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AAY,CAAC,EAC9BoC,OAAOpC,SAAWA,EAYXgN,OAAO9P,UAAUoL,WACvB0E,OAAO9P,UAAUoL,SAAW,SAAUkJ,EAAQ0W,GAK7C,MAJsB,iBAAVA,IACXA,EAAQ,KAGJA,EAAQ1W,EAAOxT,OAASwD,KAAKxD,UAGQ,IAAnCwD,KAAK0E,QAASsL,EAAQ0W,EAC9B,GAGD2sC,EAAS,KACTA,EAAS,MACTA,EAAS,KACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,KACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MACTA,EAAS,MAaTA,EAAS,K","sources":["webpack://wp-smushit/./_src/js/modules/onboarding.js","webpack://wp-smushit/./node_modules/lodash/isLength.js","webpack://wp-smushit/./node_modules/lodash/isObjectLike.js","webpack://wp-smushit/./node_modules/lodash/_isIndex.js","webpack://wp-smushit/./node_modules/lodash/_getValue.js","webpack://wp-smushit/./_src/js/modules/admin-common.js","webpack://wp-smushit/./node_modules/lodash/_getRawTag.js","webpack://wp-smushit/./node_modules/lodash/_arrayLikeKeys.js","webpack://wp-smushit/./_src/js/modules/helpers.js","webpack://wp-smushit/./node_modules/lodash/_createAssigner.js","webpack://wp-smushit/./node_modules/lodash/_apply.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.ui-deps.js","webpack://wp-smushit/external var \"jQuery\"","webpack://wp-smushit/./node_modules/lodash/_copyObject.js","webpack://wp-smushit/./node_modules/lodash/_shortOut.js","webpack://wp-smushit/./node_modules/lodash/_Symbol.js","webpack://wp-smushit/./node_modules/lodash/isFunction.js","webpack://wp-smushit/./_src/js/modules/media-library-scanner-on-dashboard.js","webpack://wp-smushit/./node_modules/lodash/isArguments.js","webpack://wp-smushit/./node_modules/lodash/_baseGetTag.js","webpack://wp-smushit/./_src/js/smush/avif.js","webpack://wp-smushit/./node_modules/lodash/_setToString.js","webpack://wp-smushit/./_src/js/modules/background-process.js","webpack://wp-smushit/./node_modules/lodash/_defineProperty.js","webpack://wp-smushit/./node_modules/lodash/_baseAssignValue.js","webpack://wp-smushit/./_src/js/smush/product-analytics.js","webpack://wp-smushit/./node_modules/lodash/identity.js","webpack://wp-smushit/./node_modules/lodash/_nativeKeys.js","webpack://wp-smushit/./node_modules/lodash/isBuffer.js","webpack://wp-smushit/./node_modules/lodash/isObject.js","webpack://wp-smushit/./_src/js/modules/admin.js","webpack://wp-smushit/./node_modules/lodash/_overArg.js","webpack://wp-smushit/./_src/js/modules/media-library-scanner-on-bulk-smush.js","webpack://wp-smushit/./_src/js/smush/next-gen.js","webpack://wp-smushit/./node_modules/lodash/_freeGlobal.js","webpack://wp-smushit/./node_modules/lodash/isArrayLike.js","webpack://wp-smushit/./node_modules/lodash/_baseIsTypedArray.js","webpack://wp-smushit/./node_modules/lodash/_baseIsNative.js","webpack://wp-smushit/./node_modules/lodash/eq.js","webpack://wp-smushit/./_src/js/loopback-tester.js","webpack://wp-smushit/./_src/js/common/globalStats.js","webpack://wp-smushit/./node_modules/lodash/_coreJsData.js","webpack://wp-smushit/./node_modules/lodash/_isPrototype.js","webpack://wp-smushit/./_src/js/modules/onboarding-free.js","webpack://wp-smushit/./_src/js/common/media-library-scanner.js","webpack://wp-smushit/./_src/js/smush/webp.js","webpack://wp-smushit/./node_modules/lodash/keys.js","webpack://wp-smushit/./_src/js/modules/directory-smush.js","webpack://wp-smushit/./_src/js/smush/directory-scanner.js","webpack://wp-smushit/./node_modules/jquery.fancytree/dist/modules/jquery.fancytree.js","webpack://wp-smushit/./node_modules/lodash/_nodeUtil.js","webpack://wp-smushit/./node_modules/lodash/_getNative.js","webpack://wp-smushit/./node_modules/lodash/assign.js","webpack://wp-smushit/./node_modules/lodash/isArray.js","webpack://wp-smushit/./node_modules/lodash/_assignValue.js","webpack://wp-smushit/./node_modules/lodash/_overRest.js","webpack://wp-smushit/./node_modules/lodash/_isIterateeCall.js","webpack://wp-smushit/./_src/js/common/progressbar.js","webpack://wp-smushit/./node_modules/lodash/isTypedArray.js","webpack://wp-smushit/./node_modules/lodash/_isMasked.js","webpack://wp-smushit/./node_modules/lodash/_baseUnary.js","webpack://wp-smushit/./node_modules/lodash/constant.js","webpack://wp-smushit/./node_modules/lodash/_toSource.js","webpack://wp-smushit/./node_modules/lodash/_baseIsArguments.js","webpack://wp-smushit/./_src/js/modules/notice.js","webpack://wp-smushit/./_src/js/utils/tracker.js","webpack://wp-smushit/./node_modules/lodash/_baseTimes.js","webpack://wp-smushit/./_src/js/global-tracking.js","webpack://wp-smushit/./_src/js/smush/cdn.js","webpack://wp-smushit/./_src/js/modules/nextgen-bulk.js","webpack://wp-smushit/./_src/js/modules/bulk-smush.js","webpack://wp-smushit/./_src/js/smush/lazy-load.js","webpack://wp-smushit/./_src/js/smush/settings.js","webpack://wp-smushit/./node_modules/lodash/_baseKeys.js","webpack://wp-smushit/./node_modules/lodash/_baseRest.js","webpack://wp-smushit/./node_modules/lodash/_root.js","webpack://wp-smushit/./node_modules/lodash/_objectToString.js","webpack://wp-smushit/./node_modules/lodash/_baseSetToString.js","webpack://wp-smushit/./_src/js/utils/fetcher.js","webpack://wp-smushit/./node_modules/lodash/stubFalse.js","webpack://wp-smushit/./_src/js/modules/bulk-restore.js","webpack://wp-smushit/./_src/js/smush/smush.js","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 */\n/* global ajaxurl */\nimport tracker from \"../utils/tracker\";\nimport GlobalTracking from '../global-tracking';\n\n/**\n * Modals JavaScript code.\n */\n( function() {\n\t'use strict';\n\n\t// Keep loading onboarding script for other dependencies.\n\tif ( document.getElementById( 'smush-onboarding-free' ) ) {\n\t\treturn;\n\t}\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\tpreload_images: true,\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'preload_images',\n\t\t\t'lazy_load',\n\t\t],\n\t\ttouchX: null,\n\t\ttouchY: null,\n\t\trecheckImagesLink: '',\n\t\tproFeaturesClicked: [],\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'original',\n\t\t\t\t\t'lazy_load',\n\t\t\t\t\t'pro_upsell',\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\tthis.skipButton = this.onboardingModal.querySelector(\n\t\t\t\t'.smush-onboarding-skip-link'\n\t\t\t);\n\t\t\tif ( this.skipButton ) {\n\t\t\t\tthis.skipButton.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\tthis.updateCheckboxStates();\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\tthis.toggleSkipButton();\n\t\t\tthis.maybeHandleProFeatureClick();\n\t\t},\n\n\t\tupdateCheckboxStates() {\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\t\t},\n\n\t\ttoggleSkipButton() {\n\t\t\tif ( ! this.skipButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.settings.last ) {\n\t\t\t\tthis.skipButton.classList.add( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tthis.skipButton.classList.remove( 'sui-hidden' );\n\t\t\t}\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', async function( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tsubmitButton.classList.add( 'sui-button-onload-text' );\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\tself.updateCheckboxStates();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait self.trackFinishSetupWizard();\n\t\t\t\t\t} catch ( err ) {\n\t\t\t\t\t\t// Do nothing..\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\tasync skipSetup() {\n\t\t\tconst _nonce = document.getElementById( 'smush_quick_setup_nonce' );\n\t\t\tthis.updateCheckboxStates();\n\n\t\t\t// Track skip setup wizard.\n\t\t\ttry {\n\t\t\t\tawait this.trackSkipSetupWizard();\n\t\t\t} catch ( err ) {\n\t\t\t\t// Do nothing..\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=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\tconst isRedirectRequired = '_blank' !== button?.target;\n\t\t\tif ( isRedirectRequired ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\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\n\t\t\t\tconst actionName = redirectUrl ? 'cta_clicked' : 'closed';\n\t\t\t\ttracker.track( 'update_modal_displayed', {\n\t\t\t\t\tAction: actionName,\n\t\t\t\t} );\n\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tif ( redirectUrl && isRedirectRequired ) {\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\tmaybeHandleProFeatureClick() {\n\t\t\tconst isProUpsellSlide = 'pro_upsell' === this.settings?.slide;\n\t\t\tif ( ! isProUpsellSlide ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.upsellButton = this.onboardingModal.querySelector( '.smush-btn-pro-upsell' );\n\t\t\tconst proFeatureToggleContainer = this.onboardingModal.querySelector( '.sui-field-list' );\n\n\t\t\tif ( proFeatureToggleContainer ) {\n\t\t\t\tproFeatureToggleContainer.addEventListener( 'click', ( event ) => {\n\t\t\t\t\tconst proFeatureClicked = event.target.matches( 'label' ) || event.target.closest( '.sui-toggle' );\n\t\t\t\t\tif ( proFeatureClicked ) {\n\t\t\t\t\t\tconst featureName = event.target.closest( '.sui-field-list-item' ).querySelector( 'input[type=\"checkbox\"]' )?.name;\n\t\t\t\t\t\tthis.handleProFeatureClicked( featureName );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.maybeTrackProUpsell();\n\t\t},\n\t\thandleProFeatureClicked( featureName ) {\n\t\t\tthis.cacheProFeatureClick( featureName );\n\t\t\tthis.highlightUpsellButton();\n\t\t},\n\t\thighlightUpsellButton() {\n\t\t\tif ( ! this.upsellButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.upsellButton.classList.remove( 'smush-btn-ripple' );\n\t\t\tvoid this.upsellButton.offsetWidth; // Trigger a reflow.\n\t\t\tthis.upsellButton.classList.add( 'smush-btn-ripple' );\n\t\t},\n\t\tcacheProFeatureClick( proFeature ) {\n\t\t\tif ( ! this.proFeaturesClicked.includes( proFeature ) ) {\n\t\t\t\tthis.proFeaturesClicked.push( proFeature );\n\t\t\t}\n\t\t},\n\t\ttrackFinishSetupWizard() {\n\t\t\treturn this.trackSetupWizard( 'finish' );\n\t\t},\n\t\ttrackSkipSetupWizard() {\n\t\t\treturn this.trackSetupWizard( 'quit' );\n\t\t},\n\t\ttrackSetupWizard( action ) {\n\t\t\tconst quitWizard = 'quit' === action;\n\t\t\tconst properties = {\n\t\t\t\tAction: quitWizard ? 'quit' : 'finish',\n\t\t\t\t'Quit Step': this.getQuitStep( quitWizard ),\n\t\t\t\t'Settings Enabled': this.getEnabledSettings( quitWizard ),\n\t\t\t\t'Pro Interests': this.getProInterests(),\n\t\t\t};\n\n\t\t\tconst allowToTrack = this.selection?.usage;\n\n\t\t\treturn tracker.setAllowToTrack( allowToTrack ).track( 'Setup Wizard', properties );\n\t\t},\n\t\tgetQuitStep( quitWizard ) {\n\t\t\tif ( ! quitWizard ) {\n\t\t\t\treturn 'na';\n\t\t\t}\n\n\t\t\tconst fieldMapsForTracking = this.getFieldMapsForTracking();\n\t\t\tconst setting = this.settings.slide;\n\n\t\t\treturn setting in fieldMapsForTracking ? fieldMapsForTracking[ setting ] : 'na';\n\t\t},\n\t\tgetEnabledSettings( quitWizard ) {\n\t\t\tif ( quitWizard ) {\n\t\t\t\treturn 'na';\n\t\t\t}\n\n\t\t\tconst fieldMapsForTracking = this.getFieldMapsForTracking();\n\t\t\tconst enabledSettings = [];\n\n\t\t\tObject.entries( this.selection ).forEach( ( [ setting, enabled ] ) => {\n\t\t\t\tif ( enabled ) {\n\t\t\t\t\tconst featureName = setting in fieldMapsForTracking ? fieldMapsForTracking[ setting ] : setting;\n\t\t\t\t\tenabledSettings.push( featureName );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn enabledSettings;\n\t\t},\n\t\tgetProInterests() {\n\t\t\tif ( 'pro' === this.membership || ! this.proFeaturesClicked.length ) {\n\t\t\t\treturn 'na';\n\t\t\t}\n\n\t\t\treturn this.proFeaturesClicked;\n\t\t},\n\t\tgetFieldMapsForTracking() {\n\t\t\treturn {\n\t\t\t\tusage: 'tracking',\n\t\t\t\tauto: 'auto_smush',\n\t\t\t\tlossy: 'free' === this.membership ? 'super_smush' : 'ultra_smush',\n\t\t\t\tstrip_exif: 'strip_exif',\n\t\t\t\toriginal: 'full_size',\n\t\t\t\tlazy_load: 'lazy_load',\n\t\t\t\tpro_upsell: 'upgrade',\n\t\t\t\tpreload_images: 'preload_images',\n\t\t\t};\n\t\t},\n\t\tmaybeTrackProUpsell() {\n\t\t\tif ( ! this.upsellButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.upsellButton.addEventListener( 'click', ( event ) => {\n\t\t\t\tconst allowToTrack = this.selection?.usage;\n\t\t\t\ttracker.setAllowToTrack( allowToTrack );\n\t\t\t\t( new GlobalTracking() ).trackSetupWizardProUpsell( event?.target?.href, this.getProInterests() );\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.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","/** 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 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","/** 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","/**\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","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});","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","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","/* 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\tredirectToPage( page ) {\n\t\t\tpage = `page=smush-${page}`;\n\t\t\tif ( window.location.href.includes( page ) ) {\n\t\t\t\twindow.location.reload();\n\t\t\t} else {\n\t\t\t\twindow.location.search = page;\n\t\t\t}\n\t\t},\n\t\tshowModal( modalId, options = {} ) {\n\t\t\tif ( ! window.SUI ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\toptions = Object.assign( {\n\t\t\t\tfocusAfterClosed: 'wpbody-content',\n\t\t\t\tfocusWhenOpen: undefined,\n\t\t\t\thasOverlayMask: false,\n\t\t\t\tisCloseOnEsc: false,\n\t\t\t\tisAnimated: true,\n\t\t\t}, options );\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\tmodalId,\n\t\t\t\toptions.focusAfterClosed,\n\t\t\t\toptions.focusWhenOpen,\n\t\t\t\toptions.hasOverlayMask,\n\t\t\t\toptions.isCloseOnEsc,\n\t\t\t\toptions.isAnimated\n\t\t\t);\n\t\t}\n\t};\n\n\tWP_Smush.helpers.init();\n}() );\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","/**\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","/*! 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","module.exports = jQuery;","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","/** 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","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\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","/* 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","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","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","import NextGen from './next-gen';\n\n/**\n * Avif Class.\n */\nclass Avif extends NextGen {\n\tconstructor() {\n\t\tsuper( 'avif' );\n\t}\n}\n\n( function() {\n\t'use strict';\n\tnew Avif();\n}() );\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","/* global WP_Smush */\n\n/**\n * Bulk Smush Background Optimization.\n *\n * @since 3.12.0\n */\nimport Fetcher from '../utils/fetcher';\nimport tracker from '../utils/tracker';\nimport SmushProgress from '../common/progressbar';\nimport {GlobalStats, UpsellManger} from \"../common/globalStats\";\nimport loopbackTester from '../loopback-tester';\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 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 loopbackTester.performTest().then( ( res ) => {\n const isLoopbackHealthy = res?.loopback;\n if ( isLoopbackHealthy ) {\n // Start BO.\n this.startBulkSmush();\n } else {\n this.showLoopbackErrorModal();\n this.onStartFailure();\n }\n } ).catch( ( error ) => {\n\t\t\t console.error( 'Error:', error );\n this.showLoopbackErrorModal();\n this.onStartFailure();\n } );\n },\n startBulkSmush() {\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 this.showFailureNotice( res );\n this.onStartFailure( res );\n }\n });\n },\n showFailureNotice( res ) {\n WP_Smush.helpers.showNotice( res, {\n 'showdismiss': true,\n 'autoclose' : false,\n } );\n },\n onStartFailure( res ) {\n this.cancelBulk();\n },\n showLoopbackErrorModal() {\n const loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n if ( ! loopbackErrorModal || ! window.SUI ) {\n return;\n }\n \n // Cache current process type.\n loopbackErrorModal.dataset.processType = 'smush';\n \n WP_Smush.helpers.showModal( loopbackErrorModal.id );\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 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.data || {}).is_process_stuck ) {\n SmushProgress.showHoldOnNotice();\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 } else if ( GlobalStats.getBoStats().is_dead ) {\n this.onDead();\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 this.hideBulkSmushFailedNotice();\n\n\t\t\t\tthis.setCancelButtonStateToInitial();\n },\n hideBulkSmushFailedNotice() {\n const bulkSmushFailedNotice = document.querySelector( '.wp-smush-inline-retry-bulk-smush-notice' );\n if ( bulkSmushFailedNotice ) {\n bulkSmushFailedNotice.parentElement.classList.add( 'sui-hidden' );\n }\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 onDead() {\n this.onFinish();\n SmushProgress.showBulkSmushDescription();\n this.showRetryBulkSmushModal();\n },\n showRetryBulkSmushModal() {\n const retryModalElement = document.getElementById( 'smush-retry-bulk-smush-notice' );\n if ( ! window.SUI || ! retryModalElement ) {\n return;\n }\n \n retryModalElement.querySelector('.smush-retry-bulk-smush-notice-button').onclick = (e) => {\n e.preventDefault();\n window.SUI.closeModal( 'smush-retry-bulk-smush-notice' );\n this.start();\n }\n \n window.SUI.openModal(\n 'smush-retry-bulk-smush-notice',\n 'wpbody-content',\n undefined,\n false\n );\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 const triggerBulkSmushButton = document.querySelector( '.wp-smush-inline-retry-bulk-smush-notice .wp-smush-trigger-bulk-smush' );\n if ( triggerBulkSmushButton ) {\n triggerBulkSmushButton.addEventListener( 'click', ( e ) => {\n e.preventDefault();\n\n startBtn.click();\n } );\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})();","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","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","import tracker from '../utils/tracker';\n\nclass ProductAnalytics {\n\ttroubleshootClicked = false;\n\tresumeBulkSmushCount = 0;\n\tmissedEventsKey = 'wp_smush_missed_events';\n\n\tinit() {\n\t\tif ( ! tracker.allowToTrack() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.trackUltraLinks();\n\t\tthis.trackUpsellLinks();\n\n\t\tthis.registerTroubleshootClickEvent();\n\n\t\t// Scan Interrupted Event from Scan Modal.\n\t\tthis.trackScanInterruptedEventOnStopScanningModal();\n\t\tthis.trackScanInterruptedEventOnRetryScanModal();\n\n\t\t// Bulk Smush Interrupted Event from Bulk Smush Modal.\n\t\tthis.trackBulkSmushInterruptedEventOnStopBulkSmushModal();\n\t\tthis.trackBulkSmushInterruptedEventOnRetryBulkSmushModal();\n\t\tthis.registerBulkSmushResumeClickEvent();\n\n\t\t// Bulk Smush Interrupted Event when exit ajax bulk smush.\n\t\tthis.trackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush();\n\n\t\t// Interrupted Event from Inline Notice.\n\t\tthis.trackInterruptedEventFromInlineNotice();\n\n\t\t// Interrupted Event from Loopback Error Modal.\n\t\tthis.trackInterruptedEventFromLoopbackErrorModal();\n\n\t\tthis.maybeTrackMissedEventsOnLoad();\n\t}\n\n\ttrackUltraLinks() {\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\tsettings: 'bulksmush_settings',\n\t\t\t\tdashboard: 'dash_summary',\n\t\t\t\tbulk: 'bulksmush_summary',\n\t\t\t\tdirectory: 'directory_summary',\n\t\t\t\t'lazy-preload': 'lazy_summary',\n\t\t\t\tcdn: 'cdn_summary',\n\t\t\t\twebp: '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\ttracker.track( eventName, {\n\t\t\t\t\tLocation: 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\ttrackUpsellLinks() {\n\t\tconst upsellLinks = document.querySelectorAll( '[href*=\"utm_source=smush\"]' );\n\t\tif ( ! upsellLinks ) {\n\t\t\treturn;\n\t\t}\n\t\tupsellLinks.forEach( ( upsellLink ) => {\n\t\t\tupsellLink.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst params = new URL( e.target.href ).searchParams;\n\t\t\t\tif ( ! params ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst campaign = params.get( 'utm_campaign' );\n\t\t\t\tconst upsellLocations = {\n\t\t\t\t\t// CDN.\n\t\t\t\t\tsummary_cdn: 'dash_summary',\n\t\t\t\t\t'smush-dashboard-cdn-upsell': 'dash_widget',\n\t\t\t\t\tsmush_bulksmush_cdn: 'bulk_smush_progress',\n\t\t\t\t\tsmush_cdn_upgrade_button: 'cdn_page',\n\t\t\t\t\tsmush_bulksmush_library_gif_cdn: 'media_library',\n\t\t\t\t\tsmush_bulk_smush_complete_global: 'bulk_smush_complete',\n\n\t\t\t\t\t// Local WebP.\n\t\t\t\t\tsummary_local_webp: 'dash_summary',\n\t\t\t\t\t'smush-dashboard-local-webp-upsell': 'dash_widget',\n\t\t\t\t\t// smush_webp_upgrade_button: 'webp_page',// Handled inside React WebP - free-content.jsx\n\t\t\t\t};\n\n\t\t\t\tif ( ! ( campaign in upsellLocations ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst Location = upsellLocations[ campaign ];\n\t\t\t\tconst matches = campaign.match( /(cdn|webp)/i );\n\t\t\t\tconst upsellModule = matches && matches[ 0 ];\n\n\t\t\t\tconst eventName = 'webp' === upsellModule ? 'local_webp_upsell' : 'cdn_upsell';\n\t\t\t\ttracker.track( eventName, { Location } );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventOnStopScanningModal() {\n\t\tconst stopScanningModal = document.getElementById( 'smush-stop-scanning-dialog' );\n\t\tif ( ! stopScanningModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst closeButtons = stopScanningModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\tTrigger: 'cancel_in_progress',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedEventOnStopBulkSmushModal() {\n\t\tconst stopBulkSmushModal = document.getElementById( 'smush-stop-bulk-smush-modal' );\n\t\tif ( ! stopBulkSmushModal ) {\n\t\t\treturn;\n\t\t}\n\t\tconst closeButtons = stopBulkSmushModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackBulkSmushInterruptedEvent( {\n\t\t\t\t\tTrigger: 'cancel_in_progress',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventOnRetryScanModal() {\n\t\tconst retryScanModal = document.getElementById( 'smush-retry-scan-notice' );\n\t\tif ( ! retryScanModal ) {\n\t\t\treturn;\n\t\t}\n\t\tconst retryButton = retryScanModal.querySelector( '.smush-retry-scan-notice-button' );\n\t\tif ( retryButton ) {\n\t\t\tretryButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst recheckImagesBtn = document.querySelector( '.wp-smush-scan' );\n\t\t\t\tif ( recheckImagesBtn ) {\n\t\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t\t} );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst event = 'Scan Interrupted';\n\t\t\t\tconst properties = this.getScanInterruptedEventProperties( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t} );\n\n\t\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tproperties,\n\t\t\t\t\t} );\n\t\t\t\t} ).finally( () => {\n\t\t\t\t\twindow.location.href = e.target.href;\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t\tconst closeButtons = retryScanModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedEventOnRetryBulkSmushModal() {\n\t\tconst retryBulkModal = document.getElementById( 'smush-retry-bulk-smush-notice' );\n\t\tif ( ! retryBulkModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst retryButton = retryBulkModal.querySelector( '.smush-retry-bulk-smush-notice-button' );\n\t\tif ( retryButton ) {\n\t\t\tretryButton.addEventListener( 'click', () => {\n\t\t\t\tthis.trackBulkSmushInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\n\t\tconst closeButtons = retryBulkModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tthis.trackBulkSmushInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_modal',\n\t\t\t\t\t'Modal Action': action,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEvent( properties ) {\n\t\treturn tracker.track( 'Scan Interrupted', this.getScanInterruptedEventProperties( properties ) );\n\t}\n\n\tgetScanInterruptedEventProperties( properties ) {\n\t\treturn Object.assign( {\n\t\t\tTroubleshoot: this.troubleshootClicked ? 'Yes' : 'No',\n\t\t}, properties );\n\t}\n\n\ttrackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush() {\n\t\tif ( this.canUseBackgroundOptimization() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst progressBar = document.querySelector( '.wp-smush-bulk-progress-bar-wrapper' );\n\t\tif ( ! progressBar ) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow.addEventListener( 'beforeunload', () => {\n\t\t\tconst ajaxBulkSmushObject = window.WP_Smush?.bulk?.bulkSmush;\n\t\t\tconst isBulkSmushInProgressing = ajaxBulkSmushObject && ajaxBulkSmushObject.ids.length > 0 && ! progressBar.classList.contains( 'sui-hidden' );\n\t\t\tif ( ! isBulkSmushInProgressing ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isFreeExceeded = progressBar.classList.contains( 'wp-smush-exceed-limit' );\n\n\t\t\tconst event = 'Bulk Smush Interrupted';\n\t\t\tconst properties = this.getBulkSmushInterruptedEventProperties(\n\t\t\t\t{\n\t\t\t\t\tTrigger: isFreeExceeded ? 'exit_50_limit' : 'exit_in_progress',\n\t\t\t\t\t'Modal Action': 'Exit',\n\t\t\t\t\t'Retry Attempts': this.resumeBulkSmushCount,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\tevent,\n\t\t\t\t\tproperties,\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tcacheMissedEvent( eventData ) {\n\t\tif ( window.localStorage ) {\n\t\t\t// As now we only use it for one event, so let's keep it as a simple array.\n\t\t\twindow.localStorage.setItem( this.missedEventsKey, JSON.stringify( [ eventData ] ) );\n\t\t}\n\t}\n\n\tgetMissedEvents() {\n\t\tif ( ! window.localStorage ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst properties = window.localStorage.getItem( this.missedEventsKey );\n\t\tif ( ! properties ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn JSON.parse( properties );\n\t}\n\n\tclearMissedEvents() {\n\t\tif ( window.localStorage ) {\n\t\t\twindow.localStorage.removeItem( this.missedEventsKey );\n\t\t}\n\t}\n\n\tcanUseBackgroundOptimization() {\n\t\treturn 'undefined' !== typeof window.wp_smushit_data?.bo_stats;\n\t}\n\n\ttrackBulkSmushInterruptedEvent( properties ) {\n\t\treturn tracker.track( 'Bulk Smush Interrupted', this.getBulkSmushInterruptedEventProperties( properties ) );\n\t}\n\n\tgetBulkSmushInterruptedEventProperties( properties ) {\n\t\treturn Object.assign(\n\t\t\t{\n\t\t\t\tTroubleshoot: this.troubleshootClicked ? 'Yes' : 'No',\n\t\t\t},\n\t\t\tthis.getBulkSmushProcessStats(),\n\t\t\tproperties\n\t\t);\n\t}\n\n\tgetBulkSmushProcessStats() {\n\t\tif ( this.canUseBackgroundOptimization() ) {\n\t\t\t// Handled it via PHP.\n\t\t\treturn {};\n\t\t}\n\t\tconst ajaxBulkSmushObject = window.WP_Smush?.bulk?.bulkSmush;\n\t\tconst totalEnqueuedImages = ajaxBulkSmushObject?.total || 0;\n\t\tconst processedImages = ajaxBulkSmushObject?.smushed + ajaxBulkSmushObject?.errors.length;\n\t\tconst completionPercentage = totalEnqueuedImages > 0 ? Math.ceil( processedImages * 100 / totalEnqueuedImages ) : 0;\n\n\t\treturn {\n\t\t\t'Retry Attempts': this.resumeBulkSmushCount,\n\t\t\t'Total Enqueued Images': totalEnqueuedImages,\n\t\t\t'Completion Percentage': completionPercentage,\n\t\t};\n\t}\n\n\ttrackInterruptedEventFromInlineNotice() {\n\t\tthis.trackInterruptedEventFromInlineNoticeOnDashboard();\n\t\tthis.trackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush();\n\t\tthis.trackScanInterruptedEventFromInlineNoticeOnBulkSmush();\n\t}\n\n\ttrackInterruptedEventFromInlineNoticeOnDashboard() {\n\t\tconst dashboardBulkElement = document.getElementById( 'smush-box-dashboard-bulk' );\n\t\tif ( ! dashboardBulkElement ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.trackBulkSmushInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement );\n\t\tthis.trackScanInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement );\n\t}\n\n\ttrackBulkSmushInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement ) {\n\t\tconst triggerBulkSmushButton = dashboardBulkElement.querySelector( '.wp-smush-retry-bulk-smush-link' );\n\t\tif ( ! triggerBulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\t\ttriggerBulkSmushButton.addEventListener( 'click', ( e ) => {\n\t\t\te.preventDefault();\n\n\t\t\tconst event = 'Bulk Smush Interrupted';\n\t\t\tconst properties = this.getBulkSmushInterruptedEventProperties(\n\t\t\t\t{\n\t\t\t\t\tTrigger: 'failed_notice',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t}\n\t\t\t);\n\n\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\tevent,\n\t\t\t\t\tproperties,\n\t\t\t\t} );\n\t\t\t} ).finally( () => {\n\t\t\t\twindow.location.href = e.target.href;\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedInlineNoticeEvent() {\n\t\treturn this.trackBulkSmushInterruptedEvent( {\n\t\t\tTrigger: 'failed_notice',\n\t\t\t'Modal Action': 'Retry',\n\t\t} );\n\t}\n\n\ttrackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush() {\n\t\tconst triggerBulkSmushButton = document.querySelector( '.wp-smush-inline-retry-bulk-smush-notice .wp-smush-trigger-bulk-smush' );\n\t\tif ( ! triggerBulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttriggerBulkSmushButton.addEventListener( 'click', () => {\n\t\t\tthis.trackBulkSmushInterruptedInlineNoticeEvent();\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventFromInlineNoticeOnDashboard( dashboardBulkElement ) {\n\t\tconst triggerScanButton = dashboardBulkElement.querySelector( '.wp-smush-retry-scan-link' );\n\t\tif ( ! triggerScanButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttriggerScanButton.addEventListener( 'click', ( e ) => {\n\t\t\te.preventDefault();\n\n\t\t\tconst event = 'Scan Interrupted';\n\t\t\tconst properties = this.getScanInterruptedEventProperties( {\n\t\t\t\tTrigger: 'failed_notice',\n\t\t\t\t'Modal Action': 'Retry',\n\t\t\t} );\n\n\t\t\ttracker.track( event, properties ).catch( () => {\n\t\t\t\tthis.cacheMissedEvent( {\n\t\t\t\t\tevent,\n\t\t\t\t\tproperties,\n\t\t\t\t} );\n\t\t\t} ).finally( () => {\n\t\t\t\twindow.location.href = e.target.href;\n\t\t\t} );\n\t\t} );\n\t}\n\n\ttrackScanInterruptedEventFromInlineNoticeOnBulkSmush() {\n\t\tconst recheckImagesNotice = document.querySelector( '.wp-smush-recheck-images-notice-box' );\n\t\tif ( ! recheckImagesNotice ) {\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.addEventListener( 'click', () => {\n\t\t\t\t// We are using the same frame for failed scan notice and generic required scan notice,\n\t\t\t\t// so we need to verify the failed notice before tracking the event.\n\t\t\t\tconst containTroubleshootingLink = triggerBackgroundScanImagesLink?.previousElementSibling?.querySelector( 'a' );\n\t\t\t\tif ( ! containTroubleshootingLink ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.trackScanInterruptedEvent( {\n\t\t\t\t\tTrigger: 'failed_notice',\n\t\t\t\t\t'Modal Action': 'Retry',\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}\n\n\ttrackInterruptedEventFromLoopbackErrorModal() {\n\t\tconst loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n\t\tif ( ! loopbackErrorModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst loopbackErrorDocsLink = loopbackErrorModal.querySelector( 'a[href*=\"#loopback-request-issue\"]' );\n\t\tlet isTroubleshootClicked = false;\n\t\tif ( loopbackErrorDocsLink ) {\n\t\t\tloopbackErrorDocsLink.addEventListener( 'click', () => {\n\t\t\t\tisTroubleshootClicked = true;\n\t\t\t}, { once: true } );\n\t\t}\n\n\t\tconst trackLoopbackErrorEvent = ( action, processType ) => {\n\t\t\tconst properties = {\n\t\t\t\tTrigger: 'loopback_error',\n\t\t\t\t'Modal Action': action,\n\t\t\t\tTroubleshoot: isTroubleshootClicked ? 'Yes' : 'No',\n\t\t\t};\n\n\t\t\tif ( 'scan' === processType ) {\n\t\t\t\tthis.trackScanInterruptedEvent( properties );\n\t\t\t} else {\n\t\t\t\tthis.trackBulkSmushInterruptedEvent( properties );\n\t\t\t}\n\t\t};\n\n\t\tconst closeButtons = loopbackErrorModal.querySelectorAll( '[data-modal-close]' );\n\t\tcloseButtons.forEach( ( closeButton ) => {\n\t\t\tcloseButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tconst action = e.target.dataset?.action || 'Close';\n\t\t\t\tconst processType = loopbackErrorModal.dataset?.processType || 'scan';\n\t\t\t\ttrackLoopbackErrorEvent( action, processType );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tregisterTroubleshootClickEvent() {\n\t\tconst troubleshootLinks = document.querySelectorAll( 'a[href*=\"#troubleshooting-guide\"]' );\n\t\tif ( ! troubleshootLinks ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttroubleshootLinks.forEach( ( troubleshootLink ) => {\n\t\t\ttroubleshootLink.addEventListener( 'click', () => {\n\t\t\t\tthis.troubleshootClicked = true;\n\t\t\t}, { once: true } );\n\t\t} );\n\t}\n\n\tmaybeTrackMissedEventsOnLoad() {\n\t\twindow.addEventListener( 'load', () => {\n\t\t\tconst missedEvents = this.getMissedEvents();\n\t\t\tif ( 0 === missedEvents.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.clearMissedEvents();\n\n\t\t\tmissedEvents.forEach( ( missedEvent ) => {\n\t\t\t\ttracker.track( missedEvent.event, missedEvent.properties );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tregisterBulkSmushResumeClickEvent() {\n\t\tconst resumeBulkSmushButton = document.querySelector( '.wp-smush-resume-bulk-smush' );\n\t\tif ( ! resumeBulkSmushButton ) {\n\t\t\treturn;\n\t\t}\n\n\t\tresumeBulkSmushButton.addEventListener( 'click', () => {\n\t\t\tthis.resumeBulkSmushCount += 1;\n\t\t} );\n\t}\n\n\tgetCurrentPageSlug() {\n\t\tconst searchParams = new URLSearchParams( document.location.search );\n\t\tconst pageSlug = searchParams.get( 'page' );\n\t\treturn 'smush' === pageSlug ? 'dashboard' : pageSlug.replace( 'smush-', '' );\n\t}\n}\n\n( new ProductAnalytics() ).init();\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 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 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","/**\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","/* global ajaxurl, WP_Smush, wp_smush_msgs */\n\nimport Smush from '../smush/smush';\nimport {GlobalStats} from \"../common/globalStats\";\nimport SmushProgress from \"../common/progressbar\";\nimport Fetcher from '../utils/fetcher';\n\nWP_Smush.adminAjax = {\n\tdisconnectSite: ( btn ) => {\n\t\tif ( btn ) {\n\t\t\tbtn.classList.add( 'sui-button-onload-text' );\n\t\t}\n\n\t\treturn Fetcher.settings.disconnectSite().then( ( res ) => {\n\t\t\tif ( res.success ) {\n\t\t\t\twindow.location.search = window.location.search + `&smush-notice=site-disconnected`;\n\t\t\t} else {\n\t\t\t\tWP_Smush.helpers.showNotice( res );\n\t\t\t}\n\t\t} ).catch( ( error ) => {\n\t\t\tWP_Smush.helpers.showNotice( error );\n\t\t} ).finally( () => {\n\t\t\tif ( btn ) {\n\t\t\t\tbtn.classList.remove( 'sui-button-onload-text' );\n\t\t\t}\n\t\t} );\n\t}\n};\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\n/**\n * Show disconnected site success message.\n */\ndocument.addEventListener(\n\t'on-smush-site-disconnected-notice',\n\t() => {\n\t\tWP_Smush.helpers.showNotice(\n\t\t\twp_smush_msgs.site_disconnected_success,\n\t\t\t{\n\t\t\t\ttype: 'success',\n\t\t\t}\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 resizingWrapper jQuery object for the whole setting row wrapper div\n\t */\n\tconst validateResizeSettings = function( resizingWrapper ) {\n\t\tconst resizeCheckbox = resizingWrapper.find( '#resize' ),\n\t\t\twidthInput = resizingWrapper.find( '#wp-smush-resize_width' ),\n\t\t\theightInput = resizingWrapper.find( '#wp-smush-resize_height' ),\n\t\t\tinputWrapper = resizingWrapper.find( '#smush-resize-settings-wrap' ),\n\t\t\terrorNotice = resizingWrapper.find( '.wp-smush-update-dimensions' );\n\n\t\tconst imageResizingEnabled = resizeCheckbox.is( ':checked' );\n\t\tif (\n\t\t\t! imageResizingEnabled ||\n\t\t\t! widthInput.length ||\n\t\t\t! heightInput.length ||\n\t\t\t! inputWrapper.length ||\n\t\t\t! errorNotice.length\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { width: largestWidth, height: largestHeight } = window.wp_smushit_data?.resize_sizes || {};\n\t\tif ( ! largestWidth && ! largestHeight ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst width = widthInput.val();\n\t\tconst height = heightInput.val();\n\t\tconst widthError = parseInt( largestWidth ) > parseInt( width );\n\t\tconst heightError = parseInt( largestWidth ) > parseInt( height );\n\n\t\tconst hasError = widthError || heightError;\n\n\t\tif ( hasError ) {\n\t\t\terrorNotice.show( 'slow' );\n\t\t} else {\n\t\t\terrorNotice.hide( 'slow' );\n\t\t}\n\n\t\tif ( widthError ) {\n\t\t\twidthInput.parent().addClass( 'sui-form-field-warning' );\n\t\t} else {\n\t\t\twidthInput.parent().removeClass( 'sui-form-field-warning' );\n\t\t}\n\n\t\tif ( heightError ) {\n\t\t\theightInput.parent().addClass( 'sui-form-field-warning' );\n\t\t} else {\n\t\t\theightInput.parent().removeClass( 'sui-form-field-warning' );\n\t\t}\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\t\n\t/**\n\t * When 'All' is selected for the Media type, select all available media type.\n\t *\n\t * @since 3.21.0\n\t */\n\t$('#all-media-type').on('change', function () {\n\t\t$('.lazyload-media-type-input').prop('checked', true);\n\t});\n\t\n\t/**\n\t * When 'All' is selected for the Output location, select all available location.\n\t *\n\t * @since 3.21.0\n\t */\n\t$('#all-output-location').on('change', function () {\n\t\t$('input[name^=\"output\"]').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\t\n\t/**\n\t * Handle clear LCP data button click (Settings)\n\t *\n\t * @since 3.20.0\n\t */\n\t$( '#smush-clear-lcp-data' ).on( 'click', function ( e ) {\n\t\te.preventDefault();\n\t\t\n\t\tconst $button = $( this );\n\t\t$button.addClass( 'sui-button-onload' );\n\t\t\n\t\t$.post(\n\t\t\t ajaxurl,\n\t\t\t {\n\t\t\t\t action: 'clear_all_lcp_data',\n\t\t\t\t _ajax_nonce: wp_smush_msgs.nonce\n\t\t\t }\n\t\t )\n\t\t .done( function ( response ) {\n\t\t\t WP_Smush.helpers.showNotice( 'LCP data cleared successfully.', {\n\t\t\t\t type: 'success',\n\t\t\t\t autoclose: true,\n\t\t\t } );\n\t\t } )\n\t\t .fail( function () {\n\t\t\t WP_Smush.helpers.showErrorNotice( 'Failed to clear LCP data. Please try again.' );\n\t\t } )\n\t\t .always( function () {\n\t\t\t $button.removeClass( 'sui-button-onload' );\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// 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 resizingWrapper = $(this).closest('#resize-settings-row');\n\n\t\t// Initiate the check.\n\t\tvalidateResizeSettings(resizingWrapper ); // 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.removeClass('sui-hidden');\n\t\t} else {\n\t\t\tsettings_wrap.addClass('sui-hidden');\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\tconst modalId = 'smush-updated-dialog',\n\t\t\tfocusAfterClosed = 'wpbody-content',\n\t\t\tfocusWhenOpen = undefined,\n\t\t\thasOverlayMask = false,\n\t\t\tisCloseOnEsc = false,\n\t\t\tisAnimated = true;\n\n\t\twindow.SUI.openModal(\n\t\t\tmodalId,\n\t\t\tfocusAfterClosed,\n\t\t\tfocusWhenOpen,\n\t\t\thasOverlayMask,\n\t\t\tisCloseOnEsc,\n\t\t\tisAnimated\n\t\t);\n\t}\n\n\t/**\n\t * Toggle backup notice based on \"Optimize 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\tupdatePreloadImageInSummaryBox();\n\t} );\n\t\n\t// Update preload image status in the summary box.\n\tconst updatePreloadImageInSummaryBox = () => {\n\t\tconst summaryBox = document.querySelector( '.wp-smush-preload-images-status' );\n\t\tconst preloadImagesCheckbox = document.getElementById( 'preload-images' );\n\t\t\n\t\tif ( ! summaryBox || ! preloadImagesCheckbox ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconst isActive = preloadImagesCheckbox.checked;\n\t\t\n\t\tsummaryBox.innerText = isActive ? 'Active' : 'Inactive';\n\t\t\n\t\tsummaryBox.classList.toggle('sui-tag-green', isActive);\n\t};\n\n\n\tconst toggleNoscriptFallbackOnNativeLazyloadChange = () => {\n\t\tconst nativeLazyloadInput = document.querySelector( '#lazyload-native-settings-row #native' );\n\t\tif ( ! nativeLazyloadInput ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnativeLazyloadInput.addEventListener( 'change', ( e ) => {\n\t\t\tconst noscriptFallbackField = document.querySelector( '#lazyload-noscript-settings-row' );\n\t\t\tconst noscriptFallbackInput = noscriptFallbackField && noscriptFallbackField.querySelector( '#noscript_fallback' );\n\t\t\tif ( ! noscriptFallbackInput ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( e.target.checked ) {\n\t\t\t\tnoscriptFallbackField.style.display = 'none';\n\t\t\t} else {\n\t\t\t\tnoscriptFallbackField.style.display = 'flex';\n\t\t\t}\n\t\t} );\n\t}\n\ttoggleNoscriptFallbackOnNativeLazyloadChange();\n\t\n\tconst togglePreloadChange = () => {\n\t\tconst preloadInput = document.querySelector( '#preload-images-settings-row #preload-images' );\n\t\tconst excludeRow = document.getElementById( 'preload-exclude-settings-row' );\n\t\tconst fetchpriorityRow = document.getElementById( 'preload-images-fetchpriority-settings-row' );\n\t\t\n\t\tif ( ! preloadInput || ( ! excludeRow && ! fetchpriorityRow ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tpreloadInput.addEventListener( 'change', ( e ) => {\n\t\t\tconst isChecked = e.target.checked;\n\t\t\texcludeRow.style.display = isChecked ? 'flex' : 'none';\n\t\t\tfetchpriorityRow.style.display = isChecked ? 'flex' : 'none';\n\t\t} );\n\t};\n\t\n\ttogglePreloadChange();\n\n\tconst cleanUrlParams = () => {\n\t\tconst url = new URL( window.location.href );\n\t\tconst params = url.searchParams;\n\t\tconst hash = url.hash;\n\n\t\tconst hashesToRemove = [ '#directory_smush-settings-row' ];\n\n\t\t// Remove all params that start with 'smush__'.\n\t\tfor ( const [ key ] of params ) {\n\t\t\tif ( key.startsWith( 'smush__' ) ) {\n\t\t\t\tparams.delete( key );\n\t\t\t}\n\t\t}\n\n\t\t// Remove specific hashes.\n\t\thashesToRemove.forEach( ( hashToRemove ) => {\n\t\t\tif ( hash === hashToRemove ) {\n\t\t\t\turl.hash = '';\n\t\t\t}\n\t\t} );\n\n\t\t// Update the URL without reloading the page.\n\t\twindow.history.replaceState( {}, '', url.toString() );\n\t}\n\n\tcleanUrlParams();\n});\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","/* 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\tthis.startScan( true );\n\t\t}\n\n\t\tonStart() {\n\t\t\tthis.hideRecheckNotice();\n\t\t\tthis.hideFailedBulkSmushNotice();\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\n\t\t\tthis.hideFailedBulkSmushNotice();\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\n\t\t\tthis.hideFailedBulkSmushNotice();\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\thideFailedBulkSmushNotice() {\n\t\t\tthis.hideAnElement( $( '#smush-box-inline-retry-bulk-smush-notice' ) );\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.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}\n\t};\n\n\tconst maybeAutoStartMediaLibraryScanOnRedirect = () => {\n\t\tif ( ! recheckImagesBtn || ! window.location.search.includes( 'smush-action=start-scan-media' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trecheckImagesBtn.click();\n\t\tconst removeScanActionFromURLAddress = () => {\n\t\t\tconst cleanedURL = window.location.href.replace( '&smush-action=start-scan-media', '' );\n\t\t\twindow.history.pushState( null, null, cleanedURL );\n\t\t};\n\t\tremoveScanActionFromURLAddress();\n\t};\n\n\t/**\n\t * Recheck Images Notice events.\n\t */\n\tconst registerEventsRelatedInlineNoticeOnBulkSmushPage = () => {\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.location.search.includes( 'smush-action=start-scan-media' ) ) {\n\t\t\t\tif ( window.wp_smushit_data.media_library_scan?.is_dead ) {\n\t\t\t\t\tmediaLibScanner.showProgressErrorNoticeOnRecheckNotice();\n\t\t\t\t} else if( window.wp_smushit_data.is_outdated && ! window.wp_smushit_data?.bo_stats?.is_dead ) {\n\t\t\t\t\tmediaLibScanner.showRecheckNoticeWarning();\n\t\t\t\t}\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\tconst bulkSmushFailedNotice = document.querySelector( '#smush-box-inline-retry-bulk-smush-notice' );\n\t\t\tconst isShowingBulkSmushFailedNotice = bulkSmushFailedNotice && ! bulkSmushFailedNotice.classList.contains( 'sui-hidden' );\n\t\t\tif ( isShowingBulkSmushFailedNotice ) {\n\t\t\t\treturn;\n\t\t\t}\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\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\n\tconst autoStartBulkSmushOnRedirect = () => {\n\t\tif ( ! bulkSmushButton || ! window.location.search.includes( 'smush-action=start-bulk-' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tbulkSmushButton.click();\n\n\t\tconst removeSmushActionFromURLAddress = () => {\n\t\t\tconst cleanedURL = window.location.href.replace( /&smush-action=start-bulk-(smush|webp-conversion)/i, '' );\n\t\t\twindow.history.pushState( null, null, cleanedURL );\n\t\t};\n\t\tremoveSmushActionFromURLAddress();\n\t};\n\n\tconst registerRetryProcessFromLoopbackErrorModal = () => {\n\t\tconst loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n\t\tif ( ! loopbackErrorModal ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst retryButton = loopbackErrorModal.querySelector( '.smush-retry-process-button' );\n\t\tif ( retryButton ) {\n\t\t\tretryButton.addEventListener( 'click', () => {\n\t\t\t\tconst processType = loopbackErrorModal.dataset?.processType || 'scan';\n\t\t\t\tif ( 'scan' === processType ) {\n\t\t\t\t\trecheckImagesBtn.click();\n\t\t\t\t} else {\n\t\t\t\t\tbulkSmushButton.click();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t};\n\n\tregisterScanMediaLibraryEvent();\n\tregisterScanAndBulkSmushEvent();\n\tregisterEventsRelatedInlineNoticeOnBulkSmushPage();\n\tmaybeAutoStartMediaLibraryScanOnRedirect();\n\tautoStartBulkSmushOnRedirect();\n\tregisterRetryProcessFromLoopbackErrorModal();\n}() );\n","/* global ajaxurl */\n/* global WP_Smush */\n\n/**\n * NextGen class.\n */\nexport default class NextGen {\n\tconstructor( nextGenFormat ) {\n\t\tthis.nextGenFormat = nextGenFormat;\n\t\tthis.nonceField = document.getElementsByName( 'wp_smush_options_nonce' );\n\t\tthis.toggleModuleButton = document.getElementById( `smush-toggle-${ nextGenFormat }-button` );\n\t\tthis.deleteAllButton = document.getElementById( `wp-smush-${ nextGenFormat }-delete-all` );\n\n\t\tthis.registerGlobalEvents();\n\t\tthis.registerEvents();\n\t}\n\n\t/**\n\t * Register global events.\n\t */\n\tregisterGlobalEvents() {\n\t\tif ( NextGen.isGlobalEventListenerAdded ) {\n\t\t\treturn;\n\t\t}\n\t\tNextGen.isGlobalEventListenerAdded = true;\n\n\t\tdocument.addEventListener( 'onSavedSmushSettings', this.onSavedNextGenSettingsHandler.bind( this ) );\n\t\tdocument.addEventListener( 'on-smush-next-gen-activated-notice', this.showNextGenActivatedModal.bind( this ) );\n\t\tdocument.addEventListener( 'on-smush-next-gen-conversion-changed-notice', this.showNextGenConversionChangedModal.bind( this ) );\n\t}\n\n\tregisterEvents() {\n\t\tthis.maybeShowDeleteAllSuccessNotice();\n\n\t\t/**\n\t\t * Handles the \"Deactivate\" and \"Get Started\" buttons on the Next-Gen page.\n\t\t */\n\t\tif ( this.toggleModuleButton ) {\n\t\t\tthis.toggleModuleButton.addEventListener( 'click', ( e ) =>\n\t\t\t\tthis.toggleModule( e )\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Handles the \"Delete Next-Gen images\" button.\n\t\t */\n\t\tif ( this.deleteAllButton ) {\n\t\t\tthis.deleteAllButton.addEventListener( 'click', ( e ) => this.deleteAll( e ) );\n\t\t}\n\t}\n\n\t/**\n\t * Toggle Next-Gen module.\n\t *\n\t * @param {Event} e\n\t */\n\ttoggleModule( e ) {\n\t\te.preventDefault();\n\n\t\tconst button = e.currentTarget,\n\t\t\tdoEnable = 'enable' === button.dataset.action;\n\n\t\tbutton.classList.add( 'sui-button-onload' );\n\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.open( 'POST', ajaxurl + `?action=smush_${ this.nextGenFormat }_toggle`, 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\tconst res = JSON.parse( xhr.response );\n\n\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\tthis.redirectToNextGenPage();\n\t\t\t\t\t};\n\t\t\t\t} else if ( 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\tthis.showNotice( res.data.message );\n\t\t\t\t\tbutton.classList.remove( 'sui-button-onload' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet message = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t\tif ( res && 'undefined' !== typeof res.data.message ) {\n\t\t\t\t\tmessage = res.data.message;\n\t\t\t\t}\n\t\t\t\tthis.showNotice( message );\n\t\t\t\tbutton.classList.remove( 'sui-button-onload' );\n\t\t\t}\n\t\t};\n\n\t\txhr.send(\n\t\t\t'param=' + doEnable + '&_ajax_nonce=' + this.nonceField[ 0 ].value\n\t\t);\n\t}\n\n\tdeleteAll( e ) {\n\t\tconst button = e.currentTarget;\n\t\tbutton.classList.add( 'sui-button-onload' );\n\n\t\tlet message = false;\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.open( 'POST', ajaxurl + `?action=smush_${ this.nextGenFormat }_delete_all`, 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\tconst res = JSON.parse( xhr.response );\n\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\tif ( 'undefined' !== typeof res.success && res.success ) {\n\t\t\t\t\tconst scanPromise = this.runScan();\n\t\t\t\t\tscanPromise.onload = () => {\n\t\t\t\t\t\tlocation.search =\n location.search + `&smush-notice=${ this.nextGenFormat }-deleted`;\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\t\t\t} else {\n\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t}\n\n\t\t\tif ( res && res.data && res.data.message ) {\n\t\t\t\tmessage = res.data.message;\n\t\t\t}\n\n\t\t\tif ( message ) {\n\t\t\t\tbutton.classList.remove( 'sui-button-onload' );\n\n\t\t\t\tconst noticeMessage = `<p style=\"text-align: left;\">${ message }</p>`;\n\t\t\t\tconst noticeOptions = {\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\ticon: 'info',\n\t\t\t\t\tautoclose: {\n\t\t\t\t\t\tshow: false,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\twindow.SUI.openNotice(\n\t\t\t\t\t'wp-smush-next-gen-delete-all-error-notice',\n\t\t\t\t\tnoticeMessage,\n\t\t\t\t\tnoticeOptions\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\txhr.send( '_ajax_nonce=' + this.nonceField[ 0 ].value );\n\t}\n\n\t/**\n\t * Triggers the scanning of images for updating the images to re-smush.\n\t *\n\t * @since 3.8.0\n\t */\n\trunScan() {\n\t\tconst xhr = new XMLHttpRequest(),\n\t\t\tnonceField = document.getElementsByName(\n\t\t\t\t'wp_smush_options_nonce'\n\t\t\t);\n\n\t\txhr.open( 'POST', ajaxurl + '?action=scan_for_resmush', 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.send( '_ajax_nonce=' + nonceField[ 0 ].value );\n\n\t\treturn xhr;\n\t}\n\n\t/**\n\t * Show message (notice).\n\t *\n\t * @param {string} message\n\t * @param {string} type\n\t */\n\tshowNotice( message, type ) {\n\t\tif ( 'undefined' === typeof message ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst noticeMessage = `<p>${ message }</p>`;\n\t\tconst noticeOptions = {\n\t\t\ttype: type || 'error',\n\t\t\ticon: 'info',\n\t\t\tdismiss: {\n\t\t\t\tshow: true,\n\t\t\t\tlabel: window.wp_smush_msgs.noticeDismiss,\n\t\t\t\ttooltip: window.wp_smush_msgs.noticeDismissTooltip,\n\t\t\t},\n\t\t\tautoclose: {\n\t\t\t\tshow: false,\n\t\t\t},\n\t\t};\n\n\t\twindow.SUI.openNotice(\n\t\t\t'wp-smush-ajax-notice',\n\t\t\tnoticeMessage,\n\t\t\tnoticeOptions\n\t\t);\n\t}\n\n\t/**\n\t * Show delete all webp success notice.\n\t */\n\tmaybeShowDeleteAllSuccessNotice() {\n\t\tconst deletedAllNoticeElementID = `wp-smush-${ this.nextGenFormat }-delete-all-notice`;\n\t\tconst deletedAllNoticeElement = document.getElementById( deletedAllNoticeElementID );\n\t\tif ( ! deletedAllNoticeElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeMessage = `<p>${\n\t\t\tdeletedAllNoticeElement\n\t\t\t\t.dataset.message\n\t\t}</p>`;\n\n\t\tconst noticeOptions = {\n\t\t\ttype: 'success',\n\t\t\ticon: 'check-tick',\n\t\t\tdismiss: {\n\t\t\t\tshow: true,\n\t\t\t},\n\t\t};\n\n\t\twindow.SUI.openNotice(\n\t\t\tdeletedAllNoticeElementID,\n\t\t\tnoticeMessage,\n\t\t\tnoticeOptions\n\t\t);\n\t}\n\n\tonSavedNextGenSettingsHandler( status ) {\n\t\tif ( 'next-gen' === status?.detail?.page ) {\n\t\t\tif ( status?.detail?.next_gen_format_changed ) {\n\t\t\t\tthis.redirectToNextGenPage( '&smush-notice=next-gen-conversion-changed' );\n\t\t\t} else if ( status?.detail?.webp_method_changed ) {\n\t\t\t\tthis.redirectToNextGenPage();\n\t\t\t}\n\t\t}\n\t}\n\n\tshowNextGenActivatedModal() {\n\t\tif ( ! window.WP_Smush ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activatedModalId = 'smush-next-gen-activated-modal';\n\t\tif ( ! document.getElementById( activatedModalId ) ) {\n\t\t\tthis.redirectToNextGenPage();\n\t\t\treturn;\n\t\t}\n\n\t\twindow.WP_Smush.helpers.showModal( activatedModalId, {\n\t\t\tisCloseOnEsc: true,\n\t\t} );\n\t}\n\n\tshowNextGenConversionChangedModal() {\n\t\tif ( ! window.WP_Smush ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst conversionChangedModalId = 'smush-next-gen-conversion-changed-modal';\n\t\tif ( ! document.getElementById( conversionChangedModalId ) ) {\n\t\t\tthis.redirectToNextGenPage();\n\t\t\treturn;\n\t\t}\n\n\t\twindow.WP_Smush.helpers.showModal( conversionChangedModalId, {\n\t\t\tisCloseOnEsc: true,\n\t\t} );\n\t}\n\n\tredirectToNextGenPage( noticeParam ) {\n\t\twindow.location.href = window.wp_smush_msgs.nextGenURL + ( noticeParam || '' );\n\t}\n}\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\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 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 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","/**\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","import Fetcher from './utils/fetcher';\n\nclass LoopbackTester {\n\tdelayTimeOnFailure = 5000;\n\n\tperformTest() {\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\tthis.startTest().then( ( res ) => {\n\t\t\t\tif ( res?.success ) {\n\t\t\t\t\tthis.getResult(\n\t\t\t\t\t\tresolve,\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\t\tthis.getResult( resolve, reject, reject );\n\t\t\t\t\t\t\t}, this.delayTimeOnFailure );\n\t\t\t\t\t\t},\n\t\t\t\t\t\treject\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treject( res );\n\t\t\t\t}\n\t\t\t} ).catch( ( error ) => {\n\t\t\t\treject( error );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tstartTest() {\n\t\treturn Fetcher.background.backgroundHealthyCheck();\n\t}\n\n\tgetResult( successCallback, failedCallback, errorCallback ) {\n\t\treturn this.fetchResult().then( ( status ) => {\n\t\t\tlet data = status?.data;\n\t\t\tif (status?.success && data?.loopback) {\n\t\t\t\tsuccessCallback(data);\n\t\t\t} else {\n\t\t\t\tfailedCallback(status);\n\t\t\t}\n\t\t} ).catch( ( error ) => {\n\t\t\terrorCallback( error );\n\t\t} );\n\t}\n\n\tfetchResult() {\n\t\treturn Fetcher.background.backgroundHealthyStatus();\n\t}\n}\n\nexport default ( new LoopbackTester() );\n","/* 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.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.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', 'is_dead' ];\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","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\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","/* global WP_Smush */\n/* global ajaxurl */\nimport tracker from '../utils/tracker';\nimport GlobalTracking from '../global-tracking';\n\n/**\n * Modals JavaScript code.\n */\n( function() {\n\t'use strict';\n\tconst onBoardingTemplateID = 'smush-onboarding-free';\n\tif ( ! document.getElementById( onBoardingTemplateID ) ) {\n\t\treturn;\n\t}\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\tsettings: {\n\t\t\tfirst: true,\n\t\t\tlast: false,\n\t\t\tslide: 'start',\n\t\t\tfields: {},\n\t\t},\n\t\tfields: {},\n\t\tcontentContainer: document.getElementById( 'smush-onboarding-content' ),\n\t\tonboardingSlides: [],\n\t\ttouchX: null,\n\t\ttouchY: null,\n\t\trecheckImagesLink: '',\n\t\tupsellUTMClicked: false,\n\n\t\tregisterEventListeners() {\n\t\t\tdocument.addEventListener(\n\t\t\t\t'smush-onboarding:rendered-slide-scan_completed',\n\t\t\t\tthis.progressBarAnimation.bind( this )\n\t\t\t);\n\n\t\t\t// Skip setup.\n\t\t\tthis.skipButton = this.onboardingModal.querySelector(\n\t\t\t\t'.smush-onboarding-skip-link'\n\t\t\t);\n\t\t\tif ( this.skipButton ) {\n\t\t\t\tthis.skipButton.addEventListener( 'click', this.skipSetup.bind( this ) );\n\t\t\t}\n\t\t},\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\tthis.onboardingSlides = window.onBoardingData?.slideKeys || [];\n\t\t\tthis.fields = window.onBoardingData?.slideFields || {};\n\t\t\tthis.settings.slide = this.onboardingSlides.length ? this.onboardingSlides[ 0 ] : 'start';\n\n\t\t\tconst dialog = document.getElementById( onBoardingTemplateID );\n\n\t\t\tthis.membership = dialog.dataset.type;\n\t\t\tthis.recheckImagesLink = dialog.dataset.ctaUrl;\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.registerEventListeners();\n\t\t\tthis.renderTemplate();\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\tprogressBarAnimation( event ) {\n\t\t\tconst progressBar = this.onboardingModal.querySelector( '.sui-progress-bar span' );\n\t\t\tconst progressText = this.onboardingModal.querySelector( '.sui-progress-text' );\n\t\t\tlet start = 0;\n\t\t\tconst duration = 3000; // 3 seconds\n\t\t\tconst step = 10; // ms\n\n\t\t\tif ( ! progressBar || ! progressText ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst interval = setInterval( () => {\n\t\t\t\tstart += step;\n\t\t\t\tconst percent = Math.min( Math.round( ( start / duration ) * 100 ), 100 );\n\t\t\t\tprogressBar.style.width = percent + '%';\n\t\t\t\tprogressText.textContent = percent + '%';\n\t\t\t\tif ( percent >= 100 ) {\n\t\t\t\t\tclearInterval( interval );\n\t\t\t\t\tconst loader = this.onboardingModal.querySelector( '.sui-icon-loader' );\n\t\t\t\t\tif ( loader ) {\n\t\t\t\t\t\tloader.classList.remove( 'sui-icon-loader', 'sui-loading' );\n\t\t\t\t\t\tloader.style.color = '#1ABC9C';\n\t\t\t\t\t\tloader.classList.add( 'sui-icon-check-tick' );\n\t\t\t\t\t}\n\t\t\t\t\tconst scanStats = this.onboardingModal.querySelector( '.scan-stats' );\n\t\t\t\t\tif ( scanStats ) {\n\t\t\t\t\t\tscanStats.classList.remove( 'sui-hidden' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, step );\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\t * Todo: Maybe redirect to finish scan slide when users go to in progressing slide.\n\t\t */\n\t\trenderTemplate( directionClass = 'none' ) {\n\t\t\t// Grab the selected value.\n\t\t\tthis.updateCheckboxStates();\n\n\t\t\tconst template = WP_Smush.onboarding.template( onBoardingTemplateID );\n\t\t\tconst settings = this.settings;\n\t\t\tsettings.fields = this.fields;\n\t\t\tconst content = template( 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\tthis.toggleSkipButton();\n\t\t\tthis.maybeHandleUpsellUTMClick();\n\n\t\t\tconst slideRendered = new CustomEvent(\n\t\t\t\t`smush-onboarding:rendered-slide-${ this.settings.slide }`,\n\t\t\t\t{\n\t\t\t\t\tdetail: {\n\t\t\t\t\t\tsettings: this.settings,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\tdocument.dispatchEvent( slideRendered );\n\t\t},\n\n\t\tupdateCheckboxStates() {\n\t\t\tconst inputs = this.onboardingModal.querySelectorAll(\n\t\t\t\t'input[type=\"checkbox\"]'\n\t\t\t);\n\t\t\tif ( inputs ) {\n\t\t\t\tinputs.forEach( ( checkbox ) => {\n\t\t\t\t\tthis.fields[ checkbox.id ] = checkbox.checked;\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\n\t\ttoggleSkipButton() {\n\t\t\tif ( ! this.skipButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.settings.last ) {\n\t\t\t\tthis.skipButton.classList.add( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tthis.skipButton.classList.remove( 'sui-hidden' );\n\t\t\t}\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', async function( e ) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tsubmitButton.classList.add( 'sui-button-onload-text' );\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\tself.updateCheckboxStates();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait self.trackFinishSetupWizard();\n\t\t\t\t\t} catch ( err ) {}\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_free_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.fields ) +\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\tif ( window.onBoardingData?.isSiteConnected ) {\n\t\t\t\tthis.redirectAndStartBulkSmush();\n\t\t\t} else {\n\t\t\t\tthis.redirectToConnectSite();\n\t\t\t}\n\t\t},\n\n\t\tredirectAndStartBulkSmush() {\n\t\t\tif ( window.onBoardingData?.startBulkSmushURL ) {\n\t\t\t\twindow.location.href = window.onBoardingData?.startBulkSmushURL;\n\t\t\t}\n\t\t},\n\n\t\tonFinish() {\n\t\t\twindow.SUI.closeModal();\n\t\t},\n\n\t\tredirectToConnectSite() {\n\t\t\tif ( ! window.onBoardingData?.connectSiteUrl ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twindow.location.href = window.onBoardingData?.connectSiteUrl;\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\tfields: this.fields,\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\tfields: this.fields,\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\tasync skipSetup() {\n\t\t\tconst _nonce = document.getElementById( 'smush_quick_setup_nonce' );\n\n\t\t\tthis.updateCheckboxStates();\n\n\t\t\ttry {\n\t\t\t\tawait this.trackSkipSetupWizard();\n\t\t\t} catch ( err ) {}\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\tthis.redirectBulkSmushPage();\n\t\t},\n\n\t\tredirectBulkSmushPage() {\n\t\t\tconst bulkSmushPage = window.wp_smush_msgs?.bulk_smush_url;\n\t\t\tif ( bulkSmushPage ) {\n\t\t\t\twindow.location.href = bulkSmushPage;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Hide new features modal.\n\t\t *\n\t\t * @param e\n\t\t * @param button\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\tconst isRedirectRequired = '_blank' !== button?.target;\n\t\t\tif ( isRedirectRequired ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\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\n\t\t\t\tconst actionName = redirectUrl ? 'cta_clicked' : 'closed';\n\t\t\t\ttracker.track( 'update_modal_displayed', {\n\t\t\t\t\tAction: actionName,\n\t\t\t\t} );\n\n\t\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\t\tif ( redirectUrl && isRedirectRequired ) {\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\tmaybeHandleUpsellUTMClick() {\n\t\t\tconst isConfigureSlide = 'configure' === this.settings?.slide;\n\t\t\tif ( ! isConfigureSlide ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst upsellLink = this.onboardingModal.querySelector( '.smush-btn-pro-upsell' );\n\n\t\t\tif ( upsellLink ) {\n\t\t\t\tupsellLink.addEventListener( 'click', () => {\n\t\t\t\t\tthis.upsellUTMClicked = true;\n\t\t\t\t}, { once: true } );\n\t\t\t}\n\n\t\t\tthis.trackProUpsellOnClick( upsellLink );\n\t\t},\n\t\ttrackFinishSetupWizard() {\n\t\t\treturn this.trackSetupWizard( window.onBoardingData?.isSiteConnected ? 'complete_wizard' : 'connect' );\n\t\t},\n\t\ttrackSkipSetupWizard() {\n\t\t\treturn this.trackSetupWizard( 'quit' );\n\t\t},\n\t\ttrackSetupWizard( action ) {\n\t\t\tconst isWizardQuit = 'quit' === action;\n\t\t\tconst properties = {\n\t\t\t\tAction: action,\n\t\t\t\t'Quit Step': this.getQuitStep( isWizardQuit ),\n\t\t\t\t'Settings Enabled': this.getEnabledSettings( isWizardQuit ),\n\t\t\t\t'Wizard Upsell': this.upsellUTMClicked ? 'clicked_utm' : 'na',\n\t\t\t};\n\n\t\t\tconst allowToTrack = this.fields?.usage;\n\n\t\t\treturn tracker.setAllowToTrack( allowToTrack ).track( 'Setup Wizard New', properties );\n\t\t},\n\t\tgetQuitStep( isWizardQuit ) {\n\t\t\treturn isWizardQuit ? ( this.settings.slide || 'na' ) : 'na';\n\t\t},\n\t\tgetEnabledSettings( isWizardQuit ) {\n\t\t\tif ( isWizardQuit ) {\n\t\t\t\treturn 'na';\n\t\t\t}\n\n\t\t\tconst fieldMapsForTracking = this.getFieldMapsForTracking();\n\t\t\tconst enabledSettings = [];\n\n\t\t\tObject.entries( this.fields ).forEach( ( [ setting, enabled ] ) => {\n\t\t\t\tif ( enabled ) {\n\t\t\t\t\tconst featureName = setting in fieldMapsForTracking ? fieldMapsForTracking[ setting ] : setting;\n\t\t\t\t\tenabledSettings.push( featureName );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn enabledSettings;\n\t\t},\n\t\tgetProInterests() {\n\t\t\tif ( 'pro' === this.membership || ! this.upsellUTMClicked.length ) {\n\t\t\t\treturn 'na';\n\t\t\t}\n\n\t\t\treturn this.upsellUTMClicked;\n\t\t},\n\t\tgetFieldMapsForTracking() {\n\t\t\treturn {\n\t\t\t\tusage: 'tracking',\n\t\t\t\tauto: 'auto_smush',\n\t\t\t\tlossy: 'super_smush',\n\t\t\t\tstrip_exif: 'strip_exif',\n\t\t\t\tcompress_backup: 'compress_backup',\n\t\t\t\tlazy_load: 'lazy_load',\n\t\t\t};\n\t\t},\n\t\ttrackProUpsellOnClick( upsellLink ) {\n\t\t\tif ( ! upsellLink ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupsellLink.addEventListener( 'click', ( event ) => {\n\t\t\t\tconst allowToTrack = this.fields?.usage;\n\t\t\t\ttracker.setAllowToTrack( allowToTrack );\n\t\t\t\t( new GlobalTracking() ).trackSetupWizardProUpsell( event?.target?.href, 'na' );\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.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\treturn compiled( data );\n\t\t};\n\t} );\n\n\twindow.addEventListener( 'load', () => WP_Smush.onboarding.init() );\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';\nimport loopbackTester from '../loopback-tester';\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\tconst processType = optimizeOnScanCompleted ? 'smush' : 'scan';\n\t\tloopbackTester.performTest().then( ( res ) => {\n\t\t\tconst isLoopbackHealthy = res?.loopback;\n\t\t\tif ( isLoopbackHealthy ) {\n\t\t\t\tFetcher.scanMediaLibrary.start( optimizeOnScanCompleted ).then( ( response ) => {\n\t\t\t\t\tif ( ! response?.success ) {\n\t\t\t\t\t\tthis.showFailureNotice( response );\n\t\t\t\t\t\tthis.onStartFailure( response );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis.showProgressBar().autoSyncStatus();\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tthis.showLoopbackErrorModal( processType );\n\t\t\t\tthis.onStartFailure( res );\n\t\t\t}\n\t\t} ).catch( ( error ) => {\n\t\t\tconsole.error( 'Error:', error );\n\t\t\tthis.showLoopbackErrorModal( processType );\n\t\t\tthis.onStartFailure( error );\n\t\t} );\n\t}\n\n\tonStart() {\n\t\t// Do nothing at the moment.\n\t}\n\n\tonStartFailure( response ) {\n\t\t// Do nothing at the moment.\n\t}\n\n\tshowFailureNotice( 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\tshowLoopbackErrorModal( processType ) {\n\t\tconst loopbackErrorModal = document.getElementById( 'smush-loopback-error-dialog' );\n\t\tif ( ! loopbackErrorModal || ! window.SUI ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Cache current process type.\n\t\tloopbackErrorModal.dataset.processType = processType || 'scan';\n\n\t\tWP_Smush.helpers.showModal( loopbackErrorModal.id );\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 ), { once: true } );\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\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' ).addEventListener( 'click', ( 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}, { once: true } );\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/* global ajaxurl */\n\n/**\n * WebP functionality.\n *\n * @since 3.8.0\n */\nimport Fetcher from '../utils/fetcher';\nimport NextGen from './next-gen';\n\nclass WebP extends NextGen {\n\tconstructor() {\n\t\tsuper( 'webp' );\n\n\t\tthis.recheckStatusButton = document.getElementById( 'smush-webp-recheck' );\n\t\tthis.recheckStatusLink = document.getElementById( 'smush-webp-recheck-link' );\n\t\tthis.showWizardButton = document.getElementById( 'smush-webp-toggle-wizard' );\n\t\tthis.switchWebpMethod = document.getElementById( 'smush-switch-webp-method' );\n\n\t\tthis.webpInit();\n\t}\n\n\twebpInit() {\n\t\t/**\n\t\t * Handle \"RE-CHECK STATUS' button click on WebP page.\n\t\t */\n\t\tif ( this.recheckStatusButton ) {\n\t\t\tthis.recheckStatusButton.addEventListener( 'click', ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.recheckStatus();\n\t\t\t} );\n\t\t}\n\n\t\t/**\n\t\t * Handle \"RE-CHECK STATUS' link click on WebP page.\n\t\t */\n\t\tif ( this.recheckStatusLink ) {\n\t\t\tthis.recheckStatusLink.addEventListener( 'click', ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.recheckStatus();\n\t\t\t} );\n\t\t}\n\n\t\tif ( this.showWizardButton ) {\n\t\t\tthis.showWizardButton.addEventListener(\n\t\t\t\t'click',\n\t\t\t\tthis.toggleWizard\n\t\t\t);\n\t\t}\n\n\t\tif ( this.switchWebpMethod ) {\n\t\t\tthis.switchWebpMethod.addEventListener(\n\t\t\t\t'click',\n\t\t\t\t( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.target.classList.add( 'wp-smush-link-in-progress' );\n\t\t\t\t\tthis.switchMethod( this.switchWebpMethod.dataset.method );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n\n\tswitchMethod( newMethod ) {\n\t\tFetcher.webp.switchMethod( newMethod ).then( ( res ) => {\n\t\t\tif ( ! res?.success ) {\n\t\t\t\tWP_Smush.helpers.showNotice( res );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twindow.location.reload();\n\t\t} );\n\t}\n\n\t/**\n\t * re-check server configuration for WebP.\n\t */\n\trecheckStatus() {\n\t\tthis.recheckStatusButton.classList.add( 'sui-button-onload' );\n\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.open( 'POST', ajaxurl + '?action=smush_webp_get_status', true );\n\t\txhr.setRequestHeader(\n\t\t\t'Content-type',\n\t\t\t'application/x-www-form-urlencoded'\n\t\t);\n\t\txhr.onload = () => {\n\t\t\tthis.recheckStatusButton.classList.remove( 'sui-button-onload' );\n\t\t\tlet message = false;\n\t\t\tconst res = JSON.parse( xhr.response );\n\t\t\tif ( 200 === xhr.status ) {\n\t\t\t\tconst isConfigured = res.success ? '1' : '0';\n\t\t\t\tif (\n\t\t\t\t\tisConfigured !==\n\t\t\t\t\tthis.recheckStatusButton.dataset.isConfigured\n\t\t\t\t) {\n\t\t\t\t\t// Reload the page when the configuration status changed.\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmessage = window.wp_smush_msgs.generic_ajax_error;\n\t\t\t}\n\n\t\t\tif ( res && res.data ) {\n\t\t\t\tmessage = res.data;\n\t\t\t}\n\n\t\t\tif ( message ) {\n\t\t\t\tthis.showNotice( message );\n\t\t\t}\n\t\t};\n\t\txhr.send( '_ajax_nonce=' + window.wp_smush_msgs.webp_nonce );\n\t}\n\n\ttoggleWizard( e ) {\n\t\te.currentTarget.classList.add( 'sui-button-onload' );\n\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.open(\n\t\t\t'GET',\n\t\t\tajaxurl +\n\t\t\t\t'?action=smush_toggle_webp_wizard&_ajax_nonce=' +\n\t\t\t\twindow.wp_smush_msgs.webp_nonce,\n\t\t\ttrue\n\t\t);\n\t\txhr.onload = () => location.href = window.wp_smush_msgs.nextGenURL;\n\t\txhr.send();\n\t}\n}\n\n( function() {\n\t'use strict';\n\tWP_Smush.WebP = new WebP();\n}() );\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","/* 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\tconst directorySmushUrl = `${ self.wp_smush_msgs.bulk_smush_url }&smush__directory-scan=done#directory_smush-settings-row`;\n\t\t\t\t\t\t\t\tif ( window.location.href === directorySmushUrl ) {\n\t\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\twindow.location.href = directorySmushUrl;\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}\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( 'smush__directory-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\tconst directorySmushUrl = `${ self.wp_smush_msgs.bulk_smush_url }&smush__directory-scan=done#directory_smush-settings-row`;\n\t\t\tif ( window.location.href === directorySmushUrl ) {\n\t\t\t\twindow.location.reload();\n\t\t\t} else {\n\t\t\t\twindow.location.href = directorySmushUrl;\n\t\t\t}\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","/*!\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\"&\": \"&\",\n\t\t\t\"<\": \"<\",\n\t\t\t\">\": \">\",\n\t\t\t'\"': \""\",\n\t\t\t\"'\": \"'\",\n\t\t\t\"/\": \"/\",\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...\", // … 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","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","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 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 * 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 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 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 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","/* 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 = 60000;// 60s.\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\tconst stopBulkSmushModal = document.getElementById( 'smush-stop-bulk-smush-modal' );\n\tconst holdOnNoticeElement = progressBar.querySelector( '.wp-smush-bulk-hold-on-notice' );\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\tthis.closeStopBulkSmushModal();\n\t\t\treturn this;\n\t\t},\n\t\tshow() {\n\t\t\t// Show progress bar.\n\t\t\tprogressBar.classList.remove( 'sui-hidden' );\n\t\t\tcancelBtn.onclick = this.showStopBulkSmushModal.bind( this );\n\t\t\tthis.hideBulkSmushDescription();\n\t\t\tthis.hideBulkSmushAllDone();\n\t\t\tthis.hideRecheckImagesNotice();\n\t\t},\n\t\tshowStopBulkSmushModal() {\n\t\t\tif ( ! stopBulkSmushModal ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst stopBulkSmushButton = stopBulkSmushModal.querySelector( '.smush-stop-bulk-smush-button' );\n\t\t\tstopBulkSmushButton.addEventListener( 'click', onCancelCallback, { once: true } );\n\n\t\t\t// Displays the modal with the release's higlights if it exists.\n\t\t\tconst modalId = stopBulkSmushModal.id,\n\t\t\tfocusAfterClosed = 'wpbody-content',\n\t\t\tfocusWhenOpen = undefined,\n\t\t\thasOverlayMask = false,\n\t\t\tisCloseOnEsc = false,\n\t\t\tisAnimated = true;\n\n\t\t\twindow.SUI.openModal(\n\t\t\t\tmodalId,\n\t\t\t\tfocusAfterClosed,\n\t\t\t\tfocusWhenOpen,\n\t\t\t\thasOverlayMask,\n\t\t\t\tisCloseOnEsc,\n\t\t\t\tisAnimated\n\t\t\t);\n\t\t},\n\t\tcloseStopBulkSmushModal() {\n\t\t\tif ( ! window.SUI ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst isModalClosed = ( ! stopBulkSmushModal ) || ! stopBulkSmushModal.classList.contains( 'sui-content-fade-in' );\n\t\t\tif ( isModalClosed ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twindow.SUI.closeModal( stopBulkSmushModal.id );\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\t\tshowHoldOnNotice() {\n\t\t\tif ( holdOnNoticeElement ) {\n\t\t\t\tholdOnNoticeElement.classList.remove( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t\thideHoldOnNotice() {\n\t\t\tif ( holdOnNoticeElement ) {\n\t\t\t\tholdOnNoticeElement.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t},\n\t};\n};\nexport default new SmushProgressBar();\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 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","/**\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","/**\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","/** 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 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","/* 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\t\n\tfunction insertHubConnectNotice() {\n\t\tconst mediaHubConnectNotice = $( '#smush-hub-connect-media-notice' );\n\t\tif ( ! mediaHubConnectNotice.length ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconst headerEnd = $( '.wrap > .wp-header-end' );\n\t\tif ( headerEnd.length ) {\n\t\t\theaderEnd.after( mediaHubConnectNotice.show() );\n\t\t}\n\t}\n\t\n\tinsertHubConnectNotice();\n\t\n\t$( '.smus-media-notification-skip' ).on( 'click', function ( e ) {\n\t\te.preventDefault();\n\t\t\n\t\t$.post( ajaxurl, {\n\t\t\t action: 'dismiss_media_hub_connect_notice',\n\t\t\t _ajax_nonce: window.wp_smush_msgs.nonce,\n\t\t } )\n\t\t .done( function ( response ) {\n\t\t\t if ( response && response.success ) {\n\t\t\t\t $( '#smush-hub-connect-media-notice' ).remove();\n\t\t\t }\n\t\t } )\n\t\t .fail( function () {\n\t\t\t console.error( 'Failed to dismiss the media hub connect notice.' );\n\t\t } );\n\t} );\n\t\n}( jQuery ) );\n","import Fetcher from './fetcher';\n\nclass Tracker {\n\t/* @private */\n\t#doingEvents = new Set();\n\t#allowToTrack;\n\n\ttrack( event, properties = {} ) {\n\t\tif ( ! this.allowToTrack() || this.inProgressEvent( event ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setInProgressEvent( event );\n\n\t\treturn Fetcher.common.track( event, properties ).then( ( res ) => {\n\t\t\tsetTimeout( () => {\n\t\t\t\tthis.restoreInProgressEvent( event );\n\t\t\t}, 1000 );\n\n\t\t\treturn res;\n\t\t} );\n\t}\n\n\tinProgressEvent( event ) {\n\t\treturn this.#doingEvents.has( event );\n\t}\n\n\tsetInProgressEvent( event ) {\n\t\tthis.#doingEvents.add( event );\n\t}\n\n\trestoreInProgressEvent( event ) {\n\t\tthis.#doingEvents.delete( event );\n\t}\n\n\tallowToTrack() {\n\t\treturn this.#allowToTrack || !! ( window.wp_smush_mixpanel?.opt_in );\n\t}\n\n\tsetAllowToTrack( allowToTrack ) {\n\t\tthis.#allowToTrack = allowToTrack;\n\n\t\treturn this;\n\t}\n}\n\nconst tracker = new Tracker();\n\nexport default tracker;\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","import tracker from './utils/tracker';\n\nexport default class GlobalTracking {\n\tinit() {\n\t\tthis.trackSubmenuProUpsell();\n\t\tthis.trackPluginListProUpsell();\n\t\tthis.trackDashboardWidgetProUpsell();\n\t}\n\n\ttrackSubmenuProUpsell() {\n\t\tconst submenuUpgradeLink = document.querySelector( '#toplevel_page_smush a[href*=\"utm_campaign=smush_submenu_upsell' );\n\t\tif ( submenuUpgradeLink ) {\n\t\t\tsubmenuUpgradeLink.addEventListener( 'click', ( event ) => {\n\t\t\t\tthis.trackGeneralProUpsell( 'submenu', event?.target?.href );\n\t\t\t} );\n\t\t}\n\t}\n\n\ttrackPluginListProUpsell() {\n\t\tconst pluginlistUpgradeLink = document.getElementById( 'smush-pluginlist-upgrade-link' );\n\t\tif ( pluginlistUpgradeLink ) {\n\t\t\tpluginlistUpgradeLink.addEventListener( 'click', ( event ) => {\n\t\t\t\tthis.trackGeneralProUpsell( 'plugins_list', event?.target?.href );\n\t\t\t} );\n\t\t}\n\t}\n\n\ttrackDashboardWidgetProUpsell() {\n\t\tconst upsellBox = document.getElementById( 'smush-box-dashboard-upsell-upsell' );\n\t\tif ( ! upsellBox ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst dashboardProUpsellLink = upsellBox.querySelector( 'a[href*=smush-dashboard-upsell]' );\n\t\tif ( dashboardProUpsellLink ) {\n\t\t\tdashboardProUpsellLink.addEventListener( 'click', ( event ) => {\n\t\t\t\tthis.trackGeneralProUpsell( 'dash_widget', event?.target?.href );\n\t\t\t} );\n\t\t}\n\t}\n\n\ttrackSetupWizardProUpsell( utmLink, proInterests ) {\n\t\tthis.trackGeneralProUpsell( 'wizard', utmLink, proInterests );\n\t}\n\n\ttrackGeneralProUpsell( localtion, utmLink, proInterests = 'na' ) {\n\t\tthis.trackProUpsell( {\n\t\t\tFeature: 'pro_general',\n\t\t\tLocation: localtion,\n\t\t\t'UTM Link': utmLink,\n\t\t\t'Pro Interests': proInterests,\n\t\t} );\n\t}\n\n\ttrackProUpsell( properties ) {\n\t\tproperties = Object.assign( {\n\t\t\t'User Action': 'cta_clicked',\n\t\t}, properties );\n\n\t\ttracker.track( 'smush_pro_upsell', properties );\n\t}\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\tWP_Smush.helpers.redirectToPage( '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","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 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\tclass WP_Smush_Bulk {\n\t\t#bulkSmushObj;\n\n\t\tconstructor() {\n\t\t\tthis.onClickBulkSmushNow();\n\t\t\tthis.onClickIgnoreImage();\n\t\t\tthis.onClickIgnoreAllImages();\n\t\t\tthis.onScanCompleted();\n\t\t\tthis.resumeBulkSmushHandler();\n\t\t}\n\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\tconst self = this;\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\tself.ajaxBulkSmushStart( bulkSmushButton );\n\t\t\t} );\n\t\t}\n\n\t\tresumeBulkSmushHandler() {\n\t\t\tconst resumeButton = document.querySelector( '.wp-smush-resume-bulk-smush' );\n\t\t\tif ( ! resumeButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresumeButton.addEventListener( 'click', ( e ) => {\n\t\t\t\tif ( ! this.#bulkSmushObj ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\tconst isUserClick = e.clientX > 0 && e.clientY > 0 && e.isTrusted;\n\t\t\t\tif ( ! isUserClick ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tWP_Smush_Bulk.#resumeBulkSmush( this.#bulkSmushObj );\n\t\t\t} );\n\t\t}\n\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\tthis.#bulkSmushObj = new Smush( bulkSmushButton, true );\n\t\t\tSmushProcess.setOnCancelCallback( () => {\n\t\t\t\tthis.#bulkSmushObj.cancelAjax();\n\t\t\t} ).update( 0, this.#bulkSmushObj.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.#bulkSmushObj.run();\n\t\t}\n\n\t\tstatic #resumeBulkSmush( bulkSmushObj ) {\n\t\t\tSmushProcess.disableExceedLimitMode();\n\t\t\tSmushProcess.hideBulkSmushDescription();\n\t\t\tbulkSmushObj.onStart();\n\t\t\tbulkSmushObj.callAjax();\n\t\t}\n\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 ( e.target.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\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\n\t\tonScanCompleted() {\n\t\t\tdocument.addEventListener( 'ajaxBulkSmushOnScanCompleted', ( e ) => {\n\t\t\t\tthis.ajaxBulkSmushStart();\n\t\t\t} );\n\t\t}\n\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}\n\n\tnew WP_Smush_Bulk();\n}( jQuery ) );\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\t\tlazyloadIframeCheckbox: document.getElementById( 'format-iframe' ),\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\tthis.handleEmbedVideosBoxVisibility();\n\t\t},\n\n\t\thandleEmbedVideosBoxVisibility() {\n\t\t\tif ( ! this.lazyloadIframeCheckbox ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst embedVideosBox = document.querySelector( '.lazyload-embed-videos' );\n\t\t\tif ( ! embedVideosBox ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.lazyloadIframeCheckbox.addEventListener( 'click', function() {\n\t\t\t\tif ( true === this.checked ) {\n\t\t\t\t\tembedVideosBox.classList.remove( 'sui-hidden' );\n\t\t\t\t} else {\n\t\t\t\t\tembedVideosBox.classList.add( 'sui-hidden' );\n\t\t\t\t}\n\t\t\t});\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\tWP_Smush.helpers.redirectToPage( 'lazy-preload' );\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","/* 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-preload-form' ).on( 'submit', function( e ) {\n\t\te.preventDefault();\n\t\tconst tabField = $( this ).find( '[name=\"tab\"]' );\n\t\tconst isLazyLoadPage = tabField.length && 'lazy_load' === tabField.val();\n\n\t\t$( '#save-settings-button' ).addClass( 'sui-button-onload-text' );\n\t\tsaveSettings( $( this ).serialize(), isLazyLoadPage ? 'lazy-load' : 'preload' );\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 * Next-Gen page.\n\t */\n\t$( 'form#smush-next-gen-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(), 'next-gen' );\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\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\t\n\t/**\n\t * Handle highlighting notice display based on detection checkbox state.\n\t */\n\tfunction handleHighlightingNotice( isAfterSave = false ) {\n\t\tconst detectionEnabled = $( '#detection' ).is( ':checked' );\n\t\tconst $notice = $( '.smush-highlighting-notice' );\n\t\tconst $warning = $( '.smush-highlighting-warning' );\n\t\t\n\t\tif ( ! detectionEnabled ) {\n\t\t\t$notice.hide();\n\t\t\t$warning.hide();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( isAfterSave ) {\n\t\t\t$notice.show();\n\t\t\t$warning.hide();\n\t\t} else {\n\t\t\t// Show warning only if notice isn't visible yet.\n\t\t\tconst noticeVisible = $notice.is( ':visible' ) || $notice.css( 'display' ) !== 'none';\n\t\t\tif ( noticeVisible ) {\n\t\t\t\t$notice.show();\n\t\t\t\t$warning.hide();\n\t\t\t} else {\n\t\t\t\t$notice.hide();\n\t\t\t\t$warning.show();\n\t\t\t}\n\t\t}\n\t}\n\t\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\thandleHighlightingNotice( false );\n\t} );\n\t\n\t/**\n\t * Handle settings saved event.\n\t */\n\t$( document ).on( 'onSavedSmushSettings', function () {\n\t\thandleHighlightingNotice( true );\n\t} );\n\n\t/**\n\t * Form notice via query var smush-notice handler.\n\t */\n\tconst formNoticeHandler = () => {\n\t\tif ( ! window.URL || ! window.URLSearchParams ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst url = new URL( window.location );\n\t\tconst noticeKey = url.searchParams.get( 'smush-notice' );\n\t\tif ( ! noticeKey ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.dispatchEvent(\n\t\t\tnew CustomEvent( `on-smush-${ noticeKey }-notice` )\n\t\t);\n\n\t\t// Remove the smush-notice query parameter.\n\t\turl.searchParams.delete( 'smush-notice' );\n\t\twindow.history.replaceState( {}, document.title, url.toString() );\n\t};\n\n\tformNoticeHandler();\n\n\t// Handle toggle fields.\n\tconst toggleFieldVisibility = ( fieldVisibilitySettings, fieldWrapperClassName ) => {\n\t\tfor ( const fieldName in fieldVisibilitySettings ) {\n\t\t\tconst field = document.querySelector( `[name=\"${ fieldName }\"]` );\n\t\t\tif ( ! field ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fieldWrapper = field.closest( `.${ fieldWrapperClassName }` );\n\t\t\tif ( ! fieldWrapper ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( 'show' === fieldVisibilitySettings[ fieldName ] ) {\n\t\t\t\tfieldWrapper.classList.remove( 'sui-hidden' );\n\t\t\t} else {\n\t\t\t\tfieldWrapper.classList.add( 'sui-hidden' );\n\t\t\t}\n\t\t}\n\t};\n\n\tconst toggleFieldsHandler = () => {\n\t\tconst settingsForm = document.querySelector( '.wp-smush-settings-form' );\n\t\tif ( ! settingsForm ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst fieldWrapperClassName = 'sui-box-settings-row';\n\t\tconst conditionalFields = settingsForm.querySelectorAll( '[data-toggle-fields]' );\n\t\tif ( conditionalFields ) {\n\t\t\tconditionalFields.forEach( function( conditionalField ) {\n\t\t\t\tconst fieldVisibilitySettings = JSON.parse( conditionalField.dataset.toggleFields );\n\t\t\t\tif ( ! fieldVisibilitySettings && 'object' !== typeof fieldVisibilitySettings ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconditionalField.addEventListener( 'change', function() {\n\t\t\t\t\tif ( ! this.checked ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\ttoggleFieldVisibility( fieldVisibilitySettings, fieldWrapperClassName );\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\n\t\tif ( window.SUI?.tabs ) {\n\t\t\twindow.SUI.tabs(\n\t\t\t\t{\n\t\t\t\t\tcallback( tab, panel ) {\n\t\t\t\t\t\tconst conditionalField = tab.next( '[data-toggle-fields]' );\n\t\t\t\t\t\tif ( conditionalField.length ) {\n\t\t\t\t\t\t\tconst fieldVisibilitySettings = conditionalField.data( 'toggle-fields' );\n\t\t\t\t\t\t\tif ( fieldVisibilitySettings && 'object' === typeof fieldVisibilitySettings ) {\n\t\t\t\t\t\t\t\ttoggleFieldVisibility( fieldVisibilitySettings, fieldWrapperClassName );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst childFields = panel.find( '[data-toggle-fields]' );\n\t\t\t\t\t\tif ( childFields.length ) {\n\t\t\t\t\t\t\tchildFields.each( function() {\n\t\t\t\t\t\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t\t\t\t\t\tconst fieldVisibilitySettings = $( this ).data( 'toggle-fields' );\n\t\t\t\t\t\t\t\t\tif ( fieldVisibilitySettings && 'object' === typeof fieldVisibilitySettings ) {\n\t\t\t\t\t\t\t\t\t\ttoggleFieldVisibility( fieldVisibilitySettings, fieldWrapperClassName );\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}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\ttoggleFieldsHandler();\n}( jQuery ) );\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 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","/** 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","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","/* 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.smush_global.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\treturn 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\n\t\t\tbackgroundHealthyCheck: () => {\n\t\t\t\treturn request('smush_start_background_pre_flight_check');\n\t\t\t},\n\n\t\t\tbackgroundHealthyStatus: () => {\n\t\t\t\treturn request('smush_get_background_pre_flight_status');\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\ttrack: ( event, properties ) => request('smush_analytics_track_event', {\n\t\t\t\tevent,\n\t\t\t\tproperties\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\n\t\twebp: {\n\t\t\tswitchMethod: ( method ) => {\n\t\t\t\treturn request( 'webp_switch_method', { method } );\n\t\t\t},\n\t\t},\n\n\t\tsettings: {\n\t\t\tdisconnectSite: () => {\n\t\t\t\treturn request( 'wp_smush_disconnect_site' );\n\t\t\t}\n\t\t}\n\t};\n\n\tassign(this, methods);\n}\n\nconst SmushAjax = new SmushFetcher();\nexport default SmushAjax;","/**\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","/* global WP_Smush */\n/* global ajaxurl */\n/* global _ */\n\nimport tracker from \"../utils/tracker\";\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.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\ttracker.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/* global wp_smushit_data */\n\nimport {GlobalStats} from \"../common/globalStats\";\nimport SmushProgress from \"../common/progressbar\";\n\nlet perf = 0;\n\nimport tracker from '../utils/tracker';\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.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\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\n\t\t\t// Hide and reset the progress bar when bulk smush is completed.\n\t\t\tSmushProgress.close();\n\t\t\tthis.onBulkSmushCompleted();\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( 'bulk-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( 'bulk-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}\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\n\t\tthis.bindDeferredEvents();\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\tif ( ! this.current_id ) {\n\t\t\treturn;\n\t\t}\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\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\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\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\n\t\tthis.onFinishBulkSmush();\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\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.getGlobalStats();\n\n\t\tconst failurePercentage = this.total > 0 ? Math.round( this.errors.length * 100 / this.total ) : 0;\n\n\t\ttracker.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\t'Total Enqueued Images': this.total,\n\t\t\t'Failure Percentage': failurePercentage,\n\t\t} );\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\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.onStartBulkSmush();\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\tonStartBulkSmush() {\n\t\tthis.showInProcessingNotice();\n\t}\n\n\tshowInProcessingNotice() {\n\t\tconst inProcessingNoticeElement = document.querySelector( '.ajax-bulk-smush-in-progressing-notice' );\n\t\tif ( ! inProcessingNoticeElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinProcessingNoticeElement.classList.remove( 'sui-hidden' );\n\t}\n\n\thideInProcessingNotice() {\n\t\tconst inProcessingNoticeElement = document.querySelector( '.ajax-bulk-smush-in-progressing-notice' );\n\t\tif ( ! inProcessingNoticeElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinProcessingNoticeElement.classList.add( 'sui-hidden' );\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// 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// 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\tjQuery( '.wp-smush-bulk-wrapper' ).removeClass( 'sui-hidden' );\n\n\t\t// Hide the progress bar.\n\t\tjQuery( '.wp-smush-bulk-progress-bar-wrapper' ).addClass( 'sui-hidden' );\n\n\t\tthis.hideBulkFreeLimitReachedNotice();\n\n\t\tthis.onFinishBulkSmush();\n\t}\n\n\tonFinishBulkSmush() {\n\t\tthis.hideInProcessingNotice();\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","// 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/onboarding-free' );\nrequire( './modules/directory-smush' );\nrequire( './smush/cdn' );\nrequire( './smush/webp' );\nrequire( './smush/avif' );\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":["e","t","r","Symbol","n","iterator","o","toStringTag","i","c","prototype","Generator","u","Object","create","_regeneratorDefine2","f","p","y","G","v","a","d","bind","length","l","TypeError","call","done","value","return","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","setPrototypeOf","__proto__","displayName","_regenerator","w","m","defineProperty","_invoke","enumerable","configurable","writable","asyncGeneratorStep","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","document","getElementById","WP_Smush","onboarding","membership","onboardingModal","first_slide","settings","first","last","slide","selection","usage","auto","lossy","strip_exif","original","preload_images","lazy_load","contentContainer","onboardingSlides","touchX","touchY","recheckImagesLink","proFeaturesClicked","init","this","dialog","dataset","type","ctaUrl","tracking","pop","renderTemplate","skipButton","querySelector","addEventListener","skipSetup","window","SUI","openModal","undefined","handleTouchStart","firstTouch","touches","clientX","clientY","handleTouchMove","xUp","yUp","xDiff","yDiff","Math","abs","next","_this","directionClass","updateCheckboxStates","content","template","innerHTML","classList","add","remove","setTimeout","bindSubmit","toggleSkipButton","maybeHandleProFeatureClick","input","id","checked","submitButton","self","_ref","_callee","_nonce","xhr","_context","preventDefault","trackFinishSetupWizard","XMLHttpRequest","open","ajaxurl","setRequestHeader","onload","status","onFinishingSetup","console","log","send","JSON","stringify","_x","onFinish","startRecheckImages","closeModal","location","href","whereTo","index","indexOf","newIndex","contains","goTo","target","_this2","_callee2","_context2","trackSkipSetupWizard","onSkipSetup","hideUpgradeModal","button","isRedirectRequired","redirectUrl","wp_smush_msgs","nonce","actionName","tracker","track","Action","_this$settings","_this3","upsellButton","proFeatureToggleContainer","event","matches","closest","_event$target$closest","featureName","name","handleProFeatureClicked","maybeTrackProUpsell","cacheProFeatureClick","highlightUpsellButton","offsetWidth","proFeature","includes","push","trackSetupWizard","action","_this$selection","quitWizard","properties","getQuitStep","getEnabledSettings","getProInterests","allowToTrack","setAllowToTrack","fieldMapsForTracking","getFieldMapsForTracking","setting","enabledSettings","entries","forEach","_ref2","_ref3","_slicedToArray","pro_upsell","_this4","_this4$selection","_event$target","GlobalTracking","trackSetupWizardProUpsell","_","memoize","compiled","options","evaluate","interpolate","escape","variable","data","templateSettings","module","exports","reIsUint","test","object","key","jQuery","$","on","prop","slide_symbol","find","parents","eq","slideToggle","text","objectProto","hasOwnProperty","nativeObjectToString","toString","symToStringTag","isOwn","tag","unmasked","result","baseTimes","isArguments","isArray","isBuffer","isIndex","isTypedArray","inherited","isArr","isArg","isBuff","isType","skipIndexes","String","helpers","cacheUpsellErrorCodes","formatBytes","b","thresh","units","toFixed","getSizeFromString","formattedSize","replace","trim","getFormatFromString","precise_round","num","decimals","sign","round","pow","showErrorNotice","message","noticeMessage","concat","openNotice","icon","loadingButton","resetSettings","res","parse","response","success","smush_url","prepareBulkSmushErrorRow","errorMsg","fileName","thumbnail","errorCode","thumbDiv","editLink","edit_link","tableDiv","error_ignore","btn_ignore","view_detail","upsellWithError","cacheUpsellErrorCode","isUpsellRendered","cacheRenderedUpsell","getErrorMessage","resp","responseJSON","generic_ajax_error","showNotice","notice","noticeOptions","_typeof","assign","showdismiss","autoclose","dismiss","show","label","noticeDismiss","tooltip","noticeDismissTooltip","closeNotice","renderActivationCDNNotice","upsellHtml","outerHTML","redirectToPage","page","reload","search","showModal","modalId","focusAfterClosed","focusWhenOpen","hasOverlayMask","isCloseOnEsc","isAnimated","baseRest","isIterateeCall","assigner","sources","customizer","guard","source","func","thisArg","args","ui","version","orig","uuid","widgetUuid","widgetSlice","Array","slice","cleanData","elems","events","elem","_data","triggerHandler","widget","base","existingConstructor","constructor","basePrototype","proxiedPrototype","namespace","split","fullName","Widget","extend","expr","toLowerCase","element","_createWidget","_proto","_childConstructors","each","isFunction","_super","_superApply","returnValue","__super","__superApply","widgetEventPrefix","widgetName","widgetFullName","child","childPrototype","bridge","inputIndex","inputLength","isPlainObject","fn","isMethodCall","methodValue","instance","charAt","jquery","pushStack","get","error","option","_init","defaultElement","classes","disabled","eventNamespace","bindings","hoverable","focusable","classesElementLookup","_on","destroy","style","ownerDocument","defaultView","parentWindow","_getCreateOptions","_create","_setOptionDisabled","_trigger","_getCreateEventData","noop","that","_destroy","_removeClass","off","removeData","removeAttr","parts","curOption","shift","_setOptions","_setOption","_setOptionClasses","classKey","elements","currentElements","addClass","_classes","keys","_toggleClass","enable","disable","full","processClassString","checkOption","current","unique","not","match","extra","join","_untrackClassesElement","inArray","_addClass","toggleClass","suppressDisabledCheck","handlers","delegateElement","handler","handlerProxy","hasClass","guid","eventName","selector","_off","_delay","delay","_hoverable","mouseenter","currentTarget","mouseleave","_focusable","focusin","focusout","callback","Event","originalEvent","trigger","isDefaultPrevented","hide","method","defaultEffect","hasOptions","effect","effectName","duration","isEmptyObject","complete","effects","easing","queue","cachedScrollbarWidth","max","rhorizontal","rvertical","roffset","rposition","rpercent","_position","position","getOffsets","offsets","width","height","parseFloat","parseCss","property","parseInt","css","getDimensions","raw","nodeType","offset","top","left","isWindow","scrollTop","scrollLeft","pageY","pageX","outerWidth","outerHeight","scrollbarWidth","w1","w2","div","innerDiv","children","append","clientWidth","getScrollInfo","within","overflowX","isDocument","overflowY","hasOverflowX","scrollWidth","scrollHeight","getWithinInfo","withinElement","of","atOffset","targetWidth","targetHeight","targetOffset","basePosition","dimensions","scrollInfo","collision","at","horizontalOffset","verticalOffset","pos","exec","collisionPosition","using","elemWidth","elemHeight","marginLeft","marginTop","collisionWidth","collisionHeight","myOffset","my","dir","props","right","bottom","feedback","horizontal","vertical","important","fit","newOverRight","withinOffset","collisionPosLeft","overLeft","overRight","newOverBottom","collisionPosTop","overTop","overBottom","flip","newOverLeft","offsetLeft","newOverTop","offsetTop","flipfit","keyCode","BACKSPACE","COMMA","DELETE","DOWN","END","ENTER","ESCAPE","HOME","LEFT","PAGE_DOWN","PAGE_UP","PERIOD","RIGHT","SPACE","TAB","UP","scrollParent","includeHidden","excludeStaticParent","overflowRegex","filter","parent","uniqueId","removeUniqueId","assignValue","baseAssignValue","isNew","newValue","nativeNow","Date","now","count","lastCalled","stamp","remaining","baseGetTag","isObject","_window$wp_smushit_da","wp_smushit_data","media_library_scan","in_processing","__","wp","i18n","_MediaLibraryScanner","mediaLibraryScannerOnDashboard","_classCallCheck","_callSuper","bulkSmushLink","_inherits","disableBulkSmushLink","revertBulkSmushLink","setAttribute","setInnerText","removeAttribute","revertInnerText","MediaLibraryScanner","showProgressBar","autoSyncStatus","baseIsArguments","isObjectLike","propertyIsEnumerable","getRawTag","objectToString","_NextGen","Avif","NextGen","baseSetToString","setToString","shortOut","BackgroundProcess","handle","Fetcher","background","initState","BackgroundSmush","startBtn","bo_stats","BO","bulkWrapper","reScanImagesButton","intervalHandle","cancellationInProgress","hookStatusChecks","statusSyncInProgress","statSyncInProgress","setInterval","statusSynced","syncBackgroundStatus","syncStats","finally","resetBOStatsOnStart","GlobalStats","setBoStats","is_cancelled","is_completed","processed_items","failed_items","start","onStart","loopbackTester","performTest","loopback","startBulkSmush","showLoopbackErrorModal","onStartFailure","catch","updatedStats","updateStats","renderStats","showFailureNotice","cancelBulk","loopbackErrorModal","processType","getBoStats","errors","getErrors","setErrors","cancel","_this5","setCancelButtonStateToStarted","hideProgressBar","SmushProgress","close","update","total_items","newStats","updateGlobal","global_stats","newBoStats","_objectWithoutProperties","_excluded","isChangedStats","setGlobalStats","_this6","getGlobalStats","percent_optimized","onCompletedBulk","showBulkSmushDescription","showCompletedMessage","processedWrapper","completeMessage","all_failed","isFailedAllItems","error_in_bulk","noticeType","getNoticeType","noticeIcon","iconElement","all_smushed","hideBulkSmushDescription","completeBulk","_this7","_this8","onComplete","responseErrors","_this9","in_process_notice","setNotice","is_process_stuck","showHoldOnNotice","is_dead","onDead","UpsellManger","maybeShowCDNUpsellForPreSiteOnStart","hideBulkSmushFailedNotice","setCancelButtonStateToInitial","bulkSmushFailedNotice","parentElement","clearInterval","maybeShowCDNUpsellForPreSiteOnCompleted","showRetryBulkSmushModal","_this0","retryModalElement","onclick","_this1","triggerBulkSmushButton","click","setCancelButtonLabel","setOnCancelCallback","cancelling","updateGlobalStatsFromSmushScriptData","getNative","ProductAnalytics","_defineProperty","trackUltraLinks","trackUpsellLinks","registerTroubleshootClickEvent","trackScanInterruptedEventOnStopScanningModal","trackScanInterruptedEventOnRetryScanModal","trackBulkSmushInterruptedEventOnStopBulkSmushModal","trackBulkSmushInterruptedEventOnRetryBulkSmushModal","registerBulkSmushResumeClickEvent","trackBulkSmushInterruptedEventWhenExitingAjaxBulkSmush","trackInterruptedEventFromInlineNotice","trackInterruptedEventFromLoopbackErrorModal","maybeTrackMissedEventsOnLoad","ultraUpsellLinks","querySelectorAll","getLocation","ultraLink","dashboard","bulk","directory","cdn","webp","getCurrentPageSlug","Location","upsellLinks","upsellLink","params","URL","searchParams","campaign","upsellLocations","summary_cdn","smush_bulksmush_cdn","smush_cdn_upgrade_button","smush_bulksmush_library_gif_cdn","smush_bulk_smush_complete_global","summary_local_webp","stopScanningModal","closeButton","_e$target$dataset","trackScanInterruptedEvent","Trigger","stopBulkSmushModal","_e$target$dataset2","trackBulkSmushInterruptedEvent","retryScanModal","retryButton","getScanInterruptedEventProperties","cacheMissedEvent","_e$target$dataset3","retryBulkModal","_e$target$dataset4","Troubleshoot","troubleshootClicked","canUseBackgroundOptimization","progressBar","_window$WP_Smush","ajaxBulkSmushObject","bulkSmush","ids","isFreeExceeded","getBulkSmushInterruptedEventProperties","resumeBulkSmushCount","eventData","localStorage","setItem","missedEventsKey","getItem","removeItem","getBulkSmushProcessStats","_window$WP_Smush2","totalEnqueuedImages","total","processedImages","smushed","completionPercentage","ceil","trackInterruptedEventFromInlineNoticeOnDashboard","trackBulkSmushInterruptedEventFromInlineNoticeOnBulkSmush","trackScanInterruptedEventFromInlineNoticeOnBulkSmush","dashboardBulkElement","trackBulkSmushInterruptedEventFromInlineNoticeOnDashboard","trackScanInterruptedEventFromInlineNoticeOnDashboard","trackBulkSmushInterruptedInlineNoticeEvent","triggerScanButton","recheckImagesNotice","triggerBackgroundScanImagesLink","_triggerBackgroundSca","previousElementSibling","loopbackErrorDocsLink","isTroubleshootClicked","once","_e$target$dataset5","_loopbackErrorModal$d","trackLoopbackErrorEvent","_this10","troubleshootLinks","troubleshootLink","_this11","missedEvents","getMissedEvents","clearMissedEvents","missedEvent","_this12","resumeBulkSmushButton","pageSlug","URLSearchParams","nativeKeys","overArg","root","stubFalse","freeExports","freeModule","Buffer","adminAjax","disconnectSite","btn","remove_element","el","timeout","fadeTo","slideUp","site_disconnected_success","process_smush_action","currentButton","smushAction","attr","mode","attachment_id","c_element","opacity","disable_links","oldLabel","html","post","enable_links","stats","wrapper","failed_item_smushed","Smush","updateImageStats","new_size","error_msg","showRecheckImagesNotice","updateBulkSmushContentAfterReCheck","remaining_count","showBulkSmushAllDone","hideBulkSmushAllDone","goToByScroll","animate","val","$button","_ajax_nonce","fail","always","removeClass","current_button","process_settings","scan_type","get_ui","wp_smush_options_nonce","$defaultText","$completedText","runRecheck","$el","hash","scrollTo","substring","focus","keypress","resizingWrapper","resizeCheckbox","widthInput","heightInput","inputWrapper","errorNotice","is","resize_sizes","largestWidth","largestHeight","widthError","heightError","validateResizeSettings","settings_wrap","membership_valid","membership_invalid","stats_param","dir_smush","ajax_error","stats_human","stats_percent","bytes","human","percent","combined_stats","c_stats","smush_percent","total_count","savings","update_cummulative_stats","prepend","compressionLevelNotice","compressionNoticeContent","_e$target","nodeName","note","handleCompressionLevelNotice","openNewTab","_e$detail","detail","is_outdated_stats","lossyLevelSummaryBox","currentLossyLevelTab","innerText","nextElementSibling","updateLossyLevelInSummaryBox","updatePreloadImageInSummaryBox","nativeLazyloadInput","summaryBox","preloadImagesCheckbox","isActive","toggle","noscriptFallbackField","display","preloadInput","excludeRow","fetchpriorityRow","isChecked","_step","url","_iterator","_createForOfIteratorHelper","s","startsWith","delete","err","hashToRemove","history","replaceState","cleanUrlParams","transform","arg","recheckImagesBtn","bulkSmushButton","mediaLibScanner","MediaLibraryScannerOnBulkSmush","runBulkSmushOnComplete","restoreButton","autoBulkSmushNotification","startScan","hideRecheckNotice","hideFailedBulkSmushNotice","disableRelatedButtons","setRecheckImagesButtonOnLoad","toggleBulkSmushBoxContent","_superPropGet","revertRelatedButtons","maybeHideAutoBulkSmushNotification","revertRecheckImagesButton","disableRecheckImagesButton","optimize_on_scan_completed","maybeShowAutoBulkSmushNotification","setRequiredScanForBulkSmushButton","globalStats","toggleBulkSmushDescription","is_outdated","removeScanEventFromBulkSmushButton","revertRecheckWarning","triggerBulkSmushEvent","showRecheckNoticeSuccess","recheckNotice","showAnElement","hideAnElement","recheckWarningElement","showRecheckNoticeWarning","enabled_background_process","triggerBackgroundBulkSmushEvent","triggerAjaxBulkSmushEvent","dispatchEvent","CustomEvent","resetAndHideBulkErrors","startScanThenBulkSmushOnComplete","registerScanAndBulkSmushEvent","_window$wp_smushit_da2","_window$wp_smushit_da3","showProgressErrorNoticeOnRecheckNotice","triggerBulkSmush","dismissNotices","dismissNotice","registerEventsRelatedInlineNoticeOnBulkSmushPage","cleanedURL","pushState","maybeAutoStartMediaLibraryScanOnRedirect","autoStartBulkSmushOnRedirect","registerRetryProcessFromLoopbackErrorModal","nextGenFormat","nonceField","getElementsByName","toggleModuleButton","deleteAllButton","registerGlobalEvents","registerEvents","isGlobalEventListenerAdded","onSavedNextGenSettingsHandler","showNextGenActivatedModal","showNextGenConversionChangedModal","maybeShowDeleteAllSuccessNotice","toggleModule","deleteAll","doEnable","runScan","redirectToNextGenPage","deletedAllNoticeElementID","deletedAllNoticeElement","_status$detail","_status$detail2","_status$detail3","next_gen_format_changed","webp_method_changed","activatedModalId","conversionChangedModalId","noticeParam","nextGenURL","freeGlobal","g","isLength","typedArrayTags","isMasked","toSource","reIsHostCtor","funcProto","Function","funcToString","reIsNative","RegExp","other","LoopbackTester","reject","startTest","getResult","delayTimeOnFailure","backgroundHealthyCheck","successCallback","failedCallback","errorCallback","fetchResult","backgroundHealthyStatus","maybeShowCDNActivationNotice","smush_cdn_activation_notice","upsellCdn","summarySmush","boStats","count_images","count_total","count_resize","count_skipped","count_smushed","savings_bytes","savings_resize","size_after","size_before","savings_percent","percent_grade","percent_metric","human_bytes","savings_conversion_human","savings_conversion","imageScore","logBulk","bulkSmushCountContent","allErrors","generateGlobalStatsFromSmushData","smushScriptData","reduce","some","newGlobalStats","renderScoreProgress","className","score","renderSummaryDetail","renderTotalStats","renderResizedStats","renderConversionSavings","resizeCountElement","conversionSavingsElement","renderBoxSummary","newErrors","renderErrors","errorKeys","showAnimatedUpsell","map","image_id","upsellErrorCode","error_code","error_message","file_name","resetErrors","maybeUpdateBulkSmushCountContent","newContent","coreJsData","Ctor","onBoardingTemplateID","fields","upsellUTMClicked","registerEventListeners","progressBarAnimation","_window$onBoardingDat","_window$onBoardingDat2","onBoardingData","slideKeys","slideFields","progressText","interval","min","textContent","loader","color","scanStats","maybeHandleUpsellUTMClick","slideRendered","inputs","checkbox","_window$onBoardingDat3","isSiteConnected","redirectAndStartBulkSmush","redirectToConnectSite","_window$onBoardingDat4","_window$onBoardingDat5","startBulkSmushURL","_window$onBoardingDat6","_window$onBoardingDat7","connectSiteUrl","redirectBulkSmushPage","_window$wp_smush_msgs","bulkSmushPage","bulk_smush_url","trackProUpsellOnClick","_window$onBoardingDat8","_this$fields","isWizardQuit","compress_backup","_this6$fields","autoSyncDuration","progressTimeoutId","scanProgress","scanProgressBar","optimizeOnScanCompleted","scanMediaLibrary","onShowProgressBar","reset","showStopScanningModal","onShowStopScanningModal","registerCancelProcessEvent","stopScanButton","cancelProgress","stopScanningElement","onCloseProgressBar","totalItems","getTotalItems","processedItems","getProcessedItems","setCancelButtonOnCancelling","onCancelled","onCancelFailure","resetCancelButtonOnFailure","clearProgressTimeout","closeProgressBar","closeStopScanningModal","showRetryScanModal","retryScanModalElement","updateGlobalStatsAndBulkContent","clearTimeout","getScanStatus","startTime","getTime","getStatus","beforeUpdateStatus","updateProgress","increaseDurationToHaveChangeOnProgress","onCompleted","newText","originalText","WebP","recheckStatusButton","recheckStatusLink","showWizardButton","switchWebpMethod","webpInit","recheckStatus","toggleWizard","switchMethod","newMethod","isConfigured","webp_nonce","arrayLikeKeys","baseKeys","isArrayLike","totalSteps","currentStep","failedItems","skippedItems","obj","scan","remainingSteps","step","showScanError","getProgress","onFinishStep","progress","progress_smushed","updateProgressBar","directorySmushUrl","statusText","forbiddenMessage","limitReached","bulk_resume","resume","skipped","items","failed","selected","tree","triggered","progressDialog","currentScanStep","scanner","Scanner","initFileTree","selectedFolders","getSelectedNodes","paths","folder","param","smush_path","image_list_nonce","showProgressDialog","queryString","has","smushButton","ajaxSettings","list_nonce","cache","createTree","autoCollapse","clickFolderMode","debugLevel","selectMode","tabindex","keyboard","quicksearch","lazyLoad","node","ajax","loadChildren","fixSelection3AfterClick","select","fancytree","FT","TEST_IMG","REX_HTML","REX_TOOLTIP","RECURSIVE_REQUEST_ERROR","INVALID_REQUEST_TARGET_ERROR","ENTITY_MAP","IGNORE_KEYCODES","SPECIAL_KEYCODES","MODIFIERS","MOUSE_BUTTONS","CLASS_ATTRS","CLASS_ATTR_MAP","TREE_ATTRS","NODE_ATTRS","NODE_ATTR_MAP","NODE_ATTR_LOWERCASE_MAP","NONE_NODE_DATA_MAP","active","_isArray","_assert","FancytreeNode","_findDirectChild","ptr","cl","_setChildren","_callHook","addChildren","insertBefore","origFirstChild","getFirstChild","origLastChild","getLastChild","firstNode","nodeList","splice","render","renderStatus","ul","tr","fixSelection3FromEndNodes","triggerModifyChild","addNode","getParent","getNextSibling","addPagingNode","title","strings","moreData","statusNodeType","partload","removeChild","appendSibling","applyCommand","cmd","opts","applyPatch","patch","_getResolvedPromise","IGNORE_MAP","expanded","_hasProp","_isFunction","removeChildren","isVisible","renderTitle","setExpanded","collapseSiblings","copyTo","toDict","countChildren","deep","debug","msg","unshift","consoleApply","discard","warn","resetLazy","discardMarkup","includeSelf","findAll","_makeNodeTitleMatcher","visit","findFirst","findRelatedNode","where","_changeSelectStatusAttrs","state","changed","unselectable","evalOption","unselectableStatus","partsel","callOpts","flag","isSelected","radiogroup","_walk","allSelected","someSelected","unselState","lazy","visitParents","fromDict","dict","getChildren","hasChildren","getIndex","getIndexHier","separator","digits","getParentList","substr","getKeyPath","excludeSelf","sep","keyPathSeparator","getPath","getLevel","level","dtn","ac","includeRoot","part","path","isFunc","getPrevSibling","stopOnParents","isStatusNode","extraClasses","hasFocus","focusNode","info","activeNode","isBelowOf","otherNode","isChildOf","isDescendantOf","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","Deferred","len","noAnimation","scroll","scrollIntoView","when","promise","moveTo","targetNode","prevParent","targetParent","navigate","activate","KC","setFocus","setActive","childNode","force","replaceWith","scheduleAction","ms","timer","_isNode","Error","scrollOfs","topNode","$scrollParent","$container","tbody","body","topNodeY","nodeY","containerOffsetTop","nodeHeight","span","topOfs","bottomOfs","containerHeight","$animateTarget","isParentWindow","newScrollTop","innerHeight","clientHeight","resolveWith","stop","setSelected","setStatus","details","setTitle","triggerModify","sortChildren","cmp","x","sort","recursive","rnotwhite","classNames","wasAdded","statusElem","statusClassPropName","curClasses","_trim","toggleExpanded","toggleSelected","operation","modifyChild","visitAndLoad","_recursion","loaders","visitSiblings","Fancytree","_makeHookContext","ctx","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","enableUpdate","_enableUpdate","expandAll","prev","findNextNode","startNode","_checkNode","_makeNodeTitleStartMatcher","visitRows","reverse","generateFormElements","selectedName","_id","activeName","$result","_appender","empty","insertAfter","idx","getFocusNode","getOption","optionName","searchRoot","idPrefix","ftnode","getRootNode","_hasFocus","_requestId","loadKeyPath","keyPathList","optsOrCallback","pathSegList","notifyWith","matchKey","_loadKeyPathImpl","nodeKey","remain","remainMap","tmpParent","segList","subDfd","__findChild","__lazyload","errMsg","rejectWith","reactivate","noFocus","selectAll","setOption","debugTime","time","debugTimeEnd","timeEnd","_triggerTreeEvent","_visitRowsUp","nextIdx","siblings","siblingOfs","skipFirstNode","checkFilter","nodeClick","expand","targetType","focusOnSelect","nodeSetFocus","nodeCollapseSiblings","nodeDblclick","nodeKeydown","matchNode","which","fromCharCode","specialModifiers","altKey","ctrlKey","metaKey","isAlnum","$target","handled","autoActivate","lastQuicksearchTime","lastQuicksearchTerm","eventToString","nodeSetExpanded","nodeToggleSelected","nodeSetActive","nodeLoadChildren","resultDfd","ajaxDfd","isAsync","nodePrevParent","requestId","debugDelay","random","nodeSetStatus","textStatus","jqXHR","errorObj","dataType","postProcess","enableAspx","parseJSON","errorThrown","metaData","noDataRes","nodata","noData","ctxErr","nodeLoadKeyPath","nodeRemoveChild","subCtx","nodeRemoveChildren","nodeRemoveMarkup","nodeRemoveChildMarkup","li","nodeRenderStatus","nodeRender","collapsed","_recursive","childLI","childNode1","childNode2","aria","firstTime","successorLi","parentNode","nextSibling","createElement","generateIds","appendChild","nodeRenderTitle","createNode","renderNode","$div","firstChild","nodeTitle","role","iconTooltip","ares","minExpandLevel","iconClass","_escapeTooltip","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","toggleEffect","ctx2","isInput","calledByNode","activeElement","nodeSetSelected","_lastSelectIntent","lastSelectedNode","_clearStatusNode","_setStatusNode","loadError","nodeToggleExpanded","treeClear","treeCreate","treeDestroy","$source","treeInit","checkboxAutoHide","rtl","treeLoad","$ul","rootCtx","parseHtml","_getElementDataAsDict","contents","treeRegisterNode","treeSetFocus","_lastMousedownNode","treeSetOption","callDefault","callCreate","callRender","treeStructureChanged","copyFunctionsToData","treeId","radio","_deprecationWarning","extension","extName","_extensions","_simpleDeepMerge","_subclassObject","icons","tabbable","_bind","_unbind","ns","_ns","getNode","prevPhase","phase","et","getEventTarget","getTree","buildType","_nextId","_nextNodeKey","_FancytreeClass","_FancytreeNodeClass","jquerySupports","positionMyOfs","isVersionAtLeast","assert","cond","$tree","debounce","invokeAsap","fixPositionOptions","myParts","atParts","dx","dy","tcn","getEventTargetType","orgEl","Element","HTMLDocument","nodeObject","treeOptions","defaultValue","treeOpt","nodeOpt","setSpanIcon","baseClass","$span","shiftKey","keyEventToString","overrideMethod","methodName","context","prevSuper","iPos","tmp","tmp2","$children","allData","lowerCaseAttr","$li","$liSpan","$liA","registerExtension","definition","unescapeHtml","childNodes","nodeValue","dottedVersion","major","minor","verParts","testParts","src","copy","clone","_makeVirtualFunction","prevFunc","baseFunc","proxy","prevLocal","prevSuperApply","attrName","argArray","deferred","json","uiFancytree","reMatch","unselectableIgnore","hideCheckbox","defaultKey","lazyload","loaderror","fx","removeNode","columns","systemFocusElement","viewport","ariaPropName","nodeContainerAttrName","fakeParent","class","appendTo","freeProcess","process","nodeUtil","require","binding","baseIsNative","getValue","copyObject","createAssigner","isPrototype","objValue","nativeMax","array","otherArgs","_wp$i18n","_n","percentElement","progressElement","remainingTimeElement","cancelBtn","holdOnNoticeElement","onCancelCallback","intervalProgressAnimation","progressTransitionDuration","setProperty","prevProcessedItems","cacheProcessTimePerItem","durationToHaveChangeOnProgress","timeLimitToShowNotice","updateRemainingTime","floor","currentWidth","animateProgressBar","remainingTime","calcProcessTimePerItem","formatTime","processTimePerItem","resetDurationToHaveChangeOnProgress","accumulator","processTime","increaseTime","resetHoldOnNoticeVisibility","totalMilliSeconds","totalSeconds","seconds","minutes","timeString","resetCancelButton","callBack","resetCancelButtonLabel","bulkSmushDescription","bulkRunningNotice","bulkSmushAllDone","isStateHidden","processStateStats","firstElementChild","lastElementChild","resetOriginalNotice","closeStopBulkSmushModal","showStopBulkSmushModal","hideRecheckImagesNotice","hideState","showState","inProcessNotice","progressMessage","cacheOriginalNotice","hideBulkProcessingNotice","showBulkProcessingNotice","setCountUnitText","unitText","disableExceedLimitMode","recheckImagesNoticeElement","hideHoldOnNotice","baseIsTypedArray","baseUnary","nodeIsTypedArray","uid","maskSrcKey","IE_PROTO","s3alert","removeNotice","$notice","mediaHubConnectNotice","headerEnd","after","insertHubConnectNotice","_doingEvents","WeakMap","_allowToTrack","Tracker","_classPrivateFieldInitSpec","Set","inProgressEvent","setInProgressEvent","common","restoreInProgressEvent","_classPrivateFieldGet","_window$wp_smush_mixp","wp_smush_mixpanel","opt_in","iteratee","trackSubmenuProUpsell","trackPluginListProUpsell","trackDashboardWidgetProUpsell","submenuUpgradeLink","trackGeneralProUpsell","pluginlistUpgradeLink","_event$target2","upsellBox","dashboardProUpsellLink","_event$target3","utmLink","proInterests","localtion","trackProUpsell","Feature","CDN","cdnEnableButton","cdnDisableButton","cdnStatsBox","toggle_cdn","updateStatsBox","toggleElements","spinner","unsmushed","resmush","SmushProcess","cancelAjax","run","_bulkSmushObj","_resumeBulkSmush","bulkSmushObj","callAjax","WP_Smush_Bulk","onClickBulkSmushNow","onClickIgnoreImage","onClickIgnoreAllImages","onScanCompleted","resumeBulkSmushHandler","ajaxBulkSmushStart","resumeButton","isTrusted","ignoreAll","cursor","smush","upsell_cdn","Lazyload","lazyloadEnableButton","lazyloadDisableButton","lazyloadIframeCheckbox","toggle_lazy_load","removeSpinner","removeLoaderIcon","removePlaceholder","handlePredefinedPlaceholders","handleEmbedVideosBoxVisibility","embedVideosBox","pl1","changeColor","pl2","backgroundColor","addLoaderIcon","frame","media","multiple","attachment","toJSON","imageIcon","backgroundImage","removeDiv","filename","saveSettings","showSuccessNotice","settingsUpdated","handleHighlightingNotice","isAfterSave","detectionEnabled","$warning","serialize","tabField","isLazyLoadPage","otherClass","noticeKey","formNoticeHandler","toggleFieldVisibility","fieldVisibilitySettings","fieldWrapperClassName","fieldName","field","fieldWrapper","_window$SUI","settingsForm","conditionalFields","conditionalField","toggleFields","tabs","tab","panel","childFields","toggleFieldsHandler","identity","overRest","freeSelf","constant","string","SmushAjax","request","FormData","contentType","processData","smush_global","methods","getStats","dismissId","hideModal","modalID","modal_id","restore","modal","resetModalWidth","maxWidth","confirmButton","initScan","statusDiv","item","thumb","link","perf","skip_resmush","is_bulk","setIds","is_bulk_resmush","smush_type","single_ajax_suffix","bulk_ajax_suffix","get_stats_action","smushAddParams","itm","bulkStart","singleStart","smushing","membershipValidity","all_done","html_stats","smush_vars","stats_label","enableButton","messageHolder","sync_stats","hideBulkFreeLimitReachedNotice","onBulkSmushCompleted","removeProp","bulkErrors","firstAnimatedError","showAnimatedUpsellNotice","unlimitedUpsellNotice","bulkErrorActionsElement","showBulkFreeLimitReachedNotice","bulkFreeLimitReachedNotice","_res","updateLocalizedStats","_updateProgress","continueSmush","bindDeferredEvents","newBulkSmushStarted","performance","freeExceeded","nonceValue","current_id","updateSmushIds","updateScoreProgress","singleDone","continue","processed_cdn_for_free","maybeShowUnlimitedUpsellNotice","maybeShowBulkErrorActions","trackBulkSmushCompleted","onFinishBulkSmush","totalImages","totalImagesToSmush","_GlobalStats$getGloba","failurePercentage","convertToMegabytes","sizeInBytes","sizeInMegabytes","onStartBulkSmush","showInProcessingNotice","inProcessingNoticeElement","bulkDone","abort","hideInProcessingNotice","memberValidityNotice","show_warning","isBulkResmush","sendUrl","new_bulk_smush_started","imagesToResmush","unsmushedCount","grade","percentOptimized","percentMetric","getTotalImagesToSmush","scanType","isNextgen","statsHuman","isNaN","smushedCountDiv","count_supersmushed","smushConversionSavings","conversionSavings","newSize","attachmentSize","sizeStrongEl","imageStats","is_lossy","currentId","uIndex","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","getter","__esModule","globalThis","nmd"],"sourceRoot":""}