wp_back/wp-content/plugins/wp-smushit/app/assets/js/smush-admin.min.js.map
2024-05-20 15:37:46 +03:00

1 line
1.0 MiB

{"version":3,"file":"js/smush-admin.min.js","mappings":"4GACO,IAAMA,EACL,CACNC,6BAA4B,WACpBC,cAAcC,6BAGrBC,SAASC,QAAQC,0BAA2BJ,cAAcC,4BAC3D,EACAI,oCAAmC,WAClC,IAAMC,EAAYC,SAASC,cAAe,wBACrCF,IACJA,EAAUE,cAAe,KAAMC,UAAYT,cAAcU,wBACzDJ,EAAUK,UAAUC,OAAQ,cAE9B,EACAC,wCAAuC,WACtC,IAAMP,EAAYC,SAASC,cAAe,wBACrCF,IACJA,EAAUE,cAAe,KAAMC,UAAYT,cAAcc,uBACzDR,EAAUK,UAAUC,OAAQ,cAE9B,GAGWG,EAAgB,WAC5B,IAAMC,EAAIT,SAASC,cAAcS,KAAMV,UACjCW,EAAeF,EAAG,8BACxB,IAAOE,EACN,MAAO,CAAC,EAGT,IAAIC,EAAUC,OAAOC,gBAAgBC,SACjCC,EAAc,CACjBC,aAAc,EACdC,YAAa,EACbC,aAAc,EACdC,cAAe,EACfC,cAAe,EACfC,cAAe,EACfC,eAAgB,EAChBC,WAAY,EACZC,YAAa,EACbC,gBAAiB,EACjBC,cAAe,sBACfC,eAAgB,EAChBC,kBAAmB,EACnBC,gBAAiB,EACjBC,YAAa,GACbC,yBAA0B,GAC1BC,mBAAoB,GAGfC,EAAazB,EAAG,sBAChB0B,EAAU1B,EAAG,uCACb2B,EAAwB3B,EAAG,0BAC7B4B,EAAY,CAAC,EAEXC,EAAmC,SAAEC,GAC1C1B,OAAOC,gBAAkB0B,OAAOC,OAAQ5B,OAAOC,gBAAiByB,GAAmB,CAAC,GACpFvB,EAAcwB,OAAOE,KAAM1B,GAAc2B,QAAQ,SAAUC,EAAUC,GAIpE,OAHKA,KAAOhC,OAAOC,kBAClB8B,EAAUC,GAAQhC,OAAOC,gBAAiB+B,IAEpCD,CACR,GAAG,CAAC,EACL,EAIA,OA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AAQ,GACVyqC,EAAO9xB,WAAU8xB,EAAO9xB,SAAW,IACjC8xB,CACR,E,wBCEA,IAAM5wD,EAAWA,GAAY,CAAC,EAC9BkB,OAAOlB,SAAWA,EAYXw1C,OAAOlpB,UAAU3P,WACvB64B,OAAOlpB,UAAU3P,SAAW,SAAUrI,EAAQ7M,GAK7C,MAJsB,iBAAVA,IACXA,EAAQ,KAGJA,EAAQ6M,EAAOvP,OAASxB,KAAKwB,UAGQ,IAAnCxB,KAAKgR,QAASD,EAAQ7M,EAC9B,GAGD6tD,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MAaTA,EAAS,I","sources":["webpack://wp-smushit/./_src/js/common/globalStats.js","webpack://wp-smushit/./_src/js/common/media-library-scanner.js","webpack://wp-smushit/./_src/js/common/progressbar.js","webpack://wp-smushit/./_src/js/mixpanel.js","webpack://wp-smushit/./_src/js/modules/admin-common.js","webpack://wp-smushit/./_src/js/modules/admin.js","webpack://wp-smushit/./_src/js/modules/background-process.js","webpack://wp-smushit/./_src/js/modules/bulk-restore.js","webpack://wp-smushit/./_src/js/modules/bulk-smush.js","webpack://wp-smushit/./_src/js/modules/directory-smush.js","webpack://wp-smushit/./_src/js/smush/directory-scanner.js","webpack://wp-smushit/./_src/js/modules/helpers.js","webpack://wp-smushit/./_src/js/modules/media-library-scanner-on-bulk-smush.js","webpack://wp-smushit/./_src/js/modules/media-library-scanner-on-dashboard.js","webpack://wp-smushit/./_src/js/modules/nextgen-bulk.js","webpack://wp-smushit/./_src/js/modules/notice.js","webpack://wp-smushit/./_src/js/modules/onboarding.js","webpack://wp-smushit/./_src/js/smush/cdn.js","webpack://wp-smushit/./_src/js/smush/lazy-load.js","webpack://wp-smushit/./_src/js/smush/product-analytics.js","webpack://wp-smushit/./_src/js/smush/settings.js","webpack://wp-smushit/./_src/js/smush/smush.js","webpack://wp-smushit/./_src/js/smush/webp.js","webpack://wp-smushit/./_src/js/utils/fetcher.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.ui-deps.js","webpack://wp-smushit/./node_modules/lodash/_Symbol.js","webpack://wp-smushit/./node_modules/lodash/_apply.js","webpack://wp-smushit/./node_modules/lodash/_arrayLikeKeys.js","webpack://wp-smushit/./node_modules/lodash/_assignValue.js","webpack://wp-smushit/./node_modules/lodash/_baseAssignValue.js","webpack://wp-smushit/./node_modules/lodash/_baseGetTag.js","webpack://wp-smushit/./node_modules/lodash/_baseIsArguments.js","webpack://wp-smushit/./node_modules/lodash/_baseIsNative.js","webpack://wp-smushit/./node_modules/lodash/_baseIsTypedArray.js","webpack://wp-smushit/./node_modules/lodash/_baseKeys.js","webpack://wp-smushit/./node_modules/lodash/_baseRest.js","webpack://wp-smushit/./node_modules/lodash/_baseSetToString.js","webpack://wp-smushit/./node_modules/lodash/_baseTimes.js","webpack://wp-smushit/./node_modules/lodash/_baseUnary.js","webpack://wp-smushit/./node_modules/lodash/_copyObject.js","webpack://wp-smushit/./node_modules/lodash/_coreJsData.js","webpack://wp-smushit/./node_modules/lodash/_createAssigner.js","webpack://wp-smushit/./node_modules/lodash/_defineProperty.js","webpack://wp-smushit/./node_modules/lodash/_freeGlobal.js","webpack://wp-smushit/./node_modules/lodash/_getNative.js","webpack://wp-smushit/./node_modules/lodash/_getRawTag.js","webpack://wp-smushit/./node_modules/lodash/_getValue.js","webpack://wp-smushit/./node_modules/lodash/_isIndex.js","webpack://wp-smushit/./node_modules/lodash/_isIterateeCall.js","webpack://wp-smushit/./node_modules/lodash/_isMasked.js","webpack://wp-smushit/./node_modules/lodash/_isPrototype.js","webpack://wp-smushit/./node_modules/lodash/_nativeKeys.js","webpack://wp-smushit/./node_modules/lodash/_nodeUtil.js","webpack://wp-smushit/./node_modules/lodash/_objectToString.js","webpack://wp-smushit/./node_modules/lodash/_overArg.js","webpack://wp-smushit/./node_modules/lodash/_overRest.js","webpack://wp-smushit/./node_modules/lodash/_root.js","webpack://wp-smushit/./node_modules/lodash/_setToString.js","webpack://wp-smushit/./node_modules/lodash/_shortOut.js","webpack://wp-smushit/./node_modules/lodash/_toSource.js","webpack://wp-smushit/./node_modules/lodash/assign.js","webpack://wp-smushit/./node_modules/lodash/constant.js","webpack://wp-smushit/./node_modules/lodash/eq.js","webpack://wp-smushit/./node_modules/lodash/identity.js","webpack://wp-smushit/./node_modules/lodash/isArguments.js","webpack://wp-smushit/./node_modules/lodash/isArray.js","webpack://wp-smushit/./node_modules/lodash/isArrayLike.js","webpack://wp-smushit/./node_modules/lodash/isBuffer.js","webpack://wp-smushit/./node_modules/lodash/isFunction.js","webpack://wp-smushit/./node_modules/lodash/isLength.js","webpack://wp-smushit/./node_modules/lodash/isObject.js","webpack://wp-smushit/./node_modules/lodash/isObjectLike.js","webpack://wp-smushit/./node_modules/lodash/isTypedArray.js","webpack://wp-smushit/./node_modules/lodash/keys.js","webpack://wp-smushit/./node_modules/lodash/stubFalse.js","webpack://wp-smushit/./node_modules/mixpanel-browser/dist/mixpanel.cjs.js","webpack://wp-smushit/external var \"jQuery\"","webpack://wp-smushit/webpack/bootstrap","webpack://wp-smushit/webpack/runtime/compat get default export","webpack://wp-smushit/webpack/runtime/define property getters","webpack://wp-smushit/webpack/runtime/global","webpack://wp-smushit/webpack/runtime/hasOwnProperty shorthand","webpack://wp-smushit/webpack/runtime/make namespace object","webpack://wp-smushit/webpack/runtime/node module decorator","webpack://wp-smushit/./_src/js/app.js"],"sourcesContent":["/* global WP_Smush */\nexport const UpsellManger = ( () => {\n\treturn {\n\t\tmaybeShowCDNActivationNotice() {\n\t\t\tif ( ! wp_smush_msgs.smush_cdn_activation_notice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tWP_Smush.helpers.renderActivationCDNNotice( wp_smush_msgs.smush_cdn_activation_notice );\n\t\t},\n\t\tmaybeShowCDNUpsellForPreSiteOnStart() {\n\t\t\tconst upsellCdn = document.querySelector( '.wp-smush-upsell-cdn' );\n\t\t\tif ( upsellCdn ) {\n\t\t\t\tupsellCdn.querySelector( 'p' ).innerHTML = wp_smush_msgs.processing_cdn_for_free;\n\t\t\t\tupsellCdn.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t\tmaybeShowCDNUpsellForPreSiteOnCompleted() {\n\t\t\tconst upsellCdn = document.querySelector( '.wp-smush-upsell-cdn' );\n\t\t\tif ( upsellCdn ) {\n\t\t\t\tupsellCdn.querySelector( 'p' ).innerHTML = wp_smush_msgs.processed_cdn_for_free;\n\t\t\t\tupsellCdn.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\t};\n} )();\nexport const GlobalStats = ( () => {\n\tconst $ = document.querySelector.bind( document );\n\tconst summarySmush = $( '.sui-summary-smush-metabox' );\n\tif ( ! summarySmush ) {\n\t\treturn {};\n\t}\n\t// Cache initial stats.\n\tlet boStats = window.wp_smushit_data.bo_stats;\n\tlet globalStats = {\n\t\tcount_images: 0,\n\t\tcount_total: 0,\n\t\tcount_resize: 0,\n\t\tcount_skipped: 0,\n\t\tcount_smushed: 0,\n\t\tsavings_bytes: 0,\n\t\tsavings_resize: 0,\n\t\tsize_after: 0,\n\t\tsize_before: 0,\n\t\tsavings_percent: 0,\n\t\tpercent_grade: 'sui-grade-dismissed',\n\t\tpercent_metric: 0,\n\t\tpercent_optimized: 0,\n\t\tremaining_count: 0,\n\t\thuman_bytes: '',\n\t\tsavings_conversion_human: '',\n\t\tsavings_conversion: 0,\n\t};\n\n\tconst imageScore = $( '#smush-image-score' );\n\tconst logBulk = $( '.smush-final-log .smush-bulk-errors' );\n\tconst bulkSmushCountContent = $( '#wp-smush-bulk-content' );\n\tlet allErrors = {};\n\n\tconst generateGlobalStatsFromSmushData = ( smushScriptData ) => {\n\t\twindow.wp_smushit_data = Object.assign( window.wp_smushit_data, smushScriptData || {} );\n\t\tglobalStats = Object.keys( globalStats ).reduce( function( newStats, key ) {\n\t\t\tif ( key in window.wp_smushit_data ) {\n\t\t\t\tnewStats[ key ] = window.wp_smushit_data[ key ];\n\t\t\t}\n\t\t\treturn newStats;\n\t\t}, {} );\n\t}\n\n\tgenerateGlobalStatsFromSmushData( window.wp_smushit_data );\n\n\treturn {\n\t\tisChangedStats( newBoStats ) {\n\t\t\tconst primaryKeys = [ 'total_items', 'processed_items', 'failed_items', 'is_cancelled', 'is_completed' ];\n\t\t\treturn primaryKeys.some( ( key ) => {\n\t\t\t\treturn newBoStats[ key ] !== boStats[ key ];\n\t\t\t} );\n\t\t},\n\t\tsetBoStats( newBoStats ) {\n\t\t\tboStats = Object.assign( boStats, newBoStats || {} );\n\t\t\treturn this;\n\t\t},\n\t\tgetBoStats() {\n\t\t\treturn boStats;\n\t\t},\n\t\tsetGlobalStats( newGlobalStats ) {\n\t\t\tglobalStats = Object.assign( globalStats, newGlobalStats || {} );\n\t\t\treturn this;\n\t\t},\n\t\tgetGlobalStats() {\n\t\t\treturn globalStats;\n\t\t},\n\t\t/**\n\t\t * Circle progress bar.\n\t\t */\n\t\trenderScoreProgress() {\n\t\t\timageScore.className = imageScore.className.replace( /(^|\\s)sui-grade-\\S+/g, '' );\n\t\t\timageScore.classList.add( globalStats.percent_grade );\n\t\t\timageScore.dataset.score = globalStats.percent_optimized;\n\t\t\timageScore.querySelector( '.sui-circle-score-label' ).innerHTML = globalStats.percent_optimized;\n\n\t\t\timageScore\n\t\t\t\t.querySelector( 'circle:last-child' )\n\t\t\t\t.setAttribute( 'style', '--metric-array:' + ( 2.63893782902 * globalStats.percent_metric ) + ' ' + ( 263.893782902 - globalStats.percent_metric ) );\n\t\t},\n\t\t/**\n\t\t * Summary detail - center meta box.\n\t\t */\n\t\trenderSummaryDetail() {\n\t\t\tthis.renderTotalStats();\n\t\t\tthis.renderResizedStats();\n\t\t\tthis.renderConversionSavings();\n\t\t},\n\t\trenderTotalStats() {\n\t\t\t// Total savings.\n\t\t\tsummarySmush.querySelector( '.sui-summary-large.wp-smush-stats-human' ).innerHTML = globalStats.human_bytes;\n\t\t\t// Update the savings percent.\n\t\t\tsummarySmush.querySelector( '.wp-smush-savings .wp-smush-stats-percent' ).innerHTML = globalStats.savings_percent;\n\t\t\t// To total smushed images files.\n\t\t\tsummarySmush.querySelector( '.wp-smush-count-total .wp-smush-total-optimised' ).innerHTML = globalStats.count_images;\n\t\t},\n\t\trenderResizedStats() {\n\t\t\tconst resizeCountElement = summarySmush.querySelector( '.wp-smush-count-resize-total' );\n\t\t\tif ( ! resizeCountElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( globalStats.count_resize > 0 ) {\n\t\t\t\tresizeCountElement.classList.remove( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tresizeCountElement.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t\tresizeCountElement.querySelector( '.wp-smush-total-optimised' ).innerHTML = globalStats.count_resize;\n\t\t},\n\t\trenderConversionSavings() {\n\t\t\t// PNG2JPG Savings.\n\t\t\tconst conversionSavingsElement = summarySmush.querySelector( '.smush-conversion-savings .wp-smush-stats' );\n\t\t\tif ( ! conversionSavingsElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconversionSavingsElement.innerHTML = globalStats.savings_conversion_human;\n\t\t\tif ( globalStats.savings_conversion > 0 ) {\n\t\t\t\tconversionSavingsElement.parentElement.classList.remove( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tconversionSavingsElement.parentElement.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t\trenderBoxSummary() {\n\t\t\t// Circle core progress.\n\t\t\tthis.renderScoreProgress();\n\t\t\t// Summary detail.\n\t\t\tthis.renderSummaryDetail();\n\t\t},\n\t\tsetErrors( newErrors ) {\n\t\t\tallErrors = newErrors || {};\n\t\t},\n\t\tgetErrors() {\n\t\t\treturn allErrors;\n\t\t},\n\t\trenderErrors() {\n\t\t\tif ( ! Object.keys( allErrors ).length || ! boStats.is_completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst errors = [];\n\t\t\tconst errorKeys = Object.keys( allErrors );\n\t\t\t// Cache error code to avoid double upsell notice.\n\t\t\tlet showAnimatedUpsell = false;\n\t\t\terrorKeys.map( ( image_id, index ) => {\n\t\t\t\tconst upsellErrorCode = allErrors[ image_id ].error_code;\n\t\t\t\tif ( index < 5 && 'animated' === upsellErrorCode ) {\n\t\t\t\t\tshowAnimatedUpsell = true;\n\t\t\t\t}\n\t\t\t\terrors.push( WP_Smush.helpers.prepareBulkSmushErrorRow(\n\t\t\t\t\tallErrors[ image_id ].error_message,\n\t\t\t\t\tallErrors[ image_id ].file_name,\n\t\t\t\t\tallErrors[ image_id ].thumbnail,\n\t\t\t\t\timage_id,\n\t\t\t\t\t'media',\n\t\t\t\t\tallErrors[ image_id ].error_code,\n\t\t\t\t) );\n\t\t\t}\n\t\t\t);\n\t\t\tlogBulk.innerHTML = errors.join( '' );\n\t\t\tlogBulk.parentElement.classList.remove( 'sui-hidden' );\n\t\t\tlogBulk.parentElement.style.display = null;\n\t\t\t// Show view all.\n\t\t\tif ( errorKeys.length > 1 ) {\n\t\t\t\t$( '.smush-bulk-errors-actions' ).classList.remove( 'sui-hidden' );\n\t\t\t}\n\n\t\t\t// Show animated upsell CDN if user disabled CDN and found an animated error in first 5 errors.\n\t\t\tif ( showAnimatedUpsell ) {\n\t\t\t\tUpsellManger.maybeShowCDNActivationNotice();\n\t\t\t}\n\t\t},\n\t\tresetAndHideBulkErrors() {\n\t\t\tif ( ! logBulk ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.resetErrors();\n\t\t\tlogBulk.parentElement.classList.add( 'sui-hidden' );\n\t\t\tlogBulk.innerHTML = '';\n\t\t},\n\t\tresetErrors() {\n\t\t\tallErrors = {};\n\t\t},\n\t\trenderStats() {\n\t\t\t// Render Smush box summary.\n\t\t\tthis.renderBoxSummary();\n\t\t\t// Render Errors.\n\t\t\tthis.renderErrors();\n\t\t},\n\t\tmaybeUpdateBulkSmushCountContent( newContent ) {\n\t\t\tif ( newContent && bulkSmushCountContent ) {\n\t\t\t\tbulkSmushCountContent.innerHTML = newContent;\n\t\t\t}\n\t\t},\n\t\tupdateGlobalStatsFromSmushScriptData( smushScriptData ) {\n\t\t\tthis.maybeUpdateBulkSmushCountContent( smushScriptData?.content );\n\t\t\tgenerateGlobalStatsFromSmushData( smushScriptData );\n\t\t\treturn this;\n\t\t},\n\t};\n} )();\n","/* global WP_Smush */\n\n/**\n * Abstract Media Library Scanner.\n *\n */\nimport Fetcher from '../utils/fetcher';\nimport { scanProgressBar } from './progressbar';\nimport { GlobalStats } from './globalStats';\nconst { __ } = wp.i18n;\nexport default class MediaLibraryScanner {\n\tconstructor() {\n\t\tthis.autoSyncDuration = 1500;\n\t\tthis.progressTimeoutId = 0;\n\t\tthis.scanProgress = scanProgressBar( this.autoSyncDuration );\n\t}\n\n\tstartScan( optimizeOnScanCompleted = false ) {\n\t\tthis.onStart();\n\t\treturn Fetcher.scanMediaLibrary.start( optimizeOnScanCompleted ).then( ( response ) => {\n\t\t\tif ( ! response?.success ) {\n\t\t\t\tthis.onStartFailure( response );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showProgressBar().autoSyncStatus();\n\t\t} );\n\t}\n\n\tonStart() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tonStartFailure( response ) {\n\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\tshowdismiss: true,\n\t\t\tautoclose: false,\n\t\t} );\n\t}\n\n\tshowProgressBar() {\n\t\tthis.onShowProgressBar();\n\t\tthis.scanProgress.reset().setOnCancelCallback( this.showStopScanningModal.bind( this ) ).open();\n\t\treturn this;\n\t}\n\n\tonShowProgressBar() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tshowStopScanningModal() {\n\t\tif ( ! window.SUI ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onShowStopScanningModal();\n\n\t\twindow.SUI.openModal(\n\t\t\t'smush-stop-scanning-dialog',\n\t\t\t'wpbody-content',\n\t\t\tundefined,\n\t\t\tfalse\n\t\t);\n\t}\n\n\tonShowStopScanningModal() {\n\t\tthis.registerCancelProcessEvent();\n\t}\n\n\tregisterCancelProcessEvent() {\n\t\tconst stopScanButton = document.querySelector( '.smush-stop-scanning-dialog-button' );\n\t\tif ( ! stopScanButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\tstopScanButton.addEventListener( 'click', this.cancelProgress.bind( this ) );\n\t}\n\n\tcloseStopScanningModal() {\n\t\tif ( ! window.SUI ) {\n\t\t\treturn;\n\t\t}\n\t\tconst stopScanningElement = document.querySelector( '#smush-stop-scanning-dialog' );\n\t\tconst isModalClosed = ( ! stopScanningElement ) || ! stopScanningElement.classList.contains( 'sui-content-fade-in' );\n\t\tif ( isModalClosed ) {\n\t\t\treturn;\n\t\t}\n\t\twindow.SUI.closeModal( 'smush-stop-scanning-dialog' );\n\t}\n\n\tcloseProgressBar() {\n\t\tthis.onCloseProgressBar();\n\t\tthis.scanProgress.close();\n\t}\n\n\tonCloseProgressBar() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tupdateProgress( stats ) {\n\t\tconst totalItems = this.getTotalItems( stats );\n\t\tconst processedItems = this.getProcessedItems( stats );\n\n\t\treturn this.scanProgress.update( processedItems, totalItems );\n\t}\n\n\tgetProcessedItems( stats ) {\n\t\treturn stats?.processed_items || 0;\n\t}\n\n\tgetTotalItems( stats ) {\n\t\treturn stats?.total_items || 0;\n\t}\n\n\tcancelProgress() {\n\t\tthis.scanProgress.setCancelButtonOnCancelling();\n\t\treturn Fetcher.scanMediaLibrary.cancel().then( ( response ) => {\n\t\t\tif ( ! response?.success ) {\n\t\t\t\tthis.onCancelFailure( response );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.onCancelled( response.data );\n\t\t} );\n\t}\n\n\tonCancelFailure( response ) {\n\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\tshowdismiss: true,\n\t\t\tautoclose: false,\n\t\t} );\n\t\tthis.scanProgress.resetCancelButtonOnFailure();\n\t}\n\n\tgetErrorProgressMessage() {\n\t\treturn __( 'Unfortunately the scan hit an error due to limited resources on your site, we have adjusted the scan to use fewer resources the next time.', 'wp-smushit' );\n\t}\n\n\tonDead( stats ) {\n\t\tthis.clearProgressTimeout();\n\t\tthis.closeProgressBar();\n\t\tthis.closeStopScanningModal();\n\t\tthis.showRetryScanModal();\n\t}\n\n\tshowRetryScanModal() {\n\t\tconst retryScanModalElement = document.getElementById( 'smush-retry-scan-notice' );\n\t\tif ( ! window.SUI || ! retryScanModalElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tretryScanModalElement.querySelector('.smush-retry-scan-notice-button').onclick = (e) => {\n\t\t\twindow.SUI.closeModal( 'smush-retry-scan-notice' );\n\t\t\tconst recheckImagesBtn = document.querySelector( '.wp-smush-scan' );\n\t\t\tif ( ! recheckImagesBtn ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\t\t\trecheckImagesBtn.click();\n\t\t}\n\n\t\twindow.SUI.openModal(\n\t\t\t'smush-retry-scan-notice',\n\t\t\t'wpbody-content',\n\t\t\tundefined,\n\t\t\tfalse\n\t\t);\n\t}\n\n\tonCompleted( stats ) {\n\t\tthis.onFinish( stats );\n\t}\n\n\tonCancelled( stats ) {\n\t\tthis.onFinish( stats );\n\t}\n\n\tonFinish( stats ) {\n\t\tthis.clearProgressTimeout();\n\t\tconst globalStats = stats?.global_stats;\n\t\tthis.updateGlobalStatsAndBulkContent( globalStats );\n\t\tthis.closeProgressBar();\n\t\tthis.closeStopScanningModal();\n\t}\n\n\tclearProgressTimeout() {\n\t\tif ( this.progressTimeoutId ) {\n\t\t\tclearTimeout( this.progressTimeoutId );\n\t\t}\n\t}\n\n\tupdateGlobalStatsAndBulkContent( globalStats ) {\n\t\tif ( ! globalStats ) {\n\t\t\treturn;\n\t\t}\n\t\tGlobalStats.updateGlobalStatsFromSmushScriptData( globalStats );\n\t\tGlobalStats.renderStats();\n\t}\n\n\tgetStatus() {\n\t\treturn Fetcher.scanMediaLibrary.getScanStatus();\n\t}\n\n\tautoSyncStatus() {\n\t\tconst startTime = new Date().getTime();\n\t\tthis.getStatus().then( ( response ) => {\n\t\t\tif ( ! response?.success ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst stats = response.data;\n\n\t\t\tif ( stats.is_dead ) {\n\t\t\t\tthis.onDead( response.data );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.beforeUpdateStatus( stats );\n\n\t\t\tthis.updateProgress( stats ).then( () => {\n\t\t\t\tthis.scanProgress.increaseDurationToHaveChangeOnProgress( new Date().getTime() - startTime );\n\n\t\t\t\tconst isCompleted = stats?.is_completed;\n\t\t\t\tif ( isCompleted ) {\n\t\t\t\t\tthis.onCompleted( stats );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst isCancelled = stats?.is_cancelled;\n\t\t\t\tif ( isCancelled ) {\n\t\t\t\t\tthis.onCancelled( stats );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.progressTimeoutId = setTimeout( () => this.autoSyncStatus(), this.autoSyncDuration );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tbeforeUpdateStatus() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tsetInnerText( element, newText ) {\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.dataset.originalText = element.dataset.originalText || element.innerText.trim();\n\t\telement.innerText = newText;\n\t}\n\n\trevertInnerText( element ) {\n\t\tif ( ! element || ! element.dataset.originalText ) {\n\t\t\treturn;\n\t\t}\n\t\telement.innerText = element.dataset.originalText.trim();\n\t}\n\n\thideAnElement( element ) {\n\t\tif ( element ) {\n\t\t\telement.classList.add( 'sui-hidden' );\n\t\t}\n\t}\n\n\tshowAnElement( element ) {\n\t\tif ( element ) {\n\t\t\telement.classList.remove( 'sui-hidden' );\n\t\t}\n\t}\n}\n","/* global WP_Smush */\n\n/**\n * SmushProgressBar\n * TODO: Update progressbar for free version.\n *\n * @param autoSyncDuration\n */\nexport const scanProgressBar = ( autoSyncDuration ) => {\n\tconst { __, _n } = wp.i18n;\n\tconst scanProgressBar = document.querySelector( '.wp-smush-scan-progress-bar-wrapper' );\n\tconst percentElement = scanProgressBar.querySelector( '.wp-smush-progress-percent' );\n\tconst progressElement = scanProgressBar.querySelector( '.wp-smush-progress-inner' );\n\tconst remainingTimeElement = scanProgressBar.querySelector( '.wp-smush-remaining-time' );\n\tconst cancelBtn = scanProgressBar.querySelector( '.wp-smush-cancel-scan-progress-btn' );\n\tconst holdOnNoticeElement = scanProgressBar.querySelector( '.wp-smush-scan-hold-on-notice' );\n\tlet onCancelCallback = () => {};\n\tlet intervalProgressAnimation = 0;\n\t// It should be smaller than autoSyncDuration.\n\tconst progressTransitionDuration = autoSyncDuration - 300;//1200\n\tscanProgressBar.style.setProperty( '--progress-transition-duration', progressTransitionDuration / 1000 + 's' );\n\n\tlet prevProcessedItems = window.wp_smushit_data?.media_library_scan?.processed_items || 0;\n\tconst cacheProcessTimePerItem = [];\n\tlet durationToHaveChangeOnProgress = autoSyncDuration;\n\tlet timeLimitToShowNotice = autoSyncDuration * 10;// 15s.\n\treturn {\n\t\tupdate( processedItems, totalItems ) {\n\t\t\tthis.updateRemainingTime( processedItems, totalItems );\n\n\t\t\tlet width = ( totalItems && Math.floor( processedItems / totalItems * 100 ) ) || 0;\n\t\t\twidth = Math.min( width, 100 );\n\n\t\t\tlet currentWidth = progressElement.style.width;\n\t\t\tcurrentWidth = ( currentWidth && currentWidth.replace( '%', '' ) ) || 0;\n\t\t\tprogressElement.style.width = width + '%';\n\n\t\t\treturn this.animateProgressBar( currentWidth, width );\n\t\t},\n\t\tanimateProgressBar( currentWidth, width ) {\n\t\t\tif ( intervalProgressAnimation ) {\n\t\t\t\tclearInterval( intervalProgressAnimation );\n\t\t\t}\n\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\tconst delayTime = progressTransitionDuration / ( width - currentWidth );\n\t\t\t\tintervalProgressAnimation = setInterval( () => {\n\t\t\t\t\t// Progress bar label.\n\t\t\t\t\tpercentElement.innerHTML = currentWidth + '%';\n\t\t\t\t\tcurrentWidth++;\n\t\t\t\t\tif ( currentWidth > width ) {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t\tclearInterval( intervalProgressAnimation );\n\t\t\t\t\t}\n\t\t\t\t}, delayTime );\n\t\t\t} );\n\t\t},\n\t\tupdateRemainingTime( processedItems, totalItems ) {\n\t\t\tif ( ! remainingTimeElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst processTimePerItem = this.calcProcessTimePerItem( processedItems ) || 500;\n\t\t\tconst remainingTime = processTimePerItem * ( totalItems - processedItems );\n\t\t\tremainingTimeElement.innerText = this.formatTime( remainingTime );\n\t\t},\n\t\tcalcProcessTimePerItem( processedItems ) {\n\t\t\tif ( ! processedItems ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprevProcessedItems = prevProcessedItems <= processedItems ? prevProcessedItems : 0;\n\t\t\tif ( prevProcessedItems != processedItems ) {\n\t\t\t\tconst processTimePerItem = Math.floor( durationToHaveChangeOnProgress / ( processedItems - prevProcessedItems ) );\n\n\t\t\t\tprevProcessedItems = processedItems;\n\t\t\t\tcacheProcessTimePerItem.push( processTimePerItem );\n\t\t\t\tthis.resetDurationToHaveChangeOnProgress();\n\t\t\t} else {\n\t\t\t\tthis.increaseDurationToHaveChangeOnProgress( autoSyncDuration );\n\t\t\t}\n\n\t\t\tif ( ! cacheProcessTimePerItem.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn cacheProcessTimePerItem.reduce(\n\t\t\t\t( accumulator, processTime ) => accumulator + processTime, 0\n\t\t\t) / cacheProcessTimePerItem.length;\n\t\t},\n\t\tincreaseDurationToHaveChangeOnProgress( increaseTime ) {\n\t\t\tdurationToHaveChangeOnProgress += increaseTime;\n\t\t\tif ( durationToHaveChangeOnProgress > timeLimitToShowNotice ) {\n\t\t\t\tthis.showHoldOnNotice();\n\t\t\t}\n\t\t},\n\t\tshowHoldOnNotice() {\n\t\t\tholdOnNoticeElement.classList.remove( 'sui-hidden' );\n\t\t\ttimeLimitToShowNotice = 100000000;\n\t\t},\n\t\tresetHoldOnNoticeVisibility() {\n\t\t\tholdOnNoticeElement.classList.add( 'sui-hidden' );\n\t\t},\n\t\tresetDurationToHaveChangeOnProgress() {\n\t\t\tdurationToHaveChangeOnProgress = autoSyncDuration;\n\t\t},\n\t\tformatTime( totalMilliSeconds ) {\n\t\t\tconst totalSeconds = Math.floor( ( totalMilliSeconds + progressTransitionDuration ) / 1000 );\n\t\t\tconst seconds = totalSeconds % 60;\n\t\t\tconst minutes = Math.floor( totalSeconds / 60 );\n\n\t\t\tlet timeString = '';\n\t\t\tif ( minutes ) {\n\t\t\t\ttimeString += minutes + ' ' + _n( 'minute', 'minutes', minutes, 'wp-smushit' );\n\t\t\t}\n\n\t\t\ttimeString += ' ' + seconds + ' ' + _n( 'second', 'seconds', seconds, 'wp-smushit' );\n\n\t\t\treturn timeString.trim();\n\t\t},\n\t\treset() {\n\t\t\tprogressElement.style.width = '0%';\n\t\t\tpercentElement.innerHTML = '0%';\n\n\t\t\tthis.resetCancelButton();\n\t\t\tthis.resetHoldOnNoticeVisibility();\n\t\t\treturn this;\n\t\t},\n\t\topen() {\n\t\t\tcancelBtn.onclick = onCancelCallback;\n\t\t\tscanProgressBar.classList.remove( 'sui-hidden' );\n\t\t},\n\t\tclose() {\n\t\t\tscanProgressBar.classList.add( 'sui-hidden' );\n\t\t\tthis.reset();\n\t\t},\n\t\tsetOnCancelCallback( callBack ) {\n\t\t\tif ( 'function' !== typeof callBack ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonCancelCallback = callBack;\n\t\t\treturn this;\n\t\t},\n\t\tsetCancelButtonLabel( textContent ) {\n\t\t\tcancelBtn.textContent = textContent;\n\t\t\treturn this;\n\t\t},\n\t\tsetCancelButtonOnCancelling() {\n\t\t\tthis.setCancelButtonLabel( wp_smush_msgs.cancelling );\n\t\t\tthis.setOnCancelCallback( () => false );\n\t\t\tcancelBtn.setAttribute( 'disabled', true );\n\t\t},\n\t\tresetCancelButton() {\n\t\t\tthis.setOnCancelCallback( () => {} );\n\t\t\tthis.resetCancelButtonLabel();\n\t\t\tcancelBtn.removeAttribute( 'disabled' );\n\t\t},\n\t\tresetCancelButtonLabel() {\n\t\t\tthis.setCancelButtonLabel( __( 'Cancel Scan', 'wp-smushit' ) );\n\t\t},\n\t\tresetCancelButtonOnFailure() {\n\t\t\tthis.resetCancelButtonLabel();\n\t\t\tcancelBtn.removeAttribute( 'disabled' );\n\t\t}\n\t};\n};\n\nconst SmushProgressBar = () => {\n\t'use strict';\n\tconst progressBar = document.querySelector( '.wp-smush-bulk-progress-bar-wrapper' );\n\tif ( ! progressBar ) {\n\t\treturn {\n\t\t\tisEmptyObject: true,\n\t\t};\n\t}\n\tconst cancelBtn = progressBar.querySelector( '.wp-smush-cancel-btn' );\n\tconst bulkSmushDescription = document.querySelector( '.wp-smush-bulk-wrapper' );\n\tconst bulkRunningNotice = progressBar.querySelector( '#wp-smush-running-notice' );\n\tconst bulkSmushAllDone = document.querySelector( '.wp-smush-all-done' );\n\tlet isStateHidden = false;\n\tlet onCancelCallback = () => {};\n\n\treturn {\n\t\t/**\n\t\t * Update progress bar.\n\t\t *\n\t\t * @param {number} processedItems\n\t\t * @param {number} totalItems\n\t\t */\n\t\tupdate( processedItems, totalItems ) {\n\t\t\tlet width = totalItems && Math.floor( processedItems / totalItems * 100 ) || 0;\n\t\t\twidth = Math.min( width, 100 );\n\n\t\t\t// Progress bar label.\n\t\t\tprogressBar.querySelector( '.wp-smush-images-percent' ).innerHTML = width + '%';\n\t\t\t// Progress bar.\n\t\t\tprogressBar.querySelector( '.wp-smush-progress-inner' ).style.width = width + '%';\n\n\t\t\t// Update processed/total.\n\t\t\tconst processStateStats = progressBar.querySelector( '.sui-progress-state-text' );\n\t\t\tprocessStateStats.firstElementChild.innerHTML = processedItems;\n\t\t\tprocessStateStats.lastElementChild.innerHTML = totalItems;\n\n\t\t\treturn this;\n\t\t},\n\t\tclose() {\n\t\t\tprogressBar.classList.add( 'sui-hidden' );\n\t\t\tthis.setCancelButtonLabel( window.wp_smush_msgs.cancel )\n\t\t\t\t.setOnCancelCallback( () => {} )\n\t\t\t\t.update( 0, 0 );\n\t\t\tthis.resetOriginalNotice();\n\t\t\treturn this;\n\t\t},\n\t\tshow() {\n\t\t\t// Show progress bar.\n\t\t\tcancelBtn.onclick = onCancelCallback;\n\t\t\tprogressBar.classList.remove( 'sui-hidden' );\n\t\t\tthis.hideBulkSmushDescription();\n\t\t\tthis.hideBulkSmushAllDone();\n\t\t\tthis.hideRecheckImagesNotice();\n\t\t},\n\t\tsetCancelButtonLabel( textContent ) {\n\t\t\tcancelBtn.textContent = textContent;\n\t\t\treturn this;\n\t\t},\n\t\tshowBulkSmushDescription() {\n\t\t\tbulkSmushDescription.classList.remove( 'sui-hidden' );\n\t\t},\n\t\thideBulkSmushDescription() {\n\t\t\tbulkSmushDescription.classList.add( 'sui-hidden' );\n\t\t},\n\t\tshowBulkSmushAllDone() {\n\t\t\tbulkSmushAllDone.classList.remove( 'sui-hidden' );\n\t\t},\n\t\thideBulkSmushAllDone() {\n\t\t\tbulkSmushAllDone.classList.add( 'sui-hidden' );\n\t\t},\n\t\thideState() {\n\t\t\tif ( isStateHidden ) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tisStateHidden = true;\n\t\t\tprogressBar.querySelector( '.sui-progress-state' ).classList.add( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tshowState() {\n\t\t\tif ( ! isStateHidden ) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tisStateHidden = false;\n\t\t\tprogressBar.querySelector( '.sui-progress-state' ).classList.remove( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tsetNotice( inProcessNotice ) {\n\t\t\tconst progressMessage = bulkRunningNotice.querySelector( '.sui-notice-message p' );\n\t\t\tthis.cacheOriginalNotice( progressMessage );\n\t\t\tprogressMessage.innerHTML = inProcessNotice;\n\t\t\treturn this;\n\t\t},\n\t\tcacheOriginalNotice( progressMessage ) {\n\t\t\tif ( bulkRunningNotice.dataset.progressMessage ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbulkRunningNotice.dataset.progressMessage = progressMessage.innerHTML;\n\t\t},\n\t\tresetOriginalNotice() {\n\t\t\tif ( ! bulkRunningNotice.dataset.progressMessage ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst progressMessage = bulkRunningNotice.querySelector( '.sui-notice-message p' );\n\t\t\tprogressMessage.innerHTML = bulkRunningNotice.dataset.progressMessage;\n\t\t},\n\t\thideBulkProcessingNotice() {\n\t\t\tbulkRunningNotice.classList.add( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tshowBulkProcessingNotice() {\n\t\t\tbulkRunningNotice.classList.remove( 'sui-hidden' );\n\t\t\treturn this;\n\t\t},\n\t\tsetCountUnitText( unitText ) {\n\t\t\tconst progressUnit = progressBar.querySelector( '.sui-progress-state-unit' );\n\t\t\tprogressUnit.innerHTML = unitText;\n\t\t},\n\t\tsetOnCancelCallback( callBack ) {\n\t\t\tif ( 'function' !== typeof callBack ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonCancelCallback = callBack;\n\t\t\treturn this;\n\t\t},\n\t\tdisableExceedLimitMode() {\n\t\t\tprogressBar.classList.remove( 'wp-smush-exceed-limit' );\n\t\t\tprogressBar.querySelector( '#bulk-smush-resume-button' ).classList.add( 'sui-hidden' );\n\t\t},\n\t\thideRecheckImagesNotice() {\n\t\t\tconst recheckImagesNoticeElement = document.querySelector( '.wp-smush-recheck-images-notice-box' );\n\t\t\tif ( recheckImagesNoticeElement ) {\n\t\t\t\trecheckImagesNoticeElement.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\n\t};\n};\nexport default new SmushProgressBar();\n","/* global wp_smush_mixpanel */\n\nimport mixpanel from \"mixpanel-browser\";\n\nclass MixPanel {\n\tconstructor() {\n\t\t// Opt out event is not triggered via js so only initial mixpanel when it's enabled.\n\t\tthis.mixpanelInstance = this.allowToTrack() && mixpanel.init(wp_smush_mixpanel.token, {\n\t\t\topt_out_tracking_by_default: ! this.allowToTrack(),\n\t\t\tloaded: (mixpanel) => {\n\t\t\t\tmixpanel.identify(wp_smush_mixpanel.unique_id);\n\t\t\t\tmixpanel.register(wp_smush_mixpanel.super_properties);\n\n\t\t\t\tif (mixpanel.has_opted_in_tracking() !== this.allowToTrack()) {\n\t\t\t\t\t// The status cached by MixPanel in the local storage is different from the settings. Clear the cache.\n\t\t\t\t\tmixpanel.clear_opt_in_out_tracking();\n\t\t\t\t}\n\t\t\t}\n\t\t}, 'smush');\n\t}\n\n\tallowToTrack() {\n\t\treturn !! wp_smush_mixpanel.opt_in;\n\t}\n\n\ttrack(event, properties = {}) {\n\t\tif ( wp_smush_mixpanel.debug ) {\n\t\t\tconsole.log( 'Event:', event, properties );\n\t\t}\n\t\tthis.mixpanelInstance && this.mixpanelInstance.track(event, properties);\n\t}\n\n\ttrackBulkSmushCompleted( globalStats ) {\n\t\tconst {\n\t\t\tsavings_bytes,\n\t\t\tcount_images,\n\t\t\tpercent_optimized,\n\t\t\tsavings_percent,\n\t\t\tcount_resize,\n\t\t\tsavings_resize\n\t\t } = globalStats;\n\t\tthis.track('Bulk Smush Completed', {\n\t\t\t'Total Savings': this.convertToMegabytes( savings_bytes ),\n\t\t\t'Total Images': count_images,\n\t\t\t'Media Optimization Percentage': parseFloat( percent_optimized ),\n\t\t\t'Percentage of Savings': parseFloat( savings_percent ),\n\t\t\t'Images Resized': count_resize,\n\t\t\t'Resize Savings': this.convertToMegabytes( savings_resize )\n\t\t});\n\t}\n\n\ttrackBulkSmushCancel() {\n\t\tthis.track('Bulk Smush Cancelled');\n\t}\n\n\tconvertToMegabytes( sizeInBytes ) {\n\t\tconst unitMB = Math.pow( 1024, 2 );\n\t\tconst sizeInMegabytes = sizeInBytes/unitMB;\n\t\treturn sizeInMegabytes && parseFloat(sizeInMegabytes.toFixed(2)) || 0;\n\t}\n}\n\nconst mixPanelInstance = () => {\n\tlet instance;\n\treturn {\n\t\tgetInstance: () => {\n\t\t\tif ( ! instance ) {\n\t\t\t\tinstance = new MixPanel();\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\t}\n}\n\nexport default mixPanelInstance();","jQuery(function ($) {\n\t'use strict';\n\n /**\n\t * Handle the Smush Stats link click\n\t */\n $('body').on('click', 'a.smush-stats-details', function (e) {\n //If disabled\n if ($(this).prop('disabled')) {\n return false;\n }\n\n // prevent the default action\n e.preventDefault();\n //Replace the `+` with a `-`\n const slide_symbol = $(this).find('.stats-toggle');\n $(this).parents().eq(1).find('.smush-stats-wrapper').slideToggle();\n slide_symbol.text(slide_symbol.text() == '+' ? '-' : '+');\n });\n});","/* global ajaxurl */\n\nimport Smush from '../smush/smush';\nimport {GlobalStats} from \"../common/globalStats\";\nimport SmushProgress from \"../common/progressbar\";\n\nconst remove_element = function (el, timeout) {\n\tif (typeof timeout === 'undefined') {\n\t\ttimeout = 100;\n\t}\n\tel.fadeTo(timeout, 0, function () {\n\t\tel.slideUp(timeout, function () {\n\t\t\tel.remove();\n\t\t});\n\t});\n};\n\njQuery(function ($) {\n\t'use strict';\n\n\t/**\n\t * Disable the action links *\n\t *\n\t * @param c_element\n\t */\n\tconst disable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '0.5' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', true);\n\t};\n\n\t/**\n\t * Enable the Action Links *\n\t *\n\t * @param c_element\n\t */\n\tconst enable_links = function (c_element) {\n\t\tconst parent = c_element.parent();\n\n\t\t//reduce parent opacity\n\t\tparent.css({ opacity: '1' });\n\t\t//Disable Links\n\t\tparent.find('a').prop('disabled', false);\n\t};\n\n\t/**\n\t * Restore image request with a specified action for Media Library / NextGen Gallery\n\t *\n\t * @param {Object} e\n\t * @param {string} currentButton\n\t * @param {string} smushAction\n\t * @param {string} action\n\t */\n\tconst process_smush_action = function (\n\t\te,\n\t\tcurrentButton,\n\t\tsmushAction,\n\t\taction\n\t) {\n\t\te.preventDefault();\n\n\t\t// If disabled.\n\t\tif ( currentButton.attr( 'disabled' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove Error.\n\t\t$('.wp-smush-error').remove();\n\n\t\t// Hide stats.\n\t\t$('.smush-stats-wrapper').hide();\n\n\t\tlet mode = 'grid';\n\t\tif ('smush_restore_image' === smushAction) {\n\t\t\tif ($(document).find('div.media-modal.wp-core-ui').length > 0) {\n\t\t\t\tmode = 'grid';\n\t\t\t} else {\n\t\t\t\tmode =\n\t\t\t\t\twindow.location.search.indexOf('item') > -1\n\t\t\t\t\t\t? 'grid'\n\t\t\t\t\t\t: 'list';\n\t\t\t}\n\t\t}\n\n\t\t// Get the image ID and nonce.\n\t\tconst params = {\n\t\t\taction: smushAction,\n\t\t\tattachment_id: currentButton.data('id'),\n\t\t\tmode,\n\t\t\t_nonce: currentButton.data('nonce'),\n\t\t};\n\n\t\t// Reduce the opacity of stats and disable the click.\n\t\tdisable_links(currentButton);\n\n\t\tconst oldLabel = currentButton.html();\n\n\t\tcurrentButton.html(\n\t\t\t'<span class=\"spinner wp-smush-progress\">' +\n\t\t\t\twp_smush_msgs[action] +\n\t\t\t\t'</span>'\n\t\t);\n\n\t\t// Restore the image.\n\t\t$.post(ajaxurl, params, function (r) {\n\t\t\t// Reset all functionality.\n\t\t\tenable_links(currentButton);\n\n\t\t\tif (r.success && 'undefined' !== typeof r.data) {\n\t\t\t\t// Replace in immediate parent for NextGEN.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof this.data &&\n\t\t\t\t\tthis.data.indexOf('nextgen') > -1\n\t\t\t\t) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else if ('restore' === action) {\n\t\t\t\t\t// Show the smush button, and remove stats and restore option.\n\t\t\t\t\tcurrentButton.parents().eq(1).html(r.data.stats);\n\t\t\t\t} else {\n\t\t\t\t\tconst wrapper = currentButton.parents().eq(1);\n\t\t\t\t\tif ( wp_smush_msgs.failed_item_smushed && wrapper.hasClass('smush-failed-processing') ) {\n\t\t\t\t\t\twrapper.html( '<p class=\"smush-status smush-success\">' + wp_smush_msgs.failed_item_smushed + '</p>' );\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\twrapper.html( r.data );\n\t\t\t\t\t\t}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twrapper.html(r.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ('undefined' !== typeof r.data && 'restore' === action) {\n\t\t\t\t\tSmush.updateImageStats(r.data.new_size);\n\t\t\t\t}\n\t\t\t} else if (r.data && r.data.error_msg) {\n\t\t\t\tif (\n\t\t\t\t\t-1 === this.data.indexOf('nextgen')\n\t\t\t\t) {\n\t\t\t\t\tcurrentButton.closest( '.smushit' ).find('.smush-status').addClass('smush-warning').html(r.data.error_msg);\n\t\t\t\t} else {\n\t\t\t\t\t// Show error.\n\t\t\t\t\tcurrentButton.parent().append(r.data.error_msg);\n\t\t\t\t}\n\n\t\t\t\t// Reset label and disable button on error.\n\t\t\t\tcurrentButton.attr('disabled', true);\n\t\t\t\tcurrentButton.html( oldLabel );\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Validates the Resize Width and Height against the Largest Thumbnail Width and Height\n\t *\n\t * @param wrapper_div jQuery object for the whole setting row wrapper div\n\t * @param width_only Whether to validate only width\n\t * @param height_only Validate only Height\n\t * @return {boolean} All Good or not\n\t */\n\tconst validate_resize_settings = function (\n\t\twrapper_div,\n\t\twidth_only,\n\t\theight_only\n\t) {\n\t\tconst resize_checkbox = wrapper_div.find('#resize');\n\n\t\tif (!height_only) {\n\t\t\tvar width_input = wrapper_div.find('#wp-smush-resize_width');\n\t\t\tvar width_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-width'\n\t\t\t);\n\t\t}\n\t\tif (!width_only) {\n\t\t\tvar height_input = wrapper_div.find('#wp-smush-resize_height');\n\t\t\tvar height_error_note = wrapper_div.find(\n\t\t\t\t'.sui-notice-info.wp-smush-update-height'\n\t\t\t);\n\t\t}\n\n\t\tlet width_error = false;\n\t\tlet height_error = false;\n\n\t\t//If resize settings is not enabled, return true\n\t\tif (!resize_checkbox.is(':checked')) {\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check if we have localised width and height\n\t\tif (\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes ||\n\t\t\t'undefined' === typeof wp_smushit_data.resize_sizes.width\n\t\t) {\n\t\t\t//Rely on server validation\n\t\t\treturn true;\n\t\t}\n\n\t\t//Check for width\n\t\tif (\n\t\t\t!height_only &&\n\t\t\t'undefined' !== typeof width_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.width) >\n\t\t\t\tparseInt(width_input.val())\n\t\t) {\n\t\t\twidth_input.parent().addClass('sui-form-field-error');\n\t\t\twidth_error_note.show('slow');\n\t\t\twidth_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\twidth_input.parent().removeClass('sui-form-field-error');\n\t\t\twidth_error_note.hide();\n\t\t\tif (height_input.hasClass('error')) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\t//Check for height\n\t\tif (\n\t\t\t!width_only &&\n\t\t\t'undefined' !== typeof height_input &&\n\t\t\tparseInt(wp_smushit_data.resize_sizes.height) >\n\t\t\t\tparseInt(height_input.val())\n\t\t) {\n\t\t\theight_input.parent().addClass('sui-form-field-error');\n\t\t\t//If we are not showing the width error already\n\t\t\tif (!width_error) {\n\t\t\t\theight_error_note.show('slow');\n\t\t\t}\n\t\t\theight_error = true;\n\t\t} else {\n\t\t\t//Remove error class\n\t\t\theight_input.parent().removeClass('sui-form-field-error');\n\t\t\theight_error_note.hide();\n\t\t\tif (width_input.hasClass('error')) {\n\t\t\t\twidth_error_note.show('slow');\n\t\t\t}\n\t\t}\n\n\t\tif (width_error || height_error) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t};\n\n\t/**\n\t * Update the progress bar width if we have images that needs to be resmushed\n\t *\n\t * @param unsmushed_count\n\t * @return {boolean}\n\t */\n\tconst update_progress_bar_resmush = function (unsmushed_count) {\n\t\tif ('undefined' === typeof unsmushed_count) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst smushed_count = wp_smushit_data.count_total - unsmushed_count;\n\n\t\t//Update the Progress Bar Width\n\t\t// get the progress bar\n\t\tconst $progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif ($progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst width = (smushed_count / wp_smushit_data.count_total) * 100;\n\n\t\t// increase progress\n\t\t$progress_bar.css('width', width + '%');\n\t};\n\n\tconst runRecheck = function (process_settings) {\n\t\tconst button = $('.wp-smush-scan');\n\n\t\t// Add a \"loading\" state to the button.\n\t\tbutton.addClass('sui-button-onload');\n\n\t\t// Check if type is set in data attributes.\n\t\tlet scan_type = button.data('type');\n\t\tscan_type = 'undefined' === typeof scan_type ? 'media' : scan_type;\n\n\t\t// Remove the Skip resmush attribute from button.\n\t\t$('.wp-smush-all').removeAttr('data-smush');\n\n\t\t// Disable Bulk smush button and itself.\n\t\t$('.wp-smush-all').prop('disabled', true);\n\n\t\t// Hide Settings changed Notice.\n\t\t$('.wp-smush-settings-changed').hide();\n\n\t\t// Ajax params.\n\t\tconst params = {\n\t\t\taction: 'scan_for_resmush',\n\t\t\ttype: scan_type,\n\t\t\tget_ui: true,\n\t\t\tprocess_settings,\n\t\t\twp_smush_options_nonce: jQuery('#wp_smush_options_nonce').val(),\n\t\t};\n\n\t\t// Send ajax request and get ids if any.\n\t\t$.get(ajaxurl, params, function (response) {\n\t\t\tif ( ! response?.success ) {\n\t\t\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\t\t\tshowdismiss: true,\n\t\t\t\t\tautoclose: false,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst stats = response.data;\n\t\t\tshowRecheckImagesNotice( stats );\n\t\t\tGlobalStats.updateGlobalStatsFromSmushScriptData( stats );\n\t\t\tGlobalStats.renderStats();\n\t\t\tupdateBulkSmushContentAfterReCheck( stats );\n\t\t}).always(function () {\n\t\t\t// Hide the progress bar.\n\t\t\tjQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper'\n\t\t\t).addClass('sui-hidden');\n\n\t\t\t// Add check complete status to button.\n\t\t\tbutton\n\t\t\t\t.removeClass('sui-button-onload')\n\t\t\t\t.addClass('smush-button-check-success');\n\n\t\t\tconst $defaultText = button.find('.wp-smush-default-text'),\n\t\t\t\t$completedText = button.find('.wp-smush-completed-text');\n\n\t\t\t$defaultText.addClass('sui-hidden-important');\n\t\t\t$completedText.removeClass('sui-hidden');\n\n\t\t\t// Remove success message from button.\n\t\t\tsetTimeout(function () {\n\t\t\t\tbutton.removeClass('smush-button-check-success');\n\n\t\t\t\t$defaultText.removeClass('sui-hidden-important');\n\t\t\t\t$completedText.addClass('sui-hidden');\n\t\t\t}, 2000);\n\n\t\t\t$('.wp-smush-all').prop('disabled', false);\n\t\t});\n\t};\n\n\tconst showRecheckImagesNotice = ( stats ) => {\n\t\tif ( ! stats.notice ) {\n\t\t\treturn;\n\t\t}\n\t\tlet type = 'success';\n\t\tif ( 'undefined' !== typeof stats.noticeType ) {\n\t\t\ttype = stats.noticeType;\n\t\t}\n\t\twindow.SUI.openNotice(\n\t\t\t'wp-smush-ajax-notice',\n\t\t\t'<p>' + stats.notice + '</p>',\n\t\t\t{ type, icon: 'check-tick' }\n\t\t);\n\t};\n\n\tconst updateBulkSmushContentAfterReCheck = ( stats ) => {\n\t\tif ( SmushProgress.isEmptyObject ) {\n\t\t\treturn;\n\t\t}\n\n\t\tSmushProgress.update( 0, stats.remaining_count );\n\t\tif ( stats.remaining_count < 1 ) {\n\t\t\tSmushProgress.hideBulkSmushDescription();\n\t\t\tSmushProgress.showBulkSmushAllDone();\n\t\t} else {\n\t\t\tSmushProgress.showBulkSmushDescription();\n\t\t\tSmushProgress.hideBulkSmushAllDone();\n\t\t}\n\t}\n\n\tconst updateDisplayedContentAfterReCheck = function (count) {\n\t\tconst $pendingImagesWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-wrapper'\n\t\t);\n\t\tconst $allDoneWrappers = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-all-done'\n\t\t);\n\n\t\tif ($pendingImagesWrappers.length && $allDoneWrappers.length) {\n\t\t\tif (count === 0) {\n\t\t\t\t$pendingImagesWrappers.addClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.find('p').html( wp_smush_msgs.all_smushed );\n\t\t\t\t$allDoneWrappers.find('.sui-notice-icon').removeClass('sui-icon-info').addClass('sui-icon-check-tick');\n\t\t\t\t$allDoneWrappers.removeClass('sui-notice-warning').addClass('sui-notice-success');\n\t\t\t\t$allDoneWrappers.removeClass('sui-hidden');\n\t\t\t} else {\n\t\t\t\t$pendingImagesWrappers.removeClass('sui-hidden');\n\t\t\t\t$allDoneWrappers.addClass('sui-hidden');\n\n\t\t\t\t// Update texts mentioning the amount of unsmushed imagesin the summary icon tooltip.\n\t\t\t\tconst $unsmushedTooltip = jQuery(\n\t\t\t\t\t'.sui-summary-smush .sui-summary-details .sui-tooltip'\n\t\t\t\t);\n\n\t\t\t\t// The tooltip doesn't exist in the NextGen page.\n\t\t\t\tif ($unsmushedTooltip.length) {\n\t\t\t\t\tconst textForm = 1 === count ? 'singular' : 'plural',\n\t\t\t\t\t\ttooltipText = $unsmushedTooltip\n\t\t\t\t\t\t\t.data(textForm)\n\t\t\t\t\t\t\t.replace('{count}', count);\n\t\t\t\t\t$unsmushedTooltip.attr('data-tooltip', tooltipText);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Total count in the progress bar.\n\t\tjQuery('.wp-smush-total-count').text(count);\n\t};\n\n\t// Scroll the element to top of the page.\n\tconst goToByScroll = function (selector) {\n\t\t// Scroll if element found.\n\t\tif ($(selector).length > 0) {\n\t\t\t$('html, body').animate(\n\t\t\t\t{\n\t\t\t\t\tscrollTop: $(selector).offset().top - 100,\n\t\t\t\t},\n\t\t\t\t'slow'\n\t\t\t);\n\t\t}\n\t};\n\n\tconst update_cummulative_stats = function (stats) {\n\t\t//Update Directory Smush Stats\n\t\tif ('undefined' !== typeof stats.dir_smush) {\n\t\t\tconst stats_human = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-human'\n\t\t\t);\n\t\t\tconst stats_percent = $(\n\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-percent'\n\t\t\t);\n\n\t\t\t// Do not replace if 0 savings.\n\t\t\tif (stats.dir_smush.bytes > 0) {\n\t\t\t\t$('.wp-smush-dir-link').addClass('sui-hidden');\n\n\t\t\t\t// Hide selector.\n\t\t\t\t$('li.smush-dir-savings .wp-smush-stats-label-message').hide();\n\t\t\t\t//Update Savings in bytes\n\t\t\t\tif (stats_human.length > 0) {\n\t\t\t\t\tstats_human.html(stats.dir_smush.human);\n\t\t\t\t}\n\n\t\t\t\t//Percentage section\n\t\t\t\tif (stats.dir_smush.percent > 0) {\n\t\t\t\t\t// Show size and percentage separator.\n\t\t\t\t\t$(\n\t\t\t\t\t\t'li.smush-dir-savings span.wp-smush-stats span.wp-smush-stats-sep'\n\t\t\t\t\t).removeClass('sui-hidden');\n\t\t\t\t\t//Update Optimisation percentage\n\t\t\t\t\tif (stats_percent.length > 0) {\n\t\t\t\t\t\tstats_percent.html(stats.dir_smush.percent + '%');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$('.wp-smush-dir-link').removeClass('sui-hidden');\n\t\t\t}\n\t\t}\n\n\t\t//Update Combined stats\n\t\tif (\n\t\t\t'undefined' !== typeof stats.combined_stats &&\n\t\t\tstats.combined_stats.length > 0\n\t\t) {\n\t\t\tconst c_stats = stats.combined_stats;\n\n\t\t\tlet smush_percent = (c_stats.smushed / c_stats.total_count) * 100;\n\t\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t\t//Smushed Percent\n\t\t\tif (smush_percent) {\n\t\t\t\t$('div.wp-smush-count-total span.wp-smush-images-percent').html(\n\t\t\t\t\tsmush_percent\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Update Total Attachment Count\n\t\t\tif (c_stats.total_count) {\n\t\t\t\t$(\n\t\t\t\t\t'span.wp-smush-count-total span.wp-smush-total-optimised'\n\t\t\t\t).html(c_stats.total_count);\n\t\t\t}\n\t\t\t//Update Savings and Percent\n\t\t\tif (c_stats.savings) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-human').html(\n\t\t\t\t\tc_stats.savings\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (c_stats.percent) {\n\t\t\t\t$('span.wp-smush-savings span.wp-smush-stats-percent').html(\n\t\t\t\t\tc_stats.percent\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * When 'All' is selected for the Image Sizes setting, select all available sizes.\n\t *\n\t * @since 3.2.1\n\t */\n\t$('#all-image-sizes').on('change', function () {\n\t\t$('input[name^=\"wp-smush-image_sizes\"]').prop('checked', true);\n\t});\n\n\t/**\n\t * Handles the tabs navigation on mobile.\n\t *\n\t * @since 3.8.4\n\t */\n\t$('.sui-mobile-nav').on('change', (e) => {\n\t\twindow.location.assign($(e.currentTarget).val());\n\t});\n\n\t/**\n\t * Handle re-check api status button click (Settings)\n\t *\n\t * @since 3.2.0.2\n\t */\n\t$('#update-api-status').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\t//$(this).prop('disabled', true);\n\t\t$(this).addClass('sui-button-onload');\n\n\t\t$.post(ajaxurl, { action: 'recheck_api_status' }, function () {\n\t\t\tlocation.reload();\n\t\t});\n\t});\n\n\t/** Handle smush button click **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-send:not(.wp-smush-resmush)',\n\t\tfunction (e) {\n\t\t\t// prevent the default action\n\t\t\te.preventDefault();\n\t\t\tnew Smush($(this), false);\n\t\t}\n\t);\n\n\t/**\n\t * Handle show in bulk smush button click.\n\t */\n\t$( 'body' ).on( 'click', '.wp-smush-remove-skipped', function( e ) {\n\t\te.preventDefault();\n\n\t\tconst self = $( this );\n\n\t\t// Send ajax request to remove the image from the skip list.\n\t\t$.post( ajaxurl, {\n\t\t\taction: 'remove_from_skip_list',\n\t\t\tid: self.attr( 'data-id' ),\n\t\t\t_ajax_nonce: self.attr( 'data-nonce' ),\n\t\t} ).done( ( response ) => {\n\t\t\tif ( response.success && 'undefined' !== typeof response.data.html ) {\n\t\t\t\tself.parent().parent().html( response.data.html );\n\t\t\t}\n\t\t} );\n\t} );\n\t/** Restore: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-restore', function (e) {\n\t\tconst current_button = $(this);\n\t\tprocess_smush_action(\n\t\t\te,\n\t\t\tcurrent_button,\n\t\t\t'smush_restore_image',\n\t\t\t'restore'\n\t\t);\n\t});\n\n\t/** Resmush: Media Library **/\n\t$('body').on('click', '.wp-smush-action.wp-smush-resmush', function (e) {\n\t\tprocess_smush_action(e, $(this), 'smush_resmush_image', 'smushing');\n\t});\n\n\t/** Restore: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-restore',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_restore_nextgen_image',\n\t\t\t\t'restore'\n\t\t\t);\n\t\t}\n\t);\n\n\t/** Resmush: NextGen Gallery **/\n\t$('body').on(\n\t\t'click',\n\t\t'.wp-smush-action.wp-smush-nextgen-resmush',\n\t\tfunction (e) {\n\t\t\tprocess_smush_action(\n\t\t\t\te,\n\t\t\t\t$(this),\n\t\t\t\t'smush_resmush_nextgen_image',\n\t\t\t\t'smushing'\n\t\t\t);\n\t\t}\n\t);\n\n\t//Scan For resmushing images\n\t$('.wp-smush-scan').on('click', function (e) {\n\t\te.preventDefault();\n\t\tif ( $(this).hasClass('wp-smush-background-scan') ) {\n\t\t\treturn;\n\t\t}\n\t\trunRecheck(false);\n\t});\n\n\t//Remove Notice\n\t$('body').on('click', '.wp-smush-notice .icon-fi-close', function (e) {\n\t\te.preventDefault();\n\t\tconst $el = $(this).parent();\n\t\tremove_element($el);\n\t});\n\n\t// On re-Smush click.\n\t// TODO: This can be removed, but follow the logic and remove all excess code as well.\n\t$('body').on('click', '.wp-smush-skip-resmush', function (e) {\n\t\te.preventDefault();\n\n\t\tconst self = jQuery(this),\n\t\t\tcontainer = self.parents().eq(1),\n\t\t\tel = self.parent();\n\n\t\t// Remove Parent div.\n\t\tremove_element(el);\n\n\t\t// Set button attribute to skip re-smush ids.\n\t\tcontainer.find('.wp-smush-all').attr('data-smush', 'skip_resmush');\n\n\t\t// Update Smushed count.\n\t\twp_smushit_data.count_smushed =\n\t\t\tparseInt(wp_smushit_data.count_smushed) +\n\t\t\twp_smushit_data.resmush.length;\n\t\twp_smushit_data.count_supersmushed =\n\t\t\tparseInt(wp_smushit_data.count_supersmushed) +\n\t\t\twp_smushit_data.resmush.length;\n\n\t\t// Update stats.\n\t\tif (wp_smushit_data.count_smushed === wp_smushit_data.count_total) {\n\t\t\t// Show all done notice.\n\t\t\t$('.wp-smush-notice.wp-smush-all-done').removeClass('sui-hidden');\n\n\t\t\t// Hide Smush button.\n\t\t\t$('.wp-smush-bulk-wrapper ').addClass('sui-hidden');\n\t\t}\n\n\t\t// Remove re-Smush notice.\n\t\t$('.wp-smush-resmush-notice').remove();\n\n\t\tlet type = $('.wp-smush-scan').data('type');\n\t\ttype = 'undefined' === typeof type ? 'media' : type;\n\n\t\tconst smushed_count =\n\t\t\t'undefined' !== typeof wp_smushit_data.count_smushed\n\t\t\t\t? wp_smushit_data.count_smushed\n\t\t\t\t: 0;\n\n\t\tlet smush_percent = (smushed_count / wp_smushit_data.count_total) * 100;\n\t\tsmush_percent = WP_Smush.helpers.precise_round(smush_percent, 1);\n\n\t\t$('.wp-smush-images-percent').html(smush_percent);\n\n\t\t// Update the progress bar width. Get the progress bar.\n\t\tconst progress_bar = jQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-progress-inner'\n\t\t);\n\t\tif (progress_bar.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Increase progress.\n\t\tprogress_bar.css('width', smush_percent + '%');\n\n\t\t// Show the default bulk smush notice.\n\t\t$('.wp-smush-bulk-wrapper').removeClass('sui-hidden');\n\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass('sui-hidden');\n\n\t\tconst params = {\n\t\t\taction: 'delete_resmush_list',\n\t\t\ttype,\n\t\t};\n\n\t\t//Delete resmush list, @todo: update stats from the ajax response\n\t\t$.post(ajaxurl, params, function (res) {\n\t\t\t// Remove the whole li element on success\n\t\t\tif (res.success && 'undefined' !== typeof res.data.stats) {\n\t\t\t\tconst stats = res.data.stats;\n\t\t\t\t// Update wp_smushit_data ( Smushed count, Smushed Percent, Image count, Super smush count, resize savings, conversion savings )\n\t\t\t\tif ('undefined' !== typeof wp_smushit_data) {\n\t\t\t\t\twp_smushit_data.count_images =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_images\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_images) +\n\t\t\t\t\t\t\t stats.count_images\n\t\t\t\t\t\t\t: wp_smushit_data.count_images;\n\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_before\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t stats.size_before\n\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t'undefined' !== typeof stats.size_after\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t stats.size_after\n\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_resize) +\n\t\t\t\t\t\t\t stats.savings_resize\n\t\t\t\t\t\t\t: wp_smushit_data.savings_resize;\n\t\t\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t\t\t'undefined' !== typeof stats.savings_conversion\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.savings_conversion) +\n\t\t\t\t\t\t\t stats.savings_conversion\n\t\t\t\t\t\t\t: wp_smushit_data.savings_conversion;\n\n\t\t\t\t\t// Add directory smush stats.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush &&\n\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush.orig_size\n\t\t\t\t\t) {\n\t\t\t\t\t\twp_smushit_data.size_before =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_before) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.orig_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_before;\n\t\t\t\t\t\twp_smushit_data.size_after =\n\t\t\t\t\t\t\t'undefined' !==\n\t\t\t\t\t\t\ttypeof wp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t? parseInt(wp_smushit_data.size_after) +\n\t\t\t\t\t\t\t\t parseInt(\n\t\t\t\t\t\t\t\t\t\twp_smushit_data.savings_dir_smush\n\t\t\t\t\t\t\t\t\t\t\t.image_size\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: wp_smushit_data.size_after;\n\t\t\t\t\t}\n\n\t\t\t\t\twp_smushit_data.count_resize =\n\t\t\t\t\t\t'undefined' !== typeof stats.count_resize\n\t\t\t\t\t\t\t? parseInt(wp_smushit_data.count_resize) +\n\t\t\t\t\t\t\t stats.count_resize\n\t\t\t\t\t\t\t: wp_smushit_data.count_resize;\n\t\t\t\t}\n\n\t\t\t\t// If no images left, hide the notice, show all success notice.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed ||\n\t\t\t\t\twp_smushit_data.unsmushed.length === 0\n\t\t\t\t) {\n\t\t\t\t\t$('.wp-smush-bulk-wrapper .sui-notice').removeClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t\t$('.sui-notice-success.wp-smush-all-done').addClass(\n\t\t\t\t\t\t'sui-hidden'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tSmush.updateStats();\n\t\t\t}\n\t\t});\n\t});\n\n\t// Enable super smush on clicking link from stats area.\n\t$('a.wp-smush-lossy-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-lossy');\n\t});\n\n\t// Enable resize on clicking link from stats area.\n\t$('.wp-smush-resize-enable').on('click', function (e) {\n\t\te.preventDefault();\n\t\t// Scroll down to settings area.\n\t\tgoToByScroll('#column-resize');\n\t});\n\n\t// If settings string is found in url, enable and scroll.\n\tif ( window.location.hash ) {\n\t\tconst setting_hash = window.location.hash.substring( 1 );\n\t\tlet scrollTo = '';\n\n\t\tswitch ( setting_hash ) {\n\t\t\tcase 'enable-resize':\n\t\t\t\tscrollTo = '#column-resize';\n\t\t\t\tbreak;\n\n\t\t\tcase 'backup-label':\n\t\t\t\tscrollTo = '#backup';\n\t\t\t\tbreak;\n\n\t\t\tcase 'original-label':\n\t\t\t\tscrollTo = '#original';\n\t\t\t\tbreak;\n\n\t\t\tcase 'enable-lossy':\n\t\t\t\tscrollTo = '#column-lossy';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( '' !== scrollTo ) {\n\t\t\tgoToByScroll( scrollTo );\n\t\t\tdocument.getElementById( scrollTo.replace( '#', '' ) ).focus();\n\t\t}\n\t}\n\n\t//Trigger Bulk\n\t$('body').on('click', '.wp-smush-trigger-bulk', function (e) {\n\t\te.preventDefault();\n\n\t\t//Induce Setting button save click\n\t\tif (\n\t\t\t'undefined' !== typeof e.target.dataset.type &&\n\t\t\t'nextgen' === e.target.dataset.type\n\t\t) {\n\t\t\t$('.wp-smush-nextgen-bulk').trigger('click');\n\t\t} else {\n\t\t\t$('.wp-smush-all').trigger('click');\n\t\t}\n\n\t\t$('span.sui-notice-dismiss').trigger('click');\n\t});\n\n\t//Trigger Bulk\n\t$('body').on('click', '#bulk-smush-top-notice-close', function (e) {\n\t\te.preventDefault();\n\t\t$(this).parent().parent().slideUp('slow');\n\t});\n\n\t//Allow the checkboxes to be Keyboard Accessible\n\t$('.wp-smush-setting-row .toggle-checkbox').on('focus', function () {\n\t\t//If Space is pressed\n\t\t$(this).keypress(function (e) {\n\t\t\tif (e.keyCode == 32) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$(this).find('.toggle-checkbox').trigger('click');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Re-Validate Resize Width And Height.\n\t$('body').on('blur', '.wp-smush-resize-input', function () {\n\t\tconst self = $(this);\n\n\t\tconst wrapper_div = self.parents().eq(4);\n\n\t\t// Initiate the check.\n\t\tvalidate_resize_settings(wrapper_div, false, false); // run the validation.\n\t});\n\n\t// Handle Resize Checkbox toggle, to show/hide width, height settings.\n\t$('body').on('click', '#resize', function () {\n\t\tconst self = $(this);\n\t\tconst settings_wrap = $('#smush-resize-settings-wrap');\n\n\t\tif (self.is(':checked')) {\n\t\t\tsettings_wrap.show();\n\t\t} else {\n\t\t\tsettings_wrap.hide();\n\t\t}\n\t});\n\n\t//Handle Re-check button functionality\n\t$('#wp-smush-revalidate-member').on('click', function (e) {\n\t\te.preventDefault();\n\t\t//Ajax Params\n\t\tconst params = {\n\t\t\taction: 'smush_show_warning',\n\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t};\n\t\tconst link = $(this);\n\t\tconst parent = link.parents().eq(1);\n\t\tparent.addClass('loading-notice');\n\t\t$.get(ajaxurl, params, function (r) {\n\t\t\t//remove the warning\n\t\t\tparent.removeClass('loading-notice').addClass('loaded-notice');\n\t\t\tif (0 == r) {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_valid);\n\t\t\t\tremove_element(parent, 1000);\n\t\t\t} else {\n\t\t\t\tparent.attr('data-message', wp_smush_msgs.membership_invalid);\n\t\t\t\tsetTimeout(function remove_loader() {\n\t\t\t\t\tparent.removeClass('loaded-notice');\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t});\n\t});\n\n\tif ($('li.smush-dir-savings').length > 0) {\n\t\t// Update Directory Smush, as soon as the page loads.\n\t\tconst stats_param = {\n\t\t\taction: 'get_dir_smush_stats',\n\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t};\n\t\t$.get(ajaxurl, stats_param, function (r) {\n\t\t\t//Hide the spinner\n\t\t\t$('li.smush-dir-savings .sui-icon-loader').hide();\n\n\t\t\t//If there are no errors, and we have a message to display\n\t\t\tif (!r.success && 'undefined' !== typeof r.data.message) {\n\t\t\t\t$('div.wp-smush-scan-result div.content').prepend(\n\t\t\t\t\tr.data.message\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//If there is no value in r\n\t\t\tif (\n\t\t\t\t'undefined' === typeof r.data ||\n\t\t\t\t'undefined' === typeof r.data.dir_smush\n\t\t\t) {\n\t\t\t\t//Append the text\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats').append(\n\t\t\t\t\twp_smush_msgs.ajax_error\n\t\t\t\t);\n\t\t\t\t$('li.smush-dir-savings span.wp-smush-stats span').hide();\n\t\t\t} else {\n\t\t\t\t//Update the stats\n\t\t\t\tupdate_cummulative_stats(r.data);\n\t\t\t}\n\t\t});\n\t}\n\n\t// Display dialogs that show up with no user action.\n\tif ($('#smush-updated-dialog').length) {\n\t\t// Displays the modal with the release's higlights if it exists.\n\t\twindow.SUI.openModal(\n\t\t\t'smush-updated-dialog',\n\t\t\t'wpbody-content',\n\t\t\tundefined,\n\t\t\tfalse\n\t\t);\n\t}\n\n\t/**\n\t * Toggle backup notice based on \"Compress original images\" setting.\n\t * @since 3.9.1\n\t */\n\t$( 'input#original' ).on( 'change', function() {\n\t\t$( '#backup-notice' ).toggleClass( 'sui-hidden', $( this ).is(':checked') );\n\t} );\n\n\n\t/**\n\t * Bulk compression level notice.\n\t */\n\tconst handleCompressionLevelNotice = () => {\n\t\tconst compressionLevelNotice = document.querySelector( '.wp-smush-compression-type' );\n\t\tif ( ! compressionLevelNotice ) {\n\t\t\treturn;\n\t\t}\n\t\tconst compressionNoticeContent = compressionLevelNotice.querySelector( '.wp-smush-compression-type_note p' );\n\t\tif ( ! compressionNoticeContent ) {\n\t\t\treturn;\n\t\t}\n\t\tcompressionLevelNotice.querySelector('.wp-smush-compression-type_slider').addEventListener('change', (e) => {\n\t\t\tif ( 'INPUT' !== e?.target?.nodeName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst note = e.target.dataset?.note;\n\t\t\tif ( ! note ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompressionNoticeContent.innerHTML = note.trim();\n\t\t} );\n\t}\n\thandleCompressionLevelNotice();\n\n\n\t/**\n\t * Close modal and redirect to the href link.\n\t */\n\t$('.wp-smush-modal-link-close').on( 'click', function( e ) {\n\t\te.preventDefault();\n\t\tSUI.closeModal();\n\t\tconst href = $(this).attr('href');\n\t\tlet openNewTab = '_blank' === $(this).attr('target');\n\t\tif ( href ) {\n\t\t\tif ( openNewTab ) {\n\t\t\t\twindow.open( href, '_blank' );\n\t\t\t} else {\n\t\t\t\twindow.location.href = href;\n\t\t\t}\n\t\t}\n\t});\n\n\t// Update Smush mode on lossy level change.\n\tconst updateLossyLevelInSummaryBox = () => {\n\t\tconst lossyLevelSummaryBox = document.querySelector('.wp-smush-current-compression-level');\n\t\tconst currentLossyLevelTab = document.querySelector( '.wp-smush-lossy-level-tabs button.active' );\n\t\tif ( ! lossyLevelSummaryBox || ! currentLossyLevelTab ) {\n\t\t\treturn;\n\t\t}\n\t\t// Update lossy label.\n\t\tlossyLevelSummaryBox.innerText = currentLossyLevelTab.innerText.trim();\n\n\t\t// Toggle Ultra notice/upsell link.\n\t\tconst upsellLink = lossyLevelSummaryBox.nextElementSibling;\n\t\tif ( upsellLink ) {\n\t\t\tif ( currentLossyLevelTab.id.includes('ultra') ) {\n\t\t\t\tupsellLink.classList.add( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tupsellLink.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\t}\n\n\tdocument.addEventListener( 'onSavedSmushSettings', function( e ) {\n\t\tif ( ! e?.detail?.is_outdated_stats ) {\n\t\t\treturn;\n\t\t}\n\t\tupdateLossyLevelInSummaryBox();\n\t} );\n});\n","/* global WP_Smush */\n\n/**\n * Bulk Smush Background Optimization.\n *\n * @since 3.12.0\n */\nimport Fetcher from '../utils/fetcher';\nimport MixPanel from \"../mixpanel\";\nimport SmushProgress from '../common/progressbar';\nimport {GlobalStats, UpsellManger} from \"../common/globalStats\";\n\n(function () {\n 'use strict';\n if (!window.wp_smush_msgs) {\n return;\n }\n const $ = document.querySelector.bind(document);\n const NO_FREE_LIMITED = 50;\n\n /**\n * Handle Background Process.\n * @returns \n */\n const BackgroundProcess = () => {\n return {\n handle(action) {\n return Fetcher.background[action]();\n },\n initState() {\n return Fetcher.background.initState();\n },\n }\n }\n\n /**\n * Background Optimization.\n */\n const BackgroundSmush = (() => {\n\n const startBtn = window.wp_smushit_data && window.wp_smushit_data.bo_stats && $('.wp-smush-bo-start');\n if (!startBtn) {\n return;\n }\n\n const mixPanel = MixPanel.getInstance();\n const BO = new BackgroundProcess();\n const bulkWrapper = $('.bulk-smush-wrapper');\n const reScanImagesButton = $('.wp-smush-scan');\n let intervalHandle = 0;\n let cancellationInProgress = false;\n return {\n hookStatusChecks() {\n if (intervalHandle) {\n // Already done\n return;\n }\n\n let count = 0;\n\t\t\t\tlet statusSyncInProgress = false;\n let statSyncInProgress = false;\n intervalHandle = setInterval(() => {\n if (statusSyncInProgress) {\n return;\n }\n statusSyncInProgress = true;\n\n count++;\n const statusSynced = this.syncBackgroundStatus();\n if (count % 3 === 0) {\n // Do a full update every nth time\n statusSynced.then(() => {\n if (!statSyncInProgress) {\n this.syncStats().then(() => {\n statSyncInProgress = false;\n });\n statSyncInProgress = true;\n }\n });\n }\n\n statusSynced.finally(() => {\n statusSyncInProgress = false;\n });\n }, 3 * 1000);\n },\n resetBOStatsOnStart() {\n GlobalStats.setBoStats( {\n is_cancelled: false,\n is_completed: false,\n processed_items: 0,\n failed_items: 0,\n } );\n },\n start() {\n // Reset boStats.\n this.resetBOStatsOnStart();\n\n // Disable UI.\n this.onStart();\n\n // Start BO.\n BO.handle('start').then((res) => {\n if (res.success) {\n // Update stats.\n const updatedStats = this.updateStats(res.data, false);\n // Show progress bar.\n this.showProgressBar();\n this.hookStatusChecks();\n if ( updatedStats ) {\n // Render stats.\n GlobalStats.renderStats();\n }\n } else {\n WP_Smush.helpers.showNotice( res, {\n 'showdismiss': true,\n 'autoclose' : false,\n } );\n this.cancelBulk();\n }\n });\n },\n /**\n * Initial state when load the Bulk Smush page while BO is running.\n */\n initState() {\n if (!GlobalStats.getBoStats().in_processing) {\n return;\n }\n // Disable UI.\n this.onStart();\n // Start BO.\n BO.initState().then((res) => {\n if (res.success) {\n // Update stats.\n this.updateStats(res.data, false);\n // Show progress bar.\n this.showProgressBar();\n this.hookStatusChecks();\n // Maybe update errors.\n if ( res.data.errors && ! Object.keys( GlobalStats.getErrors() ).length ) {\n GlobalStats.setErrors( res.data.errors );\n }\n // Render stats.\n GlobalStats.renderStats();\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n });\n },\n /**\n * Cancel.\n */\n cancel() {\n cancellationInProgress = true;\n\t\t\t\tthis.setCancelButtonStateToStarted();\n BO.handle('cancel').then((res) => {\n if (res.success) {\n this.cancelBulk();\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n });\n },\n hideProgressBar() {\n // Hide progress bar.\n SmushProgress.close().update(0, GlobalStats.getBoStats().total_items);\n },\n showProgressBar() {\n // Reset progress bar.\n SmushProgress.update(GlobalStats.getBoStats().processed_items, GlobalStats.getBoStats().total_items);\n // Show progress bar.\n SmushProgress.show();\n },\n /**\n * Update stats.\n * @param {Object} newStats Included increment stats and new BO stats.\n * @param updateGlobal\n */\n updateStats(newStats, updateGlobal) {\n // Make sure we have processed_stats/errors property (not added by default when start).\n newStats.global_stats = newStats.global_stats || {};\n newStats.errors = newStats.errors || {};\n const {\n global_stats,\n errors,\n ...newBoStats\n } = newStats;\n if ( ! GlobalStats.isChangedStats( newBoStats ) ) {\n return false;\n }\n // Update BO stats.\n GlobalStats.setBoStats(newBoStats);\n if (updateGlobal) {\n // Update global stats.\n GlobalStats.setGlobalStats(global_stats);\n }\n // Update Errors.\n GlobalStats.setErrors( errors );\n return true;\n },\n cancelBulk() {\n // Sync Stats.\n this.syncStats(() => {\n if (100 === GlobalStats.getGlobalStats().percent_optimized) {\n // If the last item was getting processed when the user cancelled then the process might have completed\n GlobalStats.setBoStats( {\n is_completed: true\n } );\n this.onCompletedBulk();\n } else {\n // Update status of boStats.\n GlobalStats.setBoStats( {\n is_cancelled: true\n } );\n // Reset and hide progress bar.\n this.onFinish();\n // Bulk is cancelled, show bulk desc.\n SmushProgress.showBulkSmushDescription();\n }\n\n mixPanel.trackBulkSmushCancel();\n\n cancellationInProgress = false;\n });\n },\n showCompletedMessage() {\n // Render completed message.\n // Show completed message.\n const processedWrapper = bulkWrapper.querySelector('.wp-smush-all-done');\n if ( GlobalStats.getBoStats().failed_items ) {\n let completeMessage = wp_smush_msgs.all_failed;\n if ( ! this.isFailedAllItems() ) {\n completeMessage = wp_smush_msgs.error_in_bulk.replace( '{{smushed}}', GlobalStats.getBoStats().total_items - GlobalStats.getBoStats().failed_items )\n .replace('{{total}}', GlobalStats.getBoStats().total_items )\n .replace('{{errors}}', GlobalStats.getBoStats().failed_items );\n }\n processedWrapper.querySelector('p').innerHTML = completeMessage;\n processedWrapper.classList.remove('sui-notice-success', 'sui-notice-warning');\n const noticeType = this.getNoticeType();\n const noticeIcon = 'warning' === noticeType ? 'info' : 'check-tick';\n const iconElement = processedWrapper.querySelector('.sui-notice-icon');\n processedWrapper.classList.add( 'sui-notice-' + noticeType );\n iconElement.classList.remove('sui-icon-check-tick', 'sui-icon-info');\n iconElement.classList.add( 'sui-icon-' + noticeIcon );\n } else {\n processedWrapper.querySelector('p').innerHTML = wp_smush_msgs.all_smushed;\n }\n processedWrapper.classList.remove('sui-hidden');\n },\n isFailedAllItems() {\n return GlobalStats.getBoStats().failed_items === GlobalStats.getBoStats().total_items;\n },\n getNoticeType() {\n return this.isFailedAllItems() ? 'warning' : 'success';\n },\n onCompletedBulk() {\n // Reset and hide progress bar.\n this.onFinish();\n // Bulk is completed, hide bulk desc.\n SmushProgress.hideBulkSmushDescription();\n // Show completed message.\n this.showCompletedMessage();\n\n // Reset the progress when we finish so the next smushing starts from zero.\n SmushProgress.update(0, GlobalStats.getBoStats().total_items);\n },\n completeBulk() {\n // Sync Stats.\n this.syncStats(() => this.onCompletedBulk());\n },\n syncStats(onComplete = () => false) {\n return BO.handle('getStats').then((res) => {\n if ( res.success ) {\n const responseErrors = res.data.errors || {};\n this.updateStats( { global_stats: res.data, errors: responseErrors }, true );\n GlobalStats.renderStats();\n if ( res.data.content ) {\n $('#wp-smush-bulk-content').innerHTML = res.data.content;\n }\n onComplete();\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n }).catch( (error) => console.log('error', error));\n },\n syncBackgroundStatus() {\n return BO.handle('getStatus').then((res) => {\n if ((res.data || {}).in_process_notice) {\n SmushProgress.setNotice( res.data.in_process_notice );\n }\n\n if (res.success) {\n // Update stats.\n if ( this.updateStats(res.data, false) ) {\n // Update progress bar.\n SmushProgress.update(GlobalStats.getBoStats().processed_items, GlobalStats.getBoStats().total_items);\n\n if (! GlobalStats.getBoStats().is_cancelled && ! GlobalStats.getBoStats().is_completed) {\n // Render stats.\n GlobalStats.renderStats();\n }\n }\n\n if (GlobalStats.getBoStats().is_cancelled && !cancellationInProgress) {\n // Cancelled on server side\n this.cancelBulk();\n } else if (GlobalStats.getBoStats().is_completed) {\n this.completeBulk();\n }\n } else {\n WP_Smush.helpers.showNotice( res );\n }\n });\n },\n onStart() {\n // Disable btn.\n startBtn.setAttribute('disabled', '');\n // Disable re-check images.\n reScanImagesButton && reScanImagesButton.setAttribute('disabled', '');\n $('.wp-smush-restore').setAttribute('disabled', '');\n // Show upsell cdn.\n UpsellManger.maybeShowCDNUpsellForPreSiteOnStart();\n \n\t\t\t\tthis.setCancelButtonStateToInitial();\n },\n onFinish() {\n // Clear interval.\n if (intervalHandle) {\n clearInterval(intervalHandle);\n intervalHandle = 0;\n }\n\n // Disable btn.\n startBtn.removeAttribute('disabled');\n // Reset and hide Progress Bar.\n this.hideProgressBar();\n // Disable re-check images.\n reScanImagesButton && reScanImagesButton.removeAttribute('disabled', '');\n $('.wp-smush-restore').removeAttribute('disabled', '');\n\n // Show upsell cdn.\n UpsellManger.maybeShowCDNUpsellForPreSiteOnCompleted();\n },\n init() {\n if (!startBtn) {\n return;\n }\n\n // Start BO.\n startBtn.onclick = () => {\n const requiredScanMedia = startBtn.classList.contains('wp-smush-scan-and-bulk-smush');\n if ( requiredScanMedia ) {\n return;\n }\n this.start();\n }\n\n // If BO is running, initial new state.\n this.initState();\n },\n\t\t\tsetCancelButtonStateToInitial() {\n SmushProgress.setCancelButtonLabel( wp_smush_msgs.cancel );\n SmushProgress.setOnCancelCallback( this.cancel.bind(this) );\n\t\t\t},\n\t\t\tsetCancelButtonStateToStarted() {\n SmushProgress.setCancelButtonLabel( wp_smush_msgs.cancelling );\n SmushProgress.setOnCancelCallback( () => false );\n },\n }\n })();\n // Run.\n BackgroundSmush && BackgroundSmush.init();\n /**\n * For globalStats, we will need to update it on reload and after re-checking images,\n * and on finish the BO.\n * 1. On finish, we handled via BackgroundSmush.syncStats -> BackgroundSmush.updateStats\n * 2. On reload or after re-checking images, we need to update globalStats from global variable:\n * window.wp_smushit_data\n */\n // Update global stats after re-checking images.\n document.addEventListener('wpSmushAfterRecheckImages', function(){\n GlobalStats.updateGlobalStatsFromSmushScriptData();\n });\n \n document.addEventListener('backgroundBulkSmushOnScanCompleted', function(){\n\t\tif ( ! BackgroundSmush ) {\n\t\t\treturn;\n\t\t}\n GlobalStats.setBoStats({\n in_processing: true,\n });\n BackgroundSmush.initState();\n });\n})();","/* global WP_Smush */\n/* global ajaxurl */\n/* global _ */\n\nimport MixPanel from \"../mixpanel\";\n\n/**\n * Bulk restore JavaScript code.\n *\n * @since 3.2.2\n */\n(function () {\n\t'use strict';\n\n\t/**\n\t * Bulk restore modal.\n\t *\n\t * @since 3.2.2\n\t */\n\tWP_Smush.restore = {\n\t\tmodal: document.getElementById('smush-restore-images-dialog'),\n\t\tcontentContainer: document.getElementById('smush-bulk-restore-content'),\n\t\tsettings: {\n\t\t\tslide: 'start', // start, progress or finish.\n\t\t\tsuccess: 0,\n\t\t\terrors: [],\n\t\t},\n\t\titems: [], // total items, 1 item = 1 step.\n\t\tsuccess: [], // successful items restored.\n\t\terrors: [], // failed items.\n\t\tcurrentStep: 0,\n\t\ttotalSteps: 0,\n\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif (!this.modal) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.settings = {\n\t\t\t\tslide: 'start',\n\t\t\t\tsuccess: 0,\n\t\t\t\terrors: [],\n\t\t\t};\n\n\t\t\tthis.mixPanel = MixPanel.getInstance();\n\n\t\t\tthis.resetModalWidth();\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Show the modal.\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-restore-images-dialog',\n\t\t\t\t'wpbody-content',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t */\n\t\trenderTemplate() {\n\t\t\tconst template = WP_Smush.onboarding.template('smush-bulk-restore');\n\t\t\tconst content = template(this.settings);\n\n\t\t\tif (content) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\t\t\t}\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Reset modal width.\n\t\t *\n\t\t * @since 3.6.0\n\t\t */\n\t\tresetModalWidth() {\n\t\t\tthis.modal.style.maxWidth = '460px';\n\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth = '460px';\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst confirmButton = this.modal.querySelector(\n\t\t\t\t'button[id=\"smush-bulk-restore-button\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif (confirmButton) {\n\t\t\t\tconfirmButton.addEventListener('click', function (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.resetModalWidth();\n\n\t\t\t\t\tself.settings = { slide: 'progress' };\n\t\t\t\t\tself.errors = [];\n\n\t\t\t\t\tself.renderTemplate();\n\t\t\t\t\tself.initScan();\n\n\t\t\t\t\tself.mixPanel.track('Bulk Restore Triggered');\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Cancel the bulk restore.\n\t\t */\n\t\tcancel() {\n\t\t\tif (\n\t\t\t\t'start' === this.settings.slide ||\n\t\t\t\t'finish' === this.settings.slide\n\t\t\t) {\n\t\t\t\t// Hide the modal.\n\t\t\t\twindow.SUI.closeModal();\n\t\t\t} else {\n\t\t\t\tthis.updateProgressBar(true);\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar(cancel = false) {\n\t\t\tlet progress = 0;\n\t\t\tif (0 < this.currentStep) {\n\t\t\t\tprogress = Math.min(\n\t\t\t\t\tMath.round((this.currentStep * 100) / this.totalSteps),\n\t\t\t\t\t99\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (progress > 100) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\tthis.modal.querySelector('.sui-progress-text span').innerHTML =\n\t\t\t\tprogress + '%';\n\t\t\tthis.modal.querySelector('.sui-progress-bar span').style.width =\n\t\t\t\tprogress + '%';\n\n\t\t\tconst statusDiv = this.modal.querySelector(\n\t\t\t\t'.sui-progress-state-text'\n\t\t\t);\n\t\t\tif (progress >= 90) {\n\t\t\t\tstatusDiv.innerHTML = 'Finalizing...';\n\t\t\t} else if (cancel) {\n\t\t\t\tstatusDiv.innerHTML = 'Cancelling...';\n\t\t\t} else {\n\t\t\t\tstatusDiv.innerHTML =\n\t\t\t\t\tthis.currentStep +\n\t\t\t\t\t'/' +\n\t\t\t\t\tthis.totalSteps +\n\t\t\t\t\t' ' +\n\t\t\t\t\t'images restored';\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * First step in bulk restore - get the bulk attachment count.\n\t\t */\n\t\tinitScan() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=get_image_count', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\tif ('undefined' !== typeof res.data.items) {\n\t\t\t\t\t\tself.items = res.data.items;\n\t\t\t\t\t\tself.totalSteps = res.data.items.length;\n\t\t\t\t\t\tself.step();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send('_ajax_nonce=' + _nonce.value);\n\t\t},\n\n\t\t/**\n\t\t * Execute a scan step recursively\n\t\t */\n\t\tstep() {\n\t\t\tconst self = this;\n\t\t\tconst _nonce = document.getElementById('_wpnonce');\n\n\t\t\tif (0 < this.items.length) {\n\t\t\t\tconst item = this.items.pop();\n\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\txhr.open('POST', ajaxurl + '?action=restore_step', true);\n\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t'Content-type',\n\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t);\n\t\t\t\txhr.onload = () => {\n\t\t\t\t\tthis.currentStep++;\n\n\t\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\t\t\tconst data = ((res || {}).data || {});\n\t\t\t\t\t\tif (data.success) {\n\t\t\t\t\t\t\tself.success.push(item);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.errors.push({\n\t\t\t\t\t\t\t\tid: item,\n\t\t\t\t\t\t\t\tsrc: data.src || \"Error\",\n\t\t\t\t\t\t\t\tthumb: data.thumb,\n\t\t\t\t\t\t\t\tlink: data.link,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.updateProgressBar();\n\t\t\t\t\tself.step();\n\t\t\t\t};\n\t\t\t\txhr.send('item=' + item + '&_ajax_nonce=' + _nonce.value);\n\t\t\t} else {\n\t\t\t\t// Finish.\n\t\t\t\tthis.settings = {\n\t\t\t\t\tslide: 'finish',\n\t\t\t\t\tsuccess: this.success.length,\n\t\t\t\t\terrors: this.errors,\n\t\t\t\t\ttotal: this.totalSteps,\n\t\t\t\t};\n\n\t\t\t\tself.renderTemplate();\n\t\t\t\tif (0 < this.errors.length) {\n\t\t\t\t\tthis.modal.style.maxWidth = '660px';\n\t\t\t\t\tthis.modal.querySelector('.sui-box').style.maxWidth =\n\t\t\t\t\t\t'660px';\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.restore.template = _.memoize((id) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn (data) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled || _.template(document.getElementById(id).innerHTML);\n\t\t\treturn compiled(data);\n\t\t};\n\t});\n})();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Bulk Smush functionality.\n *\n * @since 2.9.0 Moved from admin.js\n */\n\nimport Smush from '../smush/smush';\nimport Fetcher from '../utils/fetcher';\nimport SmushProcess from '../common/progressbar';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.bulk = {\n\t\tinit() {\n\t\t\tthis.onClickBulkSmushNow();\n\t\t\tthis.onClickIgnoreImage();\n\t\t\tthis.onClickIgnoreAllImages();\n\t\t\tthis.onScanCompleted();\n\t\t},\n\t\tonClickBulkSmushNow() {\n\t\t\t/**\n\t\t\t * Handle the Bulk Smush/Bulk re-Smush button click.\n\t\t\t */\n\t\t\t$( '.wp-smush-all' ).on( 'click', function( e ) {\n\t\t\t\tconst bulkSmushButton = $(this);\n\t\t\t\tif ( bulkSmushButton.hasClass('wp-smush-scan-and-bulk-smush') ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\n\t\t\t\tWP_Smush.bulk.ajaxBulkSmushStart( bulkSmushButton );\n\t\t\t} );\n\t\t},\n\t\tajaxBulkSmushStart( bulkSmushButton ) {\n\t\t\tbulkSmushButton = bulkSmushButton || $( '#wp-smush-bulk-content .wp-smush-all' );\n\t\t\t// Check for IDs, if there is none (unsmushed or lossless), don't call Smush function.\n\t\t\t/** @param {Array} wp_smushit_data.unsmushed */\n\t\t\tif (\n\t\t\t\t'undefined' === typeof window.wp_smushit_data ||\n\t\t\t\t( 0 === window.wp_smushit_data.unsmushed.length &&\n\t\t\t\t\t0 === window.wp_smushit_data.resmush.length )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Disable re-Smush and scan button.\n\t\t\t// TODO: refine what is disabled.\n\t\t\t$(\n\t\t\t\t'.wp-resmush.wp-smush-action, .wp-smush-scan, .wp-smush-all:not(.sui-progress-close), a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button'\n\t\t\t).prop( 'disabled', true );\n\n\t\t\tif ( bulkSmushButton.hasClass('wp-smush-resume-bulk-smush') && this.bulkSmush ) {\n\t\t\t\tthis.resumeBulkSmush();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tthis.bulkSmush = new Smush( bulkSmushButton, true );\n\t\t\tSmushProcess.setOnCancelCallback( () => {\n\t\t\t\tthis.bulkSmush.cancelAjax()\n\t\t\t}).update( 0, this.bulkSmush.ids.length ).show();\n\n\t\t\t// Show upsell cdn.\n\t\t\tthis.maybeShowCDNUpsellForPreSiteOnStart();\n\n\t\t\t// Run bulk Smush.\n\t\t\tthis.bulkSmush.run();\n\t\t},\n\t\tresumeBulkSmush() {\n\t\t\tSmushProcess.disableExceedLimitMode();\n\t\t\tSmushProcess.hideBulkSmushDescription();\n\t\t\tthis.bulkSmush.onStart();\n\t\t\tthis.bulkSmush.callAjax();\n\t\t},\n\t\tonClickIgnoreImage() {\n\t\t\t/**\n\t\t\t * Ignore file from bulk Smush.\n\t\t\t *\n\t\t\t * @since 2.9.0\n\t\t\t */\n\t\t\t$( 'body' ).on( 'click', '.smush-ignore-image', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst self = $( this );\n\n\t\t\t\tself.prop( 'disabled', true );\n\t\t\t\tself.attr( 'data-tooltip' );\n\t\t\t\tself.removeClass( 'sui-tooltip' );\n\t\t\t\t$.post( ajaxurl, {\n\t\t\t\t\taction: 'ignore_bulk_image',\n\t\t\t\t\tid: self.attr( 'data-id' ),\n\t\t\t\t\t_ajax_nonce: wp_smush_msgs.nonce,\n\t\t\t\t} ).done( ( response ) => {\n\t\t\t\t\tif ( self.is( 'a' ) && response.success && 'undefined' !== typeof response.data.html ) {\n\t\t\t\t\t\tif( self.closest('.smush-status-links') ) {\n\t\t\t\t\t\t\tself.closest('.smush-status-links').parent().html( response.data.html );\n\t\t\t\t\t\t} else if (e.target.closest( '.smush-bulk-error-row' ) ){\n\t\t\t\t\t\t\tself.addClass('disabled');\n\t\t\t\t\t\t\te.target.closest( '.smush-bulk-error-row' ).style.opacity = 0.5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t},\n\t\tonClickIgnoreAllImages() {\n\t\t\t/**\n\t\t\t * Ignore file from bulk Smush.\n\t\t\t *\n\t\t\t * @since 3.12.0\n\t\t\t */\n\t\t\tconst ignoreAll = document.querySelector('.wp_smush_ignore_all_failed_items');\n\t\t\tif ( ignoreAll ) {\n\t\t\t\tignoreAll.onclick = (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.target.setAttribute('disabled','');\n\t\t\t\t\te.target.style.cursor = 'progress';\n\t\t\t\t\tconst type = e.target.dataset.type || null;\n\t\t\t\t\te.target.classList.remove('sui-tooltip');\n\t\t\t\t\tFetcher.smush.ignoreAll(type).then((res) => {\n\t\t\t\t\t\tif ( res.success ) {\n\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\te.target.style.cursor = 'pointer';\n\t\t\t\t\t\t\te.target.removeAttribute('disabled');\n\t\t\t\t\t\t\tWP_Smush.helpers.showNotice( res );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonScanCompleted() {\n\t\t\tdocument.addEventListener('ajaxBulkSmushOnScanCompleted', (e) => {\n\t\t\t\tthis.ajaxBulkSmushStart();\n\t\t\t});\n\t\t},\n\t\tmaybeShowCDNUpsellForPreSiteOnStart: () => {\n\t\t\t// Show upsell cdn.\n\t\t\tconst upsell_cdn = document.querySelector('.wp-smush-upsell-cdn');\n\t\t\tif ( upsell_cdn ) {\n\t\t\t\tupsell_cdn.classList.remove('sui-hidden');\n\t\t\t}\n\t\t}\n\t\t\n\t};\n\n\tWP_Smush.bulk.init();\n} )( jQuery );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory Smush module JavaScript code.\n *\n * @since 2.8.1 Separated from admin.js into dedicated file.\n */\n\nimport { createTree } from 'jquery.fancytree';\nimport Scanner from '../smush/directory-scanner';\n\n( function( $ ) {\n\t'use strict';\n\n\tWP_Smush.directory = {\n\t\tselected: [],\n\t\ttree: [],\n\t\twp_smush_msgs: [],\n\t\ttriggered: false,\n\n\t\tinit() {\n\t\t\tconst self = this,\n\t\t\t\tprogressDialog = $( '#wp-smush-progress-dialog' );\n\n\t\t\tlet totalSteps = 0,\n\t\t\t\tcurrentScanStep = 0;\n\n\t\t\t// Make sure directory smush vars are set.\n\t\t\tif ( typeof window.wp_smushit_data.dir_smush !== 'undefined' ) {\n\t\t\t\ttotalSteps = window.wp_smushit_data.dir_smush.totalSteps;\n\t\t\t\tcurrentScanStep =\n\t\t\t\t\twindow.wp_smushit_data.dir_smush.currentScanStep;\n\t\t\t}\n\n\t\t\t// Init image scanner.\n\t\t\tthis.scanner = new Scanner( totalSteps, currentScanStep );\n\n\t\t\t/**\n\t\t\t * Smush translation strings.\n\t\t\t *\n\t\t\t * @param {Array} wp_smush_msgs\n\t\t\t */\n\t\t\tthis.wp_smush_msgs = window.wp_smush_msgs || {};\n\n\t\t\t/**\n\t\t\t * Open the \"Select Smush directory\" modal.\n\t\t\t */\n\t\t\t$( 'button.wp-smush-browse, a#smush-directory-open-modal' ).on(\n\t\t\t\t'click',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif ( $( e.currentTarget ).hasClass( 'wp-smush-browse' ) ) {\n\t\t\t\t\t\t// Hide all the notices.\n\t\t\t\t\t\t$( 'div.wp-smush-scan-result div.wp-smush-notice' ).hide();\n\n\t\t\t\t\t\t// Remove notice.\n\t\t\t\t\t\t$( 'div.wp-smush-info' ).remove();\n\t\t\t\t\t}\n\n\t\t\t\t\twindow.SUI.openModal(\n\t\t\t\t\t\t'wp-smush-list-dialog',\n\t\t\t\t\t\te.currentTarget,\n\t\t\t\t\t\t$(\n\t\t\t\t\t\t\t'#wp-smush-list-dialog .sui-box-header [data-modal-close]'\n\t\t\t\t\t\t)[0],\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\t//Display File tree for Directory Smush\n\t\t\t\t\tself.initFileTree();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Smush images: Smush in Choose Directory modal clicked\n\t\t\t */\n\t\t\t$( '#wp-smush-select-dir' ).on( 'click', function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body' ).css( {\n\t\t\t\t\topacity: '0.8',\n\t\t\t\t} );\n\t\t\t\t$( 'div.wp-smush-list-dialog div.sui-box-body a' ).off(\n\t\t\t\t\t'click'\n\t\t\t\t);\n\n\t\t\t\tconst button = $( this );\n\n\t\t\t\t// Display the spinner.\n\t\t\t\tbutton.addClass('sui-button-onload');\n\n\t\t\t\tconst selectedFolders = self.tree.getSelectedNodes();\n\n\t\t\t\tconst paths = [];\n\t\t\t\tselectedFolders.forEach( function( folder ) {\n\t\t\t\t\tpaths.push( folder.key );\n\t\t\t\t} );\n\n\t\t\t\t// Send a ajax request to get a list of all the image files\n\t\t\t\tconst param = {\n\t\t\t\t\taction: 'image_list',\n\t\t\t\t\tsmush_path: paths,\n\t\t\t\t\timage_list_nonce: $(\n\t\t\t\t\t\t'input[name=\"image_list_nonce\"]'\n\t\t\t\t\t).val(),\n\t\t\t\t};\n\n\t\t\t\t$.post( ajaxurl, param, function( response ) {\n\t\t\t\t\tif ( response.success ) {\n\t\t\t\t\t\t// Close the modal.\n\t\t\t\t\t\twindow.SUI.closeModal();\n\n\t\t\t\t\t\tself.scanner = new Scanner( response.data, 0 );\n\t\t\t\t\t\tself.showProgressDialog( response.data );\n\t\t\t\t\t\tself.scanner.scan();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove the spinner.\n\t\t\t\t\t\tbutton.removeClass('sui-button-onload');\n\n\t\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t\t\t\tresponse.data.message,\n\t\t\t\t\t\t\t{ type: 'warning' }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * Cancel scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'#cancel-directory-smush, #dialog-close-div, .wp-smush-cancel-dir',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t// Display the spinner\n\t\t\t\t\t$( '.wp-smush-cancel-dir' ).addClass( 'sui-button-onload' );\n\t\t\t\t\tself.scanner\n\t\t\t\t\t\t.cancel()\n\t\t\t\t\t\t.done(\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t( window.location.href =\n\t\t\t\t\t\t\t\t\tself.wp_smush_msgs.directory_url )\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Continue scan.\n\t\t\t */\n\t\t\tprogressDialog.on(\n\t\t\t\t'click',\n\t\t\t\t'.sui-icon-play, .wp-smush-resume-scan',\n\t\t\t\tfunction( e ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tself.scanner.resume();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Check to see if we should open the directory module.\n\t\t\t * Used to redirect from dashboard page.\n\t\t\t *\n\t\t\t * @since 3.8.6\n\t\t\t */\n\t\t\tconst queryString = window.location.search;\n\t\t\tconst urlParams = new URLSearchParams( queryString );\n\t\t\tif ( urlParams.has( 'start' ) && ! this.triggered ) {\n\t\t\t\tthis.triggered = true;\n\t\t\t\t$( 'button.wp-smush-browse' ).trigger( 'click' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Init fileTree.\n\t\t */\n\t\tinitFileTree() {\n\t\t\tconst self = this,\n\t\t\t\tsmushButton = $( 'button#wp-smush-select-dir' ),\n\t\t\t\tajaxSettings = {\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'smush_get_directory_list',\n\t\t\t\t\t\tlist_nonce: $( 'input[name=\"list_nonce\"]' ).val(),\n\t\t\t\t\t},\n\t\t\t\t\tcache: false,\n\t\t\t\t};\n\n\t\t\t// Object already defined.\n\t\t\tif ( Object.entries( self.tree ).length > 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.tree = createTree( '.wp-smush-list-dialog .content', {\n\t\t\t\tautoCollapse: true, // Automatically collapse all siblings, when a node is expanded\n\t\t\t\tclickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)\n\t\t\t\tcheckbox: true, // Show checkboxes\n\t\t\t\tdebugLevel: 0, // 0:quiet, 1:errors, 2:warnings, 3:infos, 4:debug\n\t\t\t\tselectMode: 3, // 1:single, 2:multi, 3:multi-hier\n\t\t\t\ttabindex: '0', // Whole tree behaves as one single control\n\t\t\t\tkeyboard: true, // Support keyboard navigation\n\t\t\t\tquicksearch: true, // Navigate to next node by typing the first letters\n\t\t\t\tsource: ajaxSettings,\n\t\t\t\tlazyLoad: ( event, data ) => {\n\t\t\t\t\tdata.result = new Promise( function( resolve, reject ) {\n\t\t\t\t\t\tajaxSettings.data.dir = data.node.key;\n\t\t\t\t\t\t$.ajax( ajaxSettings )\n\t\t\t\t\t\t\t.done( ( response ) => resolve( response ) )\n\t\t\t\t\t\t\t.fail( reject );\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t\tloadChildren: ( event, data ) =>\n\t\t\t\t\tdata.node.fixSelection3AfterClick(), // Apply parent's state to new child nodes:\n\t\t\t\tselect: () =>\n\t\t\t\t\tsmushButton.prop(\n\t\t\t\t\t\t'disabled',\n\t\t\t\t\t\t! +self.tree.getSelectedNodes().length\n\t\t\t\t\t),\n\t\t\t\tinit: () => smushButton.prop( 'disabled', true ),\n\t\t\t} );\n\t\t},\n\n\t\t/**\n\t\t * Show progress dialog.\n\t\t *\n\t\t * @param {number} items Number of items in the scan.\n\t\t */\n\t\tshowProgressDialog( items ) {\n\t\t\t// Update items status and show the progress dialog..\n\t\t\t$( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\t'0/' + items + ' ' + self.wp_smush_msgs.progress_smushed\n\t\t\t);\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'wp-smush-progress-dialog',\n\t\t\t\t'dialog-close-div',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update progress bar during directory smush.\n\t\t *\n\t\t * @param {number} progress Current progress in percent.\n\t\t * @param {boolean} cancel Cancel status.\n\t\t */\n\t\tupdateProgressBar( progress, cancel = false ) {\n\t\t\tif ( progress > 100 ) {\n\t\t\t\tprogress = 100;\n\t\t\t}\n\n\t\t\t// Update progress bar\n\t\t\t$( '.sui-progress-block .sui-progress-text span' ).text(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\t\t\t$( '.sui-progress-block .sui-progress-bar span' ).width(\n\t\t\t\tprogress + '%'\n\t\t\t);\n\n\t\t\tif ( progress >= 90 ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Finalizing...'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( cancel ) {\n\t\t\t\t$( '.sui-progress-state .sui-progress-state-text' ).text(\n\t\t\t\t\t'Cancelling...'\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t};\n\n\tWP_Smush.directory.init();\n}( jQuery ) );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Directory scanner module that will Smush images in the Directory Smush modal.\n *\n * @since 2.8.1\n *\n * @param {string|number} totalSteps\n * @param {string|number} currentStep\n * @return {Object} Scan object.\n * @class\n */\nconst DirectoryScanner = ( totalSteps, currentStep ) => {\n\ttotalSteps = parseInt( totalSteps );\n\tcurrentStep = parseInt( currentStep );\n\n\tlet cancelling = false,\n\t\tfailedItems = 0,\n\t\tskippedItems = 0;\n\n\tconst obj = {\n\t\tscan() {\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\tif ( currentStep !== 0 ) {\n\t\t\t\t// Scan started on a previous page load.\n\t\t\t\tstep( remainingSteps ).fail( this.showScanError );\n\t\t\t} else {\n\t\t\t\tjQuery\n\t\t\t\t\t.post( ajaxurl, {\n\t\t\t\t\t\taction: 'directory_smush_start',\n\t\t\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce\n\t\t\t\t\t}, () =>\n\t\t\t\t\t\tstep( remainingSteps ).fail( this.showScanError )\n\t\t\t\t\t)\n\t\t\t\t\t.fail( this.showScanError );\n\t\t\t}\n\t\t},\n\n\t\tcancel() {\n\t\t\tcancelling = true;\n\t\t\treturn jQuery.post( ajaxurl, {\n\t\t\t\taction: 'directory_smush_cancel',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce\n\t\t\t} );\n\t\t},\n\n\t\tgetProgress() {\n\t\t\tif ( cancelling ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t// O M G ... Logic at it's finest!\n\t\t\tconst remainingSteps = totalSteps - currentStep;\n\t\t\treturn Math.min(\n\t\t\t\tMath.round(\n\t\t\t\t\t( parseInt( totalSteps - remainingSteps ) * 100 ) /\n\t\t\t\t\ttotalSteps\n\t\t\t\t),\n\t\t\t\t99\n\t\t\t);\n\t\t},\n\n\t\tonFinishStep( progress ) {\n\t\t\tjQuery( '.wp-smush-progress-dialog .sui-progress-state-text' ).html(\n\t\t\t\tcurrentStep -\n\t\t\t\tfailedItems +\n\t\t\t\t'/' +\n\t\t\t\ttotalSteps +\n\t\t\t\t' ' +\n\t\t\t\twindow.wp_smush_msgs.progress_smushed\n\t\t\t);\n\t\t\tWP_Smush.directory.updateProgressBar( progress );\n\t\t},\n\n\t\tonFinish() {\n\t\t\tWP_Smush.directory.updateProgressBar( 100 );\n\t\t\twindow.location.href =\n\t\t\t\twindow.wp_smush_msgs.directory_url + '&scan=done';\n\t\t},\n\n\t\t/**\n\t\t * Displays an error when the scan request fails.\n\t\t *\n\t\t * @param {Object} res XHR object.\n\t\t */\n\t\tshowScanError( res ) {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\n\t\t\t// Add the error class to show/hide elements in the dialog.\n\t\t\tdialog\n\t\t\t\t.removeClass( 'wp-smush-exceed-limit' )\n\t\t\t\t.addClass( 'wp-smush-scan-error' );\n\n\t\t\t// Add the error status and description to the error message.\n\t\t\tdialog\n\t\t\t\t.find( '#smush-scan-error' )\n\t\t\t\t.text( `${ res.status } ${ res.statusText }` );\n\n\t\t\t// Show/hide the 403 error specific instructions.\n\t\t\tconst forbiddenMessage = dialog.find( '.smush-403-error-message' );\n\t\t\tif ( 403 !== res.status ) {\n\t\t\t\tforbiddenMessage.addClass( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tforbiddenMessage.removeClass( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\n\t\tlimitReached() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\n\t\t\tdialog.addClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'data-tooltip', window.wp_smush_msgs.bulk_resume );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-close' )\n\t\t\t\t.removeClass( 'sui-icon-close' )\n\t\t\t\t.addClass( 'sui-icon-play' );\n\t\t\tdialog\n\t\t\t\t.find( '#cancel-directory-smush' )\n\t\t\t\t.attr( 'id', 'cancel-directory-smush-disabled' );\n\t\t},\n\n\t\tresume() {\n\t\t\tconst dialog = jQuery( '#wp-smush-progress-dialog' );\n\t\t\tconst resume = dialog.find( '#cancel-directory-smush-disabled' );\n\n\t\t\tdialog.removeClass( 'wp-smush-exceed-limit' );\n\t\t\tdialog\n\t\t\t\t.find( '.sui-box-body .sui-icon-play' )\n\t\t\t\t.removeClass( 'sui-icon-play' )\n\t\t\t\t.addClass( 'sui-icon-close' );\n\t\t\tresume.attr( 'data-tooltip', 'Cancel' );\n\t\t\tresume.attr( 'id', 'cancel-directory-smush' );\n\n\t\t\tobj.scan();\n\t\t},\n\t};\n\n\t/**\n\t * Execute a scan step recursively\n\t *\n\t * Private to avoid overriding\n\t *\n\t * @param {number} remainingSteps\n\t */\n\tconst step = function( remainingSteps ) {\n\t\tif ( remainingSteps >= 0 ) {\n\t\t\tcurrentStep = totalSteps - remainingSteps;\n\t\t\treturn jQuery.post(\n\t\t\t\tajaxurl,\n\t\t\t\t{\n\t\t\t\t\taction: 'directory_smush_check_step',\n\t\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t\t\tstep: currentStep,\n\t\t\t\t},\n\t\t\t\t( response ) => {\n\t\t\t\t\t// We're good - continue on.\n\t\t\t\t\tif (\n\t\t\t\t\t\t'undefined' !== typeof response.success &&\n\t\t\t\t\t\tresponse.success\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t'undefined' !== typeof response.data &&\n\t\t\t\t\t\t\t'undefined' !== typeof response.data.skipped &&\n\t\t\t\t\t\t\ttrue === response.data.skipped\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tskippedItems++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep( remainingSteps ).fail( obj.showScanError );\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t'undefined' !== typeof response.data.error &&\n\t\t\t\t\t\t'dir_smush_limit_exceeded' === response.data.error\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Limit reached. Stop.\n\t\t\t\t\t\tobj.limitReached();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Error? never mind, continue, but count them.\n\t\t\t\t\t\tfailedItems++;\n\t\t\t\t\t\tcurrentStep++;\n\t\t\t\t\t\tremainingSteps = remainingSteps - 1;\n\t\t\t\t\t\tobj.onFinishStep( obj.getProgress() );\n\t\t\t\t\t\tstep( remainingSteps ).fail( obj.showScanError );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\treturn jQuery.post(\n\t\t\tajaxurl,\n\t\t\t{\n\t\t\t\taction: 'directory_smush_finish',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t\titems: totalSteps - ( failedItems + skippedItems ),\n\t\t\t\tfailed: failedItems,\n\t\t\t\tskipped: skippedItems,\n\t\t\t},\n\t\t\t( response ) => obj.onFinish( response )\n\t\t);\n\t};\n\n\treturn obj;\n};\n\nexport default DirectoryScanner;\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global wp_smush_msgs */\n\n/**\n * Helpers functions.\n *\n * @since 2.9.0 Moved from admin.js\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.helpers = {\n\t\tinit: () => {},\n\t\tcacheUpsellErrorCodes: [],\n\n\t\t/**\n\t\t * Convert bytes to human-readable form.\n\t\t *\n\t\t * @param {number} a Bytes\n\t\t * @param {number} b Number of digits\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tformatBytes: ( a, b ) => {\n\t\t\tconst thresh = 1024,\n\t\t\t\tunits = [ 'KB', 'MB', 'GB', 'TB', 'PB' ];\n\n\t\t\tif ( Math.abs( a ) < thresh ) {\n\t\t\t\treturn a + ' B';\n\t\t\t}\n\n\t\t\tlet u = -1;\n\n\t\t\tdo {\n\t\t\t\ta /= thresh;\n\t\t\t\t++u;\n\t\t\t} while ( Math.abs( a ) >= thresh && u < units.length - 1 );\n\n\t\t\treturn a.toFixed( b ) + ' ' + units[ u ];\n\t\t},\n\n\t\t/**\n\t\t * Get size from a string.\n\t\t *\n\t\t * @param {string} formattedSize Formatter string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetSizeFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[a-zA-Z]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Get type from formatted string.\n\t\t *\n\t\t * @param {string} formattedSize Formatted string\n\t\t * @return {*} Formatted Bytes\n\t\t */\n\t\tgetFormatFromString: ( formattedSize ) => {\n\t\t\treturn formattedSize.replace( /[0-9.]/g, '' ).trim();\n\t\t},\n\n\t\t/**\n\t\t * Stackoverflow: http://stackoverflow.com/questions/1726630/formatting-a-number-with-exactly-two-decimals-in-javascript\n\t\t *\n\t\t * @param {number} num\n\t\t * @param {number} decimals\n\t\t * @return {number} Number\n\t\t */\n\t\tprecise_round: ( num, decimals ) => {\n\t\t\tconst sign = num >= 0 ? 1 : -1;\n\t\t\t// Keep the percentage below 100.\n\t\t\tnum = num > 100 ? 100 : num;\n\t\t\treturn (\n\t\t\t\tMath.round( num * Math.pow( 10, decimals ) + sign * 0.001 ) /\n\t\t\t\tMath.pow( 10, decimals )\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Displays a floating error message using the #wp-smush-ajax-notice container.\n\t\t *\n\t\t * @since 3.8.0\n\t\t *\n\t\t * @param {string} message\n\t\t */\n\t\tshowErrorNotice: ( message ) => {\n\t\t\tif ( 'undefined' === typeof message ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst noticeMessage = `<p>${ message }</p>`,\n\t\t\t\tnoticeOptions = {\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\ticon: 'info',\n\t\t\t\t};\n\n\t\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\n\t\t\tconst loadingButton = document.querySelector( '.sui-button-onload' );\n\t\t\tif ( loadingButton ) {\n\t\t\t\tloadingButton.classList.remove( 'sui-button-onload' );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Reset settings.\n\t\t *\n\t\t * @since 3.2.0\n\t\t */\n\t\tresetSettings: () => {\n\t\t\tconst _nonce = document.getElementById( 'wp_smush_reset' );\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=reset_settings', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.href = wp_smush_msgs.smush_url;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send( '_ajax_nonce=' + _nonce.value );\n\t\t},\n\n\t\t/**\n\t\t * Prepare error row. Will only allow to hide errors for WP media attachments (not nextgen).\n\t\t *\n\t\t * @since 1.9.0\n\t\t * @since 3.12.0 Moved from Smush.\n\t\t *\n\t\t * @param {string} errorMsg Error message.\n\t\t * @param {string} fileName File name.\n\t\t * @param {string} thumbnail Thumbnail for image (if available).\n\t\t * @param {number} id Image ID.\n\t\t * @param {string} type Smush type: media or netxgen.\n\t\t * @param {string} errorCode Error code.\n\t\t *\n\t\t * @return {string} Row with error.\n\t\t */\n\t\t prepareBulkSmushErrorRow: (errorMsg, fileName, thumbnail, id, type, errorCode) => {\n\t\t\tconst thumbDiv =\n\t\t\tthumbnail && 'undefined' !== typeof thumbnail ?\n\t\t\t\t`<img class=\"attachment-thumbnail\" src=\"${thumbnail}\" />` :\n\t\t\t\t'<i class=\"sui-icon-photo-picture\" aria-hidden=\"true\"></i>';\n\t\t\tconst editLink = window.wp_smush_msgs.edit_link.replace('{{id}}', id);\n\t\t\tfileName =\n\t\t\t\t'undefined' === fileName || 'undefined' === typeof fileName ?\n\t\t\t\t'undefined' :\n\t\t\t\tfileName;\n\n\t\t\tlet tableDiv =\n\t\t\t\t`<div class=\"smush-bulk-error-row\" data-error-code=\"${errorCode}\">\n\t\t\t\t\t<div class=\"smush-bulk-image-data\">\n\t\t\t\t\t\t<div class=\"smush-bulk-image-title\">\n\t\t\t\t\t\t\t${ thumbDiv }\n\t\t\t\t\t\t\t<span class=\"smush-image-name\">\n\t\t\t\t\t\t\t\t<a href=\"${editLink}\">${fileName}</a>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"smush-image-error\">\n\t\t\t\t\t\t${errorMsg}\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\n\t\t\tif ('media' === type) {\n\t\t\t\ttableDiv +=\n\t\t\t\t\t`<div class=\"smush-bulk-image-actions\">\n\t\t\t\t\t\t<a href=\"javascript:void(0)\" class=\"sui-tooltip sui-tooltip-constrained sui-tooltip-left smush-ignore-image\" data-tooltip=\"${window.wp_smush_msgs.error_ignore}\" data-id=\"${id}\">\n\t\t\t\t\t\t\t${window.wp_smush_msgs.btn_ignore}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<a class=\"smush-link-detail\" href=\"${editLink}\">\n\t\t\t\t\t\t\t${window.wp_smush_msgs.view_detail}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>`;\n\t\t\t}\n\n\t\t\ttableDiv += '</div>';\n\n\t\t\ttableDiv += WP_Smush.helpers.upsellWithError( errorCode );\n\n\t\t\treturn tableDiv;\n\t\t},\n\t\tcacheUpsellErrorCode( errorCode ) {\n\t\t\tthis.cacheUpsellErrorCodes.push( errorCode );\n\t\t},\n\t\t/**\n\t\t * Get upsell base on error code.\n\t\t * @param {string} errorCode Error code.\n\t\t * @returns {string}\n\t\t */\n\t\tupsellWithError(errorCode) {\n\t\t\tif (\n\t\t\t\t!errorCode\n\t\t\t\t|| !window.wp_smush_msgs['error_' + errorCode]\n\t\t\t\t|| this.isUpsellRendered( errorCode )\n\t\t\t) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tthis.cacheRenderedUpsell( errorCode );\n\t\t\t\n\t\t\treturn '<div class=\"smush-bulk-error-row smush-error-upsell\">' +\n\t\t\t\t'<div class=\"smush-bulk-image-title\">' +\n\t\t\t\t'<span class=\"smush-image-error\">' +\n\t\t\t\twindow.wp_smush_msgs['error_' + errorCode] +\n\t\t\t\t'</span>' +\n\t\t\t\t'</div></div>';\n\t\t},\n\t\t// Do not use arrow function to use `this`.\n\t\tisUpsellRendered( errorCode ) {\n\t\t\treturn this.cacheUpsellErrorCodes.includes( errorCode );\n\t\t},\n\t\t// Do not use arrow function to use `this`.\n\t\tcacheRenderedUpsell( errorCode ) {\n\t\t\tthis.cacheUpsellErrorCodes.push( errorCode );\n\t\t},\n\t\t/**\n\t\t * Get error message from Ajax response or Error. \n\t\t * @param {Object} resp\n\t\t */\n\t\tgetErrorMessage: ( resp ) => {\n\t\t\treturn resp.message || resp.data && resp.data.message ||\n\t\t\t\tresp.responseJSON && resp.responseJSON.data && resp.responseJSON.data.message ||\n\t\t\t\twindow.wp_smush_msgs.generic_ajax_error ||\n\t\t\t\tresp.status && 'Request failed. Returned status of ' + resp.status\n\t\t},\n\n\t\t/**\n\t\t * Displays a floating message from response,\n\t\t * using the #wp-smush-ajax-notice container.\n\t\t *\n\t\t * @param {Object|string} notice\n\t\t * @param {Object} \t\t noticeOptions\n\t\t */\n\t\tshowNotice: function( notice, noticeOptions ) {\n\t\t\tlet message;\n\t\t\tif ( 'object' === typeof notice ) {\n\t\t\t\tmessage = this.getErrorMessage( notice );\n\t\t\t} else {\n\t\t\t\tmessage = notice;\n\t\t\t}\n\n\t\t\tif ( ! message ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnoticeOptions = noticeOptions || {};\n\t\t\tnoticeOptions = Object.assign({\n\t\t\t\tshowdismiss: false,\n\t\t\t\tautoclose: true,\n\t\t\t},noticeOptions);\n\t\t\tnoticeOptions = {\n\t\t\t\ttype: noticeOptions.type || 'error',\n\t\t\t\ticon: noticeOptions.icon || ( 'success' === noticeOptions.type ? 'check-tick' : 'info' ),\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: noticeOptions.showdismiss,\n\t\t\t\t\tlabel: window.wp_smush_msgs.noticeDismiss,\n\t\t\t\t\ttooltip: window.wp_smush_msgs.noticeDismissTooltip,\n\t\t\t\t},\n\t\t\t\tautoclose: {\n\t\t\t\t\tshow: noticeOptions.autoclose\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst noticeMessage = `<p>${ message }</p>`;\n\n\t\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\t\t\treturn Promise.resolve( '#wp-smush-ajax-notice' );\n\t\t},\n\t\tcloseNotice() {\n\t\t\twindow.SUI.closeNotice( 'wp-smush-ajax-notice' );\n\t\t},\n\t\trenderActivationCDNNotice: function( noticeMessage ) {\n\t\t\tconst animatedNotice = document.getElementById('wp-smush-animated-upsell-notice');\n\t\t\tif ( animatedNotice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst upsellHtml = `<div class=\"sui-notice sui-notice-info sui-margin-top\" id=\"wp-smush-animated-upsell-notice\">\n\t\t\t\t\t\t\t\t\t<div class=\"sui-notice-content\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"sui-notice-message\">\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"sui-notice-icon sui-icon-info\" aria-hidden=\"true\"></i>\n\t\t\t\t\t\t\t\t\t\t\t<p>${noticeMessage}</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>`;\n\t\t\tdocument.querySelector( '#smush-box-bulk .wp-smush-bulk-wrapper' ).outerHTML += upsellHtml;\n\t\t}\n\t};\n\n\tWP_Smush.helpers.init();\n}() );\n","/* global WP_Smush */\n\n/**\n * Scan Media Library.\n *\n */\nimport SmushProgress from '../common/progressbar';\nimport MediaLibraryScanner from '../common/media-library-scanner';\nimport { GlobalStats } from '../common/globalStats';\n\n( function() {\n\t'use strict';\n\tif ( ! window.wp_smush_msgs ) {\n\t\treturn;\n\t}\n\tconst $ = document.querySelector.bind( document );\n\tconst existScanProgressBar = $( '.wp-smush-scan-progress-bar-wrapper' );\n\tif ( ! existScanProgressBar ) {\n\t\treturn;\n\t}\n\n\tconst recheckImagesBtn = $( '.wp-smush-scan' );\n\tif ( ! recheckImagesBtn ) {\n\t\treturn;\n\t}\n\tconst bulkSmushButton = $( '.wp-smush-bo-start' ) || $( '.wp-smush-bulk-wrapper .wp-smush-all' );\n\tconst { __ } = wp.i18n;\n\n\tclass MediaLibraryScannerOnBulkSmush extends MediaLibraryScanner {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.runBulkSmushOnComplete = false;\n\t\t\tthis.restoreButton = $( '.wp-smush-restore' );\n\t\t\tthis.autoBulkSmushNotification = $( '.wp-smush-auto-bulk-smush-notification' );\n\t\t}\n\n\t\tstartScanThenBulkSmushOnComplete() {\n\t\t\tthis.runBulkSmushOnComplete = true;\n\t\t\treturn this.startScan( true );\n\t\t}\n\n\t\tonStart() {\n\t\t\tthis.hideRecheckNotice();\n\t\t\tthis.disableRelatedButtons();\n\t\t\tthis.setRecheckImagesButtonOnLoad();\n\t\t\tthis.toggleBulkSmushBoxContent();\n\t\t\treturn this;\n\t\t}\n\n\t\tonStartFailure( response ) {\n\t\t\tsuper.onStartFailure( response );\n\t\t\tthis.revertRelatedButtons();\n\t\t}\n\n\t\tonCloseProgressBar() {\n\t\t\tthis.maybeHideAutoBulkSmushNotification();\n\t\t}\n\n\t\tdisableRelatedButtons() {\n\t\t\tthis.restoreButton.setAttribute( 'disabled', true );\n\t\t\tif ( bulkSmushButton ) {\n\t\t\t\tbulkSmushButton.setAttribute( 'disabled', true );\n\t\t\t\tthis.setInnerText( bulkSmushButton, __( 'Waiting for Re-check to finish', 'wp-smushit' ) );\n\t\t\t}\n\t\t}\n\n\t\trevertRelatedButtons() {\n\t\t\tif ( bulkSmushButton ) {\n\t\t\t\tbulkSmushButton.removeAttribute( 'disabled' );\n\t\t\t\tthis.revertInnerText( bulkSmushButton );\n\t\t\t}\n\t\t\tthis.restoreButton.removeAttribute( 'disabled' );\n\t\t\tthis.revertRecheckImagesButton();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRecheckImagesButtonOnLoad() {\n\t\t\t// recheckImagesBtn.classList.add( 'sui-button-onload' );\n\t\t\tthis.disableRecheckImagesButton();\n\t\t\tthis.setInnerText( recheckImagesBtn.querySelector( '.wp-smush-inner-text' ), __( 'Checking Images', 'wp-smushit' ) );\n\t\t}\n\n\t\tdisableRecheckImagesButton() {\n\t\t\trecheckImagesBtn.setAttribute( 'disabled', true );\n\t\t}\n\n\t\trevertRecheckImagesButton() {\n\t\t\t// recheckImagesBtn.classList.remove( 'sui-button-onload' );\n\t\t\trecheckImagesBtn.removeAttribute( 'disabled' );\n\t\t\tthis.revertInnerText( recheckImagesBtn.querySelector( '.wp-smush-inner-text' ) );\n\t\t}\n\n\t\tbeforeUpdateStatus( stats ) {\n\t\t\tthis.runBulkSmushOnComplete = stats?.optimize_on_scan_completed;\n\t\t\tthis.maybeShowAutoBulkSmushNotification();\n\t\t}\n\n\t\tonDead( stats ) {\n\t\t\tsuper.onDead( stats );\n\t\t\tthis.revertRelatedButtons();\n\t\t\tthis.setRequiredScanForBulkSmushButton();\n\t\t}\n\n\t\tonFinish( stats ) {\n\t\t\tconst globalStats = stats.global_stats;\n\t\t\tsuper.onFinish( stats );\n\t\t\tthis.revertRelatedButtons();\n\t\t\tthis.toggleBulkSmushDescription( globalStats );\n\t\t\tif ( globalStats.is_outdated ) {\n\t\t\t\tthis.setRequiredScanForBulkSmushButton();\n\t\t\t} else {\n\t\t\t\tthis.removeScanEventFromBulkSmushButton();\n\t\t\t}\n\n\t\t\tthis.revertRecheckWarning();\n\t\t}\n\n\t\tonCompleted( stats ) {\n\t\t\tconst requiredReloadPage = ! bulkSmushButton;\n\t\t\tif ( requiredReloadPage ) {\n\t\t\t\twindow.location.reload();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.onFinish( stats );\n\t\t\tconst globalStats = stats.global_stats;\n\t\t\tconst allImagesSmushed = globalStats.remaining_count < 1;\n\t\t\tif ( allImagesSmushed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! this.runBulkSmushOnComplete ) {\n\t\t\t\tthis.showRecheckNoticeSuccess();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.runBulkSmushOnComplete = false;\n\n\t\t\tthis.triggerBulkSmushEvent( stats );\n\t\t}\n\n\t\tshowNotice( stats ) {\n\t\t\tif ( ! stats.notice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet type = 'success';\n\t\t\tif ( 'undefined' !== typeof stats.noticeType ) {\n\t\t\t\ttype = stats.noticeType;\n\t\t\t}\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\t'<p>' + stats.notice + '</p>',\n\t\t\t\t{ type, icon: 'check-tick' }\n\t\t\t);\n\t\t}\n\n\t\tshowRecheckNoticeSuccess() {\n\t\t\tconst recheckNotice = $( '.wp-smush-recheck-images-notice-box' );\n\t\t\tif ( ! recheckNotice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showAnElement( recheckNotice );\n\t\t\tthis.hideAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-warning' ) );\n\t\t\tthis.showAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-success' ) );\n\t\t}\n\n\t\tshowRecheckNoticeWarning() {\n\t\t\tconst recheckNotice = $( '.wp-smush-recheck-images-notice-box' );\n\t\t\tif ( ! recheckNotice ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showAnElement( recheckNotice );\n\t\t\tthis.hideAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-success' ) );\n\t\t\tthis.showAnElement( recheckNotice.querySelector( '.wp-smush-recheck-images-notice-warning' ) );\n\t\t}\n\n\t\thideRecheckNotice() {\n\t\t\tthis.hideAnElement( $( '.wp-smush-recheck-images-notice-box' ) );\n\t\t}\n\n\t\tshowProgressErrorNoticeOnRecheckNotice() {\n\t\t\tconst recheckWarningElement = $( '.wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning' );\n\t\t\tif ( ! recheckWarningElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trecheckWarningElement.classList.add( 'sui-notice-error' );\n\t\t\trecheckWarningElement.classList.remove( 'sui-notice-warning' );\n\t\t\tthis.setInnerText( recheckWarningElement.querySelector( 'span' ), this.getErrorProgressMessage() );\n\t\t\tthis.showRecheckNoticeWarning();\n\t\t}\n\n\t\trevertRecheckWarning() {\n\t\t\tconst recheckWarningElement = $( '.wp-smush-recheck-images-notice-box .wp-smush-recheck-images-notice-warning' );\n\t\t\tif ( ! recheckWarningElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trecheckWarningElement.classList.add( 'sui-notice-warning' );\n\t\t\trecheckWarningElement.classList.remove( 'sui-notice-error' );\n\t\t\tthis.revertInnerText( recheckWarningElement.querySelector( 'span' ) );\n\t\t}\n\n\t\ttriggerBulkSmushEvent( stats ) {\n\t\t\tthis.disableRecheckImagesButton();\n\n\t\t\tif ( stats.enabled_background_process ) {\n\t\t\t\tthis.triggerBackgroundBulkSmushEvent( stats.global_stats );\n\t\t\t} else {\n\t\t\t\tthis.triggerAjaxBulkSmushEvent( stats.global_stats );\n\t\t\t}\n\t\t}\n\n\t\ttoggleBulkSmushDescription( globalStats ) {\n\t\t\tif ( SmushProgress.isEmptyObject ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( globalStats.remaining_count < 1 ) {\n\t\t\t\tSmushProgress.hideBulkSmushDescription();\n\t\t\t\tSmushProgress.showBulkSmushAllDone();\n\t\t\t} else {\n\t\t\t\tSmushProgress.showBulkSmushDescription();\n\t\t\t\tSmushProgress.hideBulkSmushAllDone();\n\t\t\t}\n\t\t}\n\n\t\tsetRequiredScanForBulkSmushButton() {\n\t\t\tbulkSmushButton && bulkSmushButton.classList.add( 'wp-smush-scan-and-bulk-smush' );\n\t\t}\n\n\t\tremoveScanEventFromBulkSmushButton() {\n\t\t\tbulkSmushButton && bulkSmushButton.classList.remove( 'wp-smush-scan-and-bulk-smush' );\n\t\t}\n\n\t\ttriggerBackgroundBulkSmushEvent( globalStats ) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( 'backgroundBulkSmushOnScanCompleted', {\n\t\t\t\t\tdetail: globalStats\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\ttriggerAjaxBulkSmushEvent( globalStats ) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( 'ajaxBulkSmushOnScanCompleted', {\n\t\t\t\t\tdetail: globalStats\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tonCancelled( stats ) {\n\t\t\tthis.onFinish( stats );\n\t\t\tthis.runBulkSmushOnComplete = false;\n\t\t\tthis.setRequiredScanForBulkSmushButton();\n\t\t}\n\n\t\tmaybeShowAutoBulkSmushNotification() {\n\t\t\tif (\n\t\t\t\t! this.runBulkSmushOnComplete\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showAnElement( this.autoBulkSmushNotification );\n\t\t}\n\n\t\tmaybeHideAutoBulkSmushNotification() {\n\t\t\tif (\n\t\t\t\t! this.runBulkSmushOnComplete\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.hideAnElement( this.autoBulkSmushNotification );\n\t\t}\n\n\t\ttoggleBulkSmushBoxContent() {\n\t\t\tGlobalStats.resetAndHideBulkErrors();\n\t\t\tthis.toggleBulkSmushDescription( GlobalStats.getGlobalStats() );\n\t\t}\n\t}\n\tconst mediaLibScanner = new MediaLibraryScannerOnBulkSmush();\n\n\t/**\n\t * Event Listeners.\n\t */\n\n\t// Background Scan Media Library.\n\tconst registerScanMediaLibraryEvent = () => {\n\t\tif ( ! recheckImagesBtn ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst canScanInBackground = recheckImagesBtn.classList.contains( 'wp-smush-background-scan' );\n\t\tif ( ! canScanInBackground ) {\n\t\t\treturn;\n\t\t}\n\n\t\trecheckImagesBtn.addEventListener( 'click', () => mediaLibScanner.startScan() );\n\n\t\t//Check scan is running.\n\t\tif ( window.wp_smushit_data.media_library_scan?.in_processing ) {\n\t\t\tmediaLibScanner.onStart().showProgressBar().autoSyncStatus();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( window.location.search.includes( 'smush-action=start-scan-media' ) ) {\n\t\t\trecheckImagesBtn.click();\n\t\t\tconst removeScanActionFromURLAddress = () => {\n\t\t\t\tconst cleanedURL = window.location.href.replace( '&smush-action=start-scan-media', '' );\n\t\t\t\twindow.history.pushState( null, null, cleanedURL );\n\t\t\t};\n\t\t\tremoveScanActionFromURLAddress();\n\t\t}\n\t};\n\tregisterScanMediaLibraryEvent();\n\n\t/**\n\t * Recheck Images Notice events.\n\t */\n\tconst registerEventsRelatedRecheckImagesNotice = () => {\n\t\tconst recheckImagesNotice = $( '.wp-smush-recheck-images-notice-box' );\n\t\tif ( ! recheckImagesNotice || ! recheckImagesBtn ) {\n\t\t\treturn;\n\t\t}\n\t\tconst triggerBackgroundScanImagesLink = recheckImagesNotice.querySelector( '.wp-smush-trigger-background-scan' );\n\t\tif ( triggerBackgroundScanImagesLink ) {\n\t\t\ttriggerBackgroundScanImagesLink.onclick = ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\trecheckImagesBtn.click();\n\t\t\t};\n\n\t\t\tif ( window.wp_smushit_data.media_library_scan?.is_dead ) {\n\t\t\t\tmediaLibScanner.showProgressErrorNoticeOnRecheckNotice();\n\t\t\t} else if( window.wp_smushit_data.is_outdated ) {\n\t\t\t\tmediaLibScanner.showRecheckNoticeWarning();\n\t\t\t}\n\t\t}\n\t\tconst triggerBulkSmush = recheckImagesNotice.querySelector( '.wp-smush-trigger-bulk-smush' );\n\t\tif ( triggerBulkSmush && bulkSmushButton ) {\n\t\t\ttriggerBulkSmush.onclick = ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\trecheckImagesNotice.classList.add( 'sui-hidden' );\n\t\t\t\tbulkSmushButton.click();\n\t\t\t};\n\t\t}\n\t\tconst dismissNotices = recheckImagesNotice.querySelectorAll( 'button.sui-button-icon' );\n\t\tif ( dismissNotices ) {\n\t\t\tdismissNotices.forEach( ( dismissNotice ) => {\n\t\t\t\tdismissNotice.onclick = ( e ) => {\n\t\t\t\t\tdismissNotice.closest( '.sui-recheck-images-notice' ).classList.add( 'sui-hidden' );\n\t\t\t\t};\n\t\t\t} );\n\t\t}\n\n\t\tdocument.addEventListener( 'onSavedSmushSettings', function( e ) {\n\t\t\tif ( ! e?.detail?.is_outdated_stats ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmediaLibScanner.setRequiredScanForBulkSmushButton();\n\n\t\t\trecheckImagesNotice.classList.remove( 'sui-hidden' );\n\t\t\trecheckImagesNotice.querySelector( '.wp-smush-recheck-images-notice-success' ).classList.add( 'sui-hidden' );\n\t\t\trecheckImagesNotice.querySelector( '.wp-smush-recheck-images-notice-warning' ).classList.remove( 'sui-hidden' );\n\t\t} );\n\t};\n\n\tregisterEventsRelatedRecheckImagesNotice();\n\n\t// Scan and Bulk Smush.\n\tconst registerScanAndBulkSmushEvent = () => {\n\t\tif ( ! bulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handleScanAndBulkSmush = ( e ) => {\n\t\t\tconst shouldRunScan = bulkSmushButton.classList.contains( 'wp-smush-scan-and-bulk-smush' );\n\t\t\tif ( ! shouldRunScan ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\te.preventDefault();\n\t\t\tmediaLibScanner.startScanThenBulkSmushOnComplete();\n\t\t};\n\n\t\tbulkSmushButton.addEventListener( 'click', handleScanAndBulkSmush );\n\t};\n\tregisterScanAndBulkSmushEvent();\n}() );\n","/* global WP_Smush */\n\n/**\n * Scan Media Library.\n *\n */\nimport MediaLibraryScanner from '../common/media-library-scanner';\n\n( function() {\n\t'use strict';\n\tif ( ! window.wp_smush_msgs ) {\n\t\treturn;\n\t}\n\tconst $ = document.querySelector.bind( document );\n\tconst existScanProgressBar = $( '.wp-smush-scan-progress-bar-wrapper' );\n\tif ( ! existScanProgressBar ) {\n\t\treturn;\n\t}\n\n\tconst recheckImagesBtn = $( '.wp-smush-scan' );\n\tif ( recheckImagesBtn ) {\n\t\treturn;\n\t}\n\t//Check scan is running.\n\tconst is_scan_running = window.wp_smushit_data.media_library_scan?.in_processing;\n\tif ( ! is_scan_running ) {\n\t\treturn;\n\t}\n\n\tconst { __ } = wp.i18n;\n\n\tclass mediaLibraryScannerOnDashboard extends MediaLibraryScanner {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.bulkSmushLink = $( '.wp-smush-bulk-smush-link' );\n\t\t}\n\t\tonShowProgressBar() {\n\t\t\tthis.disableBulkSmushLink();\n\t\t}\n\n\t\tonCloseProgressBar() {\n\t\t\tthis.revertBulkSmushLink();\n\t\t}\n\n\t\tdisableBulkSmushLink() {\n\t\t\tif ( ! this.bulkSmushLink ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.bulkSmushLink.setAttribute( 'disabled', true );\n\t\t\tthis.setInnerText( this.bulkSmushLink, __( 'Waiting for Re-check to finish', 'wp-smushit' ) );\n\t\t}\n\n\t\trevertBulkSmushLink() {\n\t\t\tif ( ! this.bulkSmushLink ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.bulkSmushLink.removeAttribute( 'disabled' );\n\t\t\tthis.revertInnerText( this.bulkSmushLink );\n\t\t}\n\t}\n\n\t( new mediaLibraryScannerOnDashboard() ).showProgressBar().autoSyncStatus();\n}() );\n","import Smush from '../smush/smush';\nimport SmushProcess from '../common/progressbar';\n\n(function($) {\n $(function() {\n /** Handle NextGen Gallery smush button click **/\n $('body').on('click', '.wp-smush-nextgen-send', function (e) {\n // prevent the default action\n e.preventDefault();\n new Smush($(this), false, 'nextgen');\n });\n\n /** Handle NextGen Gallery Bulk smush button click **/\n $('body').on('click', '.wp-smush-nextgen-bulk', function (e) {\n // prevent the default action\n e.preventDefault();\n\n // Remove existing Re-Smush notices.\n // TODO: REMOVE re-smush-notice since no longer used.\n $('.wp-smush-resmush-notice').remove();\n\n //Check for ids, if there is none (Unsmushed or lossless), don't call smush function\n if (\n 'undefined' === typeof wp_smushit_data ||\n (wp_smushit_data.unsmushed.length === 0 &&\n wp_smushit_data.resmush.length === 0)\n ) {\n return false;\n }\n\n const bulkSmush = new Smush( $(this), true, 'nextgen' );\n\t\t\tSmushProcess.setOnCancelCallback( () => {\n\t\t\t\tbulkSmush.cancelAjax();\n\t\t\t}).update( 0, bulkSmush.ids.length ).show();\n\n jQuery('.wp-smush-all, .wp-smush-scan').prop('disabled', true);\n $('.wp-smush-notice.wp-smush-remaining').hide();\n\n\t\t\t// Run bulk Smush.\n\t\t\tbulkSmush.run();\n })\n .on('click', '.wp-smush-trigger-nextgen-bulk', function(e){\n e.preventDefault();\n const bulkSmushButton = $('.wp-smush-nextgen-bulk');\n if ( bulkSmushButton.length ) {\n bulkSmushButton.trigger('click');\n SUI.closeNotice( 'wp-smush-ajax-notice' );\n }\n });\n\n });\n}(window.jQuery));","/* global ajaxurl */\n/* global wp_smush_msgs */\n\n( function( $ ) {\n\t'use strict';\n\n\tconst s3alert = $( '#wp-smush-s3support-alert' );\n\n\t/**\n\t * S3 support alert.\n\t *\n\t * @since 3.6.2 Moved from class-s3.php\n\t */\n\tif ( s3alert.length ) {\n\t\tconst noticeOptions = {\n\t\t\ttype: 'warning',\n\t\t\ticon: 'info',\n\t\t\tdismiss: {\n\t\t\t\tshow: true,\n\t\t\t\tlabel: wp_smush_msgs.noticeDismiss,\n\t\t\t\ttooltip: wp_smush_msgs.noticeDismissTooltip,\n\t\t\t},\n\t\t};\n\n\t\twindow.SUI.openNotice(\n\t\t\t'wp-smush-s3support-alert',\n\t\t\ts3alert.data( 'message' ),\n\t\t\tnoticeOptions\n\t\t);\n\t}\n\n\t// Dismiss S3 support alert.\n\ts3alert.on( 'click', 'button', () => {\n\t\t$.post( ajaxurl,\n\t\t\t{\n\t\t\t\taction: 'dismiss_s3support_alert',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t}\n\t\t);\n\t} );\n\n\t// Remove API message.\n\t$( '#wp-smush-api-message button.sui-button-icon' ).on( 'click', function( e ) {\n\t\te.preventDefault();\n\t\tconst notice = $( '#wp-smush-api-message' );\n\t\tnotice.slideUp( 'slow', function() {\n\t\t\tnotice.remove();\n\t\t} );\n\t\t$.post( ajaxurl,\n\t\t\t{\n\t\t\t\taction: 'hide_api_message',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t}\n\t\t);\n\t} );\n\n\t// Hide the notice after a CTA button was clicked\n\tfunction removeNotice( e ) {\n\t\tconst $notice = $( e.currentTarget ).closest( '.smush-notice' );\n\t\t$notice.fadeTo( 100, 0, () =>\n\t\t\t$notice.slideUp( 100, () => $notice.remove() )\n\t\t);\n\t}\n\n\t// Only used for the Dashboard notification for now.\n\t$( '.smush-notice .smush-notice-act' ).on( 'click', ( e ) => {\n\t\tremoveNotice( e );\n\t} );\n\n\t// Dismiss the update notice.\n\t$( '.wp-smush-update-info' ).on( 'click', '.notice-dismiss', ( e ) => {\n\t\te.preventDefault();\n\t\tremoveNotice( e );\n\t\t$.post( ajaxurl,\n\t\t\t{\n\t\t\t\taction: 'dismiss_update_info',\n\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t}\n\t\t);\n\t} );\n}( jQuery ) );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Modals JavaScript code.\n */\n( function() {\n\t'use strict';\n\n\t/**\n\t * Onboarding modal.\n\t *\n\t * @since 3.1\n\t */\n\tWP_Smush.onboarding = {\n\t\tmembership: 'free', // Assume free by default.\n\t\tonboardingModal: document.getElementById( 'smush-onboarding-dialog' ),\n\t\tfirst_slide: 'usage',\n\t\tsettings: {\n\t\t\tfirst: true,\n\t\t\tlast: false,\n\t\t\tslide: 'usage',\n\t\t\tvalue: false,\n\t\t},\n\t\tselection: {\n\t\t\tusage: false,\n\t\t\tauto: true,\n\t\t\tlossy: true,\n\t\t\tstrip_exif: true,\n\t\t\toriginal: false,\n\t\t\tlazy_load: true,\n\t\t},\n\t\tcontentContainer: document.getElementById( 'smush-onboarding-content' ),\n\t\tonboardingSlides: [\n\t\t\t'usage',\n\t\t\t'auto',\n\t\t\t'lossy',\n\t\t\t'strip_exif',\n\t\t\t'original',\n\t\t\t'lazy_load',\n\t\t],\n\t\ttouchX: null,\n\t\ttouchY: null,\n\t\trecheckImagesLink: '',\n\t\t/**\n\t\t * Init module.\n\t\t */\n\t\tinit() {\n\t\t\tif ( ! this.onboardingModal ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst dialog = document.getElementById( 'smush-onboarding' );\n\n\t\t\tthis.membership = dialog.dataset.type;\n\t\t\tthis.recheckImagesLink = dialog.dataset.ctaUrl;\n\n\t\t\tif ( 'pro' !== this.membership ) {\n\t\t\t\tthis.onboardingSlides = [\n\t\t\t\t\t'usage',\n\t\t\t\t\t'auto',\n\t\t\t\t\t'lossy',\n\t\t\t\t\t'strip_exif',\n\t\t\t\t\t'lazy_load',\n\t\t\t\t];\n\t\t\t}\n\n\t\t\tif ( 'false' === dialog.dataset.tracking ) {\n\t\t\t\tthis.onboardingSlides.pop();\n\t\t\t}\n\n\t\t\tthis.renderTemplate();\n\n\t\t\t// Skip setup.\n\t\t\tconst skipButton = this.onboardingModal.querySelector(\n\t\t\t\t'.smush-onboarding-skip-link'\n\t\t\t);\n\t\t\tif ( skipButton ) {\n\t\t\t\tskipButton.addEventListener( 'click', this.skipSetup.bind( this ) );\n\t\t\t}\n\n\t\t\t// Show the modal.\n\t\t\twindow.SUI.openModal(\n\t\t\t\t'smush-onboarding-dialog',\n\t\t\t\t'wpcontent',\n\t\t\t\tundefined,\n\t\t\t\tfalse\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Get swipe coordinates.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchStart( e ) {\n\t\t\tconst firstTouch = e.touches[ 0 ];\n\t\t\tthis.touchX = firstTouch.clientX;\n\t\t\tthis.touchY = firstTouch.clientY;\n\t\t},\n\n\t\t/**\n\t\t * Process swipe left/right.\n\t\t *\n\t\t * @param {Object} e\n\t\t */\n\t\thandleTouchMove( e ) {\n\t\t\tif ( ! this.touchX || ! this.touchY ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst xUp = e.touches[ 0 ].clientX,\n\t\t\t\tyUp = e.touches[ 0 ].clientY,\n\t\t\t\txDiff = this.touchX - xUp,\n\t\t\t\tyDiff = this.touchY - yUp;\n\n\t\t\tif ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {\n\t\t\t\tif ( xDiff > 0 ) {\n\t\t\t\t\tif ( false === WP_Smush.onboarding.settings.last ) {\n\t\t\t\t\t\tWP_Smush.onboarding.next( null, 'next' );\n\t\t\t\t\t}\n\t\t\t\t} else if ( false === WP_Smush.onboarding.settings.first ) {\n\t\t\t\t\tWP_Smush.onboarding.next( null, 'prev' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.touchX = null;\n\t\t\tthis.touchY = null;\n\t\t},\n\n\t\t/**\n\t\t * Update the template, register new listeners.\n\t\t *\n\t\t * @param {string} directionClass Accepts: fadeInRight, fadeInLeft, none.\n\t\t */\n\t\trenderTemplate( directionClass = 'none' ) {\n\t\t\t// Grab the selected value.\n\t\t\tconst input = this.onboardingModal.querySelector(\n\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t);\n\t\t\tif ( input ) {\n\t\t\t\tthis.selection[ input.id ] = input.checked;\n\t\t\t}\n\n\t\t\tconst template = WP_Smush.onboarding.template( 'smush-onboarding' );\n\t\t\tconst content = template( this.settings );\n\n\t\t\tif ( content ) {\n\t\t\t\tthis.contentContainer.innerHTML = content;\n\n\t\t\t\tif ( 'none' === directionClass ) {\n\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.contentContainer.classList.remove( 'loaded' );\n\t\t\t\t\tthis.contentContainer.classList.add( directionClass );\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tthis.contentContainer.classList.add( 'loaded' );\n\t\t\t\t\t\tthis.contentContainer.classList.remove(\n\t\t\t\t\t\t\tdirectionClass\n\t\t\t\t\t\t);\n\t\t\t\t\t}, 600 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tthis.handleTouchStart,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tthis.onboardingModal.addEventListener(\n\t\t\t\t'touchmove',\n\t\t\t\tthis.handleTouchMove,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t\tthis.bindSubmit();\n\t\t},\n\n\t\t/**\n\t\t * Catch \"Finish setup wizard\" button click.\n\t\t */\n\t\tbindSubmit() {\n\t\t\tconst submitButton = this.onboardingModal.querySelector(\n\t\t\t\t'button[type=\"submit\"]'\n\t\t\t);\n\t\t\tconst self = this;\n\n\t\t\tif ( submitButton ) {\n\t\t\t\tsubmitButton.addEventListener( 'click', function( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t// Because we are not rendering the template, we need to update the last element value.\n\t\t\t\t\tconst input = self.onboardingModal.querySelector(\n\t\t\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t\t\t);\n\t\t\t\t\tif ( input ) {\n\t\t\t\t\t\tself.selection[ input.id ] = input.checked;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst _nonce = document.getElementById(\n\t\t\t\t\t\t'smush_quick_setup_nonce'\n\t\t\t\t\t);\n\n\t\t\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_setup', true );\n\t\t\t\t\txhr.setRequestHeader(\n\t\t\t\t\t\t'Content-type',\n\t\t\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t\t\t);\n\t\t\t\t\txhr.onload = () => {\n\t\t\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\t\t\tself.onFinishingSetup();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t\t\t'Request failed. Returned status of ' +\n\t\t\t\t\t\t\t\t\txhr.status\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\txhr.send(\n\t\t\t\t\t\t'smush_settings=' +\n\t\t\t\t\t\t\tJSON.stringify( self.selection ) +\n\t\t\t\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\t\t\t\t_nonce.value\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\n\t\tonFinishingSetup() {\n\t\t\tthis.onFinish();\n\t\t\tthis.startRecheckImages();\n\t\t},\n\n\t\tonFinish() {\n\t\t\twindow.SUI.closeModal();\n\t\t},\n\n\t\tstartRecheckImages() {\n\t\t\tif ( ! this.recheckImagesLink ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twindow.location.href = this.recheckImagesLink;\n\t\t},\n\n\t\t/**\n\t\t * Handle navigation.\n\t\t *\n\t\t * @param {Object} e\n\t\t * @param {null|string} whereTo\n\t\t */\n\t\tnext( e, whereTo = null ) {\n\t\t\tconst index = this.onboardingSlides.indexOf( this.settings.slide );\n\t\t\tlet newIndex = 0;\n\n\t\t\tif ( ! whereTo ) {\n\t\t\t\tnewIndex =\n\t\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t\t? index + 1\n\t\t\t\t\t\t: index - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 'next' === whereTo ? index + 1 : index - 1;\n\t\t\t}\n\n\t\t\tconst directionClass =\n\t\t\t\tnull !== e && e.classList.contains( 'next' )\n\t\t\t\t\t? 'fadeInRight'\n\t\t\t\t\t: 'fadeInLeft';\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: this.onboardingSlides[ newIndex ],\n\t\t\t\tvalue: this.selection[ this.onboardingSlides[ newIndex ] ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate( directionClass );\n\t\t},\n\n\t\t/**\n\t\t * Handle circle navigation.\n\t\t *\n\t\t * @param {string} target\n\t\t */\n\t\tgoTo( target ) {\n\t\t\tconst newIndex = this.onboardingSlides.indexOf( target );\n\n\t\t\tthis.settings = {\n\t\t\t\tfirst: 0 === newIndex,\n\t\t\t\tlast: newIndex + 1 === this.onboardingSlides.length, // length !== index\n\t\t\t\tslide: target,\n\t\t\t\tvalue: this.selection[ target ],\n\t\t\t};\n\n\t\t\tthis.renderTemplate();\n\t\t},\n\n\t\t/**\n\t\t * Skip onboarding experience.\n\t\t */\n\t\tskipSetup() {\n\t\t\tconst _nonce = document.getElementById( 'smush_quick_setup_nonce' );\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'POST',\n\t\t\t\tajaxurl + '?action=skip_smush_setup&_ajax_nonce=' + _nonce.value\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tthis.onSkipSetup();\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\n\t\tonSkipSetup() {\n\t\t\tthis.onFinish();\n\t\t},\n\n\t\t/**\n\t\t * Hide new features modal.\n\t\t * @since 3.7.0\n\t\t * @since 3.12.2 Add a new parameter redirectUrl\n\t\t */\n\t\thideUpgradeModal: ( e, button ) => {\n\t\t\te.preventDefault();\n\t\t\tbutton.classList.add( 'wp-smush-link-in-progress' );\n\t\t\tconst redirectUrl = button?.href;\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=hide_new_features&_ajax_nonce=' + window.wp_smush_msgs.nonce );\n\t\t\txhr.onload = () => {\n\t\t\t\twindow.SUI.closeModal();\n\t\t\t\tbutton.classList.remove( 'wp-smush-link-in-progress' );\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tif ( redirectUrl ) {\n\t\t\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twindow.console.log(\n\t\t\t\t\t\t'Request failed. Returned status of ' + xhr.status\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\t};\n\n\t/**\n\t * Template function (underscores based).\n\t *\n\t * @type {Function}\n\t */\n\tWP_Smush.onboarding.template = _.memoize( ( id ) => {\n\t\tlet compiled;\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g,\n\t\t\tvariable: 'data',\n\t\t};\n\n\t\treturn ( data ) => {\n\t\t\t_.templateSettings = options;\n\t\t\tcompiled =\n\t\t\t\tcompiled ||\n\t\t\t\t_.template( document.getElementById( id ).innerHTML );\n\t\t\tdata.first_slide = WP_Smush.onboarding.first_slide;\n\t\t\treturn compiled( data );\n\t\t};\n\t} );\n\n\twindow.addEventListener( 'load', () => WP_Smush.onboarding.init() );\n}() );\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * CDN functionality.\n *\n * @since 3.0\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.CDN = {\n\t\tcdnEnableButton: document.getElementById( 'smush-enable-cdn' ),\n\t\tcdnDisableButton: document.getElementById( 'smush-cancel-cdn' ),\n\t\tcdnStatsBox: document.querySelector( '.smush-cdn-stats' ),\n\n\t\tinit() {\n\t\t\t/**\n\t\t\t * Handle \"Get Started\" button click on disabled CDN page.\n\t\t\t */\n\t\t\tif ( this.cdnEnableButton ) {\n\t\t\t\tthis.cdnEnableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\t\t\t\t\tthis.toggle_cdn( true );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Deactivate' button click on CDN page.\n\t\t\t */\n\t\t\tif ( this.cdnDisableButton ) {\n\t\t\t\tthis.cdnDisableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_cdn( false );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.updateStatsBox();\n\t\t},\n\n\t\t/**\n\t\t * Toggle CDN.\n\t\t *\n\t\t * @since 3.0\n\t\t *\n\t\t * @param {boolean} enable\n\t\t */\n\t\ttoggle_cdn( enable ) {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_toggle_cdn', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.search = 'page=smush-cdn';\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send(\n\t\t\t\t'param=' + enable + '&_ajax_nonce=' + nonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Update the CDN stats box in summary meta box. Only fetch new data when on CDN page.\n\t\t *\n\t\t * @since 3.0\n\t\t */\n\t\tupdateStatsBox() {\n\t\t\tif (\n\t\t\t\t'undefined' === typeof this.cdnStatsBox ||\n\t\t\t\t! this.cdnStatsBox\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only fetch the new stats, when user is on CDN page.\n\t\t\tif ( ! window.location.search.includes( 'page=smush-cdn' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.toggleElements();\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=get_cdn_stats', true );\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\tthis.toggleElements();\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Show/hide elements during status update in the updateStatsBox()\n\t\t *\n\t\t * @since 3.1 Moved out from updateStatsBox()\n\t\t */\n\t\ttoggleElements() {\n\t\t\tconst spinner = this.cdnStatsBox.querySelector(\n\t\t\t\t'.sui-icon-loader'\n\t\t\t);\n\t\t\tconst elements = this.cdnStatsBox.querySelectorAll(\n\t\t\t\t'.wp-smush-stats > :not(.sui-icon-loader)'\n\t\t\t);\n\n\t\t\tfor ( let i = 0; i < elements.length; i++ ) {\n\t\t\t\telements[ i ].classList.toggle( 'sui-hidden' );\n\t\t\t}\n\n\t\t\tspinner.classList.toggle( 'sui-hidden' );\n\t\t},\n\t};\n\n\tWP_Smush.CDN.init();\n} )();\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * Lazy loading functionality.\n *\n * @since 3.0\n */\n( function() {\n\t'use strict';\n\n\tWP_Smush.Lazyload = {\n\t\tlazyloadEnableButton: document.getElementById(\n\t\t\t'smush-enable-lazyload'\n\t\t),\n\t\tlazyloadDisableButton: document.getElementById(\n\t\t\t'smush-cancel-lazyload'\n\t\t),\n\n\t\tinit() {\n\t\t\tconst self = this;\n\n\t\t\t/**\n\t\t\t * Handle \"Activate\" button click on disabled Lazy load page.\n\t\t\t */\n\t\t\tif ( this.lazyloadEnableButton ) {\n\t\t\t\tthis.lazyloadEnableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_lazy_load( true );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Deactivate' button click on Lazy load page.\n\t\t\t */\n\t\t\tif ( this.lazyloadDisableButton ) {\n\t\t\t\tthis.lazyloadDisableButton.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\t\t\t\tthis.toggle_lazy_load( false );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Remove icon\" button click on Lazy load page.\n\t\t\t *\n\t\t\t * This removes the image from the upload placeholder.\n\t\t\t *\n\t\t\t * @since 3.2.2\n\t\t\t */\n\t\t\tconst removeSpinner = document.getElementById(\n\t\t\t\t'smush-remove-spinner'\n\t\t\t);\n\t\t\tif ( removeSpinner ) {\n\t\t\t\tremoveSpinner.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.removeLoaderIcon();\n\t\t\t\t} );\n\t\t\t}\n\t\t\tconst removePlaceholder = document.getElementById(\n\t\t\t\t'smush-remove-placeholder'\n\t\t\t);\n\t\t\tif ( removePlaceholder ) {\n\t\t\t\tremovePlaceholder.addEventListener( 'click', ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.removeLoaderIcon( 'placeholder' );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"Remove\" icon click.\n\t\t\t *\n\t\t\t * This removes the select icon from the list (not same as above functions).\n\t\t\t *\n\t\t\t * @since 3.2.2\n\t\t\t */\n\t\t\tconst items = document.querySelectorAll( '.smush-ll-remove' );\n\t\t\tif ( items && 0 < items.length ) {\n\t\t\t\titems.forEach( function( el ) {\n\t\t\t\t\tel.addEventListener( 'click', ( e ) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\te.target.closest( 'li' ).style.display = 'none';\n\t\t\t\t\t\tself.remove(\n\t\t\t\t\t\t\te.target.dataset.id,\n\t\t\t\t\t\t\te.target.dataset.type\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.handlePredefinedPlaceholders();\n\t\t},\n\n\t\t/**\n\t\t * Handle background color changes for the two predefined placeholders.\n\t\t *\n\t\t * @since 3.7.1\n\t\t */\n\t\thandlePredefinedPlaceholders() {\n\t\t\tconst pl1 = document.getElementById( 'placeholder-icon-1' );\n\t\t\tif ( pl1 ) {\n\t\t\t\tpl1.addEventListener( 'click', () => this.changeColor( '#F3F3F3' ) );\n\t\t\t}\n\n\t\t\tconst pl2 = document.getElementById( 'placeholder-icon-2' );\n\t\t\tif ( pl2 ) {\n\t\t\t\tpl2.addEventListener( 'click', () => this.changeColor( '#333333' ) );\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Set color.\n\t\t *\n\t\t * @since 3.7.1\n\t\t * @param {string} color\n\t\t */\n\t\tchangeColor( color ) {\n\t\t\tdocument.getElementById( 'smush-color-picker' ).value = color;\n\t\t\tdocument.querySelector( '.sui-colorpicker-hex .sui-colorpicker-value > span > span' ).style.backgroundColor = color;\n\t\t\tdocument.querySelector( '.sui-colorpicker-hex .sui-colorpicker-value > input' ).value = color;\n\t\t},\n\n\t\t/**\n\t\t * Toggle lazy loading.\n\t\t *\n\t\t * @since 3.2.0\n\t\t *\n\t\t * @param {string} enable\n\t\t */\n\t\ttoggle_lazy_load( enable ) {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'POST',\n\t\t\t\tajaxurl + '?action=smush_toggle_lazy_load',\n\t\t\t\ttrue\n\t\t\t);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\t\twindow.location.search = 'page=smush-lazy-load';\n\t\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t\t\tdocument.querySelector( '.sui-button-onload' ).classList.remove( 'sui-button-onload' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t\t\tdocument.querySelector( '.sui-button-onload' ).classList.remove( 'sui-button-onload' );\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send(\n\t\t\t\t'param=' + enable + '&_ajax_nonce=' + nonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Add lazy load spinner icon.\n\t\t *\n\t\t * @since 3.2.2\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\taddLoaderIcon( type = 'spinner' ) {\n\t\t\tlet frame;\n\n\t\t\t// If the media frame already exists, reopen it.\n\t\t\tif ( frame ) {\n\t\t\t\tframe.open();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Create a new media frame\n\t\t\tframe = wp.media( {\n\t\t\t\ttitle: 'Select or upload an icon',\n\t\t\t\tbutton: {\n\t\t\t\t\ttext: 'Select icon',\n\t\t\t\t},\n\t\t\t\tmultiple: false, // Set to true to allow multiple files to be selected\n\t\t\t} );\n\n\t\t\t// When an image is selected in the media frame...\n\t\t\tframe.on( 'select', function() {\n\t\t\t\t// Get media attachment details from the frame state\n\t\t\t\tconst attachment = frame\n\t\t\t\t\t.state()\n\t\t\t\t\t.get( 'selection' )\n\t\t\t\t\t.first()\n\t\t\t\t\t.toJSON();\n\n\t\t\t\t// Send the attachment URL to our custom image input field.\n\t\t\t\tconst imageIcon = document.getElementById(\n\t\t\t\t\t'smush-' + type + '-icon-preview'\n\t\t\t\t);\n\t\t\t\timageIcon.style.backgroundImage =\n\t\t\t\t\t'url(\"' + attachment.url + '\")';\n\t\t\t\timageIcon.style.display = 'block';\n\n\t\t\t\t// Send the attachment id to our hidden input\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById( 'smush-' + type + '-icon-file' )\n\t\t\t\t\t.setAttribute( 'value', attachment.id );\n\n\t\t\t\t// Hide the add image link\n\t\t\t\tdocument.getElementById(\n\t\t\t\t\t'smush-upload-' + type\n\t\t\t\t).style.display = 'none';\n\n\t\t\t\t// Unhide the remove image link\n\t\t\t\tconst removeDiv = document.getElementById(\n\t\t\t\t\t'smush-remove-' + type\n\t\t\t\t);\n\t\t\t\tremoveDiv.querySelector( 'span' ).innerHTML =\n\t\t\t\t\tattachment.filename;\n\t\t\t\tremoveDiv.style.display = 'block';\n\t\t\t} );\n\n\t\t\t// Finally, open the modal on click\n\t\t\tframe.open();\n\t\t},\n\n\t\t/**\n\t\t * Remove lazy load spinner icon.\n\t\t *\n\t\t * @since 3.2.2\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\tremoveLoaderIcon: ( type = 'spinner' ) => {\n\t\t\t// Clear out the preview image\n\t\t\tconst imageIcon = document.getElementById(\n\t\t\t\t'smush-' + type + '-icon-preview'\n\t\t\t);\n\t\t\timageIcon.style.backgroundImage = '';\n\t\t\timageIcon.style.display = 'none';\n\n\t\t\t// Un-hide the add image link\n\t\t\tdocument.getElementById( 'smush-upload-' + type ).style.display =\n\t\t\t\t'block';\n\n\t\t\t// Hide the delete image link\n\t\t\tdocument.getElementById( 'smush-remove-' + type ).style.display =\n\t\t\t\t'none';\n\n\t\t\t// Delete the image id from the hidden input\n\t\t\tdocument\n\t\t\t\t.getElementById( 'smush-' + type + '-icon-file' )\n\t\t\t\t.setAttribute( 'value', '' );\n\t\t},\n\n\t\t/**\n\t\t * Remove item.\n\t\t *\n\t\t * @param {number} id Image ID.\n\t\t * @param {string} type Accepts: spinner, placeholder.\n\t\t */\n\t\tremove: ( id, type = 'spinner' ) => {\n\t\t\tconst nonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open( 'POST', ajaxurl + '?action=smush_remove_icon', true );\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.send(\n\t\t\t\t'id=' +\n\t\t\t\t\tid +\n\t\t\t\t\t'&type=' +\n\t\t\t\t\ttype +\n\t\t\t\t\t'&_ajax_nonce=' +\n\t\t\t\t\tnonceField[ 0 ].value\n\t\t\t);\n\t\t},\n\t};\n\n\tWP_Smush.Lazyload.init();\n} )();\n","import MixPanel from \"../mixpanel\";\n\nclass ProductAnalytics {\n init() {\n this.trackUltraLinks();\n }\n\n trackUltraLinks() {\n\t\tconst ultraUpsellLinks = document.querySelectorAll( '.wp-smush-upsell-ultra-compression' );\n\t\tif ( ! ultraUpsellLinks ) {\n\t\t\treturn;\n\t\t}\n\t\tconst getLocation = ( ultraLink ) => {\n\t\t\tconst locations = {\n\t\t\t\t'settings': 'bulksmush_settings',\n\t\t\t\t'dashboard': 'dash_summary',\n\t\t\t\t'bulk': 'bulksmush_summary',\n\t\t\t\t'directory': 'directory_summary',\n\t\t\t\t'lazy-load': 'lazy_summary',\n\t\t\t\t'cdn': 'cdn_summary',\n\t\t\t\t'webp': 'webp_summary',\n\t\t\t};\n\t\t\tconst locationId = ultraLink.classList.contains( 'wp-smush-ultra-compression-link' ) ? 'settings' : this.getCurrentPageSlug();\n\t\t\treturn locations[locationId] || 'bulksmush_settings';\n\t\t}\n\n\t\tultraUpsellLinks.forEach( ( ultraLink ) => {\n\t\t\tconst eventName = 'ultra_upsell_modal';\n\t\t\tultraLink.addEventListener( 'click', (e) => {\n\t\t\t\tMixPanel.getInstance().track( eventName, {\n\t\t\t\t\t'Location': getLocation( e.target ),\n\t\t\t\t\t'Modal Action': 'direct_cta',\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n getCurrentPageSlug(){\n\t\tconst searchParams = new URLSearchParams(document.location.search);\n\t\tconst pageSlug = searchParams.get(\"page\");\n return 'smush' === pageSlug ? 'dashboard' : pageSlug.replace( 'smush-', '' );\n\t}\n}\n\n( new ProductAnalytics() ).init();","/* global ajaxurl */\n/* global wp_smush_msgs */\n/* global WP_Smush */\n/* global SUI */\n\n( function( $ ) {\n\t'use strict';\n\n\t/**\n\t * Bulk compress page.\n\t */\n\t$( 'form#smush-bulk-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload' );\n\t\tsaveSettings( $( this ).serialize(), 'bulk' );\n\t\t// runReCheck();\n\t} );\n\n\t/**\n\t * Lazy load page.\n\t */\n\t$( 'form#smush-lazy-load-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'lazy-load' );\n\t} );\n\n\t/**\n\t * CDN page.\n\t */\n\t$( 'form#smush-cdn-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'cdn' );\n\t} );\n\n\t/**\n\t * Integrations page.\n\t */\n\t$( 'form#smush-integrations-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'integrations' );\n\t} );\n\n\t/**\n\t * Settings page.\n\t */\n\t$( 'form#smush-settings-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), 'settings' );\n\t} );\n\n\t/**\n\t * Save settings.\n\t *\n\t * @param {string} settings JSON string of settings.\n\t * @param {string} page Settings page.\n\t */\n\tfunction saveSettings( settings, page ) {\n\t\tconst xhr = new XMLHttpRequest();\n\n\t\txhr.open( 'POST', ajaxurl + '?action=smush_save_settings', true );\n\t\txhr.setRequestHeader(\n\t\t\t'Content-type',\n\t\t\t'application/x-www-form-urlencoded'\n\t\t);\n\n\t\txhr.onload = () => {\n\t\t\t$( '#save-settings-button' ).removeClass(\n\t\t\t\t'sui-button-onload-text sui-button-onload'\n\t\t\t);\n\n\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\tshowSuccessNotice( wp_smush_msgs.settingsUpdated );\n\t\t\t\t\ttriggerSavedSmushSettingsEvent( res.data );\n\t\t\t\t} else if ( res.data && res.data.message ) {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( res.data.message );\n\t\t\t\t} else {\n\t\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed.' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tWP_Smush.helpers.showErrorNotice( 'Request failed. Returned status of ' + xhr.status );\n\t\t\t}\n\t\t};\n\n\t\txhr.send( 'page=' + page + '&' + settings + '&_ajax_nonce=' + wp_smush_msgs.nonce );\n\t}\n\t\n\tfunction triggerSavedSmushSettingsEvent( status ) {\n\t\tdocument.dispatchEvent(\n\t\t\tnew CustomEvent( 'onSavedSmushSettings', {\n\t\t\t\tdetail: status\n\t\t\t} )\n\t\t);\n\t}\n\n\t/**\n\t * Show successful update notice.\n\t *\n\t * @param {string} msg Notice message.\n\t */\n\tfunction showSuccessNotice( msg ) {\n\t\tconst noticeMessage = `<p>${ msg }</p>`,\n\t\t\tnoticeOptions = {\n\t\t\t\ttype: 'success',\n\t\t\t\ticon: 'check',\n\t\t\t};\n\n\t\tSUI.openNotice( 'wp-smush-ajax-notice', noticeMessage, noticeOptions );\n\n\t\tconst loadingButton = document.querySelector( '.sui-button-onload' );\n\t\tif ( loadingButton ) {\n\t\t\tloadingButton.classList.remove( 'sui-button-onload' );\n\t\t}\n\t}\n\n\t/**\n\t * Re-check images from bulk smush and integrations pages.\n\t */\n\tfunction runReCheck() {\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload' );\n\n\t\tconst param = {\n\t\t\taction: 'scan_for_resmush',\n\t\t\twp_smush_options_nonce: $( '#wp_smush_options_nonce' ).val(),\n\t\t\ttype: 'media',\n\t\t};\n\n\t\t// Send ajax, Update Settings, And Check For resmush.\n\t\t$.post( ajaxurl, $.param( param ) ).done( function() {\n\t\t\t$( '#save-settings-button' ).removeClass( 'sui-button-onload' );\n\t\t} );\n\t}\n\n\t/**\n\t * Parse remove data change.\n\t */\n\t$( 'input[name=keep_data]' ).on( 'change', function( e ) {\n\t\tconst otherClass =\n\t\t\t'keep_data-true' === e.target.id\n\t\t\t\t? 'keep_data-false'\n\t\t\t\t: 'keep_data-true';\n\t\te.target.parentNode.classList.add( 'active' );\n\t\tdocument\n\t\t\t.getElementById( otherClass )\n\t\t\t.parentNode.classList.remove( 'active' );\n\t} );\n\n\t/**\n\t * Handle auto-detect checkbox toggle, to show/hide highlighting notice.\n\t */\n\t$( 'input#detection' ).on( 'click', function() {\n\t\tconst noticeDiv = $( '.smush-highlighting-notice' );\n\t\tconst warningDiv = $( '.smush-highlighting-warning' );\n\n\t\t// Setting enabled.\n\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t// Highlighting is already active and setting not saved.\n\t\t\tif ( noticeDiv.length > 0 ) {\n\t\t\t\tnoticeDiv.show();\n\t\t\t} else {\n\t\t\t\twarningDiv.show();\n\t\t\t}\n\t\t} else {\n\t\t\tnoticeDiv.hide();\n\t\t\twarningDiv.hide();\n\t\t}\n\t} );\n}( jQuery ) );\n","/* global WP_Smush */\n/* global ajaxurl */\n/* global wp_smushit_data */\n\nimport {GlobalStats} from \"../common/globalStats\";\nimport SmushProgress from \"../common/progressbar\";\n\nlet perf = 0;\n\nimport MixPanel from \"../mixpanel\";\n\n/**\n * Smush class.\n *\n * @since 2.9.0 Moved from admin.js into a dedicated ES6 class.\n */\nclass Smush {\n\t/**\n\t * Class constructor.\n\t *\n\t * @param {Object} button Button object that made the call.\n\t * @param {boolean} bulk Bulk smush or not.\n\t * @param {string} type Accepts: 'nextgen', 'media'.\n\t */\n\tconstructor( button, bulk, type = 'media' ) {\n\t\tthis.onStart();\n\n\t\t//If smush attribute is not defined, Need not skip re-Smush IDs.\n\t\tthis.skip_resmush = ! (\n\t\t\t'undefined' === typeof button.data( 'smush' ) ||\n\t\t\t! button.data( 'smush' )\n\t\t);\n\t\tthis.button = jQuery( button[ 0 ] );\n\t\tthis.is_bulk = typeof bulk ? bulk : false;\n\t\tthis.url = ajaxurl;\n\t\tthis.log = jQuery( '.smush-final-log' );\n\n\t\tthis.setIds();\n\n\t\tthis.mixPanel = MixPanel.getInstance();\n\n\t\tthis.is_bulk_resmush =\n\t\t\t0 < wp_smushit_data.resmush.length && ! this.skip_resmush;\n\t\tthis.status = this.button.parent().prev( '.smush-status' );\n\n\t\t// Added for NextGen support.\n\t\tthis.smush_type = type;\n\t\tthis.single_ajax_suffix =\n\t\t\t'nextgen' === this.smush_type\n\t\t\t\t? 'smush_manual_nextgen'\n\t\t\t\t: 'wp_smushit_manual';\n\t\tthis.bulk_ajax_suffix =\n\t\t\t'nextgen' === this.smush_type\n\t\t\t\t? 'wp_smushit_nextgen_bulk'\n\t\t\t\t: 'wp_smushit_bulk';\n\t\tthis.get_stats_action = 'nextgen' === this.smush_type ? 'nextgen_get_stats' : 'get_stats';\n\t\tthis.url = this.is_bulk\n\t\t\t? Smush.smushAddParams( this.url, {\n\t\t\t\taction: this.bulk_ajax_suffix,\n\t\t\t} )\n\t\t\t: Smush.smushAddParams( this.url, {\n\t\t\t\taction: this.single_ajax_suffix,\n\t\t\t} );\n\n\t\tthis.start();\n\t\t( ! this.is_bulk ) && this.run();\n\t\tthis.bindDeferredEvents();\n\n\t\t// Handle cancel ajax.\n\t\t// this.cancelAjax();\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add params to the URL.\n\t *\n\t * @param {string} url URL to add the params to.\n\t * @param {Object} data Object with params.\n\t * @return {string} URL with params.\n\t */\n\tstatic smushAddParams( url, data ) {\n\t\tif ( ! jQuery.isEmptyObject( data ) ) {\n\t\t\turl +=\n\t\t\t\t( url.indexOf( '?' ) >= 0 ? '&' : '?' ) + jQuery.param( data );\n\t\t}\n\n\t\treturn url;\n\t}\n\n\t/**\n\t * Check membership validity.\n\t *\n\t * @param {Object} data\n\t * @param {number} data.show_warning\n\t */\n\tstatic membershipValidity( data ) {\n\t\tconst memberValidityNotice = jQuery( '#wp-smush-invalid-member' );\n\n\t\t// Check for membership warning.\n\t\tif (\n\t\t\t'undefined' !== typeof data &&\n\t\t\t'undefined' !== typeof data.show_warning &&\n\t\t\tmemberValidityNotice.length > 0\n\t\t) {\n\t\t\tif ( data.show_warning ) {\n\t\t\t\tmemberValidityNotice.show();\n\t\t\t} else {\n\t\t\t\tmemberValidityNotice.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Send Ajax request for compressing the image.\n\t *\n\t * @param {boolean} isBulkResmush\n\t * @param {number} id\n\t * @param {string} sendUrl\n\t * @param {string} nonce\n\t * @param {boolean} newBulkSmushStarted\n\t * @return {*|jQuery.promise|void} Compression results.\n\t */\n\tstatic ajax( isBulkResmush, id, sendUrl, nonce, newBulkSmushStarted= false ) {\n\t\tconst param = jQuery.param( {\n\t\t\tis_bulk_resmush: isBulkResmush,\n\t\t\tattachment_id: id,\n\t\t\t_nonce: nonce,\n\t\t\tnew_bulk_smush_started: newBulkSmushStarted\n\t\t} );\n\n\t\treturn jQuery.ajax( {\n\t\t\ttype: 'GET',\n\t\t\tdata: param,\n\t\t\turl: sendUrl,\n\t\t\t/** @param {Array} wp_smushit_data */\n\t\t\ttimeout: wp_smushit_data.timeout,\n\t\t\tdataType: 'json',\n\t\t} );\n\t}\n\n\t/**\n\t * Sets this.ids.\n\t */\n\tsetIds() {\n\t\tlet ids = [];\n\t\tif ( 0 < wp_smushit_data.resmush.length && ! this.skip_resmush ) {\n\t\t\tif ( 0 < wp_smushit_data.unsmushed.length ) {\n\t\t\t\tids = wp_smushit_data.resmush.concat( wp_smushit_data.unsmushed );\n\t\t\t} else {\n\t\t\t\tids = wp_smushit_data.resmush;\n\t\t\t}\n\t\t} else {\n\t\t\tids = wp_smushit_data.unsmushed;\n\t\t}\n\n\t\tif ( 'object' === typeof ids ) {\n\t\t\t// If button has re-Smush class, and we do have ids that needs to re-Smushed, put them in the list.\n\t\t\tthis.ids = ids.filter( function( itm, i, a ) {\n\t\t\t\treturn i === a.indexOf( itm );\n\t\t\t} );\n\t\t} else {\n\t\t\tthis.ids = ids;\n\t\t}\n\t}\n\n\t/**\n\t * Show loader in button for single and bulk Smush.\n\t */\n\tstart() {\n\t\tthis.button.prop( 'disabled', true );\n\t\tthis.button.addClass( 'wp-smush-started' );\n\n\t\tthis.bulkStart();\n\t\tthis.singleStart();\n\t}\n\n\t/**\n\t * Start bulk Smush.\n\t */\n\tbulkStart() {\n\t\tif ( ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Hide the bulk div.\n\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\n\t\t// Hide the bulk limit message.\n\t\tjQuery(\n\t\t\t'.wp-smush-bulk-progress-bar-wrapper .sui-notice-warning:first-of-type'\n\t\t).hide();\n\n\t\t// Hide parent wrapper, if there are no other messages.\n\t\tif (\n\t\t\t0 >= jQuery( 'div.smush-final-log .smush-bulk-error-row' ).length\n\t\t) {\n\t\t\tjQuery( 'div.smush-final-log' ).addClass('sui-hidden');\n\t\t}\n\n\t\t// Show the progress bar.\n\t\tjQuery(\n\t\t\t'.bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper, #wp-smush-running-notice'\n\t\t).removeClass( 'sui-hidden' );\n\t}\n\n\t/**\n\t * Start single image Smush.\n\t */\n\tsingleStart() {\n\t\tif ( this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.button.html(\n\t\t\t'<span class=\"spinner wp-smush-progress\">' +\n\t\t\t\twindow.wp_smush_msgs.smushing +\n\t\t\t\t'</span>'\n\t\t);\n\t\tthis.status.removeClass( 'error' );\n\t}\n\n\t/**\n\t * Enable button.\n\t */\n\tenableButton() {\n\t\tthis.button.prop( 'disabled', false );\n\t\tjQuery('.wp-smush-all').prop('disabled', false);\n\t\tjQuery('.wp-smush-restore').prop('disabled', false);\n\t\t// For bulk process, enable other buttons.\n\t\tjQuery(\n\t\t\t'a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#save-settings-button'\n\t\t).prop('disabled', false);\n\t}\n\n\t/**\n\t * Finish single image Smush.\n\t */\n\tsingleDone() {\n\t\tif ( this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst self = this;\n\n\t\tthis.request\n\t\t\t.done( function( response ) {\n\t\t\t\tif ( 'undefined' !== typeof response.data ) {\n\t\t\t\t\t// Check if stats div exists.\n\t\t\t\t\tconst parent = self.status.parent();\n\n\t\t\t\t\t// Check whether to show membership validity notice or not.\n\t\t\t\t\tSmush.membershipValidity( response.data );\n\n\t\t\t\t\tif ( ! response.success ) {\n\t\t\t\t\t\tif ( response.data.html_stats ) {\n\t\t\t\t\t\t\tparent.html( response.data.html_stats );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.status.addClass( 'smush-warning' );\n\t\t\t\t\t\t\t/** @param {string} response.data.error_msg */\n\t\t\t\t\t\t\tself.status.html( response.data.error_msg );\n\t\t\t\t\t\t\tself.button.html(\n\t\t\t\t\t\t\t\twindow.smush_vars.strings.stats_label\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If we've updated status, replace the content.\n\t\t\t\t\t\tparent.html( response.data );\n\t\t\t\t\t\tself.button.html( window.wp_smush_msgs.all_done );\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Update image size in attachment info panel.\n\t\t\t\t\t *\n\t\t\t\t\t * @param {string|number} response.data.new_size\n\t\t\t\t\t */\n\t\t\t\t\tSmush.updateImageStats( response.data.new_size );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.fail( function( response ) {\n\t\t\t\tself.status.html( response.data );\n\t\t\t\tself.status.addClass( 'smush-warning' );\n\t\t\t\tself.enableButton();\n\t\t\t} );\n\t}\n\n\t/**\n\t * Get total images left to optimize.\n\t *\n\t * @see get_total_images_to_smush() in Abstract_Summary_Page class.\n\t *\n\t * @since 3.10.0\n\t */\n\tstatic getTotalImagesToSmush() {\n\t\tconst imagesToResmush = wp_smushit_data.resmush.length;\n\n\t\tconst unsmushedCount = wp_smushit_data.count_total - wp_smushit_data.count_smushed;\n\n\t\tif ( unsmushedCount > 0 ) {\n\t\t\treturn imagesToResmush + unsmushedCount;\n\t\t}\n\n\t\treturn imagesToResmush;\n\t}\n\n\t/**\n\t * Update the \"optimized images\" score on the summary meta box.\n\t *\n\t * @see get_grade_data() in Abstract_Summary_Page class.\n\t *\n\t * @since 3.10.0\n\t */\n\tstatic updateScoreProgress() {\n\t\tlet grade = 'sui-grade-dismissed';\n\t\tlet percentOptimized = 0;\n\t\tlet percentMetric = 0;\n\n\t\tconst totalImagesToSmush = Smush.getTotalImagesToSmush();\n\t\tconst totalImages = parseInt( wp_smushit_data.count_total );\n\n\t\tif ( totalImages === totalImagesToSmush ) {\n\t\t\tif ( totalImages > 0 ) {\n\t\t\t\tgrade = 'sui-grade-f';\n\t\t\t}\n\t\t\tpercentMetric = 100;\n\t\t} else if ( 0 < totalImages ) {\n\t\t\tpercentOptimized = Math.floor( ( totalImages - totalImagesToSmush ) * 100 / totalImages );\n\t\t\tpercentMetric = percentOptimized;\n\t\t\tgrade = 'sui-grade-f';\n\n\t\t\tif ( percentOptimized >= 60 && percentOptimized < 90 ) {\n\t\t\t\tgrade = 'sui-grade-c';\n\t\t\t} else if ( percentOptimized >= 90 ) {\n\t\t\t\tgrade = 'sui-grade-a';\n\t\t\t}\n\t\t}\n\n\t\tconst imageScore = jQuery( '#smush-image-score' );\n\n\t\timageScore\n\t\t\t.removeClass(\n\t\t\t\tfunction( index, className ) {\n\t\t\t\t\tconst matchedClasses = className.match( /(^|\\s)sui-grade-\\S+/g );\n\t\t\t\t\treturn ( matchedClasses || [] ).join( ' ' );\n\t\t\t\t}\n\t\t\t)\n\t\t\t.addClass( grade )\n\t\t\t.attr( 'data-score', percentOptimized )\n\t\t\t.find( '.sui-circle-score-label' ).html( percentOptimized );\n\n\t\timageScore\n\t\t\t.find( 'circle:last-child' )\n\t\t\t.attr( 'style', '--metric-array:' + ( 2.63893782902 * percentMetric ) + ' ' + ( 263.893782902 - percentMetric ) );\n\t}\n\n\t/**\n\t * Update all stats sections based on the response.\n\t *\n\t * @param {string} scanType Current scan type.\n\t */\n\tstatic updateStats( scanType ) {\n\t\tconst isNextgen = 'undefined' !== typeof scanType && 'nextgen' === scanType;\n\n\t\t// Calculate updated savings in bytes.\n\t\twp_smushit_data.savings_bytes = parseInt( wp_smushit_data.size_before ) - parseInt( wp_smushit_data.size_after );\n\n\t\tconst formattedSize = WP_Smush.helpers.formatBytes( wp_smushit_data.savings_bytes, 0 );\n\t\tconst statsHuman = jQuery( '.wp-smush-savings .wp-smush-stats-human' );\n\n\t\tif ( isNextgen ) {\n\t\t\tstatsHuman.html( formattedSize );\n\t\t} else {\n\t\t\tstatsHuman.html( WP_Smush.helpers.getFormatFromString( formattedSize ) );\n\t\t\tjQuery( '.sui-summary-large.wp-smush-stats-human' )\n\t\t\t\t.html( WP_Smush.helpers.getSizeFromString( formattedSize ) );\n\t\t}\n\n\t\t// Update the savings percent.\n\t\twp_smushit_data.savings_percent = WP_Smush.helpers.precise_round(\n\t\t\t( parseInt( wp_smushit_data.savings_bytes ) /\n\t\t\t\tparseInt( wp_smushit_data.size_before ) ) *\n\t\t\t\t100,\n\t\t\t1\n\t\t);\n\t\tif ( ! isNaN( wp_smushit_data.savings_percent ) ) {\n\t\t\tjQuery( '.wp-smush-savings .wp-smush-stats-percent' )\n\t\t\t\t.html( wp_smushit_data.savings_percent );\n\t\t}\n\n\t\t// Update image count.\n\t\tif ( isNextgen ) {\n\t\t\tjQuery( '.sui-summary-details span.wp-smush-total-optimised' )\n\t\t\t\t.html( wp_smushit_data.count_images );\n\t\t} else {\n\t\t\tjQuery( 'span.smushed-items-count span.wp-smush-count-total span.wp-smush-total-optimised' )\n\t\t\t\t.html( wp_smushit_data.count_images );\n\t\t}\n\n\t\t// Update resize image count.\n\t\tif ( wp_smushit_data.count_resize > 0 ) {\n\t\t\tjQuery( 'span.smushed-items-count span.wp-smush-count-resize-total' ).removeClass( 'sui-hidden' );\n\t\t\tjQuery( 'span.smushed-items-count span.wp-smush-count-resize-total span.wp-smush-total-optimised' )\n\t\t\t\t.html( wp_smushit_data.count_resize );\n\t\t}\n\n\t\t// Update super-Smushed image count.\n\t\tconst smushedCountDiv = jQuery( 'li.super-smush-attachments .smushed-count' );\n\t\tif ( smushedCountDiv.length && 'undefined' !== typeof wp_smushit_data.count_supersmushed ) {\n\t\t\tsmushedCountDiv.html( wp_smushit_data.count_supersmushed );\n\t\t}\n\n\t\t// Update conversion savings.\n\t\tconst smushConversionSavings = jQuery( '.smush-conversion-savings' );\n\t\tif (\n\t\t\tsmushConversionSavings.length > 0 &&\n\t\t\t'undefined' !== typeof wp_smushit_data.savings_conversion &&\n\t\t\twp_smushit_data.savings_conversion !== ''\n\t\t) {\n\t\t\tconst conversionSavings = smushConversionSavings.find( '.wp-smush-stats' );\n\t\t\tif ( conversionSavings.length > 0 ) {\n\t\t\t\tconversionSavings.html(\n\t\t\t\t\tWP_Smush.helpers.formatBytes( wp_smushit_data.savings_conversion, 1 )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Update image size in attachment info panel.\n\t *\n\t * @since 2.8\n\t *\n\t * @param {number} newSize\n\t */\n\tstatic updateImageStats( newSize ) {\n\t\tif ( 0 === newSize ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst attachmentSize = jQuery( '.attachment-info .file-size' );\n\t\tconst currentSize = attachmentSize\n\t\t\t.contents()\n\t\t\t.filter( function() {\n\t\t\t\treturn this.nodeType === 3;\n\t\t\t} )\n\t\t\t.text();\n\n\t\t// There is a space before the size.\n\t\tif ( currentSize !== ' ' + newSize ) {\n\t\t\tconst sizeStrongEl = attachmentSize\n\t\t\t\t.contents()\n\t\t\t\t.filter( function() {\n\t\t\t\t\treturn this.nodeType === 1;\n\t\t\t\t} )\n\t\t\t\t.text();\n\t\t\tattachmentSize.html(\n\t\t\t\t'<strong>' + sizeStrongEl + '</strong> ' + newSize\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Sync stats.\n\t */\n\tsyncStats() {\n\t\tconst messageHolder = jQuery(\n\t\t\t'div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc'\n\t\t);\n\t\t// Store the existing content in a variable.\n\t\tconst progressMessage = messageHolder.html();\n\t\t/** @param {string} wp_smush_msgs.sync_stats */\n\t\tmessageHolder.html( window.wp_smush_msgs.sync_stats );\n\n\t\tconst self = this;\n\n\t\t// Send ajax.\n\t\treturn jQuery\n\t\t\t.ajax( {\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: {\n\t\t\t\t\taction: this.get_stats_action,\n\t\t\t\t\t_ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t\t\t},\n\t\t\t\tsuccess( response ) {\n\t\t\t\t\tif ( ! response?.success ) {\n\t\t\t\t\t\tWP_Smush.helpers.showNotice( response, {\n\t\t\t\t\t\t\tshowdismiss: true,\n\t\t\t\t\t\t\tautoclose: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tGlobalStats.updateGlobalStatsFromSmushScriptData( response.data );\n\t\t\t\t\tGlobalStats.renderStats();\n\t\t\t\t\tSmushProgress.update( 0, response.data.remaining_count );\n\n\t\t\t\t\tjQuery('.wp-smush-scan').prop('disabled', false);\n\t\t\t\t\tself.hideBulkFreeLimitReachedNotice();\n\t\t\t\t},\n\t\t\t} )\n\t\t\t.always( () => messageHolder.html( progressMessage ) );\n\t}\n\n\t/**\n\t * After the bulk optimization has been finished.\n\t */\n\tbulkDone() {\n\t\tif ( ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Enable the button.\n\t\tthis.enableButton();\n\n\t\t// Show notice.\n\t\tif ( 0 === this.ids.length ) {\n\t\t\tjQuery('.bulk-smush-wrapper .wp-smush-all-done').removeClass( 'sui-hidden' );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\t\t\t// Hide the progress bar if scan is finished.\n\t\t\tjQuery( '.wp-smush-bulk-progress-bar-wrapper' ).addClass( 'sui-hidden' );\n\n\t\t\t// Reset the progress when we finish so the next smushing starts from zero.\n\t\t\tthis._updateProgress(0, 0);\n\t\t} else {\n\t\t\t// TODO: REMOVE \"re-smush-notice\" since no longer used. And maybe for \"wp-smush-remaining\" too.\n\t\t\tconst notice = jQuery(\n\t\t\t\t'.bulk-smush-wrapper .wp-smush-resmush-notice'\n\t\t\t);\n\n\t\t\tif ( notice.length > 0 ) {\n\t\t\t\tnotice.show();\n\t\t\t} else {\n\t\t\t\tjQuery( '.bulk-smush-wrapper .wp-smush-remaining' ).removeClass( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\n\t\t// Enable re-Smush and scan button.\n\t\tjQuery( '.wp-resmush.wp-smush-action' ).removeProp(\n\t\t\t'disabled'\n\t\t);\n\t}\n\t\n\tshowAnimatedUpsellNotice() {\n\t\tif ( ! this.errors.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only show animated upsell if exists an animated error in first 5 errors.\n\t\t// Note, this.errors will be reset each we resume so let detect animated error from elements.\n\t\tconst bulkErrors = document.querySelector('.smush-bulk-errors');\n\t\tif ( ! bulkErrors ) {\n\t\t\treturn;\n\t\t}\n\t\tconst firstAnimatedError = bulkErrors.querySelector( '[data-error-code=\"animated\"]' );\n\t\tif ( ! firstAnimatedError ) {\n\t\t\treturn;\n\t\t}\n\t\tconst first5Errors = Array.prototype.slice.call(bulkErrors.childNodes, 0, 5 );\n\t\treturn first5Errors.includes( firstAnimatedError );\n\t}\n\n\tmaybeShowCDNActivationNotice() {\n\t\t// Only for pro users.\n\t\tif ( ! wp_smush_msgs.smush_cdn_activation_notice || ! this.showAnimatedUpsellNotice() ) {\n\t\t\treturn;\n\t\t}\n\t\tWP_Smush.helpers.renderActivationCDNNotice( wp_smush_msgs.smush_cdn_activation_notice );\n\t}\n\n\tmaybeShowUnlimitedUpsellNotice() {\n\t\tconst unlimitedUpsellNotice = document.querySelector('.wp-smush-global-upsell');\n\t\tif ( ! unlimitedUpsellNotice ) {\n\t\t\treturn;\n\t\t}\n\t\tunlimitedUpsellNotice.classList.remove( 'sui-hidden' );\n\t}\n\n\tmaybeShowBulkErrorActions() {\n\t\tif ( ! this.errors.length ) {\n\t\t\treturn;\n\t\t}\n\t\tconst bulkErrorActionsElement = document.querySelector('.smush-bulk-errors-actions');\n\t\tif ( ! bulkErrorActionsElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tbulkErrorActionsElement.classList.remove('sui-hidden');\n\t}\n\n\t/**\n\t * Free Smush limit exceeded.\n\t */\n\tfreeExceeded() {\n\t\tconst progress = jQuery( '.wp-smush-bulk-progress-bar-wrapper' );\n\t\tprogress.addClass( 'wp-smush-exceed-limit' ).removeClass('sui-hidden');\n\t\tprogress\n\t\t\t.find( '.sui-progress-block .wp-smush-cancel-bulk' )\n\t\t\t.removeClass( 'sui-hidden' );\n\t\tprogress\n\t\t\t.find( '.sui-progress-block .wp-smush-all' )\n\t\t\t.addClass( 'sui-hidden' );\n\n\t\tprogress\n\t\t\t.find( 'i.sui-icon-loader' )\n\t\t\t.addClass( 'sui-icon-info' )\n\t\t\t.removeClass( 'sui-icon-loader' )\n\t\t\t.removeClass( 'sui-loading' );\n\n\t\tdocument\n\t\t\t.getElementById( 'bulk-smush-resume-button' )\n\t\t\t.classList.remove( 'sui-hidden' );\n\n\t\tthis.showBulkFreeLimitReachedNotice();\n\t}\n\n\tshowBulkFreeLimitReachedNotice() {\n\t\tconst bulkFreeLimitReachedNotice = document.getElementById( 'smush-limit-reached-notice' );\n\t\tif ( bulkFreeLimitReachedNotice ) {\n\t\t\tbulkFreeLimitReachedNotice.classList.remove( 'sui-hidden' );\n\t\t}\n\t}\n\n\thideBulkFreeLimitReachedNotice() {\n\t\tconst bulkFreeLimitReachedNotice = document.getElementById( 'smush-limit-reached-notice' );\n\t\tif ( bulkFreeLimitReachedNotice ) {\n\t\t\tbulkFreeLimitReachedNotice.classList.add( 'sui-hidden' );\n\t\t}\n\t}\n\n\t/**\n\t * Adds the stats for the current image to existing stats.\n\t *\n\t * @param {Array} imageStats\n\t * @param {string} imageStats.count\n\t * @param {boolean} imageStats.is_lossy\n\t * @param {Array} imageStats.savings_resize\n\t * @param {Array} imageStats.savings_conversion\n\t * @param {string} imageStats.size_before\n\t * @param {string} imageStats.size_after\n\t * @param {string} type\n\t */\n\tstatic updateLocalizedStats( imageStats, type ) {\n\t\t// Increase the Smush count.\n\t\tif ( 'undefined' === typeof window.wp_smushit_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// No need to increase attachment count, resize, conversion savings for directory Smush.\n\t\tif ( 'media' === type ) {\n\t\t\twp_smushit_data.count_smushed = parseInt( wp_smushit_data.count_smushed ) + 1;\n\n\t\t\t// Increase Smushed image count.\n\t\t\twp_smushit_data.count_images = parseInt( wp_smushit_data.count_images ) + parseInt( imageStats.count );\n\n\t\t\t// Increase super Smush count, if applicable.\n\t\t\tif ( imageStats.is_lossy ) {\n\t\t\t\twp_smushit_data.count_supersmushed = parseInt( wp_smushit_data.count_supersmushed ) + 1;\n\t\t\t}\n\n\t\t\t// Add to resize savings.\n\t\t\twp_smushit_data.savings_resize =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.savings_resize ) + parseInt( imageStats.savings_resize.bytes )\n\t\t\t\t\t: parseInt( wp_smushit_data.savings_resize );\n\n\t\t\t// Update resize count.\n\t\t\twp_smushit_data.count_resize =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.count_resize ) + 1\n\t\t\t\t\t: wp_smushit_data.count_resize;\n\n\t\t\t// Add to conversion savings.\n\t\t\twp_smushit_data.savings_conversion =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion &&\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.bytes\n\t\t\t\t\t? parseInt( wp_smushit_data.savings_conversion ) + parseInt( imageStats.savings_conversion.bytes )\n\t\t\t\t\t: parseInt( wp_smushit_data.savings_conversion );\n\t\t} else if ( 'directory_smush' === type ) {\n\t\t\t//Increase smushed image count\n\t\t\twp_smushit_data.count_images = parseInt( wp_smushit_data.count_images ) + 1;\n\t\t} else if ( 'nextgen' === type ) {\n\t\t\twp_smushit_data.count_smushed = parseInt( wp_smushit_data.count_smushed ) + 1;\n\t\t\twp_smushit_data.count_supersmushed = parseInt( wp_smushit_data.count_supersmushed ) + 1;\n\n\t\t\t// Increase Smushed image count.\n\t\t\twp_smushit_data.count_images = parseInt( wp_smushit_data.count_images ) + parseInt( imageStats.count );\n\t\t}\n\n\t\t// If we have savings. Update savings.\n\t\tif ( imageStats.size_before > imageStats.size_after ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) + parseInt( imageStats.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) + parseInt( imageStats.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\n\t\t// Add stats for resizing. Update savings.\n\t\tif ( 'undefined' !== typeof imageStats.savings_resize ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) + parseInt( imageStats.savings_resize.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.savings_resize.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) + parseInt( imageStats.savings_resize.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\n\t\t// Add stats for conversion. Update savings.\n\t\tif ( 'undefined' !== typeof imageStats.savings_conversion ) {\n\t\t\twp_smushit_data.size_before =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.size_before\n\t\t\t\t\t? parseInt( wp_smushit_data.size_before ) + parseInt( imageStats.savings_conversion.size_before )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_before );\n\t\t\twp_smushit_data.size_after =\n\t\t\t\t'undefined' !== typeof imageStats.savings_conversion.size_after\n\t\t\t\t\t? parseInt( wp_smushit_data.size_after ) + parseInt( imageStats.savings_conversion.size_after )\n\t\t\t\t\t: parseInt( wp_smushit_data.size_after );\n\t\t}\n\t}\n\n\t/**\n\t * Update progress.\n\t *\n\t * @param {Object} _res\n\t */\n\tupdateProgress( _res ) {\n\t\tif ( ! this.is_bulk_resmush && ! this.is_bulk ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet progress = 0;\n\n\t\t// Update localized stats.\n\t\tif (\n\t\t\t_res &&\n\t\t\t'undefined' !== typeof _res.data &&\n\t\t\t'undefined' !== typeof _res.data.stats\n\t\t) {\n\t\t\tSmush.updateLocalizedStats( _res.data.stats, this.smush_type );\n\t\t}\n\n\t\tif ( ! this.is_bulk_resmush ) {\n\t\t\t// Handle progress for normal bulk smush.\n\t\t\tprogress =\n\t\t\t\t( ( this.smushed + this.errors.length ) / this.total ) * 100;\n\t\t} else {\n\t\t\t// If the request was successful, update the progress bar.\n\t\t\tif ( _res.success ) {\n\t\t\t\t// Handle progress for super Smush progress bar.\n\t\t\t\tif ( wp_smushit_data.resmush.length > 0 ) {\n\t\t\t\t\t// Update the count.\n\t\t\t\t\tjQuery( '.wp-smush-images-remaining' ).html(\n\t\t\t\t\t\twp_smushit_data.resmush.length\n\t\t\t\t\t);\n\t\t\t\t} else if (\n\t\t\t\t\t0 === wp_smushit_data.resmush.length &&\n\t\t\t\t\t0 === this.ids.length\n\t\t\t\t) {\n\t\t\t\t\t// If all images are re-Smushed, show the All Smushed message.\n\t\t\t\t\tjQuery('.bulk-resmush-wrapper .wp-smush-all-done').removeClass( 'sui-hidden' );\n\n\t\t\t\t\t// Hide everything else.\n\t\t\t\t\tjQuery(\n\t\t\t\t\t\t'.wp-smush-resmush-wrap, .wp-smush-bulk-progress-bar-wrapper'\n\t\t\t\t\t).addClass( 'sui-hidden' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle progress for normal bulk Smush. Set progress bar width.\n\t\t\tif (\n\t\t\t\t'undefined' !== typeof this.ids &&\n\t\t\t\t'undefined' !== typeof this.total &&\n\t\t\t\tthis.total > 0\n\t\t\t) {\n\t\t\t\tprogress =\n\t\t\t\t\t( ( this.smushed + this.errors.length ) / this.total ) *\n\t\t\t\t\t100;\n\t\t\t}\n\t\t}\n\n\t\t// Reset the lossless images count in case of pending images for resmush ( Nextgen only ).\n\t\tif (\n\t\t\t'nextgen' === this.smush_type &&\n\t\t\twp_smushit_data.resmush.length > 0 && \n\t\t\t(this.smushed + this.errors.length <= 1)\n\t\t) {\n\t\t\twp_smushit_data.count_images -= (wp_smushit_data.resmush.length + 1);\n\t\t}\n\n\t\t// No more images left. Show bulk wrapper and Smush notice.\n\t\tif ( 0 === this.ids.length ) {\n\t\t\t// TODO: Check it with BO and maybe move these into progress bar module for reusing.\n\t\t\tjQuery('.bulk-smush-wrapper .wp-smush-all-done').removeClass( 'sui-hidden' );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).addClass( 'sui-hidden' );\n\t\t}\n\n\t\t// Increase the progress bar and counter.\n\t\tthis._updateProgress(\n\t\t\tthis.smushed + this.errors.length,\n\t\t\tWP_Smush.helpers.precise_round( progress, 1 )\n\t\t);\n\n\t\t// Avoid updating the stats twice when the bulk smush ends on Smush's page.\n\t\tif (0 !== this.ids.length || 'nextgen' === this.smush_type) {\n\t\t\t// Update stats and counts.\n\t\t\tSmush.updateStats(this.smush_type);\n\t\t}\n\t}\n\n\t/**\n\t * Update progress.\n\t *\n\t * @param {number} count Number of images optimized.\n\t * @param {string} width Percentage complete.\n\t * @private\n\t */\n\t_updateProgress( count, width ) {\n\t\tif ( ! this.is_bulk && ! this.is_bulk_resmush ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Progress bar label.\n\t\tjQuery( 'span.wp-smush-images-percent' ).html( width + '%' );\n\t\t// Progress bar.\n\t\tjQuery( '.bulk-smush-wrapper .wp-smush-progress-inner' ).css(\n\t\t\t'width',\n\t\t\twidth + '%'\n\t\t);\n\n\t\t// Progress bar status.\n\t\tjQuery( '.bulk-smush-wrapper .sui-progress-state-text' )\n\t\t\t.find( 'span:first-child' )\n\t\t\t.html( count )\n\t\t\t.find( 'span:last-child' )\n\t\t\t.html( this.total );\n\t}\n\n\t/**\n\t * Whether to send the ajax requests further or not.\n\t *\n\t * @return {*|boolean} Should continue or not.\n\t */\n\tcontinue() {\n\t\treturn this.continueSmush && this.ids.length > 0 && this.is_bulk;\n\t\tlet continueSmush = this.button.attr( 'continue_smush' );\n\n\t\tif ( 'undefined' === typeof continueSmush ) {\n\t\t\tcontinueSmush = true;\n\t\t}\n\n\t\tif ( 'false' === continueSmush || ! continueSmush ) {\n\t\t\tcontinueSmush = false;\n\t\t}\n\n\t\treturn continueSmush && this.ids.length > 0 && this.is_bulk;\n\t}\n\n\tonStart() {\n\t\tthis.deferred = jQuery.Deferred();\n\t\tthis.deferred.errors = [];\n\t\tthis.continueSmush = true;\n\t\t// TODO: errors will reset after bulk smush limit is reached and user clicks continue.\n\t\tthis.errors = [];\n\t\t// Smushed and total we take from the progress bar... I don't like this :-(\n\t\tconst progressBar = jQuery(\n\t\t\t'.bulk-smush-wrapper .sui-progress-state-text'\n\t\t);\n\t\tthis.smushed = parseInt(\n\t\t\tprogressBar.find( 'span:first-child' ).html()\n\t\t);\n\t\tthis.total = parseInt( progressBar.find( 'span:last-child' ).html() );\n\n\t\tjQuery('.wp-smush-restore').prop('disabled', true);\n\t}\n\n\t/**\n\t * Send ajax request for optimizing single and bulk, call update_progress on ajax response.\n\t *\n\t * @return {*} Ajax call response.\n\t */\n\tcallAjax(newBulkSmushStarted = false) {\n\t\t/**\n\t\t * This here little piece of code allows to track auto continue clicks and halts bulk Smush until the page\n\t\t * is reloaded.\n\t\t *\n\t\t * @since 3.5.0\n\t\t * @see https://wordpress.org/plugins/wp-nonstop-smushit/\n\t\t */\n\t\tif (\n\t\t\t0 !== perf &&\n\t\t\t'undefined' !== typeof perf &&\n\t\t\t10 > performance.now() - perf\n\t\t) {\n\t\t\tthis.freeExceeded();\n\t\t\treturn this.deferred;\n\t\t}\n\n\t\tlet nonceValue = window.wp_smush_msgs.nonce;\n\t\t// Remove from array while processing so we can continue where left off.\n\t\tthis.current_id = this.is_bulk\n\t\t\t? this.ids.shift()\n\t\t\t: this.button.data( 'id' );\n\n\t\t// Remove the ID from respective variable as well.\n\t\tSmush.updateSmushIds( this.current_id );\n\n\t\tconst nonceField = this.button.parent().find( '#_wp_smush_nonce' );\n\t\tif ( nonceField.length > 0 ) {\n\t\t\tnonceValue = nonceField.val();\n\t\t}\n\n\t\tconst self = this;\n\n\t\tthis.request = Smush.ajax(\n\t\t\tthis.is_bulk_resmush,\n\t\t\tthis.current_id,\n\t\t\tthis.url,\n\t\t\tnonceValue,\n\t\t\tnewBulkSmushStarted\n\t\t)\n\t\t\t.done( function( res ) {\n\t\t\t\t// If no response or success is false, do not process further. Increase the error count except if bulk request limit exceeded.\n\t\t\t\tif (\n\t\t\t\t\t'undefined' === typeof res.success ||\n\t\t\t\t\t( 'undefined' !== typeof res.success &&\n\t\t\t\t\t\tfalse === res.success &&\n\t\t\t\t\t\t'undefined' !== typeof res.data &&\n\t\t\t\t\t\t'limit_exceeded' !== res.data.error )\n\t\t\t\t) {\n\t\t\t\t\tself.errors.push( self.current_id );\n\t\t\t\t\tconst error = res.data.error;\n\n\t\t\t\t\t/** @param {string} res.data.file_name */\n\t\t\t\t\tconst errorMsg = WP_Smush.helpers.prepareBulkSmushErrorRow(\n\t\t\t\t\t\terror.error_message,\n\t\t\t\t\t\terror.file_name,\n\t\t\t\t\t\terror.thumbnail,\n\t\t\t\t\t\tself.current_id,\n\t\t\t\t\t\tself.smush_type,\n\t\t\t\t\t\terror.error_code\n\t\t\t\t\t);\n\n\t\t\t\t\tself.log.removeClass('sui-hidden');\n\n\t\t\t\t\t// Print the error on screen.\n\t\t\t\t\tself.log.find( '.smush-bulk-errors' ).append( errorMsg );\n\t\t\t\t\tif ( self.errors.length > 4 ) {\n\t\t\t\t\t\tself.log.find( '.smush-bulk-errors' ).addClass('overflow-box');\n\t\t\t\t\t\tjQuery( '.smush-bulk-errors-actions' ).removeClass( 'sui-hidden' );\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\t'undefined' !== typeof res.success &&\n\t\t\t\t\tres.success\n\t\t\t\t) {\n\t\t\t\t\t// Increment the smushed count if image smushed without errors.\n\t\t\t\t\tself.smushed++;\n\t\t\t\t}\n\n\t\t\t\t// Check whether to show the warning notice or not.\n\t\t\t\tSmush.membershipValidity( res.data );\n\n\t\t\t\t/**\n\t\t\t\t * Bulk Smush limit exceeded: Stop ajax requests, remove progress bar, append the last image ID\n\t\t\t\t * back to Smush variable, and reset variables to allow the user to continue bulk Smush.\n\t\t\t\t */\n\t\t\t\tif (\n\t\t\t\t\t'undefined' !== typeof res.data &&\n\t\t\t\t\t'limit_exceeded' === res.data.error &&\n\t\t\t\t\t'resolved' !== self.deferred.state()\n\t\t\t\t) {\n\t\t\t\t\t// Hide bulk running message.\n\t\t\t\t\tconst bulkRunning = document.getElementById(\n\t\t\t\t\t\t'wp-smush-running-notice'\n\t\t\t\t\t);\n\t\t\t\t\tbulkRunning.classList.add( 'sui-hidden' );\n\n\t\t\t\t\t// Add a data attribute to the Smush button, to stop sending ajax.\n\t\t\t\t\t// self.button.attr( 'continue_smush', false );\n\t\t\t\t\tself.continueSmush = false;\n\n\t\t\t\t\t// Reinsert the current ID.\n\t\t\t\t\twp_smushit_data.unsmushed.unshift( self.current_id );\n\t\t\t\t\tself.ids.unshift( self.current_id );\n\n\t\t\t\t\tperf = performance.now();\n\t\t\t\t\tself.freeExceeded();\n\t\t\t\t} else if ( self.is_bulk ) {\n\t\t\t\t\tself.updateProgress( res );\n\t\t\t\t\tSmush.updateScoreProgress();\n\t\t\t\t}\n\n\t\t\t\tif (0 === self.ids.length && self.is_bulk ) {\n\t\t\t\t\tself.onBulkSmushCompleted();\n\t\t\t\t}\n\n\t\t\t\tself.singleDone();\n\t\t\t} )\n\t\t\t.always( function() {\n\t\t\t\tif ( ! self.continue() || ! self.is_bulk ) {\n\t\t\t\t\t// Calls deferred.done()\n\t\t\t\t\tself.deferred.resolve();\n\t\t\t\t} else {\n\t\t\t\t\tself.callAjax(false);\n\t\t\t\t}\n\t\t\t} );\n\n\t\tthis.deferred.errors = this.errors;\n\n\t\treturn this.deferred;\n\t}\n\t\n\tmaybeShowCDNUpsellForPreSiteOnCompleted() {\n\t\t// Show upsell cdn.\n\t\tconst upsellCdn = document.querySelector('.wp-smush-upsell-cdn');\n\t\tif ( upsellCdn ) {\n\t\t\tupsellCdn.querySelector('p').innerHTML = wp_smush_msgs.processed_cdn_for_free;\n\t\t\tupsellCdn.classList.remove('sui-hidden');\n\t\t}\n\t}\n\t\n\tonBulkSmushCompleted() {\n\t\t// Show upsell unlimited on completed.\n\t\tthis.maybeShowUnlimitedUpsellNotice();\n\t\t// Show CDN activation notice for pro users.\n\t\tthis.maybeShowCDNActivationNotice();\n\t\t// Show CDN upsell for old users.\n\t\tthis.maybeShowCDNUpsellForPreSiteOnCompleted();\n\t\t\n\t\tthis.maybeShowBulkErrorActions();\n\t\t\n\t\tconst callback = this.is_bulk\n\t\t\t? () => this.trackBulkSmushCompleted()\n\t\t\t: () => false;\n\n\t\tthis.syncStats().done(callback);\n\t}\n\n\tgetPercentOptimized(totalImages, totalImagesToSmush) {\n\t\tif (totalImages === totalImagesToSmush || totalImages <= 0) {\n\t\t\treturn 100;\n\t\t} else {\n\t\t\treturn Math.floor((totalImages - totalImagesToSmush) * 100 / totalImages);\n\t\t}\n\t}\n\n\t/**\n\t * Prepare error row. Will only allow to hide errors for WP media attachments (not nextgen).\n\t *\n\t * @since 1.9.0\n\t *\n\t * @param {string} errorMsg Error message.\n\t * @param {string} fileName File name.\n\t * @param {string} thumbnail Thumbnail for image (if available).\n\t * @param {number} id Image ID.\n\t * @param {string} type Smush type: media or netxgen.\n\t *\n\t * @return {string} Row with error.\n\t */\n\tstatic prepareErrorRow( errorMsg, fileName, thumbnail, id, type ) {\n\t\tconst thumbDiv =\n\t\t\t'undefined' === typeof thumbnail\n\t\t\t\t? '<i class=\"sui-icon-photo-picture\" aria-hidden=\"true\"></i>'\n\t\t\t\t: thumbnail;\n\t\tconst fileLink =\n\t\t\t'undefined' === fileName || 'undefined' === typeof fileName\n\t\t\t\t? 'undefined'\n\t\t\t\t: fileName;\n\n\t\tlet tableDiv =\n\t\t\t'<div class=\"smush-bulk-error-row\">' +\n\t\t\t'<div class=\"smush-bulk-image-data\">' +\n\t\t\tthumbDiv +\n\t\t\t'<span class=\"smush-image-name\">' +\n\t\t\tfileLink +\n\t\t\t'</span>' +\n\t\t\t'<span class=\"smush-image-error\">' +\n\t\t\terrorMsg +\n\t\t\t'</span>' +\n\t\t\t'</div>';\n\n\t\tif ( 'media' === type ) {\n\t\t\ttableDiv =\n\t\t\t\ttableDiv +\n\t\t\t\t'<div class=\"smush-bulk-image-actions\">' +\n\t\t\t\t'<button type=\"button\" class=\"sui-button-icon sui-tooltip sui-tooltip-constrained sui-tooltip-left smush-ignore-image\" data-tooltip=\"' +\n\t\t\t\twindow.wp_smush_msgs.error_ignore +\n\t\t\t\t'\" data-id=\"' +\n\t\t\t\tid +\n\t\t\t\t'\">' +\n\t\t\t\t'<i class=\"sui-icon-eye-hide\" aria-hidden=\"true\"></i>' +\n\t\t\t\t'</button>' +\n\t\t\t\t'</div>';\n\t\t}\n\n\t\ttableDiv = tableDiv + '</div>';\n\n\t\treturn tableDiv;\n\t}\n\n\ttrackBulkSmushCompleted() {\n\t\tthis.mixPanel.trackBulkSmushCompleted( GlobalStats.getGlobalStats() );\n\t}\n\n\t/**\n\t * Send ajax request for single and bulk Smushing.\n\t */\n\trun() {\n\t\t// If bulk and we have a definite number of IDs.\n\t\tif ( this.is_bulk && this.ids.length > 0 ) {\n\t\t\tthis.callAjax(true);\n\t\t}\n\n\t\tif ( ! this.is_bulk ) {\n\t\t\tthis.callAjax();\n\t\t}\n\t}\n\n\t/**\n\t * Show bulk Smush errors, and disable bulk Smush button on completion.\n\t */\n\tbindDeferredEvents() {\n\t\tconst self = this;\n\n\t\tthis.deferred.done( function() {\n\t\t\t// self.button.removeAttr( 'continue_smush' );\n\t\t\tself.continueSmush = true;\n\n\t\t\tif ( self.errors.length ) {\n\t\t\t\t/** @param {string} wp_smush_msgs.error_in_bulk */\n\t\t\t\tconst msg = self.errors.length === self.total ?\n\t\t\t\t\t\t\t\twindow.wp_smush_msgs.all_failed :\n\t\t\t\t\t\t\t\twindow.wp_smush_msgs.error_in_bulk\n\t\t\t\t\t\t\t\t.replace( '{{errors}}', self.errors.length )\n\t\t\t\t\t\t\t\t.replace( '{{total}}', self.total )\n\t\t\t\t\t\t\t\t.replace( '{{smushed}}', self.smushed );\n\n\t\t\t\tjQuery( '.wp-smush-all-done' )\n\t\t\t\t\t.addClass( 'sui-notice-warning' )\n\t\t\t\t\t.removeClass( 'sui-notice-success' )\n\t\t\t\t\t.find( 'p' )\n\t\t\t\t\t.html( msg );\n\t\t\t}\n\n\t\t\tself.bulkDone();\n\n\t\t\t// Re-enable the buttons.\n\t\t\tjQuery(\n\t\t\t\t'.wp-smush-all:not(.wp-smush-finished)'\n\t\t\t).prop('disabled', false);\n\t\t} );\n\t}\n\n\t/**\n\t * Handles the cancel button click.\n\t * Update the UI, and enable the bulk Smush button.\n\t */\n\tcancelAjax() {\n\t\t\t// Add a data attribute to the Smush button, to stop sending ajax.\n\t\t// this.button.attr( 'continue_smush', false );\n\t\tthis.continueSmush = false;\n\t\t\t// Sync and update stats.\n\t\tthis.syncStats();\n\n\t\tthis.request.abort();\n\t\tthis.enableButton();\n\t\tthis.button.removeClass( 'wp-smush-started' );\n\t\twp_smushit_data.unsmushed.unshift( this.current_id );\n\t\t\tjQuery( '.wp-smush-bulk-wrapper' ).removeClass( 'sui-hidden' );\n\n\t\t\t// Hide the progress bar.\n\t\t\tjQuery( '.wp-smush-bulk-progress-bar-wrapper' ).addClass( 'sui-hidden' );\n\n\t\tthis.mixPanel.trackBulkSmushCancel();\n\t\tthis.hideBulkFreeLimitReachedNotice();\n\t}\n\n\t/**\n\t * Remove the current ID from the unSmushed/re-Smush variable.\n\t *\n\t * @param {number} currentId\n\t */\n\tstatic updateSmushIds( currentId ) {\n\t\tif (\n\t\t\t'undefined' !== typeof wp_smushit_data.unsmushed &&\n\t\t\twp_smushit_data.unsmushed.length > 0\n\t\t) {\n\t\t\tconst uIndex = wp_smushit_data.unsmushed.indexOf( currentId );\n\t\t\tif ( uIndex > -1 ) {\n\t\t\t\twp_smushit_data.unsmushed.splice( uIndex, 1 );\n\t\t\t}\n\t\t}\n\n\t\t// Remove from the re-Smush list.\n\t\tif (\n\t\t\t'undefined' !== typeof wp_smushit_data.resmush &&\n\t\t\twp_smushit_data.resmush.length > 0\n\t\t) {\n\t\t\tconst index = wp_smushit_data.resmush.indexOf( currentId );\n\t\t\tif ( index > -1 ) {\n\t\t\t\twp_smushit_data.resmush.splice( index, 1 );\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport default Smush;\n","/* global WP_Smush */\n/* global ajaxurl */\n\n/**\n * WebP functionality.\n *\n * @since 3.8.0\n */\n\n(function () {\n\t'use strict';\n\n\tWP_Smush.WebP = {\n\t\tnonceField: document.getElementsByName('wp_smush_options_nonce'),\n\t\ttoggleModuleButton: document.getElementById('smush-toggle-webp-button'),\n\t\trecheckStatusButton: document.getElementById('smush-webp-recheck'),\n\t\trecheckStatusLink: document.getElementById('smush-webp-recheck-link'),\n\t\tshowWizardButton: document.getElementById('smush-webp-toggle-wizard'),\n\n\t\tinit() {\n\t\t\tthis.maybeShowDeleteAllSuccessNotice();\n\n\t\t\t/**\n\t\t\t * Handles the \"Deactivate\" and \"Get Started\" buttons on the WebP page.\n\t\t\t */\n\t\t\tif (this.toggleModuleButton) {\n\t\t\t\tthis.toggleModuleButton.addEventListener('click', (e) =>\n\t\t\t\t\tthis.toggleWebp(e)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"RE-CHECK STATUS' button click on WebP page.\n\t\t\t */\n\t\t\tif (this.recheckStatusButton) {\n\t\t\t\tthis.recheckStatusButton.addEventListener('click', (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.recheckStatus();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handle \"RE-CHECK STATUS' link click on WebP page.\n\t\t\t */\n\t\t\tif (this.recheckStatusLink) {\n\t\t\t\tthis.recheckStatusLink.addEventListener('click', (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.recheckStatus();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles the \"Delete WebP images\" button.\n\t\t\t */\n\t\t\tif (document.getElementById('wp-smush-webp-delete-all')) {\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById('wp-smush-webp-delete-all')\n\t\t\t\t\t.addEventListener('click', (e) => this.deleteAll(e));\n\t\t\t}\n\n\t\t\tif (this.showWizardButton) {\n\t\t\t\tthis.showWizardButton.addEventListener(\n\t\t\t\t\t'click',\n\t\t\t\t\tthis.toggleWizard\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Toggle WebP module.\n\t\t *\n\t\t * @param {Event} e\n\t\t */\n\t\ttoggleWebp(e) {\n\t\t\te.preventDefault();\n\n\t\t\tconst button = e.currentTarget,\n\t\t\t\tdoEnable = 'enable' === button.dataset.action;\n\n\t\t\tbutton.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_toggle', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.onload = () => {\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tif ('undefined' !== typeof res.success && res.success) {\n\t\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\t\twindow.location.href =\n\t\t\t\t\t\t\t\twindow.wp_smush_msgs.localWebpURL;\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if ('undefined' !== typeof res.data.message) {\n\t\t\t\t\t\tthis.showNotice(res.data.message);\n\t\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet message = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t\tif (res && 'undefined' !== typeof res.data.message) {\n\t\t\t\t\t\tmessage = res.data.message;\n\t\t\t\t\t}\n\t\t\t\t\tthis.showNotice(message);\n\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send(\n\t\t\t\t'param=' + doEnable + '&_ajax_nonce=' + this.nonceField[0].value\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * re-check server configuration for WebP.\n\t\t */\n\t\trecheckStatus() {\n\t\t\tthis.recheckStatusButton.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_get_status', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\t\t\txhr.onload = () => {\n\t\t\t\tthis.recheckStatusButton.classList.remove('sui-button-onload');\n\t\t\t\tlet message = false;\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tconst isConfigured = res.success ? '1' : '0';\n\t\t\t\t\tif (\n\t\t\t\t\t\tisConfigured !==\n\t\t\t\t\t\tthis.recheckStatusButton.dataset.isConfigured\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Reload the page when the configuration status changed.\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t}\n\n\t\t\t\tif (res && res.data) {\n\t\t\t\t\tmessage = res.data;\n\t\t\t\t}\n\n\t\t\t\tif (message) {\n\t\t\t\t\tthis.showNotice(message);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send('_ajax_nonce=' + window.wp_smush_msgs.webp_nonce);\n\t\t},\n\n\t\tdeleteAll(e) {\n\t\t\tconst button = e.currentTarget;\n\t\t\tbutton.classList.add('sui-button-onload');\n\n\t\t\tlet message = false;\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', ajaxurl + '?action=smush_webp_delete_all', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.onload = () => {\n\t\t\t\tconst res = JSON.parse(xhr.response);\n\t\t\t\tif (200 === xhr.status) {\n\t\t\t\t\tif ('undefined' !== typeof res.success && res.success) {\n\t\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\t\tlocation.search =\n\t\t\t\t\t\t\t\tlocation.search + '&notice=webp-deleted';\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\t}\n\n\t\t\t\tif (res && res.data && res.data.message) {\n\t\t\t\t\tmessage = res.data.message;\n\t\t\t\t}\n\n\t\t\t\tif (message) {\n\t\t\t\t\tbutton.classList.remove('sui-button-onload');\n\n\t\t\t\t\tconst noticeMessage = `<p style=\"text-align: left;\">${message}</p>`;\n\t\t\t\t\tconst noticeOptions = {\n\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\ticon: 'info',\n\t\t\t\t\t\tautoclose: {\n\t\t\t\t\t\t\tshow: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t\t'wp-smush-webp-delete-all-error-notice',\n\t\t\t\t\t\tnoticeMessage,\n\t\t\t\t\t\tnoticeOptions\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\txhr.send('_ajax_nonce=' + this.nonceField[0].value);\n\t\t},\n\n\t\ttoggleWizard(e) {\n\t\t\te.currentTarget.classList.add('sui-button-onload');\n\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.open(\n\t\t\t\t'GET',\n\t\t\t\tajaxurl +\n\t\t\t\t\t'?action=smush_toggle_webp_wizard&_ajax_nonce=' +\n\t\t\t\t\twindow.wp_smush_msgs.webp_nonce,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\txhr.onload = () => location.reload();\n\t\t\txhr.send();\n\t\t},\n\n\t\t/**\n\t\t * Triggers the scanning of images for updating the images to re-smush.\n\t\t *\n\t\t * @since 3.8.0\n\t\t */\n\t\trunScan() {\n\t\t\tconst xhr = new XMLHttpRequest(),\n\t\t\t\tnonceField = document.getElementsByName(\n\t\t\t\t\t'wp_smush_options_nonce'\n\t\t\t\t);\n\n\t\t\txhr.open('POST', ajaxurl + '?action=scan_for_resmush', true);\n\t\t\txhr.setRequestHeader(\n\t\t\t\t'Content-type',\n\t\t\t\t'application/x-www-form-urlencoded'\n\t\t\t);\n\n\t\t\txhr.send('_ajax_nonce=' + nonceField[0].value);\n\n\t\t\treturn xhr;\n\t\t},\n\n\t\t/**\n\t\t * Show message (notice).\n\t\t *\n\t\t * @param {string} message\n\t\t * @param {string} type\n\t\t */\n\t\tshowNotice(message, type) {\n\t\t\tif ('undefined' === typeof message) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst noticeMessage = `<p>${message}</p>`;\n\t\t\tconst noticeOptions = {\n\t\t\t\ttype: type || 'error',\n\t\t\t\ticon: 'info',\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: true,\n\t\t\t\t\tlabel: window.wp_smush_msgs.noticeDismiss,\n\t\t\t\t\ttooltip: window.wp_smush_msgs.noticeDismissTooltip,\n\t\t\t\t},\n\t\t\t\tautoclose: {\n\t\t\t\t\tshow: false,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-ajax-notice',\n\t\t\t\tnoticeMessage,\n\t\t\t\tnoticeOptions\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Show delete all webp success notice.\n\t\t */\n\t\tmaybeShowDeleteAllSuccessNotice() {\n\t\t\tif (!document.getElementById('wp-smush-webp-delete-all-notice')) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst noticeMessage = `<p>${\n\t\t\t\tdocument.getElementById('wp-smush-webp-delete-all-notice')\n\t\t\t\t\t.dataset.message\n\t\t\t}</p>`;\n\n\t\t\tconst noticeOptions = {\n\t\t\t\ttype: 'success',\n\t\t\t\ticon: 'check-tick',\n\t\t\t\tdismiss: {\n\t\t\t\t\tshow: true,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\twindow.SUI.openNotice(\n\t\t\t\t'wp-smush-webp-delete-all-notice',\n\t\t\t\tnoticeMessage,\n\t\t\t\tnoticeOptions\n\t\t\t);\n\t\t},\n\t};\n\n\tWP_Smush.WebP.init();\n})();\n","/* global ajaxurl */\n\n/**\n * External dependencies\n */\nimport assign from 'lodash/assign';\n\n/**\n * Wrapper function for ajax calls to WordPress.\n *\n * @since 3.12.0\n */\nfunction SmushFetcher() {\n\t/**\n\t * Request ajax with a promise.\n\t * Use FormData Object as data if you need to upload file\n\t *\n\t * @param {string} action\n\t * @param {Object|FormData} data\n\t * @param {string} method\n\t * @return {Promise<any>} Request results.\n\t */\n\tfunction request(action, data = {}, method = 'POST') {\n\t\tconst args = {\n\t\t\turl: ajaxurl,\n\t\t\tmethod,\n\t\t\tcache: false\n\t\t};\n\n\t\tif (data instanceof FormData) {\n\t\t\tdata.append('action', action);\n\t\t\tdata.append('_ajax_nonce', window.wp_smush_msgs.nonce);\n\t\t\targs.contentType = false;\n\t\t\targs.processData = false;\n\t\t} else {\n\t\t\tdata._ajax_nonce = data._ajax_nonce || window.wp_smush_msgs.nonce;\n\t\t\tdata.action = action;\n\t\t}\n\t\targs.data = data;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tjQuery.ajax(args).done(resolve).fail(reject);\n\t\t}).then((response) => {\n\t\t\tif (typeof response !== 'object') {\n\t\t\t\tresponse = JSON.parse(response);\n\t\t\t}\n\t\t\treturn response;\n\t\t}).catch((error) => {\n\t\t\tconsole.error('Error:', error);\n\t\t});\n\t}\n\n\tconst methods = {\n\t\t/**\n\t\t * Manage ajax for background.\n\t\t */\n\t\tbackground: {\n\t\t\t/**\n\t\t\t * Start background process.\n\t\t\t */\n\t\t\tstart: () => {\n\t\t\t\treturn request('bulk_smush_start');\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Cancel background process.\n\t\t\t */\n\t\t\tcancel: () => {\n\t\t\t\treturn request('bulk_smush_cancel');\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Initial State - Get stats on the first time.\n\t\t\t */\n\t\t\tinitState: () => {\n\t\t\t\treturn request('bulk_smush_get_status');\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Get stats.\n\t\t\t */\n\t\t\tgetStatus: () => {\n\t\t\t\treturn request('bulk_smush_get_status');\n\t\t\t},\n\n\t\t\tgetStats: () => {\n\t\t\t\treturn request('bulk_smush_get_global_stats');\n\t\t\t}\n\t\t},\n\t\tsmush: {\n\t\t\t/**\n\t\t\t * Sync stats.\n\t\t\t */\n\t\t\tsyncStats: ( data ) => {\n\t\t\t\tdata = data || {};\n\t\t\t\treturn request('get_stats', data);\n\t\t\t},\n\n\t\t\t/**\n * Ignore All.\n */\n\t\t\tignoreAll: ( type ) => {\n return request('wp_smush_ignore_all_failed_items', {\n type: type,\n });\n },\n\t\t},\n\n\t\t/**\n\t\t * Manage ajax for other requests\n\t\t */\n\t\tcommon: {\n\t\t\t/**\n\t\t\t * Dismiss Notice.\n\t\t\t *\n\t\t\t * @param {string} dismissId Notification id.\n\t\t\t */\n\t\t\tdismissNotice: (dismissId) => {\n\t\t\t\treturn request('smush_dismiss_notice', {\n\t\t\t\t\tkey: dismissId\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Hide the new features modal.\n\t\t\t *\n\t\t\t * @param {string} modalID Notification id.\n\t\t\t */\n\t\t\thideModal: (modalID) => request('hide_modal', {\n\t\t\t\tmodal_id: modalID,\n\t\t\t}),\n\n\t\t\t/**\n\t\t\t * Custom request.\n\t\t\t *\n\t\t\t * @param {Object} data\n\t\t\t */\n\t\t\trequest: (data) => data.action && request(data.action, data),\n\t\t},\n\n\t\tscanMediaLibrary: {\n\t\t\tstart: ( optimize_on_scan_completed = false ) => {\n\t\t\t\toptimize_on_scan_completed = optimize_on_scan_completed ? 1 : 0;\n\t\t\t\tconst _ajax_nonce = window.wp_smushit_data.media_library_scan.nonce;\n\t\t\t\treturn request( 'wp_smush_start_background_scan', {\n\t\t\t\t\toptimize_on_scan_completed,\n\t\t\t\t\t_ajax_nonce,\n\t\t\t\t} );\n\t\t\t},\n\n\t\t\tcancel: () => {\n\t\t\t\tconst _ajax_nonce = window.wp_smushit_data.media_library_scan.nonce;\n\t\t\t\treturn request( 'wp_smush_cancel_background_scan', {\n\t\t\t\t\t_ajax_nonce,\n\t\t\t\t} );\n\t\t\t},\n\n\t\t\tgetScanStatus: () => {\n\t\t\t\tconst _ajax_nonce = window.wp_smushit_data.media_library_scan.nonce;\n\t\t\t\treturn request( 'wp_smush_get_background_scan_status', {\n\t\t\t\t\t_ajax_nonce,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t};\n\n\tassign(this, methods);\n}\n\nconst SmushAjax = new SmushFetcher();\nexport default SmushAjax;","/*!\n * jquery.fancytree.js\n * Tree view control with support for lazy loading and much more.\n * https://github.com/mar10/fancytree/\n *\n * Copyright (c) 2008-2021, Martin Wendt (https://wwWendt.de)\n * Released under the MIT license\n * https://github.com/mar10/fancytree/wiki/LicenseInfo\n *\n * @version 2.38.1-0\n * @date 2021-09-09T01:07:22Z\n */\n\n/** Core Fancytree module.\n */\n\n// UMD wrapper for the Fancytree core module\n(function (factory) {\n\tif (typeof define === \"function\" && define.amd) {\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine([\"jquery\", \"./jquery.fancytree.ui-deps\"], factory);\n\t} else if (typeof module === \"object\" && module.exports) {\n\t\t// Node/CommonJS\n\t\trequire(\"./jquery.fancytree.ui-deps\");\n\t\tmodule.exports = factory(require(\"jquery\"));\n\t} else {\n\t\t// Browser globals\n\t\tfactory(jQuery);\n\t}\n})(function ($) {\n\t\"use strict\";\n\n\t// prevent duplicate loading\n\tif ($.ui && $.ui.fancytree) {\n\t\t$.ui.fancytree.warn(\"Fancytree: ignored duplicate include\");\n\t\treturn;\n\t}\n\n\t/******************************************************************************\n\t * Private functions and variables\n\t */\n\n\tvar i,\n\t\tattr,\n\t\tFT = null, // initialized below\n\t\tTEST_IMG = new RegExp(/\\.|\\//), // strings are considered image urls if they contain '.' or '/'\n\t\tREX_HTML = /[&<>\"'/]/g, // Escape those characters\n\t\tREX_TOOLTIP = /[<>\"'/]/g, // Don't escape `&` in tooltips\n\t\tRECURSIVE_REQUEST_ERROR = \"$recursive_request\",\n\t\tINVALID_REQUEST_TARGET_ERROR = \"$request_target_invalid\",\n\t\tENTITY_MAP = {\n\t\t\t\"&\": \"&amp;\",\n\t\t\t\"<\": \"&lt;\",\n\t\t\t\">\": \"&gt;\",\n\t\t\t'\"': \"&quot;\",\n\t\t\t\"'\": \"&#39;\",\n\t\t\t\"/\": \"&#x2F;\",\n\t\t},\n\t\tIGNORE_KEYCODES = { 16: true, 17: true, 18: true },\n\t\tSPECIAL_KEYCODES = {\n\t\t\t8: \"backspace\",\n\t\t\t9: \"tab\",\n\t\t\t10: \"return\",\n\t\t\t13: \"return\",\n\t\t\t// 16: null, 17: null, 18: null, // ignore shift, ctrl, alt\n\t\t\t19: \"pause\",\n\t\t\t20: \"capslock\",\n\t\t\t27: \"esc\",\n\t\t\t32: \"space\",\n\t\t\t33: \"pageup\",\n\t\t\t34: \"pagedown\",\n\t\t\t35: \"end\",\n\t\t\t36: \"home\",\n\t\t\t37: \"left\",\n\t\t\t38: \"up\",\n\t\t\t39: \"right\",\n\t\t\t40: \"down\",\n\t\t\t45: \"insert\",\n\t\t\t46: \"del\",\n\t\t\t59: \";\",\n\t\t\t61: \"=\",\n\t\t\t// 91: null, 93: null, // ignore left and right meta\n\t\t\t96: \"0\",\n\t\t\t97: \"1\",\n\t\t\t98: \"2\",\n\t\t\t99: \"3\",\n\t\t\t100: \"4\",\n\t\t\t101: \"5\",\n\t\t\t102: \"6\",\n\t\t\t103: \"7\",\n\t\t\t104: \"8\",\n\t\t\t105: \"9\",\n\t\t\t106: \"*\",\n\t\t\t107: \"+\",\n\t\t\t109: \"-\",\n\t\t\t110: \".\",\n\t\t\t111: \"/\",\n\t\t\t112: \"f1\",\n\t\t\t113: \"f2\",\n\t\t\t114: \"f3\",\n\t\t\t115: \"f4\",\n\t\t\t116: \"f5\",\n\t\t\t117: \"f6\",\n\t\t\t118: \"f7\",\n\t\t\t119: \"f8\",\n\t\t\t120: \"f9\",\n\t\t\t121: \"f10\",\n\t\t\t122: \"f11\",\n\t\t\t123: \"f12\",\n\t\t\t144: \"numlock\",\n\t\t\t145: \"scroll\",\n\t\t\t173: \"-\",\n\t\t\t186: \";\",\n\t\t\t187: \"=\",\n\t\t\t188: \",\",\n\t\t\t189: \"-\",\n\t\t\t190: \".\",\n\t\t\t191: \"/\",\n\t\t\t192: \"`\",\n\t\t\t219: \"[\",\n\t\t\t220: \"\\\\\",\n\t\t\t221: \"]\",\n\t\t\t222: \"'\",\n\t\t},\n\t\tMODIFIERS = {\n\t\t\t16: \"shift\",\n\t\t\t17: \"ctrl\",\n\t\t\t18: \"alt\",\n\t\t\t91: \"meta\",\n\t\t\t93: \"meta\",\n\t\t},\n\t\tMOUSE_BUTTONS = { 0: \"\", 1: \"left\", 2: \"middle\", 3: \"right\" },\n\t\t// Boolean attributes that can be set with equivalent class names in the LI tags\n\t\t// Note: v2.23: checkbox and hideCheckbox are *not* in this list\n\t\tCLASS_ATTRS =\n\t\t\t\"active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore\".split(\n\t\t\t\t\" \"\n\t\t\t),\n\t\tCLASS_ATTR_MAP = {},\n\t\t// Top-level Fancytree attributes, that can be set by dict\n\t\tTREE_ATTRS = \"columns types\".split(\" \"),\n\t\t// TREE_ATTR_MAP = {},\n\t\t// Top-level FancytreeNode attributes, that can be set by dict\n\t\tNODE_ATTRS =\n\t\t\t\"checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus\".split(\n\t\t\t\t\" \"\n\t\t\t),\n\t\tNODE_ATTR_MAP = {},\n\t\t// Mapping of lowercase -> real name (because HTML5 data-... attribute only supports lowercase)\n\t\tNODE_ATTR_LOWERCASE_MAP = {},\n\t\t// Attribute names that should NOT be added to node.data\n\t\tNONE_NODE_DATA_MAP = {\n\t\t\tactive: true,\n\t\t\tchildren: true,\n\t\t\tdata: true,\n\t\t\tfocus: true,\n\t\t};\n\n\tfor (i = 0; i < CLASS_ATTRS.length; i++) {\n\t\tCLASS_ATTR_MAP[CLASS_ATTRS[i]] = true;\n\t}\n\tfor (i = 0; i < NODE_ATTRS.length; i++) {\n\t\tattr = NODE_ATTRS[i];\n\t\tNODE_ATTR_MAP[attr] = true;\n\t\tif (attr !== attr.toLowerCase()) {\n\t\t\tNODE_ATTR_LOWERCASE_MAP[attr.toLowerCase()] = attr;\n\t\t}\n\t}\n\t// for(i=0; i<TREE_ATTRS.length; i++) {\n\t// \tTREE_ATTR_MAP[TREE_ATTRS[i]] = true;\n\t// }\n\n\tfunction _assert(cond, msg) {\n\t\t// TODO: see qunit.js extractStacktrace()\n\t\tif (!cond) {\n\t\t\tmsg = msg ? \": \" + msg : \"\";\n\t\t\tmsg = \"Fancytree assertion failed\" + msg;\n\n\t\t\t// consoleApply(\"assert\", [!!cond, msg]);\n\n\t\t\t// #1041: Raised exceptions may not be visible in the browser\n\t\t\t// console if inside promise chains, so we also print directly:\n\t\t\t$.ui.fancytree.error(msg);\n\n\t\t\t// Throw exception:\n\t\t\t$.error(msg);\n\t\t}\n\t}\n\n\tfunction _hasProp(object, property) {\n\t\treturn Object.prototype.hasOwnProperty.call(object, property);\n\t}\n\n\t/* Replacement for the deprecated `jQuery.isFunction()`. */\n\tfunction _isFunction(obj) {\n\t\treturn typeof obj === \"function\";\n\t}\n\n\t/* Replacement for the deprecated `jQuery.trim()`. */\n\tfunction _trim(text) {\n\t\treturn text == null ? \"\" : text.trim();\n\t}\n\n\t/* Replacement for the deprecated `jQuery.isArray()`. */\n\tvar _isArray = Array.isArray;\n\n\t_assert($.ui, \"Fancytree requires jQuery UI (http://jqueryui.com)\");\n\n\tfunction consoleApply(method, args) {\n\t\tvar i,\n\t\t\ts,\n\t\t\tfn = window.console ? window.console[method] : null;\n\n\t\tif (fn) {\n\t\t\ttry {\n\t\t\t\tfn.apply(window.console, args);\n\t\t\t} catch (e) {\n\t\t\t\t// IE 8?\n\t\t\t\ts = \"\";\n\t\t\t\tfor (i = 0; i < args.length; i++) {\n\t\t\t\t\ts += args[i];\n\t\t\t\t}\n\t\t\t\tfn(s);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* support: IE8 Polyfil for Date.now() */\n\tif (!Date.now) {\n\t\tDate.now = function now() {\n\t\t\treturn new Date().getTime();\n\t\t};\n\t}\n\n\t/*Return true if x is a FancytreeNode.*/\n\tfunction _isNode(x) {\n\t\treturn !!(x.tree && x.statusNodeType !== undefined);\n\t}\n\n\t/** Return true if dotted version string is equal or higher than requested version.\n\t *\n\t * See http://jsfiddle.net/mar10/FjSAN/\n\t */\n\tfunction isVersionAtLeast(dottedVersion, major, minor, patch) {\n\t\tvar i,\n\t\t\tv,\n\t\t\tt,\n\t\t\tverParts = $.map(_trim(dottedVersion).split(\".\"), function (e) {\n\t\t\t\treturn parseInt(e, 10);\n\t\t\t}),\n\t\t\ttestParts = $.map(\n\t\t\t\tArray.prototype.slice.call(arguments, 1),\n\t\t\t\tfunction (e) {\n\t\t\t\t\treturn parseInt(e, 10);\n\t\t\t\t}\n\t\t\t);\n\n\t\tfor (i = 0; i < testParts.length; i++) {\n\t\t\tv = verParts[i] || 0;\n\t\t\tt = testParts[i] || 0;\n\t\t\tif (v !== t) {\n\t\t\t\treturn v > t;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deep-merge a list of objects (but replace array-type options).\n\t *\n\t * jQuery's $.extend(true, ...) method does a deep merge, that also merges Arrays.\n\t * This variant is used to merge extension defaults with user options, and should\n\t * merge objects, but override arrays (for example the `triggerStart: [...]` option\n\t * of ext-edit). Also `null` values are copied over and not skipped.\n\t *\n\t * See issue #876\n\t *\n\t * Example:\n\t * _simpleDeepMerge({}, o1, o2);\n\t */\n\tfunction _simpleDeepMerge() {\n\t\tvar options,\n\t\t\tname,\n\t\t\tsrc,\n\t\t\tcopy,\n\t\t\tclone,\n\t\t\ttarget = arguments[0] || {},\n\t\t\ti = 1,\n\t\t\tlength = arguments.length;\n\n\t\t// Handle case when target is a string or something (possible in deep copy)\n\t\tif (typeof target !== \"object\" && !_isFunction(target)) {\n\t\t\ttarget = {};\n\t\t}\n\t\tif (i === length) {\n\t\t\tthrow Error(\"need at least two args\");\n\t\t}\n\t\tfor (; i < length; i++) {\n\t\t\t// Only deal with non-null/undefined values\n\t\t\tif ((options = arguments[i]) != null) {\n\t\t\t\t// Extend the base object\n\t\t\t\tfor (name in options) {\n\t\t\t\t\tif (_hasProp(options, name)) {\n\t\t\t\t\t\tsrc = target[name];\n\t\t\t\t\t\tcopy = options[name];\n\t\t\t\t\t\t// Prevent never-ending loop\n\t\t\t\t\t\tif (target === copy) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Recurse if we're merging plain objects\n\t\t\t\t\t\t// (NOTE: unlike $.extend, we don't merge arrays, but replace them)\n\t\t\t\t\t\tif (copy && $.isPlainObject(copy)) {\n\t\t\t\t\t\t\tclone = src && $.isPlainObject(src) ? src : {};\n\t\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\t\ttarget[name] = _simpleDeepMerge(clone, copy);\n\t\t\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t\t} else if (copy !== undefined) {\n\t\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Return the modified object\n\t\treturn target;\n\t}\n\n\t/** Return a wrapper that calls sub.methodName() and exposes\n\t * this : tree\n\t * this._local : tree.ext.EXTNAME\n\t * this._super : base.methodName.call()\n\t * this._superApply : base.methodName.apply()\n\t */\n\tfunction _makeVirtualFunction(methodName, tree, base, extension, extName) {\n\t\t// $.ui.fancytree.debug(\"_makeVirtualFunction\", methodName, tree, base, extension, extName);\n\t\t// if(rexTestSuper && !rexTestSuper.test(func)){\n\t\t// // extension.methodName() doesn't call _super(), so no wrapper required\n\t\t// return func;\n\t\t// }\n\t\t// Use an immediate function as closure\n\t\tvar proxy = (function () {\n\t\t\tvar prevFunc = tree[methodName], // org. tree method or prev. proxy\n\t\t\t\tbaseFunc = extension[methodName], //\n\t\t\t\t_local = tree.ext[extName],\n\t\t\t\t_super = function () {\n\t\t\t\t\treturn prevFunc.apply(tree, arguments);\n\t\t\t\t},\n\t\t\t\t_superApply = function (args) {\n\t\t\t\t\treturn prevFunc.apply(tree, args);\n\t\t\t\t};\n\n\t\t\t// Return the wrapper function\n\t\t\treturn function () {\n\t\t\t\tvar prevLocal = tree._local,\n\t\t\t\t\tprevSuper = tree._super,\n\t\t\t\t\tprevSuperApply = tree._superApply;\n\n\t\t\t\ttry {\n\t\t\t\t\ttree._local = _local;\n\t\t\t\t\ttree._super = _super;\n\t\t\t\t\ttree._superApply = _superApply;\n\t\t\t\t\treturn baseFunc.apply(tree, arguments);\n\t\t\t\t} finally {\n\t\t\t\t\ttree._local = prevLocal;\n\t\t\t\t\ttree._super = prevSuper;\n\t\t\t\t\ttree._superApply = prevSuperApply;\n\t\t\t\t}\n\t\t\t};\n\t\t})(); // end of Immediate Function\n\t\treturn proxy;\n\t}\n\n\t/**\n\t * Subclass `base` by creating proxy functions\n\t */\n\tfunction _subclassObject(tree, base, extension, extName) {\n\t\t// $.ui.fancytree.debug(\"_subclassObject\", tree, base, extension, extName);\n\t\tfor (var attrName in extension) {\n\t\t\tif (typeof extension[attrName] === \"function\") {\n\t\t\t\tif (typeof tree[attrName] === \"function\") {\n\t\t\t\t\t// override existing method\n\t\t\t\t\ttree[attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else if (attrName.charAt(0) === \"_\") {\n\t\t\t\t\t// Create private methods in tree.ext.EXTENSION namespace\n\t\t\t\t\ttree.ext[extName][attrName] = _makeVirtualFunction(\n\t\t\t\t\t\tattrName,\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\tbase,\n\t\t\t\t\t\textension,\n\t\t\t\t\t\textName\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"Could not override tree.\" +\n\t\t\t\t\t\t\tattrName +\n\t\t\t\t\t\t\t\". Use prefix '_' to create tree.\" +\n\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\"._\" +\n\t\t\t\t\t\t\tattrName\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Create member variables in tree.ext.EXTENSION namespace\n\t\t\t\tif (attrName !== \"options\") {\n\t\t\t\t\ttree.ext[extName][attrName] = extension[attrName];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction _getResolvedPromise(context, argArray) {\n\t\tif (context === undefined) {\n\t\t\treturn $.Deferred(function () {\n\t\t\t\tthis.resolve();\n\t\t\t}).promise();\n\t\t}\n\t\treturn $.Deferred(function () {\n\t\t\tthis.resolveWith(context, argArray);\n\t\t}).promise();\n\t}\n\n\tfunction _getRejectedPromise(context, argArray) {\n\t\tif (context === undefined) {\n\t\t\treturn $.Deferred(function () {\n\t\t\t\tthis.reject();\n\t\t\t}).promise();\n\t\t}\n\t\treturn $.Deferred(function () {\n\t\t\tthis.rejectWith(context, argArray);\n\t\t}).promise();\n\t}\n\n\tfunction _makeResolveFunc(deferred, context) {\n\t\treturn function () {\n\t\t\tdeferred.resolveWith(context);\n\t\t};\n\t}\n\n\tfunction _getElementDataAsDict($el) {\n\t\t// Evaluate 'data-NAME' attributes with special treatment for 'data-json'.\n\t\tvar d = $.extend({}, $el.data()),\n\t\t\tjson = d.json;\n\n\t\tdelete d.fancytree; // added to container by widget factory (old jQuery UI)\n\t\tdelete d.uiFancytree; // added to container by widget factory\n\n\t\tif (json) {\n\t\t\tdelete d.json;\n\t\t\t// <li data-json='...'> is already returned as object (http://api.jquery.com/data/#data-html5)\n\t\t\td = $.extend(d, json);\n\t\t}\n\t\treturn d;\n\t}\n\n\tfunction _escapeTooltip(s) {\n\t\treturn (\"\" + s).replace(REX_TOOLTIP, function (s) {\n\t\t\treturn ENTITY_MAP[s];\n\t\t});\n\t}\n\n\t// TODO: use currying\n\tfunction _makeNodeTitleMatcher(s) {\n\t\ts = s.toLowerCase();\n\t\treturn function (node) {\n\t\t\treturn node.title.toLowerCase().indexOf(s) >= 0;\n\t\t};\n\t}\n\n\tfunction _makeNodeTitleStartMatcher(s) {\n\t\tvar reMatch = new RegExp(\"^\" + s, \"i\");\n\t\treturn function (node) {\n\t\t\treturn reMatch.test(node.title);\n\t\t};\n\t}\n\n\t/******************************************************************************\n\t * FancytreeNode\n\t */\n\n\t/**\n\t * Creates a new FancytreeNode\n\t *\n\t * @class FancytreeNode\n\t * @classdesc A FancytreeNode represents the hierarchical data model and operations.\n\t *\n\t * @param {FancytreeNode} parent\n\t * @param {NodeData} obj\n\t *\n\t * @property {Fancytree} tree The tree instance\n\t * @property {FancytreeNode} parent The parent node\n\t * @property {string} key Node id (must be unique inside the tree)\n\t * @property {string} title Display name (may contain HTML)\n\t * @property {object} data Contains all extra data that was passed on node creation\n\t * @property {FancytreeNode[] | null | undefined} children Array of child nodes.<br>\n\t * For lazy nodes, null or undefined means 'not yet loaded'. Use an empty array\n\t * to define a node that has no children.\n\t * @property {boolean} expanded Use isExpanded(), setExpanded() to access this property.\n\t * @property {string} extraClasses Additional CSS classes, added to the node's `<span>`.<br>\n\t * Note: use `node.add/remove/toggleClass()` to modify.\n\t * @property {boolean} folder Folder nodes have different default icons and click behavior.<br>\n\t * Note: Also non-folders may have children.\n\t * @property {string} statusNodeType null for standard nodes. Otherwise type of special system node: 'error', 'loading', 'nodata', or 'paging'.\n\t * @property {boolean} lazy True if this node is loaded on demand, i.e. on first expansion.\n\t * @property {boolean} selected Use isSelected(), setSelected() to access this property.\n\t * @property {string} tooltip Alternative description used as hover popup\n\t * @property {string} iconTooltip Description used as hover popup for icon. @since 2.27\n\t * @property {string} type Node type, used with tree.types map. @since 2.27\n\t */\n\tfunction FancytreeNode(parent, obj) {\n\t\tvar i, l, name, cl;\n\n\t\tthis.parent = parent;\n\t\tthis.tree = parent.tree;\n\t\tthis.ul = null;\n\t\tthis.li = null; // <li id='key' ftnode=this> tag\n\t\tthis.statusNodeType = null; // if this is a temp. node to display the status of its parent\n\t\tthis._isLoading = false; // if this node itself is loading\n\t\tthis._error = null; // {message: '...'} if a load error occurred\n\t\tthis.data = {};\n\n\t\t// TODO: merge this code with node.toDict()\n\t\t// copy attributes from obj object\n\t\tfor (i = 0, l = NODE_ATTRS.length; i < l; i++) {\n\t\t\tname = NODE_ATTRS[i];\n\t\t\tthis[name] = obj[name];\n\t\t}\n\t\t// unselectableIgnore and unselectableStatus imply unselectable\n\t\tif (\n\t\t\tthis.unselectableIgnore != null ||\n\t\t\tthis.unselectableStatus != null\n\t\t) {\n\t\t\tthis.unselectable = true;\n\t\t}\n\t\tif (obj.hideCheckbox) {\n\t\t\t$.error(\n\t\t\t\t\"'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'\"\n\t\t\t);\n\t\t}\n\t\t// node.data += obj.data\n\t\tif (obj.data) {\n\t\t\t$.extend(this.data, obj.data);\n\t\t}\n\t\t// Copy all other attributes to this.data.NAME\n\t\tfor (name in obj) {\n\t\t\tif (\n\t\t\t\t!NODE_ATTR_MAP[name] &&\n\t\t\t\t(this.tree.options.copyFunctionsToData ||\n\t\t\t\t\t!_isFunction(obj[name])) &&\n\t\t\t\t!NONE_NODE_DATA_MAP[name]\n\t\t\t) {\n\t\t\t\t// node.data.NAME = obj.NAME\n\t\t\t\tthis.data[name] = obj[name];\n\t\t\t}\n\t\t}\n\n\t\t// Fix missing key\n\t\tif (this.key == null) {\n\t\t\t// test for null OR undefined\n\t\t\tif (this.tree.options.defaultKey) {\n\t\t\t\tthis.key = \"\" + this.tree.options.defaultKey(this);\n\t\t\t\t_assert(this.key, \"defaultKey() must return a unique key\");\n\t\t\t} else {\n\t\t\t\tthis.key = \"_\" + FT._nextNodeKey++;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.key = \"\" + this.key; // Convert to string (#217)\n\t\t}\n\n\t\t// Fix tree.activeNode\n\t\t// TODO: not elegant: we use obj.active as marker to set tree.activeNode\n\t\t// when loading from a dictionary.\n\t\tif (obj.active) {\n\t\t\t_assert(\n\t\t\t\tthis.tree.activeNode === null,\n\t\t\t\t\"only one active node allowed\"\n\t\t\t);\n\t\t\tthis.tree.activeNode = this;\n\t\t}\n\t\tif (obj.selected) {\n\t\t\t// #186\n\t\t\tthis.tree.lastSelectedNode = this;\n\t\t}\n\t\t// TODO: handle obj.focus = true\n\n\t\t// Create child nodes\n\t\tcl = obj.children;\n\t\tif (cl) {\n\t\t\tif (cl.length) {\n\t\t\t\tthis._setChildren(cl);\n\t\t\t} else {\n\t\t\t\t// if an empty array was passed for a lazy node, keep it, in order to mark it 'loaded'\n\t\t\t\tthis.children = this.lazy ? [] : null;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.children = null;\n\t\t}\n\t\t// Add to key/ref map (except for root node)\n\t\t//\tif( parent ) {\n\t\tthis.tree._callHook(\"treeRegisterNode\", this.tree, true, this);\n\t\t//\t}\n\t}\n\n\tFancytreeNode.prototype = /** @lends FancytreeNode# */ {\n\t\t/* Return the direct child FancytreeNode with a given key, index. */\n\t\t_findDirectChild: function (ptr) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tcl = this.children;\n\n\t\t\tif (cl) {\n\t\t\t\tif (typeof ptr === \"string\") {\n\t\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\t\tif (cl[i].key === ptr) {\n\t\t\t\t\t\t\treturn cl[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof ptr === \"number\") {\n\t\t\t\t\treturn this.children[ptr];\n\t\t\t\t} else if (ptr.parent === this) {\n\t\t\t\t\treturn ptr;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t// TODO: activate()\n\t\t// TODO: activateSilently()\n\t\t/* Internal helper called in recursive addChildren sequence.*/\n\t\t_setChildren: function (children) {\n\t\t\t_assert(\n\t\t\t\tchildren && (!this.children || this.children.length === 0),\n\t\t\t\t\"only init supported\"\n\t\t\t);\n\t\t\tthis.children = [];\n\t\t\tfor (var i = 0, l = children.length; i < l; i++) {\n\t\t\t\tthis.children.push(new FancytreeNode(this, children[i]));\n\t\t\t}\n\t\t\tthis.tree._callHook(\n\t\t\t\t\"treeStructureChanged\",\n\t\t\t\tthis.tree,\n\t\t\t\t\"setChildren\"\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Append (or insert) a list of child nodes.\n\t\t *\n\t\t * @param {NodeData[]} children array of child node definitions (also single child accepted)\n\t\t * @param {FancytreeNode | string | Integer} [insertBefore] child node (or key or index of such).\n\t\t * If omitted, the new children are appended.\n\t\t * @returns {FancytreeNode} first child added\n\t\t *\n\t\t * @see FancytreeNode#applyPatch\n\t\t */\n\t\taddChildren: function (children, insertBefore) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tpos,\n\t\t\t\torigFirstChild = this.getFirstChild(),\n\t\t\t\torigLastChild = this.getLastChild(),\n\t\t\t\tfirstNode = null,\n\t\t\t\tnodeList = [];\n\n\t\t\tif ($.isPlainObject(children)) {\n\t\t\t\tchildren = [children];\n\t\t\t}\n\t\t\tif (!this.children) {\n\t\t\t\tthis.children = [];\n\t\t\t}\n\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\tnodeList.push(new FancytreeNode(this, children[i]));\n\t\t\t}\n\t\t\tfirstNode = nodeList[0];\n\t\t\tif (insertBefore == null) {\n\t\t\t\tthis.children = this.children.concat(nodeList);\n\t\t\t} else {\n\t\t\t\t// Returns null if insertBefore is not a direct child:\n\t\t\t\tinsertBefore = this._findDirectChild(insertBefore);\n\t\t\t\tpos = $.inArray(insertBefore, this.children);\n\t\t\t\t_assert(pos >= 0, \"insertBefore must be an existing child\");\n\t\t\t\t// insert nodeList after children[pos]\n\t\t\t\tthis.children.splice.apply(\n\t\t\t\t\tthis.children,\n\t\t\t\t\t[pos, 0].concat(nodeList)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (origFirstChild && !insertBefore) {\n\t\t\t\t// #708: Fast path -- don't render every child of root, just the new ones!\n\t\t\t\t// #723, #729: but only if it's appended to an existing child list\n\t\t\t\tfor (i = 0, l = nodeList.length; i < l; i++) {\n\t\t\t\t\tnodeList[i].render(); // New nodes were never rendered before\n\t\t\t\t}\n\t\t\t\t// Adjust classes where status may have changed\n\t\t\t\t// Has a first child\n\t\t\t\tif (origFirstChild !== this.getFirstChild()) {\n\t\t\t\t\t// Different first child -- recompute classes\n\t\t\t\t\torigFirstChild.renderStatus();\n\t\t\t\t}\n\t\t\t\tif (origLastChild !== this.getLastChild()) {\n\t\t\t\t\t// Different last child -- recompute classes\n\t\t\t\t\torigLastChild.renderStatus();\n\t\t\t\t}\n\t\t\t} else if (!this.parent || this.parent.ul || this.tr) {\n\t\t\t\t// render if the parent was rendered (or this is a root node)\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t\tif (this.tree.options.selectMode === 3) {\n\t\t\t\tthis.fixSelection3FromEndNodes();\n\t\t\t}\n\t\t\tthis.triggerModifyChild(\n\t\t\t\t\"add\",\n\t\t\t\tnodeList.length === 1 ? nodeList[0] : null\n\t\t\t);\n\t\t\treturn firstNode;\n\t\t},\n\t\t/**\n\t\t * Add class to node's span tag and to .extraClasses.\n\t\t *\n\t\t * @param {string} className class name\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\taddClass: function (className) {\n\t\t\treturn this.toggleClass(className, true);\n\t\t},\n\t\t/**\n\t\t * Append or prepend a node, or append a child node.\n\t\t *\n\t\t * This a convenience function that calls addChildren()\n\t\t *\n\t\t * @param {NodeData} node node definition\n\t\t * @param {string} [mode=child] 'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child')\n\t\t * @returns {FancytreeNode} new node\n\t\t */\n\t\taddNode: function (node, mode) {\n\t\t\tif (mode === undefined || mode === \"over\") {\n\t\t\t\tmode = \"child\";\n\t\t\t}\n\t\t\tswitch (mode) {\n\t\t\t\tcase \"after\":\n\t\t\t\t\treturn this.getParent().addChildren(\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tthis.getNextSibling()\n\t\t\t\t\t);\n\t\t\t\tcase \"before\":\n\t\t\t\t\treturn this.getParent().addChildren(node, this);\n\t\t\t\tcase \"firstChild\":\n\t\t\t\t\t// Insert before the first child if any\n\t\t\t\t\tvar insertBefore = this.children ? this.children[0] : null;\n\t\t\t\t\treturn this.addChildren(node, insertBefore);\n\t\t\t\tcase \"child\":\n\t\t\t\tcase \"over\":\n\t\t\t\t\treturn this.addChildren(node);\n\t\t\t}\n\t\t\t_assert(false, \"Invalid mode: \" + mode);\n\t\t},\n\t\t/**Add child status nodes that indicate 'More...', etc.\n\t\t *\n\t\t * This also maintains the node's `partload` property.\n\t\t * @param {boolean|object} node optional node definition. Pass `false` to remove all paging nodes.\n\t\t * @param {string} [mode='child'] 'child'|firstChild'\n\t\t * @since 2.15\n\t\t */\n\t\taddPagingNode: function (node, mode) {\n\t\t\tvar i, n;\n\n\t\t\tmode = mode || \"child\";\n\t\t\tif (node === false) {\n\t\t\t\tfor (i = this.children.length - 1; i >= 0; i--) {\n\t\t\t\t\tn = this.children[i];\n\t\t\t\t\tif (n.statusNodeType === \"paging\") {\n\t\t\t\t\t\tthis.removeChild(n);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.partload = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnode = $.extend(\n\t\t\t\t{\n\t\t\t\t\ttitle: this.tree.options.strings.moreData,\n\t\t\t\t\tstatusNodeType: \"paging\",\n\t\t\t\t\ticon: false,\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t\tthis.partload = true;\n\t\t\treturn this.addNode(node, mode);\n\t\t},\n\t\t/**\n\t\t * Append new node after this.\n\t\t *\n\t\t * This a convenience function that calls addNode(node, 'after')\n\t\t *\n\t\t * @param {NodeData} node node definition\n\t\t * @returns {FancytreeNode} new node\n\t\t */\n\t\tappendSibling: function (node) {\n\t\t\treturn this.addNode(node, \"after\");\n\t\t},\n\t\t/**\n\t\t * (experimental) Apply a modification (or navigation) operation.\n\t\t *\n\t\t * @param {string} cmd\n\t\t * @param {object} [opts]\n\t\t * @see Fancytree#applyCommand\n\t\t * @since 2.32\n\t\t */\n\t\tapplyCommand: function (cmd, opts) {\n\t\t\treturn this.tree.applyCommand(cmd, this, opts);\n\t\t},\n\t\t/**\n\t\t * Modify existing child nodes.\n\t\t *\n\t\t * @param {NodePatch} patch\n\t\t * @returns {$.Promise}\n\t\t * @see FancytreeNode#addChildren\n\t\t */\n\t\tapplyPatch: function (patch) {\n\t\t\t// patch [key, null] means 'remove'\n\t\t\tif (patch === null) {\n\t\t\t\tthis.remove();\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\t// TODO: make sure that root node is not collapsed or modified\n\t\t\t// copy (most) attributes to node.ATTR or node.data.ATTR\n\t\t\tvar name,\n\t\t\t\tpromise,\n\t\t\t\tv,\n\t\t\t\tIGNORE_MAP = { children: true, expanded: true, parent: true }; // TODO: should be global\n\n\t\t\tfor (name in patch) {\n\t\t\t\tif (_hasProp(patch, name)) {\n\t\t\t\t\tv = patch[name];\n\t\t\t\t\tif (!IGNORE_MAP[name] && !_isFunction(v)) {\n\t\t\t\t\t\tif (NODE_ATTR_MAP[name]) {\n\t\t\t\t\t\t\tthis[name] = v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.data[name] = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Remove and/or create children\n\t\t\tif (_hasProp(patch, \"children\")) {\n\t\t\t\tthis.removeChildren();\n\t\t\t\tif (patch.children) {\n\t\t\t\t\t// only if not null and not empty list\n\t\t\t\t\t// TODO: addChildren instead?\n\t\t\t\t\tthis._setChildren(patch.children);\n\t\t\t\t}\n\t\t\t\t// TODO: how can we APPEND or INSERT child nodes?\n\t\t\t}\n\t\t\tif (this.isVisible()) {\n\t\t\t\tthis.renderTitle();\n\t\t\t\tthis.renderStatus();\n\t\t\t}\n\t\t\t// Expand collapse (final step, since this may be async)\n\t\t\tif (_hasProp(patch, \"expanded\")) {\n\t\t\t\tpromise = this.setExpanded(patch.expanded);\n\t\t\t} else {\n\t\t\t\tpromise = _getResolvedPromise(this);\n\t\t\t}\n\t\t\treturn promise;\n\t\t},\n\t\t/** Collapse all sibling nodes.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tcollapseSiblings: function () {\n\t\t\treturn this.tree._callHook(\"nodeCollapseSiblings\", this);\n\t\t},\n\t\t/** Copy this node as sibling or child of `node`.\n\t\t *\n\t\t * @param {FancytreeNode} node source node\n\t\t * @param {string} [mode=child] 'before' | 'after' | 'child'\n\t\t * @param {Function} [map] callback function(NodeData, FancytreeNode) that could modify the new node\n\t\t * @returns {FancytreeNode} new\n\t\t */\n\t\tcopyTo: function (node, mode, map) {\n\t\t\treturn node.addNode(this.toDict(true, map), mode);\n\t\t},\n\t\t/** Count direct and indirect children.\n\t\t *\n\t\t * @param {boolean} [deep=true] pass 'false' to only count direct children\n\t\t * @returns {int} number of child nodes\n\t\t */\n\t\tcountChildren: function (deep) {\n\t\t\tvar cl = this.children,\n\t\t\t\ti,\n\t\t\t\tl,\n\t\t\t\tn;\n\t\t\tif (!cl) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tn = cl.length;\n\t\t\tif (deep !== false) {\n\t\t\t\tfor (i = 0, l = n; i < l; i++) {\n\t\t\t\t\tn += cl[i].countChildren();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn n;\n\t\t},\n\t\t// TODO: deactivate()\n\t\t/** Write to browser console if debugLevel >= 4 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tdebug: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 4) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Deprecated.\n\t\t * @deprecated since 2014-02-16. Use resetLazy() instead.\n\t\t */\n\t\tdiscard: function () {\n\t\t\tthis.warn(\n\t\t\t\t\"FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead.\"\n\t\t\t);\n\t\t\treturn this.resetLazy();\n\t\t},\n\t\t/** Remove DOM elements for all descendents. May be called on .collapse event\n\t\t * to keep the DOM small.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t */\n\t\tdiscardMarkup: function (includeSelf) {\n\t\t\tvar fn = includeSelf ? \"nodeRemoveMarkup\" : \"nodeRemoveChildMarkup\";\n\t\t\tthis.tree._callHook(fn, this);\n\t\t},\n\t\t/** Write error to browser console if debugLevel >= 1 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\terror: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 1) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t}\n\t\t},\n\t\t/**Find all nodes that match condition (excluding self).\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode[]} array of nodes (may be empty)\n\t\t */\n\t\tfindAll: function (match) {\n\t\t\tmatch = _isFunction(match) ? match : _makeNodeTitleMatcher(match);\n\t\t\tvar res = [];\n\t\t\tthis.visit(function (n) {\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres.push(n);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn res;\n\t\t},\n\t\t/**Find first node that matches condition (excluding self).\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t * @see FancytreeNode#findAll\n\t\t */\n\t\tfindFirst: function (match) {\n\t\t\tmatch = _isFunction(match) ? match : _makeNodeTitleMatcher(match);\n\t\t\tvar res = null;\n\t\t\tthis.visit(function (n) {\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres = n;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn res;\n\t\t},\n\t\t/** Find a node relative to self.\n\t\t *\n\t\t * @param {number|string} where The keyCode that would normally trigger this move,\n\t\t *\t\tor a keyword ('down', 'first', 'last', 'left', 'parent', 'right', 'up').\n\t\t * @returns {FancytreeNode}\n\t\t * @since v2.31\n\t\t */\n\t\tfindRelatedNode: function (where, includeHidden) {\n\t\t\treturn this.tree.findRelatedNode(this, where, includeHidden);\n\t\t},\n\t\t/* Apply selection state (internal use only) */\n\t\t_changeSelectStatusAttrs: function (state) {\n\t\t\tvar changed = false,\n\t\t\t\topts = this.tree.options,\n\t\t\t\tunselectable = FT.evalOption(\n\t\t\t\t\t\"unselectable\",\n\t\t\t\t\tthis,\n\t\t\t\t\tthis,\n\t\t\t\t\topts,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\tunselectableStatus = FT.evalOption(\n\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\tthis,\n\t\t\t\t\tthis,\n\t\t\t\t\topts,\n\t\t\t\t\tundefined\n\t\t\t\t);\n\n\t\t\tif (unselectable && unselectableStatus != null) {\n\t\t\t\tstate = unselectableStatus;\n\t\t\t}\n\t\t\tswitch (state) {\n\t\t\t\tcase false:\n\t\t\t\t\tchanged = this.selected || this.partsel;\n\t\t\t\t\tthis.selected = false;\n\t\t\t\t\tthis.partsel = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase true:\n\t\t\t\t\tchanged = !this.selected || !this.partsel;\n\t\t\t\t\tthis.selected = true;\n\t\t\t\t\tthis.partsel = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase undefined:\n\t\t\t\t\tchanged = this.selected || !this.partsel;\n\t\t\t\t\tthis.selected = false;\n\t\t\t\t\tthis.partsel = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t_assert(false, \"invalid state: \" + state);\n\t\t\t}\n\t\t\t// this.debug(\"fixSelection3AfterLoad() _changeSelectStatusAttrs()\", state, changed);\n\t\t\tif (changed) {\n\t\t\t\tthis.renderStatus();\n\t\t\t}\n\t\t\treturn changed;\n\t\t},\n\t\t/**\n\t\t * Fix selection status, after this node was (de)selected in multi-hier mode.\n\t\t * This includes (de)selecting all children.\n\t\t */\n\t\tfixSelection3AfterClick: function (callOpts) {\n\t\t\tvar flag = this.isSelected();\n\n\t\t\t// this.debug(\"fixSelection3AfterClick()\");\n\n\t\t\tthis.visit(function (node) {\n\t\t\t\tnode._changeSelectStatusAttrs(flag);\n\t\t\t\tif (node.radiogroup) {\n\t\t\t\t\t// #931: don't (de)select this branch\n\t\t\t\t\treturn \"skip\";\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.fixSelection3FromEndNodes(callOpts);\n\t\t},\n\t\t/**\n\t\t * Fix selection status for multi-hier mode.\n\t\t * Only end-nodes are considered to update the descendants branch and parents.\n\t\t * Should be called after this node has loaded new children or after\n\t\t * children have been modified using the API.\n\t\t */\n\t\tfixSelection3FromEndNodes: function (callOpts) {\n\t\t\tvar opts = this.tree.options;\n\n\t\t\t// this.debug(\"fixSelection3FromEndNodes()\");\n\t\t\t_assert(opts.selectMode === 3, \"expected selectMode 3\");\n\n\t\t\t// Visit all end nodes and adjust their parent's `selected` and `partsel`\n\t\t\t// attributes. Return selection state true, false, or undefined.\n\t\t\tfunction _walk(node) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tchild,\n\t\t\t\t\ts,\n\t\t\t\t\tstate,\n\t\t\t\t\tallSelected,\n\t\t\t\t\tsomeSelected,\n\t\t\t\t\tunselIgnore,\n\t\t\t\t\tunselState,\n\t\t\t\t\tchildren = node.children;\n\n\t\t\t\tif (children && children.length) {\n\t\t\t\t\t// check all children recursively\n\t\t\t\t\tallSelected = true;\n\t\t\t\t\tsomeSelected = false;\n\n\t\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\t\tchild = children[i];\n\t\t\t\t\t\t// the selection state of a node is not relevant; we need the end-nodes\n\t\t\t\t\t\ts = _walk(child);\n\t\t\t\t\t\t// if( !child.unselectableIgnore ) {\n\t\t\t\t\t\tunselIgnore = FT.evalOption(\n\t\t\t\t\t\t\t\"unselectableIgnore\",\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\topts,\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!unselIgnore) {\n\t\t\t\t\t\t\tif (s !== false) {\n\t\t\t\t\t\t\t\tsomeSelected = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (s !== true) {\n\t\t\t\t\t\t\t\tallSelected = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\tstate = allSelected\n\t\t\t\t\t\t? true\n\t\t\t\t\t\t: someSelected\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: false;\n\t\t\t\t} else {\n\t\t\t\t\t// This is an end-node: simply report the status\n\t\t\t\t\tunselState = FT.evalOption(\n\t\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tundefined\n\t\t\t\t\t);\n\t\t\t\t\tstate = unselState == null ? !!node.selected : !!unselState;\n\t\t\t\t}\n\t\t\t\t// #939: Keep a `partsel` flag that was explicitly set on a lazy node\n\t\t\t\tif (\n\t\t\t\t\tnode.partsel &&\n\t\t\t\t\t!node.selected &&\n\t\t\t\t\tnode.lazy &&\n\t\t\t\t\tnode.children == null\n\t\t\t\t) {\n\t\t\t\t\tstate = undefined;\n\t\t\t\t}\n\t\t\t\tnode._changeSelectStatusAttrs(state);\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\t_walk(this);\n\n\t\t\t// Update parent's state\n\t\t\tthis.visitParents(function (node) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tchild,\n\t\t\t\t\tstate,\n\t\t\t\t\tunselIgnore,\n\t\t\t\t\tunselState,\n\t\t\t\t\tchildren = node.children,\n\t\t\t\t\tallSelected = true,\n\t\t\t\t\tsomeSelected = false;\n\n\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tchild = children[i];\n\t\t\t\t\tunselIgnore = FT.evalOption(\n\t\t\t\t\t\t\"unselectableIgnore\",\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\tif (!unselIgnore) {\n\t\t\t\t\t\tunselState = FT.evalOption(\n\t\t\t\t\t\t\t\"unselectableStatus\",\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\topts,\n\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t);\n\t\t\t\t\t\tstate =\n\t\t\t\t\t\t\tunselState == null\n\t\t\t\t\t\t\t\t? !!child.selected\n\t\t\t\t\t\t\t\t: !!unselState;\n\t\t\t\t\t\t// When fixing the parents, we trust the sibling status (i.e.\n\t\t\t\t\t\t// we don't recurse)\n\t\t\t\t\t\tif (state || child.partsel) {\n\t\t\t\t\t\t\tsomeSelected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!state) {\n\t\t\t\t\t\t\tallSelected = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\tstate = allSelected ? true : someSelected ? undefined : false;\n\t\t\t\tnode._changeSelectStatusAttrs(state);\n\t\t\t});\n\t\t},\n\t\t// TODO: focus()\n\t\t/**\n\t\t * Update node data. If dict contains 'children', then also replace\n\t\t * the hole sub tree.\n\t\t * @param {NodeData} dict\n\t\t *\n\t\t * @see FancytreeNode#addChildren\n\t\t * @see FancytreeNode#applyPatch\n\t\t */\n\t\tfromDict: function (dict) {\n\t\t\t// copy all other attributes to this.data.xxx\n\t\t\tfor (var name in dict) {\n\t\t\t\tif (NODE_ATTR_MAP[name]) {\n\t\t\t\t\t// node.NAME = dict.NAME\n\t\t\t\t\tthis[name] = dict[name];\n\t\t\t\t} else if (name === \"data\") {\n\t\t\t\t\t// node.data += dict.data\n\t\t\t\t\t$.extend(this.data, dict.data);\n\t\t\t\t} else if (\n\t\t\t\t\t!_isFunction(dict[name]) &&\n\t\t\t\t\t!NONE_NODE_DATA_MAP[name]\n\t\t\t\t) {\n\t\t\t\t\t// node.data.NAME = dict.NAME\n\t\t\t\t\tthis.data[name] = dict[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dict.children) {\n\t\t\t\t// recursively set children and render\n\t\t\t\tthis.removeChildren();\n\t\t\t\tthis.addChildren(dict.children);\n\t\t\t}\n\t\t\tthis.renderTitle();\n\t\t\t/*\n\t\t\tvar children = dict.children;\n\t\t\tif(children === undefined){\n\t\t\t\tthis.data = $.extend(this.data, dict);\n\t\t\t\tthis.render();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdict = $.extend({}, dict);\n\t\t\tdict.children = undefined;\n\t\t\tthis.data = $.extend(this.data, dict);\n\t\t\tthis.removeChildren();\n\t\t\tthis.addChild(children);\n\t\t\t*/\n\t\t},\n\t\t/** Return the list of child nodes (undefined for unexpanded lazy nodes).\n\t\t * @returns {FancytreeNode[] | undefined}\n\t\t */\n\t\tgetChildren: function () {\n\t\t\tif (this.hasChildren() === undefined) {\n\t\t\t\t// TODO: only required for lazy nodes?\n\t\t\t\treturn undefined; // Lazy node: unloaded, currently loading, or load error\n\t\t\t}\n\t\t\treturn this.children;\n\t\t},\n\t\t/** Return the first child node or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetFirstChild: function () {\n\t\t\treturn this.children ? this.children[0] : null;\n\t\t},\n\t\t/** Return the 0-based child index.\n\t\t * @returns {int}\n\t\t */\n\t\tgetIndex: function () {\n\t\t\t// return this.parent.children.indexOf(this);\n\t\t\treturn $.inArray(this, this.parent.children); // indexOf doesn't work in IE7\n\t\t},\n\t\t/** Return the hierarchical child index (1-based, e.g. '3.2.4').\n\t\t * @param {string} [separator=\".\"]\n\t\t * @param {int} [digits=1]\n\t\t * @returns {string}\n\t\t */\n\t\tgetIndexHier: function (separator, digits) {\n\t\t\tseparator = separator || \".\";\n\t\t\tvar s,\n\t\t\t\tres = [];\n\t\t\t$.each(this.getParentList(false, true), function (i, o) {\n\t\t\t\ts = \"\" + (o.getIndex() + 1);\n\t\t\t\tif (digits) {\n\t\t\t\t\t// prepend leading zeroes\n\t\t\t\t\ts = (\"0000000\" + s).substr(-digits);\n\t\t\t\t}\n\t\t\t\tres.push(s);\n\t\t\t});\n\t\t\treturn res.join(separator);\n\t\t},\n\t\t/** Return the parent keys separated by options.keyPathSeparator, e.g. \"/id_1/id_17/id_32\".\n\t\t *\n\t\t * (Unlike `node.getPath()`, this method prepends a \"/\" and inverts the first argument.)\n\t\t *\n\t\t * @see FancytreeNode#getPath\n\t\t * @param {boolean} [excludeSelf=false]\n\t\t * @returns {string}\n\t\t */\n\t\tgetKeyPath: function (excludeSelf) {\n\t\t\tvar sep = this.tree.options.keyPathSeparator;\n\n\t\t\treturn sep + this.getPath(!excludeSelf, \"key\", sep);\n\t\t},\n\t\t/** Return the last child of this node or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetLastChild: function () {\n\t\t\treturn this.children\n\t\t\t\t? this.children[this.children.length - 1]\n\t\t\t\t: null;\n\t\t},\n\t\t/** Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... .\n\t\t * @returns {int}\n\t\t */\n\t\tgetLevel: function () {\n\t\t\tvar level = 0,\n\t\t\t\tdtn = this.parent;\n\t\t\twhile (dtn) {\n\t\t\t\tlevel++;\n\t\t\t\tdtn = dtn.parent;\n\t\t\t}\n\t\t\treturn level;\n\t\t},\n\t\t/** Return the successor node (under the same parent) or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetNextSibling: function () {\n\t\t\t// TODO: use indexOf, if available: (not in IE6)\n\t\t\tif (this.parent) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tac = this.parent.children;\n\n\t\t\t\tfor (i = 0, l = ac.length - 1; i < l; i++) {\n\t\t\t\t\t// up to length-2, so next(last) = null\n\t\t\t\t\tif (ac[i] === this) {\n\t\t\t\t\t\treturn ac[i + 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t/** Return the parent node (null for the system root node).\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetParent: function () {\n\t\t\t// TODO: return null for top-level nodes?\n\t\t\treturn this.parent;\n\t\t},\n\t\t/** Return an array of all parent nodes (top-down).\n\t\t * @param {boolean} [includeRoot=false] Include the invisible system root node.\n\t\t * @param {boolean} [includeSelf=false] Include the node itself.\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetParentList: function (includeRoot, includeSelf) {\n\t\t\tvar l = [],\n\t\t\t\tdtn = includeSelf ? this : this.parent;\n\t\t\twhile (dtn) {\n\t\t\t\tif (includeRoot || dtn.parent) {\n\t\t\t\t\tl.unshift(dtn);\n\t\t\t\t}\n\t\t\t\tdtn = dtn.parent;\n\t\t\t}\n\t\t\treturn l;\n\t\t},\n\t\t/** Return a string representing the hierachical node path, e.g. \"a/b/c\".\n\t\t * @param {boolean} [includeSelf=true]\n\t\t * @param {string | function} [part=\"title\"] node property name or callback\n\t\t * @param {string} [separator=\"/\"]\n\t\t * @returns {string}\n\t\t * @since v2.31\n\t\t */\n\t\tgetPath: function (includeSelf, part, separator) {\n\t\t\tincludeSelf = includeSelf !== false;\n\t\t\tpart = part || \"title\";\n\t\t\tseparator = separator || \"/\";\n\n\t\t\tvar val,\n\t\t\t\tpath = [],\n\t\t\t\tisFunc = _isFunction(part);\n\n\t\t\tthis.visitParents(function (n) {\n\t\t\t\tif (n.parent) {\n\t\t\t\t\tval = isFunc ? part(n) : n[part];\n\t\t\t\t\tpath.unshift(val);\n\t\t\t\t}\n\t\t\t}, includeSelf);\n\t\t\treturn path.join(separator);\n\t\t},\n\t\t/** Return the predecessor node (under the same parent) or null.\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetPrevSibling: function () {\n\t\t\tif (this.parent) {\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tac = this.parent.children;\n\n\t\t\t\tfor (i = 1, l = ac.length; i < l; i++) {\n\t\t\t\t\t// start with 1, so prev(first) = null\n\t\t\t\t\tif (ac[i] === this) {\n\t\t\t\t\t\treturn ac[i - 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t/**\n\t\t * Return an array of selected descendant nodes.\n\t\t * @param {boolean} [stopOnParents=false] only return the topmost selected\n\t\t * node (useful with selectMode 3)\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetSelectedNodes: function (stopOnParents) {\n\t\t\tvar nodeList = [];\n\t\t\tthis.visit(function (node) {\n\t\t\t\tif (node.selected) {\n\t\t\t\t\tnodeList.push(node);\n\t\t\t\t\tif (stopOnParents === true) {\n\t\t\t\t\t\treturn \"skip\"; // stop processing this branch\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn nodeList;\n\t\t},\n\t\t/** Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded).\n\t\t * @returns {boolean | undefined}\n\t\t */\n\t\thasChildren: function () {\n\t\t\tif (this.lazy) {\n\t\t\t\tif (this.children == null) {\n\t\t\t\t\t// null or undefined: Not yet loaded\n\t\t\t\t\treturn undefined;\n\t\t\t\t} else if (this.children.length === 0) {\n\t\t\t\t\t// Loaded, but response was empty\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (\n\t\t\t\t\tthis.children.length === 1 &&\n\t\t\t\t\tthis.children[0].isStatusNode()\n\t\t\t\t) {\n\t\t\t\t\t// Currently loading or load error\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !!(this.children && this.children.length);\n\t\t},\n\t\t/**\n\t\t * Return true if node has `className` defined in .extraClasses.\n\t\t *\n\t\t * @param {string} className class name (separate multiple classes by space)\n\t\t * @returns {boolean}\n\t\t *\n\t\t * @since 2.32\n\t\t */\n\t\thasClass: function (className) {\n\t\t\treturn (\n\t\t\t\t(\" \" + (this.extraClasses || \"\") + \" \").indexOf(\n\t\t\t\t\t\" \" + className + \" \"\n\t\t\t\t) >= 0\n\t\t\t);\n\t\t},\n\t\t/** Return true if node has keyboard focus.\n\t\t * @returns {boolean}\n\t\t */\n\t\thasFocus: function () {\n\t\t\treturn this.tree.hasFocus() && this.tree.focusNode === this;\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 3 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tinfo: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 3) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Return true if node is active (see also FancytreeNode#isSelected).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisActive: function () {\n\t\t\treturn this.tree.activeNode === this;\n\t\t},\n\t\t/** Return true if node is vertically below `otherNode`, i.e. rendered in a subsequent row.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t * @since 2.28\n\t\t */\n\t\tisBelowOf: function (otherNode) {\n\t\t\treturn this.getIndexHier(\".\", 5) > otherNode.getIndexHier(\".\", 5);\n\t\t},\n\t\t/** Return true if node is a direct child of otherNode.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t */\n\t\tisChildOf: function (otherNode) {\n\t\t\treturn this.parent && this.parent === otherNode;\n\t\t},\n\t\t/** Return true, if node is a direct or indirect sub node of otherNode.\n\t\t * @param {FancytreeNode} otherNode\n\t\t * @returns {boolean}\n\t\t */\n\t\tisDescendantOf: function (otherNode) {\n\t\t\tif (!otherNode || otherNode.tree !== this.tree) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar p = this.parent;\n\t\t\twhile (p) {\n\t\t\t\tif (p === otherNode) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (p === p.parent) {\n\t\t\t\t\t$.error(\"Recursive parent link: \" + p);\n\t\t\t\t}\n\t\t\t\tp = p.parent;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/** Return true if node is expanded.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisExpanded: function () {\n\t\t\treturn !!this.expanded;\n\t\t},\n\t\t/** Return true if node is the first node of its parent's children.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFirstSibling: function () {\n\t\t\tvar p = this.parent;\n\t\t\treturn !p || p.children[0] === this;\n\t\t},\n\t\t/** Return true if node is a folder, i.e. has the node.folder attribute set.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisFolder: function () {\n\t\t\treturn !!this.folder;\n\t\t},\n\t\t/** Return true if node is the last node of its parent's children.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLastSibling: function () {\n\t\t\tvar p = this.parent;\n\t\t\treturn !p || p.children[p.children.length - 1] === this;\n\t\t},\n\t\t/** Return true if node is lazy (even if data was already loaded)\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLazy: function () {\n\t\t\treturn !!this.lazy;\n\t\t},\n\t\t/** Return true if node is lazy and loaded. For non-lazy nodes always return true.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLoaded: function () {\n\t\t\treturn !this.lazy || this.hasChildren() !== undefined; // Also checks if the only child is a status node\n\t\t},\n\t\t/** Return true if children are currently beeing loaded, i.e. a Ajax request is pending.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisLoading: function () {\n\t\t\treturn !!this._isLoading;\n\t\t},\n\t\t/*\n\t\t * @deprecated since v2.4.0: Use isRootNode() instead\n\t\t */\n\t\tisRoot: function () {\n\t\t\treturn this.isRootNode();\n\t\t},\n\t\t/** Return true if node is partially selected (tri-state).\n\t\t * @returns {boolean}\n\t\t * @since 2.23\n\t\t */\n\t\tisPartsel: function () {\n\t\t\treturn !this.selected && !!this.partsel;\n\t\t},\n\t\t/** (experimental) Return true if this is partially loaded.\n\t\t * @returns {boolean}\n\t\t * @since 2.15\n\t\t */\n\t\tisPartload: function () {\n\t\t\treturn !!this.partload;\n\t\t},\n\t\t/** Return true if this is the (invisible) system root node.\n\t\t * @returns {boolean}\n\t\t * @since 2.4\n\t\t */\n\t\tisRootNode: function () {\n\t\t\treturn this.tree.rootNode === this;\n\t\t},\n\t\t/** Return true if node is selected, i.e. has a checkmark set (see also FancytreeNode#isActive).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisSelected: function () {\n\t\t\treturn !!this.selected;\n\t\t},\n\t\t/** Return true if this node is a temporarily generated system node like\n\t\t * 'loading', 'paging', or 'error' (node.statusNodeType contains the type).\n\t\t * @returns {boolean}\n\t\t */\n\t\tisStatusNode: function () {\n\t\t\treturn !!this.statusNodeType;\n\t\t},\n\t\t/** Return true if this node is a status node of type 'paging'.\n\t\t * @returns {boolean}\n\t\t * @since 2.15\n\t\t */\n\t\tisPagingNode: function () {\n\t\t\treturn this.statusNodeType === \"paging\";\n\t\t},\n\t\t/** Return true if this a top level node, i.e. a direct child of the (invisible) system root node.\n\t\t * @returns {boolean}\n\t\t * @since 2.4\n\t\t */\n\t\tisTopLevel: function () {\n\t\t\treturn this.tree.rootNode === this.parent;\n\t\t},\n\t\t/** Return true if node is lazy and not yet loaded. For non-lazy nodes always return false.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisUndefined: function () {\n\t\t\treturn this.hasChildren() === undefined; // also checks if the only child is a status node\n\t\t},\n\t\t/** Return true if all parent nodes are expanded. Note: this does not check\n\t\t * whether the node is scrolled into the visible part of the screen.\n\t\t * @returns {boolean}\n\t\t */\n\t\tisVisible: function () {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tn,\n\t\t\t\thasFilter = this.tree.enableFilter,\n\t\t\t\tparents = this.getParentList(false, false);\n\n\t\t\t// TODO: check $(n.span).is(\":visible\")\n\t\t\t// i.e. return false for nodes (but not parents) that are hidden\n\t\t\t// by a filter\n\t\t\tif (hasFilter && !this.match && !this.subMatchCount) {\n\t\t\t\t// this.debug( \"isVisible: HIDDEN (\" + hasFilter + \", \" + this.match + \", \" + this.match + \")\" );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (i = 0, l = parents.length; i < l; i++) {\n\t\t\t\tn = parents[i];\n\n\t\t\t\tif (!n.expanded) {\n\t\t\t\t\t// this.debug(\"isVisible: HIDDEN (parent collapsed)\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// if (hasFilter && !n.match && !n.subMatchCount) {\n\t\t\t\t// \tthis.debug(\"isVisible: HIDDEN (\" + hasFilter + \", \" + this.match + \", \" + this.match + \")\");\n\t\t\t\t// \treturn false;\n\t\t\t\t// }\n\t\t\t}\n\t\t\t// this.debug(\"isVisible: VISIBLE\");\n\t\t\treturn true;\n\t\t},\n\t\t/** Deprecated.\n\t\t * @deprecated since 2014-02-16: use load() instead.\n\t\t */\n\t\tlazyLoad: function (discard) {\n\t\t\t$.error(\n\t\t\t\t\"FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.\"\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Load all children of a lazy node if neccessary. The <i>expanded</i> state is maintained.\n\t\t * @param {boolean} [forceReload=false] Pass true to discard any existing nodes before. Otherwise this method does nothing if the node was already loaded.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tload: function (forceReload) {\n\t\t\tvar res,\n\t\t\t\tsource,\n\t\t\t\tself = this,\n\t\t\t\twasExpanded = this.isExpanded();\n\n\t\t\t_assert(this.isLazy(), \"load() requires a lazy node\");\n\t\t\t// _assert( forceReload || this.isUndefined(), \"Pass forceReload=true to re-load a lazy node\" );\n\t\t\tif (!forceReload && !this.isUndefined()) {\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\tif (this.isLoaded()) {\n\t\t\t\tthis.resetLazy(); // also collapses\n\t\t\t}\n\t\t\t// This method is also called by setExpanded() and loadKeyPath(), so we\n\t\t\t// have to avoid recursion.\n\t\t\tsource = this.tree._triggerNodeEvent(\"lazyLoad\", this);\n\t\t\tif (source === false) {\n\t\t\t\t// #69\n\t\t\t\treturn _getResolvedPromise(this);\n\t\t\t}\n\t\t\t_assert(\n\t\t\t\ttypeof source !== \"boolean\",\n\t\t\t\t\"lazyLoad event must return source in data.result\"\n\t\t\t);\n\t\t\tres = this.tree._callHook(\"nodeLoadChildren\", this, source);\n\t\t\tif (wasExpanded) {\n\t\t\t\tthis.expanded = true;\n\t\t\t\tres.always(function () {\n\t\t\t\t\tself.render();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tres.always(function () {\n\t\t\t\t\tself.renderStatus(); // fix expander icon to 'loaded'\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Expand all parents and optionally scroll into visible area as neccessary.\n\t\t * Promise is resolved, when lazy loading and animations are done.\n\t\t * @param {object} [opts] passed to `setExpanded()`.\n\t\t * Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tmakeVisible: function (opts) {\n\t\t\tvar i,\n\t\t\t\tself = this,\n\t\t\t\tdeferreds = [],\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tparents = this.getParentList(false, false),\n\t\t\t\tlen = parents.length,\n\t\t\t\teffects = !(opts && opts.noAnimation === true),\n\t\t\t\tscroll = !(opts && opts.scrollIntoView === false);\n\n\t\t\t// Expand bottom-up, so only the top node is animated\n\t\t\tfor (i = len - 1; i >= 0; i--) {\n\t\t\t\t// self.debug(\"pushexpand\" + parents[i]);\n\t\t\t\tdeferreds.push(parents[i].setExpanded(true, opts));\n\t\t\t}\n\t\t\t$.when.apply($, deferreds).done(function () {\n\t\t\t\t// All expands have finished\n\t\t\t\t// self.debug(\"expand DONE\", scroll);\n\t\t\t\tif (scroll) {\n\t\t\t\t\tself.scrollIntoView(effects).done(function () {\n\t\t\t\t\t\t// self.debug(\"scroll DONE\");\n\t\t\t\t\t\tdfd.resolve();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tdfd.resolve();\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/** Move this node to targetNode.\n\t\t * @param {FancytreeNode} targetNode\n\t\t * @param {string} mode <pre>\n\t\t * 'child': append this node as last child of targetNode.\n\t\t * This is the default. To be compatble with the D'n'd\n\t\t * hitMode, we also accept 'over'.\n\t\t * 'firstChild': add this node as first child of targetNode.\n\t\t * 'before': add this node as sibling before targetNode.\n\t\t * 'after': add this node as sibling after targetNode.</pre>\n\t\t * @param {function} [map] optional callback(FancytreeNode) to allow modifcations\n\t\t */\n\t\tmoveTo: function (targetNode, mode, map) {\n\t\t\tif (mode === undefined || mode === \"over\") {\n\t\t\t\tmode = \"child\";\n\t\t\t} else if (mode === \"firstChild\") {\n\t\t\t\tif (targetNode.children && targetNode.children.length) {\n\t\t\t\t\tmode = \"before\";\n\t\t\t\t\ttargetNode = targetNode.children[0];\n\t\t\t\t} else {\n\t\t\t\t\tmode = \"child\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pos,\n\t\t\t\ttree = this.tree,\n\t\t\t\tprevParent = this.parent,\n\t\t\t\ttargetParent =\n\t\t\t\t\tmode === \"child\" ? targetNode : targetNode.parent;\n\n\t\t\tif (this === targetNode) {\n\t\t\t\treturn;\n\t\t\t} else if (!this.parent) {\n\t\t\t\t$.error(\"Cannot move system root\");\n\t\t\t} else if (targetParent.isDescendantOf(this)) {\n\t\t\t\t$.error(\"Cannot move a node to its own descendant\");\n\t\t\t}\n\t\t\tif (targetParent !== prevParent) {\n\t\t\t\tprevParent.triggerModifyChild(\"remove\", this);\n\t\t\t}\n\t\t\t// Unlink this node from current parent\n\t\t\tif (this.parent.children.length === 1) {\n\t\t\t\tif (this.parent === targetParent) {\n\t\t\t\t\treturn; // #258\n\t\t\t\t}\n\t\t\t\tthis.parent.children = this.parent.lazy ? [] : null;\n\t\t\t\tthis.parent.expanded = false;\n\t\t\t} else {\n\t\t\t\tpos = $.inArray(this, this.parent.children);\n\t\t\t\t_assert(pos >= 0, \"invalid source parent\");\n\t\t\t\tthis.parent.children.splice(pos, 1);\n\t\t\t}\n\t\t\t// Remove from source DOM parent\n\t\t\t// if(this.parent.ul){\n\t\t\t// \tthis.parent.ul.removeChild(this.li);\n\t\t\t// }\n\n\t\t\t// Insert this node to target parent's child list\n\t\t\tthis.parent = targetParent;\n\t\t\tif (targetParent.hasChildren()) {\n\t\t\t\tswitch (mode) {\n\t\t\t\t\tcase \"child\":\n\t\t\t\t\t\t// Append to existing target children\n\t\t\t\t\t\ttargetParent.children.push(this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"before\":\n\t\t\t\t\t\t// Insert this node before target node\n\t\t\t\t\t\tpos = $.inArray(targetNode, targetParent.children);\n\t\t\t\t\t\t_assert(pos >= 0, \"invalid target parent\");\n\t\t\t\t\t\ttargetParent.children.splice(pos, 0, this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"after\":\n\t\t\t\t\t\t// Insert this node after target node\n\t\t\t\t\t\tpos = $.inArray(targetNode, targetParent.children);\n\t\t\t\t\t\t_assert(pos >= 0, \"invalid target parent\");\n\t\t\t\t\t\ttargetParent.children.splice(pos + 1, 0, this);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$.error(\"Invalid mode \" + mode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttargetParent.children = [this];\n\t\t\t}\n\t\t\t// Parent has no <ul> tag yet:\n\t\t\t// if( !targetParent.ul ) {\n\t\t\t// \t// This is the parent's first child: create UL tag\n\t\t\t// \t// (Hidden, because it will be\n\t\t\t// \ttargetParent.ul = document.createElement(\"ul\");\n\t\t\t// \ttargetParent.ul.style.display = \"none\";\n\t\t\t// \ttargetParent.li.appendChild(targetParent.ul);\n\t\t\t// }\n\t\t\t// // Issue 319: Add to target DOM parent (only if node was already rendered(expanded))\n\t\t\t// if(this.li){\n\t\t\t// \ttargetParent.ul.appendChild(this.li);\n\t\t\t// }\n\n\t\t\t// Let caller modify the nodes\n\t\t\tif (map) {\n\t\t\t\ttargetNode.visit(map, true);\n\t\t\t}\n\t\t\tif (targetParent === prevParent) {\n\t\t\t\ttargetParent.triggerModifyChild(\"move\", this);\n\t\t\t} else {\n\t\t\t\t// prevParent.triggerModifyChild(\"remove\", this);\n\t\t\t\ttargetParent.triggerModifyChild(\"add\", this);\n\t\t\t}\n\t\t\t// Handle cross-tree moves\n\t\t\tif (tree !== targetNode.tree) {\n\t\t\t\t// Fix node.tree for all source nodes\n\t\t\t\t// \t_assert(false, \"Cross-tree move is not yet implemented.\");\n\t\t\t\tthis.warn(\"Cross-tree moveTo is experimental!\");\n\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t// TODO: fix selection state and activation, ...\n\t\t\t\t\tn.tree = targetNode.tree;\n\t\t\t\t}, true);\n\t\t\t}\n\n\t\t\t// A collaposed node won't re-render children, so we have to remove it manually\n\t\t\t// if( !targetParent.expanded ){\n\t\t\t// prevParent.ul.removeChild(this.li);\n\t\t\t// }\n\t\t\ttree._callHook(\"treeStructureChanged\", tree, \"moveTo\");\n\n\t\t\t// Update HTML markup\n\t\t\tif (!prevParent.isDescendantOf(targetParent)) {\n\t\t\t\tprevParent.render();\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!targetParent.isDescendantOf(prevParent) &&\n\t\t\t\ttargetParent !== prevParent\n\t\t\t) {\n\t\t\t\ttargetParent.render();\n\t\t\t}\n\t\t\t// TODO: fix selection state\n\t\t\t// TODO: fix active state\n\n\t\t\t/*\n\t\t\tvar tree = this.tree;\n\t\t\tvar opts = tree.options;\n\t\t\tvar pers = tree.persistence;\n\n\t\t\t// Always expand, if it's below minExpandLevel\n\t\t\t// tree.logDebug (\"%s._addChildNode(%o), l=%o\", this, ftnode, ftnode.getLevel());\n\t\t\tif ( opts.minExpandLevel >= ftnode.getLevel() ) {\n\t\t\t\t// tree.logDebug (\"Force expand for %o\", ftnode);\n\t\t\t\tthis.bExpanded = true;\n\t\t\t}\n\n\t\t\t// In multi-hier mode, update the parents selection state\n\t\t\t// DT issue #82: only if not initializing, because the children may not exist yet\n\t\t\t// if( !ftnode.data.isStatusNode() && opts.selectMode==3 && !isInitializing )\n\t\t\t// \tftnode._fixSelectionState();\n\n\t\t\t// In multi-hier mode, update the parents selection state\n\t\t\tif( ftnode.bSelected && opts.selectMode==3 ) {\n\t\t\t\tvar p = this;\n\t\t\t\twhile( p ) {\n\t\t\t\t\tif( !p.hasSubSel )\n\t\t\t\t\t\tp._setSubSel(true);\n\t\t\t\t\tp = p.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// render this node and the new child\n\t\t\tif ( tree.bEnableUpdate )\n\t\t\t\tthis.render();\n\t\t\treturn ftnode;\n\t\t\t*/\n\t\t},\n\t\t/** Set focus relative to this node and optionally activate.\n\t\t *\n\t\t * 'left' collapses the node if it is expanded, or move to the parent\n\t\t * otherwise.\n\t\t * 'right' expands the node if it is collapsed, or move to the first\n\t\t * child otherwise.\n\t\t *\n\t\t * @param {string|number} where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'.\n\t\t * (Alternatively the keyCode that would normally trigger this move,\n\t\t * e.g. `$.ui.keyCode.LEFT` = 'left'.\n\t\t * @param {boolean} [activate=true]\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tnavigate: function (where, activate) {\n\t\t\tvar node,\n\t\t\t\tKC = $.ui.keyCode;\n\n\t\t\t// Handle optional expand/collapse action for LEFT/RIGHT\n\t\t\tswitch (where) {\n\t\t\t\tcase \"left\":\n\t\t\t\tcase KC.LEFT:\n\t\t\t\t\tif (this.expanded) {\n\t\t\t\t\t\treturn this.setExpanded(false);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\tcase KC.RIGHT:\n\t\t\t\t\tif (!this.expanded && (this.children || this.lazy)) {\n\t\t\t\t\t\treturn this.setExpanded();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Otherwise activate or focus the related node\n\t\t\tnode = this.findRelatedNode(where);\n\t\t\tif (node) {\n\t\t\t\t// setFocus/setActive will scroll later (if autoScroll is specified)\n\t\t\t\ttry {\n\t\t\t\t\tnode.makeVisible({ scrollIntoView: false });\n\t\t\t\t} catch (e) {} // #272\n\t\t\t\tif (activate === false) {\n\t\t\t\t\tnode.setFocus();\n\t\t\t\t\treturn _getResolvedPromise();\n\t\t\t\t}\n\t\t\t\treturn node.setActive();\n\t\t\t}\n\t\t\tthis.warn(\"Could not find related node '\" + where + \"'.\");\n\t\t\treturn _getResolvedPromise();\n\t\t},\n\t\t/**\n\t\t * Remove this node (not allowed for system root).\n\t\t */\n\t\tremove: function () {\n\t\t\treturn this.parent.removeChild(this);\n\t\t},\n\t\t/**\n\t\t * Remove childNode from list of direct children.\n\t\t * @param {FancytreeNode} childNode\n\t\t */\n\t\tremoveChild: function (childNode) {\n\t\t\treturn this.tree._callHook(\"nodeRemoveChild\", this, childNode);\n\t\t},\n\t\t/**\n\t\t * Remove all child nodes and descendents. This converts the node into a leaf.<br>\n\t\t * If this was a lazy node, it is still considered 'loaded'; call node.resetLazy()\n\t\t * in order to trigger lazyLoad on next expand.\n\t\t */\n\t\tremoveChildren: function () {\n\t\t\treturn this.tree._callHook(\"nodeRemoveChildren\", this);\n\t\t},\n\t\t/**\n\t\t * Remove class from node's span tag and .extraClasses.\n\t\t *\n\t\t * @param {string} className class name\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\tremoveClass: function (className) {\n\t\t\treturn this.toggleClass(className, false);\n\t\t},\n\t\t/**\n\t\t * This method renders and updates all HTML markup that is required\n\t\t * to display this node in its current state.<br>\n\t\t * Note:\n\t\t * <ul>\n\t\t * <li>It should only be neccessary to call this method after the node object\n\t\t * was modified by direct access to its properties, because the common\n\t\t * API methods (node.setTitle(), moveTo(), addChildren(), remove(), ...)\n\t\t * already handle this.\n\t\t * <li> {@link FancytreeNode#renderTitle} and {@link FancytreeNode#renderStatus}\n\t\t * are implied. If changes are more local, calling only renderTitle() or\n\t\t * renderStatus() may be sufficient and faster.\n\t\t * </ul>\n\t\t *\n\t\t * @param {boolean} [force=false] re-render, even if html markup was already created\n\t\t * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed\n\t\t */\n\t\trender: function (force, deep) {\n\t\t\treturn this.tree._callHook(\"nodeRender\", this, force, deep);\n\t\t},\n\t\t/** Create HTML markup for the node's outer `<span>` (expander, checkbox, icon, and title).\n\t\t * Implies {@link FancytreeNode#renderStatus}.\n\t\t * @see Fancytree_Hooks#nodeRenderTitle\n\t\t */\n\t\trenderTitle: function () {\n\t\t\treturn this.tree._callHook(\"nodeRenderTitle\", this);\n\t\t},\n\t\t/** Update element's CSS classes according to node state.\n\t\t * @see Fancytree_Hooks#nodeRenderStatus\n\t\t */\n\t\trenderStatus: function () {\n\t\t\treturn this.tree._callHook(\"nodeRenderStatus\", this);\n\t\t},\n\t\t/**\n\t\t * (experimental) Replace this node with `source`.\n\t\t * (Currently only available for paging nodes.)\n\t\t * @param {NodeData[]} source List of child node definitions\n\t\t * @since 2.15\n\t\t */\n\t\treplaceWith: function (source) {\n\t\t\tvar res,\n\t\t\t\tparent = this.parent,\n\t\t\t\tpos = $.inArray(this, parent.children),\n\t\t\t\tself = this;\n\n\t\t\t_assert(\n\t\t\t\tthis.isPagingNode(),\n\t\t\t\t\"replaceWith() currently requires a paging status node\"\n\t\t\t);\n\n\t\t\tres = this.tree._callHook(\"nodeLoadChildren\", this, source);\n\t\t\tres.done(function (data) {\n\t\t\t\t// New nodes are currently children of `this`.\n\t\t\t\tvar children = self.children;\n\t\t\t\t// Prepend newly loaded child nodes to `this`\n\t\t\t\t// Move new children after self\n\t\t\t\tfor (i = 0; i < children.length; i++) {\n\t\t\t\t\tchildren[i].parent = parent;\n\t\t\t\t}\n\t\t\t\tparent.children.splice.apply(\n\t\t\t\t\tparent.children,\n\t\t\t\t\t[pos + 1, 0].concat(children)\n\t\t\t\t);\n\n\t\t\t\t// Remove self\n\t\t\t\tself.children = null;\n\t\t\t\tself.remove();\n\t\t\t\t// Redraw new nodes\n\t\t\t\tparent.render();\n\t\t\t\t// TODO: set node.partload = false if this was tha last paging node?\n\t\t\t\t// parent.addPagingNode(false);\n\t\t\t}).fail(function () {\n\t\t\t\tself.setExpanded();\n\t\t\t});\n\t\t\treturn res;\n\t\t\t// $.error(\"Not implemented: replaceWith()\");\n\t\t},\n\t\t/**\n\t\t * Remove all children, collapse, and set the lazy-flag, so that the lazyLoad\n\t\t * event is triggered on next expand.\n\t\t */\n\t\tresetLazy: function () {\n\t\t\tthis.removeChildren();\n\t\t\tthis.expanded = false;\n\t\t\tthis.lazy = true;\n\t\t\tthis.children = undefined;\n\t\t\tthis.renderStatus();\n\t\t},\n\t\t/** Schedule activity for delayed execution (cancel any pending request).\n\t\t * scheduleAction('cancel') will only cancel a pending request (if any).\n\t\t * @param {string} mode\n\t\t * @param {number} ms\n\t\t */\n\t\tscheduleAction: function (mode, ms) {\n\t\t\tif (this.tree.timer) {\n\t\t\t\tclearTimeout(this.tree.timer);\n\t\t\t\tthis.tree.debug(\"clearTimeout(%o)\", this.tree.timer);\n\t\t\t}\n\t\t\tthis.tree.timer = null;\n\t\t\tvar self = this; // required for closures\n\t\t\tswitch (mode) {\n\t\t\t\tcase \"cancel\":\n\t\t\t\t\t// Simply made sure that timer was cleared\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"expand\":\n\t\t\t\t\tthis.tree.timer = setTimeout(function () {\n\t\t\t\t\t\tself.tree.debug(\"setTimeout: trigger expand\");\n\t\t\t\t\t\tself.setExpanded(true);\n\t\t\t\t\t}, ms);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"activate\":\n\t\t\t\t\tthis.tree.timer = setTimeout(function () {\n\t\t\t\t\t\tself.tree.debug(\"setTimeout: trigger activate\");\n\t\t\t\t\t\tself.setActive(true);\n\t\t\t\t\t}, ms);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$.error(\"Invalid mode \" + mode);\n\t\t\t}\n\t\t\t// this.tree.debug(\"setTimeout(%s, %s): %s\", mode, ms, this.tree.timer);\n\t\t},\n\t\t/**\n\t\t *\n\t\t * @param {boolean | PlainObject} [effects=false] animation options.\n\t\t * @param {object} [options=null] {topNode: null, effects: ..., parent: ...} this node will remain visible in\n\t\t * any case, even if `this` is outside the scroll pane.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tscrollIntoView: function (effects, options) {\n\t\t\tif (options !== undefined && _isNode(options)) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t\"scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t// The scroll parent is typically the plain tree's <UL> container.\n\t\t\t// For ext-table, we choose the nearest parent that has `position: relative`\n\t\t\t// and `overflow` set.\n\t\t\t// (This default can be overridden by the local or global `scrollParent` option.)\n\t\t\tvar opts = $.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\teffects:\n\t\t\t\t\t\t\teffects === true\n\t\t\t\t\t\t\t\t? { duration: 200, queue: false }\n\t\t\t\t\t\t\t\t: effects,\n\t\t\t\t\t\tscrollOfs: this.tree.options.scrollOfs,\n\t\t\t\t\t\tscrollParent: this.tree.options.scrollParent,\n\t\t\t\t\t\ttopNode: null,\n\t\t\t\t\t},\n\t\t\t\t\toptions\n\t\t\t\t),\n\t\t\t\t$scrollParent = opts.scrollParent,\n\t\t\t\t$container = this.tree.$container,\n\t\t\t\toverflowY = $container.css(\"overflow-y\");\n\n\t\t\tif (!$scrollParent) {\n\t\t\t\tif (this.tree.tbody) {\n\t\t\t\t\t$scrollParent = $container.scrollParent();\n\t\t\t\t} else if (overflowY === \"scroll\" || overflowY === \"auto\") {\n\t\t\t\t\t$scrollParent = $container;\n\t\t\t\t} else {\n\t\t\t\t\t// #922 plain tree in a non-fixed-sized UL scrolls inside its parent\n\t\t\t\t\t$scrollParent = $container.scrollParent();\n\t\t\t\t}\n\t\t\t} else if (!$scrollParent.jquery) {\n\t\t\t\t// Make sure we have a jQuery object\n\t\t\t\t$scrollParent = $($scrollParent);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t$scrollParent[0] === document ||\n\t\t\t\t$scrollParent[0] === document.body\n\t\t\t) {\n\t\t\t\t// `document` may be returned by $().scrollParent(), if nothing is found,\n\t\t\t\t// but would not work: (see #894)\n\t\t\t\tthis.debug(\n\t\t\t\t\t\"scrollIntoView(): normalizing scrollParent to 'window':\",\n\t\t\t\t\t$scrollParent[0]\n\t\t\t\t);\n\t\t\t\t$scrollParent = $(window);\n\t\t\t}\n\t\t\t// eslint-disable-next-line one-var\n\t\t\tvar topNodeY,\n\t\t\t\tnodeY,\n\t\t\t\thorzScrollbarHeight,\n\t\t\t\tcontainerOffsetTop,\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tself = this,\n\t\t\t\tnodeHeight = $(this.span).height(),\n\t\t\t\ttopOfs = opts.scrollOfs.top || 0,\n\t\t\t\tbottomOfs = opts.scrollOfs.bottom || 0,\n\t\t\t\tcontainerHeight = $scrollParent.height(),\n\t\t\t\tscrollTop = $scrollParent.scrollTop(),\n\t\t\t\t$animateTarget = $scrollParent,\n\t\t\t\tisParentWindow = $scrollParent[0] === window,\n\t\t\t\ttopNode = opts.topNode || null,\n\t\t\t\tnewScrollTop = null;\n\n\t\t\t// this.debug(\"scrollIntoView(), scrollTop=\" + scrollTop, opts.scrollOfs);\n\t\t\t// _assert($(this.span).is(\":visible\"), \"scrollIntoView node is invisible\"); // otherwise we cannot calc offsets\n\t\t\tif (this.isRootNode() || !this.isVisible()) {\n\t\t\t\t// We cannot calc offsets for hidden elements\n\t\t\t\tthis.info(\"scrollIntoView(): node is invisible.\");\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tif (isParentWindow) {\n\t\t\t\tnodeY = $(this.span).offset().top;\n\t\t\t\ttopNodeY =\n\t\t\t\t\ttopNode && topNode.span ? $(topNode.span).offset().top : 0;\n\t\t\t\t$animateTarget = $(\"html,body\");\n\t\t\t} else {\n\t\t\t\t_assert(\n\t\t\t\t\t$scrollParent[0] !== document &&\n\t\t\t\t\t\t$scrollParent[0] !== document.body,\n\t\t\t\t\t\"scrollParent should be a simple element or `window`, not document or body.\"\n\t\t\t\t);\n\n\t\t\t\tcontainerOffsetTop = $scrollParent.offset().top;\n\t\t\t\tnodeY =\n\t\t\t\t\t$(this.span).offset().top - containerOffsetTop + scrollTop; // relative to scroll parent\n\t\t\t\ttopNodeY = topNode\n\t\t\t\t\t? $(topNode.span).offset().top -\n\t\t\t\t\t containerOffsetTop +\n\t\t\t\t\t scrollTop\n\t\t\t\t\t: 0;\n\t\t\t\thorzScrollbarHeight = Math.max(\n\t\t\t\t\t0,\n\t\t\t\t\t$scrollParent.innerHeight() - $scrollParent[0].clientHeight\n\t\t\t\t);\n\t\t\t\tcontainerHeight -= horzScrollbarHeight;\n\t\t\t}\n\n\t\t\t// this.debug(\" scrollIntoView(), nodeY=\" + nodeY + \", containerHeight=\" + containerHeight);\n\t\t\tif (nodeY < scrollTop + topOfs) {\n\t\t\t\t// Node is above visible container area\n\t\t\t\tnewScrollTop = nodeY - topOfs;\n\t\t\t\t// this.debug(\" scrollIntoView(), UPPER newScrollTop=\" + newScrollTop);\n\t\t\t} else if (\n\t\t\t\tnodeY + nodeHeight >\n\t\t\t\tscrollTop + containerHeight - bottomOfs\n\t\t\t) {\n\t\t\t\tnewScrollTop = nodeY + nodeHeight - containerHeight + bottomOfs;\n\t\t\t\t// this.debug(\" scrollIntoView(), LOWER newScrollTop=\" + newScrollTop);\n\t\t\t\t// If a topNode was passed, make sure that it is never scrolled\n\t\t\t\t// outside the upper border\n\t\t\t\tif (topNode) {\n\t\t\t\t\t_assert(\n\t\t\t\t\t\ttopNode.isRootNode() || topNode.isVisible(),\n\t\t\t\t\t\t\"topNode must be visible\"\n\t\t\t\t\t);\n\t\t\t\t\tif (topNodeY < newScrollTop) {\n\t\t\t\t\t\tnewScrollTop = topNodeY - topOfs;\n\t\t\t\t\t\t// this.debug(\" scrollIntoView(), TOP newScrollTop=\" + newScrollTop);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newScrollTop === null) {\n\t\t\t\tdfd.resolveWith(this);\n\t\t\t} else {\n\t\t\t\t// this.debug(\" scrollIntoView(), SET newScrollTop=\" + newScrollTop);\n\t\t\t\tif (opts.effects) {\n\t\t\t\t\topts.effects.complete = function () {\n\t\t\t\t\t\tdfd.resolveWith(self);\n\t\t\t\t\t};\n\t\t\t\t\t$animateTarget.stop(true).animate(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tscrollTop: newScrollTop,\n\t\t\t\t\t\t},\n\t\t\t\t\t\topts.effects\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$animateTarget[0].scrollTop = newScrollTop;\n\t\t\t\t\tdfd.resolveWith(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dfd.promise();\n\t\t},\n\n\t\t/**Activate this node.\n\t\t *\n\t\t * The `cell` option requires the ext-table and ext-ariagrid extensions.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to deactivate\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false, cell: null}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tsetActive: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetActive\", this, flag, opts);\n\t\t},\n\t\t/**Expand or collapse this node. Promise is resolved, when lazy loading and animations are done.\n\t\t * @param {boolean} [flag=true] pass false to collapse\n\t\t * @param {object} [opts] additional options. Defaults to {noAnimation: false, noEvents: false}\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tsetExpanded: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetExpanded\", this, flag, opts);\n\t\t},\n\t\t/**Set keyboard focus to this node.\n\t\t * @param {boolean} [flag=true] pass false to blur\n\t\t * @see Fancytree#setFocus\n\t\t */\n\t\tsetFocus: function (flag) {\n\t\t\treturn this.tree._callHook(\"nodeSetFocus\", this, flag);\n\t\t},\n\t\t/**Select this node, i.e. check the checkbox.\n\t\t * @param {boolean} [flag=true] pass false to deselect\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, p\n\t\t * propagateDown: null, propagateUp: null, callback: null }\n\t\t */\n\t\tsetSelected: function (flag, opts) {\n\t\t\treturn this.tree._callHook(\"nodeSetSelected\", this, flag, opts);\n\t\t},\n\t\t/**Mark a lazy node as 'error', 'loading', 'nodata', or 'ok'.\n\t\t * @param {string} status 'error'|'loading'|'nodata'|'ok'\n\t\t * @param {string} [message]\n\t\t * @param {string} [details]\n\t\t */\n\t\tsetStatus: function (status, message, details) {\n\t\t\treturn this.tree._callHook(\n\t\t\t\t\"nodeSetStatus\",\n\t\t\t\tthis,\n\t\t\t\tstatus,\n\t\t\t\tmessage,\n\t\t\t\tdetails\n\t\t\t);\n\t\t},\n\t\t/**Rename this node.\n\t\t * @param {string} title\n\t\t */\n\t\tsetTitle: function (title) {\n\t\t\tthis.title = title;\n\t\t\tthis.renderTitle();\n\t\t\tthis.triggerModify(\"rename\");\n\t\t},\n\t\t/**Sort child list by title.\n\t\t * @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title).\n\t\t * @param {boolean} [deep=false] pass true to sort all descendant nodes\n\t\t */\n\t\tsortChildren: function (cmp, deep) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tcl = this.children;\n\n\t\t\tif (!cl) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcmp =\n\t\t\t\tcmp ||\n\t\t\t\tfunction (a, b) {\n\t\t\t\t\tvar x = a.title.toLowerCase(),\n\t\t\t\t\t\ty = b.title.toLowerCase();\n\n\t\t\t\t\t// eslint-disable-next-line no-nested-ternary\n\t\t\t\t\treturn x === y ? 0 : x > y ? 1 : -1;\n\t\t\t\t};\n\t\t\tcl.sort(cmp);\n\t\t\tif (deep) {\n\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\tif (cl[i].children) {\n\t\t\t\t\t\tcl[i].sortChildren(cmp, \"$norender$\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deep !== \"$norender$\") {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t\tthis.triggerModifyChild(\"sort\");\n\t\t},\n\t\t/** Convert node (or whole branch) into a plain object.\n\t\t *\n\t\t * The result is compatible with node.addChildren().\n\t\t *\n\t\t * @param {boolean} [recursive=false] include child nodes\n\t\t * @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications.\n\t\t * Return `false` to ignore this node or `\"skip\"` to include this node without its children.\n\t\t * @returns {NodeData}\n\t\t */\n\t\ttoDict: function (recursive, callback) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tnode,\n\t\t\t\tres,\n\t\t\t\tdict = {},\n\t\t\t\tself = this;\n\n\t\t\t$.each(NODE_ATTRS, function (i, a) {\n\t\t\t\tif (self[a] || self[a] === false) {\n\t\t\t\t\tdict[a] = self[a];\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!$.isEmptyObject(this.data)) {\n\t\t\t\tdict.data = $.extend({}, this.data);\n\t\t\t\tif ($.isEmptyObject(dict.data)) {\n\t\t\t\t\tdelete dict.data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (callback) {\n\t\t\t\tres = callback(dict, self);\n\t\t\t\tif (res === false) {\n\t\t\t\t\treturn false; // Don't include this node nor its children\n\t\t\t\t}\n\t\t\t\tif (res === \"skip\") {\n\t\t\t\t\trecursive = false; // Include this node, but not the children\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (recursive) {\n\t\t\t\tif (_isArray(this.children)) {\n\t\t\t\t\tdict.children = [];\n\t\t\t\t\tfor (i = 0, l = this.children.length; i < l; i++) {\n\t\t\t\t\t\tnode = this.children[i];\n\t\t\t\t\t\tif (!node.isStatusNode()) {\n\t\t\t\t\t\t\tres = node.toDict(true, callback);\n\t\t\t\t\t\t\tif (res !== false) {\n\t\t\t\t\t\t\t\tdict.children.push(res);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dict;\n\t\t},\n\t\t/**\n\t\t * Set, clear, or toggle class of node's span tag and .extraClasses.\n\t\t *\n\t\t * @param {string} className class name (separate multiple classes by space)\n\t\t * @param {boolean} [flag] true/false to add/remove class. If omitted, class is toggled.\n\t\t * @returns {boolean} true if a class was added\n\t\t *\n\t\t * @since 2.17\n\t\t */\n\t\ttoggleClass: function (value, flag) {\n\t\t\tvar className,\n\t\t\t\thasClass,\n\t\t\t\trnotwhite = /\\S+/g,\n\t\t\t\tclassNames = value.match(rnotwhite) || [],\n\t\t\t\ti = 0,\n\t\t\t\twasAdded = false,\n\t\t\t\tstatusElem = this[this.tree.statusClassPropName],\n\t\t\t\tcurClasses = \" \" + (this.extraClasses || \"\") + \" \";\n\n\t\t\t// this.info(\"toggleClass('\" + value + \"', \" + flag + \")\", curClasses);\n\t\t\t// Modify DOM element directly if it already exists\n\t\t\tif (statusElem) {\n\t\t\t\t$(statusElem).toggleClass(value, flag);\n\t\t\t}\n\t\t\t// Modify node.extraClasses to make this change persistent\n\t\t\t// Toggle if flag was not passed\n\t\t\twhile ((className = classNames[i++])) {\n\t\t\t\thasClass = curClasses.indexOf(\" \" + className + \" \") >= 0;\n\t\t\t\tflag = flag === undefined ? !hasClass : !!flag;\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (!hasClass) {\n\t\t\t\t\t\tcurClasses += className + \" \";\n\t\t\t\t\t\twasAdded = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twhile (curClasses.indexOf(\" \" + className + \" \") > -1) {\n\t\t\t\t\t\tcurClasses = curClasses.replace(\n\t\t\t\t\t\t\t\" \" + className + \" \",\n\t\t\t\t\t\t\t\" \"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.extraClasses = _trim(curClasses);\n\t\t\t// this.info(\"-> toggleClass('\" + value + \"', \" + flag + \"): '\" + this.extraClasses + \"'\");\n\t\t\treturn wasAdded;\n\t\t},\n\t\t/** Flip expanded status. */\n\t\ttoggleExpanded: function () {\n\t\t\treturn this.tree._callHook(\"nodeToggleExpanded\", this);\n\t\t},\n\t\t/** Flip selection status. */\n\t\ttoggleSelected: function () {\n\t\t\treturn this.tree._callHook(\"nodeToggleSelected\", this);\n\t\t},\n\t\ttoString: function () {\n\t\t\treturn \"FancytreeNode@\" + this.key + \"[title='\" + this.title + \"']\";\n\t\t\t// return \"<FancytreeNode(#\" + this.key + \", '\" + this.title + \"')>\";\n\t\t},\n\t\t/**\n\t\t * Trigger `modifyChild` event on a parent to signal that a child was modified.\n\t\t * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ...\n\t\t * @param {FancytreeNode} [childNode]\n\t\t * @param {object} [extra]\n\t\t */\n\t\ttriggerModifyChild: function (operation, childNode, extra) {\n\t\t\tvar data,\n\t\t\t\tmodifyChild = this.tree.options.modifyChild;\n\n\t\t\tif (modifyChild) {\n\t\t\t\tif (childNode && childNode.parent !== this) {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"childNode \" + childNode + \" is not a child of \" + this\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tdata = {\n\t\t\t\t\tnode: this,\n\t\t\t\t\ttree: this.tree,\n\t\t\t\t\toperation: operation,\n\t\t\t\t\tchildNode: childNode || null,\n\t\t\t\t};\n\t\t\t\tif (extra) {\n\t\t\t\t\t$.extend(data, extra);\n\t\t\t\t}\n\t\t\t\tmodifyChild({ type: \"modifyChild\" }, data);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Trigger `modifyChild` event on node.parent(!).\n\t\t * @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ...\n\t\t * @param {object} [extra]\n\t\t */\n\t\ttriggerModify: function (operation, extra) {\n\t\t\tthis.parent.triggerModifyChild(operation, this, extra);\n\t\t},\n\t\t/** Call fn(node) for all child nodes in hierarchical order (depth-first).<br>\n\t\t * Stop iteration, if fn() returns false. Skip current branch, if fn() returns \"skip\".<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and\n\t\t * its children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisit: function (fn, includeSelf) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tres = true,\n\t\t\t\tchildren = this.children;\n\n\t\t\tif (includeSelf === true) {\n\t\t\t\tres = fn(this);\n\t\t\t\tif (res === false || res === \"skip\") {\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (children) {\n\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tres = children[i].visit(fn, true);\n\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Call fn(node) for all child nodes and recursively load lazy children.<br>\n\t\t * <b>Note:</b> If you need this method, you probably should consider to review\n\t\t * your architecture! Recursivley loading nodes is a perfect way for lazy\n\t\t * programmers to flood the server with requests ;-)\n\t\t *\n\t\t * @param {function} [fn] optional callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and\n\t\t * its children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {$.Promise}\n\t\t * @since 2.4\n\t\t */\n\t\tvisitAndLoad: function (fn, includeSelf, _recursion) {\n\t\t\tvar dfd,\n\t\t\t\tres,\n\t\t\t\tloaders,\n\t\t\t\tnode = this;\n\n\t\t\t// node.debug(\"visitAndLoad\");\n\t\t\tif (fn && includeSelf === true) {\n\t\t\t\tres = fn(node);\n\t\t\t\tif (res === false || res === \"skip\") {\n\t\t\t\t\treturn _recursion ? res : _getResolvedPromise();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!node.children && !node.lazy) {\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tdfd = new $.Deferred();\n\t\t\tloaders = [];\n\t\t\t// node.debug(\"load()...\");\n\t\t\tnode.load().done(function () {\n\t\t\t\t// node.debug(\"load()... done.\");\n\t\t\t\tfor (var i = 0, l = node.children.length; i < l; i++) {\n\t\t\t\t\tres = node.children[i].visitAndLoad(fn, true, true);\n\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\tdfd.reject();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (res !== \"skip\") {\n\t\t\t\t\t\tloaders.push(res); // Add promise to the list\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$.when.apply(this, loaders).then(function () {\n\t\t\t\t\tdfd.resolve();\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/** Call fn(node) for all parent nodes, bottom-up, including invisible system root.<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisitParents: function (fn, includeSelf) {\n\t\t\t// Visit parent nodes (bottom up)\n\t\t\tif (includeSelf && fn(this) === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar p = this.parent;\n\t\t\twhile (p) {\n\t\t\t\tif (fn(p) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tp = p.parent;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Call fn(node) for all sibling nodes.<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration.\n\t\t * @param {boolean} [includeSelf=false]\n\t\t * @returns {boolean}\n\t\t */\n\t\tvisitSiblings: function (fn, includeSelf) {\n\t\t\tvar i,\n\t\t\t\tl,\n\t\t\t\tn,\n\t\t\t\tac = this.parent.children;\n\n\t\t\tfor (i = 0, l = ac.length; i < l; i++) {\n\t\t\t\tn = ac[i];\n\t\t\t\tif (includeSelf || n !== this) {\n\t\t\t\t\tif (fn(n) === false) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Write warning to browser console if debugLevel >= 2 (prepending node info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\twarn: function (msg) {\n\t\t\tif (this.tree.options.debugLevel >= 2) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t}\n\t\t},\n\t};\n\n\t/******************************************************************************\n\t * Fancytree\n\t */\n\t/**\n\t * Construct a new tree object.\n\t *\n\t * @class Fancytree\n\t * @classdesc The controller behind a fancytree.\n\t * This class also contains 'hook methods': see {@link Fancytree_Hooks}.\n\t *\n\t * @param {Widget} widget\n\t *\n\t * @property {string} _id Automatically generated unique tree instance ID, e.g. \"1\".\n\t * @property {string} _ns Automatically generated unique tree namespace, e.g. \".fancytree-1\".\n\t * @property {FancytreeNode} activeNode Currently active node or null.\n\t * @property {string} ariaPropName Property name of FancytreeNode that contains the element which will receive the aria attributes.\n\t * Typically \"li\", but \"tr\" for table extension.\n\t * @property {jQueryObject} $container Outer `<ul>` element (or `<table>` element for ext-table).\n\t * @property {jQueryObject} $div A jQuery object containing the element used to instantiate the tree widget (`widget.element`)\n\t * @property {object|array} columns Recommended place to store shared column meta data. @since 2.27\n\t * @property {object} data Metadata, i.e. properties that may be passed to `source` in addition to a children array.\n\t * @property {object} ext Hash of all active plugin instances.\n\t * @property {FancytreeNode} focusNode Currently focused node or null.\n\t * @property {FancytreeNode} lastSelectedNode Used to implement selectMode 1 (single select)\n\t * @property {string} nodeContainerAttrName Property name of FancytreeNode that contains the outer element of single nodes.\n\t * Typically \"li\", but \"tr\" for table extension.\n\t * @property {FancytreeOptions} options Current options, i.e. default options + options passed to constructor.\n\t * @property {FancytreeNode} rootNode Invisible system root node.\n\t * @property {string} statusClassPropName Property name of FancytreeNode that contains the element which will receive the status classes.\n\t * Typically \"span\", but \"tr\" for table extension.\n\t * @property {object} types Map for shared type specific meta data, used with node.type attribute. @since 2.27\n\t * @property {object} viewport See ext-vieport. @since v2.31\n\t * @property {object} widget Base widget instance.\n\t */\n\tfunction Fancytree(widget) {\n\t\tthis.widget = widget;\n\t\tthis.$div = widget.element;\n\t\tthis.options = widget.options;\n\t\tif (this.options) {\n\t\t\tif (this.options.lazyload !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.loaderror !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.fx !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'fx' option was replaced by 'toggleEffect' since 2014-11-30.\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this.options.removeNode !== undefined) {\n\t\t\t\t$.error(\n\t\t\t\t\t\"The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.ext = {}; // Active extension instances\n\t\tthis.types = {};\n\t\tthis.columns = {};\n\t\t// allow to init tree.data.foo from <div data-foo=''>\n\t\tthis.data = _getElementDataAsDict(this.$div);\n\t\t// TODO: use widget.uuid instead?\n\t\tthis._id = \"\" + (this.options.treeId || $.ui.fancytree._nextId++);\n\t\t// TODO: use widget.eventNamespace instead?\n\t\tthis._ns = \".fancytree-\" + this._id; // append for namespaced events\n\t\tthis.activeNode = null;\n\t\tthis.focusNode = null;\n\t\tthis._hasFocus = null;\n\t\tthis._tempCache = {};\n\t\tthis._lastMousedownNode = null;\n\t\tthis._enableUpdate = true;\n\t\tthis.lastSelectedNode = null;\n\t\tthis.systemFocusElement = null;\n\t\tthis.lastQuicksearchTerm = \"\";\n\t\tthis.lastQuicksearchTime = 0;\n\t\tthis.viewport = null; // ext-grid\n\n\t\tthis.statusClassPropName = \"span\";\n\t\tthis.ariaPropName = \"li\";\n\t\tthis.nodeContainerAttrName = \"li\";\n\n\t\t// Remove previous markup if any\n\t\tthis.$div.find(\">ul.fancytree-container\").remove();\n\n\t\t// Create a node without parent.\n\t\tvar fakeParent = { tree: this },\n\t\t\t$ul;\n\t\tthis.rootNode = new FancytreeNode(fakeParent, {\n\t\t\ttitle: \"root\",\n\t\t\tkey: \"root_\" + this._id,\n\t\t\tchildren: null,\n\t\t\texpanded: true,\n\t\t});\n\t\tthis.rootNode.parent = null;\n\n\t\t// Create root markup\n\t\t$ul = $(\"<ul>\", {\n\t\t\tid: \"ft-id-\" + this._id,\n\t\t\tclass: \"ui-fancytree fancytree-container fancytree-plain\",\n\t\t}).appendTo(this.$div);\n\t\tthis.$container = $ul;\n\t\tthis.rootNode.ul = $ul[0];\n\n\t\tif (this.options.debugLevel == null) {\n\t\t\tthis.options.debugLevel = FT.debugLevel;\n\t\t}\n\t\t// // Add container to the TAB chain\n\t\t// // See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant\n\t\t// // #577: Allow to set tabindex to \"0\", \"-1\" and \"\"\n\t\t// this.$container.attr(\"tabindex\", this.options.tabindex);\n\n\t\t// if( this.options.rtl ) {\n\t\t// \tthis.$container.attr(\"DIR\", \"RTL\").addClass(\"fancytree-rtl\");\n\t\t// // }else{\n\t\t// //\tthis.$container.attr(\"DIR\", null).removeClass(\"fancytree-rtl\");\n\t\t// }\n\t\t// if(this.options.aria){\n\t\t// \tthis.$container.attr(\"role\", \"tree\");\n\t\t// \tif( this.options.selectMode !== 1 ) {\n\t\t// \t\tthis.$container.attr(\"aria-multiselectable\", true);\n\t\t// \t}\n\t\t// }\n\t}\n\n\tFancytree.prototype = /** @lends Fancytree# */ {\n\t\t/* Return a context object that can be re-used for _callHook().\n\t\t * @param {Fancytree | FancytreeNode | EventData} obj\n\t\t * @param {Event} originalEvent\n\t\t * @param {Object} extra\n\t\t * @returns {EventData}\n\t\t */\n\t\t_makeHookContext: function (obj, originalEvent, extra) {\n\t\t\tvar ctx, tree;\n\t\t\tif (obj.node !== undefined) {\n\t\t\t\t// obj is already a context object\n\t\t\t\tif (originalEvent && obj.originalEvent !== originalEvent) {\n\t\t\t\t\t$.error(\"invalid args\");\n\t\t\t\t}\n\t\t\t\tctx = obj;\n\t\t\t} else if (obj.tree) {\n\t\t\t\t// obj is a FancytreeNode\n\t\t\t\ttree = obj.tree;\n\t\t\t\tctx = {\n\t\t\t\t\tnode: obj,\n\t\t\t\t\ttree: tree,\n\t\t\t\t\twidget: tree.widget,\n\t\t\t\t\toptions: tree.widget.options,\n\t\t\t\t\toriginalEvent: originalEvent,\n\t\t\t\t\ttypeInfo: tree.types[obj.type] || {},\n\t\t\t\t};\n\t\t\t} else if (obj.widget) {\n\t\t\t\t// obj is a Fancytree\n\t\t\t\tctx = {\n\t\t\t\t\tnode: null,\n\t\t\t\t\ttree: obj,\n\t\t\t\t\twidget: obj.widget,\n\t\t\t\t\toptions: obj.widget.options,\n\t\t\t\t\toriginalEvent: originalEvent,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t$.error(\"invalid args\");\n\t\t\t}\n\t\t\tif (extra) {\n\t\t\t\t$.extend(ctx, extra);\n\t\t\t}\n\t\t\treturn ctx;\n\t\t},\n\t\t/* Trigger a hook function: funcName(ctx, [...]).\n\t\t *\n\t\t * @param {string} funcName\n\t\t * @param {Fancytree|FancytreeNode|EventData} contextObject\n\t\t * @param {any} [_extraArgs] optional additional arguments\n\t\t * @returns {any}\n\t\t */\n\t\t_callHook: function (funcName, contextObject, _extraArgs) {\n\t\t\tvar ctx = this._makeHookContext(contextObject),\n\t\t\t\tfn = this[funcName],\n\t\t\t\targs = Array.prototype.slice.call(arguments, 2);\n\t\t\tif (!_isFunction(fn)) {\n\t\t\t\t$.error(\"_callHook('\" + funcName + \"') is not a function\");\n\t\t\t}\n\t\t\targs.unshift(ctx);\n\t\t\t// this.debug(\"_hook\", funcName, ctx.node && ctx.node.toString() || ctx.tree.toString(), args);\n\t\t\treturn fn.apply(this, args);\n\t\t},\n\t\t_setExpiringValue: function (key, value, ms) {\n\t\t\tthis._tempCache[key] = {\n\t\t\t\tvalue: value,\n\t\t\t\texpire: Date.now() + (+ms || 50),\n\t\t\t};\n\t\t},\n\t\t_getExpiringValue: function (key) {\n\t\t\tvar entry = this._tempCache[key];\n\t\t\tif (entry && entry.expire > Date.now()) {\n\t\t\t\treturn entry.value;\n\t\t\t}\n\t\t\tdelete this._tempCache[key];\n\t\t\treturn null;\n\t\t},\n\t\t/* Check if this tree has extension `name` enabled.\n\t\t *\n\t\t * @param {string} name name of the required extension\n\t\t */\n\t\t_usesExtension: function (name) {\n\t\t\treturn $.inArray(name, this.options.extensions) >= 0;\n\t\t},\n\t\t/* Check if current extensions dependencies are met and throw an error if not.\n\t\t *\n\t\t * This method may be called inside the `treeInit` hook for custom extensions.\n\t\t *\n\t\t * @param {string} name name of the required extension\n\t\t * @param {boolean} [required=true] pass `false` if the extension is optional, but we want to check for order if it is present\n\t\t * @param {boolean} [before] `true` if `name` must be included before this, `false` otherwise (use `null` if order doesn't matter)\n\t\t * @param {string} [message] optional error message (defaults to a descriptve error message)\n\t\t */\n\t\t_requireExtension: function (name, required, before, message) {\n\t\t\tif (before != null) {\n\t\t\t\tbefore = !!before;\n\t\t\t}\n\t\t\tvar thisName = this._local.name,\n\t\t\t\textList = this.options.extensions,\n\t\t\t\tisBefore =\n\t\t\t\t\t$.inArray(name, extList) < $.inArray(thisName, extList),\n\t\t\t\tisMissing = required && this.ext[name] == null,\n\t\t\t\tbadOrder = !isMissing && before != null && before !== isBefore;\n\n\t\t\t_assert(\n\t\t\t\tthisName && thisName !== name,\n\t\t\t\t\"invalid or same name '\" + thisName + \"' (require yourself?)\"\n\t\t\t);\n\n\t\t\tif (isMissing || badOrder) {\n\t\t\t\tif (!message) {\n\t\t\t\t\tif (isMissing || required) {\n\t\t\t\t\t\tmessage =\n\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\tthisName +\n\t\t\t\t\t\t\t\"' extension requires '\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"'\";\n\t\t\t\t\t\tif (badOrder) {\n\t\t\t\t\t\t\tmessage +=\n\t\t\t\t\t\t\t\t\" to be registered \" +\n\t\t\t\t\t\t\t\t(before ? \"before\" : \"after\") +\n\t\t\t\t\t\t\t\t\" itself\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessage =\n\t\t\t\t\t\t\t\"If used together, `\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"` must be registered \" +\n\t\t\t\t\t\t\t(before ? \"before\" : \"after\") +\n\t\t\t\t\t\t\t\" `\" +\n\t\t\t\t\t\t\tthisName +\n\t\t\t\t\t\t\t\"`\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$.error(message);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/** Activate node with a given key and fire focus and activate events.\n\t\t *\n\t\t * A previously activated node will be deactivated.\n\t\t * If activeVisible option is set, all parents will be expanded as necessary.\n\t\t * Pass key = false, to deactivate the current node only.\n\t\t * @param {string} key\n\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false}\n\t\t * @returns {FancytreeNode} activated node (null, if not found)\n\t\t */\n\t\tactivateKey: function (key, opts) {\n\t\t\tvar node = this.getNodeByKey(key);\n\t\t\tif (node) {\n\t\t\t\tnode.setActive(true, opts);\n\t\t\t} else if (this.activeNode) {\n\t\t\t\tthis.activeNode.setActive(false, opts);\n\t\t\t}\n\t\t\treturn node;\n\t\t},\n\t\t/** (experimental) Add child status nodes that indicate 'More...', ....\n\t\t * @param {boolean|object} node optional node definition. Pass `false` to remove all paging nodes.\n\t\t * @param {string} [mode='append'] 'child'|firstChild'\n\t\t * @since 2.15\n\t\t */\n\t\taddPagingNode: function (node, mode) {\n\t\t\treturn this.rootNode.addPagingNode(node, mode);\n\t\t},\n\t\t/**\n\t\t * (experimental) Apply a modification (or navigation) operation.\n\t\t *\n\t\t * Valid commands:\n\t\t * - 'moveUp', 'moveDown'\n\t\t * - 'indent', 'outdent'\n\t\t * - 'remove'\n\t\t * - 'edit', 'addChild', 'addSibling': (reqires ext-edit extension)\n\t\t * - 'cut', 'copy', 'paste': (use an internal singleton 'clipboard')\n\t\t * - 'down', 'first', 'last', 'left', 'parent', 'right', 'up': navigate\n\t\t *\n\t\t * @param {string} cmd\n\t\t * @param {FancytreeNode} [node=active_node]\n\t\t * @param {object} [opts] Currently unused\n\t\t *\n\t\t * @since 2.32\n\t\t */\n\t\tapplyCommand: function (cmd, node, opts_) {\n\t\t\tvar // clipboard,\n\t\t\t\trefNode;\n\t\t\t// opts = $.extend(\n\t\t\t// \t{ setActive: true, clipboard: CLIPBOARD },\n\t\t\t// \topts_\n\t\t\t// );\n\n\t\t\tnode = node || this.getActiveNode();\n\t\t\t// clipboard = opts.clipboard;\n\n\t\t\tswitch (cmd) {\n\t\t\t\t// Sorting and indentation:\n\t\t\t\tcase \"moveUp\":\n\t\t\t\t\trefNode = node.getPrevSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"before\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"moveDown\":\n\t\t\t\t\trefNode = node.getNextSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"after\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"indent\":\n\t\t\t\t\trefNode = node.getPrevSibling();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\tnode.moveTo(refNode, \"child\");\n\t\t\t\t\t\trefNode.setExpanded();\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outdent\":\n\t\t\t\t\tif (!node.isTopLevel()) {\n\t\t\t\t\t\tnode.moveTo(node.getParent(), \"after\");\n\t\t\t\t\t\tnode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Remove:\n\t\t\t\tcase \"remove\":\n\t\t\t\t\trefNode = node.getPrevSibling() || node.getParent();\n\t\t\t\t\tnode.remove();\n\t\t\t\t\tif (refNode) {\n\t\t\t\t\t\trefNode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Add, edit (requires ext-edit):\n\t\t\t\tcase \"addChild\":\n\t\t\t\t\tnode.editCreateNode(\"child\", \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"addSibling\":\n\t\t\t\t\tnode.editCreateNode(\"after\", \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"rename\":\n\t\t\t\t\tnode.editStart();\n\t\t\t\t\tbreak;\n\t\t\t\t// Simple clipboard simulation:\n\t\t\t\t// case \"cut\":\n\t\t\t\t// \tclipboard = { mode: cmd, data: node };\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"copy\":\n\t\t\t\t// \tclipboard = {\n\t\t\t\t// \t\tmode: cmd,\n\t\t\t\t// \t\tdata: node.toDict(function(d, n) {\n\t\t\t\t// \t\t\tdelete d.key;\n\t\t\t\t// \t\t}),\n\t\t\t\t// \t};\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"clear\":\n\t\t\t\t// \tclipboard = null;\n\t\t\t\t// \tbreak;\n\t\t\t\t// case \"paste\":\n\t\t\t\t// \tif (clipboard.mode === \"cut\") {\n\t\t\t\t// \t\t// refNode = node.getPrevSibling();\n\t\t\t\t// \t\tclipboard.data.moveTo(node, \"child\");\n\t\t\t\t// \t\tclipboard.data.setActive();\n\t\t\t\t// \t} else if (clipboard.mode === \"copy\") {\n\t\t\t\t// \t\tnode.addChildren(clipboard.data).setActive();\n\t\t\t\t// \t}\n\t\t\t\t// \tbreak;\n\t\t\t\t// Navigation commands:\n\t\t\t\tcase \"down\":\n\t\t\t\tcase \"first\":\n\t\t\t\tcase \"last\":\n\t\t\t\tcase \"left\":\n\t\t\t\tcase \"parent\":\n\t\t\t\tcase \"right\":\n\t\t\t\tcase \"up\":\n\t\t\t\t\treturn node.navigate(cmd);\n\t\t\t\tdefault:\n\t\t\t\t\t$.error(\"Unhandled command: '\" + cmd + \"'\");\n\t\t\t}\n\t\t},\n\t\t/** (experimental) Modify existing data model.\n\t\t *\n\t\t * @param {Array} patchList array of [key, NodePatch] arrays\n\t\t * @returns {$.Promise} resolved, when all patches have been applied\n\t\t * @see TreePatch\n\t\t */\n\t\tapplyPatch: function (patchList) {\n\t\t\tvar dfd,\n\t\t\t\ti,\n\t\t\t\tp2,\n\t\t\t\tkey,\n\t\t\t\tpatch,\n\t\t\t\tnode,\n\t\t\t\tpatchCount = patchList.length,\n\t\t\t\tdeferredList = [];\n\n\t\t\tfor (i = 0; i < patchCount; i++) {\n\t\t\t\tp2 = patchList[i];\n\t\t\t\t_assert(\n\t\t\t\t\tp2.length === 2,\n\t\t\t\t\t\"patchList must be an array of length-2-arrays\"\n\t\t\t\t);\n\t\t\t\tkey = p2[0];\n\t\t\t\tpatch = p2[1];\n\t\t\t\tnode = key === null ? this.rootNode : this.getNodeByKey(key);\n\t\t\t\tif (node) {\n\t\t\t\t\tdfd = new $.Deferred();\n\t\t\t\t\tdeferredList.push(dfd);\n\t\t\t\t\tnode.applyPatch(patch).always(_makeResolveFunc(dfd, node));\n\t\t\t\t} else {\n\t\t\t\t\tthis.warn(\"could not find node with key '\" + key + \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return a promise that is resolved, when ALL patches were applied\n\t\t\treturn $.when.apply($, deferredList).promise();\n\t\t},\n\t\t/* TODO: implement in dnd extension\n\t\tcancelDrag: function() {\n\t\t\t\tvar dd = $.ui.ddmanager.current;\n\t\t\t\tif(dd){\n\t\t\t\t\tdd.cancel();\n\t\t\t\t}\n\t\t\t},\n\t\t*/\n\t\t/** Remove all nodes.\n\t\t * @since 2.14\n\t\t */\n\t\tclear: function (source) {\n\t\t\tthis._callHook(\"treeClear\", this);\n\t\t},\n\t\t/** Return the number of nodes.\n\t\t * @returns {integer}\n\t\t */\n\t\tcount: function () {\n\t\t\treturn this.rootNode.countChildren();\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 4 (prepending tree name)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tdebug: function (msg) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Destroy this widget, restore previous markup and cleanup resources.\n\t\t *\n\t\t * @since 2.34\n\t\t */\n\t\tdestroy: function () {\n\t\t\tthis.widget.destroy();\n\t\t},\n\t\t/** Enable (or disable) the tree control.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to disable\n\t\t * @since 2.30\n\t\t */\n\t\tenable: function (flag) {\n\t\t\tif (flag === false) {\n\t\t\t\tthis.widget.disable();\n\t\t\t} else {\n\t\t\t\tthis.widget.enable();\n\t\t\t}\n\t\t},\n\t\t/** Temporarily suppress rendering to improve performance on bulk-updates.\n\t\t *\n\t\t * @param {boolean} flag\n\t\t * @returns {boolean} previous status\n\t\t * @since 2.19\n\t\t */\n\t\tenableUpdate: function (flag) {\n\t\t\tflag = flag !== false;\n\t\t\tif (!!this._enableUpdate === !!flag) {\n\t\t\t\treturn flag;\n\t\t\t}\n\t\t\tthis._enableUpdate = flag;\n\t\t\tif (flag) {\n\t\t\t\tthis.debug(\"enableUpdate(true): redraw \"); //, this._dirtyRoots);\n\t\t\t\tthis._callHook(\"treeStructureChanged\", this, \"enableUpdate\");\n\t\t\t\tthis.render();\n\t\t\t} else {\n\t\t\t\t// \tthis._dirtyRoots = null;\n\t\t\t\tthis.debug(\"enableUpdate(false)...\");\n\t\t\t}\n\t\t\treturn !flag; // return previous value\n\t\t},\n\t\t/** Write error to browser console if debugLevel >= 1 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\terror: function (msg) {\n\t\t\tif (this.options.debugLevel >= 1) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Expand (or collapse) all parent nodes.\n\t\t *\n\t\t * This convenience method uses `tree.visit()` and `tree.setExpanded()`\n\t\t * internally.\n\t\t *\n\t\t * @param {boolean} [flag=true] pass false to collapse\n\t\t * @param {object} [opts] passed to setExpanded()\n\t\t * @since 2.30\n\t\t */\n\t\texpandAll: function (flag, opts) {\n\t\t\tvar prev = this.enableUpdate(false);\n\n\t\t\tflag = flag !== false;\n\t\t\tthis.visit(function (node) {\n\t\t\t\tif (\n\t\t\t\t\tnode.hasChildren() !== false &&\n\t\t\t\t\tnode.isExpanded() !== flag\n\t\t\t\t) {\n\t\t\t\t\tnode.setExpanded(flag, opts);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.enableUpdate(prev);\n\t\t},\n\t\t/**Find all nodes that matches condition.\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode[]} array of nodes (may be empty)\n\t\t * @see FancytreeNode#findAll\n\t\t * @since 2.12\n\t\t */\n\t\tfindAll: function (match) {\n\t\t\treturn this.rootNode.findAll(match);\n\t\t},\n\t\t/**Find first node that matches condition.\n\t\t *\n\t\t * @param {string | function(node)} match title string to search for, or a\n\t\t * callback function that returns `true` if a node is matched.\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t * @see FancytreeNode#findFirst\n\t\t * @since 2.12\n\t\t */\n\t\tfindFirst: function (match) {\n\t\t\treturn this.rootNode.findFirst(match);\n\t\t},\n\t\t/** Find the next visible node that starts with `match`, starting at `startNode`\n\t\t * and wrap-around at the end.\n\t\t *\n\t\t * @param {string|function} match\n\t\t * @param {FancytreeNode} [startNode] defaults to first node\n\t\t * @returns {FancytreeNode} matching node or null\n\t\t */\n\t\tfindNextNode: function (match, startNode) {\n\t\t\t//, visibleOnly) {\n\t\t\tvar res = null,\n\t\t\t\tfirstNode = this.getFirstChild();\n\n\t\t\tmatch =\n\t\t\t\ttypeof match === \"string\"\n\t\t\t\t\t? _makeNodeTitleStartMatcher(match)\n\t\t\t\t\t: match;\n\t\t\tstartNode = startNode || firstNode;\n\n\t\t\tfunction _checkNode(n) {\n\t\t\t\t// console.log(\"_check \" + n)\n\t\t\t\tif (match(n)) {\n\t\t\t\t\tres = n;\n\t\t\t\t}\n\t\t\t\tif (res || n === startNode) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.visitRows(_checkNode, {\n\t\t\t\tstart: startNode,\n\t\t\t\tincludeSelf: false,\n\t\t\t});\n\t\t\t// Wrap around search\n\t\t\tif (!res && startNode !== firstNode) {\n\t\t\t\tthis.visitRows(_checkNode, {\n\t\t\t\t\tstart: firstNode,\n\t\t\t\t\tincludeSelf: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Find a node relative to another node.\n\t\t *\n\t\t * @param {FancytreeNode} node\n\t\t * @param {string|number} where 'down', 'first', 'last', 'left', 'parent', 'right', or 'up'.\n\t\t * (Alternatively the keyCode that would normally trigger this move,\n\t\t * e.g. `$.ui.keyCode.LEFT` = 'left'.\n\t\t * @param {boolean} [includeHidden=false] Not yet implemented\n\t\t * @returns {FancytreeNode|null}\n\t\t * @since v2.31\n\t\t */\n\t\tfindRelatedNode: function (node, where, includeHidden) {\n\t\t\tvar res = null,\n\t\t\t\tKC = $.ui.keyCode;\n\n\t\t\tswitch (where) {\n\t\t\t\tcase \"parent\":\n\t\t\t\tcase KC.BACKSPACE:\n\t\t\t\t\tif (node.parent && node.parent.parent) {\n\t\t\t\t\t\tres = node.parent;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"first\":\n\t\t\t\tcase KC.HOME:\n\t\t\t\t\t// First visible node\n\t\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t\tif (n.isVisible()) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"last\":\n\t\t\t\tcase KC.END:\n\t\t\t\t\tthis.visit(function (n) {\n\t\t\t\t\t\t// last visible node\n\t\t\t\t\t\tif (n.isVisible()) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"left\":\n\t\t\t\tcase KC.LEFT:\n\t\t\t\t\tif (node.expanded) {\n\t\t\t\t\t\tnode.setExpanded(false);\n\t\t\t\t\t} else if (node.parent && node.parent.parent) {\n\t\t\t\t\t\tres = node.parent;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"right\":\n\t\t\t\tcase KC.RIGHT:\n\t\t\t\t\tif (!node.expanded && (node.children || node.lazy)) {\n\t\t\t\t\t\tnode.setExpanded();\n\t\t\t\t\t\tres = node;\n\t\t\t\t\t} else if (node.children && node.children.length) {\n\t\t\t\t\t\tres = node.children[0];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"up\":\n\t\t\t\tcase KC.UP:\n\t\t\t\t\tthis.visitRows(\n\t\t\t\t\t\tfunction (n) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ start: node, reverse: true, includeSelf: false }\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"down\":\n\t\t\t\tcase KC.DOWN:\n\t\t\t\t\tthis.visitRows(\n\t\t\t\t\t\tfunction (n) {\n\t\t\t\t\t\t\tres = n;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ start: node, includeSelf: false }\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.tree.warn(\"Unknown relation '\" + where + \"'.\");\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t// TODO: fromDict\n\t\t/**\n\t\t * Generate INPUT elements that can be submitted with html forms.\n\t\t *\n\t\t * In selectMode 3 only the topmost selected nodes are considered, unless\n\t\t * `opts.stopOnParents: false` is passed.\n\t\t *\n\t\t * @example\n\t\t * // Generate input elements for active and selected nodes\n\t\t * tree.generateFormElements();\n\t\t * // Generate input elements selected nodes, using a custom `name` attribute\n\t\t * tree.generateFormElements(\"cust_sel\", false);\n\t\t * // Generate input elements using a custom filter\n\t\t * tree.generateFormElements(true, true, { filter: function(node) {\n\t\t * return node.isSelected() && node.data.yes;\n\t\t * }});\n\t\t *\n\t\t * @param {boolean | string} [selected=true] Pass false to disable, pass a string to override the field name (default: 'ft_ID[]')\n\t\t * @param {boolean | string} [active=true] Pass false to disable, pass a string to override the field name (default: 'ft_ID_active')\n\t\t * @param {object} [opts] default { filter: null, stopOnParents: true }\n\t\t */\n\t\tgenerateFormElements: function (selected, active, opts) {\n\t\t\topts = opts || {};\n\n\t\t\tvar nodeList,\n\t\t\t\tselectedName =\n\t\t\t\t\ttypeof selected === \"string\"\n\t\t\t\t\t\t? selected\n\t\t\t\t\t\t: \"ft_\" + this._id + \"[]\",\n\t\t\t\tactiveName =\n\t\t\t\t\ttypeof active === \"string\"\n\t\t\t\t\t\t? active\n\t\t\t\t\t\t: \"ft_\" + this._id + \"_active\",\n\t\t\t\tid = \"fancytree_result_\" + this._id,\n\t\t\t\t$result = $(\"#\" + id),\n\t\t\t\tstopOnParents =\n\t\t\t\t\tthis.options.selectMode === 3 &&\n\t\t\t\t\topts.stopOnParents !== false;\n\n\t\t\tif ($result.length) {\n\t\t\t\t$result.empty();\n\t\t\t} else {\n\t\t\t\t$result = $(\"<div>\", {\n\t\t\t\t\tid: id,\n\t\t\t\t})\n\t\t\t\t\t.hide()\n\t\t\t\t\t.insertAfter(this.$container);\n\t\t\t}\n\t\t\tif (active !== false && this.activeNode) {\n\t\t\t\t$result.append(\n\t\t\t\t\t$(\"<input>\", {\n\t\t\t\t\t\ttype: \"radio\",\n\t\t\t\t\t\tname: activeName,\n\t\t\t\t\t\tvalue: this.activeNode.key,\n\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\tfunction _appender(node) {\n\t\t\t\t$result.append(\n\t\t\t\t\t$(\"<input>\", {\n\t\t\t\t\t\ttype: \"checkbox\",\n\t\t\t\t\t\tname: selectedName,\n\t\t\t\t\t\tvalue: node.key,\n\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (opts.filter) {\n\t\t\t\tthis.visit(function (node) {\n\t\t\t\t\tvar res = opts.filter(node);\n\t\t\t\t\tif (res === \"skip\") {\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t\tif (res !== false) {\n\t\t\t\t\t\t_appender(node);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (selected !== false) {\n\t\t\t\tnodeList = this.getSelectedNodes(stopOnParents);\n\t\t\t\t$.each(nodeList, function (idx, node) {\n\t\t\t\t\t_appender(node);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Return the currently active node or null.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetActiveNode: function () {\n\t\t\treturn this.activeNode;\n\t\t},\n\t\t/** Return the first top level node if any (not the invisible root node).\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetFirstChild: function () {\n\t\t\treturn this.rootNode.getFirstChild();\n\t\t},\n\t\t/**\n\t\t * Return node that has keyboard focus or null.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetFocusNode: function () {\n\t\t\treturn this.focusNode;\n\t\t},\n\t\t/**\n\t\t * Return current option value.\n\t\t * (Note: this is the preferred variant of `$().fancytree(\"option\", \"KEY\")`)\n\t\t *\n\t\t * @param {string} name option name (may contain '.')\n\t\t * @returns {any}\n\t\t */\n\t\tgetOption: function (optionName) {\n\t\t\treturn this.widget.option(optionName);\n\t\t},\n\t\t/**\n\t\t * Return node with a given key or null if not found.\n\t\t *\n\t\t * @param {string} key\n\t\t * @param {FancytreeNode} [searchRoot] only search below this node\n\t\t * @returns {FancytreeNode | null}\n\t\t */\n\t\tgetNodeByKey: function (key, searchRoot) {\n\t\t\t// Search the DOM by element ID (assuming this is faster than traversing all nodes).\n\t\t\tvar el, match;\n\t\t\t// TODO: use tree.keyMap if available\n\t\t\t// TODO: check opts.generateIds === true\n\t\t\tif (!searchRoot) {\n\t\t\t\tel = document.getElementById(this.options.idPrefix + key);\n\t\t\t\tif (el) {\n\t\t\t\t\treturn el.ftnode ? el.ftnode : null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not found in the DOM, but still may be in an unrendered part of tree\n\t\t\tsearchRoot = searchRoot || this.rootNode;\n\t\t\tmatch = null;\n\t\t\tkey = \"\" + key; // Convert to string (#1005)\n\t\t\tsearchRoot.visit(function (node) {\n\t\t\t\tif (node.key === key) {\n\t\t\t\t\tmatch = node;\n\t\t\t\t\treturn false; // Stop iteration\n\t\t\t\t}\n\t\t\t}, true);\n\t\t\treturn match;\n\t\t},\n\t\t/** Return the invisible system root node.\n\t\t * @returns {FancytreeNode}\n\t\t */\n\t\tgetRootNode: function () {\n\t\t\treturn this.rootNode;\n\t\t},\n\t\t/**\n\t\t * Return an array of selected nodes.\n\t\t *\n\t\t * Note: you cannot send this result via Ajax directly. Instead the\n\t\t * node object need to be converted to plain objects, for example\n\t\t * by using `$.map()` and `node.toDict()`.\n\t\t * @param {boolean} [stopOnParents=false] only return the topmost selected\n\t\t * node (useful with selectMode 3)\n\t\t * @returns {FancytreeNode[]}\n\t\t */\n\t\tgetSelectedNodes: function (stopOnParents) {\n\t\t\treturn this.rootNode.getSelectedNodes(stopOnParents);\n\t\t},\n\t\t/** Return true if the tree control has keyboard focus\n\t\t * @returns {boolean}\n\t\t */\n\t\thasFocus: function () {\n\t\t\t// var ae = document.activeElement,\n\t\t\t// \thasFocus = !!(\n\t\t\t// \t\tae && $(ae).closest(\".fancytree-container\").length\n\t\t\t// \t);\n\n\t\t\t// if (hasFocus !== !!this._hasFocus) {\n\t\t\t// \tthis.warn(\n\t\t\t// \t\t\"hasFocus(): fix inconsistent container state, now: \" +\n\t\t\t// \t\t\thasFocus\n\t\t\t// \t);\n\t\t\t// \tthis._hasFocus = hasFocus;\n\t\t\t// \tthis.$container.toggleClass(\"fancytree-treefocus\", hasFocus);\n\t\t\t// }\n\t\t\t// return hasFocus;\n\t\t\treturn !!this._hasFocus;\n\t\t},\n\t\t/** Write to browser console if debugLevel >= 3 (prepending tree name)\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\tinfo: function (msg) {\n\t\t\tif (this.options.debugLevel >= 3) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t}\n\t\t},\n\t\t/** Return true if any node is currently beeing loaded, i.e. a Ajax request is pending.\n\t\t * @returns {boolean}\n\t\t * @since 2.32\n\t\t */\n\t\tisLoading: function () {\n\t\t\tvar res = false;\n\n\t\t\tthis.rootNode.visit(function (n) {\n\t\t\t\t// also visit rootNode\n\t\t\t\tif (n._isLoading || n._requestId) {\n\t\t\t\t\tres = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}, true);\n\t\t\treturn res;\n\t\t},\n\t\t/*\n\t\tTODO: isInitializing: function() {\n\t\t\treturn ( this.phase==\"init\" || this.phase==\"postInit\" );\n\t\t},\n\t\tTODO: isReloading: function() {\n\t\t\treturn ( this.phase==\"init\" || this.phase==\"postInit\" ) && this.options.persist && this.persistence.cookiesFound;\n\t\t},\n\t\tTODO: isUserEvent: function() {\n\t\t\treturn ( this.phase==\"userEvent\" );\n\t\t},\n\t\t*/\n\n\t\t/**\n\t\t * Make sure that a node with a given ID is loaded, by traversing - and\n\t\t * loading - its parents. This method is meant for lazy hierarchies.\n\t\t * A callback is executed for every node as we go.\n\t\t * @example\n\t\t * // Resolve using node.key:\n\t\t * tree.loadKeyPath(\"/_3/_23/_26/_27\", function(node, status){\n\t\t * if(status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + node);\n\t\t * }else if(status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * });\n\t\t * // Use deferred promise:\n\t\t * tree.loadKeyPath(\"/_3/_23/_26/_27\").progress(function(data){\n\t\t * if(data.status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + data.node);\n\t\t * }else if(data.status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * }).done(function(){\n\t\t * ...\n\t\t * });\n\t\t * // Custom path segment resolver:\n\t\t * tree.loadKeyPath(\"/321/431/21/2\", {\n\t\t * matchKey: function(node, key){\n\t\t * return node.data.refKey === key;\n\t\t * },\n\t\t * callback: function(node, status){\n\t\t * if(status === \"loaded\") {\n\t\t * console.log(\"loaded intermediate node \" + node);\n\t\t * }else if(status === \"ok\") {\n\t\t * node.activate();\n\t\t * }\n\t\t * }\n\t\t * });\n\t\t * @param {string | string[]} keyPathList one or more key paths (e.g. '/3/2_1/7')\n\t\t * @param {function | object} optsOrCallback callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error').\n\t\t * Pass an object to define custom key matchers for the path segments: {callback: function, matchKey: function}.\n\t\t * @returns {$.Promise}\n\t\t */\n\t\tloadKeyPath: function (keyPathList, optsOrCallback) {\n\t\t\tvar callback,\n\t\t\t\ti,\n\t\t\t\tpath,\n\t\t\t\tself = this,\n\t\t\t\tdfd = new $.Deferred(),\n\t\t\t\tparent = this.getRootNode(),\n\t\t\t\tsep = this.options.keyPathSeparator,\n\t\t\t\tpathSegList = [],\n\t\t\t\topts = $.extend({}, optsOrCallback);\n\n\t\t\t// Prepare options\n\t\t\tif (typeof optsOrCallback === \"function\") {\n\t\t\t\tcallback = optsOrCallback;\n\t\t\t} else if (optsOrCallback && optsOrCallback.callback) {\n\t\t\t\tcallback = optsOrCallback.callback;\n\t\t\t}\n\t\t\topts.callback = function (ctx, node, status) {\n\t\t\t\tif (callback) {\n\t\t\t\t\tcallback.call(ctx, node, status);\n\t\t\t\t}\n\t\t\t\tdfd.notifyWith(ctx, [{ node: node, status: status }]);\n\t\t\t};\n\t\t\tif (opts.matchKey == null) {\n\t\t\t\topts.matchKey = function (node, key) {\n\t\t\t\t\treturn node.key === key;\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Convert array of path strings to array of segment arrays\n\t\t\tif (!_isArray(keyPathList)) {\n\t\t\t\tkeyPathList = [keyPathList];\n\t\t\t}\n\t\t\tfor (i = 0; i < keyPathList.length; i++) {\n\t\t\t\tpath = keyPathList[i];\n\t\t\t\t// strip leading slash\n\t\t\t\tif (path.charAt(0) === sep) {\n\t\t\t\t\tpath = path.substr(1);\n\t\t\t\t}\n\t\t\t\t// segListMap[path] = { parent: parent, segList: path.split(sep) };\n\t\t\t\tpathSegList.push(path.split(sep));\n\t\t\t\t// targetList.push({ parent: parent, segList: path.split(sep)/* , path: path*/});\n\t\t\t}\n\t\t\t// The timeout forces async behavior always (even if nodes are all loaded)\n\t\t\t// This way a potential progress() event will fire.\n\t\t\tsetTimeout(function () {\n\t\t\t\tself._loadKeyPathImpl(dfd, opts, parent, pathSegList).done(\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\tdfd.resolve();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}, 0);\n\t\t\treturn dfd.promise();\n\t\t},\n\t\t/*\n\t\t * Resolve a list of paths, relative to one parent node.\n\t\t */\n\t\t_loadKeyPathImpl: function (dfd, opts, parent, pathSegList) {\n\t\t\tvar deferredList,\n\t\t\t\ti,\n\t\t\t\tkey,\n\t\t\t\tnode,\n\t\t\t\tnodeKey,\n\t\t\t\tremain,\n\t\t\t\tremainMap,\n\t\t\t\ttmpParent,\n\t\t\t\tsegList,\n\t\t\t\tsubDfd,\n\t\t\t\tself = this;\n\n\t\t\tfunction __findChild(parent, key) {\n\t\t\t\t// console.log(\"__findChild\", key, parent);\n\t\t\t\tvar i,\n\t\t\t\t\tl,\n\t\t\t\t\tcl = parent.children;\n\n\t\t\t\tif (cl) {\n\t\t\t\t\tfor (i = 0, l = cl.length; i < l; i++) {\n\t\t\t\t\t\tif (opts.matchKey(cl[i], key)) {\n\t\t\t\t\t\t\treturn cl[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// console.log(\"_loadKeyPathImpl, parent=\", parent, \", pathSegList=\", pathSegList);\n\n\t\t\t// Pass 1:\n\t\t\t// Handle all path segments for nodes that are already loaded.\n\t\t\t// Collect distinct top-most lazy nodes in a map.\n\t\t\t// Note that we can use node.key to de-dupe entries, even if a custom matcher would\n\t\t\t// look for other node attributes.\n\t\t\t// map[node.key] => {node: node, pathList: [list of remaining rest-paths]}\n\t\t\tremainMap = {};\n\n\t\t\tfor (i = 0; i < pathSegList.length; i++) {\n\t\t\t\tsegList = pathSegList[i];\n\t\t\t\t// target = targetList[i];\n\n\t\t\t\t// Traverse and pop path segments (i.e. keys), until we hit a lazy, unloaded node\n\t\t\t\ttmpParent = parent;\n\t\t\t\twhile (segList.length) {\n\t\t\t\t\tkey = segList.shift();\n\t\t\t\t\tnode = __findChild(tmpParent, key);\n\t\t\t\t\tif (!node) {\n\t\t\t\t\t\tthis.warn(\n\t\t\t\t\t\t\t\"loadKeyPath: key not found: \" +\n\t\t\t\t\t\t\t\tkey +\n\t\t\t\t\t\t\t\t\" (parent: \" +\n\t\t\t\t\t\t\t\ttmpParent +\n\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.callback(this, key, \"error\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (segList.length === 0) {\n\t\t\t\t\t\topts.callback(this, node, \"ok\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (!node.lazy || node.hasChildren() !== undefined) {\n\t\t\t\t\t\topts.callback(this, node, \"loaded\");\n\t\t\t\t\t\ttmpParent = node;\n\t\t\t\t\t} else {\n\t\t\t\t\t\topts.callback(this, node, \"loaded\");\n\t\t\t\t\t\tkey = node.key; //target.segList.join(sep);\n\t\t\t\t\t\tif (remainMap[key]) {\n\t\t\t\t\t\t\tremainMap[key].pathSegList.push(segList);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tremainMap[key] = {\n\t\t\t\t\t\t\t\tparent: node,\n\t\t\t\t\t\t\t\tpathSegList: [segList],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// console.log(\"_loadKeyPathImpl AFTER pass 1, remainMap=\", remainMap);\n\n\t\t\t// Now load all lazy nodes and continue iteration for remaining paths\n\t\t\tdeferredList = [];\n\n\t\t\t// Avoid jshint warning 'Don't make functions within a loop.':\n\t\t\tfunction __lazyload(dfd, parent, pathSegList) {\n\t\t\t\t// console.log(\"__lazyload\", parent, \"pathSegList=\", pathSegList);\n\t\t\t\topts.callback(self, parent, \"loading\");\n\t\t\t\tparent\n\t\t\t\t\t.load()\n\t\t\t\t\t.done(function () {\n\t\t\t\t\t\tself._loadKeyPathImpl\n\t\t\t\t\t\t\t.call(self, dfd, opts, parent, pathSegList)\n\t\t\t\t\t\t\t.always(_makeResolveFunc(dfd, self));\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function (errMsg) {\n\t\t\t\t\t\tself.warn(\"loadKeyPath: error loading lazy \" + parent);\n\t\t\t\t\t\topts.callback(self, node, \"error\");\n\t\t\t\t\t\tdfd.rejectWith(self);\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t// remainMap contains parent nodes, each with a list of relative sub-paths.\n\t\t\t// We start loading all of them now, and pass the the list to each loader.\n\t\t\tfor (nodeKey in remainMap) {\n\t\t\t\tif (_hasProp(remainMap, nodeKey)) {\n\t\t\t\t\tremain = remainMap[nodeKey];\n\t\t\t\t\t// console.log(\"for(): remain=\", remain, \"remainMap=\", remainMap);\n\t\t\t\t\t// key = remain.segList.shift();\n\t\t\t\t\t// node = __findChild(remain.parent, key);\n\t\t\t\t\t// if (node == null) { // #576\n\t\t\t\t\t// \t// Issue #576, refactored for v2.27:\n\t\t\t\t\t// \t// The root cause was, that sometimes the wrong parent was used here\n\t\t\t\t\t// \t// to find the next segment.\n\t\t\t\t\t// \t// Falling back to getNodeByKey() was a hack that no longer works if a custom\n\t\t\t\t\t// \t// matcher is used, because we cannot assume that a single segment-key is unique\n\t\t\t\t\t// \t// throughout the tree.\n\t\t\t\t\t// \tself.error(\"loadKeyPath: error loading child by key '\" + key + \"' (parent: \" + target.parent + \")\", target);\n\t\t\t\t\t// \t// \tnode = self.getNodeByKey(key);\n\t\t\t\t\t// \tcontinue;\n\t\t\t\t\t// }\n\t\t\t\t\tsubDfd = new $.Deferred();\n\t\t\t\t\tdeferredList.push(subDfd);\n\t\t\t\t\t__lazyload(subDfd, remain.parent, remain.pathSegList);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return a promise that is resolved, when ALL paths were loaded\n\t\t\treturn $.when.apply($, deferredList).promise();\n\t\t},\n\t\t/** Re-fire beforeActivate, activate, and (optional) focus events.\n\t\t * Calling this method in the `init` event, will activate the node that\n\t\t * was marked 'active' in the source data, and optionally set the keyboard\n\t\t * focus.\n\t\t * @param [setFocus=false]\n\t\t */\n\t\treactivate: function (setFocus) {\n\t\t\tvar res,\n\t\t\t\tnode = this.activeNode;\n\n\t\t\tif (!node) {\n\t\t\t\treturn _getResolvedPromise();\n\t\t\t}\n\t\t\tthis.activeNode = null; // Force re-activating\n\t\t\tres = node.setActive(true, { noFocus: true });\n\t\t\tif (setFocus) {\n\t\t\t\tnode.setFocus();\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Reload tree from source and return a promise.\n\t\t * @param [source] optional new source (defaults to initial source data)\n\t\t * @returns {$.Promise}\n\t\t */\n\t\treload: function (source) {\n\t\t\tthis._callHook(\"treeClear\", this);\n\t\t\treturn this._callHook(\"treeLoad\", this, source);\n\t\t},\n\t\t/**Render tree (i.e. create DOM elements for all top-level nodes).\n\t\t * @param {boolean} [force=false] create DOM elemnts, even if parent is collapsed\n\t\t * @param {boolean} [deep=false]\n\t\t */\n\t\trender: function (force, deep) {\n\t\t\treturn this.rootNode.render(force, deep);\n\t\t},\n\t\t/**(De)select all nodes.\n\t\t * @param {boolean} [flag=true]\n\t\t * @since 2.28\n\t\t */\n\t\tselectAll: function (flag) {\n\t\t\tthis.visit(function (node) {\n\t\t\t\tnode.setSelected(flag);\n\t\t\t});\n\t\t},\n\t\t// TODO: selectKey: function(key, select)\n\t\t// TODO: serializeArray: function(stopOnParents)\n\t\t/**\n\t\t * @param {boolean} [flag=true]\n\t\t */\n\t\tsetFocus: function (flag) {\n\t\t\treturn this._callHook(\"treeSetFocus\", this, flag);\n\t\t},\n\t\t/**\n\t\t * Set current option value.\n\t\t * (Note: this is the preferred variant of `$().fancytree(\"option\", \"KEY\", VALUE)`)\n\t\t * @param {string} name option name (may contain '.')\n\t\t * @param {any} new value\n\t\t */\n\t\tsetOption: function (optionName, value) {\n\t\t\treturn this.widget.option(optionName, value);\n\t\t},\n\t\t/**\n\t\t * Call console.time() when in debug mode (verbose >= 4).\n\t\t *\n\t\t * @param {string} label\n\t\t */\n\t\tdebugTime: function (label) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\twindow.console.time(this + \" - \" + label);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Call console.timeEnd() when in debug mode (verbose >= 4).\n\t\t *\n\t\t * @param {string} label\n\t\t */\n\t\tdebugTimeEnd: function (label) {\n\t\t\tif (this.options.debugLevel >= 4) {\n\t\t\t\twindow.console.timeEnd(this + \" - \" + label);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Return all nodes as nested list of {@link NodeData}.\n\t\t *\n\t\t * @param {boolean} [includeRoot=false] Returns the hidden system root node (and its children)\n\t\t * @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications.\n\t\t * Return `false` to ignore this node or \"skip\" to include this node without its children.\n\t\t * @returns {Array | object}\n\t\t * @see FancytreeNode#toDict\n\t\t */\n\t\ttoDict: function (includeRoot, callback) {\n\t\t\tvar res = this.rootNode.toDict(true, callback);\n\t\t\treturn includeRoot ? res : res.children;\n\t\t},\n\t\t/* Implicitly called for string conversions.\n\t\t * @returns {string}\n\t\t */\n\t\ttoString: function () {\n\t\t\treturn \"Fancytree@\" + this._id;\n\t\t\t// return \"<Fancytree(#\" + this._id + \")>\";\n\t\t},\n\t\t/* _trigger a widget event with additional node ctx.\n\t\t * @see EventData\n\t\t */\n\t\t_triggerNodeEvent: function (type, node, originalEvent, extra) {\n\t\t\t// this.debug(\"_trigger(\" + type + \"): '\" + ctx.node.title + \"'\", ctx);\n\t\t\tvar ctx = this._makeHookContext(node, originalEvent, extra),\n\t\t\t\tres = this.widget._trigger(type, originalEvent, ctx);\n\t\t\tif (res !== false && ctx.result !== undefined) {\n\t\t\t\treturn ctx.result;\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/* _trigger a widget event with additional tree data. */\n\t\t_triggerTreeEvent: function (type, originalEvent, extra) {\n\t\t\t// this.debug(\"_trigger(\" + type + \")\", ctx);\n\t\t\tvar ctx = this._makeHookContext(this, originalEvent, extra),\n\t\t\t\tres = this.widget._trigger(type, originalEvent, ctx);\n\n\t\t\tif (res !== false && ctx.result !== undefined) {\n\t\t\t\treturn ctx.result;\n\t\t\t}\n\t\t\treturn res;\n\t\t},\n\t\t/** Call fn(node) for all nodes in hierarchical order (depth-first).\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @returns {boolean} false, if the iterator was stopped.\n\t\t */\n\t\tvisit: function (fn) {\n\t\t\treturn this.rootNode.visit(fn, false);\n\t\t},\n\t\t/** Call fn(node) for all nodes in vertical order, top down (or bottom up).<br>\n\t\t * Stop iteration, if fn() returns false.<br>\n\t\t * Return false if iteration was stopped.\n\t\t *\n\t\t * @param {function} fn the callback function.\n\t\t * Return false to stop iteration, return \"skip\" to skip this node and children only.\n\t\t * @param {object} [options]\n\t\t * Defaults:\n\t\t * {start: First top node, reverse: false, includeSelf: true, includeHidden: false}\n\t\t * @returns {boolean} false if iteration was cancelled\n\t\t * @since 2.28\n\t\t */\n\t\tvisitRows: function (fn, opts) {\n\t\t\tif (!this.rootNode.hasChildren()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (opts && opts.reverse) {\n\t\t\t\tdelete opts.reverse;\n\t\t\t\treturn this._visitRowsUp(fn, opts);\n\t\t\t}\n\t\t\topts = opts || {};\n\n\t\t\tvar i,\n\t\t\t\tnextIdx,\n\t\t\t\tparent,\n\t\t\t\tres,\n\t\t\t\tsiblings,\n\t\t\t\tsiblingOfs = 0,\n\t\t\t\tskipFirstNode = opts.includeSelf === false,\n\t\t\t\tincludeHidden = !!opts.includeHidden,\n\t\t\t\tcheckFilter = !includeHidden && this.enableFilter,\n\t\t\t\tnode = opts.start || this.rootNode.children[0];\n\n\t\t\tparent = node.parent;\n\t\t\twhile (parent) {\n\t\t\t\t// visit siblings\n\t\t\t\tsiblings = parent.children;\n\t\t\t\tnextIdx = siblings.indexOf(node) + siblingOfs;\n\t\t\t\t_assert(\n\t\t\t\t\tnextIdx >= 0,\n\t\t\t\t\t\"Could not find \" +\n\t\t\t\t\t\tnode +\n\t\t\t\t\t\t\" in parent's children: \" +\n\t\t\t\t\t\tparent\n\t\t\t\t);\n\n\t\t\t\tfor (i = nextIdx; i < siblings.length; i++) {\n\t\t\t\t\tnode = siblings[i];\n\t\t\t\t\tif (checkFilter && !node.match && !node.subMatchCount) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!skipFirstNode && fn(node) === false) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tskipFirstNode = false;\n\t\t\t\t\t// Dive into node's child nodes\n\t\t\t\t\tif (\n\t\t\t\t\t\tnode.children &&\n\t\t\t\t\t\tnode.children.length &&\n\t\t\t\t\t\t(includeHidden || node.expanded)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Disable warning: Functions declared within loops referencing an outer\n\t\t\t\t\t\t// scoped variable may lead to confusing semantics:\n\t\t\t\t\t\t/*jshint -W083 */\n\t\t\t\t\t\tres = node.visit(function (n) {\n\t\t\t\t\t\t\tif (checkFilter && !n.match && !n.subMatchCount) {\n\t\t\t\t\t\t\t\treturn \"skip\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (fn(n) === false) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!includeHidden && n.children && !n.expanded) {\n\t\t\t\t\t\t\t\treturn \"skip\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t/*jshint +W083 */\n\t\t\t\t\t\tif (res === false) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Visit parent nodes (bottom up)\n\t\t\t\tnode = parent;\n\t\t\t\tparent = parent.parent;\n\t\t\t\tsiblingOfs = 1; //\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/* Call fn(node) for all nodes in vertical order, bottom up.\n\t\t */\n\t\t_visitRowsUp: function (fn, opts) {\n\t\t\tvar children,\n\t\t\t\tidx,\n\t\t\t\tparent,\n\t\t\t\tincludeHidden = !!opts.includeHidden,\n\t\t\t\tnode = opts.start || this.rootNode.children[0];\n\n\t\t\twhile (true) {\n\t\t\t\tparent = node.parent;\n\t\t\t\tchildren = parent.children;\n\n\t\t\t\tif (children[0] === node) {\n\t\t\t\t\t// If this is already the first sibling, goto parent\n\t\t\t\t\tnode = parent;\n\t\t\t\t\tif (!node.parent) {\n\t\t\t\t\t\tbreak; // first node of the tree\n\t\t\t\t\t}\n\t\t\t\t\tchildren = parent.children;\n\t\t\t\t} else {\n\t\t\t\t\t// Otherwise, goto prev. sibling\n\t\t\t\t\tidx = children.indexOf(node);\n\t\t\t\t\tnode = children[idx - 1];\n\t\t\t\t\t// If the prev. sibling has children, follow down to last descendant\n\t\t\t\t\twhile (\n\t\t\t\t\t\t// See: https://github.com/eslint/eslint/issues/11302\n\t\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\t\t(includeHidden || node.expanded) &&\n\t\t\t\t\t\tnode.children &&\n\t\t\t\t\t\tnode.children.length\n\t\t\t\t\t) {\n\t\t\t\t\t\tchildren = node.children;\n\t\t\t\t\t\tparent = node;\n\t\t\t\t\t\tnode = children[children.length - 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Skip invisible\n\t\t\t\tif (!includeHidden && !node.isVisible()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (fn(node) === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/** Write warning to browser console if debugLevel >= 2 (prepending tree info)\n\t\t *\n\t\t * @param {*} msg string or object or array of such\n\t\t */\n\t\twarn: function (msg) {\n\t\t\tif (this.options.debugLevel >= 2) {\n\t\t\t\tArray.prototype.unshift.call(arguments, this.toString());\n\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t}\n\t\t},\n\t};\n\n\t/**\n\t * These additional methods of the {@link Fancytree} class are 'hook functions'\n\t * that can be used and overloaded by extensions.\n\t *\n\t * @see [writing extensions](https://github.com/mar10/fancytree/wiki/TutorialExtensions)\n\t * @mixin Fancytree_Hooks\n\t */\n\t$.extend(\n\t\tFancytree.prototype,\n\t\t/** @lends Fancytree_Hooks# */\n\t\t{\n\t\t\t/** Default handling for mouse click events.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeClick: function (ctx) {\n\t\t\t\tvar activate,\n\t\t\t\t\texpand,\n\t\t\t\t\t// event = ctx.originalEvent,\n\t\t\t\t\ttargetType = ctx.targetType,\n\t\t\t\t\tnode = ctx.node;\n\n\t\t\t\t// this.debug(\"ftnode.onClick(\" + event.type + \"): ftnode:\" + this + \", button:\" + event.button + \", which: \" + event.which, ctx);\n\t\t\t\t// TODO: use switch\n\t\t\t\t// TODO: make sure clicks on embedded <input> doesn't steal focus (see table sample)\n\t\t\t\tif (targetType === \"expander\") {\n\t\t\t\t\tif (node.isLoading()) {\n\t\t\t\t\t\t// #495: we probably got a click event while a lazy load is pending.\n\t\t\t\t\t\t// The 'expanded' state is not yet set, so 'toggle' would expand\n\t\t\t\t\t\t// and trigger lazyLoad again.\n\t\t\t\t\t\t// It would be better to allow to collapse/expand the status node\n\t\t\t\t\t\t// while loading (instead of ignoring), but that would require some\n\t\t\t\t\t\t// more work.\n\t\t\t\t\t\tnode.debug(\"Got 2nd click while loading: ignored\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Clicking the expander icon always expands/collapses\n\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t} else if (targetType === \"checkbox\") {\n\t\t\t\t\t// Clicking the checkbox always (de)selects\n\t\t\t\t\tthis._callHook(\"nodeToggleSelected\", ctx);\n\t\t\t\t\tif (ctx.options.focusOnSelect) {\n\t\t\t\t\t\t// #358\n\t\t\t\t\t\tthis._callHook(\"nodeSetFocus\", ctx, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Honor `clickFolderMode` for\n\t\t\t\t\texpand = false;\n\t\t\t\t\tactivate = true;\n\t\t\t\t\tif (node.folder) {\n\t\t\t\t\t\tswitch (ctx.options.clickFolderMode) {\n\t\t\t\t\t\t\tcase 2: // expand only\n\t\t\t\t\t\t\t\texpand = true;\n\t\t\t\t\t\t\t\tactivate = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3: // expand and activate\n\t\t\t\t\t\t\t\tactivate = true;\n\t\t\t\t\t\t\t\texpand = true; //!node.isExpanded();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// else 1 or 4: just activate\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (activate) {\n\t\t\t\t\t\tthis.nodeSetFocus(ctx);\n\t\t\t\t\t\tthis._callHook(\"nodeSetActive\", ctx, true);\n\t\t\t\t\t}\n\t\t\t\t\tif (expand) {\n\t\t\t\t\t\tif (!activate) {\n\t\t\t\t\t\t\t// this._callHook(\"nodeSetFocus\", ctx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// this._callHook(\"nodeSetExpanded\", ctx, true);\n\t\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Make sure that clicks stop, otherwise <a href='#'> jumps to the top\n\t\t\t\t// if(event.target.localName === \"a\" && event.target.className === \"fancytree-title\"){\n\t\t\t\t// \tevent.preventDefault();\n\t\t\t\t// }\n\t\t\t\t// TODO: return promise?\n\t\t\t},\n\t\t\t/** Collapse all other children of same parent.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object} callOpts\n\t\t\t */\n\t\t\tnodeCollapseSiblings: function (ctx, callOpts) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tvar ac,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tnode = ctx.node;\n\n\t\t\t\tif (node.parent) {\n\t\t\t\t\tac = node.parent.children;\n\t\t\t\t\tfor (i = 0, l = ac.length; i < l; i++) {\n\t\t\t\t\t\tif (ac[i] !== node && ac[i].expanded) {\n\t\t\t\t\t\t\tthis._callHook(\n\t\t\t\t\t\t\t\t\"nodeSetExpanded\",\n\t\t\t\t\t\t\t\tac[i],\n\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\tcallOpts\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Default handling for mouse douleclick events.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeDblclick: function (ctx) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tif (\n\t\t\t\t\tctx.targetType === \"title\" &&\n\t\t\t\t\tctx.options.clickFolderMode === 4\n\t\t\t\t) {\n\t\t\t\t\t// this.nodeSetFocus(ctx);\n\t\t\t\t\t// this._callHook(\"nodeSetActive\", ctx, true);\n\t\t\t\t\tthis._callHook(\"nodeToggleExpanded\", ctx);\n\t\t\t\t}\n\t\t\t\t// TODO: prevent text selection on dblclicks\n\t\t\t\tif (ctx.targetType === \"title\") {\n\t\t\t\t\tctx.originalEvent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Default handling for mouse keydown events.\n\t\t\t *\n\t\t\t * NOTE: this may be called with node == null if tree (but no node) has focus.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeKeydown: function (ctx) {\n\t\t\t\t// TODO: return promise?\n\t\t\t\tvar matchNode,\n\t\t\t\t\tstamp,\n\t\t\t\t\t_res,\n\t\t\t\t\tfocusNode,\n\t\t\t\t\tevent = ctx.originalEvent,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\twhich = event.which,\n\t\t\t\t\t// #909: Use event.key, to get unicode characters.\n\t\t\t\t\t// We can't use `/\\w/.test(key)`, because that would\n\t\t\t\t\t// only detect plain ascii alpha-numerics. But we still need\n\t\t\t\t\t// to ignore modifier-only, whitespace, cursor-keys, etc.\n\t\t\t\t\tkey = event.key || String.fromCharCode(which),\n\t\t\t\t\tspecialModifiers = !!(\n\t\t\t\t\t\tevent.altKey ||\n\t\t\t\t\t\tevent.ctrlKey ||\n\t\t\t\t\t\tevent.metaKey\n\t\t\t\t\t),\n\t\t\t\t\tisAlnum =\n\t\t\t\t\t\t!MODIFIERS[which] &&\n\t\t\t\t\t\t!SPECIAL_KEYCODES[which] &&\n\t\t\t\t\t\t!specialModifiers,\n\t\t\t\t\t$target = $(event.target),\n\t\t\t\t\thandled = true,\n\t\t\t\t\tactivate = !(event.ctrlKey || !opts.autoActivate);\n\n\t\t\t\t// (node || FT).debug(\"ftnode.nodeKeydown(\" + event.type + \"): ftnode:\" + this + \", charCode:\" + event.charCode + \", keyCode: \" + event.keyCode + \", which: \" + event.which);\n\t\t\t\t// FT.debug( \"eventToString(): \" + FT.eventToString(event) + \", key='\" + key + \"', isAlnum: \" + isAlnum );\n\n\t\t\t\t// Set focus to active (or first node) if no other node has the focus yet\n\t\t\t\tif (!node) {\n\t\t\t\t\tfocusNode = this.getActiveNode() || this.getFirstChild();\n\t\t\t\t\tif (focusNode) {\n\t\t\t\t\t\tfocusNode.setFocus();\n\t\t\t\t\t\tnode = ctx.node = this.focusNode;\n\t\t\t\t\t\tnode.debug(\"Keydown force focus on active node\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\topts.quicksearch &&\n\t\t\t\t\tisAlnum &&\n\t\t\t\t\t!$target.is(\":input:enabled\")\n\t\t\t\t) {\n\t\t\t\t\t// Allow to search for longer streaks if typed in quickly\n\t\t\t\t\tstamp = Date.now();\n\t\t\t\t\tif (stamp - tree.lastQuicksearchTime > 500) {\n\t\t\t\t\t\ttree.lastQuicksearchTerm = \"\";\n\t\t\t\t\t}\n\t\t\t\t\ttree.lastQuicksearchTime = stamp;\n\t\t\t\t\ttree.lastQuicksearchTerm += key;\n\t\t\t\t\t// tree.debug(\"quicksearch find\", tree.lastQuicksearchTerm);\n\t\t\t\t\tmatchNode = tree.findNextNode(\n\t\t\t\t\t\ttree.lastQuicksearchTerm,\n\t\t\t\t\t\ttree.getActiveNode()\n\t\t\t\t\t);\n\t\t\t\t\tif (matchNode) {\n\t\t\t\t\t\tmatchNode.setActive();\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tswitch (FT.eventToString(event)) {\n\t\t\t\t\tcase \"+\":\n\t\t\t\t\tcase \"=\": // 187: '+' @ Chrome, Safari\n\t\t\t\t\t\ttree.nodeSetExpanded(ctx, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\ttree.nodeSetExpanded(ctx, false);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"space\":\n\t\t\t\t\t\tif (node.isPagingNode()) {\n\t\t\t\t\t\t\ttree._triggerNodeEvent(\"clickPaging\", ctx, event);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tFT.evalOption(\"checkbox\", node, node, opts, false)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// #768\n\t\t\t\t\t\t\ttree.nodeToggleSelected(ctx);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"return\":\n\t\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"home\":\n\t\t\t\t\tcase \"end\":\n\t\t\t\t\tcase \"backspace\":\n\t\t\t\t\tcase \"left\":\n\t\t\t\t\tcase \"right\":\n\t\t\t\t\tcase \"up\":\n\t\t\t\t\tcase \"down\":\n\t\t\t\t\t\t_res = node.navigate(event.which, activate);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\thandled = false;\n\t\t\t\t}\n\t\t\t\tif (handled) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// /** Default handling for mouse keypress events. */\n\t\t\t// nodeKeypress: function(ctx) {\n\t\t\t// var event = ctx.originalEvent;\n\t\t\t// },\n\n\t\t\t// /** Trigger lazyLoad event (async). */\n\t\t\t// nodeLazyLoad: function(ctx) {\n\t\t\t// var node = ctx.node;\n\t\t\t// if(this._triggerNodeEvent())\n\t\t\t// },\n\t\t\t/** Load child nodes (async).\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object[]|object|string|$.Promise|function} source\n\t\t\t * @returns {$.Promise} The deferred will be resolved as soon as the (ajax)\n\t\t\t * data was rendered.\n\t\t\t */\n\t\t\tnodeLoadChildren: function (ctx, source) {\n\t\t\t\tvar ajax,\n\t\t\t\t\tdelay,\n\t\t\t\t\tajaxDfd = null,\n\t\t\t\t\tresultDfd,\n\t\t\t\t\tisAsync = true,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\tnodePrevParent = node.parent,\n\t\t\t\t\ttag = \"nodeLoadChildren\",\n\t\t\t\t\trequestId = Date.now();\n\n\t\t\t\t// `source` is a callback: use the returned result instead:\n\t\t\t\tif (_isFunction(source)) {\n\t\t\t\t\tsource = source.call(tree, { type: \"source\" }, ctx);\n\t\t\t\t\t_assert(\n\t\t\t\t\t\t!_isFunction(source),\n\t\t\t\t\t\t\"source callback must not return another function\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// `source` is already a promise:\n\t\t\t\tif (_isFunction(source.then)) {\n\t\t\t\t\t// _assert(_isFunction(source.always), \"Expected jQuery?\");\n\t\t\t\t\tajaxDfd = source;\n\t\t\t\t} else if (source.url) {\n\t\t\t\t\t// `source` is an Ajax options object\n\t\t\t\t\tajax = $.extend({}, ctx.options.ajax, source);\n\t\t\t\t\tif (ajax.debugDelay) {\n\t\t\t\t\t\t// Simulate a slow server\n\t\t\t\t\t\tdelay = ajax.debugDelay;\n\t\t\t\t\t\tdelete ajax.debugDelay; // remove debug option\n\t\t\t\t\t\tif (_isArray(delay)) {\n\t\t\t\t\t\t\t// random delay range [min..max]\n\t\t\t\t\t\t\tdelay =\n\t\t\t\t\t\t\t\tdelay[0] +\n\t\t\t\t\t\t\t\tMath.random() * (delay[1] - delay[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"nodeLoadChildren waiting debugDelay \" +\n\t\t\t\t\t\t\t\tMath.round(delay) +\n\t\t\t\t\t\t\t\t\" ms ...\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tajaxDfd = $.Deferred(function (ajaxDfd) {\n\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t$.ajax(ajax)\n\t\t\t\t\t\t\t\t\t.done(function () {\n\t\t\t\t\t\t\t\t\t\tajaxDfd.resolveWith(this, arguments);\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.fail(function () {\n\t\t\t\t\t\t\t\t\t\tajaxDfd.rejectWith(this, arguments);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}, delay);\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tajaxDfd = $.ajax(ajax);\n\t\t\t\t\t}\n\t\t\t\t} else if ($.isPlainObject(source) || _isArray(source)) {\n\t\t\t\t\t// `source` is already a constant dict or list, but we convert\n\t\t\t\t\t// to a thenable for unified processing.\n\t\t\t\t\t// 2020-01-03: refactored.\n\t\t\t\t\t// `ajaxDfd = $.when(source)` would do the trick, but the returned\n\t\t\t\t\t// promise will resolve async, which broke some tests and\n\t\t\t\t\t// would probably also break current implementations out there.\n\t\t\t\t\t// So we mock-up a thenable that resolves synchronously:\n\t\t\t\t\tajaxDfd = {\n\t\t\t\t\t\tthen: function (resolve, reject) {\n\t\t\t\t\t\t\tresolve(source, null, null);\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tisAsync = false;\n\t\t\t\t} else {\n\t\t\t\t\t$.error(\"Invalid source type: \" + source);\n\t\t\t\t}\n\n\t\t\t\t// Check for overlapping requests\n\t\t\t\tif (node._requestId) {\n\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\"Recursive load request #\" +\n\t\t\t\t\t\t\trequestId +\n\t\t\t\t\t\t\t\" while #\" +\n\t\t\t\t\t\t\tnode._requestId +\n\t\t\t\t\t\t\t\" is pending.\"\n\t\t\t\t\t);\n\t\t\t\t\tnode._requestId = requestId;\n\t\t\t\t\t// \tnode.debug(\"Send load request #\" + requestId);\n\t\t\t\t}\n\n\t\t\t\tif (isAsync) {\n\t\t\t\t\ttree.debugTime(tag);\n\t\t\t\t\ttree.nodeSetStatus(ctx, \"loading\");\n\t\t\t\t}\n\n\t\t\t\t// The async Ajax request has now started...\n\t\t\t\t// Defer the deferred:\n\t\t\t\t// we want to be able to reject invalid responses, even if\n\t\t\t\t// the raw HTTP Ajax XHR resolved as Ok.\n\t\t\t\t// We use the ajaxDfd.then() syntax here, which is compatible with\n\t\t\t\t// jQuery and ECMA6.\n\t\t\t\t// However resultDfd is a jQuery deferred, which is currently the\n\t\t\t\t// expected result type of nodeLoadChildren()\n\t\t\t\tresultDfd = new $.Deferred();\n\t\t\t\tajaxDfd.then(\n\t\t\t\t\tfunction (data, textStatus, jqXHR) {\n\t\t\t\t\t\t// ajaxDfd was resolved, but we reject or resolve resultDfd\n\t\t\t\t\t\t// depending on the response data\n\t\t\t\t\t\tvar errorObj, res;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(source.dataType === \"json\" ||\n\t\t\t\t\t\t\t\tsource.dataType === \"jsonp\") &&\n\t\t\t\t\t\t\ttypeof data === \"string\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\t\"Ajax request returned a string (did you get the JSON dataType wrong?).\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node._requestId && node._requestId > requestId) {\n\t\t\t\t\t\t\t// The expected request time stamp is later than `requestId`\n\t\t\t\t\t\t\t// (which was kept as as closure variable to this handler function)\n\t\t\t\t\t\t\t// node.warn(\"Ignored load response for obsolete request #\" + requestId + \" (expected #\" + node._requestId + \")\");\n\t\t\t\t\t\t\tresultDfd.rejectWith(this, [\n\t\t\t\t\t\t\t\tRECURSIVE_REQUEST_ERROR,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tnode.debug(\"Response returned for load request #\" + requestId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node.parent === null && nodePrevParent !== null) {\n\t\t\t\t\t\t\tresultDfd.rejectWith(this, [\n\t\t\t\t\t\t\t\tINVALID_REQUEST_TARGET_ERROR,\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Allow to adjust the received response data in the `postProcess` event.\n\t\t\t\t\t\tif (ctx.options.postProcess) {\n\t\t\t\t\t\t\t// The handler may either\n\t\t\t\t\t\t\t// - modify `ctx.response` in-place (and leave `ctx.result` undefined)\n\t\t\t\t\t\t\t// => res = undefined\n\t\t\t\t\t\t\t// - return a replacement in `ctx.result`\n\t\t\t\t\t\t\t// => res = <new data>\n\t\t\t\t\t\t\t// If res contains an `error` property, an error status is displayed\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tres = tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\"postProcess\",\n\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\tctx.originalEvent,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tresponse: data,\n\t\t\t\t\t\t\t\t\t\terror: null,\n\t\t\t\t\t\t\t\t\t\tdataType: source.dataType,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif (res.error) {\n\t\t\t\t\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\t\t\t\t\"postProcess returned error:\",\n\t\t\t\t\t\t\t\t\t\tres\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\tres = {\n\t\t\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\t\t\tmessage: \"\" + e,\n\t\t\t\t\t\t\t\t\tdetails: \"postProcess failed\",\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res.error) {\n\t\t\t\t\t\t\t\t// Either postProcess failed with an exception, or the returned\n\t\t\t\t\t\t\t\t// result object has an 'error' property attached:\n\t\t\t\t\t\t\t\terrorObj = $.isPlainObject(res.error)\n\t\t\t\t\t\t\t\t\t? res.error\n\t\t\t\t\t\t\t\t\t: { message: res.error };\n\t\t\t\t\t\t\t\terrorObj = tree._makeHookContext(\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\terrorObj\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tresultDfd.rejectWith(this, [errorObj]);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t_isArray(res) ||\n\t\t\t\t\t\t\t\t($.isPlainObject(res) && _isArray(res.children))\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// Use `ctx.result` if valid\n\t\t\t\t\t\t\t\t// (otherwise use existing data, which may have been modified in-place)\n\t\t\t\t\t\t\t\tdata = res;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tdata &&\n\t\t\t\t\t\t\t_hasProp(data, \"d\") &&\n\t\t\t\t\t\t\tctx.options.enableAspx\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Process ASPX WebMethod JSON object inside \"d\" property\n\t\t\t\t\t\t\t// (only if no postProcess event was defined)\n\t\t\t\t\t\t\tif (ctx.options.enableAspx === 42) {\n\t\t\t\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\t\t\t\"The default for enableAspx will change to `false` in the fututure. \" +\n\t\t\t\t\t\t\t\t\t\t\"Pass `enableAspx: true` or implement postProcess to silence this warning.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdata =\n\t\t\t\t\t\t\t\ttypeof data.d === \"string\"\n\t\t\t\t\t\t\t\t\t? $.parseJSON(data.d)\n\t\t\t\t\t\t\t\t\t: data.d;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresultDfd.resolveWith(this, [data]);\n\t\t\t\t\t},\n\t\t\t\t\tfunction (jqXHR, textStatus, errorThrown) {\n\t\t\t\t\t\t// ajaxDfd was rejected, so we reject resultDfd as well\n\t\t\t\t\t\tvar errorObj = tree._makeHookContext(node, null, {\n\t\t\t\t\t\t\terror: jqXHR,\n\t\t\t\t\t\t\targs: Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\tmessage: errorThrown,\n\t\t\t\t\t\t\tdetails: jqXHR.status + \": \" + errorThrown,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresultDfd.rejectWith(this, [errorObj]);\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// The async Ajax request has now started.\n\t\t\t\t// resultDfd will be resolved/rejected after the response arrived,\n\t\t\t\t// was postProcessed, and checked.\n\t\t\t\t// Now we implement the UI update and add the data to the tree.\n\t\t\t\t// We also return this promise to the caller.\n\t\t\t\tresultDfd\n\t\t\t\t\t.done(function (data) {\n\t\t\t\t\t\ttree.nodeSetStatus(ctx, \"ok\");\n\t\t\t\t\t\tvar children, metaData, noDataRes;\n\n\t\t\t\t\t\tif ($.isPlainObject(data)) {\n\t\t\t\t\t\t\t// We got {foo: 'abc', children: [...]}\n\t\t\t\t\t\t\t// Copy extra properties to tree.data.foo\n\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\tnode.isRootNode(),\n\t\t\t\t\t\t\t\t\"source may only be an object for root nodes (expecting an array of child objects otherwise)\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\t_isArray(data.children),\n\t\t\t\t\t\t\t\t\"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tmetaData = data;\n\t\t\t\t\t\t\tchildren = data.children;\n\t\t\t\t\t\t\tdelete metaData.children;\n\t\t\t\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\t\t\t\tif (metaData[attr] !== undefined) {\n\t\t\t\t\t\t\t\t\ttree[attr] = metaData[attr];\n\t\t\t\t\t\t\t\t\tdelete metaData[attr];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// Copy all other attributes to tree.data.NAME\n\t\t\t\t\t\t\t$.extend(tree.data, metaData);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchildren = data;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t_isArray(children),\n\t\t\t\t\t\t\t\"expected array of children\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._setChildren(children);\n\n\t\t\t\t\t\tif (tree.options.nodata && children.length === 0) {\n\t\t\t\t\t\t\tif (_isFunction(tree.options.nodata)) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.nodata.call(\n\t\t\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t\t\t{ type: \"nodata\" },\n\t\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\ttree.options.nodata === true &&\n\t\t\t\t\t\t\t\tnode.isRootNode()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.strings.noData;\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\ttypeof tree.options.nodata === \"string\" &&\n\t\t\t\t\t\t\t\tnode.isRootNode()\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnoDataRes = tree.options.nodata;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (noDataRes) {\n\t\t\t\t\t\t\t\tnode.setStatus(\"nodata\", noDataRes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// trigger fancytreeloadchildren\n\t\t\t\t\t\ttree._triggerNodeEvent(\"loadChildren\", node);\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function (error) {\n\t\t\t\t\t\tvar ctxErr;\n\n\t\t\t\t\t\tif (error === RECURSIVE_REQUEST_ERROR) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"Ignored response for obsolete load request #\" +\n\t\t\t\t\t\t\t\t\trequestId +\n\t\t\t\t\t\t\t\t\t\" (expected #\" +\n\t\t\t\t\t\t\t\t\tnode._requestId +\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (error === INVALID_REQUEST_TARGET_ERROR) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"Lazy parent node was removed while loading: discarding response.\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (error.node && error.error && error.message) {\n\t\t\t\t\t\t\t// error is already a context object\n\t\t\t\t\t\t\tctxErr = error;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctxErr = tree._makeHookContext(node, null, {\n\t\t\t\t\t\t\t\terror: error, // it can be jqXHR or any custom error\n\t\t\t\t\t\t\t\targs: Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\t\tmessage: error\n\t\t\t\t\t\t\t\t\t? error.message || error.toString()\n\t\t\t\t\t\t\t\t\t: \"\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (ctxErr.message === \"[object Object]\") {\n\t\t\t\t\t\t\t\tctxErr.message = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"Load children failed (\" + ctxErr.message + \")\",\n\t\t\t\t\t\t\tctxErr\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\"loadError\",\n\t\t\t\t\t\t\t\tctxErr,\n\t\t\t\t\t\t\t\tnull\n\t\t\t\t\t\t\t) !== false\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\ttree.nodeSetStatus(\n\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t\t\tctxErr.message,\n\t\t\t\t\t\t\t\tctxErr.details\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.always(function () {\n\t\t\t\t\t\tnode._requestId = null;\n\t\t\t\t\t\tif (isAsync) {\n\t\t\t\t\t\t\ttree.debugTimeEnd(tag);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\treturn resultDfd.promise();\n\t\t\t},\n\t\t\t/** [Not Implemented] */\n\t\t\tnodeLoadKeyPath: function (ctx, keyPathList) {\n\t\t\t\t// TODO: implement and improve\n\t\t\t\t// http://code.google.com/p/dynatree/issues/detail?id=222\n\t\t\t},\n\t\t\t/**\n\t\t\t * Remove a single direct child of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {FancytreeNode} childNode dircect child of ctx.node\n\t\t\t */\n\t\t\tnodeRemoveChild: function (ctx, childNode) {\n\t\t\t\tvar idx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\t// opts = ctx.options,\n\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: childNode }),\n\t\t\t\t\tchildren = node.children;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChild()\", node.toString(), childNode.toString());\n\n\t\t\t\tif (children.length === 1) {\n\t\t\t\t\t_assert(childNode === children[0], \"invalid single child\");\n\t\t\t\t\treturn this.nodeRemoveChildren(ctx);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.activeNode &&\n\t\t\t\t\t(childNode === this.activeNode ||\n\t\t\t\t\t\tthis.activeNode.isDescendantOf(childNode))\n\t\t\t\t) {\n\t\t\t\t\tthis.activeNode.setActive(false); // TODO: don't fire events\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tthis.focusNode &&\n\t\t\t\t\t(childNode === this.focusNode ||\n\t\t\t\t\t\tthis.focusNode.isDescendantOf(childNode))\n\t\t\t\t) {\n\t\t\t\t\tthis.focusNode = null;\n\t\t\t\t}\n\t\t\t\t// TODO: persist must take care to clear select and expand cookies\n\t\t\t\tthis.nodeRemoveMarkup(subCtx);\n\t\t\t\tthis.nodeRemoveChildren(subCtx);\n\t\t\t\tidx = $.inArray(childNode, children);\n\t\t\t\t_assert(idx >= 0, \"invalid child\");\n\t\t\t\t// Notify listeners\n\t\t\t\tnode.triggerModifyChild(\"remove\", childNode);\n\t\t\t\t// Unlink to support GC\n\t\t\t\tchildNode.visit(function (n) {\n\t\t\t\t\tn.parent = null;\n\t\t\t\t}, true);\n\t\t\t\tthis._callHook(\"treeRegisterNode\", this, false, childNode);\n\t\t\t\t// remove from child list\n\t\t\t\tchildren.splice(idx, 1);\n\t\t\t},\n\t\t\t/**Remove HTML markup for all descendents of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveChildMarkup: function (ctx) {\n\t\t\t\tvar node = ctx.node;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChildMarkup()\", node.toString());\n\t\t\t\t// TODO: Unlink attr.ftnode to support GC\n\t\t\t\tif (node.ul) {\n\t\t\t\t\tif (node.isRootNode()) {\n\t\t\t\t\t\t$(node.ul).empty();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(node.ul).remove();\n\t\t\t\t\t\tnode.ul = null;\n\t\t\t\t\t}\n\t\t\t\t\tnode.visit(function (n) {\n\t\t\t\t\t\tn.li = n.ul = null;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**Remove all descendants of ctx.node.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveChildren: function (ctx) {\n\t\t\t\tvar //subCtx,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\tchildren = node.children;\n\t\t\t\t// opts = ctx.options;\n\n\t\t\t\t// FT.debug(\"nodeRemoveChildren()\", node.toString());\n\t\t\t\tif (!children) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this.activeNode && this.activeNode.isDescendantOf(node)) {\n\t\t\t\t\tthis.activeNode.setActive(false); // TODO: don't fire events\n\t\t\t\t}\n\t\t\t\tif (this.focusNode && this.focusNode.isDescendantOf(node)) {\n\t\t\t\t\tthis.focusNode = null;\n\t\t\t\t}\n\t\t\t\t// TODO: persist must take care to clear select and expand cookies\n\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t\t// Unlink children to support GC\n\t\t\t\t// TODO: also delete this.children (not possible using visit())\n\t\t\t\t// subCtx = $.extend({}, ctx);\n\t\t\t\tnode.triggerModifyChild(\"remove\", null);\n\t\t\t\tnode.visit(function (n) {\n\t\t\t\t\tn.parent = null;\n\t\t\t\t\ttree._callHook(\"treeRegisterNode\", tree, false, n);\n\t\t\t\t});\n\t\t\t\tif (node.lazy) {\n\t\t\t\t\t// 'undefined' would be interpreted as 'not yet loaded' for lazy nodes\n\t\t\t\t\tnode.children = [];\n\t\t\t\t} else {\n\t\t\t\t\tnode.children = null;\n\t\t\t\t}\n\t\t\t\tif (!node.isRootNode()) {\n\t\t\t\t\tnode.expanded = false; // #449, #459\n\t\t\t\t}\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t},\n\t\t\t/**Remove HTML markup for ctx.node and all its descendents.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRemoveMarkup: function (ctx) {\n\t\t\t\tvar node = ctx.node;\n\t\t\t\t// FT.debug(\"nodeRemoveMarkup()\", node.toString());\n\t\t\t\t// TODO: Unlink attr.ftnode to support GC\n\t\t\t\tif (node.li) {\n\t\t\t\t\t$(node.li).remove();\n\t\t\t\t\tnode.li = null;\n\t\t\t\t}\n\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Create `<li><span>..</span> .. </li>` tags for this node.\n\t\t\t *\n\t\t\t * This method takes care that all HTML markup is created that is required\n\t\t\t * to display this node in its current state.\n\t\t\t *\n\t\t\t * Call this method to create new nodes, or after the strucuture\n\t\t\t * was changed (e.g. after moving this node or adding/removing children)\n\t\t\t * nodeRenderTitle() and nodeRenderStatus() are implied.\n\t\t\t *\n\t\t\t * ```html\n\t\t\t * <li id='KEY' ftnode=NODE>\n\t\t\t * <span class='fancytree-node fancytree-expanded fancytree-has-children fancytree-lastsib fancytree-exp-el fancytree-ico-e'>\n\t\t\t * <span class=\"fancytree-expander\"></span>\n\t\t\t * <span class=\"fancytree-checkbox\"></span> // only present in checkbox mode\n\t\t\t * <span class=\"fancytree-icon\"></span>\n\t\t\t * <a href=\"#\" class=\"fancytree-title\"> Node 1 </a>\n\t\t\t * </span>\n\t\t\t * <ul> // only present if node has children\n\t\t\t * <li id='KEY' ftnode=NODE> child1 ... </li>\n\t\t\t * <li id='KEY' ftnode=NODE> child2 ... </li>\n\t\t\t * </ul>\n\t\t\t * </li>\n\t\t\t * ```\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [force=false] re-render, even if html markup was already created\n\t\t\t * @param {boolean} [deep=false] also render all descendants, even if parent is collapsed\n\t\t\t * @param {boolean} [collapsed=false] force root node to be collapsed, so we can apply animated expand later\n\t\t\t */\n\t\t\tnodeRender: function (ctx, force, deep, collapsed, _recursive) {\n\t\t\t\t/* This method must take care of all cases where the current data mode\n\t\t\t\t * (i.e. node hierarchy) does not match the current markup.\n\t\t\t\t *\n\t\t\t\t * - node was not yet rendered:\n\t\t\t\t * create markup\n\t\t\t\t * - node was rendered: exit fast\n\t\t\t\t * - children have been added\n\t\t\t\t * - children have been removed\n\t\t\t\t */\n\t\t\t\tvar childLI,\n\t\t\t\t\tchildNode1,\n\t\t\t\t\tchildNode2,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tnext,\n\t\t\t\t\tsubCtx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tfirstTime = false,\n\t\t\t\t\tparent = node.parent,\n\t\t\t\t\tisRootNode = !parent,\n\t\t\t\t\tchildren = node.children,\n\t\t\t\t\tsuccessorLi = null;\n\t\t\t\t// FT.debug(\"nodeRender(\" + !!force + \", \" + !!deep + \")\", node.toString());\n\n\t\t\t\tif (tree._enableUpdate === false) {\n\t\t\t\t\t// tree.debug(\"no render\", tree._enableUpdate);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!isRootNode && !parent.ul) {\n\t\t\t\t\t// Calling node.collapse on a deep, unrendered node\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t_assert(isRootNode || parent.ul, \"parent UL must exist\");\n\n\t\t\t\t// Render the node\n\t\t\t\tif (!isRootNode) {\n\t\t\t\t\t// Discard markup on force-mode, or if it is not linked to parent <ul>\n\t\t\t\t\tif (\n\t\t\t\t\t\tnode.li &&\n\t\t\t\t\t\t(force || node.li.parentNode !== node.parent.ul)\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (node.li.parentNode === node.parent.ul) {\n\t\t\t\t\t\t\t// #486: store following node, so we can insert the new markup there later\n\t\t\t\t\t\t\tsuccessorLi = node.li.nextSibling;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// May happen, when a top-level node was dropped over another\n\t\t\t\t\t\t\tthis.debug(\n\t\t\t\t\t\t\t\t\"Unlinking \" +\n\t\t\t\t\t\t\t\t\tnode +\n\t\t\t\t\t\t\t\t\t\" (must be child of \" +\n\t\t\t\t\t\t\t\t\tnode.parent +\n\t\t\t\t\t\t\t\t\t\")\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//\t this.debug(\"nodeRemoveMarkup...\");\n\t\t\t\t\t\tthis.nodeRemoveMarkup(ctx);\n\t\t\t\t\t}\n\t\t\t\t\t// Create <li><span /> </li>\n\t\t\t\t\t// node.debug(\"render...\");\n\t\t\t\t\tif (node.li) {\n\t\t\t\t\t\t// this.nodeRenderTitle(ctx);\n\t\t\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// node.debug(\"render... really\");\n\t\t\t\t\t\tfirstTime = true;\n\t\t\t\t\t\tnode.li = document.createElement(\"li\");\n\t\t\t\t\t\tnode.li.ftnode = node;\n\n\t\t\t\t\t\tif (node.key && opts.generateIds) {\n\t\t\t\t\t\t\tnode.li.id = opts.idPrefix + node.key;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.span = document.createElement(\"span\");\n\t\t\t\t\t\tnode.span.className = \"fancytree-node\";\n\t\t\t\t\t\tif (aria && !node.tr) {\n\t\t\t\t\t\t\t$(node.li).attr(\"role\", \"treeitem\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.li.appendChild(node.span);\n\n\t\t\t\t\t\t// Create inner HTML for the <span> (expander, checkbox, icon, and title)\n\t\t\t\t\t\tthis.nodeRenderTitle(ctx);\n\n\t\t\t\t\t\t// Allow tweaking and binding, after node was created for the first time\n\t\t\t\t\t\tif (opts.createNode) {\n\t\t\t\t\t\t\topts.createNode.call(\n\t\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t\t{ type: \"createNode\" },\n\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Allow tweaking after node state was rendered\n\t\t\t\t\tif (opts.renderNode) {\n\t\t\t\t\t\topts.renderNode.call(tree, { type: \"renderNode\" }, ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Visit child nodes\n\t\t\t\tif (children) {\n\t\t\t\t\tif (isRootNode || node.expanded || deep === true) {\n\t\t\t\t\t\t// Create a UL to hold the children\n\t\t\t\t\t\tif (!node.ul) {\n\t\t\t\t\t\t\tnode.ul = document.createElement(\"ul\");\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(collapsed === true && !_recursive) ||\n\t\t\t\t\t\t\t\t!node.expanded\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// hide top UL, so we can use an animation to show it later\n\t\t\t\t\t\t\t\tnode.ul.style.display = \"none\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (aria) {\n\t\t\t\t\t\t\t\t$(node.ul).attr(\"role\", \"group\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (node.li) {\n\t\t\t\t\t\t\t\t// issue #67\n\t\t\t\t\t\t\t\tnode.li.appendChild(node.ul);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnode.tree.$div.append(node.ul);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Add child markup\n\t\t\t\t\t\tfor (i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: children[i] });\n\t\t\t\t\t\t\tthis.nodeRender(subCtx, force, deep, false, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Remove <li> if nodes have moved to another parent\n\t\t\t\t\t\tchildLI = node.ul.firstChild;\n\t\t\t\t\t\twhile (childLI) {\n\t\t\t\t\t\t\tchildNode2 = childLI.ftnode;\n\t\t\t\t\t\t\tif (childNode2 && childNode2.parent !== node) {\n\t\t\t\t\t\t\t\tnode.debug(\n\t\t\t\t\t\t\t\t\t\"_fixParent: remove missing \" + childNode2,\n\t\t\t\t\t\t\t\t\tchildLI\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tnext = childLI.nextSibling;\n\t\t\t\t\t\t\t\tchildLI.parentNode.removeChild(childLI);\n\t\t\t\t\t\t\t\tchildLI = next;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tchildLI = childLI.nextSibling;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Make sure, that <li> order matches node.children order.\n\t\t\t\t\t\tchildLI = node.ul.firstChild;\n\t\t\t\t\t\tfor (i = 0, l = children.length - 1; i < l; i++) {\n\t\t\t\t\t\t\tchildNode1 = children[i];\n\t\t\t\t\t\t\tchildNode2 = childLI.ftnode;\n\t\t\t\t\t\t\tif (childNode1 === childNode2) {\n\t\t\t\t\t\t\t\tchildLI = childLI.nextSibling;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// node.debug(\"_fixOrder: mismatch at index \" + i + \": \" + childNode1 + \" != \" + childNode2);\n\t\t\t\t\t\t\t\tnode.ul.insertBefore(\n\t\t\t\t\t\t\t\t\tchildNode1.li,\n\t\t\t\t\t\t\t\t\tchildNode2.li\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No children: remove markup if any\n\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\t// alert(\"remove child markup for \" + node);\n\t\t\t\t\t\tthis.warn(\"remove child markup for \" + node);\n\t\t\t\t\t\tthis.nodeRemoveChildMarkup(ctx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isRootNode) {\n\t\t\t\t\t// Update element classes according to node state\n\t\t\t\t\t// this.nodeRenderStatus(ctx);\n\t\t\t\t\t// Finally add the whole structure to the DOM, so the browser can render\n\t\t\t\t\tif (firstTime) {\n\t\t\t\t\t\t// #486: successorLi is set, if we re-rendered (i.e. discarded)\n\t\t\t\t\t\t// existing markup, which we want to insert at the same position.\n\t\t\t\t\t\t// (null is equivalent to append)\n\t\t\t\t\t\t// \t\tparent.ul.appendChild(node.li);\n\t\t\t\t\t\tparent.ul.insertBefore(node.li, successorLi);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Create HTML inside the node's outer `<span>` (i.e. expander, checkbox,\n\t\t\t * icon, and title).\n\t\t\t *\n\t\t\t * nodeRenderStatus() is implied.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {string} [title] optinal new title\n\t\t\t */\n\t\t\tnodeRenderTitle: function (ctx, title) {\n\t\t\t\t// set node connector images, links and text\n\t\t\t\tvar checkbox,\n\t\t\t\t\tclassName,\n\t\t\t\t\ticon,\n\t\t\t\t\tnodeTitle,\n\t\t\t\t\trole,\n\t\t\t\t\ttabindex,\n\t\t\t\t\ttooltip,\n\t\t\t\t\ticonTooltip,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tlevel = node.getLevel(),\n\t\t\t\t\tares = [];\n\n\t\t\t\tif (title !== undefined) {\n\t\t\t\t\tnode.title = title;\n\t\t\t\t}\n\t\t\t\tif (!node.span || tree._enableUpdate === false) {\n\t\t\t\t\t// Silently bail out if node was not rendered yet, assuming\n\t\t\t\t\t// node.render() will be called as the node becomes visible\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Connector (expanded, expandable or simple)\n\t\t\t\trole =\n\t\t\t\t\taria && node.hasChildren() !== false\n\t\t\t\t\t\t? \" role='button'\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\tif (level < opts.minExpandLevel) {\n\t\t\t\t\tif (!node.lazy) {\n\t\t\t\t\t\tnode.expanded = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (level > 1) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-expander fancytree-expander-fixed'></span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// .. else (i.e. for root level) skip expander/connector alltogether\n\t\t\t\t} else {\n\t\t\t\t\tares.push(\n\t\t\t\t\t\t\"<span \" + role + \" class='fancytree-expander'></span>\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Checkbox mode\n\t\t\t\tcheckbox = FT.evalOption(\"checkbox\", node, node, opts, false);\n\n\t\t\t\tif (checkbox && !node.isStatusNode()) {\n\t\t\t\t\trole = aria ? \" role='checkbox'\" : \"\";\n\t\t\t\t\tclassName = \"fancytree-checkbox\";\n\t\t\t\t\tif (\n\t\t\t\t\t\tcheckbox === \"radio\" ||\n\t\t\t\t\t\t(node.parent && node.parent.radiogroup)\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassName += \" fancytree-radio\";\n\t\t\t\t\t}\n\t\t\t\t\tares.push(\n\t\t\t\t\t\t\"<span \" + role + \" class='\" + className + \"'></span>\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Folder or doctype icon\n\t\t\t\tif (node.data.iconClass !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\t// Handle / warn about backward compatibility\n\t\t\t\t\tif (node.icon) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\"'iconClass' node option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode.icon = node.data.iconClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If opts.icon is a callback and returns something other than undefined, use that\n\t\t\t\t// else if node.icon is a boolean or string, use that\n\t\t\t\t// else if opts.icon is a boolean or string, use that\n\t\t\t\t// else show standard icon (which may be different for folders or documents)\n\t\t\t\ticon = FT.evalOption(\"icon\", node, node, opts, true);\n\t\t\t\t// if( typeof icon !== \"boolean\" ) {\n\t\t\t\t// \t// icon is defined, but not true/false: must be a string\n\t\t\t\t// \ticon = \"\" + icon;\n\t\t\t\t// }\n\t\t\t\tif (icon !== false) {\n\t\t\t\t\trole = aria ? \" role='presentation'\" : \"\";\n\n\t\t\t\t\ticonTooltip = FT.evalOption(\n\t\t\t\t\t\t\"iconTooltip\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\topts,\n\t\t\t\t\t\tnull\n\t\t\t\t\t);\n\t\t\t\t\ticonTooltip = iconTooltip\n\t\t\t\t\t\t? \" title='\" + _escapeTooltip(iconTooltip) + \"'\"\n\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\tif (typeof icon === \"string\") {\n\t\t\t\t\t\tif (TEST_IMG.test(icon)) {\n\t\t\t\t\t\t\t// node.icon is an image url. Prepend imagePath\n\t\t\t\t\t\t\ticon =\n\t\t\t\t\t\t\t\ticon.charAt(0) === \"/\"\n\t\t\t\t\t\t\t\t\t? icon\n\t\t\t\t\t\t\t\t\t: (opts.imagePath || \"\") + icon;\n\t\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\t\"<img src='\" +\n\t\t\t\t\t\t\t\t\ticon +\n\t\t\t\t\t\t\t\t\t\"' class='fancytree-icon'\" +\n\t\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\t\" alt='' />\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t\ticon +\n\t\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\t\"></span>\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (icon.text) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t(icon.addClass || \"\") +\n\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t\t\tFT.escapeHtml(icon.text) +\n\t\t\t\t\t\t\t\t\"</span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (icon.html) {\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-custom-icon \" +\n\t\t\t\t\t\t\t\t(icon.addClass || \"\") +\n\t\t\t\t\t\t\t\t\"'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t\t\ticon.html +\n\t\t\t\t\t\t\t\t\"</span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// standard icon: theme css will take care of this\n\t\t\t\t\t\tares.push(\n\t\t\t\t\t\t\t\"<span \" +\n\t\t\t\t\t\t\t\trole +\n\t\t\t\t\t\t\t\t\" class='fancytree-icon'\" +\n\t\t\t\t\t\t\t\ticonTooltip +\n\t\t\t\t\t\t\t\t\"></span>\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Node title\n\t\t\t\tnodeTitle = \"\";\n\t\t\t\tif (opts.renderTitle) {\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\topts.renderTitle.call(\n\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t{ type: \"renderTitle\" },\n\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t) || \"\";\n\t\t\t\t}\n\t\t\t\tif (!nodeTitle) {\n\t\t\t\t\ttooltip = FT.evalOption(\"tooltip\", node, node, opts, null);\n\t\t\t\t\tif (tooltip === true) {\n\t\t\t\t\t\ttooltip = node.title;\n\t\t\t\t\t}\n\t\t\t\t\t// if( node.tooltip ) {\n\t\t\t\t\t// \ttooltip = node.tooltip;\n\t\t\t\t\t// } else if ( opts.tooltip ) {\n\t\t\t\t\t// \ttooltip = opts.tooltip === true ? node.title : opts.tooltip.call(tree, node);\n\t\t\t\t\t// }\n\t\t\t\t\ttooltip = tooltip\n\t\t\t\t\t\t? \" title='\" + _escapeTooltip(tooltip) + \"'\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\t\ttabindex = opts.titlesTabbable ? \" tabindex='0'\" : \"\";\n\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\t\"<span class='fancytree-title'\" +\n\t\t\t\t\t\ttooltip +\n\t\t\t\t\t\ttabindex +\n\t\t\t\t\t\t\">\" +\n\t\t\t\t\t\t(opts.escapeTitles\n\t\t\t\t\t\t\t? FT.escapeHtml(node.title)\n\t\t\t\t\t\t\t: node.title) +\n\t\t\t\t\t\t\"</span>\";\n\t\t\t\t}\n\t\t\t\tares.push(nodeTitle);\n\t\t\t\t// Note: this will trigger focusout, if node had the focus\n\t\t\t\t//$(node.span).html(ares.join(\"\")); // it will cleanup the jQuery data currently associated with SPAN (if any), but it executes more slowly\n\t\t\t\tnode.span.innerHTML = ares.join(\"\");\n\t\t\t\t// Update CSS classes\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\tif (opts.enhanceTitle) {\n\t\t\t\t\tctx.$title = $(\">span.fancytree-title\", node.span);\n\t\t\t\t\tnodeTitle =\n\t\t\t\t\t\topts.enhanceTitle.call(\n\t\t\t\t\t\t\ttree,\n\t\t\t\t\t\t\t{ type: \"enhanceTitle\" },\n\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t) || \"\";\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Update element classes according to node state.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeRenderStatus: function (ctx) {\n\t\t\t\t// Set classes for current status\n\t\t\t\tvar $ariaElem,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\t// \tnodeContainer = node[tree.nodeContainerAttrName],\n\t\t\t\t\thasChildren = node.hasChildren(),\n\t\t\t\t\tisLastSib = node.isLastSibling(),\n\t\t\t\t\taria = opts.aria,\n\t\t\t\t\tcn = opts._classNames,\n\t\t\t\t\tcnList = [],\n\t\t\t\t\tstatusElem = node[tree.statusClassPropName];\n\n\t\t\t\tif (!statusElem || tree._enableUpdate === false) {\n\t\t\t\t\t// if this function is called for an unrendered node, ignore it (will be updated on nect render anyway)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (aria) {\n\t\t\t\t\t$ariaElem = $(node.tr || node.li);\n\t\t\t\t}\n\t\t\t\t// Build a list of class names that we will add to the node <span>\n\t\t\t\tcnList.push(cn.node);\n\t\t\t\tif (tree.activeNode === node) {\n\t\t\t\t\tcnList.push(cn.active);\n\t\t\t\t\t// \t\t$(\">span.fancytree-title\", statusElem).attr(\"tabindex\", \"0\");\n\t\t\t\t\t// \t\ttree.$container.removeAttr(\"tabindex\");\n\t\t\t\t\t// }else{\n\t\t\t\t\t// \t\t$(\">span.fancytree-title\", statusElem).removeAttr(\"tabindex\");\n\t\t\t\t\t// \t\ttree.$container.attr(\"tabindex\", \"0\");\n\t\t\t\t}\n\t\t\t\tif (tree.focusNode === node) {\n\t\t\t\t\tcnList.push(cn.focused);\n\t\t\t\t}\n\t\t\t\tif (node.expanded) {\n\t\t\t\t\tcnList.push(cn.expanded);\n\t\t\t\t}\n\t\t\t\tif (aria) {\n\t\t\t\t\tif (hasChildren === false) {\n\t\t\t\t\t\t$ariaElem.removeAttr(\"aria-expanded\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ariaElem.attr(\"aria-expanded\", Boolean(node.expanded));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (node.folder) {\n\t\t\t\t\tcnList.push(cn.folder);\n\t\t\t\t}\n\t\t\t\tif (hasChildren !== false) {\n\t\t\t\t\tcnList.push(cn.hasChildren);\n\t\t\t\t}\n\t\t\t\t// TODO: required?\n\t\t\t\tif (isLastSib) {\n\t\t\t\t\tcnList.push(cn.lastsib);\n\t\t\t\t}\n\t\t\t\tif (node.lazy && node.children == null) {\n\t\t\t\t\tcnList.push(cn.lazy);\n\t\t\t\t}\n\t\t\t\tif (node.partload) {\n\t\t\t\t\tcnList.push(cn.partload);\n\t\t\t\t}\n\t\t\t\tif (node.partsel) {\n\t\t\t\t\tcnList.push(cn.partsel);\n\t\t\t\t}\n\t\t\t\tif (FT.evalOption(\"unselectable\", node, node, opts, false)) {\n\t\t\t\t\tcnList.push(cn.unselectable);\n\t\t\t\t}\n\t\t\t\tif (node._isLoading) {\n\t\t\t\t\tcnList.push(cn.loading);\n\t\t\t\t}\n\t\t\t\tif (node._error) {\n\t\t\t\t\tcnList.push(cn.error);\n\t\t\t\t}\n\t\t\t\tif (node.statusNodeType) {\n\t\t\t\t\tcnList.push(cn.statusNodePrefix + node.statusNodeType);\n\t\t\t\t}\n\t\t\t\tif (node.selected) {\n\t\t\t\t\tcnList.push(cn.selected);\n\t\t\t\t\tif (aria) {\n\t\t\t\t\t\t$ariaElem.attr(\"aria-selected\", true);\n\t\t\t\t\t}\n\t\t\t\t} else if (aria) {\n\t\t\t\t\t$ariaElem.attr(\"aria-selected\", false);\n\t\t\t\t}\n\t\t\t\tif (node.extraClasses) {\n\t\t\t\t\tcnList.push(node.extraClasses);\n\t\t\t\t}\n\t\t\t\t// IE6 doesn't correctly evaluate multiple class names,\n\t\t\t\t// so we create combined class names that can be used in the CSS\n\t\t\t\tif (hasChildren === false) {\n\t\t\t\t\tcnList.push(\n\t\t\t\t\t\tcn.combinedExpanderPrefix + \"n\" + (isLastSib ? \"l\" : \"\")\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tcnList.push(\n\t\t\t\t\t\tcn.combinedExpanderPrefix +\n\t\t\t\t\t\t\t(node.expanded ? \"e\" : \"c\") +\n\t\t\t\t\t\t\t(node.lazy && node.children == null ? \"d\" : \"\") +\n\t\t\t\t\t\t\t(isLastSib ? \"l\" : \"\")\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tcnList.push(\n\t\t\t\t\tcn.combinedIconPrefix +\n\t\t\t\t\t\t(node.expanded ? \"e\" : \"c\") +\n\t\t\t\t\t\t(node.folder ? \"f\" : \"\")\n\t\t\t\t);\n\t\t\t\t// node.span.className = cnList.join(\" \");\n\t\t\t\tstatusElem.className = cnList.join(\" \");\n\n\t\t\t\t// TODO: we should not set this in the <span> tag also, if we set it here:\n\t\t\t\t// Maybe most (all) of the classes should be set in LI instead of SPAN?\n\t\t\t\tif (node.li) {\n\t\t\t\t\t// #719: we have to consider that there may be already other classes:\n\t\t\t\t\t$(node.li).toggleClass(cn.lastsib, isLastSib);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Activate node.\n\t\t\t * flag defaults to true.\n\t\t\t * If flag is true, the node is activated (must be a synchronous operation)\n\t\t\t * If flag is false, the node is deactivated (must be a synchronous operation)\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false, noFocus: false}\n\t\t\t * @returns {$.Promise}\n\t\t\t */\n\t\t\tnodeSetActive: function (ctx, flag, callOpts) {\n\t\t\t\t// Handle user click / [space] / [enter], according to clickFolderMode.\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar subCtx,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true,\n\t\t\t\t\tnoFocus = callOpts.noFocus === true,\n\t\t\t\t\tscroll = callOpts.scrollIntoView !== false,\n\t\t\t\t\tisActive = node === tree.activeNode;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\t\t\t\t// node.debug(\"nodeSetActive\", flag);\n\n\t\t\t\tif (isActive === flag) {\n\t\t\t\t\t// Nothing to do\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t}\n\t\t\t\t// #1042: don't scroll between mousedown/-up when clicking an embedded link\n\t\t\t\tif (\n\t\t\t\t\tscroll &&\n\t\t\t\t\tctx.originalEvent &&\n\t\t\t\t\t$(ctx.originalEvent.target).is(\"a,:checkbox\")\n\t\t\t\t) {\n\t\t\t\t\tnode.info(\"Not scrolling while clicking an embedded link.\");\n\t\t\t\t\tscroll = false;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\tflag &&\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeActivate\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\t// Callback returned false\n\t\t\t\t\treturn _getRejectedPromise(node, [\"rejected\"]);\n\t\t\t\t}\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (tree.activeNode) {\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\ttree.activeNode !== node,\n\t\t\t\t\t\t\t\"node was active (inconsistency)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsubCtx = $.extend({}, ctx, { node: tree.activeNode });\n\t\t\t\t\t\ttree.nodeSetActive(subCtx, false);\n\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\ttree.activeNode === null,\n\t\t\t\t\t\t\t\"deactivate was out of sync?\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (opts.activeVisible) {\n\t\t\t\t\t\t// If no focus is set (noFocus: true) and there is no focused node, this node is made visible.\n\t\t\t\t\t\t// scroll = noFocus && tree.focusNode == null;\n\t\t\t\t\t\t// #863: scroll by default (unless `scrollIntoView: false` was passed)\n\t\t\t\t\t\tnode.makeVisible({ scrollIntoView: scroll });\n\t\t\t\t\t}\n\t\t\t\t\ttree.activeNode = node;\n\t\t\t\t\ttree.nodeRenderStatus(ctx);\n\t\t\t\t\tif (!noFocus) {\n\t\t\t\t\t\ttree.nodeSetFocus(ctx);\n\t\t\t\t\t}\n\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\"activate\",\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t_assert(\n\t\t\t\t\t\ttree.activeNode === node,\n\t\t\t\t\t\t\"node was not active (inconsistency)\"\n\t\t\t\t\t);\n\t\t\t\t\ttree.activeNode = null;\n\t\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\"deactivate\",\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t},\n\t\t\t/** Expand or collapse node, return Deferred.promise.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to `{noAnimation: false, noEvents: false}`\n\t\t\t * @returns {$.Promise} The deferred will be resolved as soon as the (lazy)\n\t\t\t * data was retrieved, rendered, and the expand animation finished.\n\t\t\t */\n\t\t\tnodeSetExpanded: function (ctx, flag, callOpts) {\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar _afterLoad,\n\t\t\t\t\tdfd,\n\t\t\t\t\ti,\n\t\t\t\t\tl,\n\t\t\t\t\tparents,\n\t\t\t\t\tprevAC,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoAnimation = callOpts.noAnimation === true,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// node.debug(\"nodeSetExpanded(\" + flag + \")\");\n\n\t\t\t\tif ($(node.li).hasClass(opts._classNames.animating)) {\n\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\"setExpanded(\" + flag + \") while animating: ignored.\"\n\t\t\t\t\t);\n\t\t\t\t\treturn _getRejectedPromise(node, [\"recursion\"]);\n\t\t\t\t}\n\n\t\t\t\tif ((node.expanded && flag) || (!node.expanded && !flag)) {\n\t\t\t\t\t// Nothing to do\n\t\t\t\t\t// node.debug(\"nodeSetExpanded(\" + flag + \"): nothing to do\");\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t} else if (flag && !node.lazy && !node.hasChildren()) {\n\t\t\t\t\t// Prevent expanding of empty nodes\n\t\t\t\t\t// return _getRejectedPromise(node, [\"empty\"]);\n\t\t\t\t\treturn _getResolvedPromise(node);\n\t\t\t\t} else if (!flag && node.getLevel() < opts.minExpandLevel) {\n\t\t\t\t\t// Prevent collapsing locked levels\n\t\t\t\t\treturn _getRejectedPromise(node, [\"locked\"]);\n\t\t\t\t} else if (\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeExpand\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\t// Callback returned false\n\t\t\t\t\treturn _getRejectedPromise(node, [\"rejected\"]);\n\t\t\t\t}\n\t\t\t\t// If this node inside a collpased node, no animation and scrolling is needed\n\t\t\t\tif (!noAnimation && !node.isVisible()) {\n\t\t\t\t\tnoAnimation = callOpts.noAnimation = true;\n\t\t\t\t}\n\n\t\t\t\tdfd = new $.Deferred();\n\n\t\t\t\t// Auto-collapse mode: collapse all siblings\n\t\t\t\tif (flag && !node.expanded && opts.autoCollapse) {\n\t\t\t\t\tparents = node.getParentList(false, true);\n\t\t\t\t\tprevAC = opts.autoCollapse;\n\t\t\t\t\ttry {\n\t\t\t\t\t\topts.autoCollapse = false;\n\t\t\t\t\t\tfor (i = 0, l = parents.length; i < l; i++) {\n\t\t\t\t\t\t\t// TODO: should return promise?\n\t\t\t\t\t\t\tthis._callHook(\n\t\t\t\t\t\t\t\t\"nodeCollapseSiblings\",\n\t\t\t\t\t\t\t\tparents[i],\n\t\t\t\t\t\t\t\tcallOpts\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\topts.autoCollapse = prevAC;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Trigger expand/collapse after expanding\n\t\t\t\tdfd.done(function () {\n\t\t\t\t\tvar lastChild = node.getLastChild();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tflag &&\n\t\t\t\t\t\topts.autoScroll &&\n\t\t\t\t\t\t!noAnimation &&\n\t\t\t\t\t\tlastChild &&\n\t\t\t\t\t\ttree._enableUpdate\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Scroll down to last child, but keep current node visible\n\t\t\t\t\t\tlastChild\n\t\t\t\t\t\t\t.scrollIntoView(true, { topNode: node })\n\t\t\t\t\t\t\t.always(function () {\n\t\t\t\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\tflag ? \"expand\" : \"collapse\",\n\t\t\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!noEvents) {\n\t\t\t\t\t\t\tctx.tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\tflag ? \"expand\" : \"collapse\",\n\t\t\t\t\t\t\t\tctx\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// vvv Code below is executed after loading finished:\n\t\t\t\t_afterLoad = function (callback) {\n\t\t\t\t\tvar cn = opts._classNames,\n\t\t\t\t\t\tisVisible,\n\t\t\t\t\t\tisExpanded,\n\t\t\t\t\t\teffect = opts.toggleEffect;\n\n\t\t\t\t\tnode.expanded = flag;\n\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tflag ? \"expand\" : \"collapse\"\n\t\t\t\t\t);\n\t\t\t\t\t// Create required markup, but make sure the top UL is hidden, so we\n\t\t\t\t\t// can animate later\n\t\t\t\t\ttree._callHook(\"nodeRender\", ctx, false, false, true);\n\n\t\t\t\t\t// Hide children, if node is collapsed\n\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\tisVisible = node.ul.style.display !== \"none\";\n\t\t\t\t\t\tisExpanded = !!node.expanded;\n\t\t\t\t\t\tif (isVisible === isExpanded) {\n\t\t\t\t\t\t\tnode.warn(\n\t\t\t\t\t\t\t\t\"nodeSetExpanded: UL.style.display already set\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (!effect || noAnimation) {\n\t\t\t\t\t\t\tnode.ul.style.display =\n\t\t\t\t\t\t\t\tnode.expanded || !parent ? \"\" : \"none\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// The UI toggle() effect works with the ext-wide extension,\n\t\t\t\t\t\t\t// while jQuery.animate() has problems when the title span\n\t\t\t\t\t\t\t// has position: absolute.\n\t\t\t\t\t\t\t// Since jQuery UI 1.12, the blind effect requires the parent\n\t\t\t\t\t\t\t// element to have 'position: relative'.\n\t\t\t\t\t\t\t// See #716, #717\n\t\t\t\t\t\t\t$(node.li).addClass(cn.animating); // #717\n\n\t\t\t\t\t\t\tif (_isFunction($(node.ul)[effect.effect])) {\n\t\t\t\t\t\t\t\t// tree.debug( \"use jquery.\" + effect.effect + \" method\" );\n\t\t\t\t\t\t\t\t$(node.ul)[effect.effect]({\n\t\t\t\t\t\t\t\t\tduration: effect.duration,\n\t\t\t\t\t\t\t\t\talways: function () {\n\t\t\t\t\t\t\t\t\t\t// node.debug(\"fancytree-animating end: \" + node.li.className);\n\t\t\t\t\t\t\t\t\t\t$(this).removeClass(cn.animating); // #716\n\t\t\t\t\t\t\t\t\t\t$(node.li).removeClass(cn.animating); // #717\n\t\t\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// The UI toggle() effect works with the ext-wide extension,\n\t\t\t\t\t\t\t\t// while jQuery.animate() has problems when the title span\n\t\t\t\t\t\t\t\t// has positon: absolute.\n\t\t\t\t\t\t\t\t// Since jQuery UI 1.12, the blind effect requires the parent\n\t\t\t\t\t\t\t\t// element to have 'position: relative'.\n\t\t\t\t\t\t\t\t// See #716, #717\n\t\t\t\t\t\t\t\t// tree.debug(\"use specified effect (\" + effect.effect + \") with the jqueryui.toggle method\");\n\n\t\t\t\t\t\t\t\t// try to stop an animation that might be already in progress\n\t\t\t\t\t\t\t\t$(node.ul).stop(true, true); //< does not work after resetLazy has been called for a node whose animation wasn't complete and effect was \"blind\"\n\n\t\t\t\t\t\t\t\t// dirty fix to remove a defunct animation (effect: \"blind\") after resetLazy has been called\n\t\t\t\t\t\t\t\t$(node.ul)\n\t\t\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t\t\t.find(\".ui-effects-placeholder\")\n\t\t\t\t\t\t\t\t\t.remove();\n\n\t\t\t\t\t\t\t\t$(node.ul).toggle(\n\t\t\t\t\t\t\t\t\teffect.effect,\n\t\t\t\t\t\t\t\t\teffect.options,\n\t\t\t\t\t\t\t\t\teffect.duration,\n\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t// node.debug(\"fancytree-animating end: \" + node.li.className);\n\t\t\t\t\t\t\t\t\t\t$(this).removeClass(cn.animating); // #716\n\t\t\t\t\t\t\t\t\t\t$(node.li).removeClass(cn.animating); // #717\n\t\t\t\t\t\t\t\t\t\tcallback();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcallback();\n\t\t\t\t};\n\t\t\t\t// ^^^ Code above is executed after loading finshed.\n\n\t\t\t\t// Load lazy nodes, if any. Then continue with _afterLoad()\n\t\t\t\tif (flag && node.lazy && node.hasChildren() === undefined) {\n\t\t\t\t\t// node.debug(\"nodeSetExpanded: load start...\");\n\t\t\t\t\tnode.load()\n\t\t\t\t\t\t.done(function () {\n\t\t\t\t\t\t\t// node.debug(\"nodeSetExpanded: load done\");\n\t\t\t\t\t\t\tif (dfd.notifyWith) {\n\t\t\t\t\t\t\t\t// requires jQuery 1.6+\n\t\t\t\t\t\t\t\tdfd.notifyWith(node, [\"loaded\"]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\t\t\tdfd.resolveWith(node);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.fail(function (errMsg) {\n\t\t\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\t\t\tdfd.rejectWith(node, [\n\t\t\t\t\t\t\t\t\t\"load failed (\" + errMsg + \")\",\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t/*\n\t\t\t\t\tvar source = tree._triggerNodeEvent(\"lazyLoad\", node, ctx.originalEvent);\n\t\t\t\t\t_assert(typeof source !== \"boolean\", \"lazyLoad event must return source in data.result\");\n\t\t\t\t\tnode.debug(\"nodeSetExpanded: load start...\");\n\t\t\t\t\tthis._callHook(\"nodeLoadChildren\", ctx, source).done(function(){\n\t\t\t\t\t\tnode.debug(\"nodeSetExpanded: load done\");\n\t\t\t\t\t\tif(dfd.notifyWith){ // requires jQuery 1.6+\n\t\t\t\t\t\t\tdfd.notifyWith(node, [\"loaded\"]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_afterLoad.call(tree);\n\t\t\t\t\t}).fail(function(errMsg){\n\t\t\t\t\t\tdfd.rejectWith(node, [\"load failed (\" + errMsg + \")\"]);\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t} else {\n\t\t\t\t\t_afterLoad(function () {\n\t\t\t\t\t\tdfd.resolveWith(node);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// node.debug(\"nodeSetExpanded: returns\");\n\t\t\t\treturn dfd.promise();\n\t\t\t},\n\t\t\t/** Focus or blur this node.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t */\n\t\t\tnodeSetFocus: function (ctx, flag) {\n\t\t\t\t// ctx.node.debug(\"nodeSetFocus(\" + flag + \")\");\n\t\t\t\tvar ctx2,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\tnode = ctx.node,\n\t\t\t\t\topts = tree.options,\n\t\t\t\t\t// et = ctx.originalEvent && ctx.originalEvent.type,\n\t\t\t\t\tisInput = ctx.originalEvent\n\t\t\t\t\t\t? $(ctx.originalEvent.target).is(\":input\")\n\t\t\t\t\t\t: false;\n\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// (node || tree).debug(\"nodeSetFocus(\" + flag + \"), event: \" + et + \", isInput: \"+ isInput);\n\t\t\t\t// Blur previous node if any\n\t\t\t\tif (tree.focusNode) {\n\t\t\t\t\tif (tree.focusNode === node && flag) {\n\t\t\t\t\t\t// node.debug(\"nodeSetFocus(\" + flag + \"): nothing to do\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tctx2 = $.extend({}, ctx, { node: tree.focusNode });\n\t\t\t\t\ttree.focusNode = null;\n\t\t\t\t\tthis._triggerNodeEvent(\"blur\", ctx2);\n\t\t\t\t\tthis._callHook(\"nodeRenderStatus\", ctx2);\n\t\t\t\t}\n\t\t\t\t// Set focus to container and node\n\t\t\t\tif (flag) {\n\t\t\t\t\tif (!this.hasFocus()) {\n\t\t\t\t\t\tnode.debug(\"nodeSetFocus: forcing container focus\");\n\t\t\t\t\t\tthis._callHook(\"treeSetFocus\", ctx, true, {\n\t\t\t\t\t\t\tcalledByNode: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tnode.makeVisible({ scrollIntoView: false });\n\t\t\t\t\ttree.focusNode = node;\n\t\t\t\t\tif (opts.titlesTabbable) {\n\t\t\t\t\t\tif (!isInput) {\n\t\t\t\t\t\t\t// #621\n\t\t\t\t\t\t\t$(node.span).find(\".fancytree-title\").focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (opts.aria) {\n\t\t\t\t\t\t// Set active descendant to node's span ID (create one, if needed)\n\t\t\t\t\t\t$(tree.$container).attr(\n\t\t\t\t\t\t\t\"aria-activedescendant\",\n\t\t\t\t\t\t\t$(node.tr || node.li)\n\t\t\t\t\t\t\t\t.uniqueId()\n\t\t\t\t\t\t\t\t.attr(\"id\")\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// \"ftal_\" + opts.idPrefix + node.key);\n\t\t\t\t\t}\n\t\t\t\t\t// $(node.span).find(\".fancytree-title\").focus();\n\t\t\t\t\tthis._triggerNodeEvent(\"focus\", ctx);\n\n\t\t\t\t\t// determine if we have focus on or inside tree container\n\t\t\t\t\tvar hasFancytreeFocus =\n\t\t\t\t\t\tdocument.activeElement === tree.$container.get(0) ||\n\t\t\t\t\t\t$(document.activeElement, tree.$container).length >= 1;\n\n\t\t\t\t\tif (!hasFancytreeFocus) {\n\t\t\t\t\t\t// We cannot set KB focus to a node, so use the tree container\n\t\t\t\t\t\t// #563, #570: IE scrolls on every call to .focus(), if the container\n\t\t\t\t\t\t// is partially outside the viewport. So do it only, when absolutely\n\t\t\t\t\t\t// necessary.\n\t\t\t\t\t\t$(tree.$container).focus();\n\t\t\t\t\t}\n\n\t\t\t\t\t// if( opts.autoActivate ){\n\t\t\t\t\t// \ttree.nodeSetActive(ctx, true);\n\t\t\t\t\t// }\n\t\t\t\t\tif (opts.autoScroll) {\n\t\t\t\t\t\tnode.scrollIntoView();\n\t\t\t\t\t}\n\t\t\t\t\tthis._callHook(\"nodeRenderStatus\", ctx);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** (De)Select node, return new status (sync).\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t * @param {object} [opts] additional options. Defaults to {noEvents: false,\n\t\t\t * propagateDown: null, propagateUp: null,\n\t\t\t * callback: null,\n\t\t\t * }\n\t\t\t * @returns {boolean} previous status\n\t\t\t */\n\t\t\tnodeSetSelected: function (ctx, flag, callOpts) {\n\t\t\t\tcallOpts = callOpts || {};\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\topts = ctx.options,\n\t\t\t\t\tnoEvents = callOpts.noEvents === true,\n\t\t\t\t\tparent = node.parent;\n\n\t\t\t\t// flag defaults to true\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// node.debug(\"nodeSetSelected(\" + flag + \")\", ctx);\n\n\t\t\t\t// Cannot (de)select unselectable nodes directly (only by propagation or\n\t\t\t\t// by setting the `.selected` property)\n\t\t\t\tif (FT.evalOption(\"unselectable\", node, node, opts, false)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Remember the user's intent, in case down -> up propagation prevents\n\t\t\t\t// applying it to node.selected\n\t\t\t\tnode._lastSelectIntent = flag; // Confusing use of '!'\n\n\t\t\t\t// Nothing to do?\n\t\t\t\tif (!!node.selected === flag) {\n\t\t\t\t\tif (opts.selectMode === 3 && node.partsel && !flag) {\n\t\t\t\t\t\t// If propagation prevented selecting this node last time, we still\n\t\t\t\t\t\t// want to allow to apply setSelected(false) now\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn flag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!noEvents &&\n\t\t\t\t\tthis._triggerNodeEvent(\n\t\t\t\t\t\t\"beforeSelect\",\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tctx.originalEvent\n\t\t\t\t\t) === false\n\t\t\t\t) {\n\t\t\t\t\treturn !!node.selected;\n\t\t\t\t}\n\t\t\t\tif (flag && opts.selectMode === 1) {\n\t\t\t\t\t// single selection mode (we don't uncheck all tree nodes, for performance reasons)\n\t\t\t\t\tif (tree.lastSelectedNode) {\n\t\t\t\t\t\ttree.lastSelectedNode.setSelected(false);\n\t\t\t\t\t}\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t} else if (\n\t\t\t\t\topts.selectMode === 3 &&\n\t\t\t\t\tparent &&\n\t\t\t\t\t!parent.radiogroup &&\n\t\t\t\t\t!node.radiogroup\n\t\t\t\t) {\n\t\t\t\t\t// multi-hierarchical selection mode\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t\tnode.fixSelection3AfterClick(callOpts);\n\t\t\t\t} else if (parent && parent.radiogroup) {\n\t\t\t\t\tnode.visitSiblings(function (n) {\n\t\t\t\t\t\tn._changeSelectStatusAttrs(flag && n === node);\n\t\t\t\t\t}, true);\n\t\t\t\t} else {\n\t\t\t\t\t// default: selectMode: 2, multi selection mode\n\t\t\t\t\tnode.selected = flag;\n\t\t\t\t}\n\t\t\t\tthis.nodeRenderStatus(ctx);\n\t\t\t\ttree.lastSelectedNode = flag ? node : null;\n\t\t\t\tif (!noEvents) {\n\t\t\t\t\ttree._triggerNodeEvent(\"select\", ctx);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Show node status (ok, loading, error, nodata) using styles and a dummy child node.\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param status\n\t\t\t * @param message\n\t\t\t * @param details\n\t\t\t * @since 2.3\n\t\t\t */\n\t\t\tnodeSetStatus: function (ctx, status, message, details) {\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\ttree = ctx.tree;\n\n\t\t\t\tfunction _clearStatusNode() {\n\t\t\t\t\t// Remove dedicated dummy node, if any\n\t\t\t\t\tvar firstChild = node.children ? node.children[0] : null;\n\t\t\t\t\tif (firstChild && firstChild.isStatusNode()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// I've seen exceptions here with loadKeyPath...\n\t\t\t\t\t\t\tif (node.ul) {\n\t\t\t\t\t\t\t\tnode.ul.removeChild(firstChild.li);\n\t\t\t\t\t\t\t\tfirstChild.li = null; // avoid leaks (DT issue 215)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\tif (node.children.length === 1) {\n\t\t\t\t\t\t\tnode.children = [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.children.shift();\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"clearStatusNode\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfunction _setStatusNode(data, type) {\n\t\t\t\t\t// Create/modify the dedicated dummy node for 'loading...' or\n\t\t\t\t\t// 'error!' status. (only called for direct child of the invisible\n\t\t\t\t\t// system root)\n\t\t\t\t\tvar firstChild = node.children ? node.children[0] : null;\n\t\t\t\t\tif (firstChild && firstChild.isStatusNode()) {\n\t\t\t\t\t\t$.extend(firstChild, data);\n\t\t\t\t\t\tfirstChild.statusNodeType = type;\n\t\t\t\t\t\ttree._callHook(\"nodeRenderTitle\", firstChild);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode._setChildren([data]);\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"setStatusNode\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode.children[0].statusNodeType = type;\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t}\n\t\t\t\t\treturn node.children[0];\n\t\t\t\t}\n\n\t\t\t\tswitch (status) {\n\t\t\t\t\tcase \"ok\":\n\t\t\t\t\t\t_clearStatusNode();\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"loading\":\n\t\t\t\t\t\tif (!node.parent) {\n\t\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttitle:\n\t\t\t\t\t\t\t\t\t\ttree.options.strings.loading +\n\t\t\t\t\t\t\t\t\t\t(message ? \" (\" + message + \")\" : \"\"),\n\t\t\t\t\t\t\t\t\t// icon: true, // needed for 'loding' icon\n\t\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode._isLoading = true;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"error\":\n\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle:\n\t\t\t\t\t\t\t\t\ttree.options.strings.loadError +\n\t\t\t\t\t\t\t\t\t(message ? \" (\" + message + \")\" : \"\"),\n\t\t\t\t\t\t\t\t// icon: false,\n\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = { message: message, details: details };\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"nodata\":\n\t\t\t\t\t\t_setStatusNode(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: message || tree.options.strings.noData,\n\t\t\t\t\t\t\t\t// icon: false,\n\t\t\t\t\t\t\t\tcheckbox: false,\n\t\t\t\t\t\t\t\ttooltip: details,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstatus\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnode._isLoading = false;\n\t\t\t\t\t\tnode._error = null;\n\t\t\t\t\t\tnode.renderStatus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$.error(\"invalid node status \" + status);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/**\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeToggleExpanded: function (ctx) {\n\t\t\t\treturn this.nodeSetExpanded(ctx, !ctx.node.expanded);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\tnodeToggleSelected: function (ctx) {\n\t\t\t\tvar node = ctx.node,\n\t\t\t\t\tflag = !node.selected;\n\n\t\t\t\t// In selectMode: 3 this node may be unselected+partsel, even if\n\t\t\t\t// setSelected(true) was called before, due to `unselectable` children.\n\t\t\t\t// In this case, we now toggle as `setSelected(false)`\n\t\t\t\tif (\n\t\t\t\t\tnode.partsel &&\n\t\t\t\t\t!node.selected &&\n\t\t\t\t\tnode._lastSelectIntent === true\n\t\t\t\t) {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tnode.selected = true; // so it is not considered 'nothing to do'\n\t\t\t\t}\n\t\t\t\tnode._lastSelectIntent = flag;\n\t\t\t\treturn this.nodeSetSelected(ctx, flag);\n\t\t\t},\n\t\t\t/** Remove all nodes.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeClear: function (ctx) {\n\t\t\t\tvar tree = ctx.tree;\n\t\t\t\ttree.activeNode = null;\n\t\t\t\ttree.focusNode = null;\n\t\t\t\ttree.$div.find(\">ul.fancytree-container\").empty();\n\t\t\t\t// TODO: call destructors and remove reference loops\n\t\t\t\ttree.rootNode.children = null;\n\t\t\t\ttree._callHook(\"treeStructureChanged\", ctx, \"clear\");\n\t\t\t},\n\t\t\t/** Widget was created (called only once, even it re-initialized).\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeCreate: function (ctx) {},\n\t\t\t/** Widget was destroyed.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeDestroy: function (ctx) {\n\t\t\t\tthis.$div.find(\">ul.fancytree-container\").remove();\n\t\t\t\tif (this.$source) {\n\t\t\t\t\tthis.$source.removeClass(\"fancytree-helper-hidden\");\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Widget was (re-)initialized.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeInit: function (ctx) {\n\t\t\t\tvar tree = ctx.tree,\n\t\t\t\t\topts = tree.options;\n\n\t\t\t\t//this.debug(\"Fancytree.treeInit()\");\n\t\t\t\t// Add container to the TAB chain\n\t\t\t\t// See http://www.w3.org/TR/wai-aria-practices/#focus_activedescendant\n\t\t\t\t// #577: Allow to set tabindex to \"0\", \"-1\" and \"\"\n\t\t\t\ttree.$container.attr(\"tabindex\", opts.tabindex);\n\n\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\tif (opts[attr] !== undefined) {\n\t\t\t\t\t\ttree.info(\"Move option \" + attr + \" to tree\");\n\t\t\t\t\t\ttree[attr] = opts[attr];\n\t\t\t\t\t\tdelete opts[attr];\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (opts.checkboxAutoHide) {\n\t\t\t\t\ttree.$container.addClass(\"fancytree-checkbox-auto-hide\");\n\t\t\t\t}\n\t\t\t\tif (opts.rtl) {\n\t\t\t\t\ttree.$container\n\t\t\t\t\t\t.attr(\"DIR\", \"RTL\")\n\t\t\t\t\t\t.addClass(\"fancytree-rtl\");\n\t\t\t\t} else {\n\t\t\t\t\ttree.$container\n\t\t\t\t\t\t.removeAttr(\"DIR\")\n\t\t\t\t\t\t.removeClass(\"fancytree-rtl\");\n\t\t\t\t}\n\t\t\t\tif (opts.aria) {\n\t\t\t\t\ttree.$container.attr(\"role\", \"tree\");\n\t\t\t\t\tif (opts.selectMode !== 1) {\n\t\t\t\t\t\ttree.$container.attr(\"aria-multiselectable\", true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.treeLoad(ctx);\n\t\t\t},\n\t\t\t/** Parse Fancytree from source, as configured in the options.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {object} [source] optional new source (use last data otherwise)\n\t\t\t */\n\t\t\ttreeLoad: function (ctx, source) {\n\t\t\t\tvar metaData,\n\t\t\t\t\ttype,\n\t\t\t\t\t$ul,\n\t\t\t\t\ttree = ctx.tree,\n\t\t\t\t\t$container = ctx.widget.element,\n\t\t\t\t\tdfd,\n\t\t\t\t\t// calling context for root node\n\t\t\t\t\trootCtx = $.extend({}, ctx, { node: this.rootNode });\n\n\t\t\t\tif (tree.rootNode.children) {\n\t\t\t\t\tthis.treeClear(ctx);\n\t\t\t\t}\n\t\t\t\tsource = source || this.options.source;\n\n\t\t\t\tif (!source) {\n\t\t\t\t\ttype = $container.data(\"type\") || \"html\";\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase \"html\":\n\t\t\t\t\t\t\t// There should be an embedded `<ul>` with initial nodes,\n\t\t\t\t\t\t\t// but another `<ul class='fancytree-container'>` is appended\n\t\t\t\t\t\t\t// to the tree's <div> on startup anyway.\n\t\t\t\t\t\t\t$ul = $container\n\t\t\t\t\t\t\t\t.find(\">ul\")\n\t\t\t\t\t\t\t\t.not(\".fancytree-container\")\n\t\t\t\t\t\t\t\t.first();\n\n\t\t\t\t\t\t\tif ($ul.length) {\n\t\t\t\t\t\t\t\t$ul.addClass(\n\t\t\t\t\t\t\t\t\t\"ui-fancytree-source fancytree-helper-hidden\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsource = $.ui.fancytree.parseHtml($ul);\n\t\t\t\t\t\t\t\t// allow to init tree.data.foo from <ul data-foo=''>\n\t\t\t\t\t\t\t\tthis.data = $.extend(\n\t\t\t\t\t\t\t\t\tthis.data,\n\t\t\t\t\t\t\t\t\t_getElementDataAsDict($ul)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tFT.warn(\n\t\t\t\t\t\t\t\t\t\"No `source` option was passed and container does not contain `<ul>`: assuming `source: []`.\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsource = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\t\tsource = $.parseJSON($container.text());\n\t\t\t\t\t\t\t// $container already contains the <ul>, but we remove the plain (json) text\n\t\t\t\t\t\t\t// $container.empty();\n\t\t\t\t\t\t\t$container\n\t\t\t\t\t\t\t\t.contents()\n\t\t\t\t\t\t\t\t.filter(function () {\n\t\t\t\t\t\t\t\t\treturn this.nodeType === 3;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.remove();\n\t\t\t\t\t\t\tif ($.isPlainObject(source)) {\n\t\t\t\t\t\t\t\t// We got {foo: 'abc', children: [...]}\n\t\t\t\t\t\t\t\t_assert(\n\t\t\t\t\t\t\t\t\t_isArray(source.children),\n\t\t\t\t\t\t\t\t\t\"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tmetaData = source;\n\t\t\t\t\t\t\t\tsource = source.children;\n\t\t\t\t\t\t\t\tdelete metaData.children;\n\t\t\t\t\t\t\t\t// Copy some attributes to tree.data\n\t\t\t\t\t\t\t\t$.each(TREE_ATTRS, function (i, attr) {\n\t\t\t\t\t\t\t\t\tif (metaData[attr] !== undefined) {\n\t\t\t\t\t\t\t\t\t\ttree[attr] = metaData[attr];\n\t\t\t\t\t\t\t\t\t\tdelete metaData[attr];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// Copy extra properties to tree.data.foo\n\t\t\t\t\t\t\t\t$.extend(tree.data, metaData);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$.error(\"Invalid data-type: \" + type);\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof source === \"string\") {\n\t\t\t\t\t// TODO: source is an element ID\n\t\t\t\t\t$.error(\"Not implemented\");\n\t\t\t\t}\n\n\t\t\t\t// preInit is fired when the widget markup is created, but nodes\n\t\t\t\t// not yet loaded\n\t\t\t\ttree._triggerTreeEvent(\"preInit\", null);\n\n\t\t\t\t// Trigger fancytreeinit after nodes have been loaded\n\t\t\t\tdfd = this.nodeLoadChildren(rootCtx, source)\n\t\t\t\t\t.done(function () {\n\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\"loadChildren\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t\tif (ctx.options.selectMode === 3) {\n\t\t\t\t\t\t\ttree.rootNode.fixSelection3FromEndNodes();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tree.activeNode && tree.options.activeVisible) {\n\t\t\t\t\t\t\ttree.activeNode.makeVisible();\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttree._triggerTreeEvent(\"init\", null, { status: true });\n\t\t\t\t\t})\n\t\t\t\t\t.fail(function () {\n\t\t\t\t\t\ttree.render();\n\t\t\t\t\t\ttree._triggerTreeEvent(\"init\", null, { status: false });\n\t\t\t\t\t});\n\t\t\t\treturn dfd;\n\t\t\t},\n\t\t\t/** Node was inserted into or removed from the tree.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} add\n\t\t\t * @param {FancytreeNode} node\n\t\t\t */\n\t\t\ttreeRegisterNode: function (ctx, add, node) {\n\t\t\t\tctx.tree._callHook(\n\t\t\t\t\t\"treeStructureChanged\",\n\t\t\t\t\tctx,\n\t\t\t\t\tadd ? \"addNode\" : \"removeNode\"\n\t\t\t\t);\n\t\t\t},\n\t\t\t/** Widget got focus.\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {boolean} [flag=true]\n\t\t\t */\n\t\t\ttreeSetFocus: function (ctx, flag, callOpts) {\n\t\t\t\tvar targetNode;\n\n\t\t\t\tflag = flag !== false;\n\n\t\t\t\t// this.debug(\"treeSetFocus(\" + flag + \"), callOpts: \", callOpts, this.hasFocus());\n\t\t\t\t// this.debug(\" focusNode: \" + this.focusNode);\n\t\t\t\t// this.debug(\" activeNode: \" + this.activeNode);\n\t\t\t\tif (flag !== this.hasFocus()) {\n\t\t\t\t\tthis._hasFocus = flag;\n\t\t\t\t\tif (!flag && this.focusNode) {\n\t\t\t\t\t\t// Node also looses focus if widget blurs\n\t\t\t\t\t\tthis.focusNode.setFocus(false);\n\t\t\t\t\t} else if (flag && (!callOpts || !callOpts.calledByNode)) {\n\t\t\t\t\t\t$(this.$container).focus();\n\t\t\t\t\t}\n\t\t\t\t\tthis.$container.toggleClass(\"fancytree-treefocus\", flag);\n\t\t\t\t\tthis._triggerTreeEvent(flag ? \"focusTree\" : \"blurTree\");\n\t\t\t\t\tif (flag && !this.activeNode) {\n\t\t\t\t\t\t// #712: Use last mousedowned node ('click' event fires after focusin)\n\t\t\t\t\t\ttargetNode =\n\t\t\t\t\t\t\tthis._lastMousedownNode || this.getFirstChild();\n\t\t\t\t\t\tif (targetNode) {\n\t\t\t\t\t\t\ttargetNode.setFocus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Widget option was set using `$().fancytree(\"option\", \"KEY\", VALUE)`.\n\t\t\t *\n\t\t\t * Note: `key` may reference a nested option, e.g. 'dnd5.scroll'.\n\t\t\t * In this case `value`contains the complete, modified `dnd5` option hash.\n\t\t\t * We can check for changed values like\n\t\t\t * if( value.scroll !== tree.options.dnd5.scroll ) {...}\n\t\t\t *\n\t\t\t * @param {EventData} ctx\n\t\t\t * @param {string} key option name\n\t\t\t * @param {any} value option value\n\t\t\t */\n\t\t\ttreeSetOption: function (ctx, key, value) {\n\t\t\t\tvar tree = ctx.tree,\n\t\t\t\t\tcallDefault = true,\n\t\t\t\t\tcallCreate = false,\n\t\t\t\t\tcallRender = false;\n\n\t\t\t\tswitch (key) {\n\t\t\t\t\tcase \"aria\":\n\t\t\t\t\tcase \"checkbox\":\n\t\t\t\t\tcase \"icon\":\n\t\t\t\t\tcase \"minExpandLevel\":\n\t\t\t\t\tcase \"tabindex\":\n\t\t\t\t\t\t// tree._callHook(\"treeCreate\", tree);\n\t\t\t\t\t\tcallCreate = true;\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"checkboxAutoHide\":\n\t\t\t\t\t\ttree.$container.toggleClass(\n\t\t\t\t\t\t\t\"fancytree-checkbox-auto-hide\",\n\t\t\t\t\t\t\t!!value\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"escapeTitles\":\n\t\t\t\t\tcase \"tooltip\":\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"rtl\":\n\t\t\t\t\t\tif (value === false) {\n\t\t\t\t\t\t\ttree.$container\n\t\t\t\t\t\t\t\t.removeAttr(\"DIR\")\n\t\t\t\t\t\t\t\t.removeClass(\"fancytree-rtl\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttree.$container\n\t\t\t\t\t\t\t\t.attr(\"DIR\", \"RTL\")\n\t\t\t\t\t\t\t\t.addClass(\"fancytree-rtl\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"source\":\n\t\t\t\t\t\tcallDefault = false;\n\t\t\t\t\t\ttree._callHook(\"treeLoad\", tree, value);\n\t\t\t\t\t\tcallRender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttree.debug(\n\t\t\t\t\t\"set option \" +\n\t\t\t\t\t\tkey +\n\t\t\t\t\t\t\"=\" +\n\t\t\t\t\t\tvalue +\n\t\t\t\t\t\t\" <\" +\n\t\t\t\t\t\ttypeof value +\n\t\t\t\t\t\t\">\"\n\t\t\t\t);\n\t\t\t\tif (callDefault) {\n\t\t\t\t\tif (this.widget._super) {\n\t\t\t\t\t\t// jQuery UI 1.9+\n\t\t\t\t\t\tthis.widget._super.call(this.widget, key, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// jQuery UI <= 1.8, we have to manually invoke the _setOption method from the base widget\n\t\t\t\t\t\t$.Widget.prototype._setOption.call(\n\t\t\t\t\t\t\tthis.widget,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (callCreate) {\n\t\t\t\t\ttree._callHook(\"treeCreate\", tree);\n\t\t\t\t}\n\t\t\t\tif (callRender) {\n\t\t\t\t\ttree.render(true, false); // force, not-deep\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** A Node was added, removed, moved, or it's visibility changed.\n\t\t\t * @param {EventData} ctx\n\t\t\t */\n\t\t\ttreeStructureChanged: function (ctx, type) {},\n\t\t}\n\t);\n\n\t/*******************************************************************************\n\t * jQuery UI widget boilerplate\n\t */\n\n\t/**\n\t * The plugin (derrived from [jQuery.Widget](http://api.jqueryui.com/jQuery.widget/)).\n\t *\n\t * **Note:**\n\t * These methods implement the standard jQuery UI widget API.\n\t * It is recommended to use methods of the {Fancytree} instance instead\n\t *\n\t * @example\n\t * // DEPRECATED: Access jQuery UI widget methods and members:\n\t * var tree = $(\"#tree\").fancytree(\"getTree\", \"#myTree\");\n\t * var node = $.ui.fancytree.getTree(\"#tree\").getActiveNode();\n\t *\n\t * // RECOMMENDED: Use the Fancytree object API\n\t * var tree = $.ui.fancytree.getTree(\"#myTree\");\n\t * var node = tree.getActiveNode();\n\t *\n\t * // or you may already have stored the tree instance upon creation:\n\t * import {createTree, version} from 'jquery.fancytree'\n\t * const tree = createTree('#tree', { ... });\n\t * var node = tree.getActiveNode();\n\t *\n\t * @see {Fancytree_Static#getTree}\n\t * @deprecated Use methods of the {Fancytree} instance instead\n\t * @mixin Fancytree_Widget\n\t */\n\n\t$.widget(\n\t\t\"ui.fancytree\",\n\t\t/** @lends Fancytree_Widget# */\n\t\t{\n\t\t\t/**These options will be used as defaults\n\t\t\t * @type {FancytreeOptions}\n\t\t\t */\n\t\t\toptions: {\n\t\t\t\tactiveVisible: true,\n\t\t\t\tajax: {\n\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\tcache: false, // false: Append random '_' argument to the request url to prevent caching.\n\t\t\t\t\t// timeout: 0, // >0: Make sure we get an ajax error if server is unreachable\n\t\t\t\t\tdataType: \"json\", // Expect json format and pass json object to callbacks.\n\t\t\t\t},\n\t\t\t\taria: true,\n\t\t\t\tautoActivate: true,\n\t\t\t\tautoCollapse: false,\n\t\t\t\tautoScroll: false,\n\t\t\t\tcheckbox: false,\n\t\t\t\tclickFolderMode: 4,\n\t\t\t\tcopyFunctionsToData: false,\n\t\t\t\tdebugLevel: null, // 0..4 (null: use global setting $.ui.fancytree.debugLevel)\n\t\t\t\tdisabled: false, // TODO: required anymore?\n\t\t\t\tenableAspx: 42, // TODO: this is truethy, but distinguishable from true: default will change to false in the future\n\t\t\t\tescapeTitles: false,\n\t\t\t\textensions: [],\n\t\t\t\tfocusOnSelect: false,\n\t\t\t\tgenerateIds: false,\n\t\t\t\ticon: true,\n\t\t\t\tidPrefix: \"ft_\",\n\t\t\t\tkeyboard: true,\n\t\t\t\tkeyPathSeparator: \"/\",\n\t\t\t\tminExpandLevel: 1,\n\t\t\t\tnodata: true, // (bool, string, or callback) display message, when no data available\n\t\t\t\tquicksearch: false,\n\t\t\t\trtl: false,\n\t\t\t\tscrollOfs: { top: 0, bottom: 0 },\n\t\t\t\tscrollParent: null,\n\t\t\t\tselectMode: 2,\n\t\t\t\tstrings: {\n\t\t\t\t\tloading: \"Loading...\", // &#8230; would be escaped when escapeTitles is true\n\t\t\t\t\tloadError: \"Load error!\",\n\t\t\t\t\tmoreData: \"More...\",\n\t\t\t\t\tnoData: \"No data.\",\n\t\t\t\t},\n\t\t\t\ttabindex: \"0\",\n\t\t\t\ttitlesTabbable: false,\n\t\t\t\ttoggleEffect: { effect: \"slideToggle\", duration: 200 }, //< \"toggle\" or \"slideToggle\" to use jQuery instead of jQueryUI for toggleEffect animation\n\t\t\t\ttooltip: false,\n\t\t\t\ttreeId: null,\n\t\t\t\t_classNames: {\n\t\t\t\t\tactive: \"fancytree-active\",\n\t\t\t\t\tanimating: \"fancytree-animating\",\n\t\t\t\t\tcombinedExpanderPrefix: \"fancytree-exp-\",\n\t\t\t\t\tcombinedIconPrefix: \"fancytree-ico-\",\n\t\t\t\t\terror: \"fancytree-error\",\n\t\t\t\t\texpanded: \"fancytree-expanded\",\n\t\t\t\t\tfocused: \"fancytree-focused\",\n\t\t\t\t\tfolder: \"fancytree-folder\",\n\t\t\t\t\thasChildren: \"fancytree-has-children\",\n\t\t\t\t\tlastsib: \"fancytree-lastsib\",\n\t\t\t\t\tlazy: \"fancytree-lazy\",\n\t\t\t\t\tloading: \"fancytree-loading\",\n\t\t\t\t\tnode: \"fancytree-node\",\n\t\t\t\t\tpartload: \"fancytree-partload\",\n\t\t\t\t\tpartsel: \"fancytree-partsel\",\n\t\t\t\t\tradio: \"fancytree-radio\",\n\t\t\t\t\tselected: \"fancytree-selected\",\n\t\t\t\t\tstatusNodePrefix: \"fancytree-statusnode-\",\n\t\t\t\t\tunselectable: \"fancytree-unselectable\",\n\t\t\t\t},\n\t\t\t\t// events\n\t\t\t\tlazyLoad: null,\n\t\t\t\tpostProcess: null,\n\t\t\t},\n\t\t\t_deprecationWarning: function (name) {\n\t\t\t\tvar tree = this.tree;\n\n\t\t\t\tif (tree && tree.options.debugLevel >= 3) {\n\t\t\t\t\ttree.warn(\n\t\t\t\t\t\t\"$().fancytree('\" +\n\t\t\t\t\t\t\tname +\n\t\t\t\t\t\t\t\"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/* Set up the widget, Called on first $().fancytree() */\n\t\t\t_create: function () {\n\t\t\t\tthis.tree = new Fancytree(this);\n\n\t\t\t\tthis.$source =\n\t\t\t\t\tthis.source || this.element.data(\"type\") === \"json\"\n\t\t\t\t\t\t? this.element\n\t\t\t\t\t\t: this.element.find(\">ul\").first();\n\t\t\t\t// Subclass Fancytree instance with all enabled extensions\n\t\t\t\tvar extension,\n\t\t\t\t\textName,\n\t\t\t\t\ti,\n\t\t\t\t\topts = this.options,\n\t\t\t\t\textensions = opts.extensions,\n\t\t\t\t\tbase = this.tree;\n\n\t\t\t\tfor (i = 0; i < extensions.length; i++) {\n\t\t\t\t\textName = extensions[i];\n\t\t\t\t\textension = $.ui.fancytree._extensions[extName];\n\t\t\t\t\tif (!extension) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"Could not apply extension '\" +\n\t\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\t\"' (it is not registered, did you forget to include it?)\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Add extension options as tree.options.EXTENSION\n\t\t\t\t\t// \t_assert(!this.tree.options[extName], \"Extension name must not exist as option name: \" + extName);\n\n\t\t\t\t\t// console.info(\"extend \" + extName, extension.options, this.tree.options[extName])\n\t\t\t\t\t// issue #876: we want to replace custom array-options, not merge them\n\t\t\t\t\tthis.tree.options[extName] = _simpleDeepMerge(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\textension.options,\n\t\t\t\t\t\tthis.tree.options[extName]\n\t\t\t\t\t);\n\t\t\t\t\t// this.tree.options[extName] = $.extend(true, {}, extension.options, this.tree.options[extName]);\n\n\t\t\t\t\t// console.info(\"extend \" + extName + \" =>\", this.tree.options[extName])\n\t\t\t\t\t// console.info(\"extend \" + extName + \" org default =>\", extension.options)\n\n\t\t\t\t\t// Add a namespace tree.ext.EXTENSION, to hold instance data\n\t\t\t\t\t_assert(\n\t\t\t\t\t\tthis.tree.ext[extName] === undefined,\n\t\t\t\t\t\t\"Extension name must not exist as Fancytree.ext attribute: '\" +\n\t\t\t\t\t\t\textName +\n\t\t\t\t\t\t\t\"'\"\n\t\t\t\t\t);\n\t\t\t\t\t// this.tree[extName] = extension;\n\t\t\t\t\tthis.tree.ext[extName] = {};\n\t\t\t\t\t// Subclass Fancytree methods using proxies.\n\t\t\t\t\t_subclassObject(this.tree, base, extension, extName);\n\t\t\t\t\t// current extension becomes base for the next extension\n\t\t\t\t\tbase = extension;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tif (opts.icons !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\tif (opts.icon === true) {\n\t\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\t\"'icons' tree option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.icon = opts.icons;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'icons' tree option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (opts.iconClass !== undefined) {\n\t\t\t\t\t// 2015-11-16\n\t\t\t\t\tif (opts.icon) {\n\t\t\t\t\t\t$.error(\n\t\t\t\t\t\t\t\"'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\t\"'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\topts.icon = opts.iconClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (opts.tabbable !== undefined) {\n\t\t\t\t\t// 2016-04-04\n\t\t\t\t\topts.tabindex = opts.tabbable ? \"0\" : \"-1\";\n\t\t\t\t\tthis.tree.warn(\n\t\t\t\t\t\t\"'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='\" +\n\t\t\t\t\t\t\topts.tabindex +\n\t\t\t\t\t\t\t\"' instead\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tthis.tree._callHook(\"treeCreate\", this.tree);\n\t\t\t\t// Note: 'fancytreecreate' event is fired by widget base class\n\t\t\t\t// this.tree._triggerTreeEvent(\"create\");\n\t\t\t},\n\n\t\t\t/* Called on every $().fancytree() */\n\t\t\t_init: function () {\n\t\t\t\tthis.tree._callHook(\"treeInit\", this.tree);\n\t\t\t\t// TODO: currently we call bind after treeInit, because treeInit\n\t\t\t\t// might change tree.$container.\n\t\t\t\t// It would be better, to move event binding into hooks altogether\n\t\t\t\tthis._bind();\n\t\t\t},\n\n\t\t\t/* Use the _setOption method to respond to changes to options. */\n\t\t\t_setOption: function (key, value) {\n\t\t\t\treturn this.tree._callHook(\n\t\t\t\t\t\"treeSetOption\",\n\t\t\t\t\tthis.tree,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t},\n\n\t\t\t/** Use the destroy method to clean up any modifications your widget has made to the DOM */\n\t\t\t_destroy: function () {\n\t\t\t\tthis._unbind();\n\t\t\t\tthis.tree._callHook(\"treeDestroy\", this.tree);\n\t\t\t\t// In jQuery UI 1.8, you must invoke the destroy method from the base widget\n\t\t\t\t// $.Widget.prototype.destroy.call(this);\n\t\t\t\t// TODO: delete tree and nodes to make garbage collect easier?\n\t\t\t\t// TODO: In jQuery UI 1.9 and above, you would define _destroy instead of destroy and not call the base method\n\t\t\t},\n\n\t\t\t// -------------------------------------------------------------------------\n\n\t\t\t/* Remove all event handlers for our namespace */\n\t\t\t_unbind: function () {\n\t\t\t\tvar ns = this.tree._ns;\n\t\t\t\tthis.element.off(ns);\n\t\t\t\tthis.tree.$container.off(ns);\n\t\t\t\t$(document).off(ns);\n\t\t\t},\n\t\t\t/* Add mouse and kyboard handlers to the container */\n\t\t\t_bind: function () {\n\t\t\t\tvar self = this,\n\t\t\t\t\topts = this.options,\n\t\t\t\t\ttree = this.tree,\n\t\t\t\t\tns = tree._ns;\n\t\t\t\t// selstartEvent = ( $.support.selectstart ? \"selectstart\" : \"mousedown\" )\n\n\t\t\t\t// Remove all previuous handlers for this tree\n\t\t\t\tthis._unbind();\n\n\t\t\t\t//alert(\"keydown\" + ns + \"foc=\" + tree.hasFocus() + tree.$container);\n\t\t\t\t// tree.debug(\"bind events; container: \", tree.$container);\n\t\t\t\ttree.$container\n\t\t\t\t\t.on(\"focusin\" + ns + \" focusout\" + ns, function (event) {\n\t\t\t\t\t\tvar node = FT.getNode(event),\n\t\t\t\t\t\t\tflag = event.type === \"focusin\";\n\n\t\t\t\t\t\tif (!flag && node && $(event.target).is(\"a\")) {\n\t\t\t\t\t\t\t// #764\n\t\t\t\t\t\t\tnode.debug(\n\t\t\t\t\t\t\t\t\"Ignored focusout on embedded <a> element.\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// tree.treeOnFocusInOut.call(tree, event);\n\t\t\t\t\t\t// tree.debug(\"Tree container got event \" + event.type, node, event, FT.getEventTarget(event));\n\t\t\t\t\t\tif (flag) {\n\t\t\t\t\t\t\tif (tree._getExpiringValue(\"focusin\")) {\n\t\t\t\t\t\t\t\t// #789: IE 11 may send duplicate focusin events\n\t\t\t\t\t\t\t\ttree.debug(\"Ignored double focusin.\");\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttree._setExpiringValue(\"focusin\", true, 50);\n\n\t\t\t\t\t\t\tif (!node) {\n\t\t\t\t\t\t\t\t// #789: IE 11 may send focusin before mousdown(?)\n\t\t\t\t\t\t\t\tnode = tree._getExpiringValue(\"mouseDownNode\");\n\t\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\t\ttree.debug(\n\t\t\t\t\t\t\t\t\t\t\"Reconstruct mouse target for focusin from recent event.\"\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t// For example clicking into an <input> that is part of a node\n\t\t\t\t\t\t\ttree._callHook(\n\t\t\t\t\t\t\t\t\"nodeSetFocus\",\n\t\t\t\t\t\t\t\ttree._makeHookContext(node, event),\n\t\t\t\t\t\t\t\tflag\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\ttree.tbody &&\n\t\t\t\t\t\t\t\t$(event.target).parents(\n\t\t\t\t\t\t\t\t\t\"table.fancytree-container > thead\"\n\t\t\t\t\t\t\t\t).length\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// #767: ignore events in the table's header\n\t\t\t\t\t\t\t\ttree.debug(\n\t\t\t\t\t\t\t\t\t\"Ignore focus event outside table body.\",\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttree._callHook(\"treeSetFocus\", tree, flag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.on(\n\t\t\t\t\t\t\"selectstart\" + ns,\n\t\t\t\t\t\t\"span.fancytree-title\",\n\t\t\t\t\t\tfunction (event) {\n\t\t\t\t\t\t\t// prevent mouse-drags to select text ranges\n\t\t\t\t\t\t\t// tree.debug(\"<span title> got event \" + event.type);\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t\t.on(\"keydown\" + ns, function (event) {\n\t\t\t\t\t\t// TODO: also bind keyup and keypress\n\t\t\t\t\t\t// tree.debug(\"got event \" + event.type + \", hasFocus:\" + tree.hasFocus());\n\t\t\t\t\t\t// if(opts.disabled || opts.keyboard === false || !tree.hasFocus() ){\n\t\t\t\t\t\tif (opts.disabled || opts.keyboard === false) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar res,\n\t\t\t\t\t\t\tnode = tree.focusNode, // node may be null\n\t\t\t\t\t\t\tctx = tree._makeHookContext(node || tree, event),\n\t\t\t\t\t\t\tprevPhase = tree.phase;\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttree.phase = \"userEvent\";\n\t\t\t\t\t\t\t// If a 'fancytreekeydown' handler returns false, skip the default\n\t\t\t\t\t\t\t// handling (implemented by tree.nodeKeydown()).\n\t\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\t\tres = tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\"keydown\",\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres = tree._triggerTreeEvent(\"keydown\", event);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res === \"preventNav\") {\n\t\t\t\t\t\t\t\tres = true; // prevent keyboard navigation, but don't prevent default handling of embedded input controls\n\t\t\t\t\t\t\t} else if (res !== false) {\n\t\t\t\t\t\t\t\tres = tree._callHook(\"nodeKeydown\", ctx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn res;\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\ttree.phase = prevPhase;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"mousedown\" + ns, function (event) {\n\t\t\t\t\t\tvar et = FT.getEventTarget(event);\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", et.node);\n\t\t\t\t\t\t// #712: Store the clicked node, so we can use it when we get a focusin event\n\t\t\t\t\t\t// ('click' event fires after focusin)\n\t\t\t\t\t\t// tree.debug(\"event(\" + event.type + \"): node: \", et.node);\n\t\t\t\t\t\ttree._lastMousedownNode = et ? et.node : null;\n\t\t\t\t\t\t// #789: Store the node also for a short period, so we can use it\n\t\t\t\t\t\t// in a *resulting* focusin event\n\t\t\t\t\t\ttree._setExpiringValue(\n\t\t\t\t\t\t\t\"mouseDownNode\",\n\t\t\t\t\t\t\ttree._lastMousedownNode\n\t\t\t\t\t\t);\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"click\" + ns + \" dblclick\" + ns, function (event) {\n\t\t\t\t\t\tif (opts.disabled) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar ctx,\n\t\t\t\t\t\t\tet = FT.getEventTarget(event),\n\t\t\t\t\t\t\tnode = et.node,\n\t\t\t\t\t\t\ttree = self.tree,\n\t\t\t\t\t\t\tprevPhase = tree.phase;\n\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", node);\n\t\t\t\t\t\tif (!node) {\n\t\t\t\t\t\t\treturn true; // Allow bubbling of other events\n\t\t\t\t\t\t}\n\t\t\t\t\t\tctx = tree._makeHookContext(node, event);\n\t\t\t\t\t\t// self.tree.debug(\"event(\" + event.type + \"): node: \", node);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttree.phase = \"userEvent\";\n\t\t\t\t\t\t\tswitch (event.type) {\n\t\t\t\t\t\t\t\tcase \"click\":\n\t\t\t\t\t\t\t\t\tctx.targetType = et.type;\n\t\t\t\t\t\t\t\t\tif (node.isPagingNode()) {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\ttree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\t\t\"clickPaging\",\n\t\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t\t\t) === true\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\"click\",\n\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t) === false\n\t\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t\t: tree._callHook(\"nodeClick\", ctx);\n\t\t\t\t\t\t\t\tcase \"dblclick\":\n\t\t\t\t\t\t\t\t\tctx.targetType = et.type;\n\t\t\t\t\t\t\t\t\treturn tree._triggerNodeEvent(\n\t\t\t\t\t\t\t\t\t\t\"dblclick\",\n\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t\t) === false\n\t\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t\t: tree._callHook(\"nodeDblclick\", ctx);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\ttree.phase = prevPhase;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t},\n\t\t\t/** Return the active node or null.\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetActiveNode: function () {\n\t\t\t\tthis._deprecationWarning(\"getActiveNode\");\n\t\t\t\treturn this.tree.activeNode;\n\t\t\t},\n\t\t\t/** Return the matching node or null.\n\t\t\t * @param {string} key\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetNodeByKey: function (key) {\n\t\t\t\tthis._deprecationWarning(\"getNodeByKey\");\n\t\t\t\treturn this.tree.getNodeByKey(key);\n\t\t\t},\n\t\t\t/** Return the invisible system root node.\n\t\t\t * @returns {FancytreeNode}\n\t\t\t * @deprecated Use methods of the Fancytree instance instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetRootNode: function () {\n\t\t\t\tthis._deprecationWarning(\"getRootNode\");\n\t\t\t\treturn this.tree.rootNode;\n\t\t\t},\n\t\t\t/** Return the current tree instance.\n\t\t\t * @returns {Fancytree}\n\t\t\t * @deprecated Use `$.ui.fancytree.getTree()` instead (<a href=\"Fancytree_Widget.html\">example above</a>).\n\t\t\t */\n\t\t\tgetTree: function () {\n\t\t\t\tthis._deprecationWarning(\"getTree\");\n\t\t\t\treturn this.tree;\n\t\t\t},\n\t\t}\n\t);\n\n\t// $.ui.fancytree was created by the widget factory. Create a local shortcut:\n\tFT = $.ui.fancytree;\n\n\t/**\n\t * Static members in the `$.ui.fancytree` namespace.\n\t * This properties and methods can be accessed without instantiating a concrete\n\t * Fancytree instance.\n\t *\n\t * @example\n\t * // Access static members:\n\t * var node = $.ui.fancytree.getNode(element);\n\t * alert($.ui.fancytree.version);\n\t *\n\t * @mixin Fancytree_Static\n\t */\n\t$.extend(\n\t\t$.ui.fancytree,\n\t\t/** @lends Fancytree_Static# */\n\t\t{\n\t\t\t/** Version number `\"MAJOR.MINOR.PATCH\"`\n\t\t\t * @type {string} */\n\t\t\tversion: \"2.38.1-0\", // Set to semver by 'grunt release'\n\t\t\t/** @type {string}\n\t\t\t * @description `\"production\" for release builds` */\n\t\t\tbuildType: \"production\", // Set to 'production' by 'grunt build'\n\t\t\t/** @type {int}\n\t\t\t * @description 0: silent .. 5: verbose (default: 3 for release builds). */\n\t\t\tdebugLevel: 3, // Set to 3 by 'grunt build'\n\t\t\t// Used by $.ui.fancytree.debug() and as default for tree.options.debugLevel\n\n\t\t\t_nextId: 1,\n\t\t\t_nextNodeKey: 1,\n\t\t\t_extensions: {},\n\t\t\t// focusTree: null,\n\n\t\t\t/** Expose class object as `$.ui.fancytree._FancytreeClass`.\n\t\t\t * Useful to extend `$.ui.fancytree._FancytreeClass.prototype`.\n\t\t\t * @type {Fancytree}\n\t\t\t */\n\t\t\t_FancytreeClass: Fancytree,\n\t\t\t/** Expose class object as $.ui.fancytree._FancytreeNodeClass\n\t\t\t * Useful to extend `$.ui.fancytree._FancytreeNodeClass.prototype`.\n\t\t\t * @type {FancytreeNode}\n\t\t\t */\n\t\t\t_FancytreeNodeClass: FancytreeNode,\n\t\t\t/* Feature checks to provide backwards compatibility */\n\t\t\tjquerySupports: {\n\t\t\t\t// http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at\n\t\t\t\tpositionMyOfs: isVersionAtLeast($.ui.version, 1, 9),\n\t\t\t},\n\t\t\t/** Throw an error if condition fails (debug method).\n\t\t\t * @param {boolean} cond\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tassert: function (cond, msg) {\n\t\t\t\treturn _assert(cond, msg);\n\t\t\t},\n\t\t\t/** Create a new Fancytree instance on a target element.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | string} el Target DOM element or selector\n\t\t\t * @param {FancytreeOptions} [opts] Fancytree options\n\t\t\t * @returns {Fancytree} new tree instance\n\t\t\t * @example\n\t\t\t * var tree = $.ui.fancytree.createTree(\"#tree\", {\n\t\t\t * source: {url: \"my/webservice\"}\n\t\t\t * }); // Create tree for this matching element\n\t\t\t *\n\t\t\t * @since 2.25\n\t\t\t */\n\t\t\tcreateTree: function (el, opts) {\n\t\t\t\tvar $tree = $(el).fancytree(opts);\n\t\t\t\treturn FT.getTree($tree);\n\t\t\t},\n\t\t\t/** Return a function that executes *fn* at most every *timeout* ms.\n\t\t\t * @param {integer} timeout\n\t\t\t * @param {function} fn\n\t\t\t * @param {boolean} [invokeAsap=false]\n\t\t\t * @param {any} [ctx]\n\t\t\t */\n\t\t\tdebounce: function (timeout, fn, invokeAsap, ctx) {\n\t\t\t\tvar timer;\n\t\t\t\tif (arguments.length === 3 && typeof invokeAsap !== \"boolean\") {\n\t\t\t\t\tctx = invokeAsap;\n\t\t\t\t\tinvokeAsap = false;\n\t\t\t\t}\n\t\t\t\treturn function () {\n\t\t\t\t\tvar args = arguments;\n\t\t\t\t\tctx = ctx || this;\n\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\tinvokeAsap && !timer && fn.apply(ctx, args);\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\ttimer = setTimeout(function () {\n\t\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\t\tinvokeAsap || fn.apply(ctx, args);\n\t\t\t\t\t\ttimer = null;\n\t\t\t\t\t}, timeout);\n\t\t\t\t};\n\t\t\t},\n\t\t\t/** Write message to console if debugLevel >= 4\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tdebug: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 4) {\n\t\t\t\t\tconsoleApply(\"log\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Write error message to console if debugLevel >= 1.\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\terror: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 1) {\n\t\t\t\t\tconsoleApply(\"error\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Convert `<`, `>`, `&`, `\"`, `'`, and `/` to the equivalent entities.\n\t\t\t *\n\t\t\t * @param {string} s\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tescapeHtml: function (s) {\n\t\t\t\treturn (\"\" + s).replace(REX_HTML, function (s) {\n\t\t\t\t\treturn ENTITY_MAP[s];\n\t\t\t\t});\n\t\t\t},\n\t\t\t/** Make jQuery.position() arguments backwards compatible, i.e. if\n\t\t\t * jQuery UI version <= 1.8, convert\n\t\t\t * { my: \"left+3 center\", at: \"left bottom\", of: $target }\n\t\t\t * to\n\t\t\t * { my: \"left center\", at: \"left bottom\", of: $target, offset: \"3 0\" }\n\t\t\t *\n\t\t\t * See http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at\n\t\t\t * and http://jsfiddle.net/mar10/6xtu9a4e/\n\t\t\t *\n\t\t\t * @param {object} opts\n\t\t\t * @returns {object} the (potentially modified) original opts hash object\n\t\t\t */\n\t\t\tfixPositionOptions: function (opts) {\n\t\t\t\tif (opts.offset || (\"\" + opts.my + opts.at).indexOf(\"%\") >= 0) {\n\t\t\t\t\t$.error(\n\t\t\t\t\t\t\"expected new position syntax (but '%' is not supported)\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!$.ui.fancytree.jquerySupports.positionMyOfs) {\n\t\t\t\t\tvar // parse 'left+3 center' into ['left+3 center', 'left', '+3', 'center', undefined]\n\t\t\t\t\t\tmyParts = /(\\w+)([+-]?\\d+)?\\s+(\\w+)([+-]?\\d+)?/.exec(\n\t\t\t\t\t\t\topts.my\n\t\t\t\t\t\t),\n\t\t\t\t\t\tatParts = /(\\w+)([+-]?\\d+)?\\s+(\\w+)([+-]?\\d+)?/.exec(\n\t\t\t\t\t\t\topts.at\n\t\t\t\t\t\t),\n\t\t\t\t\t\t// convert to numbers\n\t\t\t\t\t\tdx =\n\t\t\t\t\t\t\t(myParts[2] ? +myParts[2] : 0) +\n\t\t\t\t\t\t\t(atParts[2] ? +atParts[2] : 0),\n\t\t\t\t\t\tdy =\n\t\t\t\t\t\t\t(myParts[4] ? +myParts[4] : 0) +\n\t\t\t\t\t\t\t(atParts[4] ? +atParts[4] : 0);\n\n\t\t\t\t\topts = $.extend({}, opts, {\n\t\t\t\t\t\t// make a copy and overwrite\n\t\t\t\t\t\tmy: myParts[1] + \" \" + myParts[3],\n\t\t\t\t\t\tat: atParts[1] + \" \" + atParts[3],\n\t\t\t\t\t});\n\t\t\t\t\tif (dx || dy) {\n\t\t\t\t\t\topts.offset = \"\" + dx + \" \" + dy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn opts;\n\t\t\t},\n\t\t\t/** Return a {node: FancytreeNode, type: TYPE} object for a mouse event.\n\t\t\t *\n\t\t\t * @param {Event} event Mouse event, e.g. click, ...\n\t\t\t * @returns {object} Return a {node: FancytreeNode, type: TYPE} object\n\t\t\t * TYPE: 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined\n\t\t\t */\n\t\t\tgetEventTarget: function (event) {\n\t\t\t\tvar $target,\n\t\t\t\t\ttree,\n\t\t\t\t\ttcn = event && event.target ? event.target.className : \"\",\n\t\t\t\t\tres = { node: this.getNode(event.target), type: undefined };\n\t\t\t\t// We use a fast version of $(res.node).hasClass()\n\t\t\t\t// See http://jsperf.com/test-for-classname/2\n\t\t\t\tif (/\\bfancytree-title\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"title\";\n\t\t\t\t} else if (/\\bfancytree-expander\\b/.test(tcn)) {\n\t\t\t\t\tres.type =\n\t\t\t\t\t\tres.node.hasChildren() === false\n\t\t\t\t\t\t\t? \"prefix\"\n\t\t\t\t\t\t\t: \"expander\";\n\t\t\t\t\t// }else if( /\\bfancytree-checkbox\\b/.test(tcn) || /\\bfancytree-radio\\b/.test(tcn) ){\n\t\t\t\t} else if (/\\bfancytree-checkbox\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"checkbox\";\n\t\t\t\t} else if (/\\bfancytree(-custom)?-icon\\b/.test(tcn)) {\n\t\t\t\t\tres.type = \"icon\";\n\t\t\t\t} else if (/\\bfancytree-node\\b/.test(tcn)) {\n\t\t\t\t\t// Somewhere near the title\n\t\t\t\t\tres.type = \"title\";\n\t\t\t\t} else if (event && event.target) {\n\t\t\t\t\t$target = $(event.target);\n\t\t\t\t\tif ($target.is(\"ul[role=group]\")) {\n\t\t\t\t\t\t// #nnn: Clicking right to a node may hit the surrounding UL\n\t\t\t\t\t\ttree = res.node && res.node.tree;\n\t\t\t\t\t\t(tree || FT).debug(\"Ignoring click on outer UL.\");\n\t\t\t\t\t\tres.node = null;\n\t\t\t\t\t} else if ($target.closest(\".fancytree-title\").length) {\n\t\t\t\t\t\t// #228: clicking an embedded element inside a title\n\t\t\t\t\t\tres.type = \"title\";\n\t\t\t\t\t} else if ($target.closest(\".fancytree-checkbox\").length) {\n\t\t\t\t\t\t// E.g. <svg> inside checkbox span\n\t\t\t\t\t\tres.type = \"checkbox\";\n\t\t\t\t\t} else if ($target.closest(\".fancytree-expander\").length) {\n\t\t\t\t\t\tres.type = \"expander\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t},\n\t\t\t/** Return a string describing the affected node region for a mouse event.\n\t\t\t *\n\t\t\t * @param {Event} event Mouse event, e.g. click, mousemove, ...\n\t\t\t * @returns {string} 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' | undefined\n\t\t\t */\n\t\t\tgetEventTargetType: function (event) {\n\t\t\t\treturn this.getEventTarget(event).type;\n\t\t\t},\n\t\t\t/** Return a FancytreeNode instance from element, event, or jQuery object.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | Event} el\n\t\t\t * @returns {FancytreeNode} matching node or null\n\t\t\t */\n\t\t\tgetNode: function (el) {\n\t\t\t\tif (el instanceof FancytreeNode) {\n\t\t\t\t\treturn el; // el already was a FancytreeNode\n\t\t\t\t} else if (el instanceof $) {\n\t\t\t\t\tel = el[0]; // el was a jQuery object: use the DOM element\n\t\t\t\t} else if (el.originalEvent !== undefined) {\n\t\t\t\t\tel = el.target; // el was an Event\n\t\t\t\t}\n\t\t\t\twhile (el) {\n\t\t\t\t\tif (el.ftnode) {\n\t\t\t\t\t\treturn el.ftnode;\n\t\t\t\t\t}\n\t\t\t\t\tel = el.parentNode;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\t/** Return a Fancytree instance, from element, index, event, or jQueryObject.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject | Event | integer | string} [el]\n\t\t\t * @returns {Fancytree} matching tree or null\n\t\t\t * @example\n\t\t\t * $.ui.fancytree.getTree(); // Get first Fancytree instance on page\n\t\t\t * $.ui.fancytree.getTree(1); // Get second Fancytree instance on page\n\t\t\t * $.ui.fancytree.getTree(event); // Get tree for this mouse- or keyboard event\n\t\t\t * $.ui.fancytree.getTree(\"foo\"); // Get tree for this `opts.treeId`\n\t\t\t * $.ui.fancytree.getTree(\"#tree\"); // Get tree for this matching element\n\t\t\t *\n\t\t\t * @since 2.13\n\t\t\t */\n\t\t\tgetTree: function (el) {\n\t\t\t\tvar widget,\n\t\t\t\t\torgEl = el;\n\n\t\t\t\tif (el instanceof Fancytree) {\n\t\t\t\t\treturn el; // el already was a Fancytree\n\t\t\t\t}\n\t\t\t\tif (el === undefined) {\n\t\t\t\t\tel = 0; // get first tree\n\t\t\t\t}\n\t\t\t\tif (typeof el === \"number\") {\n\t\t\t\t\tel = $(\".fancytree-container\").eq(el); // el was an integer: return nth instance\n\t\t\t\t} else if (typeof el === \"string\") {\n\t\t\t\t\t// `el` may be a treeId or a selector:\n\t\t\t\t\tel = $(\"#ft-id-\" + orgEl).eq(0);\n\t\t\t\t\tif (!el.length) {\n\t\t\t\t\t\tel = $(orgEl).eq(0); // el was a selector: use first match\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tel instanceof Element ||\n\t\t\t\t\tel instanceof HTMLDocument\n\t\t\t\t) {\n\t\t\t\t\tel = $(el);\n\t\t\t\t} else if (el instanceof $) {\n\t\t\t\t\tel = el.eq(0); // el was a jQuery object: use the first\n\t\t\t\t} else if (el.originalEvent !== undefined) {\n\t\t\t\t\tel = $(el.target); // el was an Event\n\t\t\t\t}\n\t\t\t\t// el is a jQuery object wit one element here\n\t\t\t\tel = el.closest(\":ui-fancytree\");\n\t\t\t\twidget = el.data(\"ui-fancytree\") || el.data(\"fancytree\"); // the latter is required by jQuery <= 1.8\n\t\t\t\treturn widget ? widget.tree : null;\n\t\t\t},\n\t\t\t/** Return an option value that has a default, but may be overridden by a\n\t\t\t * callback or a node instance attribute.\n\t\t\t *\n\t\t\t * Evaluation sequence:\n\t\t\t *\n\t\t\t * If `tree.options.<optionName>` is a callback that returns something, use that.\n\t\t\t * Else if `node.<optionName>` is defined, use that.\n\t\t\t * Else if `tree.options.<optionName>` is a value, use that.\n\t\t\t * Else use `defaultValue`.\n\t\t\t *\n\t\t\t * @param {string} optionName name of the option property (on node and tree)\n\t\t\t * @param {FancytreeNode} node passed to the callback\n\t\t\t * @param {object} nodeObject where to look for the local option property, e.g. `node` or `node.data`\n\t\t\t * @param {object} treeOption where to look for the tree option, e.g. `tree.options` or `tree.options.dnd5`\n\t\t\t * @param {any} [defaultValue]\n\t\t\t * @returns {any}\n\t\t\t *\n\t\t\t * @example\n\t\t\t * // Check for node.foo, tree,options.foo(), and tree.options.foo:\n\t\t\t * $.ui.fancytree.evalOption(\"foo\", node, node, tree.options);\n\t\t\t * // Check for node.data.bar, tree,options.qux.bar(), and tree.options.qux.bar:\n\t\t\t * $.ui.fancytree.evalOption(\"bar\", node, node.data, tree.options.qux);\n\t\t\t *\n\t\t\t * @since 2.22\n\t\t\t */\n\t\t\tevalOption: function (\n\t\t\t\toptionName,\n\t\t\t\tnode,\n\t\t\t\tnodeObject,\n\t\t\t\ttreeOptions,\n\t\t\t\tdefaultValue\n\t\t\t) {\n\t\t\t\tvar ctx,\n\t\t\t\t\tres,\n\t\t\t\t\ttree = node.tree,\n\t\t\t\t\ttreeOpt = treeOptions[optionName],\n\t\t\t\t\tnodeOpt = nodeObject[optionName];\n\n\t\t\t\tif (_isFunction(treeOpt)) {\n\t\t\t\t\tctx = {\n\t\t\t\t\t\tnode: node,\n\t\t\t\t\t\ttree: tree,\n\t\t\t\t\t\twidget: tree.widget,\n\t\t\t\t\t\toptions: tree.widget.options,\n\t\t\t\t\t\ttypeInfo: tree.types[node.type] || {},\n\t\t\t\t\t};\n\t\t\t\t\tres = treeOpt.call(tree, { type: optionName }, ctx);\n\t\t\t\t\tif (res == null) {\n\t\t\t\t\t\tres = nodeOpt;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tres = nodeOpt == null ? treeOpt : nodeOpt;\n\t\t\t\t}\n\t\t\t\tif (res == null) {\n\t\t\t\t\tres = defaultValue; // no option set at all: return default\n\t\t\t\t}\n\t\t\t\treturn res;\n\t\t\t},\n\t\t\t/** Set expander, checkbox, or node icon, supporting string and object format.\n\t\t\t *\n\t\t\t * @param {Element | jQueryObject} span\n\t\t\t * @param {string} baseClass\n\t\t\t * @param {string | object} icon\n\t\t\t * @since 2.27\n\t\t\t */\n\t\t\tsetSpanIcon: function (span, baseClass, icon) {\n\t\t\t\tvar $span = $(span);\n\n\t\t\t\tif (typeof icon === \"string\") {\n\t\t\t\t\t$span.attr(\"class\", baseClass + \" \" + icon);\n\t\t\t\t} else {\n\t\t\t\t\t// support object syntax: { text: ligature, addClasse: classname }\n\t\t\t\t\tif (icon.text) {\n\t\t\t\t\t\t$span.text(\"\" + icon.text);\n\t\t\t\t\t} else if (icon.html) {\n\t\t\t\t\t\tspan.innerHTML = icon.html;\n\t\t\t\t\t}\n\t\t\t\t\t$span.attr(\n\t\t\t\t\t\t\"class\",\n\t\t\t\t\t\tbaseClass + \" \" + (icon.addClass || \"\")\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/** Convert a keydown or mouse event to a canonical string like 'ctrl+a',\n\t\t\t * 'ctrl+shift+f2', 'shift+leftdblclick'.\n\t\t\t *\n\t\t\t * This is especially handy for switch-statements in event handlers.\n\t\t\t *\n\t\t\t * @param {event}\n\t\t\t * @returns {string}\n\t\t\t *\n\t\t\t * @example\n\n\t\t\tswitch( $.ui.fancytree.eventToString(event) ) {\n\t\t\t\tcase \"-\":\n\t\t\t\t\ttree.nodeSetExpanded(ctx, false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"shift+return\":\n\t\t\t\t\ttree.nodeSetActive(ctx, true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"down\":\n\t\t\t\t\tres = node.navigate(event.which, activate);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\thandled = false;\n\t\t\t}\n\t\t\tif( handled ){\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\t*/\n\t\t\teventToString: function (event) {\n\t\t\t\t// Poor-man's hotkeys. See here for a complete implementation:\n\t\t\t\t// https://github.com/jeresig/jquery.hotkeys\n\t\t\t\tvar which = event.which,\n\t\t\t\t\tet = event.type,\n\t\t\t\t\ts = [];\n\n\t\t\t\tif (event.altKey) {\n\t\t\t\t\ts.push(\"alt\");\n\t\t\t\t}\n\t\t\t\tif (event.ctrlKey) {\n\t\t\t\t\ts.push(\"ctrl\");\n\t\t\t\t}\n\t\t\t\tif (event.metaKey) {\n\t\t\t\t\ts.push(\"meta\");\n\t\t\t\t}\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\ts.push(\"shift\");\n\t\t\t\t}\n\n\t\t\t\tif (et === \"click\" || et === \"dblclick\") {\n\t\t\t\t\ts.push(MOUSE_BUTTONS[event.button] + et);\n\t\t\t\t} else if (et === \"wheel\") {\n\t\t\t\t\ts.push(et);\n\t\t\t\t} else if (!IGNORE_KEYCODES[which]) {\n\t\t\t\t\ts.push(\n\t\t\t\t\t\tSPECIAL_KEYCODES[which] ||\n\t\t\t\t\t\t\tString.fromCharCode(which).toLowerCase()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn s.join(\"+\");\n\t\t\t},\n\t\t\t/** Write message to console if debugLevel >= 3\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\tinfo: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 3) {\n\t\t\t\t\tconsoleApply(\"info\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t\t/* @deprecated: use eventToString(event) instead.\n\t\t\t */\n\t\t\tkeyEventToString: function (event) {\n\t\t\t\tthis.warn(\n\t\t\t\t\t\"keyEventToString() is deprecated: use eventToString()\"\n\t\t\t\t);\n\t\t\t\treturn this.eventToString(event);\n\t\t\t},\n\t\t\t/** Return a wrapped handler method, that provides `this._super`.\n\t\t\t *\n\t\t\t * @example\n\t\t\t\t// Implement `opts.createNode` event to add the 'draggable' attribute\n\t\t\t\t$.ui.fancytree.overrideMethod(ctx.options, \"createNode\", function(event, data) {\n\t\t\t\t\t// Default processing if any\n\t\t\t\t\tthis._super.apply(this, arguments);\n\t\t\t\t\t// Add 'draggable' attribute\n\t\t\t\t\tdata.node.span.draggable = true;\n\t\t\t\t});\n\t\t\t *\n\t\t\t * @param {object} instance\n\t\t\t * @param {string} methodName\n\t\t\t * @param {function} handler\n\t\t\t * @param {object} [context] optional context\n\t\t\t */\n\t\t\toverrideMethod: function (instance, methodName, handler, context) {\n\t\t\t\tvar prevSuper,\n\t\t\t\t\t_super = instance[methodName] || $.noop;\n\n\t\t\t\tinstance[methodName] = function () {\n\t\t\t\t\tvar self = context || this;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tprevSuper = self._super;\n\t\t\t\t\t\tself._super = _super;\n\t\t\t\t\t\treturn handler.apply(self, arguments);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tself._super = prevSuper;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\t\t\t/**\n\t\t\t * Parse tree data from HTML <ul> markup\n\t\t\t *\n\t\t\t * @param {jQueryObject} $ul\n\t\t\t * @returns {NodeData[]}\n\t\t\t */\n\t\t\tparseHtml: function ($ul) {\n\t\t\t\tvar classes,\n\t\t\t\t\tclassName,\n\t\t\t\t\textraClasses,\n\t\t\t\t\ti,\n\t\t\t\t\tiPos,\n\t\t\t\t\tl,\n\t\t\t\t\ttmp,\n\t\t\t\t\ttmp2,\n\t\t\t\t\t$children = $ul.find(\">li\"),\n\t\t\t\t\tchildren = [];\n\n\t\t\t\t$children.each(function () {\n\t\t\t\t\tvar allData,\n\t\t\t\t\t\tlowerCaseAttr,\n\t\t\t\t\t\t$li = $(this),\n\t\t\t\t\t\t$liSpan = $li.find(\">span\", this).first(),\n\t\t\t\t\t\t$liA = $liSpan.length ? null : $li.find(\">a\").first(),\n\t\t\t\t\t\td = { tooltip: null, data: {} };\n\n\t\t\t\t\tif ($liSpan.length) {\n\t\t\t\t\t\td.title = $liSpan.html();\n\t\t\t\t\t} else if ($liA && $liA.length) {\n\t\t\t\t\t\t// If a <li><a> tag is specified, use it literally and extract href/target.\n\t\t\t\t\t\td.title = $liA.html();\n\t\t\t\t\t\td.data.href = $liA.attr(\"href\");\n\t\t\t\t\t\td.data.target = $liA.attr(\"target\");\n\t\t\t\t\t\td.tooltip = $liA.attr(\"title\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If only a <li> tag is specified, use the trimmed string up to\n\t\t\t\t\t\t// the next child <ul> tag.\n\t\t\t\t\t\td.title = $li.html();\n\t\t\t\t\t\tiPos = d.title.search(/<ul/i);\n\t\t\t\t\t\tif (iPos >= 0) {\n\t\t\t\t\t\t\td.title = d.title.substring(0, iPos);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\td.title = _trim(d.title);\n\n\t\t\t\t\t// Make sure all fields exist\n\t\t\t\t\tfor (i = 0, l = CLASS_ATTRS.length; i < l; i++) {\n\t\t\t\t\t\td[CLASS_ATTRS[i]] = undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// Initialize to `true`, if class is set and collect extraClasses\n\t\t\t\t\tclasses = this.className.split(\" \");\n\t\t\t\t\textraClasses = [];\n\t\t\t\t\tfor (i = 0, l = classes.length; i < l; i++) {\n\t\t\t\t\t\tclassName = classes[i];\n\t\t\t\t\t\tif (CLASS_ATTR_MAP[className]) {\n\t\t\t\t\t\t\td[className] = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\textraClasses.push(className);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\td.extraClasses = extraClasses.join(\" \");\n\n\t\t\t\t\t// Parse node options from ID, title and class attributes\n\t\t\t\t\ttmp = $li.attr(\"title\");\n\t\t\t\t\tif (tmp) {\n\t\t\t\t\t\td.tooltip = tmp; // overrides <a title='...'>\n\t\t\t\t\t}\n\t\t\t\t\ttmp = $li.attr(\"id\");\n\t\t\t\t\tif (tmp) {\n\t\t\t\t\t\td.key = tmp;\n\t\t\t\t\t}\n\t\t\t\t\t// Translate hideCheckbox -> checkbox:false\n\t\t\t\t\tif ($li.attr(\"hideCheckbox\")) {\n\t\t\t\t\t\td.checkbox = false;\n\t\t\t\t\t}\n\t\t\t\t\t// Add <li data-NAME='...'> as node.data.NAME\n\t\t\t\t\tallData = _getElementDataAsDict($li);\n\t\t\t\t\tif (allData && !$.isEmptyObject(allData)) {\n\t\t\t\t\t\t// #507: convert data-hidecheckbox (lower case) to hideCheckbox\n\t\t\t\t\t\tfor (lowerCaseAttr in NODE_ATTR_LOWERCASE_MAP) {\n\t\t\t\t\t\t\tif (_hasProp(allData, lowerCaseAttr)) {\n\t\t\t\t\t\t\t\tallData[\n\t\t\t\t\t\t\t\t\tNODE_ATTR_LOWERCASE_MAP[lowerCaseAttr]\n\t\t\t\t\t\t\t\t] = allData[lowerCaseAttr];\n\t\t\t\t\t\t\t\tdelete allData[lowerCaseAttr];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// #56: Allow to set special node.attributes from data-...\n\t\t\t\t\t\tfor (i = 0, l = NODE_ATTRS.length; i < l; i++) {\n\t\t\t\t\t\t\ttmp = NODE_ATTRS[i];\n\t\t\t\t\t\t\ttmp2 = allData[tmp];\n\t\t\t\t\t\t\tif (tmp2 != null) {\n\t\t\t\t\t\t\t\tdelete allData[tmp];\n\t\t\t\t\t\t\t\td[tmp] = tmp2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// All other data-... goes to node.data...\n\t\t\t\t\t\t$.extend(d.data, allData);\n\t\t\t\t\t}\n\t\t\t\t\t// Recursive reading of child nodes, if LI tag contains an UL tag\n\t\t\t\t\t$ul = $li.find(\">ul\").first();\n\t\t\t\t\tif ($ul.length) {\n\t\t\t\t\t\td.children = $.ui.fancytree.parseHtml($ul);\n\t\t\t\t\t} else {\n\t\t\t\t\t\td.children = d.lazy ? undefined : null;\n\t\t\t\t\t}\n\t\t\t\t\tchildren.push(d);\n\t\t\t\t\t// FT.debug(\"parse \", d, children);\n\t\t\t\t});\n\t\t\t\treturn children;\n\t\t\t},\n\t\t\t/** Add Fancytree extension definition to the list of globally available extensions.\n\t\t\t *\n\t\t\t * @param {object} definition\n\t\t\t */\n\t\t\tregisterExtension: function (definition) {\n\t\t\t\t_assert(\n\t\t\t\t\tdefinition.name != null,\n\t\t\t\t\t\"extensions must have a `name` property.\"\n\t\t\t\t);\n\t\t\t\t_assert(\n\t\t\t\t\tdefinition.version != null,\n\t\t\t\t\t\"extensions must have a `version` property.\"\n\t\t\t\t);\n\t\t\t\t$.ui.fancytree._extensions[definition.name] = definition;\n\t\t\t},\n\t\t\t/** Replacement for the deprecated `jQuery.trim()`.\n\t\t\t *\n\t\t\t * @param {string} text\n\t\t\t */\n\t\t\ttrim: _trim,\n\t\t\t/** Inverse of escapeHtml().\n\t\t\t *\n\t\t\t * @param {string} s\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tunescapeHtml: function (s) {\n\t\t\t\tvar e = document.createElement(\"div\");\n\t\t\t\te.innerHTML = s;\n\t\t\t\treturn e.childNodes.length === 0\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: e.childNodes[0].nodeValue;\n\t\t\t},\n\t\t\t/** Write warning message to console if debugLevel >= 2.\n\t\t\t * @param {string} msg\n\t\t\t */\n\t\t\twarn: function (msg) {\n\t\t\t\tif ($.ui.fancytree.debugLevel >= 2) {\n\t\t\t\t\tconsoleApply(\"warn\", arguments);\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t);\n\n\t// Value returned by `require('jquery.fancytree')`\n\treturn $.ui.fancytree;\n}); // End of closure\n","/*! jQuery UI - v1.12.1 - 2018-05-20\n* http://jqueryui.com\n* Includes: widget.js, position.js, keycode.js, scroll-parent.js, unique-id.js\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\n\n;(function( factory ) {\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\t// AMD. Register as an anonymous module.\n\t\tdefine( [ \"jquery\" ], factory );\n\t} else if ( typeof module === \"object\" && module.exports ) {\n\t\t// Node/CommonJS\n\t\tmodule.exports = factory(require(\"jquery\"));\n\t} else {\n\t\t// Browser globals\n\t\tfactory( jQuery );\n\t}\n}(function( $ ) {\n\n$.ui = $.ui || {};\n\nvar version = $.ui.version = \"1.12.1\";\n\n\n/*!\n * jQuery UI Widget 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Widget\n//>>group: Core\n//>>description: Provides a factory for creating stateful widgets with a common API.\n//>>docs: http://api.jqueryui.com/jQuery.widget/\n//>>demos: http://jqueryui.com/widget/\n\n\n\nvar widgetUuid = 0;\nvar widgetSlice = Array.prototype.slice;\n\n$.cleanData = $.cleanData || ( function( orig ) {\n\treturn function( elems ) {\n\t\tvar events, elem, i;\n\t\tfor ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\ttry {\n\n\t\t\t\t// Only trigger remove when necessary to save time\n\t\t\t\tevents = $._data( elem, \"events\" );\n\t\t\t\tif ( events && events.remove ) {\n\t\t\t\t\t$( elem ).triggerHandler( \"remove\" );\n\t\t\t\t}\n\n\t\t\t// Http://bugs.jquery.com/ticket/8235\n\t\t\t} catch ( e ) {}\n\t\t}\n\t\torig( elems );\n\t};\n} )( $.cleanData );\n\n$.widget = $.widget || function( name, base, prototype ) {\n\tvar existingConstructor, constructor, basePrototype;\n\n\t// ProxiedPrototype allows the provided prototype to remain unmodified\n\t// so that it can be used as a mixin for multiple widgets (#8876)\n\tvar proxiedPrototype = {};\n\n\tvar namespace = name.split( \".\" )[ 0 ];\n\tname = name.split( \".\" )[ 1 ];\n\tvar fullName = namespace + \"-\" + name;\n\n\tif ( !prototype ) {\n\t\tprototype = base;\n\t\tbase = $.Widget;\n\t}\n\n\tif ( $.isArray( prototype ) ) {\n\t\tprototype = $.extend.apply( null, [ {} ].concat( prototype ) );\n\t}\n\n\t// Create selector for plugin\n\t$.expr[ \":\" ][ fullName.toLowerCase() ] = function( elem ) {\n\t\treturn !!$.data( elem, fullName );\n\t};\n\n\t$[ namespace ] = $[ namespace ] || {};\n\texistingConstructor = $[ namespace ][ name ];\n\tconstructor = $[ namespace ][ name ] = function( options, element ) {\n\n\t\t// Allow instantiation without \"new\" keyword\n\t\tif ( !this._createWidget ) {\n\t\t\treturn new constructor( options, element );\n\t\t}\n\n\t\t// Allow instantiation without initializing for simple inheritance\n\t\t// must use \"new\" keyword (the code above always passes args)\n\t\tif ( arguments.length ) {\n\t\t\tthis._createWidget( options, element );\n\t\t}\n\t};\n\n\t// Extend with the existing constructor to carry over any static properties\n\t$.extend( constructor, existingConstructor, {\n\t\tversion: prototype.version,\n\n\t\t// Copy the object used to create the prototype in case we need to\n\t\t// redefine the widget later\n\t\t_proto: $.extend( {}, prototype ),\n\n\t\t// Track widgets that inherit from this widget in case this widget is\n\t\t// redefined after a widget inherits from it\n\t\t_childConstructors: []\n\t} );\n\n\tbasePrototype = new base();\n\n\t// We need to make the options hash a property directly on the new instance\n\t// otherwise we'll modify the options hash on the prototype that we're\n\t// inheriting from\n\tbasePrototype.options = $.widget.extend( {}, basePrototype.options );\n\t$.each( prototype, function( prop, value ) {\n\t\tif ( !$.isFunction( value ) ) {\n\t\t\tproxiedPrototype[ prop ] = value;\n\t\t\treturn;\n\t\t}\n\t\tproxiedPrototype[ prop ] = ( function() {\n\t\t\tfunction _super() {\n\t\t\t\treturn base.prototype[ prop ].apply( this, arguments );\n\t\t\t}\n\n\t\t\tfunction _superApply( args ) {\n\t\t\t\treturn base.prototype[ prop ].apply( this, args );\n\t\t\t}\n\n\t\t\treturn function() {\n\t\t\t\tvar __super = this._super;\n\t\t\t\tvar __superApply = this._superApply;\n\t\t\t\tvar returnValue;\n\n\t\t\t\tthis._super = _super;\n\t\t\t\tthis._superApply = _superApply;\n\n\t\t\t\treturnValue = value.apply( this, arguments );\n\n\t\t\t\tthis._super = __super;\n\t\t\t\tthis._superApply = __superApply;\n\n\t\t\t\treturn returnValue;\n\t\t\t};\n\t\t} )();\n\t} );\n\tconstructor.prototype = $.widget.extend( basePrototype, {\n\n\t\t// TODO: remove support for widgetEventPrefix\n\t\t// always use the name + a colon as the prefix, e.g., draggable:start\n\t\t// don't prefix for widgets that aren't DOM-based\n\t\twidgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name\n\t}, proxiedPrototype, {\n\t\tconstructor: constructor,\n\t\tnamespace: namespace,\n\t\twidgetName: name,\n\t\twidgetFullName: fullName\n\t} );\n\n\t// If this widget is being redefined then we need to find all widgets that\n\t// are inheriting from it and redefine all of them so that they inherit from\n\t// the new version of this widget. We're essentially trying to replace one\n\t// level in the prototype chain.\n\tif ( existingConstructor ) {\n\t\t$.each( existingConstructor._childConstructors, function( i, child ) {\n\t\t\tvar childPrototype = child.prototype;\n\n\t\t\t// Redefine the child widget using the same prototype that was\n\t\t\t// originally used, but inherit from the new version of the base\n\t\t\t$.widget( childPrototype.namespace + \".\" + childPrototype.widgetName, constructor,\n\t\t\t\tchild._proto );\n\t\t} );\n\n\t\t// Remove the list of existing child constructors from the old constructor\n\t\t// so the old child constructors can be garbage collected\n\t\tdelete existingConstructor._childConstructors;\n\t} else {\n\t\tbase._childConstructors.push( constructor );\n\t}\n\n\t$.widget.bridge( name, constructor );\n\n\treturn constructor;\n};\n\n$.widget.extend = function( target ) {\n\tvar input = widgetSlice.call( arguments, 1 );\n\tvar inputIndex = 0;\n\tvar inputLength = input.length;\n\tvar key;\n\tvar value;\n\n\tfor ( ; inputIndex < inputLength; inputIndex++ ) {\n\t\tfor ( key in input[ inputIndex ] ) {\n\t\t\tvalue = input[ inputIndex ][ key ];\n\t\t\tif ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {\n\n\t\t\t\t// Clone objects\n\t\t\t\tif ( $.isPlainObject( value ) ) {\n\t\t\t\t\ttarget[ key ] = $.isPlainObject( target[ key ] ) ?\n\t\t\t\t\t\t$.widget.extend( {}, target[ key ], value ) :\n\n\t\t\t\t\t\t// Don't extend strings, arrays, etc. with objects\n\t\t\t\t\t\t$.widget.extend( {}, value );\n\n\t\t\t\t// Copy everything else by reference\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn target;\n};\n\n$.widget.bridge = function( name, object ) {\n\tvar fullName = object.prototype.widgetFullName || name;\n\t$.fn[ name ] = function( options ) {\n\t\tvar isMethodCall = typeof options === \"string\";\n\t\tvar args = widgetSlice.call( arguments, 1 );\n\t\tvar returnValue = this;\n\n\t\tif ( isMethodCall ) {\n\n\t\t\t// If this is an empty collection, we need to have the instance method\n\t\t\t// return undefined instead of the jQuery instance\n\t\t\tif ( !this.length && options === \"instance\" ) {\n\t\t\t\treturnValue = undefined;\n\t\t\t} else {\n\t\t\t\tthis.each( function() {\n\t\t\t\t\tvar methodValue;\n\t\t\t\t\tvar instance = $.data( this, fullName );\n\n\t\t\t\t\tif ( options === \"instance\" ) {\n\t\t\t\t\t\treturnValue = instance;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !instance ) {\n\t\t\t\t\t\treturn $.error( \"cannot call methods on \" + name +\n\t\t\t\t\t\t\t\" prior to initialization; \" +\n\t\t\t\t\t\t\t\"attempted to call method '\" + options + \"'\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === \"_\" ) {\n\t\t\t\t\t\treturn $.error( \"no such method '\" + options + \"' for \" + name +\n\t\t\t\t\t\t\t\" widget instance\" );\n\t\t\t\t\t}\n\n\t\t\t\t\tmethodValue = instance[ options ].apply( instance, args );\n\n\t\t\t\t\tif ( methodValue !== instance && methodValue !== undefined ) {\n\t\t\t\t\t\treturnValue = methodValue && methodValue.jquery ?\n\t\t\t\t\t\t\treturnValue.pushStack( methodValue.get() ) :\n\t\t\t\t\t\t\tmethodValue;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Allow multiple hashes to be passed on init\n\t\t\tif ( args.length ) {\n\t\t\t\toptions = $.widget.extend.apply( null, [ options ].concat( args ) );\n\t\t\t}\n\n\t\t\tthis.each( function() {\n\t\t\t\tvar instance = $.data( this, fullName );\n\t\t\t\tif ( instance ) {\n\t\t\t\t\tinstance.option( options || {} );\n\t\t\t\t\tif ( instance._init ) {\n\t\t\t\t\t\tinstance._init();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$.data( this, fullName, new object( options, this ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn returnValue;\n\t};\n};\n\n$.Widget = $.Widget || function( /* options, element */ ) {};\n$.Widget._childConstructors = [];\n\n$.Widget.prototype = {\n\twidgetName: \"widget\",\n\twidgetEventPrefix: \"\",\n\tdefaultElement: \"<div>\",\n\n\toptions: {\n\t\tclasses: {},\n\t\tdisabled: false,\n\n\t\t// Callbacks\n\t\tcreate: null\n\t},\n\n\t_createWidget: function( options, element ) {\n\t\telement = $( element || this.defaultElement || this )[ 0 ];\n\t\tthis.element = $( element );\n\t\tthis.uuid = widgetUuid++;\n\t\tthis.eventNamespace = \".\" + this.widgetName + this.uuid;\n\n\t\tthis.bindings = $();\n\t\tthis.hoverable = $();\n\t\tthis.focusable = $();\n\t\tthis.classesElementLookup = {};\n\n\t\tif ( element !== this ) {\n\t\t\t$.data( element, this.widgetFullName, this );\n\t\t\tthis._on( true, this.element, {\n\t\t\t\tremove: function( event ) {\n\t\t\t\t\tif ( event.target === element ) {\n\t\t\t\t\t\tthis.destroy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\tthis.document = $( element.style ?\n\n\t\t\t\t// Element within the document\n\t\t\t\telement.ownerDocument :\n\n\t\t\t\t// Element is window or document\n\t\t\t\telement.document || element );\n\t\t\tthis.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );\n\t\t}\n\n\t\tthis.options = $.widget.extend( {},\n\t\t\tthis.options,\n\t\t\tthis._getCreateOptions(),\n\t\t\toptions );\n\n\t\tthis._create();\n\n\t\tif ( this.options.disabled ) {\n\t\t\tthis._setOptionDisabled( this.options.disabled );\n\t\t}\n\n\t\tthis._trigger( \"create\", null, this._getCreateEventData() );\n\t\tthis._init();\n\t},\n\n\t_getCreateOptions: function() {\n\t\treturn {};\n\t},\n\n\t_getCreateEventData: $.noop,\n\n\t_create: $.noop,\n\n\t_init: $.noop,\n\n\tdestroy: function() {\n\t\tvar that = this;\n\n\t\tthis._destroy();\n\t\t$.each( this.classesElementLookup, function( key, value ) {\n\t\t\tthat._removeClass( value, key );\n\t\t} );\n\n\t\t// We can probably remove the unbind calls in 2.0\n\t\t// all event bindings should go through this._on()\n\t\tthis.element\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeData( this.widgetFullName );\n\t\tthis.widget()\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeAttr( \"aria-disabled\" );\n\n\t\t// Clean up events and states\n\t\tthis.bindings.off( this.eventNamespace );\n\t},\n\n\t_destroy: $.noop,\n\n\twidget: function() {\n\t\treturn this.element;\n\t},\n\n\toption: function( key, value ) {\n\t\tvar options = key;\n\t\tvar parts;\n\t\tvar curOption;\n\t\tvar i;\n\n\t\tif ( arguments.length === 0 ) {\n\n\t\t\t// Don't return a reference to the internal hash\n\t\t\treturn $.widget.extend( {}, this.options );\n\t\t}\n\n\t\tif ( typeof key === \"string\" ) {\n\n\t\t\t// Handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\n\t\t\toptions = {};\n\t\t\tparts = key.split( \".\" );\n\t\t\tkey = parts.shift();\n\t\t\tif ( parts.length ) {\n\t\t\t\tcurOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );\n\t\t\t\tfor ( i = 0; i < parts.length - 1; i++ ) {\n\t\t\t\t\tcurOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};\n\t\t\t\t\tcurOption = curOption[ parts[ i ] ];\n\t\t\t\t}\n\t\t\t\tkey = parts.pop();\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn curOption[ key ] === undefined ? null : curOption[ key ];\n\t\t\t\t}\n\t\t\t\tcurOption[ key ] = value;\n\t\t\t} else {\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn this.options[ key ] === undefined ? null : this.options[ key ];\n\t\t\t\t}\n\t\t\t\toptions[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tthis._setOptions( options );\n\n\t\treturn this;\n\t},\n\n\t_setOptions: function( options ) {\n\t\tvar key;\n\n\t\tfor ( key in options ) {\n\t\t\tthis._setOption( key, options[ key ] );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === \"classes\" ) {\n\t\t\tthis._setOptionClasses( value );\n\t\t}\n\n\t\tthis.options[ key ] = value;\n\n\t\tif ( key === \"disabled\" ) {\n\t\t\tthis._setOptionDisabled( value );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOptionClasses: function( value ) {\n\t\tvar classKey, elements, currentElements;\n\n\t\tfor ( classKey in value ) {\n\t\t\tcurrentElements = this.classesElementLookup[ classKey ];\n\t\t\tif ( value[ classKey ] === this.options.classes[ classKey ] ||\n\t\t\t\t\t!currentElements ||\n\t\t\t\t\t!currentElements.length ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We are doing this to create a new jQuery object because the _removeClass() call\n\t\t\t// on the next line is going to destroy the reference to the current elements being\n\t\t\t// tracked. We need to save a copy of this collection so that we can add the new classes\n\t\t\t// below.\n\t\t\telements = $( currentElements.get() );\n\t\t\tthis._removeClass( currentElements, classKey );\n\n\t\t\t// We don't use _addClass() here, because that uses this.options.classes\n\t\t\t// for generating the string of classes. We want to use the value passed in from\n\t\t\t// _setOption(), this is the new value of the classes option which was passed to\n\t\t\t// _setOption(). We pass this value directly to _classes().\n\t\t\telements.addClass( this._classes( {\n\t\t\t\telement: elements,\n\t\t\t\tkeys: classKey,\n\t\t\t\tclasses: value,\n\t\t\t\tadd: true\n\t\t\t} ) );\n\t\t}\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._toggleClass( this.widget(), this.widgetFullName + \"-disabled\", null, !!value );\n\n\t\t// If the widget is becoming disabled, then nothing is interactive\n\t\tif ( value ) {\n\t\t\tthis._removeClass( this.hoverable, null, \"ui-state-hover\" );\n\t\t\tthis._removeClass( this.focusable, null, \"ui-state-focus\" );\n\t\t}\n\t},\n\n\tenable: function() {\n\t\treturn this._setOptions( { disabled: false } );\n\t},\n\n\tdisable: function() {\n\t\treturn this._setOptions( { disabled: true } );\n\t},\n\n\t_classes: function( options ) {\n\t\tvar full = [];\n\t\tvar that = this;\n\n\t\toptions = $.extend( {\n\t\t\telement: this.element,\n\t\t\tclasses: this.options.classes || {}\n\t\t}, options );\n\n\t\tfunction processClassString( classes, checkOption ) {\n\t\t\tvar current, i;\n\t\t\tfor ( i = 0; i < classes.length; i++ ) {\n\t\t\t\tcurrent = that.classesElementLookup[ classes[ i ] ] || $();\n\t\t\t\tif ( options.add ) {\n\t\t\t\t\tcurrent = $( $.unique( current.get().concat( options.element.get() ) ) );\n\t\t\t\t} else {\n\t\t\t\t\tcurrent = $( current.not( options.element ).get() );\n\t\t\t\t}\n\t\t\t\tthat.classesElementLookup[ classes[ i ] ] = current;\n\t\t\t\tfull.push( classes[ i ] );\n\t\t\t\tif ( checkOption && options.classes[ classes[ i ] ] ) {\n\t\t\t\t\tfull.push( options.classes[ classes[ i ] ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._on( options.element, {\n\t\t\t\"remove\": \"_untrackClassesElement\"\n\t\t} );\n\n\t\tif ( options.keys ) {\n\t\t\tprocessClassString( options.keys.match( /\\S+/g ) || [], true );\n\t\t}\n\t\tif ( options.extra ) {\n\t\t\tprocessClassString( options.extra.match( /\\S+/g ) || [] );\n\t\t}\n\n\t\treturn full.join( \" \" );\n\t},\n\n\t_untrackClassesElement: function( event ) {\n\t\tvar that = this;\n\t\t$.each( that.classesElementLookup, function( key, value ) {\n\t\t\tif ( $.inArray( event.target, value ) !== -1 ) {\n\t\t\t\tthat.classesElementLookup[ key ] = $( value.not( event.target ).get() );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_removeClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, false );\n\t},\n\n\t_addClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, true );\n\t},\n\n\t_toggleClass: function( element, keys, extra, add ) {\n\t\tadd = ( typeof add === \"boolean\" ) ? add : extra;\n\t\tvar shift = ( typeof element === \"string\" || element === null ),\n\t\t\toptions = {\n\t\t\t\textra: shift ? keys : extra,\n\t\t\t\tkeys: shift ? element : keys,\n\t\t\t\telement: shift ? this.element : element,\n\t\t\t\tadd: add\n\t\t\t};\n\t\toptions.element.toggleClass( this._classes( options ), add );\n\t\treturn this;\n\t},\n\n\t_on: function( suppressDisabledCheck, element, handlers ) {\n\t\tvar delegateElement;\n\t\tvar instance = this;\n\n\t\t// No suppressDisabledCheck flag, shuffle arguments\n\t\tif ( typeof suppressDisabledCheck !== \"boolean\" ) {\n\t\t\thandlers = element;\n\t\t\telement = suppressDisabledCheck;\n\t\t\tsuppressDisabledCheck = false;\n\t\t}\n\n\t\t// No element argument, shuffle and use this.element\n\t\tif ( !handlers ) {\n\t\t\thandlers = element;\n\t\t\telement = this.element;\n\t\t\tdelegateElement = this.widget();\n\t\t} else {\n\t\t\telement = delegateElement = $( element );\n\t\t\tthis.bindings = this.bindings.add( element );\n\t\t}\n\n\t\t$.each( handlers, function( event, handler ) {\n\t\t\tfunction handlerProxy() {\n\n\t\t\t\t// Allow widgets to customize the disabled handling\n\t\t\t\t// - disabled as an array instead of boolean\n\t\t\t\t// - disabled class as method for disabling individual parts\n\t\t\t\tif ( !suppressDisabledCheck &&\n\t\t\t\t\t\t( instance.options.disabled === true ||\n\t\t\t\t\t\t$( this ).hasClass( \"ui-state-disabled\" ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t\t.apply( instance, arguments );\n\t\t\t}\n\n\t\t\t// Copy the guid so direct unbinding works\n\t\t\tif ( typeof handler !== \"string\" ) {\n\t\t\t\thandlerProxy.guid = handler.guid =\n\t\t\t\t\thandler.guid || handlerProxy.guid || $.guid++;\n\t\t\t}\n\n\t\t\tvar match = event.match( /^([\\w:-]*)\\s*(.*)$/ );\n\t\t\tvar eventName = match[ 1 ] + instance.eventNamespace;\n\t\t\tvar selector = match[ 2 ];\n\n\t\t\tif ( selector ) {\n\t\t\t\tdelegateElement.on( eventName, selector, handlerProxy );\n\t\t\t} else {\n\t\t\t\telement.on( eventName, handlerProxy );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_off: function( element, eventName ) {\n\t\teventName = ( eventName || \"\" ).split( \" \" ).join( this.eventNamespace + \" \" ) +\n\t\t\tthis.eventNamespace;\n\t\telement.off( eventName ).off( eventName );\n\n\t\t// Clear the stack to avoid memory leaks (#10056)\n\t\tthis.bindings = $( this.bindings.not( element ).get() );\n\t\tthis.focusable = $( this.focusable.not( element ).get() );\n\t\tthis.hoverable = $( this.hoverable.not( element ).get() );\n\t},\n\n\t_delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_hoverable: function( element ) {\n\t\tthis.hoverable = this.hoverable.add( element );\n\t\tthis._on( element, {\n\t\t\tmouseenter: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t},\n\t\t\tmouseleave: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-hover\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_focusable: function( element ) {\n\t\tthis.focusable = this.focusable.add( element );\n\t\tthis._on( element, {\n\t\t\tfocusin: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t},\n\t\t\tfocusout: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, \"ui-state-focus\" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_trigger: function( type, event, data ) {\n\t\tvar prop, orig;\n\t\tvar callback = this.options[ type ];\n\n\t\tdata = data || {};\n\t\tevent = $.Event( event );\n\t\tevent.type = ( type === this.widgetEventPrefix ?\n\t\t\ttype :\n\t\t\tthis.widgetEventPrefix + type ).toLowerCase();\n\n\t\t// The original event may come from any element\n\t\t// so we need to reset the target on the new event\n\t\tevent.target = this.element[ 0 ];\n\n\t\t// Copy original event properties over to the new event\n\t\torig = event.originalEvent;\n\t\tif ( orig ) {\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tif ( !( prop in event ) ) {\n\t\t\t\t\tevent[ prop ] = orig[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element.trigger( event, data );\n\t\treturn !( $.isFunction( callback ) &&\n\t\t\tcallback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||\n\t\t\tevent.isDefaultPrevented() );\n\t}\n};\n\n$.each( { show: \"fadeIn\", hide: \"fadeOut\" }, function( method, defaultEffect ) {\n\t$.Widget.prototype[ \"_\" + method ] = function( element, options, callback ) {\n\t\tif ( typeof options === \"string\" ) {\n\t\t\toptions = { effect: options };\n\t\t}\n\n\t\tvar hasOptions;\n\t\tvar effectName = !options ?\n\t\t\tmethod :\n\t\t\toptions === true || typeof options === \"number\" ?\n\t\t\t\tdefaultEffect :\n\t\t\t\toptions.effect || defaultEffect;\n\n\t\toptions = options || {};\n\t\tif ( typeof options === \"number\" ) {\n\t\t\toptions = { duration: options };\n\t\t}\n\n\t\thasOptions = !$.isEmptyObject( options );\n\t\toptions.complete = callback;\n\n\t\tif ( options.delay ) {\n\t\t\telement.delay( options.delay );\n\t\t}\n\n\t\tif ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {\n\t\t\telement[ method ]( options );\n\t\t} else if ( effectName !== method && element[ effectName ] ) {\n\t\t\telement[ effectName ]( options.duration, options.easing, callback );\n\t\t} else {\n\t\t\telement.queue( function( next ) {\n\t\t\t\t$( this )[ method ]();\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback.call( element[ 0 ] );\n\t\t\t\t}\n\t\t\t\tnext();\n\t\t\t} );\n\t\t}\n\t};\n} );\n\nvar widget = $.widget;\n\n\n/*!\n * jQuery UI Position 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/position/\n */\n\n//>>label: Position\n//>>group: Core\n//>>description: Positions elements relative to other elements.\n//>>docs: http://api.jqueryui.com/position/\n//>>demos: http://jqueryui.com/position/\n\n\n( function() {\nvar cachedScrollbarWidth,\n\tmax = Math.max,\n\tabs = Math.abs,\n\trhorizontal = /left|center|right/,\n\trvertical = /top|center|bottom/,\n\troffset = /[\\+\\-]\\d+(\\.[\\d]+)?%?/,\n\trposition = /^\\w+/,\n\trpercent = /%$/,\n\t_position = $.fn.position;\n\nfunction getOffsets( offsets, width, height ) {\n\treturn [\n\t\tparseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),\n\t\tparseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )\n\t];\n}\n\nfunction parseCss( element, property ) {\n\treturn parseInt( $.css( element, property ), 10 ) || 0;\n}\n\nfunction getDimensions( elem ) {\n\tvar raw = elem[ 0 ];\n\tif ( raw.nodeType === 9 ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: 0, left: 0 }\n\t\t};\n\t}\n\tif ( $.isWindow( raw ) ) {\n\t\treturn {\n\t\t\twidth: elem.width(),\n\t\t\theight: elem.height(),\n\t\t\toffset: { top: elem.scrollTop(), left: elem.scrollLeft() }\n\t\t};\n\t}\n\tif ( raw.preventDefault ) {\n\t\treturn {\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\toffset: { top: raw.pageY, left: raw.pageX }\n\t\t};\n\t}\n\treturn {\n\t\twidth: elem.outerWidth(),\n\t\theight: elem.outerHeight(),\n\t\toffset: elem.offset()\n\t};\n}\n\n$.position = $.position || {\n\tscrollbarWidth: function() {\n\t\tif ( cachedScrollbarWidth !== undefined ) {\n\t\t\treturn cachedScrollbarWidth;\n\t\t}\n\t\tvar w1, w2,\n\t\t\tdiv = $( \"<div \" +\n\t\t\t\t\"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>\" +\n\t\t\t\t\"<div style='height:100px;width:auto;'></div></div>\" ),\n\t\t\tinnerDiv = div.children()[ 0 ];\n\n\t\t$( \"body\" ).append( div );\n\t\tw1 = innerDiv.offsetWidth;\n\t\tdiv.css( \"overflow\", \"scroll\" );\n\n\t\tw2 = innerDiv.offsetWidth;\n\n\t\tif ( w1 === w2 ) {\n\t\t\tw2 = div[ 0 ].clientWidth;\n\t\t}\n\n\t\tdiv.remove();\n\n\t\treturn ( cachedScrollbarWidth = w1 - w2 );\n\t},\n\tgetScrollInfo: function( within ) {\n\t\tvar overflowX = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-x\" ),\n\t\t\toverflowY = within.isWindow || within.isDocument ? \"\" :\n\t\t\t\twithin.element.css( \"overflow-y\" ),\n\t\t\thasOverflowX = overflowX === \"scroll\" ||\n\t\t\t\t( overflowX === \"auto\" && within.width < within.element[ 0 ].scrollWidth ),\n\t\t\thasOverflowY = overflowY === \"scroll\" ||\n\t\t\t\t( overflowY === \"auto\" && within.height < within.element[ 0 ].scrollHeight );\n\t\treturn {\n\t\t\twidth: hasOverflowY ? $.position.scrollbarWidth() : 0,\n\t\t\theight: hasOverflowX ? $.position.scrollbarWidth() : 0\n\t\t};\n\t},\n\tgetWithinInfo: function( element ) {\n\t\tvar withinElement = $( element || window ),\n\t\t\tisWindow = $.isWindow( withinElement[ 0 ] ),\n\t\t\tisDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,\n\t\t\thasOffset = !isWindow && !isDocument;\n\t\treturn {\n\t\t\telement: withinElement,\n\t\t\tisWindow: isWindow,\n\t\t\tisDocument: isDocument,\n\t\t\toffset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },\n\t\t\tscrollLeft: withinElement.scrollLeft(),\n\t\t\tscrollTop: withinElement.scrollTop(),\n\t\t\twidth: withinElement.outerWidth(),\n\t\t\theight: withinElement.outerHeight()\n\t\t};\n\t}\n};\n\n$.fn.position = function( options ) {\n\tif ( !options || !options.of ) {\n\t\treturn _position.apply( this, arguments );\n\t}\n\n\t// Make a copy, we don't want to modify arguments\n\toptions = $.extend( {}, options );\n\n\tvar atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,\n\t\ttarget = $( options.of ),\n\t\twithin = $.position.getWithinInfo( options.within ),\n\t\tscrollInfo = $.position.getScrollInfo( within ),\n\t\tcollision = ( options.collision || \"flip\" ).split( \" \" ),\n\t\toffsets = {};\n\n\tdimensions = getDimensions( target );\n\tif ( target[ 0 ].preventDefault ) {\n\n\t\t// Force left top to allow flipping\n\t\toptions.at = \"left top\";\n\t}\n\ttargetWidth = dimensions.width;\n\ttargetHeight = dimensions.height;\n\ttargetOffset = dimensions.offset;\n\n\t// Clone to reuse original targetOffset later\n\tbasePosition = $.extend( {}, targetOffset );\n\n\t// Force my and at to have valid horizontal and vertical positions\n\t// if a value is missing or invalid, it will be converted to center\n\t$.each( [ \"my\", \"at\" ], function() {\n\t\tvar pos = ( options[ this ] || \"\" ).split( \" \" ),\n\t\t\thorizontalOffset,\n\t\t\tverticalOffset;\n\n\t\tif ( pos.length === 1 ) {\n\t\t\tpos = rhorizontal.test( pos[ 0 ] ) ?\n\t\t\t\tpos.concat( [ \"center\" ] ) :\n\t\t\t\trvertical.test( pos[ 0 ] ) ?\n\t\t\t\t\t[ \"center\" ].concat( pos ) :\n\t\t\t\t\t[ \"center\", \"center\" ];\n\t\t}\n\t\tpos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : \"center\";\n\t\tpos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : \"center\";\n\n\t\t// Calculate offsets\n\t\thorizontalOffset = roffset.exec( pos[ 0 ] );\n\t\tverticalOffset = roffset.exec( pos[ 1 ] );\n\t\toffsets[ this ] = [\n\t\t\thorizontalOffset ? horizontalOffset[ 0 ] : 0,\n\t\t\tverticalOffset ? verticalOffset[ 0 ] : 0\n\t\t];\n\n\t\t// Reduce to just the positions without the offsets\n\t\toptions[ this ] = [\n\t\t\trposition.exec( pos[ 0 ] )[ 0 ],\n\t\t\trposition.exec( pos[ 1 ] )[ 0 ]\n\t\t];\n\t} );\n\n\t// Normalize collision option\n\tif ( collision.length === 1 ) {\n\t\tcollision[ 1 ] = collision[ 0 ];\n\t}\n\n\tif ( options.at[ 0 ] === \"right\" ) {\n\t\tbasePosition.left += targetWidth;\n\t} else if ( options.at[ 0 ] === \"center\" ) {\n\t\tbasePosition.left += targetWidth / 2;\n\t}\n\n\tif ( options.at[ 1 ] === \"bottom\" ) {\n\t\tbasePosition.top += targetHeight;\n\t} else if ( options.at[ 1 ] === \"center\" ) {\n\t\tbasePosition.top += targetHeight / 2;\n\t}\n\n\tatOffset = getOffsets( offsets.at, targetWidth, targetHeight );\n\tbasePosition.left += atOffset[ 0 ];\n\tbasePosition.top += atOffset[ 1 ];\n\n\treturn this.each( function() {\n\t\tvar collisionPosition, using,\n\t\t\telem = $( this ),\n\t\t\telemWidth = elem.outerWidth(),\n\t\t\telemHeight = elem.outerHeight(),\n\t\t\tmarginLeft = parseCss( this, \"marginLeft\" ),\n\t\t\tmarginTop = parseCss( this, \"marginTop\" ),\n\t\t\tcollisionWidth = elemWidth + marginLeft + parseCss( this, \"marginRight\" ) +\n\t\t\t\tscrollInfo.width,\n\t\t\tcollisionHeight = elemHeight + marginTop + parseCss( this, \"marginBottom\" ) +\n\t\t\t\tscrollInfo.height,\n\t\t\tposition = $.extend( {}, basePosition ),\n\t\t\tmyOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );\n\n\t\tif ( options.my[ 0 ] === \"right\" ) {\n\t\t\tposition.left -= elemWidth;\n\t\t} else if ( options.my[ 0 ] === \"center\" ) {\n\t\t\tposition.left -= elemWidth / 2;\n\t\t}\n\n\t\tif ( options.my[ 1 ] === \"bottom\" ) {\n\t\t\tposition.top -= elemHeight;\n\t\t} else if ( options.my[ 1 ] === \"center\" ) {\n\t\t\tposition.top -= elemHeight / 2;\n\t\t}\n\n\t\tposition.left += myOffset[ 0 ];\n\t\tposition.top += myOffset[ 1 ];\n\n\t\tcollisionPosition = {\n\t\t\tmarginLeft: marginLeft,\n\t\t\tmarginTop: marginTop\n\t\t};\n\n\t\t$.each( [ \"left\", \"top\" ], function( i, dir ) {\n\t\t\tif ( $.ui.position[ collision[ i ] ] ) {\n\t\t\t\t$.ui.position[ collision[ i ] ][ dir ]( position, {\n\t\t\t\t\ttargetWidth: targetWidth,\n\t\t\t\t\ttargetHeight: targetHeight,\n\t\t\t\t\telemWidth: elemWidth,\n\t\t\t\t\telemHeight: elemHeight,\n\t\t\t\t\tcollisionPosition: collisionPosition,\n\t\t\t\t\tcollisionWidth: collisionWidth,\n\t\t\t\t\tcollisionHeight: collisionHeight,\n\t\t\t\t\toffset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],\n\t\t\t\t\tmy: options.my,\n\t\t\t\t\tat: options.at,\n\t\t\t\t\twithin: within,\n\t\t\t\t\telem: elem\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tif ( options.using ) {\n\n\t\t\t// Adds feedback as second argument to using callback, if present\n\t\t\tusing = function( props ) {\n\t\t\t\tvar left = targetOffset.left - position.left,\n\t\t\t\t\tright = left + targetWidth - elemWidth,\n\t\t\t\t\ttop = targetOffset.top - position.top,\n\t\t\t\t\tbottom = top + targetHeight - elemHeight,\n\t\t\t\t\tfeedback = {\n\t\t\t\t\t\ttarget: {\n\t\t\t\t\t\t\telement: target,\n\t\t\t\t\t\t\tleft: targetOffset.left,\n\t\t\t\t\t\t\ttop: targetOffset.top,\n\t\t\t\t\t\t\twidth: targetWidth,\n\t\t\t\t\t\t\theight: targetHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\telement: {\n\t\t\t\t\t\t\telement: elem,\n\t\t\t\t\t\t\tleft: position.left,\n\t\t\t\t\t\t\ttop: position.top,\n\t\t\t\t\t\t\twidth: elemWidth,\n\t\t\t\t\t\t\theight: elemHeight\n\t\t\t\t\t\t},\n\t\t\t\t\t\thorizontal: right < 0 ? \"left\" : left > 0 ? \"right\" : \"center\",\n\t\t\t\t\t\tvertical: bottom < 0 ? \"top\" : top > 0 ? \"bottom\" : \"middle\"\n\t\t\t\t\t};\n\t\t\t\tif ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {\n\t\t\t\t\tfeedback.horizontal = \"center\";\n\t\t\t\t}\n\t\t\t\tif ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {\n\t\t\t\t\tfeedback.vertical = \"middle\";\n\t\t\t\t}\n\t\t\t\tif ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {\n\t\t\t\t\tfeedback.important = \"horizontal\";\n\t\t\t\t} else {\n\t\t\t\t\tfeedback.important = \"vertical\";\n\t\t\t\t}\n\t\t\t\toptions.using.call( this, props, feedback );\n\t\t\t};\n\t\t}\n\n\t\telem.offset( $.extend( position, { using: using } ) );\n\t} );\n};\n\n$.ui.position = {\n\tfit: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\touterWidth = within.width,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = withinOffset - collisionPosLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,\n\t\t\t\tnewOverRight;\n\n\t\t\t// Element is wider than within\n\t\t\tif ( data.collisionWidth > outerWidth ) {\n\n\t\t\t\t// Element is initially over the left side of within\n\t\t\t\tif ( overLeft > 0 && overRight <= 0 ) {\n\t\t\t\t\tnewOverRight = position.left + overLeft + data.collisionWidth - outerWidth -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.left += overLeft - newOverRight;\n\n\t\t\t\t// Element is initially over right side of within\n\t\t\t\t} else if ( overRight > 0 && overLeft <= 0 ) {\n\t\t\t\t\tposition.left = withinOffset;\n\n\t\t\t\t// Element is initially over both left and right sides of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overLeft > overRight ) {\n\t\t\t\t\t\tposition.left = withinOffset + outerWidth - data.collisionWidth;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.left = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far left -> align with left edge\n\t\t\t} else if ( overLeft > 0 ) {\n\t\t\t\tposition.left += overLeft;\n\n\t\t\t// Too far right -> align with right edge\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tposition.left -= overRight;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.left = max( position.left - collisionPosLeft, position.left );\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\touterHeight = data.within.height,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = withinOffset - collisionPosTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,\n\t\t\t\tnewOverBottom;\n\n\t\t\t// Element is taller than within\n\t\t\tif ( data.collisionHeight > outerHeight ) {\n\n\t\t\t\t// Element is initially over the top of within\n\t\t\t\tif ( overTop > 0 && overBottom <= 0 ) {\n\t\t\t\t\tnewOverBottom = position.top + overTop + data.collisionHeight - outerHeight -\n\t\t\t\t\t\twithinOffset;\n\t\t\t\t\tposition.top += overTop - newOverBottom;\n\n\t\t\t\t// Element is initially over bottom of within\n\t\t\t\t} else if ( overBottom > 0 && overTop <= 0 ) {\n\t\t\t\t\tposition.top = withinOffset;\n\n\t\t\t\t// Element is initially over both top and bottom of within\n\t\t\t\t} else {\n\t\t\t\t\tif ( overTop > overBottom ) {\n\t\t\t\t\t\tposition.top = withinOffset + outerHeight - data.collisionHeight;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tposition.top = withinOffset;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Too far up -> align with top\n\t\t\t} else if ( overTop > 0 ) {\n\t\t\t\tposition.top += overTop;\n\n\t\t\t// Too far down -> align with bottom edge\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tposition.top -= overBottom;\n\n\t\t\t// Adjust based on position and margin\n\t\t\t} else {\n\t\t\t\tposition.top = max( position.top - collisionPosTop, position.top );\n\t\t\t}\n\t\t}\n\t},\n\tflip: {\n\t\tleft: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.left + within.scrollLeft,\n\t\t\t\touterWidth = within.width,\n\t\t\t\toffsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\n\t\t\t\toverLeft = collisionPosLeft - offsetLeft,\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,\n\t\t\t\tmyOffset = data.my[ 0 ] === \"left\" ?\n\t\t\t\t\t-data.elemWidth :\n\t\t\t\t\tdata.my[ 0 ] === \"right\" ?\n\t\t\t\t\t\tdata.elemWidth :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 0 ] === \"left\" ?\n\t\t\t\t\tdata.targetWidth :\n\t\t\t\t\tdata.at[ 0 ] === \"right\" ?\n\t\t\t\t\t\t-data.targetWidth :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 0 ],\n\t\t\t\tnewOverRight,\n\t\t\t\tnewOverLeft;\n\n\t\t\tif ( overLeft < 0 ) {\n\t\t\t\tnewOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -\n\t\t\t\t\touterWidth - withinOffset;\n\t\t\t\tif ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overRight > 0 ) {\n\t\t\t\tnewOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +\n\t\t\t\t\tatOffset + offset - offsetLeft;\n\t\t\t\tif ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttop: function( position, data ) {\n\t\t\tvar within = data.within,\n\t\t\t\twithinOffset = within.offset.top + within.scrollTop,\n\t\t\t\touterHeight = within.height,\n\t\t\t\toffsetTop = within.isWindow ? within.scrollTop : within.offset.top,\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\n\t\t\t\toverTop = collisionPosTop - offsetTop,\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,\n\t\t\t\ttop = data.my[ 1 ] === \"top\",\n\t\t\t\tmyOffset = top ?\n\t\t\t\t\t-data.elemHeight :\n\t\t\t\t\tdata.my[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\tdata.elemHeight :\n\t\t\t\t\t\t0,\n\t\t\t\tatOffset = data.at[ 1 ] === \"top\" ?\n\t\t\t\t\tdata.targetHeight :\n\t\t\t\t\tdata.at[ 1 ] === \"bottom\" ?\n\t\t\t\t\t\t-data.targetHeight :\n\t\t\t\t\t\t0,\n\t\t\t\toffset = -2 * data.offset[ 1 ],\n\t\t\t\tnewOverTop,\n\t\t\t\tnewOverBottom;\n\t\t\tif ( overTop < 0 ) {\n\t\t\t\tnewOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -\n\t\t\t\t\touterHeight - withinOffset;\n\t\t\t\tif ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t} else if ( overBottom > 0 ) {\n\t\t\t\tnewOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +\n\t\t\t\t\toffset - offsetTop;\n\t\t\t\tif ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tflipfit: {\n\t\tleft: function() {\n\t\t\t$.ui.position.flip.left.apply( this, arguments );\n\t\t\t$.ui.position.fit.left.apply( this, arguments );\n\t\t},\n\t\ttop: function() {\n\t\t\t$.ui.position.flip.top.apply( this, arguments );\n\t\t\t$.ui.position.fit.top.apply( this, arguments );\n\t\t}\n\t}\n};\n\n} )();\n\nvar position = $.ui.position;\n\n\n/*!\n * jQuery UI Keycode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Keycode\n//>>group: Core\n//>>description: Provide keycodes as keynames\n//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/\n\n\nvar keycode = $.ui.keyCode = {\n\tBACKSPACE: 8,\n\tCOMMA: 188,\n\tDELETE: 46,\n\tDOWN: 40,\n\tEND: 35,\n\tENTER: 13,\n\tESCAPE: 27,\n\tHOME: 36,\n\tLEFT: 37,\n\tPAGE_DOWN: 34,\n\tPAGE_UP: 33,\n\tPERIOD: 190,\n\tRIGHT: 39,\n\tSPACE: 32,\n\tTAB: 9,\n\tUP: 38\n};\n\n\n/*!\n * jQuery UI Scroll Parent 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: scrollParent\n//>>group: Core\n//>>description: Get the closest ancestor element that is scrollable.\n//>>docs: http://api.jqueryui.com/scrollParent/\n\n\n\nvar scrollParent = $.fn.scrollParent = function( includeHidden ) {\n\tvar position = this.css( \"position\" ),\n\t\texcludeStaticParent = position === \"absolute\",\n\t\toverflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,\n\t\tscrollParent = this.parents().filter( function() {\n\t\t\tvar parent = $( this );\n\t\t\tif ( excludeStaticParent && parent.css( \"position\" ) === \"static\" ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn overflowRegex.test( parent.css( \"overflow\" ) + parent.css( \"overflow-y\" ) +\n\t\t\t\tparent.css( \"overflow-x\" ) );\n\t\t} ).eq( 0 );\n\n\treturn position === \"fixed\" || !scrollParent.length ?\n\t\t$( this[ 0 ].ownerDocument || document ) :\n\t\tscrollParent;\n};\n\n\n/*!\n * jQuery UI Unique ID 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: uniqueId\n//>>group: Core\n//>>description: Functions to generate and remove uniqueId's\n//>>docs: http://api.jqueryui.com/uniqueId/\n\n\n\nvar uniqueId = $.fn.extend( {\n\tuniqueId: ( function() {\n\t\tvar uuid = 0;\n\n\t\treturn function() {\n\t\t\treturn this.each( function() {\n\t\t\t\tif ( !this.id ) {\n\t\t\t\t\tthis.id = \"ui-id-\" + ( ++uuid );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t} )(),\n\n\tremoveUniqueId: function() {\n\t\treturn this.each( function() {\n\t\t\tif ( /^ui-id-\\d+$/.test( this.id ) ) {\n\t\t\t\t$( this ).removeAttr( \"id\" );\n\t\t\t}\n\t\t} );\n\t}\n} );\n\n\n}));\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var assignValue = require('./_assignValue'),\n copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n isArrayLike = require('./isArrayLike'),\n isPrototype = require('./_isPrototype'),\n keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nmodule.exports = assign;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","'use strict';\n\nvar Config = {\n DEBUG: false,\n LIB_VERSION: '2.47.0'\n};\n\n// since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file\nvar window$1;\nif (typeof(window) === 'undefined') {\n var loc = {\n hostname: ''\n };\n window$1 = {\n navigator: { userAgent: '' },\n document: {\n location: loc,\n referrer: ''\n },\n screen: { width: 0, height: 0 },\n location: loc\n };\n} else {\n window$1 = window;\n}\n\n/*\n * Saved references to long variable names, so that closure compiler can\n * minimize file size.\n */\n\nvar ArrayProto = Array.prototype;\nvar FuncProto = Function.prototype;\nvar ObjProto = Object.prototype;\nvar slice = ArrayProto.slice;\nvar toString = ObjProto.toString;\nvar hasOwnProperty = ObjProto.hasOwnProperty;\nvar windowConsole = window$1.console;\nvar navigator = window$1.navigator;\nvar document$1 = window$1.document;\nvar windowOpera = window$1.opera;\nvar screen = window$1.screen;\nvar userAgent = navigator.userAgent;\nvar nativeBind = FuncProto.bind;\nvar nativeForEach = ArrayProto.forEach;\nvar nativeIndexOf = ArrayProto.indexOf;\nvar nativeMap = ArrayProto.map;\nvar nativeIsArray = Array.isArray;\nvar breaker = {};\nvar _ = {\n trim: function(str) {\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n};\n\n// Console override\nvar console = {\n /** @type {function(...*)} */\n log: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n try {\n windowConsole.log.apply(windowConsole, arguments);\n } catch (err) {\n _.each(arguments, function(arg) {\n windowConsole.log(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n warn: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel warning:'].concat(_.toArray(arguments));\n try {\n windowConsole.warn.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.warn(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n error: function() {\n if (Config.DEBUG && !_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.error(arg);\n });\n }\n }\n },\n /** @type {function(...*)} */\n critical: function() {\n if (!_.isUndefined(windowConsole) && windowConsole) {\n var args = ['Mixpanel error:'].concat(_.toArray(arguments));\n try {\n windowConsole.error.apply(windowConsole, args);\n } catch (err) {\n _.each(args, function(arg) {\n windowConsole.error(arg);\n });\n }\n }\n }\n};\n\nvar log_func_with_prefix = function(func, prefix) {\n return function() {\n arguments[0] = '[' + prefix + '] ' + arguments[0];\n return func.apply(console, arguments);\n };\n};\nvar console_with_prefix = function(prefix) {\n return {\n log: log_func_with_prefix(console.log, prefix),\n error: log_func_with_prefix(console.error, prefix),\n critical: log_func_with_prefix(console.critical, prefix)\n };\n};\n\n\n// UNDERSCORE\n// Embed part of the Underscore Library\n_.bind = function(func, context) {\n var args, bound;\n if (nativeBind && func.bind === nativeBind) {\n return nativeBind.apply(func, slice.call(arguments, 1));\n }\n if (!_.isFunction(func)) {\n throw new TypeError();\n }\n args = slice.call(arguments, 2);\n bound = function() {\n if (!(this instanceof bound)) {\n return func.apply(context, args.concat(slice.call(arguments)));\n }\n var ctor = {};\n ctor.prototype = func.prototype;\n var self = new ctor();\n ctor.prototype = null;\n var result = func.apply(self, args.concat(slice.call(arguments)));\n if (Object(result) === result) {\n return result;\n }\n return self;\n };\n return bound;\n};\n\n/**\n * @param {*=} obj\n * @param {function(...*)=} iterator\n * @param {Object=} context\n */\n_.each = function(obj, iterator, context) {\n if (obj === null || obj === undefined) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) {\n return;\n }\n }\n } else {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) {\n return;\n }\n }\n }\n }\n};\n\n_.extend = function(obj) {\n _.each(slice.call(arguments, 1), function(source) {\n for (var prop in source) {\n if (source[prop] !== void 0) {\n obj[prop] = source[prop];\n }\n }\n });\n return obj;\n};\n\n_.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) === '[object Array]';\n};\n\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// var bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\n_.isFunction = function(f) {\n try {\n return /^\\s*\\bfunction\\b/.test(f);\n } catch (x) {\n return false;\n }\n};\n\n_.isArguments = function(obj) {\n return !!(obj && hasOwnProperty.call(obj, 'callee'));\n};\n\n_.toArray = function(iterable) {\n if (!iterable) {\n return [];\n }\n if (iterable.toArray) {\n return iterable.toArray();\n }\n if (_.isArray(iterable)) {\n return slice.call(iterable);\n }\n if (_.isArguments(iterable)) {\n return slice.call(iterable);\n }\n return _.values(iterable);\n};\n\n_.map = function(arr, callback, context) {\n if (nativeMap && arr.map === nativeMap) {\n return arr.map(callback, context);\n } else {\n var results = [];\n _.each(arr, function(item) {\n results.push(callback.call(context, item));\n });\n return results;\n }\n};\n\n_.keys = function(obj) {\n var results = [];\n if (obj === null) {\n return results;\n }\n _.each(obj, function(value, key) {\n results[results.length] = key;\n });\n return results;\n};\n\n_.values = function(obj) {\n var results = [];\n if (obj === null) {\n return results;\n }\n _.each(obj, function(value) {\n results[results.length] = value;\n });\n return results;\n};\n\n_.include = function(obj, target) {\n var found = false;\n if (obj === null) {\n return found;\n }\n if (nativeIndexOf && obj.indexOf === nativeIndexOf) {\n return obj.indexOf(target) != -1;\n }\n _.each(obj, function(value) {\n if (found || (found = (value === target))) {\n return breaker;\n }\n });\n return found;\n};\n\n_.includes = function(str, needle) {\n return str.indexOf(needle) !== -1;\n};\n\n// Underscore Addons\n_.inherit = function(subclass, superclass) {\n subclass.prototype = new superclass();\n subclass.prototype.constructor = subclass;\n subclass.superclass = superclass.prototype;\n return subclass;\n};\n\n_.isObject = function(obj) {\n return (obj === Object(obj) && !_.isArray(obj));\n};\n\n_.isEmptyObject = function(obj) {\n if (_.isObject(obj)) {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n return false;\n }\n }\n return true;\n }\n return false;\n};\n\n_.isUndefined = function(obj) {\n return obj === void 0;\n};\n\n_.isString = function(obj) {\n return toString.call(obj) == '[object String]';\n};\n\n_.isDate = function(obj) {\n return toString.call(obj) == '[object Date]';\n};\n\n_.isNumber = function(obj) {\n return toString.call(obj) == '[object Number]';\n};\n\n_.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n};\n\n_.encodeDates = function(obj) {\n _.each(obj, function(v, k) {\n if (_.isDate(v)) {\n obj[k] = _.formatDate(v);\n } else if (_.isObject(v)) {\n obj[k] = _.encodeDates(v); // recurse\n }\n });\n return obj;\n};\n\n_.timestamp = function() {\n Date.now = Date.now || function() {\n return +new Date;\n };\n return Date.now();\n};\n\n_.formatDate = function(d) {\n // YYYY-MM-DDTHH:MM:SS in UTC\n function pad(n) {\n return n < 10 ? '0' + n : n;\n }\n return d.getUTCFullYear() + '-' +\n pad(d.getUTCMonth() + 1) + '-' +\n pad(d.getUTCDate()) + 'T' +\n pad(d.getUTCHours()) + ':' +\n pad(d.getUTCMinutes()) + ':' +\n pad(d.getUTCSeconds());\n};\n\n_.strip_empty_properties = function(p) {\n var ret = {};\n _.each(p, function(v, k) {\n if (_.isString(v) && v.length > 0) {\n ret[k] = v;\n }\n });\n return ret;\n};\n\n/*\n * this function returns a copy of object after truncating it. If\n * passed an Array or Object it will iterate through obj and\n * truncate all the values recursively.\n */\n_.truncate = function(obj, length) {\n var ret;\n\n if (typeof(obj) === 'string') {\n ret = obj.slice(0, length);\n } else if (_.isArray(obj)) {\n ret = [];\n _.each(obj, function(val) {\n ret.push(_.truncate(val, length));\n });\n } else if (_.isObject(obj)) {\n ret = {};\n _.each(obj, function(val, key) {\n ret[key] = _.truncate(val, length);\n });\n } else {\n ret = obj;\n }\n\n return ret;\n};\n\n_.JSONEncode = (function() {\n return function(mixed_val) {\n var value = mixed_val;\n var quote = function(string) {\n var escapable = /[\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g; // eslint-disable-line no-control-regex\n var meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\'\n };\n\n escapable.lastIndex = 0;\n return escapable.test(string) ?\n '\"' + string.replace(escapable, function(a) {\n var c = meta[a];\n return typeof c === 'string' ? c :\n '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' :\n '\"' + string + '\"';\n };\n\n var str = function(key, holder) {\n var gap = '';\n var indent = ' ';\n var i = 0; // The loop counter.\n var k = ''; // The member key.\n var v = ''; // The member value.\n var length = 0;\n var mind = gap;\n var partial = [];\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n // What happens next depends on the value's type.\n switch (typeof value) {\n case 'string':\n return quote(value);\n\n case 'number':\n // JSON numbers must be finite. Encode non-finite numbers as null.\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce 'null'. The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n case 'object':\n // If the type is 'object', we might be dealing with an object or an array or\n // null.\n // Due to a specification blunder in ECMAScript, typeof null is 'object',\n // so watch out for that case.\n if (!value) {\n return 'null';\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n gap += indent;\n partial = [];\n\n // Is the value an array?\n if (toString.apply(value) === '[object Array]') {\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n v = partial.length === 0 ? '[]' :\n gap ? '[\\n' + gap +\n partial.join(',\\n' + gap) + '\\n' +\n mind + ']' :\n '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n // Iterate through all of the keys in the object.\n for (k in value) {\n if (hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n v = partial.length === 0 ? '{}' :\n gap ? '{' + partial.join(',') + '' +\n mind + '}' : '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n };\n\n // Make a fake root object containing our value under the key of ''.\n // Return the result of stringifying the value.\n return str('', {\n '': value\n });\n };\n})();\n\n/**\n * From https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js\n * Slightly modified to throw a real Error rather than a POJO\n */\n_.JSONDecode = (function() {\n var at, // The index of the current character\n ch, // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n 'b': '\\b',\n 'f': '\\f',\n 'n': '\\n',\n 'r': '\\r',\n 't': '\\t'\n },\n text,\n error = function(m) {\n var e = new SyntaxError(m);\n e.at = at;\n e.text = text;\n throw e;\n },\n next = function(c) {\n // If a c parameter is provided, verify that it matches the current character.\n if (c && c !== ch) {\n error('Expected \\'' + c + '\\' instead of \\'' + ch + '\\'');\n }\n // Get the next character. When there are no more characters,\n // return the empty string.\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n number = function() {\n // Parse a number value.\n var number,\n string = '';\n\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error('Bad number');\n } else {\n return number;\n }\n },\n\n string = function() {\n // Parse a string value.\n var hex,\n i,\n string = '',\n uffff;\n // When parsing for string values, we must look for \" and \\ characters.\n if (ch === '\"') {\n while (next()) {\n if (ch === '\"') {\n next();\n return string;\n }\n if (ch === '\\\\') {\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n } else {\n string += ch;\n }\n }\n }\n error('Bad string');\n },\n white = function() {\n // Skip whitespace.\n while (ch && ch <= ' ') {\n next();\n }\n },\n word = function() {\n // true, false, or null.\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error('Unexpected \"' + ch + '\"');\n },\n value, // Placeholder for the value function.\n array = function() {\n // Parse an array value.\n var array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function() {\n // Parse an object value.\n var key,\n object = {};\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (Object.hasOwnProperty.call(object, key)) {\n error('Duplicate key \"' + key + '\"');\n }\n object[key] = value();\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n\n value = function() {\n // Parse a JSON value. It could be an object, an array, a string,\n // a number, or a word.\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n // Return the json_parse function. It will have access to all of the\n // above functions and variables.\n return function(source) {\n var result;\n\n text = source;\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error('Syntax error');\n }\n\n return result;\n };\n})();\n\n_.base64Encode = function(data) {\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n\n if (!data) {\n return data;\n }\n\n data = _.utf8Encode(data);\n\n do { // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n\n bits = o1 << 16 | o2 << 8 | o3;\n\n h1 = bits >> 18 & 0x3f;\n h2 = bits >> 12 & 0x3f;\n h3 = bits >> 6 & 0x3f;\n h4 = bits & 0x3f;\n\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n\n enc = tmp_arr.join('');\n\n switch (data.length % 3) {\n case 1:\n enc = enc.slice(0, -2) + '==';\n break;\n case 2:\n enc = enc.slice(0, -1) + '=';\n break;\n }\n\n return enc;\n};\n\n_.utf8Encode = function(string) {\n string = (string + '').replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n\n var utftext = '',\n start,\n end;\n var stringl = 0,\n n;\n\n start = end = 0;\n stringl = string.length;\n\n for (n = 0; n < stringl; n++) {\n var c1 = string.charCodeAt(n);\n var enc = null;\n\n if (c1 < 128) {\n end++;\n } else if ((c1 > 127) && (c1 < 2048)) {\n enc = String.fromCharCode((c1 >> 6) | 192, (c1 & 63) | 128);\n } else {\n enc = String.fromCharCode((c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128);\n }\n if (enc !== null) {\n if (end > start) {\n utftext += string.substring(start, end);\n }\n utftext += enc;\n start = end = n + 1;\n }\n }\n\n if (end > start) {\n utftext += string.substring(start, string.length);\n }\n\n return utftext;\n};\n\n_.UUID = (function() {\n\n // Time-based entropy\n var T = function() {\n var time = 1 * new Date(); // cross-browser version of Date.now()\n var ticks;\n if (window$1.performance && window$1.performance.now) {\n ticks = window$1.performance.now();\n } else {\n // fall back to busy loop\n ticks = 0;\n\n // this while loop figures how many browser ticks go by\n // before 1*new Date() returns a new number, ie the amount\n // of ticks that go by per millisecond\n while (time == 1 * new Date()) {\n ticks++;\n }\n }\n return time.toString(16) + Math.floor(ticks).toString(16);\n };\n\n // Math.Random entropy\n var R = function() {\n return Math.random().toString(16).replace('.', '');\n };\n\n // User agent entropy\n // This function takes the user agent string, and then xors\n // together each sequence of 8 bytes. This produces a final\n // sequence of 8 bytes which it returns as hex.\n var UA = function() {\n var ua = userAgent,\n i, ch, buffer = [],\n ret = 0;\n\n function xor(result, byte_array) {\n var j, tmp = 0;\n for (j = 0; j < byte_array.length; j++) {\n tmp |= (buffer[j] << j * 8);\n }\n return result ^ tmp;\n }\n\n for (i = 0; i < ua.length; i++) {\n ch = ua.charCodeAt(i);\n buffer.unshift(ch & 0xFF);\n if (buffer.length >= 4) {\n ret = xor(ret, buffer);\n buffer = [];\n }\n }\n\n if (buffer.length > 0) {\n ret = xor(ret, buffer);\n }\n\n return ret.toString(16);\n };\n\n return function() {\n var se = (screen.height * screen.width).toString(16);\n return (T() + '-' + R() + '-' + UA() + '-' + se + '-' + T());\n };\n})();\n\n// _.isBlockedUA()\n// This is to block various web spiders from executing our JS and\n// sending false tracking data\nvar BLOCKED_UA_STRS = [\n 'ahrefsbot',\n 'baiduspider',\n 'bingbot',\n 'bingpreview',\n 'facebookexternal',\n 'petalbot',\n 'pinterest',\n 'screaming frog',\n 'yahoo! slurp',\n 'yandexbot',\n\n // a whole bunch of goog-specific crawlers\n // https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers\n 'adsbot-google',\n 'apis-google',\n 'duplexweb-google',\n 'feedfetcher-google',\n 'google favicon',\n 'google web preview',\n 'google-read-aloud',\n 'googlebot',\n 'googleweblight',\n 'mediapartners-google',\n 'storebot-google'\n];\n_.isBlockedUA = function(ua) {\n var i;\n ua = ua.toLowerCase();\n for (i = 0; i < BLOCKED_UA_STRS.length; i++) {\n if (ua.indexOf(BLOCKED_UA_STRS[i]) !== -1) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * @param {Object=} formdata\n * @param {string=} arg_separator\n */\n_.HTTPBuildQuery = function(formdata, arg_separator) {\n var use_val, use_key, tmp_arr = [];\n\n if (_.isUndefined(arg_separator)) {\n arg_separator = '&';\n }\n\n _.each(formdata, function(val, key) {\n use_val = encodeURIComponent(val.toString());\n use_key = encodeURIComponent(key);\n tmp_arr[tmp_arr.length] = use_key + '=' + use_val;\n });\n\n return tmp_arr.join(arg_separator);\n};\n\n_.getQueryParam = function(url, param) {\n // Expects a raw URL\n\n param = param.replace(/[[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n var regexS = '[\\\\?&]' + param + '=([^&#]*)',\n regex = new RegExp(regexS),\n results = regex.exec(url);\n if (results === null || (results && typeof(results[1]) !== 'string' && results[1].length)) {\n return '';\n } else {\n var result = results[1];\n try {\n result = decodeURIComponent(result);\n } catch(err) {\n console.error('Skipping decoding for malformed query param: ' + result);\n }\n return result.replace(/\\+/g, ' ');\n }\n};\n\n\n// _.cookie\n// Methods partially borrowed from quirksmode.org/js/cookies.html\n_.cookie = {\n get: function(name) {\n var nameEQ = name + '=';\n var ca = document$1.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1, c.length);\n }\n if (c.indexOf(nameEQ) === 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length));\n }\n }\n return null;\n },\n\n parse: function(name) {\n var cookie;\n try {\n cookie = _.JSONDecode(_.cookie.get(name)) || {};\n } catch (err) {\n // noop\n }\n return cookie;\n },\n\n set_seconds: function(name, value, seconds, is_cross_subdomain, is_secure, is_cross_site, domain_override) {\n var cdomain = '',\n expires = '',\n secure = '';\n\n if (domain_override) {\n cdomain = '; domain=' + domain_override;\n } else if (is_cross_subdomain) {\n var domain = extract_domain(document$1.location.hostname);\n cdomain = domain ? '; domain=.' + domain : '';\n }\n\n if (seconds) {\n var date = new Date();\n date.setTime(date.getTime() + (seconds * 1000));\n expires = '; expires=' + date.toGMTString();\n }\n\n if (is_cross_site) {\n is_secure = true;\n secure = '; SameSite=None';\n }\n if (is_secure) {\n secure += '; secure';\n }\n\n document$1.cookie = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n },\n\n set: function(name, value, days, is_cross_subdomain, is_secure, is_cross_site, domain_override) {\n var cdomain = '', expires = '', secure = '';\n\n if (domain_override) {\n cdomain = '; domain=' + domain_override;\n } else if (is_cross_subdomain) {\n var domain = extract_domain(document$1.location.hostname);\n cdomain = domain ? '; domain=.' + domain : '';\n }\n\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n expires = '; expires=' + date.toGMTString();\n }\n\n if (is_cross_site) {\n is_secure = true;\n secure = '; SameSite=None';\n }\n if (is_secure) {\n secure += '; secure';\n }\n\n var new_cookie_val = name + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;\n document$1.cookie = new_cookie_val;\n return new_cookie_val;\n },\n\n remove: function(name, is_cross_subdomain, domain_override) {\n _.cookie.set(name, '', -1, is_cross_subdomain, false, false, domain_override);\n }\n};\n\nvar _localStorageSupported = null;\nvar localStorageSupported = function(storage, forceCheck) {\n if (_localStorageSupported !== null && !forceCheck) {\n return _localStorageSupported;\n }\n\n var supported = true;\n try {\n storage = storage || window.localStorage;\n var key = '__mplss_' + cheap_guid(8),\n val = 'xyz';\n storage.setItem(key, val);\n if (storage.getItem(key) !== val) {\n supported = false;\n }\n storage.removeItem(key);\n } catch (err) {\n supported = false;\n }\n\n _localStorageSupported = supported;\n return supported;\n};\n\n// _.localStorage\n_.localStorage = {\n is_supported: function(force_check) {\n var supported = localStorageSupported(null, force_check);\n if (!supported) {\n console.error('localStorage unsupported; falling back to cookie store');\n }\n return supported;\n },\n\n error: function(msg) {\n console.error('localStorage error: ' + msg);\n },\n\n get: function(name) {\n try {\n return window.localStorage.getItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n return null;\n },\n\n parse: function(name) {\n try {\n return _.JSONDecode(_.localStorage.get(name)) || {};\n } catch (err) {\n // noop\n }\n return null;\n },\n\n set: function(name, value) {\n try {\n window.localStorage.setItem(name, value);\n } catch (err) {\n _.localStorage.error(err);\n }\n },\n\n remove: function(name) {\n try {\n window.localStorage.removeItem(name);\n } catch (err) {\n _.localStorage.error(err);\n }\n }\n};\n\n_.register_event = (function() {\n // written by Dean Edwards, 2005\n // with input from Tino Zijdel - crisp@xs4all.nl\n // with input from Carl Sverre - mail@carlsverre.com\n // with input from Mixpanel\n // http://dean.edwards.name/weblog/2005/10/add-event/\n // https://gist.github.com/1930440\n\n /**\n * @param {Object} element\n * @param {string} type\n * @param {function(...*)} handler\n * @param {boolean=} oldSchool\n * @param {boolean=} useCapture\n */\n var register_event = function(element, type, handler, oldSchool, useCapture) {\n if (!element) {\n console.error('No valid element provided to register_event');\n return;\n }\n\n if (element.addEventListener && !oldSchool) {\n element.addEventListener(type, handler, !!useCapture);\n } else {\n var ontype = 'on' + type;\n var old_handler = element[ontype]; // can be undefined\n element[ontype] = makeHandler(element, handler, old_handler);\n }\n };\n\n function makeHandler(element, new_handler, old_handlers) {\n var handler = function(event) {\n event = event || fixEvent(window.event);\n\n // this basically happens in firefox whenever another script\n // overwrites the onload callback and doesn't pass the event\n // object to previously defined callbacks. All the browsers\n // that don't define window.event implement addEventListener\n // so the dom_loaded handler will still be fired as usual.\n if (!event) {\n return undefined;\n }\n\n var ret = true;\n var old_result, new_result;\n\n if (_.isFunction(old_handlers)) {\n old_result = old_handlers(event);\n }\n new_result = new_handler.call(element, event);\n\n if ((false === old_result) || (false === new_result)) {\n ret = false;\n }\n\n return ret;\n };\n\n return handler;\n }\n\n function fixEvent(event) {\n if (event) {\n event.preventDefault = fixEvent.preventDefault;\n event.stopPropagation = fixEvent.stopPropagation;\n }\n return event;\n }\n fixEvent.preventDefault = function() {\n this.returnValue = false;\n };\n fixEvent.stopPropagation = function() {\n this.cancelBubble = true;\n };\n\n return register_event;\n})();\n\n\nvar TOKEN_MATCH_REGEX = new RegExp('^(\\\\w*)\\\\[(\\\\w+)([=~\\\\|\\\\^\\\\$\\\\*]?)=?\"?([^\\\\]\"]*)\"?\\\\]$');\n\n_.dom_query = (function() {\n /* document.getElementsBySelector(selector)\n - returns an array of element objects from the current document\n matching the CSS selector. Selectors can contain element names,\n class names and ids and can be nested. For example:\n\n elements = document.getElementsBySelector('div#main p a.external')\n\n Will return an array of all 'a' elements with 'external' in their\n class attribute that are contained inside 'p' elements that are\n contained inside the 'div' element which has id=\"main\"\n\n New in version 0.4: Support for CSS2 and CSS3 attribute selectors:\n See http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\n Version 0.4 - Simon Willison, March 25th 2003\n -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows\n -- Opera 7 fails\n\n Version 0.5 - Carl Sverre, Jan 7th 2013\n -- Now uses jQuery-esque `hasClass` for testing class name\n equality. This fixes a bug related to '-' characters being\n considered not part of a 'word' in regex.\n */\n\n function getAllChildren(e) {\n // Returns all children of element. Workaround required for IE5/Windows. Ugh.\n return e.all ? e.all : e.getElementsByTagName('*');\n }\n\n var bad_whitespace = /[\\t\\r\\n]/g;\n\n function hasClass(elem, selector) {\n var className = ' ' + selector + ' ';\n return ((' ' + elem.className + ' ').replace(bad_whitespace, ' ').indexOf(className) >= 0);\n }\n\n function getElementsBySelector(selector) {\n // Attempt to fail gracefully in lesser browsers\n if (!document$1.getElementsByTagName) {\n return [];\n }\n // Split selector in to tokens\n var tokens = selector.split(' ');\n var token, bits, tagName, found, foundCount, i, j, k, elements, currentContextIndex;\n var currentContext = [document$1];\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i].replace(/^\\s+/, '').replace(/\\s+$/, '');\n if (token.indexOf('#') > -1) {\n // Token is an ID selector\n bits = token.split('#');\n tagName = bits[0];\n var id = bits[1];\n var element = document$1.getElementById(id);\n if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) {\n // element not found or tag with that ID not found, return false\n return [];\n }\n // Set currentContext to contain just this element\n currentContext = [element];\n continue; // Skip to next token\n }\n if (token.indexOf('.') > -1) {\n // Token contains a class selector\n bits = token.split('.');\n tagName = bits[0];\n var className = bits[1];\n if (!tagName) {\n tagName = '*';\n }\n // Get elements matching tag, filter them for class selector\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (found[j].className &&\n _.isString(found[j].className) && // some SVG elements have classNames which are not strings\n hasClass(found[j], className)\n ) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n continue; // Skip to next token\n }\n // Code to deal with attribute selectors\n var token_match = token.match(TOKEN_MATCH_REGEX);\n if (token_match) {\n tagName = token_match[1];\n var attrName = token_match[2];\n var attrOperator = token_match[3];\n var attrValue = token_match[4];\n if (!tagName) {\n tagName = '*';\n }\n // Grab all of the tagName elements within current context\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n if (tagName == '*') {\n elements = getAllChildren(currentContext[j]);\n } else {\n elements = currentContext[j].getElementsByTagName(tagName);\n }\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = [];\n currentContextIndex = 0;\n var checkFunction; // This function will be used to filter the elements\n switch (attrOperator) {\n case '=': // Equality\n checkFunction = function(e) {\n return (e.getAttribute(attrName) == attrValue);\n };\n break;\n case '~': // Match one of space seperated words\n checkFunction = function(e) {\n return (e.getAttribute(attrName).match(new RegExp('\\\\b' + attrValue + '\\\\b')));\n };\n break;\n case '|': // Match start with value followed by optional hyphen\n checkFunction = function(e) {\n return (e.getAttribute(attrName).match(new RegExp('^' + attrValue + '-?')));\n };\n break;\n case '^': // Match starts with value\n checkFunction = function(e) {\n return (e.getAttribute(attrName).indexOf(attrValue) === 0);\n };\n break;\n case '$': // Match ends with value - fails with \"Warning\" in Opera 7\n checkFunction = function(e) {\n return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length);\n };\n break;\n case '*': // Match ends with value\n checkFunction = function(e) {\n return (e.getAttribute(attrName).indexOf(attrValue) > -1);\n };\n break;\n default:\n // Just test for existence of attribute\n checkFunction = function(e) {\n return e.getAttribute(attrName);\n };\n }\n currentContext = [];\n currentContextIndex = 0;\n for (j = 0; j < found.length; j++) {\n if (checkFunction(found[j])) {\n currentContext[currentContextIndex++] = found[j];\n }\n }\n // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);\n continue; // Skip to next token\n }\n // If we get here, token is JUST an element (not a class or ID selector)\n tagName = token;\n found = [];\n foundCount = 0;\n for (j = 0; j < currentContext.length; j++) {\n elements = currentContext[j].getElementsByTagName(tagName);\n for (k = 0; k < elements.length; k++) {\n found[foundCount++] = elements[k];\n }\n }\n currentContext = found;\n }\n return currentContext;\n }\n\n return function(query) {\n if (_.isElement(query)) {\n return [query];\n } else if (_.isObject(query) && !_.isUndefined(query.length)) {\n return query;\n } else {\n return getElementsBySelector.call(this, query);\n }\n };\n})();\n\nvar CAMPAIGN_KEYWORDS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];\nvar CLICK_IDS = ['dclid', 'fbclid', 'gclid', 'ko_click_id', 'li_fat_id', 'msclkid', 'ttclid', 'twclid', 'wbraid'];\n\n_.info = {\n campaignParams: function(default_value) {\n var kw = '',\n params = {};\n _.each(CAMPAIGN_KEYWORDS, function(kwkey) {\n kw = _.getQueryParam(document$1.URL, kwkey);\n if (kw.length) {\n params[kwkey] = kw;\n } else if (default_value !== undefined) {\n params[kwkey] = default_value;\n }\n });\n\n return params;\n },\n\n clickParams: function() {\n var id = '',\n params = {};\n _.each(CLICK_IDS, function(idkey) {\n id = _.getQueryParam(document$1.URL, idkey);\n if (id.length) {\n params[idkey] = id;\n }\n });\n\n return params;\n },\n\n marketingParams: function() {\n return _.extend(_.info.campaignParams(), _.info.clickParams());\n },\n\n searchEngine: function(referrer) {\n if (referrer.search('https?://(.*)google.([^/?]*)') === 0) {\n return 'google';\n } else if (referrer.search('https?://(.*)bing.com') === 0) {\n return 'bing';\n } else if (referrer.search('https?://(.*)yahoo.com') === 0) {\n return 'yahoo';\n } else if (referrer.search('https?://(.*)duckduckgo.com') === 0) {\n return 'duckduckgo';\n } else {\n return null;\n }\n },\n\n searchInfo: function(referrer) {\n var search = _.info.searchEngine(referrer),\n param = (search != 'yahoo') ? 'q' : 'p',\n ret = {};\n\n if (search !== null) {\n ret['$search_engine'] = search;\n\n var keyword = _.getQueryParam(referrer, param);\n if (keyword.length) {\n ret['mp_keyword'] = keyword;\n }\n }\n\n return ret;\n },\n\n /**\n * This function detects which browser is running this script.\n * The order of the checks are important since many user agents\n * include key words used in later checks.\n */\n browser: function(user_agent, vendor, opera) {\n vendor = vendor || ''; // vendor is undefined for at least IE9\n if (opera || _.includes(user_agent, ' OPR/')) {\n if (_.includes(user_agent, 'Mini')) {\n return 'Opera Mini';\n }\n return 'Opera';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (_.includes(user_agent, 'IEMobile') || _.includes(user_agent, 'WPDesktop')) {\n return 'Internet Explorer Mobile';\n } else if (_.includes(user_agent, 'SamsungBrowser/')) {\n // https://developer.samsung.com/internet/user-agent-string-format\n return 'Samsung Internet';\n } else if (_.includes(user_agent, 'Edge') || _.includes(user_agent, 'Edg/')) {\n return 'Microsoft Edge';\n } else if (_.includes(user_agent, 'FBIOS')) {\n return 'Facebook Mobile';\n } else if (_.includes(user_agent, 'Chrome')) {\n return 'Chrome';\n } else if (_.includes(user_agent, 'CriOS')) {\n return 'Chrome iOS';\n } else if (_.includes(user_agent, 'UCWEB') || _.includes(user_agent, 'UCBrowser')) {\n return 'UC Browser';\n } else if (_.includes(user_agent, 'FxiOS')) {\n return 'Firefox iOS';\n } else if (_.includes(vendor, 'Apple')) {\n if (_.includes(user_agent, 'Mobile')) {\n return 'Mobile Safari';\n }\n return 'Safari';\n } else if (_.includes(user_agent, 'Android')) {\n return 'Android Mobile';\n } else if (_.includes(user_agent, 'Konqueror')) {\n return 'Konqueror';\n } else if (_.includes(user_agent, 'Firefox')) {\n return 'Firefox';\n } else if (_.includes(user_agent, 'MSIE') || _.includes(user_agent, 'Trident/')) {\n return 'Internet Explorer';\n } else if (_.includes(user_agent, 'Gecko')) {\n return 'Mozilla';\n } else {\n return '';\n }\n },\n\n /**\n * This function detects which browser version is running this script,\n * parsing major and minor version (e.g., 42.1). User agent strings from:\n * http://www.useragentstring.com/pages/useragentstring.php\n */\n browserVersion: function(userAgent, vendor, opera) {\n var browser = _.info.browser(userAgent, vendor, opera);\n var versionRegexs = {\n 'Internet Explorer Mobile': /rv:(\\d+(\\.\\d+)?)/,\n 'Microsoft Edge': /Edge?\\/(\\d+(\\.\\d+)?)/,\n 'Chrome': /Chrome\\/(\\d+(\\.\\d+)?)/,\n 'Chrome iOS': /CriOS\\/(\\d+(\\.\\d+)?)/,\n 'UC Browser' : /(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)/,\n 'Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Mobile Safari': /Version\\/(\\d+(\\.\\d+)?)/,\n 'Opera': /(Opera|OPR)\\/(\\d+(\\.\\d+)?)/,\n 'Firefox': /Firefox\\/(\\d+(\\.\\d+)?)/,\n 'Firefox iOS': /FxiOS\\/(\\d+(\\.\\d+)?)/,\n 'Konqueror': /Konqueror:(\\d+(\\.\\d+)?)/,\n 'BlackBerry': /BlackBerry (\\d+(\\.\\d+)?)/,\n 'Android Mobile': /android\\s(\\d+(\\.\\d+)?)/,\n 'Samsung Internet': /SamsungBrowser\\/(\\d+(\\.\\d+)?)/,\n 'Internet Explorer': /(rv:|MSIE )(\\d+(\\.\\d+)?)/,\n 'Mozilla': /rv:(\\d+(\\.\\d+)?)/\n };\n var regex = versionRegexs[browser];\n if (regex === undefined) {\n return null;\n }\n var matches = userAgent.match(regex);\n if (!matches) {\n return null;\n }\n return parseFloat(matches[matches.length - 2]);\n },\n\n os: function() {\n var a = userAgent;\n if (/Windows/i.test(a)) {\n if (/Phone/.test(a) || /WPDesktop/.test(a)) {\n return 'Windows Phone';\n }\n return 'Windows';\n } else if (/(iPhone|iPad|iPod)/.test(a)) {\n return 'iOS';\n } else if (/Android/.test(a)) {\n return 'Android';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(a)) {\n return 'BlackBerry';\n } else if (/Mac/i.test(a)) {\n return 'Mac OS X';\n } else if (/Linux/.test(a)) {\n return 'Linux';\n } else if (/CrOS/.test(a)) {\n return 'Chrome OS';\n } else {\n return '';\n }\n },\n\n device: function(user_agent) {\n if (/Windows Phone/i.test(user_agent) || /WPDesktop/.test(user_agent)) {\n return 'Windows Phone';\n } else if (/iPad/.test(user_agent)) {\n return 'iPad';\n } else if (/iPod/.test(user_agent)) {\n return 'iPod Touch';\n } else if (/iPhone/.test(user_agent)) {\n return 'iPhone';\n } else if (/(BlackBerry|PlayBook|BB10)/i.test(user_agent)) {\n return 'BlackBerry';\n } else if (/Android/.test(user_agent)) {\n return 'Android';\n } else {\n return '';\n }\n },\n\n referringDomain: function(referrer) {\n var split = referrer.split('/');\n if (split.length >= 3) {\n return split[2];\n }\n return '';\n },\n\n properties: function() {\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator.vendor, windowOpera),\n '$referrer': document$1.referrer,\n '$referring_domain': _.info.referringDomain(document$1.referrer),\n '$device': _.info.device(userAgent)\n }), {\n '$current_url': window$1.location.href,\n '$browser_version': _.info.browserVersion(userAgent, navigator.vendor, windowOpera),\n '$screen_height': screen.height,\n '$screen_width': screen.width,\n 'mp_lib': 'web',\n '$lib_version': Config.LIB_VERSION,\n '$insert_id': cheap_guid(),\n 'time': _.timestamp() / 1000 // epoch time in seconds\n });\n },\n\n people_properties: function() {\n return _.extend(_.strip_empty_properties({\n '$os': _.info.os(),\n '$browser': _.info.browser(userAgent, navigator.vendor, windowOpera)\n }), {\n '$browser_version': _.info.browserVersion(userAgent, navigator.vendor, windowOpera)\n });\n },\n\n mpPageViewProperties: function() {\n return _.strip_empty_properties({\n 'current_page_title': document$1.title,\n 'current_domain': window$1.location.hostname,\n 'current_url_path': window$1.location.pathname,\n 'current_url_protocol': window$1.location.protocol,\n 'current_url_search': window$1.location.search\n });\n }\n};\n\nvar cheap_guid = function(maxlen) {\n var guid = Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10);\n return maxlen ? guid.substring(0, maxlen) : guid;\n};\n\n// naive way to extract domain name (example.com) from full hostname (my.sub.example.com)\nvar SIMPLE_DOMAIN_MATCH_REGEX = /[a-z0-9][a-z0-9-]*\\.[a-z]+$/i;\n// this next one attempts to account for some ccSLDs, e.g. extracting oxford.ac.uk from www.oxford.ac.uk\nvar DOMAIN_MATCH_REGEX = /[a-z0-9][a-z0-9-]+\\.[a-z.]{2,6}$/i;\n/**\n * Attempts to extract main domain name from full hostname, using a few blunt heuristics. For\n * common TLDs like .com/.org that always have a simple SLD.TLD structure (example.com), we\n * simply extract the last two .-separated parts of the hostname (SIMPLE_DOMAIN_MATCH_REGEX).\n * For others, we attempt to account for short ccSLD+TLD combos (.ac.uk) with the legacy\n * DOMAIN_MATCH_REGEX (kept to maintain backwards compatibility with existing Mixpanel\n * integrations). The only _reliable_ way to extract domain from hostname is with an up-to-date\n * list like at https://publicsuffix.org/ so for cases that this helper fails at, the SDK\n * offers the 'cookie_domain' config option to set it explicitly.\n * @example\n * extract_domain('my.sub.example.com')\n * // 'example.com'\n */\nvar extract_domain = function(hostname) {\n var domain_regex = DOMAIN_MATCH_REGEX;\n var parts = hostname.split('.');\n var tld = parts[parts.length - 1];\n if (tld.length > 4 || tld === 'com' || tld === 'org') {\n domain_regex = SIMPLE_DOMAIN_MATCH_REGEX;\n }\n var matches = hostname.match(domain_regex);\n return matches ? matches[0] : '';\n};\n\nvar JSONStringify = null;\nvar JSONParse = null;\nif (typeof JSON !== 'undefined') {\n JSONStringify = JSON.stringify;\n JSONParse = JSON.parse;\n}\nJSONStringify = JSONStringify || _.JSONEncode;\nJSONParse = JSONParse || _.JSONDecode;\n\n// EXPORTS (for closure compiler)\n_['toArray'] = _.toArray;\n_['isObject'] = _.isObject;\n_['JSONEncode'] = _.JSONEncode;\n_['JSONDecode'] = _.JSONDecode;\n_['isBlockedUA'] = _.isBlockedUA;\n_['isEmptyObject'] = _.isEmptyObject;\n_['info'] = _.info;\n_['info']['device'] = _.info.device;\n_['info']['browser'] = _.info.browser;\n_['info']['browserVersion'] = _.info.browserVersion;\n_['info']['properties'] = _.info.properties;\n\n/**\n * DomTracker Object\n * @constructor\n */\nvar DomTracker = function() {};\n\n\n// interface\nDomTracker.prototype.create_properties = function() {};\nDomTracker.prototype.event_handler = function() {};\nDomTracker.prototype.after_track_handler = function() {};\n\nDomTracker.prototype.init = function(mixpanel_instance) {\n this.mp = mixpanel_instance;\n return this;\n};\n\n/**\n * @param {Object|string} query\n * @param {string} event_name\n * @param {Object=} properties\n * @param {function=} user_callback\n */\nDomTracker.prototype.track = function(query, event_name, properties, user_callback) {\n var that = this;\n var elements = _.dom_query(query);\n\n if (elements.length === 0) {\n console.error('The DOM query (' + query + ') returned 0 elements');\n return;\n }\n\n _.each(elements, function(element) {\n _.register_event(element, this.override_event, function(e) {\n var options = {};\n var props = that.create_properties(properties, this);\n var timeout = that.mp.get_config('track_links_timeout');\n\n that.event_handler(e, this, options);\n\n // in case the mixpanel servers don't get back to us in time\n window.setTimeout(that.track_callback(user_callback, props, options, true), timeout);\n\n // fire the tracking event\n that.mp.track(event_name, props, that.track_callback(user_callback, props, options));\n });\n }, this);\n\n return true;\n};\n\n/**\n * @param {function} user_callback\n * @param {Object} props\n * @param {boolean=} timeout_occured\n */\nDomTracker.prototype.track_callback = function(user_callback, props, options, timeout_occured) {\n timeout_occured = timeout_occured || false;\n var that = this;\n\n return function() {\n // options is referenced from both callbacks, so we can have\n // a 'lock' of sorts to ensure only one fires\n if (options.callback_fired) { return; }\n options.callback_fired = true;\n\n if (user_callback && user_callback(timeout_occured, props) === false) {\n // user can prevent the default functionality by\n // returning false from their callback\n return;\n }\n\n that.after_track_handler(props, options, timeout_occured);\n };\n};\n\nDomTracker.prototype.create_properties = function(properties, element) {\n var props;\n\n if (typeof(properties) === 'function') {\n props = properties(element);\n } else {\n props = _.extend({}, properties);\n }\n\n return props;\n};\n\n/**\n * LinkTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar LinkTracker = function() {\n this.override_event = 'click';\n};\n_.inherit(LinkTracker, DomTracker);\n\nLinkTracker.prototype.create_properties = function(properties, element) {\n var props = LinkTracker.superclass.create_properties.apply(this, arguments);\n\n if (element.href) { props['url'] = element.href; }\n\n return props;\n};\n\nLinkTracker.prototype.event_handler = function(evt, element, options) {\n options.new_tab = (\n evt.which === 2 ||\n evt.metaKey ||\n evt.ctrlKey ||\n element.target === '_blank'\n );\n options.href = element.href;\n\n if (!options.new_tab) {\n evt.preventDefault();\n }\n};\n\nLinkTracker.prototype.after_track_handler = function(props, options) {\n if (options.new_tab) { return; }\n\n setTimeout(function() {\n window.location = options.href;\n }, 0);\n};\n\n/**\n * FormTracker Object\n * @constructor\n * @extends DomTracker\n */\nvar FormTracker = function() {\n this.override_event = 'submit';\n};\n_.inherit(FormTracker, DomTracker);\n\nFormTracker.prototype.event_handler = function(evt, element, options) {\n options.element = element;\n evt.preventDefault();\n};\n\nFormTracker.prototype.after_track_handler = function(props, options) {\n setTimeout(function() {\n options.element.submit();\n }, 0);\n};\n\n// eslint-disable-line camelcase\n\nvar logger$2 = console_with_prefix('lock');\n\n/**\n * SharedLock: a mutex built on HTML5 localStorage, to ensure that only one browser\n * window/tab at a time will be able to access shared resources.\n *\n * Based on the Alur and Taubenfeld fast lock\n * (http://www.cs.rochester.edu/research/synchronization/pseudocode/fastlock.html)\n * with an added timeout to ensure there will be eventual progress in the event\n * that a window is closed in the middle of the callback.\n *\n * Implementation based on the original version by David Wolever (https://github.com/wolever)\n * at https://gist.github.com/wolever/5fd7573d1ef6166e8f8c4af286a69432.\n *\n * @example\n * const myLock = new SharedLock('some-key');\n * myLock.withLock(function() {\n * console.log('I hold the mutex!');\n * });\n *\n * @constructor\n */\nvar SharedLock = function(key, options) {\n options = options || {};\n\n this.storageKey = key;\n this.storage = options.storage || window.localStorage;\n this.pollIntervalMS = options.pollIntervalMS || 100;\n this.timeoutMS = options.timeoutMS || 2000;\n};\n\n// pass in a specific pid to test contention scenarios; otherwise\n// it is chosen randomly for each acquisition attempt\nSharedLock.prototype.withLock = function(lockedCB, errorCB, pid) {\n if (!pid && typeof errorCB !== 'function') {\n pid = errorCB;\n errorCB = null;\n }\n\n var i = pid || (new Date().getTime() + '|' + Math.random());\n var startTime = new Date().getTime();\n\n var key = this.storageKey;\n var pollIntervalMS = this.pollIntervalMS;\n var timeoutMS = this.timeoutMS;\n var storage = this.storage;\n\n var keyX = key + ':X';\n var keyY = key + ':Y';\n var keyZ = key + ':Z';\n\n var reportError = function(err) {\n errorCB && errorCB(err);\n };\n\n var delay = function(cb) {\n if (new Date().getTime() - startTime > timeoutMS) {\n logger$2.error('Timeout waiting for mutex on ' + key + '; clearing lock. [' + i + ']');\n storage.removeItem(keyZ);\n storage.removeItem(keyY);\n loop();\n return;\n }\n setTimeout(function() {\n try {\n cb();\n } catch(err) {\n reportError(err);\n }\n }, pollIntervalMS * (Math.random() + 0.1));\n };\n\n var waitFor = function(predicate, cb) {\n if (predicate()) {\n cb();\n } else {\n delay(function() {\n waitFor(predicate, cb);\n });\n }\n };\n\n var getSetY = function() {\n var valY = storage.getItem(keyY);\n if (valY && valY !== i) { // if Y == i then this process already has the lock (useful for test cases)\n return false;\n } else {\n storage.setItem(keyY, i);\n if (storage.getItem(keyY) === i) {\n return true;\n } else {\n if (!localStorageSupported(storage, true)) {\n throw new Error('localStorage support dropped while acquiring lock');\n }\n return false;\n }\n }\n };\n\n var loop = function() {\n storage.setItem(keyX, i);\n\n waitFor(getSetY, function() {\n if (storage.getItem(keyX) === i) {\n criticalSection();\n return;\n }\n\n delay(function() {\n if (storage.getItem(keyY) !== i) {\n loop();\n return;\n }\n waitFor(function() {\n return !storage.getItem(keyZ);\n }, criticalSection);\n });\n });\n };\n\n var criticalSection = function() {\n storage.setItem(keyZ, '1');\n try {\n lockedCB();\n } finally {\n storage.removeItem(keyZ);\n if (storage.getItem(keyY) === i) {\n storage.removeItem(keyY);\n }\n if (storage.getItem(keyX) === i) {\n storage.removeItem(keyX);\n }\n }\n };\n\n try {\n if (localStorageSupported(storage, true)) {\n loop();\n } else {\n throw new Error('localStorage support check failed');\n }\n } catch(err) {\n reportError(err);\n }\n};\n\n// eslint-disable-line camelcase\n\nvar logger$1 = console_with_prefix('batch');\n\n/**\n * RequestQueue: queue for batching API requests with localStorage backup for retries.\n * Maintains an in-memory queue which represents the source of truth for the current\n * page, but also writes all items out to a copy in the browser's localStorage, which\n * can be read on subsequent pageloads and retried. For batchability, all the request\n * items in the queue should be of the same type (events, people updates, group updates)\n * so they can be sent in a single request to the same API endpoint.\n *\n * LocalStorage keying and locking: In order for reloads and subsequent pageloads of\n * the same site to access the same persisted data, they must share the same localStorage\n * key (for instance based on project token and queue type). Therefore access to the\n * localStorage entry is guarded by an asynchronous mutex (SharedLock) to prevent\n * simultaneously open windows/tabs from overwriting each other's data (which would lead\n * to data loss in some situations).\n * @constructor\n */\nvar RequestQueue = function(storageKey, options) {\n options = options || {};\n this.storageKey = storageKey;\n this.storage = options.storage || window.localStorage;\n this.reportError = options.errorReporter || _.bind(logger$1.error, logger$1);\n this.lock = new SharedLock(storageKey, {storage: this.storage});\n\n this.pid = options.pid || null; // pass pid to test out storage lock contention scenarios\n\n this.memQueue = [];\n};\n\n/**\n * Add one item to queues (memory and localStorage). The queued entry includes\n * the given item along with an auto-generated ID and a \"flush-after\" timestamp.\n * It is expected that the item will be sent over the network and dequeued\n * before the flush-after time; if this doesn't happen it is considered orphaned\n * (e.g., the original tab where it was enqueued got closed before it could be\n * sent) and the item can be sent by any tab that finds it in localStorage.\n *\n * The final callback param is called with a param indicating success or\n * failure of the enqueue operation; it is asynchronous because the localStorage\n * lock is asynchronous.\n */\nRequestQueue.prototype.enqueue = function(item, flushInterval, cb) {\n var queueEntry = {\n 'id': cheap_guid(),\n 'flushAfter': new Date().getTime() + flushInterval * 2,\n 'payload': item\n };\n\n this.lock.withLock(_.bind(function lockAcquired() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue.push(queueEntry);\n succeeded = this.saveToStorage(storedQueue);\n if (succeeded) {\n // only add to in-memory queue when storage succeeds\n this.memQueue.push(queueEntry);\n }\n } catch(err) {\n this.reportError('Error enqueueing item', item);\n succeeded = false;\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), _.bind(function lockFailure(err) {\n this.reportError('Error acquiring storage lock', err);\n if (cb) {\n cb(false);\n }\n }, this), this.pid);\n};\n\n/**\n * Read out the given number of queue entries. If this.memQueue\n * has fewer than batchSize items, then look for \"orphaned\" items\n * in the persisted queue (items where the 'flushAfter' time has\n * already passed).\n */\nRequestQueue.prototype.fillBatch = function(batchSize) {\n var batch = this.memQueue.slice(0, batchSize);\n if (batch.length < batchSize) {\n // don't need lock just to read events; localStorage is thread-safe\n // and the worst that could happen is a duplicate send of some\n // orphaned events, which will be deduplicated on the server side\n var storedQueue = this.readFromStorage();\n if (storedQueue.length) {\n // item IDs already in batch; don't duplicate out of storage\n var idsInBatch = {}; // poor man's Set\n _.each(batch, function(item) { idsInBatch[item['id']] = true; });\n\n for (var i = 0; i < storedQueue.length; i++) {\n var item = storedQueue[i];\n if (new Date().getTime() > item['flushAfter'] && !idsInBatch[item['id']]) {\n item.orphaned = true;\n batch.push(item);\n if (batch.length >= batchSize) {\n break;\n }\n }\n }\n }\n }\n return batch;\n};\n\n/**\n * Remove items with matching 'id' from array (immutably)\n * also remove any item without a valid id (e.g., malformed\n * storage entries).\n */\nvar filterOutIDsAndInvalid = function(items, idSet) {\n var filteredItems = [];\n _.each(items, function(item) {\n if (item['id'] && !idSet[item['id']]) {\n filteredItems.push(item);\n }\n });\n return filteredItems;\n};\n\n/**\n * Remove items with matching IDs from both in-memory queue\n * and persisted queue\n */\nRequestQueue.prototype.removeItemsByID = function(ids, cb) {\n var idSet = {}; // poor man's Set\n _.each(ids, function(id) { idSet[id] = true; });\n\n this.memQueue = filterOutIDsAndInvalid(this.memQueue, idSet);\n\n var removeFromStorage = _.bind(function() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue = filterOutIDsAndInvalid(storedQueue, idSet);\n succeeded = this.saveToStorage(storedQueue);\n\n // an extra check: did storage report success but somehow\n // the items are still there?\n if (succeeded) {\n storedQueue = this.readFromStorage();\n for (var i = 0; i < storedQueue.length; i++) {\n var item = storedQueue[i];\n if (item['id'] && !!idSet[item['id']]) {\n this.reportError('Item not removed from storage');\n return false;\n }\n }\n }\n } catch(err) {\n this.reportError('Error removing items', ids);\n succeeded = false;\n }\n return succeeded;\n }, this);\n\n this.lock.withLock(function lockAcquired() {\n var succeeded = removeFromStorage();\n if (cb) {\n cb(succeeded);\n }\n }, _.bind(function lockFailure(err) {\n var succeeded = false;\n this.reportError('Error acquiring storage lock', err);\n if (!localStorageSupported(this.storage, true)) {\n // Looks like localStorage writes have stopped working sometime after\n // initialization (probably full), and so nobody can acquire locks\n // anymore. Consider it temporarily safe to remove items without the\n // lock, since nobody's writing successfully anyway.\n succeeded = removeFromStorage();\n if (!succeeded) {\n // OK, we couldn't even write out the smaller queue. Try clearing it\n // entirely.\n try {\n this.storage.removeItem(this.storageKey);\n } catch(err) {\n this.reportError('Error clearing queue', err);\n }\n }\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), this.pid);\n};\n\n// internal helper for RequestQueue.updatePayloads\nvar updatePayloads = function(existingItems, itemsToUpdate) {\n var newItems = [];\n _.each(existingItems, function(item) {\n var id = item['id'];\n if (id in itemsToUpdate) {\n var newPayload = itemsToUpdate[id];\n if (newPayload !== null) {\n item['payload'] = newPayload;\n newItems.push(item);\n }\n } else {\n // no update\n newItems.push(item);\n }\n });\n return newItems;\n};\n\n/**\n * Update payloads of given items in both in-memory queue and\n * persisted queue. Items set to null are removed from queues.\n */\nRequestQueue.prototype.updatePayloads = function(itemsToUpdate, cb) {\n this.memQueue = updatePayloads(this.memQueue, itemsToUpdate);\n this.lock.withLock(_.bind(function lockAcquired() {\n var succeeded;\n try {\n var storedQueue = this.readFromStorage();\n storedQueue = updatePayloads(storedQueue, itemsToUpdate);\n succeeded = this.saveToStorage(storedQueue);\n } catch(err) {\n this.reportError('Error updating items', itemsToUpdate);\n succeeded = false;\n }\n if (cb) {\n cb(succeeded);\n }\n }, this), _.bind(function lockFailure(err) {\n this.reportError('Error acquiring storage lock', err);\n if (cb) {\n cb(false);\n }\n }, this), this.pid);\n};\n\n/**\n * Read and parse items array from localStorage entry, handling\n * malformed/missing data if necessary.\n */\nRequestQueue.prototype.readFromStorage = function() {\n var storageEntry;\n try {\n storageEntry = this.storage.getItem(this.storageKey);\n if (storageEntry) {\n storageEntry = JSONParse(storageEntry);\n if (!_.isArray(storageEntry)) {\n this.reportError('Invalid storage entry:', storageEntry);\n storageEntry = null;\n }\n }\n } catch (err) {\n this.reportError('Error retrieving queue', err);\n storageEntry = null;\n }\n return storageEntry || [];\n};\n\n/**\n * Serialize the given items array to localStorage.\n */\nRequestQueue.prototype.saveToStorage = function(queue) {\n try {\n this.storage.setItem(this.storageKey, JSONStringify(queue));\n return true;\n } catch (err) {\n this.reportError('Error saving queue', err);\n return false;\n }\n};\n\n/**\n * Clear out queues (memory and localStorage).\n */\nRequestQueue.prototype.clear = function() {\n this.memQueue = [];\n this.storage.removeItem(this.storageKey);\n};\n\n// eslint-disable-line camelcase\n\n// maximum interval between request retries after exponential backoff\nvar MAX_RETRY_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes\n\nvar logger = console_with_prefix('batch');\n\n/**\n * RequestBatcher: manages the queueing, flushing, retry etc of requests of one\n * type (events, people, groups).\n * Uses RequestQueue to manage the backing store.\n * @constructor\n */\nvar RequestBatcher = function(storageKey, options) {\n this.errorReporter = options.errorReporter;\n this.queue = new RequestQueue(storageKey, {\n errorReporter: _.bind(this.reportError, this),\n storage: options.storage\n });\n\n this.libConfig = options.libConfig;\n this.sendRequest = options.sendRequestFunc;\n this.beforeSendHook = options.beforeSendHook;\n this.stopAllBatching = options.stopAllBatchingFunc;\n\n // seed variable batch size + flush interval with configured values\n this.batchSize = this.libConfig['batch_size'];\n this.flushInterval = this.libConfig['batch_flush_interval_ms'];\n\n this.stopped = !this.libConfig['batch_autostart'];\n this.consecutiveRemovalFailures = 0;\n\n // extra client-side dedupe\n this.itemIdsSentSuccessfully = {};\n};\n\n/**\n * Add one item to queue.\n */\nRequestBatcher.prototype.enqueue = function(item, cb) {\n this.queue.enqueue(item, this.flushInterval, cb);\n};\n\n/**\n * Start flushing batches at the configured time interval. Must call\n * this method upon SDK init in order to send anything over the network.\n */\nRequestBatcher.prototype.start = function() {\n this.stopped = false;\n this.consecutiveRemovalFailures = 0;\n this.flush();\n};\n\n/**\n * Stop flushing batches. Can be restarted by calling start().\n */\nRequestBatcher.prototype.stop = function() {\n this.stopped = true;\n if (this.timeoutID) {\n clearTimeout(this.timeoutID);\n this.timeoutID = null;\n }\n};\n\n/**\n * Clear out queue.\n */\nRequestBatcher.prototype.clear = function() {\n this.queue.clear();\n};\n\n/**\n * Restore batch size configuration to whatever is set in the main SDK.\n */\nRequestBatcher.prototype.resetBatchSize = function() {\n this.batchSize = this.libConfig['batch_size'];\n};\n\n/**\n * Restore flush interval time configuration to whatever is set in the main SDK.\n */\nRequestBatcher.prototype.resetFlush = function() {\n this.scheduleFlush(this.libConfig['batch_flush_interval_ms']);\n};\n\n/**\n * Schedule the next flush in the given number of milliseconds.\n */\nRequestBatcher.prototype.scheduleFlush = function(flushMS) {\n this.flushInterval = flushMS;\n if (!this.stopped) { // don't schedule anymore if batching has been stopped\n this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);\n }\n};\n\n/**\n * Flush one batch to network. Depending on success/failure modes, it will either\n * remove the batch from the queue or leave it in for retry, and schedule the next\n * flush. In cases of most network or API failures, it will back off exponentially\n * when retrying.\n * @param {Object} [options]\n * @param {boolean} [options.sendBeacon] - whether to send batch with\n * navigator.sendBeacon (only useful for sending batches before page unloads, as\n * sendBeacon offers no callbacks or status indications)\n */\nRequestBatcher.prototype.flush = function(options) {\n try {\n\n if (this.requestInProgress) {\n logger.log('Flush: Request already in progress');\n return;\n }\n\n options = options || {};\n var timeoutMS = this.libConfig['batch_request_timeout_ms'];\n var startTime = new Date().getTime();\n var currentBatchSize = this.batchSize;\n var batch = this.queue.fillBatch(currentBatchSize);\n var dataForRequest = [];\n var transformedItems = {};\n _.each(batch, function(item) {\n var payload = item['payload'];\n if (this.beforeSendHook && !item.orphaned) {\n payload = this.beforeSendHook(payload);\n }\n if (payload) {\n // mp_sent_by_lib_version prop captures which lib version actually\n // sends each event (regardless of which version originally queued\n // it for sending)\n if (payload['event'] && payload['properties']) {\n payload['properties'] = _.extend(\n {},\n payload['properties'],\n {'mp_sent_by_lib_version': Config.LIB_VERSION}\n );\n }\n var addPayload = true;\n var itemId = item['id'];\n if (itemId) {\n if ((this.itemIdsSentSuccessfully[itemId] || 0) > 5) {\n this.reportError('[dupe] item ID sent too many times, not sending', {\n item: item,\n batchSize: batch.length,\n timesSent: this.itemIdsSentSuccessfully[itemId]\n });\n addPayload = false;\n }\n } else {\n this.reportError('[dupe] found item with no ID', {item: item});\n }\n\n if (addPayload) {\n dataForRequest.push(payload);\n }\n }\n transformedItems[item['id']] = payload;\n }, this);\n if (dataForRequest.length < 1) {\n this.resetFlush();\n return; // nothing to do\n }\n\n this.requestInProgress = true;\n\n var batchSendCallback = _.bind(function(res) {\n this.requestInProgress = false;\n\n try {\n\n // handle API response in a try-catch to make sure we can reset the\n // flush operation if something goes wrong\n\n var removeItemsFromQueue = false;\n if (options.unloading) {\n // update persisted data to include hook transformations\n this.queue.updatePayloads(transformedItems);\n } else if (\n _.isObject(res) &&\n res.error === 'timeout' &&\n new Date().getTime() - startTime >= timeoutMS\n ) {\n this.reportError('Network timeout; retrying');\n this.flush();\n } else if (\n _.isObject(res) &&\n res.xhr_req &&\n (res.xhr_req['status'] >= 500 || res.xhr_req['status'] === 429 || res.error === 'timeout')\n ) {\n // network or API error, or 429 Too Many Requests, retry\n var retryMS = this.flushInterval * 2;\n var headers = res.xhr_req['responseHeaders'];\n if (headers) {\n var retryAfter = headers['Retry-After'];\n if (retryAfter) {\n retryMS = (parseInt(retryAfter, 10) * 1000) || retryMS;\n }\n }\n retryMS = Math.min(MAX_RETRY_INTERVAL_MS, retryMS);\n this.reportError('Error; retry in ' + retryMS + ' ms');\n this.scheduleFlush(retryMS);\n } else if (_.isObject(res) && res.xhr_req && res.xhr_req['status'] === 413) {\n // 413 Payload Too Large\n if (batch.length > 1) {\n var halvedBatchSize = Math.max(1, Math.floor(currentBatchSize / 2));\n this.batchSize = Math.min(this.batchSize, halvedBatchSize, batch.length - 1);\n this.reportError('413 response; reducing batch size to ' + this.batchSize);\n this.resetFlush();\n } else {\n this.reportError('Single-event request too large; dropping', batch);\n this.resetBatchSize();\n removeItemsFromQueue = true;\n }\n } else {\n // successful network request+response; remove each item in batch from queue\n // (even if it was e.g. a 400, in which case retrying won't help)\n removeItemsFromQueue = true;\n }\n\n if (removeItemsFromQueue) {\n this.queue.removeItemsByID(\n _.map(batch, function(item) { return item['id']; }),\n _.bind(function(succeeded) {\n if (succeeded) {\n this.consecutiveRemovalFailures = 0;\n this.flush(); // handle next batch if the queue isn't empty\n } else {\n this.reportError('Failed to remove items from queue');\n if (++this.consecutiveRemovalFailures > 5) {\n this.reportError('Too many queue failures; disabling batching system.');\n this.stopAllBatching();\n } else {\n this.resetFlush();\n }\n }\n }, this)\n );\n\n // client-side dedupe\n _.each(batch, _.bind(function(item) {\n var itemId = item['id'];\n if (itemId) {\n this.itemIdsSentSuccessfully[itemId] = this.itemIdsSentSuccessfully[itemId] || 0;\n this.itemIdsSentSuccessfully[itemId]++;\n if (this.itemIdsSentSuccessfully[itemId] > 5) {\n this.reportError('[dupe] item ID sent too many times', {\n item: item,\n batchSize: batch.length,\n timesSent: this.itemIdsSentSuccessfully[itemId]\n });\n }\n } else {\n this.reportError('[dupe] found item with no ID while removing', {item: item});\n }\n }, this));\n }\n\n } catch(err) {\n this.reportError('Error handling API response', err);\n this.resetFlush();\n }\n }, this);\n var requestOptions = {\n method: 'POST',\n verbose: true,\n ignore_json_errors: true, // eslint-disable-line camelcase\n timeout_ms: timeoutMS // eslint-disable-line camelcase\n };\n if (options.unloading) {\n requestOptions.transport = 'sendBeacon';\n }\n logger.log('MIXPANEL REQUEST:', dataForRequest);\n this.sendRequest(dataForRequest, requestOptions, batchSendCallback);\n\n } catch(err) {\n this.reportError('Error flushing request queue', err);\n this.resetFlush();\n }\n};\n\n/**\n * Log error to global logger and optional user-defined logger.\n */\nRequestBatcher.prototype.reportError = function(msg, err) {\n logger.error.apply(logger.error, arguments);\n if (this.errorReporter) {\n try {\n if (!(err instanceof Error)) {\n err = new Error(msg);\n }\n this.errorReporter(msg, err);\n } catch(err) {\n logger.error(err);\n }\n }\n};\n\n/**\n * A function used to track a Mixpanel event (e.g. MixpanelLib.track)\n * @callback trackFunction\n * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc.\n * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself.\n * @param {Function} [callback] If provided, the callback function will be called after tracking the event.\n */\n\n/** Public **/\n\nvar GDPR_DEFAULT_PERSISTENCE_PREFIX = '__mp_opt_in_out_';\n\n/**\n * Opt the user in to data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action\n * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action\n * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction optIn(token, options) {\n _optInOut(true, token, options);\n}\n\n/**\n * Opt the user out of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-out cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-out cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-out cookie is set as secure or not\n */\nfunction optOut(token, options) {\n _optInOut(false, token, options);\n}\n\n/**\n * Check whether the user has opted in to data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} whether the user has opted in to the given opt type\n */\nfunction hasOptedIn(token, options) {\n return _getStorageValue(token, options) === '1';\n}\n\n/**\n * Check whether the user has opted out of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {boolean} [options.ignoreDnt] - flag to ignore browser DNT settings and always return false\n * @returns {boolean} whether the user has opted out of the given opt type\n */\nfunction hasOptedOut(token, options) {\n if (_hasDoNotTrackFlagOn(options)) {\n console.warn('This browser has \"Do Not Track\" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the \"Do Not Track\" browser setting, initialize the Mixpanel instance with the config \"ignore_dnt: true\"');\n return true;\n }\n var optedOut = _getStorageValue(token, options) === '0';\n if (optedOut) {\n console.warn('You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data.');\n }\n return optedOut;\n}\n\n/**\n * Wrap a MixpanelLib method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelLib(method) {\n return _addOptOutCheck(method, function(name) {\n return this.get_config(name);\n });\n}\n\n/**\n * Wrap a MixpanelPeople method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelPeople(method) {\n return _addOptOutCheck(method, function(name) {\n return this._get_config(name);\n });\n}\n\n/**\n * Wrap a MixpanelGroup method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction addOptOutCheckMixpanelGroup(method) {\n return _addOptOutCheck(method, function(name) {\n return this._get_config(name);\n });\n}\n\n/**\n * Clear the user's opt in/out status of data tracking and cookies/localstorage for the given token\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistenceType] Persistence mechanism used - cookie or localStorage\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction clearOptInOut(token, options) {\n options = options || {};\n _getStorage(options).remove(\n _getStorageKey(token, options), !!options.crossSubdomainCookie, options.cookieDomain\n );\n}\n\n/** Private **/\n\n/**\n * Get storage util\n * @param {Object} [options]\n * @param {string} [options.persistenceType]\n * @returns {object} either _.cookie or _.localstorage\n */\nfunction _getStorage(options) {\n options = options || {};\n return options.persistenceType === 'localStorage' ? _.localStorage : _.cookie;\n}\n\n/**\n * Get the name of the cookie that is used for the given opt type (tracking, cookie, etc.)\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {string} the name of the cookie for the given opt type\n */\nfunction _getStorageKey(token, options) {\n options = options || {};\n return (options.persistencePrefix || GDPR_DEFAULT_PERSISTENCE_PREFIX) + token;\n}\n\n/**\n * Get the value of the cookie that is used for the given opt type (tracking, cookie, etc.)\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @returns {string} the value of the cookie for the given opt type\n */\nfunction _getStorageValue(token, options) {\n return _getStorage(options).get(_getStorageKey(token, options));\n}\n\n/**\n * Check whether the user has set the DNT/doNotTrack setting to true in their browser\n * @param {Object} [options]\n * @param {string} [options.window] - alternate window object to check; used to force various DNT settings in browser tests\n * @param {boolean} [options.ignoreDnt] - flag to ignore browser DNT settings and always return false\n * @returns {boolean} whether the DNT setting is true\n */\nfunction _hasDoNotTrackFlagOn(options) {\n if (options && options.ignoreDnt) {\n return false;\n }\n var win = (options && options.window) || window$1;\n var nav = win['navigator'] || {};\n var hasDntOn = false;\n\n _.each([\n nav['doNotTrack'], // standard\n nav['msDoNotTrack'],\n win['doNotTrack']\n ], function(dntValue) {\n if (_.includes([true, 1, '1', 'yes'], dntValue)) {\n hasDntOn = true;\n }\n });\n\n return hasDntOn;\n}\n\n/**\n * Set cookie/localstorage for the user indicating that they are opted in or out for the given opt type\n * @param {boolean} optValue - whether to opt the user in or out for the given opt type\n * @param {string} token - Mixpanel project tracking token\n * @param {Object} [options]\n * @param {trackFunction} [options.track] - function used for tracking a Mixpanel event to record the opt-in action\n * @param {string} [options.trackEventName] - event name to be used for tracking the opt-in action\n * @param {Object} [options.trackProperties] - set of properties to be tracked along with the opt-in action\n * @param {string} [options.persistencePrefix=__mp_opt_in_out] - custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookieExpiration] - number of days until the opt-in cookie expires\n * @param {string} [options.cookieDomain] - custom cookie domain\n * @param {boolean} [options.crossSiteCookie] - whether the opt-in cookie is set as cross-site-enabled\n * @param {boolean} [options.crossSubdomainCookie] - whether the opt-in cookie is set as cross-subdomain or not\n * @param {boolean} [options.secureCookie] - whether the opt-in cookie is set as secure or not\n */\nfunction _optInOut(optValue, token, options) {\n if (!_.isString(token) || !token.length) {\n console.error('gdpr.' + (optValue ? 'optIn' : 'optOut') + ' called with an invalid token');\n return;\n }\n\n options = options || {};\n\n _getStorage(options).set(\n _getStorageKey(token, options),\n optValue ? 1 : 0,\n _.isNumber(options.cookieExpiration) ? options.cookieExpiration : null,\n !!options.crossSubdomainCookie,\n !!options.secureCookie,\n !!options.crossSiteCookie,\n options.cookieDomain\n );\n\n if (options.track && optValue) { // only track event if opting in (optValue=true)\n options.track(options.trackEventName || '$opt_in', options.trackProperties, {\n 'send_immediately': true\n });\n }\n}\n\n/**\n * Wrap a method with a check for whether the user is opted out of data tracking and cookies/localstorage for the given token\n * If the user has opted out, return early instead of executing the method.\n * If a callback argument was provided, execute it passing the 0 error code.\n * @param {function} method - wrapped method to be executed if the user has not opted out\n * @param {function} getConfigValue - getter function for the Mixpanel API token and other options to be used with opt-out check\n * @returns {*} the result of executing method OR undefined if the user has opted out\n */\nfunction _addOptOutCheck(method, getConfigValue) {\n return function() {\n var optedOut = false;\n\n try {\n var token = getConfigValue.call(this, 'token');\n var ignoreDnt = getConfigValue.call(this, 'ignore_dnt');\n var persistenceType = getConfigValue.call(this, 'opt_out_tracking_persistence_type');\n var persistencePrefix = getConfigValue.call(this, 'opt_out_tracking_cookie_prefix');\n var win = getConfigValue.call(this, 'window'); // used to override window during browser tests\n\n if (token) { // if there was an issue getting the token, continue method execution as normal\n optedOut = hasOptedOut(token, {\n ignoreDnt: ignoreDnt,\n persistenceType: persistenceType,\n persistencePrefix: persistencePrefix,\n window: win\n });\n }\n } catch(err) {\n console.error('Unexpected error when checking tracking opt-out status: ' + err);\n }\n\n if (!optedOut) {\n return method.apply(this, arguments);\n }\n\n var callback = arguments[arguments.length - 1];\n if (typeof(callback) === 'function') {\n callback(0);\n }\n\n return;\n };\n}\n\n/** @const */ var SET_ACTION = '$set';\n/** @const */ var SET_ONCE_ACTION = '$set_once';\n/** @const */ var UNSET_ACTION = '$unset';\n/** @const */ var ADD_ACTION = '$add';\n/** @const */ var APPEND_ACTION = '$append';\n/** @const */ var UNION_ACTION = '$union';\n/** @const */ var REMOVE_ACTION = '$remove';\n/** @const */ var DELETE_ACTION = '$delete';\n\n// Common internal methods for mixpanel.people and mixpanel.group APIs.\n// These methods shouldn't involve network I/O.\nvar apiActions = {\n set_action: function(prop, to) {\n var data = {};\n var $set = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $set[k] = v;\n }\n }, this);\n } else {\n $set[prop] = to;\n }\n\n data[SET_ACTION] = $set;\n return data;\n },\n\n unset_action: function(prop) {\n var data = {};\n var $unset = [];\n if (!_.isArray(prop)) {\n prop = [prop];\n }\n\n _.each(prop, function(k) {\n if (!this._is_reserved_property(k)) {\n $unset.push(k);\n }\n }, this);\n\n data[UNSET_ACTION] = $unset;\n return data;\n },\n\n set_once_action: function(prop, to) {\n var data = {};\n var $set_once = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $set_once[k] = v;\n }\n }, this);\n } else {\n $set_once[prop] = to;\n }\n data[SET_ONCE_ACTION] = $set_once;\n return data;\n },\n\n union_action: function(list_name, values) {\n var data = {};\n var $union = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $union[k] = _.isArray(v) ? v : [v];\n }\n }, this);\n } else {\n $union[list_name] = _.isArray(values) ? values : [values];\n }\n data[UNION_ACTION] = $union;\n return data;\n },\n\n append_action: function(list_name, value) {\n var data = {};\n var $append = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $append[k] = v;\n }\n }, this);\n } else {\n $append[list_name] = value;\n }\n data[APPEND_ACTION] = $append;\n return data;\n },\n\n remove_action: function(list_name, value) {\n var data = {};\n var $remove = {};\n if (_.isObject(list_name)) {\n _.each(list_name, function(v, k) {\n if (!this._is_reserved_property(k)) {\n $remove[k] = v;\n }\n }, this);\n } else {\n $remove[list_name] = value;\n }\n data[REMOVE_ACTION] = $remove;\n return data;\n },\n\n delete_action: function() {\n var data = {};\n data[DELETE_ACTION] = '';\n return data;\n }\n};\n\n/**\n * Mixpanel Group Object\n * @constructor\n */\nvar MixpanelGroup = function() {};\n\n_.extend(MixpanelGroup.prototype, apiActions);\n\nMixpanelGroup.prototype._init = function(mixpanel_instance, group_key, group_id) {\n this._mixpanel = mixpanel_instance;\n this._group_key = group_key;\n this._group_id = group_id;\n};\n\n/**\n * Set properties on a group.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').set('Location', '405 Howard');\n *\n * // or set multiple properties at once\n * mixpanel.get_group('company', 'mixpanel').set({\n * 'Location': '405 Howard',\n * 'Founded' : 2009,\n * });\n * // properties can be strings, integers, dates, or lists\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.set = addOptOutCheckMixpanelGroup(function(prop, to, callback) {\n var data = this.set_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/**\n * Set properties on a group, only if they do not yet exist.\n * This will not overwrite previous group property values, unlike\n * group.set().\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').set_once('Location', '405 Howard');\n *\n * // or set multiple properties at once\n * mixpanel.get_group('company', 'mixpanel').set_once({\n * 'Location': '405 Howard',\n * 'Founded' : 2009,\n * });\n * // properties can be strings, integers, lists or dates\n *\n * @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n * @param {*} [to] A value to set on the given property name\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.set_once = addOptOutCheckMixpanelGroup(function(prop, to, callback) {\n var data = this.set_once_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/**\n * Unset properties on a group permanently.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').unset('Founded');\n *\n * @param {String} prop The name of the property.\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.unset = addOptOutCheckMixpanelGroup(function(prop, callback) {\n var data = this.unset_action(prop);\n return this._send_request(data, callback);\n});\n\n/**\n * Merge a given list with a list-valued group property, excluding duplicate values.\n *\n * ### Usage:\n *\n * // merge a value to a list, creating it if needed\n * mixpanel.get_group('company', 'mixpanel').union('Location', ['San Francisco', 'London']);\n *\n * @param {String} list_name Name of the property.\n * @param {Array} values Values to merge with the given property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.union = addOptOutCheckMixpanelGroup(function(list_name, values, callback) {\n if (_.isObject(list_name)) {\n callback = values;\n }\n var data = this.union_action(list_name, values);\n return this._send_request(data, callback);\n});\n\n/**\n * Permanently delete a group.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').delete();\n *\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype['delete'] = addOptOutCheckMixpanelGroup(function(callback) {\n // bracket notation above prevents a minification error related to reserved words\n var data = this.delete_action();\n return this._send_request(data, callback);\n});\n\n/**\n * Remove a property from a group. The value will be ignored if doesn't exist.\n *\n * ### Usage:\n *\n * mixpanel.get_group('company', 'mixpanel').remove('Location', 'London');\n *\n * @param {String} list_name Name of the property.\n * @param {Object} value Value to remove from the given group property\n * @param {Function} [callback] If provided, the callback will be called after the tracking event\n */\nMixpanelGroup.prototype.remove = addOptOutCheckMixpanelGroup(function(list_name, value, callback) {\n var data = this.remove_action(list_name, value);\n return this._send_request(data, callback);\n});\n\nMixpanelGroup.prototype._send_request = function(data, callback) {\n data['$group_key'] = this._group_key;\n data['$group_id'] = this._group_id;\n data['$token'] = this._get_config('token');\n\n var date_encoded_data = _.encodeDates(data);\n return this._mixpanel._track_or_batch({\n type: 'groups',\n data: date_encoded_data,\n endpoint: this._get_config('api_host') + '/groups/',\n batcher: this._mixpanel.request_batchers.groups\n }, callback);\n};\n\nMixpanelGroup.prototype._is_reserved_property = function(prop) {\n return prop === '$group_key' || prop === '$group_id';\n};\n\nMixpanelGroup.prototype._get_config = function(conf) {\n return this._mixpanel.get_config(conf);\n};\n\nMixpanelGroup.prototype.toString = function() {\n return this._mixpanel.toString() + '.group.' + this._group_key + '.' + this._group_id;\n};\n\n// MixpanelGroup Exports\nMixpanelGroup.prototype['remove'] = MixpanelGroup.prototype.remove;\nMixpanelGroup.prototype['set'] = MixpanelGroup.prototype.set;\nMixpanelGroup.prototype['set_once'] = MixpanelGroup.prototype.set_once;\nMixpanelGroup.prototype['union'] = MixpanelGroup.prototype.union;\nMixpanelGroup.prototype['unset'] = MixpanelGroup.prototype.unset;\nMixpanelGroup.prototype['toString'] = MixpanelGroup.prototype.toString;\n\n/**\n * Mixpanel People Object\n * @constructor\n */\nvar MixpanelPeople = function() {};\n\n_.extend(MixpanelPeople.prototype, apiActions);\n\nMixpanelPeople.prototype._init = function(mixpanel_instance) {\n this._mixpanel = mixpanel_instance;\n};\n\n/*\n* Set properties on a user record.\n*\n* ### Usage:\n*\n* mixpanel.people.set('gender', 'm');\n*\n* // or set multiple properties at once\n* mixpanel.people.set({\n* 'Company': 'Acme',\n* 'Plan': 'Premium',\n* 'Upgrade date': new Date()\n* });\n* // properties can be strings, integers, dates, or lists\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [to] A value to set on the given property name\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.set = addOptOutCheckMixpanelPeople(function(prop, to, callback) {\n var data = this.set_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n // make sure that the referrer info has been updated and saved\n if (this._get_config('save_referrer')) {\n this._mixpanel['persistence'].update_referrer_info(document.referrer);\n }\n\n // update $set object with default people properties\n data[SET_ACTION] = _.extend(\n {},\n _.info.people_properties(),\n this._mixpanel['persistence'].get_referrer_info(),\n data[SET_ACTION]\n );\n return this._send_request(data, callback);\n});\n\n/*\n* Set properties on a user record, only if they do not yet exist.\n* This will not overwrite previous people property values, unlike\n* people.set().\n*\n* ### Usage:\n*\n* mixpanel.people.set_once('First Login Date', new Date());\n*\n* // or set multiple properties at once\n* mixpanel.people.set_once({\n* 'First Login Date': new Date(),\n* 'Starting Plan': 'Premium'\n* });\n*\n* // properties can be strings, integers or dates\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [to] A value to set on the given property name\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.set_once = addOptOutCheckMixpanelPeople(function(prop, to, callback) {\n var data = this.set_once_action(prop, to);\n if (_.isObject(prop)) {\n callback = to;\n }\n return this._send_request(data, callback);\n});\n\n/*\n* Unset properties on a user record (permanently removes the properties and their values from a profile).\n*\n* ### Usage:\n*\n* mixpanel.people.unset('gender');\n*\n* // or unset multiple properties at once\n* mixpanel.people.unset(['gender', 'Company']);\n*\n* @param {Array|String} prop If a string, this is the name of the property. If an array, this is a list of property names.\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.unset = addOptOutCheckMixpanelPeople(function(prop, callback) {\n var data = this.unset_action(prop);\n return this._send_request(data, callback);\n});\n\n/*\n* Increment/decrement numeric people analytics properties.\n*\n* ### Usage:\n*\n* mixpanel.people.increment('page_views', 1);\n*\n* // or, for convenience, if you're just incrementing a counter by\n* // 1, you can simply do\n* mixpanel.people.increment('page_views');\n*\n* // to decrement a counter, pass a negative number\n* mixpanel.people.increment('credits_left', -1);\n*\n* // like mixpanel.people.set(), you can increment multiple\n* // properties at once:\n* mixpanel.people.increment({\n* counter1: 1,\n* counter2: 6\n* });\n*\n* @param {Object|String} prop If a string, this is the name of the property. If an object, this is an associative array of names and numeric values.\n* @param {Number} [by] An amount to increment the given property\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.increment = addOptOutCheckMixpanelPeople(function(prop, by, callback) {\n var data = {};\n var $add = {};\n if (_.isObject(prop)) {\n _.each(prop, function(v, k) {\n if (!this._is_reserved_property(k)) {\n if (isNaN(parseFloat(v))) {\n console.error('Invalid increment value passed to mixpanel.people.increment - must be a number');\n return;\n } else {\n $add[k] = v;\n }\n }\n }, this);\n callback = by;\n } else {\n // convenience: mixpanel.people.increment('property'); will\n // increment 'property' by 1\n if (_.isUndefined(by)) {\n by = 1;\n }\n $add[prop] = by;\n }\n data[ADD_ACTION] = $add;\n\n return this._send_request(data, callback);\n});\n\n/*\n* Append a value to a list-valued people analytics property.\n*\n* ### Usage:\n*\n* // append a value to a list, creating it if needed\n* mixpanel.people.append('pages_visited', 'homepage');\n*\n* // like mixpanel.people.set(), you can append multiple\n* // properties at once:\n* mixpanel.people.append({\n* list1: 'bob',\n* list2: 123\n* });\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] value An item to append to the list\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.append = addOptOutCheckMixpanelPeople(function(list_name, value, callback) {\n if (_.isObject(list_name)) {\n callback = value;\n }\n var data = this.append_action(list_name, value);\n return this._send_request(data, callback);\n});\n\n/*\n* Remove a value from a list-valued people analytics property.\n*\n* ### Usage:\n*\n* mixpanel.people.remove('School', 'UCB');\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] value Item to remove from the list\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.remove = addOptOutCheckMixpanelPeople(function(list_name, value, callback) {\n if (_.isObject(list_name)) {\n callback = value;\n }\n var data = this.remove_action(list_name, value);\n return this._send_request(data, callback);\n});\n\n/*\n* Merge a given list with a list-valued people analytics property,\n* excluding duplicate values.\n*\n* ### Usage:\n*\n* // merge a value to a list, creating it if needed\n* mixpanel.people.union('pages_visited', 'homepage');\n*\n* // like mixpanel.people.set(), you can append multiple\n* // properties at once:\n* mixpanel.people.union({\n* list1: 'bob',\n* list2: 123\n* });\n*\n* // like mixpanel.people.append(), you can append multiple\n* // values to the same list:\n* mixpanel.people.union({\n* list1: ['bob', 'billy']\n* });\n*\n* @param {Object|String} list_name If a string, this is the name of the property. If an object, this is an associative array of names and values.\n* @param {*} [value] Value / values to merge with the given property\n* @param {Function} [callback] If provided, the callback will be called after tracking the event.\n*/\nMixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople(function(list_name, values, callback) {\n if (_.isObject(list_name)) {\n callback = values;\n }\n var data = this.union_action(list_name, values);\n return this._send_request(data, callback);\n});\n\n/*\n * Record that you have charged the current user a certain amount\n * of money. Charges recorded with track_charge() will appear in the\n * Mixpanel revenue report.\n *\n * ### Usage:\n *\n * // charge a user $50\n * mixpanel.people.track_charge(50);\n *\n * // charge a user $30.50 on the 2nd of january\n * mixpanel.people.track_charge(30.50, {\n * '$time': new Date('jan 1 2012')\n * });\n *\n * @param {Number} amount The amount of money charged to the current user\n * @param {Object} [properties] An associative array of properties associated with the charge\n * @param {Function} [callback] If provided, the callback will be called when the server responds\n * @deprecated\n */\nMixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) {\n if (!_.isNumber(amount)) {\n amount = parseFloat(amount);\n if (isNaN(amount)) {\n console.error('Invalid value passed to mixpanel.people.track_charge - must be a number');\n return;\n }\n }\n\n return this.append('$transactions', _.extend({\n '$amount': amount\n }, properties), callback);\n});\n\n/*\n * Permanently clear all revenue report transactions from the\n * current user's people analytics profile.\n *\n * ### Usage:\n *\n * mixpanel.people.clear_charges();\n *\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n * @deprecated\n */\nMixpanelPeople.prototype.clear_charges = function(callback) {\n return this.set('$transactions', [], callback);\n};\n\n/*\n* Permanently deletes the current people analytics profile from\n* Mixpanel (using the current distinct_id).\n*\n* ### Usage:\n*\n* // remove the all data you have stored about the current user\n* mixpanel.people.delete_user();\n*\n*/\nMixpanelPeople.prototype.delete_user = function() {\n if (!this._identify_called()) {\n console.error('mixpanel.people.delete_user() requires you to call identify() first');\n return;\n }\n var data = {'$delete': this._mixpanel.get_distinct_id()};\n return this._send_request(data);\n};\n\nMixpanelPeople.prototype.toString = function() {\n return this._mixpanel.toString() + '.people';\n};\n\nMixpanelPeople.prototype._send_request = function(data, callback) {\n data['$token'] = this._get_config('token');\n data['$distinct_id'] = this._mixpanel.get_distinct_id();\n var device_id = this._mixpanel.get_property('$device_id');\n var user_id = this._mixpanel.get_property('$user_id');\n var had_persisted_distinct_id = this._mixpanel.get_property('$had_persisted_distinct_id');\n if (device_id) {\n data['$device_id'] = device_id;\n }\n if (user_id) {\n data['$user_id'] = user_id;\n }\n if (had_persisted_distinct_id) {\n data['$had_persisted_distinct_id'] = had_persisted_distinct_id;\n }\n\n var date_encoded_data = _.encodeDates(data);\n\n if (!this._identify_called()) {\n this._enqueue(data);\n if (!_.isUndefined(callback)) {\n if (this._get_config('verbose')) {\n callback({status: -1, error: null});\n } else {\n callback(-1);\n }\n }\n return _.truncate(date_encoded_data, 255);\n }\n\n return this._mixpanel._track_or_batch({\n type: 'people',\n data: date_encoded_data,\n endpoint: this._get_config('api_host') + '/engage/',\n batcher: this._mixpanel.request_batchers.people\n }, callback);\n};\n\nMixpanelPeople.prototype._get_config = function(conf_var) {\n return this._mixpanel.get_config(conf_var);\n};\n\nMixpanelPeople.prototype._identify_called = function() {\n return this._mixpanel._flags.identify_called === true;\n};\n\n// Queue up engage operations if identify hasn't been called yet.\nMixpanelPeople.prototype._enqueue = function(data) {\n if (SET_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ACTION, data);\n } else if (SET_ONCE_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(SET_ONCE_ACTION, data);\n } else if (UNSET_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(UNSET_ACTION, data);\n } else if (ADD_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(ADD_ACTION, data);\n } else if (APPEND_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, data);\n } else if (REMOVE_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, data);\n } else if (UNION_ACTION in data) {\n this._mixpanel['persistence']._add_to_people_queue(UNION_ACTION, data);\n } else {\n console.error('Invalid call to _enqueue():', data);\n }\n};\n\nMixpanelPeople.prototype._flush_one_queue = function(action, action_method, callback, queue_to_params_fn) {\n var _this = this;\n var queued_data = _.extend({}, this._mixpanel['persistence']._get_queue(action));\n var action_params = queued_data;\n\n if (!_.isUndefined(queued_data) && _.isObject(queued_data) && !_.isEmptyObject(queued_data)) {\n _this._mixpanel['persistence']._pop_from_people_queue(action, queued_data);\n if (queue_to_params_fn) {\n action_params = queue_to_params_fn(queued_data);\n }\n action_method.call(_this, action_params, function(response, data) {\n // on bad response, we want to add it back to the queue\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(action, queued_data);\n }\n if (!_.isUndefined(callback)) {\n callback(response, data);\n }\n });\n }\n};\n\n// Flush queued engage operations - order does not matter,\n// and there are network level race conditions anyway\nMixpanelPeople.prototype._flush = function(\n _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback\n) {\n var _this = this;\n var $append_queue = this._mixpanel['persistence']._get_queue(APPEND_ACTION);\n var $remove_queue = this._mixpanel['persistence']._get_queue(REMOVE_ACTION);\n\n this._flush_one_queue(SET_ACTION, this.set, _set_callback);\n this._flush_one_queue(SET_ONCE_ACTION, this.set_once, _set_once_callback);\n this._flush_one_queue(UNSET_ACTION, this.unset, _unset_callback, function(queue) { return _.keys(queue); });\n this._flush_one_queue(ADD_ACTION, this.increment, _add_callback);\n this._flush_one_queue(UNION_ACTION, this.union, _union_callback);\n\n // we have to fire off each $append individually since there is\n // no concat method server side\n if (!_.isUndefined($append_queue) && _.isArray($append_queue) && $append_queue.length) {\n var $append_item;\n var append_callback = function(response, data) {\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(APPEND_ACTION, $append_item);\n }\n if (!_.isUndefined(_append_callback)) {\n _append_callback(response, data);\n }\n };\n for (var i = $append_queue.length - 1; i >= 0; i--) {\n $append_item = $append_queue.pop();\n if (!_.isEmptyObject($append_item)) {\n _this.append($append_item, append_callback);\n }\n }\n // Save the shortened append queue\n _this._mixpanel['persistence'].save();\n }\n\n // same for $remove\n if (!_.isUndefined($remove_queue) && _.isArray($remove_queue) && $remove_queue.length) {\n var $remove_item;\n var remove_callback = function(response, data) {\n if (response === 0) {\n _this._mixpanel['persistence']._add_to_people_queue(REMOVE_ACTION, $remove_item);\n }\n if (!_.isUndefined(_remove_callback)) {\n _remove_callback(response, data);\n }\n };\n for (var j = $remove_queue.length - 1; j >= 0; j--) {\n $remove_item = $remove_queue.pop();\n if (!_.isEmptyObject($remove_item)) {\n _this.remove($remove_item, remove_callback);\n }\n }\n _this._mixpanel['persistence'].save();\n }\n};\n\nMixpanelPeople.prototype._is_reserved_property = function(prop) {\n return prop === '$distinct_id' || prop === '$token' || prop === '$device_id' || prop === '$user_id' || prop === '$had_persisted_distinct_id';\n};\n\n// MixpanelPeople Exports\nMixpanelPeople.prototype['set'] = MixpanelPeople.prototype.set;\nMixpanelPeople.prototype['set_once'] = MixpanelPeople.prototype.set_once;\nMixpanelPeople.prototype['unset'] = MixpanelPeople.prototype.unset;\nMixpanelPeople.prototype['increment'] = MixpanelPeople.prototype.increment;\nMixpanelPeople.prototype['append'] = MixpanelPeople.prototype.append;\nMixpanelPeople.prototype['remove'] = MixpanelPeople.prototype.remove;\nMixpanelPeople.prototype['union'] = MixpanelPeople.prototype.union;\nMixpanelPeople.prototype['track_charge'] = MixpanelPeople.prototype.track_charge;\nMixpanelPeople.prototype['clear_charges'] = MixpanelPeople.prototype.clear_charges;\nMixpanelPeople.prototype['delete_user'] = MixpanelPeople.prototype.delete_user;\nMixpanelPeople.prototype['toString'] = MixpanelPeople.prototype.toString;\n\n/*\n * Constants\n */\n/** @const */ var SET_QUEUE_KEY = '__mps';\n/** @const */ var SET_ONCE_QUEUE_KEY = '__mpso';\n/** @const */ var UNSET_QUEUE_KEY = '__mpus';\n/** @const */ var ADD_QUEUE_KEY = '__mpa';\n/** @const */ var APPEND_QUEUE_KEY = '__mpap';\n/** @const */ var REMOVE_QUEUE_KEY = '__mpr';\n/** @const */ var UNION_QUEUE_KEY = '__mpu';\n// This key is deprecated, but we want to check for it to see whether aliasing is allowed.\n/** @const */ var PEOPLE_DISTINCT_ID_KEY = '$people_distinct_id';\n/** @const */ var ALIAS_ID_KEY = '__alias';\n/** @const */ var EVENT_TIMERS_KEY = '__timers';\n/** @const */ var RESERVED_PROPERTIES = [\n SET_QUEUE_KEY,\n SET_ONCE_QUEUE_KEY,\n UNSET_QUEUE_KEY,\n ADD_QUEUE_KEY,\n APPEND_QUEUE_KEY,\n REMOVE_QUEUE_KEY,\n UNION_QUEUE_KEY,\n PEOPLE_DISTINCT_ID_KEY,\n ALIAS_ID_KEY,\n EVENT_TIMERS_KEY\n];\n\n/**\n * Mixpanel Persistence Object\n * @constructor\n */\nvar MixpanelPersistence = function(config) {\n this['props'] = {};\n this.campaign_params_saved = false;\n\n if (config['persistence_name']) {\n this.name = 'mp_' + config['persistence_name'];\n } else {\n this.name = 'mp_' + config['token'] + '_mixpanel';\n }\n\n var storage_type = config['persistence'];\n if (storage_type !== 'cookie' && storage_type !== 'localStorage') {\n console.critical('Unknown persistence type ' + storage_type + '; falling back to cookie');\n storage_type = config['persistence'] = 'cookie';\n }\n\n if (storage_type === 'localStorage' && _.localStorage.is_supported()) {\n this.storage = _.localStorage;\n } else {\n this.storage = _.cookie;\n }\n\n this.load();\n this.update_config(config);\n this.upgrade(config);\n this.save();\n};\n\nMixpanelPersistence.prototype.properties = function() {\n var p = {};\n // Filter out reserved properties\n _.each(this['props'], function(v, k) {\n if (!_.include(RESERVED_PROPERTIES, k)) {\n p[k] = v;\n }\n });\n return p;\n};\n\nMixpanelPersistence.prototype.load = function() {\n if (this.disabled) { return; }\n\n var entry = this.storage.parse(this.name);\n\n if (entry) {\n this['props'] = _.extend({}, entry);\n }\n};\n\nMixpanelPersistence.prototype.upgrade = function(config) {\n var upgrade_from_old_lib = config['upgrade'],\n old_cookie_name,\n old_cookie;\n\n if (upgrade_from_old_lib) {\n old_cookie_name = 'mp_super_properties';\n // Case where they had a custom cookie name before.\n if (typeof(upgrade_from_old_lib) === 'string') {\n old_cookie_name = upgrade_from_old_lib;\n }\n\n old_cookie = this.storage.parse(old_cookie_name);\n\n // remove the cookie\n this.storage.remove(old_cookie_name);\n this.storage.remove(old_cookie_name, true);\n\n if (old_cookie) {\n this['props'] = _.extend(\n this['props'],\n old_cookie['all'],\n old_cookie['events']\n );\n }\n }\n\n if (!config['cookie_name'] && config['name'] !== 'mixpanel') {\n // special case to handle people with cookies of the form\n // mp_TOKEN_INSTANCENAME from the first release of this library\n old_cookie_name = 'mp_' + config['token'] + '_' + config['name'];\n old_cookie = this.storage.parse(old_cookie_name);\n\n if (old_cookie) {\n this.storage.remove(old_cookie_name);\n this.storage.remove(old_cookie_name, true);\n\n // Save the prop values that were in the cookie from before -\n // this should only happen once as we delete the old one.\n this.register_once(old_cookie);\n }\n }\n\n if (this.storage === _.localStorage) {\n old_cookie = _.cookie.parse(this.name);\n\n _.cookie.remove(this.name);\n _.cookie.remove(this.name, true);\n\n if (old_cookie) {\n this.register_once(old_cookie);\n }\n }\n};\n\nMixpanelPersistence.prototype.save = function() {\n if (this.disabled) { return; }\n this.storage.set(\n this.name,\n _.JSONEncode(this['props']),\n this.expire_days,\n this.cross_subdomain,\n this.secure,\n this.cross_site,\n this.cookie_domain\n );\n};\n\nMixpanelPersistence.prototype.remove = function() {\n // remove both domain and subdomain cookies\n this.storage.remove(this.name, false, this.cookie_domain);\n this.storage.remove(this.name, true, this.cookie_domain);\n};\n\n// removes the storage entry and deletes all loaded data\n// forced name for tests\nMixpanelPersistence.prototype.clear = function() {\n this.remove();\n this['props'] = {};\n};\n\n/**\n* @param {Object} props\n* @param {*=} default_value\n* @param {number=} days\n*/\nMixpanelPersistence.prototype.register_once = function(props, default_value, days) {\n if (_.isObject(props)) {\n if (typeof(default_value) === 'undefined') { default_value = 'None'; }\n this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;\n\n _.each(props, function(val, prop) {\n if (!this['props'].hasOwnProperty(prop) || this['props'][prop] === default_value) {\n this['props'][prop] = val;\n }\n }, this);\n\n this.save();\n\n return true;\n }\n return false;\n};\n\n/**\n* @param {Object} props\n* @param {number=} days\n*/\nMixpanelPersistence.prototype.register = function(props, days) {\n if (_.isObject(props)) {\n this.expire_days = (typeof(days) === 'undefined') ? this.default_expiry : days;\n\n _.extend(this['props'], props);\n\n this.save();\n\n return true;\n }\n return false;\n};\n\nMixpanelPersistence.prototype.unregister = function(prop) {\n if (prop in this['props']) {\n delete this['props'][prop];\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.update_search_keyword = function(referrer) {\n this.register(_.info.searchInfo(referrer));\n};\n\n// EXPORTED METHOD, we test this directly.\nMixpanelPersistence.prototype.update_referrer_info = function(referrer) {\n // If referrer doesn't exist, we want to note the fact that it was type-in traffic.\n this.register_once({\n '$initial_referrer': referrer || '$direct',\n '$initial_referring_domain': _.info.referringDomain(referrer) || '$direct'\n }, '');\n};\n\nMixpanelPersistence.prototype.get_referrer_info = function() {\n return _.strip_empty_properties({\n '$initial_referrer': this['props']['$initial_referrer'],\n '$initial_referring_domain': this['props']['$initial_referring_domain']\n });\n};\n\n// safely fills the passed in object with stored properties,\n// does not override any properties defined in both\n// returns the passed in object\nMixpanelPersistence.prototype.safe_merge = function(props) {\n _.each(this['props'], function(val, prop) {\n if (!(prop in props)) {\n props[prop] = val;\n }\n });\n\n return props;\n};\n\nMixpanelPersistence.prototype.update_config = function(config) {\n this.default_expiry = this.expire_days = config['cookie_expiration'];\n this.set_disabled(config['disable_persistence']);\n this.set_cookie_domain(config['cookie_domain']);\n this.set_cross_site(config['cross_site_cookie']);\n this.set_cross_subdomain(config['cross_subdomain_cookie']);\n this.set_secure(config['secure_cookie']);\n};\n\nMixpanelPersistence.prototype.set_disabled = function(disabled) {\n this.disabled = disabled;\n if (this.disabled) {\n this.remove();\n } else {\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.set_cookie_domain = function(cookie_domain) {\n if (cookie_domain !== this.cookie_domain) {\n this.remove();\n this.cookie_domain = cookie_domain;\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.set_cross_site = function(cross_site) {\n if (cross_site !== this.cross_site) {\n this.cross_site = cross_site;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.set_cross_subdomain = function(cross_subdomain) {\n if (cross_subdomain !== this.cross_subdomain) {\n this.cross_subdomain = cross_subdomain;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype.get_cross_subdomain = function() {\n return this.cross_subdomain;\n};\n\nMixpanelPersistence.prototype.set_secure = function(secure) {\n if (secure !== this.secure) {\n this.secure = secure ? true : false;\n this.remove();\n this.save();\n }\n};\n\nMixpanelPersistence.prototype._add_to_people_queue = function(queue, data) {\n var q_key = this._get_queue_key(queue),\n q_data = data[queue],\n set_q = this._get_or_create_queue(SET_ACTION),\n set_once_q = this._get_or_create_queue(SET_ONCE_ACTION),\n unset_q = this._get_or_create_queue(UNSET_ACTION),\n add_q = this._get_or_create_queue(ADD_ACTION),\n union_q = this._get_or_create_queue(UNION_ACTION),\n remove_q = this._get_or_create_queue(REMOVE_ACTION, []),\n append_q = this._get_or_create_queue(APPEND_ACTION, []);\n\n if (q_key === SET_QUEUE_KEY) {\n // Update the set queue - we can override any existing values\n _.extend(set_q, q_data);\n // if there was a pending increment, override it\n // with the set.\n this._pop_from_people_queue(ADD_ACTION, q_data);\n // if there was a pending union, override it\n // with the set.\n this._pop_from_people_queue(UNION_ACTION, q_data);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === SET_ONCE_QUEUE_KEY) {\n // only queue the data if there is not already a set_once call for it.\n _.each(q_data, function(v, k) {\n if (!(k in set_once_q)) {\n set_once_q[k] = v;\n }\n });\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === UNSET_QUEUE_KEY) {\n _.each(q_data, function(prop) {\n\n // undo previously-queued actions on this key\n _.each([set_q, set_once_q, add_q, union_q], function(enqueued_obj) {\n if (prop in enqueued_obj) {\n delete enqueued_obj[prop];\n }\n });\n _.each(append_q, function(append_obj) {\n if (prop in append_obj) {\n delete append_obj[prop];\n }\n });\n\n unset_q[prop] = true;\n\n });\n } else if (q_key === ADD_QUEUE_KEY) {\n _.each(q_data, function(v, k) {\n // If it exists in the set queue, increment\n // the value\n if (k in set_q) {\n set_q[k] += v;\n } else {\n // If it doesn't exist, update the add\n // queue\n if (!(k in add_q)) {\n add_q[k] = 0;\n }\n add_q[k] += v;\n }\n }, this);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === UNION_QUEUE_KEY) {\n _.each(q_data, function(v, k) {\n if (_.isArray(v)) {\n if (!(k in union_q)) {\n union_q[k] = [];\n }\n // We may send duplicates, the server will dedup them.\n union_q[k] = union_q[k].concat(v);\n }\n });\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n } else if (q_key === REMOVE_QUEUE_KEY) {\n remove_q.push(q_data);\n this._pop_from_people_queue(APPEND_ACTION, q_data);\n } else if (q_key === APPEND_QUEUE_KEY) {\n append_q.push(q_data);\n this._pop_from_people_queue(UNSET_ACTION, q_data);\n }\n\n console.log('MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):');\n console.log(data);\n\n this.save();\n};\n\nMixpanelPersistence.prototype._pop_from_people_queue = function(queue, data) {\n var q = this._get_queue(queue);\n if (!_.isUndefined(q)) {\n _.each(data, function(v, k) {\n if (queue === APPEND_ACTION || queue === REMOVE_ACTION) {\n // list actions: only remove if both k+v match\n // e.g. remove should not override append in a case like\n // append({foo: 'bar'}); remove({foo: 'qux'})\n _.each(q, function(queued_action) {\n if (queued_action[k] === v) {\n delete queued_action[k];\n }\n });\n } else {\n delete q[k];\n }\n }, this);\n\n this.save();\n }\n};\n\nMixpanelPersistence.prototype._get_queue_key = function(queue) {\n if (queue === SET_ACTION) {\n return SET_QUEUE_KEY;\n } else if (queue === SET_ONCE_ACTION) {\n return SET_ONCE_QUEUE_KEY;\n } else if (queue === UNSET_ACTION) {\n return UNSET_QUEUE_KEY;\n } else if (queue === ADD_ACTION) {\n return ADD_QUEUE_KEY;\n } else if (queue === APPEND_ACTION) {\n return APPEND_QUEUE_KEY;\n } else if (queue === REMOVE_ACTION) {\n return REMOVE_QUEUE_KEY;\n } else if (queue === UNION_ACTION) {\n return UNION_QUEUE_KEY;\n } else {\n console.error('Invalid queue:', queue);\n }\n};\n\nMixpanelPersistence.prototype._get_queue = function(queue) {\n return this['props'][this._get_queue_key(queue)];\n};\nMixpanelPersistence.prototype._get_or_create_queue = function(queue, default_val) {\n var key = this._get_queue_key(queue);\n default_val = _.isUndefined(default_val) ? {} : default_val;\n\n return this['props'][key] || (this['props'][key] = default_val);\n};\n\nMixpanelPersistence.prototype.set_event_timer = function(event_name, timestamp) {\n var timers = this['props'][EVENT_TIMERS_KEY] || {};\n timers[event_name] = timestamp;\n this['props'][EVENT_TIMERS_KEY] = timers;\n this.save();\n};\n\nMixpanelPersistence.prototype.remove_event_timer = function(event_name) {\n var timers = this['props'][EVENT_TIMERS_KEY] || {};\n var timestamp = timers[event_name];\n if (!_.isUndefined(timestamp)) {\n delete this['props'][EVENT_TIMERS_KEY][event_name];\n this.save();\n }\n return timestamp;\n};\n\n/*\n * Mixpanel JS Library\n *\n * Copyright 2012, Mixpanel, Inc. All Rights Reserved\n * http://mixpanel.com/\n *\n * Includes portions of Underscore.js\n * http://documentcloud.github.com/underscore/\n * (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.\n * Released under the MIT License.\n */\n\n// ==ClosureCompiler==\n// @compilation_level ADVANCED_OPTIMIZATIONS\n// @output_file_name mixpanel-2.8.min.js\n// ==/ClosureCompiler==\n\n/*\nSIMPLE STYLE GUIDE:\n\nthis.x === public function\nthis._x === internal - only use within this file\nthis.__x === private - only use within the class\n\nGlobals should be all caps\n*/\n\nvar init_type; // MODULE or SNIPPET loader\nvar mixpanel_master; // main mixpanel instance / object\nvar INIT_MODULE = 0;\nvar INIT_SNIPPET = 1;\n\nvar IDENTITY_FUNC = function(x) {return x;};\nvar NOOP_FUNC = function() {};\n\n/** @const */ var PRIMARY_INSTANCE_NAME = 'mixpanel';\n/** @const */ var PAYLOAD_TYPE_BASE64 = 'base64';\n/** @const */ var PAYLOAD_TYPE_JSON = 'json';\n/** @const */ var DEVICE_ID_PREFIX = '$device:';\n\n\n/*\n * Dynamic... constants? Is that an oxymoron?\n */\n// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/\n// https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#withCredentials\nvar USE_XHR = (window$1.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest());\n\n// IE<10 does not support cross-origin XHR's but script tags\n// with defer won't block window.onload; ENQUEUE_REQUESTS\n// should only be true for Opera<12\nvar ENQUEUE_REQUESTS = !USE_XHR && (userAgent.indexOf('MSIE') === -1) && (userAgent.indexOf('Mozilla') === -1);\n\n// save reference to navigator.sendBeacon so it can be minified\nvar sendBeacon = null;\nif (navigator['sendBeacon']) {\n sendBeacon = function() {\n // late reference to navigator.sendBeacon to allow patching/spying\n return navigator['sendBeacon'].apply(navigator, arguments);\n };\n}\n\n/*\n * Module-level globals\n */\nvar DEFAULT_CONFIG = {\n 'api_host': 'https://api-js.mixpanel.com',\n 'api_method': 'POST',\n 'api_transport': 'XHR',\n 'api_payload_format': PAYLOAD_TYPE_BASE64,\n 'app_host': 'https://mixpanel.com',\n 'cdn': 'https://cdn.mxpnl.com',\n 'cross_site_cookie': false,\n 'cross_subdomain_cookie': true,\n 'error_reporter': NOOP_FUNC,\n 'persistence': 'cookie',\n 'persistence_name': '',\n 'cookie_domain': '',\n 'cookie_name': '',\n 'loaded': NOOP_FUNC,\n 'track_marketing': true,\n 'track_pageview': false,\n 'skip_first_touch_marketing': false,\n 'store_google': true,\n 'save_referrer': true,\n 'test': false,\n 'verbose': false,\n 'img': false,\n 'debug': false,\n 'track_links_timeout': 300,\n 'cookie_expiration': 365,\n 'upgrade': false,\n 'disable_persistence': false,\n 'disable_cookie': false,\n 'secure_cookie': false,\n 'ip': true,\n 'opt_out_tracking_by_default': false,\n 'opt_out_persistence_by_default': false,\n 'opt_out_tracking_persistence_type': 'localStorage',\n 'opt_out_tracking_cookie_prefix': null,\n 'property_blacklist': [],\n 'xhr_headers': {}, // { header: value, header2: value }\n 'ignore_dnt': false,\n 'batch_requests': true,\n 'batch_size': 50,\n 'batch_flush_interval_ms': 5000,\n 'batch_request_timeout_ms': 90000,\n 'batch_autostart': true,\n 'hooks': {}\n};\n\nvar DOM_LOADED = false;\n\n/**\n * Mixpanel Library Object\n * @constructor\n */\nvar MixpanelLib = function() {};\n\n\n/**\n * create_mplib(token:string, config:object, name:string)\n *\n * This function is used by the init method of MixpanelLib objects\n * as well as the main initializer at the end of the JSLib (that\n * initializes document.mixpanel as well as any additional instances\n * declared before this file has loaded).\n */\nvar create_mplib = function(token, config, name) {\n var instance,\n target = (name === PRIMARY_INSTANCE_NAME) ? mixpanel_master : mixpanel_master[name];\n\n if (target && init_type === INIT_MODULE) {\n instance = target;\n } else {\n if (target && !_.isArray(target)) {\n console.error('You have already initialized ' + name);\n return;\n }\n instance = new MixpanelLib();\n }\n\n instance._cached_groups = {}; // cache groups in a pool\n\n instance._init(token, config, name);\n\n instance['people'] = new MixpanelPeople();\n instance['people']._init(instance);\n\n if (!instance.get_config('skip_first_touch_marketing')) {\n // We need null UTM params in the object because\n // UTM parameters act as a tuple. If any UTM param\n // is present, then we set all UTM params including\n // empty ones together\n var utm_params = _.info.campaignParams(null);\n var initial_utm_params = {};\n var has_utm = false;\n _.each(utm_params, function(utm_value, utm_key) {\n initial_utm_params['initial_' + utm_key] = utm_value;\n if (utm_value) {\n has_utm = true;\n }\n });\n if (has_utm) {\n instance['people'].set_once(initial_utm_params);\n }\n }\n\n // if any instance on the page has debug = true, we set the\n // global debug to be true\n Config.DEBUG = Config.DEBUG || instance.get_config('debug');\n\n // if target is not defined, we called init after the lib already\n // loaded, so there won't be an array of things to execute\n if (!_.isUndefined(target) && _.isArray(target)) {\n // Crunch through the people queue first - we queue this data up &\n // flush on identify, so it's better to do all these operations first\n instance._execute_array.call(instance['people'], target['people']);\n instance._execute_array(target);\n }\n\n return instance;\n};\n\n// Initialization methods\n\n/**\n * This function initializes a new instance of the Mixpanel tracking object.\n * All new instances are added to the main mixpanel object as sub properties (such as\n * mixpanel.library_name) and also returned by this function. To define a\n * second instance on the page, you would call:\n *\n * mixpanel.init('new token', { your: 'config' }, 'library_name');\n *\n * and use it like so:\n *\n * mixpanel.library_name.track(...);\n *\n * @param {String} token Your Mixpanel API token\n * @param {Object} [config] A dictionary of config options to override. <a href=\"https://github.com/mixpanel/mixpanel-js/blob/v2.46.0/src/mixpanel-core.js#L88-L127\">See a list of default config options</a>.\n * @param {String} [name] The name for the new mixpanel instance that you want created\n */\nMixpanelLib.prototype.init = function (token, config, name) {\n if (_.isUndefined(name)) {\n this.report_error('You must name your new library: init(token, config, name)');\n return;\n }\n if (name === PRIMARY_INSTANCE_NAME) {\n this.report_error('You must initialize the main mixpanel object right after you include the Mixpanel js snippet');\n return;\n }\n\n var instance = create_mplib(token, config, name);\n mixpanel_master[name] = instance;\n instance._loaded();\n\n return instance;\n};\n\n// mixpanel._init(token:string, config:object, name:string)\n//\n// This function sets up the current instance of the mixpanel\n// library. The difference between this method and the init(...)\n// method is this one initializes the actual instance, whereas the\n// init(...) method sets up a new library and calls _init on it.\n//\nMixpanelLib.prototype._init = function(token, config, name) {\n config = config || {};\n\n this['__loaded'] = true;\n this['config'] = {};\n\n var variable_features = {};\n\n // default to JSON payload for standard mixpanel.com API hosts\n if (!('api_payload_format' in config)) {\n var api_host = config['api_host'] || DEFAULT_CONFIG['api_host'];\n if (api_host.match(/\\.mixpanel\\.com/)) {\n variable_features['api_payload_format'] = PAYLOAD_TYPE_JSON;\n }\n }\n\n this.set_config(_.extend({}, DEFAULT_CONFIG, variable_features, config, {\n 'name': name,\n 'token': token,\n 'callback_fn': ((name === PRIMARY_INSTANCE_NAME) ? name : PRIMARY_INSTANCE_NAME + '.' + name) + '._jsc'\n }));\n\n this['_jsc'] = NOOP_FUNC;\n\n this.__dom_loaded_queue = [];\n this.__request_queue = [];\n this.__disabled_events = [];\n this._flags = {\n 'disable_all_events': false,\n 'identify_called': false\n };\n\n // set up request queueing/batching\n this.request_batchers = {};\n this._batch_requests = this.get_config('batch_requests');\n if (this._batch_requests) {\n if (!_.localStorage.is_supported(true) || !USE_XHR) {\n this._batch_requests = false;\n console.log('Turning off Mixpanel request-queueing; needs XHR and localStorage support');\n } else {\n this.init_batchers();\n if (sendBeacon && window$1.addEventListener) {\n // Before page closes or hides (user tabs away etc), attempt to flush any events\n // queued up via navigator.sendBeacon. Since sendBeacon doesn't report success/failure,\n // events will not be removed from the persistent store; if the site is loaded again,\n // the events will be flushed again on startup and deduplicated on the Mixpanel server\n // side.\n // There is no reliable way to capture only page close events, so we lean on the\n // visibilitychange and pagehide events as recommended at\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event#usage_notes.\n // These events fire when the user clicks away from the current page/tab, so will occur\n // more frequently than page unload, but are the only mechanism currently for capturing\n // this scenario somewhat reliably.\n var flush_on_unload = _.bind(function() {\n if (!this.request_batchers.events.stopped) {\n this.request_batchers.events.flush({unloading: true});\n }\n }, this);\n window$1.addEventListener('pagehide', function(ev) {\n if (ev['persisted']) {\n flush_on_unload();\n }\n });\n window$1.addEventListener('visibilitychange', function() {\n if (document$1['visibilityState'] === 'hidden') {\n flush_on_unload();\n }\n });\n }\n }\n }\n\n this['persistence'] = this['cookie'] = new MixpanelPersistence(this['config']);\n this.unpersisted_superprops = {};\n this._gdpr_init();\n\n var uuid = _.UUID();\n if (!this.get_distinct_id()) {\n // There is no need to set the distinct id\n // or the device id if something was already stored\n // in the persitence\n this.register_once({\n 'distinct_id': DEVICE_ID_PREFIX + uuid,\n '$device_id': uuid\n }, '');\n }\n\n if (this.get_config('track_pageview')) {\n this.track_pageview();\n }\n};\n\n// Private methods\n\nMixpanelLib.prototype._loaded = function() {\n this.get_config('loaded')(this);\n this._set_default_superprops();\n};\n\n// update persistence with info on referrer, UTM params, etc\nMixpanelLib.prototype._set_default_superprops = function() {\n this['persistence'].update_search_keyword(document$1.referrer);\n if (this.get_config('store_google')) {\n this.register(_.info.campaignParams(), {persistent: false});\n }\n if (this.get_config('save_referrer')) {\n this['persistence'].update_referrer_info(document$1.referrer);\n }\n};\n\nMixpanelLib.prototype._dom_loaded = function() {\n _.each(this.__dom_loaded_queue, function(item) {\n this._track_dom.apply(this, item);\n }, this);\n\n if (!this.has_opted_out_tracking()) {\n _.each(this.__request_queue, function(item) {\n this._send_request.apply(this, item);\n }, this);\n }\n\n delete this.__dom_loaded_queue;\n delete this.__request_queue;\n};\n\nMixpanelLib.prototype._track_dom = function(DomClass, args) {\n if (this.get_config('img')) {\n this.report_error('You can\\'t use DOM tracking functions with img = true.');\n return false;\n }\n\n if (!DOM_LOADED) {\n this.__dom_loaded_queue.push([DomClass, args]);\n return false;\n }\n\n var dt = new DomClass().init(this);\n return dt.track.apply(dt, args);\n};\n\n/**\n * _prepare_callback() should be called by callers of _send_request for use\n * as the callback argument.\n *\n * If there is no callback, this returns null.\n * If we are going to make XHR/XDR requests, this returns a function.\n * If we are going to use script tags, this returns a string to use as the\n * callback GET param.\n */\nMixpanelLib.prototype._prepare_callback = function(callback, data) {\n if (_.isUndefined(callback)) {\n return null;\n }\n\n if (USE_XHR) {\n var callback_function = function(response) {\n callback(response, data);\n };\n return callback_function;\n } else {\n // if the user gives us a callback, we store as a random\n // property on this instances jsc function and update our\n // callback string to reflect that.\n var jsc = this['_jsc'];\n var randomized_cb = '' + Math.floor(Math.random() * 100000000);\n var callback_string = this.get_config('callback_fn') + '[' + randomized_cb + ']';\n jsc[randomized_cb] = function(response) {\n delete jsc[randomized_cb];\n callback(response, data);\n };\n return callback_string;\n }\n};\n\nMixpanelLib.prototype._send_request = function(url, data, options, callback) {\n var succeeded = true;\n\n if (ENQUEUE_REQUESTS) {\n this.__request_queue.push(arguments);\n return succeeded;\n }\n\n var DEFAULT_OPTIONS = {\n method: this.get_config('api_method'),\n transport: this.get_config('api_transport'),\n verbose: this.get_config('verbose')\n };\n var body_data = null;\n\n if (!callback && (_.isFunction(options) || typeof options === 'string')) {\n callback = options;\n options = null;\n }\n options = _.extend(DEFAULT_OPTIONS, options || {});\n if (!USE_XHR) {\n options.method = 'GET';\n }\n var use_post = options.method === 'POST';\n var use_sendBeacon = sendBeacon && use_post && options.transport.toLowerCase() === 'sendbeacon';\n\n // needed to correctly format responses\n var verbose_mode = options.verbose;\n if (data['verbose']) { verbose_mode = true; }\n\n if (this.get_config('test')) { data['test'] = 1; }\n if (verbose_mode) { data['verbose'] = 1; }\n if (this.get_config('img')) { data['img'] = 1; }\n if (!USE_XHR) {\n if (callback) {\n data['callback'] = callback;\n } else if (verbose_mode || this.get_config('test')) {\n // Verbose output (from verbose mode, or an error in test mode) is a json blob,\n // which by itself is not valid javascript. Without a callback, this verbose output will\n // cause an error when returned via jsonp, so we force a no-op callback param.\n // See the ECMA script spec: http://www.ecma-international.org/ecma-262/5.1/#sec-12.4\n data['callback'] = '(function(){})';\n }\n }\n\n data['ip'] = this.get_config('ip')?1:0;\n data['_'] = new Date().getTime().toString();\n\n if (use_post) {\n body_data = 'data=' + encodeURIComponent(data['data']);\n delete data['data'];\n }\n\n url += '?' + _.HTTPBuildQuery(data);\n\n var lib = this;\n if ('img' in data) {\n var img = document$1.createElement('img');\n img.src = url;\n document$1.body.appendChild(img);\n } else if (use_sendBeacon) {\n try {\n succeeded = sendBeacon(url, body_data);\n } catch (e) {\n lib.report_error(e);\n succeeded = false;\n }\n try {\n if (callback) {\n callback(succeeded ? 1 : 0);\n }\n } catch (e) {\n lib.report_error(e);\n }\n } else if (USE_XHR) {\n try {\n var req = new XMLHttpRequest();\n req.open(options.method, url, true);\n\n var headers = this.get_config('xhr_headers');\n if (use_post) {\n headers['Content-Type'] = 'application/x-www-form-urlencoded';\n }\n _.each(headers, function(headerValue, headerName) {\n req.setRequestHeader(headerName, headerValue);\n });\n\n if (options.timeout_ms && typeof req.timeout !== 'undefined') {\n req.timeout = options.timeout_ms;\n var start_time = new Date().getTime();\n }\n\n // send the mp_optout cookie\n // withCredentials cannot be modified until after calling .open on Android and Mobile Safari\n req.withCredentials = true;\n req.onreadystatechange = function () {\n if (req.readyState === 4) { // XMLHttpRequest.DONE == 4, except in safari 4\n if (req.status === 200) {\n if (callback) {\n if (verbose_mode) {\n var response;\n try {\n response = _.JSONDecode(req.responseText);\n } catch (e) {\n lib.report_error(e);\n if (options.ignore_json_errors) {\n response = req.responseText;\n } else {\n return;\n }\n }\n callback(response);\n } else {\n callback(Number(req.responseText));\n }\n }\n } else {\n var error;\n if (\n req.timeout &&\n !req.status &&\n new Date().getTime() - start_time >= req.timeout\n ) {\n error = 'timeout';\n } else {\n error = 'Bad HTTP status: ' + req.status + ' ' + req.statusText;\n }\n lib.report_error(error);\n if (callback) {\n if (verbose_mode) {\n callback({status: 0, error: error, xhr_req: req});\n } else {\n callback(0);\n }\n }\n }\n }\n };\n req.send(body_data);\n } catch (e) {\n lib.report_error(e);\n succeeded = false;\n }\n } else {\n var script = document$1.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n var s = document$1.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(script, s);\n }\n\n return succeeded;\n};\n\n/**\n * _execute_array() deals with processing any mixpanel function\n * calls that were called before the Mixpanel library were loaded\n * (and are thus stored in an array so they can be called later)\n *\n * Note: we fire off all the mixpanel function calls && user defined\n * functions BEFORE we fire off mixpanel tracking calls. This is so\n * identify/register/set_config calls can properly modify early\n * tracking calls.\n *\n * @param {Array} array\n */\nMixpanelLib.prototype._execute_array = function(array) {\n var fn_name, alias_calls = [], other_calls = [], tracking_calls = [];\n _.each(array, function(item) {\n if (item) {\n fn_name = item[0];\n if (_.isArray(fn_name)) {\n tracking_calls.push(item); // chained call e.g. mixpanel.get_group().set()\n } else if (typeof(item) === 'function') {\n item.call(this);\n } else if (_.isArray(item) && fn_name === 'alias') {\n alias_calls.push(item);\n } else if (_.isArray(item) && fn_name.indexOf('track') !== -1 && typeof(this[fn_name]) === 'function') {\n tracking_calls.push(item);\n } else {\n other_calls.push(item);\n }\n }\n }, this);\n\n var execute = function(calls, context) {\n _.each(calls, function(item) {\n if (_.isArray(item[0])) {\n // chained call\n var caller = context;\n _.each(item, function(call) {\n caller = caller[call[0]].apply(caller, call.slice(1));\n });\n } else {\n this[item[0]].apply(this, item.slice(1));\n }\n }, context);\n };\n\n execute(alias_calls, this);\n execute(other_calls, this);\n execute(tracking_calls, this);\n};\n\n// request queueing utils\n\nMixpanelLib.prototype.are_batchers_initialized = function() {\n return !!this.request_batchers.events;\n};\n\nMixpanelLib.prototype.init_batchers = function() {\n var token = this.get_config('token');\n if (!this.are_batchers_initialized()) {\n var batcher_for = _.bind(function(attrs) {\n return new RequestBatcher(\n '__mpq_' + token + attrs.queue_suffix,\n {\n libConfig: this['config'],\n sendRequestFunc: _.bind(function(data, options, cb) {\n this._send_request(\n this.get_config('api_host') + attrs.endpoint,\n this._encode_data_for_request(data),\n options,\n this._prepare_callback(cb, data)\n );\n }, this),\n beforeSendHook: _.bind(function(item) {\n return this._run_hook('before_send_' + attrs.type, item);\n }, this),\n errorReporter: this.get_config('error_reporter'),\n stopAllBatchingFunc: _.bind(this.stop_batch_senders, this)\n }\n );\n }, this);\n this.request_batchers = {\n events: batcher_for({type: 'events', endpoint: '/track/', queue_suffix: '_ev'}),\n people: batcher_for({type: 'people', endpoint: '/engage/', queue_suffix: '_pp'}),\n groups: batcher_for({type: 'groups', endpoint: '/groups/', queue_suffix: '_gr'})\n };\n }\n if (this.get_config('batch_autostart')) {\n this.start_batch_senders();\n }\n};\n\nMixpanelLib.prototype.start_batch_senders = function() {\n if (this.are_batchers_initialized()) {\n this._batch_requests = true;\n _.each(this.request_batchers, function(batcher) {\n batcher.start();\n });\n }\n};\n\nMixpanelLib.prototype.stop_batch_senders = function() {\n this._batch_requests = false;\n _.each(this.request_batchers, function(batcher) {\n batcher.stop();\n batcher.clear();\n });\n};\n\n/**\n * push() keeps the standard async-array-push\n * behavior around after the lib is loaded.\n * This is only useful for external integrations that\n * do not wish to rely on our convenience methods\n * (created in the snippet).\n *\n * ### Usage:\n * mixpanel.push(['register', { a: 'b' }]);\n *\n * @param {Array} item A [function_name, args...] array to be executed\n */\nMixpanelLib.prototype.push = function(item) {\n this._execute_array([item]);\n};\n\n/**\n * Disable events on the Mixpanel object. If passed no arguments,\n * this function disables tracking of any event. If passed an\n * array of event names, those events will be disabled, but other\n * events will continue to be tracked.\n *\n * Note: this function does not stop other mixpanel functions from\n * firing, such as register() or people.set().\n *\n * @param {Array} [events] An array of event names to disable\n */\nMixpanelLib.prototype.disable = function(events) {\n if (typeof(events) === 'undefined') {\n this._flags.disable_all_events = true;\n } else {\n this.__disabled_events = this.__disabled_events.concat(events);\n }\n};\n\nMixpanelLib.prototype._encode_data_for_request = function(data) {\n var encoded_data = _.JSONEncode(data);\n if (this.get_config('api_payload_format') === PAYLOAD_TYPE_BASE64) {\n encoded_data = _.base64Encode(encoded_data);\n }\n return {'data': encoded_data};\n};\n\n// internal method for handling track vs batch-enqueue logic\nMixpanelLib.prototype._track_or_batch = function(options, callback) {\n var truncated_data = _.truncate(options.data, 255);\n var endpoint = options.endpoint;\n var batcher = options.batcher;\n var should_send_immediately = options.should_send_immediately;\n var send_request_options = options.send_request_options || {};\n callback = callback || NOOP_FUNC;\n\n var request_enqueued_or_initiated = true;\n var send_request_immediately = _.bind(function() {\n if (!send_request_options.skip_hooks) {\n truncated_data = this._run_hook('before_send_' + options.type, truncated_data);\n }\n if (truncated_data) {\n console.log('MIXPANEL REQUEST:');\n console.log(truncated_data);\n return this._send_request(\n endpoint,\n this._encode_data_for_request(truncated_data),\n send_request_options,\n this._prepare_callback(callback, truncated_data)\n );\n } else {\n return null;\n }\n }, this);\n\n if (this._batch_requests && !should_send_immediately) {\n batcher.enqueue(truncated_data, function(succeeded) {\n if (succeeded) {\n callback(1, truncated_data);\n } else {\n send_request_immediately();\n }\n });\n } else {\n request_enqueued_or_initiated = send_request_immediately();\n }\n\n return request_enqueued_or_initiated && truncated_data;\n};\n\n/**\n * Track an event. This is the most important and\n * frequently used Mixpanel function.\n *\n * ### Usage:\n *\n * // track an event named 'Registered'\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * // track an event using navigator.sendBeacon\n * mixpanel.track('Left page', {'duration_seconds': 35}, {transport: 'sendBeacon'});\n *\n * To track link clicks or form submissions, see track_links() or track_forms().\n *\n * @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc.\n * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself.\n * @param {Object} [options] Optional configuration for this track request.\n * @param {String} [options.transport] Transport method for network request ('xhr' or 'sendBeacon').\n * @param {Boolean} [options.send_immediately] Whether to bypass batching/queueing and send track request immediately.\n * @param {Function} [callback] If provided, the callback function will be called after tracking the event.\n * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object\n * with the tracking payload sent to the API server is returned; otherwise false.\n */\nMixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, properties, options, callback) {\n if (!callback && typeof options === 'function') {\n callback = options;\n options = null;\n }\n options = options || {};\n var transport = options['transport']; // external API, don't minify 'transport' prop\n if (transport) {\n options.transport = transport; // 'transport' prop name can be minified internally\n }\n var should_send_immediately = options['send_immediately'];\n if (typeof callback !== 'function') {\n callback = NOOP_FUNC;\n }\n\n if (_.isUndefined(event_name)) {\n this.report_error('No event name provided to mixpanel.track');\n return;\n }\n\n if (this._event_is_disabled(event_name)) {\n callback(0);\n return;\n }\n\n // set defaults\n properties = properties || {};\n properties['token'] = this.get_config('token');\n\n // set $duration if time_event was previously called for this event\n var start_timestamp = this['persistence'].remove_event_timer(event_name);\n if (!_.isUndefined(start_timestamp)) {\n var duration_in_ms = new Date().getTime() - start_timestamp;\n properties['$duration'] = parseFloat((duration_in_ms / 1000).toFixed(3));\n }\n\n this._set_default_superprops();\n\n var marketing_properties = this.get_config('track_marketing')\n ? _.info.marketingParams()\n : {};\n\n // note: extend writes to the first object, so lets make sure we\n // don't write to the persistence properties object and info\n // properties object by passing in a new object\n\n // update properties with pageview info and super-properties\n properties = _.extend(\n {},\n _.info.properties(),\n marketing_properties,\n this['persistence'].properties(),\n this.unpersisted_superprops,\n properties\n );\n\n var property_blacklist = this.get_config('property_blacklist');\n if (_.isArray(property_blacklist)) {\n _.each(property_blacklist, function(blacklisted_prop) {\n delete properties[blacklisted_prop];\n });\n } else {\n this.report_error('Invalid value for property_blacklist config: ' + property_blacklist);\n }\n\n var data = {\n 'event': event_name,\n 'properties': properties\n };\n var ret = this._track_or_batch({\n type: 'events',\n data: data,\n endpoint: this.get_config('api_host') + '/track/',\n batcher: this.request_batchers.events,\n should_send_immediately: should_send_immediately,\n send_request_options: options\n }, callback);\n\n return ret;\n});\n\n/**\n * Register the current user into one/many groups.\n *\n * ### Usage:\n *\n * mixpanel.set_group('company', ['mixpanel', 'google']) // an array of IDs\n * mixpanel.set_group('company', 'mixpanel')\n * mixpanel.set_group('company', 128746312)\n *\n * @param {String} group_key Group key\n * @param {Array|String|Number} group_ids An array of group IDs, or a singular group ID\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n *\n */\nMixpanelLib.prototype.set_group = addOptOutCheckMixpanelLib(function(group_key, group_ids, callback) {\n if (!_.isArray(group_ids)) {\n group_ids = [group_ids];\n }\n var prop = {};\n prop[group_key] = group_ids;\n this.register(prop);\n return this['people'].set(group_key, group_ids, callback);\n});\n\n/**\n * Add a new group for this user.\n *\n * ### Usage:\n *\n * mixpanel.add_group('company', 'mixpanel')\n *\n * @param {String} group_key Group key\n * @param {*} group_id A valid Mixpanel property type\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.add_group = addOptOutCheckMixpanelLib(function(group_key, group_id, callback) {\n var old_values = this.get_property(group_key);\n if (old_values === undefined) {\n var prop = {};\n prop[group_key] = [group_id];\n this.register(prop);\n } else {\n if (old_values.indexOf(group_id) === -1) {\n old_values.push(group_id);\n this.register(prop);\n }\n }\n return this['people'].union(group_key, group_id, callback);\n});\n\n/**\n * Remove a group from this user.\n *\n * ### Usage:\n *\n * mixpanel.remove_group('company', 'mixpanel')\n *\n * @param {String} group_key Group key\n * @param {*} group_id A valid Mixpanel property type\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.remove_group = addOptOutCheckMixpanelLib(function(group_key, group_id, callback) {\n var old_value = this.get_property(group_key);\n // if the value doesn't exist, the persistent store is unchanged\n if (old_value !== undefined) {\n var idx = old_value.indexOf(group_id);\n if (idx > -1) {\n old_value.splice(idx, 1);\n this.register({group_key: old_value});\n }\n if (old_value.length === 0) {\n this.unregister(group_key);\n }\n }\n return this['people'].remove(group_key, group_id, callback);\n});\n\n/**\n * Track an event with specific groups.\n *\n * ### Usage:\n *\n * mixpanel.track_with_groups('purchase', {'product': 'iphone'}, {'University': ['UCB', 'UCLA']})\n *\n * @param {String} event_name The name of the event (see `mixpanel.track()`)\n * @param {Object=} properties A set of properties to include with the event you're sending (see `mixpanel.track()`)\n * @param {Object=} groups An object mapping group name keys to one or more values\n * @param {Function} [callback] If provided, the callback will be called after tracking the event.\n */\nMixpanelLib.prototype.track_with_groups = addOptOutCheckMixpanelLib(function(event_name, properties, groups, callback) {\n var tracking_props = _.extend({}, properties || {});\n _.each(groups, function(v, k) {\n if (v !== null && v !== undefined) {\n tracking_props[k] = v;\n }\n });\n return this.track(event_name, tracking_props, callback);\n});\n\nMixpanelLib.prototype._create_map_key = function (group_key, group_id) {\n return group_key + '_' + JSON.stringify(group_id);\n};\n\nMixpanelLib.prototype._remove_group_from_cache = function (group_key, group_id) {\n delete this._cached_groups[this._create_map_key(group_key, group_id)];\n};\n\n/**\n * Look up reference to a Mixpanel group\n *\n * ### Usage:\n *\n * mixpanel.get_group(group_key, group_id)\n *\n * @param {String} group_key Group key\n * @param {Object} group_id A valid Mixpanel property type\n * @returns {Object} A MixpanelGroup identifier\n */\nMixpanelLib.prototype.get_group = function (group_key, group_id) {\n var map_key = this._create_map_key(group_key, group_id);\n var group = this._cached_groups[map_key];\n if (group === undefined || group._group_key !== group_key || group._group_id !== group_id) {\n group = new MixpanelGroup();\n group._init(this, group_key, group_id);\n this._cached_groups[map_key] = group;\n }\n return group;\n};\n\n/**\n * Track a default Mixpanel page view event, which includes extra default event properties to\n * improve page view data. The `config.track_pageview` option for <a href=\"#mixpanelinit\">mixpanel.init()</a>\n * may be turned on for tracking page loads automatically.\n *\n * ### Usage\n *\n * // track a default $mp_web_page_view event\n * mixpanel.track_pageview();\n *\n * // track a page view event with additional event properties\n * mixpanel.track_pageview({'ab_test_variant': 'card-layout-b'});\n *\n * // example approach to track page views on different page types as event properties\n * mixpanel.track_pageview({'page': 'pricing'});\n * mixpanel.track_pageview({'page': 'homepage'});\n *\n * // UNCOMMON: Tracking a page view event with a custom event_name option. NOT expected to be used for\n * // individual pages on the same site or product. Use cases for custom event_name may be page\n * // views on different products or internal applications that are considered completely separate\n * mixpanel.track_pageview({'page': 'customer-search'}, {'event_name': '[internal] Admin Page View'});\n *\n * @param {Object} [properties] An optional set of additional properties to send with the page view event\n * @param {Object} [options] Page view tracking options\n * @param {String} [options.event_name] - Alternate name for the tracking event\n * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object\n * with the tracking payload sent to the API server is returned; otherwise false.\n */\nMixpanelLib.prototype.track_pageview = addOptOutCheckMixpanelLib(function(properties, options) {\n if (typeof properties !== 'object') {\n properties = {};\n }\n options = options || {};\n var event_name = options['event_name'] || '$mp_web_page_view';\n\n var default_page_properties = _.extend(\n _.info.mpPageViewProperties(),\n _.info.campaignParams(),\n _.info.clickParams()\n );\n\n var event_properties = _.extend(\n {},\n default_page_properties,\n properties\n );\n\n return this.track(event_name, event_properties);\n});\n\n/**\n * Track clicks on a set of document elements. Selector must be a\n * valid query. Elements must exist on the page at the time track_links is called.\n *\n * ### Usage:\n *\n * // track click for link id #nav\n * mixpanel.track_links('#nav', 'Clicked Nav Link');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the Mixpanel\n * servers to respond. If they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] A properties object or function that returns a dictionary of properties when passed a DOMElement\n */\nMixpanelLib.prototype.track_links = function() {\n return this._track_dom.call(this, LinkTracker, arguments);\n};\n\n/**\n * Track form submissions. Selector must be a valid query.\n *\n * ### Usage:\n *\n * // track submission for form id 'register'\n * mixpanel.track_forms('#register', 'Created Account');\n *\n * ### Notes:\n *\n * This function will wait up to 300 ms for the mixpanel\n * servers to respond, if they have not responded by that time\n * it will head to the link without ensuring that your event\n * has been tracked. To configure this timeout please see the\n * set_config() documentation below.\n *\n * If you pass a function in as the properties argument, the\n * function will receive the DOMElement that triggered the\n * event as an argument. You are expected to return an object\n * from the function; any properties defined on this object\n * will be sent to mixpanel as event properties.\n *\n * @type {Function}\n * @param {Object|String} query A valid DOM query, element or jQuery-esque list\n * @param {String} event_name The name of the event to track\n * @param {Object|Function} [properties] This can be a set of properties, or a function that returns a set of properties after being passed a DOMElement\n */\nMixpanelLib.prototype.track_forms = function() {\n return this._track_dom.call(this, FormTracker, arguments);\n};\n\n/**\n * Time an event by including the time between this call and a\n * later 'track' call for the same event in the properties sent\n * with the event.\n *\n * ### Usage:\n *\n * // time an event named 'Registered'\n * mixpanel.time_event('Registered');\n * mixpanel.track('Registered', {'Gender': 'Male', 'Age': 21});\n *\n * When called for a particular event name, the next track call for that event\n * name will include the elapsed time between the 'time_event' and 'track'\n * calls. This value is stored as seconds in the '$duration' property.\n *\n * @param {String} event_name The name of the event.\n */\nMixpanelLib.prototype.time_event = function(event_name) {\n if (_.isUndefined(event_name)) {\n this.report_error('No event name provided to mixpanel.time_event');\n return;\n }\n\n if (this._event_is_disabled(event_name)) {\n return;\n }\n\n this['persistence'].set_event_timer(event_name, new Date().getTime());\n};\n\nvar REGISTER_DEFAULTS = {\n 'persistent': true\n};\n/**\n * Helper to parse options param for register methods, maintaining\n * legacy support for plain \"days\" param instead of options object\n * @param {Number|Object} [days_or_options] 'days' option (Number), or Options object for register methods\n * @returns {Object} options object\n */\nvar options_for_register = function(days_or_options) {\n var options;\n if (_.isObject(days_or_options)) {\n options = days_or_options;\n } else if (!_.isUndefined(days_or_options)) {\n options = {'days': days_or_options};\n } else {\n options = {};\n }\n return _.extend({}, REGISTER_DEFAULTS, options);\n};\n\n/**\n * Register a set of super properties, which are included with all\n * events. This will overwrite previous super property values.\n *\n * ### Usage:\n *\n * // register 'Gender' as a super property\n * mixpanel.register({'Gender': 'Female'});\n *\n * // register several super properties when a user signs up\n * mixpanel.register({\n * 'Email': 'jdoe@example.com',\n * 'Account Type': 'Free'\n * });\n *\n * // register only for the current pageload\n * mixpanel.register({'Name': 'Pat'}, {persistent: false});\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {Number|Object} [days_or_options] Options object or number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.days] - number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.persistent=true] - whether to put in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.register = function(props, days_or_options) {\n var options = options_for_register(days_or_options);\n if (options['persistent']) {\n this['persistence'].register(props, options['days']);\n } else {\n _.extend(this.unpersisted_superprops, props);\n }\n};\n\n/**\n * Register a set of super properties only once. This will not\n * overwrite previous super property values, unlike register().\n *\n * ### Usage:\n *\n * // register a super property for the first time only\n * mixpanel.register_once({\n * 'First Login Date': new Date().toISOString()\n * });\n *\n * // register once, only for the current pageload\n * mixpanel.register_once({\n * 'First interaction time': new Date().toISOString()\n * }, 'None', {persistent: false});\n *\n * ### Notes:\n *\n * If default_value is specified, current super properties\n * with that value will be overwritten.\n *\n * @param {Object} properties An associative array of properties to store about the user\n * @param {*} [default_value] Value to override if already set in super properties (ex: 'False') Default: 'None'\n * @param {Number|Object} [days_or_options] Options object or number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.days] - number of days since the user's last visit to store the super properties (only valid for persisted props)\n * @param {boolean} [days_or_options.persistent=true] - whether to put in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.register_once = function(props, default_value, days_or_options) {\n var options = options_for_register(days_or_options);\n if (options['persistent']) {\n this['persistence'].register_once(props, default_value, options['days']);\n } else {\n if (typeof(default_value) === 'undefined') {\n default_value = 'None';\n }\n _.each(props, function(val, prop) {\n if (!this.unpersisted_superprops.hasOwnProperty(prop) || this.unpersisted_superprops[prop] === default_value) {\n this.unpersisted_superprops[prop] = val;\n }\n }, this);\n }\n};\n\n/**\n * Delete a super property stored with the current user.\n *\n * @param {String} property The name of the super property to remove\n * @param {Object} [options]\n * @param {boolean} [options.persistent=true] - whether to look in persistent storage (cookie/localStorage)\n */\nMixpanelLib.prototype.unregister = function(property, options) {\n options = options_for_register(options);\n if (options['persistent']) {\n this['persistence'].unregister(property);\n } else {\n delete this.unpersisted_superprops[property];\n }\n};\n\nMixpanelLib.prototype._register_single = function(prop, value) {\n var props = {};\n props[prop] = value;\n this.register(props);\n};\n\n/**\n * Identify a user with a unique ID to track user activity across\n * devices, tie a user to their events, and create a user profile.\n * If you never call this method, unique visitors are tracked using\n * a UUID generated the first time they visit the site.\n *\n * Call identify when you know the identity of the current user,\n * typically after login or signup. We recommend against using\n * identify for anonymous visitors to your site.\n *\n * ### Notes:\n * If your project has\n * <a href=\"https://help.mixpanel.com/hc/en-us/articles/360039133851\">ID Merge</a>\n * enabled, the identify method will connect pre- and\n * post-authentication events when appropriate.\n *\n * If your project does not have ID Merge enabled, identify will\n * change the user's local distinct_id to the unique ID you pass.\n * Events tracked prior to authentication will not be connected\n * to the same user identity. If ID Merge is disabled, alias can\n * be used to connect pre- and post-registration events.\n *\n * @param {String} [unique_id] A string that uniquely identifies a user. If not provided, the distinct_id currently in the persistent store (cookie or localStorage) will be used.\n */\nMixpanelLib.prototype.identify = function(\n new_distinct_id, _set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback\n) {\n // Optional Parameters\n // _set_callback:function A callback to be run if and when the People set queue is flushed\n // _add_callback:function A callback to be run if and when the People add queue is flushed\n // _append_callback:function A callback to be run if and when the People append queue is flushed\n // _set_once_callback:function A callback to be run if and when the People set_once queue is flushed\n // _union_callback:function A callback to be run if and when the People union queue is flushed\n // _unset_callback:function A callback to be run if and when the People unset queue is flushed\n\n var previous_distinct_id = this.get_distinct_id();\n if (new_distinct_id && previous_distinct_id !== new_distinct_id) {\n // we allow the following condition if previous distinct_id is same as new_distinct_id\n // so that you can force flush people updates for anonymous profiles.\n if (typeof new_distinct_id === 'string' && new_distinct_id.indexOf(DEVICE_ID_PREFIX) === 0) {\n this.report_error('distinct_id cannot have $device: prefix');\n return -1;\n }\n this.register({'$user_id': new_distinct_id});\n }\n\n if (!this.get_property('$device_id')) {\n // The persisted distinct id might not actually be a device id at all\n // it might be a distinct id of the user from before\n var device_id = previous_distinct_id;\n this.register_once({\n '$had_persisted_distinct_id': true,\n '$device_id': device_id\n }, '');\n }\n\n // identify only changes the distinct id if it doesn't match either the existing or the alias;\n // if it's new, blow away the alias as well.\n if (new_distinct_id !== previous_distinct_id && new_distinct_id !== this.get_property(ALIAS_ID_KEY)) {\n this.unregister(ALIAS_ID_KEY);\n this.register({'distinct_id': new_distinct_id});\n }\n this._flags.identify_called = true;\n // Flush any queued up people requests\n this['people']._flush(_set_callback, _add_callback, _append_callback, _set_once_callback, _union_callback, _unset_callback, _remove_callback);\n\n // send an $identify event any time the distinct_id is changing - logic on the server\n // will determine whether or not to do anything with it.\n if (new_distinct_id !== previous_distinct_id) {\n this.track('$identify', {\n 'distinct_id': new_distinct_id,\n '$anon_distinct_id': previous_distinct_id\n }, {skip_hooks: true});\n }\n};\n\n/**\n * Clears super properties and generates a new random distinct_id for this instance.\n * Useful for clearing data when a user logs out.\n */\nMixpanelLib.prototype.reset = function() {\n this['persistence'].clear();\n this._flags.identify_called = false;\n var uuid = _.UUID();\n this.register_once({\n 'distinct_id': DEVICE_ID_PREFIX + uuid,\n '$device_id': uuid\n }, '');\n};\n\n/**\n * Returns the current distinct id of the user. This is either the id automatically\n * generated by the library or the id that has been passed by a call to identify().\n *\n * ### Notes:\n *\n * get_distinct_id() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // set distinct_id after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * distinct_id = mixpanel.get_distinct_id();\n * }\n * });\n */\nMixpanelLib.prototype.get_distinct_id = function() {\n return this.get_property('distinct_id');\n};\n\n/**\n * The alias method creates an alias which Mixpanel will use to\n * remap one id to another. Multiple aliases can point to the\n * same identifier.\n *\n * The following is a valid use of alias:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // You can add multiple id aliases to the existing ID\n * mixpanel.alias('newer_id', 'existing_id');\n *\n * Aliases can also be chained - the following is a valid example:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // chain newer_id - new_id - existing_id\n * mixpanel.alias('newer_id', 'new_id');\n *\n * Aliases cannot point to multiple identifiers - the following\n * example will not work:\n *\n * mixpanel.alias('new_id', 'existing_id');\n * // this is invalid as 'new_id' already points to 'existing_id'\n * mixpanel.alias('new_id', 'newer_id');\n *\n * ### Notes:\n *\n * If your project does not have\n * <a href=\"https://help.mixpanel.com/hc/en-us/articles/360039133851\">ID Merge</a>\n * enabled, the best practice is to call alias once when a unique\n * ID is first created for a user (e.g., when a user first registers\n * for an account). Do not use alias multiple times for a single\n * user without ID Merge enabled.\n *\n * @param {String} alias A unique identifier that you want to use for this user in the future.\n * @param {String} [original] The current identifier being used for this user.\n */\nMixpanelLib.prototype.alias = function(alias, original) {\n // If the $people_distinct_id key exists in persistence, there has been a previous\n // mixpanel.people.identify() call made for this user. It is VERY BAD to make an alias with\n // this ID, as it will duplicate users.\n if (alias === this.get_property(PEOPLE_DISTINCT_ID_KEY)) {\n this.report_error('Attempting to create alias for existing People user - aborting.');\n return -2;\n }\n\n var _this = this;\n if (_.isUndefined(original)) {\n original = this.get_distinct_id();\n }\n if (alias !== original) {\n this._register_single(ALIAS_ID_KEY, alias);\n return this.track('$create_alias', {\n 'alias': alias,\n 'distinct_id': original\n }, {\n skip_hooks: true\n }, function() {\n // Flush the people queue\n _this.identify(alias);\n });\n } else {\n this.report_error('alias matches current distinct_id - skipping api call.');\n this.identify(alias);\n return -1;\n }\n};\n\n/**\n * Provide a string to recognize the user by. The string passed to\n * this method will appear in the Mixpanel Streams product rather\n * than an automatically generated name. Name tags do not have to\n * be unique.\n *\n * This value will only be included in Streams data.\n *\n * @param {String} name_tag A human readable name for the user\n * @deprecated\n */\nMixpanelLib.prototype.name_tag = function(name_tag) {\n this._register_single('mp_name_tag', name_tag);\n};\n\n/**\n * Update the configuration of a mixpanel library instance.\n *\n * The default config is:\n *\n * {\n * // HTTP method for tracking requests\n * api_method: 'POST'\n *\n * // transport for sending requests ('XHR' or 'sendBeacon')\n * // NB: sendBeacon should only be used for scenarios such as\n * // page unload where a \"best-effort\" attempt to send is\n * // acceptable; the sendBeacon API does not support callbacks\n * // or any way to know the result of the request. Mixpanel\n * // tracking via sendBeacon will not support any event-\n * // batching or retry mechanisms.\n * api_transport: 'XHR'\n *\n * // request-batching/queueing/retry\n * batch_requests: true,\n *\n * // maximum number of events/updates to send in a single\n * // network request\n * batch_size: 50,\n *\n * // milliseconds to wait between sending batch requests\n * batch_flush_interval_ms: 5000,\n *\n * // milliseconds to wait for network responses to batch requests\n * // before they are considered timed-out and retried\n * batch_request_timeout_ms: 90000,\n *\n * // override value for cookie domain, only useful for ensuring\n * // correct cross-subdomain cookies on unusual domains like\n * // subdomain.mainsite.avocat.fr; NB this cannot be used to\n * // set cookies on a different domain than the current origin\n * cookie_domain: ''\n *\n * // super properties cookie expiration (in days)\n * cookie_expiration: 365\n *\n * // if true, cookie will be set with SameSite=None; Secure\n * // this is only useful in special situations, like embedded\n * // 3rd-party iframes that set up a Mixpanel instance\n * cross_site_cookie: false\n *\n * // super properties span subdomains\n * cross_subdomain_cookie: true\n *\n * // debug mode\n * debug: false\n *\n * // if this is true, the mixpanel cookie or localStorage entry\n * // will be deleted, and no user persistence will take place\n * disable_persistence: false\n *\n * // if this is true, Mixpanel will automatically determine\n * // City, Region and Country data using the IP address of\n * //the client\n * ip: true\n *\n * // opt users out of tracking by this Mixpanel instance by default\n * opt_out_tracking_by_default: false\n *\n * // opt users out of browser data storage by this Mixpanel instance by default\n * opt_out_persistence_by_default: false\n *\n * // persistence mechanism used by opt-in/opt-out methods - cookie\n * // or localStorage - falls back to cookie if localStorage is unavailable\n * opt_out_tracking_persistence_type: 'localStorage'\n *\n * // customize the name of cookie/localStorage set by opt-in/opt-out methods\n * opt_out_tracking_cookie_prefix: null\n *\n * // type of persistent store for super properties (cookie/\n * // localStorage) if set to 'localStorage', any existing\n * // mixpanel cookie value with the same persistence_name\n * // will be transferred to localStorage and deleted\n * persistence: 'cookie'\n *\n * // name for super properties persistent store\n * persistence_name: ''\n *\n * // names of properties/superproperties which should never\n * // be sent with track() calls\n * property_blacklist: []\n *\n * // if this is true, mixpanel cookies will be marked as\n * // secure, meaning they will only be transmitted over https\n * secure_cookie: false\n *\n * // disables enriching user profiles with first touch marketing data\n * skip_first_touch_marketing: false\n *\n * // the amount of time track_links will\n * // wait for Mixpanel's servers to respond\n * track_links_timeout: 300\n *\n * // adds any UTM parameters and click IDs present on the page to any events fired\n * track_marketing: true\n *\n * // enables automatic page view tracking using default page view events through\n * // the track_pageview() method\n * track_pageview: false\n *\n * // if you set upgrade to be true, the library will check for\n * // a cookie from our old js library and import super\n * // properties from it, then the old cookie is deleted\n * // The upgrade config option only works in the initialization,\n * // so make sure you set it when you create the library.\n * upgrade: false\n *\n * // extra HTTP request headers to set for each API request, in\n * // the format {'Header-Name': value}\n * xhr_headers: {}\n *\n * // whether to ignore or respect the web browser's Do Not Track setting\n * ignore_dnt: false\n * }\n *\n *\n * @param {Object} config A dictionary of new configuration values to update\n */\nMixpanelLib.prototype.set_config = function(config) {\n if (_.isObject(config)) {\n _.extend(this['config'], config);\n\n var new_batch_size = config['batch_size'];\n if (new_batch_size) {\n _.each(this.request_batchers, function(batcher) {\n batcher.resetBatchSize();\n });\n }\n\n if (!this.get_config('persistence_name')) {\n this['config']['persistence_name'] = this['config']['cookie_name'];\n }\n if (!this.get_config('disable_persistence')) {\n this['config']['disable_persistence'] = this['config']['disable_cookie'];\n }\n\n if (this['persistence']) {\n this['persistence'].update_config(this['config']);\n }\n Config.DEBUG = Config.DEBUG || this.get_config('debug');\n }\n};\n\n/**\n * returns the current config object for the library.\n */\nMixpanelLib.prototype.get_config = function(prop_name) {\n return this['config'][prop_name];\n};\n\n/**\n * Fetch a hook function from config, with safe default, and run it\n * against the given arguments\n * @param {string} hook_name which hook to retrieve\n * @returns {any|null} return value of user-provided hook, or null if nothing was returned\n */\nMixpanelLib.prototype._run_hook = function(hook_name) {\n var ret = (this['config']['hooks'][hook_name] || IDENTITY_FUNC).apply(this, slice.call(arguments, 1));\n if (typeof ret === 'undefined') {\n this.report_error(hook_name + ' hook did not return a value');\n ret = null;\n }\n return ret;\n};\n\n/**\n * Returns the value of the super property named property_name. If no such\n * property is set, get_property() will return the undefined value.\n *\n * ### Notes:\n *\n * get_property() can only be called after the Mixpanel library has finished loading.\n * init() has a loaded function available to handle this automatically. For example:\n *\n * // grab value for 'user_id' after the mixpanel library has loaded\n * mixpanel.init('YOUR PROJECT TOKEN', {\n * loaded: function(mixpanel) {\n * user_id = mixpanel.get_property('user_id');\n * }\n * });\n *\n * @param {String} property_name The name of the super property you want to retrieve\n */\nMixpanelLib.prototype.get_property = function(property_name) {\n return this['persistence']['props'][property_name];\n};\n\nMixpanelLib.prototype.toString = function() {\n var name = this.get_config('name');\n if (name !== PRIMARY_INSTANCE_NAME) {\n name = PRIMARY_INSTANCE_NAME + '.' + name;\n }\n return name;\n};\n\nMixpanelLib.prototype._event_is_disabled = function(event_name) {\n return _.isBlockedUA(userAgent) ||\n this._flags.disable_all_events ||\n _.include(this.__disabled_events, event_name);\n};\n\n// perform some housekeeping around GDPR opt-in/out state\nMixpanelLib.prototype._gdpr_init = function() {\n var is_localStorage_requested = this.get_config('opt_out_tracking_persistence_type') === 'localStorage';\n\n // try to convert opt-in/out cookies to localStorage if possible\n if (is_localStorage_requested && _.localStorage.is_supported()) {\n if (!this.has_opted_in_tracking() && this.has_opted_in_tracking({'persistence_type': 'cookie'})) {\n this.opt_in_tracking({'enable_persistence': false});\n }\n if (!this.has_opted_out_tracking() && this.has_opted_out_tracking({'persistence_type': 'cookie'})) {\n this.opt_out_tracking({'clear_persistence': false});\n }\n this.clear_opt_in_out_tracking({\n 'persistence_type': 'cookie',\n 'enable_persistence': false\n });\n }\n\n // check whether the user has already opted out - if so, clear & disable persistence\n if (this.has_opted_out_tracking()) {\n this._gdpr_update_persistence({'clear_persistence': true});\n\n // check whether we should opt out by default\n // note: we don't clear persistence here by default since opt-out default state is often\n // used as an initial state while GDPR information is being collected\n } else if (!this.has_opted_in_tracking() && (\n this.get_config('opt_out_tracking_by_default') || _.cookie.get('mp_optout')\n )) {\n _.cookie.remove('mp_optout');\n this.opt_out_tracking({\n 'clear_persistence': this.get_config('opt_out_persistence_by_default')\n });\n }\n};\n\n/**\n * Enable or disable persistence based on options\n * only enable/disable if persistence is not already in this state\n * @param {boolean} [options.clear_persistence] If true, will delete all data stored by the sdk in persistence and disable it\n * @param {boolean} [options.enable_persistence] If true, will re-enable sdk persistence\n */\nMixpanelLib.prototype._gdpr_update_persistence = function(options) {\n var disabled;\n if (options && options['clear_persistence']) {\n disabled = true;\n } else if (options && options['enable_persistence']) {\n disabled = false;\n } else {\n return;\n }\n\n if (!this.get_config('disable_persistence') && this['persistence'].disabled !== disabled) {\n this['persistence'].set_disabled(disabled);\n }\n\n if (disabled) {\n _.each(this.request_batchers, function(batcher) {\n batcher.clear();\n });\n }\n};\n\n// call a base gdpr function after constructing the appropriate token and options args\nMixpanelLib.prototype._gdpr_call_func = function(func, options) {\n options = _.extend({\n 'track': _.bind(this.track, this),\n 'persistence_type': this.get_config('opt_out_tracking_persistence_type'),\n 'cookie_prefix': this.get_config('opt_out_tracking_cookie_prefix'),\n 'cookie_expiration': this.get_config('cookie_expiration'),\n 'cross_site_cookie': this.get_config('cross_site_cookie'),\n 'cross_subdomain_cookie': this.get_config('cross_subdomain_cookie'),\n 'cookie_domain': this.get_config('cookie_domain'),\n 'secure_cookie': this.get_config('secure_cookie'),\n 'ignore_dnt': this.get_config('ignore_dnt')\n }, options);\n\n // check if localStorage can be used for recording opt out status, fall back to cookie if not\n if (!_.localStorage.is_supported()) {\n options['persistence_type'] = 'cookie';\n }\n\n return func(this.get_config('token'), {\n track: options['track'],\n trackEventName: options['track_event_name'],\n trackProperties: options['track_properties'],\n persistenceType: options['persistence_type'],\n persistencePrefix: options['cookie_prefix'],\n cookieDomain: options['cookie_domain'],\n cookieExpiration: options['cookie_expiration'],\n crossSiteCookie: options['cross_site_cookie'],\n crossSubdomainCookie: options['cross_subdomain_cookie'],\n secureCookie: options['secure_cookie'],\n ignoreDnt: options['ignore_dnt']\n });\n};\n\n/**\n * Opt the user in to data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * // opt user in\n * mixpanel.opt_in_tracking();\n *\n * // opt user in with specific event name, properties, cookie configuration\n * mixpanel.opt_in_tracking({\n * track_event_name: 'User opted in',\n * track_event_properties: {\n * 'Email': 'jdoe@example.com'\n * },\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {function} [options.track] Function used for tracking a Mixpanel event to record the opt-in action (default is this Mixpanel instance's track method)\n * @param {string} [options.track_event_name=$opt_in] Event name to be used for tracking the opt-in action\n * @param {Object} [options.track_properties] Set of properties to be tracked along with the opt-in action\n * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.opt_in_tracking = function(options) {\n options = _.extend({\n 'enable_persistence': true\n }, options);\n\n this._gdpr_call_func(optIn, options);\n this._gdpr_update_persistence(options);\n};\n\n/**\n * Opt the user out of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * // opt user out\n * mixpanel.opt_out_tracking();\n *\n * // opt user out with different cookie configuration from Mixpanel instance\n * mixpanel.opt_out_tracking({\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {boolean} [options.delete_user=true] If true, will delete the currently identified user's profile and clear all charges after opting the user out\n * @param {boolean} [options.clear_persistence=true] If true, will delete all data stored by the sdk in persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.opt_out_tracking = function(options) {\n options = _.extend({\n 'clear_persistence': true,\n 'delete_user': true\n }, options);\n\n // delete user and clear charges since these methods may be disabled by opt-out\n if (options['delete_user'] && this['people'] && this['people']._identify_called()) {\n this['people'].delete_user();\n this['people'].clear_charges();\n }\n\n this._gdpr_call_func(optOut, options);\n this._gdpr_update_persistence(options);\n};\n\n/**\n * Check whether the user has opted in to data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * var has_opted_in = mixpanel.has_opted_in_tracking();\n * // use has_opted_in value\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} current opt-in status\n */\nMixpanelLib.prototype.has_opted_in_tracking = function(options) {\n return this._gdpr_call_func(hasOptedIn, options);\n};\n\n/**\n * Check whether the user has opted out of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * var has_opted_out = mixpanel.has_opted_out_tracking();\n * // use has_opted_out value\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @returns {boolean} current opt-out status\n */\nMixpanelLib.prototype.has_opted_out_tracking = function(options) {\n return this._gdpr_call_func(hasOptedOut, options);\n};\n\n/**\n * Clear the user's opt in/out status of data tracking and cookies/localstorage for this Mixpanel instance\n *\n * ### Usage\n *\n * // clear user's opt-in/out status\n * mixpanel.clear_opt_in_out_tracking();\n *\n * // clear user's opt-in/out status with specific cookie configuration - should match\n * // configuration used when opt_in_tracking/opt_out_tracking methods were called.\n * mixpanel.clear_opt_in_out_tracking({\n * cookie_expiration: 30,\n * secure_cookie: true\n * });\n *\n * @param {Object} [options] A dictionary of config options to override\n * @param {boolean} [options.enable_persistence=true] If true, will re-enable sdk persistence\n * @param {string} [options.persistence_type=localStorage] Persistence mechanism used - cookie or localStorage - falls back to cookie if localStorage is unavailable\n * @param {string} [options.cookie_prefix=__mp_opt_in_out] Custom prefix to be used in the cookie/localstorage name\n * @param {Number} [options.cookie_expiration] Number of days until the opt-in cookie expires (overrides value specified in this Mixpanel instance's config)\n * @param {string} [options.cookie_domain] Custom cookie domain (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_site_cookie] Whether the opt-in cookie is set as cross-site-enabled (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.cross_subdomain_cookie] Whether the opt-in cookie is set as cross-subdomain or not (overrides value specified in this Mixpanel instance's config)\n * @param {boolean} [options.secure_cookie] Whether the opt-in cookie is set as secure or not (overrides value specified in this Mixpanel instance's config)\n */\nMixpanelLib.prototype.clear_opt_in_out_tracking = function(options) {\n options = _.extend({\n 'enable_persistence': true\n }, options);\n\n this._gdpr_call_func(clearOptInOut, options);\n this._gdpr_update_persistence(options);\n};\n\nMixpanelLib.prototype.report_error = function(msg, err) {\n console.error.apply(console.error, arguments);\n try {\n if (!err && !(msg instanceof Error)) {\n msg = new Error(msg);\n }\n this.get_config('error_reporter')(msg, err);\n } catch(err) {\n console.error(err);\n }\n};\n\n// EXPORTS (for closure compiler)\n\n// MixpanelLib Exports\nMixpanelLib.prototype['init'] = MixpanelLib.prototype.init;\nMixpanelLib.prototype['reset'] = MixpanelLib.prototype.reset;\nMixpanelLib.prototype['disable'] = MixpanelLib.prototype.disable;\nMixpanelLib.prototype['time_event'] = MixpanelLib.prototype.time_event;\nMixpanelLib.prototype['track'] = MixpanelLib.prototype.track;\nMixpanelLib.prototype['track_links'] = MixpanelLib.prototype.track_links;\nMixpanelLib.prototype['track_forms'] = MixpanelLib.prototype.track_forms;\nMixpanelLib.prototype['track_pageview'] = MixpanelLib.prototype.track_pageview;\nMixpanelLib.prototype['register'] = MixpanelLib.prototype.register;\nMixpanelLib.prototype['register_once'] = MixpanelLib.prototype.register_once;\nMixpanelLib.prototype['unregister'] = MixpanelLib.prototype.unregister;\nMixpanelLib.prototype['identify'] = MixpanelLib.prototype.identify;\nMixpanelLib.prototype['alias'] = MixpanelLib.prototype.alias;\nMixpanelLib.prototype['name_tag'] = MixpanelLib.prototype.name_tag;\nMixpanelLib.prototype['set_config'] = MixpanelLib.prototype.set_config;\nMixpanelLib.prototype['get_config'] = MixpanelLib.prototype.get_config;\nMixpanelLib.prototype['get_property'] = MixpanelLib.prototype.get_property;\nMixpanelLib.prototype['get_distinct_id'] = MixpanelLib.prototype.get_distinct_id;\nMixpanelLib.prototype['toString'] = MixpanelLib.prototype.toString;\nMixpanelLib.prototype['opt_out_tracking'] = MixpanelLib.prototype.opt_out_tracking;\nMixpanelLib.prototype['opt_in_tracking'] = MixpanelLib.prototype.opt_in_tracking;\nMixpanelLib.prototype['has_opted_out_tracking'] = MixpanelLib.prototype.has_opted_out_tracking;\nMixpanelLib.prototype['has_opted_in_tracking'] = MixpanelLib.prototype.has_opted_in_tracking;\nMixpanelLib.prototype['clear_opt_in_out_tracking'] = MixpanelLib.prototype.clear_opt_in_out_tracking;\nMixpanelLib.prototype['get_group'] = MixpanelLib.prototype.get_group;\nMixpanelLib.prototype['set_group'] = MixpanelLib.prototype.set_group;\nMixpanelLib.prototype['add_group'] = MixpanelLib.prototype.add_group;\nMixpanelLib.prototype['remove_group'] = MixpanelLib.prototype.remove_group;\nMixpanelLib.prototype['track_with_groups'] = MixpanelLib.prototype.track_with_groups;\nMixpanelLib.prototype['start_batch_senders'] = MixpanelLib.prototype.start_batch_senders;\nMixpanelLib.prototype['stop_batch_senders'] = MixpanelLib.prototype.stop_batch_senders;\n\n// MixpanelPersistence Exports\nMixpanelPersistence.prototype['properties'] = MixpanelPersistence.prototype.properties;\nMixpanelPersistence.prototype['update_search_keyword'] = MixpanelPersistence.prototype.update_search_keyword;\nMixpanelPersistence.prototype['update_referrer_info'] = MixpanelPersistence.prototype.update_referrer_info;\nMixpanelPersistence.prototype['get_cross_subdomain'] = MixpanelPersistence.prototype.get_cross_subdomain;\nMixpanelPersistence.prototype['clear'] = MixpanelPersistence.prototype.clear;\n\n\nvar instances = {};\nvar extend_mp = function() {\n // add all the sub mixpanel instances\n _.each(instances, function(instance, name) {\n if (name !== PRIMARY_INSTANCE_NAME) { mixpanel_master[name] = instance; }\n });\n\n // add private functions as _\n mixpanel_master['_'] = _;\n};\n\nvar override_mp_init_func = function() {\n // we override the snippets init function to handle the case where a\n // user initializes the mixpanel library after the script loads & runs\n mixpanel_master['init'] = function(token, config, name) {\n if (name) {\n // initialize a sub library\n if (!mixpanel_master[name]) {\n mixpanel_master[name] = instances[name] = create_mplib(token, config, name);\n mixpanel_master[name]._loaded();\n }\n return mixpanel_master[name];\n } else {\n var instance = mixpanel_master;\n\n if (instances[PRIMARY_INSTANCE_NAME]) {\n // main mixpanel lib already initialized\n instance = instances[PRIMARY_INSTANCE_NAME];\n } else if (token) {\n // intialize the main mixpanel lib\n instance = create_mplib(token, config, PRIMARY_INSTANCE_NAME);\n instance._loaded();\n instances[PRIMARY_INSTANCE_NAME] = instance;\n }\n\n mixpanel_master = instance;\n if (init_type === INIT_SNIPPET) {\n window$1[PRIMARY_INSTANCE_NAME] = mixpanel_master;\n }\n extend_mp();\n }\n };\n};\n\nvar add_dom_loaded_handler = function() {\n // Cross browser DOM Loaded support\n function dom_loaded_handler() {\n // function flag since we only want to execute this once\n if (dom_loaded_handler.done) { return; }\n dom_loaded_handler.done = true;\n\n DOM_LOADED = true;\n ENQUEUE_REQUESTS = false;\n\n _.each(instances, function(inst) {\n inst._dom_loaded();\n });\n }\n\n function do_scroll_check() {\n try {\n document$1.documentElement.doScroll('left');\n } catch(e) {\n setTimeout(do_scroll_check, 1);\n return;\n }\n\n dom_loaded_handler();\n }\n\n if (document$1.addEventListener) {\n if (document$1.readyState === 'complete') {\n // safari 4 can fire the DOMContentLoaded event before loading all\n // external JS (including this file). you will see some copypasta\n // on the internet that checks for 'complete' and 'loaded', but\n // 'loaded' is an IE thing\n dom_loaded_handler();\n } else {\n document$1.addEventListener('DOMContentLoaded', dom_loaded_handler, false);\n }\n } else if (document$1.attachEvent) {\n // IE\n document$1.attachEvent('onreadystatechange', dom_loaded_handler);\n\n // check to make sure we arn't in a frame\n var toplevel = false;\n try {\n toplevel = window$1.frameElement === null;\n } catch(e) {\n // noop\n }\n\n if (document$1.documentElement.doScroll && toplevel) {\n do_scroll_check();\n }\n }\n\n // fallback handler, always will work\n _.register_event(window$1, 'load', dom_loaded_handler, true);\n};\n\nfunction init_as_module() {\n init_type = INIT_MODULE;\n mixpanel_master = new MixpanelLib();\n\n override_mp_init_func();\n mixpanel_master['init']();\n add_dom_loaded_handler();\n\n return mixpanel_master;\n}\n\nvar mixpanel = init_as_module();\n\nmodule.exports = mixpanel;","module.exports = jQuery;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import '../scss/app.scss';\n\n/**\n * Admin modules\n */\n\nconst WP_Smush = WP_Smush || {};\nwindow.WP_Smush = WP_Smush;\n\n/**\n * IE polyfill for includes.\n *\n * @since 3.1.0\n * @param {string} search\n * @param {number} start\n * @return {boolean} Returns true if searchString appears as a substring of the result of converting this\n * object to a String, at one or more positions that are\n * greater than or equal to position; otherwise, returns false.\n */\nif ( ! String.prototype.includes ) {\n\tString.prototype.includes = function( search, start ) {\n\t\tif ( typeof start !== 'number' ) {\n\t\t\tstart = 0;\n\t\t}\n\n\t\tif ( start + search.length > this.length ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.indexOf( search, start ) !== -1;\n\t};\n}\n\nrequire( './modules/helpers' );\nrequire( './modules/admin' );\nrequire( './modules/admin-common' );\nrequire( './modules/bulk-smush' );\nrequire( './modules/nextgen-bulk' );\nrequire( './modules/background-process' );\nrequire( './common/media-library-scanner' );\nrequire( './modules/media-library-scanner-on-bulk-smush' );\nrequire( './modules/media-library-scanner-on-dashboard' );\nrequire( './modules/onboarding' );\nrequire( './modules/directory-smush' );\nrequire( './smush/cdn' );\nrequire( './smush/webp' );\nrequire( './smush/lazy-load' );\nrequire( './modules/bulk-restore' );\nrequire( './smush/settings' );\nrequire( './smush/product-analytics' );\n\n/**\n * Notice scripts.\n *\n * Notices are used in the following functions:\n *\n * @used-by \\Smush\\Core\\Modules\\Smush::smush_updated()\n * @used-by \\Smush\\Core\\Integrations\\S3::3_support_required_notice()\n * @used-by \\Smush\\App\\Abstract_Page::installation_notice()\n *\n * TODO: should this be moved out in a separate file like common.scss?\n */\nrequire( './modules/notice' );\n"],"names":["UpsellManger","maybeShowCDNActivationNotice","wp_smush_msgs","smush_cdn_activation_notice","WP_Smush","helpers","renderActivationCDNNotice","maybeShowCDNUpsellForPreSiteOnStart","upsellCdn","document","querySelector","innerHTML","processing_cdn_for_free","classList","remove","maybeShowCDNUpsellForPreSiteOnCompleted","processed_cdn_for_free","GlobalStats","$","bind","summarySmush","boStats","window","wp_smushit_data","bo_stats","globalStats","count_images","count_total","count_resize","count_skipped","count_smushed","savings_bytes","savings_resize","size_after","size_before","savings_percent","percent_grade","percent_metric","percent_optimized","remaining_count","human_bytes","savings_conversion_human","savings_conversion","imageScore","logBulk","bulkSmushCountContent","allErrors","generateGlobalStatsFromSmushData","smushScriptData","Object","assign","keys","reduce","newStats","key","isChangedStats","newBoStats","some","setBoStats","this","getBoStats","setGlobalStats","newGlobalStats","getGlobalStats","renderScoreProgress","className","replace","add","dataset","score","setAttribute","renderSummaryDetail","renderTotalStats","renderResizedStats","renderConversionSavings","resizeCountElement","conversionSavingsElement","parentElement","renderBoxSummary","setErrors","newErrors","getErrors","renderErrors","length","is_completed","errors","errorKeys","showAnimatedUpsell","map","image_id","index","upsellErrorCode","error_code","push","prepareBulkSmushErrorRow","error_message","file_name","thumbnail","join","style","display","resetAndHideBulkErrors","resetErrors","renderStats","maybeUpdateBulkSmushCountContent","newContent","updateGlobalStatsFromSmushScriptData","content","__","wp","i18n","MediaLibraryScanner","_classCallCheck","autoSyncDuration","progressTimeoutId","scanProgress","scanProgressBar","value","_this","optimizeOnScanCompleted","arguments","undefined","onStart","Fetcher","scanMediaLibrary","start","then","response","success","showProgressBar","autoSyncStatus","onStartFailure","showNotice","showdismiss","autoclose","onShowProgressBar","reset","setOnCancelCallback","showStopScanningModal","open","SUI","onShowStopScanningModal","openModal","registerCancelProcessEvent","stopScanButton","addEventListener","cancelProgress","stopScanningElement","contains","closeModal","onCloseProgressBar","close","stats","totalItems","getTotalItems","processedItems","getProcessedItems","update","processed_items","total_items","_this2","setCancelButtonOnCancelling","cancel","onCancelled","data","onCancelFailure","resetCancelButtonOnFailure","clearProgressTimeout","closeProgressBar","closeStopScanningModal","showRetryScanModal","retryScanModalElement","getElementById","onclick","e","recheckImagesBtn","preventDefault","click","onFinish","global_stats","updateGlobalStatsAndBulkContent","clearTimeout","getScanStatus","_this3","startTime","Date","getTime","getStatus","is_dead","onDead","beforeUpdateStatus","updateProgress","increaseDurationToHaveChangeOnProgress","onCompleted","is_cancelled","setTimeout","element","newText","originalText","innerText","trim","_window$wp_smushit_da","_wp$i18n","_n","percentElement","progressElement","remainingTimeElement","cancelBtn","holdOnNoticeElement","onCancelCallback","intervalProgressAnimation","progressTransitionDuration","setProperty","prevProcessedItems","media_library_scan","cacheProcessTimePerItem","durationToHaveChangeOnProgress","timeLimitToShowNotice","updateRemainingTime","width","Math","floor","min","currentWidth","animateProgressBar","clearInterval","Promise","resolve","setInterval","remainingTime","calcProcessTimePerItem","formatTime","processTimePerItem","resetDurationToHaveChangeOnProgress","accumulator","processTime","increaseTime","showHoldOnNotice","resetHoldOnNoticeVisibility","totalMilliSeconds","totalSeconds","seconds","minutes","timeString","resetCancelButton","callBack","setCancelButtonLabel","textContent","cancelling","resetCancelButtonLabel","removeAttribute","progressBar","isEmptyObject","bulkSmushDescription","bulkRunningNotice","bulkSmushAllDone","isStateHidden","processStateStats","firstElementChild","lastElementChild","resetOriginalNotice","show","hideBulkSmushDescription","hideBulkSmushAllDone","hideRecheckImagesNotice","showBulkSmushDescription","showBulkSmushAllDone","hideState","showState","setNotice","inProcessNotice","progressMessage","cacheOriginalNotice","hideBulkProcessingNotice","showBulkProcessingNotice","setCountUnitText","unitText","disableExceedLimitMode","recheckImagesNoticeElement","instance","MixPanel","mixpanelInstance","allowToTrack","mixpanel","wp_smush_mixpanel","token","opt_out_tracking_by_default","loaded","identify","unique_id","register","super_properties","has_opted_in_tracking","clear_opt_in_out_tracking","opt_in","event","properties","debug","console","log","track","convertToMegabytes","parseFloat","sizeInBytes","sizeInMegabytes","pow","toFixed","getInstance","jQuery","on","prop","slide_symbol","find","parents","eq","slideToggle","text","remove_element","el","timeout","fadeTo","slideUp","process_smush_action","currentButton","smushAction","action","attr","hide","mode","location","search","indexOf","params","attachment_id","_nonce","c_element","parent","css","opacity","disable_links","oldLabel","html","post","ajaxurl","r","enable_links","wrapper","failed_item_smushed","hasClass","Smush","updateImageStats","new_size","error_msg","closest","addClass","append","showRecheckImagesNotice","notice","type","noticeType","openNotice","icon","updateBulkSmushContentAfterReCheck","SmushProgress","goToByScroll","selector","animate","scrollTop","offset","top","currentTarget","val","reload","self","id","_ajax_nonce","done","current_button","process_settings","button","scan_type","removeAttr","get_ui","wp_smush_options_nonce","get","always","removeClass","$defaultText","$completedText","runRecheck","$el","container","parseInt","resmush","count_supersmushed","smush_percent","precise_round","progress_bar","res","savings_dir_smush","orig_size","image_size","unsmushed","updateStats","hash","scrollTo","substring","focus","target","trigger","keypress","keyCode","wrapper_div","width_only","height_only","resize_checkbox","width_input","width_error_note","height_input","height_error_note","width_error","height_error","is","resize_sizes","height","validate_resize_settings","settings_wrap","nonce","membership_valid","membership_invalid","stats_param","message","dir_smush","ajax_error","stats_human","stats_percent","bytes","human","percent","combined_stats","c_stats","smushed","total_count","savings","update_cummulative_stats","prepend","toggleClass","compressionLevelNotice","compressionNoticeContent","_e$target","_e$target$dataset","nodeName","note","handleCompressionLevelNotice","href","openNewTab","_e$detail","detail","is_outdated_stats","lossyLevelSummaryBox","currentLossyLevelTab","upsellLink","nextElementSibling","includes","updateLossyLevelInSummaryBox","BackgroundProcess","handle","background","initState","BackgroundSmush","startBtn","mixPanel","BO","bulkWrapper","reScanImagesButton","intervalHandle","cancellationInProgress","hookStatusChecks","count","statusSyncInProgress","statSyncInProgress","statusSynced","syncBackgroundStatus","syncStats","finally","resetBOStatsOnStart","failed_items","updatedStats","cancelBulk","in_processing","_this4","setCancelButtonStateToStarted","hideProgressBar","updateGlobal","_objectWithoutProperties","_excluded","_this5","onCompletedBulk","trackBulkSmushCancel","showCompletedMessage","processedWrapper","completeMessage","all_failed","isFailedAllItems","error_in_bulk","getNoticeType","noticeIcon","iconElement","all_smushed","completeBulk","_this6","_this7","onComplete","responseErrors","catch","error","_this8","in_process_notice","setCancelButtonStateToInitial","init","_this9","restore","modal","contentContainer","settings","slide","items","currentStep","totalSteps","resetModalWidth","renderTemplate","onboarding","template","bindSubmit","maxWidth","confirmButton","initScan","updateProgressBar","progress","round","statusDiv","xhr","XMLHttpRequest","setRequestHeader","onload","status","JSON","parse","step","send","item","pop","src","thumb","link","total","_","memoize","compiled","options","evaluate","interpolate","escape","variable","templateSettings","bulk","onClickBulkSmushNow","onClickIgnoreImage","onClickIgnoreAllImages","onScanCompleted","bulkSmushButton","ajaxBulkSmushStart","bulkSmush","resumeBulkSmush","SmushProcess","cancelAjax","ids","run","callAjax","ignoreAll","cursor","smush","upsell_cdn","failedItems","skippedItems","obj","scan","remainingSteps","fail","showScanError","getProgress","onFinishStep","progress_smushed","directory","directory_url","dialog","concat","statusText","forbiddenMessage","limitReached","bulk_resume","resume","skipped","failed","selected","tree","triggered","progressDialog","currentScanStep","scanner","Scanner","initFileTree","off","selectedFolders","getSelectedNodes","paths","forEach","folder","param","smush_path","image_list_nonce","showProgressDialog","queryString","URLSearchParams","has","smushButton","ajaxSettings","url","list_nonce","cache","entries","createTree","autoCollapse","clickFolderMode","checkbox","debugLevel","selectMode","tabindex","keyboard","quicksearch","source","lazyLoad","result","reject","dir","node","ajax","loadChildren","fixSelection3AfterClick","select","cacheUpsellErrorCodes","formatBytes","a","b","thresh","units","abs","u","getSizeFromString","formattedSize","getFormatFromString","num","decimals","sign","showErrorNotice","noticeMessage","loadingButton","resetSettings","smush_url","errorMsg","fileName","errorCode","thumbDiv","editLink","edit_link","tableDiv","error_ignore","btn_ignore","view_detail","upsellWithError","cacheUpsellErrorCode","isUpsellRendered","cacheRenderedUpsell","getErrorMessage","resp","responseJSON","generic_ajax_error","noticeOptions","_typeof","dismiss","label","noticeDismiss","tooltip","noticeDismissTooltip","closeNotice","upsellHtml","outerHTML","mediaLibScanner","_MediaLibraryScanner","_inherits","MediaLibraryScannerOnBulkSmush","_super","_createSuper","call","runBulkSmushOnComplete","restoreButton","autoBulkSmushNotification","startScan","hideRecheckNotice","disableRelatedButtons","setRecheckImagesButtonOnLoad","toggleBulkSmushBoxContent","_get","_getPrototypeOf","prototype","revertRelatedButtons","maybeHideAutoBulkSmushNotification","setInnerText","revertInnerText","revertRecheckImagesButton","disableRecheckImagesButton","optimize_on_scan_completed","maybeShowAutoBulkSmushNotification","setRequiredScanForBulkSmushButton","toggleBulkSmushDescription","is_outdated","removeScanEventFromBulkSmushButton","revertRecheckWarning","triggerBulkSmushEvent","showRecheckNoticeSuccess","recheckNotice","showAnElement","hideAnElement","recheckWarningElement","getErrorProgressMessage","showRecheckNoticeWarning","enabled_background_process","triggerBackgroundBulkSmushEvent","triggerAjaxBulkSmushEvent","dispatchEvent","CustomEvent","cleanedURL","history","pushState","registerScanMediaLibraryEvent","recheckImagesNotice","_window$wp_smushit_da2","triggerBackgroundScanImagesLink","showProgressErrorNoticeOnRecheckNotice","triggerBulkSmush","dismissNotices","querySelectorAll","dismissNotice","registerEventsRelatedRecheckImagesNotice","startScanThenBulkSmushOnComplete","registerScanAndBulkSmushEvent","mediaLibraryScannerOnDashboard","bulkSmushLink","disableBulkSmushLink","revertBulkSmushLink","s3alert","removeNotice","$notice","membership","onboardingModal","first_slide","first","last","selection","usage","auto","lossy","strip_exif","original","lazy_load","onboardingSlides","touchX","touchY","recheckImagesLink","ctaUrl","tracking","skipButton","skipSetup","handleTouchStart","firstTouch","touches","clientX","clientY","handleTouchMove","xUp","yUp","xDiff","yDiff","next","directionClass","input","checked","submitButton","onFinishingSetup","stringify","startRecheckImages","whereTo","newIndex","goTo","onSkipSetup","hideUpgradeModal","redirectUrl","CDN","cdnEnableButton","cdnDisableButton","cdnStatsBox","toggle_cdn","updateStatsBox","enable","nonceField","getElementsByName","toggleElements","spinner","elements","i","toggle","Lazyload","lazyloadEnableButton","lazyloadDisableButton","toggle_lazy_load","removeSpinner","removeLoaderIcon","removePlaceholder","handlePredefinedPlaceholders","pl1","changeColor","pl2","color","backgroundColor","addLoaderIcon","frame","media","title","multiple","attachment","state","toJSON","imageIcon","backgroundImage","removeDiv","filename","ProductAnalytics","trackUltraLinks","ultraUpsellLinks","getLocation","ultraLink","getCurrentPageSlug","pageSlug","saveSettings","page","msg","showSuccessNotice","settingsUpdated","serialize","otherClass","parentNode","noticeDiv","warningDiv","perf","skip_resmush","is_bulk","setIds","is_bulk_resmush","prev","smush_type","single_ajax_suffix","bulk_ajax_suffix","get_stats_action","smushAddParams","bindDeferredEvents","filter","itm","bulkStart","singleStart","smushing","request","membershipValidity","all_done","html_stats","smush_vars","strings","stats_label","enableButton","messageHolder","sync_stats","hideBulkFreeLimitReachedNotice","_updateProgress","removeProp","bulkErrors","firstAnimatedError","Array","slice","childNodes","showAnimatedUpsellNotice","unlimitedUpsellNotice","bulkErrorActionsElement","showBulkFreeLimitReachedNotice","bulkFreeLimitReachedNotice","_res","updateLocalizedStats","continueSmush","deferred","Deferred","newBulkSmushStarted","performance","now","freeExceeded","nonceValue","current_id","shift","updateSmushIds","unshift","updateScoreProgress","onBulkSmushCompleted","singleDone","continue","maybeShowUnlimitedUpsellNotice","maybeShowBulkErrorActions","callback","trackBulkSmushCompleted","totalImages","totalImagesToSmush","bulkDone","abort","memberValidityNotice","show_warning","isBulkResmush","sendUrl","new_bulk_smush_started","dataType","imagesToResmush","unsmushedCount","grade","percentOptimized","percentMetric","getTotalImagesToSmush","match","scanType","isNextgen","statsHuman","isNaN","smushedCountDiv","smushConversionSavings","conversionSavings","newSize","attachmentSize","contents","nodeType","sizeStrongEl","imageStats","is_lossy","currentId","uIndex","splice","WebP","toggleModuleButton","recheckStatusButton","recheckStatusLink","showWizardButton","maybeShowDeleteAllSuccessNotice","toggleWebp","recheckStatus","deleteAll","toggleWizard","doEnable","runScan","localWebpURL","isConfigured","webp_nonce","SmushAjax","args","method","FormData","contentType","processData","methods","getStats","common","dismissId","hideModal","modalID","modal_id","ui","fancytree","FT","TEST_IMG","RegExp","REX_HTML","REX_TOOLTIP","RECURSIVE_REQUEST_ERROR","INVALID_REQUEST_TARGET_ERROR","ENTITY_MAP","IGNORE_KEYCODES","SPECIAL_KEYCODES","MODIFIERS","MOUSE_BUTTONS","CLASS_ATTRS","split","CLASS_ATTR_MAP","TREE_ATTRS","NODE_ATTRS","NODE_ATTR_MAP","NODE_ATTR_LOWERCASE_MAP","NONE_NODE_DATA_MAP","active","children","toLowerCase","_isArray","isArray","_assert","FancytreeNode","_findDirectChild","ptr","l","cl","_setChildren","_callHook","addChildren","insertBefore","pos","origFirstChild","getFirstChild","origLastChild","getLastChild","firstNode","nodeList","isPlainObject","inArray","apply","render","renderStatus","ul","tr","fixSelection3FromEndNodes","triggerModifyChild","addNode","getParent","getNextSibling","addPagingNode","n","extend","moreData","statusNodeType","partload","removeChild","appendSibling","applyCommand","cmd","opts","applyPatch","patch","_getResolvedPromise","name","v","IGNORE_MAP","expanded","_hasProp","_isFunction","removeChildren","isVisible","renderTitle","setExpanded","collapseSiblings","copyTo","toDict","countChildren","deep","toString","consoleApply","discard","warn","resetLazy","discardMarkup","includeSelf","fn","findAll","_makeNodeTitleMatcher","visit","findFirst","findRelatedNode","where","includeHidden","_changeSelectStatusAttrs","changed","unselectable","evalOption","unselectableStatus","partsel","callOpts","flag","isSelected","radiogroup","_walk","child","s","allSelected","someSelected","unselState","lazy","visitParents","fromDict","dict","getChildren","hasChildren","getIndex","getIndexHier","separator","digits","each","getParentList","o","substr","getKeyPath","excludeSelf","sep","keyPathSeparator","getPath","getLevel","level","dtn","ac","includeRoot","part","path","isFunc","getPrevSibling","stopOnParents","isStatusNode","extraClasses","hasFocus","focusNode","info","isActive","activeNode","isBelowOf","otherNode","isChildOf","isDescendantOf","p","isExpanded","isFirstSibling","isFolder","isLastSibling","isLazy","isLoaded","isLoading","_isLoading","isRoot","isRootNode","isPartsel","isPartload","rootNode","isPagingNode","isTopLevel","isUndefined","hasFilter","enableFilter","subMatchCount","load","forceReload","wasExpanded","_triggerNodeEvent","makeVisible","deferreds","dfd","len","effects","noAnimation","scroll","scrollIntoView","when","promise","moveTo","targetNode","prevParent","targetParent","navigate","activate","KC","LEFT","RIGHT","setFocus","setActive","childNode","force","replaceWith","scheduleAction","ms","timer","_isNode","Error","duration","queue","scrollOfs","scrollParent","topNode","$scrollParent","$container","overflowY","jquery","tbody","body","topNodeY","nodeY","containerOffsetTop","nodeHeight","span","topOfs","bottomOfs","bottom","containerHeight","$animateTarget","isParentWindow","newScrollTop","max","innerHeight","clientHeight","resolveWith","complete","stop","setSelected","setStatus","details","setTitle","triggerModify","sortChildren","cmp","x","y","sort","recursive","rnotwhite","classNames","wasAdded","statusElem","statusClassPropName","curClasses","_trim","toggleExpanded","toggleSelected","operation","extra","modifyChild","visitAndLoad","_recursion","loaders","visitSiblings","Fancytree","_makeHookContext","originalEvent","ctx","widget","typeInfo","types","funcName","contextObject","_extraArgs","_setExpiringValue","_tempCache","expire","_getExpiringValue","entry","_usesExtension","extensions","_requireExtension","required","before","thisName","_local","extList","isBefore","isMissing","ext","badOrder","activateKey","getNodeByKey","opts_","refNode","getActiveNode","editCreateNode","editStart","patchList","p2","patchCount","deferredList","_makeResolveFunc","clear","destroy","disable","enableUpdate","_enableUpdate","expandAll","findNextNode","startNode","_checkNode","_makeNodeTitleStartMatcher","visitRows","BACKSPACE","HOME","END","UP","reverse","DOWN","generateFormElements","selectedName","_id","activeName","$result","_appender","empty","insertAfter","idx","getFocusNode","getOption","optionName","option","searchRoot","idPrefix","ftnode","getRootNode","_hasFocus","_requestId","loadKeyPath","keyPathList","optsOrCallback","pathSegList","notifyWith","matchKey","charAt","_loadKeyPathImpl","nodeKey","remain","remainMap","tmpParent","segList","subDfd","__findChild","__lazyload","errMsg","rejectWith","reactivate","noFocus","selectAll","setOption","debugTime","time","debugTimeEnd","timeEnd","_trigger","_triggerTreeEvent","_visitRowsUp","nextIdx","siblings","siblingOfs","skipFirstNode","checkFilter","nodeClick","expand","targetType","focusOnSelect","nodeSetFocus","nodeCollapseSiblings","nodeDblclick","nodeKeydown","matchNode","stamp","which","String","fromCharCode","specialModifiers","altKey","ctrlKey","metaKey","isAlnum","$target","handled","autoActivate","lastQuicksearchTime","lastQuicksearchTerm","eventToString","nodeSetExpanded","nodeToggleSelected","nodeSetActive","nodeLoadChildren","delay","resultDfd","ajaxDfd","isAsync","nodePrevParent","tag","requestId","debugDelay","random","nodeSetStatus","textStatus","jqXHR","errorObj","postProcess","enableAspx","d","parseJSON","errorThrown","metaData","noDataRes","nodata","noData","ctxErr","nodeLoadKeyPath","nodeRemoveChild","subCtx","nodeRemoveChildren","nodeRemoveMarkup","nodeRemoveChildMarkup","li","nodeRenderStatus","nodeRender","collapsed","_recursive","childLI","childNode1","childNode2","aria","firstTime","successorLi","nextSibling","createElement","generateIds","appendChild","nodeRenderTitle","createNode","renderNode","$div","firstChild","nodeTitle","role","iconTooltip","ares","minExpandLevel","iconClass","_escapeTooltip","test","imagePath","escapeHtml","titlesTabbable","escapeTitles","enhanceTitle","$title","$ariaElem","isLastSib","cn","_classNames","cnList","focused","Boolean","lastsib","loading","_error","statusNodePrefix","combinedExpanderPrefix","combinedIconPrefix","noEvents","_getRejectedPromise","activeVisible","_afterLoad","prevAC","animating","lastChild","autoScroll","effect","toggleEffect","ctx2","isInput","calledByNode","uniqueId","activeElement","nodeSetSelected","_lastSelectIntent","lastSelectedNode","_clearStatusNode","_setStatusNode","loadError","nodeToggleExpanded","treeClear","treeCreate","treeDestroy","$source","treeInit","checkboxAutoHide","rtl","treeLoad","$ul","rootCtx","not","parseHtml","_getElementDataAsDict","treeRegisterNode","treeSetFocus","_lastMousedownNode","treeSetOption","callDefault","callCreate","callRender","Widget","_setOption","treeStructureChanged","copyFunctionsToData","disabled","treeId","radio","_deprecationWarning","_create","extension","extName","base","_extensions","_simpleDeepMerge","_subclassObject","icons","tabbable","_init","_bind","_destroy","_unbind","ns","_ns","getNode","prevPhase","phase","et","getEventTarget","getTree","version","buildType","_nextId","_nextNodeKey","_FancytreeClass","_FancytreeNodeClass","jquerySupports","positionMyOfs","isVersionAtLeast","assert","cond","$tree","debounce","invokeAsap","fixPositionOptions","my","at","myParts","exec","atParts","dx","dy","tcn","getEventTargetType","orgEl","Element","HTMLDocument","nodeObject","treeOptions","defaultValue","treeOpt","nodeOpt","setSpanIcon","baseClass","$span","shiftKey","keyEventToString","overrideMethod","methodName","handler","context","prevSuper","noop","classes","iPos","tmp","tmp2","$children","allData","lowerCaseAttr","$li","$liSpan","$liA","registerExtension","definition","unescapeHtml","nodeValue","object","property","hasOwnProperty","dottedVersion","major","minor","t","verParts","testParts","copy","clone","_makeVirtualFunction","prevFunc","baseFunc","_superApply","proxy","prevLocal","prevSuperApply","attrName","argArray","json","uiFancytree","reMatch","unselectableIgnore","hideCheckbox","defaultKey","lazyload","loaderror","fx","removeNode","columns","systemFocusElement","viewport","ariaPropName","nodeContainerAttrName","fakeParent","class","appendTo","orig","uuid","widgetUuid","widgetSlice","cleanData","elems","events","elem","_data","triggerHandler","existingConstructor","constructor","basePrototype","proxiedPrototype","namespace","fullName","expr","_createWidget","_proto","_childConstructors","isFunction","returnValue","__super","__superApply","widgetEventPrefix","widgetName","widgetFullName","childPrototype","bridge","inputIndex","inputLength","isMethodCall","methodValue","pushStack","defaultElement","create","eventNamespace","bindings","hoverable","focusable","classesElementLookup","_on","ownerDocument","defaultView","parentWindow","_getCreateOptions","_setOptionDisabled","_getCreateEventData","that","_removeClass","removeData","parts","curOption","_setOptions","_setOptionClasses","classKey","currentElements","_classes","_toggleClass","full","processClassString","checkOption","current","unique","_untrackClassesElement","_addClass","suppressDisabledCheck","handlers","delegateElement","handlerProxy","guid","eventName","_off","_delay","_hoverable","mouseenter","mouseleave","_focusable","focusin","focusout","Event","isDefaultPrevented","defaultEffect","hasOptions","effectName","easing","cachedScrollbarWidth","rhorizontal","rvertical","roffset","rposition","rpercent","_position","position","getOffsets","offsets","parseCss","getDimensions","raw","left","isWindow","scrollLeft","pageY","pageX","outerWidth","outerHeight","scrollbarWidth","w1","w2","div","innerDiv","offsetWidth","clientWidth","getScrollInfo","within","overflowX","isDocument","hasOverflowX","scrollWidth","scrollHeight","getWithinInfo","withinElement","of","atOffset","targetWidth","targetHeight","targetOffset","basePosition","dimensions","scrollInfo","collision","horizontalOffset","verticalOffset","collisionPosition","using","elemWidth","elemHeight","marginLeft","marginTop","collisionWidth","collisionHeight","myOffset","props","right","feedback","horizontal","vertical","important","fit","newOverRight","withinOffset","collisionPosLeft","overLeft","overRight","newOverBottom","collisionPosTop","overTop","overBottom","flip","newOverLeft","offsetLeft","newOverTop","offsetTop","flipfit","COMMA","DELETE","ENTER","ESCAPE","PAGE_DOWN","PAGE_UP","PERIOD","SPACE","TAB","excludeStaticParent","overflowRegex","removeUniqueId","Symbol","module","exports","func","thisArg","baseTimes","isArguments","isBuffer","isIndex","isTypedArray","inherited","isArr","isArg","isBuff","isType","skipIndexes","baseAssignValue","objValue","defineProperty","getRawTag","objectToString","symToStringTag","toStringTag","baseGetTag","isObjectLike","isMasked","isObject","toSource","reIsHostCtor","funcProto","Function","objectProto","funcToString","reIsNative","isLength","typedArrayTags","isPrototype","nativeKeys","identity","overRest","setToString","constant","baseSetToString","string","iteratee","assignValue","customizer","isNew","newValue","coreJsData","baseRest","isIterateeCall","assigner","sources","guard","getNative","freeGlobal","g","baseIsNative","getValue","nativeObjectToString","isOwn","unmasked","reIsUint","isArrayLike","uid","maskSrcKey","IE_PROTO","Ctor","overArg","freeExports","freeModule","freeProcess","process","nodeUtil","require","binding","transform","arg","nativeMax","array","otherArgs","freeSelf","root","shortOut","nativeNow","lastCalled","remaining","copyObject","createAssigner","other","baseIsArguments","propertyIsEnumerable","stubFalse","Buffer","baseIsTypedArray","baseUnary","nodeIsTypedArray","arrayLikeKeys","baseKeys","window$1","Config","DEBUG","LIB_VERSION","loc","hostname","navigator","userAgent","referrer","screen","ch","escapee","number","white","T","ArrayProto","FuncProto","ObjProto","windowConsole","document$1","windowOpera","opera","nativeBind","nativeForEach","nativeIndexOf","nativeMap","nativeIsArray","breaker","str","err","toArray","critical","log_func_with_prefix","prefix","console_with_prefix","bound","TypeError","ctor","iterator","f","iterable","values","arr","results","include","found","needle","inherit","subclass","superclass","isString","isDate","isNumber","isElement","encodeDates","k","formatDate","timestamp","pad","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","strip_empty_properties","ret","truncate","JSONEncode","mixed_val","quote","escapable","meta","lastIndex","c","charCodeAt","holder","gap","mind","partial","isFinite","JSONDecode","m","SyntaxError","hex","uffff","word","base64Encode","h1","h2","h3","h4","bits","b64","enc","tmp_arr","utf8Encode","end","stringl","utftext","c1","UUID","ticks","se","ua","buffer","xor","byte_array","j","UA","BLOCKED_UA_STRS","isBlockedUA","HTTPBuildQuery","formdata","arg_separator","use_val","use_key","encodeURIComponent","getQueryParam","decodeURIComponent","cookie","nameEQ","ca","set_seconds","is_cross_subdomain","is_secure","is_cross_site","domain_override","cdomain","expires","secure","domain","extract_domain","date","setTime","toGMTString","set","days","new_cookie_val","_localStorageSupported","localStorageSupported","storage","forceCheck","supported","localStorage","cheap_guid","setItem","getItem","removeItem","is_supported","force_check","register_event","fixEvent","stopPropagation","cancelBubble","oldSchool","useCapture","ontype","old_handler","new_handler","old_handlers","old_result","new_result","makeHandler","TOKEN_MATCH_REGEX","dom_query","getAllChildren","all","getElementsByTagName","bad_whitespace","getElementsBySelector","tagName","foundCount","currentContextIndex","tokens","currentContext","token_match","checkFunction","attrOperator","attrValue","getAttribute","lastIndexOf","query","CAMPAIGN_KEYWORDS","CLICK_IDS","campaignParams","default_value","kw","kwkey","URL","clickParams","idkey","marketingParams","searchEngine","searchInfo","keyword","browser","user_agent","vendor","browserVersion","regex","matches","os","device","referringDomain","people_properties","mpPageViewProperties","pathname","protocol","maxlen","SIMPLE_DOMAIN_MATCH_REGEX","DOMAIN_MATCH_REGEX","domain_regex","tld","JSONStringify","JSONParse","DomTracker","create_properties","event_handler","after_track_handler","mixpanel_instance","mp","event_name","user_callback","override_event","get_config","track_callback","timeout_occured","callback_fired","LinkTracker","evt","new_tab","FormTracker","submit","logger$2","SharedLock","storageKey","pollIntervalMS","timeoutMS","withLock","lockedCB","errorCB","pid","keyX","keyY","keyZ","reportError","cb","loop","waitFor","predicate","getSetY","valY","criticalSection","logger$1","RequestQueue","errorReporter","lock","memQueue","enqueue","flushInterval","queueEntry","succeeded","storedQueue","readFromStorage","saveToStorage","fillBatch","batchSize","batch","idsInBatch","orphaned","filterOutIDsAndInvalid","idSet","filteredItems","removeItemsByID","removeFromStorage","updatePayloads","existingItems","itemsToUpdate","newItems","newPayload","storageEntry","logger","RequestBatcher","libConfig","sendRequest","sendRequestFunc","beforeSendHook","stopAllBatching","stopAllBatchingFunc","stopped","consecutiveRemovalFailures","itemIdsSentSuccessfully","flush","timeoutID","resetBatchSize","resetFlush","scheduleFlush","flushMS","requestInProgress","currentBatchSize","dataForRequest","transformedItems","payload","addPayload","itemId","timesSent","batchSendCallback","removeItemsFromQueue","unloading","xhr_req","retryMS","headers","retryAfter","halvedBatchSize","requestOptions","verbose","ignore_json_errors","timeout_ms","transport","GDPR_DEFAULT_PERSISTENCE_PREFIX","optIn","_optInOut","optOut","hasOptedIn","_getStorageValue","hasOptedOut","ignoreDnt","win","nav","hasDntOn","dntValue","_hasDoNotTrackFlagOn","optedOut","addOptOutCheckMixpanelLib","_addOptOutCheck","addOptOutCheckMixpanelPeople","_get_config","addOptOutCheckMixpanelGroup","clearOptInOut","_getStorage","_getStorageKey","crossSubdomainCookie","cookieDomain","persistenceType","persistencePrefix","optValue","cookieExpiration","secureCookie","crossSiteCookie","trackEventName","trackProperties","getConfigValue","SET_ACTION","SET_ONCE_ACTION","UNSET_ACTION","ADD_ACTION","APPEND_ACTION","UNION_ACTION","REMOVE_ACTION","apiActions","set_action","to","$set","_is_reserved_property","unset_action","$unset","set_once_action","$set_once","union_action","list_name","$union","append_action","$append","remove_action","$remove","delete_action","MixpanelGroup","group_key","group_id","_mixpanel","_group_key","_group_id","_send_request","set_once","unset","union","date_encoded_data","_track_or_batch","endpoint","batcher","request_batchers","groups","conf","MixpanelPeople","update_referrer_info","get_referrer_info","increment","by","$add","track_charge","amount","clear_charges","delete_user","_identify_called","get_distinct_id","device_id","get_property","user_id","had_persisted_distinct_id","people","_enqueue","conf_var","_flags","identify_called","_add_to_people_queue","_flush_one_queue","action_method","queue_to_params_fn","queued_data","_get_queue","action_params","_pop_from_people_queue","_flush","_set_callback","_add_callback","_append_callback","_set_once_callback","_union_callback","_unset_callback","_remove_callback","$append_queue","$remove_queue","$append_item","append_callback","save","$remove_item","remove_callback","init_type","mixpanel_master","SET_QUEUE_KEY","SET_ONCE_QUEUE_KEY","UNSET_QUEUE_KEY","ADD_QUEUE_KEY","APPEND_QUEUE_KEY","REMOVE_QUEUE_KEY","UNION_QUEUE_KEY","PEOPLE_DISTINCT_ID_KEY","ALIAS_ID_KEY","EVENT_TIMERS_KEY","RESERVED_PROPERTIES","MixpanelPersistence","config","campaign_params_saved","storage_type","update_config","upgrade","old_cookie_name","old_cookie","upgrade_from_old_lib","register_once","expire_days","cross_subdomain","cross_site","cookie_domain","default_expiry","unregister","update_search_keyword","safe_merge","set_disabled","set_cookie_domain","set_cross_site","set_cross_subdomain","set_secure","get_cross_subdomain","q_key","_get_queue_key","q_data","set_q","_get_or_create_queue","set_once_q","unset_q","add_q","union_q","remove_q","append_q","enqueued_obj","append_obj","q","queued_action","default_val","set_event_timer","timers","remove_event_timer","IDENTITY_FUNC","NOOP_FUNC","PRIMARY_INSTANCE_NAME","PAYLOAD_TYPE_BASE64","DEVICE_ID_PREFIX","USE_XHR","ENQUEUE_REQUESTS","sendBeacon","DEFAULT_CONFIG","DOM_LOADED","MixpanelLib","create_mplib","_cached_groups","utm_params","initial_utm_params","has_utm","utm_value","utm_key","_execute_array","report_error","_loaded","variable_features","set_config","__dom_loaded_queue","__request_queue","__disabled_events","_batch_requests","init_batchers","flush_on_unload","ev","unpersisted_superprops","_gdpr_init","track_pageview","_set_default_superprops","persistent","_dom_loaded","_track_dom","has_opted_out_tracking","DomClass","dt","_prepare_callback","jsc","randomized_cb","callback_string","DEFAULT_OPTIONS","body_data","use_post","use_sendBeacon","verbose_mode","lib","img","req","headerValue","headerName","start_time","withCredentials","onreadystatechange","readyState","responseText","Number","script","async","defer","fn_name","alias_calls","other_calls","tracking_calls","execute","calls","caller","are_batchers_initialized","batcher_for","attrs","queue_suffix","_encode_data_for_request","_run_hook","stop_batch_senders","start_batch_senders","disable_all_events","encoded_data","truncated_data","should_send_immediately","send_request_options","request_enqueued_or_initiated","send_request_immediately","skip_hooks","_event_is_disabled","start_timestamp","duration_in_ms","marketing_properties","property_blacklist","blacklisted_prop","set_group","group_ids","add_group","old_values","remove_group","old_value","track_with_groups","tracking_props","_create_map_key","_remove_group_from_cache","get_group","map_key","group","default_page_properties","event_properties","track_links","track_forms","time_event","REGISTER_DEFAULTS","options_for_register","days_or_options","_register_single","new_distinct_id","previous_distinct_id","alias","name_tag","prop_name","hook_name","property_name","opt_in_tracking","opt_out_tracking","_gdpr_update_persistence","_gdpr_call_func","instances","override_mp_init_func","dom_loaded_handler","inst","attachEvent","toplevel","frameElement","documentElement","doScroll","do_scroll_check","add_dom_loaded_handler","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","enumerable","globalThis","nmd"],"sourceRoot":""}