() => {
    const abap = "INTERFACE zif_foobar PUBLIC.\n" +
      "  METHODS method1 IMPORTING foo TYPE i.\n" +
      "ENDINTERFACE.";

    const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
    const cdef = run(reg);
    const def = cdef!.getMethodDefinitions().getByName("method1");
    expect(def).to.not.equal(undefined);
    expect(def!.getParameters().getImporting().length).to.equal(1);
    expect(def!.getParameters().getImporting()[0].getName()).to.equal("foo");
  }


() => {
    const abap = "INTERFACE zif_foobar PUBLIC.\n" +
      "  METHODS method1 RETURNING VALUE(rv_foo) TYPE i.\n" +
      "ENDINTERFACE.";

    const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
    const cdef = run(reg);
    const def = cdef!.getMethodDefinitions().getByName("method1");
    expect(def).to.not.equal(undefined);
    const returning = def!.getParameters().getReturning();
    expect(returning).to.not.equal(undefined);
    if (returning) {
      expect(returning.getName()).to.equal("rv_foo");
    }
  }


() => {
  it("test, positive", () => {
    const abap = "INTERFACE zif_foobar PUBLIC.\n" +
      "  DATA moo TYPE i.\n" +
      "ENDINTERFACE.";

    const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
    const def = run(reg);
    const instance = def!.getAttributes()!.getInstance();
    expect(instance.length).to.equal(1);
    expect(instance[0].getName()).to.equal("moo");
    expect(instance[0].getVisibility()).to.equal(Visibility.Public);
  });
}


() => {
    const abap = "INTERFACE zif_foobar PUBLIC.\n" +
      "  DATA moo TYPE i.\n" +
      "ENDINTERFACE.";

    const reg = new Registry().addFile(new MemoryFile("zif_foobar.intf.abap", abap)).parse();
    const def = run(reg);
    const instance = def!.getAttributes()!.getInstance();
    expect(instance.length).to.equal(1);
    expect(instance[0].getName()).to.equal("moo");
    expect(instance[0].getVisibility()).to.equal(Visibility.Public);
  }


export function createDeserializationError(
  message: string,
  response: Response
): DeserializationError {
  return {
    name: 'DeserializationError',
    message,
    response,
  };
}


export function useItemsDB() {
  return usePromised(itemsDatabaseV3);
}


/**
 *
Updates a model version. Updating a model version retrains an existing model version using updated training data and produces a new minor version of the model. You can update the training data set location and data access role attributes using this action. This action creates and trains a new minor version of the model, for example version 1.01, 1.02, 1.03.

 * @example
 * Use a bare-bones client and the command you need to make an API call.
 * ```javascript
 * import { FraudDetectorClient, UpdateModelVersionCommand } from "../../client-frauddetector/mod.ts";
 * // const { FraudDetectorClient, UpdateModelVersionCommand } = require("@aws-sdk/client-frauddetector"); // CommonJS import
 * const client = new FraudDetectorClient(config);
 * const command = new UpdateModelVersionCommand(input);
 * const response = await client.send(command);
 * ```
 *
 * @see {@link UpdateModelVersionCommandInput} for command's `input` shape.
 * @see {@link UpdateModelVersionCommandOutput} for command's `response` shape.
 * @see {@link FraudDetectorClientResolvedConfig | config} for command's `input` shape.
 *
 */
export class UpdateModelVersionCommand extends $Command<
  UpdateModelVersionCommandInput,
  UpdateModelVersionCommandOutput,
  FraudDetectorClientResolvedConfig
> {
  // Start section: command_properties
  // End section: command_properties

  constructor(readonly input: UpdateModelVersionCommandInput) {
    // Start section: command_constructor
    super();
    // End section: command_constructor
  }

  /**
   * @internal
   */
  resolveMiddleware(
    clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
    configuration: FraudDetectorClientResolvedConfig,
    options?: __HttpHandlerOptions
  ): Handler<UpdateModelVersionCommandInput, UpdateModelVersionCommandOutput> {
    this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

    const stack = clientStack.concat(this.middlewareStack);

    const { logger } = configuration;
    const clientName = "FraudDetectorClient";
    const commandName = "UpdateModelVersionCommand";
    const handlerExecutionContext: HandlerExecutionContext = {
      logger,
      clientName,
      commandName,
      inputFilterSensitiveLog: UpdateModelVersionRequest.filterSensitiveLog,
      outputFilterSensitiveLog: UpdateModelVersionResult.filterSensitiveLog,
    };
    const { requestHandler } = configuration;
    return stack.resolve(
      (request: FinalizeHandlerArguments<any>) =>
        requestHandler.handle(request.request as __HttpRequest, options || {}),
      handlerExecutionContext
    );
  }

  private serialize(input: UpdateModelVersionCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
    return serializeAws_json1_1UpdateModelVersionCommand(input, context);
  }

  private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateModelVersionCommandOutput> {
    return deserializeAws_json1_1UpdateModelVersionCommand(output, context);
  }

  // Start section: command_body_extra
  // End section: command_body_extra
}


export interface UpdateModelVersionCommandInput extends UpdateModelVersionRequest {}


export interface UpdateModelVersionCommandOutput extends UpdateModelVersionResult, __MetadataBearer {}


/**
   * @internal
   */
resolveMiddleware(
    clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
    configuration: FraudDetectorClientResolvedConfig,
    options?: __HttpHandlerOptions
  ): Handler<UpdateModelVersionCommandInput, UpdateModelVersionCommandOutput> {
    this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

    const stack = clientStack.concat(this.middlewareStack);

    const { logger } = configuration;
    const clientName = "FraudDetectorClient";
    const commandName = "UpdateModelVersionCommand";
    const handlerExecutionContext: HandlerExecutionContext = {
      logger,
      clientName,
      commandName,
      inputFilterSensitiveLog: UpdateModelVersionRequest.filterSensitiveLog,
      outputFilterSensitiveLog: UpdateModelVersionResult.filterSensitiveLog,
    };
    const { requestHandler } = configuration;
    return stack.resolve(
      (request: FinalizeHandlerArguments<any>) =>
        requestHandler.handle(request.request as __HttpRequest, options || {}),
      handlerExecutionContext
    );
  }


private serialize(input: UpdateModelVersionCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
    return serializeAws_json1_1UpdateModelVersionCommand(input, context);
  }


private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateModelVersionCommandOutput> {
    return deserializeAws_json1_1UpdateModelVersionCommand(output, context);
  }


({
  post,
  displayFull = false,
  asLink = true,
  showLike = true,
  showComment = true,
  showTimer = true,
  showShare = true,
  showMore = false,
}: Props) => {
  return (
    <article className={`${displayFull ? "w-full h-full flex flex-col" : ""}`}


type Props = {
  post: Post;
  displayFull?: boolean;
  asLink?: boolean;
  showLike?: boolean;
  showComment?: boolean;
  showTimer?: boolean;
  showShare?: boolean;
  showMore?: boolean;
};


asLink ? (
        <Link
          className="block text-slate-900 hover:no-underline dark:text-slate-50"
          to={`/posts/${post.id}`


(marble: string | null, frameTimeFactor: number = 1, maxFrame = 1000) => {
  if (!marble) {
    return new SubscriptionLog(Number.POSITIVE_INFINITY);
  }

  const marbleTokenArray = Array.from(marble).filter((token) => token !== ObservableMarbleToken.NOOP);
  const value = marbleTokenArray.reduce(subscriptionTokenParseReducer(frameTimeFactor, maxFrame), {
    currentTimeFrame: 0,
    subscriptionFrame: Number.POSITIVE_INFINITY,
    unsubscriptionFrame: Number.POSITIVE_INFINITY,
    simultaneousGrouped: false,
    expandingTokenCount: 0,
    expandingValue: [],
  });

  return value.unsubscriptionFrame === Number.POSITIVE_INFINITY
    ? new SubscriptionLog(value.subscriptionFrame)
    : new SubscriptionLog(value.subscriptionFrame, value.unsubscriptionFrame);
}


(token) => token !== ObservableMarbleToken.NOOP


async (request, response: any) => {
    const secret = request.headers.authorization as string | undefined;

    if (secret !== adminConfig.napoancom.auth) {
      return response.status(401).json({
        message: 'Invalid token',
      });
    }

    if (request.method == 'GET') {
      const maxAge = parseInt(adminConfig.contentful.maxage ?? '3000');
      response.setHeader('Cache-Control', `public, s-maxage=${maxAge}, stale-while-revalidate=86400`);

      const limitQuery = request.query.limit as string | undefined;
      const limit = parseInt(limitQuery ?? TOTAL_LIMIT.toString());

      const previewQuery = request.query.preview as string | undefined;
      let preview = false;
      if (previewQuery === 'true') {
        preview = true;
      } else {
        preview = false;
      }

      const slug = request.query.slug as string | undefined;

      if (slug == undefined || slug == '') {
        return response.status(500).json({
          error: 'Invalid slug',
        });
      } else {
        const entries = await fetchGraphQL(
          `query {
            personCollection(limit: 1, where: {slug: "${slug}"}, order: sys_firstPublishedAt_DESC) {
              items {
                displayName
                linkedFrom {
                  blogPostCollection(limit:${limit ?? TOTAL_LIMIT}) {
                    items {
                      ${POSTFORLIST_GRAPHQL_FIELDS}
                    }
                  }
                }
              }
            }
          }`,
          preview,
        );
        try {
          const result = extracter.extractPostForListsFromPerson(entries);
          if (result) {
            functions.logger.info(`Successfully fetched ${result.length} entries.`);
            return response.status(200).json(result);
          } else {
            return response.status(404).json({ error: 'Not found' });
          }
        } catch (e) {
          return response.status(500).send(e);
        }
      }
    } else {
      return response.status(405).json({
        error: 'Please use GET method',
      });
    }
  }


/**
 * Class used to create a 2D stack panel container
 */
export declare class StackPanel extends Container {
    name?: string | undefined;
    private _isVertical;
    private _manualWidth;
    private _manualHeight;
    private _doNotTrackManualChanges;
    /**
     * Gets or sets a boolean indicating that layou warnings should be ignored
     */
    ignoreLayoutWarnings: boolean;
    /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
    get isVertical(): boolean;
    set isVertical(value: boolean);
    /**
     * Gets or sets panel width.
     * This value should not be set when in horizontal mode as it will be computed automatically
     */
    set width(value: string | number);
    get width(): string | number;
    /**
     * Gets or sets panel height.
     * This value should not be set when in vertical mode as it will be computed automatically
     */
    set height(value: string | number);
    get height(): string | number;
    /**
     * Creates a new StackPanel
     * @param name defines control name
     */
    constructor(name?: string | undefined);
    protected _getTypeName(): string;
    /** @hidden */
    protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
    protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
    protected _postMeasure(): void;
}


protected _getTypeName(): string;


/** @hidden */
protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;


protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;


protected _postMeasure(): void;


@NgModule({
  imports: [ RouterModule.forChild(routes) ],
  exports: [ RouterModule ]
})
export class LibRoutingModule {}


export function fieldsToLabware(
  fields: ProcessedLabwareFields
): LabwareDefinition2 {
  // NOTE Ian 2019-07-27: only the 15-50-esque tube rack has multiple grids,
  // and it is not supported in labware creator. So all are regular.
  const isRegularLabware = true
  const { displayName } = fields
  const displayCategory = fields.labwareType

  if (isRegularLabware) {
    const totalLiquidVolume = fields.wellVolume
    const commonWellProperties = {
      depth: fields.wellDepth,
      totalLiquidVolume,
    }
    const wellProperties: LabwareWellProperties =
      fields.wellShape === 'circular'
        ? {
            ...commonWellProperties,
            shape: 'circular',
            diameter: fields.wellDiameter,
          }
        : {
            ...commonWellProperties,
            shape: 'rectangular',
            xDimension: fields.wellXDimension,
            yDimension: fields.wellYDimension,
          }

    // NOTE Ian 2019-07-29: Cannot use fields.labwareType, must be "96Standard", "384Standard", "trough", "irregular", or "trash".
    // Also note that 'irregular' in `format` just means "not 96/384 standard, not trough, and not trash",
    // it doesn't imply anything about having multiple grids or not.
    const format = 'irregular'
    let quirks: string[] = []

    const heightOrDiameter =
      fields.wellShape === 'circular'
        ? fields.wellDiameter
        : fields.wellYDimension
    if (fields.gridRows === 1 && heightOrDiameter >= MULTI_CHANNEL_WIDTH_MM) {
      quirks = [...quirks, 'centerMultichannelOnWells', 'touchTipDisabled']

      // Legacy API (v1) uses `lw_format == 'trough'` instead of centerMultichannelOnWells quirk.
      // HOWEVER, setting format to 'trough' also makes the well size zero, so you can't
      // position the tip to the edges of the labware.
      // Optimizing for the APIv1 labware test protocol (which is always with a single-channel)
      // over APIv1 protocol use, we'll AVOID setting the format to 'trough' here
      //
      // format = 'trough' // Uncomment to break test protocol but allow multichannel use in APIv1
    }

    const brand = {
      brand: fields.brand,
      brandId: fields.brandId,
      //   links: []
    }

    const groupMetadataDisplayCategory = _getGroupMetadataDisplayCategory({
      aluminumBlockChildType: fields.aluminumBlockChildType,
      labwareType: fields.labwareType,
    })

    const def = createRegularLabware({
      strict: false,
      metadata: {
        displayName,
        displayCategory,
        displayVolumeUnits: DISPLAY_VOLUME_UNITS,
        tags: [], // specifying tags is not yet supported
      },
      parameters: {
        format,
        quirks,
        isTiprack: fields.labwareType === 'tipRack',
        //   tipLength?: number,
        // Currently, assume labware is not magnetic module compatible. We don't have the information here.
        isMagneticModuleCompatible: false,
        //   magneticModuleEngageHeight?: number,
      },
      dimensions: {
        xDimension: fields.footprintXDimension,
        yDimension: fields.footprintYDimension,
        zDimension: fields.labwareZDimension,
      },
      brand,
      version: 1,
      offset: {
        x: fields.gridOffsetX,
        y: fields.gridOffsetY,
        // NOTE: must give wells a z offset b/c `well.z = offset.z - wellDepth`.
        // We include well lip as part of Z dimension in Labware Creator's fields,
        // so labware's offset.z is the SAME as labwareZDimension.
        z: fields.labwareZDimension,
      },
      grid: {
        column: fields.gridColumns,
        row: fields.gridRows,
      },
      spacing: {
        column: fields.gridSpacingX,
        row: fields.gridSpacingY,
      },
      well: wellProperties,
      // NOTE(IL, 2020-06-22): as per #5801, `group` should not include brand or displayName
      // unless the "wells" are different than the overall labware (eg NEST tubes in an opentrons rack/block).
      // Since LC doesn't allow the user to specify any of these 3 fields for wells themselves, we'll omit them
      // from the definition.
      group: {
        metadata: {
          wellBottomShape: fields.wellBottomShape,
          ...(groupMetadataDisplayCategory
            ? { displayCategory: groupMetadataDisplayCategory }
            : null),
        },
      },
    })

    // overwrite loadName from createRegularLabware with ours
    def.parameters.loadName = fields.loadName

    return def
  } else {
    throw new Error('use of createIrregularLabware not yet implemented')
    // return createIrregularLabware({ TODO })
  }
}


(args: {
  aluminumBlockChildType: string | null | undefined
  labwareType: string
}): LabwareDisplayCategory | null => {
  const { aluminumBlockChildType, labwareType } = args
  if (labwareType === 'tubeRack') {
    return 'tubeRack'
  } else if (labwareType === 'aluminumBlock') {
    const childIsWellPlate = aluminumBlockChildType === 'pcrPlate'
    return childIsWellPlate ? 'wellPlate' : 'tubeRack'
  }
  return null
}


/** if `marked` exists, use it; else, return safe html */
export function defaultConvertor(footnote: string, text: string): string {
  if (!text) return null
  return markdownToHTML(text)
}


(text: string) => {
    text = text.replace(/&/g, '&').replace(/</g, '<').replace(/  /g, '  ')
    return "<pre>" + text + "</pre>"
  }


/* ON  */
() => { lineDiv.addEventListener("mouseenter", evhandler, true) }


/* OFF */
() => { lineDiv.removeEventListener("mouseenter", evhandler, true); this.hideInfo() }


//#endregion
/********************************************************************************** */
//#region Addon Class
export class Hover implements Addon.Addon, Options /* if needed */ {
  xOffset: number;
  convertor: Convertor;
  enabled: boolean;

  constructor(public cm: cm_t) {
    // options will be initialized to defaultOption when constructor is finished

    new FlipFlop(
      /* ON  */() => { lineDiv.addEventListener("mouseenter", evhandler, true) },
      /* OFF */() => { lineDiv.removeEventListener("mouseenter", evhandler, true); this.hideInfo() }
    ).bind(this, "enabled", true)

    var lineDiv = cm.display.lineDiv as HTMLDivElement
    this.lineDiv = lineDiv

    var tooltip = document.createElement("div"),
      tooltipContent = document.createElement("div"),
      tooltipIndicator = document.createElement("div")
    tooltip.setAttribute("style", "position:absolute;z-index:99")
    tooltip.setAttribute("class", "HyperMD-hover")
    tooltip.setAttribute("cm-ignore-events", "true")

    tooltipContent.setAttribute("class", "HyperMD-hover-content")
    tooltip.appendChild(tooltipContent)

    tooltipIndicator.setAttribute("class", "HyperMD-hover-indicator")
    tooltip.appendChild(tooltipIndicator)

    this.tooltipDiv = tooltip
    this.tooltipContentDiv = tooltipContent
    this.tooltipIndicator = tooltipIndicator

    const evhandler = this.mouseenter.bind(this)
  }

  private lineDiv: HTMLDivElement // CodeMirror's line container
  public tooltipDiv: HTMLDivElement
  public tooltipContentDiv: HTMLDivElement
  public tooltipIndicator: HTMLDivElement

  mouseenter(ev: MouseEvent) {
    var cm = this.cm, target = ev.target as HTMLElement
    var className = target.className
    if (target == this.tooltipDiv || (target.compareDocumentPosition && (target.compareDocumentPosition(this.tooltipDiv) & 8) == 8)) {
      return
    }

    var mat: RegExpMatchArray
    if (target.nodeName !== "SPAN" || !(mat = className.match(/(?:^|\s)cm-(hmd-barelink2?|hmd-footref2)(?:\s|$)/))) {
      this.hideInfo()
      return
    }

    var pos = cm.coordsChar({ left: ev.clientX, top: ev.clientY }, "window")
    let footnoteName = null
    var footnote: Link = null

    const hover_type = mat[1] // hmd-barelink|hmd-link-url-s
    var range = expandRange(cm, pos, hover_type)
    if (range) {
      footnoteName = cm.getRange(range.from, range.to)
      footnoteName = footnoteName.slice(1, -1)
      if (footnoteName) footnote = cm.hmdReadLink(footnoteName, pos.line) || null
    }

    var convertor = this.convertor || defaultConvertor
    var html = convertor(footnoteName, footnote && footnote.content || null)

    if (!html) {
      this.hideInfo()
      return
    }

    this.showInfo(html, target)
  }

  showInfo(html: string, relatedTo: HTMLElement) {
    const b1 = relatedTo.getBoundingClientRect()
    const b2 = this.lineDiv.getBoundingClientRect()
    const tdiv = this.tooltipDiv
    var xOffset = this.xOffset

    this.tooltipContentDiv.innerHTML = html
    tdiv.style.left = (b1.left - b2.left - xOffset) + 'px'
    this.lineDiv.appendChild(tdiv)

    var b3 = tdiv.getBoundingClientRect()
    if (b3.right > b2.right) {
      xOffset = b3.right - b2.right
      tdiv.style.left = (b1.left - b2.left - xOffset) + 'px'
    }
    tdiv.style.top = (b1.top - b2.top - b3.height) + 'px'

    this.tooltipIndicator.style.marginLeft = xOffset + 'px'
  }

  hideInfo() {
    if (this.tooltipDiv.parentElement == this.lineDiv) {
      this.lineDiv.removeChild(this.tooltipDiv)
    }
  }
}


/********************************************************************************** */
//#region Addon Options
export interface Options extends Addon.AddonOptions {
  /** Enable Hover features or not. */ // TODO: write doc here
  enabled: boolean

  xOffset: number

  /**
   * function to decide the tooltip's content.
   *
   * First parameter is the name of footnote (without square brackets),
   * and the second is footnote Markdown content (might be `null`, if not found).
   * This function shall returns HTML string or `null`.
   *
   * @see Convertor
   * @see defaultConvertor
   */
  convertor: Convertor
}


interface EditorConfiguration {
      /**
       * Options for Hover.
       *
       * You may also provide a `false` to disable it;
       * a `true` to enable it with defaultOption (except `enabled`);
       * or a Convertor to decide the content of tooltip.
       *
       * @see Convertor
       */
      hmdHover?: OptionValueType
    }


interface HelperCollection { Hover?: Hover }


/********************************************************************************** */
/** convert footnote text into HTML. Note that `markdown` may be empty and you may return `null` to supress the tooltip */
export type Convertor = (footnote: string, markdown: string) => string


export type OptionValueType = Partial<Options> | boolean | Convertor;


mouseenter(ev: MouseEvent) {
    var cm = this.cm, target = ev.target as HTMLElement
    var className = target.className
    if (target == this.tooltipDiv || (target.compareDocumentPosition && (target.compareDocumentPosition(this.tooltipDiv) & 8) == 8)) {
      return
    }

    var mat: RegExpMatchArray
    if (target.nodeName !== "SPAN" || !(mat = className.match(/(?:^|\s)cm-(hmd-barelink2?|hmd-footref2)(?:\s|$)/))) {
      this.hideInfo()
      return
    }

    var pos = cm.coordsChar({ left: ev.clientX, top: ev.clientY }, "window")
    let footnoteName = null
    var footnote: Link = null

    const hover_type = mat[1] // hmd-barelink|hmd-link-url-s
    var range = expandRange(cm, pos, hover_type)
    if (range) {
      footnoteName = cm.getRange(range.from, range.to)
      footnoteName = footnoteName.slice(1, -1)
      if (footnoteName) footnote = cm.hmdReadLink(footnoteName, pos.line) || null
    }

    var convertor = this.convertor || defaultConvertor
    var html = convertor(footnoteName, footnote && footnote.content || null)

    if (!html) {
      this.hideInfo()
      return
    }

    this.showInfo(html, target)
  }


showInfo(html: string, relatedTo: HTMLElement) {
    const b1 = relatedTo.getBoundingClientRect()
    const b2 = this.lineDiv.getBoundingClientRect()
    const tdiv = this.tooltipDiv
    var xOffset = this.xOffset

    this.tooltipContentDiv.innerHTML = html
    tdiv.style.left = (b1.left - b2.left - xOffset) + 'px'
    this.lineDiv.appendChild(tdiv)

    var b3 = tdiv.getBoundingClientRect()
    if (b3.right > b2.right) {
      xOffset = b3.right - b2.right
      tdiv.style.left = (b1.left - b2.left - xOffset) + 'px'
    }
    tdiv.style.top = (b1.top - b2.top - b3.height) + 'px'

    this.tooltipIndicator.style.marginLeft = xOffset + 'px'
  }


hideInfo() {
    if (this.tooltipDiv.parentElement == this.lineDiv) {
      this.lineDiv.removeChild(this.tooltipDiv)
    }
  }


async ({ context: sequelize }: UmzugContext) => {
	logMigrationStart('up', migrationName);
	await sequelize.getQueryInterface().bulkInsert(tableName, config);
	logMigrationEnd('up', migrationName);
}


async ({ context: sequelize }: UmzugContext) => {
	logMigrationStart('down', migrationName);
	await sequelize.getQueryInterface().bulkDelete(tableName, { key: config.map((c) => c.key!) });
	logMigrationEnd('down', migrationName);
}


(c) => c.key!


() => {

    let driver: AppiumDriver;
    let screen: Screen;

    before(async () => {
        driver = await createDriver();
        screen = new Screen(driver);
    });

    roots.forEach(root => {
        describe(`${root} modal frame background scenarios:`, () => {

            before(async () => {
                await screen[root]();
            });

            beforeEach(async function () {
                await screen.loadModalFrame();
            });

            afterEach(async function () {
                if (this.currentTest.state === "failed") {
                    await driver.logTestArtifacts(this.currentTest.title);
                    await driver.resetApp();
                    await screen[root]();
                }
            });

            after(async () => {
                await screen.closeModal();
                await screen.loadedHome();
            });

            it("should show dialog confirm, run in background", async () => {
                await testDialogBackground(driver, screen);
            });

            it("should run modal page with frame in background", async () => {
                await modalFrameBackground(driver, screen);
            });

            it("should navigate to second page, run in background, go back", async () => {
                await testSecondPageBackground(driver, screen);
            });

            it("should show nested modal page with frame, run in background, close", async () => {
                await testNestedModalFrameBackground(driver, screen);
            });

            it("should show nested modal page, run in background, close", async () => {
                await testNestedModalPageBackground(driver, screen);
            });

            it("should navigate to second page, close", async () => {
                await testSecondPageClose(driver, screen);
            });

            it("should navigate to second page, run in background, go back", async () => {
                await testSecondPageBackground(driver, screen);
            });
        });
    });
}


async () => {
        driver = await createDriver();
        screen = new Screen(driver);
    }


root => {
        describe(`${root} modal frame background scenarios:`, () => {

            before(async () => {
                await screen[root]();
            });

            beforeEach(async function () {
                await screen.loadModalFrame();
            });

            afterEach(async function () {
                if (this.currentTest.state === "failed") {
                    await driver.logTestArtifacts(this.currentTest.title);
                    await driver.resetApp();
                    await screen[root]();
                }
            });

            after(async () => {
                await screen.closeModal();
                await screen.loadedHome();
            });

            it("should show dialog confirm, run in background", async () => {
                await testDialogBackground(driver, screen);
            });

            it("should run modal page with frame in background", async () => {
                await modalFrameBackground(driver, screen);
            });

            it("should navigate to second page, run in background, go back", async () => {
                await testSecondPageBackground(driver, screen);
            });

            it("should show nested modal page with frame, run in background, close", async () => {
                await testNestedModalFrameBackground(driver, screen);
            });

            it("should show nested modal page, run in background, close", async () => {
                await testNestedModalPageBackground(driver, screen);
            });

            it("should navigate to second page, close", async () => {
                await testSecondPageClose(driver, screen);
            });

            it("should navigate to second page, run in background, go back", async () => {
                await testSecondPageBackground(driver, screen);
            });
        });
    }


() => {

            before(async () => {
                await screen[root]();
            });

            beforeEach(async function () {
                await screen.loadModalFrame();
            });

            afterEach(async function () {
                if (this.currentTest.state === "failed") {
                    await driver.logTestArtifacts(this.currentTest.title);
                    await driver.resetApp();
                    await screen[root]();
                }
            });

            after(async () => {
                await screen.closeModal();
                await screen.loadedHome();
            });

            it("should show dialog confirm, run in background", async () => {
                await testDialogBackground(driver, screen);
            });

            it("should run modal page with frame in background", async () => {
                await modalFrameBackground(driver, screen);
            });

            it("should navigate to second page, run in background, go back", async () => {
                await testSecondPageBackground(driver, screen);
            });

            it("should show nested modal page with frame, run in background, close", async () => {
                await testNestedModalFrameBackground(driver, screen);
            });

            it("should show nested modal page, run in background, close", async () => {
                await testNestedModalPageBackground(driver, screen);
            });

            it("should navigate to second page, close", async () => {
                await testSecondPageClose(driver, screen);
            });

            it("should navigate to second page, run in background, go back", async () => {
                await testSecondPageBackground(driver, screen);
            });
        }


async () => {
                await screen[root]();
            }


async () => {
                await screen.closeModal();
                await screen.loadedHome();
            }


async () => {
                await testDialogBackground(driver, screen);
            }


async () => {
                await modalFrameBackground(driver, screen);
            }


async () => {
                await testSecondPageBackground(driver, screen);
            }


async () => {
                await testNestedModalFrameBackground(driver, screen);
            }


async () => {
                await testNestedModalPageBackground(driver, screen);
            }


async () => {
                await testSecondPageClose(driver, screen);
            }


function getSveltePlugin() {
            // Only provide our version of the svelte plugin if the user doesn't have one in
            // the workspace already. If we did it, Prettier would - for some reason - use
            // the workspace version for parsing and the extension version for printing,
            // which could crash if the contract of the parser output changed.
            const hasPluginLoadedAlready = prettier
                .getSupportInfo()
                .languages.some((l) => l.name === 'svelte');
            return hasPluginLoadedAlready ? [] : [require.resolve('prettier-plugin-svelte')];
        }


function returnObjectIfHasKeys<T>(obj: T | undefined): T | undefined {
            if (Object.keys(obj || {}).length > 0) {
                return obj;
            }
        }


(l) => l.name === 'svelte'


export class SveltePlugin
    implements
        DiagnosticsProvider,
        FormattingProvider,
        CompletionsProvider,
        HoverProvider,
        CodeActionsProvider,
        SelectionRangeProvider
{
    private docManager = new Map<Document, SvelteDocument>();

    constructor(private configManager: LSConfigManager) {}

    async getDiagnostics(document: Document): Promise<Diagnostic[]> {
        if (!this.featureEnabled('diagnostics')) {
            return [];
        }

        return getDiagnostics(
            document,
            await this.getSvelteDoc(document),
            this.configManager.getConfig().svelte.compilerWarnings
        );
    }

    async getCompiledResult(document: Document): Promise<SvelteCompileResult | null> {
        try {
            const svelteDoc = await this.getSvelteDoc(document);
            return svelteDoc.getCompiledWith({ generate: 'dom' });
        } catch (error) {
            return null;
        }
    }

    async formatDocument(document: Document, options: FormattingOptions): Promise<TextEdit[]> {
        if (!this.featureEnabled('format')) {
            return [];
        }

        const filePath = document.getFilePath()!;
        const prettier = importPrettier(filePath);
        // Try resolving the config through prettier and fall back to possible editor config
        const config =
            returnObjectIfHasKeys(await prettier.resolveConfig(filePath, { editorconfig: true })) ||
            merge(
                {}, // merge into empty obj to not manipulate own config
                this.configManager.get('svelte.format.config'),
                returnObjectIfHasKeys(this.configManager.getPrettierConfig()) ||
                    // Be defensive here because IDEs other than VSCode might not have these settings
                    (options && {
                        tabWidth: options.tabSize,
                        useTabs: !options.insertSpaces
                    }) ||
                    {}
            );
        // If user has prettier-plugin-svelte 1.x, then remove `options` from the sort
        // order or else it will throw a config error (`options` was not present back then).
        if (
            config?.svelteSortOrder &&
            getPackageInfo('prettier-plugin-svelte', filePath)?.version.major < 2
        ) {
            config.svelteSortOrder = config.svelteSortOrder
                .replace('-options', '')
                .replace('options-', '');
        }
        // Take .prettierignore into account
        const fileInfo = await prettier.getFileInfo(filePath, {
            ignorePath: this.configManager.getPrettierConfig()?.ignorePath ?? '.prettierignore',
            // Sapper places stuff within src/node_modules, we want to format that, too
            withNodeModules: true
        });
        if (fileInfo.ignored) {
            Logger.log('File is ignored, formatting skipped');
            return [];
        }

        const formattedCode = prettier.format(document.getText(), {
            ...config,
            plugins: getSveltePlugin(),
            parser: 'svelte' as any
        });

        return [
            TextEdit.replace(
                Range.create(document.positionAt(0), document.positionAt(document.getTextLength())),
                formattedCode
            )
        ];

        function getSveltePlugin() {
            // Only provide our version of the svelte plugin if the user doesn't have one in
            // the workspace already. If we did it, Prettier would - for some reason - use
            // the workspace version for parsing and the extension version for printing,
            // which could crash if the contract of the parser output changed.
            const hasPluginLoadedAlready = prettier
                .getSupportInfo()
                .languages.some((l) => l.name === 'svelte');
            return hasPluginLoadedAlready ? [] : [require.resolve('prettier-plugin-svelte')];
        }

        function returnObjectIfHasKeys<T>(obj: T | undefined): T | undefined {
            if (Object.keys(obj || {}).length > 0) {
                return obj;
            }
        }
    }

    async getCompletions(document: Document, position: Position): Promise<CompletionList | null> {
        if (!this.featureEnabled('completions')) {
            return null;
        }

        return getCompletions(await this.getSvelteDoc(document), position);
    }

    async doHover(document: Document, position: Position): Promise<Hover | null> {
        if (!this.featureEnabled('hover')) {
            return null;
        }

        return getHoverInfo(await this.getSvelteDoc(document), position);
    }

    async getCodeActions(
        document: Document,
        range: Range,
        context: CodeActionContext
    ): Promise<CodeAction[]> {
        if (!this.featureEnabled('codeActions')) {
            return [];
        }

        const svelteDoc = await this.getSvelteDoc(document);
        try {
            return getCodeActions(svelteDoc, range, context);
        } catch (error) {
            return [];
        }
    }

    async executeCommand(
        document: Document,
        command: string,
        args?: any[]
    ): Promise<WorkspaceEdit | string | null> {
        if (!this.featureEnabled('codeActions')) {
            return null;
        }

        const svelteDoc = await this.getSvelteDoc(document);
        try {
            return executeCommand(svelteDoc, command, args);
        } catch (error) {
            return null;
        }
    }

    async getSelectionRange(
        document: Document,
        position: Position
    ): Promise<SelectionRange | null> {
        if (!this.featureEnabled('selectionRange')) {
            return null;
        }

        const svelteDoc = await this.getSvelteDoc(document);

        return getSelectionRange(svelteDoc, position);
    }

    private featureEnabled(feature: keyof LSSvelteConfig) {
        return (
            this.configManager.enabled('svelte.enable') &&
            this.configManager.enabled(`svelte.${feature}.enable`)
        );
    }

    private async getSvelteDoc(document: Document) {
        let svelteDoc = this.docManager.get(document);
        if (!svelteDoc || svelteDoc.version !== document.version) {
            svelteDoc?.destroyTranspiled();
            svelteDoc = new SvelteDocument(document);
            this.docManager.set(document, svelteDoc);
        }
        return svelteDoc;
    }
}


async getDiagnostics(document: Document): Promise<Diagnostic[]> {
        if (!this.featureEnabled('diagnostics')) {
            return [];
        }

        return getDiagnostics(
            document,
            await this.getSvelteDoc(document),
            this.configManager.getConfig().svelte.compilerWarnings
        );
    }


async getCompiledResult(document: Document): Promise<SvelteCompileResult | null> {
        try {
            const svelteDoc = await this.getSvelteDoc(document);
            return svelteDoc.getCompiledWith({ generate: 'dom' });
        } catch (error) {
            return null;
        }
    }


async formatDocument(document: Document, options: FormattingOptions): Promise<TextEdit[]> {
        if (!this.featureEnabled('format')) {
            return [];
        }

        const filePath = document.getFilePath()!;
        const prettier = importPrettier(filePath);
        // Try resolving the config through prettier and fall back to possible editor config
        const config =
            returnObjectIfHasKeys(await prettier.resolveConfig(filePath, { editorconfig: true })) ||
            merge(
                {}, // merge into empty obj to not manipulate own config
                this.configManager.get('svelte.format.config'),
                returnObjectIfHasKeys(this.configManager.getPrettierConfig()) ||
                    // Be defensive here because IDEs other than VSCode might not have these settings
                    (options && {
                        tabWidth: options.tabSize,
                        useTabs: !options.insertSpaces
                    }) ||
                    {}
            );
        // If user has prettier-plugin-svelte 1.x, then remove `options` from the sort
        // order or else it will throw a config error (`options` was not present back then).
        if (
            config?.svelteSortOrder &&
            getPackageInfo('prettier-plugin-svelte', filePath)?.version.major < 2
        ) {
            config.svelteSortOrder = config.svelteSortOrder
                .replace('-options', '')
                .replace('options-', '');
        }
        // Take .prettierignore into account
        const fileInfo = await prettier.getFileInfo(filePath, {
            ignorePath: this.configManager.getPrettierConfig()?.ignorePath ?? '.prettierignore',
            // Sapper places stuff within src/node_modules, we want to format that, too
            withNodeModules: true
        });
        if (fileInfo.ignored) {
            Logger.log('File is ignored, formatting skipped');
            return [];
        }

        const formattedCode = prettier.format(document.getText(), {
            ...config,
            plugins: getSveltePlugin(),
            parser: 'svelte' as any
        });

        return [
            TextEdit.replace(
                Range.create(document.positionAt(0), document.positionAt(document.getTextLength())),
                formattedCode
            )
        ];

        function getSveltePlugin() {
            // Only provide our version of the svelte plugin if the user doesn't have one in
            // the workspace already. If we did it, Prettier would - for some reason - use
            // the workspace version for parsing and the extension version for printing,
            // which could crash if the contract of the parser output changed.
            const hasPluginLoadedAlready = prettier
                .getSupportInfo()
                .languages.some((l) => l.name === 'svelte');
            return hasPluginLoadedAlready ? [] : [require.resolve('prettier-plugin-svelte')];
        }

        function returnObjectIfHasKeys<T>(obj: T | undefined): T | undefined {
            if (Object.keys(obj || {}).length > 0) {
                return obj;
            }
        }
    }


async getCompletions(document: Document, position: Position): Promise<CompletionList | null> {
        if (!this.featureEnabled('completions')) {
            return null;
        }

        return getCompletions(await this.getSvelteDoc(document), position);
    }


async doHover(document: Document, position: Position): Promise<Hover | null> {
        if (!this.featureEnabled('hover')) {
            return null;
        }

        return getHoverInfo(await this.getSvelteDoc(document), position);
    }


async getCodeActions(
        document: Document,
        range: Range,
        context: CodeActionContext
    ): Promise<CodeAction[]> {
        if (!this.featureEnabled('codeActions')) {
            return [];
        }

        const svelteDoc = await this.getSvelteDoc(document);
        try {
            return getCodeActions(svelteDoc, range, context);
        } catch (error) {
            return [];
        }
    }


async executeCommand(
        document: Document,
        command: string,
        args?: any[]
    ): Promise<WorkspaceEdit | string | null> {
        if (!this.featureEnabled('codeActions')) {
            return null;
        }

        const svelteDoc = await this.getSvelteDoc(document);
        try {
            return executeCommand(svelteDoc, command, args);
        } catch (error) {
            return null;
        }
    }


async getSelectionRange(
        document: Document,
        position: Position
    ): Promise<SelectionRange | null> {
        if (!this.featureEnabled('selectionRange')) {
            return null;
        }

        const svelteDoc = await this.getSvelteDoc(document);

        return getSelectionRange(svelteDoc, position);
    }


private featureEnabled(feature: keyof LSSvelteConfig) {
        return (
            this.configManager.enabled('svelte.enable') &&
            this.configManager.enabled(`svelte.${feature}.enable`)
        );
    }


private async getSvelteDoc(document: Document) {
        let svelteDoc = this.docManager.get(document);
        if (!svelteDoc || svelteDoc.version !== document.version) {
            svelteDoc?.destroyTranspiled();
            svelteDoc = new SvelteDocument(document);
            this.docManager.set(document, svelteDoc);
        }
        return svelteDoc;
    }


() => console.log('done')


@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})

export class SampleRoutingModule { }


export default function binaryToDecimal(binary: string): number {
  const binaryDigits = String(binary)
    .split('')
    .map(digit => Number(digit))

  let convertedDecimal = 0

  for (let i = 0; i < binaryDigits.length; i += 1) {
    const digit = binaryDigits[i]

    convertedDecimal += digit * 2 ** (binaryDigits.length - i - 1)
  }

  return convertedDecimal
}


digit => Number(digit)


({theme}) => theme.fonts.regular


({theme}) => theme.colors.text_dark


({theme}) => theme.colors.shape


export class Item {
    itemId: number;
    itemName: string;
    itemSize: string;
    itemCost: number;
    itemModifier: string[];
    itemExtras: Item[]
    itemIsExtra: boolean;
    itemLocation: number;

    constructor(
        itemId:number,
        itemName: string,
        itemSize: string,
        itemCost: number,
        itemModifier: string[],
        itemExtras: Item[],
        itemIsExtra: boolean,
        itemLocation: number
    )
    {
        this.itemId = itemId;
        this.itemName = itemName;
        this.itemSize = itemSize;
        this.itemCost = itemCost;
        this.itemModifier = itemModifier;
        this.itemExtras = itemExtras;
        this.itemIsExtra = itemIsExtra;
        this.itemLocation = itemLocation;
    }
}


() => {
    it('transformArguments', () => {
        const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER_RO', 'key', 'member', '3', 'm', 'WITHDIST'];
        expectedReply.preserve = ['WITHDIST'];

        assert.deepEqual(
            transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
            expectedReply
        );
    });

    testUtils.testWithClient('client.geoRadiusByMemberRoWith', async client => {
        assert.deepEqual(
            await client.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
            []
        );
    }, GLOBAL.SERVERS.OPEN);

    testUtils.testWithCluster('cluster.geoRadiusByMemberRoWith', async cluster => {
        assert.deepEqual(
            await cluster.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
            []
        );
    }, GLOBAL.CLUSTERS.OPEN);
}


() => {
        const expectedReply: RedisCommandArguments = ['GEORADIUSBYMEMBER_RO', 'key', 'member', '3', 'm', 'WITHDIST'];
        expectedReply.preserve = ['WITHDIST'];

        assert.deepEqual(
            transformArguments('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
            expectedReply
        );
    }


async client => {
        assert.deepEqual(
            await client.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
            []
        );
    }


async cluster => {
        assert.deepEqual(
            await cluster.geoRadiusByMemberRoWith('key', 'member', 3 , 'm', [GeoReplyWith.DISTANCE]),
            []
        );
    }


(resolve, reject) => {
        const path = __dirname + "/test-output.csv";
        const fileStream = fs.createWriteStream(path, "utf8");
        const writeStream = (new csv.Writer()).stream([
            ["One", "Two", "Three"],
            ["Four", "Five", "Six"],
            ["Seven", "Eight", "Nine"],
        ]);
        writeStream.pipe(fileStream);
        writeStream.on("error", reject);
        fileStream.on("error", reject);
        fileStream.on("finish", () => {
            fileStream.end();
            const data = fs.readFileSync(path, "utf8");
            assert.equal(data, (
                "One,Two,Three\r\n" +
                "Four,Five,Six\r\n" +
                "Seven,Eight,Nine\r\n"
            ));
            resolve();
        });
    }


() => {
            fileStream.end();
            const data = fs.readFileSync(path, "utf8");
            assert.equal(data, (
                "One,Two,Three\r\n" +
                "Four,Five,Six\r\n" +
                "Seven,Eight,Nine\r\n"
            ));
            resolve();
        }


(resolve, reject) => {
        const path = __dirname + "/../../test/test.csv";
        const fileStream = fs.createReadStream(path, "utf8");
        fileStream.on("error", reject);
        fileStream.on("readable", () => {
            const rows = (new csv.Parser()).parse(fileStream).rows();
            assert.deepEqual(rows, [
                ["One", "Two", "Three"],
                ["Four", "Five", "Six"],
                ["Seven", "Eight", "Nine"],
            ]);
            resolve();
        });
    }


() => {
            const rows = (new csv.Parser()).parse(fileStream).rows();
            assert.deepEqual(rows, [
                ["One", "Two", "Three"],
                ["Four", "Five", "Six"],
                ["Seven", "Eight", "Nine"],
            ]);
            resolve();
        }


async (tokens, executeShellCommand) => {
    const out = await executeShellCommand("php please list --format=json");
    const subcommands = [];

    try {
      const commandDefinition = JSON.parse(out);

      commandDefinition.commands.map((command) => {
        subcommands.push({
          name: command.name,
          description: command.description,

          args: Object.values(command.definition.arguments).map(
            (argument: Argument) => {
              return {
                name: argument.name,
                description: argument.description,
                isOptional: !argument.is_required,
              };
            }
          ),
          options: Object.values(command.definition.options).map(
            (option: Option) => {
              const names = [option.name];

              if (option.shortcut !== "") {
                names.push(option.shortcut);
              }

              return {
                name: names,
                description: option.description,
              };
            }
          ),
        });
      });
    } catch (err) {
      console.error(err);
    }

    return {
      name: "please",
      debounce: true,
      subcommands,
    };
  }


(command) => {
        subcommands.push({
          name: command.name,
          description: command.description,

          args: Object.values(command.definition.arguments).map(
            (argument: Argument) => {
              return {
                name: argument.name,
                description: argument.description,
                isOptional: !argument.is_required,
              };
            }
          ),
          options: Object.values(command.definition.options).map(
            (option: Option) => {
              const names = [option.name];

              if (option.shortcut !== "") {
                names.push(option.shortcut);
              }

              return {
                name: names,
                description: option.description,
              };
            }
          ),
        });
      }


(argument: Argument) => {
              return {
                name: argument.name,
                description: argument.description,
                isOptional: !argument.is_required,
              };
            }


(option: Option) => {
              const names = [option.name];

              if (option.shortcut !== "") {
                names.push(option.shortcut);
              }

              return {
                name: names,
                description: option.description,
              };
            }


interface Argument {
  name: string;
  is_required: boolean;
  is_array: boolean;
  description: string;
  default: string;
}


interface Option {
  name: string;
  shortcut: string;
  accept_value: boolean;
  is_value_required: boolean;
  is_multiple: false;
  description: string;
  default: string;
}


declare function expect(val: any): ExpectWithIs;


() => {
    var s = Set([1,2,3]);
    expect(s.has(1)).toBe(true);
    expect(s.has(2)).toBe(true);
    expect(s.has(3)).toBe(true);
    expect(s.has(4)).toBe(false);
  }


() => {
    var s = Set({ 'length': 3, '1': 2 });
    expect(s.size).toBe(2)
    expect(s.has(undefined)).toBe(true);
    expect(s.has(2)).toBe(true);
    expect(s.has(1)).toBe(false);
  }


() => {
    var s = Set('abc');
    expect(s.size).toBe(3)
    expect(s.has('a')).toBe(true);
    expect(s.has('b')).toBe(true);
    expect(s.has('c')).toBe(true);
    expect(s.has('abc')).toBe(false);
  }


() => {
    var seq = Immutable.Seq.of(1,2,3);
    var s = Set(seq);
    expect(s.has(1)).toBe(true);
    expect(s.has(2)).toBe(true);
    expect(s.has(3)).toBe(true);
    expect(s.has(4)).toBe(false);
  }


() => {
    var seq = Immutable.Seq({a:null, b:null, c:null}).flip();
    var s = Set(seq);
    expect(s.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]);
    // Explicitly getting the values sequence
    var s2 = Set(seq.valueSeq());
    expect(s2.toArray()).toEqual(['a','b','c']);
    // toSet() does this for you.
    var v3 = seq.toSet();
    expect(v3.toArray()).toEqual(['a', 'b', 'c']);
  }


() => {
    var s = Set.fromKeys({a:null, b:null, c:null});
    expect(s.has('a')).toBe(true);
    expect(s.has('b')).toBe(true);
    expect(s.has('c')).toBe(true);
    expect(s.has('d')).toBe(false);
  }


() => {
    var seq = Immutable.Seq({a:null, b:null, c:null});
    var s = Set.fromKeys(seq);
    expect(s.has('a')).toBe(true);
    expect(s.has('b')).toBe(true);
    expect(s.has('c')).toBe(true);
    expect(s.has('d')).toBe(false);
  }


() => {
    var s = Set.of(1,2,3);
    expect(s.has(1)).toBe(true);
    expect(s.has(2)).toBe(true);
    expect(s.has(3)).toBe(true);
    expect(s.has(4)).toBe(false);
  }


() => {
    var s = Set.of(1,2,3);
    expect(s.toArray()).toEqual([1,2,3]);
  }


() => {
    var s = Set.of('a','b','c');
    expect(s.toObject()).toEqual({a:'a',b:'b',c:'c'});
  }


() => {
    var s = Set.of(1,2,3);
    var iterator = jest.genMockFunction();
    s.forEach(iterator);
    expect(iterator.mock.calls).toEqual([
      [1, 1, s],
      [2, 2, s],
      [3, 3, s]
    ]);
  }


() => {
    var s1 = Set.of('a', 'b', 'c');
    var s2 = Set.of('d', 'b', 'wow');
    var s3 = s1.union(s2);
    expect(s3.toArray()).toEqual(['a', 'b', 'c', 'd', 'wow']);
  }


() => {
    var s1 = Set.of('a', 'b', 'c');
    var s2 = Set.of('c', 'a');
    var s3 = s1.union(s2);
    expect(s3).toBe(s1);
  }


() => {
    var s1 = Set();
    var s2 = Set.of('a', 'b', 'c');
    var s3 = s1.union(s2);
    expect(s3).toBe(s2);
  }


() => {
    var s1 = Set([1,2,3]);
    var emptySet = Set();
    var l = Immutable.List([1,2,3]);
    var s2 = s1.union(l);
    var s3 = emptySet.union(l);
    var o = Immutable.OrderedSet([1,2,3]);
    var s4 = s1.union(o);
    var s5 = emptySet.union(o);
    expect(Set.isSet(s2)).toBe(true);
    expect(Set.isSet(s3)).toBe(true);
    expect(Set.isSet(s4) && !Immutable.OrderedSet.isOrderedSet(s4)).toBe(true);
    expect(Set.isSet(s5) && !Immutable.OrderedSet.isOrderedSet(s5)).toBe(true);
  }


() => {
    var s1 = Set();
    var s2 = s1.add('a');
    var s3 = s2.add('b');
    var s4 = s3.add('c');
    var s5 = s4.add('b');
    expect(s1.size).toBe(0);
    expect(s2.size).toBe(1);
    expect(s3.size).toBe(2);
    expect(s4.size).toBe(3);
    expect(s5.size).toBe(3);
  }


() => {
    var s1 = Set();
    var s2 = s1.add('a');
    var s3 = s2.add('b');
    var s4 = s3.add('c');
    var s5 = s4.remove('b');
    expect(s1.size).toBe(0);
    expect(s2.size).toBe(1);
    expect(s3.size).toBe(2);
    expect(s4.size).toBe(3);
    expect(s5.size).toBe(2);
    expect(s3.has('b')).toBe(true);
    expect(s5.has('b')).toBe(false);
  }


() => {
    var s = Set.of('A').remove('A');
    expect(s).toBe(Set());
  }


() => {
    var s = Set.of('A', 'B', 'C').union(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F'));
    expect(s).is(Set.of('A','B','C','D','E','F'));
  }


() => {
    var s = Set.of('A', 'B', 'C').intersect(Set.of('B', 'C', 'D'), Set.of('A', 'C', 'E'));
    expect(s).is(Set.of('C'));
  }


() => {
    var s = Set.of('A', 'B', 'C').subtract(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F'));
    expect(s).is(Set.of('A'));
  }


() => {
    var s1 = Set.of('A', 'B', 'C');
    expect(s1.equals(null)).toBe(false);

    var s2 = Set.of('C', 'B', 'A');
    expect(s1 === s2).toBe(false);
    expect(Immutable.is(s1, s2)).toBe(true);
    expect(s1.equals(s2)).toBe(true);

    // Map and Set are not the same (keyed vs unkeyed)
    var v1 = Immutable.Map({ A: 'A', C: 'C', B: 'B' });
    expect(Immutable.is(s1, v1)).toBe(false);
  }


() => {
    var js = Immutable.Set().withMutations(set => {
      set.union([ 'a' ]);
      set.add('b');
    }).toJS();
    expect(js).toEqual(['a', 'b']);
  }


set => {
      set.union([ 'a' ]);
      set.add('b');
    }


() => {
    var s = Set.of('A', 'B', 'C');
    expect(s.isSuperset(['B', 'C'])).toBe(true);
    expect(s.isSuperset(['B', 'C', 'D'])).toBe(false);
  }


interface ExpectWithIs extends Expect {
  is(expected: any): void;
  not: ExpectWithIs;
}


(manager: StatusBarItemsManager): readonly CommonStatusBarItem[] => {
  const uiItemProviderIds = useAvailableUiItemsProviders();
  const stageId = useActiveStageId();
  const [items, setItems] = React.useState(manager.items);
  const providersRef = React.useRef("");
  const currentStageRef = React.useRef("");
  // gathers items from registered extensions - dependent on when a UiItemsProvider is register or unregistered and if the
  // current stage's composer allows entries from extensions.
  React.useEffect(() => {
    const uiProviders = uiItemProviderIds.join("-");
    // istanbul ignore else
    if (providersRef.current !== uiProviders || currentStageRef.current !== stageId) {
      currentStageRef.current = stageId;
      providersRef.current = uiProviders;
      const statusBarItems = UiItemsManager.getStatusBarItems(stageId, StageUsage.General);
      const updatedStatusBarItems = UiItemsArbiter.updateStatusBarItems(statusBarItems);
      manager.loadItems(updatedStatusBarItems);
      setItems(manager.items);
    }

  }, [manager, uiItemProviderIds, stageId]);
  // handle item changes caused by calls to UiFramework.addonStatusBarItemsManager.setxxx
  React.useEffect(() => {
    const handleChanged = (args: StatusBarItemsChangedArgs) => {
      setItems(args.items);
    };
    manager.onItemsChanged.addListener(handleChanged);
    return () => {
      manager.onItemsChanged.removeListener(handleChanged);
    };
  }, [manager]);
  return items;
}


() => {
    const uiProviders = uiItemProviderIds.join("-");
    // istanbul ignore else
    if (providersRef.current !== uiProviders || currentStageRef.current !== stageId) {
      currentStageRef.current = stageId;
      providersRef.current = uiProviders;
      const statusBarItems = UiItemsManager.getStatusBarItems(stageId, StageUsage.General);
      const updatedStatusBarItems = UiItemsArbiter.updateStatusBarItems(statusBarItems);
      manager.loadItems(updatedStatusBarItems);
      setItems(manager.items);
    }

  }


() => {
    const handleChanged = (args: StatusBarItemsChangedArgs) => {
      setItems(args.items);
    };
    manager.onItemsChanged.addListener(handleChanged);
    return () => {
      manager.onItemsChanged.removeListener(handleChanged);
    };
  }


(args: StatusBarItemsChangedArgs) => {
      setItems(args.items);
    }


() => {
      manager.onItemsChanged.removeListener(handleChanged);
    }


export abstract class CTRGladman extends BlockCipherMode {
  public static Encryptor = CTRGladmanEncryptor;

  public static Decryptor = CTRGladmanEncryptor;
}


export interface IListConfig extends IDragConfig {
    template?: (obj: IDataItem) => string;
    data?: DataCollection<any> | any[];
    virtual?: boolean;
    itemHeight?: number | string;
    css?: string;
    height?: number | string;
    selection?: boolean;
    multiselection?: boolean | MultiselectionMode;
    keyNavigation?: boolean | (() => boolean);
    editable?: boolean;
    hotkeys?: IHandlers;
    eventHandlers?: {
        [key: string]: any;
    };
    /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
    editing?: boolean;
    /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
    multiselectionMode?: MultiselectionMode;
}


export interface IListEventHandlersMap {
    [key: string]: (...args: any[]) => any;
    [ListEvents.click]: (id: string, e: Event) => any;
    [ListEvents.itemMouseOver]: (id: string, e: Event) => any;
    [ListEvents.doubleClick]: (id: string, e: Event) => any;
    [ListEvents.itemRightClick]: (id: string, e: MouseEvent) => any;
    [ListEvents.focusChange]: (focusIndex: number, id: string) => any;
    [ListEvents.beforeEditStart]: (id: string) => void | boolean;
    [ListEvents.afterEditStart]: (id: string) => void;
    [ListEvents.beforeEditEnd]: (value: any, id: string) => void | boolean;
    [ListEvents.afterEditEnd]: (value: any, id: string) => void;
    [ListEvents.contextmenu]: (id: string, e: MouseEvent) => any;
}


export interface ISelectionConfig {
    multiselection?: boolean | MultiselectionMode;
    disabled?: boolean;
}


export interface IList<T = any> {
    config: IListConfig;
    data: DataCollection<T>;
    events: IEventSystem<DataEvents | ListEvents | DragEvents, IListEventHandlersMap & IDataEventsHandlersMap & IDragEventsHandlersMap>;
    selection: ISelection;
    paint(): void;
    destructor(): void;
    editItem(id: string): void;
    getFocusItem(): T;
    setFocus(id: string): void;
    getFocus(): string;
    showItem(id: string): void;
    /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
    disableSelection(): void;
    /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
    enableSelection(): void;
}


export interface ISelection<T = any> {
    config: ISelectionConfig;
    events: IEventSystem<SelectionEvents | DataEvents, ISelectionEventsHandlersMap & IDataEventsHandlersMap>;
    getId(): string | string[] | undefined;
    getItem(): T;
    contains(id?: string): boolean;
    remove(id?: string): void;
    add(id?: string, isShift?: boolean, isCtrl?: boolean, silent?: boolean): void;
    enable(): void;
    disable(): void;
    destructor(): void;
}


export interface IListItem {
    [key: string]: any;
}


export declare enum ListEvents {
    click = "click",
    doubleClick = "doubleclick",
    focusChange = "focuschange",
    beforeEditStart = "beforeEditStart",
    afterEditStart = "afterEditStart",
    beforeEditEnd = "beforeEditEnd",
    afterEditEnd = "afterEditEnd",
    itemRightClick = "itemRightClick",
    itemMouseOver = "itemMouseOver",
    /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
    contextmenu = "contextmenu"
}


export declare type MultiselectionMode = "click" | "ctrlClick";


/** Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity. */
export class SubscriptionItemRequestBuilder {
    /** Path parameters for the request */
    private readonly pathParameters: Record<string, unknown>;
    /** The request adapter to use to execute the requests. */
    private readonly requestAdapter: RequestAdapter;
    /** Url template to use to build the URL for the current request builder */
    private readonly urlTemplate: string;
    /**
     * Instantiates a new SubscriptionItemRequestBuilder and sets the default values.
     * @param pathParameters The raw url or the Url template parameters for the request.
     * @param requestAdapter The request adapter to use to execute the requests.
     */
    public constructor(pathParameters: Record<string, unknown> | string | undefined, requestAdapter: RequestAdapter) {
        if(!pathParameters) throw new Error("pathParameters cannot be undefined");
        if(!requestAdapter) throw new Error("requestAdapter cannot be undefined");
        this.urlTemplate = "{+baseurl}/drives/{drive%2Did}/items/{driveItem%2Did}/subscriptions/{subscription%2Did}{?%24select,%24expand}";
        const urlTplParams = getPathParameters(pathParameters);
        this.pathParameters = urlTplParams;
        this.requestAdapter = requestAdapter;
    };
    /**
     * Delete navigation property subscriptions for drives
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
    public createDeleteRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined) : RequestInformation {
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.DELETE;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        return requestInfo;
    };
    /**
     * The set of subscriptions on the item. Only supported on the root of a drive.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
    public createGetRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined) : RequestInformation {
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.GET;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.setQueryStringParametersFromRawObject(requestConfiguration.queryParameters);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        return requestInfo;
    };
    /**
     * Update the navigation property subscriptions in drives
     * @param body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
    public createPatchRequestInformation(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined) : RequestInformation {
        if(!body) throw new Error("body cannot be undefined");
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.PATCH;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body);
        return requestInfo;
    };
    /**
     * Delete navigation property subscriptions for drives
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     */
    public delete(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
        const requestInfo = this.createDeleteRequestInformation(
            requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    };
    /**
     * The set of subscriptions on the item. Only supported on the root of a drive.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     * @returns a Promise of Subscription
     */
    public get(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<Subscription | undefined> {
        const requestInfo = this.createGetRequestInformation(
            requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendAsync<Subscription>(requestInfo, createSubscriptionFromDiscriminatorValue, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    };
    /**
     * Update the navigation property subscriptions in drives
     * @param body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     */
    public patch(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
        if(!body) throw new Error("body cannot be undefined");
        const requestInfo = this.createPatchRequestInformation(
            body, requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    };
}


/**
     * Delete navigation property subscriptions for drives
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
public createDeleteRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined) : RequestInformation {
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.DELETE;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        return requestInfo;
    }


/**
     * The set of subscriptions on the item. Only supported on the root of a drive.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
public createGetRequestInformation(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined) : RequestInformation {
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.GET;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.setQueryStringParametersFromRawObject(requestConfiguration.queryParameters);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        return requestInfo;
    }


/**
     * Update the navigation property subscriptions in drives
     * @param body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
public createPatchRequestInformation(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined) : RequestInformation {
        if(!body) throw new Error("body cannot be undefined");
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.PATCH;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body);
        return requestInfo;
    }


/**
     * Delete navigation property subscriptions for drives
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     */
public delete(requestConfiguration?: SubscriptionItemRequestBuilderDeleteRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
        const requestInfo = this.createDeleteRequestInformation(
            requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    }


/**
     * The set of subscriptions on the item. Only supported on the root of a drive.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     * @returns a Promise of Subscription
     */
public get(requestConfiguration?: SubscriptionItemRequestBuilderGetRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<Subscription | undefined> {
        const requestInfo = this.createGetRequestInformation(
            requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendAsync<Subscription>(requestInfo, createSubscriptionFromDiscriminatorValue, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    }


/**
     * Update the navigation property subscriptions in drives
     * @param body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     */
public patch(body: Subscription | undefined, requestConfiguration?: SubscriptionItemRequestBuilderPatchRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<void> {
        if(!body) throw new Error("body cannot be undefined");
        const requestInfo = this.createPatchRequestInformation(
            body, requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendNoResponseContentAsync(requestInfo, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    }


/**
 * connects to the nest.land api and returns a url for package installation.
 * @param {string} pkgName - package name.
 * @param {string} version - specific version of the package.
 * @return {string} package url.
 */
export async function nestPackageUrl(
  pkgName: string,
  version: string
): Promise<string> {

  if (STD.includes(pkgName)) {
    return needProxy(pkgName)
      ? Proxy(pkgName)
      : `https://x.nest.land/std@${version}/${pkgName}/mod.ts`;
  }

  else {
    const response = (await fetch(
      `https://x.nest.land/api/package/${pkgName}/${version}`,
      {
        method: "GET",
        headers: {
          Accept: "*/*",
          "Accept-Encoding": "gzip, deflate, br",
          Connection: "keep-alive",
        },
      }
    ).catch((_) => offLine())) as Response;

    const data: NestResponse = await response.json();

    return data.prefix + data.entry;
  }
}


/**
 * download all dependencies and install packages from nest.land.
 * @param {string} url - the url of the package to install.
 * @return {void} void
 */
export async function cacheNestpackage(url: string): Promise<void> {
  const process = Deno.run({
    cmd: ["deno", "install", "-f", "-n", "trex_Cache_Map", "--unstable", url],
  });

  if (!(await process.status()).success) {
    process.close();
    ErrorInstalling();
  }

  process.close();
}


/**
 * generates the url for packages that are installed from a repository.
 * @param {string} repoInfo - repository information { user/repo/path_file }
 * @param {string} pkgName - the name of the package to be saved in the import map file, by default use repository name.
 * @return {string} url package.
 */
export function pkgRepo(repoInfo: string, pkgName?: string): string[] {
  const [user, repo, ...path] = repoInfo.split("/");

  return [
    pkgName ? pkgName : repo,
    `https://denopkg.com/${user}/${repo}/${path.join("/")}${
      path.length ? "" : "mod.ts"
    }`,
  ];
}


(_) => offLine()


async (_parent, _args, ctx) => ctx.user !== null


async (_parent, { where }, { prisma, user }) => {
    // get the user based on the resource in question
    const { userId: resourceOwnerId } = await prisma.bio.findOne({
      where,
      select: { userId: true },
    });

    // is the user the same as the one provided by context?
    return resourceOwnerId === user.id;
  }


// where.id is guarenteed to exist on updateOneBio
async (_parent, { where }, { prisma, user }) => {
    // get the resource owner
    // is nested destructuring with an alias hard to read?
    const {
      profile: { userId: resourceOwnerId },
    } = await prisma.job.findOne({
      where,
      select: {
        profile: { select: { userId: true } },
      },
    });
    return resourceOwnerId === user.id;
  }


() => {
  test('request user', () => {
    const action = actions.user.request({
      name: 'rssviana',
    });
    const state = reducer(INITIAL_STATE, action);

    expect({ ...state, updatedOn: 0 }).toStrictEqual(
      {
        ...INITIAL_STATE,
        loading: true,
        success: false,
        error: false,
        messages: [],
      }
    )
  })

  test('success user response', () => {
    const fakeRESP = userRESP
    // @ts-ignore

    const action = actions.user.success(fakeRESP)
    const state = reducer(INITIAL_STATE, action);

    expect({ ...state, updatedOn: 0 }).toStrictEqual({
      ...INITIAL_STATE,
      data: [ fakeRESP ],
      loading: false,
      success: true,
      error: false,
      messages: [],
    });
  })

  test('failure user response', () => {
    const action = actions.user.failure(['error test']);
    const state = reducer(INITIAL_STATE, action);
    expect({ ...state, updatedOn: 0 }).toStrictEqual({
      ...INITIAL_STATE,
      loading: false,
      success: false,
      error: true,
      messages: ['error test'],
    });
  });
}


() => {
    const action = actions.user.request({
      name: 'rssviana',
    });
    const state = reducer(INITIAL_STATE, action);

    expect({ ...state, updatedOn: 0 }).toStrictEqual(
      {
        ...INITIAL_STATE,
        loading: true,
        success: false,
        error: false,
        messages: [],
      }
    )
  }


() => {
    const fakeRESP = userRESP
    // @ts-ignore

    const action = actions.user.success(fakeRESP)
    const state = reducer(INITIAL_STATE, action);

    expect({ ...state, updatedOn: 0 }).toStrictEqual({
      ...INITIAL_STATE,
      data: [ fakeRESP ],
      loading: false,
      success: true,
      error: false,
      messages: [],
    });
  }


() => {
    const action = actions.user.failure(['error test']);
    const state = reducer(INITIAL_STATE, action);
    expect({ ...state, updatedOn: 0 }).toStrictEqual({
      ...INITIAL_STATE,
      loading: false,
      success: false,
      error: true,
      messages: ['error test'],
    });
  }


() => {
  it("should be empty object if no params given", () => {
    const params: AttributeListUrlFilters = {};
    const filterVariables = getFilterVariables(params);

    expect(getExistingKeys(filterVariables)).toHaveLength(0);
  });

  it("should not be empty object if params given", () => {
    const params: AttributeListUrlFilters = {
      isVariantOnly: true.toString(),
    };
    const filterVariables = getFilterVariables(params);

    expect(getExistingKeys(filterVariables)).toHaveLength(1);
  });
}


() => {
    const params: AttributeListUrlFilters = {};
    const filterVariables = getFilterVariables(params);

    expect(getExistingKeys(filterVariables)).toHaveLength(0);
  }


() => {
    const params: AttributeListUrlFilters = {
      isVariantOnly: true.toString(),
    };
    const filterVariables = getFilterVariables(params);

    expect(getExistingKeys(filterVariables)).toHaveLength(1);
  }


() => {
  const intl = createIntl(config);

  const filters = createFilterStructure(intl, {
    filterableInStorefront: {
      active: false,
      value: true,
    },
    isVariantOnly: {
      active: false,
      value: true,
    },
    valueRequired: {
      active: false,
      value: true,
    },
    visibleInStorefront: {
      active: false,
      value: true,
    },
  });

  it("should be empty if no active filters", () => {
    const filterQueryParams = getFilterQueryParams(
      filters,
      getFilterQueryParam,
    );

    expect(getExistingKeys(filterQueryParams)).toHaveLength(0);
  });

  it("should not be empty if active filters are present", () => {
    const filterQueryParams = getFilterQueryParams(
      setFilterOptsStatus(filters, true),
      getFilterQueryParam,
    );

    expect(filterQueryParams).toMatchSnapshot();
    expect(stringifyQs(filterQueryParams)).toMatchSnapshot();
  });
}


() => {
    const filterQueryParams = getFilterQueryParams(
      filters,
      getFilterQueryParam,
    );

    expect(getExistingKeys(filterQueryParams)).toHaveLength(0);
  }


() => {
    const filterQueryParams = getFilterQueryParams(
      setFilterOptsStatus(filters, true),
      getFilterQueryParam,
    );

    expect(filterQueryParams).toMatchSnapshot();
    expect(stringifyQs(filterQueryParams)).toMatchSnapshot();
  }


({
  value,
  min,
  max,
  onChange,
  step,
  markers,
  formatValue,
}) => {
  const { getRailProps, getTrackProps, getHandleProps, getMarkerProps } = useSlider({
    value,
    min,
    max,
    onChange,
    step,
    formatValue,
  })

  return (
    <SliderContainer>
      <SliderRail {...getRailProps()} />
      <SliderTrack {...getTrackProps()} />

      {markers?.map((marker)


export interface ISliderProps {
  value: number
  min: number
  max: number
  onChange: (value: number) => void

  step?: number
  markers?: IRangeMarker[]
  formatValue?: (value: number) => string
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, id()))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = testContentsEmpty;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = testContentsEmpty;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, id()))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = testContentsWithEntries;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = testContentsWithEntries;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntry)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndEmptySingle;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndEmptySingle;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntryWithComma)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndEmptySingle;
            t.is(result, expected);
        });
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntries)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndEmptyMulti;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndEmptyMulti;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntriesWithCommas)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndEmptyMulti;
            t.is(result, expected);
        });
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntry)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndWithEntriesSingle;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndWithEntriesSingle;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntryWithComma)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndWithEntriesSingle;
            t.is(result, expected);
        });
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntries)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndWithEntriesMulti;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndWithEntriesMulti;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtEnd(insertedEntriesWithCommas)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtEndWithEntriesMulti;
            t.is(result, expected);
        });
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntry)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartEmptySingle;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartEmptySingle;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntryWithComma)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartEmptySingle;
            t.is(result, expected);
        });
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntries)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartEmptyMulti;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartEmptyMulti;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsEmpty, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntriesWithCommas)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartEmptyMulti;
            t.is(result, expected);
        });
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntry)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartWithEntriesSingle;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartWithEntriesSingle;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntryWithComma)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartWithEntriesSingle;
            t.is(result, expected);
        });
}


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntries)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartWithEntriesMulti;
            t.is(result, expected);
        });
}


(tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartWithEntriesMulti;
            t.is(result, expected);
        }


(t) => {
    t.plan(1);

    // Write test file
    const targetFile = fileSync();
    writeFileSync(targetFile.name, testContentsWithEntries, 'utf8');

    transform(targetFile.name, targetFile.name, blocks(startPattern, endPattern, insertAtStart(insertedEntriesWithCommas)))
        .then((tfn: string) => {
            const result = readFileSync(tfn, 'utf8');
            const expected = resultInsertAtStartWithEntriesMulti;
            t.is(result, expected);
        });
}


() => {
    this.setState({
      visible: !this.state.visible,
    })
  }


export default class Collapse extends PureComponent<ICollapseProps, ICollapseState> {
  constructor(props: ICollapseProps) {
    super(props)

    this.state = {
      visible: props.initialVisible || false,
    }
  }

  handleClick = () => {
    this.setState({
      visible: !this.state.visible,
    })
  }

  render() {
    return (
      <div className={classnames('collapse', {
        '-hide': !this.state.visible,
      })}


interface ICollapseProps {
  title: string
  initialVisible?: boolean
}


interface ICollapseState {
  visible: boolean
}


render() {
    return (
      <div className={classnames('collapse', {
        '-hide': !this.state.visible,
      })}


classnames('collapse', {
        '-hide': !this


/**
 * @private
 * @class         module:azure-iot-device.BlobUploadResult
 * @classdesc     Result object used by the {@link module:azure-iot-device.blobUpload.BlobUploader} class to describe a successful upload to a blob.
 *
 * @params        isSuccess          {Boolean} Indicates whether the upload was successful or failed
 * @params        statusCode         {Number}  Status code returned by the blob storage upload operation
 * @params        statusDescription  {String}  String containing useful information pertaining to the result of the blob upload.
 *
 * @augments      {Error}
 */
export declare class BlobUploadResult {
    isSuccess: boolean;
    statusCode: number;
    statusDescription: string;
    constructor(isSuccess: boolean, statusCode: number, statusDescription: string);
    /**
     * @method           module:azure-iot-device.BlobUploadResult#fromAzureStorageCallbackArgs
     * @description      The `fromAzureStorageCallbackArgs` static method creates a new BlobUploadResult instance from the arguments passed to the callback of the azure storage upload method.
     *
     * @param {Object}   err         The error object that is passed to the callback.
     * @param {Object}   body        The body of the HTTP response.
     * @param {Object}   response    The HTTP response object.
     *
     * @throws {ReferenceException} If err is null and either body or response are also falsy.
     */
    static fromAzureStorageCallbackArgs(err?: Error, body?: any, response?: BlobResponse): BlobUploadResult;
}


/**
     * @method           module:azure-iot-device.BlobUploadResult#fromAzureStorageCallbackArgs
     * @description      The `fromAzureStorageCallbackArgs` static method creates a new BlobUploadResult instance from the arguments passed to the callback of the azure storage upload method.
     *
     * @param {Object}   err         The error object that is passed to the callback.
     * @param {Object}   body        The body of the HTTP response.
     * @param {Object}   response    The HTTP response object.
     *
     * @throws {ReferenceException} If err is null and either body or response are also falsy.
     */
static fromAzureStorageCallbackArgs(err?: Error, body?: any, response?: BlobResponse): BlobUploadResult;


@Component({
  selector: 'app-event',
  templateUrl: './event.component.html',
  styleUrls: ['./event.component.css']
})
export class EventComponent implements OnInit {
  @Input('event') event: any;
  constructor(private router:Router,public eventService:EventService) { }

  ngOnInit() {
  }
  more() {
    //this.eventService.serviceData = this.event;
    this.router.navigate(['event',"{{event.id}}"]);
  }

}


ngOnInit() {
  }


more() {
    //this.eventService.serviceData = this.event;
    this.router.navigate(['event',"{{event.id}}"]);
  }


@Component({templateUrl: 'home.component.html'})
export class HomeComponent implements OnInit {
    currentUser: User;
    users: User[] = [];

    constructor(private userService: UserService) {
        this.currentUser = JSON.parse(localStorage.getItem('currentUser'));
    }

    ngOnInit() {

    }

}


ngOnInit() {

    }


(): string => {
    return uniqueNamesGenerator({dictionaries: [adjectives, animals]})
}


() => this.QueueText(
                "* Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter    Deich."
                )