/**
 * Construction properties of the {@link LambdaInvokeAction Lambda invoke CodePipeline Action}.
 */
export interface LambdaInvokeActionProps extends codepipeline.CommonAwsActionProps {
  /**
   * The optional input Artifacts of the Action.
   * A Lambda Action can have up to 5 inputs.
   * The inputs will appear in the event passed to the Lambda,
   * under the `'CodePipeline.job'.data.inputArtifacts` path.
   *
   * @default the Action will not have any inputs
   * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
   */
  readonly inputs?: codepipeline.Artifact[];

  /**
   * The optional names of the output Artifacts of the Action.
   * A Lambda Action can have up to 5 outputs.
   * The outputs will appear in the event passed to the Lambda,
   * under the `'CodePipeline.job'.data.outputArtifacts` path.
   * It is the responsibility of the Lambda to upload ZIP files with the Artifact contents to the provided locations.
   *
   * @default the Action will not have any outputs
   */
  readonly outputs?: codepipeline.Artifact[];

  /**
   * A set of key-value pairs that will be accessible to the invoked Lambda
   * inside the event that the Pipeline will call it with.
   *
   * Only one of `userParameters` or `userParametersString` can be specified.
   *
   * @see https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example
   * @default - no user parameters will be passed
   */
  readonly userParameters?: { [key: string]: any };

  /**
   * The string representation of the user parameters that will be
   * accessible to the invoked Lambda inside the event
   * that the Pipeline will call it with.
   *
   * Only one of `userParametersString` or `userParameters` can be specified.
   *
   * @default - no user parameters will be passed
   */
  readonly userParametersString?: string;

  /**
   * The lambda function to invoke.
   */
  readonly lambda: lambda.IFunction;
}


/**
   * Reference a CodePipeline variable defined by the Lambda function this action points to.
   * Variables in Lambda invoke actions are defined by calling the PutJobSuccessResult CodePipeline API call
   * with the 'outputVariables' property filled.
   *
   * @param variableName the name of the variable to reference.
   *   A variable by this name must be present in the 'outputVariables' section of the PutJobSuccessResult
   *   request that the Lambda function calls when the action is invoked
   *
   * @see https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PutJobSuccessResult.html
   */
public variable(variableName: string): string {
    return this.variableExpression(variableName);
  }


protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions):
  codepipeline.ActionConfig {
    // allow pipeline to list functions
    options.role.addToPolicy(new iam.PolicyStatement({
      actions: ['lambda:ListFunctions'],
      resources: ['*'],
    }));

    // allow pipeline to invoke this lambda functionn
    this.props.lambda.grantInvoke(options.role);

    // allow the Role access to the Bucket, if there are any inputs/outputs
    if ((this.actionProperties.inputs || []).length > 0) {
      options.bucket.grantRead(options.role);
    }
    if ((this.actionProperties.outputs || []).length > 0) {
      options.bucket.grantWrite(options.role);
    }

    // allow lambda to put job results for this pipeline
    // CodePipeline requires this to be granted to '*'
    // (the Pipeline ARN will not be enough)
    this.props.lambda.addToRolePolicy(new iam.PolicyStatement({
      resources: ['*'],
      actions: ['codepipeline:PutJobSuccessResult', 'codepipeline:PutJobFailureResult'],
    }));

    return {
      configuration: {
        FunctionName: this.props.lambda.functionName,
        UserParameters: this.props.userParametersString ?? Stack.of(scope).toJsonString(this.props.userParameters),
      },
    };
  }


() => import(/* webpackChunkName: "playersList" */ '@/views/player/list.vue')


() => import('@/views/player/create.vue')


() => import('@/views/player/edit.vue')


export class DisassociateServerVirtualIpRequest {
    private 'nic_id': string | undefined;
    public body?: DisassociateServerVirtualIpRequestBody;
    public constructor(nicId?: any) {
        this['nic_id'] = nicId;
    }
    public withNicId(nicId: string): DisassociateServerVirtualIpRequest {
        this['nic_id'] = nicId;
        return this;
    }
    public set nicId(nicId: string | undefined) {
        this['nic_id'] = nicId;
    }
    public get nicId() {
        return this['nic_id'];
    }
    public withBody(body: DisassociateServerVirtualIpRequestBody): DisassociateServerVirtualIpRequest {
        this['body'] = body;
        return this;
    }
}


public withNicId(nicId: string): DisassociateServerVirtualIpRequest {
        this['nic_id'] = nicId;
        return this;
    }


public withBody(body: DisassociateServerVirtualIpRequestBody): DisassociateServerVirtualIpRequest {
        this['body'] = body;
        return this;
    }


i => contextTypeOf(ctx).includes(i)


/** Transformations related to the origin user */
export class OriginTransform extends BaseTransform {
    protected _manager = new MiddlewareManager<IExtensibleMessage>()
    private readonly _operators: number[]
    /**
     * @param operators users with OriginPermission.OPERATOR permission level
     */
    public constructor(operators: number[] = []) {
        super()
        this._operators = operators
    }
    /** Deep-copy a Transform object */
    public static from(last: OriginTransform) {
        const next = new OriginTransform(last._operators)
        next._manager = MiddlewareManager.from(last._manager)
        return next
    }
    /** Require the message to be from specific group(s) */
    public isFromGroup(...id: number[]) {
        return this._derive(async function (ctx, next) {
            if (id.includes(ctx.group_id)) await next()
        })
    }
    /** Require the message to be from specific discuss group(s) */
    public isFromDiscuss(...id: number[]) {
        return this._derive(async function (ctx, next) {
            if (id.includes(ctx.discuss_id)) await next()
        })
    }
    /** Require the message to be from specific user(s) */
    public isFromUser(...id: number[]) {
        return this._derive(async function (ctx, next) {
            if (id.includes(ctx.user_id)) await next()
        })
    }
    /** Require the message to be specific type(s) */
    public isType(...types: string[]) {
        return this._derive(async function (ctx, next) {
            if (types.some(i => contextTypeOf(ctx).includes(i))) await next()
        })
    }
    /** Require the message's sender to have a specific level of permission */
    public hasPermission(level: OriginPermission) {
        return this._derive(async function (ctx, next) {
            switch (level) {
                case OriginPermission.EVERYONE:
                    await next()
                    break
                case OriginPermission.OPERATOR:
                    if (this._operators.includes(ctx.user_id)) await next()
                    break
                case OriginPermission.ADMIN:
                    if (!ctx.sender.role || ctx.sender.role === 'admin' || ctx.sender.role === 'owner') await next()
                    break
                case OriginPermission.OWNER:
                    if (!ctx.sender.role || ctx.sender.role === 'owner') await next()
                    break
            }
        })
    }
    private _derive(mw: IMiddleware<IExtensibleMessage>) {
        const next = OriginTransform.from(this)
        next._manager = this._manager.use(mw)
        return next
    }
}


/** Permission levels of OriginTransform.hasPermission() */
export enum OriginPermission { EVERYONE, ADMIN, OWNER, OPERATOR }


/** Deep-copy a Transform object */
public static from(last: OriginTransform) {
        const next = new OriginTransform(last._operators)
        next._manager = MiddlewareManager.from(last._manager)
        return next
    }


/** Require the message to be from specific group(s) */
public isFromGroup(...id: number[]) {
        return this._derive(async function (ctx, next) {
            if (id.includes(ctx.group_id)) await next()
        })
    }


/** Require the message to be from specific discuss group(s) */
public isFromDiscuss(...id: number[]) {
        return this._derive(async function (ctx, next) {
            if (id.includes(ctx.discuss_id)) await next()
        })
    }


/** Require the message to be from specific user(s) */
public isFromUser(...id: number[]) {
        return this._derive(async function (ctx, next) {
            if (id.includes(ctx.user_id)) await next()
        })
    }


/** Require the message to be specific type(s) */
public isType(...types: string[]) {
        return this._derive(async function (ctx, next) {
            if (types.some(i => contextTypeOf(ctx).includes(i))) await next()
        })
    }


/** Require the message's sender to have a specific level of permission */
public hasPermission(level: OriginPermission) {
        return this._derive(async function (ctx, next) {
            switch (level) {
                case OriginPermission.EVERYONE:
                    await next()
                    break
                case OriginPermission.OPERATOR:
                    if (this._operators.includes(ctx.user_id)) await next()
                    break
                case OriginPermission.ADMIN:
                    if (!ctx.sender.role || ctx.sender.role === 'admin' || ctx.sender.role === 'owner') await next()
                    break
                case OriginPermission.OWNER:
                    if (!ctx.sender.role || ctx.sender.role === 'owner') await next()
                    break
            }
        })
    }


private _derive(mw: IMiddleware<IExtensibleMessage>) {
        const next = OriginTransform.from(this)
        next._manager = this._manager.use(mw)
        return next
    }


p => p.theme.breakpoints.down("md")


p => p.theme.breakpoints.up("md")


/**
 * Kubernetes
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1.21.1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
/**
* TokenReviewSpec is a description of the token authentication request.
*/
export declare class V1beta1TokenReviewSpec {
    /**
    * Audiences is a list of the identifiers that the resource server presented with the token identifies as. Audience-aware token authenticators will verify that the token was intended for at least one of the audiences in this list. If no audiences are provided, the audience will default to the audience of the Kubernetes apiserver.
    */
    'audiences'?: Array<string>;
    /**
    * Token is the opaque bearer token.
    */
    'token'?: string;
    static discriminator: string | undefined;
    static attributeTypeMap: Array<{
        name: string;
        baseName: string;
        type: string;
    }>;
    static getAttributeTypeMap(): {
        name: string;
        baseName: string;
        type: string;
    }[];
}


static getAttributeTypeMap(): {
        name: string;
        baseName: string;
        type: string;
    }[];


(name: string, document: Element | Document): Element[] => {
  return Array.from(document.querySelectorAll("meta")).filter(meta => {
    return meta.getAttribute("name") === name;
  });
}


meta => {
    return meta.getAttribute("name") === name;
  }


export default class Collapse extends React.Component<Props> {}


export interface Props {
  children: React.ReactChild,
  prefixCls: string,
  activeKey: string | string[],
  defaultActiveKey: string | string[],
  openAnimation: object,
  onChange: (key: any) => void,
  accordion: boolean,
  className: string,
  style: object,
  destroyInactivePanel: boolean,
  expandIcon: (props: object) => React.ReactNode,
}


@Entity('sougou_dict_metas')
export class SougouDictMetaEntity {
  @PrimaryColumn({ type: 'int' })
  id: number;
  @Column('text', { nullable: false })
  name: string;
  @Column('text', { nullable: true })
  createdBy: string;
  @Column('timestamp', {
    // comment: 'Unix Timestamp',
    // transformer: {
    //   from(value: any): any {
    //     if (value instanceof Date) {
    //       return value;
    //     }
    //     return value ? new Date(value * 1000) : null
    //   },
    //   to(value: any): any {
    //     if (typeof value === 'number') {
    //       return value;
    //     }
    //     return value ? Math.fround(+(value as Date) / 1000) : null
    //   }
    // }
  })
  updatedAt: Date;
  @Column('int')
  size: number;
  @Column('int')
  count: number;
  @Column('int')
  downloadCount: number;
  @Column('int', { default: 0 })
  version: number;
}


() => {
  let page: AppPage;

  beforeEach(() => {
    page = new AppPage();
  });

  it('should display welcome message', () => {
    page.navigateTo();
    expect(page.getTitleText()).toEqual('cacc-web-frontend app is running!');
  });

  afterEach(async () => {
    // Assert that there are no errors emitted from the browser
    const logs = await browser.manage().logs().get(logging.Type.BROWSER);
    expect(logs).not.toContain(jasmine.objectContaining({
      level: logging.Level.SEVERE,
    } as logging.Entry));
  });
}


() => {
    page = new AppPage();
  }


() => {
    page.navigateTo();
    expect(page.getTitleText()).toEqual('cacc-web-frontend app is running!');
  }


async () => {
    // Assert that there are no errors emitted from the browser
    const logs = await browser.manage().logs().get(logging.Type.BROWSER);
    expect(logs).not.toContain(jasmine.objectContaining({
      level: logging.Level.SEVERE,
    } as logging.Entry));
  }


() => {
  let component: DiscoverComponent;
  let fixture: ComponentFixture<DiscoverComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [DiscoverComponent],
    }).compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(DiscoverComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it("should create", () => {
    expect(component).toBeTruthy();
  });
}


() => {
    TestBed.configureTestingModule({
      declarations: [DiscoverComponent],
    }).compileComponents();
  }


() => {
    fixture = TestBed.createComponent(DiscoverComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  }


() => {
    let httpPutAction: HttpPutAction;

    beforeEach(() => {
        httpPutAction = new HttpPutAction(null, null);
    });

    it('should be created', () => {
        expect(httpPutAction).to.be.ok;
    });
}


() => {
        httpPutAction = new HttpPutAction(null, null);
    }


() => {
        expect(httpPutAction).to.be.ok;
    }


export class WowfModel implements DeserializableModel<WowfModel> {

    //TODO field name : type

    deserialize(input: any): WowfModel {
        Object.assign(this, input);
        return this;
    }
}


//TODO field name : type
deserialize(input: any): WowfModel {
        Object.assign(this, input);
        return this;
    }


(rgbString: string): boolean => {
  if (typeof rgbString !== 'string')
    throw new Error(`'rgbString' must be a string`);
  if (rgbString.startsWith('#')) return validateHexRGB(rgbString);
  else return validateFunctionalRGB(rgbString);
}


function useHookWithRefCallback<T>(init: T) {
  const [rect, setRect] = React.useState(init);
  const ref = React.useCallback((node: T) => {
    setRect(node);
  }, []);
  return [rect, ref] as const;
}


function Button({
  onClick,
  direction
}: {
  onClick: () => any
  direction: 'left' | 'right'
}) {
  return (
    <div
      className={styles.buttonWrap}
      style={{
        [direction]: 0,
        justifyContent: direction === 'left' ? 'flex-start' : 'flex-end'
      }}


export function Carousel<T>({
  id,
  data,
  renderItem,
  keyExtractor,
  inverted = false,
  ItemSeparatorComponent,
  ListEmptyComponent,
  ListHeaderComponent,
  ListFooterComponent,
  className,
  style,
  initialIndex = 0,
  onChange = () => {},
  width = 200,
  forwardRef,
  enableArrowKeys = false
}: CarouselProps<T>) {
  const [ div, internalRef ] = useHookWithRefCallback<HTMLDivElement | null>(null);
  const [index, setIndex] = React.useState(initialIndex ?? 0);
  const [ loading, setLoading ] = React.useState(true);
  const scrollTimeout = React.useRef<number | undefined>();

  React.useEffect(() => {
    if (!div) return;
    div.scrollLeft = index * width;
  }, [width]);

  React.useEffect(() => {
    setLoading(true);
    if (forwardRef) {
      forwardRef(div);
    }

    if (!div) return;

    setIndex(initialIndex);
    const newIndex = clamp(
      0,
      initialIndex,
      data.length - 1
    );
    div.scrollLeft = newIndex * width;

    // timeout prevents scroll animation on load
    let timeout = setTimeout(() => {
      setLoading(false);
    }, 50);

    return () => {
      clearTimeout(timeout);
    }
  }, [div, id]);

  const updateScroll = React.useCallback(
    (offset: number) => {
      if (!div) return;
      const newIndex = clamp(0, index + offset, data.length - 1);
      // div.scrollLeft = newIndex * width;
      div.scroll({ top: 0, left: newIndex * width, behavior: 'smooth' });
    },
    [data.length, div, index, width]
  );

  React.useEffect(() => {
    if (!enableArrowKeys || typeof window === 'undefined') {
      return;
    }

    const LEFT_ARROW = 37;
    const RIGHT_ARROW = 39;

    const handleEsc = (event: KeyboardEvent) => {
      if (event.keyCode === LEFT_ARROW) {
        updateScroll(-1);
      }

      if (event.keyCode === RIGHT_ARROW) {
        updateScroll(1);
      }
    };
    window.addEventListener('keydown', handleEsc);

    return () => {
      window.removeEventListener('keydown', handleEsc);
    };
  }, [updateScroll, enableArrowKeys]);

  if(data.length === 0) {
    return ListEmptyComponent ? (
      <>
        {ListEmptyComponent}
      </>
    ) : null;
  }

  function renderItemWithExtras(item: any, i: number) {
    return <>
      {i !== 0 ? ItemSeparatorComponent : null}
      {renderItem(item, i)}
    </>;
  }


function renderItemWithExtras(item: any, i: number) {
    return <>
      {i !== 0 ? ItemSeparatorComponent : null}


function CarouselResponsive<T>({
  ...props
}: CarouselBase<T>) {
  const [ width, setWidth ] = React.useState(0);
  const [ div, ref ] = useHookWithRefCallback<HTMLDivElement | null>(null);

  const handleResize = React.useCallback(
    () => {
      const newWidth = div?.offsetWidth ?? 0;
      if (newWidth !== width) {
        setWidth(div?.offsetWidth ?? 0);
      }
    },
    [width, div]
  );

  React.useEffect(() => {
    handleResize();
  }, [div]);

  React.useEffect(() => {
    if(process.browser && div) {
      window.addEventListener('resize', handleResize, { passive: true });
      return () => {
        window.removeEventListener('resize', handleResize);
      }
    }
  }, [div, handleResize]);

  return (
    <Carousel
      width={width}
      forwardRef={ref}
      {...props}
    />
  )
}


(node: T) => {
    setRect(node);
  }


() => {
    if (!div) return;
    div.scrollLeft = index * width;
  }


() => {
    setLoading(true);
    if (forwardRef) {
      forwardRef(div);
    }

    if (!div) return;

    setIndex(initialIndex);
    const newIndex = clamp(
      0,
      initialIndex,
      data.length - 1
    );
    div.scrollLeft = newIndex * width;

    // timeout prevents scroll animation on load
    let timeout = setTimeout(() => {
      setLoading(false);
    }, 50);

    return () => {
      clearTimeout(timeout);
    }
  }


() => {
      setLoading(false);
    }


() => {
      clearTimeout(timeout);
    }


(offset: number) => {
      if (!div) return;
      const newIndex = clamp(0, index + offset, data.length - 1);
      // div.scrollLeft = newIndex * width;
      div.scroll({ top: 0, left: newIndex * width, behavior: 'smooth' });
    }


() => {
    if (!enableArrowKeys || typeof window === 'undefined') {
      return;
    }

    const LEFT_ARROW = 37;
    const RIGHT_ARROW = 39;

    const handleEsc = (event: KeyboardEvent) => {
      if (event.keyCode === LEFT_ARROW) {
        updateScroll(-1);
      }

      if (event.keyCode === RIGHT_ARROW) {
        updateScroll(1);
      }
    };
    window.addEventListener('keydown', handleEsc);

    return () => {
      window.removeEventListener('keydown', handleEsc);
    };
  }


(event: KeyboardEvent) => {
      if (event.keyCode === LEFT_ARROW) {
        updateScroll(-1);
      }

      if (event.keyCode === RIGHT_ARROW) {
        updateScroll(1);
      }
    }


() => {
      window.removeEventListener('keydown', handleEsc);
    }


() => {
            if (crntIndex !== index) {
              setIndex(crntIndex);
              onChange(crntIndex);
            }
          }


(item: any, i: number) => (
          <React.Fragment key={keyExtractor(item, i)}>
            <div
              className


() => {
      const newWidth = div?.offsetWidth ?? 0;
      if (newWidth !== width) {
        setWidth(div?.offsetWidth ?? 0);
      }
    }


() => {
    handleResize();
  }


() => {
    if(process.browser && div) {
      window.addEventListener('resize', handleResize, { passive: true });
      return () => {
        window.removeEventListener('resize', handleResize);
      }
    }
  }


() => {
        window.removeEventListener('resize', handleResize);
      }


interface CarouselBase<T> {
  id?: string;
  data: T[];
  renderItem: (item: T, index: number) => ReactChildren;
  keyExtractor: (item: T, index: number) => string | number;
  inverted?: boolean;
  ItemSeparatorComponent?: ReactChildren;
  ListEmptyComponent?: ReactChildren;
  ListHeaderComponent?: ReactChildren;
  ListFooterComponent?: ReactChildren;
  className?: string;
  style?: React.CSSProperties;
  initialIndex?: number;
  onChange?: (index: number) => any;
  width?: number;
  enableArrowKeys?: boolean
}


interface CarouselProps<T> extends CarouselBase<T> {
  forwardRef?: ((instance: HTMLDivElement | null) => void) | null
}


cn(
        className,
        styles


keyExtractor(item, i)


renderItemWithExtras(item, i)


() => {
  const [response, setResponse] = useState<DebugResponse | null>(null)
  const [host, setHost] = useState("127.0.0.1")
  const [port, setPort] = useState("45678")
  const [endpoint, setEndpoint] = useState("search")
  const [requestBody, setRequestBody] = useState("")
  const [loading, setLoading] = useState(false)

  const handleRequest = async () => {
    setLoading(true)

    console.log("Sending Request Body", JSON.parse(requestBody))

    try {
      const searchResult = await axios.request<DebugResponse>({
        method: "post",
        url: `http://${host}:${port}/${endpoint}`,
        data: requestBody,
        headers: {
          mode: "no-cors",
        },
      })

      console.log("Search Result:", searchResult)
      setLoading(false)

      if (searchResult.data) {
        setResponse(searchResult.data)
      }
    } catch (e) {
      setLoading(false)
      alert("Error: " + e)
    }
  }

  return (
    <Container data-name="debuggingTool">
      <Grid container spacing={2}>
        <Grid item xs={12}>
          <Card>
            <CardContent>
              <Grid container spacing={2}>
                <Grid item xs={4}>
                  <TextInput
                    label="Host"
                    variant="outlined"
                    value={host}
                    onChange={(e)


async () => {
    setLoading(true)

    console.log("Sending Request Body", JSON.parse(requestBody))

    try {
      const searchResult = await axios.request<DebugResponse>({
        method: "post",
        url: `http://${host}:${port}/${endpoint}`,
        data: requestBody,
        headers: {
          mode: "no-cors",
        },
      })

      console.log("Search Result:", searchResult)
      setLoading(false)

      if (searchResult.data) {
        setResponse(searchResult.data)
      }
    } catch (e) {
      setLoading(false)
      alert("Error: " + e)
    }
  }


export type ResponseMode = "text" | "image" | "audio" | "video"


export type Route = {
  end_time: string
  start_time: string
  pod: string
  pod_id: string
}


export type Score = {
  description: string
  op_name: string
  ref_id: string
  operands?: Score[]
  value?: number
}


export type Match = {
  id: string
  scores: {
    values: {
      [key: string]: Score
    }
  }
  mime_type: string
  adjacency?: number
  granularity?: number
  text?: string
  uri?: string
}


export type Chunk = {
  id: string
  granularity?: number
  content_hash: string
  mime_type: string
  parent_id: string
  text?: string
  uri?: string
  matches: Match[]
}


export type Doc = {
  id: string
  tags: { [key: string]: string }
  adjacency?: number
  modality?: string
  score?: { value: number }
  text?: string
  uri?: string
  mime_type?: string
  matches?: Match[]
  chunks?: Chunk[]
}


export type DebugResponse = {
  request_id: string
  parameters: { mode: ResponseMode }
  routes: Route[]
  header: {
    exec_endpoint: string
  }
  data: { docs: Doc[] } | Doc[]
}


(path:string) => {

  if (fs.existsSync(path)) {
     return dotenv.parse(fs.readFileSync(path, 'utf8').toString())
  }

 return {};

}


(attributes: any) => {

    const { envPath, env, cwd } = attributes;

    const newAttributes = { ...attributes };

    newAttributes.cwd = path.join(process.cwd(), cwd);
    newAttributes.pkgJson = require(path.join(newAttributes.cwd, "package.json"));

    if(envPath) {
        newAttributes.env = {
            ...env,
            ...getEnv(path.join(newAttributes.cwd, envPath))
        }
    }

    return newAttributes;
}


(cwd:string) => {

    const absolutePath = cwd ? path.join(process.cwd(), cwd) : process.cwd();
    const pathMatch = absolutePath.match(/.*\/(src\/.*)/);
    const relativePath = pathMatch ? pathMatch[1] : "";

    return {
        absolutePath,
        relativePath
    }
}


(opts?:any) => {

    const { isServerless=false } = opts || {};

    const {
        TWILIO_ACCOUNT_SID,
        TWILIO_AUTH_TOKEN,
        TWILIO_USERNAME,
        TWILIO_PASSWORD
    } = process.env;

    if(isServerless) {

        return new TwilioServerlessApiClient({
            username: (TWILIO_USERNAME || TWILIO_ACCOUNT_SID)!,
            password: (TWILIO_PASSWORD || TWILIO_AUTH_TOKEN)!
        })

    }

    return TWILIO_USERNAME ?
        twilio(TWILIO_USERNAME, TWILIO_PASSWORD, { accountSid: TWILIO_ACCOUNT_SID }) :
        twilio(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN);
}


props => props.theme.space.sm


props => props.theme.lineHeights.xl


props => props.theme.fontSizes.xl


() => (
  <Dropdown onSelect={(selectedKey: any)


(data: any) => {
            /**
             * Ensure correct placement relative to trigger
             **/
            data.offsets.popper.top -= 2;

            return data;
          }


({ foo }) => (
  <div role="grid"


data => (
            <Row key={data.id}


interface IRow {
  id: number;
  subject: string;
  requester: string;
  requested: string;
  type: string;
}


/*
 * Copyright 2021 Marcus Portmann
 *
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * The Session class holds the information for an active user session associated with an
 * authenticated user. All values are stored as strings to support the serialization of the user
 * session.
 *
 * @author Marcus Portmann
 */
export class Session {

  /**
   * The base-64 encoded OAuth2 JWT access token for the user session.
   */
  accessToken: string;

  /**
   * The date and time the OAuth2 JWT access token for the user session will expire.
   */
  accessTokenExpiry?: Date;

  /**
   * The codes for the functions assigned to the user associated with the user session.
   */
  functionCodes: string[];

  /**
   * The name of the user.
   */
  name: string;

  /**
   * The base-64 encoded OAuth2 refresh token for the user session.
   */
  refreshToken?: string;

  /**
   * The codes for the roles assigned to the user associated with the user session.
   */
  roleCodes: string[];

  /**
   * The OAuth2 scopes for the user session.
   */
  scopes: string[];

  /**
   * The ID for the selected tenant for the user session.
   */
  tenantId?: string;

  /**
   * The IDs for tenants the user is associated with.
   */
  tenantIds: string[];

  /**
   * The ID for the user directory the user is associated with.
   */
  userDirectoryId: string;

  /**
   * The username for the user, the user session is associated with.
   */
  username: string;

  /**
   * Constructs a new Session.
   *
   * @param username          The username for the user the user session is associated with.
   * @param userDirectoryId   The ID for the user directory the
   *                          user is associated with.
   * @param name              The name of the user.
   * @param scopes            The OAuth2 scopes for the user session.
   * @param roleCodes         The codes for the roles assigned to the user associated with
   *                          the user session.
   * @param functionCodes     The codes for the functions assigned to the user associated
   *                          with the user session.
   * @param tenantIds         The IDs for the tenants the user
   *                          is associated with.
   * @param accessToken       The base-64 encoded OAuth2 JWT access token for the user session.
   * @param accessTokenExpiry The string representation of the epoch timestamp giving the date and
   *                          time the OAuth2 JWT access token for the user session will expire.
   * @param refreshToken      The base-64 encoded OAuth2 refresh token for the user session.
   */
  constructor(username: string, userDirectoryId: string, name: string, scopes: string[],
              roleCodes: string[], functionCodes: string[], tenantIds: string[],
              accessToken: string, accessTokenExpiry?: Date, refreshToken?: string) {
    this.username = username;
    this.userDirectoryId = userDirectoryId;
    this.name = name;
    this.scopes = scopes;
    this.roleCodes = roleCodes;
    this.functionCodes = functionCodes;
    this.tenantIds = tenantIds;
    this.accessToken = accessToken;
    this.accessTokenExpiry = accessTokenExpiry;
    this.refreshToken = refreshToken;
  }

  /**
   * Confirm that the user associated with the session has the specified authority.
   *
   * @param requiredAuthority The required authority.
   *
   * @return True if the user associated with the session has the specified authority or false
   *         otherwise.
   */
  hasAuthority(requiredAuthority: string): boolean {
    if (requiredAuthority.startsWith('ROLE_')) {
      if (requiredAuthority.length < 6) {
        return false;
      } else {
        return this.hasRole(requiredAuthority.substr(5));
      }
    }

    if (requiredAuthority.startsWith('FUNCTION_')) {
      if (requiredAuthority.length < 10) {
        return false;
      } else {
        return this.hasFunction(requiredAuthority.substr(9));
      }
    }

    return false;
  }

  /**
   * Confirm that the user associated with the session has been assigned the required function.
   *
   * @param requiredFunctionCode The code for the required function.
   *
   * @return True if the user associated with the session has been assigned the required function
   *         or false otherwise.
   */
  hasFunction(requiredFunctionCode: string): boolean {
    for (const functionCode of this.functionCodes) {
      if (functionCode.localeCompare(requiredFunctionCode, undefined, {sensitivity: 'accent'}) === 0) {
        return true;
      }
    }

    return false;
  }

  /**
   * Confirm that the user associated with the session has been assigned the required role.
   *
   * @param requiredRoleCode The code for the required role.
   *
   * @return True if the user associated with the session has been assigned the required role or
   *         false otherwise.
   */
  hasRole(requiredRoleCode: string): boolean {
    for (const roleCode of this.roleCodes) {
      if (roleCode.localeCompare(requiredRoleCode, undefined, {sensitivity: 'accent'}) === 0) {
        return true;
      }
    }

    return false;
  }
}


/**
   * Confirm that the user associated with the session has the specified authority.
   *
   * @param requiredAuthority The required authority.
   *
   * @return True if the user associated with the session has the specified authority or false
   *         otherwise.
   */
hasAuthority(requiredAuthority: string): boolean {
    if (requiredAuthority.startsWith('ROLE_')) {
      if (requiredAuthority.length < 6) {
        return false;
      } else {
        return this.hasRole(requiredAuthority.substr(5));
      }
    }

    if (requiredAuthority.startsWith('FUNCTION_')) {
      if (requiredAuthority.length < 10) {
        return false;
      } else {
        return this.hasFunction(requiredAuthority.substr(9));
      }
    }

    return false;
  }


/**
   * Confirm that the user associated with the session has been assigned the required function.
   *
   * @param requiredFunctionCode The code for the required function.
   *
   * @return True if the user associated with the session has been assigned the required function
   *         or false otherwise.
   */
hasFunction(requiredFunctionCode: string): boolean {
    for (const functionCode of this.functionCodes) {
      if (functionCode.localeCompare(requiredFunctionCode, undefined, {sensitivity: 'accent'}) === 0) {
        return true;
      }
    }

    return false;
  }


/**
   * Confirm that the user associated with the session has been assigned the required role.
   *
   * @param requiredRoleCode The code for the required role.
   *
   * @return True if the user associated with the session has been assigned the required role or
   *         false otherwise.
   */
hasRole(requiredRoleCode: string): boolean {
    for (const roleCode of this.roleCodes) {
      if (roleCode.localeCompare(requiredRoleCode, undefined, {sensitivity: 'accent'}) === 0) {
        return true;
      }
    }

    return false;
  }


function Layout(props) {
    return (
        <div
            className={`${bulmaStyles.hero} ${bulmaStyles.isFullheight} ${
                layoutStyles.isFullheight
            }`}


export declare function switchMode(mode: Mode): Mode;


export declare enum Mode {
    Dark = 0,
    Light = 1
}


(plotDiv: HTMLDivElement | null): void => {
    this.plotDiv = plotDiv;
  }


(): Figure => {
    const figure = this.props.data;

    if (typeof figure === "string") {
      return JSON.parse(figure);
    }

    // The Plotly API *mutates* the figure to include a UID, which means
    // they won't take our frozen objects
    if (Object.isFrozen(figure)) {
      return cloneDeep(figure);
    }

    const { data = {}, layout = {} } = figure;
    return {
      data,
      layout,
    };
  }


(gd: any) => {
    this.Plotly.toImage(gd).then(function (dataUrl) {
      const electron = require("electron") as typeof import("electron");

      electron.remote.getCurrentWebContents().downloadURL(dataUrl);
    });
  }


declare class PlotlyHTMLElement extends HTMLDivElement {
  data: Record<string, any>;
  layout: Record<string, any>;
  newPlot: () => void;
  redraw: () => void;
}


export class PlotlyTransform extends React.Component<Props> {
  static defaultProps = {
    data: "",
    mediaType: "application/vnd.plotly.v1+json",
  };
  plotDiv: HTMLDivElement | null;
  Plotly: {
    newPlot: (
      div: HTMLDivElement | null | void,
      data: Record<string, any>,
      layout: FigureLayout
    ) => void;
    redraw: (div?: PlotlyHTMLElement) => void;
    toImage: (gd: any) => Promise<string>;
  };

  constructor(props: Props) {
    super(props);
    this.downloadImage = this.downloadImage.bind(this);
  }

  componentDidMount(): void {
    // Handle case of either string to be `JSON.parse`d or pure object
    const figure = this.getFigure();
    this.Plotly = require("@nteract/plotly");
    this.Plotly.newPlot(this.plotDiv, figure.data, figure.layout, {
      modeBarButtonsToRemove: ["toImage"],
      modeBarButtonsToAdd: [
        {
          name: "Download plot as a png",
          icon: this.Plotly.Icons.camera,
          click: this.downloadImage,
        },
      ],
    });
  }

  shouldComponentUpdate(nextProps: Props): boolean {
    return this.props.data !== nextProps.data;
  }

  componentDidUpdate() {
    const figure = this.getFigure();

    if (!this.plotDiv) {
      return;
    }

    const plotDiv: PlotlyHTMLElement = this.plotDiv as any;
    plotDiv.data = figure.data;
    plotDiv.layout = figure.layout;
    this.Plotly.redraw(plotDiv);
  }

  plotDivRef = (plotDiv: HTMLDivElement | null): void => {
    this.plotDiv = plotDiv;
  };
  getFigure = (): Figure => {
    const figure = this.props.data;

    if (typeof figure === "string") {
      return JSON.parse(figure);
    }

    // The Plotly API *mutates* the figure to include a UID, which means
    // they won't take our frozen objects
    if (Object.isFrozen(figure)) {
      return cloneDeep(figure);
    }

    const { data = {}, layout = {} } = figure;
    return {
      data,
      layout,
    };
  };
  downloadImage = (gd: any) => {
    this.Plotly.toImage(gd).then(function (dataUrl) {
      const electron = require("electron") as typeof import("electron");

      electron.remote.getCurrentWebContents().downloadURL(dataUrl);
    });
  };

  render() {
    const { layout } = this.getFigure();
    const style: Record<string, any> = {};

    if (layout && layout.height && !layout.autosize) {
      style.height = layout.height;
    }

    return <div ref={this.plotDivRef} style={style} />;
  }
}


interface Props {
  data: string | Record<string, any>;
  mediaType: "application/vnd.plotly.v1+json";
}


interface FigureLayout extends ObjectType {
  height?: string;
  autosize?: boolean;
}


interface Figure extends ObjectType {
  data: Record<string, any>;
  layout: FigureLayout;
}


type ObjectType = Record<string, any>;


componentDidMount(): void {
    // Handle case of either string to be `JSON.parse`d or pure object
    const figure = this.getFigure();
    this.Plotly = require("@nteract/plotly");
    this.Plotly.newPlot(this.plotDiv, figure.data, figure.layout, {
      modeBarButtonsToRemove: ["toImage"],
      modeBarButtonsToAdd: [
        {
          name: "Download plot as a png",
          icon: this.Plotly.Icons.camera,
          click: this.downloadImage,
        },
      ],
    });
  }


shouldComponentUpdate(nextProps: Props): boolean {
    return this.props.data !== nextProps.data;
  }


componentDidUpdate() {
    const figure = this.getFigure();

    if (!this.plotDiv) {
      return;
    }

    const plotDiv: PlotlyHTMLElement = this.plotDiv as any;
    plotDiv.data = figure.data;
    plotDiv.layout = figure.layout;
    this.Plotly.redraw(plotDiv);
  }


render() {
    const { layout } = this.getFigure();
    const style: Record<string, any> = {};

    if (layout && layout.height && !layout.autosize) {
      style.height = layout.height;
    }

    return <div ref={this.plotDivRef} style={style} />;
  }


theme => ({
    root: {
        position: 'relative',
    },
    border: {
        width: theme.spacing(5),
        height: theme.spacing(2),
        borderRadius: theme.spacing(3),
        border: '3px solid',
        borderColor: theme.palette.divider,
        backgroundColor: 'transparent',
        [theme.breakpoints.up('md')]: {
            width: theme.spacing(6),
            height: theme.spacing(3),
        }
    },
    borderDark: {
        borderColor: colors.indigo[700],
    },
    modeToggler: {
        position: 'absolute',
        top: `-${theme.spacing(1 / 2)}px`,
        left: `-${theme.spacing(1 / 2)}px`,
        width: theme.spacing(3),
        height: theme.spacing(3),
        borderRadius: '50%',
        backgroundColor: theme.palette.text.primary,
        transition: `transform .3s cubic-bezier(.4,.03,0,1)`,
        cursor: 'pointer',
        [theme.breakpoints.up('md')]: {
            width: theme.spacing(4),
            height: theme.spacing(4),
        }
    },
    modeTogglerDark: {
        transform: `translateX(${theme.spacing(3)}px)`,
        backgroundColor: colors.indigo[900],
    },
    modeTogglerIcon: {
        fill: theme.palette.secondary.main,
        marginTop: theme.spacing(1 / 2),
        marginLeft: theme.spacing(1 / 2),
        [theme.breakpoints.up('md')]: {
            marginTop: theme.spacing(1),
            marginLeft: theme.spacing(1),
        }
    },
})


export interface Globals {
    config: Config
    bot_presets: BotPreset[]
    BotWeaponScatterings: BotWeaponScattering[]
    ItemPresets: ItemPresets
    HealthEffect: null
}


export interface BotWeaponScattering {
    Name: string
    PriorityScatter1meter: number
    PriorityScatter10meter: number
    PriorityScatter100meter: number
}


export interface The5841474424597759_Ba49Be91 {
    _id: string
    _type: Type
    _changeWeaponName: boolean
    _name: string
    _parent: string
    _items: The5841474424597759Ba49Be91Item[]
    _encyclopedia?: string
}


export interface The5841474424597759Ba49Be91Item {
    _id: string
    _tpl: string
    upd?: PurpleUpd
    parentId?: string
    slotId?: string
}


export interface PurpleUpd {
    FireMode: FireModeClass
}


export interface FireModeClass {
    FireMode: FireModeEnum
}


export interface The584147732459775_A2B6D9F12 {
    _id: string
    _type: Type
    _changeWeaponName: boolean
    _name: string
    _parent: string
    _items: The584147732459775A2B6D9F12Item[]
    _encyclopedia?: string
}


export interface The584147732459775A2B6D9F12Item {
    _id: string
    _tpl: string
    upd?: FluffyUpd
    parentId?: string
    slotId?: string
}


export interface FluffyUpd {
    Foldable?: Foldable
    FireMode?: FireModeClass
}


export interface Foldable {
    Folded: boolean
}


export interface The5841482_E2459775A050Cdda9 {
    _id: string
    _type: Type
    _changeWeaponName: boolean
    _name: string
    _parent: string
    _items: The5841482E2459775A050Cdda9Item[]
    _encyclopedia?: string
}


export interface The5841482E2459775A050Cdda9Item {
    _id: string
    _tpl: string
    parentId?: string
    slotId?: string
}


export interface The59411_Abb86F77478F702B5D2 {
    _id: string
    _type: Type
    _changeWeaponName: boolean
    _name: string
    _parent: string
    _items: The59411Abb86F77478F702B5D2Item[]
    _encyclopedia?: string
}


export interface The59411Abb86F77478F702B5D2Item {
    _id: string
    _tpl: string
    parentId?: string
    slotId?: string
    upd?: TentacledUpd
}


export interface TentacledUpd {
    StackObjectsCount: number
}


export interface The5_Ddbbeac582Ed30A6134E577 {
    _id: string
    _type: Type
    _changeWeaponName: boolean
    _name: string
    _parent: string
    _items: The5Ddbbeac582Ed30A6134E577Item[]
}


export interface The5Ddbbeac582Ed30A6134E577Item {
    _id: string
    _tpl: string
    upd?: StickyUpd
    parentId?: string
    slotId?: string
    location?: number
}


export interface StickyUpd {
    Foldable?: Foldable
    FireMode?: FireModeClass
    StackObjectsCount?: number
}


export interface The5E0354F786F77425B53Eb6C5 {
    _id: string
    _type: Type
    _changeWeaponName: boolean
    _name: string
    _parent: string
    _items: The5E0354F786F77425B53Eb6C5Item[]
    _encyclopedia: string
}


export interface The5E0354F786F77425B53Eb6C5Item {
    _id: string
    _tpl: string
    upd?: StickyUpd
    parentId?: string
    slotId?: string
}


export interface BotPreset {
    UseThis: boolean
    Role: string
    BotDifficulty: string
    VisibleAngle: number
    VisibleDistance: number
    ScatteringPerMeter: number
    HearingSense: number
    SCATTERING_DIST_MODIF: number
    MAX_AIMING_UPGRADE_BY_TIME: number
    FIRST_CONTACT_ADD_SEC: number
    COEF_IF_MOVE: number
}


export interface Config {
    content: Content
    AimPunchMagnitude: number
    WeaponSkillProgressRate: number
    SkillAtrophy: boolean
    exp: Exp
    t_base_looting: number
    t_base_lockpicking: number
    armor: Armor
    SessionsToShowHotKeys: number
    MaxBotsAliveOnMap: number
    SavagePlayCooldown: number
    SavagePlayCooldownNdaFree: number
    MarksmanAccuracy: number
    SavagePlayCooldownDevelop: number
    TODSkyDate: string
    Mastering: Mastering[]
    GlobalItemPriceModifier: number
    TradingUnlimitedItems: boolean
    MaxLoyaltyLevelForAll: boolean
    GlobalLootChanceModifier: number
    TimeBeforeDeploy: number
    TimeBeforeDeployLocal: number
    LoadTimeSpeedProgress: number
    BaseLoadTime: number
    BaseUnloadTime: number
    BaseCheckTime: number
    Customization: Customization
    UncheckOnShot: boolean
    BotsEnabled: boolean
    ArmorMaterials: ArmorMaterials
    LegsOverdamage: number
    HandsOverdamage: number
    StomachOverdamage: number
    Health: ConfigHealth
    rating: Rating
    tournament: Tournament
    RagFair: RagFair
    handbook: Handbook
    FractureCausedByFalling: FractureCausedByBulletHit
    FractureCausedByBulletHit: FractureCausedByBulletHit
    WAVE_COEF_LOW: number
    WAVE_COEF_MID: number
    WAVE_COEF_HIGH: number
    WAVE_COEF_HORDE: number
    Stamina: Stamina
    StaminaRestoration: StaminaDrainClass
    StaminaDrain: StaminaDrainClass
    RequirementReferences: RequirementReferences
    RestrictionsInRaid: RestrictionsInRAID[]
    SkillMinEffectiveness: number
    SkillFatiguePerPoint: number
    SkillFreshEffectiveness: number
    SkillFreshPoints: number
    SkillPointsBeforeFatigue: number
    SkillFatigueReset: number
    EventType: string[]
    WalkSpeed: SprintSpeed
    SprintSpeed: SprintSpeed
    SkillEnduranceWeightThreshold: number
    TeamSearchingTimeout: number
    Insurance: Insurance
    SkillExpPerLevel: number
    GameSearchingTimeout: number
    WallContusionAbsorption: SprintSpeed
    SkillsSettings: SkillsSettings
    AzimuthPanelShowsPlayerOrientation: boolean
    Aiming: Aiming
    Malfunction: Malfunction
    Overheat: Overheat
    FenceSettings: FenceSettings
    TestValue: number
    Inertia: Inertia
    Ballistic: Ballistic
}


export interface Aiming {
    ProceduralIntensityByPose: SprintSpeed
    AimProceduralIntensity: number
    HeavyWeight: number
    LightWeight: number
    MaxTimeHeavy: number
    MinTimeHeavy: number
    MaxTimeLight: number
    MinTimeLight: number
    RecoilScaling: number
    RecoilDamping: number
    CameraSnapGlobalMult: number
    RecoilXIntensityByPose: SprintSpeed
    RecoilYIntensityByPose: SprintSpeed
    RecoilZIntensityByPose: SprintSpeed
    RecoilCrank: boolean
    RecoilHandDamping: number
    RecoilConvergenceMult: number
    RecoilVertBonus: number
    RecoilBackBonus: number
}


export interface SprintSpeed {
    x: number
    y: number
    z: number
}


export interface ArmorMaterials {
    UHMWPE: Aluminium
    Aramid: Aluminium
    Combined: Aluminium
    Titan: Aluminium
    Aluminium: Aluminium
    ArmoredSteel: Aluminium
    Ceramic: Aluminium
    Glass: Aluminium
}


export interface Aluminium {
    Destructibility: number
    MinRepairDegradation: number
    MaxRepairDegradation: number
    ExplosionDestructibility: number
}


export interface Ballistic {
    GlobalDamageDegradationCoefficient: number
}


export interface Customization {
    SavageHead: { [key: string]: SavageHead }
    SavageBody: { [key: string]: SavageBody }
    SavageFeet: { [key: string]: SavageFeet }
    CustomizationVoice: CustomizationVoice[]
    BodyParts: BodyParts
}


export interface BodyParts {
    Head: string
    Body: string
    Feet: string
    Hands: string
}


export interface CustomizationVoice {
    voice: string
    side: Side[]
    isNotRandom: boolean
}


export interface SavageBody {
    body: string
    hands: string
    isNotRandom: boolean
}


export interface SavageFeet {
    feet: string
    isNotRandom: boolean
    NotRandom: boolean
}


export interface SavageHead {
    head: string
    isNotRandom: boolean
    NotRandom: boolean
}


export interface FenceSettings {
    FenceId: string
    Levels: Levels
    paidExitStandingNumerator: number
}


export interface Levels {
    '0': The1
    '1': The1
    '2': The1
    '3': The1
    '4': The1
    '5': The1
    '6': The1
    '-7': The1
    '-6': The1
    '-5': The1
    '-4': The1
    '-3': The1
    '-2': The1
    '-1': The1
}


export interface The1 {
    SavageCooldownModifier: number
    ScavCaseTimeModifier: number
    PaidExitCostModifier: number
    BotFollowChance: number
    ScavEquipmentSpawnChanceModifier: number
    PriceModifier: number
    HostileBosses: boolean
    HostileScavs: boolean
    ScavAttackSupport: boolean
    ExfiltrationPriceModifier: number
    AvailableExits: number
}


export interface FractureCausedByBulletHit {
    FunctionType: string
    K: number
    B: number
    Threshold: number
}


export interface ConfigHealth {
    Falling: Falling
    Effects: Effects
    HealPrice: HealPrice
    ProfileHealthSettings: ProfileHealthSettings
}


export interface Effects {
    Existence: Existence
    Dehydration: Dehydration
    BreakPart: BreakPart
    Contusion: Contusion
    Disorientation: Contusion
    Exhaustion: Exhaustion
    LowEdgeHealth: LowEdgeHealth
    RadExposure: RADExposure
    Stun: Contusion
    Intoxication: BreakPart
    Regeneration: Regeneration
    Wound: Wound
    Berserk: Berserk
    Flash: Contusion
    MedEffect: MedEffect
    Pain: Pain
    PainKiller: Contusion
    SandingScreen: Contusion
    Stimulator: Stimulator
    Tremor: Tremor
    ChronicStaminaFatigue: ChronicStaminaFatigue
    Fracture: BreakPart
    HeavyBleeding: Bleeding
    LightBleeding: Bleeding
    BodyTemperature: BodyTemperature
}


export interface Berserk {
    DefaultDelay: number
    WorkingTime: number
    DefaultResidueTime: number
}


export interface BodyTemperature {
    DefaultBuildUpTime: number
    DefaultResidueTime: number
    LoopTime: number
}


export interface BreakPart {
    DefaultDelay: number
    DefaultResidueTime: number
    HealExperience: number
    OfflineDurationMin: number
    OfflineDurationMax: number
    RemovePrice: number
    RemovedAfterDeath: boolean
    BulletHitProbability?: FractureCausedByBulletHit
    FallingProbability?: FractureCausedByBulletHit
    DamageHealth?: number
    HealthLoopTime?: number
}


export interface ChronicStaminaFatigue {
    EnergyRate: number
    WorkingTime: number
    TicksEvery: number
    EnergyRatePerStack: number
}


export interface Contusion {
    Dummy: number
}


export interface Dehydration {
    DefaultDelay: number
    DefaultResidueTime: number
    BleedingHealth: number
    BleedingLoopTime: number
    BleedingLifeTime: number
    DamageOnStrongDehydration: number
    StrongDehydrationLoopTime: number
}


export interface Exhaustion {
    DefaultDelay: number
    DefaultResidueTime: number
    Damage: number
    DamageLoopTime: number
}


export interface Existence {
    EnergyLoopTime: number
    HydrationLoopTime: number
    EnergyDamage: number
    HydrationDamage: number
    DestroyedStomachEnergyTimeFactor: number
    DestroyedStomachHydrationTimeFactor: number
}


export interface Bleeding {
    DefaultDelay: number
    DefaultResidueTime: number
    DamageEnergy: number
    DamageHealth: number
    EnergyLoopTime: number
    HealthLoopTime: number
    DamageHealthDehydrated: number
    HealthLoopTimeDehydrated: number
    LifeTimeDehydrated: number
    EliteVitalityDuration: number
    HealExperience: number
    OfflineDurationMin: number
    OfflineDurationMax: number
    RemovePrice: number
    RemovedAfterDeath: boolean
    Probability: FractureCausedByBulletHit
}


export interface LowEdgeHealth {
    DefaultDelay: number
    DefaultResidueTime: number
    StartCommonHealth: number
}


export interface MedEffect {
    LoopTime: number
    StartDelay: number
    DrinkStartDelay: number
    FoodStartDelay: number
    DrugsStartDelay: number
    MedKitStartDelay: number
    MedicalStartDelay: number
    StimulatorStartDelay: number
}


export interface Pain {
    TremorDelay: number
    HealExperience: number
}


export interface RADExposure {
    Damage: number
    DamageLoopTime: number
}


export interface Regeneration {
    LoopTime: number
    MinimumHealthPercentage: number
    Energy: number
    Hydration: number
    BodyHealth: BodyHealth
    Influences: Influences
}


export interface BodyHealth {
    Head: BodyHealthChest
    Chest: BodyHealthChest
    Stomach: BodyHealthChest
    LeftArm: BodyHealthChest
    RightArm: BodyHealthChest
    LeftLeg: BodyHealthChest
    RightLeg: BodyHealthChest
}


export interface BodyHealthChest {
    Value: number
}


export interface Influences {
    LightBleeding: Fracture
    HeavyBleeding: Fracture
    Fracture: Fracture
    RadExposure: Fracture
    Intoxication: Fracture
}


export interface Fracture {
    HealthSlowDownPercentage: number
    EnergySlowDownPercentage: number
    HydrationSlowDownPercentage: number
}


export interface Stimulator {
    BuffLoopTime: number
    Buffs: { [key: string]: Buff[] }
}


export interface Buff {
    BuffType: string
    Chance: number
    Delay: number
    Duration: number
    Value: number
    AbsoluteValue: boolean
    SkillName: string
    AppliesTo?: string[]
}


export interface Tremor {
    DefaultDelay: number
    DefaultResidueTime: number
}


export interface Wound {
    WorkingTime: number
    ThresholdMin: number
    ThresholdMax: number
}


export interface Falling {
    DamagePerMeter: number
    SafeHeight: number
}


export interface HealPrice {
    HealthPointPrice: number
    HydrationPointPrice: number
    EnergyPointPrice: number
    TrialLevels: number
    TrialRaids: number
}


export interface ProfileHealthSettings {
    BodyPartsSettings: BodyPartsSettings
    HealthFactorsSettings: HealthFactorsSettings
}


export interface BodyPartsSettings {
    Head: EnergyClass
    Chest: EnergyClass
    Stomach: EnergyClass
    LeftArm: EnergyClass
    RightArm: EnergyClass
    LeftLeg: EnergyClass
    RightLeg: EnergyClass
}


export interface EnergyClass {
    Minimum: number
    Maximum: number
    Default: number
    OverDamageReceivedMultiplier?: number
}


export interface HealthFactorsSettings {
    Energy: EnergyClass
    Hydration: EnergyClass
    Temperature: EnergyClass
    Poisoning: EnergyClass
    Radiation: EnergyClass
}


export interface Inertia {
    InertiaLimits: SprintSpeed
    InertiaLimitsStep: number
    ExitMovementStateSpeedThreshold: SprintSpeed
    WalkInertia: SprintSpeed
    FallThreshold: number
    SpeedLimitAfterFallMin: SprintSpeed
    SpeedLimitAfterFallMax: SprintSpeed
    SpeedLimitDurationMin: SprintSpeed
    SpeedLimitDurationMax: SprintSpeed
    SpeedInertiaAfterJump: SprintSpeed
    BaseJumpPenaltyDuration: number
    DurationPower: number
    BaseJumpPenalty: number
    PenaltyPower: number
    InertiaTiltCurveMin: SprintSpeed
    InertiaTiltCurveMax: SprintSpeed
    InertiaBackwardCoef: SprintSpeed
    TiltInertiaMaxSpeed: SprintSpeed
    TiltStartSideBackSpeed: SprintSpeed
    TiltMaxSideBackSpeed: SprintSpeed
    TiltAcceleration: SprintSpeed
    AverageRotationFrameSpan: number
    SprintSpeedInertiaCurveMin: SprintSpeed
    SprintSpeedInertiaCurveMax: SprintSpeed
    SprintBrakeInertia: SprintSpeed
    SprintTransitionMotionPreservation: SprintSpeed
    WeaponFlipSpeed: SprintSpeed
    PreSprintAccelerationLimits: SprintSpeed
    SprintAccelerationLimits: SprintSpeed
    SideTime: SprintSpeed
    DiagonalTime: SprintSpeed
    MinDirectionBlendTime: number
    MoveTime: number
    MinMovementAccelerationRangeRight: SprintSpeed
    MaxMovementAccelerationRangeRight: SprintSpeed
}


export interface Insurance {
    MaxStorageTimeInHour: number
}


export interface Malfunction {
    AmmoMalfChanceMult: number
    MagazineMalfChanceMult: number
    MalfRepairHardSlideMult: number
    MalfRepairOneHandBrokenMult: number
    MalfRepairTwoHandsBrokenMult: number
    AllowMalfForBots: boolean
    ShowGlowAttemptsCount: number
    OutToIdleSpeedMultForPistol: number
    IdleToOutSpeedMultOnMalf: number
    TimeToQuickdrawPistol: number
    DurRangeToIgnoreMalfs: SprintSpeed
    DurFeedWt: number
    DurMisfireWt: number
    DurJamWt: number
    DurSoftSlideWt: number
    DurHardSlideMinWt: number
    DurHardSlideMaxWt: number
    AmmoMisfireWt: number
    AmmoFeedWt: number
    AmmoJamWt: number
    OverheatFeedWt: number
    OverheatJamWt: number
    OverheatSoftSlideWt: number
    OverheatHardSlideMinWt: number
    OverheatHardSlideMaxWt: number
}


export interface Mastering {
    Name: string
    Templates: string[]
    Level2: number
    Level3: number
}


export interface Overheat {
    MinOverheat: number
    MaxOverheat: number
    OverheatProblemsStart: number
    ModHeatFactor: number
    ModCoolFactor: number
    MinWearOnOverheat: number
    MaxWearOnOverheat: number
    MinWearOnMaxOverheat: number
    MaxWearOnMaxOverheat: number
    OverheatWearLimit: number
    MaxCOIIncreaseMult: number
    MinMalfChance: number
    MaxMalfChance: number
    DurReduceMinMult: number
    DurReduceMaxMult: number
    BarrelMoveRndDuration: number
    BarrelMoveMaxMult: number
    FireratePitchMult: number
    FirerateReduceMinMult: number
    FirerateReduceMaxMult: number
    FirerateOverheatBorder: number
    EnableSlideOnMaxOverheat: boolean
    StartSlideOverheat: number
    FixSlideOverheat: number
    AutoshotMinOverheat: number
    AutoshotChance: number
    AutoshotPossibilityDuration: number
    MaxOverheatCoolCoef: number
}


export interface RagFair {
    enabled: boolean
    priceStabilizerEnabled: boolean
    includePveTraderSales: boolean
    priceStabilizerStartIntervalInHours: number
    minUserLevel: number
    communityTax: number
    communityItemTax: number
    communityRequirementTax: number
    offerPriorityCost: number
    offerDurationTimeInHour: number
    offerDurationTimeInHourAfterRemove: number
    priorityTimeModifier: number
    maxRenewOfferTimeInHour: number
    renewPricePerHour: number
    maxActiveOfferCount: MaxActiveOfferCount[]
    balancerRemovePriceCoefficient: number
    balancerMinPriceCount: number
    balancerAveragePriceCoefficient: number
    delaySinceOfferAdd: number
    uniqueBuyerTimeoutInDays: number
    ratingSumForIncrease: number
    ratingIncreaseCount: number
    ratingSumForDecrease: number
    ratingDecreaseCount: number
    maxSumForIncreaseRatingPerOneSale: number
    maxSumForDecreaseRatingPerOneSale: number
    maxSumForRarity: MaxSumForRarity
    ChangePriceCoef: number
    balancerUserItemSaleCooldownEnabled: boolean
    balancerUserItemSaleCooldown: number
    youSellOfferMaxStorageTimeInHour: number
    yourOfferDidNotSellMaxStorageTimeInHour: number
    isOnlyFoundInRaidAllowed: boolean
    sellInOnePiece: number
}


export interface MaxActiveOfferCount {
    from: number
    to: number
    count: number
}


export interface MaxSumForRarity {
    Common: Common
    Rare: Common
    Superrare: Common
    Not_exist: Common
}


export interface Common {
    value: number
}


export interface RequirementReferences {
    Alpinist: Alpinist[]
}


export interface Alpinist {
    Requirement: string
    Id: string
    Count: number
    RequiredSlot: string
    RequirementTip: string
}


export interface RestrictionsInRAID {
    TemplateId: string
    Value: number
}


export interface SkillsSettings {
    SkillProgressRate: number
    WeaponSkillProgressRate: number
    WeaponSkillRecoilBonusPerLevel: number
    HideoutManagement: HideoutManagement
    Crafting: Crafting
    Metabolism: Metabolism
    Immunity: Immunity
    Endurance: Endurance
    Strength: Strength
    Vitality: Vitality
    Health: SkillsSettingsHealth
    StressResistance: StressResistance
    Throwing: Throwing
    RecoilControl: RecoilControl
    Pistol: Assault
    Revolver: any[]
    SMG: any[]
    Assault: Assault
    Shotgun: Assault
    Sniper: Assault
    LMG: any[]
    HMG: any[]
    Launcher: any[]
    AttachedLauncher: any[]
    Melee: any[]
    DMR: Assault
    BearAssaultoperations: any[]
    BearAuthority: any[]
    BearAksystems: any[]
    BearHeavycaliber: any[]
    BearRawpower: any[]
    UsecArsystems: any[]
    UsecDeepweaponmodding_Settings: any[]
    UsecLongrangeoptics_Settings: any[]
    UsecNegotiations: any[]
    UsecTactics: any[]
    BotReload: any[]
    CovertMovement: CovertMovement
    FieldMedicine: any[]
    Search: Search
    Sniping: any[]
    ProneMovement: any[]
    FirstAid: any[]
    LightVests: any[]
    HeavyVests: any[]
    WeaponModding: any[]
    AdvancedModding: any[]
    NightOps: any[]
    SilentOps: any[]
    Lockpicking: any[]
    WeaponTreatment: WeaponTreatment
    MagDrills: MagDrills
    Freetrading: any[]
    Auctions: any[]
    Cleanoperations: any[]
    Barter: any[]
    Shadowconnections: any[]
    Taskperformance: any[]
    Perception: Perception
    Intellect: Intellect
    Attention: Attention
    Charisma: Charisma
    Memory: Memory
    Surgery: Surgery
    AimDrills: AimDrills
    BotSound: any[]
    TroubleShooting: TroubleShooting
}


export interface AimDrills {
    WeaponShotAction: number
}


export interface Assault {
    WeaponReloadAction: number
    WeaponShotAction: number
    WeaponFixAction: number
    WeaponChamberAction: number
}


export interface Attention {
    ExamineWithInstruction: number
    FindActionFalse: number
    FindActionTrue: number
}


export interface Charisma {
    SkillProgressInt: number
    SkillProgressAtn: number
    SkillProgressPer: number
}


export interface CovertMovement {
    MovementAction: number
}


export interface Crafting {
    PointsPerCraftingCycle: number
    CraftingCycleHours: number
    PointsPerUniqueCraftCycle: number
    UniqueCraftsPerCycle: number
    CraftTimeReductionPerLevel: number
    ProductionTimeReductionPerLevel: number
    EliteExtraProductions: number
    CraftingPointsToInteligence: number
}


export interface Endurance {
    MovementAction: number
    SprintAction: number
    GainPerFatigueStack: number
}


export interface SkillsSettingsHealth {
    SkillProgress: number
}


export interface HideoutManagement {
    SkillPointsPerAreaUpgrade: number
    SkillPointsPerCraft: number
    ConsumptionReductionPerLevel: number
    SkillBoostPercent: number
    SkillPointsRate: SkillPointsRate
    EliteSlots: EliteSlots
}


export interface EliteSlots {
    Generator: BitcoinFarmClass
    AirFilteringUnit: BitcoinFarmClass
    WaterCollector: BitcoinFarmClass
    BitcoinFarm: BitcoinFarmClass
}


export interface BitcoinFarmClass {
    Slots: number
    Container: number
}


export interface SkillPointsRate {
    Generator: SolarPowerClass
    AirFilteringUnit: SolarPowerClass
    WaterCollector: SolarPowerClass
    SolarPower: SolarPowerClass
}


export interface SolarPowerClass {
    ResourceSpent: number
    PointsGained: number
}


export interface Immunity {
    ImmunityMiscEffects: number
    ImmunityPoisonBuff: number
    ImmunityPainKiller: number
    HealthNegativeEffect: number
    StimulatorNegativeBuff: number
}


export interface Intellect {
    ExamineAction: number
    SkillProgress: number
    RepairAction: number
}


export interface MagDrills {
    RaidLoadedAmmoAction: number
    RaidUnloadedAmmoAction: number
    MagazineCheckAction: number
}


export interface Memory {
    AnySkillUp: number
    SkillProgress: number
}


export interface Metabolism {
    HydrationRecoveryRate: number
    EnergyRecoveryRate: number
    IncreasePositiveEffectDurationRate: number
    DecreaseNegativeEffectDurationRate: number
    DecreasePoisonDurationRate: number
}


export interface Perception {
    OnlineAction: number
    UniqueLoot: number
}


export interface RecoilControl {
    RecoilAction: number
    RecoilBonusPerLevel: number
}


export interface Search {
    SearchAction: number
    FindAction: number
}


export interface Strength {
    SprintActionMin: number
    SprintActionMax: number
    MovementActionMin: number
    MovementActionMax: number
    PushUpMin: number
    PushUpMax: number
    FistfightAction: number
    ThrowAction: number
}


export interface StressResistance {
    HealthNegativeEffect: number
    LowHPDuration: number
}


export interface Surgery {
    SurgeryAction: number
    SkillProgress: number
}


export interface Throwing {
    ThrowAction: number
}


export interface TroubleShooting {
    MalfRepairSpeedBonusPerLevel: number
    SkillPointsPerMalfFix: number
    EliteDurabilityChanceReduceMult: number
    EliteAmmoChanceReduceMult: number
    EliteMagChanceReduceMult: number
}


export interface Vitality {
    DamageTakenAction: number
    HealthNegativeEffect: number
}


export interface WeaponTreatment {
    WearChanceReducePerLevel: number
    DurLossReducePerLevel: number
    SkillPointsPerRepair: number
    Filter: any[]
}


export interface Stamina {
    Capacity: number
    SprintDrainRate: number
    BaseRestorationRate: number
    JumpConsumption: number
    GrenadeHighThrow: number
    GrenadeLowThrow: number
    AimDrainRate: number
    AimRangeFinderDrainRate: number
    OxygenCapacity: number
    OxygenRestoration: number
    WalkOverweightLimits: SprintSpeed
    BaseOverweightLimits: SprintSpeed
    SprintOverweightLimits: SprintSpeed
    WalkSpeedOverweightLimits: SprintSpeed
    CrouchConsumption: SprintSpeed
    WalkConsumption: SprintSpeed
    StandupConsumption: SprintSpeed
    TransitionSpeed: SprintSpeed
    SprintAccelerationLowerLimit: number
    SprintSpeedLowerLimit: number
    SprintSensitivityLowerLimit: number
    AimConsumptionByPose: SprintSpeed
    RestorationMultiplierByPose: SprintSpeed
    OverweightConsumptionByPose: SprintSpeed
    AimingSpeedMultiplier: number
    WalkVisualEffectMultiplier: number
    HandsCapacity: number
    HandsRestoration: number
    ProneConsumption: number
    BaseHoldBreathConsumption: number
    SoundRadius: SprintSpeed
    ExhaustedMeleeSpeed: number
    FatigueRestorationRate: number
    FatigueAmountToCreateEffect: number
    ExhaustedMeleeDamageMultiplier: number
    FallDamageMultiplier: number
    SafeHeightOverweight: number
    SitToStandConsumption: number
    StaminaExhaustionCausesJiggle: boolean
    StaminaExhaustionStartsBreathSound: boolean
    StaminaExhaustionRocksCamera: boolean
    HoldBreathStaminaMultiplier: SprintSpeed
    PoseLevelIncreaseSpeed: SprintSpeed
    PoseLevelDecreaseSpeed: SprintSpeed
    PoseLevelConsumptionPerNotch: SprintSpeed
}


export interface StaminaDrainClass {
    LowerLeftPoint: number
    LowerRightPoint: number
    LeftPlatoPoint: number
    RightPlatoPoint: number
    RightLimit: number
    ZeroValue: number
}


export interface Armor {
    class: Class[]
}


export interface Class {
    resistance: number
}


export interface Content {
    ip: string
    port: number
    root: string
}


export interface Exp {
    heal: Heal
    match_end: MatchEnd
    loot: null
    kill: Kill
    level: Level
    loot_attempts: LootAttempt[]
    expForLockedDoorOpen: number
    expForLockedDoorBreach: number
    triggerMult: number
}


export interface Heal {
    expForHeal: number
    expForHydration: number
    expForEnergy: number
}


export interface Kill {
    combo: Combo[]
    victimLevelExp: number
    headShotMult: number
    expOnDamageAllHealth: number
    longShotDistance: number
    bloodLossToLitre: number
    victimBotLevelExp: number
}


export interface Combo {
    percent: number
}


export interface Level {
    exp_table: ExpTable[]
    trade_level: number
    savage_level: number
    clan_level: number
    mastering1: number
    mastering2: number
}


export interface ExpTable {
    exp: number
}


export interface LootAttempt {
    k_exp: number
}


export interface MatchEnd {
    README: string
    survived_exp_requirement: number
    survived_seconds_requirement: number
    survived_exp_reward: number
    mia_exp_reward: number
    runner_exp_reward: number
    leftMult: number
    miaMult: number
    survivedMult: number
    runnerMult: number
    killedMult: number
}


export interface Handbook {
    defaultCategory: string
}


export interface Rating {
    levelRequired: number
    limit: number
    categories: RatingCategories
}


export interface RatingCategories {
    experience: boolean
    kd: boolean
    surviveRatio: boolean
    avgEarnings: boolean
    kills: boolean
    raidCount: boolean
    longestShot: boolean
    timeOnline: boolean
    inventoryFullCost: boolean
    ragFairStanding: boolean
}


export interface Tournament {
    categories: TournamentCategories
    limit: number
    levelRequired: number
}


export interface TournamentCategories {
    dogtags: boolean
}


export enum FireModeEnum {
    Single = 'single'
}


export enum Type {
    Preset = 'Preset'
}


export enum Side {
    Bear = 'Bear',
    Savage = 'Savage',
    Usec = 'Usec'
}


() => {
  it('linear-gradient', async () => {
    var div1 = document.createElement('div');
    Object.assign(div1.style, {
      width: '200px',
      height: '100px',
      backgroundImage:
      'linear-gradient(to left, #333, #333 50%, #eee 75%, #333 75%)',
    });

    append(BODY, div1);
    await matchElementImageSnapshot(div1);
  });

  it('linear-gradient and remove', async (done) => {
    var div1 = document.createElement('div');
    Object.assign(div1.style, {
      width: '200px',
      height: '100px',
      backgroundImage:
      'linear-gradient(to left, #333, #333 50%, #eee 75%, #333 75%)',
    });

    append(BODY, div1);
    await matchElementImageSnapshot(div1);
    requestAnimationFrame(async () => {
      div1.style.backgroundImage = '';
      await expectAsync(div1.toBlob(1.0)).toMatchImageSnapshot();
      done();
    });
  });

  it('conic-gradient', async () => {
    var div2 = document.createElement('div');
    Object.assign(div2.style, {
      width: '200px',
      height: '200px',
      backgroundImage:
      'conic-gradient(from 0.25turn at 50% 30%,red 20deg, orange 130deg, yellow 90deg, green 180deg, blue 270deg)',
    });

    append(BODY, div2);
    await matchElementImageSnapshot(div2);
  });

  it('radial-gradient', async () => {
    var div3 = document.createElement('div');
    Object.assign(div3.style, {
      width: '200px',
      height: '200px',
      backgroundImage: 'radial-gradient(circle at 50% 50%, red 0%, yellow 20%, blue 80%)',
    });

    append(BODY, div3);
    await matchElementImageSnapshot(div3);
  });

  it('linear-gradient-rotate', async () => {
    var div4 = document.createElement('div');
    Object.assign(div4.style, {
      width: '200px',
      height: '100px',
      backgroundImage:
      'linear-gradient(135deg, red, red 10%, blue 75%, yellow 75%)',
    });
    append(BODY, div4);
    await matchElementImageSnapshot(div4);
  });

  it("linear-gradient to right with color stop of px", async () => {

    let flexbox;

    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to right, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          display: 'flex',
          'justify-content': 'center',
          height: '100px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  });

  it("linear-gradient to right with color stop of px and width not set", async () => {

    let flexbox;

    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to right, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          display: 'flex',
          'justify-content': 'center',
          height: '100px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  });

  it("linear-gradient to bottom with color stop of px", async () => {

    let flexbox;

    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to bottom, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          display: 'flex',
          'justify-content': 'center',
          height: '200px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  });

  it("linear-gradient to bottom with color stop of px and height not set", async () => {

    let flexbox;
    let container = createElement(
      'div',
      {
        style: {
          display: 'flex',
          width: '300px',
          height: '300px',
        }
      }
    );
    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to bottom, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );

    container.appendChild(flexbox);
    BODY.appendChild(container);

    await matchViewportSnapshot();
  });

  it("linear-gradient to right with color stop not set", async () => {
    let flexbox;
    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to right, blue, blue, red, red, orange, orange)',
          display: 'flex',
          'justify-content': 'center',
          height: '100px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  });

  it("linear-gradient to bottom with color stop not set", async () => {
    let flexbox;
    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
            'linear-gradient(to bottom, blue, blue, red, red, orange, orange)',
          display: 'flex',
          'justify-content': 'center',
          height: '200px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  });
}


async () => {
    var div1 = document.createElement('div');
    Object.assign(div1.style, {
      width: '200px',
      height: '100px',
      backgroundImage:
      'linear-gradient(to left, #333, #333 50%, #eee 75%, #333 75%)',
    });

    append(BODY, div1);
    await matchElementImageSnapshot(div1);
  }


async (done) => {
    var div1 = document.createElement('div');
    Object.assign(div1.style, {
      width: '200px',
      height: '100px',
      backgroundImage:
      'linear-gradient(to left, #333, #333 50%, #eee 75%, #333 75%)',
    });

    append(BODY, div1);
    await matchElementImageSnapshot(div1);
    requestAnimationFrame(async () => {
      div1.style.backgroundImage = '';
      await expectAsync(div1.toBlob(1.0)).toMatchImageSnapshot();
      done();
    });
  }


async () => {
      div1.style.backgroundImage = '';
      await expectAsync(div1.toBlob(1.0)).toMatchImageSnapshot();
      done();
    }


async () => {
    var div2 = document.createElement('div');
    Object.assign(div2.style, {
      width: '200px',
      height: '200px',
      backgroundImage:
      'conic-gradient(from 0.25turn at 50% 30%,red 20deg, orange 130deg, yellow 90deg, green 180deg, blue 270deg)',
    });

    append(BODY, div2);
    await matchElementImageSnapshot(div2);
  }


async () => {
    var div3 = document.createElement('div');
    Object.assign(div3.style, {
      width: '200px',
      height: '200px',
      backgroundImage: 'radial-gradient(circle at 50% 50%, red 0%, yellow 20%, blue 80%)',
    });

    append(BODY, div3);
    await matchElementImageSnapshot(div3);
  }


async () => {
    var div4 = document.createElement('div');
    Object.assign(div4.style, {
      width: '200px',
      height: '100px',
      backgroundImage:
      'linear-gradient(135deg, red, red 10%, blue 75%, yellow 75%)',
    });
    append(BODY, div4);
    await matchElementImageSnapshot(div4);
  }


async () => {

    let flexbox;

    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to right, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          display: 'flex',
          'justify-content': 'center',
          height: '100px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  }


async () => {

    let flexbox;

    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to right, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          display: 'flex',
          'justify-content': 'center',
          height: '100px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  }


async () => {

    let flexbox;

    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to bottom, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          display: 'flex',
          'justify-content': 'center',
          height: '200px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  }


async () => {

    let flexbox;
    let container = createElement(
      'div',
      {
        style: {
          display: 'flex',
          width: '300px',
          height: '300px',
        }
      }
    );
    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to bottom, blue 0px, blue 40px, red 40px, red 120px, orange 120px, orange 200px)',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );

    container.appendChild(flexbox);
    BODY.appendChild(container);

    await matchViewportSnapshot();
  }


async () => {
    let flexbox;
    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
          'linear-gradient(to right, blue, blue, red, red, orange, orange)',
          display: 'flex',
          'justify-content': 'center',
          height: '100px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  }


async () => {
    let flexbox;
    flexbox = createElement(
      'div',
      {
        id: 'flexbox',
        style: {
          background:
            'linear-gradient(to bottom, blue, blue, red, red, orange, orange)',
          display: 'flex',
          'justify-content': 'center',
          height: '200px',
          width: '300px',
          'box-sizing': 'border-box',
        },
      },
    );
    BODY.appendChild(flexbox);

    await matchViewportSnapshot();
  }


() => {
  const intl = useIntl();

  const { data: media, error: mediaError } = useSWR<MediaResultsResponse>(
    '/api/v1/media?filter=allavailable&take=20&sort=mediaAdded'
  );

  const {
    data: requests,
    error: requestError,
  } = useSWR<RequestResultsResponse>(
    '/api/v1/request?filter=unavailable&take=10&sort=modified&skip=0'
  );

  return (
    <>
      <PageTitle title={intl.formatMessage(messages.discover)} />

          {intl.formatMessage(messages.recentlyAdded)}

      <Slider
        sliderKey="media"
        isLoading={!media && !mediaError}


(request) => (
          <RequestCard
            key={`request-slider-item-${request.id}`


map(


(state = initialState, action) => {
  switch (action.type) {
    case HentDiskresjonskodeActionTypes.HENTER_DISKRESJONSKODE: {
      return {
        ...initialState,
        henter: true,
        error: undefined,
      };
    }
    case HentDiskresjonskodeActionTypes.DISKRESJONSKODE_HENTET: {
      return {
        ...state,
        henter: false,
        hentet: true,
        error: undefined,
        data: {
          diskresjonskode: action.data.toString(),
        },
      };
    }
    case HentDiskresjonskodeActionTypes.HENT_DISKRESJONSKODE_FEILET: {
      return {
        ...state,
        henter: false,
        error: action.error,
      };
    }
    default: {
      return state;
    }
  }
}


export interface DiskresjonskodeData {
  diskresjonskode: string;
}


export interface DiskresjonskodeState {
  henter: boolean;
  hentet: boolean;
  error?: ApiError;
  data: DiskresjonskodeData;
}


() => this.datasource.getPeople(0, 5)


@Component({
  selector: 'pbl-columns-factory-example',
  templateUrl: './factory.component.html',
  styleUrls: ['./factory.component.scss'],
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
@Example('pbl-columns-factory-example', { title: 'Column Factory' })
export class ColumnsFactoryExample {
  columns = columnFactory()
    .default({ minWidth: 40 })
    .table(
      { prop: 'id', width: '40px' },
      { prop: 'name' },
      { prop: 'gender', width: '50px' },
      { prop: 'email', width: '150px' },
      { prop: 'country' },
      { prop: 'language' },
    )
    .header(
      { id: 'header1', label: 'Header 1', width: '25%'},
      { id: 'header2', label: 'Header 2'},
    )
    .headerGroup(
      { prop: 'name', span: 1, label: 'Name & Gender' },
    )
    .header(
      { id: 'header3', label: 'Header 3'},
    )
    .headerGroup(
      { prop: 'id', span: 2, label: 'ID, Name & Gender' },
      { prop: 'country', span: 1, label: 'Country & Language' },
    )
    .footer(
      { id: 'footer1', label: 'Footer 1', width: '25%'},
      { id: 'footer2', label: 'Footer 2'},
    )
    .footer(
      { id: 'footer3', label: 'Footer 3'},
    )
    .build();
  ds = createDS<Person>().onTrigger( () => this.datasource.getPeople(0, 5) ).create();

  constructor(private datasource: DemoDataSource) { }
}


() => {
      const { used } = this.state;
      const val = (used + 10) % 100;
      this.setState({
        spacer: val < 10 ? ' ' : '',
        used: val
      });
    }


export class DonutUtilizationSimpleRightDemo extends React.Component<{}, { used: number; spacer: string }> {
  interval: number;

  constructor(props: {}) {
    super(props as null);
    this.state = {
      spacer: '',
      used: 0
    };
  }

  componentDidMount() {
    window.scrollTo(0, 0);

    this.interval = window.setInterval(() => {
      const { used } = this.state;
      const val = (used + 10) % 100;
      this.setState({
        spacer: val < 10 ? ' ' : '',
        used: val
      });
    }, 1000);
  }

  componentWillUnmount() {
    clearInterval(this.interval);
  }

  render() {
    const { spacer, used } = this.state;
    return (

        <div style={{ backgroundColor: 'white', height: '230px', width: '435px' }}


componentDidMount() {
    window.scrollTo(0, 0);

    this.interval = window.setInterval(() => {
      const { used } = this.state;
      const val = (used + 10) % 100;
      this.setState({
        spacer: val < 10 ? ' ' : '',
        used: val
      });
    }, 1000);
  }


componentWillUnmount() {
    clearInterval(this.interval);
  }


render() {
    const { spacer, used } = this.state;
    return (

        <div style={{ backgroundColor: 'white', height: '230px', width: '435px' }}


interface MUIDataTableData {
    index: number;
    data: Array<object | number[] | string[]>;
}


interface MUIDataTableStateRows {
    data: string[];
    lookup: any;
}


export interface MUIDataTableState {
    announceText: string | null;
    activeColumn: string | null;
    page: number;
    rowsPerPage: number;
    filterList: string[][];
    selectedRows: MUIDataTableStateRows;
    expandedRows: MUIDataTableStateRows;
    showResponsive: boolean;
    searchText: string | null;
    rowsPerPageOptions: number[];
}


interface MUIDataTableMeta {
    rowIndex: number;
    columnIndex: number;
    columnData: MUIDataTableColumnOptions[];
    rowData: any[];
    tableData: MUIDataTableData[];
    tableState: MUIDataTableState;
}


interface MUIDataTableCustomHeadRenderer extends MUIDataTableColumn {
    index: number;
}


interface MUIDataTableTextLabelsBody {
    noMatch: string;
    toolTip: string;
}


interface MUIDataTableTextLabelsPagination {
    next: string;
    previous: string;
    rowsPerPage: string;
    displayRows: string;
}


interface MUIDataTableTextLabelsToolbar {
    search: string;
    downloadCsv: string;
    print: string;
    viewColumns: string;
    filterTable: string;
}


interface MUIDataTableTextLabelsFilter {
    all: string;
    title: string;
    reset: string;
}


interface MUIDataTableTextLabelsViewColumns {
    title: string;
    titleAria: string;
}


interface MUIDataTableTextLabelsSelectedRows {
    text: string;
    delete: string;
    deleteAria: string;
}


export interface MUIDataTableColumn {
    name: string;
    label?: string;
    options?: MUIDataTableColumnOptions;
}


export interface MUIDataTableTextLabels {
    body: MUIDataTableTextLabelsBody;
    pagination: MUIDataTableTextLabelsPagination;
    toolbar: MUIDataTableTextLabelsToolbar;
    filter: MUIDataTableTextLabelsFilter;
    viewColumns: MUIDataTableTextLabelsViewColumns;
    selectedRows: MUIDataTableTextLabelsSelectedRows;
}


export interface MUIDataTableColumnOptions {
    display?: 'true' | 'false' | 'excluded';
    empty?: boolean;
    filter?: boolean;
    filterList?: string[];
    filterOptions?: string[];
    filterType?: 'dropdown' | 'checkbox' | 'multiselect' | 'textField';
    sort?: boolean;
    searchable?: boolean;
    sortDirection?: 'asc' | 'desc';
    print?: boolean;
    download?: boolean;
    viewColumns?: boolean;
    hint?: string;
    customHeadRender?: (columnMeta: MUIDataTableCustomHeadRenderer, updateDirection: (params: any) => any) => string | React.ReactNode;
    customBodyRender?: (value: any, tableMeta: MUIDataTableMeta, updateValue: (s: any, c: any, p: any) => any) => string | React.ReactNode;
    setCellProps?: (cellValue: string, rowIndex: number, columnIndex: number) => object;
}


export interface MUIDataTableOptions {
    caseSensitive?: boolean;
    count?: number;
    customFooter?: (rowCount: number, page: number, rowsPerPage: number, changeRowsPerPage: () => any, changePage: number) => React.ReactNode;
    customSearch?: (searchQuery: string, currentRow: any[], columns: any[]) => boolean;
    customSort?: (data: any[], colIndex: number, order: string) => any[];
    customToolbar?: () => React.ReactNode;
    customToolbarSelect?: (
        selectedRows: {
            data: Array<{ index: number; dataIndex: number }>,
            lookup: { [key: number]: boolean }
        },
        displayData: Array<{ data: any[]; dataIndex: number }>,
        setSelectedRows: (rows: number[]) => void
    ) => React.ReactNode;
    download?: boolean;
    downloadOptions?: { filename: string; separator: string };
    elevation?: number;
    expandableRows?: boolean;
    filter?: boolean;
    filterType?: 'dropdown' | 'checkbox' | 'multiselect' | 'textField';
    fixedHeader?: boolean;
    isRowSelectable?: (dataIndex: number) => boolean;
    onCellClick?: (colData: any, cellMeta: { colIndex: number, rowIndex: number, dataIndex: number, event: React.MouseEvent }) => void;
    onChangePage?: (currentPage: number) => void;
    onChangeRowsPerPage?: (numberOfRows: number) => void;
    onColumnSortChange?: (changedColumn: string, direction: string) => void;
    onColumnViewChange?: (changedColumn: string, action: string) => void;
    onDownload?: (buildHead: (columns: any) => string, buildBody: (data: any) => string, columns: any, data: any) => string;
    onFilterChange?: (changedColumn: string, filterList: any[]) => void;
    onRowClick?: (rowData: string[], rowMeta: { dataIndex: number; rowIndex: number }) => void;
    onRowsDelete?: (rowsDeleted: any[]) => void;
    onRowsSelect?: (currentRowsSelected: any[], rowsSelected: any[]) => void;
    onSearchChange?: (searchText: string) => void;
    onTableChange?: (action: string, tableState: MUIDataTableState) => void;
    page?: number;
    pagination?: boolean;
    print?: boolean;
    renderExpandableRow?: (rowData: string[], rowMeta: { dataIndex: number; rowIndex: number }) => React.ReactNode;
    resizableColumns?: boolean;
    responsive?: 'stacked' | 'scroll';
    rowHover?: boolean;
    rowsPerPage?: number;
    rowsPerPageOptions?: number[];
    rowsSelected?: any[];
    search?: boolean;
    selectableRows?: boolean;
    serverSide?: boolean;
    setRowProps?: (row: any[], rowIndex: number) => object;
    sort?: boolean;
    sortFilterList?: boolean;
    textLabels?: MUIDataTableTextLabels;
    viewColumns?: boolean;
}


export interface MUIDataTableProps {
    title: string | React.ReactNode;
    columns: MUIDataTableColumnDef[];
    data: Array<object | number[] | string[]>;
    options?: MUIDataTableOptions;
}


export interface MUIDataTablePopover {
    action?: (...args: any) => any;
    elevation?: number;
    option?: boolean;
    onClose?: (...args: any) => any;
    onExited?: (...args: any) => any;
    anchorEl?: React.ReactNode;
    ref?: any;
    anchorOrigin?: any;
    transformOrigin?: any;
}


export interface MUIDataTableBody {
    data: Array<object | number[] | string[]>;
    count: number;
    columns: MUIDataTableColumnDef[];
    options: object;
    filterList?: string[][];
    onRowClick?: (rowData: string[], rowMeta: { dataIndex: number; rowIndex: number }) => void;
    selectedRows?: object;
    selectRowUpdate?: (...args: any) => any;
    searchText?: string;
    toggleExpandRow?: (...args: any) => any;
    classes: object;
}


export interface MUIDataTableBodyCell {
    classes?: object;
    colIndex?: number;
    columnHeader?: any;
    options?: object;
    dataIndex?: number;
    rowIndex?: number;
    className?: string;
    children?: any;
    otherProps?: any;
}


export interface MUIDataTableBodyRow {
    options: object;
    onClick?: (...args: any) => any;
    rowSelected?: boolean;
    classes?: object;
    className?: string;
}


export interface MUIDataTableFilter {
    filterData: any[];
    filterList?: string[][];
    options: object;
    onFilterUpdate?: (...args: any) => any;
    onFilterRest?: (...args: any) => any;
    classes?: object;
}


export interface MUIDataTableFilterList {
    filterList: string[][];
    onFilterUpdate?: (...args: any) => any;
    classes?: object;
}


export interface MUIDataTableFooter {
    options?: object;
    rowCount?: number;
    page?: number;
    rowsPerPage?: number;
    changeRowsPerPage?: (...args: any) => any;
    changePage?: any;
}


export interface MUIDataTableHead {
    classes?: object;
    columns?: MUIDataTableColumnDef[];
    count?: number;
    options?: object;
    data?: any[];
    page?: any;
    setCellRef?: any;
    selectedRows?: any;
}


export interface MUIDataTableHeadCell {
    classes?: object;
    options: object;
    sortDirection?: 'asc' | 'desc';
    toggleSort: (...args: any) => any;
    sort: boolean;
    hint: string;
    children?: any;
}


export interface MUIDataTableHeadRow {
    classes?: object;
}


export interface MUIDataTablePagination {
    count: number;
    options: object;
    page: number;
    rowsPerPage: number;
    changeRowsPerPage: (...args: any) => any;
}


export interface MUIDataTableResize {
    classes?: object;
    options?: object;
    rowSelected?: boolean;
    setResizeable?: (...args: any) => any;
    updateDividers?: (...args: any) => any;
}


export interface MUIDataTableSearch {
    classes?: object;
    options?: object;
    onHide?: (...args: any) => any;
    onSearch?: (...args: any) => any;
}


export interface MUIDataTableSelectCell {
    checked: boolean;
    fixedHeader: boolean;
    isHeaderCell?: boolean;
    expandableOn?: boolean;
    selectableOn?: boolean;
    isRowExpanded?: boolean;
    isRowSelectable?: boolean;
    onChange?: (...args: any) => any;
    onExpand?: (...args: any) => any;
    classes?: object;
    otherProps?: any;
}


export interface MUIDataTableToolbar {
    data?: any[];
    classes?: object;
    columns: MUIDataTableColumnDef[];
    options?: object;
    setTableActions?: (...args: any) => any;
    searchTextUpdate?: (...args: any) => any;
    filterData?: any;
    filterList?: string[][];
    filterUpdate?: any;
    resetFilters?: any;
    toggleViewColumn?: any;
    title?: any;
    tableRef?: (...args: any) => any;
}


export interface MUIDataTableToolbarSelect {
    options: object;
    rowSelected?: boolean;
    displayData?: any;
    onRowsDelete?: (...args: any) => any;
    selectRowUpdate?: (...args: any) => any;
    classes?: object;
}


export interface MUIDataTableViewCol {
    columns: any[];
    object: object;
    onColumnUpdate: (...args: any) => any;
    classes?: object;
}


export type MUIDataTableColumnDef = string | MUIDataTableColumn;


({ dependents }: IDependentListProps) => (
  <div className={css.component}>
    <Typography variant


name => (
          <li className={css.packageName}


interface IDependentListProps {
  dependents: string[];
}


function


(Standard:


function waitForElement(selector: any /** TODO #9100 */) {
  var EC = (<any>protractor).ExpectedConditions;
  // Waits for the element with id 'abc' to be present on the dom.
  browser.wait(EC.presenceOf($(selector)), 20000);
}


() => {

  afterEach(verifyNoBrowserErrors);

  describe('index view', () => {
    var URL = 'all/playground/src/routing/';

    it('should list out the current collection of items', () => {
      browser.get(URL);
      waitForElement('.inbox-item-record');
      expect(element.all(by.css('.inbox-item-record')).count()).toEqual(200);
    });
  });
}


() => {
    var URL = 'all/playground/src/routing/';

    it('should list out the current collection of items', () => {
      browser.get(URL);
      waitForElement('.inbox-item-record');
      expect(element.all(by.css('.inbox-item-record')).count()).toEqual(200);
    });
  }


() => {
      browser.get(URL);
      waitForElement('.inbox-item-record');
      expect(element.all(by.css('.inbox-item-record')).count()).toEqual(200);
    }


() => {

	it('Delay 1',
		Callbackify(
			InSeries(
				() => [ 1, 2, 3 ],
				Delay(100),
				Assert(
					([ a, b, c ]) => (a === 1 && b === 2 && c === 3)
				)
			)
		)
	);

	it('Delay 2',
		Callbackify(
			InSeries(
				() => [ 1, 2, 3 ],
				Delay(),
				Assert(
					([ a, b, c ]) => (a === 1 && b === 2 && c === 3)
				)
			)
		)
	);

}


() => [ 1, 2, 3 ]


([ a, b, c ]) => (a === 1 && b === 2 && c === 3)


() => {
  const fn = savedVisualization().fn;
  const args = {
    id: 'some-id',
    timerange: null,
    colors: null,
    hideLegend: null,
    title: null,
  };

  it('accepts null context', () => {
    const expression = fn(null, args, {} as any);

    expect(expression.input.filters).toEqual([]);
  });

  it('accepts filter context', () => {
    const expression = fn(filterContext, args, {} as any);
    const embeddableFilters = getQueryFilters(filterContext.and);

    expect(expression.input.filters).toEqual(embeddableFilters);
  });

  it('accepts an empty title when title is disabled', () => {
    const expression = fn(null, { ...args, title: '' }, {} as any);
    expect(expression.input.title).toEqual('');
  });
}


() => {
    const expression = fn(null, args, {} as any);

    expect(expression.input.filters).toEqual([]);
  }


() => {
    const expression = fn(filterContext, args, {} as any);
    const embeddableFilters = getQueryFilters(filterContext.and);

    expect(expression.input.filters).toEqual(embeddableFilters);
  }


() => {
    const expression = fn(null, { ...args, title: '' }, {} as any);
    expect(expression.input.title).toEqual('');
  }


({
  children,
  padding = 'space60',
  paddingBottom,
  paddingLeft,
  paddingRight,
  paddingTop,
  ...props
}) => {
  return (
    <Box
      {...safelySpreadBoxProps(props)}
      as="article"
      borderWidth="borderWidth20"
      borderColor="colorBorderLight"
      borderStyle="solid"
      borderRadius="borderRadius20"
      padding={padding}
      paddingBottom={paddingBottom}
      paddingLeft={paddingLeft}
      paddingRight={paddingRight}
      paddingTop={paddingTop}
      backgroundColor="colorBackgroundBody"
    >
      {children}
    </Box>


export interface CardProps extends React.HTMLAttributes<''>, PaddingProps {}


export type Theme = typeof theme


(locale) => {
            const splitedLocale = locale.split('-');
            return splitedLocale.map((value, index) => {
                const localeGenerator = [];
                for (let i = 0; i <= index; i++) {
                    localeGenerator.push(splitedLocale[i]);
                }
                return localeGenerator.join('-');
            }).reverse();
        }


(value, index) => {
                const localeGenerator = [];
                for (let i = 0; i <= index; i++) {
                    localeGenerator.push(splitedLocale[i]);
                }
                return localeGenerator.join('-');
            }


(a, b) => a.concat(b)


/**
 * This transformers create fallbacks from complex locales to simpliest.
 * 'en-US-east' => ['en-US-east', 'en-US', 'en']
 * 'es-ES' => ['es-ES', 'es']
 */
export default class FallbacksTransformer extends Transformer {
    /**
     * Add fallbacks to locales. Locales should be in IETF language tag format.
     *
     * @param {Array<string>} locales - list of locales
     * @returns {Array<string>} locales with fallbacks
     */
    public transform(locales: string[]): string[] {
        return locales.map((locale) => {
            const splitedLocale = locale.split('-');
            return splitedLocale.map((value, index) => {
                const localeGenerator = [];
                for (let i = 0; i <= index; i++) {
                    localeGenerator.push(splitedLocale[i]);
                }
                return localeGenerator.join('-');
            }).reverse();
        }).reduce((a, b) => a.concat(b), []);
    }
}