Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/store/web/modules/contrib/commerce_shipping/js/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/store/web/modules/contrib/commerce_shipping/js/shipping_checkout.es6.js

/**
 * @file
 * Handles the shipping rates recalculation in checkout.
 */
((Drupal, drupalSettings, once) => {

  Drupal.shippingRecalculate = {
    recalculateButtonSelector: '',
    submitButtonSelector: '[id^=edit-actions-next]',
    wrapper: '',
    onChange(element) {
      const waitForAjaxComplete = (element) => {
        setTimeout(() => {
          // Ensure no ajax request is in progress for the element
          // being updated before triggering the recalculation.
          if (element.disabled) {
            waitForAjaxComplete(element)
            return
          }
          if (Drupal.shippingRecalculate.canRecalculateRates()) {
            Drupal.shippingRecalculate.recalculateRates()
          }
        }, 100, element)
      };

      waitForAjaxComplete(element)
    },
    init(context) {
      // Everytime a required field value is updated, attempt to trigger the
      // shipping rates recalculation if possible.
      const requiredInputs = document.getElementById(this.wrapper).querySelectorAll('input[required], select[required], input[type=checkbox]');
      if (requiredInputs.length) {
        once('shipping-recalculate', requiredInputs, context).forEach((element) => {
          element.addEventListener('change', (el) => {
            this.onChange(el.target);
          });
        });
      }
    },
    // Determines whether the shipping rates can be recalculated.
    canRecalculateRates() {
      let canRecalculate = true;
      const requiredInputs = document.getElementById(this.wrapper).querySelectorAll('input[required], select[required]');
      Array.prototype.forEach.call(requiredInputs, function(el) {
        if (!el.value) {
          canRecalculate = false;
          return false;
        }
      });

      return canRecalculate;
    },
    recalculateRates() {
      const buttons = document.querySelectorAll(this.submitButtonSelector);
      // Disable the 'Continue to Review' button while recalculating.
      if (buttons.length) {
        buttons[0].disabled = true;
      }
      document.getElementById(this.wrapper).querySelector(this.recalculateButtonSelector).dispatchEvent(new Event('mousedown'));
    }
  };

  /**
   * Handles the shipping rates recalculation in checkout.
   *
   * @type {Drupal~behavior}
   *
   * @prop {Drupal~behaviorAttach} attach
   */
  Drupal.behaviors.shippingRatesRecalculate = {
    attach(context) {
      Drupal.shippingRecalculate.wrapper = drupalSettings.commerceShipping.wrapper;
      Drupal.shippingRecalculate.recalculateButtonSelector = drupalSettings.commerceShipping.recalculateButtonSelector;
      Drupal.shippingRecalculate.init(context);
    }
  }

})(Drupal, drupalSettings, once);

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net