(query: Q): Condition {\n const conditions = [];\n const keys = this._objectKeys(query);\n\n this._documentInstructionContext.query = query;\n\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n const value = query[key];\n const instruction = this._instructions[key];\n\n if (instruction) {\n if (instruction.type !== 'document' && instruction.type !== 'compound') {\n throw new Error(`Cannot use parsing instruction for operator \"${key}\" in \"document\" context as it is supposed to be used in \"${instruction.type}\" context`);\n }\n\n pushIfNonNullCondition(\n conditions,\n this.parseInstruction(instruction, value, this._documentInstructionContext)\n );\n } else if (this._fieldInstructionContext.hasOperators(value)) {\n conditions.push(...this.parseFieldOperators(key, value));\n } else {\n pushIfNonNullCondition(\n conditions,\n this.parseField(key, this._options.defaultOperatorName, value, query)\n );\n }\n }\n\n return this._options.mergeFinalConditions(conditions);\n }\n}\n","import { Condition } from './Condition';\n\ntype ArgsExceptLastany> =\n F extends (a: any, c: any) => any\n ? Parameters<(condition: Condition) => 0>\n : F extends (a: any, b: any, c: any) => any\n ? Parameters<(condition: Condition, value: Parameters [1]) => 0>\n : Parameters<(\n condition: Condition,\n value: Parameters [1],\n options: Parameters [2],\n ...args: unknown[]\n ) => 0>;\n\nexport type Interpreter = (condition: T, ...args: any[]) => R;\nexport type AnyInterpreter = Interpreter ;\nexport interface InterpretationContext {\n interpret(...args: ArgsExceptLast ): ReturnType ;\n}\n\nfunction getInterpreter >(\n interpreters: T,\n operator: keyof T\n) {\n const interpret = interpreters[operator];\n\n if (typeof interpret !== 'function') {\n throw new Error(`Unable to interpret \"${operator}\" condition. Did you forget to register interpreter for it?`);\n }\n\n return interpret;\n}\n\nexport interface InterpreterOptions {\n numberOfArguments?: 1 | 2 | 3\n getInterpreterName?(condition: Condition, context: this): string\n}\n\nfunction defaultInterpreterName(condition: Condition) {\n return condition.operator;\n}\n\nexport function createInterpreter (\n interpreters: Record ,\n rawOptions?: U\n) {\n const options = rawOptions as U & InterpreterOptions;\n const getInterpreterName = options && options.getInterpreterName || defaultInterpreterName;\n let interpret;\n\n switch (options ? options.numberOfArguments : 0) {\n case 1:\n interpret = ((condition) => {\n const interpreterName = getInterpreterName(condition, options);\n const interpretOperator = getInterpreter(interpreters, interpreterName);\n return interpretOperator(condition, defaultContext); // eslint-disable-line @typescript-eslint/no-use-before-define\n }) as InterpretationContext ['interpret'];\n break;\n case 3:\n interpret = ((condition, value, params) => {\n const interpreterName = getInterpreterName(condition, options);\n const interpretOperator = getInterpreter(interpreters, interpreterName);\n return interpretOperator(condition, value, params, defaultContext); // eslint-disable-line @typescript-eslint/no-use-before-define\n }) as InterpretationContext ['interpret'];\n break;\n default:\n interpret = ((condition, value) => {\n const interpreterName = getInterpreterName(condition, options);\n const interpretOperator = getInterpreter(interpreters, interpreterName);\n return interpretOperator(condition, value, defaultContext); // eslint-disable-line @typescript-eslint/no-use-before-define\n }) as InterpretationContext ['interpret'];\n break;\n }\n\n const defaultContext = {\n ...options,\n interpret,\n } as InterpretationContext & U;\n\n return defaultContext.interpret;\n}\n","import { ObjectQueryParser } from './parsers/ObjectQueryParser';\n\nexport * from './Condition';\nexport * from './types';\nexport * from './interpreter';\nexport * from './translator';\nexport * from './builder';\nexport {\n isCompound,\n hasOperators,\n identity,\n object,\n optimizedCompoundCondition,\n ignoreValue,\n} from './utils';\nexport type {\n IgnoreValue\n} from './utils';\nexport * from './parsers/ObjectQueryParser';\nexport * from './parsers/defaultInstructionParsers';\n/**\n * @deprecated use `ObjectQueryParser#parseInstruction` instead\n * TODO(major): remove\n */\nexport const parseInstruction = (ObjectQueryParser.prototype as any).parseInstruction;\n","import {\n CompoundCondition,\n FieldCondition,\n NamedInstruction,\n CompoundInstruction,\n FieldInstruction,\n DocumentInstruction,\n Comparable,\n ITSELF,\n NULL_CONDITION,\n FieldParsingContext,\n optimizedCompoundCondition,\n ObjectQueryFieldParsingContext,\n} from '@ucast/core';\nimport { MongoQuery } from './types';\n\nfunction ensureIsArray(instruction: NamedInstruction, value: unknown) {\n if (!Array.isArray(value)) {\n throw new Error(`\"${instruction.name}\" expects value to be an array`);\n }\n}\n\nfunction ensureIsNonEmptyArray(instruction: NamedInstruction, value: unknown[]) {\n ensureIsArray(instruction, value);\n\n if (!value.length) {\n throw new Error(`\"${instruction.name}\" expects to have at least one element in array`);\n }\n}\n\nfunction ensureIsComparable(instruction: NamedInstruction, value: string | number | Date) {\n const isComparable = typeof value === 'string' || typeof value === 'number' || value instanceof Date;\n\n if (!isComparable) {\n throw new Error(`\"${instruction.name}\" expects value to be comparable (i.e., string, number or date)`);\n }\n}\n\nconst ensureIs = (type: string) => (instruction: NamedInstruction, value: unknown) => {\n if (typeof value !== type) { // eslint-disable-line valid-typeof\n throw new Error(`\"${instruction.name}\" expects value to be a \"${type}\"`);\n }\n};\n\nexport const $and: CompoundInstruction []> = {\n type: 'compound',\n validate: ensureIsNonEmptyArray,\n parse(instruction, queries, { parse }) {\n const conditions = queries.map(query => parse(query));\n return optimizedCompoundCondition(instruction.name, conditions);\n }\n};\nexport const $or = $and;\nexport const $nor: CompoundInstruction []> = {\n type: 'compound',\n validate: ensureIsNonEmptyArray,\n};\n\nexport const $not: FieldInstruction | RegExp> = {\n type: 'field',\n validate(instruction, value) {\n const isValid = value && (value instanceof RegExp || value.constructor === Object);\n\n if (!isValid) {\n throw new Error(`\"${instruction.name}\" expects to receive either regular expression or object of field operators`);\n }\n },\n parse(instruction, value, context) {\n const condition = value instanceof RegExp\n ? new FieldCondition('regex' as typeof instruction.name, context.field, value)\n : context.parse(value, context);\n\n return new CompoundCondition(instruction.name, [condition]);\n },\n};\nexport const $elemMatch: FieldInstruction , ObjectQueryFieldParsingContext> = {\n type: 'field',\n validate(instruction, value) {\n if (!value || value.constructor !== Object) {\n throw new Error(`\"${instruction.name}\" expects to receive an object with nested query or field level operators`);\n }\n },\n parse(instruction, value, { parse, field, hasOperators }) {\n const condition = hasOperators(value) ? parse(value, { field: ITSELF }) : parse(value);\n return new FieldCondition(instruction.name, field, condition);\n }\n};\n\nexport const $size: FieldInstruction = {\n type: 'field',\n validate: ensureIs('number')\n};\nexport const $in: FieldInstruction = {\n type: 'field',\n validate: ensureIsArray,\n};\nexport const $nin = $in;\nexport const $all = $in;\nexport const $mod: FieldInstruction<[number, number]> = {\n type: 'field',\n validate(instruction, value) {\n if (!Array.isArray(value) || value.length !== 2) {\n throw new Error(`\"${instruction.name}\" expects an array with 2 numeric elements`);\n }\n }\n};\n\nexport const $exists: FieldInstruction = {\n type: 'field',\n validate: ensureIs('boolean'),\n};\n\nexport const $gte: FieldInstruction = {\n type: 'field',\n validate: ensureIsComparable\n};\nexport const $gt = $gte;\nexport const $lt = $gt;\nexport const $lte = $gt;\n\nexport const $eq: FieldInstruction = {\n type: 'field',\n};\nexport const $ne = $eq;\n\nexport interface RegExpFieldContext extends FieldParsingContext {\n query: {\n $options?: string\n }\n}\n\nexport const $regex: FieldInstruction = {\n type: 'field',\n validate(instruction, value) {\n if (!(value instanceof RegExp) && typeof value !== 'string') {\n throw new Error(`\"${instruction.name}\" expects value to be a regular expression or a string that represents regular expression`);\n }\n },\n parse(instruction, rawValue, context) {\n const value = typeof rawValue === 'string'\n ? new RegExp(rawValue, context.query.$options || '')\n : rawValue;\n return new FieldCondition(instruction.name, context.field, value);\n }\n};\nexport const $options: FieldInstruction = {\n type: 'field',\n parse: () => NULL_CONDITION,\n};\n\nexport const $where: DocumentInstruction<() => boolean> = {\n type: 'document',\n validate: ensureIs('function'),\n};\n","import {\n Condition,\n buildAnd as and,\n ParsingInstruction,\n ObjectQueryParser,\n FieldQueryOperators,\n} from '@ucast/core';\nimport { MongoQuery } from './types';\n\nexport interface ParseOptions {\n field: string\n}\n\nexport class MongoQueryParser extends ObjectQueryParser > {\n constructor(instructions: Record ) {\n super(instructions, {\n defaultOperatorName: '$eq',\n operatorToConditionName: name => name.slice(1),\n });\n }\n\n parse , FQ extends FieldQueryOperators= FieldQueryOperators>(\n query: Q | FQ,\n options?: ParseOptions\n ): Condition {\n if (options && options.field) {\n return and(this.parseFieldOperators(options.field, query as FQ));\n }\n\n return super.parse(query);\n }\n}\n","import * as instructions from './instructions';\n\nexport const allParsingInstructions = instructions;\nexport * from './instructions';\nexport * from './MongoQueryParser';\nexport * from './types';\nexport { defaultInstructionParsers as defaultParsers } from '@ucast/core';\n","import { FieldCondition } from '@ucast/core';\nimport { JsInterpretationOptions, JsInterpreter } from './types';\n\nexport type AnyObject = Record;\nexport type GetField = (object: any, field: string) => any;\n\nexport function includes (\n items: T[],\n value: T,\n compare: JsInterpretationOptions['compare']\n): boolean {\n for (let i = 0, length = items.length; i < length; i++) {\n if (compare(items[i], value) === 0) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function isArrayAndNotNumericField (object: T | T[], field: string): object is T[] {\n return Array.isArray(object) && Number.isNaN(Number(field));\n}\n\nfunction getField (object: T | T[], field: string, get: GetField) {\n if (!isArrayAndNotNumericField(object, field)) {\n return get(object, field);\n }\n\n let result: unknown[] = [];\n\n for (let i = 0; i < object.length; i++) {\n const value = get(object[i], field);\n if (typeof value !== 'undefined') {\n result = result.concat(value);\n }\n }\n\n return result;\n}\n\nexport function getValueByPath(object: AnyObject, field: string, get: GetField) {\n if (field.indexOf('.') === -1) {\n return getField(object, field, get);\n }\n\n const paths = field.split('.');\n let value = object;\n\n for (let i = 0, length = paths.length; i < length; i++) {\n value = getField(value, paths[i], get);\n\n if (!value || typeof value !== 'object') {\n return value;\n }\n }\n\n return value;\n}\n\nexport function testValueOrArray (test: JsInterpreter , U>) {\n return ((node, object, context) => {\n const value = context.get(object, node.field);\n\n if (!Array.isArray(value)) {\n return test(node, value, context);\n }\n\n return value.some(v => test(node, v, context));\n }) as JsInterpreter , AnyObject | U>;\n}\n","import { createInterpreter, ITSELF } from '@ucast/core';\nimport { getValueByPath, AnyObject, GetField } from './utils';\nimport { JsInterpretationOptions, JsInterpreter } from './types';\n\nconst defaultGet = (object: AnyObject, field: string) => object[field];\ntype Field = string | typeof ITSELF;\n\nexport function getObjectFieldCursor (object: T, path: string, get: GetField) {\n const dotIndex = path.lastIndexOf('.');\n\n if (dotIndex === -1) {\n return [object, path] as const;\n }\n\n return [\n get(object, path.slice(0, dotIndex)) as T,\n path.slice(dotIndex + 1)\n ] as const;\n}\n\nexport function getObjectField(object: unknown, field: Field, get: GetField = defaultGet) {\n if (field === ITSELF) {\n return object;\n }\n\n if (!object) {\n throw new Error(`Unable to get field \"${field}\" out of ${String(object)}.`);\n }\n\n return getValueByPath(object as Record , field, get);\n}\n\nexport function createGetter (get: T) {\n return (object: Parameters [0], field: Parameters [1]) => getObjectField(object, field, get);\n}\n\nexport function compare (a: T, b: T): 0 | 1 | -1 {\n if (a === b) {\n return 0;\n }\n\n return a > b ? 1 : -1;\n}\n\nexport function createJsInterpreter<\n T extends JsInterpreter ,\n O extends Partial \n>(\n operators: Record ,\n options: O = {} as O\n) {\n return createInterpreter(operators, {\n get: getObjectField,\n compare,\n ...options,\n });\n}\n","import { Condition } from './Condition';\nimport { Parse } from './types';\nimport { AnyInterpreter } from './interpreter';\n\ntype Bound = T extends (first: Condition, ...args: infer A) => any\n ? { (...args: A): ReturnType , ast: Condition }\n : never;\n\nexport function createTranslatorFactory (\n parse: Parse ,\n interpret: Interpreter\n) {\n return (query: Lang, ...args: unknown[]): Bound => {\n const ast = parse(query, ...args);\n const translate = (interpret as any).bind(null, ast);\n translate.ast = ast;\n return translate;\n };\n}\n","import {\n CompoundCondition as Compound,\n FieldCondition as Field,\n DocumentCondition as Document,\n Condition,\n Comparable,\n ITSELF,\n} from '@ucast/core';\nimport { JsInterpreter as Interpret } from './types';\nimport {\n includes,\n testValueOrArray,\n isArrayAndNotNumericField,\n AnyObject,\n} from './utils';\nimport { getObjectFieldCursor } from './interpreter';\n\nexport const or: Interpret = (node, object, { interpret }) => {\n return node.value.some(condition => interpret(condition, object));\n};\n\nexport const nor: typeof or = (node, object, context) => {\n return !or(node, object, context);\n};\n\nexport const and: Interpret = (node, object, { interpret }) => {\n return node.value.every(condition => interpret(condition, object));\n};\n\nexport const not: Interpret = (node, object, { interpret }) => {\n return !interpret(node.value[0], object);\n};\n\nexport const eq: Interpret = (node, object, { compare, get }) => {\n const value = get(object, node.field);\n\n if (Array.isArray(value) && !Array.isArray(node.value)) {\n return includes(value, node.value, compare);\n }\n\n return compare(value, node.value) === 0;\n};\n\nexport const ne: typeof eq = (node, object, context) => {\n return !eq(node, object, context);\n};\n\nexport const lte = testValueOrArray ((node, value, context) => {\n const result = context.compare(value, node.value);\n return result === 0 || result === -1;\n});\n\nexport const lt = testValueOrArray ((node, value, context) => {\n return context.compare(value, node.value) === -1;\n});\nexport const gt = testValueOrArray ((node, value, context) => {\n return context.compare(value, node.value) === 1;\n});\nexport const gte = testValueOrArray ((node, value, context) => {\n const result = context.compare(value, node.value);\n return result === 0 || result === 1;\n});\n\nexport const exists: Interpret > = (node, object, { get }) => {\n if (node.field === ITSELF) {\n return typeof object !== 'undefined';\n }\n\n const [item, field] = getObjectFieldCursor<{}>(object, node.field, get);\n const test = (value: {}) => !!value && value.hasOwnProperty(field) === node.value;\n\n return isArrayAndNotNumericField(item, field) ? item.some(test) : test(item);\n};\n\nexport const mod = testValueOrArray<[number, number], number>((node, value) => {\n return typeof value === 'number' && value % node.value[0] === node.value[1];\n});\n\nexport const size: Interpret , AnyObject | unknown[]> = (node, object, { get }) => {\n const [items, field] = getObjectFieldCursor(object as AnyObject, node.field, get);\n const test = (item: unknown) => {\n const value = get(item, field);\n return Array.isArray(value) && value.length === node.value;\n };\n\n return node.field !== ITSELF && isArrayAndNotNumericField(items, field)\n ? items.some(test)\n : test(items);\n};\n\nexport const regex = testValueOrArray ((node, value) => {\n return typeof value === 'string' && node.value.test(value);\n});\n\nexport const within = testValueOrArray ((node, object, { compare }) => {\n return includes(node.value, object, compare);\n});\n\nexport const nin: typeof within = (node, object, context) => !within(node, object, context);\n\nexport const all: Interpret > = (node, object, { compare, get }) => {\n const value = get(object, node.field);\n return Array.isArray(value) && node.value.every(v => includes(value, v, compare));\n};\n\nexport const elemMatch: Interpret > = (node, object, { interpret, get }) => {\n const value = get(object, node.field);\n return Array.isArray(value) && value.some(v => interpret(node.value, v));\n};\n\ntype WhereFunction = (this: AnyObject) => boolean;\nexport const where: Interpret , AnyObject> = (node, object) => {\n return node.value.call(object);\n};\n","import { createJsInterpreter } from './interpreter';\nimport * as interpreters from './interpreters';\n\nexport const allInterpreters = {\n ...interpreters,\n in: interpreters.within,\n};\nexport const interpret = createJsInterpreter(allInterpreters);\n","import { createTranslatorFactory, ParsingInstruction, Condition, ITSELF } from '@ucast/core';\nimport {\n MongoQuery,\n MongoQueryParser,\n MongoQueryFieldOperators,\n allParsingInstructions,\n defaultParsers\n} from '@ucast/mongo';\nimport {\n createJsInterpreter,\n allInterpreters,\n JsInterpreter,\n JsInterpretationOptions,\n compare\n} from '@ucast/js';\n\ntype ThingFilter = {\n (object: T): boolean\n ast: Condition\n};\n\ninterface HasToJSON {\n toJSON(): unknown\n}\n\nfunction toPrimitive(value: unknown) {\n if (value instanceof Date) {\n return value.getTime();\n }\n\n if (value && typeof (value as HasToJSON).toJSON === 'function') {\n return (value as HasToJSON).toJSON();\n }\n\n return value;\n}\n\nconst comparePrimitives: typeof compare = (a, b) => compare(toPrimitive(a), toPrimitive(b));\n\nexport interface FactoryOptions extends JsInterpretationOptions {\n forPrimitives: boolean\n}\n\nexport type Filter = <\n T = Record ,\n Q extends MongoQuery = MongoQuery \n>(query: Q) => ThingFilter ;\n\nexport type PrimitiveMongoQuery = MongoQueryFieldOperators & Partial<{\n $and: MongoQueryFieldOperators [],\n $or: MongoQueryFieldOperators [],\n $nor: MongoQueryFieldOperators []\n}>;\nexport type PrimitiveFilter = <\n T,\n Q extends PrimitiveMongoQuery = PrimitiveMongoQuery \n>(query: Q) => ThingFilter ;\n\ntype FilterType = T['forPrimitives'] extends true\n ? PrimitiveFilter\n : Filter;\n\nexport function createFactory<\n T extends Record >,\n I extends Record >,\n P extends { forPrimitives?: true }\n>(instructions: T, interpreters: I, options?: Partial & P): FilterType {\n const parser = new MongoQueryParser(instructions);\n const interpret = createJsInterpreter(interpreters, {\n compare: comparePrimitives,\n ...options\n });\n\n if (options && options.forPrimitives) {\n const params = { field: ITSELF };\n const parse = parser.parse;\n parser.setParse(query => parse(query, params));\n }\n\n return createTranslatorFactory(parser.parse, interpret) as any;\n}\n\nexport const guard = createFactory(allParsingInstructions, allInterpreters);\n\nconst compoundOperators = ['$and', '$or'] as const;\nconst allPrimitiveParsingInstructions = compoundOperators.reduce((instructions, name) => {\n instructions[name] = { ...instructions[name], type: 'field' } as any;\n return instructions;\n}, {\n ...allParsingInstructions,\n $nor: {\n ...allParsingInstructions.$nor,\n type: 'field',\n parse: defaultParsers.compound\n }\n});\n\nexport const squire = createFactory(allPrimitiveParsingInstructions, allInterpreters, {\n forPrimitives: true\n});\nexport const filter = guard; // TODO: remove in next major version\n","import { createMongoAbility } from \"@casl/ability\";\nimport { AbilityBuilder } from '@casl/ability';\n\nexport const ability = new createMongoAbility();\n\nexport function convertAbility(data) {\n const { can, rules } = new AbilityBuilder();\n data.forEach((m) => {\n can(m.roleFeatures.code, m.customRoles.masterRoles.code)\n });\n return rules;\n}","import clsx from \"clsx\";\n\nconst BoldCloseIcon = ({ color = \"#585550\", height = '0.875rem', width = '0.875rem', className, ...props }) => (\n \n);\n\nexport default BoldCloseIcon;\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nfunction CalendarIcon({className, ...props}) {\n return (\n \n );\n}\n\nCalendarIcon.propTypes = {\n className: PropTypes.string,\n};\n\nCalendarIcon.defaultProps = {\n className: 'fill-current text-dawn-gray',\n};\n\nexport default CalendarIcon;\n","import clsx from 'clsx';\n\nfunction CheckBoxIcon({className, size = 'w-9 h-9', color='#D1C7BB', ...props}) {\n return (\n \n );\n}\n\nexport default CheckBoxIcon;\n","import clsx from \"clsx\";\n\nfunction CloseIcon({ color, className, size = \"w-7 h-7\", ...props }) {\n return (\n \n );\n}\n\nexport default CloseIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction EditIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default EditIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction InfoIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default InfoIcon;\n","import clsx from 'clsx';\n\nconst LogoIcon = ({size = 'w-16 h-16', className, ...props}) => (\n \n);\n\nexport default LogoIcon;\n","import clsx from \"clsx\";\n\nfunction PlusSignIcon({ className, ...props }) {\n return (\n \n );\n}\n\nexport default PlusSignIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction SettingsIcon({className, color='#585550', ...props}) {\n return (\n \n );\n}\n\nexport default SettingsIcon;\n","import clsx from 'clsx';\n\nfunction TemplateIcon({ className, color, ...props }) {\n return (\n <>\n \n >\n );\n}\n\nexport default TemplateIcon;\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nfunction TrashIcon({className, ...props}) {\n return (\n \n );\n}\n\nTrashIcon.propTypes = {\n className: PropTypes.string,\n};\n\nTrashIcon.defaultProps = {\n className: 'fill-current text-pepper',\n};\n\nexport default TrashIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction VideoIcon({className, size='w-7 h-5', color, ...props}) {\n return (\n \n );\n}\n\nexport default VideoIcon;\n","import * as React from \"react\";\nimport clsx from \"clsx\";\n\nfunction ArrowIcon({ color, className, ...props }) {\n return (\n \n );\n}\n\nexport default ArrowIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction EyeIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default EyeIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction ChatRoomsIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default ChatRoomsIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction SmallArrowIcon({className, stroke = '#999', ...props}) {\n return (\n \n );\n}\n\nexport default SmallArrowIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction PictureAddIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default PictureAddIcon;\n","import React from 'react';\nimport clsx from 'clsx';\n\nfunction InboxIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default InboxIcon;\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nfunction ChatIcon({className, ...props}) {\n return (\n \n );\n}\n\nChatIcon.propTypes = {\n className: PropTypes.string,\n};\n\nChatIcon.defaultProps = {\n className: 'fill-current text-dawn-gray',\n};\n\nexport default ChatIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction UserIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default UserIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction LogoutIcon({className, stroke = '#EE6A5F', ...props}) {\n return (\n \n );\n}\n\nexport default LogoutIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction DotCircle({className, ...props}) {\n return (\n \n );\n}\n\nexport default DotCircle;\n","import clsx from 'clsx';\n\nfunction ArrowLeftIcon({className, ...props}) {\n return (\n \n\n );\n}\n\nexport default ArrowLeftIcon;\n","import clsx from 'clsx';\n\nfunction ArrowRightIcon({className, color, ...props}) {\n return (\n \n );\n}\n\nexport default ArrowRightIcon;\n","import clsx from \"clsx\";\n\nfunction CheckboxUnchecked({\n className,\n size = \"w-9 h-9\",\n color = \"#D1C7BB\",\n ...props\n}) {\n return (\n \n );\n}\n\nexport default CheckboxUnchecked;\n","import clsx from 'clsx';\n\nfunction WriteMessageIcon({className,color='#FCB96B', ...props}) {\n return (\n \n );\n}\n\nexport default WriteMessageIcon;\n","import clsx from 'clsx';\n\nfunction VerticalDotsIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default VerticalDotsIcon;\n","import clsx from 'clsx';\n\nfunction ArrowUpIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default ArrowUpIcon;\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nfunction CheckIcon({className, stroke, ...props}) {\n return (\n \n );\n}\n\nCheckIcon.propTypes = {\n stroke: PropTypes.string,\n};\n\nCheckIcon.defaultProps = {\n stroke: '#FEB95C',\n};\n\nexport default CheckIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction MicrophoneIcon({className, color, ...props}) {\n return (\n \n );\n}\n\nexport default MicrophoneIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction MicrophoneCrossedIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default MicrophoneCrossedIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction PhoneIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default PhoneIcon;\n","import * as React from 'react';\n\nfunction VideoCrossedIcon(props) {\n return (\n \n );\n}\n\nexport default VideoCrossedIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction FileIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default FileIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction SurveyArrowIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default SurveyArrowIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction FileTextIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default FileTextIcon;\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nfunction ArchiveIcon({className, ...props}) {\n return (\n \n );\n}\n\nArchiveIcon.propTypes = {\n className: PropTypes.string,\n};\n\nArchiveIcon.defaultProps = {\n className: 'fill-current text-dawn-gray',\n};\n\nexport default ArchiveIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction SearchIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default SearchIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst StatisticsIcon = ({className, ...props}) => (\n \n);\n\nexport default StatisticsIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst ManyUsersIcon = ({className, color=\"none\",...props}) => (\n \n);\n\nexport default ManyUsersIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst FilterIcon = ({className, ...props}) => (\n \n);\n\nexport default FilterIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst DotsIcon = ({className, ...props}) => (\n \n);\n\nexport default DotsIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst PencilIcon = ({className, ...props}) => (\n \n);\n\nexport default PencilIcon;\n","import clsx from 'clsx';\n\nfunction NoteIcon({className, ...props}) {\n return (\n \n\n );\n}\n\nexport default NoteIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst DisableIcon = ({className, ...props}) => (\n \n);\n\nexport default DisableIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst SettingsNavbarIcon = ({className, ...props}) => (\n \n);\n\nexport default SettingsNavbarIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nconst CameraBlockIcon = ({className, ...props}) => (\n \n);\n\nexport default CameraBlockIcon;\n","import * as React from 'react';\n\nconst SvgComponent = (props) => (\n \n);\n\nexport default SvgComponent;\n","import * as React from 'react';\n\nconst SvgComponent = (props) => (\n \n);\n\nexport default SvgComponent;\n","import * as React from 'react';\n\nconst SvgComponent = (props) => (\n \n);\n\nexport default SvgComponent;\n","import clsx from 'clsx';\n\nconst SelectArrow = ({className, ...props}) => (\n \n);\n\nexport default SelectArrow;\n","import * as React from 'react';\n\nconst AppStoreIcon = ({width = 30, height = 30, ...props}) => (\n \n);\n\nexport default AppStoreIcon;\n","import * as React from 'react';\n\nconst GooglePlayIcon = ({width = 30, height = 30, ...props}) => (\n \n);\n\nexport default GooglePlayIcon;\n","import clsx from 'clsx';\n\nfunction SecureIcon({className, ...props}) {\n return (\n \n );\n}\n\nexport default SecureIcon;\n","import * as React from 'react';\nimport clsx from 'clsx';\n\nfunction CopyIcon({\n color, className, ...props\n}) {\n return (\n \n );\n}\n\nexport default CopyIcon;\n","import React from \"react\";\nimport clsx from 'clsx';\n\n\nfunction CompleteSurveyIcon({\n width = 35,\n height = 35,\n color = \"#585550\",\n xml: space = \"preserve\",\n className,\n ...props\n}) {\n return (\n \n );\n}\n\nexport default CompleteSurveyIcon;\n","import * as React from 'react';\n\nconst CertifiedIcon = ({width = 40, height = 45, ...props}) => (\n \n);\n\nexport default CertifiedIcon;\n","import clsx from \"clsx\";\n\nconst SendEmailIcon = ({ className, ...props }) => (\n \n);\n\nexport default SendEmailIcon;\n","function SvgComponent() {\n return (\n \n );\n}\n\nexport default SvgComponent;\n","function SvgComponent() {\n return (\n \n );\n}\n\nexport default SvgComponent;\n","function SurveyIntroAllbry() {\n return (\n \n );\n}\n\nexport default SurveyIntroAllbry;\n","function SurveyOutroAllbry() {\n return (\n \n );\n}\n\nexport default SurveyOutroAllbry;\n","function SvgComponent() {\n return (\n \n );\n}\n\nexport default SvgComponent;\n","function SvgComponent() {\n return (\n \n );\n}\n\nexport default SvgComponent;\n","function SvgComponent() {\n return (\n \n );\n}\n\nexport default SvgComponent;\n","// extracted by mini-css-extract-plugin\nexport default {\"topicAccordion\":\"AccordionCustom_topicAccordion__1Yzd6\"};","import { Accordion, AccordionTab } from \"primereact/accordion\";\nimport styles from \"./AccordionCustom.module.scss\";\nimport clsx from \"clsx\";\nconst AccordionCustom = ({\n children,\n multiple = false,\n activeIndex,\n onTabChange = () => {},\n width = \"57.313rem\",\n}) => {\n return (\n
\n\n );\n};\nexport default AccordionCustom;","import React from 'react';\nimport {Link} from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nconst CustomLink = ({\n to, className, children, ...props\n}) => {\n const defaultClasses = 'hover:opacity-70 transition duration-30';\n return (\n \n {children}\n \n );\n};\n\nCustomLink.propTypes = {\n to: PropTypes.string.isRequired,\n};\n\nexport default CustomLink;\n","// extracted by mini-css-extract-plugin\nexport default {\"custom\":\"Button_custom__rdyxA\",\"modal\":\"Button_modal__PJWqM\",\"default\":\"Button_default__d5avx\",\"withoutBg\":\"Button_withoutBg__po2vZ\",\"secondary\":\"Button_secondary__eQnQJ\",\"disabled\":\"Button_disabled__nKJlH\",\"empty\":\"Button_empty__Khs6a\",\"empty-borderless\":\"Button_empty-borderless__PplGJ\",\"edit\":\"Button_edit__h36kN\",\"astext\":\"Button_astext__LX3ZA\"};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport {Link} from 'react-router-dom';\nimport Loader from '@components/Loader';\nimport styles from './Button.module.scss';\n\nconst TypeBtn = ({option, ...props}) => {\n if (option === 'link') return ;\n if (option === 'div') return ;\n\n return ;\n};\n\nconst Button = ({\n variant = 'default', className, isDisabled, isLoading, children, ...props\n}) => (\n\n {children}\n \n\n {isLoading && \n);\n\nButton.propTypes = {\n variant: PropTypes.oneOf(['default', 'empty', 'disabled', 'custom', 'edit', 'empty-borderless', 'secondary', 'astext', 'modal', 'withoutBg']),\n option: PropTypes.oneOf(['link', 'button', 'div']),\n isDisabled: PropTypes.bool,\n};\n\nButton.defaultProps = {\n variant: 'default',\n option: 'button',\n isDisabled: false,\n};\n\nexport default Button;\n","// extracted by mini-css-extract-plugin\nexport default {\"default\":\"ButtonGroupItem_default__gcaqj\",\"selected\":\"ButtonGroupItem_selected__iLf+T\",\"report\":\"ButtonGroupItem_report__tIR2B\",\"reportSelected\":\"ButtonGroupItem_reportSelected__dfpw9\"};","import PropTypes from 'prop-types';\nimport {useTranslation} from 'react-i18next';\nimport {AnimatePresence, motion} from 'framer-motion';\n\nimport styles from './ButtonGroupItem.module.scss';\n\nconst ButtonGroupItem = ({\n label, isChecked, onClick, variant, variantSelected, animationDelay,\n}) => {\n const {t} = useTranslation();\n const selectedStyle = variantSelected ? styles[variantSelected] : styles.selected;\n\n return (\n}\n \n {children}\n\n\n \n );\n};\n\nButtonGroupItem.propTypes = {\n label: PropTypes.string,\n isChecked: PropTypes.bool,\n onClick: PropTypes.func,\n variant: PropTypes.oneOf(['default', 'report']),\n variantSelected: PropTypes.oneOf(['selected', 'reportSelected']),\n animationDelay: PropTypes.number,\n};\n\nButtonGroupItem.defaultProps = {\n label: '',\n isChecked: false,\n onClick: () => {},\n variant: 'default',\n variantSelected: 'selected',\n animationDelay: 0,\n};\n\nexport default ButtonGroupItem;\n","// extracted by mini-css-extract-plugin\nexport default {\"list\":\"Dropdown_list__BGV8Q\",\"hideWithScrollbar\":\"Dropdown_hideWithScrollbar__q6Ekc\"};","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useOutside } from \"@hooks/useOutside\";\nimport { Element, scroller } from \"react-scroll/modules\";\nimport { Check, SmallArrow } from \"@assets/icons\";\nimport clsx from \"clsx\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport useDeferredRenderEffect from \"@hooks/useDifferredRenderEffects\";\nimport styles from \"./Dropdown.module.scss\";\n\nconst Dropdown = ({\n onChange,\n classSelect,\n label,\n options,\n scrollID = \"default\",\n error,\n value,\n className,\n placeholder,\n writableDropdown,\n}) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const [inputValue, setInputValue] = useState(value || \"\");\n const [localOptions, setLocalOptions] = useState(options);\n\n useEffect(() => {\n if (value === \"\") {\n setInputValue(\"\");\n }\n }, [value]);\n\n const wrapperRef = useRef(null);\n useOutside(wrapperRef, setIsOpen);\n\n const scroll = (fieldName) => {\n scroller.scrollTo(`value-${fieldName}`, {\n duration: 300,\n smooth: true,\n containerId: `dropdown-${scrollID}`,\n offset: -5,\n });\n };\n\n useEffect(() => {\n setLocalOptions(options);\n }, [options]);\n\n const viewLabel = useCallback(() => {\n if (value || value === 0) {\n return (\n \n {localOptions.find((v) => v.value === value)?.label}\n \n );\n }\n if (placeholder) {\n return {placeholder};\n }\n return - ;\n }, [value, placeholder, options]);\n\n useDeferredRenderEffect(() => {\n if (value && isOpen) {\n scroll(value);\n }\n }, [value, isOpen]);\n\n const onClick = (option) => {\n if (!option?.value) {\n return;\n }\n setInputValue(option.label); // Set input value based on the selected option\n onChange(option);\n setIsOpen(false);\n };\n\n const handleInputChange = (e) => {\n const typedValue = e.target.value;\n setInputValue(typedValue);\n\n if (!typedValue) {\n setLocalOptions(options); // Reset options when input is cleared\n } else {\n // Filter the options based on the typed value\n const filteredOptions = options.filter((option) =>\n option.label.toLowerCase().includes(typedValue.toLowerCase())\n );\n setLocalOptions(filteredOptions);\n }\n };\n\n return (\n\n {t(label)}\n \n\n {!!label &&\n );\n};\nexport default Dropdown;\n","// extracted by mini-css-extract-plugin\nexport default {\"input\":\"Input_input__iWK-F\",\"input-field\":\"Input_input-field__WeD3s\",\"search\":\"Input_search__2FP80\",\"search-field\":\"Input_search-field__TnGVl\",\"gray\":\"Input_gray__Yt4VS\",\"gray-field\":\"Input_gray-field__CsmBx\"};","import { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\n\nimport { Eye, Search } from \"@assets/icons\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport styles from \"./Input.module.scss\";\n\n// Add new icon to this object\nconst icons = {\n eye: Eye,\n search: Search,\n};\n\nconst Icon = ({ icon, ...props }) => {\n const ViewIcon = icons[icon];\n return{label}
}\nsetIsOpen((prev) => !prev)}\n >\n {writableDropdown ? (\n \n ) : (\n {viewLabel()}\n )}\n\n\n \n {isOpen && (\n \n\n \n )}\n\n {localOptions.map((item) => (\n\nonClick(item)}\n >\n {item.label}\n {value === item.value ? \n ))}\n: <>>}\n ;\n};\n\nconst Input = ({\n className,\n innerClassName,\n type = \"text\",\n icon,\n iconPosition,\n error,\n help,\n onChange,\n variant,\n placeholder,\n ...props\n}) => {\n const [visible, setVisible] = useState(type === \"text\");\n const inputIcon = icon || (type === \"password\" ? \"eye\" : null);\n const { t } = useTranslation();\n\n return (\n \n\n );\n};\n\nInput.propTypes = {\n className: PropTypes.string,\n icon: PropTypes.oneOf([\"eye\", \"search\"]),\n iconPosition: PropTypes.oneOf([\"left\", \"right\"]),\n type: PropTypes.oneOf([\"text\", \"password\"]),\n error: PropTypes.string,\n onChange: PropTypes.func,\n help: PropTypes.string,\n variant: PropTypes.string,\n};\n\nInput.defaultProps = {\n onChange: () => {},\n className: \"\",\n icon: null,\n iconPosition: \"right\",\n type: \"text\",\n error: \"\",\n help: \"\",\n variant: \"\",\n};\n\nexport default Input;\n","import PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nimport ButtonGroupItem from './ButtonGroupItem';\n\nconst ButtonGroup = ({\n options, selectedOptions, onChange, variant, variantSelected, className,\n}) => (\n\n {inputIcon && iconPosition === \"left\" && (\n\n\n{\n if (icon === \"eye\" || type === \"password\") setVisible(!visible);\n }}\n // eslint-disable-next-line no-nested-ternary\n className={clsx(\n \"absolute h-full flex items-center justify-center transform -translate-y-2/4 left-1.5 inset-y-2/4 w-12 h-full\",\n icon === \"eye\" || type === \"password\"\n ? visible\n ? \"cursor-pointer\"\n : \"opacity-25 cursor-pointer\"\n : \"\"\n )}\n >\n\n )}\n onChange(e.target.value)}\n {...props}\n className={\n variant ? styles[`${variant}-field`] : styles[\"input-field\"]\n }\n style={{ paddingLeft: iconPosition === \"left\" ? \"3rem\" : \"1rem\" }}\n />\n {inputIcon && iconPosition === \"right\" && (\n\n {\n if (icon === \"eye\" || type === \"password\") setVisible(!visible);\n }}\n // eslint-disable-next-line no-nested-ternary\n className={clsx(\n \"absolute flex items-center justify-center transform -translate-y-2/4 right-0 inset-y-2/4 w-12 h-full\",\n icon === \"eye\" || type === \"password\"\n ? visible\n ? \"cursor-pointer\"\n : \"opacity-25 cursor-pointer\"\n : \"\"\n )}\n >\n\n )}\n\n \n \n\n {\n // eslint-disable-next-line no-nested-ternary\n error ? (\n \n {t(error)}\n \n ) : help && !error ? (\n \n {t(help)}\n \n ) : (\n <>>\n )\n }\n \n\n {options.map((option, index) => (\n\n);\n\nButtonGroup.propTypes = {\n options: PropTypes.arrayOf(PropTypes.shape({label: PropTypes.string, value: PropTypes.string})),\n selectedOptions:\n PropTypes.arrayOf(PropTypes.shape({label: PropTypes.string, value: PropTypes.string})),\n onChange: PropTypes.func,\n variant: PropTypes.oneOf(['default', 'report']),\n variantSelected: PropTypes.oneOf(['selected', 'reportSelected']),\n};\n\nButtonGroup.defaultProps = {\n onChange: () => {},\n options: [],\n selectedOptions: [],\n variant: 'default',\n variantSelected: 'selected',\n};\n\nexport default ButtonGroup;\n","export const clsx = (...classes) => classes.filter(Boolean).join(' ');","import './roller.css';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { clsx } from '../utils';\n\nconst Roller = ({\n className,\n color,\n size,\n style\n}) => {\n const varStyle = { ...style\n };\n color && (varStyle['--rcs-roller-color'] = color);\n size && (varStyle['--rcs-roller-size'] = `${size}px`);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: clsx('rcs-roller', className),\n style: varStyle\n }, /*#__PURE__*/React.createElement(\"div\", null), /*#__PURE__*/React.createElement(\"div\", null), /*#__PURE__*/React.createElement(\"div\", null), /*#__PURE__*/React.createElement(\"div\", null), /*#__PURE__*/React.createElement(\"div\", null), /*#__PURE__*/React.createElement(\"div\", null), /*#__PURE__*/React.createElement(\"div\", null), /*#__PURE__*/React.createElement(\"div\", null));\n};\n\nprocess.env.NODE_ENV !== \"production\" ? Roller.propTypes = {\n className: PropTypes.string,\n color: PropTypes.string,\n size: PropTypes.number,\n style: PropTypes.object\n} : void 0;\nexport default Roller;","// extracted by mini-css-extract-plugin\nexport default {\"spinner\":\"Switch_spinner__fy-yc\",\"toggle\":\"Switch_toggle__7BucZ\",\"active\":\"Switch_active__-7rZ7\",\"disabled\":\"Switch_disabled__GyvHZ\",\"check\":\"Switch_check__kCoJ4\",\"transformation\":\"Switch_transformation__TOsyP\"};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {Roller} from 'react-css-spinners';\nimport clsx from 'clsx';\nimport styles from './Switch.module.scss';\n\nconst Switch = ({\n isChecked, isDisabled, onToggle, isLoading, className,\n}) => (\nv.value === option.value)}\n onClick={() => onChange(option)}\n variant={variant}\n variantSelected={variantSelected}\n animationDelay={index * (variant === 'report' ? 0.025 : 0.2)}\n />\n ))}\n \n\n);\n\nSwitch.propTypes = {\n className: PropTypes.string,\n isChecked: PropTypes.bool,\n isLoading: PropTypes.bool,\n isDisabled: PropTypes.bool,\n onToggle: PropTypes.func,\n};\n\nSwitch.defaultProps = {\n className: '',\n isChecked: false,\n isLoading: false,\n isDisabled: false,\n onToggle: () => {},\n};\n\nexport default Switch;\n","// extracted by mini-css-extract-plugin\nexport default {\"textarea\":\"TextArea_textarea__6lOOJ\",\"default\":\"TextArea_default__yDGtX\",\"note\":\"TextArea_note__kuHvo\",\"note-video\":\"TextArea_note-video__cVBgJ\"};","import { useTranslation } from \"react-i18next\";\nimport clsx from \"clsx\";\nimport PropTypes from \"prop-types\";\nimport styles from \"./TextArea.module.scss\";\n\nconst TextArea = ({\n variant,\n value,\n className,\n placeholder,\n onChange,\n maxLength,\n ...props\n}) => {\n const onValueChange = (e) => {\n const newValue = e.target.value;\n if (maxLength && newValue.length > maxLength) {\n return;\n }\n\n onChange(newValue);\n };\n const { t } = useTranslation();\n\n return (\nonToggle(!isChecked)}\n >\n \n\n\n \n \n {!!maxLength && variant !== \"note\" && (\n\n );\n};\n\nTextArea.propTypes = {\n variant: PropTypes.string,\n placeholder: PropTypes.string,\n className: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n};\n\nTextArea.defaultProps = {\n variant: \"default\",\n placeholder: \"\",\n className: \"\",\n};\n\nexport default TextArea;\n","import memoize from 'lodash.memoize';\nfunction resolver(options) {\n return JSON.stringify(options);\n}\nfunction isString(el) {\n return typeof el === 'string';\n}\nfunction isUnique(el, index, arr) {\n return arr.indexOf(el) === index;\n}\nfunction isAllLowerCase(el) {\n return el.toLowerCase() === el;\n}\nfunction fixCommas(el) {\n return el.indexOf(',') === -1 ? el : el.split(',');\n}\nfunction normalizeLocale(locale) {\n if (!locale) {\n return locale;\n }\n if (locale === 'C' || locale === 'posix' || locale === 'POSIX') {\n return 'en-US';\n }\n // If there's a dot (.) in the locale, it's likely in the format of \"en-US.UTF-8\", so we only take the first part\n if (locale.indexOf('.') !== -1) {\n var _a = locale.split('.')[0], actualLocale = _a === void 0 ? '' : _a;\n return normalizeLocale(actualLocale);\n }\n // If there's an at sign (@) in the locale, it's likely in the format of \"en-US@posix\", so we only take the first part\n if (locale.indexOf('@') !== -1) {\n var _b = locale.split('@')[0], actualLocale = _b === void 0 ? '' : _b;\n return normalizeLocale(actualLocale);\n }\n // If there's a dash (-) in the locale and it's not all lower case, it's already in the format of \"en-US\", so we return it\n if (locale.indexOf('-') === -1 || !isAllLowerCase(locale)) {\n return locale;\n }\n var _c = locale.split('-'), splitEl1 = _c[0], _d = _c[1], splitEl2 = _d === void 0 ? '' : _d;\n return \"\".concat(splitEl1, \"-\").concat(splitEl2.toUpperCase());\n}\nfunction getUserLocalesInternal(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.useFallbackLocale, useFallbackLocale = _c === void 0 ? true : _c, _d = _b.fallbackLocale, fallbackLocale = _d === void 0 ? 'en-US' : _d;\n var languageList = [];\n if (typeof navigator !== 'undefined') {\n var rawLanguages = navigator.languages || [];\n var languages = [];\n for (var _i = 0, rawLanguages_1 = rawLanguages; _i < rawLanguages_1.length; _i++) {\n var rawLanguagesItem = rawLanguages_1[_i];\n languages = languages.concat(fixCommas(rawLanguagesItem));\n }\n var rawLanguage = navigator.language;\n var language = rawLanguage ? fixCommas(rawLanguage) : rawLanguage;\n languageList = languageList.concat(languages, language);\n }\n if (useFallbackLocale) {\n languageList.push(fallbackLocale);\n }\n return languageList.filter(isString).map(normalizeLocale).filter(isUnique);\n}\nexport var getUserLocales = memoize(getUserLocalesInternal, resolver);\nfunction getUserLocaleInternal(options) {\n return getUserLocales(options)[0] || null;\n}\nexport var getUserLocale = memoize(getUserLocaleInternal, resolver);\nexport default getUserLocale;\n","/**\n * Utils\n */\nfunction makeGetEdgeOfNeighbor(getPeriod, getEdgeOfPeriod, defaultOffset) {\n return function makeGetEdgeOfNeighborInternal(date, offset) {\n if (offset === void 0) { offset = defaultOffset; }\n var previousPeriod = getPeriod(date) + offset;\n return getEdgeOfPeriod(previousPeriod);\n };\n}\nfunction makeGetEnd(getBeginOfNextPeriod) {\n return function makeGetEndInternal(date) {\n return new Date(getBeginOfNextPeriod(date).getTime() - 1);\n };\n}\nfunction makeGetRange(getStart, getEnd) {\n return function makeGetRangeInternal(date) {\n return [getStart(date), getEnd(date)];\n };\n}\n/**\n * Simple getters - getting a property of a given point in time\n */\n/**\n * Gets year from a given date.\n *\n * @param {DateLike} date Date to get year from\n * @returns {number} Year\n */\nexport function getYear(date) {\n if (date instanceof Date) {\n return date.getFullYear();\n }\n if (typeof date === 'number') {\n return date;\n }\n var year = parseInt(date, 10);\n if (typeof date === 'string' && !isNaN(year)) {\n return year;\n }\n throw new Error(\"Failed to get year from date: \".concat(date, \".\"));\n}\n/**\n * Gets month from a given date.\n *\n * @param {Date} date Date to get month from\n * @returns {number} Month\n */\nexport function getMonth(date) {\n if (date instanceof Date) {\n return date.getMonth();\n }\n throw new Error(\"Failed to get month from date: \".concat(date, \".\"));\n}\n/**\n * Gets human-readable month from a given date.\n *\n * @param {Date} date Date to get human-readable month from\n * @returns {number} Human-readable month\n */\nexport function getMonthHuman(date) {\n if (date instanceof Date) {\n return date.getMonth() + 1;\n }\n throw new Error(\"Failed to get human-readable month from date: \".concat(date, \".\"));\n}\n/**\n * Gets day of the month from a given date.\n *\n * @param {Date} date Date to get day of the month from\n * @returns {number} Day of the month\n */\nexport function getDate(date) {\n if (date instanceof Date) {\n return date.getDate();\n }\n throw new Error(\"Failed to get year from date: \".concat(date, \".\"));\n}\n/**\n * Gets hours from a given date.\n *\n * @param {Date | string} date Date to get hours from\n * @returns {number} Hours\n */\nexport function getHours(date) {\n if (date instanceof Date) {\n return date.getHours();\n }\n if (typeof date === 'string') {\n var datePieces = date.split(':');\n if (datePieces.length >= 2) {\n var hoursString = datePieces[0];\n if (hoursString) {\n var hours = parseInt(hoursString, 10);\n if (!isNaN(hours)) {\n return hours;\n }\n }\n }\n }\n throw new Error(\"Failed to get hours from date: \".concat(date, \".\"));\n}\n/**\n * Gets minutes from a given date.\n *\n * @param {Date | string} date Date to get minutes from\n * @returns {number} Minutes\n */\nexport function getMinutes(date) {\n if (date instanceof Date) {\n return date.getMinutes();\n }\n if (typeof date === 'string') {\n var datePieces = date.split(':');\n if (datePieces.length >= 2) {\n var minutesString = datePieces[1] || '0';\n var minutes = parseInt(minutesString, 10);\n if (!isNaN(minutes)) {\n return minutes;\n }\n }\n }\n throw new Error(\"Failed to get minutes from date: \".concat(date, \".\"));\n}\n/**\n * Gets seconds from a given date.\n *\n * @param {Date | string} date Date to get seconds from\n * @returns {number} Seconds\n */\nexport function getSeconds(date) {\n if (date instanceof Date) {\n return date.getSeconds();\n }\n if (typeof date === 'string') {\n var datePieces = date.split(':');\n if (datePieces.length >= 2) {\n var secondsWithMillisecondsString = datePieces[2] || '0';\n var seconds = parseInt(secondsWithMillisecondsString, 10);\n if (!isNaN(seconds)) {\n return seconds;\n }\n }\n }\n throw new Error(\"Failed to get seconds from date: \".concat(date, \".\"));\n}\n/**\n * Gets milliseconds from a given date.\n *\n * @param {Date | string} date Date to get milliseconds from\n * @returns {number} Milliseconds\n */\nexport function getMilliseconds(date) {\n if (date instanceof Date) {\n return date.getMilliseconds();\n }\n if (typeof date === 'string') {\n var datePieces = date.split(':');\n if (datePieces.length >= 2) {\n var secondsWithMillisecondsString = datePieces[2] || '0';\n var millisecondsString = secondsWithMillisecondsString.split('.')[1] || '0';\n var milliseconds = parseInt(millisecondsString, 10);\n if (!isNaN(milliseconds)) {\n return milliseconds;\n }\n }\n }\n throw new Error(\"Failed to get seconds from date: \".concat(date, \".\"));\n}\n/**\n * Century\n */\n/**\n * Gets century start date from a given date.\n *\n * @param {DateLike} date Date to get century start from\n * @returns {Date} Century start date\n */\nexport function getCenturyStart(date) {\n var year = getYear(date);\n var centuryStartYear = year + ((-year + 1) % 100);\n var centuryStartDate = new Date();\n centuryStartDate.setFullYear(centuryStartYear, 0, 1);\n centuryStartDate.setHours(0, 0, 0, 0);\n return centuryStartDate;\n}\n/**\n * Gets previous century start date from a given date.\n *\n * @param {DateLike} date Date to get previous century start from\n * @returns {Date} Previous century start date\n */\nexport var getPreviousCenturyStart = makeGetEdgeOfNeighbor(getYear, getCenturyStart, -100);\n/**\n * Gets next century start date from a given date.\n *\n * @param {DateLike} date Date to get next century start from\n * @returns {Date} Next century start date\n */\nexport var getNextCenturyStart = makeGetEdgeOfNeighbor(getYear, getCenturyStart, 100);\n/**\n * Gets century end date from a given date.\n *\n * @param {DateLike} date Date to get century end from\n * @returns {Date} Century end date\n */\nexport var getCenturyEnd = makeGetEnd(getNextCenturyStart);\n/**\n * Gets previous century end date from a given date.\n *\n * @param {DateLike} date Date to get previous century end from\n * @returns {Date} Previous century end date\n */\nexport var getPreviousCenturyEnd = makeGetEdgeOfNeighbor(getYear, getCenturyEnd, -100);\n/**\n * Gets next century end date from a given date.\n *\n * @param {DateLike} date Date to get next century end from\n * @returns {Date} Next century end date\n */\nexport var getNextCenturyEnd = makeGetEdgeOfNeighbor(getYear, getCenturyEnd, 100);\n/**\n * Gets century start and end dates from a given date.\n *\n * @param {DateLike} date Date to get century start and end from\n * @returns {[Date, Date]} Century start and end dates\n */\nexport var getCenturyRange = makeGetRange(getCenturyStart, getCenturyEnd);\n/**\n * Decade\n */\n/**\n * Gets decade start date from a given date.\n *\n * @param {DateLike} date Date to get decade start from\n * @returns {Date} Decade start date\n */\nexport function getDecadeStart(date) {\n var year = getYear(date);\n var decadeStartYear = year + ((-year + 1) % 10);\n var decadeStartDate = new Date();\n decadeStartDate.setFullYear(decadeStartYear, 0, 1);\n decadeStartDate.setHours(0, 0, 0, 0);\n return decadeStartDate;\n}\n/**\n * Gets previous decade start date from a given date.\n *\n * @param {DateLike} date Date to get previous decade start from\n * @returns {Date} Previous decade start date\n */\nexport var getPreviousDecadeStart = makeGetEdgeOfNeighbor(getYear, getDecadeStart, -10);\n/**\n * Gets next decade start date from a given date.\n *\n * @param {DateLike} date Date to get next decade start from\n * @returns {Date} Next decade start date\n */\nexport var getNextDecadeStart = makeGetEdgeOfNeighbor(getYear, getDecadeStart, 10);\n/**\n * Gets decade end date from a given date.\n *\n * @param {DateLike} date Date to get decade end from\n * @returns {Date} Decade end date\n */\nexport var getDecadeEnd = makeGetEnd(getNextDecadeStart);\n/**\n * Gets previous decade end date from a given date.\n *\n * @param {DateLike} date Date to get previous decade end from\n * @returns {Date} Previous decade end date\n */\nexport var getPreviousDecadeEnd = makeGetEdgeOfNeighbor(getYear, getDecadeEnd, -10);\n/**\n * Gets next decade end date from a given date.\n *\n * @param {DateLike} date Date to get next decade end from\n * @returns {Date} Next decade end date\n */\nexport var getNextDecadeEnd = makeGetEdgeOfNeighbor(getYear, getDecadeEnd, 10);\n/**\n * Gets decade start and end dates from a given date.\n *\n * @param {DateLike} date Date to get decade start and end from\n * @returns {[Date, Date]} Decade start and end dates\n */\nexport var getDecadeRange = makeGetRange(getDecadeStart, getDecadeEnd);\n/**\n * Year\n */\n/**\n * Gets year start date from a given date.\n *\n * @param {DateLike} date Date to get year start from\n * @returns {Date} Year start date\n */\nexport function getYearStart(date) {\n var year = getYear(date);\n var yearStartDate = new Date();\n yearStartDate.setFullYear(year, 0, 1);\n yearStartDate.setHours(0, 0, 0, 0);\n return yearStartDate;\n}\n/**\n * Gets previous year start date from a given date.\n *\n * @param {DateLike} date Date to get previous year start from\n * @returns {Date} Previous year start date\n */\nexport var getPreviousYearStart = makeGetEdgeOfNeighbor(getYear, getYearStart, -1);\n/**\n * Gets next year start date from a given date.\n *\n * @param {DateLike} date Date to get next year start from\n * @returns {Date} Next year start date\n */\nexport var getNextYearStart = makeGetEdgeOfNeighbor(getYear, getYearStart, 1);\n/**\n * Gets year end date from a given date.\n *\n * @param {DateLike} date Date to get year end from\n * @returns {Date} Year end date\n */\nexport var getYearEnd = makeGetEnd(getNextYearStart);\n/**\n * Gets previous year end date from a given date.\n *\n * @param {DateLike} date Date to get previous year end from\n * @returns {Date} Previous year end date\n */\nexport var getPreviousYearEnd = makeGetEdgeOfNeighbor(getYear, getYearEnd, -1);\n/**\n * Gets next year end date from a given date.\n *\n * @param {DateLike} date Date to get next year end from\n * @returns {Date} Next year end date\n */\nexport var getNextYearEnd = makeGetEdgeOfNeighbor(getYear, getYearEnd, 1);\n/**\n * Gets year start and end dates from a given date.\n *\n * @param {DateLike} date Date to get year start and end from\n * @returns {[Date, Date]} Year start and end dates\n */\nexport var getYearRange = makeGetRange(getYearStart, getYearEnd);\n/**\n * Month\n */\nfunction makeGetEdgeOfNeighborMonth(getEdgeOfPeriod, defaultOffset) {\n return function makeGetEdgeOfNeighborMonthInternal(date, offset) {\n if (offset === void 0) { offset = defaultOffset; }\n var year = getYear(date);\n var month = getMonth(date) + offset;\n var previousPeriod = new Date();\n previousPeriod.setFullYear(year, month, 1);\n previousPeriod.setHours(0, 0, 0, 0);\n return getEdgeOfPeriod(previousPeriod);\n };\n}\n/**\n * Gets month start date from a given date.\n *\n * @param {DateLike} date Date to get month start from\n * @returns {Date} Month start date\n */\nexport function getMonthStart(date) {\n var year = getYear(date);\n var month = getMonth(date);\n var monthStartDate = new Date();\n monthStartDate.setFullYear(year, month, 1);\n monthStartDate.setHours(0, 0, 0, 0);\n return monthStartDate;\n}\n/**\n * Gets previous month start date from a given date.\n *\n * @param {DateLike} date Date to get previous month start from\n * @returns {Date} Previous month start date\n */\nexport var getPreviousMonthStart = makeGetEdgeOfNeighborMonth(getMonthStart, -1);\n/**\n * Gets next month start date from a given date.\n *\n * @param {DateLike} date Date to get next month start from\n * @returns {Date} Next month start date\n */\nexport var getNextMonthStart = makeGetEdgeOfNeighborMonth(getMonthStart, 1);\n/**\n * Gets month end date from a given date.\n *\n * @param {DateLike} date Date to get month end from\n * @returns {Date} Month end date\n */\nexport var getMonthEnd = makeGetEnd(getNextMonthStart);\n/**\n * Gets previous month end date from a given date.\n *\n * @param {DateLike} date Date to get previous month end from\n * @returns {Date} Previous month end date\n */\nexport var getPreviousMonthEnd = makeGetEdgeOfNeighborMonth(getMonthEnd, -1);\n/**\n * Gets next month end date from a given date.\n *\n * @param {DateLike} date Date to get next month end from\n * @returns {Date} Next month end date\n */\nexport var getNextMonthEnd = makeGetEdgeOfNeighborMonth(getMonthEnd, 1);\n/**\n * Gets month start and end dates from a given date.\n *\n * @param {DateLike} date Date to get month start and end from\n * @returns {[Date, Date]} Month start and end dates\n */\nexport var getMonthRange = makeGetRange(getMonthStart, getMonthEnd);\n/**\n * Day\n */\nfunction makeGetEdgeOfNeighborDay(getEdgeOfPeriod, defaultOffset) {\n return function makeGetEdgeOfNeighborDayInternal(date, offset) {\n if (offset === void 0) { offset = defaultOffset; }\n var year = getYear(date);\n var month = getMonth(date);\n var day = getDate(date) + offset;\n var previousPeriod = new Date();\n previousPeriod.setFullYear(year, month, day);\n previousPeriod.setHours(0, 0, 0, 0);\n return getEdgeOfPeriod(previousPeriod);\n };\n}\n/**\n * Gets day start date from a given date.\n *\n * @param {DateLike} date Date to get day start from\n * @returns {Date} Day start date\n */\nexport function getDayStart(date) {\n var year = getYear(date);\n var month = getMonth(date);\n var day = getDate(date);\n var dayStartDate = new Date();\n dayStartDate.setFullYear(year, month, day);\n dayStartDate.setHours(0, 0, 0, 0);\n return dayStartDate;\n}\n/**\n * Gets previous day start date from a given date.\n *\n * @param {DateLike} date Date to get previous day start from\n * @returns {Date} Previous day start date\n */\nexport var getPreviousDayStart = makeGetEdgeOfNeighborDay(getDayStart, -1);\n/**\n * Gets next day start date from a given date.\n *\n * @param {DateLike} date Date to get next day start from\n * @returns {Date} Next day start date\n */\nexport var getNextDayStart = makeGetEdgeOfNeighborDay(getDayStart, 1);\n/**\n * Gets day end date from a given date.\n *\n * @param {DateLike} date Date to get day end from\n * @returns {Date} Day end date\n */\nexport var getDayEnd = makeGetEnd(getNextDayStart);\n/**\n * Gets previous day end date from a given date.\n *\n * @param {DateLike} date Date to get previous day end from\n * @returns {Date} Previous day end date\n */\nexport var getPreviousDayEnd = makeGetEdgeOfNeighborDay(getDayEnd, -1);\n/**\n * Gets next day end date from a given date.\n *\n * @param {DateLike} date Date to get next day end from\n * @returns {Date} Next day end date\n */\nexport var getNextDayEnd = makeGetEdgeOfNeighborDay(getDayEnd, 1);\n/**\n * Gets day start and end dates from a given date.\n *\n * @param {DateLike} date Date to get day start and end from\n * @returns {[Date, Date]} Day start and end dates\n */\nexport var getDayRange = makeGetRange(getDayStart, getDayEnd);\n/**\n * Other\n */\n/**\n * Returns a number of days in a month of a given date.\n *\n * @param {Date} date Date\n * @returns {number} Number of days in a month\n */\nexport function getDaysInMonth(date) {\n return getDate(getMonthEnd(date));\n}\nfunction padStart(num, val) {\n if (val === void 0) { val = 2; }\n var numStr = \"\".concat(num);\n if (numStr.length >= val) {\n return num;\n }\n return \"0000\".concat(numStr).slice(-val);\n}\n/**\n * Returns local hours and minutes (hh:mm).\n *\n * @param {Date | string} date Date to get hours and minutes from\n * @returns {string} Local hours and minutes\n */\nexport function getHoursMinutes(date) {\n var hours = padStart(getHours(date));\n var minutes = padStart(getMinutes(date));\n return \"\".concat(hours, \":\").concat(minutes);\n}\n/**\n * Returns local hours, minutes and seconds (hh:mm:ss).\n *\n * @param {Date | string} date Date to get hours, minutes and seconds from\n * @returns {string} Local hours, minutes and seconds\n */\nexport function getHoursMinutesSeconds(date) {\n var hours = padStart(getHours(date));\n var minutes = padStart(getMinutes(date));\n var seconds = padStart(getSeconds(date));\n return \"\".concat(hours, \":\").concat(minutes, \":\").concat(seconds);\n}\n/**\n * Returns local month in ISO-like format (YYYY-MM).\n *\n * @param {Date} date Date to get month in ISO-like format from\n * @returns {string} Local month in ISO-like format\n */\nexport function getISOLocalMonth(date) {\n var year = padStart(getYear(date), 4);\n var month = padStart(getMonthHuman(date));\n return \"\".concat(year, \"-\").concat(month);\n}\n/**\n * Returns local date in ISO-like format (YYYY-MM-DD).\n *\n * @param {Date} date Date to get date in ISO-like format from\n * @returns {string} Local date in ISO-like format\n */\nexport function getISOLocalDate(date) {\n var year = padStart(getYear(date), 4);\n var month = padStart(getMonthHuman(date));\n var day = padStart(getDate(date));\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}\n/**\n * Returns local date & time in ISO-like format (YYYY-MM-DDThh:mm:ss).\n *\n * @param {Date} date Date to get date & time in ISO-like format from\n * @returns {string} Local date & time in ISO-like format\n */\nexport function getISOLocalDateTime(date) {\n return \"\".concat(getISOLocalDate(date), \"T\").concat(getHoursMinutesSeconds(date));\n}\n","var _a;\nexport var CALENDAR_TYPES = {\n GREGORY: 'gregory',\n HEBREW: 'hebrew',\n ISLAMIC: 'islamic',\n ISO_8601: 'iso8601',\n};\nexport var DEPRECATED_CALENDAR_TYPES = {\n ARABIC: 'Arabic',\n HEBREW: 'Hebrew',\n ISO_8601: 'ISO 8601',\n US: 'US',\n};\nexport var CALENDAR_TYPE_LOCALES = (_a = {},\n _a[CALENDAR_TYPES.GREGORY] = [\n 'en-CA',\n 'en-US',\n 'es-AR',\n 'es-BO',\n 'es-CL',\n 'es-CO',\n 'es-CR',\n 'es-DO',\n 'es-EC',\n 'es-GT',\n 'es-HN',\n 'es-MX',\n 'es-NI',\n 'es-PA',\n 'es-PE',\n 'es-PR',\n 'es-SV',\n 'es-VE',\n 'pt-BR',\n ],\n _a[CALENDAR_TYPES.HEBREW] = ['he', 'he-IL'],\n _a[CALENDAR_TYPES.ISLAMIC] = [\n // ar-LB, ar-MA intentionally missing\n 'ar',\n 'ar-AE',\n 'ar-BH',\n 'ar-DZ',\n 'ar-EG',\n 'ar-IQ',\n 'ar-JO',\n 'ar-KW',\n 'ar-LY',\n 'ar-OM',\n 'ar-QA',\n 'ar-SA',\n 'ar-SD',\n 'ar-SY',\n 'ar-YE',\n 'dv',\n 'dv-MV',\n 'ps',\n 'ps-AR',\n ],\n _a);\nexport var WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];\n","import getUserLocale from 'get-user-locale';\nvar formatterCache = new Map();\nfunction getFormatter(options) {\n return function formatter(locale, date) {\n var localeWithDefault = locale || getUserLocale();\n if (!formatterCache.has(localeWithDefault)) {\n formatterCache.set(localeWithDefault, new Map());\n }\n var formatterCacheLocale = formatterCache.get(localeWithDefault);\n if (!formatterCacheLocale.has(options)) {\n formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault || undefined, options).format);\n }\n return formatterCacheLocale.get(options)(date);\n };\n}\n/**\n * Changes the hour in a Date to ensure right date formatting even if DST is messed up.\n * Workaround for bug in WebKit and Firefox with historical dates.\n * For more details, see:\n * https://bugs.chromium.org/p/chromium/issues/detail?id=750465\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1385643\n *\n * @param {Date} date Date.\n * @returns {Date} Date with hour set to 12.\n */\nfunction toSafeHour(date) {\n var safeDate = new Date(date);\n return new Date(safeDate.setHours(12));\n}\nfunction getSafeFormatter(options) {\n return function (locale, date) { return getFormatter(options)(locale, toSafeHour(date)); };\n}\nvar formatDateOptions = {\n day: 'numeric',\n month: 'numeric',\n year: 'numeric',\n};\nvar formatDayOptions = { day: 'numeric' };\nvar formatLongDateOptions = {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n};\nvar formatMonthOptions = { month: 'long' };\nvar formatMonthYearOptions = {\n month: 'long',\n year: 'numeric',\n};\nvar formatShortWeekdayOptions = { weekday: 'short' };\nvar formatWeekdayOptions = { weekday: 'long' };\nvar formatYearOptions = { year: 'numeric' };\nexport var formatDate = getSafeFormatter(formatDateOptions);\nexport var formatDay = getSafeFormatter(formatDayOptions);\nexport var formatLongDate = getSafeFormatter(formatLongDateOptions);\nexport var formatMonth = getSafeFormatter(formatMonthOptions);\nexport var formatMonthYear = getSafeFormatter(formatMonthYearOptions);\nexport var formatShortWeekday = getSafeFormatter(formatShortWeekdayOptions);\nexport var formatWeekday = getSafeFormatter(formatWeekdayOptions);\nexport var formatYear = getSafeFormatter(formatYearOptions);\n","import { getYear, getMonth as getMonthIndex, getCenturyStart, getPreviousCenturyStart, getNextCenturyStart, getCenturyEnd, getPreviousCenturyEnd, getCenturyRange, getDecadeStart, getPreviousDecadeStart, getNextDecadeStart, getDecadeEnd, getPreviousDecadeEnd, getDecadeRange, getYearStart, getPreviousYearStart, getNextYearStart, getYearEnd, getPreviousYearEnd, getYearRange, getMonthStart, getPreviousMonthStart, getNextMonthStart, getMonthEnd, getPreviousMonthEnd, getMonthRange, getDayStart, getDayEnd, getDayRange, } from '@wojtekmaj/date-utils';\nimport { CALENDAR_TYPES, WEEKDAYS } from './const.js';\nimport { formatYear as defaultFormatYear } from './dateFormatter.js';\nvar SUNDAY = WEEKDAYS[0];\nvar FRIDAY = WEEKDAYS[5];\nvar SATURDAY = WEEKDAYS[6];\n/* Simple getters - getting a property of a given point in time */\n/**\n * Gets day of the week of a given date.\n * @param {Date} date Date.\n * @param {CalendarType} [calendarType=\"iso8601\"] Calendar type.\n * @returns {number} Day of the week.\n */\nexport function getDayOfWeek(date, calendarType) {\n if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }\n var weekday = date.getDay();\n switch (calendarType) {\n case CALENDAR_TYPES.ISO_8601:\n // Shifts days of the week so that Monday is 0, Sunday is 6\n return (weekday + 6) % 7;\n case CALENDAR_TYPES.ISLAMIC:\n return (weekday + 1) % 7;\n case CALENDAR_TYPES.HEBREW:\n case CALENDAR_TYPES.GREGORY:\n return weekday;\n default:\n throw new Error('Unsupported calendar type.');\n }\n}\n/**\n * Century\n */\n/**\n * Gets the year of the beginning of a century of a given date.\n * @param {Date} date Date.\n * @returns {number} Year of the beginning of a century.\n */\nexport function getBeginOfCenturyYear(date) {\n var beginOfCentury = getCenturyStart(date);\n return getYear(beginOfCentury);\n}\n/**\n * Decade\n */\n/**\n * Gets the year of the beginning of a decade of a given date.\n * @param {Date} date Date.\n * @returns {number} Year of the beginning of a decade.\n */\nexport function getBeginOfDecadeYear(date) {\n var beginOfDecade = getDecadeStart(date);\n return getYear(beginOfDecade);\n}\n/**\n * Week\n */\n/**\n * Returns the beginning of a given week.\n *\n * @param {Date} date Date.\n * @param {CalendarType} [calendarType=\"iso8601\"] Calendar type.\n * @returns {Date} Beginning of a given week.\n */\nexport function getBeginOfWeek(date, calendarType) {\n if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }\n var year = getYear(date);\n var monthIndex = getMonthIndex(date);\n var day = date.getDate() - getDayOfWeek(date, calendarType);\n return new Date(year, monthIndex, day);\n}\n/**\n * Gets week number according to ISO 8601 or US standard.\n * In ISO 8601, Arabic and Hebrew week 1 is the one with January 4.\n * In US calendar week 1 is the one with January 1.\n *\n * @param {Date} date Date.\n * @param {CalendarType} [calendarType=\"iso8601\"] Calendar type.\n * @returns {number} Week number.\n */\nexport function getWeekNumber(date, calendarType) {\n if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }\n var calendarTypeForWeekNumber = calendarType === CALENDAR_TYPES.GREGORY ? CALENDAR_TYPES.GREGORY : CALENDAR_TYPES.ISO_8601;\n var beginOfWeek = getBeginOfWeek(date, calendarType);\n var year = getYear(date) + 1;\n var dayInWeekOne;\n var beginOfFirstWeek;\n // Look for the first week one that does not come after a given date\n do {\n dayInWeekOne = new Date(year, 0, calendarTypeForWeekNumber === CALENDAR_TYPES.ISO_8601 ? 4 : 1);\n beginOfFirstWeek = getBeginOfWeek(dayInWeekOne, calendarType);\n year -= 1;\n } while (date < beginOfFirstWeek);\n return Math.round((beginOfWeek.getTime() - beginOfFirstWeek.getTime()) / (8.64e7 * 7)) + 1;\n}\n/**\n * Others\n */\n/**\n * Returns the beginning of a given range.\n *\n * @param {RangeType} rangeType Range type (e.g. 'day')\n * @param {Date} date Date.\n * @returns {Date} Beginning of a given range.\n */\nexport function getBegin(rangeType, date) {\n switch (rangeType) {\n case 'century':\n return getCenturyStart(date);\n case 'decade':\n return getDecadeStart(date);\n case 'year':\n return getYearStart(date);\n case 'month':\n return getMonthStart(date);\n case 'day':\n return getDayStart(date);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\n/**\n * Returns the beginning of a previous given range.\n *\n * @param {RangeType} rangeType Range type (e.g. 'day')\n * @param {Date} date Date.\n * @returns {Date} Beginning of a previous given range.\n */\nexport function getBeginPrevious(rangeType, date) {\n switch (rangeType) {\n case 'century':\n return getPreviousCenturyStart(date);\n case 'decade':\n return getPreviousDecadeStart(date);\n case 'year':\n return getPreviousYearStart(date);\n case 'month':\n return getPreviousMonthStart(date);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\n/**\n * Returns the beginning of a next given range.\n *\n * @param {RangeType} rangeType Range type (e.g. 'day')\n * @param {Date} date Date.\n * @returns {Date} Beginning of a next given range.\n */\nexport function getBeginNext(rangeType, date) {\n switch (rangeType) {\n case 'century':\n return getNextCenturyStart(date);\n case 'decade':\n return getNextDecadeStart(date);\n case 'year':\n return getNextYearStart(date);\n case 'month':\n return getNextMonthStart(date);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\nexport function getBeginPrevious2(rangeType, date) {\n switch (rangeType) {\n case 'decade':\n return getPreviousDecadeStart(date, -100);\n case 'year':\n return getPreviousYearStart(date, -10);\n case 'month':\n return getPreviousMonthStart(date, -12);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\nexport function getBeginNext2(rangeType, date) {\n switch (rangeType) {\n case 'decade':\n return getNextDecadeStart(date, 100);\n case 'year':\n return getNextYearStart(date, 10);\n case 'month':\n return getNextMonthStart(date, 12);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\n/**\n * Returns the end of a given range.\n *\n * @param {RangeType} rangeType Range type (e.g. 'day')\n * @param {Date} date Date.\n * @returns {Date} End of a given range.\n */\nexport function getEnd(rangeType, date) {\n switch (rangeType) {\n case 'century':\n return getCenturyEnd(date);\n case 'decade':\n return getDecadeEnd(date);\n case 'year':\n return getYearEnd(date);\n case 'month':\n return getMonthEnd(date);\n case 'day':\n return getDayEnd(date);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\n/**\n * Returns the end of a previous given range.\n *\n * @param {RangeType} rangeType Range type (e.g. 'day')\n * @param {Date} date Date.\n * @returns {Date} End of a previous given range.\n */\nexport function getEndPrevious(rangeType, date) {\n switch (rangeType) {\n case 'century':\n return getPreviousCenturyEnd(date);\n case 'decade':\n return getPreviousDecadeEnd(date);\n case 'year':\n return getPreviousYearEnd(date);\n case 'month':\n return getPreviousMonthEnd(date);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\nexport function getEndPrevious2(rangeType, date) {\n switch (rangeType) {\n case 'decade':\n return getPreviousDecadeEnd(date, -100);\n case 'year':\n return getPreviousYearEnd(date, -10);\n case 'month':\n return getPreviousMonthEnd(date, -12);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\n/**\n * Returns an array with the beginning and the end of a given range.\n *\n * @param {RangeType} rangeType Range type (e.g. 'day')\n * @param {Date} date Date.\n * @returns {Date[]} Beginning and end of a given range.\n */\nexport function getRange(rangeType, date) {\n switch (rangeType) {\n case 'century':\n return getCenturyRange(date);\n case 'decade':\n return getDecadeRange(date);\n case 'year':\n return getYearRange(date);\n case 'month':\n return getMonthRange(date);\n case 'day':\n return getDayRange(date);\n default:\n throw new Error(\"Invalid rangeType: \".concat(rangeType));\n }\n}\n/**\n * Creates a range out of two values, ensuring they are in order and covering entire period ranges.\n *\n * @param {RangeType} rangeType Range type (e.g. 'day')\n * @param {Date} date1 First date.\n * @param {Date} date2 Second date.\n * @returns {Date[]} Beginning and end of a given range.\n */\nexport function getValueRange(rangeType, date1, date2) {\n var rawNextValue = [date1, date2].sort(function (a, b) { return a.getTime() - b.getTime(); });\n return [getBegin(rangeType, rawNextValue[0]), getEnd(rangeType, rawNextValue[1])];\n}\nfunction toYearLabel(locale, formatYear, dates) {\n if (formatYear === void 0) { formatYear = defaultFormatYear; }\n return dates.map(function (date) { return formatYear(locale, date); }).join(' – ');\n}\n/**\n * @callback FormatYear\n * @param {string} locale Locale.\n * @param {Date} date Date.\n * @returns {string} Formatted year.\n */\n/**\n * Returns a string labelling a century of a given date.\n * For example, for 2017 it will return 2001-2100.\n *\n * @param {string} locale Locale.\n * @param {FormatYear} formatYear Function to format a year.\n * @param {Date|string|number} date Date or a year as a string or as a number.\n * @returns {string} String labelling a century of a given date.\n */\nexport function getCenturyLabel(locale, formatYear, date) {\n return toYearLabel(locale, formatYear, getCenturyRange(date));\n}\n/**\n * Returns a string labelling a decade of a given date.\n * For example, for 2017 it will return 2011-2020.\n *\n * @param {string} locale Locale.\n * @param {FormatYear} formatYear Function to format a year.\n * @param {Date|string|number} date Date or a year as a string or as a number.\n * @returns {string} String labelling a decade of a given date.\n */\nexport function getDecadeLabel(locale, formatYear, date) {\n return toYearLabel(locale, formatYear, getDecadeRange(date));\n}\n/**\n * Returns a boolean determining whether a given date is the current day of the week.\n *\n * @param {Date} date Date.\n * @returns {boolean} Whether a given date is the current day of the week.\n */\nexport function isCurrentDayOfWeek(date) {\n return date.getDay() === new Date().getDay();\n}\n/**\n * Returns a boolean determining whether a given date is a weekend day.\n *\n * @param {Date} date Date.\n * @param {CalendarType} [calendarType=\"iso8601\"] Calendar type.\n * @returns {boolean} Whether a given date is a weekend day.\n */\nexport function isWeekend(date, calendarType) {\n if (calendarType === void 0) { calendarType = CALENDAR_TYPES.ISO_8601; }\n var weekday = date.getDay();\n switch (calendarType) {\n case CALENDAR_TYPES.ISLAMIC:\n case CALENDAR_TYPES.HEBREW:\n return weekday === FRIDAY || weekday === SATURDAY;\n case CALENDAR_TYPES.ISO_8601:\n case CALENDAR_TYPES.GREGORY:\n return weekday === SATURDAY || weekday === SUNDAY;\n default:\n throw new Error('Unsupported calendar type.');\n }\n}\n","'use client';\nimport React from 'react';\nimport { getUserLocale } from 'get-user-locale';\nimport { getCenturyLabel, getDecadeLabel, getBeginNext, getBeginNext2, getBeginPrevious, getBeginPrevious2, getEndPrevious, getEndPrevious2, } from '../shared/dates.js';\nimport { formatMonthYear as defaultFormatMonthYear, formatYear as defaultFormatYear, } from '../shared/dateFormatter.js';\nvar className = 'react-calendar__navigation';\nexport default function Navigation(_a) {\n var activeStartDate = _a.activeStartDate, drillUp = _a.drillUp, _b = _a.formatMonthYear, formatMonthYear = _b === void 0 ? defaultFormatMonthYear : _b, _c = _a.formatYear, formatYear = _c === void 0 ? defaultFormatYear : _c, locale = _a.locale, maxDate = _a.maxDate, minDate = _a.minDate, _d = _a.navigationAriaLabel, navigationAriaLabel = _d === void 0 ? '' : _d, navigationAriaLive = _a.navigationAriaLive, navigationLabel = _a.navigationLabel, _e = _a.next2AriaLabel, next2AriaLabel = _e === void 0 ? '' : _e, _f = _a.next2Label, next2Label = _f === void 0 ? '»' : _f, _g = _a.nextAriaLabel, nextAriaLabel = _g === void 0 ? '' : _g, _h = _a.nextLabel, nextLabel = _h === void 0 ? '›' : _h, _j = _a.prev2AriaLabel, prev2AriaLabel = _j === void 0 ? '' : _j, _k = _a.prev2Label, prev2Label = _k === void 0 ? '«' : _k, _l = _a.prevAriaLabel, prevAriaLabel = _l === void 0 ? '' : _l, _m = _a.prevLabel, prevLabel = _m === void 0 ? '‹' : _m, setActiveStartDate = _a.setActiveStartDate, showDoubleView = _a.showDoubleView, view = _a.view, views = _a.views;\n var drillUpAvailable = views.indexOf(view) > 0;\n var shouldShowPrevNext2Buttons = view !== 'century';\n var previousActiveStartDate = getBeginPrevious(view, activeStartDate);\n var previousActiveStartDate2 = shouldShowPrevNext2Buttons\n ? getBeginPrevious2(view, activeStartDate)\n : undefined;\n var nextActiveStartDate = getBeginNext(view, activeStartDate);\n var nextActiveStartDate2 = shouldShowPrevNext2Buttons\n ? getBeginNext2(view, activeStartDate)\n : undefined;\n var prevButtonDisabled = (function () {\n if (previousActiveStartDate.getFullYear() < 0) {\n return true;\n }\n var previousActiveEndDate = getEndPrevious(view, activeStartDate);\n return minDate && minDate >= previousActiveEndDate;\n })();\n var prev2ButtonDisabled = shouldShowPrevNext2Buttons &&\n (function () {\n if (previousActiveStartDate2.getFullYear() < 0) {\n return true;\n }\n var previousActiveEndDate = getEndPrevious2(view, activeStartDate);\n return minDate && minDate >= previousActiveEndDate;\n })();\n var nextButtonDisabled = maxDate && maxDate < nextActiveStartDate;\n var next2ButtonDisabled = shouldShowPrevNext2Buttons && maxDate && maxDate < nextActiveStartDate2;\n function onClickPrevious() {\n setActiveStartDate(previousActiveStartDate, 'prev');\n }\n function onClickPrevious2() {\n setActiveStartDate(previousActiveStartDate2, 'prev2');\n }\n function onClickNext() {\n setActiveStartDate(nextActiveStartDate, 'next');\n }\n function onClickNext2() {\n setActiveStartDate(nextActiveStartDate2, 'next2');\n }\n function renderLabel(date) {\n var label = (function () {\n switch (view) {\n case 'century':\n return getCenturyLabel(locale, formatYear, date);\n case 'decade':\n return getDecadeLabel(locale, formatYear, date);\n case 'year':\n return formatYear(locale, date);\n case 'month':\n return formatMonthYear(locale, date);\n default:\n throw new Error(\"Invalid view: \".concat(view, \".\"));\n }\n })();\n return navigationLabel\n ? navigationLabel({\n date: date,\n label: label,\n locale: locale || getUserLocale() || undefined,\n view: view,\n })\n : label;\n }\n function renderButton() {\n var labelClassName = \"\".concat(className, \"__label\");\n return (React.createElement(\"button\", { \"aria-label\": navigationAriaLabel, \"aria-live\": navigationAriaLive, className: labelClassName, disabled: !drillUpAvailable, onClick: drillUp, style: { flexGrow: 1 }, type: \"button\" },\n React.createElement(\"span\", { className: \"\".concat(labelClassName, \"__labelText \").concat(labelClassName, \"__labelText--from\") }, renderLabel(activeStartDate)),\n showDoubleView ? (React.createElement(React.Fragment, null,\n React.createElement(\"span\", { className: \"\".concat(labelClassName, \"__divider\") }, \" \\u2013 \"),\n React.createElement(\"span\", { className: \"\".concat(labelClassName, \"__labelText \").concat(labelClassName, \"__labelText--to\") }, renderLabel(nextActiveStartDate)))) : null));\n }\n return (React.createElement(\"div\", { className: className },\n prev2Label !== null && shouldShowPrevNext2Buttons ? (React.createElement(\"button\", { \"aria-label\": prev2AriaLabel, className: \"\".concat(className, \"__arrow \").concat(className, \"__prev2-button\"), disabled: prev2ButtonDisabled, onClick: onClickPrevious2, type: \"button\" }, prev2Label)) : null,\n prevLabel !== null && (React.createElement(\"button\", { \"aria-label\": prevAriaLabel, className: \"\".concat(className, \"__arrow \").concat(className, \"__prev-button\"), disabled: prevButtonDisabled, onClick: onClickPrevious, type: \"button\" }, prevLabel)),\n renderButton(),\n nextLabel !== null && (React.createElement(\"button\", { \"aria-label\": nextAriaLabel, className: \"\".concat(className, \"__arrow \").concat(className, \"__next-button\"), disabled: nextButtonDisabled, onClick: onClickNext, type: \"button\" }, nextLabel)),\n next2Label !== null && shouldShowPrevNext2Buttons ? (React.createElement(\"button\", { \"aria-label\": next2AriaLabel, className: \"\".concat(className, \"__arrow \").concat(className, \"__next2-button\"), disabled: next2ButtonDisabled, onClick: onClickNext2, type: \"button\" }, next2Label)) : null));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nfunction toPercent(num) {\n return \"\".concat(num, \"%\");\n}\nexport default function Flex(_a) {\n var children = _a.children, className = _a.className, count = _a.count, direction = _a.direction, offset = _a.offset, style = _a.style, wrap = _a.wrap, otherProps = __rest(_a, [\"children\", \"className\", \"count\", \"direction\", \"offset\", \"style\", \"wrap\"]);\n return (React.createElement(\"div\", __assign({ className: className, style: __assign({ display: 'flex', flexDirection: direction, flexWrap: wrap ? 'wrap' : 'nowrap' }, style) }, otherProps), React.Children.map(children, function (child, index) {\n var marginInlineStart = offset && index === 0 ? toPercent((100 * offset) / count) : null;\n return React.cloneElement(child, __assign(__assign({}, child.props), { style: {\n flexBasis: toPercent(100 / count),\n flexShrink: 0,\n flexGrow: 0,\n overflow: 'hidden',\n marginLeft: marginInlineStart,\n marginInlineStart: marginInlineStart,\n marginInlineEnd: 0,\n } }));\n })));\n}\n","var _a;\nimport warning from 'tiny-warning';\nimport { CALENDAR_TYPES, DEPRECATED_CALENDAR_TYPES } from './const.js';\nimport { getRange } from './dates.js';\n/**\n * Returns a value no smaller than min and no larger than max.\n *\n * @param {Date} value Value to return.\n * @param {Date} min Minimum return value.\n * @param {Date} max Maximum return value.\n * @returns {Date} Value between min and max.\n */\nexport function between(value, min, max) {\n if (min && min > value) {\n return min;\n }\n if (max && max < value) {\n return max;\n }\n return value;\n}\nexport function isValueWithinRange(value, range) {\n return range[0] <= value && range[1] >= value;\n}\nexport function isRangeWithinRange(greaterRange, smallerRange) {\n return greaterRange[0] <= smallerRange[0] && greaterRange[1] >= smallerRange[1];\n}\nexport function doRangesOverlap(range1, range2) {\n return isValueWithinRange(range1[0], range2) || isValueWithinRange(range1[1], range2);\n}\nfunction getRangeClassNames(valueRange, dateRange, baseClassName) {\n var isRange = doRangesOverlap(dateRange, valueRange);\n var classes = [];\n if (isRange) {\n classes.push(baseClassName);\n var isRangeStart = isValueWithinRange(valueRange[0], dateRange);\n var isRangeEnd = isValueWithinRange(valueRange[1], dateRange);\n if (isRangeStart) {\n classes.push(\"\".concat(baseClassName, \"Start\"));\n }\n if (isRangeEnd) {\n classes.push(\"\".concat(baseClassName, \"End\"));\n }\n if (isRangeStart && isRangeEnd) {\n classes.push(\"\".concat(baseClassName, \"BothEnds\"));\n }\n }\n return classes;\n}\nfunction isCompleteValue(value) {\n if (Array.isArray(value)) {\n return value[0] !== null && value[1] !== null;\n }\n return value !== null;\n}\nexport function getTileClasses(args) {\n if (!args) {\n throw new Error('args is required');\n }\n var value = args.value, date = args.date, hover = args.hover;\n var className = 'react-calendar__tile';\n var classes = [className];\n if (!date) {\n return classes;\n }\n var now = new Date();\n var dateRange = (function () {\n if (Array.isArray(date)) {\n return date;\n }\n var dateType = args.dateType;\n if (!dateType) {\n throw new Error('dateType is required when date is not an array of two dates');\n }\n return getRange(dateType, date);\n })();\n if (isValueWithinRange(now, dateRange)) {\n classes.push(\"\".concat(className, \"--now\"));\n }\n if (!value || !isCompleteValue(value)) {\n return classes;\n }\n var valueRange = (function () {\n if (Array.isArray(value)) {\n return value;\n }\n var valueType = args.valueType;\n if (!valueType) {\n throw new Error('valueType is required when value is not an array of two dates');\n }\n return getRange(valueType, value);\n })();\n if (isRangeWithinRange(valueRange, dateRange)) {\n classes.push(\"\".concat(className, \"--active\"));\n }\n else if (doRangesOverlap(valueRange, dateRange)) {\n classes.push(\"\".concat(className, \"--hasActive\"));\n }\n var valueRangeClassNames = getRangeClassNames(valueRange, dateRange, \"\".concat(className, \"--range\"));\n classes.push.apply(classes, valueRangeClassNames);\n var valueArray = Array.isArray(value) ? value : [value];\n if (hover && valueArray.length === 1) {\n var hoverRange = hover > valueRange[0] ? [valueRange[0], hover] : [hover, valueRange[0]];\n var hoverRangeClassNames = getRangeClassNames(hoverRange, dateRange, \"\".concat(className, \"--hover\"));\n classes.push.apply(classes, hoverRangeClassNames);\n }\n return classes;\n}\nvar calendarTypeMap = (_a = {},\n _a[DEPRECATED_CALENDAR_TYPES.ARABIC] = CALENDAR_TYPES.ISLAMIC,\n _a[DEPRECATED_CALENDAR_TYPES.HEBREW] = CALENDAR_TYPES.HEBREW,\n _a[DEPRECATED_CALENDAR_TYPES.ISO_8601] = CALENDAR_TYPES.ISO_8601,\n _a[DEPRECATED_CALENDAR_TYPES.US] = CALENDAR_TYPES.GREGORY,\n _a);\nfunction isDeprecatedCalendarType(calendarType) {\n return calendarType !== undefined && calendarType in DEPRECATED_CALENDAR_TYPES;\n}\nvar warned = false;\nexport function mapCalendarType(calendarTypeOrDeprecatedCalendarType) {\n if (isDeprecatedCalendarType(calendarTypeOrDeprecatedCalendarType)) {\n var calendarType = calendarTypeMap[calendarTypeOrDeprecatedCalendarType];\n warning(warned, \"Specifying calendarType=\\\"\".concat(calendarTypeOrDeprecatedCalendarType, \"\\\" is deprecated. Use calendarType=\\\"\").concat(calendarType, \"\\\" instead.\"));\n warned = true;\n return calendarType;\n }\n return calendarTypeOrDeprecatedCalendarType;\n}\n","import React from 'react';\nimport Flex from './Flex.js';\nimport { getTileClasses } from './shared/utils.js';\nexport default function TileGroup(_a) {\n var className = _a.className, _b = _a.count, count = _b === void 0 ? 3 : _b, dateTransform = _a.dateTransform, dateType = _a.dateType, end = _a.end, hover = _a.hover, offset = _a.offset, renderTile = _a.renderTile, start = _a.start, _c = _a.step, step = _c === void 0 ? 1 : _c, value = _a.value, valueType = _a.valueType;\n var tiles = [];\n for (var point = start; point <= end; point += step) {\n var date = dateTransform(point);\n tiles.push(renderTile({\n classes: getTileClasses({\n date: date,\n dateType: dateType,\n hover: hover,\n value: value,\n valueType: valueType,\n }),\n date: date,\n }));\n }\n return (React.createElement(Flex, { className: className, count: count, offset: offset, wrap: true }, tiles));\n}\n","import React, { useMemo } from 'react';\nimport clsx from 'clsx';\nexport default function Tile(props) {\n var activeStartDate = props.activeStartDate, children = props.children, classes = props.classes, date = props.date, formatAbbr = props.formatAbbr, locale = props.locale, maxDate = props.maxDate, maxDateTransform = props.maxDateTransform, minDate = props.minDate, minDateTransform = props.minDateTransform, onClick = props.onClick, onMouseOver = props.onMouseOver, style = props.style, tileClassNameProps = props.tileClassName, tileContentProps = props.tileContent, tileDisabled = props.tileDisabled, view = props.view;\n var tileClassName = useMemo(function () {\n var args = { activeStartDate: activeStartDate, date: date, view: view };\n return typeof tileClassNameProps === 'function' ? tileClassNameProps(args) : tileClassNameProps;\n }, [activeStartDate, date, tileClassNameProps, view]);\n var tileContent = useMemo(function () {\n var args = { activeStartDate: activeStartDate, date: date, view: view };\n return typeof tileContentProps === 'function' ? tileContentProps(args) : tileContentProps;\n }, [activeStartDate, date, tileContentProps, view]);\n return (React.createElement(\"button\", { className: clsx(classes, tileClassName), disabled: (minDate && minDateTransform(minDate) > date) ||\n (maxDate && maxDateTransform(maxDate) < date) ||\n (tileDisabled && tileDisabled({ activeStartDate: activeStartDate, date: date, view: view })), onClick: onClick ? function (event) { return onClick(date, event); } : undefined, onFocus: onMouseOver ? function () { return onMouseOver(date); } : undefined, onMouseOver: onMouseOver ? function () { return onMouseOver(date); } : undefined, style: style, type: \"button\" },\n formatAbbr ? React.createElement(\"abbr\", { \"aria-label\": formatAbbr(locale, date) }, children) : children,\n tileContent));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport React from 'react';\nimport { getDecadeStart, getDecadeEnd } from '@wojtekmaj/date-utils';\nimport Tile from '../Tile.js';\nimport { getDecadeLabel } from '../shared/dates.js';\nimport { formatYear as defaultFormatYear } from '../shared/dateFormatter.js';\nvar className = 'react-calendar__century-view__decades__decade';\nexport default function Decade(_a) {\n var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear = _c === void 0 ? defaultFormatYear : _c, otherProps = __rest(_a, [\"classes\", \"formatYear\"]);\n var date = otherProps.date, locale = otherProps.locale;\n return (React.createElement(Tile, __assign({}, otherProps, { classes: __spreadArray(__spreadArray([], classes, true), [className], false), maxDateTransform: getDecadeEnd, minDateTransform: getDecadeStart, view: \"century\" }), getDecadeLabel(locale, formatYear, date)));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport { getDecadeStart } from '@wojtekmaj/date-utils';\nimport TileGroup from '../TileGroup.js';\nimport Decade from './Decade.js';\nimport { getBeginOfCenturyYear } from '../shared/dates.js';\nexport default function Decades(props) {\n var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest(props, [\"activeStartDate\", \"hover\", \"value\", \"valueType\"]);\n var start = getBeginOfCenturyYear(activeStartDate);\n var end = start + 99;\n return (React.createElement(TileGroup, { className: \"react-calendar__century-view__decades\", dateTransform: getDecadeStart, dateType: \"decade\", end: end, hover: hover, renderTile: function (_a) {\n var date = _a.date, otherTileProps = __rest(_a, [\"date\"]);\n return (React.createElement(Decade, __assign({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));\n }, start: start, step: 10, value: value, valueType: valueType }));\n}\n","var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport PropTypes from 'prop-types';\nimport { CALENDAR_TYPES, DEPRECATED_CALENDAR_TYPES } from './const.js';\nvar calendarTypes = Object.values(CALENDAR_TYPES);\nvar deprecatedCalendarTypes = Object.values(DEPRECATED_CALENDAR_TYPES);\nvar allViews = ['century', 'decade', 'year', 'month'];\nexport var isCalendarType = PropTypes.oneOf(__spreadArray(__spreadArray([], calendarTypes, true), deprecatedCalendarTypes, true));\nexport var isClassName = PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n]);\nexport var isMinDate = function isMinDate(props, propName, componentName) {\n var _a = props, _b = propName, minDate = _a[_b];\n if (!minDate) {\n return null;\n }\n if (!(minDate instanceof Date)) {\n return new Error(\"Invalid prop `\".concat(propName, \"` of type `\").concat(typeof minDate, \"` supplied to `\").concat(componentName, \"`, expected instance of `Date`.\"));\n }\n var maxDate = props.maxDate;\n if (maxDate && minDate > maxDate) {\n return new Error(\"Invalid prop `\".concat(propName, \"` of type `\").concat(typeof minDate, \"` supplied to `\").concat(componentName, \"`, minDate cannot be larger than maxDate.\"));\n }\n return null;\n};\nexport var isMaxDate = function isMaxDate(props, propName, componentName) {\n var _a = props, _b = propName, maxDate = _a[_b];\n if (!maxDate) {\n return null;\n }\n if (!(maxDate instanceof Date)) {\n return new Error(\"Invalid prop `\".concat(propName, \"` of type `\").concat(typeof maxDate, \"` supplied to `\").concat(componentName, \"`, expected instance of `Date`.\"));\n }\n var minDate = props.minDate;\n if (minDate && maxDate < minDate) {\n return new Error(\"Invalid prop `\".concat(propName, \"` of type `\").concat(typeof maxDate, \"` supplied to `\").concat(componentName, \"`, maxDate cannot be smaller than minDate.\"));\n }\n return null;\n};\nexport var isRef = PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.exact({\n current: PropTypes.any,\n }),\n]);\nvar isRange = PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.oneOf([null])]).isRequired);\nexport var isValue = PropTypes.oneOfType([\n PropTypes.instanceOf(Date),\n PropTypes.oneOf([null]),\n isRange,\n]);\nexport var isViews = PropTypes.arrayOf(PropTypes.oneOf(allViews));\nexport var isView = function isView(props, propName, componentName) {\n var _a = props, _b = propName, view = _a[_b];\n if (view !== undefined && (typeof view !== 'string' || allViews.indexOf(view) === -1)) {\n return new Error(\"Invalid prop `\".concat(propName, \"` of value `\").concat(view, \"` supplied to `\").concat(componentName, \"`, expected one of [\").concat(allViews\n .map(function (a) { return \"\\\"\".concat(a, \"\\\"\"); })\n .join(', '), \"].\"));\n }\n // Everything is fine\n return null;\n};\nisView.isRequired = function isViewIsRequired(props, propName, componentName, location, propFullName) {\n var _a = props, _b = propName, view = _a[_b];\n if (!view) {\n return new Error(\"The prop `\".concat(propName, \"` is marked as required in `\").concat(componentName, \"`, but its value is `\").concat(view, \"`.\"));\n }\n return isView(props, propName, componentName, location, propFullName);\n};\nexport var rangeOf = function (type) {\n return PropTypes.arrayOf(type);\n};\nexport var tileGroupProps = {\n activeStartDate: PropTypes.instanceOf(Date).isRequired,\n hover: PropTypes.instanceOf(Date),\n locale: PropTypes.string,\n maxDate: isMaxDate,\n minDate: isMinDate,\n onClick: PropTypes.func,\n onMouseOver: PropTypes.func,\n tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),\n tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n value: isValue,\n valueType: PropTypes.oneOf(['century', 'decade', 'year', 'month', 'day']).isRequired,\n};\nexport var tileProps = {\n activeStartDate: PropTypes.instanceOf(Date).isRequired,\n classes: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,\n date: PropTypes.instanceOf(Date).isRequired,\n locale: PropTypes.string,\n maxDate: isMaxDate,\n minDate: isMinDate,\n onClick: PropTypes.func,\n onMouseOver: PropTypes.func,\n style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),\n tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n tileDisabled: PropTypes.func,\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport React from 'react';\nimport Decades from './CenturyView/Decades.js';\nimport { tileGroupProps } from './shared/propTypes.js';\nvar CenturyView = function CenturyView(props) {\n function renderDecades() {\n return React.createElement(Decades, __assign({}, props));\n }\n return React.createElement(\"div\", { className: \"react-calendar__century-view\" }, renderDecades());\n};\nCenturyView.propTypes = __assign({}, tileGroupProps);\nexport default CenturyView;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport React from 'react';\nimport { getYearStart, getYearEnd } from '@wojtekmaj/date-utils';\nimport Tile from '../Tile.js';\nimport { formatYear as defaultFormatYear } from '../shared/dateFormatter.js';\nvar className = 'react-calendar__decade-view__years__year';\nexport default function Year(_a) {\n var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatYear, formatYear = _c === void 0 ? defaultFormatYear : _c, otherProps = __rest(_a, [\"classes\", \"formatYear\"]);\n var date = otherProps.date, locale = otherProps.locale;\n return (React.createElement(Tile, __assign({}, otherProps, { classes: __spreadArray(__spreadArray([], classes, true), [className], false), maxDateTransform: getYearEnd, minDateTransform: getYearStart, view: \"decade\" }), formatYear(locale, date)));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport { getYearStart } from '@wojtekmaj/date-utils';\nimport TileGroup from '../TileGroup.js';\nimport Year from './Year.js';\nimport { getBeginOfDecadeYear } from '../shared/dates.js';\nexport default function Years(props) {\n var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest(props, [\"activeStartDate\", \"hover\", \"value\", \"valueType\"]);\n var start = getBeginOfDecadeYear(activeStartDate);\n var end = start + 9;\n return (React.createElement(TileGroup, { className: \"react-calendar__decade-view__years\", dateTransform: getYearStart, dateType: \"year\", end: end, hover: hover, renderTile: function (_a) {\n var date = _a.date, otherTileProps = __rest(_a, [\"date\"]);\n return (React.createElement(Year, __assign({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));\n }, start: start, value: value, valueType: valueType }));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport React from 'react';\nimport Years from './DecadeView/Years.js';\nimport { tileGroupProps } from './shared/propTypes.js';\nvar DecadeView = function DecadeView(props) {\n function renderYears() {\n return React.createElement(Years, __assign({}, props));\n }\n return React.createElement(\"div\", { className: \"react-calendar__decade-view\" }, renderYears());\n};\nDecadeView.propTypes = __assign({}, tileGroupProps);\nexport default DecadeView;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport React from 'react';\nimport { getMonthStart, getMonthEnd } from '@wojtekmaj/date-utils';\nimport Tile from '../Tile.js';\nimport { formatMonth as defaultFormatMonth, formatMonthYear as defaultFormatMonthYear, } from '../shared/dateFormatter.js';\nvar className = 'react-calendar__year-view__months__month';\nexport default function Month(_a) {\n var _b = _a.classes, classes = _b === void 0 ? [] : _b, _c = _a.formatMonth, formatMonth = _c === void 0 ? defaultFormatMonth : _c, _d = _a.formatMonthYear, formatMonthYear = _d === void 0 ? defaultFormatMonthYear : _d, otherProps = __rest(_a, [\"classes\", \"formatMonth\", \"formatMonthYear\"]);\n var date = otherProps.date, locale = otherProps.locale;\n return (React.createElement(Tile, __assign({}, otherProps, { classes: __spreadArray(__spreadArray([], classes, true), [className], false), formatAbbr: formatMonthYear, maxDateTransform: getMonthEnd, minDateTransform: getMonthStart, view: \"year\" }), formatMonth(locale, date)));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport { getMonthStart, getYear } from '@wojtekmaj/date-utils';\nimport TileGroup from '../TileGroup.js';\nimport Month from './Month.js';\nexport default function Months(props) {\n var activeStartDate = props.activeStartDate, hover = props.hover, value = props.value, valueType = props.valueType, otherProps = __rest(props, [\"activeStartDate\", \"hover\", \"value\", \"valueType\"]);\n var start = 0;\n var end = 11;\n var year = getYear(activeStartDate);\n return (React.createElement(TileGroup, { className: \"react-calendar__year-view__months\", dateTransform: function (monthIndex) {\n var date = new Date();\n date.setFullYear(year, monthIndex, 1);\n return getMonthStart(date);\n }, dateType: \"month\", end: end, hover: hover, renderTile: function (_a) {\n var date = _a.date, otherTileProps = __rest(_a, [\"date\"]);\n return (React.createElement(Month, __assign({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, date: date })));\n }, start: start, value: value, valueType: valueType }));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport React from 'react';\nimport Months from './YearView/Months.js';\nimport { tileGroupProps } from './shared/propTypes.js';\nvar YearView = function YearView(props) {\n function renderMonths() {\n return React.createElement(Months, __assign({}, props));\n }\n return React.createElement(\"div\", { className: \"react-calendar__year-view\" }, renderMonths());\n};\nYearView.propTypes = __assign({}, tileGroupProps);\nexport default YearView;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport { getDayStart, getDayEnd } from '@wojtekmaj/date-utils';\nimport Tile from '../Tile.js';\nimport { isWeekend } from '../shared/dates.js';\nimport { formatDay as defaultFormatDay, formatLongDate as defaultFormatLongDate, } from '../shared/dateFormatter.js';\nimport { mapCalendarType } from '../shared/utils.js';\nvar className = 'react-calendar__month-view__days__day';\nexport default function Day(_a) {\n var calendarTypeOrDeprecatedCalendarType = _a.calendarType, _b = _a.classes, classes = _b === void 0 ? [] : _b, currentMonthIndex = _a.currentMonthIndex, _c = _a.formatDay, formatDay = _c === void 0 ? defaultFormatDay : _c, _d = _a.formatLongDate, formatLongDate = _d === void 0 ? defaultFormatLongDate : _d, otherProps = __rest(_a, [\"calendarType\", \"classes\", \"currentMonthIndex\", \"formatDay\", \"formatLongDate\"]);\n var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);\n var date = otherProps.date, locale = otherProps.locale;\n var classesProps = [];\n if (classes) {\n classesProps.push.apply(classesProps, classes);\n }\n if (className) {\n classesProps.push(className);\n }\n if (isWeekend(date, calendarType)) {\n classesProps.push(\"\".concat(className, \"--weekend\"));\n }\n if (date.getMonth() !== currentMonthIndex) {\n classesProps.push(\"\".concat(className, \"--neighboringMonth\"));\n }\n return (React.createElement(Tile, __assign({}, otherProps, { classes: classesProps, formatAbbr: formatLongDate, maxDateTransform: getDayEnd, minDateTransform: getDayStart, view: \"month\" }), formatDay(locale, date)));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport { getYear, getMonth, getDaysInMonth, getDayStart } from '@wojtekmaj/date-utils';\nimport TileGroup from '../TileGroup.js';\nimport Day from './Day.js';\nimport { getDayOfWeek } from '../shared/dates.js';\nimport { mapCalendarType } from '../shared/utils.js';\nexport default function Days(props) {\n var activeStartDate = props.activeStartDate, calendarTypeOrDeprecatedCalendarType = props.calendarType, hover = props.hover, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks, showNeighboringMonth = props.showNeighboringMonth, value = props.value, valueType = props.valueType, otherProps = __rest(props, [\"activeStartDate\", \"calendarType\", \"hover\", \"showFixedNumberOfWeeks\", \"showNeighboringMonth\", \"value\", \"valueType\"]);\n var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);\n var year = getYear(activeStartDate);\n var monthIndex = getMonth(activeStartDate);\n var hasFixedNumberOfWeeks = showFixedNumberOfWeeks || showNeighboringMonth;\n var dayOfWeek = getDayOfWeek(activeStartDate, calendarType);\n var offset = hasFixedNumberOfWeeks ? 0 : dayOfWeek;\n /**\n * Defines on which day of the month the grid shall start. If we simply show current\n * month, we obviously start on day one, but if showNeighboringMonth is set to\n * true, we need to find the beginning of the week the first day of the month is in.\n */\n var start = (hasFixedNumberOfWeeks ? -dayOfWeek : 0) + 1;\n /**\n * Defines on which day of the month the grid shall end. If we simply show current\n * month, we need to stop on the last day of the month, but if showNeighboringMonth\n * is set to true, we need to find the end of the week the last day of the month is in.\n */\n var end = (function () {\n if (showFixedNumberOfWeeks) {\n // Always show 6 weeks\n return start + 6 * 7 - 1;\n }\n var daysInMonth = getDaysInMonth(activeStartDate);\n if (showNeighboringMonth) {\n var activeEndDate = new Date();\n activeEndDate.setFullYear(year, monthIndex, daysInMonth);\n activeEndDate.setHours(0, 0, 0, 0);\n var daysUntilEndOfTheWeek = 7 - getDayOfWeek(activeEndDate, calendarType) - 1;\n return daysInMonth + daysUntilEndOfTheWeek;\n }\n return daysInMonth;\n })();\n return (React.createElement(TileGroup, { className: \"react-calendar__month-view__days\", count: 7, dateTransform: function (day) {\n var date = new Date();\n date.setFullYear(year, monthIndex, day);\n return getDayStart(date);\n }, dateType: \"day\", hover: hover, end: end, renderTile: function (_a) {\n var date = _a.date, otherTileProps = __rest(_a, [\"date\"]);\n return (React.createElement(Day, __assign({ key: date.getTime() }, otherProps, otherTileProps, { activeStartDate: activeStartDate, calendarType: calendarTypeOrDeprecatedCalendarType, currentMonthIndex: monthIndex, date: date })));\n }, offset: offset, start: start, value: value, valueType: valueType }));\n}\n","import React from 'react';\nimport clsx from 'clsx';\nimport { getYear, getMonth, getMonthStart } from '@wojtekmaj/date-utils';\nimport Flex from '../Flex.js';\nimport { getDayOfWeek, isCurrentDayOfWeek, isWeekend } from '../shared/dates.js';\nimport { formatShortWeekday as defaultFormatShortWeekday, formatWeekday as defaultFormatWeekday, } from '../shared/dateFormatter.js';\nimport { mapCalendarType } from '../shared/utils.js';\nvar className = 'react-calendar__month-view__weekdays';\nvar weekdayClassName = \"\".concat(className, \"__weekday\");\nexport default function Weekdays(props) {\n var calendarTypeOrDeprecatedCalendarType = props.calendarType, _a = props.formatShortWeekday, formatShortWeekday = _a === void 0 ? defaultFormatShortWeekday : _a, _b = props.formatWeekday, formatWeekday = _b === void 0 ? defaultFormatWeekday : _b, locale = props.locale, onMouseLeave = props.onMouseLeave;\n var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);\n var anyDate = new Date();\n var beginOfMonth = getMonthStart(anyDate);\n var year = getYear(beginOfMonth);\n var monthIndex = getMonth(beginOfMonth);\n var weekdays = [];\n for (var weekday = 1; weekday <= 7; weekday += 1) {\n var weekdayDate = new Date(year, monthIndex, weekday - getDayOfWeek(beginOfMonth, calendarType));\n var abbr = formatWeekday(locale, weekdayDate);\n weekdays.push(React.createElement(\"div\", { key: weekday, className: clsx(weekdayClassName, isCurrentDayOfWeek(weekdayDate) && \"\".concat(weekdayClassName, \"--current\"), isWeekend(weekdayDate, calendarType) && \"\".concat(weekdayClassName, \"--weekend\")) },\n React.createElement(\"abbr\", { \"aria-label\": abbr, title: abbr }, formatShortWeekday(locale, weekdayDate).replace('.', ''))));\n }\n return (React.createElement(Flex, { className: className, count: 7, onFocus: onMouseLeave, onMouseOver: onMouseLeave }, weekdays));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nvar className = 'react-calendar__tile';\nexport default function WeekNumber(props) {\n var onClickWeekNumber = props.onClickWeekNumber, weekNumber = props.weekNumber;\n var children = React.createElement(\"span\", null, weekNumber);\n if (onClickWeekNumber) {\n var date_1 = props.date, onClickWeekNumber_1 = props.onClickWeekNumber, weekNumber_1 = props.weekNumber, otherProps = __rest(props, [\"date\", \"onClickWeekNumber\", \"weekNumber\"]);\n return (React.createElement(\"button\", __assign({}, otherProps, { className: className, onClick: function (event) { return onClickWeekNumber_1(weekNumber_1, date_1, event); }, type: \"button\" }), children));\n }\n else {\n var date = props.date, onClickWeekNumber_2 = props.onClickWeekNumber, weekNumber_2 = props.weekNumber, otherProps = __rest(props, [\"date\", \"onClickWeekNumber\", \"weekNumber\"]);\n return (React.createElement(\"div\", __assign({}, otherProps, { className: className }), children));\n }\n}\n","import React from 'react';\nimport { getYear, getMonth, getDate, getDaysInMonth } from '@wojtekmaj/date-utils';\nimport WeekNumber from './WeekNumber.js';\nimport Flex from '../Flex.js';\nimport { getBeginOfWeek, getDayOfWeek, getWeekNumber } from '../shared/dates.js';\nimport { mapCalendarType } from '../shared/utils.js';\nexport default function WeekNumbers(props) {\n var activeStartDate = props.activeStartDate, calendarTypeOrDeprecatedCalendarType = props.calendarType, onClickWeekNumber = props.onClickWeekNumber, onMouseLeave = props.onMouseLeave, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks;\n var calendarType = mapCalendarType(calendarTypeOrDeprecatedCalendarType);\n var numberOfWeeks = (function () {\n if (showFixedNumberOfWeeks) {\n return 6;\n }\n var numberOfDays = getDaysInMonth(activeStartDate);\n var startWeekday = getDayOfWeek(activeStartDate, calendarType);\n var days = numberOfDays - (7 - startWeekday);\n return 1 + Math.ceil(days / 7);\n })();\n var dates = (function () {\n var year = getYear(activeStartDate);\n var monthIndex = getMonth(activeStartDate);\n var day = getDate(activeStartDate);\n var result = [];\n for (var index = 0; index < numberOfWeeks; index += 1) {\n result.push(getBeginOfWeek(new Date(year, monthIndex, day + index * 7), calendarType));\n }\n return result;\n })();\n var weekNumbers = dates.map(function (date) { return getWeekNumber(date, calendarType); });\n return (React.createElement(Flex, { className: \"react-calendar__month-view__weekNumbers\", count: numberOfWeeks, direction: \"column\", onFocus: onMouseLeave, onMouseOver: onMouseLeave, style: { flexBasis: 'calc(100% * (1 / 8)', flexShrink: 0 } }, weekNumbers.map(function (weekNumber, weekIndex) {\n var date = dates[weekIndex];\n if (!date) {\n throw new Error('date is not defined');\n }\n return (React.createElement(WeekNumber, { key: weekNumber, date: date, onClickWeekNumber: onClickWeekNumber, weekNumber: weekNumber }));\n })));\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport Days from './MonthView/Days.js';\nimport Weekdays from './MonthView/Weekdays.js';\nimport WeekNumbers from './MonthView/WeekNumbers.js';\nimport { CALENDAR_TYPES, CALENDAR_TYPE_LOCALES } from './shared/const.js';\nimport { isCalendarType, tileGroupProps } from './shared/propTypes.js';\nfunction getCalendarTypeFromLocale(locale) {\n if (locale) {\n for (var _i = 0, _a = Object.entries(CALENDAR_TYPE_LOCALES); _i < _a.length; _i++) {\n var _b = _a[_i], calendarType = _b[0], locales = _b[1];\n if (locales.includes(locale)) {\n return calendarType;\n }\n }\n }\n return CALENDAR_TYPES.ISO_8601;\n}\nvar MonthView = function MonthView(props) {\n var activeStartDate = props.activeStartDate, locale = props.locale, onMouseLeave = props.onMouseLeave, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks;\n var _a = props.calendarType, calendarType = _a === void 0 ? getCalendarTypeFromLocale(locale) : _a, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, onClickWeekNumber = props.onClickWeekNumber, showWeekNumbers = props.showWeekNumbers, childProps = __rest(props, [\"calendarType\", \"formatShortWeekday\", \"formatWeekday\", \"onClickWeekNumber\", \"showWeekNumbers\"]);\n function renderWeekdays() {\n return (React.createElement(Weekdays, { calendarType: calendarType, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, locale: locale, onMouseLeave: onMouseLeave }));\n }\n function renderWeekNumbers() {\n if (!showWeekNumbers) {\n return null;\n }\n return (React.createElement(WeekNumbers, { activeStartDate: activeStartDate, calendarType: calendarType, onClickWeekNumber: onClickWeekNumber, onMouseLeave: onMouseLeave, showFixedNumberOfWeeks: showFixedNumberOfWeeks }));\n }\n function renderDays() {\n return React.createElement(Days, __assign({ calendarType: calendarType }, childProps));\n }\n var className = 'react-calendar__month-view';\n return (React.createElement(\"div\", { className: clsx(className, showWeekNumbers ? \"\".concat(className, \"--weekNumbers\") : '') },\n React.createElement(\"div\", { style: {\n display: 'flex',\n alignItems: 'flex-end',\n } },\n renderWeekNumbers(),\n React.createElement(\"div\", { style: {\n flexGrow: 1,\n width: '100%',\n } },\n renderWeekdays(),\n renderDays()))));\n};\nMonthView.propTypes = __assign(__assign({}, tileGroupProps), { calendarType: isCalendarType, formatDay: PropTypes.func, formatLongDate: PropTypes.func, formatShortWeekday: PropTypes.func, formatWeekday: PropTypes.func, onClickWeekNumber: PropTypes.func, onMouseLeave: PropTypes.func, showFixedNumberOfWeeks: PropTypes.bool, showNeighboringMonth: PropTypes.bool, showWeekNumbers: PropTypes.bool });\nexport default MonthView;\n","'use client';\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport React, { forwardRef, useCallback, useImperativeHandle, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport Navigation from './Calendar/Navigation.js';\nimport CenturyView from './CenturyView.js';\nimport DecadeView from './DecadeView.js';\nimport YearView from './YearView.js';\nimport MonthView from './MonthView.js';\nimport { getBegin, getBeginNext, getEnd, getValueRange } from './shared/dates.js';\nimport { isCalendarType, isClassName, isMaxDate, isMinDate, isRef, isView, rangeOf, } from './shared/propTypes.js';\nimport { between } from './shared/utils.js';\nvar baseClassName = 'react-calendar';\nvar allViews = ['century', 'decade', 'year', 'month'];\nvar allValueTypes = ['decade', 'year', 'month', 'day'];\nvar defaultMinDate = new Date();\ndefaultMinDate.setFullYear(1, 0, 1);\ndefaultMinDate.setHours(0, 0, 0, 0);\nvar defaultMaxDate = new Date(8.64e15);\nfunction toDate(value) {\n if (value instanceof Date) {\n return value;\n }\n return new Date(value);\n}\n/**\n * Returns views array with disallowed values cut off.\n */\nfunction getLimitedViews(minDetail, maxDetail) {\n return allViews.slice(allViews.indexOf(minDetail), allViews.indexOf(maxDetail) + 1);\n}\n/**\n * Determines whether a given view is allowed with currently applied settings.\n */\nfunction isViewAllowed(view, minDetail, maxDetail) {\n var views = getLimitedViews(minDetail, maxDetail);\n return views.indexOf(view) !== -1;\n}\n/**\n * Gets either provided view if allowed by minDetail and maxDetail, or gets\n * the default view if not allowed.\n */\nfunction getView(view, minDetail, maxDetail) {\n if (!view) {\n return maxDetail;\n }\n if (isViewAllowed(view, minDetail, maxDetail)) {\n return view;\n }\n return maxDetail;\n}\n/**\n * Returns value type that can be returned with currently applied settings.\n */\nfunction getValueType(view) {\n var index = allViews.indexOf(view);\n return allValueTypes[index];\n}\nfunction getValue(value, index) {\n var rawValue = Array.isArray(value) ? value[index] : value;\n if (!rawValue) {\n return null;\n }\n var valueDate = toDate(rawValue);\n if (isNaN(valueDate.getTime())) {\n throw new Error(\"Invalid date: \".concat(value));\n }\n return valueDate;\n}\nfunction getDetailValue(_a, index) {\n var value = _a.value, minDate = _a.minDate, maxDate = _a.maxDate, maxDetail = _a.maxDetail;\n var valuePiece = getValue(value, index);\n if (!valuePiece) {\n return null;\n }\n var valueType = getValueType(maxDetail);\n var detailValueFrom = (function () {\n switch (index) {\n case 0:\n return getBegin(valueType, valuePiece);\n case 1:\n return getEnd(valueType, valuePiece);\n default:\n throw new Error(\"Invalid index value: \".concat(index));\n }\n })();\n return between(detailValueFrom, minDate, maxDate);\n}\nvar getDetailValueFrom = function (args) { return getDetailValue(args, 0); };\nvar getDetailValueTo = function (args) { return getDetailValue(args, 1); };\nvar getDetailValueArray = function (args) {\n return [getDetailValueFrom, getDetailValueTo].map(function (fn) { return fn(args); });\n};\nfunction getActiveStartDate(_a) {\n var maxDate = _a.maxDate, maxDetail = _a.maxDetail, minDate = _a.minDate, minDetail = _a.minDetail, value = _a.value, view = _a.view;\n var rangeType = getView(view, minDetail, maxDetail);\n var valueFrom = getDetailValueFrom({\n value: value,\n minDate: minDate,\n maxDate: maxDate,\n maxDetail: maxDetail,\n }) || new Date();\n return getBegin(rangeType, valueFrom);\n}\nfunction getInitialActiveStartDate(_a) {\n var activeStartDate = _a.activeStartDate, defaultActiveStartDate = _a.defaultActiveStartDate, defaultValue = _a.defaultValue, defaultView = _a.defaultView, maxDate = _a.maxDate, maxDetail = _a.maxDetail, minDate = _a.minDate, minDetail = _a.minDetail, value = _a.value, view = _a.view;\n var rangeType = getView(view, minDetail, maxDetail);\n var valueFrom = activeStartDate || defaultActiveStartDate;\n if (valueFrom) {\n return getBegin(rangeType, valueFrom);\n }\n return getActiveStartDate({\n maxDate: maxDate,\n maxDetail: maxDetail,\n minDate: minDate,\n minDetail: minDetail,\n value: value || defaultValue,\n view: view || defaultView,\n });\n}\nfunction getIsSingleValue(value) {\n return value && (!Array.isArray(value) || value.length === 1);\n}\nfunction areDatesEqual(date1, date2) {\n return date1 instanceof Date && date2 instanceof Date && date1.getTime() === date2.getTime();\n}\nvar Calendar = forwardRef(function Calendar(props, ref) {\n var activeStartDateProps = props.activeStartDate, allowPartialRange = props.allowPartialRange, calendarType = props.calendarType, className = props.className, defaultActiveStartDate = props.defaultActiveStartDate, defaultValue = props.defaultValue, defaultView = props.defaultView, formatDay = props.formatDay, formatLongDate = props.formatLongDate, formatMonth = props.formatMonth, formatMonthYear = props.formatMonthYear, formatShortWeekday = props.formatShortWeekday, formatWeekday = props.formatWeekday, formatYear = props.formatYear, _a = props.goToRangeStartOnSelect, goToRangeStartOnSelect = _a === void 0 ? true : _a, inputRef = props.inputRef, locale = props.locale, _b = props.maxDate, maxDate = _b === void 0 ? defaultMaxDate : _b, _c = props.maxDetail, maxDetail = _c === void 0 ? 'month' : _c, _d = props.minDate, minDate = _d === void 0 ? defaultMinDate : _d, _e = props.minDetail, minDetail = _e === void 0 ? 'century' : _e, navigationAriaLabel = props.navigationAriaLabel, navigationAriaLive = props.navigationAriaLive, navigationLabel = props.navigationLabel, next2AriaLabel = props.next2AriaLabel, next2Label = props.next2Label, nextAriaLabel = props.nextAriaLabel, nextLabel = props.nextLabel, onActiveStartDateChange = props.onActiveStartDateChange, onChangeProps = props.onChange, onClickDay = props.onClickDay, onClickDecade = props.onClickDecade, onClickMonth = props.onClickMonth, onClickWeekNumber = props.onClickWeekNumber, onClickYear = props.onClickYear, onDrillDown = props.onDrillDown, onDrillUp = props.onDrillUp, onViewChange = props.onViewChange, prev2AriaLabel = props.prev2AriaLabel, prev2Label = props.prev2Label, prevAriaLabel = props.prevAriaLabel, prevLabel = props.prevLabel, _f = props.returnValue, returnValue = _f === void 0 ? 'start' : _f, selectRange = props.selectRange, showDoubleView = props.showDoubleView, showFixedNumberOfWeeks = props.showFixedNumberOfWeeks, _g = props.showNavigation, showNavigation = _g === void 0 ? true : _g, _h = props.showNeighboringMonth, showNeighboringMonth = _h === void 0 ? true : _h, showWeekNumbers = props.showWeekNumbers, tileClassName = props.tileClassName, tileContent = props.tileContent, tileDisabled = props.tileDisabled, valueProps = props.value, viewProps = props.view;\n var _j = useState(defaultActiveStartDate), activeStartDateState = _j[0], setActiveStartDateState = _j[1];\n var _k = useState(null), hoverState = _k[0], setHoverState = _k[1];\n var _l = useState(Array.isArray(defaultValue)\n ? defaultValue.map(function (el) { return (el !== null ? toDate(el) : null); })\n : defaultValue !== null && defaultValue !== undefined\n ? toDate(defaultValue)\n : null), valueState = _l[0], setValueState = _l[1];\n var _m = useState(defaultView), viewState = _m[0], setViewState = _m[1];\n var activeStartDate = activeStartDateProps ||\n activeStartDateState ||\n getInitialActiveStartDate({\n activeStartDate: activeStartDateProps,\n defaultActiveStartDate: defaultActiveStartDate,\n defaultValue: defaultValue,\n defaultView: defaultView,\n maxDate: maxDate,\n maxDetail: maxDetail,\n minDate: minDate,\n minDetail: minDetail,\n value: valueProps,\n view: viewProps,\n });\n var value = (function () {\n var rawValue = (function () {\n // In the middle of range selection, use value from state\n if (selectRange && getIsSingleValue(valueState)) {\n return valueState;\n }\n return valueProps !== undefined ? valueProps : valueState;\n })();\n if (!rawValue) {\n return null;\n }\n return Array.isArray(rawValue)\n ? rawValue.map(function (el) { return (el !== null ? toDate(el) : null); })\n : rawValue !== null\n ? toDate(rawValue)\n : null;\n })();\n var valueType = getValueType(maxDetail);\n var view = getView(viewProps || viewState, minDetail, maxDetail);\n var views = getLimitedViews(minDetail, maxDetail);\n var hover = selectRange ? hoverState : null;\n var drillDownAvailable = views.indexOf(view) < views.length - 1;\n var drillUpAvailable = views.indexOf(view) > 0;\n var getProcessedValue = useCallback(function (value) {\n var processFunction = (function () {\n switch (returnValue) {\n case 'start':\n return getDetailValueFrom;\n case 'end':\n return getDetailValueTo;\n case 'range':\n return getDetailValueArray;\n default:\n throw new Error('Invalid returnValue.');\n }\n })();\n return processFunction({\n maxDate: maxDate,\n maxDetail: maxDetail,\n minDate: minDate,\n value: value,\n });\n }, [maxDate, maxDetail, minDate, returnValue]);\n var setActiveStartDate = useCallback(function (nextActiveStartDate, action) {\n setActiveStartDateState(nextActiveStartDate);\n var args = {\n action: action,\n activeStartDate: nextActiveStartDate,\n value: value,\n view: view,\n };\n if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {\n onActiveStartDateChange(args);\n }\n }, [activeStartDate, onActiveStartDateChange, value, view]);\n var onClickTile = useCallback(function (value, event) {\n var callback = (function () {\n switch (view) {\n case 'century':\n return onClickDecade;\n case 'decade':\n return onClickYear;\n case 'year':\n return onClickMonth;\n case 'month':\n return onClickDay;\n default:\n throw new Error(\"Invalid view: \".concat(view, \".\"));\n }\n })();\n if (callback)\n callback(value, event);\n }, [onClickDay, onClickDecade, onClickMonth, onClickYear, view]);\n var drillDown = useCallback(function (nextActiveStartDate, event) {\n if (!drillDownAvailable) {\n return;\n }\n onClickTile(nextActiveStartDate, event);\n var nextView = views[views.indexOf(view) + 1];\n if (!nextView) {\n throw new Error('Attempted to drill down from the lowest view.');\n }\n setActiveStartDateState(nextActiveStartDate);\n setViewState(nextView);\n var args = {\n action: 'drillDown',\n activeStartDate: nextActiveStartDate,\n value: value,\n view: nextView,\n };\n if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {\n onActiveStartDateChange(args);\n }\n if (onViewChange && view !== nextView) {\n onViewChange(args);\n }\n if (onDrillDown) {\n onDrillDown(args);\n }\n }, [\n activeStartDate,\n drillDownAvailable,\n onActiveStartDateChange,\n onClickTile,\n onDrillDown,\n onViewChange,\n value,\n view,\n views,\n ]);\n var drillUp = useCallback(function () {\n if (!drillUpAvailable) {\n return;\n }\n var nextView = views[views.indexOf(view) - 1];\n if (!nextView) {\n throw new Error('Attempted to drill up from the highest view.');\n }\n var nextActiveStartDate = getBegin(nextView, activeStartDate);\n setActiveStartDateState(nextActiveStartDate);\n setViewState(nextView);\n var args = {\n action: 'drillUp',\n activeStartDate: nextActiveStartDate,\n value: value,\n view: nextView,\n };\n if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {\n onActiveStartDateChange(args);\n }\n if (onViewChange && view !== nextView) {\n onViewChange(args);\n }\n if (onDrillUp) {\n onDrillUp(args);\n }\n }, [\n activeStartDate,\n drillUpAvailable,\n onActiveStartDateChange,\n onDrillUp,\n onViewChange,\n value,\n view,\n views,\n ]);\n var onChange = useCallback(function (rawNextValue, event) {\n var previousValue = value;\n onClickTile(rawNextValue, event);\n var isFirstValueInRange = selectRange && !getIsSingleValue(previousValue);\n var nextValue;\n if (selectRange) {\n // Range selection turned on\n if (isFirstValueInRange) {\n // Value has 0 or 2 elements - either way we're starting a new array\n // First value\n nextValue = getBegin(valueType, rawNextValue);\n }\n else {\n if (!previousValue) {\n throw new Error('previousValue is required');\n }\n if (Array.isArray(previousValue)) {\n throw new Error('previousValue must not be an array');\n }\n // Second value\n nextValue = getValueRange(valueType, previousValue, rawNextValue);\n }\n }\n else {\n // Range selection turned off\n nextValue = getProcessedValue(rawNextValue);\n }\n var nextActiveStartDate = \n // Range selection turned off\n !selectRange ||\n // Range selection turned on, first value\n isFirstValueInRange ||\n // Range selection turned on, second value, goToRangeStartOnSelect toggled on\n goToRangeStartOnSelect\n ? getActiveStartDate({\n maxDate: maxDate,\n maxDetail: maxDetail,\n minDate: minDate,\n minDetail: minDetail,\n value: nextValue,\n view: view,\n })\n : null;\n event.persist();\n setActiveStartDateState(nextActiveStartDate);\n setValueState(nextValue);\n var args = {\n action: 'onChange',\n activeStartDate: nextActiveStartDate,\n value: nextValue,\n view: view,\n };\n if (onActiveStartDateChange && !areDatesEqual(activeStartDate, nextActiveStartDate)) {\n onActiveStartDateChange(args);\n }\n if (onChangeProps) {\n if (selectRange) {\n var isSingleValue = getIsSingleValue(nextValue);\n if (!isSingleValue) {\n onChangeProps(nextValue || null, event);\n }\n else if (allowPartialRange) {\n if (Array.isArray(nextValue)) {\n throw new Error('value must not be an array');\n }\n onChangeProps([nextValue || null, null], event);\n }\n }\n else {\n onChangeProps(nextValue || null, event);\n }\n }\n }, [\n activeStartDate,\n allowPartialRange,\n getProcessedValue,\n goToRangeStartOnSelect,\n maxDate,\n maxDetail,\n minDate,\n minDetail,\n onActiveStartDateChange,\n onChangeProps,\n onClickTile,\n selectRange,\n value,\n valueType,\n view,\n ]);\n function onMouseOver(nextHover) {\n setHoverState(nextHover);\n }\n function onMouseLeave() {\n setHoverState(null);\n }\n useImperativeHandle(ref, function () { return ({\n activeStartDate: activeStartDate,\n drillDown: drillDown,\n drillUp: drillUp,\n onChange: onChange,\n setActiveStartDate: setActiveStartDate,\n value: value,\n view: view,\n }); }, [activeStartDate, drillDown, drillUp, onChange, setActiveStartDate, value, view]);\n function renderContent(next) {\n var currentActiveStartDate = next\n ? getBeginNext(view, activeStartDate)\n : getBegin(view, activeStartDate);\n var onClick = drillDownAvailable ? drillDown : onChange;\n var commonProps = {\n activeStartDate: currentActiveStartDate,\n hover: hover,\n locale: locale,\n maxDate: maxDate,\n minDate: minDate,\n onClick: onClick,\n onMouseOver: selectRange ? onMouseOver : undefined,\n tileClassName: tileClassName,\n tileContent: tileContent,\n tileDisabled: tileDisabled,\n value: value,\n valueType: valueType,\n };\n switch (view) {\n case 'century': {\n return React.createElement(CenturyView, __assign({ formatYear: formatYear }, commonProps));\n }\n case 'decade': {\n return React.createElement(DecadeView, __assign({ formatYear: formatYear }, commonProps));\n }\n case 'year': {\n return (React.createElement(YearView, __assign({ formatMonth: formatMonth, formatMonthYear: formatMonthYear }, commonProps)));\n }\n case 'month': {\n return (React.createElement(MonthView, __assign({ calendarType: calendarType, formatDay: formatDay, formatLongDate: formatLongDate, formatShortWeekday: formatShortWeekday, formatWeekday: formatWeekday, onClickWeekNumber: onClickWeekNumber, onMouseLeave: selectRange ? onMouseLeave : undefined, showFixedNumberOfWeeks: typeof showFixedNumberOfWeeks !== 'undefined'\n ? showFixedNumberOfWeeks\n : showDoubleView, showNeighboringMonth: showNeighboringMonth, showWeekNumbers: showWeekNumbers }, commonProps)));\n }\n default:\n throw new Error(\"Invalid view: \".concat(view, \".\"));\n }\n }\n function renderNavigation() {\n if (!showNavigation) {\n return null;\n }\n return (React.createElement(Navigation, { activeStartDate: activeStartDate, drillUp: drillUp, formatMonthYear: formatMonthYear, formatYear: formatYear, locale: locale, maxDate: maxDate, minDate: minDate, navigationAriaLabel: navigationAriaLabel, navigationAriaLive: navigationAriaLive, navigationLabel: navigationLabel, next2AriaLabel: next2AriaLabel, next2Label: next2Label, nextAriaLabel: nextAriaLabel, nextLabel: nextLabel, prev2AriaLabel: prev2AriaLabel, prev2Label: prev2Label, prevAriaLabel: prevAriaLabel, prevLabel: prevLabel, setActiveStartDate: setActiveStartDate, showDoubleView: showDoubleView, view: view, views: views }));\n }\n var valueArray = Array.isArray(value) ? value : [value];\n return (React.createElement(\"div\", { className: clsx(baseClassName, selectRange && valueArray.length === 1 && \"\".concat(baseClassName, \"--selectRange\"), showDoubleView && \"\".concat(baseClassName, \"--doubleView\"), className), ref: inputRef },\n renderNavigation(),\n React.createElement(\"div\", { className: \"\".concat(baseClassName, \"__viewContainer\"), onBlur: selectRange ? onMouseLeave : undefined, onMouseLeave: selectRange ? onMouseLeave : undefined },\n renderContent(),\n showDoubleView ? renderContent(true) : null)));\n});\nvar isActiveStartDate = PropTypes.instanceOf(Date);\nvar isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);\nvar isValueOrValueArray = PropTypes.oneOfType([isValue, rangeOf(isValue)]);\nCalendar.propTypes = {\n activeStartDate: isActiveStartDate,\n allowPartialRange: PropTypes.bool,\n calendarType: isCalendarType,\n className: isClassName,\n defaultActiveStartDate: isActiveStartDate,\n defaultValue: isValueOrValueArray,\n defaultView: isView,\n formatDay: PropTypes.func,\n formatLongDate: PropTypes.func,\n formatMonth: PropTypes.func,\n formatMonthYear: PropTypes.func,\n formatShortWeekday: PropTypes.func,\n formatWeekday: PropTypes.func,\n formatYear: PropTypes.func,\n goToRangeStartOnSelect: PropTypes.bool,\n inputRef: isRef,\n locale: PropTypes.string,\n maxDate: isMaxDate,\n maxDetail: PropTypes.oneOf(allViews),\n minDate: isMinDate,\n minDetail: PropTypes.oneOf(allViews),\n navigationAriaLabel: PropTypes.string,\n navigationAriaLive: PropTypes.oneOf(['off', 'polite', 'assertive']),\n navigationLabel: PropTypes.func,\n next2AriaLabel: PropTypes.string,\n next2Label: PropTypes.node,\n nextAriaLabel: PropTypes.string,\n nextLabel: PropTypes.node,\n onActiveStartDateChange: PropTypes.func,\n onChange: PropTypes.func,\n onClickDay: PropTypes.func,\n onClickDecade: PropTypes.func,\n onClickMonth: PropTypes.func,\n onClickWeekNumber: PropTypes.func,\n onClickYear: PropTypes.func,\n onDrillDown: PropTypes.func,\n onDrillUp: PropTypes.func,\n onViewChange: PropTypes.func,\n prev2AriaLabel: PropTypes.string,\n prev2Label: PropTypes.node,\n prevAriaLabel: PropTypes.string,\n prevLabel: PropTypes.node,\n returnValue: PropTypes.oneOf(['start', 'end', 'range']),\n selectRange: PropTypes.bool,\n showDoubleView: PropTypes.bool,\n showFixedNumberOfWeeks: PropTypes.bool,\n showNavigation: PropTypes.bool,\n showNeighboringMonth: PropTypes.bool,\n showWeekNumbers: PropTypes.bool,\n tileClassName: PropTypes.oneOfType([PropTypes.func, isClassName]),\n tileContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n tileDisabled: PropTypes.func,\n value: isValueOrValueArray,\n view: isView,\n};\nexport default Calendar;\n","import Calendar from './Calendar.js';\nimport CenturyView from './CenturyView.js';\nimport DecadeView from './DecadeView.js';\nimport MonthView from './MonthView.js';\nimport Navigation from './Calendar/Navigation.js';\nimport YearView from './YearView.js';\nexport { Calendar, CenturyView, DecadeView, MonthView, Navigation, YearView };\nexport default Calendar;\n","// extracted by mini-css-extract-plugin\nexport default {\"with-shadow\":\"Calendar_with-shadow__EKMT4\",\"disabledChange\":\"Calendar_disabledChange__37iOz\",\"custom-calendar\":\"Calendar_custom-calendar__FKc-G\"};","import ReactCalendar from \"react-calendar\";\nimport { useTranslation } from \"react-i18next\";\nimport { ArrowLeft, ArrowRight } from \"@assets/icons\";\n\n// import 'react-calendar/dist/Calendar.css';\nimport clsx from \"clsx\";\nimport styles from \"./Calendar.module.scss\";\n\nconst Calendar = ({\n value,\n onChange,\n minDate,\n maxDate,\n withoutShadow = false,\n className,\n disabledChange = false,\n ...props\n}) => {\n const { i18n } = useTranslation();\n\n return (\n\n {value.length}/{maxLength}\n\n )}\n}\n nextLabel={ }\n prev2Label={null}\n next2Label={null}\n minDate={minDate}\n maxDate={maxDate}\n tileClassName={styles[\"custom-calendar__tile\"]}\n {...props}\n />\n );\n};\n\nexport default Calendar;\n","// extracted by mini-css-extract-plugin\nexport default {\"sliderInput\":\"Slider_sliderInput__pFZnx\",\"sliderInputContainer\":\"Slider_sliderInputContainer__0Var5\",\"backgroundLeftLayer\":\"Slider_backgroundLeftLayer__9sW0L\",\"withoutColorLeftLayer\":\"Slider_withoutColorLeftLayer__6oWPT\",\"whiteColorLeftLayer\":\"Slider_whiteColorLeftLayer__kY1GM\",\"backgroundRightLayer\":\"Slider_backgroundRightLayer__6i0Nw\",\"whitebackgroundRightLayer\":\"Slider_whitebackgroundRightLayer__baGnW\"};","import {\n useEffect, useRef, useState, useCallback, useMemo,\n} from 'react';\nimport clsx from 'clsx';\n\nimport styles from './Slider.module.scss';\n\nconst Slider = ({\n className, containerClassName, value = 0, min = 0, max = 10, step = 0.5, onChange, whiteBackGroundColor=false,withoutBackGroundColor=false, number = true\n}) => {\n const [valueWidth, setValueWidth] = useState(0);\n const sliderWidth = useRef(null);\n\n const steps = useMemo(() => {\n const comps = [];\n for (let i = min; i <= max; i += step) {\n comps.push(\n ({style}) => {i},\n );\n }\n return comps;\n }, [min, max, step]);\n\n const recalculateSize = useCallback(() => {\n setValueWidth(((max - value) / (max - min)) * sliderWidth.current.offsetWidth);\n }, [max, min, value]);\n\n useEffect(() => {\n window.addEventListener('resize', recalculateSize);\n\n return () => {\n window.removeEventListener('resize', recalculateSize);\n };\n }, [recalculateSize]);\n\n useEffect(() => {\n if (!sliderWidth.current) {\n return;\n }\n\n setValueWidth(((max - value) / (max - min)) * sliderWidth.current.offsetWidth);\n }, [value, sliderWidth?.current]);\n \n return (\n\n\n );\n};\n\nexport default Slider;\n","function toVal(mix) {\n\tvar k, y, str='';\n\n\tif (typeof mix === 'string' || typeof mix === 'number') {\n\t\tstr += mix;\n\t} else if (typeof mix === 'object') {\n\t\tif (Array.isArray(mix)) {\n\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tif (y = toVal(mix[k])) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (k in mix) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\tstr += k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn str;\n}\n\nexport default function () {\n\tvar i=0, tmp, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (tmp = arguments[i++]) {\n\t\t\tif (x = toVal(tmp)) {\n\t\t\t\tstr && (str += ' ');\n\t\t\t\tstr += x\n\t\t\t}\n\t\t}\n\t}\n\treturn str;\n}\n","import { toast, ToastContainer } from \"react-toastify\";\nimport { useTranslation } from \"react-i18next\";\nimport { Inbox, Trash, Archive, Note } from \"@assets/icons\";\nimport \"react-toastify/dist/ReactToastify.css\";\n\nconst BaseToast = ({ closeToast, icon, message }) => {\n const { t } = useTranslation();\n\n return (\n\n \n \n \n\n {number &&\n\n {steps.map((Step, index) => (\n\n }\n\n ))}\n \n\n );\n};\n\nconst Info = ({ closeToast, message }) => (\n\n {icon}\n {message}\n\n \n {t(\"common.close\")}\n \n} />\n);\nconst Deleted = ({ closeToast, message }) => (\n }\n />\n);\nconst ChatArchived = ({ closeToast, message }) => (\n }\n />\n);\nconst Success = ({ closeToast, message }) => (\n }\n />\n);\nconst PopupError = ({ closeToast, message }) => (\n }\n />\n);\n\nconst NotifyByType = {\n info: Info,\n deleted: Deleted,\n chatArchived: ChatArchived,\n success: Success,\n error: PopupError,\n};\n\nexport const sendNotify = (message, type) => {\n const Component = NotifyByType[type];\n toast( );\n};\n\nconst GlobalNotify = () => (\n \n);\n\nexport default GlobalNotify;\n","// extracted by mini-css-extract-plugin\nexport default {\"rotate\":\"Loader_rotate__NEbL0\",\"reverse\":\"Loader_reverse__edr1F\"};","import React from 'react';\nimport styles from './Loader.module.scss';\n\nconst Loader = ({\n height = 100, width = 100, stroke = 'var(--colors-primary)', ...props\n}) => (\n \n\n);\n\nexport default Loader;\n","import Modal from 'react-modal';\nimport {Close} from '@assets/icons';\nimport {Button} from '@components/Form';\nimport PropTypes from 'prop-types';\nimport {AnimatePresence, motion} from 'framer-motion';\nimport clsx from 'clsx';\n\nconst customStyles = {\n content: {\n width: '100%',\n height: '100%',\n top: '50%',\n left: '50%',\n right: 'auto',\n bottom: 'auto',\n marginRight: '-50%',\n transform: 'translate(-50%, -50%)',\n border: 'none',\n padding: 0,\n overflow: 'initial',\n background: 'transparent',\n },\n overlay: {\n zIndex: 30,\n background: 'transparent',\n width: '100%',\n height: '100%',\n },\n};\n\nconst CustomModal = ({\n openModal, setOpenModal, className, children, hideCloseButton, outsideClickClose,\n}) => (\n\n \n \n\n\n {openModal\n && (\n \n);\n\nCustomModal.propTypes = {\n openModal: PropTypes.bool.isRequired,\n setOpenModal: PropTypes.func.isRequired,\n className: PropTypes.string,\n hideCloseButton: PropTypes.bool,\n};\n\nCustomModal.defaultProps = {\n className: '',\n hideCloseButton: false,\n};\n\nexport default CustomModal;\n","import {useTranslation} from 'react-i18next';\n\nimport {Button} from '@components/Form';\nimport {CustomModal} from '@components/Modals';\n\nconst FileSizeLimitModal = ({\n isOpened, onSubmit, onToggle, sizeLimit,\n}) => {\n const {t} = useTranslation();\n\n return (\nsetOpenModal(false)}\n >\n \n )}\n{\n if (outsideClickClose) {\n setOpenModal(false);\n }\n }}\n className=\"bg-black w-full h-full flex justify-center items-center bg-opacity-40\"\n initial={{\n opacity: 0,\n }}\n animate={{\n opacity: 1,\n transition: {\n type: 'easyInOut',\n stiffness: 300,\n },\n }}\n exit={{\n opacity: 0,\n transition: {duration: 0.6},\n }}\n >\n \ne.stopPropagation()}\n initial={{\n opacity: 0,\n y: 60,\n scale: 0.5,\n }}\n animate={{\n opacity: 1,\n y: 0,\n scale: 1,\n }}\n exit={{\n opacity: 0,\n scale: 0.5,\n transition: {duration: 0.6},\n }}\n >\n \n\n {!hideCloseButton && (\n \n )}\n {children}\n\n\n \n );\n};\n\nexport default FileSizeLimitModal;\n","/* eslint-disable react/no-array-index-key */\nimport React, { useMemo, useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport clsx from \"clsx\";\nimport { useFormik } from \"formik\";\nimport * as yup from \"yup\";\n\nimport { Button, Input } from \"@components/Form\";\nimport { BoldClose } from \"@assets/icons\";\nimport { setFieldForm } from \"@utils/helpers\";\nimport { CustomModal } from \"@components/Modals\";\nimport { Divider } from \"@components/Static\";\nimport Dropdown from \"@components/Form/Dropdown\";\n\nconst FORM_STATE = {\n FILTERS: \"filters\",\n};\n\nconst UserFilterModal = ({\n isOpened,\n onSubmit,\n onToggle,\n filterOptions,\n filters,\n isShowInfoStrip = false,\n infoStripContent = '',\n}) => {\n const { t } = useTranslation();\n\n const equalityOptions = [\n {\n value: \"true\",\n label: t(\"filterModal.is\"),\n },\n {\n value: \"false\",\n label: t(\"filterModal.isNot\"),\n },\n ];\n\n const validationSchema = yup.object({\n [FORM_STATE.FILTERS]: yup.array().of(\n yup.object().shape({\n key: yup.string().max(50),\n isEqual: yup.boolean(),\n value: yup\n .mixed()\n .when(\"key\", (key, schema) => {\n // Check if filterOptions exists and key is valid\n const option = filterOptions?.find((v) => v.value === key);\n\n if (option?.isNumeric) {\n // If key is numeric, enforce number validation\n return yup.number().required();\n } else {\n // Otherwise, treat as a string with max length\n return yup.string().trim().max(50);\n }\n }),\n })\n ),\n });\n\n\n const initialState = useMemo(\n () => ({ [FORM_STATE.FILTERS]: filters?.length ? filters : [{}] }),\n [filters]\n );\n\n const { handleSubmit, setFieldValue, values, errors, setErrors, resetForm } =\n useFormik({\n initialValues: initialState,\n validationSchema,\n enableReinitialize: true,\n onSubmit: (val) => handleFormSubmit(val),\n });\n\n useEffect(() => {\n if (!isOpened) {\n resetForm();\n }\n }, [isOpened]);\n\n const handleAddCondition = () => {\n setFieldForm(setFieldValue, setErrors, FORM_STATE.FILTERS, [\n ...values[FORM_STATE.FILTERS],\n {},\n ]);\n };\n\n const handleFormSubmit = (formValues) => {\n const result = formValues[FORM_STATE.FILTERS]\n .filter((v) => !!Object.keys(v).length)\n .map((v) => {\n const optionValue = filterOptions.find((j) => j.value === v.key);\n if (!optionValue) {\n return {};\n }\n\n let { value } = v;\n if (optionValue.isNumeric) {\n const numericValue = Number(v.value);\n value = Number.isNaN(numericValue) ? 0 : numericValue;\n }\n\n return {\n key: v.key,\n isEqual: !!v.isEqual,\n value,\n };\n });\n\n onSubmit(result);\n onToggle(false);\n };\n\n const handleFilterDelete = (index) => {\n const filter = values[FORM_STATE.FILTERS][index];\n\n if (!filter) {\n return;\n }\n\n if (values[FORM_STATE.FILTERS].length !== 1) {\n setFieldForm(\n setFieldValue,\n setErrors,\n FORM_STATE.FILTERS,\n values[FORM_STATE.FILTERS].filter((__v, i) => i !== index)\n );\n return;\n }\n\n if (!filter.key) {\n return;\n }\n\n setFieldForm(setFieldValue, setErrors, FORM_STATE.FILTERS, [{}]);\n };\n\n const keyBasedDropdowns = (filter, index) => {\n const optionValue = filterOptions.find((v) => v.value === filter.key);\n\n return (\n\n {t('modal.sizeLimit.title')}\n\n\n {t('modal.sizeLimit.content', {sizeLimit})}\n
\n \n\n\n );\n };\n\n return (\n{\n setFieldForm(\n setFieldValue,\n setErrors,\n `${FORM_STATE.FILTERS}[${index}][value]`,\n undefined\n );\n setFieldForm(\n setFieldValue,\n setErrors,\n `${FORM_STATE.FILTERS}[${index}][key]`,\n value\n );\n }}\n scrollID={`filter-${index}-key`}\n classSelect=\"py-5\"\n options={filterOptions}\n value={filter.key}\n className=\"bg-silver-light flex rounded cursor-pointer w-64\"\n />\n \n setFieldForm(\n setFieldValue,\n setErrors,\n `${FORM_STATE.FILTERS}[${index}][isEqual]`,\n value === \"true\"\n )\n }\n scrollID={`filter-${index}-equality`}\n classSelect=\"py-5\"\n options={equalityOptions}\n value={filter.isEqual ? \"true\" : \"false\"}\n className=\"bg-silver-light flex rounded cursor-pointer w-24 ml-6\"\n />\n {optionValue?.options ? (\n \n setFieldForm(\n setFieldValue,\n setErrors,\n `${FORM_STATE.FILTERS}[${index}][value]`,\n value\n )\n }\n scrollID={`filter-${index}-value`}\n classSelect=\"py-5\"\n options={optionValue.options}\n value={filter.value}\n error={\n errors[FORM_STATE.FILTERS] &&\n errors[FORM_STATE.FILTERS][index]?.value\n }\n className=\"bg-silver-light flex rounded cursor-pointer flex-1 ml-6\"\n />\n ) : (\n {\n if (optionValue.isNumeric && !Number.isInteger(Number(value))) {\n return;\n }\n\n setFieldForm(\n setFieldValue,\n setErrors,\n `${FORM_STATE.FILTERS}[${index}][value]`,\n value\n );\n }}\n />\n )}\n handleFilterDelete(index)}\n className=\"ml-6 cursor-pointer self-center hover:opacity-80\"\n />\n \n \n \n );\n};\n\nexport default React.memo(UserFilterModal);\n","// extracted by mini-css-extract-plugin\nexport default {\"videoModal\":\"VideoPlayerModal_videoModal__ivZ5u\"};","import ProfileVideo from \"@components/ProfileVideo/ProfileVideo\";\nimport CustomModal from \"../CustomModal/CustomModal\";\nimport { useProfileVideoUrl } from \"@hooks/profile\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { Button } from \"@components/Form\";\nimport { useTranslation } from \"react-i18next\";\nimport styles from \"./VideoPlayerModal.module.scss\";\n\nconst VideoPlayerModal = ({\n openModal,\n setOpenModal,\n className,\n profile,\n controlsAllowed,\n isViewMode,\n}) => {\n const { t } = useTranslation();\n const profileVideoUrl = useProfileVideoUrl(\n profile.profileVideoName,\n profile.accountId\n );\n\n return (\n <>\n\n \n >\n );\n};\n\nVideoPlayerModal.propTypes = {\n openModal: PropTypes.bool.isRequired,\n setOpenModal: PropTypes.func.isRequired,\n className: PropTypes.string,\n profile: PropTypes.object.isRequired,\n controlsAllowed: PropTypes.bool,\n isViewMode: PropTypes.bool,\n};\n\nVideoPlayerModal.defaultProps = {\n className: \"\",\n profileVideoUrl: \"\",\n controlsAllowed: true,\n isViewMode: false,\n};\n\nexport default VideoPlayerModal;\n","import { useTranslation } from 'react-i18next';\nimport { Button, Calendar } from '@components/Form';\nimport { CustomModal } from '@components/Modals';\nimport { useState } from 'react';\nimport { addDays } from 'date-fns';\nimport PropTypes from 'prop-types';\n\nconst DatePickerModal = ({\n isOpened, onSubmit, onToggle, existingDate\n}) => {\n const { t } = useTranslation();\n const [endDate, setEndDate] = useState(new Date());\n\n return (\n\n\n\n \n {t(\"common.helloVideoTitle\")}\n \n\n\n {profileVideoUrl ? (\n <>\n\n\n >\n ) : (\n \n\n )}\n\n {t(\"common.noFound\", { name: \"video\" })}\n
\n\n \n\n\n \n );\n};\n\nDatePickerModal.propTypes = {\n isOpened: PropTypes.bool.isRequired,\n onSubmit: PropTypes.func.isRequired,\n onToggle: PropTypes.func.isRequired,\n existingDate: PropTypes.instanceOf(Date).isRequired\n};\n\nexport default DatePickerModal;\n","import clsx from \"clsx\";\nimport {\n BWOther,\n ColorOther,\n} from \"@assets/illustrations\";\nimport { USER_ROLES } from \"@utils/consts\";\nimport { useContext, useState } from \"react\";\nimport { UserContext } from \"@contexts/User\";\nimport Loader from \"@components/Loader\";\n\nconst ProfilePictureItem = ({\n profile,\n profilePictureUrl,\n profilePictureStyle,\n alt,\n isGroupChat,\n}) => {\n const [imgError, setImgError] = useState(false);\n const [isImgLoading, setIsImgLoading] = useState(true);\n\n if (profile?.isAnonymous) {\n return\n {t('modal.endDate.title')}\n\n\n {t('modal.endDate.content')}\n
\n\n\n \n\n\n\n setEndDate(value)\n }\n />\n ;\n }\n\n const handleProfileIllustration = () => {\n return ;\n };\n\n if (!profilePictureUrl) {\n return handleProfileIllustration();\n }\n\n const result = !imgError ? (\n <>\n setImgError(true)}\n onLoad={() => setIsImgLoading(false)}\n alt={alt}\n />\n {isImgLoading && (\n
\n\n )}\n >\n ) : (\n handleProfileIllustration()\n );\n\n return result;\n};\n\nconst ProfilePicture = ({\n profile,\n profilePictureUrl,\n profilePictureStyle = {\n className: \"w-16 h-16\",\n height: 16,\n },\n statusPictureStyle = {\n size: 4,\n className: \"w-4 h-4\",\n },\n isShowOnline = false,\n alt,\n isGroupChat,\n}) => {\n const { htmlFontSize } = useContext(UserContext);\n // eslint-disable-next-line no-nested-ternary\n const onlineStatusSizeBottom = isShowOnline\n ? profilePictureStyle.height < 16\n ? profilePictureStyle.height / statusPictureStyle.size - 1\n : profilePictureStyle.height / statusPictureStyle.size + 1\n : 0;\n\n return (\n\n \n\n );\n};\n\nexport default ProfilePicture;\n","import clsx from \"clsx\";\nimport { useState } from \"react\";\n\nconst ProfileVideoItem = ({ profileVideoUrl, profileVideoStyle ,controlsAllowed,isViewMode ,style ,autoPlayAllowed}) => {\n const [videoError, setVideoError] = useState(false);\n\n if (!profileVideoUrl) {\n return null;\n }\n\n const result = !videoError ? (\n <>\n \n >\n ) : null;\n\n return result;\n};\n\nconst ProfileVideo = ({\n profileVideoUrl,\n profileVideoStyle = {\n className: \"w-16 h-16\"\n },\n controlsAllowed=true,\n isViewMode=true,\n style=null,\n autoPlayAllowed=true\n}) => {\n return (\n\n {isShowOnline && profile?.type === USER_ROLES.COUNSELLOR_ROLE && (\n \n )}\n \n\n );\n};\n\nexport default ProfileVideo;\n","import Skeleton from 'react-loading-skeleton';\n\nexport const loadableAuthParams = {\n fallback: (\n\n \n ),\n};\n\nexport const loadableRootParams = {\n fallback: (\n \n ),\n};\n","import React from \"react\";\nimport { Arrow } from \"@assets/icons\";\nimport { useNavigate } from \"react-router-dom\";\nimport clsx from \"clsx\";\nimport { useTranslation } from \"react-i18next\";\n\nconst Back = ({ link, className, isReplace, onClick }) => {\n const navigate = useNavigate();\n const { t } = useTranslation();\n\n const backHandler = async () => {\n if (link) {\n if (isReplace === true) {\n return navigate(link, { replace: true });\n } else {\n return navigate(link);\n }\n }\n\n if (onClick) {\n return onClick();\n }\n\n return navigate(-1);\n };\n\n return (\n backHandler()}\n >\n\n );\n};\nexport default Back;\n","import clsx from 'clsx';\nimport PropTypes from 'prop-types';\n\nconst Divider = ({className, isVertical = false}) => (\n \n);\n\nDivider.propTypes = {\n isVertical: PropTypes.bool,\n};\n\nDivider.defaultProps = {\n isVertical: false,\n};\n\nexport default Divider;\n","import {useNavigate} from 'react-router-dom';\nimport {useTranslation} from 'react-i18next';\nimport clsx from 'clsx';\n\nimport {PopupButton} from '@components/Static';\nimport {Checkbox} from '@assets/icons';\n\nconst NavPopupButton = ({\n Icon, label, path, onClick, textClassName, text, isSelected, className, unreadMessage, labelColor=''\n}) => {\n const navigate = useNavigate();\n const {t} = useTranslation();\n\n const onRedirect = () => {\n if (path) {\n navigate(path);\n }\n\n if (typeof onClick === 'function') {\n onClick();\n }\n };\n\n return (\n\n\n \n {t(\"common.back\")}\n \n\n \n \n );\n};\n\nexport default NavPopupButton;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\nconst ChatMessage = ({\n className, name, message, time, variant,\n}) => (\n\n {Icon && (\n\n {isSelected &&\n\n )}\n\n {text || t(label)}\n {unreadMessage\n ? \n <>\n\n\n \n {unreadMessage}\n \n\n >\n : ''\n }\n}\n \n\n);\n\nChatMessage.propTypes = {\n name: PropTypes.string,\n message: PropTypes.string,\n time: PropTypes.string,\n variant: PropTypes.string,\n};\n\nChatMessage.defaultProps = {\n name: '',\n message: '',\n time: '',\n variant: '',\n};\n\nexport default ChatMessage;\n","const Paper = ({children}) => (\n{name}
\n\n {message}\n
\n{time}
\n\n {children}\n\n);\n\nexport default Paper;\n","import { useEffect, RefObject, useLayoutEffect } from 'react';\n\nexport const useOnEscape = (\n handler: (event: KeyboardEvent) => void,\n active = true\n) => {\n useEffect(() => {\n if (!active) return;\n const listener = (event: KeyboardEvent) => {\n // check if key is an Escape\n if (event.key === 'Escape') handler(event);\n };\n document.addEventListener('keyup', listener);\n\n return () => {\n if (!active) return;\n document.removeEventListener('keyup', listener);\n };\n }, [handler, active]);\n};\n\nexport const useRepositionOnResize = (handler: () => void, active = true) => {\n useEffect(() => {\n if (!active) return;\n const listener = () => {\n handler();\n };\n\n window.addEventListener('resize', listener);\n\n return () => {\n if (!active) return;\n window.removeEventListener('resize', listener);\n };\n }, [handler, active]);\n};\n\nexport const useOnClickOutside = (\n ref: RefObject| RefObject [],\n handler: (event: TouchEvent | MouseEvent) => void,\n active = true\n) => {\n useEffect(() => {\n if (!active) return;\n const listener = (event: TouchEvent | MouseEvent) => {\n // Do nothing if clicking ref's element or descendent elements\n const refs = Array.isArray(ref) ? ref : [ref];\n\n let contains = false;\n refs.forEach(r => {\n if (!r.current || r.current.contains(event.target as Node)) {\n contains = true;\n return;\n }\n });\n event.stopPropagation();\n if (!contains) handler(event);\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n\n return () => {\n if (!active) return;\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, handler, active]);\n};\n\n// Make sure that user is not able TAB out of the Modal content on Open\nexport const useTabbing = (\n contentRef: RefObject ,\n active = true\n) => {\n useEffect(() => {\n if (!active) return;\n const listener = (event: KeyboardEvent) => {\n // check if key is an Tab\n if (event.keyCode === 9) {\n const els = contentRef?.current?.querySelectorAll(\n 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]'\n );\n\n const focusableEls = Array.prototype.slice.call(els);\n if (focusableEls.length === 1) {\n event.preventDefault();\n return;\n }\n\n const firstFocusableEl = focusableEls[0];\n const lastFocusableEl = focusableEls[focusableEls.length - 1];\n if (event.shiftKey && document.activeElement === firstFocusableEl) {\n event.preventDefault();\n lastFocusableEl.focus();\n } else if (document.activeElement === lastFocusableEl) {\n event.preventDefault();\n firstFocusableEl.focus();\n }\n }\n };\n\n document.addEventListener('keydown', listener);\n\n return () => {\n if (!active) return;\n document.removeEventListener('keydown', listener);\n };\n }, [contentRef, active]);\n};\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n","import React from 'react';\n\ntype PopupStyle = {\n popupContent: {\n tooltip: React.CSSProperties;\n modal: React.CSSProperties;\n };\n popupArrow: React.CSSProperties;\n overlay: {\n tooltip: React.CSSProperties;\n modal: React.CSSProperties;\n };\n};\n\nconst Style: PopupStyle = {\n popupContent: {\n tooltip: {\n position: 'absolute',\n zIndex: 999,\n },\n modal: {\n position: 'relative',\n margin: 'auto',\n },\n },\n popupArrow: {\n height: '8px',\n width: '16px',\n position: 'absolute',\n background: 'transparent',\n color: '#FFF',\n zIndex: -1,\n },\n overlay: {\n tooltip: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n zIndex: 999,\n },\n modal: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n display: 'flex',\n zIndex: 999,\n },\n },\n};\n\nexport default Style;\n","/* Algo to calculate position\n 1. center position for popup content : the center of the trigger will be the center of the content content\n so the popup content position will be like this :\n top => the y of the center for the trigger element : trigger.top + trigger.height/2\n left => the x of the center for the trigger element : trigger.left + trigger.width/2\n\n 2. translate position according to the first position attribute passed in the function argument\n for example :\n position = 'left top'\n we need to handle the first argument in the position: 'left' => that's mean we need to translate the popup content according to the X axis by - content.width/2\n\n 3.translate position according to the first position attribute passed in the function argument\n for example :\n position = 'left top'\n the second argument 'top' => translate popup content by + content.height*4/5\n\n 4. check if calculated position is going out of bounds of wrapper box or not. If yes repeat 1-3 for next position enum. By default wrapper box is window element\n*/\nimport { PopupPosition } from './types';\n\nexport const POSITION_TYPES: PopupPosition[] = [\n 'top left',\n 'top center',\n 'top right',\n 'right top',\n 'right center',\n 'right bottom',\n 'bottom left',\n 'bottom center',\n 'bottom right',\n 'left top',\n 'left center',\n 'left bottom',\n //'center center',\n];\n\ntype CordsType = {\n top: number;\n left: number;\n transform: string;\n arrowLeft: string;\n arrowTop: string;\n};\n\nconst getCoordinatesForPosition = (\n triggerBounding: DOMRect,\n ContentBounding: DOMRect,\n position: PopupPosition, //PopupPosition | PopupPosition[],\n arrow: boolean,\n { offsetX, offsetY }: { offsetX: number; offsetY: number }\n): CordsType => {\n const margin = arrow ? 8 : 0;\n const args = position.split(' ');\n // the step N 1 : center the popup content => ok\n const CenterTop = triggerBounding.top + triggerBounding.height / 2;\n const CenterLeft = triggerBounding.left + triggerBounding.width / 2;\n const { height, width } = ContentBounding;\n let top = CenterTop - height / 2;\n let left = CenterLeft - width / 2;\n let transform = '';\n let arrowTop = '0%';\n let arrowLeft = '0%';\n // the step N 2 : => ok\n switch (args[0]) {\n case 'top':\n top -= height / 2 + triggerBounding.height / 2 + margin;\n transform = `rotate(180deg) translateX(50%)`;\n arrowTop = '100%';\n arrowLeft = '50%';\n break;\n case 'bottom':\n top += height / 2 + triggerBounding.height / 2 + margin;\n transform = `rotate(0deg) translateY(-100%) translateX(-50%)`;\n arrowLeft = '50%';\n break;\n case 'left':\n left -= width / 2 + triggerBounding.width / 2 + margin;\n transform = ` rotate(90deg) translateY(50%) translateX(-25%)`;\n arrowLeft = '100%';\n arrowTop = '50%';\n break;\n case 'right':\n left += width / 2 + triggerBounding.width / 2 + margin;\n transform = `rotate(-90deg) translateY(-150%) translateX(25%)`;\n arrowTop = '50%';\n break;\n default:\n }\n switch (args[1]) {\n case 'top':\n top = triggerBounding.top;\n arrowTop = `${triggerBounding.height / 2}px`;\n break;\n case 'bottom':\n top = triggerBounding.top - height + triggerBounding.height;\n arrowTop = `${height - triggerBounding.height / 2}px`;\n break;\n case 'left':\n left = triggerBounding.left;\n arrowLeft = `${triggerBounding.width / 2}px`;\n break;\n case 'right':\n left = triggerBounding.left - width + triggerBounding.width;\n arrowLeft = `${width - triggerBounding.width / 2}px`;\n break;\n default:\n }\n\n top = args[0] === 'top' ? top - offsetY : top + offsetY;\n left = args[0] === 'left' ? left - offsetX : left + offsetX;\n\n return { top, left, transform, arrowLeft, arrowTop };\n};\n\nexport const getTooltipBoundary = (keepTooltipInside: string | Boolean) => {\n // add viewport\n let boundingBox = {\n top: 0,\n left: 0,\n /* eslint-disable-next-line no-undef */\n width: window.innerWidth,\n /* eslint-disable-next-line no-undef */\n height: window.innerHeight,\n };\n if (typeof keepTooltipInside === 'string') {\n /* eslint-disable-next-line no-undef */\n const selector = document.querySelector(keepTooltipInside);\n if (process.env.NODE_ENV !== 'production') {\n if (selector === null)\n throw new Error(\n `${keepTooltipInside} selector does not exist : keepTooltipInside must be a valid html selector 'class' or 'Id' or a boolean value`\n );\n }\n if (selector !== null) boundingBox = selector.getBoundingClientRect();\n }\n\n return boundingBox;\n};\n\nconst calculatePosition = (\n triggerBounding: DOMRect,\n ContentBounding: DOMRect,\n position: PopupPosition | PopupPosition[],\n arrow: boolean,\n { offsetX, offsetY }: { offsetX: number; offsetY: number },\n keepTooltipInside: string | boolean\n): CordsType => {\n let bestCoords: CordsType = {\n arrowLeft: '0%',\n arrowTop: '0%',\n left: 0,\n top: 0,\n transform: 'rotate(135deg)',\n };\n let i = 0;\n const wrapperBox = getTooltipBoundary(keepTooltipInside);\n let positions = Array.isArray(position) ? position : [position];\n\n // keepTooltipInside would be activated if the keepTooltipInside exist or the position is Array\n if (keepTooltipInside || Array.isArray(position))\n positions = [...positions, ...POSITION_TYPES];\n\n // add viewPort for WarpperBox\n // wrapperBox.top = wrapperBox.top + window.scrollY;\n // wrapperBox.left = wrapperBox.left + window.scrollX;\n\n while (i < positions.length) {\n bestCoords = getCoordinatesForPosition(\n triggerBounding,\n ContentBounding,\n positions[i],\n arrow,\n { offsetX, offsetY }\n );\n\n const contentBox = {\n top: bestCoords.top,\n left: bestCoords.left,\n width: ContentBounding.width,\n height: ContentBounding.height,\n };\n\n if (\n contentBox.top <= wrapperBox.top ||\n contentBox.left <= wrapperBox.left ||\n contentBox.top + contentBox.height >=\n wrapperBox.top + wrapperBox.height ||\n contentBox.left + contentBox.width >= wrapperBox.left + wrapperBox.width\n ) {\n i++;\n } else {\n break;\n }\n }\n\n return bestCoords;\n};\n\nexport default calculatePosition;\n","import React, {\n useState,\n useRef,\n useEffect,\n forwardRef,\n useImperativeHandle,\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport { PopupProps, PopupActions } from './types';\nimport {\n useOnEscape,\n useRepositionOnResize,\n useOnClickOutside,\n useTabbing,\n useIsomorphicLayoutEffect,\n} from './hooks';\n\nimport './index.css';\n\nimport styles from './styles';\nimport calculatePosition from './Utils';\n\nlet popupIdCounter = 0;\n\nconst getRootPopup = () => {\n let PopupRoot = document.getElementById('popup-root');\n\n if (PopupRoot === null) {\n PopupRoot = document.createElement('div');\n PopupRoot.setAttribute('id', 'popup-root');\n document.body.appendChild(PopupRoot);\n }\n\n return PopupRoot;\n};\n\nexport const Popup = forwardRef (\n (\n {\n trigger = null,\n onOpen = () => {},\n onClose = () => {},\n defaultOpen = false,\n open = undefined,\n disabled = false,\n nested = false,\n closeOnDocumentClick = true,\n repositionOnResize = true,\n closeOnEscape = true,\n on = ['click'],\n contentStyle = {},\n arrowStyle = {},\n overlayStyle = {},\n className = '',\n position = 'bottom center',\n modal = false,\n lockScroll = false,\n arrow = true,\n offsetX = 0,\n offsetY = 0,\n mouseEnterDelay = 100,\n mouseLeaveDelay = 100,\n keepTooltipInside = false,\n children,\n },\n ref\n ) => {\n const [isOpen, setIsOpen] = useState (open || defaultOpen);\n const triggerRef = useRef (null);\n const contentRef = useRef (null);\n const arrowRef = useRef (null);\n const focusedElBeforeOpen = useRef (null);\n const popupId = useRef (`popup-${++popupIdCounter}`);\n\n const isModal = modal ? true : !trigger;\n const timeOut = useRef (0);\n\n useIsomorphicLayoutEffect(() => {\n if (isOpen) {\n focusedElBeforeOpen.current = document.activeElement;\n setPosition();\n focusContentOnOpen(); // for accessibility\n lockScrolll();\n } else {\n resetScroll();\n }\n return () => {\n clearTimeout(timeOut.current);\n };\n }, [isOpen]);\n\n // for uncontrolled popup we need to sync isOpen with open prop\n useEffect(() => {\n if (typeof open === 'boolean') {\n if (open) openPopup();\n else closePopup();\n }\n }, [open, disabled]);\n\n const openPopup = (event?: React.SyntheticEvent) => {\n if (isOpen || disabled) return;\n setIsOpen(true);\n setTimeout(() => onOpen(event), 0);\n };\n\n const closePopup = (\n event?: React.SyntheticEvent | KeyboardEvent | TouchEvent | MouseEvent\n ) => {\n if (!isOpen || disabled) return;\n setIsOpen(false);\n if (isModal) (focusedElBeforeOpen.current as HTMLElement)?.focus();\n setTimeout(() => onClose(event), 0);\n };\n\n const togglePopup = (event?: React.SyntheticEvent) => {\n event?.stopPropagation();\n if (!isOpen) openPopup(event);\n else closePopup(event);\n };\n\n const onMouseEnter = (event?: React.SyntheticEvent) => {\n clearTimeout(timeOut.current);\n timeOut.current = setTimeout(() => openPopup(event), mouseEnterDelay);\n };\n\n const onContextMenu = (event?: React.SyntheticEvent) => {\n event?.preventDefault();\n togglePopup();\n };\n\n const onMouseLeave = (event?: React.SyntheticEvent) => {\n clearTimeout(timeOut.current);\n timeOut.current = setTimeout(() => closePopup(event), mouseLeaveDelay);\n };\n\n const lockScrolll = () => {\n if (isModal && lockScroll)\n document.getElementsByTagName('body')[0].style.overflow = 'hidden'; // migrate to document.body\n };\n\n const resetScroll = () => {\n if (isModal && lockScroll)\n document.getElementsByTagName('body')[0].style.overflow = 'auto';\n };\n const focusContentOnOpen = () => {\n const focusableEls = contentRef?.current?.querySelectorAll(\n 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]'\n );\n const firstEl = Array.prototype.slice.call(focusableEls)[0];\n firstEl?.focus();\n };\n\n useImperativeHandle(ref, () => ({\n open: () => {\n openPopup();\n },\n close: () => {\n closePopup();\n },\n toggle: () => {\n togglePopup();\n },\n }));\n\n // set Position\n const setPosition = () => {\n if (isModal || !isOpen) return;\n if (!triggerRef?.current || !triggerRef?.current || !contentRef?.current)\n return; /// show error as one of ref is undefined\n const trigger = triggerRef.current.getBoundingClientRect();\n const content = contentRef.current.getBoundingClientRect();\n\n const cords = calculatePosition(\n trigger,\n content,\n position,\n arrow,\n {\n offsetX,\n offsetY,\n },\n keepTooltipInside\n );\n contentRef.current.style.top = `${cords.top + window.scrollY}px`;\n contentRef.current.style.left = `${cords.left + window.scrollX}px`;\n if (arrow && !!arrowRef.current) {\n arrowRef.current.style.transform = cords.transform;\n arrowRef.current.style.setProperty('-ms-transform', cords.transform);\n arrowRef.current.style.setProperty(\n '-webkit-transform',\n cords.transform\n );\n arrowRef.current.style.top =\n arrowStyle.top?.toString() || cords.arrowTop;\n arrowRef.current.style.left =\n arrowStyle.left?.toString() || cords.arrowLeft;\n }\n };\n // hooks\n useOnEscape(closePopup, closeOnEscape); // can be optimized if we disabled for hover\n useTabbing(contentRef, isOpen && isModal);\n useRepositionOnResize(setPosition, repositionOnResize);\n useOnClickOutside(\n !!trigger ? [contentRef, triggerRef] : [contentRef],\n closePopup,\n closeOnDocumentClick && !nested\n ); // we need to add a ne\n // render the trigger element and add events\n const renderTrigger = () => {\n const triggerProps: any = {\n key: 'T',\n ref: triggerRef,\n 'aria-describedby': popupId.current,\n };\n const onAsArray = Array.isArray(on) ? on : [on];\n for (let i = 0, len = onAsArray.length; i < len; i++) {\n switch (onAsArray[i]) {\n case 'click':\n triggerProps.onClick = togglePopup;\n break;\n case 'right-click':\n triggerProps.onContextMenu = onContextMenu;\n break;\n case 'hover':\n triggerProps.onMouseEnter = onMouseEnter;\n triggerProps.onMouseLeave = onMouseLeave;\n break;\n case 'focus':\n triggerProps.onFocus = onMouseEnter;\n triggerProps.onBlur = onMouseLeave;\n break;\n default:\n }\n }\n\n if (typeof trigger === 'function') {\n const comp = trigger(isOpen);\n return !!trigger && React.cloneElement(comp, triggerProps);\n }\n\n return !!trigger && React.cloneElement(trigger, triggerProps);\n };\n\n const addWarperAction = () => {\n const popupContentStyle = isModal\n ? styles.popupContent.modal\n : styles.popupContent.tooltip;\n\n const childrenElementProps: any = {\n className: `popup-content ${\n className !== ''\n ? className\n .split(' ')\n .map(c => `${c}-content`)\n .join(' ')\n : ''\n }`,\n style: {\n ...popupContentStyle,\n ...contentStyle,\n pointerEvents: 'auto', //closeOnDocumentClick && nested ? 'auto' : 'none',\n },\n ref: contentRef,\n onClick: (e: any) => {\n e.stopPropagation();\n },\n };\n if (!modal && on.indexOf('hover') >= 0) {\n childrenElementProps.onMouseEnter = onMouseEnter;\n childrenElementProps.onMouseLeave = onMouseLeave;\n }\n return childrenElementProps;\n };\n\n const renderContent = () => {\n return (\n \n {arrow && !isModal && (\n\n );\n };\n\n const overlay = !(on.indexOf('hover') >= 0);\n const ovStyle = isModal ? styles.overlay.modal : styles.overlay.tooltip;\n\n const content = [\n overlay && (\n\n \n\n )}\n {children && typeof children === 'function'\n ? children(closePopup, isOpen)\n : children}\n`${c}-overlay`)\n .join(' ')\n : ''\n }`}\n style={{\n ...ovStyle,\n ...overlayStyle,\n pointerEvents:\n (closeOnDocumentClick && nested) || isModal ? 'auto' : 'none',\n }}\n onClick={closeOnDocumentClick && nested ? closePopup : undefined}\n tabIndex={-1}\n >\n {isModal && renderContent()}\n\n ),\n\n !isModal && renderContent(),\n ];\n\n return (\n <>\n {renderTrigger()}\n {isOpen && ReactDOM.createPortal(content, getRootPopup())}\n >\n );\n }\n);\n\nexport default Popup;\n","// extracted by mini-css-extract-plugin\nexport default {\"popupContent\":\"Popup_popupContent__lmrpV\"};","import React from 'react';\nimport clsx from 'clsx';\n\nimport PropTypes from 'prop-types';\nimport ReactPopup from 'reactjs-popup';\n\nimport styles from './Popup.module.scss';\nimport './Popup.scss';\n\nconst Popup = ({\n variant,\n children,\n trigger,\n containerSelector,\n position,\n className,\n closeOnContentClick,\n onOpen,\n onClose,\n offsetY,\n offsetX,\n isOverflowEnabled = false,\n}) => {\n const onContentClick = (closeFn) => {\n if (closeOnContentClick) {\n closeFn();\n }\n };\n\n return (\n\n {(close) => (\n \n );\n};\n\nPopup.propTypes = {\n variant: PropTypes.oneOf(['default', 'navbar', 'accounts', 'pdf', 'csv']),\n children: PropTypes.node.isRequired,\n trigger: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,\n className: PropTypes.string,\n closeOnContentClick: PropTypes.bool,\n containerSelector: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n position: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n offsetY: PropTypes.number,\n offsetX: PropTypes.number,\n};\n\nPopup.defaultProps = {\n variant: 'default',\n className: '',\n closeOnContentClick: true,\n containerSelector: null,\n position: 'bottom left',\n onOpen: () => {},\n onClose: () => {},\n offsetY: 0,\n offsetX: 0,\n};\n\nexport default Popup;\n","// extracted by mini-css-extract-plugin\nexport default {\"btn\":\"PopupButton_btn__d2lhV\"};","import clsx from 'clsx';\n\nimport styles from './PopupButton.module.scss';\n\nconst PopupButton = ({className, children, onClick}) => (\nonContentClick(close)}>\n {React.cloneElement(children, {closePopup: close})}\n\n )}\n\n {children}\n\n);\n\nexport default PopupButton;\n","import clsx from 'clsx';\nimport { filesize } from \"filesize\";\nimport {format} from 'date-fns';\nimport {useTranslation} from 'react-i18next';\n\nimport Loader from '@components/Loader';\n\nconst Attachment = ({\n fileName, fileType, size, isLoading, sentAt, onClick, className, maxFileNameLength = 100,\n}) => {\n const {t} = useTranslation();\n\n return (\n\n\n );\n};\n\nexport default Attachment;\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","export const COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\n\nexport function toFileWithPath(file: FileWithPath, path?: string): FileWithPath {\n const f = withMimeType(file);\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n const {webkitRelativePath} = file;\n Object.defineProperty(f, 'path', {\n value: typeof path === 'string'\n ? path\n // If is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return f;\n}\n\nexport interface FileWithPath extends File {\n readonly path?: string;\n}\n\nfunction withMimeType(file: FileWithPath) {\n const {name} = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const ext = name.split('.')\n .pop()!.toLowerCase();\n const type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n}\n","import {FileWithPath, toFileWithPath} from './file';\n\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n *\n * EXPERIMENTAL: A list of https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle objects can also be passed as an arg\n * and a list of File objects will be returned.\n *\n * @param evt\n */\nexport async function fromEvent(evt: Event | any): Promise<(FileWithPath | DataTransferItem)[]> {\n if (isObject\n {isLoading\n ?\n\n : (\n \n {fileType}\n
\n )}\n\n\n\n {`${fileName}.${fileType}`.length > maxFileNameLength\n ? `${`${fileName}.${fileType}`.slice(0, maxFileNameLength)}...`\n : `${fileName}.${fileType}`}\n
\n\n {sentAt ? t('chat.attachmentInfo', {fileSize: filesize(size), date: format(sentAt, 'dd.MM.yyyy'), time: format(sentAt, 'HH:mm')}) : filesize(size)}\n
\n(evt) && isDataTransfer(evt.dataTransfer)) {\n return getDataTransferFiles(evt.dataTransfer, evt.type);\n } else if (isChangeEvt(evt)) {\n return getInputFiles(evt);\n } else if (Array.isArray(evt) && evt.every(item => 'getFile' in item && typeof item.getFile === 'function')) {\n return getFsHandleFiles(evt)\n }\n return [];\n}\n\nfunction isDataTransfer(value: any): value is DataTransfer {\n return isObject(value);\n}\n\nfunction isChangeEvt(value: any): value is Event {\n return isObject (value) && isObject(value.target);\n}\n\nfunction isObject (v: any): v is T {\n return typeof v === 'object' && v !== null\n}\n\nfunction getInputFiles(evt: Event) {\n return fromList ((evt.target as HTMLInputElement).files).map(file => toFileWithPath(file));\n}\n\n// Ee expect each handle to be https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle\nasync function getFsHandleFiles(handles: any[]) {\n const files = await Promise.all(handles.map(h => h.getFile()));\n return files.map(file => toFileWithPath(file));\n}\n\n\nasync function getDataTransferFiles(dt: DataTransfer, type: string) {\n // IE11 does not support dataTransfer.items\n // See https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items#Browser_compatibility\n if (dt.items) {\n const items = fromList (dt.items)\n .filter(item => item.kind === 'file');\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return items;\n }\n const files = await Promise.all(items.map(toFilePromises));\n return noIgnoredFiles(flatten (files));\n }\n\n return noIgnoredFiles(fromList (dt.files)\n .map(file => toFileWithPath(file)));\n}\n\nfunction noIgnoredFiles(files: FileWithPath[]) {\n return files.filter(file => FILES_TO_IGNORE.indexOf(file.name) === -1);\n}\n\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList (items: DataTransferItemList | FileList | null): T[] {\n if (items === null) {\n return [];\n }\n\n const files = [];\n\n // tslint:disable: prefer-for-of\n for (let i = 0; i < items.length; i++) {\n const file = items[i];\n files.push(file);\n }\n\n return files as any;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item: DataTransferItem) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n\n const entry = item.webkitGetAsEntry();\n\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry) as any;\n }\n\n return fromDataTransferItem(item);\n}\n\nfunction flatten (items: any[]): T[] {\n return items.reduce((acc, files) => [\n ...acc,\n ...(Array.isArray(files) ? flatten(files) : [files])\n ], []);\n}\n\nfunction fromDataTransferItem(item: DataTransferItem) {\n const file = item.getAsFile();\n if (!file) {\n return Promise.reject(`${item} is not a File`);\n }\n const fwp = toFileWithPath(file);\n return Promise.resolve(fwp);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nasync function fromEntry(entry: any) {\n return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry: any) {\n const reader = entry.createReader();\n\n return new Promise ((resolve, reject) => {\n const entries: Promise [] = [];\n\n function readEntries() {\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(async (batch: any[]) => {\n if (!batch.length) {\n // Done reading directory\n try {\n const files = await Promise.all(entries);\n resolve(files);\n } catch (err) {\n reject(err);\n }\n } else {\n const items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n\n // Continue reading\n readEntries();\n }\n }, (err: any) => {\n reject(err);\n });\n }\n\n readEntries();\n });\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nasync function fromFileEntry(entry: any) {\n return new Promise ((resolve, reject) => {\n entry.file((file: FileWithPath) => {\n const fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, (err: any) => {\n reject(err);\n });\n });\n}\n\n// Infinite type recursion\n// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540\ninterface FileArray extends Array {}\ntype FileValue = FileWithPath\n | FileArray[];\n","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from \"attr-accept\"; // Error codes\n\nexport var FILE_INVALID_TYPE = \"file-invalid-type\";\nexport var FILE_TOO_LARGE = \"file-too-large\";\nexport var FILE_TOO_SMALL = \"file-too-small\";\nexport var TOO_MANY_FILES = \"too-many-files\";\nexport var ErrorCode = {\n FileInvalidType: FILE_INVALID_TYPE,\n FileTooLarge: FILE_TOO_LARGE,\n FileTooSmall: FILE_TOO_SMALL,\n TooManyFiles: TOO_MANY_FILES\n}; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(\", \")) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" \").concat(maxSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" \").concat(minSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: \"Too many files\"\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === \"application/x-moz-file\" || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n/**\n *\n * @param {object} options\n * @param {File[]} options.files\n * @param {string|string[]} [options.accept]\n * @param {number} [options.minSize]\n * @param {number} [options.maxSize]\n * @param {boolean} [options.multiple]\n * @param {number} [options.maxFiles]\n * @param {(f: File) => FileError|FileError[]|null} [options.validator]\n * @returns\n */\n\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles,\n validator = _ref.validator;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n var customErrors = validator ? validator(file) : null;\n return accepted && sizeMatch && !customErrors;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === \"function\") {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== \"undefined\") {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === \"Files\" || type === \"application/x-moz-file\";\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === \"object\" && item !== null && item.kind === \"file\";\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf(\"MSIE\") !== -1 || userAgent.indexOf(\"Trident/\") !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf(\"Edge/\") !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}\n/**\n * canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)\n * is supported by the browser.\n * @returns {boolean}\n */\n\nexport function canUseFileSystemAccessAPI() {\n return \"showOpenFilePicker\" in window;\n}\n/**\n * Convert the `{accept}` dropzone prop to the\n * `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n *\n * @param {AcceptProp} accept\n * @returns {{accept: string[]}[]}\n */\n\nexport function pickerOptionsFromAccept(accept) {\n if (isDefined(accept)) {\n var acceptForPicker = Object.entries(accept).filter(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n mimeType = _ref3[0],\n ext = _ref3[1];\n\n var ok = true;\n\n if (!isMIMEType(mimeType)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.\"));\n ok = false;\n }\n\n if (!Array.isArray(ext) || !ext.every(isExt)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because an invalid file extension was provided.\"));\n ok = false;\n }\n\n return ok;\n }).reduce(function (agg, _ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n mimeType = _ref5[0],\n ext = _ref5[1];\n\n return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext));\n }, {});\n return [{\n // description is required due to https://crbug.com/1264708\n description: \"Files\",\n accept: acceptForPicker\n }];\n }\n\n return accept;\n}\n/**\n * Convert the `{accept}` dropzone prop to an array of MIME types/extensions.\n * @param {AcceptProp} accept\n * @returns {string}\n */\n\nexport function acceptPropAsAcceptAttr(accept) {\n if (isDefined(accept)) {\n return Object.entries(accept).reduce(function (a, _ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n mimeType = _ref7[0],\n ext = _ref7[1];\n\n return [].concat(_toConsumableArray(a), [mimeType], _toConsumableArray(ext));\n }, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these\n .filter(function (v) {\n return isMIMEType(v) || isExt(v);\n }).join(\",\");\n }\n\n return undefined;\n}\n/**\n * Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is an abort exception.\n */\n\nexport function isAbort(v) {\n return v instanceof DOMException && (v.name === \"AbortError\" || v.code === v.ABORT_ERR);\n}\n/**\n * Check if v is a security error.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is a security error.\n */\n\nexport function isSecurityError(v) {\n return v instanceof DOMException && (v.name === \"SecurityError\" || v.code === v.SECURITY_ERR);\n}\n/**\n * Check if v is a MIME type string.\n *\n * See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.\n *\n * @param {string} v\n */\n\nexport function isMIMEType(v) {\n return v === \"audio/*\" || v === \"video/*\" || v === \"image/*\" || v === \"text/*\" || /\\w+\\/[-+.\\w]+/g.test(v);\n}\n/**\n * Check if v is a file extension.\n * @param {string} v\n */\n\nexport function isExt(v) {\n return /^.*\\.[\\w]+$/.test(v);\n}\n/**\n * @typedef {Object. } AcceptProp\n */\n\n/**\n * @typedef {object} FileError\n * @property {string} message\n * @property {ErrorCode|string} code\n */\n\n/**\n * @typedef {\"file-invalid-type\"|\"file-too-large\"|\"file-too-small\"|\"too-many-files\"} ErrorCode\n */","var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { fromEvent } from \"file-selector\";\nimport { acceptPropAsAcceptAttr, allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, canUseFileSystemAccessAPI, isAbort, isEvtWithFiles, isIeOrEdge, isPropagationStopped, isSecurityError, onDocumentDragOver, pickerOptionsFromAccept, TOO_MANY_FILES_REJECTION } from \"./utils/index\";\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n * \n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = \"Dropzone\"; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: true,\n autoFocus: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n */\n accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Set to true to focus the root element on render\n */\n autoFocus: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Cb for when there's some error from any of the promises.\n *\n * @param {Error} error\n */\n onError: PropTypes.func,\n\n /**\n * Custom validation function. It must return null if there's no errors.\n * @param {File} file\n * @returns {FileError|FileError[]|null}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise\n * \n *\n * )}\n *Drag 'n' drop some files here, or click to select files
\n *)}\n */\n\n/**\n * An object with the current dropzone state.\n *\n * @typedef {object} DropzoneState\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\n/**\n * An object with the dropzone methods.\n *\n * @typedef {object} DropzoneMethods\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n * \n * \n *\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {import(\"./utils\").AcceptProp} [props.accept] Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n * @param {boolean} autoFocus Set to true to auto focus the root element.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be an object with keys as a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) and the value an array of file extensions (optional).\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n * @param {(error: Error) => void} [props.onError]\n *\n * @returns {DropzoneState & DropzoneMethods}\n */\n\nexport function useDropzone() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),\n accept = _defaultProps$props.accept,\n disabled = _defaultProps$props.disabled,\n getFilesFromEvent = _defaultProps$props.getFilesFromEvent,\n maxSize = _defaultProps$props.maxSize,\n minSize = _defaultProps$props.minSize,\n multiple = _defaultProps$props.multiple,\n maxFiles = _defaultProps$props.maxFiles,\n onDragEnter = _defaultProps$props.onDragEnter,\n onDragLeave = _defaultProps$props.onDragLeave,\n onDragOver = _defaultProps$props.onDragOver,\n onDrop = _defaultProps$props.onDrop,\n onDropAccepted = _defaultProps$props.onDropAccepted,\n onDropRejected = _defaultProps$props.onDropRejected,\n onFileDialogCancel = _defaultProps$props.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$props.onFileDialogOpen,\n useFsAccessApi = _defaultProps$props.useFsAccessApi,\n autoFocus = _defaultProps$props.autoFocus,\n preventDropOnDocument = _defaultProps$props.preventDropOnDocument,\n noClick = _defaultProps$props.noClick,\n noKeyboard = _defaultProps$props.noKeyboard,\n noDrag = _defaultProps$props.noDrag,\n noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,\n onError = _defaultProps$props.onError,\n validator = _defaultProps$props.validator;\n\n var acceptAttr = useMemo(function () {\n return acceptPropAsAcceptAttr(accept);\n }, [accept]);\n var pickerTypes = useMemo(function () {\n return pickerOptionsFromAccept(accept);\n }, [accept]);\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === \"function\" ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === \"function\" ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n /**\n * @constant\n * @type {React.MutableRefObjectDrag and drop some files here, or click to select files
\n *}\n */\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive;\n var fsAccessApiWorksRef = useRef(typeof window !== \"undefined\" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (!fsAccessApiWorksRef.current && isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: \"closeDialog\"\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener(\"focus\", onWindowFocus, false);\n return function () {\n window.removeEventListener(\"focus\", onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener(\"dragover\", onDocumentDragOver, false);\n document.addEventListener(\"drop\", onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener(\"dragover\", onDocumentDragOver);\n document.removeEventListener(\"drop\", onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true\n\n useEffect(function () {\n if (!disabled && autoFocus && rootRef.current) {\n rootRef.current.focus();\n }\n\n return function () {};\n }, [rootRef, autoFocus, disabled]);\n var onErrCb = useCallback(function (e) {\n if (onError) {\n onError(e);\n } else {\n // Let the user know something's gone wrong if they haven't provided the onError cb.\n console.error(e);\n }\n }, [onError]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var fileCount = files.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: files,\n accept: acceptAttr,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles,\n validator: validator\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n dispatch({\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isDragActive: true,\n type: \"setDraggedFiles\"\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = \"copy\";\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n type: \"setDraggedFiles\",\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, acceptAttr),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: \"setFiles\"\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n\n dispatch({\n type: \"reset\"\n });\n }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n // No point to use FS access APIs if context is not secure\n // https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#feature_detection\n if (fsAccessApiWorksRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: pickerTypes\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n setFiles(files, null);\n dispatch({\n type: \"closeDialog\"\n });\n }).catch(function (e) {\n // AbortError means the user canceled\n if (isAbort(e)) {\n onFileDialogCancelCb(e);\n dispatch({\n type: \"closeDialog\"\n });\n } else if (isSecurityError(e)) {\n fsAccessApiWorksRef.current = false; // CORS, so cannot use this API\n // Try using the input\n\n if (inputRef.current) {\n inputRef.current.value = null;\n inputRef.current.click();\n } else {\n onErrCb(new Error(\"Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided.\"));\n }\n } else {\n onErrCb(e);\n }\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.key === \" \" || event.key === \"Enter\" || event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: \"focus\"\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: \"blur\"\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? \"ref\" : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === \"string\" && role !== \"\" ? role : \"presentation\"\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? \"ref\" : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: acceptAttr,\n multiple: multiple,\n type: \"file\",\n style: {\n display: \"none\"\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n/**\n * @param {DropzoneState} state\n * @param {{type: string} & DropzoneState} action\n * @returns {DropzoneState}\n */\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case \"focus\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case \"blur\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case \"openDialog\":\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case \"closeDialog\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case \"setDraggedFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragActive: action.isDragActive,\n isDragAccept: action.isDragAccept,\n isDragReject: action.isDragReject\n });\n\n case \"setFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case \"reset\":\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from \"./utils\";","import {\n useState, useMemo, useCallback,\n} from 'react';\nimport {useDropzone} from 'react-dropzone';\nimport {Attachment} from '@components/Static';\nimport {useTranslation} from 'react-i18next';\n\nconst baseStyle = {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n height: '15rem',\n margin: '0px 0.625rem 1.25rem',\n borderWidth: 2,\n borderRadius: 2,\n borderColor: '#eeeeee',\n borderStyle: 'dashed',\n backgroundColor: '#fafafa',\n color: '#bdbdbd',\n outline: 'none',\n transition: 'border .24s ease-in-out',\n};\n\nconst focusedStyle = {\n borderColor: '#FCB96B',\n};\n\nconst acceptStyle = {\n borderColor: '#FCB96B',\n};\n\nconst rejectStyle = {\n borderColor: '#EE6A5F',\n};\n\nconst DragAndDropZone = ({setItems, acceptedFileTypes}) => {\n const [file, setFile] = useState(null);\n const {t} = useTranslation();\n\n const onDrop = useCallback((acceptedFiles) => {\n setFile(acceptedFiles[0]);\n setItems(acceptedFiles[0]);\n }, []);\n\n const onRemove = () => {\n setFile(null);\n setItems(null);\n };\n\n const {\n getRootProps,\n getInputProps,\n isFocused,\n isDragAccept,\n isDragReject,\n } = useDropzone({onDrop, noClick: !!file, accept: acceptedFileTypes});\n\n const style = useMemo(() => ({\n ...baseStyle,\n ...(isFocused ? focusedStyle : {}),\n ...(isDragAccept ? acceptStyle : {}),\n ...(isDragReject ? rejectStyle : {}),\n }), [\n isFocused,\n isDragAccept,\n isDragReject,\n ]);\n\n return (\n \n\n );\n};\n\nexport default DragAndDropZone;\n","const config = {\n authApiUrl: process.env.REACT_APP_AUTH_API_URL,\n accountApiUrl: process.env.REACT_APP_ACCOUNT_API_URL,\n resourceApiUrl: process.env.REACT_APP_RESOURCE_API_URL,\n calendarApiUrl: process.env.REACT_APP_CALENDAR_API_URL,\n noteApiUrl: process.env.REACT_APP_NOTE_API_URL,\n videoApiUrl: process.env.REACT_APP_VIDEO_API_URL,\n chatRoomApiUrl: process.env.REACT_APP_CHATROOM_API_URL,\n chatRoomSocketDomain: process.env.REACT_APP_CHATROOM_SOCKET_DOMAIN,\n chatRoomSocketPath: process.env.REACT_APP_CHATROOM_SOCKET_PATH,\n calenderSocketDomain: process.env.REACT_APP_CALENDAR_SOCKET_DOMAIN,\n calenderSocketPath: process.env.REACT_APP_CALENDAR_SOCKET_PATH,\n reportApiUrl: process.env.REACT_APP_REPORT_API_URL,\n graphQlUrl: process.env.REACT_APP_GRAPHQL_URL,\n dataResetApiUrl: process.env.REACT_APP_DATARESET_API_URL,\n statisticsApiUrl: process.env.REACT_APP_STATISTICS_API_URL,\n appStoreUrl: process.env.REACT_APP_APP_STORE_URL,\n googlePlayUrl: process.env.REACT_APP_GOOGLE_PLAY_URL,\n emailApiUrl: process.env.REACT_APP_NESTJS_API_URL,\n webUrl: process.env.REACT_APP_WEB_URL,\n globalChatSocketDomain: process.env.REACT_APP_GLOBAL_CHAT_SOCKET_DOMAIN,\n globalChatSocketPath: process.env.REACT_APP_GLOBAL_CHAT_SOCKET_PATH,\n};\n\nexport default config;\n","/* eslint-disable no-case-declarations */\nimport {\n createContext, useEffect, useState, useCallback, useContext, useRef,\n} from 'react';\n\nimport LocalStorageService from '@services/localStorage';\nimport ReportService from '@services/api/report';\nimport VideoService from '@services/api/video';\nimport ChatRoomService from '@services/api/chat';\nimport { REPORT_TYPES, USER_ROLES } from '@utils/consts';\nimport { UserContext } from './User';\nimport { io } from 'socket.io-client';\nimport config from '@config/config';\n\nexport const AppointmentReportContext = createContext({\n appointmentReportItem: null,\n internalReportItem: null,\n createReport: async () => { },\n createAppointmentReportItem: () => { },\n createAppointmentReportCounsellorId: () => { },\n createInternalReportItem: () => { },\n createInternalReport: async () => { },\n appointmentSocket: null,\n});\n\nconst AppointmentReportProvider = ({ children }) => {\n const { profile: currentProfile } = useContext(UserContext);\n const [appointmentReportItem, setAppointmentReportItem] = useState();\n const [internalReportItem, setInternalReportItem] = useState();\n const [appointmentSocket, setAppointmentSocket] = useState();\n\n const socket = useRef();\n useEffect(() => {\n if (!currentProfile\n || (currentProfile.type !== USER_ROLES.STUDENT_ROLE\n && currentProfile.type !== USER_ROLES.COUNSELLOR_ROLE)\n || (socket.current && socket.current.connected)) {\n return undefined;\n }\n\n const accessToken = LocalStorageService.getAccessToken();\n\n if (!accessToken) {\n return undefined;\n }\n\n socket.current = io(config.calenderSocketDomain, {\n path: config.calenderSocketPath,\n query: {\n accessToken,\n },\n });\n\n setAppointmentSocket(socket.current);\n\n return () => {\n if (socket?.current && socket.current.connected) {\n socket.current.disconnect();\n }\n };\n }, [currentProfile?.id]);\n\n useEffect(() => {\n (async () => {\n const reportItem = LocalStorageService.getAppointmentReportItem();\n const counsellorId = LocalStorageService.getAppointmentReportCounsellorId();\n const internalReportItem = LocalStorageService.getInternalReportItem();\n if (!reportItem\n || !currentProfile\n || currentProfile.type !== USER_ROLES.COUNSELLOR_ROLE\n || currentProfile.id !== counsellorId) {\n return;\n }\n\n setAppointmentReportItem(reportItem);\n setInternalReportItem(internalReportItem);\n })();\n }, [currentProfile]);\n\n const createInternalReport = useCallback(async (data) => {\n if (!internalReportItem || !currentProfile) {\n return;\n }\n\n const report = {\n accountId: currentProfile.accountId,\n reporterId: currentProfile.userId,\n entityId: internalReportItem.reportItemId,\n type: internalReportItem.type,\n userId: null,\n ...data,\n };\n await ReportService.createReport(currentProfile.accountId, report);\n LocalStorageService.removeInternalReportItem();\n LocalStorageService.removeAppointmentReportCounsellorId();\n setInternalReportItem(null);\n }, [internalReportItem, currentProfile])\n\n const createReport = useCallback(async (createPayloadData) => {\n if (!appointmentReportItem || !currentProfile) {\n return;\n }\n\n let entityId;\n let anotherParticipant;\n switch (createPayloadData?.data?.type ? createPayloadData?.data?.type : appointmentReportItem.type) {\n case REPORT_TYPES.APPOINTMENT:\n case REPORT_TYPES.APPOINTMENT_QUICK:\n const room = await VideoService.getRoomById(currentProfile.accountId, appointmentReportItem.reportItemId, {\n includeParticipants: true,\n });\n\n entityId = room.eventId;\n anotherParticipant = room.participants.find((participant) => participant.userId !== currentProfile.userId);\n break;\n case REPORT_TYPES.CHAT:\n case REPORT_TYPES.CHAT_QUICK:\n const chatRoom = await ChatRoomService.getChatRoomById(currentProfile.accountId, appointmentReportItem.reportItemId, true);\n entityId = chatRoom.id;\n anotherParticipant = chatRoom.participants.find((participant) => participant.userId !== currentProfile.userId);\n break;\n case REPORT_TYPES.INSTANT:\n case REPORT_TYPES.QUICK:\n entityId = appointmentReportItem.reportItemId;\n anotherParticipant = {\n userId: appointmentReportItem.userId,\n };\n break;\n case REPORT_TYPES.ANONYMOUS_QUICK_REPORT:\n case REPORT_TYPES.ANONYMOUS_ULTRA_QUICK_REPORT:\n entityId = appointmentReportItem.reportItemId;\n anotherParticipant = {\n userId: null\n }\n break;\n default:\n LocalStorageService.removeAppointmentReportItem();\n LocalStorageService.removeAppointmentReportCounsellorId();\n setAppointmentReportItem(null);\n return;\n }\n const report = {\n accountId: currentProfile.accountId,\n reporterId: currentProfile.userId,\n entityId,\n type: createPayloadData?.data?.type\n ? createPayloadData?.data?.type\n : appointmentReportItem.type,\n userId: anotherParticipant.userId,\n ...createPayloadData,\n };\n await ReportService.createReport(currentProfile.accountId, report);\n LocalStorageService.removeAppointmentReportItem();\n LocalStorageService.removeAppointmentReportCounsellorId();\n setAppointmentReportItem(null);\n }, [appointmentReportItem, currentProfile]);\n\n const createAppointmentReportItem = useCallback((reportItem) => {\n LocalStorageService.setAppointmentReportItem(reportItem);\n setAppointmentReportItem(reportItem);\n }, []);\n\n const createInternalReportItem = useCallback((internalReportItem) => {\n LocalStorageService.setInternalReportItem(internalReportItem);\n setInternalReportItem(internalReportItem);\n })\n\n const createAppointmentReportCounsellorId = useCallback((id) => {\n LocalStorageService.setAppointmentReportCounsellorId(id);\n }, []);\n\n const value = {\n appointmentReportItem,\n createAppointmentReportItem,\n createInternalReportItem,\n createAppointmentReportCounsellorId,\n createReport,\n appointmentSocket,\n internalReportItem,\n createInternalReport,\n };\n\n return (\n\n \n {!file ? (\n{t('common.dragNDrop')}
) : (\n\n )}\n {children} \n );\n};\n\nexport default AppointmentReportProvider;\n","import {\n createContext, useEffect, useRef, useContext, useState,\n } from 'react';\n import {io} from 'socket.io-client';\n \n import config from '@config/config';\n import LocalStorageService from '@services/localStorage';\n import {USER_ROLES} from '@utils/consts';\n import {UserContext} from './User';\n \n export const GlobalChatContext = createContext({\n socketForGlobalMessage: null,\n openedChatRoomId: undefined,\n setOpenedChatRoomId: () => {},\n });\n \n const GlobalChatProvider = ({children}) => {\n const {profile: currentProfile} = useContext(UserContext);\n const [openedChatRoomId, setOpenedChatRoomId] = useState();\n const socketForGlobalMessage = useRef();\n \n useEffect(() => {\n if (!currentProfile\n || (currentProfile.type !== USER_ROLES.STUDENT_ROLE\n && currentProfile.type !== USER_ROLES.COUNSELLOR_ROLE)\n || (socketForGlobalMessage.current && socketForGlobalMessage.current.connected)) {\n return undefined;\n }\n \n const accessToken = LocalStorageService.getAccessToken();\n \n if (!accessToken) {\n return undefined;\n }\n \n socketForGlobalMessage.current = io(config.globalChatSocketDomain, {\n transports: ['websocket'],\n path:config.globalChatSocketPath,\n query: {\n accessToken,\n },\n });\n \n return () => {\n if (socketForGlobalMessage?.current && socketForGlobalMessage.current.connected) {\n socketForGlobalMessage.current.disconnect();\n }\n };\n }, [currentProfile?.id]);\n \n const value = {socketForGlobalMessage, openedChatRoomId, setOpenedChatRoomId};\n \n return (\n{children} \n );\n };\n \n export default GlobalChatProvider;\n ","import {\n createContext, useEffect, useRef, useContext, useState,\n} from 'react';\nimport {io} from 'socket.io-client';\n\nimport config from '@config/config';\nimport LocalStorageService from '@services/localStorage';\nimport {USER_ROLES} from '@utils/consts';\nimport {UserContext} from './User';\n\nexport const ChatContext = createContext({\n socket: null,\n openedChatRoomId: undefined,\n setOpenedChatRoomId: () => {},\n});\n\nconst ChatProvider = ({children}) => {\n const {profile: currentProfile} = useContext(UserContext);\n const [openedChatRoomId, setOpenedChatRoomId] = useState();\n const socket = useRef();\n\n useEffect(() => {\n if (!currentProfile\n || (currentProfile.type !== USER_ROLES.STUDENT_ROLE\n && currentProfile.type !== USER_ROLES.COUNSELLOR_ROLE)\n || (socket.current && socket.current.connected)) {\n return undefined;\n }\n\n const accessToken = LocalStorageService.getAccessToken();\n\n if (!accessToken) {\n return undefined;\n }\n\n socket.current = io(config.chatRoomSocketDomain, {\n path: config.chatRoomSocketPath,\n query: {\n accessToken,\n },\n });\n\n return () => {\n if (socket?.current && socket.current.connected) {\n socket.current.disconnect();\n }\n };\n }, [currentProfile?.id]);\n\n const value = {socket, openedChatRoomId, setOpenedChatRoomId};\n\n return (\n{children} \n );\n};\n\nexport default ChatProvider;\n","import { createContext, useCallback, useEffect, useState } from \"react\";\n\nimport AuthService from \"@services/api/auth\";\nimport ProfileService from \"@services/api/profile\";\nimport CalendarService from \"@services/api/calendar\";\nimport OrganizationService from \"@services/api/organization\";\nimport LocalStorageService from \"@services/localStorage\";\nimport RolesGraphqlInstance from '@services/api/roles.graphql';\nimport { ability, convertAbility } from 'ability/ability';\n\nimport {\n AFTER_SURVEY_STEPS,\n SURVEY_STATUSES,\n USER_ROLES,\n MEDIA_FONT_SIZE,\n} from \"@utils/consts\";\nimport calendarGraphqlInstance from \"@services/api/calendar.graphql\";\n\nexport const UserContext = createContext({\n user: null,\n profile: null,\n organization: null,\n surveyStatus: null,\n userCalendar: null,\n htmlFontSize: null,\n isMainLoading: true,\n login: async () => {},\n logout: async () => {},\n register: async () => {},\n registerConsumer: async () => {},\n forgotPassword: async () => {},\n resetPassword: async () => {},\n checkIsSSO: async () => {},\n setHtmlFontSize: () => {},\n distributedLogin: async () => {},\n switchAccountTokens: async () => {},\n setSurveyStatus: async () => {},\n setShowBroadcastModal: () => {},\n});\n\nconst UserProvider = ({ children }) => {\n const [user, setUser] = useState(null);\n const [profile, setProfile] = useState(null);\n const [surveyStatus, setSurveyStatus] = useState(null);\n const [userCalendar, setUserCalendar] = useState(null);\n const [afterSurveyWrapStep, setAfterSurveyWrapStep] = useState(null);\n const [organization, setOrganization] = useState(null);\n const [htmlFontSize, setHtmlFontSize] = useState(MEDIA_FONT_SIZE.BASE);\n const [showBroadcastModal, setShowBroadcastModal] = useState(false);\n const [currentUserRoots, setCurrentUserRoots] = useState(null);\n\n const [isMainLoading, setIsMainLoading] = useState(true);\n\n const setUserContextData = useCallback(\n async (userData, isRegistration = null, showSurvey = true) => {\n const profileResponse = await ProfileService.getProfileByUserId(\n userData.accountId,\n userData.id\n );\n\n if (\n profileResponse?.type !== USER_ROLES.STUDENT_ROLE &&\n profileResponse?.type !== USER_ROLES.COUNSELLOR_ROLE &&\n profileResponse?.type !== USER_ROLES.PRINCIPAL_ROLE &&\n profileResponse?.type !== USER_ROLES.ALLBRY_COUNSELLOR_ROLE\n ) {\n LocalStorageService.removeAccessToken();\n LocalStorageService.removeRefreshToken();\n throw new Error();\n }\n\n if (isRegistration) {\n switch (profileResponse?.type) {\n case USER_ROLES.STUDENT_ROLE:\n if (showSurvey) {\n LocalStorageService.setSurveyStatus(\n SURVEY_STATUSES.STUDENT_SURVEY\n );\n setSurveyStatus(SURVEY_STATUSES.STUDENT_SURVEY);\n } else {\n setAfterSurveyWrapStep(AFTER_SURVEY_STEPS.FIRST_STEP);\n }\n break;\n case USER_ROLES.COUNSELLOR_ROLE:\n setAfterSurveyWrapStep(AFTER_SURVEY_STEPS.FIRST_STEP);\n break;\n default:\n break;\n }\n }else if(isRegistration === false){ \n if(profileResponse?.gender === '' || profileResponse?.gender === null){\n LocalStorageService.setSurveyStatus(\n SURVEY_STATUSES.STUDENT_GENDER\n );\n setSurveyStatus(SURVEY_STATUSES.STUDENT_GENDER);\n }\n }\n\n const userCalendarResponse = await CalendarService.getCalendarByUserId(\n userData.accountId,\n userData.id\n );\n\n const organizationResponse = await OrganizationService.getOrganizationById(\n userData.accountId,\n profileResponse.organizationId\n );\n\n // Set roles and permissions\n try{\n const data = await RolesGraphqlInstance.getRoleFeaturesByCurrentUser();\n if(data){\n const rules = convertAbility(data || []);\n ability.update(rules);\n }\n }catch (err) {}\n\n setUser(userData);\n setUserCalendar(userCalendarResponse);\n setOrganization(organizationResponse);\n setProfile(profileResponse);\n },\n []\n );\n\n const setUserInitData = useCallback(async () => {\n setIsMainLoading(true);\n\n const accessToken = LocalStorageService.getAccessToken();\n const refreshToken = LocalStorageService.getRefreshToken();\n\n if (!accessToken && !refreshToken) {\n setIsMainLoading(false);\n return;\n }\n\n const localSurveyStatus = LocalStorageService.getSurveyStatus();\n\n if (localSurveyStatus && accessToken) {\n setSurveyStatus(localSurveyStatus);\n }\n\n try {\n let userResponse;\n\n try {\n userResponse = await AuthService.getCurrentUser();\n } catch (err) {\n // Try to refresh token if current one is invalid\n const result = await AuthService.refreshToken();\n\n if (result) {\n LocalStorageService.setAccessToken(result.accessToken);\n LocalStorageService.setRefreshToken(result.refreshToken);\n\n // Current user after token refresh\n userResponse = await AuthService.getCurrentUser();\n }\n }\n\n await setUserContextData(userResponse);\n } catch (err) {\n LocalStorageService.removeAccessToken();\n LocalStorageService.removeRefreshToken();\n LocalStorageService.removeAppCache();\n } finally {\n setIsMainLoading(false);\n }\n }, [setUserContextData]);\n\n useEffect(() => {\n setUserInitData();\n\n // This is needed to track local storage changes from other browser tab\n // (changes from the tab listener was created in are not triggering event)\n const storageHandler = (e) => {\n // local storage key\n if (e.key === \"accessToken\") {\n setUserInitData();\n }\n };\n\n window.addEventListener(\"storage\", storageHandler);\n\n return () => {\n window.removeEventListener(\"storage\", storageHandler);\n };\n }, [setUserInitData]);\n\n const login = useCallback(async (email, password) => {\n const result = await AuthService.login(email, password);\n if (!result.accessToken) {\n if (result?.userId) {\n return result;\n }\n\n if (result.isMissingPassword) {\n return false;\n }\n }\n\n if (result.redirectUrl || !result.accessToken) {\n return true;\n }\n\n if (result.redirectUrl || !result.accessToken) {\n return true;\n }\n\n LocalStorageService.setAccessToken(result.accessToken);\n LocalStorageService.setRefreshToken(result.refreshToken);\n\n const userResponse = await AuthService.getCurrentUser();\n await setUserContextData(userResponse, false);\n\n return true;\n }, []);\n\n const setTokens = useCallback(async (tokens) => {\n LocalStorageService.setAccessToken(tokens.accessToken);\n LocalStorageService.setRefreshToken(tokens.refreshToken);\n\n const userResponse = await AuthService.getCurrentUser();\n await setUserContextData(userResponse, false);\n }, []);\n\n const register = useCallback(async (email, password) => {\n const result = await AuthService.emailRegistration(email, password);\n\n LocalStorageService.setAccessToken(result.accessToken);\n LocalStorageService.setRefreshToken(result.refreshToken);\n\n const userResponse = await AuthService.getCurrentUser();\n await setUserContextData(userResponse, true);\n }, []);\n\n const registerConsumer = useCallback(async (accessToken, refreshToken) => {\n LocalStorageService.setAccessToken(accessToken);\n LocalStorageService.setRefreshToken(refreshToken);\n\n const userResponse = await AuthService.getCurrentUser();\n await setUserContextData(userResponse, true, false);\n }, []);\n\n const checkIsSSO = useCallback(async (email, isRegistration = false) => {\n const isSSO = await AuthService.isSSO(email, isRegistration);\n return isSSO;\n }, []);\n\n const forgotPassword = useCallback(async (email) => {\n const result = await AuthService.forgotPassword(email);\n return result;\n }, []);\n\n const resetPassword = useCallback(async (newPassword, token) => {\n const result = await AuthService.resetPassword(newPassword, token);\n\n LocalStorageService.setAccessToken(result.accessToken);\n LocalStorageService.setRefreshToken(result.refreshToken);\n\n const userResponse = await AuthService.getCurrentUser();\n await setUserContextData(userResponse);\n }, []);\n\n const logout = useCallback(async () => {\n await AuthService.logout();\n\n LocalStorageService.removeAccessToken();\n LocalStorageService.removeRefreshToken();\n LocalStorageService.removeAppCache();\n\n // Order is very important\n setProfile(null);\n setUser(null);\n setUserCalendar(null);\n setOrganization(null);\n }, []);\n\n const completeSurvey = () => {\n setSurveyStatus(null);\n LocalStorageService.removeSurveyStatus();\n setAfterSurveyWrapStep(AFTER_SURVEY_STEPS.FIRST_STEP);\n };\n\n const updateCurrentProfile = useCallback(\n async (profileData) => {\n const newProfile = {\n ...profile,\n ...profileData,\n };\n const updatedProfile = await ProfileService.updateProfileById(\n profile.accountId,\n profile.id,\n newProfile\n );\n setProfile(updatedProfile);\n },\n [profile]\n );\n\n const updateCalendarSyncStatus = useCallback(\n async (status) => {\n const updatedCalender = await calendarGraphqlInstance.updateCalendarSyncStatus(status);\n setUserCalendar(updatedCalender);\n },\n [userCalendar]\n );\n\n const updateCalendarSyncFreeTimeStatus = useCallback(\n async (status) => {\n const updatedCalender = await calendarGraphqlInstance.updateCalendarSyncFreeTimeStatus(status);\n setUserCalendar(updatedCalender);\n },\n [userCalendar]\n );\n\n const updateOrganization = useCallback(async (form) => {\n const newOrganization = await OrganizationService.updateOrganization(\n organization.accountId,\n organization.id,\n {\n ...form,\n id: organization.id,\n name: organization.name,\n accountId: organization.accountId,\n }\n );\n setOrganization(newOrganization);\n });\n\n const switchAccountTokens = useCallback(async (accountId) => {\n const result = await AuthService.switchAccount(accountId);\n\n LocalStorageService.setAccessToken(result.accessToken);\n LocalStorageService.setRefreshToken(result.refreshToken);\n });\n\n const distributedLogin = useCallback(async (accountId) => {\n await switchAccountTokens(accountId);\n\n try {\n const userResponse = await AuthService.getCurrentUser();\n await setUserContextData(userResponse);\n } catch (e) {\n LocalStorageService.removeAccessToken();\n LocalStorageService.removeRefreshToken();\n LocalStorageService.removeAppCache();\n\n setProfile(null);\n setUser(null);\n setUserCalendar(null);\n setOrganization(null);\n }\n }, []);\n\n const setUserRootsCall = useCallback((roots) => {\n setCurrentUserRoots(roots);\n });\n\n const value = {\n user,\n isMainLoading,\n profile,\n userCalendar,\n organization,\n surveyStatus,\n completeSurvey,\n login,\n logout,\n register,\n registerConsumer,\n forgotPassword,\n resetPassword,\n updateCurrentProfile,\n afterSurveyWrapStep,\n setAfterSurveyWrapStep,\n setTokens,\n checkIsSSO,\n updateOrganization,\n htmlFontSize,\n setHtmlFontSize,\n distributedLogin,\n switchAccountTokens,\n setSurveyStatus,\n updateCalendarSyncStatus,\n setShowBroadcastModal,\n showBroadcastModal,\n setUserRootsCall,\n currentUserRoots,\n updateCalendarSyncFreeTimeStatus,\n };\n\n return (\n{children} \n );\n};\n\nexport default UserProvider;\n","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport addDays from \"../addDays/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n *\n * | Key | Description |\n * |----------------|------------------------------------|\n * | years | Amount of years to be added |\n * | months | Amount of months to be added |\n * | weeks | Amount of weeks to be added |\n * | days | Amount of days to be added |\n * | hours | Amount of hours to be added |\n * | minutes | Amount of minutes to be added |\n * | seconds | Amount of seconds to be added |\n *\n * All values default to 0\n *\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport default function add(dirtyDate, duration) {\n requiredArgs(2, arguments);\n if (!duration || _typeof(duration) !== 'object') return new Date(NaN);\n var years = duration.years ? toInteger(duration.years) : 0;\n var months = duration.months ? toInteger(duration.months) : 0;\n var weeks = duration.weeks ? toInteger(duration.weeks) : 0;\n var days = duration.days ? toInteger(duration.days) : 0;\n var hours = duration.hours ? toInteger(duration.hours) : 0;\n var minutes = duration.minutes ? toInteger(duration.minutes) : 0;\n var seconds = duration.seconds ? toInteger(duration.seconds) : 0;\n\n // Add years and months\n var date = toDate(dirtyDate);\n var dateWithMonths = months || years ? addMonths(date, months + years * 12) : date;\n\n // Add weeks and days\n var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes and seconds\n var minutesToAdd = minutes + hours * 60;\n var secondsToAdd = seconds + minutesToAdd * 60;\n var msToAdd = secondsToAdd * 1000;\n var finalDate = new Date(dateWithDays.getTime() + msToAdd);\n return finalDate;\n}","import {useEffect, useState} from 'react';\n\nexport const useIntervalTrigger = (intervalValue) => {\n const [intervalTrigger, setIntervalTrigger] = useState(false);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setIntervalTrigger((prev) => !prev);\n }, intervalValue);\n\n return () => clearInterval(interval);\n }, [intervalValue]);\n\n return intervalTrigger;\n};\n","import {\n useEffect,\n useMemo,\n useState,\n useContext,\n useCallback,\n useRef,\n} from \"react\";\nimport {\n startOfDay,\n endOfDay,\n differenceInMilliseconds,\n format,\n areIntervalsOverlapping,\n isSameDay,\n add,\n} from \"date-fns\";\n\nimport LocalStorageService from \"@services/localStorage\";\nimport { APPOINTMENT_STATUSES, getStatus } from \"@utils/status\";\nimport { handleFreeTimeEventsIntersections } from \"@utils/freeTimeEventsIntersections\";\nimport { getWorkingHours } from \"@utils/workingTime\";\nimport { generateUUID } from \"@utils/helpers\";\nimport CalendarService from \"@services/api/calendar\";\nimport ProfileService from \"@services/api/profile\";\nimport { UserContext } from \"@contexts/User\";\nimport { USER_ROLES } from \"@utils/consts\";\nimport { useIntervalTrigger } from \"./useIntervalTrigger\";\nimport calendarGraphqlInstance from \"@services/api/calendar.graphql\";\nimport { AppointmentReportContext } from \"@contexts/AppointmentReport\";\n\nconst minute = 60000;\n\nconst convertData = (appointment) => ({\n ...appointment,\n ...getStatus(appointment.dtStart, appointment.status, appointment.dtEnd),\n});\n\nconst prepareAppointment = async (\n appointmentParam,\n userProfile,\n includeSelf = false\n) => {\n const appointment = { ...appointmentParam };\n\n if (appointment.participants && appointment.type !== \"freeTime\") {\n appointment.originalParticipants = appointment.participants;\n if (!includeSelf) {\n appointment.participants = appointment.participants.filter(\n (participant) => participant.userId !== userProfile.userId\n );\n }\n\n const participantProfiles = appointment.participants.map((participant) => {\n if (participant.userId) {\n return ProfileService.getProfileByUserId(\n participant.accountId,\n participant.userId\n );\n }\n return ProfileService.getProfileByExUserId(\n participant.accountId,\n participant.externalUserId\n );\n });\n appointment.participantProfiles = await Promise.all(participantProfiles);\n }\n\n return {\n ...appointment,\n id: appointment.id,\n dtConvertStart: new Date(Number(appointment.dtStart)),\n dtConvertEnd: new Date(Number(appointment.dtEnd)),\n profile:\n (appointment?.participantProfiles?.length &&\n (appointment.participantProfiles.find(\n (e) =>\n e?.userId ==\n appointment.participants.find((e) => e.type == \"organizer\")?.userId\n ) ||\n appointment.participantProfiles[0])) ||\n null,\n status: appointment.status,\n dtStart: Number(appointment.dtStart),\n dtEnd: Number(appointment.dtEnd),\n };\n};\n\nconst participantProfileInAppointment = (\n appointmentParam,\n userProfile,\n includeSelf = false,\n participants\n) => {\n const appointment = { ...appointmentParam };\n\n if (appointment.participants && appointment.type !== \"freeTime\") {\n appointment.originalParticipants = appointment.participants;\n if (!includeSelf) {\n appointment.participants = appointment.participants.filter(\n (participant) => participant.userId !== userProfile.userId\n );\n }\n const participantProfiles = appointment.participants.map((participant) =>\n participants.find((e) => e.userId === participant.userId)\n );\n appointment.participantProfiles = participantProfiles;\n }\n\n return {\n ...appointment,\n id: appointment.id,\n dtConvertStart: new Date(Number(appointment.dtStart)),\n dtConvertEnd: new Date(Number(appointment.dtEnd)),\n profile:\n (appointment?.participantProfiles?.length &&\n (appointment.participantProfiles.find(\n (e) =>\n e?.userId ==\n appointment.participants.find((e) => e.type == \"organizer\")?.userId\n ) ||\n appointment.participantProfiles[0])) ||\n null,\n status: appointment.status,\n dtStart: Number(appointment.dtStart),\n dtEnd: Number(appointment.dtEnd),\n };\n};\n\nconst getMillisecondsFromDayStart = (date) =>\n differenceInMilliseconds(date, startOfDay(date));\n\nconst prepareTimeSlots = (\n orgWorkingHours,\n existingEvents,\n date,\n durationInMillis,\n freeTimeIntervals,\n isCounsellor = false,\n isNowTimeSlot = false\n) => {\n if (\n !orgWorkingHours ||\n !orgWorkingHours.start ||\n !orgWorkingHours.end ||\n durationInMillis === \"custom\"\n ) {\n return [];\n }\n\n let freeTimes;\n if (freeTimeIntervals.length && !isCounsellor) {\n const freeSlots = freeTimeIntervals.filter(\n (freeTime) =>\n freeTime.dtEndFromDayStart > orgWorkingHours.start &&\n freeTime.dtStartFromDayStart < orgWorkingHours.end\n );\n if (!freeSlots.length) {\n return [];\n }\n\n freeSlots[0].dtStartFromDayStart =\n freeSlots[0].dtStartFromDayStart < orgWorkingHours.start\n ? orgWorkingHours.start\n : freeSlots[0].dtStartFromDayStart;\n\n freeSlots[freeSlots.length - 1].dtEndFromDayStart =\n freeSlots[freeSlots.length - 1].dtEndFromDayStart > orgWorkingHours.end\n ? orgWorkingHours.end\n : freeSlots[freeSlots.length - 1].dtEndFromDayStart;\n\n freeTimes = freeSlots.map((slot) => ({\n start: slot.dtStartFromDayStart,\n end: slot.dtEndFromDayStart,\n }));\n } else {\n if (isCounsellor) {\n freeTimes = [\n {\n start: isNowTimeSlot\n ? new Date().getTime() - startOfDay(new Date())\n : orgWorkingHours.start,\n end: orgWorkingHours.end,\n },\n ];\n } else {\n freeTimes = [];\n }\n }\n\n const restTimeInMillis = 600000; // 10 minutes of rest time\n\n const step = durationInMillis;\n const timeSlots = [];\n const now = Date.now();\n\n const isNowToday = isSameDay(now, date);\n const nowFromStartDay = now - startOfDay(now);\n\n freeTimes.forEach((freeTime) => {\n for (\n let currentTime = freeTime.start;\n currentTime < freeTime.end;\n currentTime += step + restTimeInMillis\n ) {\n const slotStartTime = currentTime;\n const slotEndTime = currentTime + step;\n\n if (isNowToday && currentTime < nowFromStartDay) {\n continue; // eslint-disable-line no-continue\n }\n\n const isOverlap = existingEvents.some((event) => {\n const eventInterval = {\n start: getMillisecondsFromDayStart(Number(event.dtStart)),\n end: getMillisecondsFromDayStart(Number(event.dtEnd)),\n };\n const slotInterval = {\n start: Number(slotStartTime),\n end: Number(slotEndTime),\n };\n\n return areIntervalsOverlapping(eventInterval, slotInterval, {\n inclusive: false,\n });\n });\n\n if (!isOverlap && slotEndTime < freeTime.end) {\n const dayStart = startOfDay(date).getTime();\n\n timeSlots.push({\n label: `${format(dayStart + slotStartTime, \"HH:mm\")} - ${format(\n dayStart + slotEndTime,\n \"HH:mm\"\n )}`,\n value: {\n dtStart: dayStart + slotStartTime,\n dtEnd: dayStart + slotEndTime,\n },\n });\n }\n }\n });\n\n return timeSlots;\n};\n\nexport const useAppointmentList = (\n {\n isPopulateParticipants = false,\n dtStart = 0,\n dtEnd = 99999999999999,\n participantUserIds,\n isCacheEnabled = false,\n status = null,\n } = {},\n filterFn\n) => {\n const [appointments, setAppointments] = useState(() => {\n if (isCacheEnabled) {\n const cache = LocalStorageService.getAppointments();\n\n if (cache?.length) {\n return cache.map((v) => ({\n ...v,\n dtConvertStart: v.dtConvertStart ? new Date(v.dtConvertStart) : null,\n dtConvertEnd: v.dtConvertEnd ? new Date(v.dtConvertEnd) : null,\n }));\n }\n }\n\n return null;\n });\n\n const [isLoading, setIsLoading] = useState(true);\n const { userCalendar, profile } = useContext(UserContext);\n const isUnmounted = useRef();\n const intervalTrigger = useIntervalTrigger(minute);\n const isCacheMounted = useRef();\n const { appointmentSocket } = useContext(AppointmentReportContext);\n\n useEffect(() => {\n if (isCacheEnabled && appointments && isCacheMounted.current) {\n LocalStorageService.setAppointments(appointments);\n return;\n }\n\n isCacheMounted.current = true;\n }, [appointments]);\n\n const refetch = async () => {\n if (!userCalendar || !profile) {\n setIsLoading(false);\n return;\n }\n try {\n setIsLoading(true);\n const appointmentsResponse =\n await CalendarService.getCalendarEventsByCalendarId({\n accountId: userCalendar.accountId,\n calendarId: userCalendar.id,\n dtStart,\n dtEnd,\n populateParticipants: isPopulateParticipants,\n participantUserIds,\n status,\n });\n\n const participantsIds = appointmentsResponse.flatMap((appointment) => {\n const participants = appointment.participants?.filter((participant) => {\n return participant.userId !== profile.userId;\n });\n const result = participants?.map((participant) => {\n return {\n userId: participant.userId,\n accountId: participant.accountId,\n };\n });\n return result;\n });\n\n const externalParticipantsIds = appointmentsResponse.flatMap(\n (appointment) => {\n const participants = appointment.participants?.filter((participant) => {\n return participant.userId !== profile.userId;\n });\n const result = participants?.map((participant) => {\n return {\n externalUserId: participant.externalUserId,\n accountId: participant.accountId,\n };\n });\n return result;\n }\n );\n\n externalParticipantsIds.forEach((item) => {\n participantsIds.push(item);\n });\n\n let uniqueData = participantsIds.filter(\n (e) => e?.userId || e?.externalUserId\n );\n uniqueData = uniqueData.filter((item, index) => {\n const _item = JSON.stringify(item);\n return (\n index ===\n uniqueData.findIndex((obj) => {\n return JSON.stringify(obj) === _item;\n })\n );\n });\n\n let participantsData = uniqueData.map((participant) => {\n if (participant.userId) {\n return ProfileService.getProfileByUserId(\n participant.accountId,\n participant.userId\n );\n } else if (participant.externalUserId) {\n return ProfileService.getProfileByExUserId(\n participant.accountId,\n participant.externalUserId\n );\n }\n return null;\n });\n\n participantsData = await Promise.all(participantsData);\n\n let preparedAppointments = appointmentsResponse.map((appointmentItem) => {\n const participantProfile = participantProfileInAppointment(\n appointmentItem,\n profile,\n false,\n participantsData\n );\n return participantProfile;\n });\n\n preparedAppointments = preparedAppointments\n // eslint-disable-next-line no-nested-ternary\n .sort((a, b) =>\n a.dtStart > b.dtStart ? 1 : b.dtStart > a.dtStart ? -1 : 0\n );\n\n if (filterFn && typeof filterFn === \"function\") {\n preparedAppointments = filterFn(preparedAppointments);\n }\n\n if (!isUnmounted.current) {\n setAppointments(preparedAppointments);\n setIsLoading(false);\n }\n } catch (err) {\n console.log(err);\n }\n return () => {\n isUnmounted.current = true;\n };\n };\n\n useEffect(() => {\n refetch();\n }, [userCalendar, profile, dtStart, dtEnd]);\n\n const needUpdate = (msg) => {\n refetch();\n };\n\n useEffect(() => {\n if (!appointmentSocket || appointmentSocket.disconnected) {\n return;\n }\n appointmentSocket.on(\"appointment\", needUpdate);\n return () => {\n appointmentSocket.off(\"appointment\", needUpdate);\n };\n }, [appointmentSocket?.connected]);\n\n return useMemo(() => {\n const result = appointments\n ? appointments.map((item) => convertData(item))\n : null;\n return [result, { isLoading, refetch }];\n }, [appointments, intervalTrigger, isLoading]);\n};\n\nexport const useAppointmentDetails = (id, isPopulateParticipants = false) => {\n const [appointment, setAppointment] = useState(null);\n const { userCalendar, profile } = useContext(UserContext);\n const isUnmounted = useRef(false);\n const intervalTrigger = useIntervalTrigger(minute);\n\n useEffect(() => {\n (async () => {\n if (!userCalendar || !profile) {\n return;\n }\n\n const appointmentResponse = await CalendarService.getCalendarEventById(\n userCalendar.accountId,\n id,\n isPopulateParticipants\n );\n\n const preparedAppointment = await prepareAppointment(\n appointmentResponse,\n profile\n );\n if (!isUnmounted.current) {\n setAppointment(preparedAppointment);\n }\n return () => {\n isUnmounted.current = true;\n };\n })();\n }, [userCalendar, profile]);\n\n return useMemo(() => {\n if (!appointment) return null;\n return convertData(appointment);\n }, [appointment, intervalTrigger]);\n};\n\nexport const useAppointmentCreate = ({ isDataFetchingEnabled = true }) => {\n if (!isDataFetchingEnabled) {\n return [[], [], { isLoading: false }];\n }\n const { userCalendar, profile } = useContext(UserContext);\n const [isLoading, setIsLoading] = useState(false);\n\n const createAppointment = useCallback(\n async (newAppointment, participantProfiles, externalUsers) => {\n return new Promise(async (resolve, reject) => {\n setIsLoading(true);\n CalendarService.createCalendarEvent(userCalendar.accountId, {\n accountId: userCalendar.accountId,\n globalCalendarEventId: generateUUID(),\n calendarId: userCalendar.id,\n organizerId: profile.userId,\n organizerName: profile.name,\n title: \"title\",\n description: \"description\",\n status: \"active\",\n dtStart: newAppointment.dtStart,\n dtEnd: newAppointment.dtEnd,\n type: \"event\",\n customAppointmentTypesId: newAppointment.customAppointmentTypesId,\n userId: participantProfiles.map((participant) => participant.userId),\n })\n .then(async (response) => {\n if (response.id) {\n const participantProfilerData = participantProfiles?.map(\n (participant) => ({\n userId: participant.userId,\n name: participant.name,\n type: participant.type,\n status: APPOINTMENT_STATUSES.UNANSWERED,\n })\n );\n const externalParticipants = externalUsers?.map(\n (participant) => ({\n externalUserId: participant.id,\n name: participant.name,\n status: APPOINTMENT_STATUSES.UNANSWERED,\n type: \"external\",\n })\n );\n const promise = CalendarService.createCalendarEventParticipant(\n userCalendar.accountId,\n {\n accountId: userCalendar.accountId,\n eventId: response.id,\n participantProfilerData,\n externalParticipants: externalParticipants,\n }\n );\n\n await promise;\n resolve(response);\n setIsLoading(false);\n } else {\n setIsLoading(false);\n reject(response);\n return;\n }\n })\n .catch((err) => {\n setIsLoading(false);\n reject(err);\n });\n });\n },\n [userCalendar, profile]\n );\n return [createAppointment, { isLoading }];\n};\n\nexport const useAppointmentUpdate = () => {\n const [appointment, setAppointment] = useState(null);\n const { userCalendar } = useContext(UserContext);\n const [isSuccess, setIsSuccess] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n\n const updateAppointment = useCallback(\n async (updatedAppointment) => {\n return new Promise(async (resolve, reject) => {\n setIsSuccess(false);\n setIsLoading(true);\n CalendarService.updateCalendarEvent(\n userCalendar.accountId,\n updatedAppointment\n )\n .then(async (response) => {\n if (response.id) {\n const resultAppointment = {\n ...response,\n dtConvertStart: new Date(Number(response.dtStart)),\n dtConvertEnd: new Date(Number(response.dtEnd)),\n dtStart: Number(response.dtStart),\n dtEnd: Number(response.dtEnd),\n };\n setAppointment(resultAppointment);\n setIsSuccess(true);\n setIsLoading(false);\n resolve(resultAppointment);\n } else {\n setIsLoading(false);\n reject(response);\n }\n })\n .catch((err) => {\n setIsLoading(false);\n reject(err);\n });\n });\n },\n [userCalendar]\n );\n\n const newAppointment = useMemo(() => {\n if (!appointment) return null;\n return convertData(appointment);\n }, [appointment]);\n\n return [updateAppointment, { isSuccess, isLoading, newAppointment }];\n};\n\nexport const useTimeSlots = (\n participantProfile,\n date,\n durationInMillis,\n currentUserId,\n isVideoCall = false,\n isDataFetchingEnabled = true,\n isOwnTimeSlotsOnly = false\n) => {\n if (!isDataFetchingEnabled) {\n return [[], [], { isLoading: false }];\n }\n const [timeSlots, setTimeSlots] = useState(null);\n const { profile, organization, userCalendar, user } = useContext(UserContext);\n const [isLoading, setIsLoading] = useState(true);\n const [recommendedSlotsData, setRecommendedSlotsData] = useState([]);\n let recommendedSlots = [];\n let dateNext = date;\n let isCounsellor = user.roles.some(\n (role) =>\n role.name === USER_ROLES.COUNSELLOR_ROLE ||\n role.name === USER_ROLES.ALLBRY_COUNSELLOR_ROLE\n );\n\n const ownAppointmentsPromise = useMemo(() => {\n if (!date || !profile) {\n return Promise.resolve([]);\n }\n\n const dtStart = startOfDay(date).getTime();\n const dtEnd = endOfDay(add(date, { days: 30 })).getTime();\n const checkMultipleAccounts = isCounsellor ? true : false;\n return CalendarService.getEventsByCalendarId(\n profile.accountId,\n userCalendar.id,\n { dtStart, dtEnd },\n currentUserId ? [currentUserId] : null,\n checkMultipleAccounts,\n user.id\n );\n }, [profile, date, currentUserId, userCalendar]);\n\n const participantAppointmentsPromise = useMemo(() => {\n if (!date || !profile || !participantProfile.length) {\n return Promise.resolve([]);\n }\n\n const dtStart = startOfDay(date).getTime();\n const dtEnd = endOfDay(add(date, { days: 30 })).getTime();\n const checkMultipleAccounts = isCounsellor ? false : true;\n return CalendarService.getCalendarEventsByOwnerId(\n profile.accountId,\n participantProfile.map((participant) => participant.userId),\n { dtStart, dtEnd },\n currentUserId ? [currentUserId] : null,\n checkMultipleAccounts\n );\n }, [profile, participantProfile, date, currentUserId]);\n\n useEffect(() => {\n (async () => {\n if (!organization || !durationInMillis || !date || (isOwnTimeSlotsOnly ? !isOwnTimeSlotsOnly : !participantProfile.length)) {\n setIsLoading(false);\n return;\n }\n\n setIsLoading(true);\n\n const ownAppointments = await ownAppointmentsPromise;\n const participantAppointments = await participantAppointmentsPromise;\n\n const getSlots = async (SlotDate) => {\n const orgWorkingHours = getWorkingHours(organization.schedule, SlotDate);\n const workingHours = orgWorkingHours\n ? {\n start: orgWorkingHours.workTimeStart,\n end: orgWorkingHours.workTimeEnd,\n }\n : null;\n\n if (!workingHours) {\n setTimeSlots([]);\n }\n\n const allAppointments =\n [\n ...ownAppointments.filter((e) =>\n isSameDay(SlotDate, new Date(JSON.parse(e.dtStart)))\n ),\n ...participantAppointments.filter((e) =>\n isSameDay(SlotDate, new Date(JSON.parse(e.dtStart)))\n ),\n ] ?? [];\n const appointments = allAppointments.filter(\n (x) => x.status !== \"cancelled\"\n );\n const appointmentEvents = appointments.filter(\n (appointment) => appointment.type === \"event\"\n );\n\n const freeTimeEvents = appointments.filter(\n (appointment) => appointment.type === \"freeTime\"\n );\n\n const resultFreeTimeEvents = handleFreeTimeEventsIntersections(\n freeTimeEvents\n ).map((freeTime) => ({\n ...freeTime,\n dtStartFromDayStart:\n Number(freeTime.dtStart) - startOfDay(Number(freeTime.dtStart)),\n dtEndFromDayStart:\n Number(freeTime.dtEnd) - startOfDay(Number(freeTime.dtEnd)),\n }));\n\n const preparedTimeSlots = prepareTimeSlots(\n workingHours,\n appointmentEvents,\n SlotDate,\n durationInMillis,\n resultFreeTimeEvents,\n isCounsellor,\n isVideoCall\n );\n\n return preparedTimeSlots;\n };\n\n const preparedTimeSlots = await getSlots(date);\n\n const getRecommendedSlots = async () => {\n setIsLoading(true);\n if (preparedTimeSlots !== null && !preparedTimeSlots.length) {\n if (\n recommendedSlots.length == 3 ||\n dateNext > add(date, { days: 30 })\n ) {\n setRecommendedSlotsData(recommendedSlots);\n setIsLoading(false);\n return;\n } else {\n dateNext = startOfDay(add(dateNext, { days: 1 }));\n const data = await getSlots(dateNext);\n if (data.length) {\n recommendedSlots.push({ data: data, date: dateNext });\n }\n getRecommendedSlots();\n }\n } else {\n setIsLoading(false);\n return;\n }\n };\n getRecommendedSlots();\n setTimeSlots(preparedTimeSlots);\n setIsLoading(false);\n })();\n }, [\n organization,\n date,\n durationInMillis,\n ownAppointmentsPromise,\n participantAppointmentsPromise,\n participantProfile,\n isOwnTimeSlotsOnly,\n ]);\n\n return useMemo(() => {\n const result = timeSlots ?? [];\n return [result, recommendedSlotsData, { isLoading }];\n }, [timeSlots, isLoading, recommendedSlotsData]);\n};\n\nexport const useFreeTimeList = (options = {}) => {\n const { userCalendar, profile } = useContext(UserContext);\n\n const [isCreating, setIsCreating] = useState(false);\n const [isDeleting, setIsDeleting] = useState(false);\n const [isUpdating, setIsUpdating] = useState(false);\n\n const [isError, setIsError] = useState(false);\n\n const [freeTimes, setFreeTimes] = useState([]);\n const [appointments, { isLoading: isFetching }] = useAppointmentList(options);\n const [updateAppointment] = useAppointmentUpdate();\n\n useEffect(() => {\n if (appointments?.length) {\n setFreeTimes(\n appointments.filter((appointment) => appointment.type === \"freeTime\")\n );\n }\n }, [appointments]);\n\n const createFreeTimes = useCallback(\n async (newAppointments) => {\n setIsError(false);\n setIsCreating(true);\n\n try {\n const data = newAppointments.map((newAppointment) => ({\n accountId: userCalendar.accountId,\n globalCalendarEventId: generateUUID(),\n calendarId: userCalendar.id,\n organizerId: profile.userId,\n organizerName: profile.name,\n title: \"Free time\",\n description: \"free time\",\n status: \"active\",\n dtStart: newAppointment.dtStart,\n dtEnd: newAppointment.dtEnd,\n type: \"freeTime\",\n }));\n const promises = CalendarService.createCalendarEventMultiple(\n userCalendar.accountId,\n {\n accountId: userCalendar.accountId,\n organizerId: profile.userId,\n calendarId: userCalendar.id,\n data: data,\n globalCalendarEventId: generateUUID(),\n }\n );\n\n const appointmentResponses = await promises;\n const preparedAppointmentsPromises = appointmentResponses.map(\n (appointmentResponse) =>\n prepareAppointment(appointmentResponse, profile)\n );\n const preparedAppointments = await Promise.all(\n preparedAppointmentsPromises\n );\n\n setFreeTimes((prev) => [\n ...prev,\n ...preparedAppointments.map((appointment) =>\n convertData(appointment)\n ),\n ]);\n setIsCreating(false);\n } catch (err) {\n setIsError(true);\n setIsCreating(false);\n }\n },\n [profile, userCalendar]\n );\n\n const deleteFreeTime = useCallback(async (accountId, id) => {\n setIsError(false);\n setIsDeleting(true);\n\n try {\n await CalendarService.deleteCalendarEventById(accountId, id);\n setFreeTimes((prev) =>\n prev.filter((appointment) => appointment.id !== id)\n );\n\n setIsDeleting(false);\n } catch (err) {\n setIsError(true);\n setIsDeleting(false);\n }\n }, []);\n\n const updateFreeTime = useCallback(\n async (newAppointment) => {\n setIsError(false);\n setIsUpdating(true);\n\n try {\n const updatedAppointment = await updateAppointment(newAppointment);\n setFreeTimes((prev) =>\n prev.map((appointment) => {\n if (appointment.id === updatedAppointment.id) {\n return updatedAppointment;\n }\n\n return appointment;\n })\n );\n\n setIsUpdating(false);\n } catch (err) {\n setIsError(true);\n setIsUpdating(false);\n }\n },\n [updateAppointment]\n );\n\n const sortedFreeTimes = useMemo(() => {\n if (!freeTimes) {\n return [];\n }\n\n return freeTimes.sort((a, b) => {\n if (a.dtStart < b.dtStart) {\n return -1;\n }\n\n if (b.dtStart < a.dtStart) {\n return 1;\n }\n\n return 0;\n });\n }, [freeTimes]);\n\n return [\n sortedFreeTimes,\n {\n isCreating,\n createFreeTimes,\n deleteFreeTime,\n isDeleting,\n isError,\n updateFreeTime,\n isUpdating,\n isFetching,\n },\n ];\n};\n\nexport const useUnansweredEvent = (options = {}) => {\n const [unansweredEvent, setUnansweredEvent] = useState(null);\n const [distributedUsers, setDistributedUsers] = useState([]);\n\n const { profile } = useContext(UserContext);\n const isUnmounted = useRef();\n\n const fetchData = async () => {\n if (!profile) {\n return;\n }\n const res = await calendarGraphqlInstance.getUnAnsweredEvents(\n distributedUsers\n );\n let result = res;\n if (!options?.forAllAccount) {\n result = res.filter((e) => e.accountId === profile.accountId);\n }\n setUnansweredEvent(result);\n };\n\n useEffect(()=>{\n (async () => {\n fetchData();\n return () => {\n isUnmounted.current = true;\n };\n })();\n\n },[profile,distributedUsers])\n\n return [unansweredEvent, fetchData, setDistributedUsers];\n};\n\nexport const useAppointmentDates = ({ calendarId, startDate, endDate }) => {\n const [appointmentDates, setAppointmentDates] = useState();\n const [isLoading, setIsLoading] = useState(true);\n\n const isUnmounted = useRef();\n\n useEffect(() => {\n (async () => {\n if (!calendarId || !startDate || !endDate) {\n setIsLoading(false);\n return;\n }\n\n setIsLoading(true);\n const response =\n await calendarGraphqlInstance.getAllCalenderEventDatesById(\n calendarId,\n startDate,\n endDate\n );\n\n if (!isUnmounted.current) {\n setAppointmentDates(response);\n setIsLoading(false);\n }\n\n return () => {\n isUnmounted.current = true;\n };\n })();\n }, [startDate, endDate]);\n\n return useMemo(() => {\n const result = appointmentDates?.map((x) =>\n format(new Date(parseInt(x)), \"yyyy-MM-dd\")\n );\n return [result, { isLoading }];\n }, [appointmentDates, isLoading]);\n};\n","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name areIntervalsOverlapping\n * @category Interval Helpers\n * @summary Is the given time interval overlapping with another time interval?\n *\n * @description\n * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping.\n *\n * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.inclusive=false] - whether the comparison is inclusive or not\n * @returns {Boolean} whether the time intervals are overlapping\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For overlapping time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * //=> true\n *\n * @example\n * // For non-overlapping time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }\n * )\n * //=> false\n *\n * @example\n * // For adjacent time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }\n * )\n * //=> false\n *\n * @example\n * // Using the inclusive option:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }\n * )\n * //=> false\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },\n * { inclusive: true }\n * )\n * //=> true\n */\nexport default function areIntervalsOverlapping(intervalLeft, intervalRight, options) {\n requiredArgs(2, arguments);\n var leftStartTime = toDate(intervalLeft === null || intervalLeft === void 0 ? void 0 : intervalLeft.start).getTime();\n var leftEndTime = toDate(intervalLeft === null || intervalLeft === void 0 ? void 0 : intervalLeft.end).getTime();\n var rightStartTime = toDate(intervalRight === null || intervalRight === void 0 ? void 0 : intervalRight.start).getTime();\n var rightEndTime = toDate(intervalRight === null || intervalRight === void 0 ? void 0 : intervalRight.end).getTime();\n\n // Throw an exception if start date is after end date or if any date is `Invalid Date`\n if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {\n throw new RangeError('Invalid interval');\n }\n if (options !== null && options !== void 0 && options.inclusive) {\n return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;\n }\n return leftStartTime < rightEndTime && rightStartTime < leftEndTime;\n}","import { gql } from \"@apollo/client\";\nimport GraphQlService from \"./graphql\";\n\nclass profileGraphql extends GraphQlService {\n async getAllAccountPerson(data) {\n return this.client.query({\n query: gql`\n query {\n getAllAccountPerson(\n userId: ${data.userId ? `\"${data.userId}\"` : null}\n populateAttributes: ${data.populateAttributes ? data.populateAttributes : false}\n type: ${data.type ? `\"${data.type}\"` : null}\n ) {\n id\n about\n accountId\n allowEmailNotification\n birthday\n createdAt\n createdBy\n customRolesId\n email\n gender\n organizationId\n profilePictureName\n profileVideoName\n type\n updatedAt\n updatedBy\n userId\n isAnonymous\n isAnywaySendMessage\n isOnline\n isSecretIdentity\n isUnavailable\n masterRolesId\n name\n nameSW\n nameEng\n organizationName\n unavailableMessage\n version\n accountPersonAttributes {\n id\n accountId\n createdAt\n createdBy\n name\n personId\n updatedAt\n updatedBy\n value\n version\n }\n }\n }\n `,\n }).then((result) => result?.data?.getAllAccountPerson);\n }\n}\n\nconst profileGraphqlInstance = new profileGraphql();\nexport default profileGraphqlInstance;\n","import {\n useEffect,\n useMemo,\n useState,\n useContext,\n useCallback,\n useRef,\n} from \"react\";\n\nimport LocalStorageService from \"@services/localStorage\";\nimport ChatService from \"@services/api/chat\";\nimport { UserContext } from \"@contexts/User\";\nimport { ChatContext } from \"@contexts/Messages\";\nimport ProfileService from \"@services/api/profile\";\nimport { generateUUID } from \"@utils/helpers\";\nimport ResourceService from \"@services/api/resource\";\nimport { CHAT_MESSAGE_TYPES, SUPER_ADMIN_SENDER_NAME, USER_ROLES } from \"@utils/consts\";\nimport chatGraphqlInstance from \"@services/api/chat.graphql\";\nimport { useLocation } from \"react-router-dom\";\nimport profileGraphqlInstance from \"@services/api/profile.graphql\";\nimport { GlobalChatContext } from \"@contexts/GlobalMessages\";\n\nconst prepareChatRoom = async (\n chatRoomParam,\n userProfile,\n populateChatParticipantProfiles\n) => {\n const { messageCount, ...chatRoom } = { ...chatRoomParam };\n let unreadMessageCount = messageCount ? Number(messageCount) : 0;\n\n if (chatRoom.participants) {\n const currentUserParticipant = chatRoom.participants.find(\n (participant) => participant.userId === userProfile.userId\n );\n if (currentUserParticipant) {\n const sendMessageCount = currentUserParticipant.sendMessageCount\n ? Number(currentUserParticipant.sendMessageCount)\n : 0;\n const readMessageCount = currentUserParticipant.readMessageCount\n ? Number(currentUserParticipant.readMessageCount)\n : 0;\n unreadMessageCount =\n unreadMessageCount - sendMessageCount - readMessageCount;\n\n chatRoom.participants = chatRoom.participants.filter(\n (participant) => participant.userId !== userProfile.userId\n );\n }\n\n if (populateChatParticipantProfiles) {\n const participantProfiles = chatRoom.participants.map((participant) =>\n ProfileService.getProfileByUserId(\n participant.accountId,\n participant.userId\n )\n );\n chatRoom.participantProfiles = await Promise.all(participantProfiles);\n }\n }\n\n if (chatRoom.lastMessage) {\n chatRoom.lastMessage.sentAt = Number(chatRoom.lastMessage.sentAt);\n } else {\n chatRoom.lastMessage = {\n sentAt: Number(chatRoom.createdAt),\n messageText: \"\",\n type: CHAT_MESSAGE_TYPES.TEXT,\n };\n }\n\n return {\n ...chatRoom,\n unreadMessageCount,\n profile: chatRoom?.accountId === null ? {} :\n (chatRoom.participantProfiles && chatRoom.participantProfiles[0]) || [],\n };\n};\n\nconst prepareChatMessage = async (chatMessage) => {\n if (\n (chatMessage.type === CHAT_MESSAGE_TYPES.TEXT_ATTACHMENT ||\n chatMessage.type === CHAT_MESSAGE_TYPES.ATTACHMENT) &&\n !chatMessage.attachments?.length\n ) {\n const attachments = (\n await ResourceService.getResourcesByEntity(\n chatMessage.globalChatRoomId ? chatMessage.globalChatRoomId : chatMessage.senderName === SUPER_ADMIN_SENDER_NAME ? chatMessage.chatRoomId : chatMessage.accountId,\n chatMessage.id,\n \"chatAttachment\",\n chatMessage.hasOwnProperty('globalChatRoomId')\n )\n ).map((v) => ({ ...v, size: Number(v.size) }));\n\n return {\n ...chatMessage,\n attachments,\n sentAt: Number(chatMessage.sentAt),\n };\n }\n\n return {\n ...chatMessage,\n sentAt: Number(chatMessage.sentAt),\n };\n};\n\nexport const useChatList = (\n {\n isPopulateChatParticipants = false,\n isPopulateChatParticipantProfiles = false,\n isPopulateLastMessage = false,\n allowReadMessageEventEmitting = false,\n isCacheEnabled = false,\n chatListRefresh = false,\n } = {},\n filterFn\n) => {\n const { search } = useLocation();\n const query = new URLSearchParams(search);\n const chatId = query.get(\"chatId\");\n\n const [chatList, setChatList] = useState(() => {\n if (isCacheEnabled) {\n const cache = LocalStorageService.getChatRooms();\n\n if (cache?.length) {\n return cache;\n }\n }\n\n return undefined;\n });\n\n const [isLoading, setIsLoading] = useState(true);\n const pendingNewChats = useRef([]);\n const { profile } = useContext(UserContext);\n const { socket, openedChatRoomId } = useContext(ChatContext);\n const isUnmounted = useRef();\n const isCacheMounted = useRef();\n\n useEffect(() => {\n if (isCacheEnabled && chatList && isCacheMounted.current) {\n LocalStorageService.setChatRooms(chatList);\n return;\n }\n\n isCacheMounted.current = true;\n }, [chatList]);\n\n const fetchChatList = useCallback(async () => {\n if (!profile) {\n setIsLoading(false);\n return;\n }\n\n setIsLoading(true);\n\n const chatRoomsResponse = await ChatService.getChatRoomsByUserId(\n profile.accountId,\n profile.userId,\n isPopulateLastMessage,\n isPopulateChatParticipants\n );\n\n const chatRoomsResponseFiltered = chatRoomsResponse.filter(\n (chatRoom) =>{\n if(chatRoom?.organizerName === SUPER_ADMIN_SENDER_NAME){\n return true;\n }\n return chatRoom?.participants?.length > 1\n } \n );\n\n let preparedChatRooms = chatRoomsResponseFiltered.map((chatRoom) =>\n prepareChatRoom(chatRoom, profile, isPopulateChatParticipantProfiles)\n );\n\n preparedChatRooms = (await Promise.all(preparedChatRooms))\n // eslint-disable-next-line no-nested-ternary\n .sort((a, b) =>\n a.lastMessage.sentAt < b.lastMessage.sentAt\n ? 1\n : b.lastMessage.sentAt < a.lastMessage.sentAt\n ? -1\n : 0\n );\n\n if (!isUnmounted.current) {\n setChatList(preparedChatRooms);\n setIsLoading(false);\n }\n }, [profile, chatListRefresh]);\n\n useEffect(()=>{\n (async () => {\n fetchChatList();\n })()\n }, [profile, chatListRefresh]);\n\n useEffect(() => {\n if (\n !socket?.current ||\n socket.current.disconnected ||\n !profile ||\n !openedChatRoomId ||\n !allowReadMessageEventEmitting\n ) {\n return;\n }\n \n if (!chatId) {\n return;\n }\n socket.current.emit(\"readMessages\", openedChatRoomId);\n }, [openedChatRoomId, socket]);\n\n useEffect(() => {\n if (!socket?.current || socket.current.disconnected || !profile) {\n return;\n }\n\n const newChatRoomHandler = async (chatRoom) => {\n if (chatList.find((chat) => chat.id === chatRoom.id)) {\n return;\n }\n\n if (chatRoom.participants.length < 2) {\n pendingNewChats.current = [...pendingNewChats.current, chatRoom];\n return;\n }\n\n const preparedChatRoom = await prepareChatRoom(\n chatRoom,\n profile,\n isPopulateChatParticipantProfiles\n );\n\n if (isUnmounted.current) {\n return;\n }\n\n setChatList((prev) =>\n prev ? [preparedChatRoom, ...prev] : [preparedChatRoom]\n );\n };\n\n const newChatParticipantHandler = async (chatParticipant) => {\n // this is used so we don't create new item in the list with one participant while adding participant\n const pendingChat = pendingNewChats.current.find(\n (v) => v.id === chatParticipant.chatRoomId\n );\n if (pendingChat) {\n if (chatList.find((chat) => chat.id === pendingChat.id)) {\n pendingNewChats.current = pendingNewChats.current.filter(\n (v) => v.id !== pendingChat.id\n );\n return;\n }\n\n const newChat = {\n ...pendingChat,\n participants: pendingChat.participants\n ? [...pendingChat.participants, chatParticipant]\n : [chatParticipant],\n };\n\n const chatRoomsResponse = await ChatService.getChatRoomsByUserId(\n profile.accountId,\n profile.userId,\n isPopulateLastMessage,\n isPopulateChatParticipants\n );\n\n const chatRoomsResponseFiltered = chatRoomsResponse.filter(\n (chatRoom) => chatRoom.participants.length > 1\n );\n let preparedChatRooms = await chatRoomsResponseFiltered.map(\n (chatRoom) =>\n prepareChatRoom(\n chatRoom,\n profile,\n isPopulateChatParticipantProfiles\n )\n );\n preparedChatRooms = (await Promise.all(preparedChatRooms))\n // eslint-disable-next-line no-nested-ternary\n .sort((a, b) =>\n a.lastMessage.sentAt < b.lastMessage.sentAt\n ? 1\n : b.lastMessage.sentAt < a.lastMessage.sentAt\n ? -1\n : 0\n );\n\n if (filterFn && typeof filterFn === \"function\") {\n preparedChatRooms = filterFn(preparedChatRooms);\n }\n\n if (!isUnmounted.current) {\n setChatList(preparedChatRooms);\n setIsLoading(false);\n }\n // setChatList((prev) => [preparedChatRoom, ...prev]);\n pendingNewChats.current = pendingNewChats.current.filter(\n (v) => v.id !== newChat.id\n );\n }\n };\n\n const newMessageHandler = (chatMessage) => {\n const newMessageChat = chatList.find(\n (chat) => chat.id === chatMessage.chatRoomId\n );\n if (!newMessageChat) {\n return;\n }\n\n if (chatMessage.senderId !== profile.userId) {\n const params = new URLSearchParams(window.location.search);\n const chatIdParams = params.get(\"chatId\");\n if (chatMessage.chatRoomId === openedChatRoomId && chatIdParams) {\n if (allowReadMessageEventEmitting) {\n socket.current.emit(\"readMessages\", chatMessage.chatRoomId);\n }\n } else {\n newMessageChat.unreadMessageCount += 1;\n }\n }\n\n newMessageChat.lastMessage = {\n ...chatMessage,\n sentAt: Number(chatMessage.sentAt),\n };\n\n if (!isUnmounted.current) {\n setChatList((prev) => [\n newMessageChat,\n ...prev.filter((chat) => chat.id !== chatMessage.chatRoomId),\n ]);\n }\n };\n\n const messagesReadHandler = (readEvent) => {\n if (!chatList) {\n return;\n }\n\n const chatListCopy = [...chatList];\n\n const readMessagesChat = chatListCopy.find(\n (chat) => chat.id === readEvent.chatRoomId\n );\n if (!readMessagesChat || readMessagesChat.unreadMessageCount === 0) {\n return;\n }\n\n readMessagesChat.unreadMessageCount = 0;\n\n if (!isUnmounted.current) {\n setChatList(chatListCopy);\n }\n };\n\n const chatRoomDeletedHandler = async (chatRoomId) => {\n if (!chatList.some((chat) => chat.id === chatRoomId)) {\n return;\n }\n\n if (!isUnmounted.current) {\n setChatList((prev) => prev.filter((chat) => chat.id !== chatRoomId));\n }\n };\n\n socket.current.on(\"newChatRoom\", newChatRoomHandler);\n socket.current.on(\"newChatParticipant\", newChatParticipantHandler);\n socket.current.on(\"newMessage\", newMessageHandler);\n socket.current.on(\"messagesRead\", messagesReadHandler);\n socket.current.on(\"chatRoomDeleted\", chatRoomDeletedHandler);\n socket.current.on(\"ParticipantChatListUpdate\", fetchChatList);\n\n // eslint-disable-next-line consistent-return\n return () => {\n socket.current.off(\"newChatRoom\", newChatRoomHandler);\n socket.current.off(\"newChatParticipant\", newChatParticipantHandler);\n socket.current.off(\"newMessage\", newMessageHandler);\n socket.current.off(\"messagesRead\", messagesReadHandler);\n socket.current.off(\"chatRoomDeleted\", chatRoomDeletedHandler);\n socket.current.off(\"ParticipantChatListUpdate\", fetchChatList);\n };\n }, [\n chatList,\n socket,\n profile,\n openedChatRoomId,\n isPopulateChatParticipantProfiles,\n allowReadMessageEventEmitting,\n ]);\n\n const updateChatRoom = useCallback(\n async (accountId, chatRoom, cb) => {\n const chatListCopy = [...chatList];\n const updatingChatIndex = chatListCopy.findIndex(\n (chat) => chat.id === chatRoom.id\n );\n if (updatingChatIndex === -1) {\n return;\n }\n\n const updateResponse = await ChatService.updateChatRoom(\n accountId,\n chatRoom\n );\n chatListCopy[updatingChatIndex] = {\n ...chatListCopy[updatingChatIndex],\n isArchived: updateResponse.isArchived,\n organizerName: updateResponse.organizerName,\n };\n\n setChatList(chatListCopy);\n if (cb && typeof cb === \"function\") {\n cb();\n }\n },\n [chatList]\n );\n\n return useMemo(() => {\n // TODO: investigate why sometimes there are chat duplicates\n const chats = chatList\n ? chatList.filter(\n (chat, index) => chatList.findIndex((c) => c.id === chat.id) === index\n )\n : [];\n return [chats, { isLoading, updateChatRoom }];\n }, [chatList, isLoading]);\n};\n\nexport const useChatMessages = ({\n chatRoomId,\n filterFn,\n chatMessagesRefresh = false,\n isGlobalChat = false,\n isDataFetchingEnabled = true,\n}) => {\n if(!isDataFetchingEnabled){\n return [undefined, { isLoading: false }];\n }\n const [chatMessages, setChatMessages] = useState(() => {\n let cache = undefined;\n if(isGlobalChat){\n cache = LocalStorageService.getGlobalChatRoomMessages(chatRoomId);\n }else{\n cache = LocalStorageService.getChatRoomMessages(chatRoomId);\n }\n return cache ?? undefined;\n });\n\n const [isLoading, setIsLoading] = useState(true);\n const [updatedReadBadgeId, setUpdatedReadBadgeId] = useState();\n const { profile } = useContext(UserContext);\n const { socket } = useContext(ChatContext);\n const {socketForGlobalMessage}= useContext(GlobalChatContext);\n const [initial, setInitial] = useState(true);\n const [isDataOver, setIsDataOver] = useState(false);\n const [date, setDate] = useState(null);\n const isUnmounted = useRef();\n const isCacheMounted = useRef();\n\n useEffect(() => {\n if (chatMessages && isCacheMounted.current) {\n if(isGlobalChat){\n LocalStorageService.setGlobalChatRoomMessages(chatRoomId, chatMessages);\n }else{\n LocalStorageService.setChatRoomMessages(chatRoomId, chatMessages);\n }\n return;\n }\n\n isCacheMounted.current = true;\n }, [chatMessages]);\n\n const handleChatMessages = async (date = null) => {\n if (!profile) {\n setIsLoading(false);\n return;\n }\n\n setIsLoading(true);\n let chatRoomMessagesResponse = [];\n if (isGlobalChat) {\n chatRoomMessagesResponse = await chatGraphqlInstance.getChatRoomMessages(\n chatRoomId,\n date\n );\n }else{\n chatRoomMessagesResponse = await ChatService.getChatRoomMessages(\n profile.accountId,\n chatRoomId,\n date\n );\n }\n if (chatRoomMessagesResponse.length < 20) {\n setIsDataOver(true);\n }\n const preparedChatMessagesPromises = chatRoomMessagesResponse.map(\n (chatMessage) => prepareChatMessage(chatMessage)\n );\n let preparedChatMessages = (await Promise.all(preparedChatMessagesPromises))\n // eslint-disable-next-line no-nested-ternary\n .sort((a, b) => (a.sentAt < b.sentAt ? 1 : b.sentAt < a.sentAt ? -1 : 0));\n\n if (filterFn && typeof filterFn === \"function\") {\n preparedChatMessages = filterFn(preparedChatMessages);\n }\n\n if (!isUnmounted.current) {\n setChatMessages((prev) =>{\n if(initial){\n return preparedChatMessages\n }\n return [...prev, ...preparedChatMessages]\n });\n setIsLoading(false);\n }\n };\n\n const handleLoadMoreMessages = async (newDate) => {\n setDate(newDate);\n setInitial(false);\n };\n\n useEffect(() => {\n if(date !== null && !initial){\n handleChatMessages(date);\n }\n }, [initial,date]);\n \n useEffect(() => {\n (async () => {\n handleChatMessages();\n return () => {\n isUnmounted.current = true;\n };\n })();\n }, [profile, chatRoomId, chatMessagesRefresh]);\n\n useEffect(() => {\n\n if(isGlobalChat){\n if (!socketForGlobalMessage?.current || socketForGlobalMessage.current.disconnected) {\n return;\n }\n }else{\n if (!socket?.current || socket.current.disconnected) {\n return;\n }\n }\n\n\n const newMessageHandler = async (chatMessage) => {\n if(isGlobalChat){\n if (chatMessage.globalChatRoomId !== chatRoomId) {\n return;\n }\n }else{\n if (chatMessage.chatRoomId !== chatRoomId) {\n return;\n }\n }\n\n const existingMessage = chatMessages?.find(\n (v) => v.id === chatMessage.id\n );\n\n if (existingMessage) {\n if (!existingMessage.isPending) {\n return;\n }\n\n const preparedMessage = await prepareChatMessage({\n ...chatMessage,\n attachments: existingMessage.attachments,\n isPending: false,\n });\n if (!isUnmounted.current) {\n setChatMessages((prev) => [\n preparedMessage,\n ...prev.filter((v) => v.id !== preparedMessage.id),\n ]);\n }\n\n return;\n }\n\n const preparedNewMessage = await prepareChatMessage(chatMessage);\n\n if (!isUnmounted.current) {\n setChatMessages((prev) =>\n prev ? [preparedNewMessage, ...prev] : [preparedNewMessage]\n );\n }\n };\n\n const participantDeletedHandler = () => {\n handleChatMessages();\n };\n\n socket.current.on(\"newMessage\", newMessageHandler);\n socketForGlobalMessage.current.on(\"newGlobalChatMessage\", newMessageHandler);\n socket.current.on(\n \"participantMessagesRead\",\n participantMessagesReadHandler\n );\n socket.current.on(\"participantDeleteMessage\", participantDeletedHandler);\n socketForGlobalMessage.current.on(\"globalParticipantDeleteMessage\", participantDeletedHandler);\n\n // eslint-disable-next-line consistent-return\n return () => {\n socket.current.off(\"newMessage\", newMessageHandler);\n socketForGlobalMessage.current.off(\"newGlobalChatMessage\", newMessageHandler);\n socket.current.off(\n \"participantMessagesRead\",\n participantMessagesReadHandler\n );\n socket.current.off(\"participantDeleteMessage\", participantDeletedHandler);\n socketForGlobalMessage.current.off(\"globalParticipantDeleteMessage\", participantDeletedHandler);\n };\n }, [chatMessages, socket, profile, chatRoomId,socketForGlobalMessage]);\n\n const createChatMessage = useCallback(\n async (newMessage, cb) => {\n const messageId = generateUUID();\n const messageAttachments = newMessage.attachments?.length\n ? newMessage.attachments.map((attachment) => ({\n id: attachment.fileName.split(\".\")[0],\n accountId: newMessage.accountId,\n entityId: messageId,\n entityType: \"chatAttachment\",\n resourceName: attachment.originalFileName.split(\".\")[0],\n resourceType: attachment.fileName.split(\".\").pop(),\n contentType: attachment.mimetype,\n size: attachment.size,\n }))\n : [];\n\n const preparedNewMessage = await prepareChatMessage({\n id: messageId,\n ...newMessage,\n attachments: messageAttachments,\n });\n\n setChatMessages((prev) =>\n prev\n ? [{ ...preparedNewMessage, isPending: true }, ...prev]\n : [{ ...preparedNewMessage, isPending: true }]\n );\n\n const attachmentsPromises = messageAttachments.map((attachment) =>\n ResourceService.createResource(preparedNewMessage.accountId, attachment)\n );\n\n await Promise.all(attachmentsPromises);\n await ChatService.createChatRoomMessage(preparedNewMessage.accountId, {\n id: preparedNewMessage.id,\n accountId: preparedNewMessage.accountId,\n senderName: preparedNewMessage.senderName,\n senderId: preparedNewMessage.senderId,\n chatRoomId: preparedNewMessage.chatRoomId,\n messageText: preparedNewMessage.messageText,\n type: preparedNewMessage.type,\n sentAt: preparedNewMessage.sentAt,\n });\n\n if (cb && typeof cb === \"function\") {\n cb();\n }\n },\n [chatMessages]\n );\n\n const createGlobalChatMessage = useCallback(\n async (newMessage, cb) => {\n const messageId = generateUUID();\n const messageAttachments = newMessage.attachments?.length\n ? newMessage.attachments.map((attachment) => ({\n id: attachment.fileName.split(\".\")[0],\n accountId: newMessage.globalChatRoomId,\n entityId: messageId,\n entityType: \"chatAttachment\",\n resourceName: attachment.originalFileName.split(\".\")[0],\n resourceType: attachment.fileName.split(\".\").pop(),\n contentType: attachment.mimetype,\n size: attachment.size,\n isGlobalChat: true,\n }))\n : [];\n\n const preparedNewMessage = await prepareChatMessage({\n id: messageId,\n ...newMessage,\n attachments: messageAttachments,\n });\n\n setChatMessages((prev) =>\n prev\n ? [{ ...preparedNewMessage, isPending: true }, ...prev]\n : [{ ...preparedNewMessage, isPending: true }]\n );\n\n const attachmentsPromises = messageAttachments.map((attachment) =>\n ResourceService.createResource(preparedNewMessage.globalChatRoomId, attachment)\n );\n\n await Promise.all(attachmentsPromises);\n await chatGraphqlInstance.createChatChatMessageGlobal({\n id: preparedNewMessage.id,\n senderName: preparedNewMessage.senderName,\n senderId: preparedNewMessage.senderId,\n globalChatRoomId: preparedNewMessage.globalChatRoomId,\n messageText: preparedNewMessage.messageText,\n type: preparedNewMessage.type,\n sentAt: preparedNewMessage.sentAt,\n });\n\n if (cb && typeof cb === \"function\") {\n cb();\n }\n },\n [chatMessages]\n );\n\n const participantMessagesReadHandler = async (readEvent) => {\n if (chatMessages && readEvent.chatRoomId === chatRoomId) {\n await chatGraphqlInstance\n .getUnreadMessageCount(\n readEvent.chatRoomId,\n readEvent.accountId,\n readEvent.userId\n )\n .then((res) => {\n const messageData = chatMessages.filter(\n (x) => x.senderId === profile.userId\n );\n if (messageData) {\n setUpdatedReadBadgeId(messageData?.[res]?.id);\n }\n });\n }\n };\n \n return useMemo(() => {\n // TODO: investigate why sometimes there are message duplicates\n const messages = chatMessages\n ? chatMessages.filter(\n (message, index) =>\n chatMessages.findIndex((m) => m.id === message.id) === index\n )\n : [];\n return [messages, { createChatMessage, isLoading, updatedReadBadgeId ,createGlobalChatMessage , handleLoadMoreMessages ,isDataOver }];\n }, [chatMessages, isLoading, updatedReadBadgeId ,handleLoadMoreMessages]);\n};\n\nexport const useChatRoomCreate = () => {\n const [isLoading, setIsLoading] = useState(false);\n const isUnmounted = useRef();\n\n useEffect(\n () => () => {\n isUnmounted.current = true;\n },\n []\n );\n\n const createChatRoom = useCallback(async (newChat, chatParticipant, cb) => {\n setIsLoading(true);\n\n const chatRoomResponse = await ChatService.createChatRoom(\n newChat.accountId,\n {\n isArchived: newChat.isArchived,\n organizerName: newChat.organizerName,\n organizerId: newChat.organizerId,\n accountId: newChat.accountId,\n }\n );\n\n const chatRoomParticipant = await ChatService.createChatRoomParticipant(\n chatRoomResponse.accountId,\n {\n chatRoomId: chatRoomResponse.id,\n accountId: chatRoomResponse.accountId,\n name: chatParticipant.name,\n userId: chatParticipant.userId,\n }\n );\n\n if (!isUnmounted.current) {\n setIsLoading(false);\n }\n\n if (cb && typeof cb === \"function\") {\n cb({ ...chatRoomResponse, id: chatRoomParticipant.chatRoomId });\n }\n }, []);\n\n return [createChatRoom, { isLoading }];\n};\n\nexport const useGroupChatRoomCreate = () => {\n const [isLoading, setIsLoading] = useState(false);\n const isUnmounted = useRef();\n\n useEffect(\n () => () => {\n isUnmounted.current = true;\n },\n []\n );\n\n const createGroupChatRoom = useCallback(\n async (newChat, chatParticipant, cb) => {\n setIsLoading(true);\n const chatRoomResponse = await ChatService.createChatRoom(\n newChat.accountId,\n {\n isArchived: newChat.isArchived,\n organizerName: newChat.organizerName,\n organizerId: newChat.organizerId,\n accountId: newChat.accountId,\n name: newChat.groupName ? newChat.groupName : undefined,\n }\n );\n\n for (const participant of chatParticipant) {\n await ChatService.createChatRoomParticipant(\n chatRoomResponse.accountId,\n {\n chatRoomId: chatRoomResponse.id,\n accountId: chatRoomResponse.accountId,\n name: participant.name,\n userId: participant.userId,\n }\n );\n }\n\n if (!isUnmounted.current) {\n setIsLoading(false);\n }\n\n if (cb && typeof cb === \"function\") {\n cb(chatRoomResponse);\n }\n },\n []\n );\n\n return [createGroupChatRoom, { isLoading }];\n};\n\nexport const useChatRoomDelete = () => {\n const [isLoading, setIsLoading] = useState(false);\n\n const deleteChatRoom = useCallback(async (accountId, chatRoomId, cb) => {\n setIsLoading(true);\n\n await ChatService.deleteChatRoom(accountId, chatRoomId);\n\n setIsLoading(false);\n\n if (cb && typeof cb === \"function\") {\n cb();\n }\n }, []);\n\n return [deleteChatRoom, { isLoading }];\n};\n\nexport const useChatAttachments = (isGlobalChatRoom=false,chatRoomId, filterFn) => {\n const [attachments, setAttachments] = useState();\n const { profile } = useContext(UserContext);\n const { socket } = useContext(ChatContext);\n const { socketForGlobalMessage } = useContext(GlobalChatContext);\n const [isLoading, setIsLoading] = useState(true);\n \n const isUnmounted = useRef();\n\n const fetchChatAttachments = useCallback(async (isGlobal=false) => {\n \n if (!profile) {\n setIsLoading(false);\n return;\n }\n\n setIsLoading(true);\n\n let chatAttachmentsResponse = [];\n\n if(isGlobal){\n chatAttachmentsResponse = await chatGraphqlInstance.getAttachmentsByGlobalChatRoomId(chatRoomId)\n }else{\n chatAttachmentsResponse = await ChatService.getChatRoomAttachments(\n profile.accountId,\n chatRoomId,\n isGlobal\n );\n }\n\n if (isUnmounted.current) {\n return;\n }\n\n chatAttachmentsResponse = chatAttachmentsResponse\n .map((attachment) => ({\n ...attachment,\n sentAt: Number(attachment.sentAt),\n attachmentSize: Number(attachment.attachmentSize),\n }))\n // eslint-disable-next-line no-nested-ternary\n .sort((a, b) => (a.sentAt < b.sentAt ? 1 : b.sentAt < a.sentAt ? -1 : 0));\n\n if (filterFn && typeof filterFn === \"function\") {\n chatAttachmentsResponse = filterFn(chatAttachmentsResponse);\n }\n\n setAttachments(chatAttachmentsResponse);\n setIsLoading(false);\n }, [profile,chatRoomId]);\n\n\n useEffect(() => {\n fetchChatAttachments(isGlobalChatRoom);\n }, [profile, chatRoomId]);\n\n useEffect(() => {\n if(isGlobalChatRoom){\n if (!socketForGlobalMessage?.current || socketForGlobalMessage.current.disconnected) {\n return;\n }\n }else{\n if (!socket?.current || socket.current.disconnected) {\n return;\n }\n }\n\n const newChatAttachmentHandler = async (chatAttachment) => {\n \n if ((chatAttachment?.hasOwnProperty('globalChatRoomId') ? chatAttachment?.globalChatRoomId : chatAttachment.chatRoomId) !== chatRoomId) {\n return;\n }\n\n const preparedChatAttachment = {\n ...chatAttachment,\n sentAt: Number(chatAttachment.sentAt),\n };\n\n if (!isUnmounted.current) {\n setAttachments((prev) =>\n prev ? [preparedChatAttachment, ...prev] : [preparedChatAttachment]\n );\n }\n };\n\n const attachmentDeleteHandler = async (data) => {\n fetchChatAttachments(data)\n };\n\n socket.current.on(\"newChatAttachment\", newChatAttachmentHandler);\n socketForGlobalMessage.current.on(\"newGlobalChatAttachment\", newChatAttachmentHandler);\n socketForGlobalMessage.current.on(\"globalParticipantDeleteAttachment\", attachmentDeleteHandler);\n socket.current.on(\"participantDeleteAttachment\",attachmentDeleteHandler);\n\n // eslint-disable-next-line consistent-return\n return () => {\n socket.current.off(\"newChatAttachment\", newChatAttachmentHandler);\n socketForGlobalMessage.current.off(\"newGlobalChatAttachment\", newChatAttachmentHandler);\n socketForGlobalMessage.current.off(\"globalParticipantDeleteAttachment\", attachmentDeleteHandler);\n socket.current.off(\"participantDeleteAttachment\", attachmentDeleteHandler);\n };\n }, [attachments, socket, profile, chatRoomId,socketForGlobalMessage]);\n \n // TODO: investigate why sometimes there are attachments duplicates\n return useMemo(() => {\n const result = attachments\n ? attachments.filter(\n (attachment, index) =>\n attachments.findIndex(\n (a) =>\n (a.hasOwnProperty(\"globalChatRoomId\") ? a.globalChatRoomId : a.chatRoomId) === (attachment.hasOwnProperty(\"globalChatRoomId\") ? attachment?.globalChatRoomId : attachment.chatRoomId) &&\n a.attachmentId === attachment.attachmentId\n ) === index\n )\n : [];\n\n return [result, { isLoading }];\n }, [attachments, isLoading]);\n};\n\nexport const useGlobalChatRoomCreate = () => {\n const [isLoading, setIsLoading] = useState(false);\n const isUnmounted = useRef();\n\n useEffect(\n () => () => {\n isUnmounted.current = true;\n },\n []\n );\n\n const createGlobalChatRoom = useCallback(\n async (newChat, chatParticipant, cb) => {\n setIsLoading(true);\n const globalChatRoomResponse =\n await chatGraphqlInstance.createChatChatRoomGlobal({\n isArchived: newChat.isArchived,\n organizerName: newChat.organizerName,\n organizerId: newChat.organizerId,\n });\n\n await chatParticipant.forEach(\n async (participant) =>\n await chatGraphqlInstance.createChatChatParticipantGlobal({\n name: participant.name,\n userId: participant.userId,\n globalChatRoomId: globalChatRoomResponse.id,\n })\n )\n\n if (!isUnmounted.current) {\n setIsLoading(false);\n }\n\n if (cb && typeof cb === \"function\") {\n cb(globalChatRoomResponse);\n }\n },\n []\n );\n\n return [createGlobalChatRoom, { isLoading }];\n}\n\nexport const useGroupChatRoomCreateForGlobal = () => {\n const [isLoading, setIsLoading] = useState(false);\n const isUnmounted = useRef();\n\n useEffect(\n () => () => {\n isUnmounted.current = true;\n },\n []\n );\n\n const createGroupChatRoomForGlobal = useCallback(\n async (newChat, chatParticipant, cb) => {\n setIsLoading(true);\n const globalChatRoomResponse =\n await chatGraphqlInstance.createChatChatRoomGlobal({\n isArchived: newChat.isArchived,\n organizerName: newChat.organizerName,\n organizerId: newChat.organizerId,\n name: newChat.groupName ? newChat.groupName : undefined,\n });\n\n await chatParticipant.forEach(\n async (participant) =>\n await chatGraphqlInstance.createChatChatParticipantGlobal({\n name: participant.name,\n userId: participant.userId,\n globalChatRoomId: globalChatRoomResponse.id,\n })\n );\n\n if (!isUnmounted.current) {\n setIsLoading(false);\n }\n\n if (cb && typeof cb === \"function\") {\n cb(globalChatRoomResponse);\n }\n },\n []\n );\n\n return [createGroupChatRoomForGlobal, { isLoading }];\n};\n\nconst prepareGlobalChatRoom = async (\n chatRoomParam,\n userProfile,\n populateChatParticipantProfiles\n) => {\n const { messageCount, ...chatRoom } = { ...chatRoomParam };\n let unreadMessageCount = messageCount ? Number(messageCount) : 0;\n\n if (chatRoom.participants) {\n const currentUserParticipant = chatRoom.participants.find(\n (participant) => participant.userId === userProfile.userId\n );\n if (currentUserParticipant) {\n const sendMessageCount = currentUserParticipant.sendMessageCount\n ? Number(currentUserParticipant.sendMessageCount)\n : 0;\n const readMessageCount = currentUserParticipant.readMessageCount\n ? Number(currentUserParticipant.readMessageCount)\n : 0;\n unreadMessageCount =\n unreadMessageCount - sendMessageCount - readMessageCount;\n\n chatRoom.participants = chatRoom.participants.filter(\n (participant) => participant.userId !== userProfile.userId\n );\n }\n\n if (populateChatParticipantProfiles) {\n const participantProfiles = chatRoom.participants.map((participant) =>\n profileGraphqlInstance.getAllAccountPerson({\n userId: participant.userId,\n })\n );\n chatRoom.participantProfiles = await Promise.all(participantProfiles);\n }\n }\n\n if (chatRoom.lastMessage) {\n chatRoom.lastMessage = {\n ...chatRoom.lastMessage,\n sentAt: Number(chatRoom.lastMessage.sentAt),\n };\n } else {\n chatRoom.lastMessage = {\n sentAt: Number(chatRoom.createdAt),\n messageText: \"\",\n type: CHAT_MESSAGE_TYPES.TEXT,\n };\n }\n\n return {\n ...chatRoom,\n unreadMessageCount,\n profile:\n (chatRoom.participantProfiles && chatRoom.participantProfiles?.flatMap((v) => v))[0] || [],\n };\n};\n\nexport const useGlobalChatList = (\n {\n isPopulateChatParticipants = false,\n isPopulateChatParticipantProfiles = false,\n isPopulateLastMessage = false,\n allowReadMessageEventEmitting = false,\n isCacheEnabled = false,\n chatListRefresh = false,\n } = {},\n filterFn\n) => {\n const { search } = useLocation();\n const query = new URLSearchParams(search);\n const chatId = query.get(\"chatId\");\n\n const [globalChatList, setGlobalChatList] = useState(() => {\n if (isCacheEnabled) {\n const cache = LocalStorageService.getChatRooms();\n\n if (cache?.length) {\n return cache;\n }\n }\n\n return undefined;\n });\n\n const [isLoading, setIsLoading] = useState(true);\n const pendingNewChats = useRef([]);\n const { profile } = useContext(UserContext);\n const { socketForGlobalMessage, openedChatRoomId } = useContext(GlobalChatContext);\n const isUnmounted = useRef();\n const isCacheMounted = useRef();\n const isCounsellor = profile?.type === USER_ROLES.COUNSELLOR_ROLE;\n\n if(!isCounsellor){\n return [[], { isLoading: false }];\n }\n\n useEffect(() => {\n if (isCacheEnabled && globalChatList && isCacheMounted.current) {\n LocalStorageService.setChatRooms(globalChatList);\n return;\n }\n\n isCacheMounted.current = true;\n }, [globalChatList]);\n\n const fetchGlobalChatList = useCallback(async () => {\n if (!profile) {\n setIsLoading(false);\n return;\n }\n\n setIsLoading(true);\n \n const chatRoomsResponse = await chatGraphqlInstance.getChatRoomsByUserId({\n userId: profile.userId,\n populateLastMessage: isPopulateLastMessage,\n populateChatParticipants: isPopulateChatParticipants,\n });\n\n const chatRoomsResponseFiltered = chatRoomsResponse.filter(\n (chatRoom) => chatRoom?.participants?.length > 1\n );\n\n let preparedChatRooms = chatRoomsResponseFiltered.map((chatRoom) =>\n prepareGlobalChatRoom(\n chatRoom,\n profile,\n isPopulateChatParticipantProfiles\n )\n );\n\n preparedChatRooms = (await Promise.all(preparedChatRooms))\n // eslint-disable-next-line no-nested-ternary\n .sort((a, b) =>\n a.lastMessage.sentAt < b.lastMessage.sentAt\n ? 1\n : b.lastMessage.sentAt < a.lastMessage.sentAt\n ? -1\n : 0\n );\n\n if (filterFn && typeof filterFn === \"function\") {\n preparedChatRooms = filterFn(preparedChatRooms);\n }\n\n if (!isUnmounted.current) {\n setGlobalChatList(preparedChatRooms);\n setIsLoading(false);\n }\n }, [profile,chatListRefresh]);\n\n useEffect(()=>{\n (async () => {\n fetchGlobalChatList();\n })()\n }, [profile, chatListRefresh]);\n\n useEffect(() => {\n if (\n !socketForGlobalMessage?.current ||\n socketForGlobalMessage.current.disconnected ||\n !profile ||\n !openedChatRoomId ||\n !allowReadMessageEventEmitting\n ) {\n return;\n }\n\n if(!chatId){\n return;\n }\n \n socketForGlobalMessage.current.emit(\"readGlobalMessages\", openedChatRoomId);\n }, [openedChatRoomId, socketForGlobalMessage]);\n\n useEffect(() => {\n if (!socketForGlobalMessage?.current || socketForGlobalMessage.current.disconnected || !profile) {\n return;\n }\n\n const newChatRoomHandler = async (chatRoom) => {\n if (globalChatList.find((chat) => chat.id === chatRoom.id)) {\n return;\n }\n\n if (chatRoom.participants.length < 2) {\n pendingNewChats.current = [...pendingNewChats.current, chatRoom];\n return;\n }\n\n const preparedChatRoom = await prepareGlobalChatRoom(\n chatRoom,\n profile,\n isPopulateChatParticipantProfiles\n );\n\n if (isUnmounted.current) {\n return;\n }\n\n setGlobalChatList((prev) =>\n prev ? [preparedChatRoom, ...prev] : [preparedChatRoom]\n );\n };\n\n const newChatParticipantHandler = async (chatParticipant) => {\n // this is used so we don't create new item in the list with one participant while adding participant\n const pendingChat = pendingNewChats.current.find(\n (v) => v.id === chatParticipant.globalChatRoomId\n );\n\n if (pendingChat) {\n if (globalChatList.find((chat) => chat.id === pendingChat.id)) {\n pendingNewChats.current = pendingNewChats.current.filter(\n (v) => v.id !== pendingChat.id\n );\n return;\n }\n\n const newChat = {\n ...pendingChat,\n participants: pendingChat.participants\n ? [...pendingChat.participants, chatParticipant]\n : [chatParticipant],\n };\n\n const chatRoomsResponse = await chatGraphqlInstance.getChatRoomsByUserId({\n userId: profile.userId,\n populateLastMessage: isPopulateLastMessage,\n populateChatParticipants: isPopulateChatParticipants,\n })\n\n const chatRoomsResponseFiltered = chatRoomsResponse.filter(\n (chatRoom) => chatRoom.participants.length > 1\n );\n\n let preparedChatRooms = await chatRoomsResponseFiltered.map(\n (chatRoom) =>\n prepareGlobalChatRoom(\n chatRoom,\n profile,\n isPopulateChatParticipantProfiles\n )\n );\n preparedChatRooms = (await Promise.all(preparedChatRooms))\n\n // eslint-disable-next-line no-nested-ternary\n .sort((a, b) =>\n a.lastMessage.sentAt < b.lastMessage.sentAt\n ? 1\n : b.lastMessage.sentAt < a.lastMessage.sentAt\n ? -1\n : 0\n );\n \n if (filterFn && typeof filterFn === \"function\") {\n preparedChatRooms = filterFn(preparedChatRooms);\n }\n\n if (!isUnmounted.current) {\n setGlobalChatList(preparedChatRooms);\n setIsLoading(false);\n }\n // setChatList((prev) => [preparedChatRoom, ...prev]);\n pendingNewChats.current = pendingNewChats.current.filter(\n (v) => v.id !== newChat.id\n );\n }\n };\n\n const newMessageHandler =async (chatMessage) => {\n const newMessageChat = globalChatList.find(\n (chat) => chat.id === chatMessage.globalChatRoomId\n );\n \n if (!newMessageChat) {\n return;\n }\n\n if (chatMessage.senderId !== profile.userId) {\n const params = new URLSearchParams(window.location.search);\n const chatIdParams = params.get(\"chatId\");\n if (chatMessage.globalChatRoomId === openedChatRoomId && chatIdParams) {\n if (allowReadMessageEventEmitting) {\n socketForGlobalMessage.current.emit(\"readGlobalMessages\", chatMessage.globalChatRoomId);\n }\n } else {\n newMessageChat.unreadMessageCount += 1;\n }\n }\n\n newMessageChat.lastMessage = {\n ...chatMessage,\n sentAt: Number(chatMessage.sentAt),\n };\n\n if (!isUnmounted.current) {\n setGlobalChatList((prev) => [\n newMessageChat,\n ...prev.filter((chat) => chat.id !== chatMessage.globalChatRoomId),\n ]);\n }\n };\n\n const messagesReadHandler = (readEvent) => {\n if (!globalChatList) {\n return;\n }\n\n const chatListCopy = [...globalChatList];\n\n const readMessagesChat = chatListCopy.find(\n (chat) => chat.id === readEvent.globalChatRoomId\n );\n\n if (!readMessagesChat || readMessagesChat.unreadMessageCount === 0) {\n return;\n }\n\n readMessagesChat.unreadMessageCount = 0;\n\n if (!isUnmounted.current) {\n setGlobalChatList(chatListCopy);\n }\n };\n\n const chatRoomDeletedHandler = async (globalChatRoomId) => {\n if (!globalChatList.some((chat) => chat.id === globalChatRoomId)) {\n return;\n }\n\n if (!isUnmounted.current) {\n setGlobalChatList((prev) => prev.filter((chat) => chat.id !== globalChatRoomId));\n }\n };\n\n socketForGlobalMessage.current.on(\"newGlobalChatRoom\", newChatRoomHandler);\n socketForGlobalMessage.current.on(\"newGlobalChatParticipant\", newChatParticipantHandler);\n socketForGlobalMessage.current.on(\"newGlobalChatMessage\", newMessageHandler);\n socketForGlobalMessage.current.on(\"globalMessagesRead\", messagesReadHandler);\n socketForGlobalMessage.current.on(\"globalChatRoomDeleted\", chatRoomDeletedHandler);\n socketForGlobalMessage.current.on(\"globalParticipantChatListUpdate\", fetchGlobalChatList);\n\n // eslint-disable-next-line consistent-return\n return () => {\n socketForGlobalMessage.current.off(\"newGlobalChatRoom\", newChatRoomHandler);\n socketForGlobalMessage.current.off(\"newGlobalChatParticipant\", newChatParticipantHandler);\n socketForGlobalMessage.current.off(\"newGlobalChatMessage\", newMessageHandler);\n socketForGlobalMessage.current.off(\"globalMessagesRead\", messagesReadHandler);\n socketForGlobalMessage.current.off(\"globalChatRoomDeleted\", chatRoomDeletedHandler);\n socketForGlobalMessage.current.off(\"globalParticipantChatListUpdate\", fetchGlobalChatList);\n };\n }, [\n globalChatList,\n socketForGlobalMessage,\n profile,\n openedChatRoomId,\n isPopulateChatParticipantProfiles,\n allowReadMessageEventEmitting,\n ]);\n\n const updateGlobalChatRoom = useCallback(\n async (accountId, chatRoom, cb) => {\n const chatListCopy = [...globalChatList];\n const updatingChatIndex = chatListCopy.findIndex(\n (chat) => chat.id === chatRoom.id\n );\n if (updatingChatIndex === -1) {\n return;\n }\n\n const updateResponse = await chatGraphqlInstance.updateChatChatRoomGlobal({\n id: chatRoom.id,\n isArchived: chatRoom.isArchived,\n })\n\n chatListCopy[updatingChatIndex] = {\n ...chatListCopy[updatingChatIndex],\n isArchived: updateResponse.isArchived,\n organizerName: updateResponse.organizerName,\n };\n\n setGlobalChatList(chatListCopy);\n if (cb && typeof cb === \"function\") {\n cb();\n }\n },\n [globalChatList]\n );\n\n return useMemo(() => {\n // TODO: investigate why sometimes there are chat duplicates\n const chats = globalChatList\n ? globalChatList.filter(\n (chat, index) => globalChatList.findIndex((c) => c.id === chat.id) === index\n )\n : [];\n return [chats, { isLoading, updateGlobalChatRoom }];\n }, [globalChatList, isLoading]);\n};\n","import { useEffect, useMemo, useState, useContext, useRef } from \"react\";\nimport ProfileService from \"@services/api/profile\";\nimport { UserContext } from \"@contexts/User\";\nimport config from \"@config/config\";\n\nexport const useProfileList = (type, filterFn) => {\n const [profiles, setProfiles] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n const { profile } = useContext(UserContext);\n\n useEffect(() => {\n (async () => {\n if (!profile) {\n return;\n }\n\n setIsLoading(true);\n let profilesResponse = await ProfileService.getProfilesByType(\n profile.accountId,\n type\n );\n\n if (filterFn && typeof filterFn === \"function\") {\n profilesResponse = filterFn(profilesResponse);\n }\n\n setProfiles(profilesResponse);\n setIsLoading(false);\n })();\n }, [profile, type]);\n\n return useMemo(() => {\n if (!profiles) return [[], { isLoading }];\n return [profiles, { isLoading }];\n }, [profiles, isLoading]);\n};\n\nexport const useProfile = (profileId) => {\n const [profile, setProfile] = useState(null);\n const { profile: currentProfile } = useContext(UserContext);\n\n useEffect(() => {\n (async () => {\n if (!currentProfile || !profileId) {\n return;\n }\n\n const profileResponse = await ProfileService.getProfileById(\n currentProfile.accountId,\n profileId\n );\n\n setProfile(profileResponse);\n })();\n }, [currentProfile, profileId]);\n\n return useMemo(() => {\n if (!profile) {\n return null;\n }\n\n return profile;\n }, [currentProfile, profileId, profile]);\n};\n\nexport const useProfileImageUrl = (profilePictureName, accountId) =>\n useMemo(() => {\n if (!profilePictureName || !accountId) {\n return \"\";\n }\n\n return `${config.resourceApiUrl}/accounts/${accountId}/profileImage/${profilePictureName}`;\n }, [profilePictureName, accountId]);\n\nexport const useProfileUrl = (profilePictureName, accountId) => {\n if (!profilePictureName || !accountId) {\n return \"\";\n }\n\n return `${config.resourceApiUrl}/accounts/${accountId}/profileImage/${profilePictureName}`;\n};\n\nexport const useProfileVideoUrl = (profileVideoName, accountId) =>\n useMemo(() => {\n if (!profileVideoName || !accountId) {\n return \"\";\n }\n\n return `${config.resourceApiUrl}/accounts/${accountId}/introductionVideo/${profileVideoName}`;\n });\n","import {\n useEffect, useRef,\n} from 'react';\n\nexport default function useDeferredRenderEffect(fn, inputs) {\n const didMountRef = useRef(null);\n\n useEffect(() => {\n if (didMountRef.current && didMountRef.current !== JSON.stringify(inputs)) {\n didMountRef.current = JSON.stringify(inputs);\n\n return fn();\n }\n didMountRef.current = JSON.stringify(inputs);\n return () => {};\n }, [fn, inputs]);\n}\n","import { useMemo, useState, useRef, useEffect, useCallback } from 'react';\n\nexport const FETCH_TYPES = {\n QUERY: 'query',\n MUTATION: 'mutation',\n};\n\nexport const useFetchHook = (fetch, type) => {\n const [data, setData] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n const [isSuccess, setIsSuccess] = useState(false);\n const [error, setError] = useState(null);\n const isUnmounted = useRef();\n\n useEffect(() => {\n (async () => {\n if (type === FETCH_TYPES.QUERY) {\n await sendFetch();\n }\n })();\n }, [type]);\n\n const sendFetch = useCallback(\n async (...params) => {\n setIsSuccess(false);\n setIsLoading(true);\n\n try {\n const values = await fetch(...params);\n if (!isUnmounted.current) {\n setData(values);\n setIsSuccess(true);\n setIsLoading(false);\n }\n return {data: values, error: null};\n } catch (e) {\n setError(e);\n setIsLoading(false);\n return {data: null, error: e};\n }\n },\n [fetch],\n );\n\n return useMemo(() => {\n if (type === FETCH_TYPES.QUERY) {\n return {\n data, isLoading, error, isSuccess,\n };\n }\n return (\n [sendFetch, {\n data, isLoading, error, isSuccess,\n }]\n );\n }, [data, isLoading, sendFetch, error, isSuccess]);\n};\n","import {useEffect} from 'react';\n\nexport function useOutside(ref, handler) {\n useEffect(() => {\n function handleClickOutside(event) {\n if (ref.current && !ref.current.contains(event.target)) {\n handler(false);\n }\n }\n\n document.addEventListener('mousedown', handleClickOutside);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [handler, ref]);\n}\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\n\nvar arr = [];\nvar each = arr.forEach;\nvar slice = arr.slice;\nfunction defaults(obj) {\n each.call(slice.call(arguments, 1), function (source) {\n if (source) {\n for (var prop in source) {\n if (obj[prop] === undefined) obj[prop] = source[prop];\n }\n }\n });\n return obj;\n}\n\n// eslint-disable-next-line no-control-regex\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\nvar serializeCookie = function serializeCookie(name, val, options) {\n var opt = options || {};\n opt.path = opt.path || '/';\n var value = encodeURIComponent(val);\n var str = \"\".concat(name, \"=\").concat(value);\n if (opt.maxAge > 0) {\n var maxAge = opt.maxAge - 0;\n if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');\n str += \"; Max-Age=\".concat(Math.floor(maxAge));\n }\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n str += \"; Domain=\".concat(opt.domain);\n }\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n str += \"; Path=\".concat(opt.path);\n }\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n str += \"; Expires=\".concat(opt.expires.toUTCString());\n }\n if (opt.httpOnly) str += '; HttpOnly';\n if (opt.secure) str += '; Secure';\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n return str;\n};\nvar cookie = {\n create: function create(name, value, minutes, domain) {\n var cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n path: '/',\n sameSite: 'strict'\n };\n if (minutes) {\n cookieOptions.expires = new Date();\n cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);\n }\n if (domain) cookieOptions.domain = domain;\n document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);\n },\n read: function read(name) {\n var nameEQ = \"\".concat(name, \"=\");\n var ca = document.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n },\n remove: function remove(name) {\n this.create(name, '', -1);\n }\n};\nvar cookie$1 = {\n name: 'cookie',\n lookup: function lookup(options) {\n var found;\n if (options.lookupCookie && typeof document !== 'undefined') {\n var c = cookie.read(options.lookupCookie);\n if (c) found = c;\n }\n return found;\n },\n cacheUserLanguage: function cacheUserLanguage(lng, options) {\n if (options.lookupCookie && typeof document !== 'undefined') {\n cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain, options.cookieOptions);\n }\n }\n};\n\nvar querystring = {\n name: 'querystring',\n lookup: function lookup(options) {\n var found;\n if (typeof window !== 'undefined') {\n var search = window.location.search;\n if (!window.location.search && window.location.hash && window.location.hash.indexOf('?') > -1) {\n search = window.location.hash.substring(window.location.hash.indexOf('?'));\n }\n var query = search.substring(1);\n var params = query.split('&');\n for (var i = 0; i < params.length; i++) {\n var pos = params[i].indexOf('=');\n if (pos > 0) {\n var key = params[i].substring(0, pos);\n if (key === options.lookupQuerystring) {\n found = params[i].substring(pos + 1);\n }\n }\n }\n }\n return found;\n }\n};\n\nvar hasLocalStorageSupport = null;\nvar localStorageAvailable = function localStorageAvailable() {\n if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;\n try {\n hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;\n var testKey = 'i18next.translate.boo';\n window.localStorage.setItem(testKey, 'foo');\n window.localStorage.removeItem(testKey);\n } catch (e) {\n hasLocalStorageSupport = false;\n }\n return hasLocalStorageSupport;\n};\nvar localStorage = {\n name: 'localStorage',\n lookup: function lookup(options) {\n var found;\n if (options.lookupLocalStorage && localStorageAvailable()) {\n var lng = window.localStorage.getItem(options.lookupLocalStorage);\n if (lng) found = lng;\n }\n return found;\n },\n cacheUserLanguage: function cacheUserLanguage(lng, options) {\n if (options.lookupLocalStorage && localStorageAvailable()) {\n window.localStorage.setItem(options.lookupLocalStorage, lng);\n }\n }\n};\n\nvar hasSessionStorageSupport = null;\nvar sessionStorageAvailable = function sessionStorageAvailable() {\n if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;\n try {\n hasSessionStorageSupport = window !== 'undefined' && window.sessionStorage !== null;\n var testKey = 'i18next.translate.boo';\n window.sessionStorage.setItem(testKey, 'foo');\n window.sessionStorage.removeItem(testKey);\n } catch (e) {\n hasSessionStorageSupport = false;\n }\n return hasSessionStorageSupport;\n};\nvar sessionStorage = {\n name: 'sessionStorage',\n lookup: function lookup(options) {\n var found;\n if (options.lookupSessionStorage && sessionStorageAvailable()) {\n var lng = window.sessionStorage.getItem(options.lookupSessionStorage);\n if (lng) found = lng;\n }\n return found;\n },\n cacheUserLanguage: function cacheUserLanguage(lng, options) {\n if (options.lookupSessionStorage && sessionStorageAvailable()) {\n window.sessionStorage.setItem(options.lookupSessionStorage, lng);\n }\n }\n};\n\nvar navigator$1 = {\n name: 'navigator',\n lookup: function lookup(options) {\n var found = [];\n if (typeof navigator !== 'undefined') {\n if (navigator.languages) {\n // chrome only; not an array, so can't use .push.apply instead of iterating\n for (var i = 0; i < navigator.languages.length; i++) {\n found.push(navigator.languages[i]);\n }\n }\n if (navigator.userLanguage) {\n found.push(navigator.userLanguage);\n }\n if (navigator.language) {\n found.push(navigator.language);\n }\n }\n return found.length > 0 ? found : undefined;\n }\n};\n\nvar htmlTag = {\n name: 'htmlTag',\n lookup: function lookup(options) {\n var found;\n var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);\n if (htmlTag && typeof htmlTag.getAttribute === 'function') {\n found = htmlTag.getAttribute('lang');\n }\n return found;\n }\n};\n\nvar path = {\n name: 'path',\n lookup: function lookup(options) {\n var found;\n if (typeof window !== 'undefined') {\n var language = window.location.pathname.match(/\\/([a-zA-Z-]*)/g);\n if (language instanceof Array) {\n if (typeof options.lookupFromPathIndex === 'number') {\n if (typeof language[options.lookupFromPathIndex] !== 'string') {\n return undefined;\n }\n found = language[options.lookupFromPathIndex].replace('/', '');\n } else {\n found = language[0].replace('/', '');\n }\n }\n }\n return found;\n }\n};\n\nvar subdomain = {\n name: 'subdomain',\n lookup: function lookup(options) {\n // If given get the subdomain index else 1\n var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === 'number' ? options.lookupFromSubdomainIndex + 1 : 1;\n // get all matches if window.location. is existing\n // first item of match is the match itself and the second is the first group macht which sould be the first subdomain match\n // is the hostname no public domain get the or option of localhost\n var language = typeof window !== 'undefined' && window.location && window.location.hostname && window.location.hostname.match(/^(\\w{2,5})\\.(([a-z0-9-]{1,63}\\.[a-z]{2,6})|localhost)/i);\n\n // if there is no match (null) return undefined\n if (!language) return undefined;\n // return the given group match\n return language[lookupFromSubdomainIndex];\n }\n};\n\nfunction getDefaults() {\n return {\n order: ['querystring', 'cookie', 'localStorage', 'sessionStorage', 'navigator', 'htmlTag'],\n lookupQuerystring: 'lng',\n lookupCookie: 'i18next',\n lookupLocalStorage: 'i18nextLng',\n lookupSessionStorage: 'i18nextLng',\n // cache user language\n caches: ['localStorage'],\n excludeCacheFor: ['cimode'],\n // cookieMinutes: 10,\n // cookieDomain: 'myDomain'\n\n convertDetectedLanguage: function convertDetectedLanguage(l) {\n return l;\n }\n };\n}\nvar Browser = /*#__PURE__*/function () {\n function Browser(services) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Browser);\n this.type = 'languageDetector';\n this.detectors = {};\n this.init(services, options);\n }\n _createClass(Browser, [{\n key: \"init\",\n value: function init(services) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.services = services || {\n languageUtils: {}\n }; // this way the language detector can be used without i18next\n this.options = defaults(options, this.options || {}, getDefaults());\n if (typeof this.options.convertDetectedLanguage === 'string' && this.options.convertDetectedLanguage.indexOf('15897') > -1) {\n this.options.convertDetectedLanguage = function (l) {\n return l.replace('-', '_');\n };\n }\n\n // backwards compatibility\n if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;\n this.i18nOptions = i18nOptions;\n this.addDetector(cookie$1);\n this.addDetector(querystring);\n this.addDetector(localStorage);\n this.addDetector(sessionStorage);\n this.addDetector(navigator$1);\n this.addDetector(htmlTag);\n this.addDetector(path);\n this.addDetector(subdomain);\n }\n }, {\n key: \"addDetector\",\n value: function addDetector(detector) {\n this.detectors[detector.name] = detector;\n }\n }, {\n key: \"detect\",\n value: function detect(detectionOrder) {\n var _this = this;\n if (!detectionOrder) detectionOrder = this.options.order;\n var detected = [];\n detectionOrder.forEach(function (detectorName) {\n if (_this.detectors[detectorName]) {\n var lookup = _this.detectors[detectorName].lookup(_this.options);\n if (lookup && typeof lookup === 'string') lookup = [lookup];\n if (lookup) detected = detected.concat(lookup);\n }\n });\n detected = detected.map(function (d) {\n return _this.options.convertDetectedLanguage(d);\n });\n if (this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0\n return detected.length > 0 ? detected[0] : null; // a little backward compatibility\n }\n }, {\n key: \"cacheUserLanguage\",\n value: function cacheUserLanguage(lng, caches) {\n var _this2 = this;\n if (!caches) caches = this.options.caches;\n if (!caches) return;\n if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;\n caches.forEach(function (cacheName) {\n if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options);\n });\n }\n }]);\n return Browser;\n}();\nBrowser.type = 'languageDetector';\n\nexport { Browser as default };\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport LocalStorageService from \"@services/localStorage\";\n\nimport en from \"./utils/localizations/en\";\nimport sv from \"./utils/localizations/sv\";\n\nconst resources = {\n enUS: {\n translation: en,\n },\n sv: {\n translation: sv,\n },\n};\n\ni18n\n // detect user language\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(LanguageDetector)\n // pass the i18n instance to react-i18next.\n .use(initReactI18next)\n // init i18next\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"sv\",\n lng: LocalStorageService.getLanguage(),\n debug: false,\n resources,\n keySeparator: \".\",\n interpolation: {\n escapeValue: false, // not needed for react as it escapes by default\n },\n });\ndocument.documentElement.lang = i18n.language;\n\nexport default i18n;\n","import { PRINCIPAL_ROUTE_NAME } from \"@router/principal\";\n\nconst en = {\n common: {\n preview: \"Preview\",\n continue: \"Continue\",\n next: \"Next\",\n previous: \"Previous\",\n complete: \"Complete\",\n skip: \"Skip\",\n saveChanges: \"Save changes\",\n save: \"Save\",\n upload: \"Upload image\",\n uploadVideo: \"Upload video\",\n loading: \"Loading\",\n back: \"Back\",\n cancel: \"Cancel\",\n delete: \"Delete\",\n close: \"Close\",\n twentyMinutes: \"20 min\",\n fiftyMinutes: \"50 min\",\n resetPasswordError: \"Error occurred while attempting to reset password\",\n notFoundEmailError:\n \"Configured or registered user with this email not found\",\n email: \"Email address\",\n password: \"Password\",\n passwordConfirm: \"Confirm your password\",\n corporateEmail: \"Please enter your corporate email address\",\n anyEmail: \"Enter your corporate email address\",\n today: \"Today\",\n scheduleSession: \"Schedule a session\",\n invalidEmail: \"Invalid email address\",\n invalidPasswordLength: \"8 characters long\",\n invalidPasswordMatch: \"1 uppercase & 1 lowercase character & 1 number\",\n invalidPasswordConfirm: \"Passwords don’t match\",\n requiredField: \"This field is required\",\n no: \"No\",\n checkSearch: \"Add a new one or check if the search is correct\",\n noFound: \"No {{name}} found\",\n switchAccountError:\n \"Error occurred while attempting to switch organization\",\n dragNDrop: \"Drag and drop some files here, or click to select files\",\n continueWithCode: \"Continue with code\",\n continueWithoutCode: \"Skip\",\n areYouSure: \"Are you sure?\",\n yes: \"Yes\",\n create: \"Create\",\n keywordSearch: \"Search\",\n watchHelloVideo: \"Watch greeting video\",\n helloVideoTitle: \"Greeting video\",\n profileImage: \"Profile image\",\n aboutMeVideo: \"Greeting video\",\n notes: \"Notes\",\n add: \"Add\",\n color: \"Color\",\n min: \"min\",\n send: \"Send\",\n selectStatus: \"Select a status\",\n showMore: \"Show more\",\n showLess: \"Show less\",\n download: \"Download\",\n downloadQrAsSvg: \"Click and download QR as SVG\",\n copied: \"Copied\",\n copyError: \"Error while copying\",\n },\n modal: {\n sizeLimit: {\n title: \"File size limit has been reached\",\n content:\n \"File is too big for the upload, the limit is {{sizeLimit}}. Please, choose another one.\",\n },\n fileType: {\n title: \"Invalid file type\",\n content: \"You are only able to use images\",\n },\n akkImage: {\n akkImage: \"AAC image\",\n customImage: \"Custom image\",\n uploadImage: \"Select image\",\n },\n endDate: {\n title: \"End date\",\n content: \"Please select the end date\",\n },\n },\n mobile: {\n notAvailable: \"Allbry web version is not available on mobile\",\n availableInLandscape:\n \"Allbry web version is only available in landscape mode\",\n pleaseUseLinks: \"Please, download our mobile app using the link below\",\n pleaseUseLinksLandscape:\n \"You can download our mobile app using the link below\",\n appStore: \"App Store\",\n googlePlay: \"Google Play\",\n },\n introduction: {\n getSupport: \"Get support from Allbry, wherever you are\",\n chat: {\n student: \"Jamie\",\n counsellor: \"Margo\",\n messages: {\n first: \"She said I was lazy!\",\n second: \"I have school, dance class, the horses and tutoring!\",\n third: \"She doesn't get me... 😔\",\n fourth: \"Oh dear, let's talk!\",\n },\n },\n },\n auth: {\n login: {\n withEmail: \"Enter your email address\",\n codeStepTitle: \"Did you receive an registration code?\",\n loginSuccess: \"You have logged in successfully\",\n enterPassword: \"Enter your password\",\n codeStepSubtitle:\n \"In some cases you need a registration code to sign up. If you received one, please enter it below. If not, just press skip.\",\n codeInput: \"Registration code\",\n codeInputHint: \"Please enter your registration code if you received one\",\n createPass: \"Create your password\",\n terms: \"I have read, understood and hereby approve of Allbrys \",\n termsLink: \"terms of use\",\n paymentTitle: \"Renew your subscription\",\n paymentDescription:\n \"Allbry costs {{price}} {{currency}} every month. The subscription is active until you cancel it.\",\n },\n logout: {\n logoutSuccess: \"You have logged out successfully\",\n },\n signUpConsumer: {\n terms: \"I have read, understood and hereby approve of Allbrys \",\n termsLink: \"terms of use\",\n startJourney: \"Start your journey with Allbry today\",\n withOrganization: \"Sign up with Organization\",\n withEmail: \"Sign up with Email\",\n signUp: \"Sign up\",\n createPass: \"Create your password\",\n haveAccount: \"Already have an account?\",\n logIn: \"Log in\",\n connectedOrganization: \"Your account belongs to \",\n aboutYourSelfHeader: \"Choose your username\",\n aboutYourSelfDescription1:\n \"Choose the name you want to be visible to the counsellor or advisor.\",\n aboutYourSelfDescription2:\n \"We do not disclose your personal information to third parties.\",\n paymentTitle: \"Create your subscription\",\n paymentDescription:\n \"Allbry costs {{price}} {{currency}} every month. The subscription is active until you cancel it.\",\n paymentDescriptionSuccess:\n \"Congratulations! Your account is now successfully created and your subscription is active until you cancel it.\",\n successTitle: \"Congratulations!\",\n successDescription:\n \"Welcome to Allbry! We are here to support, motivate and guide you.\",\n klarnaLoadingError:\n \"Something went wrong when trying to load the payment widget, please try again\",\n klarnaOrderError:\n \"Something went wrong when trying to complete the payment, please try again\",\n },\n forgot: {\n checkStep: \"Check your email\",\n weJustSent: \"We've just sent\",\n resetPassLink: \"reset password link\",\n followInstructions:\n \"to your email. Please check your inbox and follow the instructions.\",\n enterEmail: \"Enter your email\",\n createNewPass: \"Create new password\",\n },\n registrationError: \"User registration failed\",\n signInError: \"Wrong email or password\",\n invalidPassword: \"Invalid password\",\n forgotPassword: \"Forgot password?\",\n externalJoin: {\n title: \"Did you receive an meeting code?\",\n description:\n \"If you received a meeting code, please enter it below to get started.\",\n placeholder: \"Enter your meeting code\",\n help: \"If you don't have a meeting code, please contact your organizer.\",\n invitationMessage: \"You have been invited to a meeting in Allbry\",\n invitationDescription:\n \"You have been invited to a meeting through Allbry by {{counselorName}}\",\n },\n },\n navbar: {\n switch: \"Set yourself as\",\n toOffline: \"Offline\",\n toOnline: \"Online\",\n appointments: {\n title: \"Appointments\",\n text: \"Schedule meetings with student health staff to get more qualified help\",\n },\n messages: {\n title: \"Messages\",\n text: \"Communicate with student health staff and get help anytime\",\n },\n students: {\n title: \"Students\",\n },\n reports: {\n title: \"Reports\",\n },\n organizations: {\n title: \"Organizations\",\n },\n statistics: {\n title: \"Statistics\",\n },\n profile: \"Profile\",\n settings: {\n title: \"Settings\",\n },\n logOut: \"Log out\",\n [PRINCIPAL_ROUTE_NAME.ORGANIZATION]: {\n title: \"organization\",\n },\n [PRINCIPAL_ROUTE_NAME.STATISTICS]: {\n title: \"statistics\",\n },\n [PRINCIPAL_ROUTE_NAME.USERS]: {\n title: \"users\",\n },\n counsellors: {\n title: \"Student health staff\",\n },\n ftpDataCollection: {\n title: \"FTP Data Collection\",\n },\n dataMigration: {\n title: \"Data Migration\",\n },\n configForm: {\n title: \"Config Form\",\n },\n notifications: {\n title: \"Notifications\",\n },\n superActions: {\n title: \"Super Actions\",\n },\n checkInsAndSurveys: {\n title: \"CheckIns and Surveys\",\n },\n config: {\n title: \"Template\",\n },\n broadcastMessages: {\n title: \"Broadcast Messages\",\n },\n },\n notFound: {\n code: \"404\",\n text: \"Not Found\",\n },\n settings: {\n title: \"Settings\",\n billing: {\n title: \"Billing details\",\n activeStatus:\n 'Your subscription is Active and you next billing will occur on {{date}}',\n inactiveStatus:\n 'Your subscription is Inactive, but you account is available until {{date}}',\n manageSubBtn: \"Manage subscription\",\n cancelSubBtn: \"Cancel subscription\",\n manageSub: \"Manage subscription\",\n cancelSub: \"Cancel subscription\",\n cancelSubSubtitle:\n \"Are you sure you want to leave us? We are always here for support.
You are of course welcome back anytime! Your account will remain active until {{date}}, then we say goodbye.\",\n confirmCancel: \"Confirm cancellation\",\n },\n anonymous: {\n title: \"Anonymous mode\",\n description:\n \"Your organization allows you to be anonymous. Your name and profile image will be hidden from other users.\",\n },\n allowEmailNotification: {\n title: \"Email notification\",\n description: \"You can turn off email notifications from Allbry\",\n },\n calendarSync: {\n title: \"External calendar sync\",\n description: \"Activate external calendar sync for appointments\",\n freeDescription:\n \"Activate external calendar sync for added available time\",\n freeNote:\n \"Note: Most of the time everything is added automatically, but if not, follow the instructions in the email sent to you when adding available times.\",\n },\n dataReset: {\n recurrentReset: {\n title: \"Recurrent data reset\",\n disabledResetParagraph:\n \"Enable recurrent data reset to clear data automatically. Please note that data reset affects chats, appointments, notes.\",\n enabledResetParagraph:\n \"Estimated date for the next reset is {{date}}. Please note that data reset affect chats, appointments, notes.\",\n intervalLabel: \"Interval\",\n intervals: {\n eachMonth: \"Each month\",\n eachThreeMonths: \"Each 3 months\",\n eachSixMonths: \"Each 6 months\",\n },\n errorGettingResetState:\n \"Error while getting current recurrent jobs state\",\n errorSwitchingResetState: \"Error while changing recurrent jobs state\",\n errorIntervalChange: \"Error while changing reset interval\",\n successIntervalChange: \"New reset interval has been set\",\n },\n manualReset: {\n title: \"Reset data now\",\n paragraph:\n \"Please note that data reset affects chats, appointments, notes.\",\n resetButton: \"Clear all data\",\n resetSuccess: \"The data has been cleared\",\n resetFailure: \"Error while resetting data\",\n resetModal: {\n title: \"Clear all data\",\n paragraph:\n \"Are you sure you want to reset all information in chats, appointments, notes?\",\n yes: \"Yes\",\n no: \"No\",\n },\n },\n },\n policy: {\n title: \"Integrity Policy\",\n description: {\n firstPart:\n \"Being fully aware that our work as consultants and engineers is critical to the achievement of a sustainable development of the society and the environment, we have designed and implemented a range of measures aiming at making our ethical conduct one of IRD Engineering main characteristics.\",\n secondPart:\n \"All these, and any future measures, are and will be incorporated in our Integrated Management System, which represents the official Company policy and procedures to ensure that the Company's services are carried out at a high professional level, consistent with the highest international standards in terms of quality assurance, environmental sustainability and worker's health and safety.\",\n },\n policyCopy:\n \"A copy of our Code of Ethics and Integrity Policy can be found\",\n hereLink: \"here\",\n },\n language: {\n title: \"Language\",\n },\n changePassword: \"Change Password\",\n currentPassword: \"Current Password\",\n newPassword: \"New Password\",\n confirmPassword: \"Confirm New Password\",\n passwordChanged: \"Password Changed Successfully\",\n unavailable: {\n title: \"Unavailable\",\n description: \"Enter the field below to set your unavailable message\",\n success: \"Your unavailable massage has been updated successfully\",\n unavailableText: \"Write your unavailable text here\",\n anywaySendMessage:\n \"Allow the student to continue sending messages even if you are unavailable.\",\n },\n },\n profile: {\n personProfile: \"{{type}}'s profile\",\n personProfileName: \"{{person}}s profile\",\n overview: \"Profile Overview\",\n edit: {\n title: \"Edit profile\",\n restriction: \"Only owners and admins can edit.\",\n gender: {\n male: \"Male\",\n female: \"Female\",\n other: \"Other\",\n private: \"Do not wish to say\",\n },\n about: \"About\",\n changesSaved: \"Changes Saved\",\n },\n personalInfo: \"PERSONAL INFORMATION\",\n about: \"About me\",\n name: \"Name\",\n birthday: \"Date of Birth\",\n fullBirthday: \"{{birthday}} ({{fullYears}} years)\",\n appointments: \"APPOINTMENTS\",\n noAppointments: \"No appointments found for this category\",\n gender: \"Gender\",\n age: \"Age\",\n email: \"Email\",\n lastNote: \"{{person}}'s last note will be placed here.\",\n parentAccountID: \"Parent account ID\",\n noParentIfEmpty: \"No parent if empty\",\n secretIdentity: \"Protected identity\",\n },\n appointments: {\n title: \"Appointment\",\n session: {\n today: \"Join Now\",\n future: \"Cancel or Reschedule\",\n completed: \"Book another session\",\n cancelled: \"Book another session\",\n cancel: \"Cancel\",\n },\n status: {\n upcoming: \"Upcoming\",\n completed: \"Completed\",\n cancelled: \"Cancelled\",\n pending: \"Pending confirmation from you\",\n unanswered: \"Pending confirmation by {{name}}\",\n active: \"Accepted\",\n },\n action: {\n accept: \"Accept\",\n reschedule: \"Reschedule\",\n deny: \"Deny\",\n goToAppointment: \"Go to appointment\",\n },\n unansweredDialog: {\n title: \"You have unanswered appointment requests\",\n continueBtn: \"Continue later\",\n },\n booking: {\n title: {\n booking: \"Booking\",\n reschedule: \"Reschedule\",\n },\n schedule: \"Schedule\",\n chooseUser: \"Choose users\",\n selectUser: \"Select user\",\n chooseStudent: \"Choose student\",\n selectStudent: \"Select student\",\n sessionDuration: \"Choose session duration\",\n sessionTime: \"Choose session time\",\n success: \"Success\",\n successText:\n \"The session was successfully {{action}}! Now you can check your session in upcoming appointments\",\n successBooked: \"booked\",\n successRescheduled: \"rescheduled\",\n back: \"Back to appointments\",\n chooseStudentModal: \"Choose student\",\n chooseUserModal: \"Choose users\",\n done: \"Done\",\n chooseCounsellor: \"Choose student health staff\",\n chooseCounsellorModal: \"Choose student health staff\",\n selectCounsellor: \"Select student health staff\",\n searchStudents: \"Search students\",\n noTimeSlots: \"No available time slots\",\n recommendedSlotsMassage:\n \"No available slots, choose a different date or select on of the recommended slots below\",\n recommendedSlots: \"Recommended slots\",\n custom: \"Custom time\",\n startTime: \"Start time\",\n endTime: \"End time\",\n video: \"Video\",\n students: \"Students\",\n counsellors: \"Student health staff\",\n search: {\n student: \"Search student\",\n counsellor: \"Search health staff\",\n },\n notFound: {\n student: \"No student found\",\n counsellor: \"No student health staff found\",\n },\n selectExternal: \"Add external participant\",\n name: \"Name\",\n number: \"Phone number\",\n email: \"Email\",\n },\n detail: {\n scheduleInfoCancelOrReschedule:\n \"The session is scheduled on {{date}} at {{time}}. You're able to cancel or reschedule it.\",\n scheduleInfoBookAnother:\n \"The session is scheduled on {{date}} at {{start}} - {{end}}. You are able to book another one.\",\n reschedule: \"Reschedule\",\n cancel: \"Cancel Appointment\",\n areYouSure: \"Are you sure you want to cancel your session?\",\n yes: \"Yes, Cancel\",\n cancelled: \"The session was cancelled\",\n sessionDetails: \"Session details\",\n externalUserInfo: \"External user info\",\n copied: \"Copied\",\n copyError: \"Error while copying\",\n resendEmailToExternalUser:\n \"Are you sure you want to resend the email to the external user?\",\n },\n now: \"Now\",\n scheduleNew: \"Schedule a new appointment\",\n counsellors: \"Student health staff\",\n appointments: \"Appointments\",\n seeAll: \"See all\",\n notExist: \"Appointment does not exist\",\n weeksInterval: \"In {{interval}} weeks\",\n daysInterval: \"In {{interval}} days\",\n dayInterval: \"In {{interval}} day\",\n hoursInterval: \"In {{interval}} hours\",\n hourInterval: \"In {{interval}} hour\",\n minutesInterval: \"In {{interval}} minutes\",\n minuteInterval: \"In {{interval}} minute\",\n today: \"Today\",\n future: \"Future\",\n completed: \"Completed\",\n cancelled: \"Cancelled\",\n noAppointments: \"No appointments here yet...\",\n organizationNotWorking: \"Organization is not working on this day\",\n scheduleFirst: \"Schedule your first appointment\",\n yourFreeTime: \"Your available time\",\n freeTime: {\n title: \"Your available time\",\n addTime: \"Add time\",\n noFreeTimes:\n \"Please allocate your available time in order students can book the appointments\",\n allocateTime: \"Allocate available time\",\n editTime: \"Edit available time\",\n startTime: \"Start time\",\n endTime: \"End time\",\n add: \"Add\",\n cancel: \"Cancel\",\n date: \"Date\",\n ends: \"Ends\",\n orgNotWorking: \"Organization is not working\",\n repeats: {\n everyday: \"Everyday\",\n weeklyOn: \"Weekly on {{day}}\",\n weekdays: \"Every weekday (Monday to Friday)\",\n none: \"Doesn't repeat\",\n },\n deleteModal: {\n title: \"Delete available time\",\n description: \"Are you sure you want to delete your available time?\",\n delete: \"Yes, Delete\",\n },\n timeAdded: \"Your available time was added\",\n timeEdited: \"Your available time was edited\",\n timeDeleted: \"Your available time was deleted\",\n },\n customMeeting: \"Choose appointment type\",\n error: {\n studentOrCounsellor: \"Student or staff unavailable between {{data}}\",\n and: \"and\",\n counsellor: \"Healthcare staff unavailable this time\",\n timeError: \"End-time must be greater than start-time\",\n minimumTime: \"Appointment must be greater than {{minimumTime}} minutes\",\n currentTime: \"Start-time must be greater than current-time\",\n noAvailableTime: \"Student or staff unavailable at this time\",\n },\n invited: \"{{count}} Invited\",\n participants: \"{{count}} Participants\",\n },\n notes: {\n title: \"Notes & reports\",\n note: \"Note\",\n report: \"Report\",\n topics: \"Topics\",\n meetingType: \"Meeting type\",\n meetingKind: \"Meeting place\",\n meetingDuration: \"Meeting duration\",\n student: \"Student\",\n generated: \"Generated\",\n add: \"Add note\",\n personNotes: \"{{person}}'s notes & reports\",\n personNote: \"{{person}}'s note\",\n personReport: \"{{person}}'s report\",\n personStatistics: \"{{person}}'s Statistics\",\n create: \"Create a note\",\n saveText: \"Take notes about the student.\",\n autoSaveText:\n \"Take notes about student. All notes will be saved automatically\",\n autoSaveTextDuringVideo:\n \"Take notes during the session. All notes will be saved automatically\",\n metaAppointment:\n \"{{person}} finished appointment with {{student}}, {{date}}\",\n metaChat: \"{{person}} finished chat with {{student}}, {{date}}\",\n createdBy: \"{{date}} by {{person}}\",\n delete: \"Delete note\",\n deleteQuestion: \"Are you sure you want to delete this note?\",\n yes: \"Yes, delete\",\n saved: \"The note has been saved\",\n deleted: \"The note has been deleted\",\n worryLevel: \"Worry level\",\n filter: \"Filter\",\n notes: \"Notes\",\n reports: \"Reports\",\n isPinned: \"Pin note\",\n pinnedNotes: \"This note is pinned\",\n isNotPinned: \"This note is not pinned\",\n isPublic: \"Open\",\n isForPublic: \"This note is visible for other professions\",\n isNotForPublic: \"This note is not visible for other professions.\",\n publicLabel: \"Open\",\n pinnedLabel: \"Pinned\",\n isForReportPublic: \"This report is visible for other professions\",\n isReportNotForPublic: \"This report is not visible for other professions\",\n },\n videoCall: {\n leaveCallModal: {\n title: \"Finishing the appointment\",\n paragraph:\n \"Already done with the appointment? If so, click End the call option and fill the report. If not, click Leave the call and you'll be able to rejoin it.\",\n leaveCall: \"Leave the call\",\n endCall: \"End the call\",\n },\n videoAccessModal: {\n title: \"Camera or microphone is blocked\",\n description_1:\n \"Allbry requires access to your camera and microphone. Click the camera blocked icon\",\n description_2: \"in your browser's address bar.\",\n leaveCall: \"Leave the call\",\n },\n join: \"Join\",\n notJoin: \"Not joined\",\n },\n chat: {\n end: \"End chat\",\n archivedForCounsellor:\n \"This chat has been archived by the student. To restart the conversation you just need to write something.\",\n endInfoForCounsellor:\n \"This chat was ended on {{time}} by you. To restart the conversation you just need to write something.\",\n noMessages: \"No messages here yet\",\n sendFirstMessage: \"Send your first message to {{person}}\",\n writeMessage: \"Write a message...\",\n endChatQuestion:\n \"Are you sure you want to end the chat? The chat will not be deleted, you can restart it by sending the message.\",\n attachmentInfo: \"{{fileSize}}, {{date}} at {{time}}\",\n sharedFiles: \"SHARED FILES\",\n noFiles: \"No shared files here yet..\",\n general: \"General\",\n messages: \"Messages\",\n chatEnded: \"(Chat ended)\",\n attachment: \"(Attachment)\",\n image: \"(Image)\",\n startTitle: \"Who you want to talk with?\",\n noStudentsFound: \"No students found\",\n notFoundLabels: {\n student: \"No student found\",\n counsellor: \"No student health staff found\",\n globalCounsellor: \"No global student health staff found\",\n },\n noStudentsAvailable: \"No students are available\",\n noStudentsAvailableToChat:\n \"There are no available students to start a chat with\",\n noCounsellorsAvailable: \"No student health staff are available\",\n noCounsellorsAvailableToChat:\n \"There are no available staff to start a chat with\",\n start: \"Start chat\",\n startGroupChat: \"Start group chat\",\n nameTheGroupChat: \"Name the group chat\",\n enterGroupName: \"Enter a name for group chat\",\n groupName: \"Name of group\",\n more: \"View more\",\n selectChat: \"Select a chat to start messaging\",\n archive: \"Archive\",\n delete: \"Delete chat\",\n organizationDoesntWork:\n \"Organization doesn't work now. It'll take longer time to receive the answer. We recommend to send messages at {{start}} - {{end}}\",\n organizationDoesntWorkToday:\n \"Organization is not working today. It'll take longer time to receive the answer\",\n endInfoForStudent:\n \"This chat was ended on {{time}} by {{person}}. To restart the conversation you just need to write something.\",\n sendAfterWork: \"Send message outside working hours\",\n workingHours:\n \"Working hours of organization: {{start}} - {{end}}. If you want to send message outside working hours, please note that you receive answer in working hours.\",\n workingHoursToday:\n \"Organization is not working today. If you want to send message outside working hours, please note that you receive answer in working hours.\",\n ok: \"Ok, got it\",\n deleteChatQuestion: \"Are you sure you want to delete the chat?\",\n archiveChat: \"Archive chat\",\n unarchiveChat: \"Unarchive chat\",\n deleted: \"Chat deleted\",\n archived: \"Chat archived\",\n unarchived: \"Chat unarchived\",\n deleteGroup: \"Delete group\",\n modifyGroup: \"Modify group\",\n groupAllMembers: \"Group Members\",\n modifyGroupChat: \"Modify group chat\",\n editGroupName: \"Enter a name for the group chat\",\n members: \"Participants\",\n confirmToDelete: \"Are you sure to delete this group?\",\n confirmToDeleteMember: \"Are you sure to remove selected participant?\",\n addNewMember: \"Add new participant\",\n deleteSelected: \"Delete selected participant\",\n selectNewMember: \"Select new participant\",\n selectClose: \"Select & close\",\n noMembersInGroup:\n \"There are no more participants in this group, Do you want to delete this group?\",\n groupMembers: \"{{value}} participants\",\n overview: \"Overview\",\n notesAndReports: \"Notes & reports\",\n statistics: \"Statistics\",\n imageFile: \"Image or file\",\n akkImage: \"AAC image\",\n read: \"Read\",\n akk: {\n selectCategory: \"Select Category\",\n chooseAkk: \"Choose images\",\n send: \"Send\",\n noImage: \"No images found\",\n },\n all: \"All\",\n students: \"Students\",\n counsellors: {\n shortName: \"Local\",\n fullName: \"Student health staff\",\n },\n globalCounsellors: {\n shortName: \"Global\",\n fullName: \"Global student health staff\",\n },\n searchStudent: \"Search student\",\n searchCounsellor: \"Search health staff\",\n searchGlobalCounsellor: \"Search global health staff\",\n active: \"Registered\",\n inactive: \"Inactive\",\n deactivated: \"Deactivated\",\n successDelete: \"Message deleted successfully\",\n counsellorUnavailable: \"Counsellor unavailable\",\n videoCall: \"Video Call\",\n confirmVideoCall: \"Are you sure you want to start a video call?\",\n counsellorInactive: \"Counsellor no longer works in this organization\",\n onlyAllbryCanSendMessage: \"Only {{name}} can send messages\",\n messagesTitleSuperAdmin: \"Messages (Tech releases)\",\n showMore: \"Show more\",\n },\n reports: {\n createReport: \"Create report\",\n deleteReport: \"Delete report\",\n deleteReportQuestion: \"Are you sure you want to delete the report?\",\n yes: \"Yes, delete\",\n deleted: \"The report has been deleted\",\n title: \"Reporting\",\n title2: \"Non mandatory step\",\n selectDate: \"1. Date\",\n selectTopics: \"2. Select the topic in the conversation\",\n concernScale: \"3. How worried are you about the student?\",\n selectMeetingType: \"4. What kind of meeting did you have?\",\n selectMeetingKind: \"5. How did the meeting occur?\",\n noteComment: \"{{questionNo}}. Note / Comment\",\n feedbackAllbry:\n \"{{questionNo}}. Is there anything else you want to be able to map? (optional market research)\",\n additionalSupportQuestionTitle:\n \"{{questionNo}}. Is the student in need of additional support?\",\n participationThanks: {\n title: \"Thank you!\",\n details:\n \"Thank you for providing this information. It's really helpful for us.\",\n close: \"Close\",\n },\n topics: {\n startOfSession: \"Start of the session\",\n checkIn: \"Check-in\",\n basicCare: \"Basic care\",\n identity: \"Identity\",\n anxiety: \"Anxiety\",\n stress: \"Stress\",\n physicalHealth: \"Physical health\",\n training: \"Training\",\n crime: \"Crime\",\n sorrow: \"Sorrow\",\n socialRelationship: \"Social relationship\",\n workLife: \"Work life\",\n shame: \"Shame\",\n honor: \"Honor\",\n careFailure: \"Child neglect\",\n economy: \"Economy\",\n security: \"Security\",\n stimulationAndGuidance: \"Stimulation and guidance\",\n socialOrientation: \"Social orientation\",\n emotionalAvailability: \"Emotional availability\",\n love: \"Love\",\n mentalHealth: \"Mental health\",\n mentalAbuse: \"Mental abuse\",\n physicalAbuse: \"Physical abuse\",\n loveRelations: \"Love relations\",\n familyRelations: \"Family relations\",\n sexualAbuse: \"Sexual abuse\",\n economicalAbuse: \"Financial abuse\",\n drugUse: \"Drug use\",\n performanceAnxiety: \"Performance anxiety\",\n loneliness: \"Loneliness\",\n grooming: \"Grooming\",\n school: \"School\",\n education: \"Education\",\n selfHarm: \"Self-injurious behavior\",\n suicidalToughts: \"Suicidal thoughts\",\n religion: \"Religion\",\n politics: \"Politics\",\n sexuality: \"Sexuality\",\n npfDiagnoses: \"NPF diagnoses\",\n },\n meetingType: {\n emergencyMeeting: \"Emergency meeting\",\n dropInMeeting: \"Drop-in meeting\",\n individualMeeting: \"Individual meeting\",\n noShowMeeting: \"No-show meeting\",\n parentMeeting: \"Meeting with guardian\",\n ehtMeeting: \"Meeting with representative from EHT\",\n groupMeeting: \"Group meeting with students\",\n adultMeeting: \"Meeting with other adult (i.e. teacher)\",\n breakMeeting: \"Meeting in hallway or during break\",\n adultStudentMeeting:\n \"Meeting with student, guardian, principal and / or other school staff\",\n },\n meetingKind: {\n allbryMeeting: \"Did you book or have the meeting in Allbry?\",\n allbryMeetingIfNot: \"If not, where did you have the meeting?\",\n telephone: \"Telephone meeting\",\n digital: \"Digital meeting\",\n physical: \"Physical meeting\",\n },\n addTopic: {\n title: \"Add topic\",\n name: \"Name\",\n description: \"Description\",\n button: \"Add new\",\n success: \"Topic added successfully\",\n error: \"Error while adding topic\",\n expandTab: \"Expand\",\n collapseTab: \"Collapse\",\n all: \"All\",\n },\n worriedLevel: {\n level0: \"No worry / contact sought\",\n level0_5: \"Risk on the way to level 1\",\n level1: \"Preventive / promotional / informative talk or other talks\",\n level1_5: \"Risk on the way to level 2\",\n level2: \"Mild worry – worry that you can manage with the student\",\n level2_5: \"Risk on the way to level 3\",\n level3:\n \"Medium concern - contact the school and follow-up after 4 weeks or refer to BUP / psychiatry & other instances\",\n level3_5: \"Risk on the way to level 4\",\n level4: \"High concern - ”orosanmälan” or similar\",\n level4_5: \"Risk on the way to level 5\",\n level5:\n \"Acute concern - act now, alert the emergency services or similar\",\n details0:\n \"No concern / contact sought \\n\\nNo concern at this stage. The student has sought contact or started a conversation.\",\n details0_5: \"Risk on the way to level 1\",\n details1:\n \"Preventive / promotional / informative talk or other talks \\n\\nAt this level, student health staff have had preventive / promotional / informative calls or other types of support calls. For example, about friendships, love, future and free time or goals and dreams and similar themes/topics.\\n\\nGuided conversations in connection with, for example, the high school application (for elementary school students) or the university application (for high school students).\",\n details1_5: \"Risk on the way to level 2\",\n details2:\n \"Mild concern - concern that you can manage with the student \\n\\nAt this level, student health personnel feel mild concern for the student. This means concern where the counsellor/student health staff and student can talk about topics/themes without having to notify others (duty of confidentiality). This may include conversations about self-esteem, self-confidence, past trauma, relationships and health, and experiences that the student is talking about.\\n\\nAt this stage of concern, the counselor/student health professional can use their skills, knowledge and conversational methods to work with the student and support at different times and situations. \\n\\nRelationship building, trust and confidence are important at this level as a student may tell something in confidence to the student health staff that the student does not want to reveal to anyone else but still needs help, an example is low self-esteem, tells about NPF diagnoses , investigations, previous contact with authorities such as social services and BUP or adult psychiatry.\\n\\nThere is a concern for the student but you as student health staff are there to support and sort out the concern.\",\n details2_5: \"Risk on the way to level 3\",\n details3:\n \"Medium concern - contact the school and follow-up after 4 weeks or refer to BUP / psychiatry & other agencies \\n\\nThis is the first step where student health personnel must act and violate confidentiality (non-disclosure). In this case, it is about contacting the school in case of concerns about the child's health (mental and physical health), school attendance, school results, home environment, ostracism and bullying. Offensive treatment. In the first step, a counselor or mentor is contacted. Possibly a case for EHT/EHM to discuss this student, for example in the case of adaptations, difficulties at school. Follow-up for the student takes place after 4 weeks, the counselor is responsible for follow-up.\",\n details3_5: \"Risk on the way to level 4\",\n details4:\n \"High concern - report of concern or similar \\n\\nBased on the National Board of Health and Welfare's governing document and notification obligation according to SoL 14 ch. 1§ & SkolL 29 ch. 13, obligation to report if you know or suspect that a child is in harm's way. Student health personnel notify the student (and the parents in some cases) and inform them that a report of concern is being made and why it is being made. The school must always be informed. A report of concern is usually made in collaboration with the principal.\\n\\nThe National Board of Health and Welfare's (2013) definition of the term ”children who get hurt” from Children who get hurt or are at risk of getting hurt. A guide for healthcare and dental care regarding reporting obligations and responsibilities.\\n\\n”The concept of child harm includes all forms of abuse, neglect and exploitation that lead to actual or potential damage to the child's health or development. It can, for example, refer to children and young people who are exposed to physical or psychological violence, sexual abuse, violations or problems in relation to their family, as well as if they witness violence or live in an environment where violence and threats of violence occur. It also includes children and young people who get hurt because of their own behavior, for example because of substance abuse, crime and other self-destructive behavior. Children who are exposed to threats, violence or other abuse from peers or from others, as well as children with major problems in the school situation caused by a social problem can also be considered to be part of the social service's target group. and exploitation that results in actual or potential harm to the child's health or development. It can, for example, refer to children and young people who are exposed to physical or psychological violence, sexual abuse, violations or problems in relation to their family, as well as if they witness violence or live in an environment where violence and threats of violence occur. It also includes children and young people who get hurt because of their own behavior, for example because of substance abuse, crime and other self-destructive behavior. Children who are exposed to threats, violence or other abuse from peers or from others, as well as children with major problems in the school situation caused by a social problem can also be considered part of the social services target group.”\",\n details4_5: \"Risk on the way to level 5\",\n details5:\n \"Urgent concern - act now, alert the emergency services or similar \\n\\nAct immediately. At this stage, there is immediate danger to the student's life or health, or other situations where action must be taken immediately. Call 112. Contact emergency services. It could be that a student writes that they will attempt suicide, commit a crime or put themselves or someone else in immediate danger. Acute concern - act now, alert the emergency services or the like \\n\\nAct immediately. At this stage, there is immediate danger to the student's life or health, or other situations where action must be taken immediately. Call 112. Contact emergency services. It could be that a student writes that they will attempt suicide, commit a crime or put themselves or someone else in immediate danger.\",\n title: \"Information level \",\n },\n types: {\n quick: {\n title: \"Quick\",\n description: \"Only a limited number of subjects\",\n selectTopics: \"1. Select the topic in the conversation\",\n selectMeetingKind: \"2. How did the meeting occur?\",\n },\n normal: {\n title: \"Normal\",\n description: \"Full length report\",\n },\n },\n additionalSupport: {\n youthReception: \"Youth reception\",\n socialServices: \"Social services\",\n medicalAndHealthcare: \"Medical and healthcare\",\n },\n statistics: {\n additionalSupport: \"Additional support\",\n },\n },\n principal: {\n validation: {\n notEmpty: \"Value can't be empty\",\n noSpaces: \"Value can't have spaces\",\n lessThan30Symbols: \"{{value}} should be less than 30 symbols\",\n exists: \"Attribute already exists\",\n ageLessThan8: \"Your age cannot be less than 8\",\n ageLessThan18: \"Your age cannot be less than 18\",\n required: \"{{value}} is required\",\n requiredName: \"Name is required\",\n requiredEmail: \"Email is required\",\n notValidEmail: \"Not valid email\",\n },\n addCustomField: \"Add custom field\",\n overview: \"{{name}} Overview\",\n schedule: \"Organization schedule\",\n addCustomAttributes: \"Add custom attributes\",\n customFieldsDescription:\n \"While creating the user you'll see added custom fields.\",\n anonymous:\n \"Students in your organization are allowed to be anonymous. Their names and profile images will be hidden from other users.\",\n removeChatTitle: \"Remove chats\",\n removeChatDescription:\n \"Students in your organization are allowed to remove chats with student health staff.\",\n archiveChatTitle: \"Archive chats\",\n archiveChatDescription:\n \"Students in your organization are allowed to archive chats with student health staff.\",\n to: \"To\",\n from: \"From\",\n workingHours: \"Working hours\",\n custom: \"Custom\",\n weekDays: \"Weekdays\",\n allDays: \"All days\",\n addCustomMeetingTypes: \"Create custom appointment types\",\n addMeetingType: \"Create appointment type\",\n createMeetingType: \"Create appointment type\",\n editMeetingType: \"Edit appointment type\",\n chooseMeetingTypeEN: \"Choose name of appointment type in english\",\n chooseMeetingTypeSW: \"Choose name of appointment type in swedish\",\n meetingDescriptionSW:\n \"Enter a description for the appointment type in swedish\",\n meetingDescriptionEN:\n \"Enter a description for the appointment type in english\",\n videoEnable: \"Video enabled\",\n meetingCreated: \"Appointment type created successfully\",\n errorCreateMeeting: \"Error while create appointment type\",\n updatedMeeting: \"Updated appointment type successfully\",\n errorUpdatingMeeting: \"Error updating appointment type\",\n removeMeeting: \"Appointment type removed successfully\",\n errorRemovingMeeting: \"Error while removing appointment type\",\n MeetingNameRequired: \"Appointment type name is required\",\n confirmRemoveMeeting: \"Are you sure to remove appointment type\",\n editMeeting: \"Edit\",\n removePopup: \"Are you sure to remove appointment type?\",\n video: \"Video\",\n appointmentTypeDescription:\n \"The default Video meeting type will dissapear if a new video meeting type is added\",\n sessionDuration: \"Select meeting duration time\",\n sessionDurationNote:\n \"Note: Please make sure you make a selection. Because if no option is selected then the default options are 20 minutes and 50 minutes\",\n days: {\n monday: \"Monday\",\n tuesday: \"Tuesday\",\n wednesday: \"Wednesday\",\n thursday: \"Thursday\",\n friday: \"Friday\",\n saturday: \"Saturday\",\n sunday: \"Sunday\",\n },\n startLaterThanEnd: \"Start time is later than end time\",\n endBeforeStart: \"The end time is before the start time\",\n edit: \"Edit User\",\n add: \"Add User\",\n student: \"Student\",\n counsellor: \"Student health staff\",\n allbryCounsellor: \"Allbry Counsellor\",\n userCreated: \"The user was created successfully.\",\n errorCreatingUser: \"Error creating user\",\n userUpdated: \"The user was updated successfully.\",\n errorUpdatingUser: \"Error updating user\",\n userTable: {\n viewProfile: \"View profile\",\n editProfile: \"Edit profile\",\n users: \"users\",\n active: \"Registered\",\n inactive: \"Inactive\",\n deactivated: \"Deactivated\",\n nameSurname: \"Name Surname\",\n birthday: \"Date of birth\",\n organization: \"Organization\",\n activate: \"Activate\",\n deactivate: \"Deactivate\",\n profileActivated: \"Profile activated\",\n profileDeactivated: \"Profile deactivated\",\n activatingError: \"Error activating profile\",\n deactivatingError: \"Error deactivating profile\",\n generateCsvTemplate: \"Generate csv template\",\n generateXlsxTemplate: \"Generate xlsx template\",\n importUsers: \"Import users from xls or xlsx\",\n csvImportTitle: \"Import is in progress\",\n csvImportBody:\n \"Importing users may take some time. Please, don't close the window\",\n importButton: \"Import\",\n selectFiles: \"Select file to import\",\n importTitle: \"Import users\",\n usersAddSuccess: \"Users successfully added\",\n usersAddError: \"Error in importing users\",\n wrongFormat: \"File format should be xls or xlsx\",\n wrongImportData: \"Error in line {{row}}! Check imported file\",\n onboardingEmailDialogInstruction:\n \"You will send onboarding emails to the following users\",\n inActivateMultipleUserDialogInstruction:\n \"You will deactivate the following users\",\n scrapeMultipleUserDialogInstruction:\n \"You will scrape the following users\",\n sendEmail: \"Send Email\",\n onboardingEmail: \"Onboarding Email\",\n customEmail: \"Custom Email\",\n disableStudent: \"Disable Students\",\n disableUser: \"Disable Users\",\n actions: \"Actions\",\n role: \"Role\",\n class: \"Class\",\n usersDelete: \"Delete users\",\n requestScrapeSuccess:\n \"Request for Scrape Multiple Users submitted successfully\",\n changeAttributesSuccessMessage: \"Attributes changed successfully\",\n changeAttributes: \"Change attributes\",\n deactivatedSuccessMessage: \"Users deactivated successfully\",\n },\n csv: {\n custom: \"Fill custom attribute\",\n email: \"Fill person's email\",\n role: \"Fill number: 1 - student, 2 - counsellor\",\n gender: \"Fill number: 1 - male, 2 - female, 3 - other\",\n year: \"Year of birth\",\n month: \"Month of birth (number)\",\n day: \"Day of birth\",\n nameSurname: \"Fill person's name and surname\",\n dateOfBirth: \"Date of birth: yyyymmdd\",\n fillNumber: \"Fill number\",\n workSheetName: \"Sheet1\",\n },\n usersOrganization: \"{{name}} Users\",\n addUserButton: \"Add user\",\n about: \"About me\",\n user: {\n role: \"Role\",\n email: \"Email\",\n status: \"Status\",\n forcePassword: \"Force Password\",\n attribute: \"Attribute\",\n attributeDescription:\n \"You can select multiple attributes here. \\n\\nStudents with atleast one of the selected attribute will be able to contact you. However you can always concats everybody.\\nIf you do not select any attributes, all students can see you.\",\n },\n enterFieldName: \"Enter Field name (E.x. Class)\",\n result: \"{{value}} result\",\n results: \"{{value}} results\",\n noResults: \"No results\",\n day: \"Day\",\n month: \"Month\",\n year: \"Year\",\n statistic: {\n title: \"Statistics\",\n calendar: \"Calendar\",\n today: \"Today\",\n last7Days: \"Last 7 days\",\n last30Days: \"Last 30 days\",\n last90Days: \"Last 90 days\",\n thisWeek: \"This Week\",\n thisMonth: \"This month\",\n thisQuarter: \"This quarter\",\n thisYear: \"This year\",\n allTime: \"All time\",\n userTypes: \"User types\",\n notFound: \"No statistics found\",\n topics: \"Student reports\",\n amountOfReports: \"Amount of reports\",\n experience: \"Experience\",\n counselling: \"Appointments\",\n popularTimes: \"Popular hours\",\n ngoClicks: \"Support lines\",\n usersAmount: \"{{amount}} users\",\n levelOfWorry: \"Level of worry\",\n chats: \"Chats\",\n video: \"Video\",\n other: \"Other\",\n appointments: \"Appointments\",\n all: \"All\",\n without0: \"Actual worry level\",\n without0tooltip:\n \"Enabled: Average level of worry is shown for the meetings where a concern has actually been indicated. \\nDisabled: Average level of worry for all meetings is displayed even where worry was not experienced.\",\n allTitle: {\n users: \"{{value}} users\",\n user: \"{{value}} users\",\n times: \"{{value}} times\",\n time: \"{{value}} times\",\n zero: \"0\",\n redirection: \"{{value}} redirection\",\n redirections: \"{{value}} redirection\",\n },\n registered: \"Registered\",\n inactive: \"Inactive\",\n active: \"Registered & active\",\n todayInterval: \"Today {{start}} - {{end}}\",\n pdfExport: \"Export as PDF\",\n chartTitle: \"Counselling\",\n student: \"Student statistics\",\n internal: \"Internal EHT statistics\",\n totalHours: \"Total hours of reports\",\n showAll: \"Show all\",\n showLess: \"Show less\",\n anonymousUsersCount: \"Amount of anonymous users - {{count}}\",\n selectTopicsCategories: \"Select topics categories\",\n includeMeetingKind: \"Include Manual reports\",\n moreThanOneChatCountAverage:\n \"Average number of chats for students that chatted more than once:\",\n oneChatCountPercentage: \"Number of students that only chatted once:\",\n },\n internalStatistic: {\n time: \"Time spent per group\",\n total: \"Total\",\n hours: \"hours\",\n },\n changeAttributesNotes:\n '- If you want to change attributes select and show the input box to write your change, then press the \"Save\" button to save the changes attributes. \\n - If you only select attributes and press the \"Save\" button, you will attribute delete. \\n - If you want to add a new attribute, write your new attribute, then press the \"Save\" button to save the new attribute. ',\n },\n admin: {\n title: \"Allbry Admin\",\n modals: {\n addCounsellors: {\n choose: \"Choose student health staff\",\n search: \"Search student health staff\",\n },\n },\n organization: {\n organizations: \"organizations\",\n edit: \"Edit organization\",\n details: \"Organization details\",\n closed: \"Closed\",\n start: \"Start Date\",\n end: \"End Date\",\n principal: \"Principal\",\n principals: \"Principals\",\n create: \"Create organization\",\n view: \"View\",\n editPopup: \"Edit\",\n deactivated: \"Organization deactivated\",\n deactivatedError: \"Error deactivating organization\",\n name: \"Organization Name\",\n startEnd: \"Start date/End date\",\n addPrincipal: \"+ Add principal\",\n addCounsellor: \"+ Add student health staff\",\n searchOrganizations: \"Search organizations by name\",\n edited: \"The organization was edited successfully.\",\n created: \"The organization Was created successfully.\",\n createdError: \"Error creating organization\",\n editError: \"Error editing organization\",\n longName: \"Too long name\",\n startDateRequired: \"Start date is required\",\n endBeforeStart: \"End date cannot be before start date\",\n longEmail: \"Too long email\",\n emailFormat: \"Wrong email format\",\n duplicateEmails: \"Duplicate emails\",\n userExists: \"User already exists\",\n atLeastOne: \"At least one must be active\",\n subscriptionType: {\n title: \"Subscription types\",\n description:\n \"Your organization bla bla description for the feature allows you to be anonymous. Your name and profile image will be hidden from other users\",\n addLink: \"+ Add feature or type\",\n selectType: \"Select type\",\n registrationCode: \"Registration code\",\n add: \"Add\",\n remove: \"Remove\",\n addDialogTitle: \"Add subscription type\",\n addSuccess: \"Subscription type has been added successfully\",\n removeSuccess: \"Subscription type has been removed successfully\",\n },\n deleteOrganization: \"Delete organization\",\n requestScrapeSuccess:\n \"Request for Scrape Multiple Organizations submitted successfully\",\n scrapeMultipleOrganizationDialogInstruction:\n \"You will scrape the following organizations\",\n },\n role: {\n title: \"Roles\",\n addRoles: \"+ Add role\",\n createRole: \"Create role\",\n editRole: \"Edit role\",\n chooseMasterRole: \"Choose master role\",\n enterNameRoleSwedish: \"Enter name of role swedish\",\n enterNameRoleEnglish: \"Enter name of role english\",\n chooseFeatures: \"Choose features\",\n selectMasterRole: \"Select master role\",\n customRolesCreated: \"Custom role created successfully\",\n errorCreatecustomRoles: \"Error while create custom role\",\n updatedcustomRoles: \"Updated custom role successfully\",\n errorUpdatingcustomRoles: \"Error updating custom role\",\n removecustomRoles: \"Custom role removed successfully\",\n errorRemovingcustomRoles: \"Error while removing custom role\",\n confirmRemovecustomRoles: \"Are you sure to remove custom role?\",\n rolesRequired: \"Roles required\",\n rolesSelectRequired: \"Select atleast one role\",\n chooseFeaturesOne: \"Choose atleast one feature\",\n sessionTimeRequired: \"Session time required\",\n sessionTimeNumber: \"Session time should be number\",\n sessionTimeMin: \"Session time should be greater than 1 hour\",\n sessionTimeTitle: \"Session time\",\n },\n counsellors: {\n title: \"Allbry Counsellors\",\n add: \"Add counsellor\",\n edit: \"Edit counsellor\",\n profile: \"Counsellor's profile\",\n searchCounsellors: \"Search counsellors by name\",\n },\n ftpDataCollection: {\n title: \"FTP Data Collection\",\n selectOrganizations: \"Select Organization\",\n runCron: \"Run Now\",\n cronRunStart:\n \"Data migration process started for the selected organization. You will be received an email shortly\",\n },\n configData: {\n title: \"Config Data\",\n addConfig: \"Add Config\",\n organization: \"Organization\",\n migrationTime: \"Migration Time\",\n status: \"Status\",\n active: \"Active\",\n deactivate: \"Deactivated\",\n viewProfile: \"View Config\",\n editProfile: \"Edit Config\",\n organizationActivated: \"Organization Activated\",\n organizationDeactivated: \"Organization Deactivated\",\n activatingError: \"Error activating Organization\",\n deactivatingError: \"Error deactivating Organization\",\n configDetails: \"{{organization}}'s Config Details\",\n timerNotSet: \"Timer Not Set\",\n yes: \"Yes\",\n no: \"No\",\n },\n configForm: {\n title: \"Config Form\",\n addOrgConfig: \"Add organization Config\",\n editOrgConfig: \"Edit organization Config\",\n ftpConfigDetails: \"FTP Config Details\",\n organization: \"Organization\",\n runOnce: \"Run Single Time\",\n timer: \"Timer\",\n daily: \"Every Midnight\",\n weekly: \"Every Sunday Midnight\",\n monthly: \"Every 1st Of Month Midnight\",\n selectTimer: \"Select Timer\",\n subOrganization: \"Sub Organization\",\n addOrganization: \"+ Add Organization\",\n selectOrganizations: \"Select Organization\",\n userModel: \"User Models\",\n addModel: \"+ Add Model\",\n student: \"Student\",\n attribute: \"Attribute\",\n userAttributes: \"User Attribute\",\n addAttribute: \"+ Add Attribute\",\n selectAttributes: \"Select Attribute\",\n name: \"Name\",\n code: \"Code\",\n host: \"Host Name\",\n username: \"Username\",\n password: \"Password\",\n port: \"Port\",\n secure: \"Secure\",\n fileName: \"File Name\",\n fileFormat: \"File Format\",\n filePath: \"File Path\",\n true: \"True\",\n false: \"False\",\n fileNameEx: 'Ex: File name is \"latest\" or create \\nyour custom file name',\n filePathEx: 'Ex: File path is \"/\" ',\n userModelNameEx: 'Ex: name is \"student/counsellor\"',\n userModelCodeEx: 'Ex: code is \"student/counsellor\"',\n edit: \"Edit Config\",\n nameRequired: \"Name is required\",\n codeRequired: \"Code is required\",\n selectRequired: \"Select any one\",\n configRequired: \"{{name}} is required\",\n },\n notifications: {\n notificationDate: \"Notification Date\",\n message: \"Message\",\n activeInactive: \"Active/Inactive\",\n status: \"Status\",\n all: \"All\",\n sent: \"Sent\",\n upcoming: \"Upcoming\",\n vieweditNotifications: \"View/edit notifications\",\n deleteNotifications: \"Delete notifications\",\n createNotification: \"Create notification\",\n notificationDateAndTime: \"Notifications date and time\",\n notificationMessage: \"Notification Message\",\n notificationMessagePlaceholder: \"Enter notification message\",\n allOrganization: \"All Organization\",\n selectOrganization: \"Select Organization\",\n add: \"Add\",\n popup: \"Are you sure to remove notification?\",\n messageValidation: \"Message can not be blank\",\n selectRequired: \"Select at least one organization\",\n createdNotification: \"Notification create successfully\",\n removedNotification: \"Notification removed successfully\",\n editNotification: \"Notification edit successfully\",\n errorCreateNotification: \"Error while creating notification\",\n errorErrorNotification: \"Error while edit notification\",\n },\n superActions: {\n title: \"Super Actions\",\n userLoginWithEmail: \"User login with email\",\n loginButton: \"Login\",\n emailInput: \"Email\",\n },\n broadcastMessages: {\n createdBroadcastMessage: \"Broadcast message create successfully\",\n updatedBroadcastMessage: \"Broadcast message updated successfully\",\n removedBroadcastMessage: \"Broadcast message removed successfully\",\n deleteBroadcastMessageConfirmation:\n \"Are you sure you want to delete this record ?\",\n deleteBroadcastMessageError:\n \"You cannot delete this record but can deactivate it\",\n editBroadcastMessage: \"Broadcast message edit successfully\",\n errorCreateBroadcastMessage: \"Error while creating broadcast message\",\n errorUpdateBroadcastMessage: \"Error while updating broadcast message\",\n errorRemoveBroadcastMessage: \"Error while removing broadcast message\",\n allOrganizations: \"All Organizations\",\n selectOrganization: \"Select Organization\",\n active: \"Active\",\n inActive: \"Inactive\",\n edit: \"Edit\",\n delete: \"Delete\",\n create: {\n startDate: \"Start Date\",\n endDate: \"End Date\",\n enterHeading: \"Enter Heading\",\n message: \"Enter Message\",\n newsAndMarketingMessage: \"News and Marketing Message\",\n add: \"Add\",\n heading: \"Heading\",\n userTypes: \"User Types\",\n selectUserTypes: \"Select User Type\",\n },\n userTypes: {\n counsellor: \"Counsellor\",\n student: \"Student\",\n },\n listingColumn: {\n heading: \"Heading\",\n message: \"Message\",\n startDate: \"Start Date\",\n endDate: \"End Date\",\n userType: \"User Type\",\n status: \"Status\",\n },\n },\n },\n allbryCounsellor: {\n choose: \"Choose organization\",\n notFound: \"No organization found...\",\n text: \"You haven't been added to any organization yet.\",\n error: \"Error while attempting to login in organization\",\n },\n filterModal: {\n filter: \"Filter\",\n addFilter: \"Add filter\",\n description: \"Show users that match all conditions:\",\n addCondition: \"+ Add condition\",\n is: \"is\",\n isNot: \"is not\",\n chooseFilter: \"Choose filter\",\n conditionValue: \"Enter condition value\",\n },\n counsellorReport: {\n tabs: {\n reportTemplates: \"Report templates\",\n reports: \"Reports\",\n },\n reports: \"Reports\",\n reportTemplate: {\n studentReport: \"Student report\",\n studentReportDescription: \"Create a student report\",\n studentNote: \"Student note\",\n studentNoteDescription: \"Create a student note\",\n internalReport: \"Internal EHT report\",\n internalReportDescription: \"Create a internal EHT report\",\n anonymousReport: \"Anonymous student report\",\n anonymousReportDescription: \"Create an anonymous student report\",\n },\n internalReport: {\n selectTypes: \"2. Select the type of meeting\",\n selectFilter: \"3. Select group if applicable (non mandatory)\",\n meetingDuration: \"5. Meeting duration (in hours)\",\n meetingNotes: \"4. Meeting notes\",\n meetingNoteTitle: \"Anteckningar\",\n meetingTypes: {\n type1: \"EHT\",\n type2: \"EHM\",\n type3: \"Cooperation meeting SIP\",\n type4: \"Cooperation meeting with VH, students & other actors\",\n type5: \"Cooperation meeting BUP\",\n type6: \"Meeting with VH, students & other actors\",\n type7: \"Meeting with student and VH\",\n type8: \"Meeting with VH\",\n type9: \"Meeting with student and school staff\",\n type10: \"Meeting with VH and another actor\",\n type11: \"Meeting cooperation\",\n type12: \"Attendance work\",\n type13: \"Guiding school staff\",\n type14: \"Meeting with school staff\",\n type15: \"Meeting with principal\",\n type16: \"Participation in development work\",\n type17: \"Participation in security work\",\n type18: \"Work with student groups\",\n },\n staticAttributes: {\n attributeName: {\n attribute1: \"Stage\",\n },\n attributeValue: {\n attribute1value1: \"Low stage\",\n attribute1value2: \"Middle stage\",\n attribute1value3: \"High stage\",\n attribute1value4: \"High school\",\n },\n },\n },\n anonymousReport: {\n title: \"Anonymous student report\",\n selectAttributeTitle: \"1. Select class/year (non mandatory)\",\n gender: \"2. Gender identity (non mandatory)\",\n studentName: \"3. Enter students name (non mandatory)\",\n },\n chooseStudent: \"Choose student\",\n createReport: \"Create report\",\n createNote: \"Create note\",\n searchStudents: \"Search students\",\n filterOption: {\n notes: \"Notes\",\n quickReport: \"Student reports\",\n internalReport: \"Internal reports\",\n anonymousReport: \"Anonymous reports\",\n },\n showMore: \"Show more...\",\n },\n survey: {\n introStep: \"Hey, let's start with a quick survey\",\n firstStep: {\n question: \"Have you tried Allbry before?\",\n letMeIn: \"Yes, let me in!\",\n whatIsAllbry: \"What is Allbry?\",\n },\n secondStep: {\n question: \"Have you previously sought guidance?\",\n yes: \"Yes, a couple of times\",\n never: \"No, I haven't\",\n },\n genderStep: {\n question: \"To which gender do you most identify?\",\n male: \"Male\",\n female: \"Female\",\n other: \"Other\",\n private: \"Do not wish to say\",\n },\n outroStep: \"Thank you for your time!\",\n helpImprove:\n \"It'll take only few minutes, but will help us to improve your experience with Allbry.\",\n firstPart: \"1/2\",\n secondPart: \"2/2\",\n checkInAndSurvey: \"Check-ins and Surveys\",\n tabOption: {\n template: \"Templates\",\n active: \"Active\",\n statistics: \"Statistics\",\n },\n create: {\n title: \"Template creator\",\n name: \"Name\",\n accessType: \"Access type\",\n accessTypeOptions: {\n global: \"Global\",\n local: \"Local\",\n },\n surveyType: \"Survey type\",\n surveyTypeOptions: {\n checkIn: \"Check-in\",\n survey: \"Survey\",\n },\n isPublic: \"Is Public\",\n isActive: \"Is Active\",\n },\n createConfig: {\n title: \"Config Templates\",\n Survey: \"Survey Template\",\n Account: \"Organization\",\n attributes: \"User Attributes\",\n select: \"-Select-\",\n runsDay: \"Runs every Day\",\n runsWeekly: \"Runs every\",\n runsMonthly: \"Runs every {{date}} th of month\",\n timerOption: {\n daily: \"Daily\",\n weekly: \"Weekly\",\n monthly: \"Monthly\",\n weekDays: {\n monday: \"Monday\",\n tuesday: \"Tuesday\",\n wednesday: \"Wednesday\",\n thursday: \"Thursday\",\n friday: \"Friday\",\n saturday: \"Saturday\",\n sunday: \"Sunday\",\n },\n },\n modals: {\n students: {\n title: \"Select Group\",\n chooseStudentTitle: \"Who do you want to check on?\",\n selectedStudents: \"Selected Students\",\n confirmSelection: \"Confirm Selection\",\n searchPlaceholder: \"Search for students\",\n noStudentsFound: \"No students found\",\n },\n },\n addOwnUsers: \"+ Add your own users\",\n addedOwnUsers: \"Added {{count}} own users\",\n },\n template: {\n createTemplate: \"Template create successfully\",\n errorCreateTemplate: \"Error while creating template\",\n deleteTemplate: \"Template delete successfully\",\n deleteTemplateConfirmation:\n \"Are you sure you want to delete this templates ?\",\n deleteTemplateError:\n \"You cannot delete this template but can deactivate it\",\n deleteConfigError: \"You cannot delete this config but can deactivate it\",\n errorDeleteTemplate: \"Error while deleting template\",\n editTemplate: \"Template edit successfully\",\n errorEditTemplate: \"Error while editing template \",\n createConfig: \"Config create successfully\",\n errorCreateConfig: \"Error while creating config\",\n active: \"Active\",\n inActive: \"Inactive\",\n true: \"Yes\",\n false: \"No\",\n timer: \"Timer\",\n RunOnce: \"RunOnce\",\n StartTime: \"Start time\",\n EndTime: \"End time\",\n TimeLimitInHour: \"Time limit in Hour\",\n typeChangeDescription:\n \"We are looking you have some changes on survey Templates.\\n Are you sure you want to change?\\n If you change the survey type then you all changes will be discard.\",\n btn: {\n delete: \"Delete\",\n edit: \"Edit\",\n statistics: \"Statistics\",\n addImage: \"Add image to question\",\n },\n listingColumn: {\n name: \"Name\",\n accessType: \"Access type\",\n surveyType: \"Survey type\",\n public: \"Public\",\n questionAmount: \"Question amount\",\n status: \"status\",\n },\n listingColumn: {\n name: \"Name\",\n templateName: \"Template Name\",\n accessType: \"Access type\",\n surveyType: \"Survey type\",\n public: \"Public\",\n questionAmount: \"Question amount\",\n status: \"Status\",\n attributes: \"User Attributes\",\n organization: \"Organization Name\",\n isAnonymous: \"Is Anonymous\",\n action: \"Action\",\n StartDate: \"Start Date\",\n EndDate: \"End Date\",\n },\n questionType: {\n filling: \"Feelings\",\n rangSlider: \"Range slider\",\n singleSelect: \"Single select\",\n image: \"Image\",\n },\n createTemplateAboutDescription:\n \"Watch the video below to learn more about the template creator.\",\n createTemplateAboutTitle: \"Description\",\n duplicate: \"Duplicate\",\n copyText: \"Copy\",\n addImages: \"Add images\",\n },\n student: {\n question: \"Question\",\n stripMas: \"Your teacher wants to take the test!\",\n questionnaire: \"The school questionnaire\",\n completeHeading: \"Thanks for your answers!\",\n completeDescription: \"The school questionnaire has been submitted.\",\n completeBackButton: \"Back to home screen\",\n startSurvey: \"Start the survey\",\n skipQuestion: \"I do not want to answer\",\n SkipMas: \"Are you sure, you don't want to answer?\",\n notAnonymousAnswerDescription:\n \"The survey is not anonymous, and the student health services can access individual responses\",\n },\n statistics: {\n noAnyTemplate: \"You have no any templates\",\n all: \"All\",\n ended: \"Ended\",\n started: \"Started\",\n date: \"Date\",\n AmountOfAnswers: \"Amount of answers\",\n noOFUsers: \"No. of users\",\n question: \"question\",\n thisMonth: \"This month\",\n unanswered: \"Unanswered\",\n status: {\n new: \"New\",\n complete: \"Complete\",\n active: \"Active\",\n },\n showAll: \"Show all\",\n showLess: \"Show less\",\n response: \"response\",\n days: \"Days\",\n weekNumbers: \"Week numbers\",\n months: \"Months\",\n students: \"Students\",\n noAnyoneAnswered: \"No students have answered this survey\",\n answer: \"Answer\",\n deepFilter: \"Deep filter\",\n averageValue: \"Average value: {{value}}\",\n multiple: \"(Multiple)\",\n guestUserLink: \"Guest user link\",\n showGuestUserData: \"Show guest user data\",\n filterInfo: \"If a filter is applied, remove the guest user data.\",\n guestUsers: \"guest users\",\n showGuestUserDataDisabledContent:\n \"Not possible to show guest user data if a filter is applied.\",\n amountOfCustomStudents: \"Manually chosen students\",\n numberOfCustomStudents: \"Number of manually chosen students\",\n anonymousResponse: \"Response #{{number}}\",\n responses: \"Responses\",\n },\n counsellor: {\n titles: { survey: \"Survey\", checkIn: \"Check in\" },\n readMoreDifferenceModalTitle: \"Difference\",\n checkInDescription:\n \"Survey with questions that are asked regularly during a selected interval\",\n surveyDescription:\n \"Survey with questions that are asked once\",\n title: \"The Temperature Check\",\n startTitle: \"Pace your students\",\n startDescription:\n \"With the temperature check, you can send out long or short questionnaires to learn more about the well-being of your students.\",\n createTemplateBtn: \"Create your first temp\",\n addTemplateBtn: \"Create new temp\",\n readMoreDifference: \"Read more about the difference\",\n student: \"Students\",\n ownSelection: \"Own selection\",\n ownSelectionDescription: \"Select individuals\",\n answered: \"Answered\",\n dispatch: \"Dispatch frequency\",\n adjustTime: \"Adjust date and time\",\n question: {\n num1: \"Do you want to take the test or create a survey?\",\n template: \"What do you want to tempt?\",\n attribute: \"Which ones do you want to challenge?\",\n survey: \"How often do you want to take the temp?\",\n checkIn: \"When do you want to send out the survey?\",\n description: {\n checkIn:\n \"Survey with uestions that are asked regularly during a selected interval\",\n survey: \"Survey with questions asked once\",\n },\n anonymousPageTitle: \"Do you want to see individual answers?\",\n anonymousPageDescription:\n \"If you activate this, you will be able to see students individual answers, however the student will be informed when starting the survey that their answers will not be anonymous\",\n guestPageTitle: \"Do you want to generate a anonymous link?\",\n guestPageDescription:\n \"If you activate this, you will receive a link and/or QR-code that you can distribute to students. \\n The students who then use the link will be able to answser the survey without logging in and/or having an account.\",\n },\n status: {\n active: \"Active\",\n search: \"Search\",\n completed: \"Completed\",\n },\n timerOption: {\n daily: \"Daily\",\n weekly: \"Weekly\",\n monthly: \"Monthly\",\n dailyDescription: \"Shipped every day\",\n weeklyDescription: \"Shipped every Monday\",\n monthlyDescription: \"Sent on the 1st of every month\",\n },\n createOwnTemplate: \"+ Create your own template\",\n },\n templateType: {\n general: \"General\",\n private: \"Private\",\n },\n surveyTypeOptions: {\n checkIn: \"Check-in\",\n survey: \"Survey\",\n },\n amountQuestion: \"Amount of questions\",\n endSurveyConfig: \"End survey\",\n endSurveyPopupConfirmationText:\n \"Are you sure you want to stop this survey?\",\n endSuccess: \"Survey ended successfully\",\n deleteSurveyConfig: \"Delete survey\",\n deleteSurveyConfigPopupConfirmationText:\n \"Are you sure you want to delete this survey and its statistics?\",\n },\n};\n\nexport default en;\n","import { PRINCIPAL_ROUTE_NAME } from \"@router/principal\";\n\nconst sv = {\n common: {\n preview: \"Förhandsgranska\",\n continue: \"Fortsätt\",\n next: \"Nästa\",\n previous: \"Tidigare\",\n complete: \"Klar\",\n skip: \"Hoppa över\",\n saveChanges: \"Spara ändringar\",\n save: \"Spara\",\n upload: \"Ladda upp\",\n uploadVideo: \"Ladda upp video\",\n loading: \"Laddar\",\n back: \"Tillbaka\",\n cancel: \"Avbryt\",\n delete: \"Ta bort\",\n close: \"Stäng\",\n twentyMinutes: \"20 min\",\n fiftyMinutes: \"50 min\",\n resetPasswordError: \"Ett fel uppstod när lösenordet skulle återställas\",\n notFoundEmailError: \"En användare med denna e-postadress kunde inte hittas\",\n email: \"E-postadress\",\n password: \"Lösenord\",\n passwordConfirm: \"Bekräfta ditt lösenord\",\n corporateEmail: \"Ange din skol- eller organisationsmail\",\n anyEmail: \"Ange din e-postadress\",\n today: \"Idag\",\n scheduleSession: \"Boka ett elevhälsosamtal\",\n invalidEmail: \"Ogiltig e-postadress\",\n invalidPasswordLength: \"8 tecken långt\",\n invalidPasswordMatch: \"En stor bokstav, en liten bokstav & en siffra\",\n invalidPasswordConfirm: \"Lösenorden matchar inte\",\n requiredField: \"Detta fält är obligatoriskt\",\n no: \"Nej\",\n checkSearch: \"Lägg till en ny eller kontrollera om sökningen är korrekt\",\n noFound: \"Inga {{name}} hittades\",\n switchAccountError: \"Ett fel inträffade när du försökte byta organisation\",\n dragNDrop:\n \"Dra och släpp några filer hit, eller klicka för att välj filer.\",\n continueWithCode: \"Fortsätt med kod\",\n continueWithoutCode: \"Hoppa över\",\n areYouSure: \"Är du säker?\",\n yes: \"Ja\",\n create: \"Skapa\",\n keywordSearch: \"Sök\",\n watchHelloVideo: \"Se videohälsning\",\n helloVideoTitle: \"Videohälsning\",\n profileImage: \"Profilbild\",\n aboutMeVideo: \"Videohälsning\",\n notes: \"Anteckningar\",\n add: \"Lägg till\",\n color: \"Färg\",\n min: \"min\",\n send: \"Skicka\",\n selectStatus: \"Välj en status\",\n showMore: \"Visa mer\",\n showLess: \"Visa mindre\",\n download: \"Ladda ner\",\n downloadQrAsSvg: \"Klicka och ladda ner QR som SVG\",\n copied: \"Kopierad\",\n copyError: \"Kunde inte kopiera\",\n },\n modal: {\n sizeLimit: {\n title: \"Gränsen för filstorlek har nåtts\",\n content:\n \"Filen är för stor för uppladdning, gränsen är {{sizeLimit}}. Var vänlig välj en annan.\",\n },\n fileType: {\n title: \"Ogiltig filtyp\",\n content: \"Du kan bara använda bilder\",\n },\n akkImage: {\n akkImage: \"Bildstöd\",\n customImage: \"Egen bild\",\n uploadImage: \"Välj bild\",\n },\n endDate: {\n title: \"Slutdatum\",\n content: \"Välj slutdatum\",\n },\n },\n mobile: {\n notAvailable: \"Webbversionen av Allbry är inte tillgänglig på mobilen\",\n availableInLandscape:\n \"Allbry-webbversionen är endast tillgänglig i liggande läge\",\n pleaseUseLinks: \"Ladda ner vår mobilapp via länken nedan\",\n pleaseUseLinksLandscape:\n \"Du kan ladda ner vår mobilapp genom att använda länken nedan\",\n appStore: \"App Store\",\n googlePlay: \"Google Play\",\n },\n introduction: {\n getSupport: \"Elevhälsa direkt på webben\",\n chat: {\n student: \"Aden\",\n counsellor: \"Alexandra\",\n messages: {\n first: \"Hej!\",\n second: \"Jag känner mig nere\",\n third: \"Och har ingen att prata med... 😔\",\n fourth:\n \"Tja Aden! Du har ju mig att prata med! Berätta för mig, varför känner du dig nere?\",\n },\n },\n },\n auth: {\n login: {\n withEmail: \"Ange din e-postadress\",\n enterPassword: \"Ange ditt lösenord\",\n codeStepTitle: \"Har du fått en registreringskod?\",\n loginSuccess: \"Du har loggat in framgångsrikt\",\n codeStepSubtitle:\n \"I vissa fall behöver du en registreringskod för att registrera dig. Om du har fått en, vänligen ange den nedan. Om inte, tryck bara på hoppa över.\",\n codeInput: \"Registreringskod\",\n codeInputHint: \"Vänligen ange din registreringskod om du fått en\",\n createPass: \"Skapa ditt lösenord\",\n terms: \"Jag har läst, förstått och godkänner härmed Allbrys\",\n termsLink: \"villkor\",\n paymentTitle: \"Förnya din prenumeration\",\n paymentDescription:\n \"Allbry kostar {{price}} {{currency}} varje månad. Abonnemanget är aktivt tills du säger upp det.\",\n },\n logout: {\n logoutSuccess: \"Du har loggat ut framgångsrikt\",\n },\n signUpConsumer: {\n terms: \"Jag har läst, förstått och godkänner härmed Allbrys \",\n termsLink: \"villkor\",\n startJourney: \"Påbörja din resa med Allbry idag\",\n withOrganization: \"Registrera dig med ett organisationskonto (SSO)\",\n withEmail: \"Skapa konto\",\n signUp: \"Registrera dig med e-postadress\",\n createPass: \"Skapa lösenord\",\n haveAccount: \"Har du redan ett konto?\",\n logIn: \"Logga in\",\n connectedOrganization: \"Ditt konto tillhör \",\n aboutYourSelfHeader: \"Välj användarnamn\",\n aboutYourSelfDescription1:\n \"Välj det namn du vill ska synas för kuratorn eller rådgivaren.\",\n aboutYourSelfDescription2:\n \"Vi lämnar inte ut din personliga information till tredje part.\",\n paymentTitle: \"Skapa abonnemang\",\n paymentDescription:\n \"Allbry kostar {{price}} kr per månad och du debiteras månadsvis i efterhand så länge du har ditt konto hos oss. Snabbt och enkelt, utan bindningstid.\",\n paymentDescriptionSuccess:\n \"Grattis! Ditt konto är nu skapat och abonnemanget är aktivt tills att du avbryter det.\",\n successTitle: \"Grattis!\",\n successDescription:\n \"Välkommen till Allbry! Här finns vi tillgängliga för att stötta, motivera och vägleda dig. \",\n klarnaLoadingError:\n \"Något gick fel när vi försökte ladda betalningsomdulen, var vänlig försök igen senare\",\n klarnaOrderError:\n \"Något gick fel när vi försökte bekräfta din betalning, var vänlig försök igen senare\",\n },\n forgot: {\n checkStep: \"Kolla din e-post!\",\n weJustSent: \"Vi har skickat en\",\n resetPassLink: \"återställningslänk för ditt lösenord\",\n followInstructions:\n \"till din e-post. Kolla din inkorg och följ instruktionerna\",\n enterEmail: \"Ange din e-postadress\",\n createNewPass: \"Skapa nytt lösenord\",\n },\n registrationError: \"Det gick inte att skapa ditt konto\",\n signInError: \"Felaktigt e-postadress och/eller lösenord\",\n forgotPassword: \"Glömt lösenord?\",\n invalidPassword: \"Ogiltigt lösenord\",\n externalJoin: {\n title: \"Har du fått en möteskod\",\n description:\n \"Om du har fått en möteskod, vänligen ange den nedan för att komma igång.\",\n placeholder: \"Ange din möteskod\",\n help: \"Kontakta organisatören om du inte har en möteskod.\",\n invitationMessage: \"Du har blivit inbjuden till ett möte\",\n invitationDescription:\n \"Du har blivit inbjuden till ett möte genom Allbry av {{counselorName}}\",\n },\n },\n navbar: {\n switch: \"Ställ dig själv som\",\n toOffline: \"offline\",\n toOnline: \"online\",\n appointments: {\n title: \"Samtal\",\n text: \"Boka ett videosamtal med elevhälsan för ett personligare samtal.\",\n },\n messages: {\n title: \"Chatt\",\n text: \"Chatta med elevhälsan när som helst utan att boka tid\",\n },\n students: {\n title: \"Elever\",\n },\n reports: {\n title: \"Rapporter\",\n },\n home: {\n title: \"Hem\",\n },\n organizations: {\n title: \"Organisationer\",\n },\n profile: \"Profil\",\n settings: {\n title: \"Inställningar\",\n },\n logOut: \"Logga ut\",\n [PRINCIPAL_ROUTE_NAME.ORGANIZATION]: {\n title: \"Organisation\",\n },\n [PRINCIPAL_ROUTE_NAME.STATISTICS]: {\n title: \"Statistik\",\n },\n [PRINCIPAL_ROUTE_NAME.USERS]: {\n title: \"Användare\",\n },\n counsellors: {\n title: \"Elevhälsopersonal\",\n },\n dataMigration: {\n title: \"Data Migration\",\n },\n ftpDataCollection: {\n title: \"FTP Data Collection\",\n },\n configForm: {\n title: \"Config Form\",\n },\n notifications: {\n title: \"Notifikationer\",\n },\n superActions: {\n title: \"Super Actions\",\n },\n checkInsAndSurveys: {\n title: \"Tempen\",\n },\n config: {\n title: \"Tempen\",\n },\n broadcastMessages: {\n title: \"Sänd meddelanden\",\n },\n },\n notFound: {\n code: \"404\",\n text: \"Sidan gick inte att visa\",\n },\n settings: {\n title: \"Inställningar\",\n billing: {\n title: \"Prenumerationsinställningar\",\n activeStatus:\n 'Din prenumeration är aktiv och nästa betalning kommer att inträffa den {{date}}',\n inactiveStatus:\n 'Din prenumeration är inaktiv, men ditt konto är tillgängligt till {{date}}',\n manageSubBtn: \"Hantera prenumeration\",\n cancelSubBtn: \"Avbryt prenumeration\",\n manageSub: \"Hantera prenumeration\",\n cancelSub: \"Avbryt prenumeration\",\n cancelSubSubtitle:\n \"Är du säker på att du vill lämna oss? Vi finns alltid här som stöd. Du är självklart välkommen tillbaka närsomhelst! Ditt konto kommer vara fortsatt aktivt fram till {{date}}, sedan säger vi hejdå.\",\n confirmCancel: \"Bekräfta\",\n },\n anonymous: {\n title: \"Anonymt läge\",\n description:\n \"Din organisation tillåter dig att vara anonym. Med denna inställning aktiverad kommer ditt namn och profilbild vara dolt för din elevhälsopersonal. Vi har anmälningsskyldighet i fall vi känner oss oroliga för dig och din omedelbara säkerhet så kan vi identifera dig, även om du är anonym.\",\n },\n allowEmailNotification: {\n title: \"Mejlnotiser\",\n description: \"Du kan stänga av mejlnotiser från Allbry\",\n },\n calendarSync: {\n title: \"Extern kalender synk\",\n description: \"Aktivera extern kalender synk för boka samtal\",\n freeDescription: \"Aktivera extern kalendersynk av upplagd tillgänglighet\",\n freeNote:\n \"Notera: Oftast läggs allt till automatiskt men om det inte sker så följ instruktionerna i mejlet som skickas till dig när du lägger till tillgänglig tid\",\n },\n dataReset: {\n recurrentReset: {\n title: \"Återkommande återställning av data\",\n disabledResetParagraph:\n \"Aktivera återkommande återställning av data för att rensa data automatiskt. Observera att återställning av data påverkar chattar, samtalshistorik och minnesanteckningar.\",\n enabledResetParagraph:\n \"Beräknat datum för nästa återställning är {{date}}. Observera att återställning av data påverkar chattar, samtalshistorik och minnesanteckningar.\",\n intervalLabel: \"Intervall\",\n intervals: {\n eachMonth: \"Varje månad\",\n eachThreeMonths: \"Varje 3 månader\",\n eachSixMonths: \"Varje 6 månader\",\n },\n errorGettingResetState:\n \"Fel när det gäller att hämta status för aktuella återkommande jobb\",\n errorSwitchingResetState:\n \"Fel vid ändring av status för återkommande jobb\",\n errorIntervalChange: \"Fel vid ändring av återställningsintervallet\",\n successIntervalChange:\n \"Ett nytt återställningsintervall har fastställts.\",\n },\n manualReset: {\n title: \"Återställ data nu\",\n paragraph:\n \"Observera att återställning av data påverkar chattar, samtalshistorik och minnesanteckningar.\",\n resetButton: \"Rensa alla uppgifter\",\n resetSuccess: \"Uppgifterna har raderats\",\n resetFailure: \"Fel vid återställning av data\",\n resetModal: {\n title: \"Rensa alla uppgifter\",\n paragraph:\n \"Är du säker på att du vill återställa all information i chattar, samtalshistorik och minnesanteckningar?\",\n yes: \"Ja\",\n no: \"Nej\",\n },\n },\n },\n policy: {\n title: \"Integritetspolicy\",\n description: {\n firstPart: \"\",\n secondPart: \"\",\n },\n policyCopy:\n \"En kopia av våra användarvillkor och integritetspolicy finns\",\n hereLink: \"här\",\n },\n language: {\n title: \"Språk\",\n },\n changePassword: \"Ändra Lösenord\",\n currentPassword: \"Nuvarande Lösenord\",\n newPassword: \"Nytt Lösenord\",\n confirmPassword: \"Bekräfta Nytt Lösenord\",\n passwordChanged: \"Lösenordet har ändrats\",\n unavailable: {\n title: \"Out of office\",\n description:\n \"Fyll i rutan nedan och aktivera till höger för att ställa in ett meddelande som visas för dina elever när de skickar ett meddelande till dig.\",\n success: \"Texten har uppdaterats\",\n unavailableText: \"Ange texten här\",\n anywaySendMessage:\n \"Ge eleven möjlighet att fortsätta skicka meddelanden även om du inte är tillgänglig.\",\n },\n },\n profile: {\n personProfile: \"{{type}}s profil\",\n personProfileName: \"{{person}}s profil\",\n overview: \"Profil\",\n edit: {\n title: \"Ändra profil\",\n restriction: \"Endast administratörer kan ändra\",\n gender: {\n male: \"Man\",\n female: \"Kvinna\",\n other: \"Annat\",\n private: \"Vill inte svara\",\n },\n about: \"Om\",\n changesSaved: \"Ändringar sparade\",\n },\n personalInfo: \"PERSONLIGA UPPGIFTER\",\n about: \"Om mig\",\n name: \"Namn\",\n birthday: \"Födelsedatum\",\n fullBirthday: \"{{birthday}} ({{fullYears}} år)\",\n appointments: \"SAMTAL\",\n noAppointments: \"Inga samtal hittades för denna kategori\",\n gender: \"Kön\",\n age: \"Ålder\",\n email: \"E-postadress\",\n lastNote: \"{{person}}s senaste anteckning kommer visas här.\",\n parentAccountID: \"Parent account ID\",\n noParentIfEmpty: \"Ingen parent om den är tom\",\n secretIdentity: \"Skyddad identitet\",\n },\n appointments: {\n title: \"Samtal\",\n session: {\n today: \"Gå med i samtalet\",\n future: \"Avbokning eller ombokning\",\n completed: \"Nytt samtal\",\n cancelled: \" Nytt samtal\",\n cancel: \"Avboka\",\n },\n status: {\n upcoming: \"Kommande\",\n completed: \"Avslutade\",\n cancelled: \"Avbokade\",\n unanswered: \"Väntar på svar från {{name}}\",\n pending: \"Väntar på svar från dig\",\n active: \"Accepterad\",\n },\n action: {\n accept: \"Godkänn\",\n reschedule: \"Ombokning\",\n deny: \"Avböj\",\n goToAppointment: \"Gå till bokningen\",\n },\n unansweredDialog: {\n title: \"Du har obesvarande samtalsförfrågningar\",\n continueBtn: \"Fortsätt senare\",\n },\n booking: {\n title: {\n booking: \"Bokning\",\n reschedule: \"Omplanera\",\n },\n schedule: \"Boka\",\n chooseStudent: \"Välj elev\",\n selectStudent: \"Välj elev\",\n chooseUser: \"Välj användare\",\n selectUser: \"Välj användare\",\n sessionDuration: \"Samtalets längd\",\n sessionTime: \"Samtalets tid\",\n success: \"Klart\",\n successText: \"Du kan se din bokning under kommande samtal\",\n successBooked: \"bokat\",\n successRescheduled: \"ombokat\",\n back: \"Okej\",\n chooseUserModal: \"Välj användare\",\n chooseStudentModal: \"Välj elev\",\n done: \"Klart\",\n chooseCounsellor: \"Välj elevhälsopersonal\",\n chooseCounsellorModal: \"Välj elevhälsopersonal\",\n selectCounsellor: \"Välj elevhälsopersonal\",\n searchStudents: \"Sök elev\",\n recommendedSlotsMassage:\n \"Inga tillgängliga tider, välj ett annat datum eller välj en av de rekommenderade tiderna nedan\",\n recommendedSlots: \"Rekommenderade tider\",\n noTimeSlots: \"Inga tillgängliga tider\",\n custom: \"Anpassad tid\",\n startTime: \"Starttid\",\n endTime: \"Sluttid\",\n video: \"Video\",\n students: \"Elever\",\n counsellors: \"Elevhälsopersonal\",\n search: {\n student: \"Sök elev\",\n counsellor: \"Sök hälsopersonal\",\n },\n notFound: {\n student: \"Ingen elev hittades\",\n counsellor: \"Ingen elevhälsopersonal hittades\",\n },\n selectExternal: \"Lägg till extern\",\n name: \"Namn\",\n number: \"Telefonnummer\",\n email: \"Epost\",\n },\n detail: {\n scheduleInfoCancelOrReschedule:\n \"Samtalet är bokat per {{date}}, klockan {{time}}. Du kan närsomhelst avboka eller omboka samtalet. \",\n scheduleInfoBookAnother:\n \"Samtalet är bokat per {{date}}, mellan kl {{start}} - {{end}}. Du kan alltid boka flera samtal.\",\n reschedule: \"Omboka\",\n cancel: \"Avboka\",\n areYouSure: \"Är du säker på att du vill avboka ditt samtal?\",\n yes: \"Ja, avboka\",\n cancelled: \"Samtalet är avbokat\",\n sessionDetails: \"Samtalets detaljer\",\n externalUserInfo: \"Extern användarinformation\",\n copied: \"Kopierad\",\n copyError: \"Kunde inte kopiera\",\n resendEmailToExternalUser:\n \"Är du säker på att du vill skicka e-postmeddelandet igen till den externa användaren?\",\n },\n now: \"Nu\",\n scheduleNew: \"Nytt samtal\",\n counsellors: \"Hej, snacka med mig!\",\n appointments: \"Samtal\",\n seeAll: \"Se alla\",\n notExist: \"Samtalet finns inte\",\n weeksInterval: \"Om {{interval}} veckor\",\n daysInterval: \"Om {{interval}} dagar\",\n dayInterval: \" Om {{interval}} dag\",\n hoursInterval: \" Om {{interval}} timmar\",\n hourInterval: \" Om {{interval}} timme\",\n minutesInterval: \" Om {{interval}} minuter\",\n minuteInterval: \" Om {{interval}} minut\",\n today: \"Idag\",\n future: \"Framtiden\",\n completed: \"Avslutad\",\n cancelled: \"Avbokad\",\n organizationNotWorking: \"Organisationen arbetar inte denna dag\",\n noAppointments: \"Inga samtal här ännu...\",\n scheduleFirst: \"Boka ditt första samtal\",\n yourFreeTime: \"Din tillgänglighet\",\n freeTime: {\n title: \"Din tillgänglighet\",\n addTime: \"Lägg till tid\",\n noFreeTimes:\n \"Här avsätter du dina tillgängliga tider för samtal. Under dessa tider kan du boka in elever på individuella samtal och eleverna kan även boka dig.\",\n allocateTime: \"Bokningsbar tid\",\n startTime: \"Starttid\",\n endTime: \"Sluttid\",\n editTime: \"Redigera tillgänglig tid\",\n add: \"Lägg till\",\n cancel: \"Annullera\",\n date: \"Datum\",\n ends: \"Slutar\",\n orgNotWorking: \"Organisationen har inte öppet\",\n repeats: {\n everyday: \"Varje dag\",\n weeklyOn: \"Varje vecka på {{day}}\",\n weekdays: \"Varje vardag (måndag till fredag)\",\n none: \"Upprepas inte\",\n },\n deleteModal: {\n title: \"Ta bort tillgänglig tid\",\n description: \"Är du säker på att du vill ta bort din tillgängliga tid?\",\n delete: \"Ja, ta bort\",\n },\n timeAdded: \"Din tillgängliga tid lades till\",\n timeEdited: \"Din tillgängliga tid har redigerats\",\n timeDeleted: \"Din tillgängliga tid raderades\",\n },\n customMeeting: \"Välj mötestyp\",\n error: {\n studentOrCounsellor:\n \"Elev eller personal är inte tillgänglig mellan {{data}}\",\n and: \"och\",\n counsellor: \"Personal är inte tillgänglig denna tid\",\n timeError: \"Sluttiden måste vara större än starttiden\",\n minimumTime: \"Samtalet måste vara längre än {{minimumTime}} minuter\",\n currentTime: \"Starttiden måste vara större än aktuell tid\",\n noAvailableTime: \"Elev eller personal är inte tillgänglig för närvarande\",\n },\n invited: \"{{count}} inbjudna\",\n participants: \"{{count}} deltagare\",\n },\n notes: {\n title: \"Anteckningar & rapporter\",\n note: \"Anteckning\",\n report: \"Elevrapport\",\n topics: \"Ämnen\",\n meetingType: \"Mötestyp\",\n meetingKind: \"Mötesplats\",\n meetingDuration: \"Möteslängd\",\n student: \"Elev\",\n generated: \"Genererad\",\n add: \"Skapa anteckning\",\n personNotes: \"{{person}}s anteckningar & rapporter\",\n personNote: \"{{person}}s anteckning\",\n personReport: \"{{person}}s rapport\",\n personStatistics: \"{{person}}s Statistik\",\n create: \"Skapa ny anteckning\",\n saveText:\n \"Skapa minnesanteckningar för eleven, dem är endast synliga för dig och andra med samma profession som dig i elevhälsoteamet.\",\n autoSaveText:\n \"Skapa minnesanteckningar för eleven, dem är endast synliga för dig och andra med samma profession som dig i elevhälsoteamet. Anteckningarna sparas automatiskt. \",\n autoSaveTextDuringVideo:\n \"Skapa minnesanteckningar för eleven, dem är endast synliga för dig och andra med samma profession som dig i elevhälsoteamet. Anteckningarna sparas automatiskt.\",\n metaAppointment:\n \"{{person}} har avslutat ett samtal med {{student}}, {{date}}\",\n metaChat:\n \"{{person}} har avslutat en chattkonversation med {{student}}, {{date}}\",\n createdBy: \"{{date}} av {{person}}\",\n delete: \"Ta bort anteckningen\",\n deleteQuestion: \"Är du säker på att du vill ta bort den här anteckningen?\",\n yes: \"Ja, ta bort\",\n saved: \"Anteckningen har sparats\",\n deleted: \"Anteckningen har raderats\",\n worryLevel: \"Orosnivå\",\n filter: \"Filter\",\n notes: \"Anteckningar\",\n reports: \"Rapporter\",\n isPinned: \"Fäst anteckning\",\n pinnedNotes: \"Den här anteckningen är fäst\",\n isNotPinned: \"Den här anteckningen är inte fäst\",\n isPublic: \"Öppen\",\n isForPublic:\n \"Denna anteckningen är synlig för kollegor med andra professioner\",\n isNotForPublic:\n \"Denna anteckningen är inte synlig för kollegor med andra professioner\",\n publicLabel: \"Öppen\",\n pinnedLabel: \"Fäst\",\n isForReportPublic:\n \"Denna rapport är synlig för kollegor med andra professioner\",\n isReportNotForPublic:\n \"Denna rapport är inte synlig för kollegor med andra professioner\",\n },\n videoCall: {\n leaveCallModal: {\n title: \"Avsluta samtalet\",\n paragraph:\n \"Har du redan gjort ditt samtal? Klicka i så fall på avsluta samtalet och fyll i rapporten. Om inte, klickar du på Lämna samtalet så kan du återgå till samtalet.\",\n leaveCall: \"Lämna samtalet\",\n endCall: \"Avsluta samtalet\",\n },\n videoAccessModal: {\n title: \"Kameran eller mikrofonen är blockerad\",\n description_1:\n \"Allbry kräver åtkomst till din kamera och mikrofon. Klicka på ikonen för blockerad kamera\",\n description_2: \"i webbläsarens adressfält.\",\n leaveCall: \"Lämna samtalet\",\n },\n join: \"Ansluten\",\n notJoin: \"Ej ansluten\",\n },\n chat: {\n end: \"Avsluta chatt\",\n archivedForCounsellor:\n \"Eleven har arkiverat chatten. Det betyder att chatten är rensad för eleven och den ser inte tidigare meddelanden. För att starta om konversationen behöver du bara skriva något.\",\n endInfoForCounsellor:\n \"Chatten avslutades kl {{time}} av dig. Skriv ett meddelande för att starta chattkonversationen på nytt. \",\n noMessages: \"Vad tänker du på?\",\n sendFirstMessage: \"Skriv vad som helst för att börja!\",\n writeMessage: \"Skriv ett meddelande...\",\n endChatQuestion:\n \"Är du säker på att du vill avsluta chatten? Chatten kommer inte försvinna och du kan närsomhelst starta den igen genom att skicka ett nytt meddelande.\",\n attachmentInfo: \"{{fileSize}}, {{date}} kl {{time}}\",\n sharedFiles: \"DELADE FILER\",\n noFiles: \"Inga filer har delats än...\",\n general: \"Alla\",\n messages: \"Meddelanden\",\n chatEnded: \"(Chatt avslutad)\",\n attachment: \"(Bilaga)\",\n image: \"(Bild)\",\n startTitle: \"Vem vill du chatta med?\",\n noStudentsFound: \"Inga elever hittades\",\n notFoundLabels: {\n student: \"Ingen elev hittades\",\n counsellor: \"Ingen elevhälsopersonal hittades\",\n globalCounsellor: \"Ingen global studenthälsopersonal hittades\",\n },\n noStudentsAvailable: \"Inga elever är tillgängliga\",\n noStudentsAvailableToChat:\n \"Det finns inga tillgängliga elever att starta en chatt med\",\n noCounsellorsAvailable: \"Ingen elevhälsopersonal är tillgänglig\",\n noCounsellorsAvailableToChat:\n \"Det finns ingen tillgänglig elevhälsopersonal att starta en chatt med\",\n start: \"Starta chatt\",\n startGroupChat: \"Starta gruppchatt\",\n nameTheGroupChat: \"Namnge gruppchatten\",\n enterGroupName: \"Ange ett namn för gruppchatten\",\n groupName: \"Gruppens namn\",\n more: \"Se mer\",\n selectChat:\n \"Välj en chatt och skicka ett meddelande eller skriv ett nytt meddelande.\",\n archive: \"Arkiverat\",\n delete: \"Ta bort chatt\",\n organizationDoesntWork:\n \"Allbry är inte öppet just nu. Du kan självklart fortfarande skicka ditt meddelande så svarar vi så fort vi kan. Vi har öppet och elevhälsopersonal finns på plats mellan {{start}} och {{end}}.\",\n organizationDoesntWorkToday:\n \"Skolan är stängd över sommaren. Det kommer att ta längre tid att få svar, men på mobilen har du fortfarande tillgång till flera olika stödlinjer.\",\n endInfoForStudent:\n \"Chatten avslutades kl {{time}} av {{person}}. Du kan närsomhelst starta den igen genom att skicka ett nytt meddelande.\",\n sendAfterWork: \"Skicka meddelande utanför Allbrys öppettider\",\n workingHours:\n \"Allbry har öppet mellan {{start}} och {{end}}. Du kan självklart fortfarande skicka ditt meddelande så svarar vi så fort vi kan.\",\n workingHoursToday:\n \"Organisationen har inte öppet idag. Du kan skicka meddelanden utanför arbetstid, observera dock att du får svar inom arbetstid.\",\n ok: \"Jag förstår\",\n deleteChatQuestion: \"Är du säker på att du vill ta bort chatten? \",\n archiveChat: \"Arkivera chatt\",\n unarchiveChat: \"Återställ chatt\",\n deleted: \"Chatten raderad\",\n archived: \"Chatten arkiverad\",\n unarchived: \"Chatten har återställts\",\n deleteGroup: \"Ta bort grupp\",\n modifyGroup: \"Ändra grupp\",\n groupAllMembers: \"Gruppmedlemmar\",\n modifyGroupChat: \"Redigera gruppchatt\",\n editGroupName: \"Ange ett namn för gruppchatten\",\n members: \"Deltagare\",\n confirmToDelete: \"Är du säker på att du vill ta bort gruppen?\",\n confirmToDeleteMember: \"Är du säker på att ta bort vald deltagare?\",\n addNewMember: \"Lägg till deltagare\",\n deleteSelected: \"Ta bort vald deltagare\",\n selectNewMember: \"Välj deltagare\",\n selectClose: \"Välj & stäng\",\n noMembersInGroup:\n \"Det finns inga medlemmar i den här gruppen. Vill du ta bort gruppen?\",\n groupMembers: \"{{value}} deltagare\",\n overview: \"Översikt\",\n notesAndReports: \"Anteckningar & rapporter\",\n statistics: \"Statistik\",\n imageFile: \"Bild eller bilaga\",\n akkImage: \"Bildstöd\",\n read: \"Läst\",\n akk: {\n selectCategory: \"Välj kategori\",\n chooseAkk: \"Välj bilder\",\n send: \"Skicka\",\n noImage: \"Inga bilder hittades\",\n },\n all: \"Alla\",\n students: \"Elever\",\n counsellors: {\n shortName: \"Lokala\",\n fullName: \"Elevhälsopersonal på skolan\",\n },\n globalCounsellors: {\n shortName: \"Globala\",\n fullName: \"Elevhälsopersonal inom organisationen\",\n },\n searchStudent: \"Sök elev\",\n searchCounsellor: \"Sök elevhälsopersonal\",\n searchGlobalCounsellor: \"Sök global elevhälsopersonal\",\n active: \"Registrerad\",\n inactive: \"Inaktiv\",\n deactivated: \"Inaktiverad\",\n successDelete: \"Meddelandet har raderats\",\n counsellorUnavailable: \"Personal är inte tillgänglig\",\n videoCall: \"Videosamtal\",\n confirmVideoCall: \"Är du säker på att du vill starta ett videosamtal?\",\n counsellorInactive: \"Personen arbetar inte längre på skolan\",\n onlyAllbryCanSendMessage: \"Endast {{name}} kan skicka meddelanden\",\n messagesTitleSuperAdmin: \"Meddelanden (tekniska releaser)\",\n showMore: \"Visa mer\",\n },\n reports: {\n createReport: \"Skapa elevrapport\",\n deleteReport: \"Ta bort rapport\",\n deleteReportQuestion: \"Är du säker på att du vill ta bort rapporten?\",\n yes: \"Ja, radera\",\n deleted: \"Rapporten har raderats\",\n title: \"Elevrapport\",\n title2: \"Friviligt steg\",\n selectDate: \"1. Datum\",\n selectTopics: \"2. Vilka ämnen har berörts under samtalet?\",\n concernScale: \"3. Hur orolig är du för eleven?\",\n selectMeetingType: \"4. Vad för typ av samtal har ni haft?\",\n selectMeetingKind: \"5. Hur ägde samtalet rum?\",\n noteComment: \"{{questionNo}}. Anteckning / Kommentar\",\n feedbackAllbry:\n \"{{questionNo}}. Finns det något annat du vill kunna kartlägga? (valfri marknadsundersökning)\",\n additionalSupportQuestionTitle:\n \"{{questionNo}}. Är eleven i behov av ytterligare stöd?\",\n participationThanks: {\n title: \"Tack!\",\n details:\n \"Tack för att du fyllt i elevrapporten. Dessa används för att kunna få insikt i hur eleverna mår och vad dem pratar om för att göra en bra kartläggning av eleverna.\",\n close: \"Stäng\",\n },\n topics: {\n startOfSession: \"Sökt kontakt (startat samtal)\",\n checkIn: \"Check-in\",\n basicCare: \"Grundläggande omsorg\",\n identity: \"Identitet\",\n anxiety: \"Ångest\",\n stress: \"Stress\",\n physicalHealth: \"Fysisk hälsa\",\n training: \"Träning\",\n crime: \"Kriminalitet\",\n sorrow: \"Sorg\",\n socialRelationship: \"Sociala relationer\",\n workLife: \"Arbetsliv\",\n shame: \"Skam\",\n honor: \"Heder\",\n careFailure: \"Omsorgssvikt\",\n economy: \"Ekonomi\",\n security: \"Säkerhet\",\n stimulationAndGuidance: \"Stimulans och vägledning\",\n socialOrientation: \"Samhällsorientering\",\n emotionalAvailability: \"Känslomässig tillgänglighet\",\n love: \"Kärlek\",\n mentalHealth: \"Psykisk hälsa\",\n mentalAbuse: \"Psykisk misshandel\",\n physicalAbuse: \"Fysisk misshandel\",\n loveRelations: \"Kärleksrelationer\",\n familyRelations: \"Familjerelationer\",\n sexualAbuse: \"Sexuellt övergrepp\",\n economicalAbuse: \"Ekonomisk misshandel\",\n drugUse: \"Droganvändning\",\n performanceAnxiety: \"Prestationsångest\",\n loneliness: \"Ofrivillig ensamhet\",\n grooming: \"Grooming\",\n school: \"Skola\",\n education: \"Utbildning\",\n selfHarm: \"Självskadebeteende\",\n suicidalToughts: \"Självmordstankar\",\n religion: \"Religion\",\n politics: \"Politik\",\n sexuality: \"Sexualitet\",\n npfDiagnoses: \"NPF-diagnoser\",\n },\n meetingType: {\n emergencyMeeting: \"Akutmöte\",\n dropInMeeting: \"Drop-in möte\",\n individualMeeting: \"Enskilt möte\",\n noShowMeeting: \"Uteblivet möte\",\n parentMeeting: \"Möte med vårdnadshavare\",\n ehtMeeting: \"Möte med representant från EHT\",\n groupMeeting: \"Gruppmöte med elever\",\n adultMeeting: \"Möte med annan vuxen (t.ex. lärare)\",\n breakMeeting: \"Samtal i korridor eller under rast\",\n adultStudentMeeting:\n \"Samtal med elev, VH, rektor och / eller annan skolpersonal\",\n },\n meetingKind: {\n allbryMeeting:\n \"Bokade du ett fysiskt möte eller videosamtal genom Allbry?\",\n allbryMeetingIfNot: \"Om inte, ange vilken typ av möte du haft\",\n telephone: \"Telefonmöte\",\n digital: \"Digitalt möte\",\n physical: \"Fysiskt möte\",\n },\n addTopic: {\n title: \"Lägg till ämne\",\n name: \"Namn\",\n description: \"Beskrivning\",\n button: \"Lägg till ny\",\n success: \"Ämnet har lagts till\",\n error: \"Det gick inte att lägga till ämne\",\n expandTab: \"Expandera\",\n collapseTab: \"Kollapsa\",\n all: \"Alla\",\n },\n worriedLevel: {\n level0: \"Ingen oro / sökt kontakt\",\n level0_5: \"Risk på väg mot nivå 1 \",\n level1:\n \"Förebyggande / främjande / informerande samtal eller övriga samtal\",\n level1_5: \"Risk på väg mot nivå 2\",\n level2: \"Mild oro – oro som du kan hantera med eleven\",\n level2_5: \"Risk på väg mot nivå 3\",\n level3:\n \"Medel oro - kontakta skolan och uppföljning efter 4 veckor eller hänvisa till BUP / psykiatrin & andra instanser\",\n level3_5: \"Risk på väg mot nivå 4\",\n level4: \"Hög oro – orosanmälan eller liknande\",\n level4_5: \"Risk på väg mot nivå 5\",\n level5: \"Akut oro - agera nu, larma till räddningstjänst eller liknande\",\n details0:\n \"Ingen oro / sökt kontakt \\n\\nIngen oro vid det här stadiet. Eleven har sökt kontakt eller startat ett samtal. \",\n details0_5: \"Risk på väg mot nivå 1.\",\n details1:\n \"Förebyggande / främjande / informerande samtal eller övriga samtal \\n\\nVid den här nivån har elevhälsopersonal haft förebyggande/främjande/informerande samtal eller andra typer av stödsamtal. Exempelvis om vänskapsrelationer, kärlek, framtid och fritid eller mål och drömmar och liknande teman/ämnen.\\n\\nVägledande samtal i samband med exempelvis gymnasieansökan (för grundskoleelever) eller universitetsansökan (för gymnasieelever). \",\n details1_5: \"Risk på väg mot nivå 2.\",\n details2:\n \"Mild oro – oro som du kan hantera med eleven \\n\\nVid den här nivån känner elevhälsopersonal en mild oro för eleven. Det innebär oro där kurator/elevhälsopersonal och elev kan samtala om ämnen/teman utan att behöva meddela andra (tystnadsplikt). Det kan gälla samtal om självkänsla, självförtroende, tidigare trauman, relationer och hälsa och erfarenheter som eleven berättar om.\\n\\nI det här stadiet av oro kan kurator/elevhälsopersonal med sina färdigheter, kunskaper och samtalsmetoder arbeta med eleven och stötta vid olika lägen och situationer. \\n\\nRelationsskapande, förtroende och tillit är viktiga i denna nivå då en elev kanske berättar något i förtroende till elevhälsopersonal som eleven inte vill ska komma ut till någon annan men som ändå behöver hjälp, ett exempel är låg självkänsla, berättar om NPF-diagnoser, utredningar, tidigare kontakt med myndigheter som socialtjänst och BUP eller vuxenpsykiatrin.\\n\\nDet finns en oro för eleven men du som elevhälsopersonal finns som stöd och reder ut oron.\",\n details2_5: \"Risk på väg mot nivå 3.\",\n details3:\n \"Medel oro - kontakta skolan och uppföljning efter 4 veckor eller hänvisa till BUP / psykiatrin & andra instanser \\n\\nDetta är det första steget där elevhälsopersonal ska agera och bryta mot sekretessen (tystnadsplikt). I det här fallet handlar det om att kontakta skolan vid oro kring barnets hälsa (psykisk och fysisk hälsa), skolgång, skolresultat, hemmamiljö, utfrysning och mobbning. Kränkande behandling. Vid första steg kontaktas kurator eller mentor. Eventuellt ett ärende för EHT/EHM att diskutera denna elev exempelvis vid anpassningar, svårigheter i skolan. Uppföljning för eleven sker efter 4 veckor, kurator ansvarar för uppföljning.\",\n details3_5: \"Risk på väg mot nivå 4.\",\n details4:\n \"Hög oro – orosanmälan eller liknande \\n\\nUtifrån Socialstyrelsens styrdokument samt anmälningsskyldighet enligt SoL 14kap 1§ & SkolL 29kap 13§, skyldighet att anmäla vid kännedom eller misstanke om att barn far illa. Elevhälsopersonal meddelar eleven (och föräldrarna i vissa fall) och informera om att en orosanmälan görs och varför den görs. Skolan skall alltid vara informerade. En orosanmälan görs vanligtvis i samarbete med rektor.\\n\\nSocialstyrelsens (2013) definition av begreppet ”barn som far illa” ur Barn som far illa eller riskerar att fara illa. En vägledning för hälso- och sjukvården samt tandvården gällande anmälningsskyldighet och ansvar.\\n\\n”Begreppet barn som far illa innefattar alla former av övergrepp, försummelse och utnyttjande som leder till faktisk eller potentiell skada för barnets hälsa eller utveckling. Det kan till exempel avse barn och ungdomar som i hemmet utsätts för fysiskt eller psykiskt våld, sexuella övergrepp, kränkningar eller problem i förhållande till sin familj, likaså om det blir vittne till våld eller lever i en miljö där våld och hot om våld förekommer. Vidare ingår barn och ungdomar som far illa på grund av sitt eget beteende, exempelvis på grund av missbruk, kriminalitet och annat självdestruktivt beteende. Barn som utsätts för hot, våld eller andra övergrepp från jämnåriga eller från andra, samt barn med stora problem i skolsituationen föranledda av en social problematik kan också anses ingå i socialtjänstens målgrupp.””Begreppet barn som far illa innefattar alla former av övergrepp, försummelse och utnyttjande som leder till faktisk eller potentiell skada för barnets hälsa eller utveckling. Det kan till exempel avse barn och ungdomar som i hemmet utsätts för fysiskt eller psykiskt våld, sexuella övergrepp, kränkningar eller problem i förhållande till sin familj, likaså om det blir vittne till våld eller lever i en miljö där våld och hot om våld förekommer. Vidare ingår barn och ungdomar som far illa på grund av sitt eget beteende, exempelvis på grund av missbruk, kriminalitet och annat självdestruktivt beteende. Barn som utsätts för hot, våld eller andra övergrepp från jämnåriga eller från andra, samt barn med stora problem i skolsituationen föranledda av en social problematik kan också anses ingå i socialtjänstens målgrupp.”\",\n details4_5: \"Risk på väg mot nivå 5.\",\n details5:\n \"Akut oro - agera nu, larma till räddningstjänst eller liknande \\n\\nAgera genast. Vid det här stadiet är det omedelbar fara för elevens liv eller hälsa, eller andra situationer där action måste genomföras genast. Ring 112. Kontakta räddningstjänst. Det kan vara att en elev skriver att den skall genomföra ett självmordsförsök, begå ett brott eller utsätta sig själv eller någon annan i omedelbar fara. \",\n title: \"Information nivå \",\n },\n types: {\n quick: {\n title: \"Snabb\",\n description: \"Endast ett begränsat antal ämnen\",\n selectTopics: \"1. Välj ämnet i konversationen\",\n selectMeetingKind: \"2. Hur ägde samtalet rum?\",\n },\n normal: {\n title: \"Normal\",\n description: \"Rapport i full längd\",\n },\n },\n additionalSupport: {\n youthReception: \"Ungdomsmottagning\",\n socialServices: \"Socialtjänst\",\n medicalAndHealthcare: \"Sjuk- och hälsovård\",\n },\n statistics: {\n additionalSupport: \"Ytterligare stöd\",\n },\n },\n principal: {\n validation: {\n notEmpty: \"Värdet kan inte vara tomt\",\n noSpaces: \"Värdet kan inte ha mellanslag\",\n lessThan30Symbols: \"{{value}} bör vara mindre än 30 tecken\",\n exists: \"Attributet finns redan\",\n ageLessThan8: \"Din ålder får inte vara lägre än 8 år\",\n ageLessThan18: \"Din ålder får inte vara lägre än 18 år\",\n required: \"{{value}} krävs\",\n requiredName: \"Namn krävs\",\n requiredEmail: \"E-postadress krävs\",\n notValidEmail: \"Inte giltig e-postadress\",\n },\n addCustomField: \"Lägg till ett anpassat fält\",\n overview: \"{{name}} Översikt\",\n schedule: \"Verksamhetsschema\",\n addCustomAttributes: \"Lägg till anpassade attribut\",\n customFieldsDescription:\n \"Du kan mäta och följa upp olika attribut, t.ex. årskurs eller klass.\",\n anonymous:\n \"Eleverna i din organisation får vara anonyma. Deras namn och profilbilder kommer att vara dolda för andra användare.\",\n removeChatTitle: \"Ta bort chattar\",\n removeChatDescription:\n \"Elever i din organisation får ta bort chattar med elevhälsopersonal.\",\n archiveChatTitle: \"Arkivera chattar\",\n archiveChatDescription:\n \"Eleverna i din organisation får arkivera chattar med elevhälsopersonal.\",\n addCustomMeetingTypes: \"Skapa anpassade mötestyper\",\n addMeetingType: \"Skapa anpassad mötestyp\",\n createMeetingType: \"Skapa mötestyp\",\n editMeetingType: \"Redigera mötestyp\",\n chooseMeetingTypeEN: \"Ange mötestypens namn på engelska\",\n chooseMeetingTypeSW: \"Ange mötestypens namn på svenska\",\n meetingDescriptionSW: \"Ange en beskrivning på svenska\",\n meetingDescriptionEN: \"Ange en beskrivning på engelska\",\n videoEnable: \"Video aktiverat\",\n meetingCreated: \"Mötestypen är skapad\",\n errorCreateMeeting: \"Det gick inte att skapa mötestypen\",\n updatedMeeting: \"Mötestypen är ändrad\",\n errorUpdatingMeeting: \"Det gick inte att uppdatera mötestypen\",\n removeMeeting: \"Mötestypen är borttagen\",\n errorRemovingMeeting: \"Det gick inte att radera mötestypen\",\n MeetingNameRequired: \"Namn på mötestypen är obligatoriskt\",\n confirmRemoveMeeting: \"Är du säker på att du vill ta bort mötestypen?\",\n removePopup: \"Är du säker på att du vill ta bort mötestypen?\",\n video: \"Video\",\n editMeeting: \"Redigera\",\n to: \"Till\",\n from: \"Från\",\n workingHours: \"Arbetstid\",\n custom: \"Anpassad\",\n weekDays: \"Veckodagar\",\n allDays: \"Alla dagar\",\n appointmentTypeDescription:\n \"Den initiala Videomötestypen försvinner om en ny videomötestyp läggs till\",\n sessionDuration: \"Välj samtalets varaktighetstid\",\n sessionDurationNote:\n \"Notera: Se till att du gör ett val, eftersom om inget alternativ är valt så kommer standardalternativen 20 minuter och 50 minuter väljas\",\n days: {\n monday: \"Måndag\",\n tuesday: \"Tisdag\",\n wednesday: \"Onsdag\",\n thursday: \"Torsdag\",\n friday: \"Fredag\",\n saturday: \"Lördag\",\n sunday: \"Söndag\",\n },\n startLaterThanEnd: \"Starttiden är senare än sluttiden\",\n endBeforeStart: \"Sluttiden är före starttiden\",\n edit: \"Redigera användare\",\n add: \"Lägg till användare\",\n student: \"Elev\",\n counsellor: \"Kurator\",\n allbryCounsellor: \"Allbry Kurator\",\n userCreated: \"Användaren skapades framgångsrikt.\",\n errorCreatingUser: \"Fel vid skapande av användaren\",\n userUpdated: \"Användaren uppdaterades framgångsrikt.\",\n errorUpdatingUser: \"Fel vid uppdatering av användaren\",\n userTable: {\n viewProfile: \"Visa profil\",\n editProfile: \"Redigera profil\",\n users: \"användare\",\n active: \"Registrerad\",\n inactive: \"Inaktiv\",\n deactivated: \"Inaktiverad\",\n nameSurname: \"Namn Efternamn\",\n birthday: \"Födelsedatum\",\n organization: \"Organisation\",\n activate: \"Aktivera\",\n deactivate: \"Inaktivera\",\n profileActivated: \"Profil aktiverad\",\n profileDeactivated: \"Profilen är inaktiverad\",\n activatingError: \"Fel vid aktivering av profil\",\n deactivatingError: \"Fel vid avaktivering av profil\",\n generateCsvTemplate: \"Generera csv-mall\",\n generateXlsxTemplate: \"Generera xlsx-mall\",\n importUsers: \"Importera användare från xls eller xlsx\",\n csvImportTitle: \"Import pågår\",\n csvImportBody:\n \"Det kan ta lite tid att importera användare. Stäng inte fönstret\",\n importButton: \"Importera\",\n selectFiles: \"Välj den fil som ska importeras\",\n importTitle: \"Importera användare\",\n usersAddSuccess: \"Användare har lagts till\",\n usersAddError: \"Fel vid import av användare\",\n wrongFormat: \"Filformatet ska vara xls eller xlsx\",\n wrongImportData: \"Fel i rad {{row}}! Kontrollera filen\",\n onboardingEmailDialogInstruction:\n \"Du kommer att skicka onboardingmejl till följande användare\",\n inActivateMultipleUserDialogInstruction:\n \"Du kommer att inaktivera följande användare\",\n scrapeMultipleUserDialogInstruction:\n \"Du kommer att ta bort följande användare\",\n sendEmail: \"Skicka mejl\",\n onboardingEmail: \"Onboardingmejl\",\n customEmail: \"Anpassat mejl\",\n disableStudent: \"Inaktivera elever\",\n disableUser: \"Inaktivera användare\",\n actions: \"Åtgärder\",\n usersDelete: \"Ta bort användare\",\n requestScrapeSuccess: \"Användarna är borttagna\",\n changeAttributesSuccessMessage: \"Attribut har ändrats\",\n changeAttributes: \"Ändra attribut\",\n deactivatedSuccessMessage: \"Användaren är inaktiverad\",\n },\n csv: {\n custom: \"Fyll i ett anpassat attribut\",\n email: \"Fyll i personens e-postadress\",\n role: \"Fyllnadsnummer: 1 - studerande, 2 - rådgivare\",\n gender: \"Fyllnadsnummer: 1 - man, 2 - kvinna, 3 - annan\",\n year: \"Födelseår\",\n month: \"Födelsemånad (nummer)\",\n day: \"Födelsedag\",\n nameSurname: \"Fyll i personens namn och efternamn\",\n dateOfBirth: \"Födelsedatum: yyyymmdd\",\n fillNumber: \"Ange nummer\",\n workSheetName: \"Blad 1\",\n },\n usersOrganization: \"{{name}} Användare\",\n addUserButton: \"Lägg till användare\",\n about: \"Om mig\",\n user: {\n role: \"Roll\",\n email: \"E-postadress\",\n status: \"Status\",\n forcePassword: \"Tvinga lösenord\",\n attribute: \"Attribut\",\n attributeDescription:\n \"Du kan välja ett till flera attribut. \\n\\nDet betyder att endast elever med minst ett av de valda attributen kan kommunicera med dig. Du kan fortfarande kommunicera med samtliga elever. \\nOm du inte väljer några attribut kan alla elever se dig.\\n\",\n },\n enterFieldName: \"Ange fältnamn (t.ex. klass)\",\n result: \"{{value}} resultat\",\n results: \"{{value}} resultat\",\n noResults: \"Inga resultat\",\n day: \"Dag\",\n month: \"Månad\",\n year: \"År\",\n statistic: {\n title: \"Statistik\",\n calendar: \"Kalender\",\n today: \"Idag\",\n last7Days: \"Senaste 7 dagarna\",\n last30Days: \"Senaste 30 dagarna\",\n last90Days: \"Senaste 90 dagarna\",\n thisWeek: \"Vecka\",\n thisMonth: \"Månad\",\n thisQuarter: \"Kvartal\",\n thisYear: \"År\",\n allTime: \"Historiskt\",\n userTypes: \"Användartyper\",\n notFound: \"Ingen statistik hittades\",\n topics: \"Elevrapporter\",\n amountOfReports: \"Antal rapporter\",\n experience: \"Orosnivå\",\n counselling: \"Samtalsbokningar\",\n popularTimes: \"Populära tider\",\n ngoClicks: \"Stödlinjer\",\n usersAmount: \"{{amount}} användare\",\n levelOfWorry: \"Nivå av oro\",\n chats: \"Chattar\",\n video: \"Video\",\n other: \"Annat\",\n appointments: \"Samtal\",\n all: \"Alla\",\n without0: \"Faktisk oro\",\n without0tooltip:\n \"Aktiverad: Genomsnittlig orosnivå visas för de samtal där det faktiskt har angivits att det finns en oro. \\nAvvaktiverad: Genomsnittlig orosnivå för alla samtal visas även där oro inte upplevts.\",\n allTitle: {\n users: \"{{value}} användare\",\n user: \"{{value}} användare\",\n times: \"{{value}} konversationer\",\n time: \"{{value}} konversation\",\n redirection: \"{{value}} hänvisningar\",\n redirections: \"{{value}} hänvisningar\",\n },\n registered: \"Registrerade\",\n inactive: \"Inaktiva\",\n active: \"Registrerade & aktiva\",\n todayInterval: \"Idag {{start}} - {{end}}\",\n pdfExport: \"Exportera som PDF\",\n chartTitle: \"Samtal\",\n student: \"Elevstatistisk\",\n internal: \"Intern EHT statistisk\",\n totalHours: \"Totalt antal timmar\",\n showAll: \"Visa allt\",\n showLess: \"Visa mindre\",\n anonymousUsersCount: \"Antal anonyma användare - {{count}}\",\n selectTopicsCategories: \"Välj ämneskategorier\",\n includeMeetingKind: \"Inkludera manuella rapporter\",\n moreThanOneChatCountAverage:\n \"Genomsnittligt antal chattar för elever som chattat mer än en gång:\",\n oneChatCountPercentage: \"Antal elever som endast chattat en gång:\",\n },\n internalStatistic: {\n time: \"Tid per grupp\",\n total: \"Totalt\",\n hours: \"timmar\",\n },\n changeAttributesNotes:\n '- Om du vill ändra attribut, välj och visa inmatningsrutan för att skriva din ändring, tryck sedan på \"Spara\"-knappen för att spara ändringarnarna. \\n - Om du bara väljer attribut utan att fylla i ett nytt värde och trycker på \"Spara\"-knappen kommer du att radera attributet. \\n - Om du vill lägga till ett nytt attribut, skriv ditt nya attribut och tryck sedan på \"Spara\"-knappen. ',\n },\n admin: {\n title: \"Allbry Admin\",\n modals: {\n addCounsellors: {\n choose: \"Välj elevhälsopersonal\",\n search: \"Sök elevhälsopersonal\",\n },\n },\n organization: {\n organizations: \"organisationer\",\n edit: \"Redigera organisationen\",\n details: \"Uppgifter om organisationen\",\n closed: \"Stängt\",\n start: \"Startdatum\",\n end: \"Slutdatum\",\n principal: \"Huvudansvarig\",\n principals: \"Huvudmännen\",\n create: \"Skapa en organisationen\",\n view: \"Visa\",\n editPopup: \"Redigera\",\n deactivated: \"Organisationen inaktiverad\",\n deactivatedError: \"Fel vid avaktivering av organisationen\",\n name: \"Organisationens namn\",\n startEnd: \"Startdatum/Slutdatum\",\n addPrincipal: \"+ Lägg till huvudansvarig\",\n addCounsellor: \"+ Lägg till elevhälsopersonal\",\n searchOrganizations: \"Sök efter organisationer med namn\",\n edited: \"Organisationen redigerades framgångsrikt.\",\n created: \"Organisationen skapades framgångsrikt.\",\n createdError: \"Fel i att skapa en organisation\",\n editError: \"Fel i redigeringen av organisationen\",\n longName: \"För långt namn\",\n startDateRequired: \"Startdatum krävs\",\n endBeforeStart: \"Slutdatum kan inte vara före startdatum\",\n longEmail: \"För långt e-postadress\",\n emailFormat: \"Fel e-postformat\",\n duplicateEmails: \"Dubbla e-postmeddelanden\",\n userExists: \"Användaren finns redan\",\n atLeastOne: \"Minst en av dem måste vara aktiv.\",\n subscriptionType: {\n title: \"Subscription types\",\n description:\n \"Your organization bla bla description for the feature allows you to be anonymous. Your name and profile image will be hidden from other users\",\n addLink: \"+ Add feature or type\",\n selectType: \"Select type\",\n registrationCode: \"Registration code\",\n add: \"Add\",\n remove: \"Remove\",\n addDialogTitle: \"Add subscription type\",\n addSuccess: \"Subscription type has been added successfully\",\n removeSuccess: \"Subscription type has been removed successfully\",\n },\n deleteOrganization: \"Ta bort organisation\",\n requestScrapeSuccess: \"Du har tagit bort organisationen\",\n scrapeMultipleOrganizationDialogInstruction:\n \"Du kommer att ta bort följande organisation\",\n },\n role: {\n title: \"Roller\",\n addRoles: \"+ Lägg till roll\",\n createRole: \"Skapa roll\",\n editRole: \"Ändra roll\",\n chooseMasterRole: \"Välj master roll\",\n enterNameRoleSwedish: \"Ange namn på roll svenska\",\n enterNameRoleEnglish: \"Ange namnet på rollen engelska\",\n chooseFeatures: \"Välj funktioner\",\n selectMasterRole: \"Välj master roll\",\n customRolesCreated: \"Rollen är skapad\",\n errorCreatecustomRoles: \"Fel vid skapandet av rollen\",\n updatedcustomRoles: \"Rollen är uppdaterad\",\n errorUpdatingcustomRoles: \"Fel vid uppdatering av rollen\",\n removecustomRoles: \"Rollen är borttagen\",\n errorRemovingcustomRoles: \"Fel vid borttag av rollen\",\n confirmRemovecustomRoles: \"Är du säker på att du vill ta bort rollen?\",\n rolesRequired: \"Roller är obligatoriskt\",\n rolesSelectRequired: \"Skapa minst en roll\",\n chooseFeaturesOne: \"Välj minst en funktion\",\n sessionTimeRequired: \"Sessionstid krävs\",\n sessionTimeNumber: \"Sessionstiden ska vara nummer\",\n sessionTimeMin: \"Sessionstiden bör vara längre än 1 timme\",\n sessionTimeTitle: \"Sessionstid\",\n },\n counsellors: {\n title: \"Kurator i Allbry\",\n add: \"Lägg till kurator\",\n edit: \"Redigera kurator\",\n profile: \"Personalens profil\",\n searchCounsellors: \"Sök efter rådgivare med namn\",\n },\n ftpDataCollection: {\n title: \"FTP Data Collection\",\n selectOrganizations: \"Select Organization\",\n runCron: \"Run Now\",\n cronRunStart:\n \"Data migration process started for the selected organization. You will be received an email shortly\",\n },\n configData: {\n title: \"Config Data\",\n addConfig: \"Add Config\",\n organization: \"Organization\",\n migrationTime: \"Migration Time\",\n status: \"Status\",\n active: \"Active\",\n deactivate: \"Deactivated\",\n viewProfile: \"View Config\",\n editProfile: \"Edit Config\",\n organizationActivated: \"Organization Activated\",\n organizationDeactivated: \"Organization Deactivated\",\n activatingError: \"Error activating Organization\",\n deactivatingError: \"Error deactivating Organization\",\n configDetails: \"{{organization}}'s Config Details\",\n timerNotSet: \"Timer Not Set\",\n yes: \"Yes\",\n no: \"No\",\n },\n configForm: {\n title: \"Config Form\",\n addOrgConfig: \"Add organization Config\",\n editOrgConfig: \"Edit organization Config\",\n ftpConfigDetails: \"FTP Config Details\",\n organization: \"Organization\",\n runOnce: \"Run Single Time\",\n timer: \"Timer\",\n daily: \"Every Midnight\",\n weekly: \"Every Sunday Midnight\",\n monthly: \"Every 1st Of Month Midnight\",\n selectTimer: \"Select Timer\",\n subOrganization: \"Sub Organization\",\n addOrganization: \"+ Add Organization\",\n selectOrganizations: \"Select Organization\",\n userModel: \"User Models\",\n addModel: \"+ Add Model\",\n student: \"Student\",\n attribute: \"Attribute\",\n userAttributes: \"User Attribute\",\n addAttribute: \"+ Add Attribute\",\n selectAttributes: \"Select Attribute\",\n name: \"Name\",\n code: \"Code\",\n host: \"Host Name\",\n username: \"Username\",\n password: \"Password\",\n port: \"Port\",\n secure: \"Secure\",\n fileName: \"File Name\",\n fileFormat: \"File Format\",\n filePath: \"File Path\",\n true: \"True\",\n false: \"False\",\n fileNameEx: 'Ex: File name is \"latest\" or create \\nyour custom file name',\n filePathEx: 'Ex: File path is \"/\" ',\n userModelNameEx: 'Ex: name is \"student/counsellor\"',\n userModelCodeEx: 'Ex: code is \"student/counsellor\"',\n edit: \"Edit Config\",\n nameRequired: \"Name is required\",\n codeRequired: \"Code is required\",\n selectRequired: \"Select any one\",\n configRequired: \"{{name}} is required\",\n },\n notifications: {\n notificationDate: \"Datum\",\n title: \"Notifikationer\",\n message: \"Meddelande\",\n activeInactive: \"Aktiv / Inaktiv\",\n status: \"Status\",\n all: \"Alla\",\n sent: \"Skickat\",\n upcoming: \"Kommande\",\n vieweditNotifications: \"Se / ändra notis\",\n deleteNotifications: \"Ta bort notis\",\n createNotification: \"Skapa notis\",\n notificationDateAndTime: \"Datum och tid\",\n notificationMessage: \"Meddelande\",\n notificationMessagePlaceholder: \"Ange ett aviseringsmeddeland\",\n allOrganization: \"Alla organisationer\",\n selectOrganization: \"Välj organisation\",\n add: \"Lägg till\",\n popup: \"Är du säker på att du vill ta bort notisen?\",\n selectRequired: \"Välj minst en organisation\",\n messageValidation: \"Meddelandet får inte vara tomt\",\n createdNotification: \"Notisen är skapad\",\n removeNotification: \"Notisen är borttagen\",\n editNotification: \"Notisen är ändrad\",\n errorCreateNotification: \"Fel vid skapandet av notisen\",\n errorErrorNotification: \"Fel vid ändring av notisen\",\n },\n superActions: {\n title: \"Super Actions\",\n userLoginWithEmail: \"Logga in med e-postadress\",\n loginButton: \"Logga in\",\n emailInput: \"E-postadress\",\n },\n broadcastMessages: {\n createdBroadcastMessage: \"Sändningsmeddelande skapades framgångsrikt\",\n updatedBroadcastMessage: \"Broadcast-meddelandet har uppdaterats\",\n removedBroadcastMessage: \"Broadcast-meddelandet har tagits bort\",\n deleteBroadcastMessageConfirmation:\n \"Är du säker på att du vill radera denna post?\",\n deleteBroadcastMessageError:\n \"Du kan inte radera denna post men kan avaktivera den\",\n editBroadcastMessage: \"Redigeringen av sändningsmeddelandet lyckades\",\n errorCreateBroadcastMessage:\n \"Ett fel uppstod när sändningsmeddelandet skapades\",\n errorUpdateBroadcastMessage: \"Fel vid uppdatering av sändningsmeddelande\",\n errorRemoveBroadcastMessage:\n \"Fel när sändningsmeddelandet skulle tas bort\",\n allOrganizations: \"Alla organisationer\",\n selectOrganization: \"Välj Organisation\",\n active: \"Aktiva\",\n inActive: \"Inaktiv\",\n edit: \"Redigera\",\n delete: \"Radera\",\n create: {\n startDate: \"Start datum\",\n endDate: \"Slutdatum\",\n enterHeading: \"Ange rubrik\",\n message: \"Ange meddelande\",\n newsAndMarketingMessage: \"Nyheter och marknadsföringsmeddelande\",\n add: \"Lägg till\",\n heading: \"Rubrik\",\n userTypes: \"Användartyper\",\n selectUserTypes: \"Välj Användartyp\",\n },\n userTypes: {\n counsellor: \"Rådgivare\",\n student: \"Studerande\",\n },\n listingColumn: {\n heading: \"Rubrik\",\n message: \"Meddelande\",\n startDate: \"Start datum\",\n endDate: \"Slutdatum\",\n userType: \"Användartyp\",\n status: \"Status\",\n },\n },\n },\n allbryCounsellor: {\n choose: \"Välj organisation\",\n notFound: \"Ingen organisation hittad...\",\n text: \"Du har inte lagts till i någon organisation ännu.\",\n error: \"Fel när du försöker logga in i organisationen\",\n },\n filterModal: {\n filter: \"Filter\",\n addFilter: \"Lägg till filter\",\n description: \"Visa användare som uppfyller alla villkor:\",\n addCondition: \"+ Lägg till fler\",\n is: \"är\",\n isNot: \"är inte\",\n chooseFilter: \"Välj filter\",\n conditionValue: \"Ange villkorets värde\",\n },\n counsellorReport: {\n tabs: {\n reportTemplates: \"Rapportmallar\",\n reports: \"Rapporter\",\n },\n reports: \"Rapporter\",\n reportTemplate: {\n studentReport: \"Elevrapport\",\n studentReportDescription: \"Skapa en elevrapport\",\n studentNote: \"Minnesanteckning\",\n studentNoteDescription: \"Skapa en minnesanteckning för en elev\",\n internalReport: \"EHT rapport\",\n internalReportDescription: \"Skapa en intern EHT rapport\",\n anonymousReport: \"Anonym elevrapport\",\n anonymousReportDescription: \"Skapa en anonym elevrapport\",\n },\n internalReport: {\n selectTypes: \"2. Välj typ av möte\",\n selectFilter: \"3. Välj grupp om relevant (ej obligatorisk)\",\n meetingDuration: \"5. Mötets varaktighet (i timmar)\",\n meetingNotes: \"4. Skriv en kort sammanfattning av mötet\",\n meetingNoteTitle: \"Anteckningar\",\n meetingTypes: {\n type1: \"EHT\",\n type2: \"EHM\",\n type3: \"Samverkanssmöte SIP\",\n type4: \"Samverkansmöte med VH, skolpersonal med flera\",\n type5: \"Samverkanssmöte BUP\",\n type6: \"Samtal med VH, elever & annan aktör\",\n type7: \"Samtal med elev och VH\",\n type8: \"Samtal med VH\",\n type9: \"Samtal med elev och skolpersonal\",\n type10: \"Samtal med VH och annan aktör\",\n type11: \"Mötessamverkan\",\n type12: \"Närvaroarbete\",\n type13: \"Handledning av skolpersonal\",\n type14: \"Möte med skolpersonal\",\n type15: \"Möte med rektor\",\n type16: \"Medverkan i utvecklingsarbete\",\n type17: \"Medverkan i trygghetsarbete\",\n type18: \"Arbete med elevgrupp\",\n },\n staticAttributes: {\n attributeName: {\n attribute1: \"Stadie\",\n },\n attributeValue: {\n attribute1value1: \"Lågstadie\",\n attribute1value2: \"Mellanstadie\",\n attribute1value3: \"Högstadie\",\n attribute1value4: \"Gymnasie\",\n },\n },\n },\n anonymousReport: {\n title: \"Anonym elevrapport\",\n selectAttributeTitle: \"1. Välj klass/årskurs (valfritt)\",\n gender: \"2. Könsidentitet (ej obligatoriskt)\",\n studentName: \"3. Ange elevens namn (ej obligatoriskt)\",\n },\n chooseStudent: \"Välj elev\",\n createReport: \"Skapa elevrapport\",\n createNote: \"Skapa minnesanteckning\",\n searchStudents: \"Sök efter elev\",\n filterOption: {\n notes: \"Anteckningar\",\n quickReport: \"Elevrapporter\",\n internalReport: \"Interna rapporter\",\n anonymousReport: \"Anonyma rapporter\",\n },\n showMore: \"Visa mer...\",\n },\n survey: {\n introStep: \"Hej, låt oss börja med två snabba frågor!\",\n firstStep: {\n question: \"Är det första gången du använder Allbry?\",\n letMeIn: \"Nej, jag har använt Allbry förut\",\n whatIsAllbry: \"Ja, det är första gången\",\n },\n secondStep: {\n question: \"Har du sökt stöd tidigare?\",\n yes: \"Ja, minst ett par gånger\",\n never: \"Nej, det har jag inte\",\n },\n genderStep: {\n question: \"Med vilket kön identifierar du dig mest?\",\n male: \"Man\",\n female: \"Kvinna\",\n other: \"Annat\",\n private: \"Vill inte svara\",\n },\n outroStep: \"Tack för din tid!\",\n helpImprove: \"Det kommer bara ta en minut och frågorna är helt anonyma!\",\n firstPart: \"1/2\",\n secondPart: \"2/2\",\n checkInAndSurvey: \"Tempen\",\n tabOption: {\n template: \"Mallar\",\n active: \"Aktiva\",\n statistics: \"Statistik\",\n },\n create: {\n title: \"Skapa mall\",\n name: \"Namn\",\n accessType: \"Åtkomsttyp\",\n accessTypeOptions: {\n global: \"Global\",\n local: \"Lokal\",\n },\n surveyType: \"Undersökningstyp\",\n surveyTypeOptions: {\n checkIn: \"Check-in\",\n survey: \"Enkät\",\n },\n isPublic: \"är offentlig\",\n isActive: \"Är aktiv\",\n },\n createConfig: {\n title: \"Konfigurationsmallar\",\n Survey: \"Enkätmall\",\n Account: \"Organisation\",\n attributes: \"Attribut\",\n select: \"-Välj-\",\n runsDay: \"Kör varje dag\",\n runsWeekly: \"Kör varje\",\n runsMonthly: \"Kör varje {{date}}:e i månaden\",\n timerOption: {\n daily: \"Dagligen\",\n weekly: \"Varje vecka\",\n monthly: \"En gång i månaden\",\n weekDays: {\n monday: \"Måndag\",\n tuesday: \"Tisdag\",\n wednesday: \"Onsdag\",\n thursday: \"Torsdag\",\n friday: \"Fredag\",\n saturday: \"Lördag\",\n sunday: \"Söndag\",\n },\n },\n modals: {\n students: {\n title: \"Eget urval\",\n chooseStudentTitle: \"Vilka vill du ta tempen på?\",\n selectedStudents: \"Valda elever\",\n confirmSelection: \"Bekräfta urval\",\n searchPlaceholder: \"Sök efter elev\",\n noStudentsFound: \"Inga elever hittades\",\n },\n },\n addOwnUsers: \"+ Lägg till dina egna användare\",\n addedOwnUsers: \"Lade till {{count}} egna användare\",\n },\n template: {\n createTemplate: \"Mall skapades\",\n errorCreateTemplate: \"Fel när mallen skapades\",\n deleteTemplate: \"Mallen har tagits bort\",\n deleteTemplateConfirmation:\n \"Är du säker på att du vill ta bort denna mall ?\",\n deleteTemplateError:\n \"Du kan inte ta bort den här mallen men kan avaktivera den\",\n deleteConfigError:\n \"Du kan inte ta bort den här konfigurationen men kan avaktivera den\",\n errorDeleteTemplate: \"Fel vid borttagning av mall\",\n editTemplate: \"Mallredigering lyckades\",\n errorEditTemplate: \"Fel vid redigering av mall\",\n createConfig: \"Tempen skapades framgångsrikt\",\n errorCreateConfig: \"Fel när konfigurationen skapades\",\n active: \"aktiva\",\n inActive: \"inaktiv\",\n true: \"Sann\",\n false: \"falsk\",\n timer: \"Timer\",\n RunOnce: \"Kör en gång\",\n StartTime: \"Starttid\",\n EndTime: \"Sluttid\",\n TimeLimitInHour: \"Tidsgräns i timme\",\n editTemplate: \"Mallredigering lyckades\",\n errorEditTemplate: \"Fel vid redigering av mall\",\n typeChangeDescription:\n \"Vi ser att du har några ändringar på undersökningsmallar.\\n Är du säker på att du vill ändra?\\n Om du ändrar undersökningstyp kommer alla ändringar att ignoreras.\",\n active: \"aktiva\",\n inActive: \"inaktiv\",\n btn: {\n delete: \"Ta bort\",\n edit: \"Redigera\",\n statistics: \"Statistik\",\n addImage: \"Bild till frågan\",\n },\n listingColumn: {\n name: \"Namn\",\n accessType: \"Åtkomsttyp\",\n surveyType: \"Undersökningstyp\",\n public: \"Offentlig\",\n questionAmount: \"Frågebelopp\",\n status: \"Status\",\n attributes: \"Användarattribut\",\n organization: \"organisations namn\",\n isAnonymous: \"är anonym\",\n action: \"Handling\",\n StartDate: \"Start datum\",\n EndDate: \"Slutdatum\",\n },\n questionType: {\n filling: \"Allbry\",\n rangSlider: \"Range slider\",\n singleSelect: \"Enstaka val\",\n image: \"Bild\",\n },\n createTemplateAboutDescription:\n \"Se videon nedan för instruktioner om hur du skapar en mall\",\n createTemplateAboutTitle: \"Beskrivning\",\n duplicate: \"Duplicera\",\n copyText: \"Kopiera\",\n addImages: \"Lägg till bilder\",\n },\n student: {\n question: \"Fråga\",\n stripMas: \"Din skola vill ta tempen!!\",\n questionnaire: \"Enkät\",\n completeHeading: \"Tack för dina svar!\",\n completeDescription: \"Enkäten har skickats in.\",\n completeBackButton: \"Tillbaka till hemskärmen\",\n startSurvey: \"Påbörja enkäten\",\n skipQuestion: \"Jag vill inte svara\",\n SkipMas: \"Är du säker på att du inte vill svara?\",\n notAnonymousAnswerDescription:\n \"Enkäten är inte anonym och elevhälsan kan ta del av individuella svar\",\n },\n statistics: {\n noAnyTemplate: \"Du har inga mallar\",\n all: \"Alla\",\n ended: \"Avslutad\",\n started: \"Startad\",\n date: \"Datum\",\n AmountOfAnswers: \"Antal svar\",\n noOFUsers: \"Antal elever\",\n question: \"frågor\",\n thisMonth: \"Denna månad\",\n unanswered: \"Obesvarad\",\n status: {\n new: \"Ny\",\n complete: \"Avslutad\",\n active: \"Aktiv\",\n },\n showAll: \"Visa allt\",\n showLess: \"Visa mindre\",\n response: \"svar\",\n days: \"dagar\",\n weekNumbers: \"Veckans nummer\",\n months: \"månader\",\n students: \"Elever\",\n noAnyoneAnswered: \"Inga elever har besvarat denna enkät än\",\n answer: \"Svar\",\n deepFilter: \"Djupfiltrering\",\n averageValue: \"Medelvärde: {{value}}\",\n multiple: \"(Flera olika)\",\n guestUserLink: \"Gästanvändarlänk\",\n showGuestUserData: \"Visa gästanvändardata\",\n guestUsers: \"gästanvändare\",\n filterInfo: \"Om ett filter tillämpas så visas inte gästanvändardata\",\n showGuestUserDataDisabledContent:\n \"Det går inte att visa gästanvändardata om ett filter tillämpas.\",\n amountOfCustomStudents: \"Manuellt valda elever\",\n numberOfCustomStudents: \"Antal manuellt valda elever\",\n anonymousResponse: \"Svar #{{number}}\",\n responses: \"Svar\",\n students: \"Elever\",\n noAnyoneAnswered: \"Ingen har svarat än\",\n },\n counsellor: {\n titles: { survey: \"Enkät\", checkIn: \"Check-in\" },\n readMoreDifferenceModalTitle: \"Skillnad\",\n checkInDescription: \"En återkommande enkät med frågor som ställs med jämna mellanrum enligt valt tidsintervall. Den används för att kontinuerligt samla in data, identifiera trender och följa förändringar över tid. Perfekt för att mäta elevernas välmående eller andra faktorer som kräver regelbunden uppföljning. Genom att analysera resultaten över tid kan insikter skapas som bidrar till bättre beslutsfattande och långsiktig utveckling.\",\n surveyDescription: \"En engångsenkät med frågor som ställs vid ett specifikt tillfälle. Den används för att snabbt samla in information, utvärdera en händelse eller få en ögonblicksbild av elevernas åsikter och upplevelser. Passar bra för trygghets- och trviselenkäter, skolenkäter eller utvärderingar där en enda datainsamling är tillräcklig. Resultaten kan ge värdefulla insikter för att fatta beslut eller förbättra framtida processer.\",\n title: \"Temperaturkollen\",\n startTitle: \"Ta tempen på dina elever\",\n startDescription:\n \"Med temperaturkollen kan du skicka ut långa eller korta frågeformulär för att lära dig mer om dina elevers välmående.\",\n createTemplateBtn: \"Skapa din första temp\",\n addTemplateBtn: \"Skapa ny temp\",\n readMoreDifference: \"Läs mer om skillnaden\",\n student: \"elever\",\n ownSelection: \"Eget urval\",\n ownSelectionDescription: \"Välj enskilda personer\",\n answered: \"Svarade\",\n dispatch: \"Utskicksfrekvens\",\n adjustTime: \"Anpassa datum och tid\",\n question: {\n num1: \"Vill du ta tempen eller skapa en enkät?\",\n template: \"Vad vill du ta tempen på?\",\n attribute: \"Vilka vill du ta tempen på?\",\n survey: \"När vill du skicka ut enkäten?\",\n checkIn: \"Hur ofta vill du ta tempen?\",\n description: {\n checkIn:\n \"En återkommande enkät med frågor som ställs med jämna mellanrum enligt valt tidsintervall\",\n survey: \"En engångsenkät med frågor som ställs vid ett specifikt tillfälle\",\n },\n anonymousPageTitle: \"Vill du se individuella svar?\",\n anonymousPageDescription:\n \"Om du aktiverar detta så kommer du att kunna se elevernas individuella svar, dock kommer eleverna att informeras när enkäten startar att deras svar inte kommer att vara anonyma.\",\n guestPageTitle: \"Vill du skapa en enkätlänk?\",\n guestPageDescription:\n \"Om du aktiverar detta får du en länk och/eller QR-kod som du kan dela ut till elever, vårdnadshavare eller andra som INTE har Allbry. \\n Personerna som sedan använder länken kommer att kunna svara på enkäten utan att logga in och/eller ha ett konto. Funktionen går att kombinera med klasser/årskurse samt att se individuella svar för dessa.\",\n },\n status: {\n active: \"Aktiva\",\n search: \"Sök\",\n completed: \"Avslutade\",\n },\n timerOption: {\n daily: \"Dagligen\",\n weekly: \"Veckovis\",\n monthly: \"Månadsvis\",\n dailyDescription: \"Skickas varje dag\",\n weeklyDescription: \"Skickas varje måndag\",\n monthlyDescription: \"Skickas den 1a varje månad\",\n },\n createOwnTemplate: \"+ Skapa en egen mall\",\n },\n templateType: {\n general: \"Allmänna\",\n private: \"Egna\",\n },\n surveyTypeOptions: {\n checkIn: \"Check-in\",\n survey: \"Enkät\",\n },\n amountQuestion: \"Antal frågor\",\n endSurveyConfig: \"Avsluta enkäten\",\n endSurveyPopupConfirmationText: \"Är du säker på att du vill avsluta?\",\n endSuccess: \"Enkäten har avslutats\",\n deleteSurveyConfig: \"Ta bort enkät\",\n deleteSurveyConfigPopupConfirmationText:\n \"Är du säker på att du vill ta bort enkäten och enkätsvaren?\",\n deleteSurveyConfigPopupConfirmationBody:\n \"Observera att även enkätsvaren kommer att försvinna, åtgärden kan inte ångras.\",\n },\n};\n\nexport default sv;\n","export const ROOT = \"/\";\n\nexport const AUTH_ROOT_SSO = `${ROOT}sso`;\n\nexport const AUTH_ROOT_LOGIN = `${ROOT}login`;\nexport const SURVEY = `${ROOT}survey`;\n\nexport const AUTH_LOGIN_STEPS = {\n LOGIN_CODE: `${AUTH_ROOT_LOGIN}?code`,\n LOGIN_CREATE: `${AUTH_ROOT_LOGIN}?create`,\n LOGIN_EMAIL: `${AUTH_ROOT_LOGIN}?email`,\n LOGIN_PASSWORD: `${AUTH_ROOT_LOGIN}?password`,\n LOGIN_PAYMENT: `${AUTH_ROOT_LOGIN}?payment`,\n LOGIN_PAYMENT_APP: `${AUTH_ROOT_LOGIN}?payment-app`,\n LOGIN_SUCCESS: `${AUTH_ROOT_LOGIN}?success`,\n LOGIN_PAYMENT_SUCCESS: `${AUTH_ROOT_LOGIN}?payment-confirmation-order-id`,\n};\n\nexport const AUTH_ROOT_SIGN_UP_CONSUMER = `${ROOT}sign-up-consumer/:accountId`;\nexport const AUTH_SIGN_UP_CONSUMER_STEPS = {\n SIGN_UP_CREATE: `${AUTH_ROOT_SIGN_UP_CONSUMER}?create`,\n SIGN_UP_PAYMENT: `${AUTH_ROOT_SIGN_UP_CONSUMER}?payment`,\n SIGN_UP_SUCCESS: `${AUTH_ROOT_SIGN_UP_CONSUMER}?success`,\n};\n\nexport const AUTH_ROOT_FORGOT = `${ROOT}forgot`;\nexport const AUTH_FORGOT_STEPS = {\n FORGOT_CHECK: `${AUTH_ROOT_FORGOT}?check`,\n FORGOT_PASSWORD: `${AUTH_ROOT_FORGOT}?create`,\n};\n\nexport const PROFILE = `${ROOT}profile`;\n\nexport const EDIT_PROFILE = `${PROFILE}/:id/edit`;\nexport const PROFILE_STUDENT_VIEW_NOTES = `${PROFILE}/:id/notes`;\nexport const PROFILE_STUDENT_VIEW_STATISTICS = `${PROFILE}/:id/statistics`;\nexport const PROFILE_STUDENT_VIEW_NOTES_ADD = `${PROFILE_STUDENT_VIEW_NOTES}/add`;\nexport const PROFILE_STUDENT_VIEW_NOTE = `${PROFILE_STUDENT_VIEW_NOTES}/:noteId`;\n\nexport const PROFILE_STUDENT_VIEW_REPORT = `${PROFILE}/:id/report/:reportId`;\n\nexport const SETTINGS = `${ROOT}settings`;\n\nexport const SURVEY_ROOT = \"/\";\n\nexport const NOT_FOUND = \"*\";\n\nexport const APPOINTMENTS = `${ROOT}appointments`;\nexport const APPOINTMENT_DETAIL = `${ROOT}appointments/:id`;\nexport const APPOINTMENTS_BOOKING = `${APPOINTMENTS}/book`;\nexport const APPOINTMENTS_FREE_TIME = `${APPOINTMENTS}/free`;\n\nexport const COUNSELLORS = `${ROOT}counsellors`;\n\nexport const MESSAGES = `${ROOT}messages`;\nexport const STUDENTS = `${ROOT}students`;\nexport const REPORTS = `${ROOT}reports`;\n\nexport const VIDEO_ROOT = `${ROOT}meet`;\nexport const VIDEO_ROOM = `${VIDEO_ROOT}/:id`;\n\nexport const ORGANIZATION = `${ROOT}organization`;\nexport const STATISTICS = `${ROOT}statistics`;\n\nexport const ACCOUNT = `account`;\nexport const ACCOUNT_SELECTION = `${ROOT}accountSelection`;\nexport const USERS_ACCOUNT_SELECTION = `${ROOT}usersAccountSelection`;\n\nexport const USERS = `${ROOT}users`;\nexport const ADD_USER = `${USERS}/add`;\nexport const EDIT_USER = `${USERS}/:id/${ACCOUNT}/:accountId/edit`;\n\nexport const QUESTIONS = `${ROOT}survey/:id`;\n\nexport const CONFIG = `${ROOT}config`;\nexport const ADD_CONFIG = `${CONFIG}/create/:questionNumber`;\nexport const CREATE_OWN_TEMPLATE = `${CONFIG}/createOwnTemplate`;\n\nexport const SURVEY_AND_CHECK_IN = `${ROOT}checkInsAndSurveys`;\n\nexport const CHECK_IN = `${ROOT}checkIn`;\n\nexport const EXTERNAL_USER = `${ROOT}join`;","import loadable from \"@loadable/component\";\nimport { loadableRootParams } from \"@components/Skeleton/loadableParams\";\n\nconst Principal = {\n Organization: loadable(() => import(\"./Organization\"), loadableRootParams),\n Users: loadable(() => import(\"./Users/UsersTable\"), loadableRootParams),\n Statistics: loadable(\n () => import(\"../../components/Statistics/Statistics\"),\n loadableRootParams\n ),\n ChangeUser: loadable(() => import(\"./Users/ChangeUser\"), loadableRootParams),\n ProfileUser: loadable(\n () => import(\"./Users/ProfileUser\"),\n loadableRootParams\n ),\n Config: loadable(\n () => import(\"@components/SurveyAndCheckIns\"),\n loadableRootParams\n ),\n ConfigCreate: loadable(\n () => import(\"@components/SurveyAndCheckIns/Create/CreateConfig\"),\n loadableRootParams\n ),\n CreateOwnTempLate: loadable(\n () => import(\"@components/SurveyAndCheckIns/Create/CreateOwnTemplate\"),\n loadableRootParams\n ),\n UsersAccountSelection: loadable(\n () => import(\"@components/UsersAccountSelection/UsersAccountSelection\"),\n loadableRootParams\n ),\n};\n\nexport default Principal;\n","import {\n ACCOUNT,\n ADD_CONFIG,\n ADD_USER,\n CONFIG,\n CREATE_OWN_TEMPLATE,\n EDIT_USER,\n ORGANIZATION,\n STATISTICS,\n USERS,\n USERS_ACCOUNT_SELECTION,\n} from \"@router/consts\";\nimport Principal from \"@pages/Principal\";\nimport { ability } from \"ability/ability\";\nimport { USER_ROLES, CUSTOM_USER_ROLES } from \"@utils/consts\";\nimport { ManyUsers, Statistics, User } from \"@assets/icons\";\nimport TemplateIcon from \"@assets/icons/Template\";\n\nexport const PRINCIPAL_ROUTE_NAME = {\n ORGANIZATION: \"organization\",\n USERS: \"users\",\n STATISTICS: \"statistics\",\n CHANGE_USER: \"changeUser\",\n USERS_ACCOUNT_SELECTION: \"usersAccountSelection\",\n};\n\nexport const PRINCIPAL_MENU_ROUTES = () => {\n let principalMenuRoutes = [];\n\n if (\n ability.can(\n CUSTOM_USER_ROLES[USER_ROLES.PRINCIPAL_ROLE].DASHBOARD,\n USER_ROLES.PRINCIPAL_ROLE\n )\n ) {\n principalMenuRoutes.push({\n name: \"statistics\",\n path: STATISTICS,\n exact: true,\n icon: Statistics,\n isMenu: true,\n element:,\n });\n }\n\n if (\n ability.can(\n CUSTOM_USER_ROLES[USER_ROLES.PRINCIPAL_ROLE].USER_MANAGEMENT,\n USER_ROLES.PRINCIPAL_ROLE\n )\n ) {\n principalMenuRoutes.push({\n name: \"users\",\n path: USERS,\n exact: true,\n icon: User,\n isMenu: true,\n element: ,\n });\n }\n\n if (\n ability.can(\n CUSTOM_USER_ROLES[USER_ROLES.PRINCIPAL_ROLE].ORGANIZATION_SETTINGS,\n USER_ROLES.PRINCIPAL_ROLE\n )\n ) {\n principalMenuRoutes.push({\n name: \"organization\",\n path: ORGANIZATION,\n exact: true,\n icon: ManyUsers,\n isMenu: true,\n element: ,\n });\n }\n\n if (\n ability.can(\n CUSTOM_USER_ROLES[USER_ROLES.PRINCIPAL_ROLE].SURVEY_CONFIG,\n USER_ROLES.PRINCIPAL_ROLE\n )\n ) {\n principalMenuRoutes.push({\n name: \"config\",\n exact: true,\n isMenu: true,\n icon: TemplateIcon,\n path: CONFIG,\n element: ,\n });\n }\n\n return principalMenuRoutes;\n};\n\nexport const PRINCIPAL_ROUTES = () => {\n let principalRoutes = PRINCIPAL_MENU_ROUTES();\n\n if (\n ability.can(\n CUSTOM_USER_ROLES[USER_ROLES.PRINCIPAL_ROLE].USER_MANAGEMENT,\n USER_ROLES.PRINCIPAL_ROLE\n )\n ) {\n principalRoutes.push({\n name: \"addUser\",\n path: ADD_USER,\n exact: true,\n element: ,\n });\n principalRoutes.push({\n name: \"editUser\",\n path: EDIT_USER,\n exact: true,\n element: ,\n });\n principalRoutes.push({\n name: \"profileUser\",\n path: `${USERS}/:id/${ACCOUNT}/:accountId`,\n exact: true,\n element: ,\n });\n }\n\n if (\n ability.can(\n CUSTOM_USER_ROLES[USER_ROLES.PRINCIPAL_ROLE].SURVEY_CONFIG,\n USER_ROLES.PRINCIPAL_ROLE\n )\n ) {\n principalRoutes.push({\n name: \"configCreate\",\n path: ADD_CONFIG,\n exact: true,\n element: ,\n });\n\n principalRoutes.push({\n name: \"createOwnTemplate\",\n path: CREATE_OWN_TEMPLATE,\n exact: true,\n element: ,\n });\n }\n\n principalRoutes.push({\n name: PRINCIPAL_ROUTE_NAME.USERS_ACCOUNT_SELECTION,\n path: USERS_ACCOUNT_SELECTION,\n exact: true,\n element: ,\n });\n\n return principalRoutes;\n};\n","import { gql } from \"@apollo/client\";\nimport GraphQlService from \"./graphql\";\n\nclass AccountGraphql extends GraphQlService {\n async getAccounts() {\n return this.client\n .query({\n query: gql`\n query {\n findAllAccountsByUserId {\n id\n isUnavailable\n unavailableMessage\n isAnywaySendMessage\n account {\n ssoEnabled\n name\n id\n dtActivation\n dtDeactivation\n }\n user {\n email\n chatChatParticipants {\n accountId\n name\n sendMessageCount\n readMessageCount\n chatRoom {\n messageCount\n organizerName\n }\n }\n chatChatParticipantGlobals{\n name\n sendMessageCount\n readMessageCount\n globalChatRoom{\n messageCount\n organizerName\n }\n }\n }\n }\n }\n `,\n fetchPolicy: \"network-only\",\n })\n .then((result) => result?.data?.findAllAccountsByUserId);\n }\n async updateAuthUserSession(accountId) {\n return this.client\n .mutate({\n mutation: gql`\n mutation{\n updateAuthUserSession(accountId: \"${accountId}\")\n {\n accessToken\n userId\n accountId\n }\n }\n `,\n })\n .then((result) => result?.data?.updateAuthUserSession);\n }\n\n async findChildrenAccounts() {\n return this.client\n .query({\n query: gql`\n query {\n findChildrenAccounts {\n name\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.findChildrenAccounts);\n }\n\n async findChildrenAccountsByAccountId(accountId) {\n return this.client\n .query({\n query: gql`\n query{\n findChildrenAccountsByAccountId(\n id:\"${accountId}\"\n ){\n name\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.findChildrenAccountsByAccountId);\n }\n\n async updateIsUnavailableStatus(isUnavailable) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateIsUnavailableStatus(\n updateUnavailableStatusInput: { isUnavailable: ${isUnavailable} }\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.updateIsUnavailableStatus);\n }\n\n async updateUnavailableMessage(message) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateUnavailableMessage(\n updateUnavailableMessageInput: { unavailableMessage: \"\"\"${message}\"\"\" }\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.updateUnavailableMessage);\n }\n\n async updateIsAnywaySendMessageStatus(isAnywaySendMessage) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateIsAnywaySendMessageStatus(\n updateAnywaySendMessageStatusInput: { isAnywaySendMessage: ${isAnywaySendMessage} }\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.updateIsAnywaySendMessageStatus);\n }\n}\n\nconst AccountGraphqlInstance = new AccountGraphql();\nexport default AccountGraphqlInstance;\n","import config from '@config/config';\nimport ApiService from './api';\n\nclass AccountApi extends ApiService {\n constructor() {\n if (AccountApi.instance) {\n return AccountApi.instance;\n }\n\n super(config.authApiUrl);\n AccountApi.instance = this;\n }\n\n async createAccount(data) {\n const response = await this.http.post('/accounts', data);\n return response.data;\n }\n\n async getAccountById(accountId) {\n const response = await this.http.get(`/accounts/${accountId}`);\n return response.data;\n }\n\n async getAccounts() {\n const response = await this.http.get('accounts');\n return response.data;\n }\n\n async update(accountId, data) {\n const response = await this.http.put(`/accounts/${accountId}`, data);\n return response.data;\n }\n}\n\nconst accountApiInstance = new AccountApi();\nexport default accountApiInstance;\n","import { gql } from \"@apollo/client\";\nimport GraphQlService from \"./graphql\";\n\nclass accountPersonGraphql extends GraphQlService {\n async getAccountPersonByAccountId(accountId) {\n return this.client\n .query({\n query: gql`\n query {\n getAccountPersonByAccountId (\n id: \"${accountId}\"\n ){\n accountId\n organizationName\n organization {\n id\n }\n }\n }\n `,\n })\n .then((result) => result?.data?.getAccountPersonByAccountId);\n }\n\n async updateGender(gender) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateGender(updateGenderInput:{\n gender: \"${gender}\"\n }){\n id\n } \n }\n `,\n })\n .then((result) => result?.data?.updateGender);\n }\n async getAttributesWithStudentByAccountId(accountId) {\n return this.client\n .query({\n query: gql`\n query {\n getAttributesWithStudentByAccountId(accountId:\"${accountId}\"){\n attributeName\n attributeValue\n studentCount\n }\n }\n `,\n })\n .then((result) => result?.data?.getAttributesWithStudentByAccountId);\n }\n async updateColor(data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateColor(updateColorInput: {\n id: \"${data.id}\"\n color: ${data.color ? `\"${data.color}\"` : null}\n }) {\n id\n color\n }\n }\n `,\n })\n .then((result) => result?.data?.updateColor);\n }\n}\nconst accountPersonService = new accountPersonGraphql();\nexport default accountPersonService;\n","'use strict';\n\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object } obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array }\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n value = +value;\n return Number.isFinite(value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array } arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object } obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object } options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array } path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object } params - The parameters to be converted to a FormData object.\n * @param {Object } options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = (\n (product) => {\n return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0\n })(typeof navigator !== 'undefined' && navigator.product);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array } arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n if (!hasJSONContentType) {\n return data;\n }\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \" ://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n// Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n const msie = /(msie|trident)/i.test(navigator.userAgent);\n const urlParsingNode = document.createElement('a');\n let originURL;\n\n /**\n * Parse a URL to discover its components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n let href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })();\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","'use strict';\n\nimport utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport cookies from './../helpers/cookies.js';\nimport buildURL from './../helpers/buildURL.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport isURLSameOrigin from './../helpers/isURLSameOrigin.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport speedometer from '../helpers/speedometer.js';\n\nfunction progressEventReducer(listener, isDownloadStream) {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e\n };\n\n data[isDownloadStream ? 'download' : 'upload'] = true;\n\n listener(data);\n };\n}\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n let requestData = config.data;\n const requestHeaders = AxiosHeaders.from(config.headers).normalize();\n let {responseType, withXSRFToken} = config;\n let onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n let contentType;\n\n if (utils.isFormData(requestData)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n requestHeaders.setContentType(false); // Let the browser set it\n } else if ((contentType = requestHeaders.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n let request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));\n }\n\n const fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if(platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n\n if (xsrfValue) {\n requestHeaders.set(config.xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","export const VERSION = \"1.6.2\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from 'axios';\n\nclass HttpService {\n constructor(baseURL) {\n this.axios = axios.create({baseURL});\n }\n\n get(url, config) {\n return this.axios.get(url, config);\n }\n\n post(url, data, config) {\n return this.axios.post(url, data, config);\n }\n\n put(url, data, config) {\n return this.axios.put(url, data, config);\n }\n\n delete(url, config) {\n return this.axios.delete(url, config);\n }\n\n addRequestInterceptor(fn) {\n this.axios.interceptors.request.use((...args) => fn(...args));\n }\n\n addResponseInterceptor(responseFn, errorFn) {\n this.axios.interceptors.response.use(responseFn, errorFn);\n }\n}\n\nexport default HttpService;\n","import config from '@config/config';\nimport HttpService from '../http';\nimport LocalStorageService from '../localStorage';\n\nclass ApiService {\n constructor(baseUrl) {\n this.http = new HttpService(baseUrl);\n this.internalRefreshToken = this.internalRefreshToken.bind(this);\n\n this.http.addRequestInterceptor((axiosConfig) => {\n const accessToken = LocalStorageService.getAccessToken();\n if (!accessToken) {\n return axiosConfig;\n }\n\n axiosConfig.headers = axiosConfig.headers || {}; // eslint-disable-line no-param-reassign\n axiosConfig.headers.Authorization = `Bearer ${accessToken}`; // eslint-disable-line no-param-reassign\n return axiosConfig;\n });\n\n this.http.addResponseInterceptor((response) => response, (error) => {\n const status = error.response ? error.response.status : null;\n\n if (error.config.url.includes('/session/current')) {\n return Promise.reject(error);\n }\n\n if (error.config.url.includes('/refreshToken')) {\n window.location.href = '/';\n return Promise.reject(error);\n }\n\n if (status === 401) {\n return this.internalRefreshToken().then((accessToken) => {\n if (!accessToken) {\n window.location.href = '/';\n return Promise.reject(error);\n }\n\n error.config.headers.Authorization = `Bearer ${accessToken}`; // eslint-disable-line no-param-reassign\n return this.http.axios.request(error.config);\n });\n }\n\n return Promise.reject(error);\n });\n }\n\n async internalRefreshToken() {\n const refreshToken = LocalStorageService.getRefreshToken();\n if (!refreshToken) {\n LocalStorageService.removeAccessToken();\n LocalStorageService.removeRefreshToken();\n LocalStorageService.removeAppCache();\n return null;\n }\n\n try {\n const response = await this.http.post(`${config.authApiUrl}/refreshToken`, {refreshToken});\n const tokens = response.data;\n\n LocalStorageService.setAccessToken(tokens.accessToken);\n LocalStorageService.setRefreshToken(tokens.refreshToken);\n\n return tokens.accessToken;\n } catch (err) {\n LocalStorageService.removeAccessToken();\n LocalStorageService.removeRefreshToken();\n LocalStorageService.removeAppCache();\n return null;\n }\n }\n}\n\nexport default ApiService;\n","import config from '@config/config';\nimport ApiService from './api';\nimport LocalStorageService from '../localStorage';\n\nclass AuthApi extends ApiService {\n constructor() {\n if (AuthApi.instance) {\n return AuthApi.instance;\n }\n\n super(config.authApiUrl);\n AuthApi.instance = this;\n }\n\n async login(email, password) {\n const response = await this.http.post('/login', {email, password});\n \n if (response.data.redirectUrl) {\n const form = document.createElement('form');\n\n form.method = 'POST';\n form.action = `${config.authApiUrl}${response.data.redirectUrl}`;\n document.body.appendChild(form);\n form.submit();\n }\n\n return response.data;\n }\n\n async isSSO(email, isRegistration) {\n const response = await this.http.post('/sso/check', {email, registration: isRegistration});\n\n if (response.data.redirectUrl) {\n const form = document.createElement('form');\n\n form.method = 'POST';\n form.action = `${config.authApiUrl}${response.data.redirectUrl}`;\n document.body.appendChild(form);\n form.submit();\n\n return true;\n }\n\n return false;\n }\n\n async emailRegistration(email, password) {\n const response = await this.http.post('/register', {email, password});\n return response.data;\n }\n\n async forgotPassword(email) {\n const response = await this.http.post('/forgotPassword', {email});\n return response.data;\n }\n\n async resetPassword(newPassword, token) {\n const response = await this.http.post('/resetPassword', {\n newPassword,\n resetPasswordToken: token,\n });\n\n return response.data;\n }\n\n async logout() {\n const response = await this.http.post('/logout');\n\n return response.data;\n }\n\n async getCurrentUser() {\n const response = await this.http.get('/session/current');\n return response.data;\n }\n\n async refreshToken() {\n const refreshToken = LocalStorageService.getRefreshToken();\n if (!refreshToken) {\n LocalStorageService.removeAccessToken();\n LocalStorageService.removeRefreshToken();\n LocalStorageService.removeAppCache();\n return null;\n }\n\n const response = await this.http.post('/refreshToken', {refreshToken});\n return response.data;\n }\n\n async switchAccount(accountId) {\n const response = await this.http.post('/switchAccount', {accountId});\n return response.data;\n }\n}\n\nconst authApiInstance = new AuthApi();\nexport default authApiInstance;\n","import { gql } from \"@apollo/client\";\nimport GraphQlService from \"./graphql\";\n\nclass BroadcastMessageGraphql extends GraphQlService {\n async getAllBroadcastMessages() {\n return this.client\n .query({\n query: gql`\n query {\n getAllBroadcastMessages {\n id\n startDate\n endDate\n message\n heading\n userType\n status\n isAllAccount\n authAccounts{\n id\n name\n }\n }\n }\n `,\n })\n .then((result) => result?.data?.getAllBroadcastMessages);\n }\n\n async createBroadcastMessage(broadcastMessage) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n createBroadcastMessages(\n createBroadcastMessagesInput: {\n isAllAccount: ${broadcastMessage.isAllAccount}\n accountIds: \"\"\"${JSON.stringify(broadcastMessage.accountIds)}\"\"\"\n startDate: \"${broadcastMessage.startDate}\"\n endDate: \"${broadcastMessage.endDate}\"\n message: \"\"${JSON.stringify(broadcastMessage.message)}\"\"\n heading: \"${broadcastMessage.heading}\"\n userType: \"${broadcastMessage.userType}\"\n }\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.createBroadcastMessages);\n }\n\n async updateBroadcastMessage(broadcastMessage) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateBroadcastMessages(\n updateBroadcastMessagesInput: {\n id: \"${broadcastMessage.id}\"\n isAllAccount: ${broadcastMessage.isAllAccount}\n accountIds: \"\"\"${JSON.stringify(broadcastMessage.accountIds)}\"\"\"\n startDate: \"${broadcastMessage.startDate}\"\n endDate: \"${broadcastMessage.endDate}\"\n message: \"\"${JSON.stringify(broadcastMessage.message)}\"\"\n heading: \"${broadcastMessage.heading}\"\n userType: \"${broadcastMessage.userType}\"\n }\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.updateBroadcastMessages);\n }\n\n async updateStatusBroadcastMessages(data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateStatusBroadcastMessages(\n updateStatusBroadcastMessageInput:{\n id: \"${data.id}\", status: ${data.status}\n }\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.updateStatusBroadcastMessages);\n }\n\n async removeBroadcastMessages(id) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n removeBroadcastMessages(id: \"${id}\")\n }\n `,\n })\n .then((result) => result?.data?.removeBroadcastMessages);\n }\n\n async getBroadcastMessagesByUser() {\n return this.client\n .query({\n query: gql`\n query {\n getBroadcastMessagesByUser {\n id\n message\n heading\n }\n }\n `,\n })\n .then((result) => result?.data?.getBroadcastMessagesByUser);\n }\n\n async createBroadcastMessagesUsers(id) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n createBroadcastMessagesUsers(\n createBroadcastMessagesUsersInput: {\n messageId: \"${id}\"\n }\n ), {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.createBroadcastMessagesUsers);\n }\n\n}\n\nconst broadcastMessagesInstance = new BroadcastMessageGraphql();\nexport default broadcastMessagesInstance;\n","import { gql } from \"@apollo/client\";\nimport GraphQlService from \"./graphql\";\n\nclass CalendarGraphql extends GraphQlService {\n async getUnAnsweredEvents(users = []) {\n return this.client\n .query({\n query: gql`\n query {\n getUnAnsweredEvents(userIds: ${JSON.stringify(users)}){\n id\n accountId\n }\n }\n `,\n fetchPolicy: \"network-only\",\n })\n .then((result) => result?.data?.getUnAnsweredEvents);\n }\n async updateCalendarSyncStatus(status) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateCalendarSyncStatus(\n status: ${status}\n ){\n id\n accountId\n name\n type\n ownerId\n createdAt\n updatedAt\n createdBy\n updatedBy\n version\n externalSync\n externalSyncFreeTime\n } \n }\n `,\n })\n .then((result) => result?.data?.updateCalendarSyncStatus);\n }\n\n async getAllCalenderEventDatesById(calendarId, startDate, endDate) {\n return this.client\n .query({\n query: gql`\n query{\n getAllCalenderEventDatesById(getAllCalenderEventDatesByIdInput:{\n id: \"${calendarId}\"\n startDate: \"${startDate}\"\n EndDate: \"${endDate}\"\n })\n }\n `,\n })\n .then((result) => result?.data?.getAllCalenderEventDatesById);\n }\n\n async getByGlobalCalendarEventId(calendarId) {\n return this.client\n .query({\n query: gql`\n query {\n getByGlobalCalendarEventId(\n globalCalendarEventId: \"${calendarId}\"\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.getByGlobalCalendarEventId);\n }\n\n async updateCalendarSyncFreeTimeStatus(status) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateCalendarSyncFreeTimeStatus(\n status: ${status}\n ){\n id\n accountId\n name\n type\n ownerId\n createdAt\n updatedAt\n createdBy\n updatedBy\n version\n externalSync\n externalSyncFreeTime\n } \n }\n `,\n })\n .then((result) => result?.data?.updateCalendarSyncFreeTimeStatus);\n }\n\n async createManyCalendarEventExternalUser(users) {\n return this.client\n .mutate({\n mutation: gql`\n mutation CreateManyCalendarEventExternalUser(\n $users: [CreateCalendarEventExternalUserInput!]!\n ) {\n createManyCalendarEventExternalUser(\n createManyCalendarEventExternalUserInput: $users\n ) {\n id\n name\n }\n }\n `,\n variables: {\n users,\n },\n })\n .then((result) => result?.data?.createManyCalendarEventExternalUser);\n }\n\n async getExternalUserByExternalCode(externalCode) {\n return this.client\n .query({\n query: gql`\n query {\n getExternalUserByExternalCode(externalCode: \"${externalCode}\") {\n id\n externalUserCode\n dtStart\n dtEnd\n organizerName\n globalCalendarEventId\n status\n accountId\n organizerId\n originalParticipants: calendarParticipants{\n id\n userId\n accountId\n name\n externalUserId\n type\n }\n calendar{\n externalUser{\n id\n name\n email\n mobile\n }\n }\n }\n }\n `,\n })\n .then((result) => result?.data?.getExternalUserByExternalCode);\n }\n\n async resendEmailToExternalUser(externalUserId) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n resendEmailToExternalUser(\n externalUserId: \"${externalUserId}\"\n )\n }\n `,\n })\n .then((result) => result?.data?.resendEmailToExternalUser);\n }\n}\nconst calendarGraphqlInstance = new CalendarGraphql();\nexport default calendarGraphqlInstance;\n","import config from '@config/config';\nimport ApiService from './api';\n\nclass CalendarApi extends ApiService {\n constructor() {\n if (CalendarApi.instance) {\n return CalendarApi.instance;\n }\n\n super(config.calendarApiUrl);\n CalendarApi.instance = this;\n }\n\n async getCalendarByUserId(accountId, userId) {\n const response = await this.http.get(`/accounts/${accountId}/calendars?ownerId=${userId}`);\n return response.data;\n }\n\n async getCalendarByUserIds(accountId, userIds) {\n const response = await this.http.get(`/accounts/${accountId}/calendars/userIds?ownerIds=${JSON.stringify(userIds)}`);\n return response.data;\n }\n\n async getCalendarEventsByCalendarId({\n accountId,\n calendarId,\n dtStart = 0,\n dtEnd = 99999999999999,\n populateParticipants = false,\n participantUserIds,\n globalEventId,\n status=null\n }) {\n const calendarIdParam = `calendarId=${calendarId}`;\n const dtStartParam = `dtStart=${dtStart}`;\n const dtEndParam = `dtEnd=${dtEnd}`;\n const statusParam = status === null ? '' :`&status=${status}`;\n const populateParticipantsParam = `populateParticipants=${populateParticipants}`;\n const globalEventIdParam = globalEventId ? `globalEventId=${globalEventId}` : null;\n const participantsParam = participantUserIds\n ? participantUserIds.map((v) => `participant=${v}`).join('&')\n : null;\n\n const response = await this.http.get(`/accounts/${accountId}/calendarEvents?${calendarIdParam}&${dtStartParam}${statusParam}&${dtEndParam}&${populateParticipantsParam}${participantsParam\n ? `&${participantsParam}`\n : ''}${globalEventIdParam ? `&${globalEventIdParam}` : ''}`);\n\n return response.data;\n }\n\n async getCalendarEventById(accountId, calendarEventId, populateParticipants = false) {\n const response = await this.http.get(`/accounts/${accountId}/calendarEvents/${calendarEventId}${populateParticipants ? `?populateParticipants=${populateParticipants}` : ''}`);\n return response.data;\n }\n\n async createCalendarEvent(accountId, calendarEvent) {\n const response = await this.http.post(`/accounts/${accountId}/calendarEvents`, calendarEvent);\n return response.data;\n }\n\n async createCalendarEventMultiple(accountId, calendarEvent) {\n const response = await this.http.post(`/accounts/${accountId}/calendarEvents/multi`, calendarEvent);\n return response.data;\n }\n\n async createCalendarEventParticipant(accountId, calendarEventParticipant) {\n const response = await this.http.post(`/accounts/${accountId}/calendarEvents/${calendarEventParticipant.eventId}/participants`, calendarEventParticipant);\n return response.data;\n }\n\n async updateCalendarEvent(accountId, calendarEvent) {\n const response = await this.http.put(`/accounts/${accountId}/calendarEvents/${calendarEvent.id}`, calendarEvent);\n return response.data;\n }\n\n async getCalendarEventsByOwnerId(accountId, ownerId, {dtStart, dtEnd}, participantUserIds, checkMultipleAccounts = false) {\n const userId = ownerId;\n const usersCalendars = await this.getCalendarByUserIds(accountId, ownerId);\n const calendarIds = usersCalendars.map((v) => v.id);\n return this.getEventsByCalendarId(accountId, calendarIds, {dtStart, dtEnd}, participantUserIds, checkMultipleAccounts,userId);\n }\n\n async getEventsByCalendarId(accountId, calendarIds, {dtStart, dtEnd}, participantUserIds, checkMultipleAccounts = false,userId) {\n const participantsParam = participantUserIds\n ? participantUserIds.map((v) => `participant=${v}`).join('&')\n : null;\n const calendarIdParam = `calendarId=${JSON.stringify(Array.isArray(calendarIds) ? calendarIds : [calendarIds])}`;\n const dtStartParam = `dtStart=${dtStart}`;\n const dtEndParam = `dtEnd=${dtEnd}`;\n const checkMultipleAccountsParam = `checkMultipleAccounts=${checkMultipleAccounts}`;\n const userIdParam = `userId=${JSON.stringify(Array.isArray(userId) ? userId : [userId])}`;\n\n const eventsResponse = await this.http.get(`/accounts/${accountId}/calendarEvents?${calendarIdParam}&${dtStartParam}&${dtEndParam}&${checkMultipleAccountsParam}&${userIdParam}${participantsParam ? `&${participantsParam}` : ''} `);\n return eventsResponse.data;\n }\n\n async createCalendar(accountId, data) {\n const response = await this.http.post(`/accounts/${accountId}/calendars`, data);\n return response.data;\n }\n\n async deleteCalendarEventById(accountId, id) {\n const response = await this.http.delete(`/accounts/${accountId}/calendarEvents/${id}`);\n return response.data;\n }\n}\n\nconst calendarApiInstance = new CalendarApi();\nexport default calendarApiInstance;\n","import { gql } from \"@apollo/client\";\nimport GraphQlService from \"./graphql\";\n\nclass ChatGraphql extends GraphQlService {\n async removeGroup(groupId) {\n return this.client.mutate({\n mutation: gql`\n mutation removeChatChatRoom{\n removeChatChatRoom(\n id: \"${groupId}\",\n )\n {\n response{\n messages{\n message\n }\n }\n }\n }\n `,\n });\n }\n\n async updateGroupDetails(groupId, groupName, participants) {\n let participantsFormated = \"\";\n participants.forEach((attachment) => {\n if (attachment.action === \"REMOVE\") {\n participantsFormated += `{ id: \"${attachment.id}\", action: \"${attachment.action}\"}`;\n } else {\n participantsFormated += `{ userId: \"${attachment.userId}\", action: \"${attachment.action}\", name: \"${attachment.name}\"}`;\n }\n });\n\n return this.client.mutate({\n mutation: gql`\n mutation updateChatChatRoom{\n updateChatChatRoom(\n updateChatChatRoomInput: {\n id: \"${groupId}\"\n name: \"${groupName}\"\n participants: [${participantsFormated}]\n }\n )\n {\n name\n chatChatParticipants{\n name\n userId\n }\n }\n }\n `,\n });\n }\n\n async getUnreadMessageCount(id, accountId, userId) {\n return this.client\n .query({\n query: gql`\n query{\n getUnreadMessageCount(getUnreadMessageCountInput:{\n id:\"${id}\"\n accountId:\"${accountId}\"\n userId:\"${userId}\"\n })\n }\n `,\n })\n .then((result) => result?.data?.getUnreadMessageCount);\n }\n\n async getUnreadMessageCountForGlobal(id, userId) {\n return this.client\n .query({\n query: gql`\n query{\n getUnreadMessageCountForGlobal(getUnreadMessageCountForGlobalInput:{\n id:\"${id}\"\n userId:\"${userId}\"\n })\n }\n `,\n })\n .then((result) => result?.data?.getUnreadMessageCountForGlobal);\n }\n\n async removeChatChatMessage(data) {\n return this.client.mutate({\n mutation: gql`\n mutation{\n removeChatChatMessage(deleteChatChatMessageInput:{\n id:\"${data.id}\"\n type:\"${data.type}\"\n isLastInGroup:${data.isLastInGroup}\n chatRoomId:\"${data.chatRoomId}\"\n })\n }\n `,\n });\n }\n\n async createChatChatRoomGlobal(data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation{\n createChatChatRoomGlobal(createChatChatRoomGlobalInput:{\n isArchived:${data.isArchived},\n organizerId:\"${data.organizerId}\",\n organizerName:\"${data.organizerName}\",\n name: ${data.name ? `\"${data.name}\"` : null} \n }){\n id\n }\n }\n `,\n })\n .then((result) => result.data.createChatChatRoomGlobal);\n }\n\n async createChatChatParticipantGlobal(data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n createChatChatParticipantGlobal(\n createChatChatParticipantGlobalInput: {\n userId: \"${data.userId}\"\n globalChatRoomId: \"${data.globalChatRoomId}\"\n name: ${data.name ? `\"${data.name}\"` : null} \n }\n ) {\n id\n }\n }\n `,\n })\n .then((result) => result.data.createChatChatParticipantGlobal);\n }\n\n async getChatRoomsByUserId(data) {\n return this.client\n .query({\n query: gql`\n query{\n getChatRoomsByUserId(\n userId:\"${data.userId}\"\n populateLastMessage:${data.populateLastMessage}\n populateChatParticipants:${data.populateChatParticipants}\n ){\n id\n name\n isArchived\n organizerId\n organizerName\n lastMessage{\n id\n globalChatRoomId\n senderId\n senderName\n messageText\n sentAt\n attachmentName\n type\n createdAt\n updatedAt\n createdBy\n updatedBy\n version\n }\n messageCount\n createdAt\n createdBy\n updatedAt\n updatedBy\n version\n participants{\n id\n globalChatRoomId\n userId\n name\n sendMessageCount\n readMessageCount\n createdAt\n createdBy\n updatedAt\n updatedBy\n version\n }\n }\n }`,\n })\n .then((result) => result.data.getChatRoomsByUserId);\n }\n\n async updateChatChatRoomGlobal(data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateChatChatRoomGlobal(\n updateChatChatRoomGlobalInput: {\n id: \"${data.id}\"\n isArchived: ${data.isArchived}\n }\n ) {\n id\n isArchived\n organizerName\n }\n }\n `,\n })\n .then((result) => result.data.updateChatChatRoomGlobal);\n }\n\n async getChatRoomMessages(chatRoomId, date=null) {\n return this.client\n .query({\n query: gql`\n query{\n getByGlobalChatRoomId(\n globalChatRoomId:\"${chatRoomId}\"\n date: ${date ? `\"${date}\"` : null}\n ){\n id\n isAnonymous\n globalChatRoomId\n senderId\n senderName\n messageText\n sentAt\n attachmentName\n type\n createdAt\n createdBy\n updatedAt\n updatedBy\n version\n }\n }\n `,\n })\n .then((result) => result.data.getByGlobalChatRoomId);\n }\n\n async createChatChatMessageGlobal(data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n createChatChatMessageGlobal(\n createChatChatMessageGlobalInput: {\n id: \"${data.id}\"\n globalChatRoomId: \"${data.globalChatRoomId}\"\n senderId: \"${data.senderId}\"\n senderName: \"${data.senderName}\"\n messageText: \"\"\"${data.messageText}\"\"\"\n sentAt:${data.sentAt}\n attachmentName: ${\n data.attachmentName ? `\"${data.attachmentName}\"` : null\n } \n type: \"${data.type}\"\n }\n ) {\n id\n globalChatRoomId\n senderId\n senderName\n messageText\n sentAt\n attachmentName\n type\n createdAt\n createdBy\n updatedAt\n updatedBy\n version\n }\n }\n `,\n })\n .then((result) => result.data.createChatChatMessageGlobal);\n }\n\n async removeGlobalChatChatMessage(data) {\n return this.client.mutate({\n mutation: gql`\n mutation{\n removeGlobalChatChatMessage(deleteChatChatMessageGlobalInput:{\n id:\"${data.id}\"\n type:\"${data.type}\"\n isLastInGroup:${data.isLastInGroup}\n globalChatRoomId:\"${data.globalChatRoomId}\"\n })\n }\n `,\n });\n }\n\n async getAttachmentsByGlobalChatRoomId(globalChatRoomId) {\n return this.client\n .query({\n query: gql`\n query{\n getAttachmentsByGlobalChatRoomId(globalChatRoomId:\"${globalChatRoomId}\"){\n globalChatRoomId\n attachmentId\n attachmentName\n attachmentSize\n attachmentType\n contentType\n entityType\n sentAt\n createdAt\n createdBy\n updatedAt\n updatedBy\n version\n }\n }\n `,\n })\n .then((result) => result.data.getAttachmentsByGlobalChatRoomId);\n }\n\n async getGlobalChatChatRoomForAdmin(){\n return this.client\n .query({\n query: gql`\n query{\n getGlobalChatChatRoomForAdmin{\n id\n accountId\n organizerId\n organizerName\n lastMessage\n messageCount\n createdAt\n createdBy\n updatedAt\n updatedBy\n chatChatParticipants{\n id\n accountId\n name\n userId\n chatRoomId\n sendMessageCount\n readMessageCount\n }\n }\n }\n `,\n }).then((result) => result.data.getGlobalChatChatRoomForAdmin);\n }\n}\n\nconst chatGraphqlInstance = new ChatGraphql();\nexport default chatGraphqlInstance;\n","import config from '@config/config';\nimport ApiService from './api';\n\nclass ChatApi extends ApiService {\n constructor() {\n if (ChatApi.instance) {\n return ChatApi.instance;\n }\n\n super(config.chatRoomApiUrl);\n ChatApi.instance = this;\n }\n\n async getChatRoomsByUserId(\n accountId,\n userId,\n populateLastMessage = false,\n populateChatParticipants = false,\n ) {\n const userIdIdParam = `userId=${userId}`;\n const populateChatParticipantsParam = `populateChatParticipants=${populateChatParticipants}`;\n const populateLastMessageParam = `populateLastMessage=${populateLastMessage}`;\n\n const response = await this.http.get(`/accounts/${accountId}/chatRooms?${userIdIdParam}${populateChatParticipants ? `&${populateChatParticipantsParam}` : ''}${populateLastMessage ? `&${populateLastMessageParam}` : ''}`);\n return response.data;\n }\n\n async getChatRoomById(\n accountId,\n chatRoomId,\n populateChatParticipants = false,\n ) {\n const populateChatParticipantsParam = `populateChatParticipants=${populateChatParticipants}`;\n\n const response = await this.http.get(`/accounts/${accountId}/chatRooms/${chatRoomId}?${populateChatParticipantsParam}`);\n return response.data;\n }\n\n async createChatRoom(accountId, chatRoom) {\n const response = await this.http.post(`/accounts/${accountId}/chatRooms`, chatRoom);\n return response.data;\n }\n\n async updateChatRoom(accountId, chatRoom) {\n const response = await this.http.put(`/accounts/${accountId}/chatRooms/${chatRoom.id}`, chatRoom);\n return response.data;\n }\n\n async deleteChatRoom(accountId, chatRoomId) {\n await this.http.delete(`/accounts/${accountId}/chatRooms/${chatRoomId}`);\n }\n\n async createChatRoomParticipant(accountId, chatRoomParticipant) {\n const response = await this.http.post(`/accounts/${accountId}/chatRooms/${chatRoomParticipant.chatRoomId}/participants`, chatRoomParticipant);\n return response.data;\n }\n\n async createChatRoomMessage(accountId, chatRoomMessage) {\n const response = await this.http.post(`/accounts/${accountId}/chatRooms/${chatRoomMessage.chatRoomId}/messages`, chatRoomMessage);\n return response.data;\n }\n\n async getChatRoomMessages(accountId, chatRoomId,date = null) {\n const response = await this.http.get(`/accounts/${accountId}/chatRooms/${chatRoomId}/messages?date=${date}`);\n return response.data;\n }\n\n async getChatRoomAttachments(accountId, chatRoomId) {\n const response = await this.http.get(`/accounts/${accountId}/chatRooms/${chatRoomId}/attachments`);\n return response.data;\n }\n}\n\nconst chatApiInstance = new ChatApi();\nexport default chatApiInstance;\n","import {\n gql,\n } from '@apollo/client';\n import GraphQlService from './graphql';\n\n class externalIntegrationConfigGraphql extends GraphQlService {\n async getExternalIntegrationConfigs() {\n return this.client\n .query({\n query: gql`\n query {\n getAllConfig {\n id\n accountId\n timer\n runOnce\n updateMethod\n configJson\n active\n account {\n id\n name\n }\n }\n }\n `,\n })\n .then((result) => result?.data?.getAllConfig);\n }\n\n async createExternalIntegrationsConfig(data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n createExternalIntegrationsConfig(\n createExternalIntegrationsConfig: {\n accountId: \"${data.accountId}\",\n timer: \"${data.timer}\",\n runOnce: ${data.runOnce},\n updateMethod: \"${data.updateMethod}\",\n configJson: \"\"\"${data.configJson}\"\"\"\n }\n ){\n id\n }\n }\n `,\n })\n .then((result) => result?.data?.createExternalIntegrationsConfig);\n }\n async updateStatusConfig(id, active) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateStatusConfig(\n updateStatusConfig: {\n id:\"${id}\"\n active: ${active}\n }\n ){\n id\n accountId\n active\n timer\n runOnce\n updateMethod\n configJson\n account{\n id\n name\n }\n }\n }\n `,\n })\n .then((result) => result?.data?.updateStatusConfig);\n }\n async updateExternalIntegrationsConfig(id, data) {\n return this.client\n .mutate({\n mutation: gql`\n mutation {\n updateExternalIntegrationsConfig(\n updateExternalIntegrationsConfig: {\n id:\"${id}\"\n accountId: \"${data.accountId}\",\n timer: \"${data.timer}\",\n runOnce: ${data.runOnce},\n updateMethod: \"${data.updateMethod}\",\n configJson: \"\"\"${data.configJson}\"\"\"\n }\n ){\n id\n accountId\n active\n timer\n runOnce\n updateMethod\n configJson\n account{\n id\n name\n }\n }\n }\n `,\n })\n .then((result) => result?.data?.updateExternalIntegrationsConfig);\n }\n}\nconst externalIntegrationConfigService = new externalIntegrationConfigGraphql();\nexport default externalIntegrationConfigService; \n","const genericMessage = \"Invariant Violation\";\nconst {\n setPrototypeOf = function (obj: any, proto: any) {\n obj.__proto__ = proto;\n return obj;\n },\n} = Object as any;\n\nexport class InvariantError extends Error {\n framesToPop = 1;\n name = genericMessage;\n constructor(message: string | number = genericMessage) {\n super(\n typeof message === \"number\"\n ? `${genericMessage}: ${message} (see https://github.com/apollographql/invariant-packages)`\n : message\n );\n setPrototypeOf(this, InvariantError.prototype);\n }\n}\n\nexport function invariant(\n condition: any,\n message?: string | number,\n): asserts condition {\n if (!condition) {\n throw new InvariantError(message);\n }\n}\n\nconst verbosityLevels = [\"debug\", \"log\", \"warn\", \"error\", \"silent\"] as const;\nexport type VerbosityLevel = (typeof verbosityLevels)[number];\nexport type ConsoleMethodName = Exclude ;\nlet verbosityLevel = verbosityLevels.indexOf(\"log\");\n\nfunction wrapConsoleMethod (name: M) {\n return function () {\n if (verbosityLevels.indexOf(name) >= verbosityLevel) {\n // Default to console.log if this host environment happens not to provide\n // all the console.* methods we need.\n const method = console[name] || console.log;\n return method.apply(console, arguments as any);\n }\n } as (typeof console)[M];\n}\n\nexport namespace invariant {\n export const debug = wrapConsoleMethod(\"debug\");\n export const log = wrapConsoleMethod(\"log\");\n export const warn = wrapConsoleMethod(\"warn\");\n export const error = wrapConsoleMethod(\"error\");\n}\n\nexport function setVerbosity(level: VerbosityLevel): VerbosityLevel {\n const old = verbosityLevels[verbosityLevel];\n verbosityLevel = Math.max(0, verbosityLevels.indexOf(level));\n return old;\n}\n\nexport default invariant;\n","export const version = \"local\";\n","export function maybe (thunk: () => T): T | undefined {\n try {\n return thunk();\n } catch {}\n}\n","import { maybe } from \"./maybe.js\";\n\ndeclare global {\n const __DEV__: boolean; // will be removed in `dist` by the `postprocessDist` script\n interface Window {\n __DEV__?: boolean;\n }\n}\n\nexport default (maybe(() => globalThis) ||\n maybe(() => window) ||\n maybe(() => self) ||\n maybe(() => global) ||\n // We don't expect the Function constructor ever to be invoked at runtime, as\n // long as at least one of globalThis, window, self, or global is defined, so\n // we are under no obligation to make it easy for static analysis tools to\n // detect syntactic usage of the Function constructor. If you think you can\n // improve your static analysis to detect this obfuscation, think again. This\n // is an arms race you cannot win, at least not in JavaScript.\n maybe(function () {\n return maybe.constructor(\"return this\")();\n })) as typeof globalThis & Window;\n","const prefixCounts = new Map ();\n\n// These IDs won't be globally unique, but they will be unique within this\n// process, thanks to the counter, and unguessable thanks to the random suffix.\nexport function makeUniqueId(prefix: string) {\n const count = prefixCounts.get(prefix) || 1;\n prefixCounts.set(prefix, count + 1);\n return `${prefix}:${count}:${Math.random().toString(36).slice(2)}`;\n}\n","import { makeUniqueId } from \"./makeUniqueId.js\";\n\nexport function stringifyForDisplay(value: any, space = 0): string {\n const undefId = makeUniqueId(\"stringifyForDisplay\");\n return JSON.stringify(\n value,\n (key, value) => {\n return value === void 0 ? undefId : value;\n },\n space\n )\n .split(JSON.stringify(undefId))\n .join(\" \");\n}\n","import { invariant as originalInvariant, InvariantError } from \"ts-invariant\";\nimport { version } from \"../../version.js\";\nimport global from \"./global.js\";\nimport type { ErrorCodes } from \"../../invariantErrorCodes.js\";\nimport { stringifyForDisplay } from \"../common/stringifyForDisplay.js\";\n\nfunction wrap(fn: (msg?: string, ...args: any[]) => void) {\n return function (message?: string | number, ...args: any[]) {\n if (typeof message === \"number\") {\n const arg0 = message;\n message = getHandledErrorMsg(arg0);\n if (!message) {\n message = getFallbackErrorMsg(arg0, args);\n args = [];\n }\n }\n fn(...[message].concat(args));\n };\n}\n\ntype LogFunction = {\n /**\n * Logs a `$level` message if the user used `ts-invariant`'s `setVerbosity` to set\n * a verbosity level of `$level` or lower. (defaults to `\"log\"`).\n *\n * The user will either be presented with a link to the documentation for the message,\n * or they can use the `loadDevMessages` to add the message strings to the bundle.\n * The documentation will display the message without argument substitution.\n * Instead, the arguments will be printed on the console after the link.\n *\n * `message` can only be a string, a concatenation of strings, or a ternary statement\n * that results in a string. This will be enforced on build, where the message will\n * be replaced with a message number.\n *\n * String substitutions like %s, %o, %d or %f are supported.\n */\n (message?: any, ...optionalParams: unknown[]): void;\n};\n\ntype WrappedInvariant = {\n /**\n * Throws and InvariantError with the given message if the condition is false.\n *\n * `message` can only be a string, a concatenation of strings, or a ternary statement\n * that results in a string. This will be enforced on build, where the message will\n * be replaced with a message number.\n *\n * The user will either be presented with a link to the documentation for the message,\n * or they can use the `loadErrorMessages` to add the message strings to the bundle.\n * The documentation will display the message with the arguments substituted.\n *\n * String substitutions with %s are supported and will also return\n * pretty-stringified objects.\n * Excess `optionalParams` will be swallowed.\n */\n (\n condition: any,\n message?: string | number,\n ...optionalParams: unknown[]\n ): asserts condition;\n\n debug: LogFunction;\n log: LogFunction;\n warn: LogFunction;\n error: LogFunction;\n};\nconst invariant: WrappedInvariant = Object.assign(\n function invariant(\n condition: any,\n message?: string | number,\n ...args: unknown[]\n ): asserts condition {\n if (!condition) {\n originalInvariant(\n condition,\n getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args)\n );\n }\n },\n {\n debug: wrap(originalInvariant.debug),\n log: wrap(originalInvariant.log),\n warn: wrap(originalInvariant.warn),\n error: wrap(originalInvariant.error),\n }\n);\n\n/**\n * Returns an InvariantError.\n *\n * `message` can only be a string, a concatenation of strings, or a ternary statement\n * that results in a string. This will be enforced on build, where the message will\n * be replaced with a message number.\n * String substitutions with %s are supported and will also return\n * pretty-stringified objects.\n * Excess `optionalParams` will be swallowed.\n */\nfunction newInvariantError(\n message?: string | number,\n ...optionalParams: unknown[]\n) {\n return new InvariantError(\n getHandledErrorMsg(message, optionalParams) ||\n getFallbackErrorMsg(message, optionalParams)\n );\n}\n\nconst ApolloErrorMessageHandler = Symbol.for(\n \"ApolloErrorMessageHandler_\" + version\n);\ndeclare global {\n interface Window {\n [ApolloErrorMessageHandler]?: {\n (message: string | number, args: unknown[]): string | undefined;\n } & ErrorCodes;\n }\n}\n\nfunction stringify(arg: any) {\n return typeof arg == \"string\"\n ? arg\n : stringifyForDisplay(arg, 2).slice(0, 1000);\n}\n\nfunction getHandledErrorMsg(\n message?: string | number,\n messageArgs: unknown[] = []\n) {\n if (!message) return;\n return (\n global[ApolloErrorMessageHandler] &&\n global[ApolloErrorMessageHandler](message, messageArgs.map(stringify))\n );\n}\n\nfunction getFallbackErrorMsg(\n message?: string | number,\n messageArgs: unknown[] = []\n) {\n if (!message) return;\n return `An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(\n JSON.stringify({\n version,\n message,\n args: messageArgs.map(stringify),\n })\n )}`;\n}\n\nexport {\n invariant,\n InvariantError,\n newInvariantError,\n ApolloErrorMessageHandler,\n};\n","import {\n invariant,\n newInvariantError,\n InvariantError,\n} from \"./invariantWrappers.js\";\n\nexport { maybe } from \"./maybe.js\";\nexport { default as global } from \"./global.js\";\nexport { invariant, newInvariantError, InvariantError };\n\n/**\n * @deprecated we do not use this internally anymore,\n * it is just exported for backwards compatibility\n */\n// this file is extempt from automatic `__DEV__` replacement\n// so we have to write it out here\n// @ts-ignore\nexport const DEV = globalThis.__DEV__ !== false;\nexport { DEV as __DEV__ };\n","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n// === Symbol Support ===\nvar hasSymbols = function () {\n return typeof Symbol === 'function';\n};\n\nvar hasSymbol = function (name) {\n return hasSymbols() && Boolean(Symbol[name]);\n};\n\nvar getSymbol = function (name) {\n return hasSymbol(name) ? Symbol[name] : '@@' + name;\n};\n\nif (hasSymbols() && !hasSymbol('observable')) {\n Symbol.observable = Symbol('observable');\n}\n\nvar SymbolIterator = getSymbol('iterator');\nvar SymbolObservable = getSymbol('observable');\nvar SymbolSpecies = getSymbol('species'); // === Abstract Operations ===\n\nfunction getMethod(obj, key) {\n var value = obj[key];\n if (value == null) return undefined;\n if (typeof value !== 'function') throw new TypeError(value + ' is not a function');\n return value;\n}\n\nfunction getSpecies(obj) {\n var ctor = obj.constructor;\n\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n\n if (ctor === null) {\n ctor = undefined;\n }\n }\n\n return ctor !== undefined ? ctor : Observable;\n}\n\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\n\nfunction hostReportError(e) {\n if (hostReportError.log) {\n hostReportError.log(e);\n } else {\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nfunction enqueue(fn) {\n Promise.resolve().then(function () {\n try {\n fn();\n } catch (e) {\n hostReportError(e);\n }\n });\n}\n\nfunction cleanupSubscription(subscription) {\n var cleanup = subscription._cleanup;\n if (cleanup === undefined) return;\n subscription._cleanup = undefined;\n\n if (!cleanup) {\n return;\n }\n\n try {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n var unsubscribe = getMethod(cleanup, 'unsubscribe');\n\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n } catch (e) {\n hostReportError(e);\n }\n}\n\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = 'closed';\n}\n\nfunction flushSubscription(subscription) {\n var queue = subscription._queue;\n\n if (!queue) {\n return;\n }\n\n subscription._queue = undefined;\n subscription._state = 'ready';\n\n for (var i = 0; i < queue.length; ++i) {\n notifySubscription(subscription, queue[i].type, queue[i].value);\n if (subscription._state === 'closed') break;\n }\n}\n\nfunction notifySubscription(subscription, type, value) {\n subscription._state = 'running';\n var observer = subscription._observer;\n\n try {\n var m = getMethod(observer, type);\n\n switch (type) {\n case 'next':\n if (m) m.call(observer, value);\n break;\n\n case 'error':\n closeSubscription(subscription);\n if (m) m.call(observer, value);else throw value;\n break;\n\n case 'complete':\n closeSubscription(subscription);\n if (m) m.call(observer);\n break;\n }\n } catch (e) {\n hostReportError(e);\n }\n\n if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready';\n}\n\nfunction onNotify(subscription, type, value) {\n if (subscription._state === 'closed') return;\n\n if (subscription._state === 'buffering') {\n subscription._queue.push({\n type: type,\n value: value\n });\n\n return;\n }\n\n if (subscription._state !== 'ready') {\n subscription._state = 'buffering';\n subscription._queue = [{\n type: type,\n value: value\n }];\n enqueue(function () {\n return flushSubscription(subscription);\n });\n return;\n }\n\n notifySubscription(subscription, type, value);\n}\n\nvar Subscription = /*#__PURE__*/function () {\n function Subscription(observer, subscriber) {\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = 'initializing';\n var subscriptionObserver = new SubscriptionObserver(this);\n\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n } catch (e) {\n subscriptionObserver.error(e);\n }\n\n if (this._state === 'initializing') this._state = 'ready';\n }\n\n var _proto = Subscription.prototype;\n\n _proto.unsubscribe = function unsubscribe() {\n if (this._state !== 'closed') {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n };\n\n _createClass(Subscription, [{\n key: \"closed\",\n get: function () {\n return this._state === 'closed';\n }\n }]);\n\n return Subscription;\n}();\n\nvar SubscriptionObserver = /*#__PURE__*/function () {\n function SubscriptionObserver(subscription) {\n this._subscription = subscription;\n }\n\n var _proto2 = SubscriptionObserver.prototype;\n\n _proto2.next = function next(value) {\n onNotify(this._subscription, 'next', value);\n };\n\n _proto2.error = function error(value) {\n onNotify(this._subscription, 'error', value);\n };\n\n _proto2.complete = function complete() {\n onNotify(this._subscription, 'complete');\n };\n\n _createClass(SubscriptionObserver, [{\n key: \"closed\",\n get: function () {\n return this._subscription._state === 'closed';\n }\n }]);\n\n return SubscriptionObserver;\n}();\n\nvar Observable = /*#__PURE__*/function () {\n function Observable(subscriber) {\n if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function');\n if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function');\n this._subscriber = subscriber;\n }\n\n var _proto3 = Observable.prototype;\n\n _proto3.subscribe = function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n observer = {\n next: observer,\n error: arguments[1],\n complete: arguments[2]\n };\n }\n\n return new Subscription(observer, this._subscriber);\n };\n\n _proto3.forEach = function forEach(fn) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n if (typeof fn !== 'function') {\n reject(new TypeError(fn + ' is not a function'));\n return;\n }\n\n function done() {\n subscription.unsubscribe();\n resolve();\n }\n\n var subscription = _this.subscribe({\n next: function (value) {\n try {\n fn(value, done);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n };\n\n _proto3.map = function map(fn) {\n var _this2 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this2.subscribe({\n next: function (value) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n };\n\n _proto3.filter = function filter(fn) {\n var _this3 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n return _this3.subscribe({\n next: function (value) {\n try {\n if (!fn(value)) return;\n } catch (e) {\n return observer.error(e);\n }\n\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n observer.complete();\n }\n });\n });\n };\n\n _proto3.reduce = function reduce(fn) {\n var _this4 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n var hasSeed = arguments.length > 1;\n var hasValue = false;\n var seed = arguments[1];\n var acc = seed;\n return new C(function (observer) {\n return _this4.subscribe({\n next: function (value) {\n var first = !hasValue;\n hasValue = true;\n\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n } catch (e) {\n return observer.error(e);\n }\n } else {\n acc = value;\n }\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence'));\n observer.next(acc);\n observer.complete();\n }\n });\n });\n };\n\n _proto3.concat = function concat() {\n var _this5 = this;\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscription;\n var index = 0;\n\n function startNext(next) {\n subscription = next.subscribe({\n next: function (v) {\n observer.next(v);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n } else {\n startNext(C.from(sources[index++]));\n }\n }\n });\n }\n\n startNext(_this5);\n return function () {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n };\n\n _proto3.flatMap = function flatMap(fn) {\n var _this6 = this;\n\n if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function');\n var C = getSpecies(this);\n return new C(function (observer) {\n var subscriptions = [];\n\n var outer = _this6.subscribe({\n next: function (value) {\n if (fn) {\n try {\n value = fn(value);\n } catch (e) {\n return observer.error(e);\n }\n }\n\n var inner = C.from(value).subscribe({\n next: function (value) {\n observer.next(value);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n var i = subscriptions.indexOf(inner);\n if (i >= 0) subscriptions.splice(i, 1);\n completeIfDone();\n }\n });\n subscriptions.push(inner);\n },\n error: function (e) {\n observer.error(e);\n },\n complete: function () {\n completeIfDone();\n }\n });\n\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) observer.complete();\n }\n\n return function () {\n subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n outer.unsubscribe();\n };\n });\n };\n\n _proto3[SymbolObservable] = function () {\n return this;\n };\n\n Observable.from = function from(x) {\n var C = typeof this === 'function' ? this : Observable;\n if (x == null) throw new TypeError(x + ' is not an object');\n var method = getMethod(x, SymbolObservable);\n\n if (method) {\n var observable = method.call(x);\n if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object');\n if (isObservable(observable) && observable.constructor === C) return observable;\n return new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n\n if (hasSymbol('iterator')) {\n method = getMethod(x, SymbolIterator);\n\n if (method) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var _iterator = _createForOfIteratorHelperLoose(method.call(x)), _step; !(_step = _iterator()).done;) {\n var item = _step.value;\n observer.next(item);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n }\n\n if (Array.isArray(x)) {\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < x.length; ++i) {\n observer.next(x[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n }\n\n throw new TypeError(x + ' is not observable');\n };\n\n Observable.of = function of() {\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n var C = typeof this === 'function' ? this : Observable;\n return new C(function (observer) {\n enqueue(function () {\n if (observer.closed) return;\n\n for (var i = 0; i < items.length; ++i) {\n observer.next(items[i]);\n if (observer.closed) return;\n }\n\n observer.complete();\n });\n });\n };\n\n _createClass(Observable, null, [{\n key: SymbolSpecies,\n get: function () {\n return this;\n }\n }]);\n\n return Observable;\n}();\n\nif (hasSymbols()) {\n Object.defineProperty(Observable, Symbol('extensions'), {\n value: {\n symbol: SymbolObservable,\n hostReportError: hostReportError\n },\n configurable: true\n });\n}\n\nexport { Observable };\n","export function isNonNullObject(obj: any): obj is Record {\n return obj !== null && typeof obj === \"object\";\n}\n\nexport function isPlainObject(obj: any): obj is Record {\n return (\n obj !== null &&\n typeof obj === \"object\" &&\n (Object.getPrototypeOf(obj) === Object.prototype ||\n Object.getPrototypeOf(obj) === null)\n );\n}\n","import { invariant, newInvariantError } from \"../globals/index.js\";\n\nimport type {\n DocumentNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionNode,\n} from \"graphql\";\n\n// TODO(brian): A hack until this issue is resolved (https://github.com/graphql/graphql-js/issues/3356)\ntype Kind = any;\ntype OperationTypeNode = any;\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach((definition) => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === \"OperationDefinition\") {\n throw newInvariantError(\n `Found a %s operation%s. ` +\n \"No operations are allowed when using a fragment as a query. Only fragments are allowed.\",\n definition.operation,\n definition.name ? ` named '${definition.name.value}'` : \"\"\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === \"FragmentDefinition\") {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === \"undefined\") {\n invariant(\n fragments.length === 1,\n `Found %s fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n fragments.length\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: \"OperationDefinition\" as Kind,\n // OperationTypeNode is an enum\n operation: \"query\" as OperationTypeNode,\n selectionSet: {\n kind: \"SelectionSet\" as Kind,\n selections: [\n {\n kind: \"FragmentSpread\" as Kind,\n name: {\n kind: \"Name\" as Kind,\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\nexport type FragmentMapFunction = (\n fragmentName: string\n) => FragmentDefinitionNode | null;\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = []\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach((fragment) => {\n symTable[fragment.name.value] = fragment;\n });\n return symTable;\n}\n\nexport function getFragmentFromSelection(\n selection: SelectionNode,\n fragmentMap?: FragmentMap | FragmentMapFunction\n): InlineFragmentNode | FragmentDefinitionNode | null {\n switch (selection.kind) {\n case \"InlineFragment\":\n return selection;\n case \"FragmentSpread\": {\n const fragmentName = selection.name.value;\n if (typeof fragmentMap === \"function\") {\n return fragmentMap(fragmentName);\n }\n const fragment = fragmentMap && fragmentMap[fragmentName];\n invariant(fragment, `No fragment named %s`, fragmentName);\n return fragment || null;\n }\n default:\n return null;\n }\n}\n","import { newInvariantError } from \"../globals/index.js\";\n\nimport type {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n SelectionSetNode,\n DocumentNode,\n FragmentSpreadNode,\n} from \"graphql\";\n\nimport { isNonNullObject } from \"../common/objects.js\";\nimport type { FragmentMap } from \"./fragments.js\";\nimport { getFragmentFromSelection } from \"./fragments.js\";\n\nexport interface Reference {\n readonly __ref: string;\n}\n\nexport function makeReference(id: string): Reference {\n return { __ref: String(id) };\n}\n\nexport function isReference(obj: any): obj is Reference {\n return Boolean(\n obj && typeof obj === \"object\" && typeof obj.__ref === \"string\"\n );\n}\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | Reference\n | Reference[]\n | null\n | undefined\n | void\n | Object;\n\nexport interface StoreObject {\n __typename?: string;\n [storeFieldName: string]: StoreValue;\n}\n\n/**\n * Workaround for a TypeScript quirk:\n * types per default have an implicit index signature that makes them\n * assignable to `StoreObject`.\n * interfaces do not have that implicit index signature, so they cannot\n * be assigned to `StoreObject`.\n * This type just maps over a type or interface that is passed in,\n * implicitly adding the index signature.\n * That way, the result can be assigned to `StoreObject`.\n *\n * This is important if some user-defined interface is used e.g.\n * in cache.modify, where the `toReference` method expects a\n * `StoreObject` as input.\n */\nexport type AsStoreObject = {\n [K in keyof T]: T[K];\n};\n\nexport function isDocumentNode(value: any): value is DocumentNode {\n return (\n isNonNullObject(value) &&\n (value as DocumentNode).kind === \"Document\" &&\n Array.isArray((value as DocumentNode).definitions)\n );\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === \"StringValue\";\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === \"BooleanValue\";\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === \"IntValue\";\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === \"FloatValue\";\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === \"Variable\";\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === \"ObjectValue\";\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === \"ListValue\";\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === \"EnumValue\";\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === \"NullValue\";\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map((obj) =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables)\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map((listValue) => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw newInvariantError(\n `The inline argument \"%s\" of kind \"%s\"` +\n \"is not supported. Use variables instead of inline arguments to \" +\n \"overcome this limitation.\",\n name.value,\n (value as any).kind\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach((directive) => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables\n )\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables)\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n \"connection\",\n \"include\",\n \"skip\",\n \"client\",\n \"rest\",\n \"export\",\n \"nonreactive\",\n];\n\nexport const getStoreKeyName = Object.assign(\n function (\n fieldName: string,\n args?: Record | null,\n directives?: Directives\n ): string {\n if (\n args &&\n directives &&\n directives[\"connection\"] &&\n directives[\"connection\"][\"key\"]\n ) {\n if (\n directives[\"connection\"][\"filter\"] &&\n (directives[\"connection\"][\"filter\"] as string[]).length > 0\n ) {\n const filterKeys = directives[\"connection\"][\"filter\"]\n ? (directives[\"connection\"][\"filter\"] as string[])\n : [];\n filterKeys.sort();\n\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach((key) => {\n filteredArgs[key] = args[key];\n });\n\n return `${directives[\"connection\"][\"key\"]}(${stringify(filteredArgs)})`;\n } else {\n return directives[\"connection\"][\"key\"];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach((key) => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n },\n {\n setStringify(s: typeof stringify) {\n const previous = stringify;\n stringify = s;\n return previous;\n },\n }\n);\n\n// Default stable JSON.stringify implementation. Can be updated/replaced with\n// something better by calling getStoreKeyName.setStringify.\nlet stringify = function defaultStringify(value: any): string {\n return JSON.stringify(value, stringifyReplacer);\n};\n\nfunction stringifyReplacer(_key: string, value: any): any {\n if (isNonNullObject(value) && !Array.isArray(value)) {\n value = Object.keys(value)\n .sort()\n .reduce(\n (copy, key) => {\n copy[key] = value[key];\n return copy;\n },\n {} as Record \n );\n }\n return value;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables?: Record \n): Object | null {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables)\n );\n return argObj;\n }\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function getTypenameFromResult(\n result: Record ,\n selectionSet: SelectionSetNode,\n fragmentMap?: FragmentMap\n): string | undefined {\n let fragments: undefined | Array ;\n for (const selection of selectionSet.selections) {\n if (isField(selection)) {\n if (selection.name.value === \"__typename\") {\n return result[resultKeyNameFromField(selection)];\n }\n } else if (fragments) {\n fragments.push(selection);\n } else {\n fragments = [selection];\n }\n }\n if (typeof result.__typename === \"string\") {\n return result.__typename;\n }\n if (fragments) {\n for (const selection of fragments) {\n const typename = getTypenameFromResult(\n result,\n getFragmentFromSelection(selection, fragmentMap)!.selectionSet,\n fragmentMap\n );\n if (typeof typename === \"string\") {\n return typename;\n }\n }\n }\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === \"Field\";\n}\n\nexport function isInlineFragment(\n selection: SelectionNode\n): selection is InlineFragmentNode {\n return selection.kind === \"InlineFragment\";\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n","import { invariant, newInvariantError } from \"../globals/index.js\";\n\nimport type {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from \"graphql\";\n\nimport { valueToObjectRepresentation } from \"./storeUtils.js\";\n\ntype OperationDefinitionWithName = OperationDefinitionNode & {\n name: NonNullable ;\n};\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === \"Document\",\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`\n );\n\n const operations = doc.definitions\n .filter((d) => d.kind !== \"FragmentDefinition\")\n .map((definition) => {\n if (definition.kind !== \"OperationDefinition\") {\n throw newInvariantError(\n `Schema type definitions not allowed in queries. Found: \"%s\"`,\n definition.kind\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains %s operations`,\n operations.length\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n (definition): definition is OperationDefinitionNode =>\n definition.kind === \"OperationDefinition\"\n )[0];\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n (definition): definition is OperationDefinitionWithName =>\n definition.kind === \"OperationDefinition\" && !!definition.name\n )\n .map((x) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n (definition): definition is FragmentDefinitionNode =>\n definition.kind === \"FragmentDefinition\"\n );\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc)!;\n\n invariant(\n queryDef && queryDef.operation === \"query\",\n \"Must contain a query definition.\"\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode\n): FragmentDefinitionNode {\n invariant(\n doc.kind === \"Document\",\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`\n );\n\n invariant(\n doc.definitions.length <= 1,\n \"Fragment must have exactly one definition.\"\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === \"FragmentDefinition\",\n \"Must be a fragment definition.\"\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === \"OperationDefinition\") {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === \"query\" ||\n operation === \"mutation\" ||\n operation === \"subscription\"\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === \"FragmentDefinition\" && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw newInvariantError(\n \"Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.\"\n );\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined\n): Record {\n const defaultValues = Object.create(null);\n const defs = definition && definition.variableDefinitions;\n if (defs && defs.length) {\n defs.forEach((def) => {\n if (def.defaultValue) {\n valueToObjectRepresentation(\n defaultValues,\n def.variable.name,\n def.defaultValue as ValueNode\n );\n }\n });\n }\n return defaultValues;\n}\n","import { newInvariantError, invariant } from \"../../utilities/globals/index.js\";\n\nimport type { Observer } from \"../../utilities/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport type {\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n GraphQLRequest,\n} from \"./types.js\";\nimport {\n validateOperation,\n createOperation,\n transformOperation,\n} from \"../utils/index.js\";\n\nfunction passthrough(op: Operation, forward: NextLink) {\n return (forward ? forward(op) : Observable.of()) as Observable ;\n}\n\nfunction toLink(handler: RequestHandler | ApolloLink) {\n return typeof handler === \"function\" ? new ApolloLink(handler) : handler;\n}\n\nfunction isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport class ApolloLink {\n public static empty(): ApolloLink {\n return new ApolloLink(() => Observable.of());\n }\n\n public static from(links: (ApolloLink | RequestHandler)[]): ApolloLink {\n if (links.length === 0) return ApolloLink.empty();\n return links.map(toLink).reduce((x, y) => x.concat(y)) as ApolloLink;\n }\n\n public static split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler\n ): ApolloLink {\n const leftLink = toLink(left);\n const rightLink = toLink(right || new ApolloLink(passthrough));\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink((operation) => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n }\n\n public static execute(\n link: ApolloLink,\n operation: GraphQLRequest\n ): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation))\n )\n ) || Observable.of()\n );\n }\n\n public static concat(\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler\n ) {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n invariant.warn(\n `You are calling concat on a terminating link, which will have no effect %o`,\n firstLink\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n (operation) =>\n firstLink.request(\n operation,\n (op) => nextLink.request(op) || Observable.of()\n ) || Observable.of()\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, (op) => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n }\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler\n ): ApolloLink {\n return this.concat(\n ApolloLink.split(test, left, right || new ApolloLink(passthrough))\n );\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return ApolloLink.concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink\n ): Observable | null {\n throw newInvariantError(\"request is not implemented\");\n }\n\n protected onError(\n error: any,\n observer?: Observer \n ): false | void {\n if (observer && observer.error) {\n observer.error(error);\n // Returning false indicates that observer.error does not need to be\n // called again, since it was already called (on the previous line).\n // Calling observer.error again would not cause any real problems,\n // since only the first call matters, but custom onError functions\n // might have other reasons for wanting to prevent the default\n // behavior by returning false.\n return false;\n }\n // Throw errors will be passed to observer.error.\n throw error;\n }\n\n public setOnError(fn: ApolloLink[\"onError\"]): this {\n this.onError = fn;\n return this;\n }\n}\n","import type { GraphQLRequest, Operation } from \"../core/index.js\";\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest\n): Operation {\n let context = { ...starting };\n const setContext = (next: any) => {\n if (typeof next === \"function\") {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, \"setContext\", {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, \"getContext\", {\n enumerable: false,\n value: getContext,\n });\n\n return operation as Operation;\n}\n","import type { GraphQLRequest, Operation } from \"../core/index.js\";\nimport { getOperationName } from \"../../utilities/index.js\";\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // Best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== \"string\"\n ? getOperationName(transformedOperation.query) || undefined\n : \"\";\n }\n\n return transformedOperation as Operation;\n}\n","import { newInvariantError } from \"../../utilities/globals/index.js\";\nimport type { GraphQLRequest } from \"../core/index.js\";\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n \"query\",\n \"operationName\",\n \"variables\",\n \"extensions\",\n \"context\",\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw newInvariantError(`illegal argument: %s`, key);\n }\n }\n\n return operation;\n}\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isNode, QueryDocumentKeys } from './ast.mjs';\nimport { Kind } from './kinds.mjs';\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport const BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * ```ts\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n * ```\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to three permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n * ```\n *\n * 2) Named visitors that trigger upon entering and leaving a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n * ```\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * ```ts\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n * ```\n */\n\nexport function visit(root, visitor, visitorKeys = QueryDocumentKeys) {\n const enterLeaveMap = new Map();\n\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n /* eslint-disable no-undef-init */\n\n let stack = undefined;\n let inArray = Array.isArray(root);\n let keys = [root];\n let index = -1;\n let edits = [];\n let node = root;\n let key = undefined;\n let parent = undefined;\n const path = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n let editOffset = 0;\n\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = Object.defineProperties(\n {},\n Object.getOwnPropertyDescriptors(node),\n );\n\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent) {\n key = inArray ? index : keys[index];\n node = parent[key];\n\n if (node === null || node === undefined) {\n continue;\n }\n\n path.push(key);\n }\n\n let result;\n\n if (!Array.isArray(node)) {\n var _enterLeaveMap$get, _enterLeaveMap$get2;\n\n isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);\n const visitFn = isLeaving\n ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get === void 0\n ? void 0\n : _enterLeaveMap$get.leave\n : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get2 === void 0\n ? void 0\n : _enterLeaveMap$get2.enter;\n result =\n visitFn === null || visitFn === void 0\n ? void 0\n : visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _node$kind;\n\n stack = {\n inArray,\n index,\n keys,\n edits,\n prev: stack,\n };\n inArray = Array.isArray(node);\n keys = inArray\n ? node\n : (_node$kind = visitorKeys[node.kind]) !== null &&\n _node$kind !== void 0\n ? _node$kind\n : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits[edits.length - 1][1];\n }\n\n return root;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor || (hasVisitor = enter != null || leave != null);\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave = {\n enter(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _enterList$i;\n\n const result =\n (_enterList$i = enterList[i]) === null || _enterList$i === void 0\n ? void 0\n : _enterList$i.apply(visitors[i], args);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n\n leave(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _leaveList$i;\n\n const result =\n (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0\n ? void 0\n : _leaveList$i.apply(visitors[i], args);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n */\n\nexport function getEnterLeaveForKind(visitor, kind) {\n const kindVisitor = visitor[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return {\n enter: kindVisitor,\n leave: undefined,\n };\n } // { enter() {}, leave() {} }\n\n return {\n enter: visitor.enter,\n leave: visitor.leave,\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n *\n * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17\n */\n\n/* c8 ignore next 8 */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n const { enter, leave } = getEnterLeaveForKind(visitor, kind);\n return isLeaving ? leave : enter;\n}\n","import { invariant } from \"../globals/index.js\";\n\n// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport type {\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n ASTNode,\n} from \"graphql\";\nimport { visit, BREAK } from \"graphql\";\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function shouldInclude(\n { directives }: SelectionNode,\n variables?: Record \n): boolean {\n if (!directives || !directives.length) {\n return true;\n }\n return getInclusionDirectives(directives).every(\n ({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === \"Variable\") {\n evaledValue =\n variables && variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @%s directive.`,\n directive.name.value\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === \"skip\" ? !evaledValue : evaledValue;\n }\n );\n}\n\nexport function getDirectiveNames(root: ASTNode) {\n const names: string[] = [];\n\n visit(root, {\n Directive(node: DirectiveNode) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport const hasAnyDirectives = (names: string[], root: ASTNode) =>\n hasDirectives(names, root, false);\n\nexport const hasAllDirectives = (names: string[], root: ASTNode) =>\n hasDirectives(names, root, true);\n\nexport function hasDirectives(names: string[], root: ASTNode, all?: boolean) {\n const nameSet = new Set(names);\n const uniqueCount = nameSet.size;\n\n visit(root, {\n Directive(node) {\n if (nameSet.delete(node.name.value) && (!all || !nameSet.size)) {\n return BREAK;\n }\n },\n });\n\n // If we found all the names, nameSet will be empty. If we only care about\n // finding some of them, the < condition is sufficient.\n return all ? !nameSet.size : nameSet.size < uniqueCount;\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return document && hasDirectives([\"client\", \"export\"], document, true);\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === \"skip\" || value === \"include\";\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray \n): InclusionDirectives {\n const result: InclusionDirectives = [];\n\n if (directives && directives.length) {\n directives.forEach((directive) => {\n if (!isInclusionDirective(directive)) return;\n\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @%s directive.`,\n directiveName\n );\n\n const ifArgument = directiveArguments![0];\n invariant(\n ifArgument.name && ifArgument.name.value === \"if\",\n `Invalid argument for the @%s directive.`,\n directiveName\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\"),\n `Argument for the @%s directive must be a variable or a boolean value.`,\n directiveName\n );\n\n result.push({ directive, ifArgument });\n });\n }\n\n return result;\n}\n","import { newInvariantError } from \"../../utilities/globals/index.js\";\nimport type { InvariantError } from \"../../utilities/globals/index.js\";\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport const serializeFetchParameter = (p: any, label: string) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = newInvariantError(\n `Network request failed. %s is not serializable: %s`,\n label,\n e.message\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n","import { maybe } from \"../globals/index.js\";\n\nexport const canUseWeakMap =\n typeof WeakMap === \"function\" &&\n maybe(() => navigator.product) !== \"ReactNative\";\n\nexport const canUseWeakSet = typeof WeakSet === \"function\";\n\nexport const canUseSymbol =\n typeof Symbol === \"function\" && typeof Symbol.for === \"function\";\n\nexport const canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;\n\nexport const canUseDOM =\n typeof maybe(() => window.document.createElement) === \"function\";\n\nconst usingJSDOM: boolean =\n // Following advice found in this comment from @domenic (maintainer of jsdom):\n // https://github.com/jsdom/jsdom/issues/1537#issuecomment-229405327\n //\n // Since we control the version of Jest and jsdom used when running Apollo\n // Client tests, and that version is recent enought to include \" jsdom/x.y.z\"\n // at the end of the user agent string, I believe this case is all we need to\n // check. Testing for \"Node.js\" was recommended for backwards compatibility\n // with older version of jsdom, but we don't have that problem.\n maybe(() => navigator.userAgent.indexOf(\"jsdom\") >= 0) || false;\n\n// Our tests should all continue to pass if we remove this !usingJSDOM\n// condition, thereby allowing useLayoutEffect when using jsdom. Unfortunately,\n// if we allow useLayoutEffect, then useSyncExternalStore generates many\n// warnings about useLayoutEffect doing nothing on the server. While these\n// warnings are harmless, this !usingJSDOM condition seems to be the best way to\n// prevent them (i.e. skipping useLayoutEffect when using jsdom).\nexport const canUseLayoutEffect = canUseDOM && !usingJSDOM;\n","/**\n * Original source:\n * https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/nodeStream.ts\n */\n\nimport type { Readable as NodeReadableStream } from \"stream\";\nimport { canUseAsyncIteratorSymbol } from \"../../../utilities/index.js\";\n\ninterface NodeStreamIterator {\n next(): Promise >;\n [Symbol.asyncIterator]?(): AsyncIterator ;\n}\n\nexport default function nodeStreamIterator (\n stream: NodeReadableStream\n): AsyncIterableIterator {\n let cleanup: (() => void) | null = null;\n let error: Error | null = null;\n let done = false;\n const data: unknown[] = [];\n\n const waiting: [\n (\n value:\n | IteratorResult \n | PromiseLike >\n ) => void,\n (reason?: any) => void,\n ][] = [];\n\n function onData(chunk: any) {\n if (error) return;\n if (waiting.length) {\n const shiftedArr = waiting.shift();\n if (Array.isArray(shiftedArr) && shiftedArr[0]) {\n return shiftedArr[0]({ value: chunk, done: false });\n }\n }\n data.push(chunk);\n }\n function onError(err: Error) {\n error = err;\n const all = waiting.slice();\n all.forEach(function (pair) {\n pair[1](err);\n });\n !cleanup || cleanup();\n }\n function onEnd() {\n done = true;\n const all = waiting.slice();\n all.forEach(function (pair) {\n pair[0]({ value: undefined, done: true });\n });\n !cleanup || cleanup();\n }\n\n cleanup = function () {\n cleanup = null;\n stream.removeListener(\"data\", onData);\n stream.removeListener(\"error\", onError);\n stream.removeListener(\"end\", onEnd);\n stream.removeListener(\"finish\", onEnd);\n stream.removeListener(\"close\", onEnd);\n };\n stream.on(\"data\", onData);\n stream.on(\"error\", onError);\n stream.on(\"end\", onEnd);\n stream.on(\"finish\", onEnd);\n stream.on(\"close\", onEnd);\n\n function getNext(): Promise > {\n return new Promise(function (resolve, reject) {\n if (error) return reject(error);\n if (data.length)\n return resolve({ value: data.shift() as T, done: false });\n if (done) return resolve({ value: undefined, done: true });\n waiting.push([resolve, reject]);\n });\n }\n\n const iterator: NodeStreamIterator = {\n next(): Promise > {\n return getNext();\n },\n };\n\n if (canUseAsyncIteratorSymbol) {\n iterator[Symbol.asyncIterator] = function (): AsyncIterator {\n return this;\n };\n }\n\n return iterator as AsyncIterableIterator ;\n}\n","/**\n * Original source:\n * https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/reader.ts\n */\n\nimport { canUseAsyncIteratorSymbol } from \"../../../utilities/index.js\";\n\ninterface ReaderIterator {\n next(): Promise >;\n [Symbol.asyncIterator]?(): AsyncIterator ;\n}\n\nexport default function readerIterator (\n reader: ReadableStreamDefaultReader \n): AsyncIterableIterator {\n const iterator: ReaderIterator = {\n next() {\n return reader.read();\n },\n };\n\n if (canUseAsyncIteratorSymbol) {\n iterator[Symbol.asyncIterator] = function (): AsyncIterator {\n return this;\n };\n }\n\n return iterator as AsyncIterableIterator ;\n}\n","/**\n * Original source:\n * https://github.com/kmalakoff/response-iterator/blob/master/src/index.ts\n */\n\nimport type { Response as NodeResponse } from \"node-fetch\";\nimport type { Readable as NodeReadableStream } from \"stream\";\nimport { canUseAsyncIteratorSymbol } from \"../../utilities/index.js\";\n\nimport asyncIterator from \"./iterators/async.js\";\nimport nodeStreamIterator from \"./iterators/nodeStream.js\";\nimport promiseIterator from \"./iterators/promise.js\";\nimport readerIterator from \"./iterators/reader.js\";\n\nfunction isNodeResponse(value: any): value is NodeResponse {\n return !!(value as NodeResponse).body;\n}\n\nfunction isReadableStream(value: any): value is ReadableStream {\n return !!(value as ReadableStream ).getReader;\n}\n\nfunction isAsyncIterableIterator(\n value: any\n): value is AsyncIterableIterator {\n return !!(\n canUseAsyncIteratorSymbol &&\n (value as AsyncIterableIterator )[Symbol.asyncIterator]\n );\n}\n\nfunction isStreamableBlob(value: any): value is Blob {\n return !!(value as Blob).stream;\n}\n\nfunction isBlob(value: any): value is Blob {\n return !!(value as Blob).arrayBuffer;\n}\n\nfunction isNodeReadableStream(value: any): value is NodeReadableStream {\n return !!(value as NodeReadableStream).pipe;\n}\n\nexport function responseIterator (\n response: Response | NodeResponse\n): AsyncIterableIterator {\n let body: unknown = response;\n\n if (isNodeResponse(response)) body = response.body;\n\n if (isAsyncIterableIterator(body)) return asyncIterator (body);\n\n if (isReadableStream(body)) return readerIterator (body.getReader());\n\n // this errors without casting to ReadableStream \n // because Blob.stream() returns a NodeJS ReadableStream\n if (isStreamableBlob(body)) {\n return readerIterator (\n (body.stream() as unknown as ReadableStream ).getReader()\n );\n }\n\n if (isBlob(body)) return promiseIterator (body.arrayBuffer());\n\n if (isNodeReadableStream(body)) return nodeStreamIterator (body);\n\n throw new Error(\n \"Unknown body type for responseIterator. Please pass a streamable response.\"\n );\n}\n","/**\n * Original source:\n * https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/async.ts\n */\n\nexport default function asyncIterator (\n source: AsyncIterableIterator \n): AsyncIterableIterator {\n const iterator = source[Symbol.asyncIterator]();\n return {\n next(): Promise > {\n return iterator.next();\n },\n [Symbol.asyncIterator](): AsyncIterableIterator {\n return this;\n },\n };\n}\n","/**\n * Original source:\n * https://github.com/kmalakoff/response-iterator/blob/master/src/iterators/promise.ts\n */\n\nimport { canUseAsyncIteratorSymbol } from \"../../../utilities/index.js\";\n\ninterface PromiseIterator {\n next(): Promise >;\n [Symbol.asyncIterator]?(): AsyncIterator ;\n}\n\nexport default function promiseIterator (\n promise: Promise \n): AsyncIterableIterator {\n let resolved = false;\n\n const iterator: PromiseIterator = {\n next(): Promise