{"version":3,"file":"../cart-update-212.min.js","sources":["cart-update-212.js"],"sourcesContent":["/**\n * Manage cart update actions.\n *\n * DEPENDS ON:\n * - jQuery // Interact with WooCommerce events\n */\n (function (root, factory) {\n\tif ( typeof define === 'function' && define.amd ) {\n\t\tdefine([], factory(root));\n\t} else if ( typeof exports === 'object' ) {\n\t\tmodule.exports = factory(root);\n\t} else {\n\t\troot.CartUpdate = factory(root);\n\t}\n})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) {\n\n\t'use strict';\n\n\tvar $ = jQuery;\n\tvar _hasJQuery = ( $ != null );\n\n\tvar _hasInitialized = false;\n\tvar _publicMethods = {};\n\tvar _settings = {\n\t\tbodyClass: 'has-fc-cart-update',\n\n\t\twrapperSelector: '.fc-wrapper',\n\t\tsectionSelector: '.fc-cart-section',\n\t\tmessagesWrapperSelector: '.woocommerce-notices-wrapper',\n\n\t\tscrollToNoticesEnabled: 'yes',\n\n\t\tsectionVisibleStateFieldSelector: '.fc-section-visible-state[type=\"hidden\"]',\n\t\tsectionVisibleStateAttribute: 'data-section-visible',\n\n\t\tcartItemsListSelector: '.woocommerce-cart-form__contents tbody',\n\t\tcartItemNotRemovedSelector: '.woocommerce-cart-form__cart-item:not( .removed ):not( .undo )',\n\n\t\tuiProcessingClass: 'processing',\n\n\t\tshippingCalcMessagesWrapperSelector: '.fc-shipping-calculator-messages',\n\n\t\tscrollOffsetSelector: '.fc-checkout-header',\n\t\tscrollBehavior: 'smooth',\n\t\tscrollOffset: 0,\n\n\t\tupdateCartFragmentsNonce: '', // Value updated during runtime\n\t}\n\tvar _xhr = false;\n\tvar _fragments = {};\n\n\n\n\t/**\n\t * METHODS\n\t */\n\n\n\n\t/**\n\t * Get the offset position of the element recursively adding the offset position of parent elements until the `stopElement` (or the `body` element).\n\t *\n\t * @param HTMLElement element Element to get the offset position for.\n\t * @param HTMLElement stopElement Parent element where to stop adding the offset position to the total offset top position of the element.\n\t *\n\t * @return int Offset position of the element until the `stopElement` or the `body` element.\n\t */\n\tvar getOffsetTop = function( element, stopElement ) {\n\t\tvar offsetTop = 0;\n\t\t\n\t\twhile( element ) {\n\t\t\t// Reached the stopElement\n\t\t\tif ( stopElement && stopElement == element ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\toffsetTop += element.offsetTop;\n\t\t\telement = element.offsetParent;\n\t\t}\n\t\t\n\t\treturn offsetTop;\n\t}\n\n\n\n\n\t/**\n\t * Maybe change visibility status of cart sections.\n\t *\n\t * @param Event _event An unused `jQuery.Event` object.\n\t * @param Array data The updated checkout data.\n\t */\n\tvar maybeChangeSectionState = function( _event, data ) {\n\t\tvar sectionElements = document.querySelectorAll( _settings.sectionSelector );\n\t\tfor ( var i = 0; i < sectionElements.length; i++ ) {\n\t\t\tvar sectionElement = sectionElements[i];\n\n\t\t\t// Handle visibility state\n\t\t\tvar visibilityHiddenField = sectionElement.querySelector( _settings.sectionVisibleStateFieldSelector );\n\t\t\tif ( visibilityHiddenField && 'no' === visibilityHiddenField.value ) {\n\t\t\t\tsectionElement.setAttribute( _settings.sectionVisibleStateAttribute, visibilityHiddenField.value );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsectionElement.removeAttribute( _settings.sectionVisibleStateAttribute );\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Maybe set the focus back to the element with focus previously to fragments replacement.\n\t *\n\t * @param HTMLElement focusedElement The current focused element.\n\t * @param mixed value Value for the current focused element.\n\t */\n\tvar maybeRefocusElement = function( focusedElement, value ) {\n\t\t// Bail if no element to focus\n\t\tif ( null === focusedElement ) { return; }\n\n\t\trequestAnimationFrame( function() {\n\t\t\tvar elementToFocus;\n\n\t\t\t// Try findind the the current focused element after updating updated element by ID\n\t\t\tif ( focusedElement.id ) {\n\t\t\t\telementToFocus = document.getElementById( focusedElement.id );\n\t\t\t}\n\t\t\t// Try findind the updated element by name\n\t\t\telse if ( focusedElement.getAttribute( 'name' ) ) {\n\t\t\t\tvar nameAttr = focusedElement.getAttribute( 'name' );\n\t\t\t\telementToFocus = document.querySelector( '[name=\"'+nameAttr+'\"]' );\n\t\t\t}\n\t\t\t// Try findind the `select2` focusable element\n\t\t\telse if ( focusedElement.closest( '.form-row' ) ) {\n\t\t\t\tvar formRow = focusedElement.closest( '.form-row' );\n\t\t\t\tif ( formRow.id ) {\n\t\t\t\t\telementToFocus = document.querySelector( '.form-row[id=\"'+formRow.id+'\"] .select2-selection' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Try setting focus if element is found\n\t\t\tif ( elementToFocus ) {\n\t\t\t\telementToFocus.focus();\n\n\t\t\t\t// Try to set current value to the focused element\n\t\t\t\tif ( null !== value && value !== elementToFocus.value ) {\n\t\t\t\t\telementToFocus.value = value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Set keyboard track position back to that previously to update\n\t\t\t\tsetTimeout( function(){\n\t\t\t\t\t// Try to set the same track position\n\t\t\t\t\tif( null !== elementToFocus.selectionStart && null !== elementToFocus.selectionEnd ) {\n\t\t\t\t\t\tif ( focusedElement.selectionStart && focusedElement.selectionEnd ) {\n\t\t\t\t\t\t\telementToFocus.selectionStart = focusedElement.selectionStart;\n\t\t\t\t\t\t\telementToFocus.selectionEnd = focusedElement.selectionEnd;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise try set the track position to the end of the field\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n\t\t\t\t\t\t// @see https://html.spec.whatwg.org/multipage/input.html#concept-input-apply\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\telementToFocus.selectionStart = elementToFocus.selectionEnd = Number.MAX_SAFE_INTEGER || 10000;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Try to select the entire content of the field\n\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select\n\t\t\t\t\t// @see https://html.spec.whatwg.org/multipage/input.html#concept-input-apply\n\t\t\t\t\telse {\n\t\t\t\t\t\ttry { elementToFocus.select(); }\n\t\t\t\t\t\tcatch { /* Do nothing */ }\n\t\t\t\t\t}\n\t\t\t\t}, 0 );\n\t\t\t}\n\t\t} );\n\t};\n\n\n\n\t/**\n\t * Maybe trigger the update cart event when the page visibility state changes.\n\t */\n\tvar maybeUpdateCartVisibilityChange = function() {\n\t\tif ( 'hidden' == document.visibilityState || 'visible' == document.visibilityState ) {\n\t\t\t$( document.body ).trigger( 'wc_fragment_refresh' );\n\t\t}\n\t};\n\n\n\n\t/**\n\t * Trigger update cart fragments for use with event handlers.\n\t */\n\tvar triggerUpdateCartFragments = function( e ) {\n\t\t_publicMethods.updateCartFragments();\n\t};\n\n\n\n\t/**\n\t * Update the cart fragments.\n\t * @throws {TypeError} Throws TypeError when used directly with event handlers because events pass the Event object as the first parameter while this function expects the first parameter to be the extra data to be sent with the AJAX request.\n\t */\n\t_publicMethods.updateCartFragments = function( data ) {\n\t\t// Cancel existing update request\n\t\tif ( _xhr ) { _xhr.abort(); }\n\n\t\t// Add security\n\t\tdata = FCUtils.extendObject( data, {\n\t\t\tsecurity: _settings.updateCartFragmentsNonce,\n\t\t} );\n\n\t\t_xhr = $.ajax({\n\t\t\ttype:\t\t'POST',\n\t\t\turl:\t\tfcSettings.wcAjaxUrl.toString().replace( '%%endpoint%%', 'fc_pro_update_cart_fragments' ),\n\t\t\tdata:\t\tdata,\n\t\t\tsuccess:\tfunction( result ) {\n\n\t\t\t\t// Reload the page if requested\n\t\t\t\tif ( result && true === result.reload ) {\n\t\t\t\t\twindow.location.reload();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get current element with focus, will reset after updating the fragments\n\t\t\t\tvar currentFocusedElement = document.activeElement;\n\t\t\t\tvar currentValue = document.activeElement.value;\n\n\t\t\t\t// Always update the fragments\n\t\t\t\tif ( result && result.fragments ) {\n\t\t\t\t\t// Try to remove select2 components from existing fields before replacing fragments\n\t\t\t\t\t$( 'select.country_select, select.state_select' ).each( function() {\n\t\t\t\t\t\tvar field = $( this );\n\t\t\t\t\t\tif ( field && false !== field.data( 'select2' ) && field.selectWoo && 'function' === typeof field.selectWoo ) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfield.select2( 'destroy' );\n\t\t\t\t\t\t\t} catch ( error ) {\n\t\t\t\t\t\t\t\ttry { field.selectWoo( 'destroy' ); }\n\t\t\t\t\t\t\t\tcatch ( error2 ) { /* Do nothing */ }\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\t$.each( result.fragments, function ( key, value ) {\n\t\t\t\t\t\t// CHANGE: Declare local variables needed for some checks before replacing the fragment\n\t\t\t\t\t\tvar fragmentToReplace = document.querySelector( key );\n\t\t\t\t\t\tvar replaceFragment = true;\n\n\t\t\t\t\t\t// CHANGE: Allow fragments to be replaced every time even when their contents are equal the existing elements in the DOM\n\t\t\t\t\t\tif ( value && -1 !== value.toString().indexOf( 'fc-fragment-always-replace' ) ) {\n\t\t\t\t\t\t\treplaceFragment = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// CHANGE: Allow fragments to be replaced every time even when their contents are equal the existing elements in the DOM\n\t\t\t\t\t\tif ( replaceFragment && ( ! _fragments || _fragments[ key ] !== value ) ) {\n\t\t\t\t\t\t\t// CHANGE: Log replaced fragment to console if debug mode is enabled.\n\t\t\t\t\t\t\tif ( fcSettings.debugMode ) {\n\t\t\t\t\t\t\t\tconsole.log( 'Replacing fragment: ' + key );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$( key ).replaceWith( value );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// CHANGE: Log skipped fragment to console if debug mode is enabled.\n\t\t\t\t\t\telse if ( fcSettings.debugMode ) {\n\t\t\t\t\t\t\tconsole.log( 'Skipping fragment: ' + key );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$( key ).unblock();\n\t\t\t\t\t} );\n\t\t\t\t\t_fragments = result.fragments;\n\t\t\t\t}\n\n\t\t\t\t// Re-set focus to the element with focus previously to updating fragments\n\t\t\t\tmaybeRefocusElement( currentFocusedElement, currentValue );\n\n\t\t\t\t// Maybe scroll to notices\n\t\t\t\tvar messagesWrapper = document.querySelector( _settings.messagesWrapperSelector );\n\t\t\t\tif ( messagesWrapper && messagesWrapper.children.length > 0 ) {\n\t\t\t\t\t_publicMethods.scrollToNotices( messagesWrapper );\n\t\t\t\t}\n\n\t\t\t\t$( document.body ).trigger( 'wc_fragments_refreshed' );\n\t\t\t\t$( document.body ).trigger( 'updated_cart_totals' );\n\t\t\t}\n\n\t\t});\n\t};\n\n\n\n\t/**\n\t * Change scroll position after changing steps.\n\t */\n\t_publicMethods.scrollToNotices = function() {\n\t\t// Bail if scroll to notices is disabled\n\t\tif ( 'yes' !== _settings.scrollToNoticesEnabled ) { return; }\n\n\t\tvar element = document.querySelector( _settings.messagesWrapperSelector );\n\t\tvar stickyElementsOffset = 0;\n\n\t\t// Maybe add sticky elements height to scroll position\n\t\tif ( window.StickyStates ) {\n\t\t\tvar maybeStickyElements = document.querySelectorAll( _settings.scrollOffsetSelector );\n\t\t\tif ( maybeStickyElements && maybeStickyElements.length > 0 ) {\n\t\t\t\tfor ( var i = 0; i < maybeStickyElements.length; i++ ) {\n\t\t\t\t\tvar stickyElement = maybeStickyElements[i];\n\t\t\t\t\tif ( StickyStates.isStickyPosition( stickyElement ) ) {\n\t\t\t\t\t\tvar height = stickyElement.getBoundingClientRect().height;\n\t\t\t\t\t\tstickyElementsOffset += height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Scroll to the top of the collapsed step\n\t\tvar elementOffset = getOffsetTop( element ) + ( _settings.scrollOffset * -1 ) + ( stickyElementsOffset * -1 );\n\t\trequestAnimationFrame( function() {\n\t\t\twindow.scrollTo( {\n\t\t\t\ttop: elementOffset,\n\t\t\t\tbehavior: _settings.scrollBehavior,\n\t\t\t} );\n\t\t} );\n\t}\n\n\t\n\n\t/**\n\t * Use the same method that WooCommerce uses to block other parts of the checkout form while updating.\n\t * The UI is unblocked by the WooCommerce `checkout.js` script (which is replaced with a modified version but keeps the same behavior)\n\t * using the checkout fragment selector, then unblocking after the checkout update is completed.\n\t *\n\t * @param HTMLElement element Element to block the UI and show the loading indicator.\n\t */\n\t_publicMethods.blockUI = function( element ) {\n\t\t$( element ).addClass( _settings.uiProcessingClass ).block( {\n\t\t\tmessage: null,\n\t\t\toverlayCSS: {\n\t\t\t\tbackground: '#fff',\n\t\t\t\topacity: 0.6\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Unblock UI element to be used again.\n\t *\n\t * @param HTMLElement element Element to get the UI unblocked.\n\t *\n\t * @see blockUI\n\t */\n\t_publicMethods.unblockUI = function( element ) {\n\t\t$( element ).removeClass( _settings.uiProcessingClass ).unblock();\n\t}\n\n\t/**\n\t * Add notices in the coupon code section.\n\t *\n\t * @param HTML content HTML content to be displayed.\n\t */\n\t _publicMethods.showShippingNotices = function( content ) {\n\t\tvar messagesWrapper = document.querySelector( _settings.shippingCalcMessagesWrapperSelector );\n\t\tif ( messagesWrapper ) {\n\t\t\tmessagesWrapper.innerHTML = content;\n\t\t}\n\t}\n\n\t/**\n\t * Remove all notices from the coupon code section.\n\t *\n\t * @param HTML content HTML content to be displayed.\n\t */\n\t_publicMethods.clearShippingNotices = function() {\n\t\tvar messagesWrapper = document.querySelector( _settings.shippingCalcMessagesWrapperSelector );\n\t\tif ( messagesWrapper ) {\n\t\t\tmessagesWrapper.innerHTML = '';\n\t\t}\n\t}\n\n\n\n\t/**\n\t * Initialize component and set related handlers.\n\t */\n\t_publicMethods.init = function( options ) {\n\t\tif ( _hasInitialized ) return;\n\n\t\t// Merge settings\n\t\t_settings = FCUtils.extendObject( _settings, options );\n\n\t\t// Add event listeners\n\t\tdocument.addEventListener( 'visibilitychange', maybeUpdateCartVisibilityChange );\n\n\t\t// Add jQuery event listeners\n\t\tif ( _hasJQuery ) {\n\t\t\t$( document.body ).on( 'wc_fragment_refresh updated_wc_div updated_shipping_method', triggerUpdateCartFragments );\n\t\t\t\n\t\t\t// After cart fragments has been updated\n\t\t\t$( document.body ).on( 'wc_fragments_refreshed', maybeChangeSectionState );\n\t\t}\n\n\t\t// Add init class\n\t\tdocument.body.classList.add( _settings.bodyClass );\n\n\t\t// Update fragments\n\t\ttriggerUpdateCartFragments();\n\n\t\t_hasInitialized = true;\n\t};\n\n\n\n\t//\n\t// Public APIs\n\t//\n\treturn _publicMethods;\n\n});\n"],"names":["root","factory","define","amd","exports","module","CartUpdate","global","this","window","maybeChangeSectionState","_event","data","sectionElements","document","querySelectorAll","_settings","sectionSelector","i","length","sectionElement","visibilityHiddenField","querySelector","sectionVisibleStateFieldSelector","value","setAttribute","sectionVisibleStateAttribute","removeAttribute","maybeUpdateCartVisibilityChange","visibilityState","$","body","trigger","triggerUpdateCartFragments","e","_publicMethods","updateCartFragments","jQuery","_hasJQuery","_hasInitialized","bodyClass","wrapperSelector","messagesWrapperSelector","scrollToNoticesEnabled","cartItemsListSelector","cartItemNotRemovedSelector","uiProcessingClass","shippingCalcMessagesWrapperSelector","scrollOffsetSelector","scrollBehavior","scrollOffset","updateCartFragmentsNonce","_xhr","_fragments","abort","FCUtils","extendObject","security","ajax","type","url","fcSettings","wcAjaxUrl","toString","replace","success","result","currentFocusedElement","currentValue","focusedElement","reload","location","activeElement","fragments","each","field","selectWoo","select2","error","error2","key","replaceFragment","indexOf","debugMode","console","log","replaceWith","unblock","requestAnimationFrame","elementToFocus","formRow","id","getElementById","getAttribute","nameAttr","closest","focus","setTimeout","selectionStart","selectionEnd","Number","MAX_SAFE_INTEGER","select","messagesWrapper","children","scrollToNotices","element","stickyElementsOffset","StickyStates","maybeStickyElements","stickyElement","isStickyPosition","getBoundingClientRect","height","elementOffset","stopElement","offsetTop","offsetParent","scrollTo","top","behavior","blockUI","addClass","block","message","overlayCSS","background","opacity","unblockUI","removeClass","showShippingNotices","content","innerHTML","clearShippingNotices","init","options","addEventListener","on","classList","add"],"mappings":"AAMC,CAAA,SAAWA,EAAMC,GACM,YAAlB,OAAOC,QAAyBA,OAAOC,IAC3CD,OAAO,GAAID,EAAY,CAAC,EACM,UAAnB,OAAOG,QAClBC,OAAOD,QAAUH,EAAY,EAE7BD,EAAKM,WAAaL,EAAY,CAE/B,EAAoB,aAAlB,OAAOM,OAAyBA,OAASC,KAAKC,QAAUD,KAAKD,OAAQ,SAAUP,GAEjF,aA4E8B,SAA1BU,EAAoCC,EAAQC,GAE/C,IADA,IAAIC,EAAkBC,SAASC,iBAAkBC,EAAUC,eAAgB,EACjEC,EAAI,EAAGA,EAAIL,EAAgBM,OAAQD,CAAC,GAAK,CAClD,IAAIE,EAAiBP,EAAgBK,GAGjCG,EAAwBD,EAAeE,cAAeN,EAAUO,gCAAiC,EAChGF,GAAyB,OAASA,EAAsBG,MAC5DJ,EAAeK,aAAcT,EAAUU,6BAA8BL,EAAsBG,KAAM,EAGjGJ,EAAeO,gBAAiBX,EAAUU,4BAA6B,CAEzE,CACD,CA2EsC,SAAlCE,IACE,UAAYd,SAASe,iBAAmB,WAAaf,SAASe,iBAClEC,EAAGhB,SAASiB,IAAK,EAAEC,QAAS,qBAAsB,CAEpD,CAOiC,SAA7BC,EAAuCC,GAC1CC,EAAeC,oBAAoB,CACpC,CAhLA,IAAIN,EAAIO,OACJC,EAAoB,MAALR,EAEfS,EAAkB,CAAA,EAClBJ,EAAiB,GACjBnB,EAAY,CACfwB,UAAW,qBAEXC,gBAAiB,cACjBxB,gBAAiB,mBACjByB,wBAAyB,+BAEzBC,uBAAwB,MAExBpB,iCAAkC,2CAClCG,6BAA8B,uBAE9BkB,sBAAuB,yCACvBC,2BAA4B,iEAE5BC,kBAAmB,aAEnBC,oCAAqC,mCAErCC,qBAAsB,sBACtBC,eAAgB,SAChBC,aAAc,EAEdC,yBAA0B,EAC3B,EACIC,EAAO,CAAA,EACPC,EAAa,GA0WjB,OAjNAlB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