private decodeString(dataView: DataView, encoding: BufferStringEncoding): [string, number] {
    let currentOffset = this.#offset;
    let result = '';

    const contentLength = dataView.getUint8(currentOffset++);

    if (encoding === 'utf16') {
      const utf16 = new ArrayBuffer(contentLength * 2);
      const utf16view = new Uint16Array(utf16);

      for (let i = 0; i < contentLength; i++ , currentOffset += 2) {
        utf16view[i] = dataView.getUint8(currentOffset);
      }

      result = String.fromCharCode.apply(null, Array.from(utf16view));
    }

    if (encoding === 'utf8') {
      const utf8 = new ArrayBuffer(contentLength);
      const utf8view = new Uint8Array(utf8);

      for (let i = 0; i < contentLength; i++ , currentOffset += 1) {
        utf8view[i] = dataView.getUint8(currentOffset);
      }

      result = String.fromCharCode.apply(null, Array.from(utf8view));
    }

    return [result, currentOffset - this.#offset];
  }


private encodeString(dataView: DataView, job: BufferJob): number {
    const value = job.value as string;
    const valueLength = value.length;

    let currentOffset = this.#offset;

    dataView.setUint8(currentOffset++, valueLength);

    switch (job.encoding) {
      case 'utf16':
        for (let i = 0; i < (job.length - 1) / 2; i++, currentOffset += 2) {
          dataView.setUint16(currentOffset, value.charCodeAt(i), true);
        }
        break;
      case 'utf8':
        for (let i = 0; i < (job.length - 1); i++, currentOffset++) {
          dataView.setUint8(currentOffset, value.charCodeAt(i));
        }
        break;
      default:
        throw new Error(`Undefined encoding provided '${this.#encoding}'`)
    }

    return currentOffset - this.#offset;
  }


private encodeValue(dataView: DataView, fn: (...args: any[]) => void, job: BufferJob): number {
    fn.call(dataView, this.#offset, job.value as number, job.littleEndian);

    return job.length;
  }


({ onClickOutside }) => {
  const ref = useRef(null);

  useOnClickOutside({ ref, handler: onClickOutside });

  return (
    <>
      <div ref={ref} data-testid="div-test-id">
        test-div
      </div>
      <button type="button" data-testid="button-test-id">
        test-button
      </button>
    </>


() => {
  document.addEventListener = defaultEventListener;
}


() => {
  handleClickOutside.mockReset();
}


() => {
  test('коллбек не вызывается, если кликнули на элемент, который обернут в хук', () => {
    const eventsMap: Record<string, EventListener> = {};

    document.addEventListener = jest.fn((event, cb: EventListener) => {
      eventsMap[event] = cb;
    });
    render(<HookedComponent onClickOutside={handleClickOutside} />);

    const div = screen.getByTestId('div-test-id');

    const event: MouseEvent = new MouseEvent('mousedown');

    eventsMap.mousedown({ ...event, target: div });

    expect(handleClickOutside).not.toBeCalled();
  });

  test('коллбек вызывается, если кликнули вне обернутого элемента', () => {
    const eventsMap: Record<string, EventListener> = {};

    document.addEventListener = jest.fn((event, cb: EventListener) => {
      eventsMap[event] = cb;
    });

    render(<HookedComponent onClickOutside={handleClickOutside} />);

    const button = screen.getByTestId('button-test-id');

    const event: MouseEvent = new MouseEvent('mousedown');

    eventsMap.mousedown({ ...event, target: button });

    expect(handleClickOutside).toBeCalled();
  });
}


() => {
    const eventsMap: Record<string, EventListener> = {};

    document.addEventListener = jest.fn((event, cb: EventListener) => {
      eventsMap[event] = cb;
    });
    render(<HookedComponent onClickOutside={handleClickOutside} />);

    const div = screen.getByTestId('div-test-id');

    const event: MouseEvent = new MouseEvent('mousedown');

    eventsMap.mousedown({ ...event, target: div });

    expect(handleClickOutside).not.toBeCalled();
  }


(event, cb: EventListener) => {
      eventsMap[event] = cb;
    }


() => {
    const eventsMap: Record<string, EventListener> = {};

    document.addEventListener = jest.fn((event, cb: EventListener) => {
      eventsMap[event] = cb;
    });

    render(<HookedComponent onClickOutside={handleClickOutside} />);

    const button = screen.getByTestId('button-test-id');

    const event: MouseEvent = new MouseEvent('mousedown');

    eventsMap.mousedown({ ...event, target: button });

    expect(handleClickOutside).toBeCalled();
  }


type Props = {
  onClickOutside: (e: MouseEvent | TouchEvent) => void;
};


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    ClientsPageRoutingModule,
    SharedModule
  ],
  declarations: [ClientsPage]
})
export class ClientsPageModule {}


(unix: string | number): string => {
  return dayjs.unix(Number(unix) / 1000 / 1000).toISOString()
}


(unix: string | number): boolean => {
  const digitLength = String(unix).length === 16
  const isNum = !Number.isNaN(Number(unix))
  return isNum && digitLength
}


(log: LogData) =>
  log &&
  log.timestamp &&
  log.metadata &&
  log.event_message &&
  log.id &&
  Object.keys(log).length === 4


(obj: { [k: string]: unknown }, parent?: string): string[] => {
  const keys = Object.keys(obj).filter((k) => obj[k])
  return keys.flatMap((k) => {
    const currKey = parent ? `${parent}.${k}` : k
    if (typeof obj[k] === 'object') {
      return getDotKeys(obj[k] as any, currKey)
    } else {
      return [currKey]
    }
  })
}


(k) => obj[k]


(k) => {
    const currKey = parent ? `${parent}.${k}` : k
    if (typeof obj[k] === 'object') {
      return getDotKeys(obj[k] as any, currKey)
    } else {
      return [currKey]
    }
  }


(table: LogsTableName, filters: Filters) => {
  const keys = Object.keys(filters)
  const filterTemplates = SQL_FILTER_TEMPLATES[table]
  const _resolveTemplateToStatement = (dotKey: string): string | null => {
    const template = filterTemplates[dotKey]
    const value = get(filters, dotKey)
    if (value !== undefined && typeof template === 'function') {
      return template(value)
    } else if (template === undefined) {
      // resolve unknwon filters (possibly from filter overrides)
      // no template, set a default
      if (typeof value === 'string') {
        return `${dotKey} = '${value}'`
      } else {
        return `${dotKey} = ${value}`
      }
    } else if (value === undefined && typeof template === 'function') {
      return null
    } else if (template && value === false) {
      // template present, but value is false
      return null
    } else {
      return template
    }
  }

  const statement = keys
    .map((rootKey) => {
      if (typeof filters[rootKey] === 'object') {
        // join all statements with an OR
        const nestedStatements = getDotKeys(filters[rootKey] as Filters, rootKey)
          .map(_resolveTemplateToStatement)
          .filter(Boolean)

        if (nestedStatements.length > 0) {
          return `(${nestedStatements.join(' or ')})`
        } else {
          return null
        }
      } else {
        const nestedStatement = _resolveTemplateToStatement(rootKey)
        if (nestedStatement === null) return null
        return `(${nestedStatement})`
      }
    })
    .filter(Boolean)
    // join all root statements with AND
    .join(' and ')

  if (statement) {
    return 'where ' + statement
  } else {
    return ''
  }
}


(dotKey: string): string | null => {
    const template = filterTemplates[dotKey]
    const value = get(filters, dotKey)
    if (value !== undefined && typeof template === 'function') {
      return template(value)
    } else if (template === undefined) {
      // resolve unknwon filters (possibly from filter overrides)
      // no template, set a default
      if (typeof value === 'string') {
        return `${dotKey} = '${value}'`
      } else {
        return `${dotKey} = ${value}`
      }
    } else if (value === undefined && typeof template === 'function') {
      return null
    } else if (template && value === false) {
      // template present, but value is false
      return null
    } else {
      return template
    }
  }


(rootKey) => {
      if (typeof filters[rootKey] === 'object') {
        // join all statements with an OR
        const nestedStatements = getDotKeys(filters[rootKey] as Filters, rootKey)
          .map(_resolveTemplateToStatement)
          .filter(Boolean)

        if (nestedStatements.length > 0) {
          return `(${nestedStatements.join(' or ')})`
        } else {
          return null
        }
      } else {
        const nestedStatement = _resolveTemplateToStatement(rootKey)
        if (nestedStatement === null) return null
        return `(${nestedStatement})`
      }
    }


(table: LogsTableName, filters: Filters) => {
  const where = _genWhereStatement(table, filters)

  switch (table) {
    case 'edge_logs':
      return `select id, timestamp, event_message, metadata, request, response, request.method, request.path, response.status_code
  from ${table}
  cross join unnest(metadata) as m
  cross join unnest(m.request) as request
  cross join unnest(m.response) as response
  ${where}
  limit 100
  `
      break

    case 'postgres_logs':
      return `select postgres_logs.timestamp, id, event_message, metadata, metadataparsed.error_severity from ${table}
  cross join unnest(metadata) as m
  cross join unnest(m.parsed) as metadataparsed
  ${where}
  limit 100
  `
      break

    case 'function_logs':
      return `select id, ${table}.timestamp, event_message, metadata.event_type, metadata.function_id, metadata.level, metadata from ${table}
  cross join unnest(metadata) as metadata
  ${where}
  limit 100
    `
      break

    case 'function_edge_logs':
      return `select id, ${table}.timestamp, event_message, response.status_code, response, request, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from ${table}
  cross join unnest(metadata) as m
  cross join unnest(m.response) as response
  cross join unnest(m.request) as request
  ${where}
  limit 100
  `

    default:
      return `select id, ${table}.timestamp, event_message, metadata from ${table}
  ${where}
  limit 100
  `
      break
  }
}


(resolve, reject) => {
      let id = route.paramMap.get('id');
      this.firebaseService.getRoutineDetails(id).then(routine => {
        routine.subscribe( data => {
          data.id = id;
          resolve(data);
        })
      })
    }


routine => {
        routine.subscribe( data => {
          data.id = id;
          resolve(data);
        })
      }


data => {
          data.id = id;
          resolve(data);
        }


(resolve, reject) => {
      let id = route.paramMap.get('id');
      this.firebaseService.getRoutineTasks(id).then(routine => {
        routine.subscribe( data => {
          resolve(data);
        })
      })
    }


routine => {
        routine.subscribe( data => {
          resolve(data);
        })
      }


data => {
          resolve(data);
        }


@Injectable()
export class ViewRoutineResolver implements Resolve<any> {

  constructor(public firebaseService: FirebaseService,) { }

  resolve(route: ActivatedRouteSnapshot) {

    return new Promise((resolve, reject) => {
      let id = route.paramMap.get('id');
      this.firebaseService.getRoutineDetails(id).then(routine => {
        routine.subscribe( data => {
          data.id = id;
          resolve(data);
        })
      })
    })
  }
}


@Injectable()
export class TasksResolver implements Resolve<any> {

  constructor(public firebaseService: FirebaseService,) { }

  resolve(route: ActivatedRouteSnapshot) {

    return new Promise((resolve, reject) => {
      let id = route.paramMap.get('id');
      this.firebaseService.getRoutineTasks(id).then(routine => {
        routine.subscribe( data => {
          resolve(data);
        })
      })
    })
  }
}


resolve(route: ActivatedRouteSnapshot) {

    return new Promise((resolve, reject) => {
      let id = route.paramMap.get('id');
      this.firebaseService.getRoutineDetails(id).then(routine => {
        routine.subscribe( data => {
          data.id = id;
          resolve(data);
        })
      })
    })
  }


resolve(route: ActivatedRouteSnapshot) {

    return new Promise((resolve, reject) => {
      let id = route.paramMap.get('id');
      this.firebaseService.getRoutineTasks(id).then(routine => {
        routine.subscribe( data => {
          resolve(data);
        })
      })
    })
  }


export function MultiSelect<T>(props: MultiSelectProps<T>) {
  const {
    ariaDescribedBy,
    components: customComponents,
    errorMessage,
    hasError,
    helperMessage,
    inputStyle,
    isLabelVisuallyHidden,
    innerRef,
    itemToString,
    items,
    labelPosition,
    labelStyle,
    labelText,
    disabled,
    isInverse,
    itemListMaxHeight,
    menuStyle,
    messageStyle,
    onBlur,
    onFocus,
    onKeyDown,
    onKeyPress,
    onKeyUp,
    onRemoveSelectedItem,
    placeholder,
  } = props;

  function checkSelectedItemValidity(itemToCheck: T) {
    return (
      items.findIndex(i => itemToString(i) === itemToString(itemToCheck)) !== -1
    );
  }

  const {
    getSelectedItemProps,
    getDropdownProps,
    addSelectedItem,
    removeSelectedItem,
    selectedItems,
    setActiveIndex,
  } = useMultipleSelection<T>({
    ...props,
    ...(props.initialSelectedItems && {
      initialSelectedItems: props.initialSelectedItems.filter(
        checkSelectedItemValidity
      ),
    }),
    ...(props.selectedItems && {
      selectedItems: props.selectedItems.filter(checkSelectedItemValidity),
    }),
  });

  function getFilteredItems(unfilteredItems) {
    return unfilteredItems.filter(
      item =>
        selectedItems.findIndex(
          selectedItem => itemToString(selectedItem) === itemToString(item)
        ) < 0
    );
  }

  const {
    stateReducer: passedInStateReducer,
    onStateChange,
    ...selectProps
  } = props;

  function stateReducer(state, actionAndChanges) {
    const { type, changes } = actionAndChanges;
    switch (type) {
      case useSelect.stateChangeTypes.ToggleButtonKeyDownCharacter:
        return {
          ...changes,
          selectedItem: state.selectedItem,
        };
      default:
        return changes;
    }
  }

  const {
    isOpen,
    getToggleButtonProps,
    getLabelProps,
    getMenuProps,
    highlightedIndex,
    getItemProps,
    selectItem,
    openMenu,
  } = useSelect({
    ...selectProps,
    items: getFilteredItems(items),
    onSelectedItemChange: defaultOnSelectedItemChange,
    stateReducer,
  });

  function defaultOnSelectedItemChange(changes) {
    const { selectedItem: newSelectedItem } = changes;

    if (newSelectedItem) {
      addSelectedItem(newSelectedItem);
      selectItem(null);
    }
  }

  function handleRemoveSelectedItem(event: React.SyntheticEvent, selectedItem) {
    event.stopPropagation();

    onRemoveSelectedItem && typeof onRemoveSelectedItem === 'function'
      ? onRemoveSelectedItem(selectedItem)
      : removeSelectedItem(selectedItem);
  }

  const theme = React.useContext(ThemeContext);
  const i18n = React.useContext(I18nContext);

  const toggleButtonProps = getToggleButtonProps({
    ...getDropdownProps({
      onBlur,
      onKeyDown: event => {
        if (
          document.activeElement.tagName.toLowerCase() === 'button' &&
          (event.key === 'Backspace' ||
            event.key === 'Delete' ||
            event.key === 'ArrowLeft')
        ) {
          event.nativeEvent.preventDownshiftDefault = true;
        }

        if (event.key === 'Enter' || event.key === ' ') {
          event.preventDefault();
          openMenu();
        }

        onKeyDown && typeof onKeyDown === 'function' && onKeyDown(event);
      },
      onKeyPress,
      onKeyUp,
      onFocus,
      preventKeyAction: isOpen,
      ...(innerRef && { ref: innerRef }),
    }),
    disabled: disabled,
  });

  return (
    <SelectContainer
      descriptionId={ariaDescribedBy}
      errorMessage={errorMessage}
      getLabelProps={getLabelProps}
      helperMessage={helperMessage}
      isLabelVisuallyHidden={isLabelVisuallyHidden}
      labelPosition={labelPosition}
      labelStyle={labelStyle}
      labelText={labelText}
      isInverse={isInverse}
      messageStyle={messageStyle}
    >
      <SelectTriggerButton
        ariaDescribedBy={ariaDescribedBy}
        toggleButtonProps={toggleButtonProps}
        hasError={hasError}
        disabled={disabled}
        isInverse={isInverse}
        style={inputStyle}
      >
        {selectedItems && selectedItems.length > 0
          ? selectedItems.map((multiSelectedItem, index) => {
              const multiSelectedItemString = itemToString(multiSelectedItem);
              return (
                <SelectedItemButton
                  aria-label={i18n.multiSelect.selectedItemButtonAriaLabel.replace(
                    /\{selectedItem\}/g,
                    multiSelectedItemString
                  )}
                  key={`selected-item-${index}`}
                  {...getSelectedItemProps({
                    selectedItem: multiSelectedItem,
                    index,
                  })}
                  onClick={event =>
                    handleRemoveSelectedItem(event, multiSelectedItem)
                  }
                  onFocus={() => setActiveIndex(index)}


function checkSelectedItemValidity(itemToCheck: T) {
    return (
      items.findIndex(i => itemToString(i) === itemToString(itemToCheck)) !== -1
    );
  }


function getFilteredItems(unfilteredItems) {
    return unfilteredItems.filter(
      item =>
        selectedItems.findIndex(
          selectedItem => itemToString(selectedItem) === itemToString(item)
        ) < 0
    );
  }


function stateReducer(state, actionAndChanges) {
    const { type, changes } = actionAndChanges;
    switch (type) {
      case useSelect.stateChangeTypes.ToggleButtonKeyDownCharacter:
        return {
          ...changes,
          selectedItem: state.selectedItem,
        };
      default:
        return changes;
    }
  }


function defaultOnSelectedItemChange(changes) {
    const { selectedItem: newSelectedItem } = changes;

    if (newSelectedItem) {
      addSelectedItem(newSelectedItem);
      selectItem(null);
    }
  }


function handleRemoveSelectedItem(event: React.SyntheticEvent, selectedItem) {
    event.stopPropagation();

    onRemoveSelectedItem && typeof onRemoveSelectedItem === 'function'
      ? onRemoveSelectedItem(selectedItem)
      : removeSelectedItem(selectedItem);
  }


i => itemToString(i) === itemToString(itemToCheck)


item =>
        selectedItems.findIndex(
          selectedItem => itemToString(selectedItem) === itemToString(item)
        ) < 0


selectedItem => itemToString(selectedItem) === itemToString(item)


event => {
        if (
          document.activeElement.tagName.toLowerCase() === 'button' &&
          (event.key === 'Backspace' ||
            event.key === 'Delete' ||
            event.key === 'ArrowLeft')
        ) {
          event.nativeEvent.preventDownshiftDefault = true;
        }

        if (event.key === 'Enter' || event.key === ' ') {
          event.preventDefault();
          openMenu();
        }

        onKeyDown && typeof onKeyDown === 'function' && onKeyDown(event);
      }


(multiSelectedItem, index) => {
              const multiSelectedItemString = itemToString(multiSelectedItem);
              return (
                <SelectedItemButton
                  aria-label={i18n.multiSelect.selectedItemButtonAriaLabel.replace(
                    /\{selectedItem\}/g,
                    multiSelectedItemString
                  )}
                  key={`selected-item-${index}`}


handleRemoveSelectedItem(event, multiSelectedItem)


getFilteredItems(items)


(format: StyleResourcesFileFormat): StyleResourcesLoaderOptions => ({
    patterns: `./${format}/resources.${format}`,
})


export interface Props {
  block?: boolean;
  children?: ReactNode;
  className?: string;
  disabled?: boolean;
  size?: 'large' | 'regular' | 'small' | 'x-small' | 'custom';
  theme?: 'default' | 'primary';
  variant?: 'contained' | 'outlined' | 'link' | 'text';
}


export interface ButtonAsButtonProps
  extends Props,
    React.ButtonHTMLAttributes<HTMLButtonElement> {
  /**
   * The element that should be rendered as a button
   */
  tag?: 'button';
  /**
   * The native HTML button type
   */
  type?: 'button' | 'submit' | 'reset';
}


export interface ButtonAsAnchorProps
  extends Props,
    React.AnchorHTMLAttributes<HTMLAnchorElement> {
  tag?: 'a';
}


export interface ButtonAsOtherProps
  extends Props,
    React.AnchorHTMLAttributes<HTMLAnchorElement> {
  tag?: string;
}


export type ButtonProps =
  | ButtonAsButtonProps
  | ButtonAsAnchorProps
  | ButtonAsOtherProps;


export type Ref = ReactNode | HTMLElement | string;


export default function Checkbox(props: RZNTProps.Form.Checkbox) {
  return (

        <input {...props} type="checkbox" className="form-checkbox-input"/>

          <svg className="fill-current text-white" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 17.837 17.837" >
            <g>
              <path id="checkmark" d="M16.145,2.571c-0.272-0.273-0.718-0.273-0.99,0L6.92,10.804l-4.241-4.27 c-0.272-0.274-0.715-0.274-0.989,0L0.204,8.019c-0.272,0.271-0.272,0.717,0,0.99l6.217,6.258c0.272,0.271,0.715,0.271,0.99,0
              L17.63,5.047c0.276-0.273,0.276-0.72,0-0.994L16.145,2.571z"/>
            </g>
          </svg>

      {props.label}

  );
}


conclass('form-choicebox', props


conclass('form-checkbox-icon', props


conclass('form-checkbox-label', props


export type DownloadIconTypes = IconType;


(c) => onEnd((contents) => contents.push({
        type: 'rect',
        x: (c[0].x + c[1].x) / 2,
        y: (c[0].y + c[1].y) / 2,
        width: Math.abs(c[0].x - c[1].x),
        height: Math.abs(c[0].y - c[1].y),
        angle: 0,
      } as RectContent))


(contents) => contents.push({
        type: 'rect',
        x: (c[0].x + c[1].x) / 2,
        y: (c[0].y + c[1].y) / 2,
        width: Math.abs(c[0].x - c[1].x),
        height: Math.abs(c[0].y - c[1].y),
        angle: 0,
      } as RectContent)


useCommand({ onEnd, getAngleSnap, type }) {
    const { line, onClick, onMove, input } = useLineClickCreate(
      type === 'create rect',
      (c) => onEnd((contents) => contents.push({
        type: 'rect',
        x: (c[0].x + c[1].x) / 2,
        y: (c[0].y + c[1].y) / 2,
        width: Math.abs(c[0].x - c[1].x),
        height: Math.abs(c[0].y - c[1].y),
        angle: 0,
      } as RectContent)),
      {
        once: true,
        getAngleSnap,
      },
    )
    const assistentContents: (RectContent)[] = []
    if (line) {
      assistentContents.push({
        type: 'rect',
        x: (line[0].x + line[1].x) / 2,
        y: (line[0].y + line[1].y) / 2,
        width: Math.abs(line[0].x - line[1].x),
        height: Math.abs(line[0].y - line[1].y),
        angle: 0,
      })
    }
    return {
      onStart: onClick,
      input,
      onMove,
      assistentContents,
    }
  }


(info) => {

    const newWxOutFiles = {}
    let {appJSON} = info.entryInfo

    // 增加对 weixin目录下的app.json 文件处理
    const userAppJSONPath = path.resolve(configure.inputFullpath, 'weixin', 'app.json')
    if (fse.existsSync(userAppJSONPath)) {
        const userAppJSON = require(userAppJSONPath)
        appJSON = merge(appJSON, userAppJSON)

        // 移除输出目录的app.json
        fse.unlinkSync(path.resolve(configure.outputFullpath, 'weixin', 'app.json'))
    }

    const appJSONPath = path.resolve(configure.outputFullpath, 'app.json')
    newWxOutFiles[appJSONPath] = JSON.stringify(appJSON, null, '\t')

    return newWxOutFiles
}


(): RepositoryModel[] => [
  {
    title: 'Featured work',
    subtitle: 'Some projects that I’ve finally finished... almost',
    seeMore: 'I might have more',
    url: 'https://www.linkedin.com/in/wikz87/',
    collection: [
      {
        icon: '🤖',
        companyLogo: 'logo-achieve',
        name: 'Achieve Test Prep',
        url: 'https://prep.achievetestprep.com/',
        description:
          'A learning management system to help the students to achieve more in less time and using less money.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: '1on1 Quiz',
        url: 'https://1on1quiz.com',
        description: '1on1 Quiz - Competitive gaming platform',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Content Management System',
        url: 'https://rcms.beaconhouse.net/',
        description: 'A multi platforms(LMS) supported content management system',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-git',
        name: 'Portfolio Website',
        url: 'https://github.com/wikz/Portfolio-Website',
        description: "This one. Yep, you can check the cool stuff that I've used to build it",
        status: 'in-progress'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-git',
        name: 'Resource Preloader',
        url: 'https://github.com/wikz/Resource-Preloader',
        description:
          'A JavaScript based powerful resource pre-loader with concurrent download and dependency resolving feature.',
        status: 'done'
      }
    ]
  },
  {
    title: 'Mobile Applications',
    subtitle: 'Some apps that I built',
    seeMore: 'I might have more',
    url: 'https://www.linkedin.com/in/wikz87/',
    collection: [
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Learn Smart Pakistan',
        url: 'https://play.google.com/store/apps/details?id=com.knowledgeplatform.lsp',
        description:
          'A cross-platform mobile application for Ultrabot(Learning Management System) with data storing and synching capability. Currently serving 250k+ students.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Ultrabot Prime',
        url: 'https://play.google.com/store/apps/details?id=com.knowledgeplatform.ultrabotprime',
        description: 'A cross-platform mobile LMS App created for M1 Singapore.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Literacy & Numeracy Placement',
        url: '',
        description: 'A multilingual app built in collaboration with World bank and used by 50k+ individual users.',
        status: 'done'
      }
    ]
  },
  {
    title: 'Applications',
    subtitle: "Some Web & desktop Applications I've worked on",
    seeMore: 'I might have more',
    url: 'https://www.linkedin.com/in/wikz87/',
    collection: [
      {
        icon: '🤖',
        companyLogo: 'logo-achieve',
        name: 'Achieve Test Prep',
        url: 'https://prep.achievetestprep.com/',
        description:
          'A learning management system to help the students to achieve more in less time and using less money.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: '1on1 Quiz',
        url: 'https://1on1quiz.com',
        description: '1on1 Quiz - Competitive gaming platform',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Content Management System',
        url: 'https://rcms.beaconhouse.net/',
        description: 'A multi platforms(LMS) supported content management system',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-ewi',
        name: 'Voice Activated FM Audio Broadcast Logger',
        url: '#',
        description: 'An Audio logging software for Radio transmissions. Logs audio transmission in mp3 audio clips.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-ewi',
        name: 'Audio Broadcast Profanity Delay System',
        url: '#',
        description: 'A software being used in Radio transmission broadcasting industry.',
        status: 'done'
      }
    ]
  },
  {
    title: 'CrossPlatform Games',
    subtitle: 'Some games that I’ve launched successfully',
    seeMore: 'I might have more',
    url: 'https://www.linkedin.com/in/wikz87/',
    collection: [
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Dino Eggs',
        url: 'http://gamesdemo.knowledgeplatform.com/demos/dino-eggs/',
        description:
          'A multi-level online game covering 120+ mastery topics of mathematics for middle school students.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Factor Monsters',
        url: 'https://apps.apple.com/pk/app/factor-monsters/id987903121',
        description: 'A drill to master different skills pertaining to factorization.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Mind Tussle',
        url: 'https://apps.apple.com/pk/app/mind-tussle/id1052659847',
        description: 'Improve mental math in an online 1-on-1, time-bound 3 levels game.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Martian Multiples',
        url: 'https://apps.apple.com/pk/app/martian-multiples/id1101691574',
        description: 'A game to master skills of finding Least common multiples and Highest common factors.',
        status: 'done'
      },
      {
        icon: '🤖',
        companyLogo: 'logo-kp',
        name: 'Kampong',
        url: 'http://gamesdemo.knowledgeplatform.com/demos/kampong/',
        description: 'A card game based on adaptive templates for primary content.',
        status: 'done'
      }
    ]
  }
]


export interface SingleProjectModel {
  icon: '🤖'
  companyLogo: string
  name: string
  url: string
  description: string
  status: 'done' | 'in-progress' | 'to-do'
}


export interface RepositoryModel {
  title: String
  subtitle: String
  seeMore: String
  url: String
  collection: SingleProjectModel[]
}


export type HeaderModelName = 'default' | 'headphones' | 'drawing' | 'dude'


() => {
    return (
        <StateManagerProvider stateManager={stateManager}>
            <h1 style={{padding: "1rem"}}>
                For multiple queries with the same variables but different shapes,
                queries with smaller shapes will not send out HTTP requests,
                they will borrow the HTTP request of the query with the largest shape.
            </h1>
            <Row gutter={10}>
                <Col span={12}>
                    <Filter/>
                    <SmallestShape/>
                    <BiggestShape/>
                    <MiddleShape/>
                </Col>
                <Col span={12}>
                    <HttpLogList/>
                </Col>
            </Row>
        </StateManagerProvider>


(
  center: IPosition,
  current: IPosition,
  angle: number
): IPosition => {
  const radians = (Math.PI / 180) * angle;
  const cos = Math.cos(radians);
  const sin = Math.sin(radians);
  const x =
    cos * (current.x - center.x) + sin * (current.y - center.y) + center.x;
  const y =
    cos * (current.y - center.y) - sin * (current.x - center.x) + center.y;
  return { x, y };
}


export interface ThemeState {
  theme: Theme;
  muiTheme: any;
  themeSelection: string;
  themeList: string[];
  changeTheme?: (value: string) => void;
}


export interface DateFormatState {
  dateFormat: 'locale' | 'utc';
  changeDateFormat?: (value: string) => void;
  dateFormatList: string[];
}


export type Theme = 'light' | 'dark' | 'device' | 'deuteranopia' | 'tritanopia' | 'achromatopsia';


export type SettingsState = ThemeState & DateFormatState;


class Footer extends React.Component {
  render() {
    return (
      <Fragment>
        <footer className="footer">
          <Row className="align-items-center justify-content-xl-between">
            <Col xl="6">
              <div className="copyright text-center text-xl-left text-muted">
                © 2018{" "}
                <a
                  className="font-weight-bold ml-1"
                  href="https://www.creative-tim.com?ref=adr-admin-footer"
                  rel="noopener noreferrer"
                  target="_blank"
                >
                  Creative Tim
                </a>
              </div>
            </Col>

            <Col xl="6">
              <Nav className="nav-footer justify-content-center justify-content-xl-end">
                <NavItem>
                  <NavLink
                    href="https://www.creative-tim.com?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    Creative Tim
                  </NavLink>
                </NavItem>

                <NavItem>
                  <NavLink
                    href="https://www.creative-tim.com/presentation?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    About Us
                  </NavLink>
                </NavItem>

                <NavItem>
                  <NavLink
                    href="http://blog.creative-tim.com?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    Blog
                  </NavLink>
                </NavItem>

                <NavItem>
                  <NavLink
                    href="https://github.com/creativetimofficial/argon-dashboard/blob/master/LICENSE.md?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    MIT License
                  </NavLink>
                </NavItem>
              </Nav>
            </Col>
          </Row>
        </footer>
      </Fragment>
    );
  }
}


render() {
    return (
      <Fragment>
        <footer className="footer">
          <Row className="align-items-center justify-content-xl-between">
            <Col xl="6">
              <div className="copyright text-center text-xl-left text-muted">
                © 2018{" "}
                <a
                  className="font-weight-bold ml-1"
                  href="https://www.creative-tim.com?ref=adr-admin-footer"
                  rel="noopener noreferrer"
                  target="_blank"
                >
                  Creative Tim
                </a>
              </div>
            </Col>

            <Col xl="6">
              <Nav className="nav-footer justify-content-center justify-content-xl-end">
                <NavItem>
                  <NavLink
                    href="https://www.creative-tim.com?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    Creative Tim
                  </NavLink>
                </NavItem>

                <NavItem>
                  <NavLink
                    href="https://www.creative-tim.com/presentation?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    About Us
                  </NavLink>
                </NavItem>

                <NavItem>
                  <NavLink
                    href="http://blog.creative-tim.com?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    Blog
                  </NavLink>
                </NavItem>

                <NavItem>
                  <NavLink
                    href="https://github.com/creativetimofficial/argon-dashboard/blob/master/LICENSE.md?ref=adr-admin-footer"
                    rel="noopener noreferrer"
                    target="_blank"
                  >
                    MIT License
                  </NavLink>
                </NavItem>
              </Nav>
            </Col>
          </Row>
        </footer>
      </Fragment>
    );
  }


() => {
  return (

          Frequently Asked Question

          The most common questions about how our business works and what can do
          for you.

              How Long is this site live?

              Laboris qui labore cillum culpa in sunt quis sint veniam. Dolore
              ex aute deserunt esse ipsum elit aliqua. Aute quis minim velit
              nostrud pariatur culpa magna in aute.

              Can I install/upload anything I want on there?

              Laboris qui labore cillum culpa in sunt quis sint veniam. Dolore
              ex aute deserunt esse ipsum elit aliqua. Aute quis minim velit
              nostrud pariatur culpa magna in aute.

              How can I migrate to another site?

              Laboris qui labore cillum culpa in sunt quis sint veniam. Dolore
              ex aute deserunt esse ipsum elit aliqua. Aute quis minim velit
              nostrud pariatur culpa magna in aute.

              Can I change the domain you give me?

              Laboris qui labore cillum culpa in sunt quis sint veniam. Dolore
              ex aute deserunt esse ipsum elit aliqua. Aute quis minim velit
              nostrud pariatur culpa magna in aute.

              How many sites I can create at once?

              Laboris qui labore cillum culpa in sunt quis sint veniam. Dolore
              ex aute deserunt esse ipsum elit aliqua. Aute quis minim velit
              nostrud pariatur culpa magna in aute.

              How can I communicate with you?

              Laboris qui labore cillum culpa in sunt quis sint veniam. Dolore
              ex aute deserunt esse ipsum elit aliqua. Aute quis minim velit
              nostrud pariatur culpa magna in aute.


export function PlantCardSecondary({ data, handleRemove, ...rest }: PlantProps) {
  return (
    <Swipeable
      overshootRight={false}
      renderRightActions={() => (
        <Animated.View>
          <View>
            <RectButton style={styles.buttonRemove} onPress={handleRemove}>

            <Feather name="trash" size={32} color={colors.white} />
            </RectButton>
          </View>
        </Animated.View>
      )}


interface PlantProps extends RectButtonProps {
  data: {
    name: string;
    photo: string;
    hour: string;
  };
  handleRemove: () => void;
}


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

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

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

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


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


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


@NgModule({
  declarations: [],
  imports: [
    SharedModule
  ],
  providers: [
    {
      provide: HTTP_INTERCEPTORS,
      useClass: HttpInterceptorService,
      multi: true
    },
    AuthService,
    AuthGuard,
  ]
})
export class CoreModule { }


() => {
  test('all changes when total amount is below limit', () => {
    const summary = createSummary(
      [
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-1',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-2',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldAdded,
          message: 'safe-3',
          criticality: {
            level: CriticalityLevel.NonBreaking,
          },
        },
      ],
      3,
    );

    expect(summary).toContain('- breaking-1');
    expect(summary).toContain('- breaking-2');
    expect(summary).toContain('- safe-3');
    expect(summary).not.toContain('summaryLimit');
  });

  test('only breaking changes when total is above limit and breaking is below or equal', () => {
    const summary = createSummary(
      [
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-1',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-2',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-3',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldAdded,
          message: 'safe-4',
          criticality: {
            level: CriticalityLevel.NonBreaking,
          },
        },
      ],
      3,
    );

    expect(summary).toContain('- breaking-1');
    expect(summary).toContain('- breaking-2');
    expect(summary).toContain('- breaking-3');
    expect(summary).not.toContain('- safe-4');
    expect(summary).toContain('summaryLimit');
  });

  test('empty when total and breaking are above limit', () => {
    const summary = createSummary(
      [
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-1',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-2',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-3',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldAdded,
          message: 'safe-4',
          criticality: {
            level: CriticalityLevel.NonBreaking,
          },
        },
      ],
      2,
    );

    expect(summary).not.toContain('- breaking-1');
    expect(summary).not.toContain('- breaking-2');
    expect(summary).not.toContain('- breaking-3');
    expect(summary).not.toContain('- safe-4');
    expect(summary).toContain('summaryLimit');
  });
}


() => {
    const summary = createSummary(
      [
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-1',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-2',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldAdded,
          message: 'safe-3',
          criticality: {
            level: CriticalityLevel.NonBreaking,
          },
        },
      ],
      3,
    );

    expect(summary).toContain('- breaking-1');
    expect(summary).toContain('- breaking-2');
    expect(summary).toContain('- safe-3');
    expect(summary).not.toContain('summaryLimit');
  }


() => {
    const summary = createSummary(
      [
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-1',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-2',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-3',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldAdded,
          message: 'safe-4',
          criticality: {
            level: CriticalityLevel.NonBreaking,
          },
        },
      ],
      3,
    );

    expect(summary).toContain('- breaking-1');
    expect(summary).toContain('- breaking-2');
    expect(summary).toContain('- breaking-3');
    expect(summary).not.toContain('- safe-4');
    expect(summary).toContain('summaryLimit');
  }


() => {
    const summary = createSummary(
      [
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-1',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-2',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldRemoved,
          message: 'breaking-3',
          criticality: {
            level: CriticalityLevel.Breaking,
          },
        },
        {
          type: ChangeType.FieldAdded,
          message: 'safe-4',
          criticality: {
            level: CriticalityLevel.NonBreaking,
          },
        },
      ],
      2,
    );

    expect(summary).not.toContain('- breaking-1');
    expect(summary).not.toContain('- breaking-2');
    expect(summary).not.toContain('- breaking-3');
    expect(summary).not.toContain('- safe-4');
    expect(summary).toContain('summaryLimit');
  }


/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * 대시보드 옵션 구조체
 */
export class BoardGlobalOptions {
  public layout?: BoardLayoutOptions;    // 대시보드 레이아웃 정보
  public widget?: BoardWidgetOptions;    // 차트 표현 방식 설정
  public sync?: BoardSyncOptions;        // 대시보드 실시간 옵션 정보
  constructor() {
    this.layout = new BoardLayoutOptions();
    this.widget = new BoardWidgetOptions();
  }
}


/**
 * 대시보드 옵션 - 레이아웃 형태 정의 옵션 구조체
 */
export class BoardLayoutOptions {
  public layoutType:BoardLayoutType;   // Layout Type
  public layoutHeight:number;     // height value, if layoutType set FIT_TO_HEIGHT
  public widgetPadding:number;    // widget 간 간격

  constructor() {
    this.layoutType = BoardLayoutType.FIT_TO_SCREEN;
    this.widgetPadding = 5;
  }
}


/**
 * 대시보드 옵션 - 차트 속성 표시 옵션 구조체
 */
export class BoardWidgetOptions {
  public showTitle: WidgetShowType;
  public showLegend: WidgetShowType;
  public showMinimap: WidgetShowType;

  constructor() {
    this.showTitle = WidgetShowType.BY_WIDGET;
    this.showLegend = WidgetShowType.BY_WIDGET;
    this.showMinimap = WidgetShowType.BY_WIDGET;
  }
}


/**
 * 대시보드 옵션 - 실시간 옵션 구조체
 */
export class BoardSyncOptions {
  public enabled: boolean = false;
  public interval: number;

  constructor(interval?: number) {
    if (interval) {
      this.enabled = true;
      this.interval = interval;
    }
  }
}


/**
 * 레이아웃 타입
 */
export enum BoardLayoutType {
  FIT_TO_SCREEN = <any>'FIT_TO_SCREEN',
  FIT_TO_HEIGHT = <any>'FIT_TO_HEIGHT'
}


/**
 * 위젯 표시 여부
 */
export enum WidgetShowType {
  ON = <any>'ON',
  OFF = <any>'OFF',
  BY_WIDGET = <any>'BY_WIDGET'
}


loader => this.updateNotification(loader ? NotificationTypeEnum.Loader : NotificationTypeEnum.None)


error => this.updateNotification(error ? NotificationTypeEnum.Error : NotificationTypeEnum.None, error)


export class CoreApiNotification extends Subscriptions {
  notification:string;
  notificationType:NotificationTypeEnum;
  button:NotificationButtonInterface;

  constructor(private state:CoreApiStateService,
              private apiService:any) {
    super();
    this.subscriptions.push(state.loader$.subscribe(
      loader => this.updateNotification(loader ? NotificationTypeEnum.Loader : NotificationTypeEnum.None)
    ));

    this.subscriptions.push(state.error$.subscribe(
      error => this.updateNotification(error ? NotificationTypeEnum.Error : NotificationTypeEnum.None, error)
    ));
  }

  notificationAction(type:string) {
    if (type === NotificationActions.Reload) {
      this.apiService.reload();
    }
  }

  updateNotification(type:NotificationTypeEnum, value:any = null, button:NotificationButtonInterface = null) {
    this.notificationType = type;
    if (type === NotificationTypeEnum.Error) {
      this.notification = value.value;
      this.button = {
        icon: 'refresh',
        text: 'Try Again',
        action: NotificationActions.Reload
      };
    } else {
      this.button = button;
      this.notification = value;
    }
  }
}


export class NotificationActions {
  static Reload = 'reload';
}


notificationAction(type:string) {
    if (type === NotificationActions.Reload) {
      this.apiService.reload();
    }
  }


updateNotification(type:NotificationTypeEnum, value:any = null, button:NotificationButtonInterface = null) {
    this.notificationType = type;
    if (type === NotificationTypeEnum.Error) {
      this.notification = value.value;
      this.button = {
        icon: 'refresh',
        text: 'Try Again',
        action: NotificationActions.Reload
      };
    } else {
      this.button = button;
      this.notification = value;
    }
  }


export default class PriceInput extends DecimalInput {
    decimals(): number {
        return app.forum.attribute('priceDecimals');
    }
}


decimals(): number {
        return app.forum.attribute('priceDecimals');
    }


export function getLab(args: GetLabArgs, opts?: pulumi.InvokeOptions): Promise<GetLabResult> {
    if (!opts) {
        opts = {}
    }

    if (!opts.version) {
        opts.version = utilities.getVersion();
    }
    return pulumi.runtime.invoke("azure-nextgen:labservices/latest:getLab", {
        "expand": args.expand,
        "labAccountName": args.labAccountName,
        "labName": args.labName,
        "resourceGroupName": args.resourceGroupName,
    }, opts);
}


export interface GetLabArgs {
    /**
     * Specify the $expand query. Example: 'properties($select=maxUsersInLab)'
     */
    readonly expand?: string;
    /**
     * The name of the lab Account.
     */
    readonly labAccountName: string;
    /**
     * The name of the lab.
     */
    readonly labName: string;
    /**
     * The name of the resource group.
     */
    readonly resourceGroupName: string;
}


/**
 * Represents a lab.
 */
export interface GetLabResult {
    /**
     * Object id of the user that created the lab.
     */
    readonly createdByObjectId: string;
    /**
     * Lab creator name
     */
    readonly createdByUserPrincipalName: string;
    /**
     * Creation date for the lab
     */
    readonly createdDate: string;
    /**
     * Invitation code that users can use to join a lab.
     */
    readonly invitationCode: string;
    /**
     * The details of the latest operation. ex: status, error
     */
    readonly latestOperationResult: outputs.labservices.latest.LatestOperationResultResponse;
    /**
     * The location of the resource.
     */
    readonly location?: string;
    /**
     * Maximum number of users allowed in the lab.
     */
    readonly maxUsersInLab?: number;
    /**
     * The name of the resource.
     */
    readonly name: string;
    /**
     * The provisioning status of the resource.
     */
    readonly provisioningState?: string;
    /**
     * The tags of the resource.
     */
    readonly tags?: {[key: string]: string};
    /**
     * The type of the resource.
     */
    readonly type: string;
    /**
     * The unique immutable identifier of a resource (Guid).
     */
    readonly uniqueIdentifier?: string;
    /**
     * Maximum duration a user can use an environment for in the lab.
     */
    readonly usageQuota?: string;
    /**
     * Lab user access mode (open to all vs. restricted to those listed on the lab).
     */
    readonly userAccessMode?: string;
    /**
     * Maximum value MaxUsersInLab can be set to, as specified by the service
     */
    readonly userQuota: number;
}


export type IDataColumn = Column & {
  title?: string;
  disableHidden?: boolean;
  disableSortBy?: boolean;
  filterValue?: any;
  preFilteredRows?: any;
  setFilter?: any;
};


/**
 * tasks
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * OpenAPI spec version: 2.13
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */
export interface TasksEnqueueManyResponseSucceeded {
    /**
     * ID of the succeeded entity
     */
    id?: string;
    /**
     * Number of tasks updated (0 or 1)
     */
    updated?: number;
    /**
     * Updated fields names and values
     */
    fields?: object;
    /**
     * Indicates whether the task was queued
     */
    queued?: boolean;
}


export abstract class Source {
    size(): number;

    map(options?: any): any;

    sourceAndMap(options?: any): {
        source: string;
        map: RawSourceMap;
    };

    updateHash(hash: Hash): void;

    source(options?: any): string;

    node(options?: any): any;

    listNode(options?: any): any;

    listMap(options?: any): any;
}


export class CachedSource {
    _source: Source;
    _cachedSource: string;
    _cachedSize: number;
    _cachedMaps: {
        [prop: string]: RawSourceMap
    };
    node: (options: any) => SourceNode;
    listMap: (options: any) => SourceListMap;

    constructor(source: Source);

    source(): string;

    size(): number;

    sourceAndMap(options: any): {
        source: string;
        map: RawSourceMap;
    };

    map(options: any): RawSourceMap;

    updateHash(hash: Hash): void;
}


export class ConcatSource extends Source implements SourceAndMapMixin {
    children: Array<(string | Source)>;

    constructor(...args: Array<(string | Source)>);

    add(item: string | Source): void;

    source(): string;

    size(): number;

    node(options: any): SourceNode;

    listMap(options: any): SourceListMap;

    updateHash(hash: Hash): void;
}


export class LineToLineMappedSource extends Source implements SourceAndMapMixin {
    _value: string;
    _name: string;
    _originalSource: string;

    constructor(value: string, name: string, originalSource: string);

    source(): string;

    node(options: any): SourceNode;

    listMap(options: any): SourceListMap;

    updateHash(hash: Hash): void;
}


export class OriginalSource extends Source implements SourceAndMapMixin {
    _value: string;
    _name: string;

    constructor(value: string, name: string);

    source(): string;

    node(
        options?: {
            columns?: boolean;
        }
    ): SourceNode;

    listMap(options: any): SourceListMap;

    updateHash(hash: Hash): void;
}


export class PrefixSource extends Source implements SourceAndMapMixin {
    _source: Source | string;
    _prefix: Source | string;

    constructor(prefix: Source | string, source: Source | string);

    source(): string;

    node(options: any): SourceNode;

    listMap(options: any): SourceListMap;

    updateHash(hash: Hash): void;
}


export class RawSource extends Source {
    _value: string;

    constructor(value: string);

    source(): string;

    map(options: any): null;

    node(options: any): SourceNode;

    listMap(options: any): SourceListMap;

    updateHash(hash: Hash): void;
}


export class ReplaceSource extends Source implements SourceAndMapMixin {
    _source: Source;
    _name: string;
    replacements: any[][];

    constructor(source: Source, name: string);

    replace(start: number, end: number, newValue: string): void;

    insert(pos: number, newValue: string): void;

    source(): string;

    _sortReplacements(): void;

    _replaceString(str: string): string;

    node(options: any): SourceNode;

    listMap(options: any): SourceListMap;

    _replacementToSourceNode(oldNode: SourceNode, newString: string): string | SourceNode;

    _splitSourceNode(node: SourceNode, position: SourceNode[]): SourceNode[];
    _splitSourceNode(node: string, position: number): number;

    _splitString(str: string, position: number): string[];
}


export class SourceMapSource extends Source implements SourceAndMapMixin {
    _value: string;
    _name: string;
    _sourceMap: SourceMapGenerator | RawSourceMap;
    _originalSource: string;
    _innerSourceMap: RawSourceMap;

    constructor(
        value: string,
        name: string,
        sourceMap: SourceMapGenerator | RawSourceMap,
        originalSource?: string,
        innerSourceMap?: RawSourceMap
    );

    source(): string;

    node(): SourceNode;

    listMap(
        options: {
            module?: boolean;
        }
    ): SourceListMap;

    updateHash(hash: Hash): void;
}


export interface SourceAndMapMixin {
    map(options: { columns?: boolean }): RawSourceMap;
    sourceAndMap(options: { columns?: boolean }): {
        source: string;
        map: RawSourceMap;
    };
}


size(): number;


map(options?: any): any;


sourceAndMap(options?: any): {
        source: string;
        map: RawSourceMap;
    };


updateHash(hash: Hash): void;


source(options?: any): string;


node(options?: any): any;


listNode(options?: any): any;


listMap(options?: any): any;


source(): string;


sourceAndMap(options: any): {
        source: string;
        map: RawSourceMap;
    };


map(options: any): RawSourceMap;


add(item: string | Source): void;


node(options: any): SourceNode;


listMap(options: any): SourceListMap;


node(
        options?: {
            columns?: boolean;
        }
    ): SourceNode;


map(options: any): null;


replace(start: number, end: number, newValue: string): void;


insert(pos: number, newValue: string): void;


_sortReplacements(): void;


_replaceString(str: string): string;


_replacementToSourceNode(oldNode: SourceNode, newString: string): string | SourceNode;


_splitSourceNode(node: SourceNode, position: SourceNode[]): SourceNode[];


_splitSourceNode(node: string, position: number): number;


_splitString(str: string, position: number): string[];


node(): SourceNode;


listMap(
        options: {
            module?: boolean;
        }
    ): SourceListMap;


(res, rej) =>
			ctx.req.session!.destroy((err) => {
				if (err) return rej(false);

				ctx.res.clearCookie('qid');
				return res(true);
			})


(err) => {
				if (err) return rej(false);

				ctx.res.clearCookie('qid');
				return res(true);
			}


@Resolver()
export class AuthResolver {
	@Mutation(() => User)
	async register(
		@Arg('input') input: ResolverTypes.RegisterInput
	): Promise<User> {
		return await User.create(input).save();
	}

	@Mutation(() => User)
	async login(
		@Arg('input') input: ResolverTypes.LoginInput,
		@Ctx() { req }: MyContext
	): Promise<User> {
		const user = await User.findOne({ email: input.email });

		if (!user) {
			throw new ArgumentValidationError([
				{
					target: {
						email: input.email,
					},
					value: input.email,
					property: 'email',
					constraints: {
						isEmailCorrect: 'email, or password is incorrect',
					},
				},
			]);
		}

		const isMatch = await bcrypt.compare(input.password, user.password);

		if (!isMatch) {
			throw new ArgumentValidationError([
				{
					target: {
						email: input.email,
					},
					value: input.email,
					property: 'email',
					constraints: {
						isEmailCorrect: 'email, or password is incorrect',
					},
				},
			]);
		}

		(req.session as any).user = user;
		return user;
	}

	@Query(() => User, { nullable: true })
	async me(@Ctx() { req }: MyContext): Promise<User | undefined> {
		return (req.session as any).user;
	}

	@Mutation(() => Boolean)
	logout(@Ctx() ctx: MyContext): Promise<boolean> {
		return new Promise((res, rej) =>
			ctx.req.session!.destroy((err) => {
				if (err) return rej(false);

				ctx.res.clearCookie('qid');
				return res(true);
			})
		);
	}
}


@Mutation(() => User)
	async register(
		@Arg('input') input: ResolverTypes.RegisterInput
	): Promise<User> {
		return await User.create(input).save();
	}


@Mutation(() => User)
	async login(
		@Arg('input') input: ResolverTypes.LoginInput,
		@Ctx() { req }: MyContext
	): Promise<User> {
		const user = await User.findOne({ email: input.email });

		if (!user) {
			throw new ArgumentValidationError([
				{
					target: {
						email: input.email,
					},
					value: input.email,
					property: 'email',
					constraints: {
						isEmailCorrect: 'email, or password is incorrect',
					},
				},
			]);
		}

		const isMatch = await bcrypt.compare(input.password, user.password);

		if (!isMatch) {
			throw new ArgumentValidationError([
				{
					target: {
						email: input.email,
					},
					value: input.email,
					property: 'email',
					constraints: {
						isEmailCorrect: 'email, or password is incorrect',
					},
				},
			]);
		}

		(req.session as any).user = user;
		return user;
	}


@Query(() => User, { nullable: true })
	async me(@Ctx() { req }: MyContext): Promise<User | undefined> {
		return (req.session as any).user;
	}


@Mutation(() => Boolean)
	logout(@Ctx() ctx: MyContext): Promise<boolean> {
		return new Promise((res, rej) =>
			ctx.req.session!.destroy((err) => {
				if (err) return rej(false);

				ctx.res.clearCookie('qid');
				return res(true);
			})
		);
	}


export default function GetScriptLanguagesApi(this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.GetScriptLanguagesResponse>;


export default function GetScriptLanguagesApi(this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.GetScriptLanguagesResponse, unknown>>;


export default function GetScriptLanguagesApi(this: That, params?: T.GetScriptLanguagesRequest | TB.GetScriptLanguagesRequest, options?: TransportRequestOptions): Promise<T.GetScriptLanguagesResponse>;


interface That {
    transport: Transport;
}


/**
 * Creates a {@link vscode.Task Task} to build all targets in this package.
 */
function createBuildAllTask(folder: vscode.WorkspaceFolder): vscode.Task {
    const additionalArgs: string[] = [];
    if (process.platform !== "darwin") {
        additionalArgs.push("--enable-test-discovery");
    }
    if (process.platform === "win32") {
        additionalArgs.push("-Xlinker", "-debug:dwarf");
    }
    return createSwiftTask(
        ["build", "--build-tests", ...additionalArgs, ...configuration.buildArguments],
        SwiftTaskProvider.buildAllName,
        { group: vscode.TaskGroup.Build, scope: folder }
    );
}


/**
 * Creates a {@link vscode.Task Task} to run an executable target.
 */
function createBuildTasks(product: Product, folder: vscode.WorkspaceFolder): vscode.Task[] {
    const debugArguments = process.platform === "win32" ? ["-Xlinker", "-debug:dwarf"] : [];
    return [
        createSwiftTask(
            [
                "build",
                "--product",
                product.name,
                ...debugArguments,
                ...configuration.buildArguments,
            ],
            `Build Debug ${product.name}`,
            { group: vscode.TaskGroup.Build, scope: folder }
        ),
        createSwiftTask(
            ["build", "-c", "release", "--product", product.name, ...configuration.buildArguments],
            `Build Release ${product.name}`,
            { group: vscode.TaskGroup.Build, scope: folder }
        ),
    ];
}


/**
 * Helper function to create a {@link vscode.Task Task} with the given parameters.
 */
export function createSwiftTask(args: string[], name: string, config?: TaskConfig): vscode.Task {
    const swift = getSwiftExecutable();
    const task = new vscode.Task(
        { type: "swift", command: swift, args: args },
        config?.scope ?? vscode.TaskScope.Workspace,
        name,
        "swift",
        new vscode.ShellExecution(swift, args),
        config?.problemMatcher
    );
    // This doesn't include any quotes added by VS Code.
    // See also: https://github.com/microsoft/vscode/issues/137895
    task.detail = `swift ${args.join(" ")}`;
    task.group = config?.group;
    task.presentationOptions = config?.presentationOptions ?? {};
    return task;
}


/*
 * Execute swift command as task and wait until it is finished
 */
export async function executeSwiftTaskAndWait(args: string[], name: string, config?: TaskConfig) {
    const swift = getSwiftExecutable();
    const task = new vscode.Task(
        { type: "swift", command: "swift", args: args },
        config?.scope ?? vscode.TaskScope.Workspace,
        name,
        "swift",
        new vscode.ShellExecution(swift, args),
        config?.problemMatcher
    );
    task.group = config?.group;
    task.presentationOptions = config?.presentationOptions ?? {};

    executeTaskAndWait(task);
}


/*
 * Execute shell command as task and wait until it is finished
 */
export async function executeShellTaskAndWait(
    command: string,
    args: string[],
    name: string,
    config?: TaskConfig
) {
    const task = new vscode.Task(
        { type: "swift", command: command, args: args },
        config?.scope ?? vscode.TaskScope.Workspace,
        name,
        "swift",
        new vscode.ShellExecution(command, args),
        config?.problemMatcher
    );
    task.group = config?.group;
    task.presentationOptions = config?.presentationOptions ?? {};

    executeTaskAndWait(task);
}


/*
 * Execute task and wait until it is finished. This function assumes that no
 * other tasks with the same name will be run at the same time
 */
export async function executeTaskAndWait(task: vscode.Task) {
    return new Promise<void>(resolve => {
        const disposable = vscode.tasks.onDidEndTask(({ execution }) => {
            if (execution.task.name === task.name && execution.task.scope === task.scope) {
                disposable.dispose();
                resolve();
            }
        });
        vscode.tasks.executeTask(task);
    });
}


resolve => {
        const disposable = vscode.tasks.onDidEndTask(({ execution }) => {
            if (execution.task.name === task.name && execution.task.scope === task.scope) {
                disposable.dispose();
                resolve();
            }
        });
        vscode.tasks.executeTask(task);
    }


({ execution }) => {
            if (execution.task.name === task.name && execution.task.scope === task.scope) {
                disposable.dispose();
                resolve();
            }
        }


/**
 * A {@link vscode.TaskProvider TaskProvider} for tasks that match the definition
 * in **package.json**: `{ type: 'swift'; command: string; args: string[] }`.
 *
 * See {@link SwiftTaskProvider.provideTasks provideTasks} for a list of provided tasks.
 */
export class SwiftTaskProvider implements vscode.TaskProvider {
    static buildAllName = "Build All";
    static cleanBuildName = "Clean Build Artifacts";
    static resolvePackageName = "Resolve Package Dependencies";
    static updatePackageName = "Update Package Dependencies";

    constructor(private workspaceContext: WorkspaceContext) {}

    /**
     * Provides tasks to run the following commands:
     *
     * - `swift build`
     * - `swift package clean`
     * - `swift package resolve`
     * - `swift package update`
     * - `swift run ${target}` for every executable target
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    async provideTasks(token: vscode.CancellationToken): Promise<vscode.Task[]> {
        if (this.workspaceContext.folders.length === 0) {
            return [];
        }
        const tasks = [];

        for (const folderContext of this.workspaceContext.folders) {
            if (!folderContext.swiftPackage.foundPackage) {
                continue;
            }
            tasks.push(createBuildAllTask(folderContext.folder));
            const executables = folderContext.swiftPackage.executableProducts;
            for (const executable of executables) {
                tasks.push(...createBuildTasks(executable, folderContext.folder));
            }
        }
        return tasks;
    }

    /**
     * Resolves a {@link vscode.Task Task} specified in **tasks.json**.
     *
     * Other than its definition, this `Task` may be incomplete,
     * so this method should fill in the blanks.
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    resolveTask(task: vscode.Task, token: vscode.CancellationToken): vscode.Task {
        // We need to create a new Task object here.
        // Reusing the task parameter doesn't seem to work.
        const newTask = new vscode.Task(
            task.definition,
            task.scope ?? vscode.TaskScope.Workspace,
            task.name || "Custom Task",
            "swift",
            new vscode.ShellExecution(task.definition.command, task.definition.args),
            task.problemMatchers
        );
        newTask.detail =
            task.detail ?? `${task.definition.command} ${task.definition.args.join(" ")}`;
        newTask.group = task.group;
        newTask.presentationOptions = task.presentationOptions;

        return newTask;
    }
}


/**
 * References:
 *
 * - General information on tasks:
 *   https://code.visualstudio.com/docs/editor/tasks
 * - Contributing task definitions:
 *   https://code.visualstudio.com/api/references/contribution-points#contributes.taskDefinitions
 * - Implementing task providers:
 *   https://code.visualstudio.com/api/extension-guides/task-provider
 */
// Interface class for defining task configuration
interface TaskConfig {
    scope?: vscode.TaskScope | vscode.WorkspaceFolder;
    group?: vscode.TaskGroup;
    problemMatcher?: string | string[];
    presentationOptions?: vscode.TaskPresentationOptions;
}


/**
     * Provides tasks to run the following commands:
     *
     * - `swift build`
     * - `swift package clean`
     * - `swift package resolve`
     * - `swift package update`
     * - `swift run ${target}` for every executable target
     */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async provideTasks(token: vscode.CancellationToken): Promise<vscode.Task[]> {
        if (this.workspaceContext.folders.length === 0) {
            return [];
        }
        const tasks = [];

        for (const folderContext of this.workspaceContext.folders) {
            if (!folderContext.swiftPackage.foundPackage) {
                continue;
            }
            tasks.push(createBuildAllTask(folderContext.folder));
            const executables = folderContext.swiftPackage.executableProducts;
            for (const executable of executables) {
                tasks.push(...createBuildTasks(executable, folderContext.folder));
            }
        }
        return tasks;
    }


/**
     * Resolves a {@link vscode.Task Task} specified in **tasks.json**.
     *
     * Other than its definition, this `Task` may be incomplete,
     * so this method should fill in the blanks.
     */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
resolveTask(task: vscode.Task, token: vscode.CancellationToken): vscode.Task {
        // We need to create a new Task object here.
        // Reusing the task parameter doesn't seem to work.
        const newTask = new vscode.Task(
            task.definition,
            task.scope ?? vscode.TaskScope.Workspace,
            task.name || "Custom Task",
            "swift",
            new vscode.ShellExecution(task.definition.command, task.definition.args),
            task.problemMatchers
        );
        newTask.detail =
            task.detail ?? `${task.definition.command} ${task.definition.args.join(" ")}`;
        newTask.group = task.group;
        newTask.presentationOptions = task.presentationOptions;

        return newTask;
    }


export default function WalletCreateList() {
  const history = useHistory();
  const { url } = useRouteMatch();

  function handleCreateDistributedIdentity() {
    history.push(`${url}/did`);
  }

  return (
    <Flex flexDirection="column" gap={3}>
      <Flex flexGrow={1}>
        <Typography variant="h5">
          <Trans>Select Wallet Type</Trans>
        </Typography>
      </Flex>
      <Grid spacing={3} alignItems="stretch" container>
        <Grid xs={12} sm={6} md={4} item>
          <WalletCreateCard
            onSelect={handleCreateDistributedIdentity}
            title={<Trans>Distributed Identity</Trans>}
            icon={<ShareIcon fontSize="large" color="primary" />}


function handleCreateDistributedIdentity() {
    history.push(`${url}/did`);
  }


@Component({
  selector: 'notification-item',
  templateUrl: './notification-item.component.html',
  styleUrls: ['./notification-item.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class NotificationItemComponent {
  @Input() notification: Notification;

  private errorMessage = "This url doesn't exist.";

  constructor(private router: Router, private service: NotificationService) {}

  public goToPath() {
    try {
      this.router.navigate([this.notification.path]);
      this.service.readNotification(this.notification.id);
    } catch (error) {
      console.error(error);
      throw new Error(this.errorMessage);
    }
  }

  public goToTeamwork() {
    try {
      this.router.navigate([this.notification.path]);
      this.service.readNotification(this.notification.id);
    } catch (error) {
      console.error(error);
      throw new Error(this.errorMessage);
    }
  }

  public read() {
    this.service.readNotification(this.notification.id);
  }
}


public goToPath() {
    try {
      this.router.navigate([this.notification.path]);
      this.service.readNotification(this.notification.id);
    } catch (error) {
      console.error(error);
      throw new Error(this.errorMessage);
    }
  }


public goToTeamwork() {
    try {
      this.router.navigate([this.notification.path]);
      this.service.readNotification(this.notification.id);
    } catch (error) {
      console.error(error);
      throw new Error(this.errorMessage);
    }
  }


public read() {
    this.service.readNotification(this.notification.id);
  }


export class Tenderfoot extends Unit {
    protected baseAttributes = new Attributes();

    color: Color.ColorName = 'Neutral';
    spec: Color.Spec = 'Starter';
    flavorType = 'Virtuoso';
    name: string = 'Tenderfoot';
    techLevel: TechLevel = 0;
    importPath: string = './neutral/starter';

    constructor(owner: number, controller?: number, cardId?: string) {
        super(owner, controller, cardId);

        this.baseAttributes.cost = 1;

        this.baseAttributes.attack = 2;
        this.baseAttributes.health = 1;
    }
}


/** @deprecated use getResponseTypes instead, this function will be removed in a future version. */
function onlySuccessful(statusCode: string) {
  return successfulCodes.includes(statusCode);
}


/** @deprecated use getResponseTypes instead, this function will be removed in a future version. */
function getSuccessfulResponse(op: HttpOperation): SwaggerType {
  const definedSuccessCodes = Object.keys(op.responses).filter(onlySuccessful);

  if (definedSuccessCodes.length === 0) {
    throw new Error("No success responses defined");
  }

  return op.responses[definedSuccessCodes[0]];
}


/** @deprecated use getResponseTypes instead, this function will be removed in a future version. */
export function getSuccessfulResponseType(
  op: HttpOperation,
  swagger: Swagger
): [string, boolean] {
  let successfulResponseTypeIsRef = false;
  let successfulResponseType;

  try {
    const successfulResponse = getSuccessfulResponse(op);
    const convertedType = convertType(successfulResponse, swagger);

    if (convertedType.target) {
      successfulResponseTypeIsRef = true;
    }

    successfulResponseType =
      convertedType.target || convertedType.tsType || defaultResponseType;
  } catch (error) {
    successfulResponseType = defaultResponseType;
  }

  return [successfulResponseType, successfulResponseTypeIsRef];
}


(
  responseTypeName: string,
  httpOperation: HttpOperation,
  swagger: Swagger
): string =>
  uniq(
    responseTypesToStrings(
      responseTypeName,
      convertResponseTypes(responseTypes(httpOperation), swagger)
    )
  ).join(" | ")


(
  httpOperation: HttpOperation
): ResponseType<SwaggerType>[] =>
  entries(httpOperation.responses).map(kvp => ({
    statusType: kvp[0],
    bodyType: kvp[1]
  }))


kvp => ({
    statusType: kvp[0],
    bodyType: kvp[1]
  })


(
  swaggerTypes: ResponseType<SwaggerType>[],
  swagger: Swagger
): ResponseType<TypeSpec>[] =>
  swaggerTypes.map(swaggerType => convertResponseType(swaggerType, swagger))


swaggerType => convertResponseType(swaggerType, swagger)


(
  swaggerType: ResponseType<SwaggerType>,
  swagger: Swagger
): ResponseType<TypeSpec> => ({
  statusType: convertStatusType(swaggerType.statusType),
  bodyType: convertType(swaggerType.bodyType, swagger)
})


(str: string): string =>
  isHttpStatusCode(str) ? str : defaultHttpStatusType


(str: string): boolean =>
  str.match(/^[1-5]\d{2}$/) !== null


(
  responseTypeName: string,
  typeSpecs: ResponseType<TypeSpec>[]
): string[] => typeSpecs.map(ts => responseTypeToString(responseTypeName, ts))


ts => responseTypeToString(responseTypeName, ts)


(
  responseTypeName: string,
  typeSpec: ResponseType<TypeSpec>
): string =>
  `${responseTypeName}<${typeSpec.statusType}, ${typeSpecToString(
    typeSpec.bodyType
  )}>`


(typeSpec: TypeSpec): string =>
  typeSpec.target || typeSpec.tsType || defaultResponseType


interface ResponseType<T> {
  statusType: string;
  bodyType: T;
}


/**
 * Interface for the jqXHR object
 */
interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
    /**
     * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5).
     */
    overrideMimeType(mimeType: string): any;
    /**
     * Cancel the request.
     *
     * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
     */
    abort(statusText?: string): void;
    /**
     * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.
     */
    then<R>(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<R>;
    /**
     * Property containing the parsed response if the response Content-Type is json
     */
    responseJSON?: any;
    /**
     * A function to be called if the request fails.
     */
    error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void;
}


/**
 * Interface for the JQuery callback
 */
interface JQueryCallback {
    /**
     * Add a callback or a collection of callbacks to a callback list.
     *
     * @param callbacks A function, or array of functions, that are to be added to the callback list.
     */
    add(callbacks: Function): JQueryCallback;
    /**
     * Add a callback or a collection of callbacks to a callback list.
     *
     * @param callbacks A function, or array of functions, that are to be added to the callback list.
     */
    add(callbacks: Function[]): JQueryCallback;

    /**
     * Disable a callback list from doing anything more.
     */
    disable(): JQueryCallback;

    /**
     * Determine if the callbacks list has been disabled.
     */
    disabled(): boolean;

    /**
     * Remove all of the callbacks from a list.
     */
    empty(): JQueryCallback;

    /**
     * Call all of the callbacks with the given arguments
     *
     * @param arguments The argument or list of arguments to pass back to the callback list.
     */
    fire(...arguments: any[]): JQueryCallback;

    /**
     * Determine if the callbacks have already been called at least once.
     */
    fired(): boolean;

    /**
     * Call all callbacks in a list with the given context and arguments.
     *
     * @param context A reference to the context in which the callbacks in the list should be fired.
     * @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
     */
    fireWith(context?: any, args?: any[]): JQueryCallback;

    /**
     * Determine whether a supplied callback is in a list
     *
     * @param callback The callback to search for.
     */
    has(callback: Function): boolean;

    /**
     * Lock a callback list in its current state.
     */
    lock(): JQueryCallback;

    /**
     * Determine if the callbacks list has been locked.
     */
    locked(): boolean;

    /**
     * Remove a callback or a collection of callbacks from a callback list.
     *
     * @param callbacks A function, or array of functions, that are to be removed from the callback list.
     */
    remove(callbacks: Function): JQueryCallback;
    /**
     * Remove a callback or a collection of callbacks from a callback list.
     *
     * @param callbacks A function, or array of functions, that are to be removed from the callback list.
     */
    remove(callbacks: Function[]): JQueryCallback;
}


/**
 * Allows jQuery Promises to interop with non-jQuery promises
 */
interface JQueryGenericPromise<T> {
    /**
     * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
     *
     * @param doneFilter A function that is called when the Deferred is resolved.
     * @param failFilter An optional function that is called when the Deferred is rejected.
     */
    then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;

    /**
     * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
     *
     * @param doneFilter A function that is called when the Deferred is resolved.
     * @param failFilter An optional function that is called when the Deferred is rejected.
     */
    then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>;
}


/**
 * Interface for the JQuery promise/deferred callbacks
 */
interface JQueryPromiseCallback<T> {
    (value?: T, ...args: any[]): void;
}


interface JQueryPromiseOperator<T, U> {
    (callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
}


/**
 * Interface for the JQuery promise, part of callbacks
 */
interface JQueryPromise<T> extends JQueryGenericPromise<T> {
    /**
     * Determine the current state of a Deferred object.
     */
    state(): string;
    /**
     * Add handlers to be called when the Deferred object is either resolved or rejected.
     *
     * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
     * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
     */
    always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
    /**
     * Add handlers to be called when the Deferred object is resolved.
     *
     * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
     * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
     */
    done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>;
    /**
     * Add handlers to be called when the Deferred object is rejected.
     *
     * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
     * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
     */
    fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
    /**
     * Add handlers to be called when the Deferred object generates progress notifications.
     *
     * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
     */
    progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;

    // Deprecated - given no typings
    pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
}


/**
 * Interface for the JQuery deferred, part of callbacks
 */
interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
    /**
     * Determine the current state of a Deferred object.
     */
    state(): string;
    /**
     * Add handlers to be called when the Deferred object is either resolved or rejected.
     *
     * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
     * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
     */
    always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
    /**
     * Add handlers to be called when the Deferred object is resolved.
     *
     * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
     * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
     */
    done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>;
    /**
     * Add handlers to be called when the Deferred object is rejected.
     *
     * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
     * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
     */
    fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
    /**
     * Add handlers to be called when the Deferred object generates progress notifications.
     *
     * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
     */
    progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;

    /**
     * Call the progressCallbacks on a Deferred object with the given args.
     *
     * @param args Optional arguments that are passed to the progressCallbacks.
     */
    notify(value?: any, ...args: any[]): JQueryDeferred<T>;

    /**
     * Call the progressCallbacks on a Deferred object with the given context and args.
     *
     * @param context Context passed to the progressCallbacks as the this object.
     * @param args Optional arguments that are passed to the progressCallbacks.
     */
    notifyWith(context: any, value?: any[]): JQueryDeferred<T>;

    /**
     * Reject a Deferred object and call any failCallbacks with the given args.
     *
     * @param args Optional arguments that are passed to the failCallbacks.
     */
    reject(value?: any, ...args: any[]): JQueryDeferred<T>;
    /**
     * Reject a Deferred object and call any failCallbacks with the given context and args.
     *
     * @param context Context passed to the failCallbacks as the this object.
     * @param args An optional array of arguments that are passed to the failCallbacks.
     */
    rejectWith(context: any, value?: any[]): JQueryDeferred<T>;

    /**
     * Resolve a Deferred object and call any doneCallbacks with the given args.
     *
     * @param value First argument passed to doneCallbacks.
     * @param args Optional subsequent arguments that are passed to the doneCallbacks.
     */
    resolve(value?: T, ...args: any[]): JQueryDeferred<T>;

    /**
     * Resolve a Deferred object and call any doneCallbacks with the given context and args.
     *
     * @param context Context passed to the doneCallbacks as the this object.
     * @param args An optional array of arguments that are passed to the doneCallbacks.
     */
    resolveWith(context: any, value?: T[]): JQueryDeferred<T>;

    /**
     * Return a Deferred's Promise object.
     *
     * @param target Object onto which the promise methods have to be attached
     */
    promise(target?: any): JQueryPromise<T>;

    // Deprecated - given no typings
    pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
}


/**
 * Interface of the JQuery extension of the W3C event object
 */
interface BaseJQueryEventObject extends Event {
    data: any;
    delegateTarget: Element;
    isDefaultPrevented(): boolean;
    isImmediatePropagationStopped(): boolean;
    isPropagationStopped(): boolean;
    namespace: string;
    originalEvent: Event;
    preventDefault(): any;
    relatedTarget: Element;
    result: any;
    stopImmediatePropagation(): void;
    stopPropagation(): void;
    target: Element;
    pageX: number;
    pageY: number;
    which: number;
    metaKey: boolean;
}


interface JQueryInputEventObject extends BaseJQueryEventObject {
    altKey: boolean;
    ctrlKey: boolean;
    metaKey: boolean;
    shiftKey: boolean;
}


interface JQueryMouseEventObject extends JQueryInputEventObject {
    button: number;
    clientX: number;
    clientY: number;
    offsetX: number;
    offsetY: number;
    pageX: number;
    pageY: number;
    screenX: number;
    screenY: number;
}


interface JQueryKeyEventObject extends JQueryInputEventObject {
    char: any;
    charCode: number;
    key: any;
    keyCode: number;
}


interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
}


/*
 Collection of properties of the current browser
 */
interface JQuerySupport {
    ajax?: boolean;
    boxModel?: boolean;
    changeBubbles?: boolean;
    checkClone?: boolean;
    checkOn?: boolean;
    cors?: boolean;
    cssFloat?: boolean;
    hrefNormalized?: boolean;
    htmlSerialize?: boolean;
    leadingWhitespace?: boolean;
    noCloneChecked?: boolean;
    noCloneEvent?: boolean;
    opacity?: boolean;
    optDisabled?: boolean;
    optSelected?: boolean;
    scriptEval? (): boolean;
    style?: boolean;
    submitBubbles?: boolean;
    tbody?: boolean;
}


interface JQueryParam {
    /**
     * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
     *
     * @param obj An array or object to serialize.
     */
    (obj: any): string;

    /**
     * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
     *
     * @param obj An array or object to serialize.
     * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
     */
    (obj: any, traditional: boolean): string;
}


/**
 * The interface used to construct jQuery events (with $.Event). It is
 * defined separately instead of inline in JQueryStatic to allow
 * overriding the construction function with specific strings
 * returning specific event objects.
 */
interface JQueryEventConstructor {
    (name: string, eventProperties?: any): JQueryEventObject;
    new (name: string, eventProperties?: any): JQueryEventObject;
}


/**
 * The interface used to specify coordinates.
 */
interface JQueryCoordinates {
    left: number;
    top: number;
}


/**
 * Elements in the array returned by serializeArray()
 */
interface JQuerySerializeArrayElement {
    name: string;
    value: string;
}


interface JQueryAnimationOptions {
    /**
     * A string or number determining how long the animation will run.
     */
    duration?: any;
    /**
     * A string indicating which easing function to use for the transition.
     */
    easing?: string;
    /**
     * A function to call once the animation is complete.
     */
    complete?: Function;
    /**
     * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.
     */
    step?: (now: number, tween: any) => any;
    /**
     * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8)
     */
    progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
    /**
     * A function to call when the animation begins. (version added: 1.8)
     */
    start?: (animation: JQueryPromise<any>) => any;
    /**
     * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
     */
    done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
    /**
     * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
     */
    fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
    /**
     * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8)
     */
    always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
    /**
     * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it.
     */
    queue?: any;
    /**
     * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
     */
    specialEasing?: Object;
}


interface JQueryEasingFunction {
    ( percent: number ): number;
}


interface JQueryEasingFunctions {
    [ name: string ]: JQueryEasingFunction;
    linear: JQueryEasingFunction;
    swing: JQueryEasingFunction;
}


// 将html字符串解析成jQuery对象
function parseHtml(html_str: string) {
    let nodes = $.parseHTML(html_str, null, true);
    let elem;
    if (nodes.length != 1)
        elem = $(document.createElement('div')).append(nodes);
    else
        elem = $(nodes[0]);
    return elem;
}


export function getWidgetElement(spec: any) {
    if (!(spec.type in type2widget))
        throw Error("Unknown type in getWidgetElement() :" + spec.type);

    let elem = type2widget[spec.type].get_element(spec);
    if (spec.style) {
        let old_style = elem.attr('style') || '';
        elem.attr({"style": old_style + spec.style});
    }
    return elem;
}


// 将output指令的spec字段解析成html字符串
export function outputSpecToHtml(spec: any) {
    let html = '';
    try {
        let nodes = getWidgetElement(spec);
        for (let node of nodes)
            html += node.outerHTML || '';
    } catch (e) {
        console.error('Get sub widget html error,', e, spec);
    }
    return html;
}


/*
* 当前限制
* 若Widget被作为其他Widget的子项时，该Widget中绑定的事件将会失效
* */
export interface Widget {
    handle_type: string;

    get_element(spec: any): JQuery;
}


interface itemType {
            data: string,
            col?: number,
            row?: number
        }


declare function SimpleSelect(props: SimpleSelectProps & React.RefAttributes<HTMLInputElement>): JSX.Element;


export interface SimpleSelectProps extends FormInputPropTypes {
  /** Child components (such as Option or OptionRow) for the SelectList */
  children: React.ReactNode;
  /** The default selected value(s), when the component is operating in uncontrolled mode */
  defaultValue?: string | object;
  /** Boolean to toggle where SelectList is rendered in relation to the Select Input */
  disablePortal?: boolean;
  /** If true the loader animation is displayed in the option list */
  isLoading?: boolean;
  /** When true component will work in multi column mode.
   * Children should consist of OptionRow components in this mode
   */
  multiColumn?: boolean;
  /** A callback that is triggered when a user scrolls to the bottom of the list */
  onListScrollBottom?: () => void;
  /** A custom callback for when the dropdown menu opens */
  onOpen?: () => void;
  /** If true the Component opens on focus */
  openOnFocus?: boolean;
  /** A custom message to be displayed when any option does not match the filter text */
  noResultsMessage?: string;
  /** SelectList table header, should consist of multiple th elements.
   * Works only in multiColumn mode
   */
  tableHeader?: React.ReactNode;
  /** If true the component input has no border and is transparent */
  transparent?: boolean;
  /** The selected value(s), when the component is operating in controlled mode */
  value?: string | object;
}


(flag: string): boolean => {
  const context = useContext(ReactSimpleFlagsContext)
  if (!context) return false

  const match = context?.find((f) => f.name === flag)

  if (!match) return false

  return Boolean(match.enabled)
}


(f) => f.name === flag


({
    authData,
    authRoute,
    children,
}) => {
    return (
        <AuthStateContext.Provider
            value={{
                authData,
                authRoute: authRoute ?? AuthRoute.SignIn,
                dispatchAuthState,
            }}