(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("i18next"), require("React"), require("dayjs"), require("antd")); else if(typeof define === 'function' && define.amd) define(["i18next", "React", "dayjs", "antd"], factory); else { var a = typeof exports === 'object' ? factory(require("i18next"), require("React"), require("dayjs"), require("antd")) : factory(root["i18next"], root["React"], root["dayjs"], root["antd"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(self, (__WEBPACK_EXTERNAL_MODULE__575__, __WEBPACK_EXTERNAL_MODULE__883__, __WEBPACK_EXTERNAL_MODULE__185__, __WEBPACK_EXTERNAL_MODULE__59__) => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 467: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { !function(e,s){ true?module.exports=s(__webpack_require__(185)):0}(this,(function(e){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=s(e),d={name:"lv",weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),weekStart:1,weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),ordinal:function(e){return e},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},relativeTime:{future:"pēc %s",past:"pirms %s",s:"dažām sekundēm",m:"minūtes",mm:"%d minūtēm",h:"stundas",hh:"%d stundām",d:"dienas",dd:"%d dienām",M:"mēneša",MM:"%d mēnešiem",y:"gada",yy:"%d gadiem"}};return t.default.locale(d,null,!0),d})); /***/ }), /***/ 799: /***/ ((__unused_webpack_module, exports) => { "use strict"; var __webpack_unused_export__; /** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference"); function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}__webpack_unused_export__=h;__webpack_unused_export__=g;__webpack_unused_export__=b;__webpack_unused_export__=l;__webpack_unused_export__=d;__webpack_unused_export__=q;__webpack_unused_export__=p;__webpack_unused_export__=c;__webpack_unused_export__=f;__webpack_unused_export__=e;__webpack_unused_export__=m; __webpack_unused_export__=n;__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(a){return v(a)===h};__webpack_unused_export__=function(a){return v(a)===g};__webpack_unused_export__=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};__webpack_unused_export__=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};__webpack_unused_export__=function(a){return v(a)===q};__webpack_unused_export__=function(a){return v(a)===p}; __webpack_unused_export__=function(a){return v(a)===c};__webpack_unused_export__=function(a){return v(a)===f};__webpack_unused_export__=function(a){return v(a)===e};__webpack_unused_export__=function(a){return v(a)===m};__webpack_unused_export__=function(a){return v(a)===n}; __webpack_unused_export__=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};__webpack_unused_export__=v; /***/ }), /***/ 363: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(799); } else {} /***/ }), /***/ 915: /***/ ((module) => { /** * This file automatically generated from `pre-publish.js`. * Do not manually edit. */ module.exports = { "area": true, "base": true, "br": true, "col": true, "embed": true, "hr": true, "img": true, "input": true, "link": true, "meta": true, "param": true, "source": true, "track": true, "wbr": true }; /***/ }), /***/ 883: /***/ ((module) => { "use strict"; module.exports = __WEBPACK_EXTERNAL_MODULE__883__; /***/ }), /***/ 59: /***/ ((module) => { "use strict"; module.exports = __WEBPACK_EXTERNAL_MODULE__59__; /***/ }), /***/ 185: /***/ ((module) => { "use strict"; module.exports = __WEBPACK_EXTERNAL_MODULE__185__; /***/ }), /***/ 575: /***/ ((module) => { "use strict"; module.exports = __WEBPACK_EXTERNAL_MODULE__575__; /***/ }), /***/ 942: /***/ ((module, exports) => { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = ''; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (arg) { classes = appendClass(classes, parseValue(arg)); } } return classes; } function parseValue (arg) { if (typeof arg === 'string' || typeof arg === 'number') { return arg; } if (typeof arg !== 'object') { return ''; } if (Array.isArray(arg)) { return classNames.apply(null, arg); } if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { return arg.toString(); } var classes = ''; for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes = appendClass(classes, key); } } return classes; } function appendClass (value, newClass) { if (!newClass) { return value; } if (value) { return value + ' ' + newClass; } return value + newClass; } if ( true && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { ViainvestLegacy: () => (/* binding */ ViainvestLegacy), renderComponent: () => (/* binding */ renderComponent) }); // NAMESPACE OBJECT: ./node_modules/axios/lib/platform/common/utils.js var common_utils_namespaceObject = {}; __webpack_require__.r(common_utils_namespaceObject); __webpack_require__.d(common_utils_namespaceObject, { hasBrowserEnv: () => (hasBrowserEnv), hasStandardBrowserEnv: () => (hasStandardBrowserEnv), hasStandardBrowserWebWorkerEnv: () => (hasStandardBrowserWebWorkerEnv), navigator: () => (_navigator), origin: () => (origin) }); // EXTERNAL MODULE: external "i18next" var external_i18next_ = __webpack_require__(575); var external_i18next_default = /*#__PURE__*/__webpack_require__.n(external_i18next_); // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(883); var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); // EXTERNAL MODULE: ./node_modules/void-elements/index.js var void_elements = __webpack_require__(915); var void_elements_default = /*#__PURE__*/__webpack_require__.n(void_elements); ;// ./node_modules/html-parse-stringify/dist/html-parse-stringify.module.js var t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],((void_elements_default())[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return{type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)})}return e.replace(r,function(r,s){if(m){if(r!=="")return;m=!1}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=n(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};/* harmony default export */ const html_parse_stringify_module = ((/* unused pure expression or super */ null && (c))); //# sourceMappingURL=html-parse-stringify.module.js.map ;// ./node_modules/react-i18next/dist/es/utils.js function utils_warn() { if (console && console.warn) { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (utils_isString(args[0])) args[0] = `react-i18next:: ${args[0]}`; console.warn(...args); } } const alreadyWarned = {}; function utils_warnOnce() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } if (utils_isString(args[0]) && alreadyWarned[args[0]]) return; if (utils_isString(args[0])) alreadyWarned[args[0]] = new Date(); utils_warn(...args); } const loadedClb = (i18n, cb) => () => { if (i18n.isInitialized) { cb(); } else { const initialized = () => { setTimeout(() => { i18n.off('initialized', initialized); }, 0); cb(); }; i18n.on('initialized', initialized); } }; const loadNamespaces = (i18n, ns, cb) => { i18n.loadNamespaces(ns, loadedClb(i18n, cb)); }; const loadLanguages = (i18n, lng, ns, cb) => { if (utils_isString(ns)) ns = [ns]; ns.forEach(n => { if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n); }); i18n.loadLanguages(lng, loadedClb(i18n, cb)); }; const oldI18nextHasLoadedNamespace = function (ns, i18n) { let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const lng = i18n.languages[0]; const fallbackLng = i18n.options ? i18n.options.fallbackLng : false; const lastLng = i18n.languages[i18n.languages.length - 1]; if (lng.toLowerCase() === 'cimode') return true; const loadNotPending = (l, n) => { const loadState = i18n.services.backendConnector.state[`${l}|${n}`]; return loadState === -1 || loadState === 2; }; if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false; if (i18n.hasResourceBundle(lng, ns)) return true; if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true; if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true; return false; }; const hasLoadedNamespace = function (ns, i18n) { let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; if (!i18n.languages || !i18n.languages.length) { utils_warnOnce('i18n.languages were undefined or empty', i18n.languages); return true; } const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined; if (!isNewerI18next) { return oldI18nextHasLoadedNamespace(ns, i18n, options); } return i18n.hasLoadedNamespace(ns, { lng: options.lng, precheck: (i18nInstance, loadNotPending) => { if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false; } }); }; const utils_getDisplayName = Component => Component.displayName || Component.name || (utils_isString(Component) && Component.length > 0 ? Component : 'Unknown'); const utils_isString = obj => typeof obj === 'string'; const utils_isObject = obj => typeof obj === 'object' && obj !== null; ;// ./node_modules/react-i18next/dist/es/unescape.js const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g; const htmlEntities = { '&': '&', '&': '&', '<': '<', '<': '<', '>': '>', '>': '>', ''': "'", ''': "'", '"': '"', '"': '"', ' ': ' ', ' ': ' ', '©': '©', '©': '©', '®': '®', '®': '®', '…': '…', '…': '…', '/': '/', '/': '/' }; const unescapeHtmlEntity = m => htmlEntities[m]; const unescape_unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity); ;// ./node_modules/react-i18next/dist/es/defaults.js let defaultOptions = { bindI18n: 'languageChanged', bindI18nStore: '', transEmptyNodeValue: '', transSupportBasicHtmlNodes: true, transWrapTextNodes: '', transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'], useSuspense: true, unescape: unescape_unescape }; const setDefaults = function () { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; defaultOptions = { ...defaultOptions, ...options }; }; const defaults_getDefaults = () => defaultOptions; ;// ./node_modules/react-i18next/dist/es/TransWithoutContext.js const hasChildren = (node, checkLength) => { if (!node) return false; const base = node.props ? node.props.children : node.children; if (checkLength) return base.length > 0; return !!base; }; const getChildren = node => { if (!node) return []; const children = node.props ? node.props.children : node.children; return node.props && node.props.i18nIsDynamicList ? getAsArray(children) : children; }; const hasValidReactChildren = children => Array.isArray(children) && children.every(isValidElement); const getAsArray = data => Array.isArray(data) ? data : [data]; const mergeProps = (source, target) => { const newTarget = { ...target }; newTarget.props = Object.assign(source.props, target.props); return newTarget; }; const nodesToString = (children, i18nOptions) => { if (!children) return ''; let stringNode = ''; const childrenArray = getAsArray(children); const keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : []; childrenArray.forEach((child, childIndex) => { if (isString(child)) { stringNode += `${child}`; } else if (isValidElement(child)) { const { props, type } = child; const childPropsCount = Object.keys(props).length; const shouldKeepChild = keepArray.indexOf(type) > -1; const childChildren = props.children; if (!childChildren && shouldKeepChild && !childPropsCount) { stringNode += `<${type}/>`; } else if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) { stringNode += `<${childIndex}>`; } else if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) { stringNode += `<${type}>${childChildren}`; } else { const content = nodesToString(childChildren, i18nOptions); stringNode += `<${childIndex}>${content}`; } } else if (child === null) { warn(`Trans: the passed in value is invalid - seems you passed in a null child.`); } else if (isObject(child)) { const { format, ...clone } = child; const keys = Object.keys(clone); if (keys.length === 1) { const value = format ? `${keys[0]}, ${format}` : keys[0]; stringNode += `{{${value}}}`; } else { warn(`react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.`, child); } } else { warn(`Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.`, child); } }); return stringNode; }; const renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) => { if (targetString === '') return []; const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || []; const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map(keep => `<${keep}`).join('|')).test(targetString); if (!children && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString]; const data = {}; const getData = childs => { const childrenArray = getAsArray(childs); childrenArray.forEach(child => { if (isString(child)) return; if (hasChildren(child)) getData(getChildren(child));else if (isObject(child) && !isValidElement(child)) Object.assign(data, child); }); }; getData(children); const ast = HTML.parse(`<0>${targetString}`); const opts = { ...data, ...combinedTOpts }; const renderInner = (child, node, rootReactNode) => { const childs = getChildren(child); const mappedChildren = mapAST(childs, node.children, rootReactNode); return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props && child.props.i18nIsDynamicList ? childs : mappedChildren; }; const pushTranslatedJSX = (child, inner, mem, i, isVoid) => { if (child.dummy) { child.children = inner; mem.push(cloneElement(child, { key: i }, isVoid ? undefined : inner)); } else { mem.push(...Children.map([child], c => { const props = { ...c.props }; delete props.i18nIsDynamicList; return createElement(c.type, { ...props, key: i, ref: c.ref }, isVoid ? null : inner); })); } }; const mapAST = (reactNode, astNode, rootReactNode) => { const reactNodes = getAsArray(reactNode); const astNodes = getAsArray(astNode); return astNodes.reduce((mem, node, i) => { const translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language); if (node.type === 'tag') { let tmp = reactNodes[parseInt(node.name, 10)]; if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name]; if (!tmp) tmp = {}; const child = Object.keys(node.attrs).length !== 0 ? mergeProps({ props: node.attrs }, tmp) : tmp; const isElement = isValidElement(child); const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement; const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject(child) && child.dummy && !isElement; const isKnownComponent = isObject(children) && Object.hasOwnProperty.call(children, node.name); if (isString(child)) { const value = i18n.services.interpolator.interpolate(child, opts, i18n.language); mem.push(value); } else if (hasChildren(child) || isValidTranslationWithChildren) { const inner = renderInner(child, node, rootReactNode); pushTranslatedJSX(child, inner, mem, i); } else if (isEmptyTransWithHTML) { const inner = mapAST(reactNodes, node.children, rootReactNode); pushTranslatedJSX(child, inner, mem, i); } else if (Number.isNaN(parseFloat(node.name))) { if (isKnownComponent) { const inner = renderInner(child, node, rootReactNode); pushTranslatedJSX(child, inner, mem, i, node.voidElement); } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) { if (node.voidElement) { mem.push(createElement(node.name, { key: `${node.name}-${i}` })); } else { const inner = mapAST(reactNodes, node.children, rootReactNode); mem.push(createElement(node.name, { key: `${node.name}-${i}` }, inner)); } } else if (node.voidElement) { mem.push(`<${node.name} />`); } else { const inner = mapAST(reactNodes, node.children, rootReactNode); mem.push(`<${node.name}>${inner}`); } } else if (isObject(child) && !isElement) { const content = node.children[0] ? translationContent : null; if (content) mem.push(content); } else { pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent); } } else if (node.type === 'text') { const wrapTextNodes = i18nOptions.transWrapTextNodes; const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language); if (wrapTextNodes) { mem.push(createElement(wrapTextNodes, { key: `${node.name}-${i}` }, content)); } else { mem.push(content); } } return mem; }, []); }; const result = mapAST([{ dummy: true, children: children || [] }], ast, getAsArray(children || [])); return getChildren(result[0]); }; function Trans(_ref) { let { children, count, parent, i18nKey, context, tOptions = {}, values, defaults, components, ns, i18n: i18nFromProps, t: tFromProps, shouldUnescape, ...additionalProps } = _ref; const i18n = i18nFromProps || getI18n(); if (!i18n) { warnOnce('You will need to pass in an i18next instance by using i18nextReactModule'); return children; } const t = tFromProps || i18n.t.bind(i18n) || (k => k); const reactI18nextOptions = { ...getDefaults(), ...(i18n.options && i18n.options.react) }; let namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS; namespaces = isString(namespaces) ? [namespaces] : namespaces || ['translation']; const nodeAsString = nodesToString(children, reactI18nextOptions); const defaultValue = defaults || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey; const { hashTransKey } = reactI18nextOptions; const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue); if (i18n.options && i18n.options.interpolation && i18n.options.interpolation.defaultVariables) { values = values && Object.keys(values).length > 0 ? { ...values, ...i18n.options.interpolation.defaultVariables } : { ...i18n.options.interpolation.defaultVariables }; } const interpolationOverride = values || count !== undefined || !children ? tOptions.interpolation : { interpolation: { ...tOptions.interpolation, prefix: '#$?', suffix: '?$#' } }; const combinedTOpts = { ...tOptions, context: context || tOptions.context, count, ...values, ...interpolationOverride, defaultValue, ns: namespaces }; const translation = key ? t(key, combinedTOpts) : defaultValue; if (components) { Object.keys(components).forEach(c => { const comp = components[c]; if (typeof comp.type === 'function' || !comp.props || !comp.props.children || translation.indexOf(`${c}/>`) < 0 && translation.indexOf(`${c} />`) < 0) return; function Componentized() { return createElement(Fragment, null, comp); } components[c] = createElement(Componentized); }); } const content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape); const useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent; return useAsParent ? createElement(useAsParent, additionalProps, content) : content; } ;// ./node_modules/react-i18next/dist/es/i18nInstance.js let i18nInstance; const setI18n = instance => { i18nInstance = instance; }; const i18nInstance_getI18n = () => i18nInstance; ;// ./node_modules/react-i18next/dist/es/initReactI18next.js const initReactI18next = { type: '3rdParty', init(instance) { setDefaults(instance.options.react); setI18n(instance); } }; ;// ./node_modules/react-i18next/dist/es/context.js const context_I18nContext = (0,external_React_.createContext)(); class ReportNamespaces { constructor() { this.usedNamespaces = {}; } addUsedNamespaces(namespaces) { namespaces.forEach(ns => { if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true; }); } getUsedNamespaces = () => Object.keys(this.usedNamespaces); } const context_composeInitialProps = ForComponent => async ctx => { const componentsInitialProps = ForComponent.getInitialProps ? await ForComponent.getInitialProps(ctx) : {}; const i18nInitialProps = getInitialProps(); return { ...componentsInitialProps, ...i18nInitialProps }; }; const getInitialProps = () => { const i18n = getI18n(); const namespaces = i18n.reportNamespaces ? i18n.reportNamespaces.getUsedNamespaces() : []; const ret = {}; const initialI18nStore = {}; i18n.languages.forEach(l => { initialI18nStore[l] = {}; namespaces.forEach(ns => { initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {}; }); }); ret.initialI18nStore = initialI18nStore; ret.initialLanguage = i18n.language; return ret; }; ;// ./node_modules/react-i18next/dist/es/Trans.js function Trans_Trans(_ref) { let { children, count, parent, i18nKey, context, tOptions = {}, values, defaults, components, ns, i18n: i18nFromProps, t: tFromProps, shouldUnescape, ...additionalProps } = _ref; const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = useContext(I18nContext) || {}; const i18n = i18nFromProps || i18nFromContext || getI18n(); const t = tFromProps || i18n && i18n.t.bind(i18n); return TransWithoutContext({ children, count, parent, i18nKey, context, tOptions, values, defaults, components, ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS, i18n, t: tFromProps, shouldUnescape, ...additionalProps }); } ;// ./node_modules/react-i18next/dist/es/useTranslation.js const usePrevious = (value, ignore) => { const ref = (0,external_React_.useRef)(); (0,external_React_.useEffect)(() => { ref.current = ignore ? ref.current : value; }, [value, ignore]); return ref.current; }; const alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix); const useMemoizedT = (i18n, language, namespace, keyPrefix) => (0,external_React_.useCallback)(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]); const useTranslation_useTranslation = function (ns) { let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const { i18n: i18nFromProps } = props; const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = (0,external_React_.useContext)(context_I18nContext) || {}; const i18n = i18nFromProps || i18nFromContext || i18nInstance_getI18n(); if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces(); if (!i18n) { utils_warnOnce('You will need to pass in an i18next instance by using initReactI18next'); const notReadyT = (k, optsOrDefaultValue) => { if (utils_isString(optsOrDefaultValue)) return optsOrDefaultValue; if (utils_isObject(optsOrDefaultValue) && utils_isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue; return Array.isArray(k) ? k[k.length - 1] : k; }; const retNotReady = [notReadyT, {}, false]; retNotReady.t = notReadyT; retNotReady.i18n = {}; retNotReady.ready = false; return retNotReady; } if (i18n.options.react && i18n.options.react.wait !== undefined) utils_warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.'); const i18nOptions = { ...defaults_getDefaults(), ...i18n.options.react, ...props }; const { useSuspense, keyPrefix } = i18nOptions; let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS; namespaces = utils_isString(namespaces) ? [namespaces] : namespaces || ['translation']; if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces); const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions)); const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix); const getT = () => memoGetT; const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix); const [t, setT] = (0,external_React_.useState)(getT); let joinedNS = namespaces.join(); if (props.lng) joinedNS = `${props.lng}${joinedNS}`; const previousJoinedNS = usePrevious(joinedNS); const isMounted = (0,external_React_.useRef)(true); (0,external_React_.useEffect)(() => { const { bindI18n, bindI18nStore } = i18nOptions; isMounted.current = true; if (!ready && !useSuspense) { if (props.lng) { loadLanguages(i18n, props.lng, namespaces, () => { if (isMounted.current) setT(getNewT); }); } else { loadNamespaces(i18n, namespaces, () => { if (isMounted.current) setT(getNewT); }); } } if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) { setT(getNewT); } const boundReset = () => { if (isMounted.current) setT(getNewT); }; if (bindI18n && i18n) i18n.on(bindI18n, boundReset); if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset); return () => { isMounted.current = false; if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset)); if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset)); }; }, [i18n, joinedNS]); (0,external_React_.useEffect)(() => { if (isMounted.current && ready) { setT(getT); } }, [i18n, keyPrefix, ready]); const ret = [t, i18n, ready]; ret.t = t; ret.i18n = i18n; ret.ready = ready; if (ready) return ret; if (!ready && !useSuspense) return ret; throw new Promise(resolve => { if (props.lng) { loadLanguages(i18n, props.lng, namespaces, () => resolve()); } else { loadNamespaces(i18n, namespaces, () => resolve()); } }); }; ;// ./node_modules/react-i18next/dist/es/withTranslation.js const withTranslation = function (ns) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return function Extend(WrappedComponent) { function I18nextWithTranslation(_ref) { let { forwardedRef, ...rest } = _ref; const [t, i18n, ready] = useTranslation(ns, { ...rest, keyPrefix: options.keyPrefix }); const passDownProps = { ...rest, t, i18n, tReady: ready }; if (options.withRef && forwardedRef) { passDownProps.ref = forwardedRef; } else if (!options.withRef && forwardedRef) { passDownProps.forwardedRef = forwardedRef; } return createElement(WrappedComponent, passDownProps); } I18nextWithTranslation.displayName = `withI18nextTranslation(${getDisplayName(WrappedComponent)})`; I18nextWithTranslation.WrappedComponent = WrappedComponent; const forwardRef = (props, ref) => createElement(I18nextWithTranslation, Object.assign({}, props, { forwardedRef: ref })); return options.withRef ? forwardRefReact(forwardRef) : I18nextWithTranslation; }; }; ;// ./node_modules/react-i18next/dist/es/Translation.js function Translation(props) { const { ns, children, ...options } = props; const [t, i18n, ready] = useTranslation(ns, options); return children(t, { i18n, lng: i18n.language }, ready); } ;// ./node_modules/react-i18next/dist/es/I18nextProvider.js function I18nextProvider(_ref) { let { i18n, defaultNS, children } = _ref; const value = useMemo(() => ({ i18n, defaultNS }), [i18n, defaultNS]); return createElement(I18nContext.Provider, { value }, children); } ;// ./node_modules/react-i18next/dist/es/useSSR.js const useSSR_useSSR = function (initialI18nStore, initialLanguage) { let props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const { i18n: i18nFromProps } = props; const { i18n: i18nFromContext } = useContext(I18nContext) || {}; const i18n = i18nFromProps || i18nFromContext || getI18n(); if (i18n.options && i18n.options.isClone) return; if (initialI18nStore && !i18n.initializedStoreOnce) { i18n.services.resourceStore.data = initialI18nStore; i18n.options.ns = Object.values(initialI18nStore).reduce((mem, lngResources) => { Object.keys(lngResources).forEach(ns => { if (mem.indexOf(ns) < 0) mem.push(ns); }); return mem; }, i18n.options.ns); i18n.initializedStoreOnce = true; i18n.isInitialized = true; } if (initialLanguage && !i18n.initializedLanguageOnce) { i18n.changeLanguage(initialLanguage); i18n.initializedLanguageOnce = true; } }; ;// ./node_modules/react-i18next/dist/es/withSSR.js const withSSR = () => function Extend(WrappedComponent) { function I18nextWithSSR(_ref) { let { initialI18nStore, initialLanguage, ...rest } = _ref; useSSR(initialI18nStore, initialLanguage); return createElement(WrappedComponent, { ...rest }); } I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent); I18nextWithSSR.displayName = `withI18nextSSR(${getDisplayName(WrappedComponent)})`; I18nextWithSSR.WrappedComponent = WrappedComponent; return I18nextWithSSR; }; ;// ./node_modules/react-i18next/dist/es/index.js const date = () => ''; const time = () => ''; const number = () => ''; const es_select = () => ''; const plural = () => ''; const selectOrdinal = () => ''; ;// ./src/i18n/locales/en.json const en_namespaceObject = /*#__PURE__*/JSON.parse('{"available":"Available","button":{"back":"Back","continue":"Continue","edit":"Edit","next":"Next","register":"Register","submit":"Submit","update":"Update","close":"Close","resend":"Resend","sending":"Sending...","change_password":"Change password","change_email":"Change email"},"email":{"label":"Email","rule":{"invalidFormat":"Make sure you have entered valid e-mail address","required":"E-mail address is required"},"yourEmail":"Your e-mail"},"errors":{"retryText":"Something goes wrong! Please, retry"},"form":{"citizenshipCountry":"Country of citizenship","city":"City","country":"Country","differentTaxCountry":"Country of my tax residence DOES NOT match country of citizenship","dob":"Date of birth","documentNumber":"Passport/ID/Residence permit number","email":"Email","your-email":"Your e-mail","name":"Name","password":"Password","personCode":"Personal code","phone":"Phone number","promoCode":"Promo code","repeatPassword":"Repeat password","streetName":"Street name and number","surname":"Surname","taxCountry":"Country of tax residence","zip":"Zip code","verificationCode":"Verification code","currentEmail":"Current email","newEmail":"Enter new email"},"input":{"email":"Email","select":"Select","selectDate":"Select date","yourEmail":"Your email"},"mifid":{"autoInvest":"Custom Auto-invest strategies","completeNow":"COMPLETE NOW","editAnswers":"EDIT ANSWERS","manualInvest":"Manual investments","mifid_portfolio_limit":"Based on your responses, your limit to invest using automated strategies is € {limit}. This evaluation is based on the total value of your assets and your share of the liquid assets.","mifid_portfolio_limit_0":"Based on your responses, your limit to invest using automated strategies is € 0. This evaluation is based on the total value of your assets and your share of the liquid assets.","mifid_portfolio_no_limit":"Based on your responses, you can use automated strategies to invest without limits","mifid_consent_save_error":"Thank you for completing our product suitability questionnaire. You will receive a notification with the results in your account or via email shortly.","resultMifidScore_beginner":"Based on your responses to the product suitability questionnaire, we\'ve determined that some of our products may not be suitable for your current investment knowledge and experience. As your circumstances change, you can always update your questionnaire anytime to unlock new products suited to your new situation.","resultMifidScore_high":"Wonderful news! Based on your responses to the product suitability questionnaire, all of our products are suitable for your current investment knowledge and experience.","resultMifidScore_informed":"Wonderful news! Based on your responses to the product suitability questionnaire, all of our products are suitable for your current investment knowledge and experience.","resultMifidScore_none":"Complete our quick product suitability questionnaire to gain access to our full range of services. This simple yet essential step helps us understand your investment knowledge and experience, ensuring that we only recommend products suitable for you."},"notAvailable":"Not available","password":{"changeSuccess":"Your password has been changed successfully.","changeTitle":"Change password","changeLabel":"Enter new password","confirmLabel":"Confirm password","rule":{"notMatch":"The two passwords that you entered do not match!","password_invalid":"The password field format is invalid.","password_repeat_required":"Repeat password is required","passwords_match":"Passwords must match"},"strength_indicator":{"weak":"Weak","strong":"Strong","low_characters":"At least 8 characters","special_character":"At least one of the following special characters ! @ # $ & % *","numbers_quantity":"One number","spaces":"No spaces"}},"passwordRecovery":{"requestSuccess":"Please check your e-mail for further instructions on restoring the password\'","title":"Password recovery"},"rule":{"answerRequired":"Answer is required","dobMessage":"Date of birth is required","checkboxRequired":"This checkbox is required","required":"This field is required","verificationCode":"Verification code is required","min":"Field must have at least {{min}} characters","max":"Field cannot be longer than {{max} characters","phoneFormat":"Incorrect phone format","personCodeFormat":"Personal code should be either 11 or 12 characters long"},"serviceError":"Something went wrong, please try again later.","step":{"financial-information":"Financial info","identification":"Identification","personal-information":"Personal info","profile-information":"Profile Info","verification":"Verification","texts":{"verification":{"thank-you":"Thank you for registration. You should have received email with verification code. If you have not, click to"},"identification":{"title":"WE ARE HAPPY TO HAVE YOU ON BOARD!","paragraph_1":"You are almost there - take the last step by verifying your identity, and your investor account will be fully set up for making profitable investments!","paragraph_2":"After clicking the button below, you will be redirected to the identification screen provided by our partner iDenfy. Automatic identity verification will require taking photos of your face and/or valid identification document.","checklist_title":"Here is the checklist that will help you verify your identity successfully:","checklist_1":"Make sure you have a valid passport, ID card or residence permit with you.","checklist_2":"Have your mobile phone camera or PC webcam ready for taking photos.","checklist_3":"Lighting is important to ensure good quality of images of your face and identification document.","button_verify":"VERIFY MY IDENTITY"},"complete":"Thank you! All the registration steps are complete."}},"Submit":"Submit","summary":{"description":"Please review your information below and click Submit to complete the process.","title":"Summary"},"after":"after","username":{"changeSuccess":"Your email has been changed successfully.","changeTitle":"Change email","changeLabel":"Enter new email"},"topbar":{"menu":"Menu","dashboard":"Dashboard","account":"Account","invest":"Invest","investments":"My investments","transactions":"Statement","settings":"Settings","logout":"Logout"},"validation":{"regex":"Please make sure that the text you enter is composed of Latin characters and/or hyphen only!","regex_special":"Please make sure that the text you enter is composed only of Latin characters, spaces, numbers and/or hyphens!","email.email":"This email is invalid or taken.","password.regex":"The password field format is invalid.","alpha_dash":"Field must only contain letters, numbers, dashes, and underscores.","before_or_equal":"Registration available starting form 18 years of age","required":"This field is required","invalid_date":"Invalid date for selected month","invalid_birth_date":"To register You must be full 18 years of age","min":"Password is too short.","otp.mismatch":"Code does not match.","otp.expired":"Code expired.","phoneNumber.notAvailable":"This phone number is not valid or already taken"},"identification":{"notVerified":"You were not verified, please try again!","success":"Identification was successfully submitted, please wait for the results!","closeWindow":"You can now close this window and go back to the original page."},"alert":{"investor_data_form":{"success":"Investor Profile information has been updated","error":"Something went wrong with updating your Investor Account information. Please try again!"}}}'); ;// ./src/i18n/locales/lv.json const lv_namespaceObject = /*#__PURE__*/JSON.parse('{"available":"Pieejams","button":{"back":"Atpakaļ","continue":"Turpināt","edit":"Rediģēt","next":"Tālāk","register":"Reģistrēties","submit":"Iesniegt","update":"Atjaunot","close":"Aizvērt","resend":"Nosūtīt no jauna","sending":"Tiek sūtīts...","change_password":"Nomainīt paroli","change_email":"Nomainīt e-pastu"},"email":{"label":"E-pasts","rule":{"invalidFormat":"Lūdzu, pārliecinieties, vai esat ievadījis pareizu e-pasta adresi!","required":"Lūdzu, ievadiet, e-pasta adresi!"},"yourEmail":"Tavs e-pasts"},"errors":{"retryText":"Notikusi kļūda pieprasījuma apstrādē. Lūdzu mēģiniet vēlreiz!"},"form":{"citizenshipCountry":"Pilsonība","city":"Pilsēta","country":"Valsts","differentTaxCountry":"Nodokļu rezidences valsts NESAKRĪT ar pilsonības valsti","dob":"Dzimšanas datums","documentNumber":"Pases/ID kartes/uzturēšanās atļaujas numurs","email":"E-pasts","your-email":"Tavs e-pasts","name":"Vārds","password":"Parole","personCode":"Personas kods","phone":"Mobilais tālrunis","promoCode":"Promo kods","repeatPassword":"Atkārtot paroli","streetName":"Ielas nosaukums un numurs","surname":"Uzvārds","taxCountry":"Nodokļu rezidences valsts","zip":"Pasta indeks","verificationCode":"Verifikācijas kods","currentEmail":"Pašreizējā e-pasta adrese","newEmail":"Ievadiet jauno e-pasta adresi"},"input":{"email":"E-pasts","select":"Izvēlēties","selectDate":"Izvēlēties datumu","yourEmail":"Jūsu e-pasts"},"mifid":{"autoInvest":"Pielāgotas automātiskās investīciju stratēģijas","completeNow":"AIZPILDĪT TAGAD","editAnswers":"REDIĢĒT ATBILDES","manualInvest":"Manuālas investīcijas","mifid_portfolio_limit":"Pamatojoties uz jūsu atbildēm, jūsu limits ieguldījumiem, izmantojot automatizētas stratēģijas ir € {limit}. Šis novērtējums ir balstīts uz informāciju par jūsu kopējo aktīvu vērtību un likvīdu aktīvu proporciju.","mifid_portfolio_limit_0":"Pamatojoties uz jūsu atbildēm, jūsu limits ieguldījumiem, izmantojot automatizētas stratēģijas ir 0 €. Šis novērtējums ir balstīts uz informāciju par jūsu kopējo aktīvu vērtību un likvīdu aktīvu proporciju.","mifid_portfolio_no_limit":"Pamatojoties uz jūsu atbildēm, varat izmantot automatizētas stratēģijas, lai ieguldītu bez ierobežojuma","mifid_consent_save_error":"Paldies, ka aizpildījāt mūsu produktu piemērotības anketu. Drīzumā jūs saņemsiet paziņojumu ar rezultātiem savā kontā vai pa e-pastu.","resultMifidScore_beginner":"Pamatojoties uz jūsu atbildēm produktu piemērotības anketā, esam noteikuši, ka daži no mūsu produktiem var nebūt piemēroti jūsu pašreizējai pieredzei un zināšanām par ieguldījumiem. Mainoties apstākļiem, jūs vienmēr varat atjaunināt savu anketu.","resultMifidScore_high":"Lieliskas ziņas! Pamatojoties uz jūsu atbildēm produktu piemērotības anketā, visi mūsu produkti ir piemēroti jūsu pašreizējām zināšanām un pieredzei.","resultMifidScore_informed":"Lieliskas ziņas! Pamatojoties uz jūsu atbildēm produktu piemērotības anketā, visi mūsu produkti ir piemēroti jūsu pašreizējām zināšanām un pieredzei.","resultMifidScore_none":"Aizpildiet produktu piemērotības anketu, lai piekļūtu visam mūsu pakalpojumu klāstam. Šis vienkāršais, taču būtiskais solis palīdz mums izprast jūsu zināšanas un pieredzi, nodrošinot, ka mēs iesakām tikai jums piemērotus ieguldījumu produktus."},"notAvailable":"Nav pieejams","password":{"changeSuccess":"Jūsu parole ir nomainīta.","changeTitle":"Paroles maiņa","changeLabel":"Ievadiet jauno paroli","confirmLabel":"Atkartoti ievadiet paroli","rule":{"notMatch":"Abām parolēm jābūt vienādām","password_invalid":"Paroles vērtība neatbilst formātam.","password_repeat_required":"Atkārtota parole ir obligāta","passwords_match":"Parolei un atkārtotai parolei ir jāsakrīt"},"strength_indicator":{"weak":"Vāja","strong":"Stipra","low_characters":"Vismaz 8 rakstzīmes","special_character":"Vismaz viens no sekojošiem specsimboliem ! @ # $ & % *","numbers_quantity":"Vismaz viens cipars","spaces":"Bez atstarpēm"}},"passwordRecovery":{"requestSuccess":"Lūdzu, pārbaudiet savu e-pastu, lai saņemtu turpmākās instrukcijas paroles atjaunošanai.","title":"Paroles atjaunošana"},"rule":{"answerRequired":"Atbilde šeit ir vajadzīga","dobMessage":"Dzimšanas datums ir vajadzīgs","checkboxRequired":"Šī izvēles rūtiņa ir vajadzīga","required":"Šis lauks ir obligāts","verificationCode":"Verifikācijas kods ir vajadzīga","min":"Lauka vērtībai jābūt vismaz {{min}} zīmes garai","max":"Lauka vērtība nedrīkst pārsniegt {{max}} zīmju skaitu","phoneFormat":"Nekorekts tālruņa formāts","personCodeFormat":"Personas kodam jābūt 11 vai 12 zīmes garam"},"serviceError":"Kaut kas aizgāja netā, lūdzu, vēlāk mēģiniet vēlreiz.","Submit":"Iesniegt","step":{"financial-information":"Finanšu informācija","identification":"Identitātes verifikācija","personal-information":"Personīgā informācija","profile-information":"Profila informācija","verification":"E-pasta verifikācija","texts":{"verification":{"thank-you":"Paldies par reģistrāciju. Jums bija jāsaņem e-pasts ar verifikācijas kodu. Ja vēl neesat saņēmis, noklikšķiniet uz"},"identification":{"title":"Priecājamies ka mums pievienojies!","paragraph_1":"Jūs gandrīz jau esat galā - veiciet pēdējo soli, verificējot savu identitāti, un Jūsu investora konts būs izveidots lai Jūs varētu veikt ienesīgas investīcijas.","paragraph_2":"Kad nospiedīsiet uz zemāk esošās pogas, Jūs tiksiet pāradresēti uz identifikācijas lapu ko nodrošina mūsu partneris iDenfy. Automātiskai identitātes verifikācijai būs nepieciešams nofotogrāfēt Jūsu seju, kā arī derīgu personu apliecinošu dokumentu.","checklist_title":"Zemāk ir punkti, kuri palīdzēs Jums veiksmīgi veikt idnetitātes verifikāciju:","checklist_1":"Pārliecinities, ka Jums ir derīga pase, ID karte vai uzturēšanās atļauja.","checklist_2":"Sagatavojiet savu telefona kameru, vai datora web kameru fotogrāfiju uzņemšanai.","checklist_3":"Apgaismojums ir svarīgs lai nodrošinātu labas kvalitātes Jūsu sejas un dokumenta attēlus.","button_verify":"Apstiprināt manu identitāti"},"complete":"Paldies! Visi reģistrācijas soli izpildīti."}},"summary":{"description":"Lūdzu, pārskatiet informāciju un noklikšķiniet uz pogas Iesniegt, lai pabeigtu procesu.","title":"Kopsavilkums"},"after":"pēc","username":{"changeSuccess":"Jūsu lietotājvārds ir nomainīta.","changeTitle":"Email/Lietotājvārda maiņa","changeLabel":"Ievadiet jauno lietotājvārdu"},"topbar":{"menu":"Izvēlne","dashboard":"Darba vide","account":"Konts","invest":"Investēt","investments":"Manas investīcijas","transactions":"Konta pārskats","settings":"Uzstādījumi","logout":"Iziet"},"validation":{"regex":"Lūdzu, pārliecinieties, ka Jūsu ievadītais teksts sastāv tikai no latīņu alfabēta burtiem un/vai defises!","regex_special":"Lūdzu, pārliecinieties, ka Jūsu ievadītais teksts sastāv tikai no latīņu alfabēta burtiem, atstarpēm, cipariem un/vai defisēm!","email.email":"Šis e-pasts nav derīgs vai jau ir aizņemts.","password.regex":"Paroles vērtība neatbilst formātam.","alpha_dash":" Lauka vērtība drīkst saturēt tikai burtus, numurus, domuzīmes un apakšsvītras.","before_or_equal":"Reģistrācija pieejam pilnus 18 gadus sasniegušām personām","required":"Šis lauks ir obligāts","invalid_date":"Izvēlētajā mēnesī norādītais datums neeksistē","invalid_birth_date":"Lai reģistrētos Jums jābūt pilniem 18 gadiem","min":"Parole ir par īsu.","otp.mismatch":"Kods nav pareizs.","otp.expired":"Koda derīguma termiņš ir beidzies.","phoneNumber.notAvailable":"Šis tālruņa numurs nav derīgs vai jau ir aizņemts"},"identification":{"notVerified":"Nesanāca Jūs verificēt. Lūdzu, mēģiniet vēlreiz!","success":"Identifikācija tika veiksmīgi iesniegta, lūdzu, gaidiet rezultātus!","closeWindow":"Tagad varat aizvērt šo logu un atgriezties uz iepriekšējo lapu."},"alert":{"investor_data_form":{"success":"Investora profila informācija ir atjaunota","error":"Mums neizdevās atjaunot Jūsu investora profila informāciju! Lūdzu, mēģiniet vēlreiz!"}}}'); ;// ./src/i18n/locales/index.js const locales = { en: en_namespaceObject, lv: lv_namespaceObject }; /* harmony default export */ const i18n_locales = (locales); ;// ./src/i18n/index.js // Import the translations const resources = Object.keys(i18n_locales).reduce((acc, key) => { acc[key] = { translation: i18n_locales[key] }; return acc; }, {}); external_i18next_default().use(initReactI18next).init({ resources, lng: 'en', // default language fallbackLng: 'en', debug: true, interpolation: { escapeValue: false // React already safes from xss } }); /* harmony default export */ const i18n = ((external_i18next_default())); // EXTERNAL MODULE: external "dayjs" var external_dayjs_ = __webpack_require__(185); var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_); // EXTERNAL MODULE: external "antd" var external_antd_ = __webpack_require__(59); ;// ./src/investor/helpers/constants.js const regSteps = { stepOne: 'profile-information', stepTwo: 'personal-information', stepThree: 'financial-information', stepFour: 'verification', stepFive: 'identification' }; const statuses = { identification: { required: 'required', needed: 'needed', inProcess: 'in_process', waiting: 'waiting', denied: 'denied', approved: 'approved', expired: 'expired' }, customer: { application: 'application', identified: 'identified' } }; const externalInputSteps = { firstStep: 'viainvest-investor-first-step', secondStep: 'viainvest-investor-second-step', thirdStep: 'viainvest-investor-third-step' }; const parseExternalSteps = { 'viainvest-investor-first-step': regSteps.stepFour, 'viainvest-investor-second-step': regSteps.stepFive }; const consents = { kyc: 'kyc_questionnaire', appropriateness: 'appropriateness_assesment' }; const questionnaireParts = { overview: 'overview', overviewShowAlert: 'overviewShowAlert', summary: 'summary', form: 'form', results: 'results', resultsLoading: 'resultsLoading' }; const mifidLevel = { none: 'none', beginner: 'beginner', informed: 'informed', high: 'high' }; const consentAction = { save: 'save', confirm: 'confirm' }; ;// ./node_modules/axios/lib/helpers/bind.js function bind(fn, thisArg) { return function wrap() { return fn.apply(thisArg, arguments); }; } ;// ./node_modules/axios/lib/utils.js // utils is a library of generic helper functions non-specific to axios const {toString: utils_toString} = Object.prototype; const {getPrototypeOf} = Object; const kindOf = (cache => thing => { const str = utils_toString.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); })(Object.create(null)); const kindOfTest = (type) => { type = type.toLowerCase(); return (thing) => kindOf(thing) === type } const typeOfTest = type => thing => typeof thing === type; /** * Determine if a value is an Array * * @param {Object} val The value to test * * @returns {boolean} True if value is an Array, otherwise false */ const {isArray} = Array; /** * Determine if a value is undefined * * @param {*} val The value to test * * @returns {boolean} True if the value is undefined, otherwise false */ const isUndefined = typeOfTest('undefined'); /** * Determine if a value is a Buffer * * @param {*} val The value to test * * @returns {boolean} True if value is a Buffer, otherwise false */ function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); } /** * Determine if a value is an ArrayBuffer * * @param {*} val The value to test * * @returns {boolean} True if value is an ArrayBuffer, otherwise false */ const isArrayBuffer = kindOfTest('ArrayBuffer'); /** * Determine if a value is a view on an ArrayBuffer * * @param {*} val The value to test * * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { let result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { result = ArrayBuffer.isView(val); } else { result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); } return result; } /** * Determine if a value is a String * * @param {*} val The value to test * * @returns {boolean} True if value is a String, otherwise false */ const lib_utils_isString = typeOfTest('string'); /** * Determine if a value is a Function * * @param {*} val The value to test * @returns {boolean} True if value is a Function, otherwise false */ const isFunction = typeOfTest('function'); /** * Determine if a value is a Number * * @param {*} val The value to test * * @returns {boolean} True if value is a Number, otherwise false */ const isNumber = typeOfTest('number'); /** * Determine if a value is an Object * * @param {*} thing The value to test * * @returns {boolean} True if value is an Object, otherwise false */ const lib_utils_isObject = (thing) => thing !== null && typeof thing === 'object'; /** * Determine if a value is a Boolean * * @param {*} thing The value to test * @returns {boolean} True if value is a Boolean, otherwise false */ const isBoolean = thing => thing === true || thing === false; /** * Determine if a value is a plain Object * * @param {*} val The value to test * * @returns {boolean} True if value is a plain Object, otherwise false */ const isPlainObject = (val) => { if (kindOf(val) !== 'object') { return false; } const prototype = getPrototypeOf(val); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); } /** * Determine if a value is a Date * * @param {*} val The value to test * * @returns {boolean} True if value is a Date, otherwise false */ const isDate = kindOfTest('Date'); /** * Determine if a value is a File * * @param {*} val The value to test * * @returns {boolean} True if value is a File, otherwise false */ const isFile = kindOfTest('File'); /** * Determine if a value is a Blob * * @param {*} val The value to test * * @returns {boolean} True if value is a Blob, otherwise false */ const isBlob = kindOfTest('Blob'); /** * Determine if a value is a FileList * * @param {*} val The value to test * * @returns {boolean} True if value is a File, otherwise false */ const isFileList = kindOfTest('FileList'); /** * Determine if a value is a Stream * * @param {*} val The value to test * * @returns {boolean} True if value is a Stream, otherwise false */ const isStream = (val) => lib_utils_isObject(val) && isFunction(val.pipe); /** * Determine if a value is a FormData * * @param {*} thing The value to test * * @returns {boolean} True if value is an FormData, otherwise false */ const isFormData = (thing) => { let kind; return thing && ( (typeof FormData === 'function' && thing instanceof FormData) || ( isFunction(thing.append) && ( (kind = kindOf(thing)) === 'formdata' || // detect form-data instance (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') ) ) ) } /** * Determine if a value is a URLSearchParams object * * @param {*} val The value to test * * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ const isURLSearchParams = kindOfTest('URLSearchParams'); const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); /** * Trim excess whitespace off the beginning and end of a string * * @param {String} str The String to trim * * @returns {String} The String freed of excess whitespace */ const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); /** * Iterate over an Array or an Object invoking a function for each item. * * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing * the value, key, and complete object for each property. * * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item * * @param {Boolean} [allOwnKeys = false] * @returns {any} */ function forEach(obj, fn, {allOwnKeys = false} = {}) { // Don't bother if no value provided if (obj === null || typeof obj === 'undefined') { return; } let i; let l; // Force an array if not already something iterable if (typeof obj !== 'object') { /*eslint no-param-reassign:0*/ obj = [obj]; } if (isArray(obj)) { // Iterate over array values for (i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } } else { // Iterate over object keys const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); const len = keys.length; let key; for (i = 0; i < len; i++) { key = keys[i]; fn.call(null, obj[key], key, obj); } } } function findKey(obj, key) { key = key.toLowerCase(); const keys = Object.keys(obj); let i = keys.length; let _key; while (i-- > 0) { _key = keys[i]; if (key === _key.toLowerCase()) { return _key; } } return null; } const _global = (() => { /*eslint no-undef:0*/ if (typeof globalThis !== "undefined") return globalThis; return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) })(); const isContextDefined = (context) => !isUndefined(context) && context !== _global; /** * Accepts varargs expecting each argument to be an object, then * immutably merges the properties of each object and returns result. * * When multiple objects contain the same key the later object in * the arguments list will take precedence. * * Example: * * ```js * var result = merge({foo: 123}, {foo: 456}); * console.log(result.foo); // outputs 456 * ``` * * @param {Object} obj1 Object to merge * * @returns {Object} Result of all merge properties */ function merge(/* obj1, obj2, obj3, ... */) { const {caseless} = isContextDefined(this) && this || {}; const result = {}; const assignValue = (val, key) => { const targetKey = caseless && findKey(result, key) || key; if (isPlainObject(result[targetKey]) && isPlainObject(val)) { result[targetKey] = merge(result[targetKey], val); } else if (isPlainObject(val)) { result[targetKey] = merge({}, val); } else if (isArray(val)) { result[targetKey] = val.slice(); } else { result[targetKey] = val; } } for (let i = 0, l = arguments.length; i < l; i++) { arguments[i] && forEach(arguments[i], assignValue); } return result; } /** * Extends object a by mutably adding to it the properties of object b. * * @param {Object} a The object to be extended * @param {Object} b The object to copy properties from * @param {Object} thisArg The object to bind function to * * @param {Boolean} [allOwnKeys] * @returns {Object} The resulting value of object a */ const extend = (a, b, thisArg, {allOwnKeys}= {}) => { forEach(b, (val, key) => { if (thisArg && isFunction(val)) { a[key] = bind(val, thisArg); } else { a[key] = val; } }, {allOwnKeys}); return a; } /** * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) * * @param {string} content with BOM * * @returns {string} content value without BOM */ const stripBOM = (content) => { if (content.charCodeAt(0) === 0xFEFF) { content = content.slice(1); } return content; } /** * Inherit the prototype methods from one constructor into another * @param {function} constructor * @param {function} superConstructor * @param {object} [props] * @param {object} [descriptors] * * @returns {void} */ const inherits = (constructor, superConstructor, props, descriptors) => { constructor.prototype = Object.create(superConstructor.prototype, descriptors); constructor.prototype.constructor = constructor; Object.defineProperty(constructor, 'super', { value: superConstructor.prototype }); props && Object.assign(constructor.prototype, props); } /** * Resolve object with deep prototype chain to a flat object * @param {Object} sourceObj source object * @param {Object} [destObj] * @param {Function|Boolean} [filter] * @param {Function} [propFilter] * * @returns {Object} */ const toFlatObject = (sourceObj, destObj, filter, propFilter) => { let props; let i; let prop; const merged = {}; destObj = destObj || {}; // eslint-disable-next-line no-eq-null,eqeqeq if (sourceObj == null) return destObj; do { props = Object.getOwnPropertyNames(sourceObj); i = props.length; while (i-- > 0) { prop = props[i]; if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { destObj[prop] = sourceObj[prop]; merged[prop] = true; } } sourceObj = filter !== false && getPrototypeOf(sourceObj); } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); return destObj; } /** * Determines whether a string ends with the characters of a specified string * * @param {String} str * @param {String} searchString * @param {Number} [position= 0] * * @returns {boolean} */ const endsWith = (str, searchString, position) => { str = String(str); if (position === undefined || position > str.length) { position = str.length; } position -= searchString.length; const lastIndex = str.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; } /** * Returns new array from array like object or null if failed * * @param {*} [thing] * * @returns {?Array} */ const toArray = (thing) => { if (!thing) return null; if (isArray(thing)) return thing; let i = thing.length; if (!isNumber(i)) return null; const arr = new Array(i); while (i-- > 0) { arr[i] = thing[i]; } return arr; } /** * Checking if the Uint8Array exists and if it does, it returns a function that checks if the * thing passed in is an instance of Uint8Array * * @param {TypedArray} * * @returns {Array} */ // eslint-disable-next-line func-names const isTypedArray = (TypedArray => { // eslint-disable-next-line func-names return thing => { return TypedArray && thing instanceof TypedArray; }; })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); /** * For each entry in the object, call the function with the key and value. * * @param {Object} obj - The object to iterate over. * @param {Function} fn - The function to call for each entry. * * @returns {void} */ const forEachEntry = (obj, fn) => { const generator = obj && obj[Symbol.iterator]; const iterator = generator.call(obj); let result; while ((result = iterator.next()) && !result.done) { const pair = result.value; fn.call(obj, pair[0], pair[1]); } } /** * It takes a regular expression and a string, and returns an array of all the matches * * @param {string} regExp - The regular expression to match against. * @param {string} str - The string to search. * * @returns {Array} */ const matchAll = (regExp, str) => { let matches; const arr = []; while ((matches = regExp.exec(str)) !== null) { arr.push(matches); } return arr; } /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ const isHTMLForm = kindOfTest('HTMLFormElement'); const toCamelCase = str => { return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { return p1.toUpperCase() + p2; } ); }; /* Creating a function that will check if an object has a property. */ const utils_hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); /** * Determine if a value is a RegExp object * * @param {*} val The value to test * * @returns {boolean} True if value is a RegExp object, otherwise false */ const isRegExp = kindOfTest('RegExp'); const reduceDescriptors = (obj, reducer) => { const descriptors = Object.getOwnPropertyDescriptors(obj); const reducedDescriptors = {}; forEach(descriptors, (descriptor, name) => { let ret; if ((ret = reducer(descriptor, name, obj)) !== false) { reducedDescriptors[name] = ret || descriptor; } }); Object.defineProperties(obj, reducedDescriptors); } /** * Makes all methods read-only * @param {Object} obj */ const freezeMethods = (obj) => { reduceDescriptors(obj, (descriptor, name) => { // skip restricted props in strict mode if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { return false; } const value = obj[name]; if (!isFunction(value)) return; descriptor.enumerable = false; if ('writable' in descriptor) { descriptor.writable = false; return; } if (!descriptor.set) { descriptor.set = () => { throw Error('Can not rewrite read-only method \'' + name + '\''); }; } }); } const toObjectSet = (arrayOrString, delimiter) => { const obj = {}; const define = (arr) => { arr.forEach(value => { obj[value] = true; }); } isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); return obj; } const noop = () => {} const toFiniteNumber = (value, defaultValue) => { return value != null && Number.isFinite(value = +value) ? value : defaultValue; } const ALPHA = 'abcdefghijklmnopqrstuvwxyz' const DIGIT = '0123456789'; const ALPHABET = { DIGIT, ALPHA, ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT } const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { let str = ''; const {length} = alphabet; while (size--) { str += alphabet[Math.random() * length|0] } return str; } /** * If the thing is a FormData object, return true, otherwise return false. * * @param {unknown} thing - The thing to check. * * @returns {boolean} */ function isSpecCompliantForm(thing) { return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); } const toJSONObject = (obj) => { const stack = new Array(10); const visit = (source, i) => { if (lib_utils_isObject(source)) { if (stack.indexOf(source) >= 0) { return; } if(!('toJSON' in source)) { stack[i] = source; const target = isArray(source) ? [] : {}; forEach(source, (value, key) => { const reducedValue = visit(value, i + 1); !isUndefined(reducedValue) && (target[key] = reducedValue); }); stack[i] = undefined; return target; } } return source; } return visit(obj, 0); } const isAsyncFn = kindOfTest('AsyncFunction'); const isThenable = (thing) => thing && (lib_utils_isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); // original code // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 const _setImmediate = ((setImmediateSupported, postMessageSupported) => { if (setImmediateSupported) { return setImmediate; } return postMessageSupported ? ((token, callbacks) => { _global.addEventListener("message", ({source, data}) => { if (source === _global && data === token) { callbacks.length && callbacks.shift()(); } }, false); return (cb) => { callbacks.push(cb); _global.postMessage(token, "*"); } })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); })( typeof setImmediate === 'function', isFunction(_global.postMessage) ); const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); // ********************* /* harmony default export */ const utils = ({ isArray, isArrayBuffer, isBuffer, isFormData, isArrayBufferView, isString: lib_utils_isString, isNumber, isBoolean, isObject: lib_utils_isObject, isPlainObject, isReadableStream, isRequest, isResponse, isHeaders, isUndefined, isDate, isFile, isBlob, isRegExp, isFunction, isStream, isURLSearchParams, isTypedArray, isFileList, forEach, merge, extend, trim, stripBOM, inherits, toFlatObject, kindOf, kindOfTest, endsWith, toArray, forEachEntry, matchAll, isHTMLForm, hasOwnProperty: utils_hasOwnProperty, hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors, freezeMethods, toObjectSet, toCamelCase, noop, toFiniteNumber, findKey, global: _global, isContextDefined, ALPHABET, generateString, isSpecCompliantForm, toJSONObject, isAsyncFn, isThenable, setImmediate: _setImmediate, asap }); ;// ./node_modules/axios/lib/core/AxiosError.js /** * Create an Error with the specified message, config, error code, request and response. * * @param {string} message The error message. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [config] The config. * @param {Object} [request] The request. * @param {Object} [response] The response. * * @returns {Error} The created error. */ function AxiosError(message, code, config, request, response) { Error.call(this); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } else { this.stack = (new Error()).stack; } this.message = message; this.name = 'AxiosError'; code && (this.code = code); config && (this.config = config); request && (this.request = request); if (response) { this.response = response; this.status = response.status ? response.status : null; } } utils.inherits(AxiosError, Error, { toJSON: function toJSON() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: utils.toJSONObject(this.config), code: this.code, status: this.status }; } }); const AxiosError_prototype = AxiosError.prototype; const descriptors = {}; [ 'ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED', 'ERR_NOT_SUPPORT', 'ERR_INVALID_URL' // eslint-disable-next-line func-names ].forEach(code => { descriptors[code] = {value: code}; }); Object.defineProperties(AxiosError, descriptors); Object.defineProperty(AxiosError_prototype, 'isAxiosError', {value: true}); // eslint-disable-next-line func-names AxiosError.from = (error, code, config, request, response, customProps) => { const axiosError = Object.create(AxiosError_prototype); utils.toFlatObject(error, axiosError, function filter(obj) { return obj !== Error.prototype; }, prop => { return prop !== 'isAxiosError'; }); AxiosError.call(axiosError, error.message, code, config, request, response); axiosError.cause = error; axiosError.name = error.name; customProps && Object.assign(axiosError, customProps); return axiosError; }; /* harmony default export */ const core_AxiosError = (AxiosError); ;// ./node_modules/axios/lib/helpers/null.js // eslint-disable-next-line strict /* harmony default export */ const helpers_null = (null); ;// ./node_modules/axios/lib/helpers/toFormData.js // temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored /** * Determines if the given thing is a array or js object. * * @param {string} thing - The object or array to be visited. * * @returns {boolean} */ function isVisitable(thing) { return utils.isPlainObject(thing) || utils.isArray(thing); } /** * It removes the brackets from the end of a string * * @param {string} key - The key of the parameter. * * @returns {string} the key without the brackets. */ function removeBrackets(key) { return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; } /** * It takes a path, a key, and a boolean, and returns a string * * @param {string} path - The path to the current key. * @param {string} key - The key of the current object being iterated over. * @param {string} dots - If true, the key will be rendered with dots instead of brackets. * * @returns {string} The path to the current key. */ function renderKey(path, key, dots) { if (!path) return key; return path.concat(key).map(function each(token, i) { // eslint-disable-next-line no-param-reassign token = removeBrackets(token); return !dots && i ? '[' + token + ']' : token; }).join(dots ? '.' : ''); } /** * If the array is an array and none of its elements are visitable, then it's a flat array. * * @param {Array} arr - The array to check * * @returns {boolean} */ function isFlatArray(arr) { return utils.isArray(arr) && !arr.some(isVisitable); } const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { return /^is[A-Z]/.test(prop); }); /** * Convert a data object to FormData * * @param {Object} obj * @param {?Object} [formData] * @param {?Object} [options] * @param {Function} [options.visitor] * @param {Boolean} [options.metaTokens = true] * @param {Boolean} [options.dots = false] * @param {?Boolean} [options.indexes = false] * * @returns {Object} **/ /** * It converts an object into a FormData object * * @param {Object} obj - The object to convert to form data. * @param {string} formData - The FormData object to append to. * @param {Object} options * * @returns */ function toFormData(obj, formData, options) { if (!utils.isObject(obj)) { throw new TypeError('target must be an object'); } // eslint-disable-next-line no-param-reassign formData = formData || new (helpers_null || FormData)(); // eslint-disable-next-line no-param-reassign options = utils.toFlatObject(options, { metaTokens: true, dots: false, indexes: false }, false, function defined(option, source) { // eslint-disable-next-line no-eq-null,eqeqeq return !utils.isUndefined(source[option]); }); const metaTokens = options.metaTokens; // eslint-disable-next-line no-use-before-define const visitor = options.visitor || defaultVisitor; const dots = options.dots; const indexes = options.indexes; const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; const useBlob = _Blob && utils.isSpecCompliantForm(formData); if (!utils.isFunction(visitor)) { throw new TypeError('visitor must be a function'); } function convertValue(value) { if (value === null) return ''; if (utils.isDate(value)) { return value.toISOString(); } if (!useBlob && utils.isBlob(value)) { throw new core_AxiosError('Blob is not supported. Use a Buffer instead.'); } if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); } return value; } /** * Default visitor. * * @param {*} value * @param {String|Number} key * @param {Array} path * @this {FormData} * * @returns {boolean} return true to visit the each prop of the value recursively */ function defaultVisitor(value, key, path) { let arr = value; if (value && !path && typeof value === 'object') { if (utils.endsWith(key, '{}')) { // eslint-disable-next-line no-param-reassign key = metaTokens ? key : key.slice(0, -2); // eslint-disable-next-line no-param-reassign value = JSON.stringify(value); } else if ( (utils.isArray(value) && isFlatArray(value)) || ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) )) { // eslint-disable-next-line no-param-reassign key = removeBrackets(key); arr.forEach(function each(el, index) { !(utils.isUndefined(el) || el === null) && formData.append( // eslint-disable-next-line no-nested-ternary indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), convertValue(el) ); }); return false; } } if (isVisitable(value)) { return true; } formData.append(renderKey(path, key, dots), convertValue(value)); return false; } const stack = []; const exposedHelpers = Object.assign(predicates, { defaultVisitor, convertValue, isVisitable }); function build(value, path) { if (utils.isUndefined(value)) return; if (stack.indexOf(value) !== -1) { throw Error('Circular reference detected in ' + path.join('.')); } stack.push(value); utils.forEach(value, function each(el, key) { const result = !(utils.isUndefined(el) || el === null) && visitor.call( formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers ); if (result === true) { build(el, path ? path.concat(key) : [key]); } }); stack.pop(); } if (!utils.isObject(obj)) { throw new TypeError('data must be an object'); } build(obj); return formData; } /* harmony default export */ const helpers_toFormData = (toFormData); ;// ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js /** * It encodes a string by replacing all characters that are not in the unreserved set with * their percent-encoded equivalents * * @param {string} str - The string to encode. * * @returns {string} The encoded string. */ function encode(str) { const charMap = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+', '%00': '\x00' }; return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { return charMap[match]; }); } /** * It takes a params object and converts it to a FormData object * * @param {Object} params - The parameters to be converted to a FormData object. * @param {Object} options - The options object passed to the Axios constructor. * * @returns {void} */ function AxiosURLSearchParams(params, options) { this._pairs = []; params && helpers_toFormData(params, this, options); } const AxiosURLSearchParams_prototype = AxiosURLSearchParams.prototype; AxiosURLSearchParams_prototype.append = function append(name, value) { this._pairs.push([name, value]); }; AxiosURLSearchParams_prototype.toString = function toString(encoder) { const _encode = encoder ? function(value) { return encoder.call(this, value, encode); } : encode; return this._pairs.map(function each(pair) { return _encode(pair[0]) + '=' + _encode(pair[1]); }, '').join('&'); }; /* harmony default export */ const helpers_AxiosURLSearchParams = (AxiosURLSearchParams); ;// ./node_modules/axios/lib/helpers/buildURL.js /** * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their * URI encoded counterparts * * @param {string} val The value to be encoded. * * @returns {string} The encoded value. */ function buildURL_encode(val) { return encodeURIComponent(val). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). replace(/%20/g, '+'). replace(/%5B/gi, '['). replace(/%5D/gi, ']'); } /** * Build a URL by appending params to the end * * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended * @param {?object} options * * @returns {string} The formatted url */ function buildURL(url, params, options) { /*eslint no-param-reassign:0*/ if (!params) { return url; } const _encode = options && options.encode || buildURL_encode; const serializeFn = options && options.serialize; let serializedParams; if (serializeFn) { serializedParams = serializeFn(params, options); } else { serializedParams = utils.isURLSearchParams(params) ? params.toString() : new helpers_AxiosURLSearchParams(params, options).toString(_encode); } if (serializedParams) { const hashmarkIndex = url.indexOf("#"); if (hashmarkIndex !== -1) { url = url.slice(0, hashmarkIndex); } url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } return url; } ;// ./node_modules/axios/lib/core/InterceptorManager.js class InterceptorManager { constructor() { this.handlers = []; } /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * * @return {Number} An ID used to remove interceptor later */ use(fulfilled, rejected, options) { this.handlers.push({ fulfilled, rejected, synchronous: options ? options.synchronous : false, runWhen: options ? options.runWhen : null }); return this.handlers.length - 1; } /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` * * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise */ eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } } /** * Clear all interceptors from the stack * * @returns {void} */ clear() { if (this.handlers) { this.handlers = []; } } /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor * * @returns {void} */ forEach(fn) { utils.forEach(this.handlers, function forEachHandler(h) { if (h !== null) { fn(h); } }); } } /* harmony default export */ const core_InterceptorManager = (InterceptorManager); ;// ./node_modules/axios/lib/defaults/transitional.js /* harmony default export */ const defaults_transitional = ({ silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }); ;// ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js /* harmony default export */ const classes_URLSearchParams = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : helpers_AxiosURLSearchParams); ;// ./node_modules/axios/lib/platform/browser/classes/FormData.js /* harmony default export */ const classes_FormData = (typeof FormData !== 'undefined' ? FormData : null); ;// ./node_modules/axios/lib/platform/browser/classes/Blob.js /* harmony default export */ const classes_Blob = (typeof Blob !== 'undefined' ? Blob : null); ;// ./node_modules/axios/lib/platform/browser/index.js /* harmony default export */ const browser = ({ isBrowser: true, classes: { URLSearchParams: classes_URLSearchParams, FormData: classes_FormData, Blob: classes_Blob }, protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] }); ;// ./node_modules/axios/lib/platform/common/utils.js const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; const _navigator = typeof navigator === 'object' && navigator || undefined; /** * Determine if we're running in a standard browser environment * * This allows axios to run in a web worker, and react-native. * Both environments support XMLHttpRequest, but not fully standard globals. * * web workers: * typeof window -> undefined * typeof document -> undefined * * react-native: * navigator.product -> 'ReactNative' * nativescript * navigator.product -> 'NativeScript' or 'NS' * * @returns {boolean} */ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); /** * Determine if we're running in a standard browser webWorker environment * * Although the `isStandardBrowserEnv` method indicates that * `allows axios to run in a web worker`, the WebWorker will still be * filtered out due to its judgment standard * `typeof window !== 'undefined' && typeof document !== 'undefined'`. * This leads to a problem when axios post `FormData` in webWorker */ const hasStandardBrowserWebWorkerEnv = (() => { return ( typeof WorkerGlobalScope !== 'undefined' && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts === 'function' ); })(); const origin = hasBrowserEnv && window.location.href || 'http://localhost'; ;// ./node_modules/axios/lib/platform/index.js /* harmony default export */ const platform = ({ ...common_utils_namespaceObject, ...browser }); ;// ./node_modules/axios/lib/helpers/toURLEncodedForm.js function toURLEncodedForm(data, options) { return helpers_toFormData(data, new platform.classes.URLSearchParams(), Object.assign({ visitor: function(value, key, path, helpers) { if (platform.isNode && utils.isBuffer(value)) { this.append(key, value.toString('base64')); return false; } return helpers.defaultVisitor.apply(this, arguments); } }, options)); } ;// ./node_modules/axios/lib/helpers/formDataToJSON.js /** * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] * * @param {string} name - The name of the property to get. * * @returns An array of strings. */ function parsePropPath(name) { // foo[x][y][z] // foo.x.y.z // foo-x-y-z // foo x y z return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { return match[0] === '[]' ? '' : match[1] || match[0]; }); } /** * Convert an array to an object. * * @param {Array} arr - The array to convert to an object. * * @returns An object with the same keys and values as the array. */ function arrayToObject(arr) { const obj = {}; const keys = Object.keys(arr); let i; const len = keys.length; let key; for (i = 0; i < len; i++) { key = keys[i]; obj[key] = arr[key]; } return obj; } /** * It takes a FormData object and returns a JavaScript object * * @param {string} formData The FormData object to convert to JSON. * * @returns {Object | null} The converted object. */ function formDataToJSON(formData) { function buildPath(path, value, target, index) { let name = path[index++]; if (name === '__proto__') return true; const isNumericKey = Number.isFinite(+name); const isLast = index >= path.length; name = !name && utils.isArray(target) ? target.length : name; if (isLast) { if (utils.hasOwnProp(target, name)) { target[name] = [target[name], value]; } else { target[name] = value; } return !isNumericKey; } if (!target[name] || !utils.isObject(target[name])) { target[name] = []; } const result = buildPath(path, value, target[name], index); if (result && utils.isArray(target[name])) { target[name] = arrayToObject(target[name]); } return !isNumericKey; } if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { const obj = {}; utils.forEachEntry(formData, (name, value) => { buildPath(parsePropPath(name), value, obj, 0); }); return obj; } return null; } /* harmony default export */ const helpers_formDataToJSON = (formDataToJSON); ;// ./node_modules/axios/lib/defaults/index.js /** * It takes a string, tries to parse it, and if it fails, it returns the stringified version * of the input * * @param {any} rawValue - The value to be stringified. * @param {Function} parser - A function that parses a string into a JavaScript object. * @param {Function} encoder - A function that takes a value and returns a string. * * @returns {string} A stringified version of the rawValue. */ function stringifySafely(rawValue, parser, encoder) { if (utils.isString(rawValue)) { try { (parser || JSON.parse)(rawValue); return utils.trim(rawValue); } catch (e) { if (e.name !== 'SyntaxError') { throw e; } } } return (encoder || JSON.stringify)(rawValue); } const defaults = { transitional: defaults_transitional, adapter: ['xhr', 'http', 'fetch'], transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ''; const hasJSONContentType = contentType.indexOf('application/json') > -1; const isObjectPayload = utils.isObject(data); if (isObjectPayload && utils.isHTMLForm(data)) { data = new FormData(data); } const isFormData = utils.isFormData(data); if (isFormData) { return hasJSONContentType ? JSON.stringify(helpers_formDataToJSON(data)) : data; } if (utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data) || utils.isReadableStream(data) ) { return data; } if (utils.isArrayBufferView(data)) { return data.buffer; } if (utils.isURLSearchParams(data)) { headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); return data.toString(); } let isFileList; if (isObjectPayload) { if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { return toURLEncodedForm(data, this.formSerializer).toString(); } if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { const _FormData = this.env && this.env.FormData; return helpers_toFormData( isFileList ? {'files[]': data} : data, _FormData && new _FormData(), this.formSerializer ); } } if (isObjectPayload || hasJSONContentType ) { headers.setContentType('application/json', false); return stringifySafely(data); } return data; }], transformResponse: [function transformResponse(data) { const transitional = this.transitional || defaults.transitional; const forcedJSONParsing = transitional && transitional.forcedJSONParsing; const JSONRequested = this.responseType === 'json'; if (utils.isResponse(data) || utils.isReadableStream(data)) { return data; } if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { const silentJSONParsing = transitional && transitional.silentJSONParsing; const strictJSONParsing = !silentJSONParsing && JSONRequested; try { return JSON.parse(data); } catch (e) { if (strictJSONParsing) { if (e.name === 'SyntaxError') { throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, this.response); } throw e; } } } return data; }], /** * A timeout in milliseconds to abort a request. If set to 0 (default) a * timeout is not created. */ timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: platform.classes.FormData, Blob: platform.classes.Blob }, validateStatus: function validateStatus(status) { return status >= 200 && status < 300; }, headers: { common: { 'Accept': 'application/json, text/plain, */*', 'Content-Type': undefined } } }; utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { defaults.headers[method] = {}; }); /* harmony default export */ const lib_defaults = (defaults); ;// ./node_modules/axios/lib/helpers/parseHeaders.js // RawAxiosHeaders whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers const ignoreDuplicateOf = utils.toObjectSet([ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]); /** * Parse headers into an object * * ``` * Date: Wed, 27 Aug 2014 08:58:49 GMT * Content-Type: application/json * Connection: keep-alive * Transfer-Encoding: chunked * ``` * * @param {String} rawHeaders Headers needing to be parsed * * @returns {Object} Headers parsed into an object */ /* harmony default export */ const parseHeaders = (rawHeaders => { const parsed = {}; let key; let val; let i; rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { i = line.indexOf(':'); key = line.substring(0, i).trim().toLowerCase(); val = line.substring(i + 1).trim(); if (!key || (parsed[key] && ignoreDuplicateOf[key])) { return; } if (key === 'set-cookie') { if (parsed[key]) { parsed[key].push(val); } else { parsed[key] = [val]; } } else { parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } }); return parsed; }); ;// ./node_modules/axios/lib/core/AxiosHeaders.js const $internals = Symbol('internals'); function normalizeHeader(header) { return header && String(header).trim().toLowerCase(); } function normalizeValue(value) { if (value === false || value == null) { return value; } return utils.isArray(value) ? value.map(normalizeValue) : String(value); } function parseTokens(str) { const tokens = Object.create(null); const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let match; while ((match = tokensRE.exec(str))) { tokens[match[1]] = match[2]; } return tokens; } const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { if (utils.isFunction(filter)) { return filter.call(this, value, header); } if (isHeaderNameFilter) { value = header; } if (!utils.isString(value)) return; if (utils.isString(filter)) { return value.indexOf(filter) !== -1; } if (utils.isRegExp(filter)) { return filter.test(value); } } function formatHeader(header) { return header.trim() .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { return char.toUpperCase() + str; }); } function buildAccessors(obj, header) { const accessorName = utils.toCamelCase(' ' + header); ['get', 'set', 'has'].forEach(methodName => { Object.defineProperty(obj, methodName + accessorName, { value: function(arg1, arg2, arg3) { return this[methodName].call(this, header, arg1, arg2, arg3); }, configurable: true }); }); } class AxiosHeaders { constructor(headers) { headers && this.set(headers); } set(header, valueOrRewrite, rewrite) { const self = this; function setHeader(_value, _header, _rewrite) { const lHeader = normalizeHeader(_header); if (!lHeader) { throw new Error('header name must be a non-empty string'); } const key = utils.findKey(self, lHeader); if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { self[key || _header] = normalizeValue(_value); } } const setHeaders = (headers, _rewrite) => utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); if (utils.isPlainObject(header) || header instanceof this.constructor) { setHeaders(header, valueOrRewrite) } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { setHeaders(parseHeaders(header), valueOrRewrite); } else if (utils.isHeaders(header)) { for (const [key, value] of header.entries()) { setHeader(value, key, rewrite); } } else { header != null && setHeader(valueOrRewrite, header, rewrite); } return this; } get(header, parser) { header = normalizeHeader(header); if (header) { const key = utils.findKey(this, header); if (key) { const value = this[key]; if (!parser) { return value; } if (parser === true) { return parseTokens(value); } if (utils.isFunction(parser)) { return parser.call(this, value, key); } if (utils.isRegExp(parser)) { return parser.exec(value); } throw new TypeError('parser must be boolean|regexp|function'); } } } has(header, matcher) { header = normalizeHeader(header); if (header) { const key = utils.findKey(this, header); return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); } return false; } delete(header, matcher) { const self = this; let deleted = false; function deleteHeader(_header) { _header = normalizeHeader(_header); if (_header) { const key = utils.findKey(self, _header); if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { delete self[key]; deleted = true; } } } if (utils.isArray(header)) { header.forEach(deleteHeader); } else { deleteHeader(header); } return deleted; } clear(matcher) { const keys = Object.keys(this); let i = keys.length; let deleted = false; while (i--) { const key = keys[i]; if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { delete this[key]; deleted = true; } } return deleted; } normalize(format) { const self = this; const headers = {}; utils.forEach(this, (value, header) => { const key = utils.findKey(headers, header); if (key) { self[key] = normalizeValue(value); delete self[header]; return; } const normalized = format ? formatHeader(header) : String(header).trim(); if (normalized !== header) { delete self[header]; } self[normalized] = normalizeValue(value); headers[normalized] = true; }); return this; } concat(...targets) { return this.constructor.concat(this, ...targets); } toJSON(asStrings) { const obj = Object.create(null); utils.forEach(this, (value, header) => { value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); }); return obj; } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator](); } toString() { return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); } get [Symbol.toStringTag]() { return 'AxiosHeaders'; } static from(thing) { return thing instanceof this ? thing : new this(thing); } static concat(first, ...targets) { const computed = new this(first); targets.forEach((target) => computed.set(target)); return computed; } static accessor(header) { const internals = this[$internals] = (this[$internals] = { accessors: {} }); const accessors = internals.accessors; const prototype = this.prototype; function defineAccessor(_header) { const lHeader = normalizeHeader(_header); if (!accessors[lHeader]) { buildAccessors(prototype, _header); accessors[lHeader] = true; } } utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); return this; } } AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); // reserved names hotfix utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` return { get: () => value, set(headerValue) { this[mapped] = headerValue; } } }); utils.freezeMethods(AxiosHeaders); /* harmony default export */ const core_AxiosHeaders = (AxiosHeaders); ;// ./node_modules/axios/lib/core/transformData.js /** * Transform the data for a request or a response * * @param {Array|Function} fns A single function or Array of functions * @param {?Object} response The response object * * @returns {*} The resulting transformed data */ function transformData(fns, response) { const config = this || lib_defaults; const context = response || config; const headers = core_AxiosHeaders.from(context.headers); let data = context.data; utils.forEach(fns, function transform(fn) { data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); }); headers.normalize(); return data; } ;// ./node_modules/axios/lib/cancel/isCancel.js function isCancel(value) { return !!(value && value.__CANCEL__); } ;// ./node_modules/axios/lib/cancel/CanceledError.js /** * A `CanceledError` is an object that is thrown when an operation is canceled. * * @param {string=} message The message. * @param {Object=} config The config. * @param {Object=} request The request. * * @returns {CanceledError} The created error. */ function CanceledError(message, config, request) { // eslint-disable-next-line no-eq-null,eqeqeq core_AxiosError.call(this, message == null ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request); this.name = 'CanceledError'; } utils.inherits(CanceledError, core_AxiosError, { __CANCEL__: true }); /* harmony default export */ const cancel_CanceledError = (CanceledError); ;// ./node_modules/axios/lib/core/settle.js /** * Resolve or reject a Promise based on response status. * * @param {Function} resolve A function that resolves the promise. * @param {Function} reject A function that rejects the promise. * @param {object} response The response. * * @returns {object} The response. */ function settle(resolve, reject, response) { const validateStatus = response.config.validateStatus; if (!response.status || !validateStatus || validateStatus(response.status)) { resolve(response); } else { reject(new core_AxiosError( 'Request failed with status code ' + response.status, [core_AxiosError.ERR_BAD_REQUEST, core_AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response )); } } ;// ./node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url) { const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); return match && match[1] || ''; } ;// ./node_modules/axios/lib/helpers/speedometer.js /** * Calculate data maxRate * @param {Number} [samplesCount= 10] * @param {Number} [min= 1000] * @returns {Function} */ function speedometer(samplesCount, min) { samplesCount = samplesCount || 10; const bytes = new Array(samplesCount); const timestamps = new Array(samplesCount); let head = 0; let tail = 0; let firstSampleTS; min = min !== undefined ? min : 1000; return function push(chunkLength) { const now = Date.now(); const startedAt = timestamps[tail]; if (!firstSampleTS) { firstSampleTS = now; } bytes[head] = chunkLength; timestamps[head] = now; let i = tail; let bytesCount = 0; while (i !== head) { bytesCount += bytes[i++]; i = i % samplesCount; } head = (head + 1) % samplesCount; if (head === tail) { tail = (tail + 1) % samplesCount; } if (now - firstSampleTS < min) { return; } const passed = startedAt && now - startedAt; return passed ? Math.round(bytesCount * 1000 / passed) : undefined; }; } /* harmony default export */ const helpers_speedometer = (speedometer); ;// ./node_modules/axios/lib/helpers/throttle.js /** * Throttle decorator * @param {Function} fn * @param {Number} freq * @return {Function} */ function throttle(fn, freq) { let timestamp = 0; let threshold = 1000 / freq; let lastArgs; let timer; const invoke = (args, now = Date.now()) => { timestamp = now; lastArgs = null; if (timer) { clearTimeout(timer); timer = null; } fn.apply(null, args); } const throttled = (...args) => { const now = Date.now(); const passed = now - timestamp; if ( passed >= threshold) { invoke(args, now); } else { lastArgs = args; if (!timer) { timer = setTimeout(() => { timer = null; invoke(lastArgs) }, threshold - passed); } } } const flush = () => lastArgs && invoke(lastArgs); return [throttled, flush]; } /* harmony default export */ const helpers_throttle = (throttle); ;// ./node_modules/axios/lib/helpers/progressEventReducer.js const progressEventReducer = (listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = helpers_speedometer(50, 250); return helpers_throttle(e => { const loaded = e.loaded; const total = e.lengthComputable ? e.total : undefined; const progressBytes = loaded - bytesNotified; const rate = _speedometer(progressBytes); const inRange = loaded <= total; bytesNotified = loaded; const data = { loaded, total, progress: total ? (loaded / total) : undefined, bytes: progressBytes, rate: rate ? rate : undefined, estimated: rate && total && inRange ? (total - loaded) / rate : undefined, event: e, lengthComputable: total != null, [isDownloadStream ? 'download' : 'upload']: true }; listener(data); }, freq); } const progressEventDecorator = (total, throttled) => { const lengthComputable = total != null; return [(loaded) => throttled[0]({ lengthComputable, total, loaded }), throttled[1]]; } const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args)); ;// ./node_modules/axios/lib/helpers/isURLSameOrigin.js /* harmony default export */ const isURLSameOrigin = (platform.hasStandardBrowserEnv ? // Standard browser envs have full support of the APIs needed to test // whether the request URL is of the same origin as current location. (function standardBrowserEnv() { const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent); const urlParsingNode = document.createElement('a'); let originURL; /** * Parse a URL to discover its components * * @param {String} url The URL to be parsed * @returns {Object} */ function resolveURL(url) { let href = url; if (msie) { // IE needs attribute set twice to normalize properties urlParsingNode.setAttribute('href', href); href = urlParsingNode.href; } urlParsingNode.setAttribute('href', href); // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils return { href: urlParsingNode.href, protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', host: urlParsingNode.host, search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', hostname: urlParsingNode.hostname, port: urlParsingNode.port, pathname: (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname }; } originURL = resolveURL(window.location.href); /** * Determine if a URL shares the same origin as the current location * * @param {String} requestURL The URL to test * @returns {boolean} True if URL shares the same origin, otherwise false */ return function isURLSameOrigin(requestURL) { const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; return (parsed.protocol === originURL.protocol && parsed.host === originURL.host); }; })() : // Non standard browser envs (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return function isURLSameOrigin() { return true; }; })()); ;// ./node_modules/axios/lib/helpers/cookies.js /* harmony default export */ const cookies = (platform.hasStandardBrowserEnv ? // Standard browser envs support document.cookie { write(name, value, expires, path, domain, secure) { const cookie = [name + '=' + encodeURIComponent(value)]; utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); utils.isString(path) && cookie.push('path=' + path); utils.isString(domain) && cookie.push('domain=' + domain); secure === true && cookie.push('secure'); document.cookie = cookie.join('; '); }, read(name) { const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); return (match ? decodeURIComponent(match[3]) : null); }, remove(name) { this.write(name, '', Date.now() - 86400000); } } : // Non-standard browser env (web workers, react-native) lack needed support. { write() {}, read() { return null; }, remove() {} }); ;// ./node_modules/axios/lib/helpers/isAbsoluteURL.js /** * Determines whether the specified URL is absolute * * @param {string} url The URL to test * * @returns {boolean} True if the specified URL is absolute, otherwise false */ function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); } ;// ./node_modules/axios/lib/helpers/combineURLs.js /** * Creates a new URL by combining the specified URLs * * @param {string} baseURL The base URL * @param {string} relativeURL The relative URL * * @returns {string} The combined URL */ function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; } ;// ./node_modules/axios/lib/core/buildFullPath.js /** * Creates a new URL by combining the baseURL with the requestedURL, * only when the requestedURL is not already an absolute URL. * If the requestURL is absolute, this function returns the requestedURL untouched. * * @param {string} baseURL The base URL * @param {string} requestedURL Absolute or relative URL to combine * * @returns {string} The combined full path */ function buildFullPath(baseURL, requestedURL) { if (baseURL && !isAbsoluteURL(requestedURL)) { return combineURLs(baseURL, requestedURL); } return requestedURL; } ;// ./node_modules/axios/lib/core/mergeConfig.js const headersToObject = (thing) => thing instanceof core_AxiosHeaders ? { ...thing } : thing; /** * Config-specific merge-function which creates a new config-object * by merging two configuration objects together. * * @param {Object} config1 * @param {Object} config2 * * @returns {Object} New object resulting from merging config2 to config1 */ function mergeConfig(config1, config2) { // eslint-disable-next-line no-param-reassign config2 = config2 || {}; const config = {}; function getMergedValue(target, source, caseless) { if (utils.isPlainObject(target) && utils.isPlainObject(source)) { return utils.merge.call({caseless}, target, source); } else if (utils.isPlainObject(source)) { return utils.merge({}, source); } else if (utils.isArray(source)) { return source.slice(); } return source; } // eslint-disable-next-line consistent-return function mergeDeepProperties(a, b, caseless) { if (!utils.isUndefined(b)) { return getMergedValue(a, b, caseless); } else if (!utils.isUndefined(a)) { return getMergedValue(undefined, a, caseless); } } // eslint-disable-next-line consistent-return function valueFromConfig2(a, b) { if (!utils.isUndefined(b)) { return getMergedValue(undefined, b); } } // eslint-disable-next-line consistent-return function defaultToConfig2(a, b) { if (!utils.isUndefined(b)) { return getMergedValue(undefined, b); } else if (!utils.isUndefined(a)) { return getMergedValue(undefined, a); } } // eslint-disable-next-line consistent-return function mergeDirectKeys(a, b, prop) { if (prop in config2) { return getMergedValue(a, b); } else if (prop in config1) { return getMergedValue(undefined, a); } } const mergeMap = { url: valueFromConfig2, method: valueFromConfig2, data: valueFromConfig2, baseURL: defaultToConfig2, transformRequest: defaultToConfig2, transformResponse: defaultToConfig2, paramsSerializer: defaultToConfig2, timeout: defaultToConfig2, timeoutMessage: defaultToConfig2, withCredentials: defaultToConfig2, withXSRFToken: defaultToConfig2, adapter: defaultToConfig2, responseType: defaultToConfig2, xsrfCookieName: defaultToConfig2, xsrfHeaderName: defaultToConfig2, onUploadProgress: defaultToConfig2, onDownloadProgress: defaultToConfig2, decompress: defaultToConfig2, maxContentLength: defaultToConfig2, maxBodyLength: defaultToConfig2, beforeRedirect: defaultToConfig2, transport: defaultToConfig2, httpAgent: defaultToConfig2, httpsAgent: defaultToConfig2, cancelToken: defaultToConfig2, socketPath: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) }; utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { const merge = mergeMap[prop] || mergeDeepProperties; const configValue = merge(config1[prop], config2[prop], prop); (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); }); return config; } ;// ./node_modules/axios/lib/helpers/resolveConfig.js /* harmony default export */ const resolveConfig = ((config) => { const newConfig = mergeConfig({}, config); let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig; newConfig.headers = headers = core_AxiosHeaders.from(headers); newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer); // HTTP basic authentication if (auth) { headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) ); } let contentType; if (utils.isFormData(data)) { if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { headers.setContentType(undefined); // Let the browser set it } else if ((contentType = headers.getContentType()) !== false) { // fix semicolon duplication issue for ReactNative FormData implementation const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; headers.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); } } // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (platform.hasStandardBrowserEnv) { withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) { // Add xsrf header const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); if (xsrfValue) { headers.set(xsrfHeaderName, xsrfValue); } } } return newConfig; }); ;// ./node_modules/axios/lib/adapters/xhr.js const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; /* harmony default export */ const xhr = (isXHRAdapterSupported && function (config) { return new Promise(function dispatchXhrRequest(resolve, reject) { const _config = resolveConfig(config); let requestData = _config.data; const requestHeaders = core_AxiosHeaders.from(_config.headers).normalize(); let {responseType, onUploadProgress, onDownloadProgress} = _config; let onCanceled; let uploadThrottled, downloadThrottled; let flushUpload, flushDownload; function done() { flushUpload && flushUpload(); // flush events flushDownload && flushDownload(); // flush events _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); _config.signal && _config.signal.removeEventListener('abort', onCanceled); } let request = new XMLHttpRequest(); request.open(_config.method.toUpperCase(), _config.url, true); // Set the request timeout in MS request.timeout = _config.timeout; function onloadend() { if (!request) { return; } // Prepare the response const responseHeaders = core_AxiosHeaders.from( 'getAllResponseHeaders' in request && request.getAllResponseHeaders() ); const responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; const response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config, request }; settle(function _resolve(value) { resolve(value); done(); }, function _reject(err) { reject(err); done(); }, response); // Clean up request request = null; } if ('onloadend' in request) { // Use onloadend if available request.onloadend = onloadend; } else { // Listen for ready state to emulate onloadend request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // readystate handler is calling before onerror or ontimeout handlers, // so we should call onloadend on the next 'tick' setTimeout(onloadend); }; } // Handle browser request cancellation (as opposed to a manual cancellation) request.onabort = function handleAbort() { if (!request) { return; } reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request)); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; const transitional = _config.transitional || defaults_transitional; if (_config.timeoutErrorMessage) { timeoutErrorMessage = _config.timeoutErrorMessage; } reject(new core_AxiosError( timeoutErrorMessage, transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, config, request)); // Clean up request request = null; }; // Remove Content-Type if data is undefined requestData === undefined && requestHeaders.setContentType(null); // Add headers to the request if ('setRequestHeader' in request) { utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { request.setRequestHeader(key, val); }); } // Add withCredentials to request if needed if (!utils.isUndefined(_config.withCredentials)) { request.withCredentials = !!_config.withCredentials; } // Add responseType to request if needed if (responseType && responseType !== 'json') { request.responseType = _config.responseType; } // Handle progress if needed if (onDownloadProgress) { ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); request.addEventListener('progress', downloadThrottled); } // Not all browsers support upload events if (onUploadProgress && request.upload) { ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); request.upload.addEventListener('progress', uploadThrottled); request.upload.addEventListener('loadend', flushUpload); } if (_config.cancelToken || _config.signal) { // Handle cancellation // eslint-disable-next-line func-names onCanceled = cancel => { if (!request) { return; } reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel); request.abort(); request = null; }; _config.cancelToken && _config.cancelToken.subscribe(onCanceled); if (_config.signal) { _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); } } const protocol = parseProtocol(_config.url); if (protocol && platform.protocols.indexOf(protocol) === -1) { reject(new core_AxiosError('Unsupported protocol ' + protocol + ':', core_AxiosError.ERR_BAD_REQUEST, config)); return; } // Send the request request.send(requestData || null); }); }); ;// ./node_modules/axios/lib/helpers/composeSignals.js const composeSignals = (signals, timeout) => { const {length} = (signals = signals ? signals.filter(Boolean) : []); if (timeout || length) { let controller = new AbortController(); let aborted; const onabort = function (reason) { if (!aborted) { aborted = true; unsubscribe(); const err = reason instanceof Error ? reason : this.reason; controller.abort(err instanceof core_AxiosError ? err : new cancel_CanceledError(err instanceof Error ? err.message : err)); } } let timer = timeout && setTimeout(() => { timer = null; onabort(new core_AxiosError(`timeout ${timeout} of ms exceeded`, core_AxiosError.ETIMEDOUT)) }, timeout) const unsubscribe = () => { if (signals) { timer && clearTimeout(timer); timer = null; signals.forEach(signal => { signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); }); signals = null; } } signals.forEach((signal) => signal.addEventListener('abort', onabort)); const {signal} = controller; signal.unsubscribe = () => utils.asap(unsubscribe); return signal; } } /* harmony default export */ const helpers_composeSignals = (composeSignals); ;// ./node_modules/axios/lib/helpers/trackStream.js const streamChunk = function* (chunk, chunkSize) { let len = chunk.byteLength; if (!chunkSize || len < chunkSize) { yield chunk; return; } let pos = 0; let end; while (pos < len) { end = pos + chunkSize; yield chunk.slice(pos, end); pos = end; } } const readBytes = async function* (iterable, chunkSize) { for await (const chunk of readStream(iterable)) { yield* streamChunk(chunk, chunkSize); } } const readStream = async function* (stream) { if (stream[Symbol.asyncIterator]) { yield* stream; return; } const reader = stream.getReader(); try { for (;;) { const {done, value} = await reader.read(); if (done) { break; } yield value; } } finally { await reader.cancel(); } } const trackStream = (stream, chunkSize, onProgress, onFinish) => { const iterator = readBytes(stream, chunkSize); let bytes = 0; let done; let _onFinish = (e) => { if (!done) { done = true; onFinish && onFinish(e); } } return new ReadableStream({ async pull(controller) { try { const {done, value} = await iterator.next(); if (done) { _onFinish(); controller.close(); return; } let len = value.byteLength; if (onProgress) { let loadedBytes = bytes += len; onProgress(loadedBytes); } controller.enqueue(new Uint8Array(value)); } catch (err) { _onFinish(err); throw err; } }, cancel(reason) { _onFinish(reason); return iterator.return(); } }, { highWaterMark: 2 }) } ;// ./node_modules/axios/lib/adapters/fetch.js const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function'; const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function'; // used only inside the fetch adapter const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()) ); const test = (fn, ...args) => { try { return !!fn(...args); } catch (e) { return false } } const supportsRequestStream = isReadableStreamSupported && test(() => { let duplexAccessed = false; const hasContentType = new Request(platform.origin, { body: new ReadableStream(), method: 'POST', get duplex() { duplexAccessed = true; return 'half'; }, }).headers.has('Content-Type'); return duplexAccessed && !hasContentType; }); const DEFAULT_CHUNK_SIZE = 64 * 1024; const supportsResponseStream = isReadableStreamSupported && test(() => utils.isReadableStream(new Response('').body)); const resolvers = { stream: supportsResponseStream && ((res) => res.body) }; isFetchSupported && (((res) => { ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { !resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() : (_, config) => { throw new core_AxiosError(`Response type '${type}' is not supported`, core_AxiosError.ERR_NOT_SUPPORT, config); }) }); })(new Response)); const getBodyLength = async (body) => { if (body == null) { return 0; } if(utils.isBlob(body)) { return body.size; } if(utils.isSpecCompliantForm(body)) { const _request = new Request(platform.origin, { method: 'POST', body, }); return (await _request.arrayBuffer()).byteLength; } if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) { return body.byteLength; } if(utils.isURLSearchParams(body)) { body = body + ''; } if(utils.isString(body)) { return (await encodeText(body)).byteLength; } } const resolveBodyLength = async (headers, body) => { const length = utils.toFiniteNumber(headers.getContentLength()); return length == null ? getBodyLength(body) : length; } /* harmony default export */ const adapters_fetch = (isFetchSupported && (async (config) => { let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = 'same-origin', fetchOptions } = resolveConfig(config); responseType = responseType ? (responseType + '').toLowerCase() : 'text'; let composedSignal = helpers_composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); let request; const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { composedSignal.unsubscribe(); }); let requestContentLength; try { if ( onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && (requestContentLength = await resolveBodyLength(headers, data)) !== 0 ) { let _request = new Request(url, { method: 'POST', body: data, duplex: "half" }); let contentTypeHeader; if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { headers.setContentType(contentTypeHeader) } if (_request.body) { const [onProgress, flush] = progressEventDecorator( requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)) ); data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); } } if (!utils.isString(withCredentials)) { withCredentials = withCredentials ? 'include' : 'omit'; } // Cloudflare Workers throws when credentials are defined // see https://github.com/cloudflare/workerd/issues/902 const isCredentialsSupported = "credentials" in Request.prototype; request = new Request(url, { ...fetchOptions, signal: composedSignal, method: method.toUpperCase(), headers: headers.normalize().toJSON(), body: data, duplex: "half", credentials: isCredentialsSupported ? withCredentials : undefined }); let response = await fetch(request); const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { const options = {}; ['status', 'statusText', 'headers'].forEach(prop => { options[prop] = response[prop]; }); const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length')); const [onProgress, flush] = onDownloadProgress && progressEventDecorator( responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true) ) || []; response = new Response( trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { flush && flush(); unsubscribe && unsubscribe(); }), options ); } responseType = responseType || 'text'; let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config); !isStreamResponse && unsubscribe && unsubscribe(); return await new Promise((resolve, reject) => { settle(resolve, reject, { data: responseData, headers: core_AxiosHeaders.from(response.headers), status: response.status, statusText: response.statusText, config, request }) }) } catch (err) { unsubscribe && unsubscribe(); if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) { throw Object.assign( new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request), { cause: err.cause || err } ) } throw core_AxiosError.from(err, err && err.code, config, request); } })); ;// ./node_modules/axios/lib/adapters/adapters.js const knownAdapters = { http: helpers_null, xhr: xhr, fetch: adapters_fetch } utils.forEach(knownAdapters, (fn, value) => { if (fn) { try { Object.defineProperty(fn, 'name', {value}); } catch (e) { // eslint-disable-next-line no-empty } Object.defineProperty(fn, 'adapterName', {value}); } }); const renderReason = (reason) => `- ${reason}`; const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; /* harmony default export */ const adapters = ({ getAdapter: (adapters) => { adapters = utils.isArray(adapters) ? adapters : [adapters]; const {length} = adapters; let nameOrAdapter; let adapter; const rejectedReasons = {}; for (let i = 0; i < length; i++) { nameOrAdapter = adapters[i]; let id; adapter = nameOrAdapter; if (!isResolvedHandle(nameOrAdapter)) { adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; if (adapter === undefined) { throw new core_AxiosError(`Unknown adapter '${id}'`); } } if (adapter) { break; } rejectedReasons[id || '#' + i] = adapter; } if (!adapter) { const reasons = Object.entries(rejectedReasons) .map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build') ); let s = length ? (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : 'as no adapter specified'; throw new core_AxiosError( `There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT' ); } return adapter; }, adapters: knownAdapters }); ;// ./node_modules/axios/lib/core/dispatchRequest.js /** * Throws a `CanceledError` if cancellation has been requested. * * @param {Object} config The config that is to be used for the request * * @returns {void} */ function throwIfCancellationRequested(config) { if (config.cancelToken) { config.cancelToken.throwIfRequested(); } if (config.signal && config.signal.aborted) { throw new cancel_CanceledError(null, config); } } /** * Dispatch a request to the server using the configured adapter. * * @param {object} config The config that is to be used for the request * * @returns {Promise} The Promise to be fulfilled */ function dispatchRequest(config) { throwIfCancellationRequested(config); config.headers = core_AxiosHeaders.from(config.headers); // Transform request data config.data = transformData.call( config, config.transformRequest ); if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { config.headers.setContentType('application/x-www-form-urlencoded', false); } const adapter = adapters.getAdapter(config.adapter || lib_defaults.adapter); return adapter(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); // Transform response data response.data = transformData.call( config, config.transformResponse, response ); response.headers = core_AxiosHeaders.from(response.headers); return response; }, function onAdapterRejection(reason) { if (!isCancel(reason)) { throwIfCancellationRequested(config); // Transform response data if (reason && reason.response) { reason.response.data = transformData.call( config, config.transformResponse, reason.response ); reason.response.headers = core_AxiosHeaders.from(reason.response.headers); } } return Promise.reject(reason); }); } ;// ./node_modules/axios/lib/env/data.js const VERSION = "1.7.7"; ;// ./node_modules/axios/lib/helpers/validator.js const validators = {}; // eslint-disable-next-line func-names ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { validators[type] = function validator(thing) { return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; }; }); const deprecatedWarnings = {}; /** * Transitional option validator * * @param {function|boolean?} validator - set to false if the transitional option has been removed * @param {string?} version - deprecated version / removed since version * @param {string?} message - some message with additional info * * @returns {function} */ validators.transitional = function transitional(validator, version, message) { function formatMessage(opt, desc) { return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); } // eslint-disable-next-line func-names return (value, opt, opts) => { if (validator === false) { throw new core_AxiosError( formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), core_AxiosError.ERR_DEPRECATED ); } if (version && !deprecatedWarnings[opt]) { deprecatedWarnings[opt] = true; // eslint-disable-next-line no-console console.warn( formatMessage( opt, ' has been deprecated since v' + version + ' and will be removed in the near future' ) ); } return validator ? validator(value, opt, opts) : true; }; }; /** * Assert object's properties type * * @param {object} options * @param {object} schema * @param {boolean?} allowUnknown * * @returns {object} */ function assertOptions(options, schema, allowUnknown) { if (typeof options !== 'object') { throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); let i = keys.length; while (i-- > 0) { const opt = keys[i]; const validator = schema[opt]; if (validator) { const value = options[opt]; const result = value === undefined || validator(value, opt, options); if (result !== true) { throw new core_AxiosError('option ' + opt + ' must be ' + result, core_AxiosError.ERR_BAD_OPTION_VALUE); } continue; } if (allowUnknown !== true) { throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION); } } } /* harmony default export */ const validator = ({ assertOptions, validators }); ;// ./node_modules/axios/lib/core/Axios.js const Axios_validators = validator.validators; /** * Create a new instance of Axios * * @param {Object} instanceConfig The default config for the instance * * @return {Axios} A new instance of Axios */ class Axios { constructor(instanceConfig) { this.defaults = instanceConfig; this.interceptors = { request: new core_InterceptorManager(), response: new core_InterceptorManager() }; } /** * Dispatch a request * * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) * @param {?Object} config * * @returns {Promise} The Promise to be fulfilled */ async request(configOrUrl, config) { try { return await this._request(configOrUrl, config); } catch (err) { if (err instanceof Error) { let dummy; Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); // slice off the Error: ... line const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; try { if (!err.stack) { err.stack = stack; // match without the 2 top stack lines } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { err.stack += '\n' + stack } } catch (e) { // ignore the case where "stack" is an un-writable property } } throw err; } } _request(configOrUrl, config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof configOrUrl === 'string') { config = config || {}; config.url = configOrUrl; } else { config = configOrUrl || {}; } config = mergeConfig(this.defaults, config); const {transitional, paramsSerializer, headers} = config; if (transitional !== undefined) { validator.assertOptions(transitional, { silentJSONParsing: Axios_validators.transitional(Axios_validators.boolean), forcedJSONParsing: Axios_validators.transitional(Axios_validators.boolean), clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean) }, false); } if (paramsSerializer != null) { if (utils.isFunction(paramsSerializer)) { config.paramsSerializer = { serialize: paramsSerializer } } else { validator.assertOptions(paramsSerializer, { encode: Axios_validators.function, serialize: Axios_validators.function }, true); } } // Set config.method config.method = (config.method || this.defaults.method || 'get').toLowerCase(); // Flatten headers let contextHeaders = headers && utils.merge( headers.common, headers[config.method] ); headers && utils.forEach( ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => { delete headers[method]; } ); config.headers = core_AxiosHeaders.concat(contextHeaders, headers); // filter out skipped interceptors const requestInterceptorChain = []; let synchronousRequestInterceptors = true; this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { return; } synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); }); const responseInterceptorChain = []; this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); }); let promise; let i = 0; let len; if (!synchronousRequestInterceptors) { const chain = [dispatchRequest.bind(this), undefined]; chain.unshift.apply(chain, requestInterceptorChain); chain.push.apply(chain, responseInterceptorChain); len = chain.length; promise = Promise.resolve(config); while (i < len) { promise = promise.then(chain[i++], chain[i++]); } return promise; } len = requestInterceptorChain.length; let newConfig = config; i = 0; while (i < len) { const onFulfilled = requestInterceptorChain[i++]; const onRejected = requestInterceptorChain[i++]; try { newConfig = onFulfilled(newConfig); } catch (error) { onRejected.call(this, error); break; } } try { promise = dispatchRequest.call(this, newConfig); } catch (error) { return Promise.reject(error); } i = 0; len = responseInterceptorChain.length; while (i < len) { promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); } return promise; } getUri(config) { config = mergeConfig(this.defaults, config); const fullPath = buildFullPath(config.baseURL, config.url); return buildURL(fullPath, config.params, config.paramsSerializer); } } // Provide aliases for supported request methods utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, config) { return this.request(mergeConfig(config || {}, { method, url, data: (config || {}).data })); }; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { /*eslint func-names:0*/ function generateHTTPMethod(isForm) { return function httpMethod(url, data, config) { return this.request(mergeConfig(config || {}, { method, headers: isForm ? { 'Content-Type': 'multipart/form-data' } : {}, url, data })); }; } Axios.prototype[method] = generateHTTPMethod(); Axios.prototype[method + 'Form'] = generateHTTPMethod(true); }); /* harmony default export */ const core_Axios = (Axios); ;// ./node_modules/axios/lib/cancel/CancelToken.js /** * A `CancelToken` is an object that can be used to request cancellation of an operation. * * @param {Function} executor The executor function. * * @returns {CancelToken} */ class CancelToken { constructor(executor) { if (typeof executor !== 'function') { throw new TypeError('executor must be a function.'); } let resolvePromise; this.promise = new Promise(function promiseExecutor(resolve) { resolvePromise = resolve; }); const token = this; // eslint-disable-next-line func-names this.promise.then(cancel => { if (!token._listeners) return; let i = token._listeners.length; while (i-- > 0) { token._listeners[i](cancel); } token._listeners = null; }); // eslint-disable-next-line func-names this.promise.then = onfulfilled => { let _resolve; // eslint-disable-next-line func-names const promise = new Promise(resolve => { token.subscribe(resolve); _resolve = resolve; }).then(onfulfilled); promise.cancel = function reject() { token.unsubscribe(_resolve); }; return promise; }; executor(function cancel(message, config, request) { if (token.reason) { // Cancellation has already been requested return; } token.reason = new cancel_CanceledError(message, config, request); resolvePromise(token.reason); }); } /** * Throws a `CanceledError` if cancellation has been requested. */ throwIfRequested() { if (this.reason) { throw this.reason; } } /** * Subscribe to the cancel signal */ subscribe(listener) { if (this.reason) { listener(this.reason); return; } if (this._listeners) { this._listeners.push(listener); } else { this._listeners = [listener]; } } /** * Unsubscribe from the cancel signal */ unsubscribe(listener) { if (!this._listeners) { return; } const index = this._listeners.indexOf(listener); if (index !== -1) { this._listeners.splice(index, 1); } } toAbortSignal() { const controller = new AbortController(); const abort = (err) => { controller.abort(err); }; this.subscribe(abort); controller.signal.unsubscribe = () => this.unsubscribe(abort); return controller.signal; } /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. */ static source() { let cancel; const token = new CancelToken(function executor(c) { cancel = c; }); return { token, cancel }; } } /* harmony default export */ const cancel_CancelToken = (CancelToken); ;// ./node_modules/axios/lib/helpers/spread.js /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * * @returns {Function} */ function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; } ;// ./node_modules/axios/lib/helpers/isAxiosError.js /** * Determines whether the payload is an error thrown by Axios * * @param {*} payload The value to test * * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false */ function isAxiosError(payload) { return utils.isObject(payload) && (payload.isAxiosError === true); } ;// ./node_modules/axios/lib/helpers/HttpStatusCode.js const HttpStatusCode = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, }; Object.entries(HttpStatusCode).forEach(([key, value]) => { HttpStatusCode[value] = key; }); /* harmony default export */ const helpers_HttpStatusCode = (HttpStatusCode); ;// ./node_modules/axios/lib/axios.js /** * Create an instance of Axios * * @param {Object} defaultConfig The default config for the instance * * @returns {Axios} A new instance of Axios */ function createInstance(defaultConfig) { const context = new core_Axios(defaultConfig); const instance = bind(core_Axios.prototype.request, context); // Copy axios.prototype to instance utils.extend(instance, core_Axios.prototype, context, {allOwnKeys: true}); // Copy context to instance utils.extend(instance, context, null, {allOwnKeys: true}); // Factory for creating new instances instance.create = function create(instanceConfig) { return createInstance(mergeConfig(defaultConfig, instanceConfig)); }; return instance; } // Create the default instance to be exported const axios = createInstance(lib_defaults); // Expose Axios class to allow class inheritance axios.Axios = core_Axios; // Expose Cancel & CancelToken axios.CanceledError = cancel_CanceledError; axios.CancelToken = cancel_CancelToken; axios.isCancel = isCancel; axios.VERSION = VERSION; axios.toFormData = helpers_toFormData; // Expose AxiosError class axios.AxiosError = core_AxiosError; // alias for CanceledError for backward compatibility axios.Cancel = axios.CanceledError; // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = spread; // Expose isAxiosError axios.isAxiosError = isAxiosError; // Expose mergeConfig axios.mergeConfig = mergeConfig; axios.AxiosHeaders = core_AxiosHeaders; axios.formToJSON = thing => helpers_formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); axios.getAdapter = adapters.getAdapter; axios.HttpStatusCode = helpers_HttpStatusCode; axios.default = axios; // this module should only have a default export /* harmony default export */ const lib_axios = (axios); ;// ./src/helpers/api/api.js const api = lib_axios.create({ baseURL: '/api/v1' }); const configureApi = url => { api.defaults.baseURL = url ? `${url}/api/v1` : '/api/v1'; }; /* harmony default export */ const api_api = (api); ;// ./src/investor/api/hooks/useStatus.jsx const useStatus = _ref => { let { url = '/investor/status' } = _ref; const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: 200, data: {} }); const getStatus = function () { let onSuccess = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; if (state.loading) { return; } updateState(prevState => ({ ...prevState, loading: true })); api_api.get(url).then(res => { updateState({ loading: false, statusCode: res.status, data: res.data.data }); if (onSuccess) { onSuccess(res); } }).catch(err => { updateState({ loading: false, statusCode: err.response?.status || 500, data: {} }); }); }; return { loading: state.loading, failed: state.statusCode !== 200, data: state.data, getStatus }; }; /* harmony default export */ const hooks_useStatus = (useStatus); ;// ./src/investor/helpers/statusPolling.jsx const StatusPolling = _ref => { let { initialCall = false, callback } = _ref; const { data, failed, getStatus } = hooks_useStatus({}); const [makeInitialCall, setMakeInitialCall] = (0,external_React_.useState)(initialCall); if (makeInitialCall) { getStatus(); setMakeInitialCall(false); } (0,external_React_.useEffect)(() => { callback(data); if (failed) return; const intervalId = setInterval(getStatus, 30000); // 30 seconds return () => clearInterval(intervalId); }, [data, failed]); return null; }; /* harmony default export */ const statusPolling = (StatusPolling); ;// ./src/investor/helpers/regStepRedirectHelper.js const redirectTo = statusData => { if (!statusData?.steps?.current) { return null; } const identificationResultUrl = '/portal/identification?status=success'; const idenfyWaiting = [statuses.identification.approved, statuses.identification.waiting].includes(statusData?.statuses?.identification); const isApplication = statuses.customer.application === statusData?.status; if (statuses.customer.identified === statusData?.status && window.location.href.includes(identificationResultUrl)) { return null; } if (isApplication && idenfyWaiting && window.location.href.includes(identificationResultUrl)) { return null; } const registrationUrl = '/portal/registration'; if (isApplication && !idenfyWaiting && window.location.href.includes(registrationUrl)) { return regSteps.stepFive; } if (statusData?.steps?.current === externalInputSteps.thirdStep) { const dashboardUrl = '/users/dashboard'; if (statuses.identification.approved === statusData?.statuses?.identification && !window.location.href.includes(dashboardUrl)) { window.location.href = dashboardUrl; } if ([statuses.identification.needed, statuses.identification.inProcess, statuses.identification.denied, statuses.identification.expired].includes(statusData?.statuses?.identification)) { return regSteps.stepFive; } if (statuses.identification.waiting === statusData?.statuses?.identification && !window.location.href.includes(identificationResultUrl)) { window.location.href = identificationResultUrl; } } else { return parseExternalSteps[statusData.steps.current]; } return null; }; ;// ./src/investor/contexts/PortalContext.jsx const DefaultValue = { lang: 'en', step: regSteps.stepOne, data: {} }; const PortalContext = /*#__PURE__*/(0,external_React_.createContext)(DefaultValue); const usePortalContext = () => { const context = (0,external_React_.useContext)(PortalContext); if (!context) { throw Error('usePortalContext must be used inside the PortalContextProvider'); } return context; }; const PortalContextProvider = _ref => { let { children, ...props } = _ref; const [initialStatusCalled, setInitialStatusCalled] = (0,external_React_.useState)(false); const [loading, setLoading] = (0,external_React_.useState)(true); const { data: statusData, failed, getStatus } = hooks_useStatus({}); if (!initialStatusCalled) { setInitialStatusCalled(true); getStatus(); } DefaultValue.lang = props.lang ?? DefaultValue.lang; DefaultValue.loggedIn = props.loggedIn ?? false; const [state, updateState] = (0,external_React_.useState)(DefaultValue); const setLang = lang => { updateState(prevState => ({ ...prevState, lang: lang })); }; const setStep = step => { updateState(prevState => ({ ...prevState, step: step })); }; const setData = data => { updateState(prevState => ({ ...prevState, data: data })); }; i18n.changeLanguage(DefaultValue.lang); const t = function () { return i18n.t(...arguments); }; configureApi(props.url); const context = { lang: state.lang, setLang, step: state.step, setStep, data: state.data, setData, loggedIn: state.loggedIn, t }; (0,external_React_.useEffect)(() => { const redirectStep = redirectTo(statusData); if (redirectStep) { setStep(redirectStep); } else if (statusData?.steps?.current) { setStep(null); } if (!failed && statusData?.regData && state.loggedIn) { state.data.profileStep = statusData?.regData; state.data.personalStep = statusData?.regData; state.data.financialStep = statusData?.regData; const dob = external_dayjs_default()(state.data.personalStep.representative.dateOfBirth); state.data.personalStep.birth_year = dob.year(); state.data.personalStep.birth_month = dob.month() + 1; state.data.personalStep.birth_day = dob.date(); } if (!failed && statusData?.email && state.loggedIn) { state.data.profileStep = state.data.profileStep ?? {}; state.data.profileStep.email = statusData?.email; const pass = '$A' + Math.random().toString(36).slice(3); state.data.profileStep.password = pass; state.data.profileStep.passwordConfirmation = pass; } if (failed) { updateState(prevState => ({ ...prevState, loggedIn: false })); } if (failed || statusData?.steps) { setLoading(false); } }, [statusData, failed]); const loadingAnimation = () => { return /*#__PURE__*/external_React_default().createElement("div", { style: { textAlign: 'center', padding: '20px' } }, /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, { size: "large" })); }; const callbackForStatus = data => { const redirectStep = redirectTo(data); if (redirectStep && context.step !== redirectStep) { context.setStep(redirectStep); } }; return /*#__PURE__*/external_React_default().createElement(PortalContext.Provider, { value: context }, loading && loadingAnimation(), !loading && children, /*#__PURE__*/external_React_default().createElement(statusPolling, { callback: callbackForStatus })); }; ;// ./src/investor/components/RegistrationForm/Steps/StepWizard.jsx const lookup = [{ name: regSteps.stepOne, value: 0 }, { name: regSteps.stepTwo, value: 1 }, { name: regSteps.stepThree, value: 2 }, { name: regSteps.stepFour, value: 3 }, { name: regSteps.stepFive, value: 4 }]; const StepWizard = () => { const { step, t } = usePortalContext(); return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(external_antd_.Steps, { labelPlacement: "vertical", current: lookup.find(_ref => { let { name } = _ref; return name === step; })?.value || 0, items: [{ title: t(`step.${regSteps.stepOne}`) }, { title: t(`step.${regSteps.stepTwo}`) }, { title: t(`step.${regSteps.stepThree}`) }, { title: t(`step.${regSteps.stepFour}`) }, { title: t(`step.${regSteps.stepFive}`) }] })); }; /* harmony default export */ const Steps_StepWizard = (StepWizard); ;// ./src/investor/components/Layouts/RegistrationLayout.jsx const RegistrationLayout = _ref => { let { children, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(external_antd_.Layout, { style: { background: 'white', placeContent: 'center' } }, /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { vertical: true, justify: "center" }, children && /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Row, { justify: "center" }, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { xs: 24, md: 24, lg: 18, xl: 12 }, /*#__PURE__*/external_React_default().createElement(Steps_StepWizard, null))), /*#__PURE__*/external_React_default().createElement(external_antd_.Divider, null)), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, { justify: "center", style: { padding: '20px' } }, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { xs: 24, md: 24, lg: 18, xl: 12 }, children || /*#__PURE__*/external_React_default().createElement("p", null, t('step.texts.complete')))))); }; /* harmony default export */ const Layouts_RegistrationLayout = (RegistrationLayout); ;// ./src/hooks/Dictionary/useDictionaryApi.js const useDictionaryApi = _ref => { let { dictionary, ...props } = _ref; const [state, setState] = (0,external_React_.useState)({ loading: false, items: [] }); (0,external_React_.useEffect)(() => { setState({ loading: true, items: [] }); const source = lib_axios.CancelToken.source(); api_api.get(`/dictionaries/${dictionary}`, { params: props?.params, cancelToken: source.token }).then(res => { setState({ loading: false, items: res.data.data }); }).catch(err => { setState({ loading: true, items: [] }); }); return () => { source.cancel("Canceled"); }; }, [dictionary]); return { state }; }; /* harmony default export */ const Dictionary_useDictionaryApi = (useDictionaryApi); ;// ./node_modules/@babel/runtime/helpers/esm/extends.js function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } ;// ./node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js // This icon file is generated automatically. var LoadingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" }; /* harmony default export */ const asn_LoadingOutlined = (LoadingOutlined); ;// ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } ;// ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } ;// ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } ;// ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } ;// ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js function _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."); } ;// ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } ;// ./node_modules/@babel/runtime/helpers/esm/typeof.js function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } ;// ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js function toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } ;// ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } ;// ./node_modules/@babel/runtime/helpers/esm/defineProperty.js function _defineProperty(e, r, t) { return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } ;// ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; } ;// ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__(942); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); ;// ./node_modules/@ctrl/tinycolor/dist/module/util.js /** * Take input from [0, n] and return it as [0, 1] * @hidden */ function util_bound01(n, max) { if (isOnePointZero(n)) { n = '100%'; } var isPercent = isPercentage(n); n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n))); // Automatically convert percentage into number if (isPercent) { n = parseInt(String(n * max), 10) / 100; } // Handle floating point rounding errors if (Math.abs(n - max) < 0.000001) { return 1; } // Convert into [0, 1] range if it isn't already if (max === 360) { // If n is a hue given in degrees, // wrap around out-of-range values into [0, 360] range // then convert into [0, 1]. n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max)); } else { // If n not a hue given in degrees // Convert into [0, 1] range if it isn't already. n = (n % max) / parseFloat(String(max)); } return n; } /** * Force a number between 0 and 1 * @hidden */ function clamp01(val) { return Math.min(1, Math.max(0, val)); } /** * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 * * @hidden */ function isOnePointZero(n) { return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1; } /** * Check to see if string passed in is a percentage * @hidden */ function isPercentage(n) { return typeof n === 'string' && n.indexOf('%') !== -1; } /** * Return a valid alpha value [0,1] with all invalid values being set to 1 * @hidden */ function boundAlpha(a) { a = parseFloat(a); if (isNaN(a) || a < 0 || a > 1) { a = 1; } return a; } /** * Replace a decimal with it's percentage value * @hidden */ function convertToPercentage(n) { if (n <= 1) { return "".concat(Number(n) * 100, "%"); } return n; } /** * Force a hex value to have 2 characters * @hidden */ function util_pad2(c) { return c.length === 1 ? '0' + c : String(c); } ;// ./node_modules/@ctrl/tinycolor/dist/module/conversion.js // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: // /** * Handle bounds / percentage checking to conform to CSS color spec * * *Assumes:* r, g, b in [0, 255] or [0, 1] * *Returns:* { r, g, b } in [0, 255] */ function rgbToRgb(r, g, b) { return { r: util_bound01(r, 255) * 255, g: util_bound01(g, 255) * 255, b: util_bound01(b, 255) * 255, }; } /** * Converts an RGB color value to HSL. * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] * *Returns:* { h, s, l } in [0,1] */ function rgbToHsl(r, g, b) { r = bound01(r, 255); g = bound01(g, 255); b = bound01(b, 255); var max = Math.max(r, g, b); var min = Math.min(r, g, b); var h = 0; var s = 0; var l = (max + min) / 2; if (max === min) { s = 0; h = 0; // achromatic } else { var d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; default: break; } h /= 6; } return { h: h, s: s, l: l }; } function hue2rgb(p, q, t) { if (t < 0) { t += 1; } if (t > 1) { t -= 1; } if (t < 1 / 6) { return p + (q - p) * (6 * t); } if (t < 1 / 2) { return q; } if (t < 2 / 3) { return p + (q - p) * (2 / 3 - t) * 6; } return p; } /** * Converts an HSL color value to RGB. * * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] * *Returns:* { r, g, b } in the set [0, 255] */ function hslToRgb(h, s, l) { var r; var g; var b; h = util_bound01(h, 360); s = util_bound01(s, 100); l = util_bound01(l, 100); if (s === 0) { // achromatic g = l; b = l; r = l; } else { var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; r = hue2rgb(p, q, h + 1 / 3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1 / 3); } return { r: r * 255, g: g * 255, b: b * 255 }; } /** * Converts an RGB color value to HSV * * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] * *Returns:* { h, s, v } in [0,1] */ function rgbToHsv(r, g, b) { r = util_bound01(r, 255); g = util_bound01(g, 255); b = util_bound01(b, 255); var max = Math.max(r, g, b); var min = Math.min(r, g, b); var h = 0; var v = max; var d = max - min; var s = max === 0 ? 0 : d / max; if (max === min) { h = 0; // achromatic } else { switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; default: break; } h /= 6; } return { h: h, s: s, v: v }; } /** * Converts an HSV color value to RGB. * * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] * *Returns:* { r, g, b } in the set [0, 255] */ function hsvToRgb(h, s, v) { h = util_bound01(h, 360) * 6; s = util_bound01(s, 100); v = util_bound01(v, 100); var i = Math.floor(h); var f = h - i; var p = v * (1 - s); var q = v * (1 - f * s); var t = v * (1 - (1 - f) * s); var mod = i % 6; var r = [v, q, p, p, t, v][mod]; var g = [t, v, v, q, p, p][mod]; var b = [p, p, t, v, v, q][mod]; return { r: r * 255, g: g * 255, b: b * 255 }; } /** * Converts an RGB color to hex * * Assumes r, g, and b are contained in the set [0, 255] * Returns a 3 or 6 character hex */ function rgbToHex(r, g, b, allow3Char) { var hex = [ util_pad2(Math.round(r).toString(16)), util_pad2(Math.round(g).toString(16)), util_pad2(Math.round(b).toString(16)), ]; // Return a 3 character hex if possible if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) { return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); } return hex.join(''); } /** * Converts an RGBA color plus alpha transparency to hex * * Assumes r, g, b are contained in the set [0, 255] and * a in [0, 1]. Returns a 4 or 8 character rgba hex */ // eslint-disable-next-line max-params function rgbaToHex(r, g, b, a, allow4Char) { var hex = [ pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a)), ]; // Return a 4 character hex if possible if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) { return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); } return hex.join(''); } /** * Converts an RGBA color to an ARGB Hex8 string * Rarely used, but required for "toFilter()" */ function rgbaToArgbHex(r, g, b, a) { var hex = [ pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), ]; return hex.join(''); } /** Converts a decimal to a hex value */ function convertDecimalToHex(d) { return Math.round(parseFloat(d) * 255).toString(16); } /** Converts a hex value to a decimal */ function convertHexToDecimal(h) { return parseIntFromHex(h) / 255; } /** Parse a base-16 hex value into a base-10 integer */ function parseIntFromHex(val) { return parseInt(val, 16); } function numberInputToObject(color) { return { r: color >> 16, g: (color & 0xff00) >> 8, b: color & 0xff, }; } ;// ./node_modules/@ctrl/tinycolor/dist/module/css-color-names.js // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json /** * @hidden */ var names = { aliceblue: '#f0f8ff', antiquewhite: '#faebd7', aqua: '#00ffff', aquamarine: '#7fffd4', azure: '#f0ffff', beige: '#f5f5dc', bisque: '#ffe4c4', black: '#000000', blanchedalmond: '#ffebcd', blue: '#0000ff', blueviolet: '#8a2be2', brown: '#a52a2a', burlywood: '#deb887', cadetblue: '#5f9ea0', chartreuse: '#7fff00', chocolate: '#d2691e', coral: '#ff7f50', cornflowerblue: '#6495ed', cornsilk: '#fff8dc', crimson: '#dc143c', cyan: '#00ffff', darkblue: '#00008b', darkcyan: '#008b8b', darkgoldenrod: '#b8860b', darkgray: '#a9a9a9', darkgreen: '#006400', darkgrey: '#a9a9a9', darkkhaki: '#bdb76b', darkmagenta: '#8b008b', darkolivegreen: '#556b2f', darkorange: '#ff8c00', darkorchid: '#9932cc', darkred: '#8b0000', darksalmon: '#e9967a', darkseagreen: '#8fbc8f', darkslateblue: '#483d8b', darkslategray: '#2f4f4f', darkslategrey: '#2f4f4f', darkturquoise: '#00ced1', darkviolet: '#9400d3', deeppink: '#ff1493', deepskyblue: '#00bfff', dimgray: '#696969', dimgrey: '#696969', dodgerblue: '#1e90ff', firebrick: '#b22222', floralwhite: '#fffaf0', forestgreen: '#228b22', fuchsia: '#ff00ff', gainsboro: '#dcdcdc', ghostwhite: '#f8f8ff', goldenrod: '#daa520', gold: '#ffd700', gray: '#808080', green: '#008000', greenyellow: '#adff2f', grey: '#808080', honeydew: '#f0fff0', hotpink: '#ff69b4', indianred: '#cd5c5c', indigo: '#4b0082', ivory: '#fffff0', khaki: '#f0e68c', lavenderblush: '#fff0f5', lavender: '#e6e6fa', lawngreen: '#7cfc00', lemonchiffon: '#fffacd', lightblue: '#add8e6', lightcoral: '#f08080', lightcyan: '#e0ffff', lightgoldenrodyellow: '#fafad2', lightgray: '#d3d3d3', lightgreen: '#90ee90', lightgrey: '#d3d3d3', lightpink: '#ffb6c1', lightsalmon: '#ffa07a', lightseagreen: '#20b2aa', lightskyblue: '#87cefa', lightslategray: '#778899', lightslategrey: '#778899', lightsteelblue: '#b0c4de', lightyellow: '#ffffe0', lime: '#00ff00', limegreen: '#32cd32', linen: '#faf0e6', magenta: '#ff00ff', maroon: '#800000', mediumaquamarine: '#66cdaa', mediumblue: '#0000cd', mediumorchid: '#ba55d3', mediumpurple: '#9370db', mediumseagreen: '#3cb371', mediumslateblue: '#7b68ee', mediumspringgreen: '#00fa9a', mediumturquoise: '#48d1cc', mediumvioletred: '#c71585', midnightblue: '#191970', mintcream: '#f5fffa', mistyrose: '#ffe4e1', moccasin: '#ffe4b5', navajowhite: '#ffdead', navy: '#000080', oldlace: '#fdf5e6', olive: '#808000', olivedrab: '#6b8e23', orange: '#ffa500', orangered: '#ff4500', orchid: '#da70d6', palegoldenrod: '#eee8aa', palegreen: '#98fb98', paleturquoise: '#afeeee', palevioletred: '#db7093', papayawhip: '#ffefd5', peachpuff: '#ffdab9', peru: '#cd853f', pink: '#ffc0cb', plum: '#dda0dd', powderblue: '#b0e0e6', purple: '#800080', rebeccapurple: '#663399', red: '#ff0000', rosybrown: '#bc8f8f', royalblue: '#4169e1', saddlebrown: '#8b4513', salmon: '#fa8072', sandybrown: '#f4a460', seagreen: '#2e8b57', seashell: '#fff5ee', sienna: '#a0522d', silver: '#c0c0c0', skyblue: '#87ceeb', slateblue: '#6a5acd', slategray: '#708090', slategrey: '#708090', snow: '#fffafa', springgreen: '#00ff7f', steelblue: '#4682b4', tan: '#d2b48c', teal: '#008080', thistle: '#d8bfd8', tomato: '#ff6347', turquoise: '#40e0d0', violet: '#ee82ee', wheat: '#f5deb3', white: '#ffffff', whitesmoke: '#f5f5f5', yellow: '#ffff00', yellowgreen: '#9acd32', }; ;// ./node_modules/@ctrl/tinycolor/dist/module/format-input.js /* eslint-disable @typescript-eslint/no-redundant-type-constituents */ /** * Given a string or object, convert that input to RGB * * Possible string inputs: * ``` * "red" * "#f00" or "f00" * "#ff0000" or "ff0000" * "#ff000000" or "ff000000" * "rgb 255 0 0" or "rgb (255, 0, 0)" * "rgb 1.0 0 0" or "rgb (1, 0, 0)" * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" * ``` */ function inputToRGB(color) { var rgb = { r: 0, g: 0, b: 0 }; var a = 1; var s = null; var v = null; var l = null; var ok = false; var format = false; if (typeof color === 'string') { color = stringInputToObject(color); } if (typeof color === 'object') { if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { rgb = rgbToRgb(color.r, color.g, color.b); ok = true; format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb'; } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { s = convertToPercentage(color.s); v = convertToPercentage(color.v); rgb = hsvToRgb(color.h, s, v); ok = true; format = 'hsv'; } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { s = convertToPercentage(color.s); l = convertToPercentage(color.l); rgb = hslToRgb(color.h, s, l); ok = true; format = 'hsl'; } if (Object.prototype.hasOwnProperty.call(color, 'a')) { a = color.a; } } a = boundAlpha(a); return { ok: ok, format: color.format || format, r: Math.min(255, Math.max(rgb.r, 0)), g: Math.min(255, Math.max(rgb.g, 0)), b: Math.min(255, Math.max(rgb.b, 0)), a: a, }; } // var CSS_INTEGER = '[-\\+]?\\d+%?'; // var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?'; // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")"); // Actual matching. // Parentheses and commas are optional, but not required. // Whitespace can take the place of commas or opening paren var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?"); var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?"); var matchers = { CSS_UNIT: new RegExp(CSS_UNIT), rgb: new RegExp('rgb' + PERMISSIVE_MATCH3), rgba: new RegExp('rgba' + PERMISSIVE_MATCH4), hsl: new RegExp('hsl' + PERMISSIVE_MATCH3), hsla: new RegExp('hsla' + PERMISSIVE_MATCH4), hsv: new RegExp('hsv' + PERMISSIVE_MATCH3), hsva: new RegExp('hsva' + PERMISSIVE_MATCH4), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, }; /** * Permissive string parsing. Take in a number of formats, and output an object * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` */ function stringInputToObject(color) { color = color.trim().toLowerCase(); if (color.length === 0) { return false; } var named = false; if (names[color]) { color = names[color]; named = true; } else if (color === 'transparent') { return { r: 0, g: 0, b: 0, a: 0, format: 'name' }; } // Try to match string input using regular expressions. // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] // Just return an object and let the conversion functions handle that. // This way the result will be the same whether the tinycolor is initialized with string or object. var match = matchers.rgb.exec(color); if (match) { return { r: match[1], g: match[2], b: match[3] }; } match = matchers.rgba.exec(color); if (match) { return { r: match[1], g: match[2], b: match[3], a: match[4] }; } match = matchers.hsl.exec(color); if (match) { return { h: match[1], s: match[2], l: match[3] }; } match = matchers.hsla.exec(color); if (match) { return { h: match[1], s: match[2], l: match[3], a: match[4] }; } match = matchers.hsv.exec(color); if (match) { return { h: match[1], s: match[2], v: match[3] }; } match = matchers.hsva.exec(color); if (match) { return { h: match[1], s: match[2], v: match[3], a: match[4] }; } match = matchers.hex8.exec(color); if (match) { return { r: parseIntFromHex(match[1]), g: parseIntFromHex(match[2]), b: parseIntFromHex(match[3]), a: convertHexToDecimal(match[4]), format: named ? 'name' : 'hex8', }; } match = matchers.hex6.exec(color); if (match) { return { r: parseIntFromHex(match[1]), g: parseIntFromHex(match[2]), b: parseIntFromHex(match[3]), format: named ? 'name' : 'hex', }; } match = matchers.hex4.exec(color); if (match) { return { r: parseIntFromHex(match[1] + match[1]), g: parseIntFromHex(match[2] + match[2]), b: parseIntFromHex(match[3] + match[3]), a: convertHexToDecimal(match[4] + match[4]), format: named ? 'name' : 'hex8', }; } match = matchers.hex3.exec(color); if (match) { return { r: parseIntFromHex(match[1] + match[1]), g: parseIntFromHex(match[2] + match[2]), b: parseIntFromHex(match[3] + match[3]), format: named ? 'name' : 'hex', }; } return false; } /** * Check to see if it looks like a CSS unit * (see `matchers` above for definition). */ function isValidCSSUnit(color) { return Boolean(matchers.CSS_UNIT.exec(String(color))); } ;// ./node_modules/@ant-design/colors/es/generate.js var hueStep = 2; // 色相阶梯 var saturationStep = 0.16; // 饱和度阶梯,浅色部分 var saturationStep2 = 0.05; // 饱和度阶梯,深色部分 var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分 var brightnessStep2 = 0.15; // 亮度阶梯,深色部分 var lightColorCount = 5; // 浅色数量,主色上 var darkColorCount = 4; // 深色数量,主色下 // 暗色主题颜色映射关系表 var darkColorMap = [{ index: 7, opacity: 0.15 }, { index: 6, opacity: 0.25 }, { index: 5, opacity: 0.3 }, { index: 5, opacity: 0.45 }, { index: 5, opacity: 0.65 }, { index: 5, opacity: 0.85 }, { index: 4, opacity: 0.9 }, { index: 3, opacity: 0.95 }, { index: 2, opacity: 0.97 }, { index: 1, opacity: 0.98 }]; // Wrapper function ported from TinyColor.prototype.toHsv // Keep it here because of `hsv.h * 360` function toHsv(_ref) { var r = _ref.r, g = _ref.g, b = _ref.b; var hsv = rgbToHsv(r, g, b); return { h: hsv.h * 360, s: hsv.s, v: hsv.v }; } // Wrapper function ported from TinyColor.prototype.toHexString // Keep it here because of the prefix `#` function toHex(_ref2) { var r = _ref2.r, g = _ref2.g, b = _ref2.b; return "#".concat(rgbToHex(r, g, b, false)); } // Wrapper function ported from TinyColor.prototype.mix, not treeshakable. // Amount in range [0, 1] // Assume color1 & color2 has no alpha, since the following src code did so. function mix(rgb1, rgb2, amount) { var p = amount / 100; var rgb = { r: (rgb2.r - rgb1.r) * p + rgb1.r, g: (rgb2.g - rgb1.g) * p + rgb1.g, b: (rgb2.b - rgb1.b) * p + rgb1.b }; return rgb; } function getHue(hsv, i, light) { var hue; // 根据色相不同,色相转向不同 if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) { hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i; } else { hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i; } if (hue < 0) { hue += 360; } else if (hue >= 360) { hue -= 360; } return hue; } function getSaturation(hsv, i, light) { // grey color don't change saturation if (hsv.h === 0 && hsv.s === 0) { return hsv.s; } var saturation; if (light) { saturation = hsv.s - saturationStep * i; } else if (i === darkColorCount) { saturation = hsv.s + saturationStep; } else { saturation = hsv.s + saturationStep2 * i; } // 边界值修正 if (saturation > 1) { saturation = 1; } // 第一格的 s 限制在 0.06-0.1 之间 if (light && i === lightColorCount && saturation > 0.1) { saturation = 0.1; } if (saturation < 0.06) { saturation = 0.06; } return Number(saturation.toFixed(2)); } function getValue(hsv, i, light) { var value; if (light) { value = hsv.v + brightnessStep1 * i; } else { value = hsv.v - brightnessStep2 * i; } if (value > 1) { value = 1; } return Number(value.toFixed(2)); } function generate(color) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var patterns = []; var pColor = inputToRGB(color); for (var i = lightColorCount; i > 0; i -= 1) { var hsv = toHsv(pColor); var colorString = toHex(inputToRGB({ h: getHue(hsv, i, true), s: getSaturation(hsv, i, true), v: getValue(hsv, i, true) })); patterns.push(colorString); } patterns.push(toHex(pColor)); for (var _i = 1; _i <= darkColorCount; _i += 1) { var _hsv = toHsv(pColor); var _colorString = toHex(inputToRGB({ h: getHue(_hsv, _i), s: getSaturation(_hsv, _i), v: getValue(_hsv, _i) })); patterns.push(_colorString); } // dark theme patterns if (opts.theme === 'dark') { return darkColorMap.map(function (_ref3) { var index = _ref3.index, opacity = _ref3.opacity; var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100)); return darkColorString; }); } return patterns; } ;// ./node_modules/@ant-design/colors/es/presets.js // Generated by script. Do NOT modify! var presetPrimaryColors = { "red": "#F5222D", "volcano": "#FA541C", "orange": "#FA8C16", "gold": "#FAAD14", "yellow": "#FADB14", "lime": "#A0D911", "green": "#52C41A", "cyan": "#13C2C2", "blue": "#1677FF", "geekblue": "#2F54EB", "purple": "#722ED1", "magenta": "#EB2F96", "grey": "#666666" }; var red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"]; red.primary = red[5]; var volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"]; volcano.primary = volcano[5]; var orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"]; orange.primary = orange[5]; var gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"]; gold.primary = gold[5]; var yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"]; yellow.primary = yellow[5]; var lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"]; lime.primary = lime[5]; var green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"]; green.primary = green[5]; var cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"]; cyan.primary = cyan[5]; var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"]; blue.primary = blue[5]; var geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"]; geekblue.primary = geekblue[5]; var purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"]; purple.primary = purple[5]; var magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"]; magenta.primary = magenta[5]; var grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"]; grey.primary = grey[5]; var gray = (/* unused pure expression or super */ null && (grey)); var presetPalettes = { red: red, volcano: volcano, orange: orange, gold: gold, yellow: yellow, lime: lime, green: green, cyan: cyan, blue: blue, geekblue: geekblue, purple: purple, magenta: magenta, grey: grey }; var redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"]; redDark.primary = redDark[5]; var volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"]; volcanoDark.primary = volcanoDark[5]; var orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"]; orangeDark.primary = orangeDark[5]; var goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"]; goldDark.primary = goldDark[5]; var yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"]; yellowDark.primary = yellowDark[5]; var limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"]; limeDark.primary = limeDark[5]; var greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"]; greenDark.primary = greenDark[5]; var cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"]; cyanDark.primary = cyanDark[5]; var blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"]; blueDark.primary = blueDark[5]; var geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"]; geekblueDark.primary = geekblueDark[5]; var purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"]; purpleDark.primary = purpleDark[5]; var magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"]; magentaDark.primary = magentaDark[5]; var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"]; greyDark.primary = greyDark[5]; var presetDarkPalettes = { red: redDark, volcano: volcanoDark, orange: orangeDark, gold: goldDark, yellow: yellowDark, lime: limeDark, green: greenDark, cyan: cyanDark, blue: blueDark, geekblue: geekblueDark, purple: purpleDark, magenta: magentaDark, grey: greyDark }; ;// ./node_modules/@ant-design/colors/es/index.js ;// ./node_modules/@ant-design/icons/es/components/Context.js var IconContext = /*#__PURE__*/(0,external_React_.createContext)({}); /* harmony default export */ const Context = (IconContext); ;// ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } ;// ./node_modules/rc-util/es/Dom/canUseDom.js function canUseDom() { return !!(typeof window !== 'undefined' && window.document && window.document.createElement); } ;// ./node_modules/rc-util/es/Dom/contains.js function contains(root, n) { if (!root) { return false; } // Use native if support if (root.contains) { return root.contains(n); } // `document.contains` not support with IE11 var node = n; while (node) { if (node === root) { return true; } node = node.parentNode; } return false; } ;// ./node_modules/rc-util/es/Dom/dynamicCSS.js var APPEND_ORDER = 'data-rc-order'; var APPEND_PRIORITY = 'data-rc-priority'; var MARK_KEY = "rc-util-key"; var containerCache = new Map(); function getMark() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, mark = _ref.mark; if (mark) { return mark.startsWith('data-') ? mark : "data-".concat(mark); } return MARK_KEY; } function getContainer(option) { if (option.attachTo) { return option.attachTo; } var head = document.querySelector('head'); return head || document.body; } function getOrder(prepend) { if (prepend === 'queue') { return 'prependQueue'; } return prepend ? 'prepend' : 'append'; } /** * Find style which inject by rc-util */ function findStyles(container) { return Array.from((containerCache.get(container) || container).children).filter(function (node) { return node.tagName === 'STYLE'; }); } function injectCSS(css) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (!canUseDom()) { return null; } var csp = option.csp, prepend = option.prepend, _option$priority = option.priority, priority = _option$priority === void 0 ? 0 : _option$priority; var mergedOrder = getOrder(prepend); var isPrependQueue = mergedOrder === 'prependQueue'; var styleNode = document.createElement('style'); styleNode.setAttribute(APPEND_ORDER, mergedOrder); if (isPrependQueue && priority) { styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority)); } if (csp !== null && csp !== void 0 && csp.nonce) { styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce; } styleNode.innerHTML = css; var container = getContainer(option); var firstChild = container.firstChild; if (prepend) { // If is queue `prepend`, it will prepend first style and then append rest style if (isPrependQueue) { var existStyle = (option.styles || findStyles(container)).filter(function (node) { // Ignore style which not injected by rc-util with prepend if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) { return false; } // Ignore style which priority less then new style var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0); return priority >= nodePriority; }); if (existStyle.length) { container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling); return styleNode; } } // Use `insertBefore` as `prepend` container.insertBefore(styleNode, firstChild); } else { container.appendChild(styleNode); } return styleNode; } function findExistNode(key) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var container = getContainer(option); return (option.styles || findStyles(container)).find(function (node) { return node.getAttribute(getMark(option)) === key; }); } function removeCSS(key) { var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var existNode = findExistNode(key, option); if (existNode) { var container = getContainer(option); container.removeChild(existNode); } } /** * qiankun will inject `appendChild` to insert into other */ function syncRealContainer(container, option) { var cachedRealContainer = containerCache.get(container); // Find real container when not cached or cached container removed if (!cachedRealContainer || !contains(document, cachedRealContainer)) { var placeholderStyle = injectCSS('', option); var parentNode = placeholderStyle.parentNode; containerCache.set(container, parentNode); container.removeChild(placeholderStyle); } } /** * manually clear container cache to avoid global cache in unit testes */ function clearContainerCache() { containerCache.clear(); } function updateCSS(css, key) { var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var container = getContainer(originOption); var styles = findStyles(container); var option = _objectSpread2(_objectSpread2({}, originOption), {}, { styles: styles }); // Sync real parent syncRealContainer(container, option); var existNode = findExistNode(key, option); if (existNode) { var _option$csp, _option$csp2; if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) { var _option$csp3; existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce; } if (existNode.innerHTML !== css) { existNode.innerHTML = css; } return existNode; } var newNode = injectCSS(css, option); newNode.setAttribute(getMark(option), key); return newNode; } ;// ./node_modules/rc-util/es/Dom/shadow.js function getRoot(ele) { var _ele$getRootNode; return ele === null || ele === void 0 || (_ele$getRootNode = ele.getRootNode) === null || _ele$getRootNode === void 0 ? void 0 : _ele$getRootNode.call(ele); } /** * Check if is in shadowRoot */ function inShadow(ele) { return getRoot(ele) instanceof ShadowRoot; } /** * Return shadowRoot if possible */ function getShadowRoot(ele) { return inShadow(ele) ? getRoot(ele) : null; } ;// ./node_modules/rc-util/es/warning.js /* eslint-disable no-console */ var warned = {}; var preWarningFns = []; /** * Pre warning enable you to parse content before console.error. * Modify to null will prevent warning. */ var preMessage = function preMessage(fn) { preWarningFns.push(fn); }; /** * Warning if condition not match. * @param valid Condition * @param message Warning message * @example * ```js * warning(false, 'some error'); // print some error * warning(true, 'some error'); // print nothing * warning(1 === 2, 'some error'); // print some error * ``` */ function warning(valid, message) { if (false) { var finalMessage; } } /** @see Similar to {@link warning} */ function note(valid, message) { if (false) { var finalMessage; } } function resetWarned() { warned = {}; } function call(method, valid, message) { if (!valid && !warned[message]) { method(false, message); warned[message] = true; } } /** @see Same as {@link warning}, but only warn once for the same message */ function warningOnce(valid, message) { call(warning, valid, message); } /** @see Same as {@link warning}, but only warn once for the same message */ function noteOnce(valid, message) { call(note, valid, message); } warningOnce.preMessage = preMessage; warningOnce.resetWarned = resetWarned; warningOnce.noteOnce = noteOnce; /* harmony default export */ const es_warning = (warningOnce); ;// ./node_modules/@ant-design/icons/es/utils.js function camelCase(input) { return input.replace(/-(.)/g, function (match, g) { return g.toUpperCase(); }); } function utils_warning(valid, message) { es_warning(valid, "[@ant-design/icons] ".concat(message)); } function isIconDefinition(target) { return _typeof(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (_typeof(target.icon) === 'object' || typeof target.icon === 'function'); } function normalizeAttrs() { var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return Object.keys(attrs).reduce(function (acc, key) { var val = attrs[key]; switch (key) { case 'class': acc.className = val; delete acc.class; break; default: delete acc[key]; acc[camelCase(key)] = val; } return acc; }, {}); } function utils_generate(node, key, rootProps) { if (!rootProps) { return /*#__PURE__*/external_React_default().createElement(node.tag, _objectSpread2({ key: key }, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) { return utils_generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index)); })); } return /*#__PURE__*/external_React_default().createElement(node.tag, _objectSpread2(_objectSpread2({ key: key }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) { return utils_generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index)); })); } function getSecondaryColor(primaryColor) { // choose the second color return generate(primaryColor)[0]; } function normalizeTwoToneColors(twoToneColor) { if (!twoToneColor) { return []; } return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor]; } // These props make sure that the SVG behaviours like general text. // Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4 var svgBaseProps = { width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true', focusable: 'false' }; var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n"; var useInsertStyles = function useInsertStyles(eleRef) { var _useContext = (0,external_React_.useContext)(Context), csp = _useContext.csp, prefixCls = _useContext.prefixCls; var mergedStyleStr = iconStyles; if (prefixCls) { mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls); } (0,external_React_.useEffect)(function () { var ele = eleRef.current; var shadowRoot = getShadowRoot(ele); updateCSS(mergedStyleStr, '@ant-design-icons', { prepend: true, csp: csp, attachTo: shadowRoot }); }, []); }; ;// ./node_modules/@ant-design/icons/es/components/IconBase.js var _excluded = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"]; var twoToneColorPalette = { primaryColor: '#333', secondaryColor: '#E6E6E6', calculated: false }; function setTwoToneColors(_ref) { var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor; twoToneColorPalette.primaryColor = primaryColor; twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor); twoToneColorPalette.calculated = !!secondaryColor; } function getTwoToneColors() { return _objectSpread2({}, twoToneColorPalette); } var IconBase = function IconBase(props) { var icon = props.icon, className = props.className, onClick = props.onClick, style = props.style, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, restProps = _objectWithoutProperties(props, _excluded); var svgRef = external_React_.useRef(); var colors = twoToneColorPalette; if (primaryColor) { colors = { primaryColor: primaryColor, secondaryColor: secondaryColor || getSecondaryColor(primaryColor) }; } useInsertStyles(svgRef); utils_warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon)); if (!isIconDefinition(icon)) { return null; } var target = icon; if (target && typeof target.icon === 'function') { target = _objectSpread2(_objectSpread2({}, target), {}, { icon: target.icon(colors.primaryColor, colors.secondaryColor) }); } return utils_generate(target.icon, "svg-".concat(target.name), _objectSpread2(_objectSpread2({ className: className, onClick: onClick, style: style, 'data-icon': target.name, width: '1em', height: '1em', fill: 'currentColor', 'aria-hidden': 'true' }, restProps), {}, { ref: svgRef })); }; IconBase.displayName = 'IconReact'; IconBase.getTwoToneColors = getTwoToneColors; IconBase.setTwoToneColors = setTwoToneColors; /* harmony default export */ const components_IconBase = (IconBase); ;// ./node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js function setTwoToneColor(twoToneColor) { var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; return components_IconBase.setTwoToneColors({ primaryColor: primaryColor, secondaryColor: secondaryColor }); } function getTwoToneColor() { var colors = components_IconBase.getTwoToneColors(); if (!colors.calculated) { return colors.primaryColor; } return [colors.primaryColor, colors.secondaryColor]; } ;// ./node_modules/@ant-design/icons/es/components/AntdIcon.js 'use client'; var AntdIcon_excluded = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"]; // Initial setting // should move it to antd main repo? setTwoToneColor(blue.primary); // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-488848720 var Icon = /*#__PURE__*/external_React_.forwardRef(function (props, ref) { var className = props.className, icon = props.icon, spin = props.spin, rotate = props.rotate, tabIndex = props.tabIndex, onClick = props.onClick, twoToneColor = props.twoToneColor, restProps = _objectWithoutProperties(props, AntdIcon_excluded); var _React$useContext = external_React_.useContext(Context), _React$useContext$pre = _React$useContext.prefixCls, prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre, rootClassName = _React$useContext.rootClassName; var classString = classnames_default()(rootClassName, prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), "".concat(prefixCls, "-spin"), !!spin || icon.name === 'loading'), className); var iconTabIndex = tabIndex; if (iconTabIndex === undefined && onClick) { iconTabIndex = -1; } var svgStyle = rotate ? { msTransform: "rotate(".concat(rotate, "deg)"), transform: "rotate(".concat(rotate, "deg)") } : undefined; var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; return /*#__PURE__*/external_React_.createElement("span", _extends({ role: "img", "aria-label": icon.name }, restProps, { ref: ref, tabIndex: iconTabIndex, onClick: onClick, className: classString }), /*#__PURE__*/external_React_.createElement(components_IconBase, { icon: icon, primaryColor: primaryColor, secondaryColor: secondaryColor, style: svgStyle })); }); Icon.displayName = 'AntdIcon'; Icon.getTwoToneColor = getTwoToneColor; Icon.setTwoToneColor = setTwoToneColor; /* harmony default export */ const AntdIcon = (Icon); ;// ./node_modules/@ant-design/icons/es/icons/LoadingOutlined.js // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY var LoadingOutlined_LoadingOutlined = function LoadingOutlined(props, ref) { return /*#__PURE__*/external_React_.createElement(AntdIcon, _extends({}, props, { ref: ref, icon: asn_LoadingOutlined })); }; /**![loading](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTk4OCA1NDhjLTE5LjkgMC0zNi0xNi4xLTM2LTM2IDAtNTkuNC0xMS42LTExNy0zNC42LTE3MS4zYTQ0MC40NSA0NDAuNDUgMCAwMC05NC4zLTEzOS45IDQzNy43MSA0MzcuNzEgMCAwMC0xMzkuOS05NC4zQzYyOSA4My42IDU3MS40IDcyIDUxMiA3MmMtMTkuOSAwLTM2LTE2LjEtMzYtMzZzMTYuMS0zNiAzNi0zNmM2OS4xIDAgMTM2LjIgMTMuNSAxOTkuMyA0MC4zQzc3Mi4zIDY2IDgyNyAxMDMgODc0IDE1MGM0NyA0NyA4My45IDEwMS44IDEwOS43IDE2Mi43IDI2LjcgNjMuMSA0MC4yIDEzMC4yIDQwLjIgMTk5LjMuMSAxOS45LTE2IDM2LTM1LjkgMzZ6IiAvPjwvc3ZnPg==) */ var RefIcon = /*#__PURE__*/external_React_.forwardRef(LoadingOutlined_LoadingOutlined); if (false) {} /* harmony default export */ const icons_LoadingOutlined = (RefIcon); ;// ./src/helpers/dictionaries.js const dictionaries = { countries: { name: 'countries', tags: { invest: 'viainvest-vendor-registration-allowed,viainvest-investor-citizenship-country' } }, taxCountries: { name: 'countries', tags: { invest: 'viainvest-investor-tax-country' } }, residentialCountries: { name: 'countries', tags: { invest: 'viainvest-investor-residential-country' } }, plannedFunding: { name: 'planned_funding' }, industry: { name: 'industry' }, politicallyExposedPerson: { name: 'politically_exposed_person' } }; ;// ./src/components/Country/CountrySelect.jsx function CountrySelect_extends() { return CountrySelect_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, CountrySelect_extends.apply(null, arguments); } const CountrySelect = props => { const selectedDictionary = props?.selectedDictionary ?? dictionaries.countries; const { state: countries } = Dictionary_useDictionaryApi({ dictionary: selectedDictionary.name, params: { tags: selectedDictionary.tags.invest } }); const mapCountries = countries => countries.map(country => ({ key: country.value, label: country.description, value: country.value, data: { phoneNumberCode: country.phone_code } })); return /*#__PURE__*/React.createElement(external_antd_.Select, CountrySelect_extends({ showSearch: true, placeholder: countries.loading ? /*#__PURE__*/React.createElement(icons_LoadingOutlined, null) : 'Select country', options: mapCountries(countries.items), optionFilterProp: "label", disabled: countries.loading || props?.disabled }, props)); }; /* harmony default export */ const Country_CountrySelect = (CountrySelect); ;// ./src/components/FormItem.jsx function FormItem_extends() { return FormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, FormItem_extends.apply(null, arguments); } const FormItem = props => { return /*#__PURE__*/external_React_default().createElement(external_antd_.Form.Item, FormItem_extends({ validateStatus: props?.errors && 'error', help: props?.errors, validateTrigger: ['onBlur'] }, props), props.children); }; /* harmony default export */ const components_FormItem = (FormItem); ;// ./src/components/Country/CountryFormItem.jsx function CountryFormItem_extends() { return CountryFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, CountryFormItem_extends.apply(null, arguments); } const CountryFormItem = _ref => { let { disabled = false, required = true, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, CountryFormItem_extends({ label: props?.label || 'Country', name: props?.name || 'country', rules: [{ required: required, message: t('rule.required') }] }, props), /*#__PURE__*/external_React_default().createElement(Country_CountrySelect, CountryFormItem_extends({}, props, { disabled: disabled }))); }; /* harmony default export */ const Country_CountryFormItem = (CountryFormItem); ;// ./src/components/Country/TaxCountry/TaxCountrySelect.jsx function TaxCountrySelect_extends() { return TaxCountrySelect_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, TaxCountrySelect_extends.apply(null, arguments); } const TaxCountrySelect = props => { const { state: countries } = Dictionary_useDictionaryApi({ dictionary: dictionaries.taxCountries.name, params: { tags: dictionaries.taxCountries.tags.invest } }); const mapCountries = countries => countries.map(country => ({ key: country.value, label: country.description, value: country.value, data: { phoneNumberCode: country.phone_code } })); return /*#__PURE__*/React.createElement(external_antd_.Select, TaxCountrySelect_extends({ showSearch: true, placeholder: countries.loading ? /*#__PURE__*/React.createElement(icons_LoadingOutlined, null) : 'Select country', options: mapCountries(countries.items), optionFilterProp: "label", disabled: countries.loading || props?.disabled }, props)); }; /* harmony default export */ const TaxCountry_TaxCountrySelect = (TaxCountrySelect); ;// ./src/components/Country/TaxCountry/TaxCountryFormItem.jsx function TaxCountryFormItem_extends() { return TaxCountryFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, TaxCountryFormItem_extends.apply(null, arguments); } const TaxCountryFormItem = _ref => { let { disabled = false, required = true, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, TaxCountryFormItem_extends({ label: props?.label || 'Country', name: props?.name || 'country', rules: [{ required: required, message: t('rule.required') }] }, props), /*#__PURE__*/external_React_default().createElement(TaxCountry_TaxCountrySelect, TaxCountryFormItem_extends({}, props, { disabled: disabled }))); }; /* harmony default export */ const TaxCountry_TaxCountryFormItem = (TaxCountryFormItem); ;// ./src/components/Country/Country.jsx const Country = { FormItem: Country_CountryFormItem, TaxCountry: TaxCountry_TaxCountryFormItem }; /* harmony default export */ const Country_Country = (Country); ;// ./src/components/Email/EmailFormItem.jsx function EmailFormItem_extends() { return EmailFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, EmailFormItem_extends.apply(null, arguments); } const EmailFormItem = _ref => { let { label, name, required = true, disabled = false, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, EmailFormItem_extends({ label: label || t('email.label') + ':', name: name || 'email', rules: [{ required: required, message: t('rule.required') }, { pattern: new RegExp(/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/g), message: t("email.rule.invalidFormat") }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, { disabled: disabled, className: props.inputClassName ?? '' })); }; /* harmony default export */ const Email_EmailFormItem = (EmailFormItem); ;// ./src/components/Email/Email.jsx const Email = { FormItem: Email_EmailFormItem }; /* harmony default export */ const Email_Email = (Email); ;// ./src/components/Password/PasswordFormItem.jsx function PasswordFormItem_extends() { return PasswordFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, PasswordFormItem_extends.apply(null, arguments); } const PasswordFormItem = _ref => { let { disabled = false, ...props } = _ref; const { t } = useTranslation_useTranslation(); const [state, setState] = (0,external_React_.useState)({ focus: false, hasSpecialCharacter: false, hasNumber: false, hasCorrectLength: false, hasNoSpaces: true, passwordStrongWidth: '0%', value: null }); (0,external_React_.useEffect)(() => { if (state.focus) { validatePasswordRules(state.value); } }, [state.focus]); const onChange = e => { validatePasswordRules(e.target.value); }; const validatePasswordRules = value => { let lengthOfPassword = value.length, hasSpecialCharacter = /[@$!%*#?&]/.test(value), hasNumber = /[0-9]/.test(value), hasNoSpaces = value.indexOf(' ') < 0, hasCorrectLength = lengthOfPassword > 7, strongOfPassword; if (lengthOfPassword < 6) { strongOfPassword = lengthOfPassword * 10; } else if (hasSpecialCharacter && hasNumber && lengthOfPassword >= 10) { strongOfPassword = 100; } else { strongOfPassword = lengthOfPassword > 10 ? 100 : lengthOfPassword * 10; } strongOfPassword = strongOfPassword - (hasSpecialCharacter ? 0 : 25) - (hasNumber ? 0 : 25) - (hasNoSpaces ? 0 : 25) - (hasCorrectLength ? 0 : 25); setState({ ...state, hasSpecialCharacter: hasSpecialCharacter, hasNumber: hasNumber, hasCorrectLength: hasCorrectLength, hasNoSpaces: hasNoSpaces, passwordStrongWidth: (strongOfPassword < 0 ? 0 : strongOfPassword) + '%' }); return hasSpecialCharacter && hasNumber && hasCorrectLength && hasNoSpaces; }; const isValidPassword = (_, value) => { if (value === undefined || value.length < 1) { return Promise.resolve(); } let isValid = validatePasswordRules(value); return isValid ? Promise.resolve() : Promise.reject(new Error(t('password.rule.password_invalid'))); }; return /*#__PURE__*/external_React_default().createElement("div", null, /*#__PURE__*/external_React_default().createElement(components_FormItem, PasswordFormItem_extends({ label: "Password", name: "password", rules: [{ required: true, message: t('password.rule.password_invalid') }, { validator: isValidPassword }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input.Password, { onFocus: e => setState({ ...state, focus: true, value: e.target.value }), onBlur: e => setState({ ...state, focus: false, value: e.target.value }), onChange: onChange, disabled: disabled })), /*#__PURE__*/external_React_default().createElement("div", { className: 'passw-criteria ' + (state.focus ? '' : 'hide') }, /*#__PURE__*/external_React_default().createElement("span", { className: "passw-line" }, /*#__PURE__*/external_React_default().createElement("span", { className: "passw-line-act", style: { 'width': state.passwordStrongWidth } })), /*#__PURE__*/external_React_default().createElement("div", { className: "passw-strength" }, /*#__PURE__*/external_React_default().createElement("span", { className: "txt-left" }, t('password.strength_indicator.weak')), " ", /*#__PURE__*/external_React_default().createElement("span", { className: "txt-right" }, t('password.strength_indicator.strong'))), /*#__PURE__*/external_React_default().createElement("ul", { className: "passw-rules" }, /*#__PURE__*/external_React_default().createElement("li", { className: state.hasCorrectLength ? 'is-valid' : 'not-valid' }, t('password.strength_indicator.low_characters')), /*#__PURE__*/external_React_default().createElement("li", { className: state.hasSpecialCharacter ? 'is-valid' : 'not-valid' }, t('password.strength_indicator.special_character')), /*#__PURE__*/external_React_default().createElement("li", { className: state.hasNumber ? 'is-valid' : 'not-valid' }, t('password.strength_indicator.numbers_quantity')), /*#__PURE__*/external_React_default().createElement("li", { className: state.hasNoSpaces ? 'is-valid' : 'not-valid' }, t('password.strength_indicator.spaces'))))); }; /* harmony default export */ const Password_PasswordFormItem = (PasswordFormItem); ;// ./src/components/Password/Confirmation/ConfirmationFormItem.jsx function ConfirmationFormItem_extends() { return ConfirmationFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, ConfirmationFormItem_extends.apply(null, arguments); } const ConfirmationFormItem = _ref => { let { disabled = false, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, ConfirmationFormItem_extends({ label: "Repeat password", name: "passwordConfirmation", validateTrigger: 'onBlur', rules: [{ required: true, message: t('password.rule.password_repeat_required') }, _ref2 => { let { getFieldValue } = _ref2; return { validator(_, value) { return new Promise((res, rej) => { !value || getFieldValue('password') === value ? res() : rej(t('password.rule.passwords_match')); }); } }; }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input.Password, { disabled: disabled })); }; /* harmony default export */ const Confirmation_ConfirmationFormItem = (ConfirmationFormItem); ;// ./src/components/Password/Password.jsx const Password = { FormItem: Password_PasswordFormItem, Confirmation: { FormItem: Confirmation_ConfirmationFormItem } }; /* harmony default export */ const Password_Password = (Password); ;// ./src/components/Represantative/Name/NameFormItem.jsx function NameFormItem_extends() { return NameFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, NameFormItem_extends.apply(null, arguments); } const NameFormItem = _ref => { let { disabled = false, required = true, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, NameFormItem_extends({ label: "Name", name: ['representative', 'name'], rules: [{ required: required, message: t('rule.required') }, { pattern: new RegExp(/^[-A-Za-z]+$/), message: t('validation.regex') }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, { disabled: disabled })); }; /* harmony default export */ const Name_NameFormItem = (NameFormItem); ;// ./src/components/Represantative/Surname/SurnameFormItem.jsx function SurnameFormItem_extends() { return SurnameFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, SurnameFormItem_extends.apply(null, arguments); } const SurnameFormItem = _ref => { let { disabled = false, required = true, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, SurnameFormItem_extends({ label: "Surname", name: ['representative', 'surname'], rules: [{ required: required, message: t('rule.required') }, { pattern: new RegExp(/^[-A-Za-z]+$/), message: t('validation.regex') }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, { disabled: disabled })); }; /* harmony default export */ const Surname_SurnameFormItem = (SurnameFormItem); ;// ./src/components/Represantative/DateOfBirth/DateOfBirthFormItem.jsx function DateOfBirthFormItem_extends() { return DateOfBirthFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, DateOfBirthFormItem_extends.apply(null, arguments); } const DateOfBirthFormItem = _ref => { let { label = '', required = true, disabled = false, ...props } = _ref; const { t } = useTranslation_useTranslation(); (0,external_React_.useEffect)(() => { if (props.value) { let date = external_dayjs_default()(props.value); props.form.setFieldValue('birth_day', date.date()); props.form.setFieldValue('birth_month', date.month() + 1); props.form.setFieldValue('birth_year', date.year()); } }, [props.value]); const getListOfMonths = () => { return external_dayjs_default().months().map((val, index) => { return { label: val.charAt(0).toUpperCase() + val.slice(1), value: index + 1 }; }); }; const getFields = () => { return [props.form.getFieldValue('birth_day'), props.form.getFieldValue('birth_month'), props.form.getFieldValue('birth_year')]; }; const isValidDate = () => { let [day, month, year] = getFields(); if (year && month && day) { let birthDay = external_dayjs_default()(new Date(year, month, day)); if (birthDay.isBefore(external_dayjs_default()('1920-12-31')) || birthDay.isAfter(external_dayjs_default()().subtract(18, 'year'))) { return Promise.reject(new Error(t('validation.invalid_birth_date'))); } } return Promise.resolve(); }; const checkBirthDay = () => { let [day, month, year] = getFields(); if (year && month && day) { if (parseInt(day) > new Date(Date.UTC(year, month, 0)).getDate()) { return Promise.reject(new Error(t('validation.invalid_date'))); } } return isValidDate(); }; const isValidFields = _ => { let [day, month, year] = getFields(); if (day === undefined || month === undefined || year === undefined) { return Promise.resolve(); } return year && month && day ? Promise.resolve() : Promise.reject(t('rule.required')); }; return /*#__PURE__*/external_React_default().createElement("div", { className: 'date-input-wrap' }, /*#__PURE__*/external_React_default().createElement(components_FormItem, DateOfBirthFormItem_extends({ style: { marginBottom: 0 }, label: label, rules: [{ required: required, validator: isValidFields }, { validator: checkBirthDay }], name: 'empty_label_date_of_birth' }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, null, /*#__PURE__*/external_React_default().createElement(components_FormItem, DateOfBirthFormItem_extends({ name: 'birth_day', style: { display: 'inline-block', width: '70px', height: '25px' } }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.InputNumber, { placeholder: 'DD', disabled: disabled, onFocus: val => props.form.setFieldValue('birth_day', props.form.getFieldValue('birth_day') ?? null), className: 'day-input', min: 1, max: 31 })), /*#__PURE__*/external_React_default().createElement(components_FormItem, DateOfBirthFormItem_extends({ name: 'birth_month', style: { display: 'inline-block', width: '130px', marginLeft: '0.5rem', height: '25px' } }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Select, { disabled: disabled, showSearch: true, placeholder: "Month", optionFilterProp: "label", onFocus: val => props.form.setFieldValue('birth_month', props.form.getFieldValue('birth_month') ?? null), options: getListOfMonths() })), /*#__PURE__*/external_React_default().createElement(components_FormItem, DateOfBirthFormItem_extends({ name: 'birth_year', style: { display: 'inline-block', width: '90px', marginLeft: '0.5rem', height: '25px' } }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.InputNumber, { placeholder: 'YYYY', disabled: disabled, onFocus: val => props.form.setFieldValue('birth_year', props.form.getFieldValue('birth_year') ?? null), min: 1921, max: 9999 }))))); }; /* harmony default export */ const DateOfBirth_DateOfBirthFormItem = (DateOfBirthFormItem); ;// ./src/components/Represantative/Position/PositionFormItem.jsx function PositionFormItem_extends() { return PositionFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, PositionFormItem_extends.apply(null, arguments); } const PositionFormItem = props => { return /*#__PURE__*/external_React_default().createElement(components_FormItem, PositionFormItem_extends({ label: "Position within the company", name: ['representative', 'position'], validateTrigger: 'onBlur', rules: [{ required: true, message: 'Position is required' }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null)); }; /* harmony default export */ const Position_PositionFormItem = (PositionFormItem); ;// ./src/components/Represantative/DocumentNumber/DocumentNumberFormItem.jsx function DocumentNumberFormItem_extends() { return DocumentNumberFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, DocumentNumberFormItem_extends.apply(null, arguments); } const DocumentNumberFormItem = _ref => { let { disabled = false, required = true, ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, DocumentNumberFormItem_extends({ label: "Document number", name: ['representative', 'documentNumber'], rules: [{ required: required, message: t('rule.required') }, { pattern: new RegExp(/^[A-Za-z0-9\/\.\-\s]+$/), message: t('validation.regex') }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, { disabled: disabled })); }; /* harmony default export */ const DocumentNumber_DocumentNumberFormItem = (DocumentNumberFormItem); ;// ./src/components/Represantative/Representative.jsx const Representative = { Name: { FormItem: Name_NameFormItem }, Surname: { FormItem: Surname_SurnameFormItem }, DateOfBirth: { FormItem: DateOfBirth_DateOfBirthFormItem }, Position: { FormItem: Position_PositionFormItem }, DocumentNumber: { FormItem: DocumentNumber_DocumentNumberFormItem } }; /* harmony default export */ const Represantative_Representative = (Representative); ;// ./src/components/Steps/Alerts/RegistrationUnavailableAlert.js const RegistrationUnavailableAlert = _ref => { let { statusCode } = _ref; if (statusCode && 500 <= statusCode) { return /*#__PURE__*/external_React_default().createElement(external_antd_.Form.Item, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: "Registration is temporarily unavailable. Please try again later.", type: "error" })); } }; /* harmony default export */ const Alerts_RegistrationUnavailableAlert = (RegistrationUnavailableAlert); ;// ./src/investor/components/RegistrationForm/Steps/RegStepButtons.jsx const RegStepButtons = _ref => { let { loading, next, nextAction, back, backAction, buttonStyle = {} } = _ref; return /*#__PURE__*/external_React_default().createElement(external_antd_.Form.Item, { className: "step-buttons" }, loading && /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, null), !loading && back && backAction && /*#__PURE__*/external_React_default().createElement(external_antd_.Button, { className: "reg-back-button", onClick: backAction, style: buttonStyle }, back), !loading && /*#__PURE__*/external_React_default().createElement(external_antd_.Button, { className: "reg-button", onClick: nextAction, style: buttonStyle }, next)); }; /* harmony default export */ const Steps_RegStepButtons = (RegStepButtons); ;// ./src/investor/components/Inputs/CheckboxWithDependency.jsx const CheckboxWithDependency = _ref => { let { children, name, text, errors = '', checked = false, reversed = false, className = '' } = _ref; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Form.Item, { name: name, valuePropName: "checked", initialValue: checked }, /*#__PURE__*/external_React_default().createElement(external_antd_.Checkbox, { className: className }, " ", text, " ")), /*#__PURE__*/external_React_default().createElement(external_antd_.Form.Item, { shouldUpdate: (prevValues, currentValues) => prevValues[name] !== currentValues[name], noStyle: true, dependencies: [name], errors: errors }, _ref2 => { let { getFieldValue } = _ref2; return reversed ? !getFieldValue(name) && children : getFieldValue(name) && children; })); }; /* harmony default export */ const Inputs_CheckboxWithDependency = (CheckboxWithDependency); ;// ./src/investor/components/Inputs/TextField.jsx function TextField_extends() { return TextField_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, TextField_extends.apply(null, arguments); } const TextField = _ref => { let { fieldRequired, rulesSet = [], ...props } = _ref; if (fieldRequired) { rulesSet = [...rulesSet, { required: true, message: fieldRequired }]; } return /*#__PURE__*/external_React_default().createElement(external_antd_.Form.Item, TextField_extends({ rules: rulesSet }, props, { validateTrigger: ['onBlur'] }), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null)); }; /* harmony default export */ const Inputs_TextField = (TextField); ;// ./src/investor/helpers/translateApiValidationErrors.js const translateApiValidationErrors = (errors, t) => { const translate = rule => { const fallbackRule = rule.split('.').pop(); // Extract 'regex' from 'name.regex' return t(`validation.${rule}`, t(`validation.${fallbackRule}`)); }; const processEntry = entry => { let output = {}; for (let key in entry) { if (entry.hasOwnProperty(key)) { if (Array.isArray(entry[key])) { output[key] = entry[key].map(rule => translate(rule)); } else if (typeof entry[key] === 'object') { output[key] = processEntry(entry[key]); } else { output[key] = t(entry[key], entry[key]); } } } return output; }; return errors ? processEntry(errors) : {}; }; ;// ./src/investor/api/hooks/useValidateStep.jsx const useValidateStep = (values, step, nextStep) => { const { setStep, t } = usePortalContext(); const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, errors: {} }); const validateStep = (values, step, nextStep) => { updateState({ loading: true, statusCode: null, errors: {} }); api_api.post(`/investor/registration/validate/${step}`, values).then(res => { setStep(nextStep); updateState({ loading: false, statusCode: res.status, errors: {} }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, errors: translateApiValidationErrors(err.response?.data?.errors, t) }); }); }; (0,external_React_.useEffect)(() => { if (values) { validateStep(values, step, nextStep); } }, [values, step, nextStep]); return { loading: state.loading, statusCode: state.statusCode, errors: state.errors }; }; /* harmony default export */ const hooks_useValidateStep = (useValidateStep); ;// ./src/investor/api/hooks/useConsent.jsx const useConsent = function (consentName, lang) { let questionnaire = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, data: null }); const getConsent = (consentName, lang) => { updateState({ loading: true, statusCode: null, data: null }); const endpoint = `/consent/${lang}/${consentName}`; const suffix = questionnaire ? '/questionnaire' : ''; api_api.get(endpoint + suffix).then(res => { updateState({ loading: false, statusCode: res.status, data: res.data }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, data: null }); }); }; (0,external_React_.useEffect)(() => { getConsent(consentName, lang); }, [consentName, lang]); return { data: state.data, loading: state.loading, statusCode: state.statusCode, success: state.statusCode === 200 }; }; /* harmony default export */ const hooks_useConsent = (useConsent); ;// ./src/investor/api/hooks/useViainvestLogin.jsx const useViainvestLogin = () => { const endpoint = '/users/login'; const redirectUrl = '/identify'; const [loggedIn, setLoggedIn] = (0,external_React_.useState)(null); const login = (email, password) => { const data = { Login: { email: email, passwd: password } }; const options = { withCredentials: true }; lib_axios.post(endpoint, data, options).then(res => { setLoggedIn(true); }).catch(e => { setLoggedIn(false); }); }; return { loggedIn, login }; }; /* harmony default export */ const hooks_useViainvestLogin = (useViainvestLogin); ;// ./src/investor/api/hooks/useRegistration.jsx const useRegistration = values => { const { setStep } = usePortalContext(); const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, errors: {} }); const { login } = hooks_useViainvestLogin(); const register = values => { updateState({ loading: true, statusCode: null, errors: {} }); api_api.post(`/investor/registration/register`, values).then(res => { setStep(regSteps.stepFour); updateState({ loading: false, statusCode: res.status, errors: {} }); // attempt to perform a login in old system too login(values.email, values.password); //Old system returns 302 response, which do not saying, that user is logged IN //so, untill it will be fixed by other side, leave that event there // when login() function will return 200 response -> add useEffect and move that line there document.dispatchEvent(new Event('logged_in_user')); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, errors: err.response?.data?.errors || {} }); }); }; (0,external_React_.useEffect)(() => { if (values) { register(values); } }, [values]); return { errors: state.errors, loading: state.loading, statusCode: state.statusCode }; }; /* harmony default export */ const hooks_useRegistration = (useRegistration); ;// ./src/investor/api/hooks/useResendOtp.jsx const useResendOtp = () => { const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, errors: {} }); const resend = () => { updateState({ loading: true, statusCode: null, errors: {} }); api_api.post('/investor/verification/resend').then(res => { updateState({ loading: false, statusCode: res.status, errors: {} }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, errors: err.response?.data?.errors || {} }); }); }; return { loading: state.loading, statusCode: state.statusCode, errors: state.errors, resend }; }; /* harmony default export */ const hooks_useResendOtp = (useResendOtp); ;// ./src/investor/api/hooks/useVerifyOtp.jsx const useVerifyOtp = () => { const { setStep } = usePortalContext(); const { t } = useTranslation_useTranslation(); const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, errors: {} }); const verify = values => { updateState({ loading: true, statusCode: null, errors: {} }); api_api.post('/investor/verification/verify', values).then(res => { setStep(regSteps.stepFive); updateState({ loading: false, statusCode: res.status, errors: {} }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, errors: translateApiValidationErrors(err.response?.data?.errors, t) }); }); }; return { loading: state.loading, statusCode: state.statusCode, errors: state.errors, verify }; }; /* harmony default export */ const hooks_useVerifyOtp = (useVerifyOtp); ;// ./src/investor/api/hooks/useMifidRules.jsx const useMifidRules = () => { const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, data: null }); const getMfidRules = () => { updateState({ loading: true, statusCode: null, data: null }); const endpoint = `/publisher/mifid-rules`; api_api.get(endpoint).then(res => { updateState({ loading: false, statusCode: res.status, data: res.data }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, data: null }); }); }; (0,external_React_.useEffect)(() => { getMfidRules(); }, []); return { data: state.data, loading: state.loading, statusCode: state.statusCode, success: state.statusCode === 200, getMfidRules }; }; /* harmony default export */ const hooks_useMifidRules = (useMifidRules); ;// ./src/investor/api/hooks/useStoreConsent.jsx // [{lang, data, answers, actionName, placeSlug = null},...] const useStoreConsent = function () { let consentObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, data: null }); const url = window.location.href; const prepareResource = consentObject => { const consentId = consentObject.data.id; const consentActionId = Object.values(consentObject.data.actions).find(action => action.name === consentObject.actionName).id; const consentPlaceId = consentObject?.placeSlug ? consentObject.data.places[consentObject.placeSlug]['id'] : Object.values(consentObject.data.places)[0]['id']; return { 'consentId': consentId, 'lang': consentObject.lang, 'consentAnswers': consentObject.answers, 'consentActionId': consentActionId, 'consentPlaceId': consentPlaceId, 'url': url }; }; const storeConsent = () => { const endpoint = `/consent/`; updateState({ loading: true, statusCode: null }); const resource = []; consentObjects.forEach(function (consentObject) { resource.push(prepareResource(consentObject)); }); api_api.post(endpoint, { 'consents': resource }).then(res => { updateState({ loading: false, statusCode: res.status }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status }); }); }; (0,external_React_.useEffect)(() => { if (consentObjects.length > 0) { storeConsent(); } }, [consentObjects]); return { loading: state.loading, statusCode: state.statusCode, success: state.statusCode === 200 }; }; /* harmony default export */ const hooks_useStoreConsent = (useStoreConsent); ;// ./src/investor/api/hooks/useGetRequest.jsx const useGetRequest = endpoint => { const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, data: null }); const getRequest = endpoint => { if (state.loading) { return; } updateState({ loading: true, statusCode: null, data: null }); api_api.get(endpoint).then(res => { updateState({ loading: false, statusCode: res.status, data: res.data }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, data: null }); }); }; (0,external_React_.useEffect)(() => { getRequest(endpoint); }, [endpoint]); return { data: state.data, loading: state.loading, statusCode: state.statusCode, success: state.statusCode === 200 }; }; /* harmony default export */ const hooks_useGetRequest = (useGetRequest); ;// ./src/investor/api/hooks/usePostRequest.jsx const usePostRequest = (endpoint, values) => { const [state, updateState] = (0,external_React_.useState)({ loading: false, statusCode: null, data: null, errors: {} }); const postRequest = (endpoint, values) => { if (state.loading) { return; } updateState({ loading: true, statusCode: null, data: null, errors: {} }); api_api.post(endpoint, values).then(res => { updateState({ loading: false, statusCode: res.status, data: res.data, errors: {} }); }).catch(err => { updateState({ loading: false, statusCode: err.response?.status, data: null, errors: err.response?.data?.errors || {} }); }); }; (0,external_React_.useEffect)(() => { if (values) { postRequest(endpoint, values); } }, [endpoint, values]); return { data: state.data, loading: state.loading, statusCode: state.statusCode, success: state.statusCode === 200, errors: state.errors }; }; /* harmony default export */ const hooks_usePostRequest = (usePostRequest); ;// ./src/investor/api/index.js const validation = { useValidateProfileStep: values => hooks_useValidateStep(values, regSteps.stepOne, regSteps.stepTwo), useValidatePersonalStep: values => hooks_useValidateStep(values, regSteps.stepTwo, regSteps.stepThree), useValidateFinancialStep: values => hooks_useValidateStep(values, regSteps.stepThree, regSteps.stepFour) }; const investor_api_api = { useStatus: props => hooks_useStatus(props), useConsent: function (consentName, lang) { let questionnaire = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; return hooks_useConsent(consentName, lang, questionnaire); }, useRegister: values => hooks_useRegistration(values), useResendOtp: () => hooks_useResendOtp(), useVerifyOtp: () => hooks_useVerifyOtp(), useMifidRules: () => hooks_useMifidRules(), useStoreConsent: consentObjects => hooks_useStoreConsent(consentObjects), useGetRequest: endpoint => hooks_useGetRequest(endpoint), usePostRequest: (endpoint, values) => hooks_usePostRequest(endpoint, values) }; ;// ./src/investor/components/RegistrationForm/Steps/ProfileStep.jsx const ProfileStep = () => { const [form] = external_antd_.Form.useForm(); const { data, setData, t, loggedIn } = usePortalContext(); const [formData, setFormData] = (0,external_React_.useState)(null); const { loading, errors, statusCode } = validation.useValidateProfileStep(formData); (0,external_React_.useEffect)(() => { if (data.profileStep) { form.setFieldsValue(data.profileStep); } }, []); const onFinish = values => { if (values['promoCode'] === '') { delete values['promoCode']; } setFormData(values); }; const onSubmitClick = () => { data.profileStep = form.getFieldsValue(); if (data.profileStep['promoCode'] === '') { delete data.profileStep['promoCode']; } setData(data); form.submit(); }; return /*#__PURE__*/external_React_default().createElement(external_antd_.Form, { form: form, disabled: loading, layout: "vertical", autoComplete: "off", onFinish: onFinish }, /*#__PURE__*/external_React_default().createElement(Alerts_RegistrationUnavailableAlert, { statusCode: statusCode }), /*#__PURE__*/external_React_default().createElement(Country_Country.FormItem, { label: t('form.citizenshipCountry'), name: "citizenship", className: "reg-item", errors: errors?.citizenship }), /*#__PURE__*/external_React_default().createElement(Inputs_CheckboxWithDependency, { name: "differentTaxCountry", text: t('form.differentTaxCountry'), errors: errors?.taxCountry }, /*#__PURE__*/external_React_default().createElement(Country_Country.TaxCountry, { label: t('form.taxCountry'), name: "taxCountry", className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(Represantative_Representative.Name.FormItem, { label: t('form.name'), name: "name", className: "reg-item", errors: errors?.name }), /*#__PURE__*/external_React_default().createElement(Represantative_Representative.Surname.FormItem, { label: t('form.surname'), name: "surname", className: "reg-item", errors: errors?.surname }), /*#__PURE__*/external_React_default().createElement(Email_Email.FormItem, { label: t('form.email'), className: "reg-item", errors: errors?.email, disabled: loggedIn }), /*#__PURE__*/external_React_default().createElement(Password_Password.FormItem, { label: t('form.password'), className: "reg-item", errors: errors?.password, disabled: loggedIn }), /*#__PURE__*/external_React_default().createElement(Password_Password.Confirmation.FormItem, { label: t('form.repeatPassword'), className: "reg-item", disabled: loggedIn, errors: errors?.passwordConfirmation }), /*#__PURE__*/external_React_default().createElement(Inputs_TextField, { label: t('form.promoCode'), name: "promoCode", errors: errors?.promoCode, className: "reg-item" }), /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: loading, next: t('button.next'), nextAction: onSubmitClick })); }; /* harmony default export */ const Steps_ProfileStep = (ProfileStep); ;// ./src/components/Elements/ResendButton.jsx const ResendButton = _ref => { let { resend, loading, seconds, prefixText = null } = _ref; const { t } = usePortalContext(); const newTime = () => { return external_dayjs_default()().add(seconds, 'second').valueOf(); }; const [countdown, setCountdown] = (0,external_React_.useState)({ value: 0, finished: true }); const enableResend = () => { setCountdown({ value: 0, finished: true }); }; const onResend = () => { setCountdown({ value: newTime(), finished: false }); resend(); }; return /*#__PURE__*/external_React_default().createElement(external_antd_.Typography.Text, null, prefixText && prefixText + ' ', /*#__PURE__*/external_React_default().createElement(external_antd_.Button, { style: { padding: 0, font: 'inherit', border: 'none', position: 'relative', top: '-1.5px' }, type: "link", onClick: onResend, disabled: !countdown.finished || loading }, loading ? t('button.sending')?.toLowerCase() : t('button.resend')?.toLowerCase()), !countdown.finished && !loading && /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, ' ' + t('after') + ' ', /*#__PURE__*/external_React_default().createElement(external_antd_.Statistic.Countdown, { style: { display: 'inline-block' }, value: countdown.value, format: 'mm:ss', onFinish: enableResend, valueStyle: { fontSize: '14px', font: 'inherit' } })), "."); }; /* harmony default export */ const Elements_ResendButton = (ResendButton); ;// ./src/components/VerificationCode/VerificationCodeFormItem.jsx function VerificationCodeFormItem_extends() { return VerificationCodeFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, VerificationCodeFormItem_extends.apply(null, arguments); } const VerificationCodeFormItem = props => { const { t } = usePortalContext(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, VerificationCodeFormItem_extends({ label: t('form.verificationCode'), name: "verificationCode", rules: [{ required: true, message: t('rule.verificationCode') }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null)); }; /* harmony default export */ const VerificationCode_VerificationCodeFormItem = (VerificationCodeFormItem); ;// ./src/components/VerificationCode/VerificationCode.jsx const VerificationCode = { FormItem: VerificationCode_VerificationCodeFormItem }; /* harmony default export */ const VerificationCode_VerificationCode = (VerificationCode); ;// ./src/viainvest-legacy/Affiliate/index.js const captureAffiliate = () => { const queryParams = getUrlParams(); if (queryParams['utm_source']) { // isReferral const encodedData = base64Encode(JSON.stringify(queryParams)); setCookie('affiliateCapture', encodedData, 30); } }; function getUrlParams() { const params = new URLSearchParams(window.location.search); const queryParams = {}; for (let [key, value] of params.entries()) { queryParams[key] = value; } return queryParams; } function setCookie(name, value, days) { const date = new Date(); date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); const expires = "expires=" + date.toUTCString(); document.cookie = name + "=" + value + ";" + expires + ";path=/"; } function base64Encode(str) { return btoa(encodeURIComponent(str)); } function gtag() { dataLayer.push(arguments); } /** * This dependency is required on the website side where google cookie is required: * * Doc: https://developers.google.com/tag-platform/gtagjs */ function setGoogleCookie() { let measurementTagId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'G-C07DM3X3H2'; window.dataLayer = window.dataLayer || []; gtag('js', new Date()); gtag('config', measurementTagId); gtag('get', measurementTagId, 'session_id', session_id => { setCookie('ga_session_id', session_id, 1); }); } function resetGoogleSessionId() { const newSessionId = Math.floor(Date.now() / 1000); gtag('event', 'session_start', { 'session_id': newSessionId }); setCookie('ga_session_id', newSessionId, 1); } const GoogleCookie = { setGoogleCookie, resetGoogleSessionId }; ;// ./src/investor/components/RegistrationForm/Steps/VerificationStep.jsx const VerificationStep = () => { const { t } = usePortalContext(); const [form] = external_antd_.Form.useForm(); const seconds = 120; const { loading: verificationCodeResending, resend } = investor_api_api.useResendOtp(); const { loading, verify, errors } = investor_api_api.useVerifyOtp(); GoogleCookie.resetGoogleSessionId(); return /*#__PURE__*/external_React_default().createElement(external_antd_.Form, { disabled: loading || verificationCodeResending, form: form, layout: "vertical", autoComplete: "off", onFinish: verify }, /*#__PURE__*/external_React_default().createElement(Elements_ResendButton, { resend: resend, loading: verificationCodeResending, seconds: seconds, prefixText: t('step.texts.verification.thank-you') }), /*#__PURE__*/external_React_default().createElement(external_antd_.Divider, null), /*#__PURE__*/external_React_default().createElement(VerificationCode_VerificationCode.FormItem, { className: "reg-item", errors: errors?.verificationCode }), /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: loading, next: t('button.continue'), nextAction: form.submit })); }; /* harmony default export */ const Steps_VerificationStep = (VerificationStep); ;// ./src/components/Address/Street/StreetFormItem.jsx function StreetFormItem_extends() { return StreetFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, StreetFormItem_extends.apply(null, arguments); } const StreetFormItem = props => { const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, StreetFormItem_extends({ label: "Street name and number", name: props?.name || ['address', 'street'], rules: [{ required: true, message: t('rule.required') }, { pattern: new RegExp(/^[A-Za-z0-9\/\.\-\s]+$/), message: t('validation.regex') }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null)); }; /* harmony default export */ const Street_StreetFormItem = (StreetFormItem); ;// ./src/components/Address/ZipCode/ZipCodeFormItem.jsx function ZipCodeFormItem_extends() { return ZipCodeFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, ZipCodeFormItem_extends.apply(null, arguments); } const ZipCodeFormItem = props => { const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, ZipCodeFormItem_extends({ label: "Zip code", name: props?.name || ['address', 'zipCode'], rules: [{ required: true, message: t('rule.required') }, { pattern: new RegExp(/^[A-Za-z0-9\-\s]+$/), message: t('validation.regex') }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null)); }; /* harmony default export */ const ZipCode_ZipCodeFormItem = (ZipCodeFormItem); ;// ./src/components/Address/City/CityFormItem.jsx function CityFormItem_extends() { return CityFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, CityFormItem_extends.apply(null, arguments); } const CityFormItem = props => { const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(components_FormItem, CityFormItem_extends({ label: "City", name: props?.name || ['address', 'city'], rules: [{ required: true, message: t('rule.required') }, { pattern: new RegExp(/^[A-Za-z\.\-\s]+$/), message: t('validation.regex') }] }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null)); }; /* harmony default export */ const City_CityFormItem = (CityFormItem); ;// ./src/components/Address/Address.jsx const Address = { Street: { FormItem: Street_StreetFormItem }, ZipCode: { FormItem: ZipCode_ZipCodeFormItem }, City: { FormItem: City_CityFormItem } }; /* harmony default export */ const Address_Address = (Address); ;// ./src/components/Phone/CountryCode/CountryCodeSelect.jsx function CountryCodeSelect_extends() { return CountryCodeSelect_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, CountryCodeSelect_extends.apply(null, arguments); } const CountryCodeSelect = props => { const { state: countries } = Dictionary_useDictionaryApi({ dictionary: dictionaries.countries.name }); const mapCountries = countries => countries.filter((obj1, i, arr) => arr.findIndex(obj2 => obj2.phone_code === obj1.phone_code) === i).map(country => ({ key: country.phone_code, label: country.phone_code, value: country.phone_code })).sort((a, b) => a.value - b.value); return /*#__PURE__*/React.createElement(external_antd_.Select, CountryCodeSelect_extends({ showSearch: true, placeholder: countries.loading ? /*#__PURE__*/React.createElement(icons_LoadingOutlined, null) : 'Select code', options: mapCountries(countries.items), optionFilterProp: "label", disabled: countries.loading || props?.disabled }, props)); }; /* harmony default export */ const CountryCode_CountryCodeSelect = (CountryCodeSelect); ;// ./src/components/Phone/CountryCode/CountryCodeFormItem.jsx function CountryCodeFormItem_extends() { return CountryCodeFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, CountryCodeFormItem_extends.apply(null, arguments); } const CountryCodeFormItem = props => { return /*#__PURE__*/external_React_default().createElement(components_FormItem, CountryCodeFormItem_extends({ noStyle: true, name: "phoneNumberCode", validateTrigger: 'onBlur' }, props), /*#__PURE__*/external_React_default().createElement(CountryCode_CountryCodeSelect, null)); }; /* harmony default export */ const CountryCode_CountryCodeFormItem = (CountryCodeFormItem); ;// ./src/components/Phone/Number/NumberFormItem.jsx function NumberFormItem_extends() { return NumberFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, NumberFormItem_extends.apply(null, arguments); } const NumberFormItem = _ref => { let { label, form, errors, ...props } = _ref; const { t } = useTranslation_useTranslation(); const isValidFields = () => { return form.getFieldValue('phoneNumber') && form.getFieldValue('phoneNumberCode') ? Promise.resolve() : Promise.reject(t('rule.required')); }; const isValidPhoneNumber = () => { if (form.getFieldValue('phoneNumber') && form.getFieldValue('phoneNumberCode')) { return /^\d{1,15}$/.test(form.getFieldValue('phoneNumber')) ? Promise.resolve() : Promise.reject(t('rule.phoneFormat')); } return Promise.resolve(); }; return /*#__PURE__*/external_React_default().createElement(components_FormItem, NumberFormItem_extends({ name: 'empty_label', label: label, rules: [{ required: true, validator: isValidFields }, { validator: isValidPhoneNumber }], errors: errors }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 3, style: { height: '40px' } }, /*#__PURE__*/external_React_default().createElement(Phone_Phone.CountryCode.FormItem, props)), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 21, style: { height: '40px' } }, /*#__PURE__*/external_React_default().createElement(components_FormItem, NumberFormItem_extends({ name: "phoneNumber" }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null))))); }; /* harmony default export */ const Number_NumberFormItem = (NumberFormItem); ;// ./src/components/Phone/Phone.jsx const Phone = { CountryCode: { FormItem: CountryCode_CountryCodeFormItem }, Number: { FormItem: Number_NumberFormItem } }; /* harmony default export */ const Phone_Phone = (Phone); ;// ./src/investor/components/RegistrationForm/Steps/PersonalStep.jsx const PersonalStep = () => { const [form] = external_antd_.Form.useForm(); const [formData, setFormData] = (0,external_React_.useState)(null); const { loading, errors, statusCode } = validation.useValidatePersonalStep(formData); const { data, setStep, setData, t } = usePortalContext(); const onCountryChange = (_, country) => { form.setFieldValue('phoneNumberCode', country?.data?.phoneNumberCode); }; (0,external_React_.useEffect)(() => { if (data.personalStep) { form.setFieldsValue(data.personalStep); } }, []); const onFinish = values => { if (values.birth_year && values.birth_month && values.birth_day) { values.representative.dateOfBirth = external_dayjs_default()(new Date(Date.UTC(values.birth_year, values.birth_month - 1, values.birth_day))).toISOString(); } setFormData(values); }; const onSubmitClick = () => { form.setFieldValue('birth_year', form.getFieldValue('birth_year') ?? null); form.setFieldValue('birth_month', form.getFieldValue('birth_month') ?? null); form.setFieldValue('birth_day', form.getFieldValue('birth_day') ?? null); data.personalStep = form.getFieldsValue(); if (data.personalStep.birth_year && data.personalStep.birth_month && data.personalStep.birth_day) { data.personalStep.representative.dateOfBirth = external_dayjs_default()(new Date(Date.UTC(data.personalStep.birth_year, data.personalStep.birth_month - 1, data.personalStep.birth_day))).toISOString(); } setData(data); form.submit(); }; const onBackClick = () => { data.personalStep = form.getFieldsValue(); setData(data); setStep(regSteps.stepOne); }; return /*#__PURE__*/external_React_default().createElement(external_antd_.Form, { form: form, disabled: loading, layout: "vertical", autoComplete: "off", onFinish: onFinish }, /*#__PURE__*/external_React_default().createElement(Alerts_RegistrationUnavailableAlert, { statusCode: statusCode }), /*#__PURE__*/external_React_default().createElement(Represantative_Representative.DateOfBirth.FormItem, { label: t('form.dob'), errors: errors?.representative?.dateOfBirth, form: form, className: "reg-item" }), data?.profileStep?.citizenship === 'LV' && /*#__PURE__*/external_React_default().createElement(Inputs_TextField, { label: t('form.personCode'), name: "personCode", errors: errors?.personCode, rulesSet: [{ min: 11, message: t('rule.personCodeFormat') }, { max: 12, message: t('rule.personCodeFormat') }, { pattern: new RegExp(/^[A-Za-z0-9\-\s]+$/), message: t('validation.regex') }], fieldRequired: t('rule.required'), className: "reg-item" }), /*#__PURE__*/external_React_default().createElement(Country_Country.FormItem, { label: t('form.country'), name: ['representative', 'address', 'country'], errors: errors?.representative?.address?.country, onChange: onCountryChange, className: "reg-item", selectedDictionary: dictionaries.residentialCountries }), /*#__PURE__*/external_React_default().createElement(Address_Address.Street.FormItem, { label: t('form.streetName'), name: ['representative', 'address', 'street'], errors: errors?.representative?.address?.street, className: "reg-item" }), /*#__PURE__*/external_React_default().createElement(Address_Address.ZipCode.FormItem, { label: t('form.zip'), name: ['representative', 'address', 'zipCode'], errors: errors?.representative?.address?.zipCode, className: "reg-item" }), /*#__PURE__*/external_React_default().createElement(Address_Address.City.FormItem, { label: t('form.city'), name: ['representative', 'address', 'city'], errors: errors?.representative?.address?.city, className: "reg-item" }), /*#__PURE__*/external_React_default().createElement(Phone_Phone.Number.FormItem, { label: t('form.phone'), errors: errors?.phoneNumber, form: form, className: "reg-item" }), /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: loading, next: t('button.next'), nextAction: onSubmitClick, back: t('button.back'), backAction: onBackClick })); }; /* harmony default export */ const Steps_PersonalStep = (PersonalStep); ;// ./src/investor/components/Inputs/QuestionnaireSelect.jsx function QuestionnaireSelect_extends() { return QuestionnaireSelect_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, QuestionnaireSelect_extends.apply(null, arguments); } const QuestionnaireSelect = _ref => { let { consent, slug, loading, selectText = 'Select', answerRequiredText = 'Answer is required', defaultValue = null, ...props } = _ref; const [question, setQuestion] = (0,external_React_.useState)(null); const [options, setOptions] = (0,external_React_.useState)([]); (0,external_React_.useEffect)(() => { const questionFound = consent && !loading && consent?.questions && Object.values(consent.questions).find(question => question?.name === slug); setQuestion(questionFound); if (questionFound) { const mappedOptions = Object.values(questionFound.answers).map(answer => ({ key: answer.id, label: answer.text, value: answer.id })); setOptions(mappedOptions); } }, [consent, slug, loading]); return /*#__PURE__*/external_React_default().createElement(components_FormItem, QuestionnaireSelect_extends({ label: question?.text ?? '', name: slug, rules: [{ required: true, message: answerRequiredText }], initialValue: defaultValue }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Select, { placeholder: !question ? /*#__PURE__*/external_React_default().createElement(icons_LoadingOutlined, null) : selectText, options: question ? options : [], optionFilterProp: "label", disabled: !question })); }; /* harmony default export */ const Inputs_QuestionnaireSelect = (QuestionnaireSelect); ;// ./src/investor/components/Inputs/ConsentsCheckbox.jsx function ConsentsCheckbox_extends() { return ConsentsCheckbox_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, ConsentsCheckbox_extends.apply(null, arguments); } const ConsentsCheckbox = _ref => { let { consentName, lang, required = false, ...props } = _ref; const { t } = useTranslation_useTranslation(); const { data: consentData, loading: consentLoading } = investor_api_api.useConsent(consentName, lang); const rules = required ? [{ required: true, message: t('rule.checkboxRequired'), transform: value => value || undefined, type: 'boolean' }] : []; return /*#__PURE__*/external_React_default().createElement(components_FormItem, ConsentsCheckbox_extends({ name: ['consents', consentName], valuePropName: "checked", initialValue: false, rules: rules }, props), /*#__PURE__*/external_React_default().createElement(external_antd_.Checkbox, ConsentsCheckbox_extends({ disabled: consentLoading || !consentData }, props), consentLoading || !consentData ? /*#__PURE__*/external_React_default().createElement(icons_LoadingOutlined, null) : /*#__PURE__*/external_React_default().createElement("span", { dangerouslySetInnerHTML: { __html: consentData?.text } }))); }; /* harmony default export */ const Inputs_ConsentsCheckbox = (ConsentsCheckbox); ;// ./src/investor/components/Inputs/ConsentsQuestionWithDependency.jsx const ConsentsQuestionWithDependency = _ref => { let { children, consent, form, slug } = _ref; const question = consent && consent?.questions && Object.values(consent.questions).find(question => question?.name === slug); const dependsOnQuestion = question && consent.questions[question.dependsOnQuestion]; const dependsOnQuestionValue = external_antd_.Form.useWatch(dependsOnQuestion?.name, form); const isSubQuestionShown = () => { if (dependsOnQuestionValue !== null && typeof dependsOnQuestionValue === 'object' && question !== null) { let questionKey = '', isActive = false; for (const [key, value] of Object.entries(dependsOnQuestion.answers)) { if (key === question?.dependsOnQuestionAnswer) questionKey = key; } for (const [key, value] of Object.entries(dependsOnQuestionValue)) { if (value === questionKey) isActive = true; } return isActive; } return dependsOnQuestionValue === question?.dependsOnQuestionAnswer; }; return /*#__PURE__*/React.createElement(React.Fragment, null, isSubQuestionShown() && children); }; /* harmony default export */ const Inputs_ConsentsQuestionWithDependency = (ConsentsQuestionWithDependency); ;// ./src/investor/components/Inputs/QuestionnaireTextField.jsx function QuestionnaireTextField_extends() { return QuestionnaireTextField_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, QuestionnaireTextField_extends.apply(null, arguments); } const QuestionnaireTextField = _ref => { let { consent, slug, errors, fieldRequired, ...props } = _ref; const question = consent && consent?.questions && Object.values(consent.questions).find(question => question?.name === slug); return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(Inputs_TextField, QuestionnaireTextField_extends({ label: question?.text, name: slug, errors: errors, fieldRequired: fieldRequired }, props))); }; /* harmony default export */ const Inputs_QuestionnaireTextField = (QuestionnaireTextField); ;// ./src/investor/components/RegistrationForm/Steps/FinancialStep.jsx const FinancialStep = () => { const [form] = external_antd_.Form.useForm(); const [formData, setFormData] = (0,external_React_.useState)(null); const { loading, errors, statusCode } = investor_api_api.useRegister(formData); const { lang, data, setStep, setData, t } = usePortalContext(); const { data: consentData, loading: consentLoading } = investor_api_api.useConsent('kyc_questionnaire', lang); (0,external_React_.useEffect)(() => { if (data.financialStep) { form.setFieldsValue(data.financialStep); } }, []); (0,external_React_.useEffect)(() => { if (statusCode === 302) { window.location.href = '/users/register/error'; } }, [statusCode]); const onSubmitClick = () => { data.financialStep = form.getFieldsValue(); setData(data); data.lang = { lang: lang }; setFormData(Object.assign({}, ...Object.values(data))); }; const onBackClick = () => { data.financialStep = form.getFieldsValue(); setData(data); setStep(regSteps.stepTwo); }; const isPepText = consentData ? Object.values(consentData?.questions).find(question => question?.name === 'is_pep')?.text ?? '' : ''; return /*#__PURE__*/external_React_default().createElement(external_antd_.Form, { form: form, disabled: loading, layout: "vertical", autoComplete: "off", onFinish: onSubmitClick }, /*#__PURE__*/external_React_default().createElement(Alerts_RegistrationUnavailableAlert, { statusCode: statusCode }), /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "prof_status", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.prof_status }), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsQuestionWithDependency, { consent: consentData, slug: "prof_status_enterpreneur_business_activity", form: form }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "prof_status_enterpreneur_business_activity", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.prof_status_enterpreneur_business_activity })), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsQuestionWithDependency, { consent: consentData, slug: "prof_status_enterpreneur_company_name", form: form }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireTextField, { consent: consentData, slug: "prof_status_enterpreneur_company_name", rules: [{ required: true, message: t('rule.required') }, { pattern: new RegExp(/^[A-Za-z0-9\/\.\-\s]+$/), message: t('validation.regex_special') }], errors: errors?.prof_status_enterpreneur_company_name, fieldRequired: t('rule.required'), className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsQuestionWithDependency, { consent: consentData, slug: "prof_status_employed_position", form: form }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "prof_status_employed_position", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.prof_status_employed_position })), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsQuestionWithDependency, { consent: consentData, slug: "prof_status_employee_company_name", form: form }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireTextField, { consent: consentData, slug: "prof_status_employee_company_name", rules: [{ required: true, message: t('rule.required') }, { pattern: new RegExp(/^[A-Za-z0-9\/\.\-\s]+$/), message: t('validation.regex_special') }], errors: errors?.prof_status_employee_company_name, fieldRequired: t('rule.required'), className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsQuestionWithDependency, { consent: consentData, slug: "prof_status_self_employed_business_activity", form: form }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "prof_status_self_employed_business_activity", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.prof_status_self_employed_business_activity })), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsQuestionWithDependency, { consent: consentData, slug: "prof_status_self_employed_tax_identification_number", form: form }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireTextField, { consent: consentData, slug: "prof_status_self_employed_tax_identification_number", errors: errors?.prof_status_self_employed_tax_identification_number, rules: [{ required: true, message: t('rule.required') }, { pattern: new RegExp(/^[-A-Za-z0-9]+$/), message: t('validation.regex') }], fieldRequired: t('rule.required'), className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "revenue_monthly_eur", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.revenue_monthly_eur }), /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "source_of_funds", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.source_of_funds }), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsQuestionWithDependency, { consent: consentData, slug: "source_of_funds_other_please_specify", form: form }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireTextField, { consent: consentData, slug: "source_of_funds_other_please_specify", errors: errors?.source_of_funds_other_please_specify, rules: [{ required: true, message: t('rule.required') }, { pattern: new RegExp(/^[-A-Za-z0-9]+$/), message: t('validation.regex') }], fieldRequired: t('rule.required'), className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "invest_plan_yearly", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.invest_plan_yearly }), /*#__PURE__*/external_React_default().createElement(Inputs_CheckboxWithDependency, { name: "is_pep", text: isPepText, checked: true, reversed: true }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "pep_relation", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.required'), className: "reg-item", errors: errors?.pep_relation })), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsCheckbox, { consentName: "viainvest_registration_tc", lang: lang, errors: errors?.consents?.viainvest_registration_tc, required: true }), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsCheckbox, { consentName: "viainvest_registration_beneficiar", lang: lang, errors: errors?.consents?.viainvest_registration_beneficiar, required: true }), /*#__PURE__*/external_React_default().createElement(Inputs_ConsentsCheckbox, { consentName: "viainvest_registration_marketing", lang: lang, errors: errors?.consents?.viainvest_registration_marketing }), /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: loading, next: t('button.register'), nextAction: form.submit, back: t('button.back'), backAction: onBackClick })); }; /* harmony default export */ const Steps_FinancialStep = (FinancialStep); ;// ./node_modules/@ant-design/icons-svg/es/asn/CheckOutlined.js // This icon file is generated automatically. var CheckOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, "name": "check", "theme": "outlined" }; /* harmony default export */ const asn_CheckOutlined = (CheckOutlined); ;// ./node_modules/@ant-design/icons/es/icons/CheckOutlined.js // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY var CheckOutlined_CheckOutlined = function CheckOutlined(props, ref) { return /*#__PURE__*/external_React_.createElement(AntdIcon, _extends({}, props, { ref: ref, icon: asn_CheckOutlined })); }; /**![check](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkxMiAxOTBoLTY5LjljLTkuOCAwLTE5LjEgNC41LTI1LjEgMTIuMkw0MDQuNyA3MjQuNSAyMDcgNDc0YTMyIDMyIDAgMDAtMjUuMS0xMi4ySDExMmMtNi43IDAtMTAuNCA3LjctNi4zIDEyLjlsMjczLjkgMzQ3YzEyLjggMTYuMiAzNy40IDE2LjIgNTAuMyAwbDQ4OC40LTYxOC45YzQuMS01LjEuNC0xMi44LTYuMy0xMi44eiIgLz48L3N2Zz4=) */ var CheckOutlined_RefIcon = /*#__PURE__*/external_React_.forwardRef(CheckOutlined_CheckOutlined); if (false) {} /* harmony default export */ const icons_CheckOutlined = (CheckOutlined_RefIcon); ;// ./src/hooks/Identification/useIdentificationApi.js const useIdentificationApi = props => { const [errors, setErrors] = (0,external_React_.useState)({}); const [loading, setLoading] = (0,external_React_.useState)(false); const start = () => { setLoading(true); setErrors({}); const url = props?.url || window.location.href.concat('identification'); const failedUrl = props?.failedUrl || null; let resource = { url: url }; if (failedUrl) { resource['failed_url'] = failedUrl; } api_api.post('/identification/start', resource).then(res => { window.location.href = res.data.redirectUrl; props?.onSuccess(res); }).catch(err => { setErrors(err.response?.data?.errors || {}); props?.onError(err); }).finally(() => setLoading(false)); }; return { loading, errors, start }; }; /* harmony default export */ const Identification_useIdentificationApi = (useIdentificationApi); ;// ./src/investor/components/RegistrationForm/Steps/IdentificationStep.jsx const { Title, Text } = external_antd_.Typography; const IdentificationStep = () => { const url = window.location.origin.concat('/portal/identification?status=success'); const failedUrl = window.location.origin.concat('/portal/registration'); const { loading, start } = Identification_useIdentificationApi({ url: url, failedUrl: failedUrl, onError: error => { if (401 === error.response?.status) { window.location = '/users/login'; } } }); const { t } = useTranslation_useTranslation(); const checklistItems = [t('step.texts.identification.checklist_1'), t('step.texts.identification.checklist_2'), t('step.texts.identification.checklist_3')]; return /*#__PURE__*/external_React_default().createElement(external_antd_.Card, { style: { textAlign: 'center', padding: '20px' }, bordered: false }, /*#__PURE__*/external_React_default().createElement(external_antd_.Image, { style: { marginBottom: 20 }, preview: false, className: "idenfy-image", src: "" }), /*#__PURE__*/external_React_default().createElement(Title, { level: 2 }, t('step.texts.identification.title')), /*#__PURE__*/external_React_default().createElement(Text, null, t('step.texts.identification.paragraph_1')), /*#__PURE__*/external_React_default().createElement("br", null), /*#__PURE__*/external_React_default().createElement("br", null), /*#__PURE__*/external_React_default().createElement(Text, null, t('step.texts.identification.paragraph_2')), /*#__PURE__*/external_React_default().createElement("br", null), /*#__PURE__*/external_React_default().createElement("br", null), /*#__PURE__*/external_React_default().createElement(Title, { level: 4 }, t('step.texts.identification.checklist_title')), /*#__PURE__*/external_React_default().createElement(external_antd_.List, { dataSource: checklistItems, renderItem: item => /*#__PURE__*/external_React_default().createElement(external_antd_.List.Item, null, /*#__PURE__*/external_React_default().createElement(icons_CheckOutlined, { style: { color: 'green', marginRight: 8 } }), item) }), /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: loading, next: t('step.texts.identification.button_verify'), nextAction: start })); }; /* harmony default export */ const Steps_IdentificationStep = (IdentificationStep); ;// ./src/investor/components/RegistrationForm/RegistrationForm.jsx const RegistrationForm = () => { const { step } = usePortalContext(); const stepComponent = () => { switch (step) { case regSteps.stepOne: return /*#__PURE__*/external_React_default().createElement(Steps_ProfileStep, null); case regSteps.stepTwo: return /*#__PURE__*/external_React_default().createElement(Steps_PersonalStep, null); case regSteps.stepThree: return /*#__PURE__*/external_React_default().createElement(Steps_FinancialStep, null); case regSteps.stepFour: return /*#__PURE__*/external_React_default().createElement(Steps_VerificationStep, null); case regSteps.stepFive: return /*#__PURE__*/external_React_default().createElement(Steps_IdentificationStep, null); default: return null; } }; return /*#__PURE__*/external_React_default().createElement(Layouts_RegistrationLayout, null, stepComponent()); }; /* harmony default export */ const RegistrationForm_RegistrationForm = (RegistrationForm); ;// ./src/investor/helpers/processedConsentsHelper.js function isNotNullNorEmptyArray(value) { return value !== null && (!Array.isArray(value) || value.length > 0); } function processConsents(consents) { let processedContent = { questions: [], // consentSlug -> groupId -> questionId -> {question, subQuestions} answers: [] // consentSlug -> groupId -> questionId -> {answerId, value} }; Object.values(consents).forEach(function (consent) { const consentName = consent.slug; consent = consent.data; processedContent.questions[consentName] = {}; processedContent.answers[consentName] = {}; Object.values(consent.questions).forEach(function (question) { let groupId = question.groupId; if (consent.questionGroups[groupId]?.parentConsentQuestionGroupId) { groupId = consent.questionGroups[groupId]?.parentConsentQuestionGroupId; } if (!processedContent.questions[consentName][groupId]) { processedContent.questions[consentName][groupId] = {}; } if (!question.dependsOnQuestion) { if (!processedContent.questions[consentName][groupId][question.id]) { processedContent.questions[consentName][groupId][question.id] = {}; } processedContent.questions[consentName][groupId][question.id].question = question; } else { if (!processedContent.questions[consentName][groupId][question.dependsOnQuestion]) { processedContent.questions[consentName][groupId][question.dependsOnQuestion] = {}; } const subQuestions = processedContent.questions[consentName][groupId][question.dependsOnQuestion].subQuestions ?? {}; processedContent.questions[consentName][groupId][question.dependsOnQuestion].subQuestions = { ...subQuestions, [question.id]: question }; } if (isNotNullNorEmptyArray(question.customerAnswer)) { let answer = { consentAnswerId: null, value: null }; if (question.type === 'text' || question.type === 'email') { answer.value = question.customerAnswer; } else { answer.consentAnswerId = question.customerAnswer; answer.value = question.answers[question.customerAnswer].text ?? question.answers[question.customerAnswer].name; } if (!processedContent.answers[consentName][question.groupId]) { processedContent.answers[consentName][question.groupId] = {}; } if (!processedContent.answers[consentName][question.groupId][question.id]) { processedContent.answers[consentName][question.groupId][question.id] = {}; } processedContent.answers[consentName][question.groupId][question.id] = answer; } }); }); return groupSubGroupsTogether(consents, processedContent); } function groupSubGroupsTogether(consents, processedContent) { Object.values(consents).forEach(function (consent) { const consentName = consent.slug; Object.values(consent.data?.questionGroups).forEach(function (questionGroup) { if (questionGroup.parentConsentQuestionGroupId) { processedContent.questions[consentName][questionGroup.parentConsentQuestionGroupId] = { ...processedContent.questions[consentName][questionGroup.parentConsentQuestionGroupId], ...processedContent.questions[consentName][questionGroup.id] }; delete processedContent.questions[consentName][questionGroup.id]; } }); }); return processedContent; } function findGroupIdByName(questionGroups, name) { for (const key in questionGroups) { if (questionGroups[key].name === name) { return questionGroups[key].id; } } return null; } function flatten(array) { let result = {}; Object.values(array).forEach(function (object) { result = { ...result, ...object }; }); return result; } ;// ./src/investor/contexts/QuestionnaireContext.jsx const QuestionnaireContext_DefaultValue = { consents: null, // [{slug, data}] activePart: questionnaireParts.overview, // current page => overview, summary, form groups: [], // groups to include [{name, id, slug}] questions: [], // groupId->questionId => {question, subQuestions} ordered by groups active: { group: null, questionData: null }, // current question (group) to display action: { triggered: null, dependsOnActions: null }, answers: [] // [consent->group->{questionID => [consentAnswerId, value]}], }; const QuestionnaireContext = /*#__PURE__*/(0,external_React_.createContext)(QuestionnaireContext_DefaultValue); const useQuestionnaireContext = () => { const context = (0,external_React_.useContext)(QuestionnaireContext); if (!context) { throw Error('useQuestionnaireContext must be used inside the PortalContextProvider'); } return context; }; const QuestionnaireContextProvider = _ref => { let { children, ...props } = _ref; const [state, updateState] = (0,external_React_.useState)(QuestionnaireContext_DefaultValue); const setConsents = consents => { const result = processConsents(consents); updateState(prevState => ({ ...prevState, consents: consents, questions: flatten(result.questions), answers: result.answers })); }; const setActivePart = activePart => { updateState(prevState => ({ ...prevState, activePart: activePart })); }; const setGroups = groups => { groups = groups.map(function (group) { group.id = findGroupIdByName(state.consents[group.slug]?.data?.questionGroups, group.name); group.title = state.consents[group.slug]?.data?.questionGroups[group.id].text; return group; }); updateState(prevState => ({ ...prevState, groups: Object.values(groups) })); }; const setActive = active => { updateState(prevState => ({ ...prevState, active: active })); }; const setAnswers = answers => { updateState(prevState => ({ ...prevState, answers: answers })); }; const setAction = action => { updateState(prevState => ({ ...prevState, action: action })); }; const context = { consents: state.consents, setConsents, activePart: state.activePart, setActivePart, groups: state.groups, setGroups, questions: state.questions, active: state.active, setActive, answers: state.answers, setAnswers, action: state.action, setAction }; return /*#__PURE__*/external_React_default().createElement(QuestionnaireContext.Provider, { value: context }, children); }; ;// ./node_modules/@ant-design/icons-svg/es/asn/CloseOutlined.js // This icon file is generated automatically. var CloseOutlined = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" }; /* harmony default export */ const asn_CloseOutlined = (CloseOutlined); ;// ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY var CloseOutlined_CloseOutlined = function CloseOutlined(props, ref) { return /*#__PURE__*/external_React_.createElement(AntdIcon, _extends({}, props, { ref: ref, icon: asn_CloseOutlined })); }; /**![close](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdmlld0JveD0iNjQgNjQgODk2IDg5NiIgZm9jdXNhYmxlPSJmYWxzZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNzk5Ljg2IDE2Ni4zMWMuMDIgMCAuMDQuMDIuMDguMDZsNTcuNjkgNTcuN2MuMDQuMDMuMDUuMDUuMDYuMDhhLjEyLjEyIDAgMDEwIC4wNmMwIC4wMy0uMDIuMDUtLjA2LjA5TDU2OS45MyA1MTJsMjg3LjcgMjg3LjdjLjA0LjA0LjA1LjA2LjA2LjA5YS4xMi4xMiAwIDAxMCAuMDdjMCAuMDItLjAyLjA0LS4wNi4wOGwtNTcuNyA1Ny42OWMtLjAzLjA0LS4wNS4wNS0uMDcuMDZhLjEyLjEyIDAgMDEtLjA3IDBjLS4wMyAwLS4wNS0uMDItLjA5LS4wNkw1MTIgNTY5LjkzbC0yODcuNyAyODcuN2MtLjA0LjA0LS4wNi4wNS0uMDkuMDZhLjEyLjEyIDAgMDEtLjA3IDBjLS4wMiAwLS4wNC0uMDItLjA4LS4wNmwtNTcuNjktNTcuN2MtLjA0LS4wMy0uMDUtLjA1LS4wNi0uMDdhLjEyLjEyIDAgMDEwLS4wN2MwLS4wMy4wMi0uMDUuMDYtLjA5TDQ1NC4wNyA1MTJsLTI4Ny43LTI4Ny43Yy0uMDQtLjA0LS4wNS0uMDYtLjA2LS4wOWEuMTIuMTIgMCAwMTAtLjA3YzAtLjAyLjAyLS4wNC4wNi0uMDhsNTcuNy01Ny42OWMuMDMtLjA0LjA1LS4wNS4wNy0uMDZhLjEyLjEyIDAgMDEuMDcgMGMuMDMgMCAuMDUuMDIuMDkuMDZMNTEyIDQ1NC4wN2wyODcuNy0yODcuN2MuMDQtLjA0LjA2LS4wNS4wOS0uMDZhLjEyLjEyIDAgMDEuMDcgMHoiIC8+PC9zdmc+) */ var CloseOutlined_RefIcon = /*#__PURE__*/external_React_.forwardRef(CloseOutlined_CloseOutlined); if (false) {} /* harmony default export */ const icons_CloseOutlined = (CloseOutlined_RefIcon); ;// ./src/investor/components/MifidQuestionnaire/Parts/Overview/InvestAvailabilityIndicator.jsx const InvestAvailabilityIndicator = _ref => { let { type, available } = _ref; const { t } = useTranslation_useTranslation(); let param = null; switch (type) { case 'auto': param = { title: 'mifid.autoInvest', img: 'auto-invest-image' }; break; case 'manual': param = { title: 'mifid.manualInvest', img: 'manual-invest-image' }; break; } switch (available) { case true: param.color = '#4eb829'; param.text = 'available'; break; case false: param.color = 'red'; param.text = 'notAvailable'; break; } const subStyle = { fontSize: '18px', color: param.color, fontWeight: 400 }; return param && /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { className: "mifid-overview-indicators", style: { background: '#fff', width: '100%', padding: '20px' }, vertical: true, gap: 10, align: "center", justify: "center" }, /*#__PURE__*/external_React_default().createElement("div", { style: { width: '80px', height: '80px' } }, /*#__PURE__*/external_React_default().createElement(external_antd_.Image, { preview: false, className: param.img, src: "" })), /*#__PURE__*/external_React_default().createElement("h4", null, t(param.title)), /*#__PURE__*/external_React_default().createElement(external_antd_.Space, { align: "center", style: { ...subStyle } }, available && /*#__PURE__*/external_React_default().createElement(icons_CheckOutlined, { style: subStyle }), !available && /*#__PURE__*/external_React_default().createElement(icons_CloseOutlined, { style: subStyle }), t(param.text))); }; /* harmony default export */ const Overview_InvestAvailabilityIndicator = (InvestAvailabilityIndicator); ;// ./node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js // This icon file is generated automatically. var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" }; /* harmony default export */ const asn_ExclamationCircleOutlined = (ExclamationCircleOutlined); ;// ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) { return /*#__PURE__*/external_React_.createElement(AntdIcon, _extends({}, props, { ref: ref, icon: asn_ExclamationCircleOutlined })); }; /**![exclamation-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUxMiA2NEMyNjQuNiA2NCA2NCAyNjQuNiA2NCA1MTJzMjAwLjYgNDQ4IDQ0OCA0NDggNDQ4LTIwMC42IDQ0OC00NDhTNzU5LjQgNjQgNTEyIDY0em0wIDgyMGMtMjA1LjQgMC0zNzItMTY2LjYtMzcyLTM3MnMxNjYuNi0zNzIgMzcyLTM3MiAzNzIgMTY2LjYgMzcyIDM3Mi0xNjYuNiAzNzItMzcyIDM3MnoiIC8+PHBhdGggZD0iTTQ2NCA2ODhhNDggNDggMCAxMDk2IDAgNDggNDggMCAxMC05NiAwem0yNC0xMTJoNDhjNC40IDAgOC0zLjYgOC04VjI5NmMwLTQuNC0zLjYtOC04LThoLTQ4Yy00LjQgMC04IDMuNi04IDh2MjcyYzAgNC40IDMuNiA4IDggOHoiIC8+PC9zdmc+) */ var ExclamationCircleOutlined_RefIcon = /*#__PURE__*/external_React_.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined); if (false) {} /* harmony default export */ const icons_ExclamationCircleOutlined = (ExclamationCircleOutlined_RefIcon); ;// ./node_modules/@ant-design/icons-svg/es/asn/CheckCircleOutlined.js // This icon file is generated automatically. var CheckCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "check-circle", "theme": "outlined" }; /* harmony default export */ const asn_CheckCircleOutlined = (CheckCircleOutlined); ;// ./node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.js // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY var CheckCircleOutlined_CheckCircleOutlined = function CheckCircleOutlined(props, ref) { return /*#__PURE__*/external_React_.createElement(AntdIcon, _extends({}, props, { ref: ref, icon: asn_CheckCircleOutlined })); }; /**![check-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTY5OSAzNTNoLTQ2LjljLTEwLjIgMC0xOS45IDQuOS0yNS45IDEzLjNMNDY5IDU4NC4zbC03MS4yLTk4LjhjLTYtOC4zLTE1LjYtMTMuMy0yNS45LTEzLjNIMzI1Yy02LjUgMC0xMC4zIDcuNC02LjUgMTIuN2wxMjQuNiAxNzIuOGEzMS44IDMxLjggMCAwMDUxLjcgMGwyMTAuNi0yOTJjMy45LTUuMy4xLTEyLjctNi40LTEyLjd6IiAvPjxwYXRoIGQ9Ik01MTIgNjRDMjY0LjYgNjQgNjQgMjY0LjYgNjQgNTEyczIwMC42IDQ0OCA0NDggNDQ4IDQ0OC0yMDAuNiA0NDgtNDQ4Uzc1OS40IDY0IDUxMiA2NHptMCA4MjBjLTIwNS40IDAtMzcyLTE2Ni42LTM3Mi0zNzJzMTY2LjYtMzcyIDM3Mi0zNzIgMzcyIDE2Ni42IDM3MiAzNzItMTY2LjYgMzcyLTM3MiAzNzJ6IiAvPjwvc3ZnPg==) */ var CheckCircleOutlined_RefIcon = /*#__PURE__*/external_React_.forwardRef(CheckCircleOutlined_CheckCircleOutlined); if (false) {} /* harmony default export */ const icons_CheckCircleOutlined = (CheckCircleOutlined_RefIcon); ;// ./src/viainvest-legacy/Modal/index.js const error = _ref => { let { title, content, onClose, okText, icon = null, titleBody = null, ...props } = _ref; external_antd_.Modal.error({ title: titleBody ? titleBody : /*#__PURE__*/external_React_default().createElement("span", null, /*#__PURE__*/external_React_default().createElement(icons_ExclamationCircleOutlined, { style: { color: 'red', marginRight: '10px', fontSize: '64px' } }), title || 'Error'), content: /*#__PURE__*/external_React_default().createElement("div", null, /*#__PURE__*/external_React_default().createElement("p", null, content)), okText: okText || 'Close', onOk: onClose, centered: true, icon: icon, keyboard: false, ...props }); }; const success = _ref2 => { let { title, content, onClose, okText } = _ref2; external_antd_.Modal.success({ title: /*#__PURE__*/external_React_default().createElement("span", null, /*#__PURE__*/external_React_default().createElement(icons_CheckCircleOutlined, { style: { color: 'green', marginRight: '10px' } }), title || 'Success'), content: /*#__PURE__*/external_React_default().createElement("div", null, /*#__PURE__*/external_React_default().createElement("p", null, content)), okText: okText || 'Close', onOk: onClose, centered: true, icon: null, keyboard: false }); }; const Modal = { error, success }; ;// ./src/investor/components/Modals/ConsentConfirmModal.jsx const ConsentConfirmModal = _ref => { let { consentName, lang } = _ref; const actionConsent = 'consent'; const { data, success } = investor_api_api.useConsent(consentName, lang); const [modalShown, setModalShown] = (0,external_React_.useState)(false); const [submitConsent, updateSubmitConsent] = (0,external_React_.useState)([]); const {} = investor_api_api.useStoreConsent(submitConsent); const submit = (data, actionName) => { updateSubmitConsent([{ lang: lang, data, answers: [], actionName: actionName }]); }; const showConfirm = data => { const consentActionId = Object.values(data.actions).find(action => action.name === actionConsent).id; Modal.error({ okText: data.actions[consentActionId].text, onClose: () => { setModalShown(false); }, onOk() { submit(data, actionConsent); }, className: 'legacy-v1-antd', width: '50%', titleBody: /*#__PURE__*/external_React_default().createElement(external_antd_.Row, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 4 }, /*#__PURE__*/external_React_default().createElement(icons_ExclamationCircleOutlined, { style: { color: 'red', marginRight: '10px', fontSize: '64px' } })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 19 }, data.text)) }); }; (0,external_React_.useEffect)(() => { if (success && data && !modalShown) { showConfirm(data); setModalShown(true); const actionShown = Object.values(data.actions).find(action => action.name === 'shown')?.name; if (actionShown) { submit(data, actionShown); } } }, [success, data]); }; /* harmony default export */ const Modals_ConsentConfirmModal = (ConsentConfirmModal); ;// ./src/investor/components/MifidQuestionnaire/Parts/Overview/OverviewPart.jsx const OverviewPart = _ref => { let { mifidData, showSaveAlert = false, showModal = false } = _ref; const { t } = useTranslation_useTranslation(); const lang = i18n.language; const { setActivePart, groups, questions, setActive } = useQuestionnaireContext(); const containerStyle = { width: '100%', padding: '20px 25px 1px', margin: '0 0' }; const notFirstForm = mifidData?.level && mifidData?.level !== mifidLevel.none; const openForm = () => { if (notFirstForm) { setActivePart(questionnaireParts.summary); } else { const group = groups[0]; const question = Object.values(questions[group.id])[0]; setActive({ group: group, questionData: question }); setActivePart(questionnaireParts.form); } }; const buttonText = notFirstForm ? 'mifid.editAnswers' : 'mifid.completeNow'; const showPortfolioLimit = mifidData?.level && (mifidData?.level === mifidLevel.informed || mifidData?.level === mifidLevel.high); const portfolioLimitText = () => { if (!showPortfolioLimit) { return ''; } let key; switch (mifidData?.portfolio_limit) { case null: key = 'mifid_portfolio_no_limit'; break; case 0: key = 'mifid_portfolio_limit_0'; break; default: key = 'mifid_portfolio_limit'; } return t('mifid.' + key).replace("{limit}", mifidData?.portfolio_limit); }; return mifidData && /*#__PURE__*/external_React_default().createElement("div", { style: containerStyle, className: "mifid-overview" }, showSaveAlert && /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: t('mifid_consent_save_error'), type: "warning", showIcon: true, closable: true }), /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { gap: "large", style: { width: '100%', marginBottom: '15px' } }, /*#__PURE__*/external_React_default().createElement(Overview_InvestAvailabilityIndicator, { type: "auto", available: mifidData?.rules?.can_create_autoinvest_from_scratch }), /*#__PURE__*/external_React_default().createElement(Overview_InvestAvailabilityIndicator, { type: "manual", available: mifidData?.rules?.can_create_manual_invest })), /*#__PURE__*/external_React_default().createElement("p", { style: { margin: '10px 0' } }, t('mifid.resultMifidScore_' + mifidData?.level)), showPortfolioLimit && /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: /*#__PURE__*/external_React_default().createElement("p", null, portfolioLimitText()), type: "warning", style: { marginTop: "12px" } }), /*#__PURE__*/external_React_default().createElement("div", { style: { marginTop: "10px", textAlign: 'center' } }, /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: false, next: t(buttonText), nextAction: openForm })), showModal && mifidData?.showConfirmConsent && /*#__PURE__*/external_React_default().createElement(Modals_ConsentConfirmModal, { consentName: 'mifid_result_' + mifidData?.level, lang: lang })); }; /* harmony default export */ const Overview_OverviewPart = (OverviewPart); ;// ./src/investor/components/MifidQuestionnaire/Parts/Summary/SummaryQuestion.jsx const { Text: SummaryQuestion_Text } = external_antd_.Typography; const SummaryQuestion = _ref => { let { questionData, group } = _ref; const { t } = useTranslation_useTranslation(); const { consents, setActive, setActivePart, answers } = useQuestionnaireContext(); const question = questionData.question; const handleEdit = () => { setActive({ group: group, questionData: questionData }); setActivePart(questionnaireParts.form); }; const subGroupText = () => { const subGroup = consents[group.slug]?.data?.questionGroups[question?.groupId]; if (!subGroup?.parentConsentQuestionGroupId) { return; } return subGroup?.text && /*#__PURE__*/external_React_default().createElement("div", null, /*#__PURE__*/external_React_default().createElement(SummaryQuestion_Text, { strong: true }, subGroup.text)); }; const questionText = () => { return question?.text && /*#__PURE__*/external_React_default().createElement("div", null, /*#__PURE__*/external_React_default().createElement(SummaryQuestion_Text, { strong: true }, question?.text)); }; const answerText = () => { let answer = answers[group.slug][question.groupId][question.id]; return answer && /*#__PURE__*/external_React_default().createElement("div", null, /*#__PURE__*/external_React_default().createElement(SummaryQuestion_Text, { type: "success" }, answer?.value ?? question?.answers[answer?.consentAnswerId]?.text)); }; const subAnswerText = subQuestion => { const answer = answers[group.slug][subQuestion.groupId][subQuestion.id]; return /*#__PURE__*/external_React_default().createElement("div", { key: subQuestion.id }, /*#__PURE__*/external_React_default().createElement(external_antd_.Divider, { dashed: true }), /*#__PURE__*/external_React_default().createElement(SummaryQuestion_Text, { strong: true }, subQuestion?.text), /*#__PURE__*/external_React_default().createElement("br", null), /*#__PURE__*/external_React_default().createElement(SummaryQuestion_Text, { type: "success" }, answer?.value ?? subQuestion?.answers[answer?.consentAnswerId]?.text)); }; const subAnswersTexts = () => { if (!questionData?.subQuestions) { return; } let div = []; Object.values(questionData.subQuestions).forEach(function (subQuestion) { if (answers[group.slug][subQuestion.groupId]) { if (answers[group.slug][subQuestion.groupId][subQuestion.id]) { div = [...div, subAnswerText(subQuestion)]; } } }); return div; }; return /*#__PURE__*/external_React_default().createElement(external_antd_.Card, { style: { marginBottom: '30px' }, className: "summary-group-question" }, subGroupText(), questionText(), answerText(), subAnswersTexts(), /*#__PURE__*/external_React_default().createElement(external_antd_.Button, { style: { position: 'absolute', bottom: '-20px', left: '50%', transform: 'translateX(-50%)' }, onClick: handleEdit }, t('button.edit').toLowerCase())); }; /* harmony default export */ const Summary_SummaryQuestion = (SummaryQuestion); ;// ./src/investor/components/MifidQuestionnaire/Parts/Summary/SummaryGroups.jsx const { Text: SummaryGroups_Text } = external_antd_.Typography; const SummaryGroups = _ref => { let { groups } = _ref; const { questions, answers, consents } = useQuestionnaireContext(); const computeGroupHeader = group => { const consentGroup = consents[group.slug].data.questionGroups[group.id]; const groupQuestions = Object.keys(questions[group.id]).length; let groupAnswers = 0; Object.values(questions[group.id]).forEach(function (question) { if (answers[group.slug][question.question.groupId][question.question.id]) { groupAnswers++; } }); const counter = groupAnswers + ' of ' + groupQuestions + ' done'; return /*#__PURE__*/external_React_default().createElement("div", { className: "summary-group" }, /*#__PURE__*/external_React_default().createElement(SummaryGroups_Text, { strong: true }, /*#__PURE__*/external_React_default().createElement("h4", null, consentGroup?.text)), /*#__PURE__*/external_React_default().createElement(SummaryGroups_Text, { strong: true, type: "success" }, counter)); }; const computeGroups = () => { const items = groups.map(function (group) { return { key: group.name, label: computeGroupHeader(group), children: computeGroupQuestions(group) }; }); return /*#__PURE__*/external_React_default().createElement(external_antd_.Collapse, { accordion: true, bordered: false, items: items, expandIconPosition: 'end', style: { backgroundColor: '#ffffff' } }); }; const computeGroupQuestions = group => { return /*#__PURE__*/external_React_default().createElement(external_antd_.List, { dataSource: Object.values(questions[group.id]), renderItem: item => /*#__PURE__*/external_React_default().createElement(Summary_SummaryQuestion, { questionData: item, group: group }) }); }; return computeGroups(); }; /* harmony default export */ const Summary_SummaryGroups = (SummaryGroups); ;// ./src/investor/components/MifidQuestionnaire/Parts/ProgressBar/ProgressBar.jsx const ProgressBar = _ref => { let { title, percent } = _ref; return /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { vertical: true, style: { width: '100%' } }, /*#__PURE__*/external_React_default().createElement("h5", { style: { margin: 0 } }, title), /*#__PURE__*/external_React_default().createElement(external_antd_.Progress, { percent: percent, type: "line", showInfo: false, size: "small" })); }; /* harmony default export */ const ProgressBar_ProgressBar = (ProgressBar); ;// ./src/investor/components/MifidQuestionnaire/Parts/ProgressBar/GroupWizard.jsx const GroupWizard = () => { const { questions, groups, answers } = useQuestionnaireContext(); const computeBars = () => { let render = []; Object.values(groups).forEach(function (group) { const groupQuestions = Object.keys(questions[group.id]).length; let groupAnswers = 0; Object.values(questions[group.id]).forEach(function (question) { if (answers[group.slug][question.question.groupId] && answers[group.slug][question.question.groupId][question.question.id]) { groupAnswers++; } }); const percent = groupAnswers / groupQuestions * 100; render.push(/*#__PURE__*/React.createElement(ProgressBar_ProgressBar, { key: group.id, title: group?.title, percent: percent })); }); return render; }; return /*#__PURE__*/React.createElement(external_antd_.Flex, { align: "center", gap: "large", style: { width: '100%' } }, computeBars()); }; /* harmony default export */ const ProgressBar_GroupWizard = (GroupWizard); ;// ./src/investor/components/MifidQuestionnaire/Parts/Summary/SummaryPart.jsx const SummaryPart = () => { const { t } = useTranslation_useTranslation(); const lang = i18n.language; const { groups, setActivePart, answers, consents } = useQuestionnaireContext(); const [consentObjects, updateConsentObjects] = (0,external_React_.useState)([]); const { loading, statusCode, success } = investor_api_api.useStoreConsent(consentObjects); const submit = () => { const objects = []; Object.values(consents).forEach(function (consent) { objects.push({ lang: lang, data: consent.data, answers: flatten(answers[consent.slug]), actionName: consentAction.save }); }); updateConsentObjects(objects); }; (0,external_React_.useEffect)(() => { if (success) { setActivePart(questionnaireParts.resultsLoading); } }, [success]); const showError = statusCode && consentObjects.length > 0; return /*#__PURE__*/external_React_default().createElement("div", { className: "mifid-summary" }, /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { vertical: true, style: { minHeight: '10vh' }, gap: "small" }, /*#__PURE__*/external_React_default().createElement(ProgressBar_GroupWizard, null), showError && /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: t('serviceError'), type: "error", showIcon: true }), /*#__PURE__*/external_React_default().createElement("div", { style: { width: '80%', padding: '20px 0', margin: '0 auto' } }, /*#__PURE__*/external_React_default().createElement("h3", null, t('summary.title').toUpperCase()), /*#__PURE__*/external_React_default().createElement("p", null, t('summary.description')), /*#__PURE__*/external_React_default().createElement(Summary_SummaryGroups, { groups: groups }), /*#__PURE__*/external_React_default().createElement("div", { style: { position: 'absolute', marginTop: '10px', left: '50%', transform: 'translateX(-50%)' } }, /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: loading, next: t('button.submit'), nextAction: submit }))))); }; /* harmony default export */ const Summary_SummaryPart = (SummaryPart); ;// ./src/investor/components/Inputs/Questionnaire/SelectQuestion.jsx const SelectQuestion = _ref => { let { question, callback, answer = null, selectText = 'Select', disabled = false } = _ref; const options = () => { return Object.values(question.answers).map(answer => ({ key: answer.id, label: answer.text, value: answer.id })); }; const onChange = (value, option) => { callback({ consentAnswerId: value, value: option.label }, question); }; return /*#__PURE__*/React.createElement(external_antd_.Select, { placeholder: selectText, options: options(), optionFilterProp: "label", value: answer?.consentAnswerId, onChange: onChange, style: { width: '100%' }, disabled: disabled }); }; /* harmony default export */ const Questionnaire_SelectQuestion = (SelectQuestion); ;// ./src/investor/components/Inputs/Questionnaire/TextQuestion.jsx const TextQuestion = _ref => { let { question, callback, answer = null, disabled = false } = _ref; const onChange = e => { callback({ consentAnswerId: null, value: e.target.value }, question); }; return /*#__PURE__*/external_React_default().createElement(external_antd_.Input, { value: answer?.value, onChange: onChange, style: { width: '100%' }, disabled: disabled }); }; /* harmony default export */ const Questionnaire_TextQuestion = (TextQuestion); ;// ./src/investor/components/Inputs/Questionnaire/RadioQuestion.jsx const RadioQuestion = _ref => { let { question, callback, answer = null } = _ref; const options = () => { return Object.values(question.answers).map(answer => ({ key: answer.id, label: answer.text, value: answer.id })); }; const onChange = e => { const answerId = e.target.value; callback({ consentAnswerId: answerId, value: question.answers[answerId]?.text }, question); }; return /*#__PURE__*/React.createElement(external_antd_.Radio.Group, { onChange: onChange, value: answer?.consentAnswerId, style: { width: '100%' } }, /*#__PURE__*/React.createElement(external_antd_.Space, { direction: "vertical" }, options().map(option => /*#__PURE__*/React.createElement(external_antd_.Radio, { key: option.key, value: option.value }, option.label)))); }; /* harmony default export */ const Questionnaire_RadioQuestion = (RadioQuestion); ;// ./src/investor/components/MifidQuestionnaire/Parts/Form/QuestionPart.jsx const { Text: QuestionPart_Text } = external_antd_.Typography; const QuestionPart = _ref => { let { form } = _ref; const { t } = useTranslation_useTranslation(); const { active, answers, setAnswers, questions, consents } = useQuestionnaireContext(); const question = active.questionData?.question; const callback = (answer, question) => { form.setFieldsValue({ [question.name]: answer.value }); if (!answers[active.group.slug]) { answers[active.group.slug] = []; } if (!answers[active.group.slug][question.groupId]) { answers[active.group.slug][question.groupId] = []; } answers[active.group.slug][question.groupId][question.id] = answer; if (questions[active.group.id][question.id]?.subQuestions) { Object.values(questions[active.group.id][question.id].subQuestions).forEach(function (subQuestion) { if (answers[active.group.slug][subQuestion.groupId] && answers[active.group.slug][subQuestion.groupId][subQuestion.id]) { form.setFieldsValue({ [subQuestion.name]: null }); delete answers[active.group.slug][subQuestion.groupId][subQuestion.id]; } }); } setAnswers(answers); }; let answer = answers[active.group.slug][question.groupId] ? answers[active.group.slug][question.groupId][question.id] ?? null : null; const subGroupText = () => { const subGroup = consents[active.group.slug]?.data?.questionGroups[question?.groupId]; if (!subGroup?.parentConsentQuestionGroupId) { return; } return subGroup?.text && /*#__PURE__*/React.createElement(QuestionPart_Text, { strong: true }, /*#__PURE__*/React.createElement("h5", null, subGroup.text)); }; const rules = [{ required: true, message: t('rule.answerRequired') }]; const renderQuestion = function (question, answer) { let disableQuestion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (form && answer) { form.setFieldsValue({ [question.name]: answer.value }); } switch (question.type) { case 'radio': return /*#__PURE__*/React.createElement(external_antd_.Form.Item, { key: question.id, rules: rules, name: question?.name, label: question?.text }, /*#__PURE__*/React.createElement(Questionnaire_RadioQuestion, { question: question, callback: callback, answer: answer })); case 'list': return /*#__PURE__*/React.createElement(external_antd_.Form.Item, { key: question.id, rules: rules, name: question?.name, label: question?.text }, /*#__PURE__*/React.createElement(Questionnaire_SelectQuestion, { question: question, callback: callback, answer: answer, disabled: disableQuestion })); case 'text': return /*#__PURE__*/React.createElement(external_antd_.Form.Item, { key: question.id, rules: rules, name: question?.name, label: question?.text }, /*#__PURE__*/React.createElement(Questionnaire_TextQuestion, { question: question, callback: callback, answer: answer, disabled: disableQuestion })); default: return /*#__PURE__*/React.createElement(React.Fragment, null); } }; const changeSubAnswerToFirst = subQuestion => { const subAnswer = Object.values(subQuestion.answers)[0] ?? null; if (subAnswer) { const answer = { consentAnswerId: subAnswer.id, value: subAnswer.text }; if (answers[active.group.slug][subQuestion.groupId][subQuestion.id]?.consentAnswerId !== subAnswer.id) { callback(answer, subQuestion); } } }; const renderSubQuestions = () => { let questions = []; if (active.questionData?.subQuestions) { Object.values(active.questionData.subQuestions).forEach(function (subQuestion) { if (subQuestion.dependsOnQuestionAnswer === null || subQuestion.dependsOnQuestionAnswer === answer?.consentAnswerId || subQuestion?.dependsOnType === 'hide') { let disableQuestion = subQuestion.dependsOnQuestionAnswer === answer?.consentAnswerId && subQuestion?.dependsOnType === 'hide'; if (disableQuestion) { changeSubAnswerToFirst(subQuestion); } let subAnswer = null; if (answers[active.group.slug][subQuestion.groupId]) { subAnswer = answers[active.group.slug][subQuestion.groupId][subQuestion.id]; } questions = [...questions, renderQuestion(subQuestion, subAnswer, disableQuestion)]; } }); } return questions; }; return /*#__PURE__*/React.createElement(external_antd_.Flex, { vertical: true, gap: "small", className: "mifid-form-question-part" }, subGroupText(), renderQuestion(question, answer), renderSubQuestions()); }; /* harmony default export */ const Form_QuestionPart = (QuestionPart); ;// ./src/investor/components/MifidQuestionnaire/Parts/Form/HintPart.jsx const HintPart = () => { const { consents, active, answers, action, setAction } = useQuestionnaireContext(); const renderWarnings = warnings => { if (!warnings) { return; } const newDepActions = []; const render = warnings.map(function (warning) { const question = consents[active.group.slug].data.questions[warning.dependsOnQuestion]; const answer = answers[active.group.slug][question.groupId][question.id]; if (warning.dependsOnAnswers.includes(answer?.consentAnswerId) || warning.dependsOnAnswers.includes(answer?.value)) { if (warning?.dependsOnActions && !action?.triggered) { newDepActions.push(...warning.dependsOnActions); return; } if (warning?.dependsOnActions && action?.triggered && !warning.dependsOnActions.includes(action?.triggered)) { return; } const severity = warning.severity === 'alert' ? 'error' : warning.severity; return /*#__PURE__*/React.createElement(external_antd_.Alert, { key: Math.random(), message: renderBody(warning.body), type: severity, style: { marginBottom: '10px' } }); } }); if (JSON.stringify(newDepActions) !== JSON.stringify(dependsOnActions)) { updateDependsOnActions(newDepActions); } return render; }; const renderAccordion = accordion => { if (!accordion) { return; } const items = accordion.map(function (item) { return { key: Math.random(), label: item.title, children: renderBody(item.body) }; }); return /*#__PURE__*/React.createElement(external_antd_.Collapse, { accordion: true, ghost: true, items: items }); }; const renderBody = body => { return Object.values(body).map(function (p, index) { return /*#__PURE__*/React.createElement("p", { key: index }, p); }); }; const renderPart = hintJson => { return /*#__PURE__*/React.createElement("div", null, renderWarnings(hintJson?.warnings), hintJson.title && /*#__PURE__*/React.createElement("h3", { className: 'questionnaire-hint-title' }, " ", hintJson.title, " "), hintJson.body && renderBody(hintJson.body), renderAccordion(hintJson.accordion)); }; const [hintJson, updateHint] = (0,external_React_.useState)(null); const [dependsOnActions, updateDependsOnActions] = (0,external_React_.useState)(null); (0,external_React_.useEffect)(() => { updateHint(active.questionData.question?.hintJson); }, [active.questionData]); (0,external_React_.useEffect)(() => { if (JSON.stringify(action.dependsOnActions) !== JSON.stringify(dependsOnActions)) { action.dependsOnActions = dependsOnActions; setAction(action); } }, [dependsOnActions]); return hintJson && renderPart(hintJson); }; /* harmony default export */ const Form_HintPart = (HintPart); ;// ./src/investor/components/MifidQuestionnaire/Parts/Form/FormPart.jsx const FormPart = _ref => { let { isUpdate } = _ref; const { t } = useTranslation_useTranslation(); const { questions, active, setActivePart, action, setAction, setActive, groups, activePart } = useQuestionnaireContext(); const [form] = external_antd_.Form.useForm(); const handle = function (nextActivePart) { let newActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (!action.triggered && action.dependsOnActions?.length) { action.triggered = consentAction.save; setAction(action); return; } if (activePart !== nextActivePart) { setActivePart(nextActivePart); } setAction({ triggered: null, dependsOnActions: null }); if (newActive) { setActive(newActive); } }; const updateAction = () => { handle(questionnaireParts.summary); }; const getNextQuestion = function (data, currentKey) { let i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; const keys = Object.keys(data); const currentIndex = keys.indexOf(currentKey); const nextIndex = currentIndex + i; // wrap around using modulo operator const newActive = Object.create(active); if (nextIndex >= keys.length) { const groupIndex = groups.findIndex(function (group) { return group.id === active.group.id; }) + 1; if (groupIndex >= groups.length) { return null; } newActive.group = groups[groupIndex]; const key = Object.keys(questions[newActive.group.id])[0]; newActive.questionData = questions[newActive.group.id][key]; return newActive; } if (nextIndex < 0) { const groupIndex = groups.findIndex(function (group) { return group.id === active.group.id; }) - 1; if (groupIndex < 0) { return null; } newActive.group = groups[groupIndex]; const keys = Object.keys(questions[newActive.group.id]); newActive.questionData = questions[newActive.group.id][keys[keys.length - 1]]; return newActive; } const key = Object.keys(questions[active.group.id])[nextIndex]; newActive.group = active.group; newActive.questionData = questions[active.group.id][key]; return newActive; }; const nextAction = () => { const temp = getNextQuestion(questions[active.group.id], active.questionData.question.id); if (temp) { handle(questionnaireParts.form, temp); } else { handle(questionnaireParts.summary); } }; const backAction = () => { const temp = getNextQuestion(questions[active.group.id], active.questionData.question.id, -1); if (temp) { handle(questionnaireParts.form, temp); } }; const showBackButton = () => { const groupIndex = groups.findIndex(function (group) { return group.id === active.group.id; }); const questionIndex = Object.keys(questions[active.group.id]).indexOf(active.questionData.question.id); return groupIndex + questionIndex > 0; }; const submit = () => { if (isUpdate) { updateAction(); } else { nextAction(); } }; const nextButtonText = isUpdate ? t('button.update') : t('button.next'); const backButtonText = !isUpdate && showBackButton() ? t('button.back') : null; return /*#__PURE__*/external_React_default().createElement("div", { className: "mifid-form" }, /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { vertical: true, style: { minHeight: '10vh' }, gap: "small" }, /*#__PURE__*/external_React_default().createElement(ProgressBar_GroupWizard, null), /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { gap: "small" }, /*#__PURE__*/external_React_default().createElement(external_antd_.Card, { style: { width: '50%' } }, /*#__PURE__*/external_React_default().createElement(external_antd_.Form, { form: form, onFinish: submit, layout: "vertical", autoComplete: "off" }, /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { vertical: true }, /*#__PURE__*/external_React_default().createElement(Form_QuestionPart, { form: form }), /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: false, next: nextButtonText, nextAction: form.submit, back: backButtonText, backAction: backAction })))), /*#__PURE__*/external_React_default().createElement(external_antd_.Card, { bordered: false, className: 'questionnaire-hint' }, /*#__PURE__*/external_React_default().createElement(Form_HintPart, null))))); }; /* harmony default export */ const Form_FormPart = (FormPart); ;// ./src/investor/components/MifidQuestionnaire/Parts/ResultLoading/ResultLoadingPart.jsx const ResultLoadingPart = () => { const attemptsAmount = 5; const { setActivePart } = useQuestionnaireContext(); const [attempts, updateAttempts] = (0,external_React_.useState)(0); const { data: mifidRules, loading, getMfidRules } = investor_api_api.useMifidRules(); const update = () => { if (!loading && attempts < attemptsAmount) { updateAttempts(attempts + 1); getMfidRules(); } }; (0,external_React_.useEffect)(() => { if (mifidRules?.showConfirmConsent) { setActivePart(questionnaireParts.results); return; } if (attempts >= attemptsAmount) { setActivePart(questionnaireParts.overviewShowAlert); return; } const intervalId = setInterval(update, 2000); // 2 second return () => clearInterval(intervalId); }, [attempts, mifidRules, attemptsAmount]); return /*#__PURE__*/React.createElement(external_antd_.Flex, { className: "mifid-result-loading", align: "center", justify: "center" }, /*#__PURE__*/React.createElement(external_antd_.Spin, { tip: "Processing results..." })); }; /* harmony default export */ const ResultLoading_ResultLoadingPart = (ResultLoadingPart); ;// ./src/investor/components/MifidQuestionnaire/MifidQuestionnaire.jsx const MifidQuestionnaire = () => { const { t } = useTranslation_useTranslation(); const lang = i18n.language; const { consents: consentsData, activePart, setConsents, setGroups, setActivePart } = useQuestionnaireContext(); const { data: mifidRules, loading: mifidLoading, success: mifidLoaded, getMfidRules } = investor_api_api.useMifidRules(); const [notFirstForm, updateNotFirstForm] = (0,external_React_.useState)(null); const [resultsSubmitted, updateResultsSubmitted] = (0,external_React_.useState)(false); const { data: kycConsent, loading: kycLoading, success: kycLoaded } = investor_api_api.useConsent(consents.kyc, lang, true); const { data: appropriatenessConsent, loading: appropriatenessLoading, success: appropriatenessLoaded } = investor_api_api.useConsent(consents.appropriateness, lang, true); const loadingAnimation = () => { return /*#__PURE__*/external_React_default().createElement("div", { style: { textAlign: 'center', padding: '20px' } }, /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, { size: "large" })); }; const showFreshMifid = () => { if (!mifidLoading) { getMfidRules(); } updateResultsSubmitted(true); setActivePart(questionnaireParts.overview); }; const questionnairePart = () => { if (kycLoading || appropriatenessLoading || mifidLoading) { return loadingAnimation(); } if (!kycLoaded || !appropriatenessLoaded || !mifidLoaded) { return /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: t('serviceError'), type: "error", showIcon: true }); } switch (activePart) { case questionnaireParts.overview: return /*#__PURE__*/external_React_default().createElement(Overview_OverviewPart, { mifidData: mifidRules, showModal: resultsSubmitted }); case questionnaireParts.overviewShowAlert: return /*#__PURE__*/external_React_default().createElement(Overview_OverviewPart, { mifidData: mifidRules, showSaveAlert: true }); case questionnaireParts.summary: return /*#__PURE__*/external_React_default().createElement(Summary_SummaryPart, null); case questionnaireParts.form: return /*#__PURE__*/external_React_default().createElement(Form_FormPart, { isUpdate: notFirstForm }); case questionnaireParts.results: showFreshMifid(); return loadingAnimation(); case questionnaireParts.resultsLoading: return /*#__PURE__*/external_React_default().createElement(ResultLoading_ResultLoadingPart, null); } }; (0,external_React_.useEffect)(() => { if (!consentsData && kycConsent && appropriatenessConsent) { setConsents({ [consents.kyc]: { slug: consents.kyc, data: kycConsent }, [consents.appropriateness]: { slug: consents.appropriateness, data: appropriatenessConsent } }); } if (consentsData) { setGroups([{ name: 'financial_situation', slug: consents.kyc }, { name: 'assessment_of_experience_and_knowledge', slug: consents.appropriateness }, { name: 'investment_objectives', slug: consents.appropriateness }]); } }, [consentsData, kycConsent, appropriatenessConsent]); (0,external_React_.useEffect)(() => { if (!notFirstForm) { updateNotFirstForm(mifidRules?.level && mifidRules?.level !== mifidLevel.none); } if (activePart === questionnaireParts.summary) { updateNotFirstForm(true); } }, [mifidRules, activePart]); return questionnairePart(); }; /* harmony default export */ const MifidQuestionnaire_MifidQuestionnaire = (MifidQuestionnaire); ;// ./src/investor/pages/MifidQuestionnairePage.jsx const MifidQuestionnairePage = () => { return /*#__PURE__*/React.createElement(QuestionnaireContextProvider, null, /*#__PURE__*/React.createElement(MifidQuestionnaire_MifidQuestionnaire, null)); }; /* harmony default export */ const pages_MifidQuestionnairePage = (MifidQuestionnairePage); ;// ./src/components/Buttons/SubmitBottonFormItem.jsx function SubmitBottonFormItem_extends() { return SubmitBottonFormItem_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, SubmitBottonFormItem_extends.apply(null, arguments); } const SubmitButtonFormItem = _ref => { let { disabled, formClassName = '', ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(external_antd_.Form.Item, { className: formClassName }, /*#__PURE__*/external_React_default().createElement(external_antd_.Button, SubmitBottonFormItem_extends({ type: "primary", htmlType: "submit", disabled: disabled || false }, props), t("Submit"))); }; /* harmony default export */ const SubmitBottonFormItem = (SubmitButtonFormItem); ;// ./src/components/Password/PasswordChangeForm.jsx function PasswordChangeForm_extends() { return PasswordChangeForm_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, PasswordChangeForm_extends.apply(null, arguments); } const PasswordChangeForm = _ref => { let { onSubmit, ...props } = _ref; const formLayout = 'vertical'; const { t } = useTranslation_useTranslation(); const [form] = external_antd_.Form.useForm(); const [state, updateState] = (0,external_React_.useState)({ submitDisabled: true }); const handleSubmit = values => { onSubmit?.(values); }; const handleValuesChange = (changedValues, allValues) => { const { password, confirmPassword } = allValues; updateState(prev => ({ ...prev, submitDisabled: !(password && confirmPassword && password === confirmPassword) })); }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Form, PasswordChangeForm_extends({ form: form, layout: formLayout, onFinish: handleSubmit, onValuesChange: handleValuesChange }, props), /*#__PURE__*/external_React_default().createElement(FormItems.PasswordInput, { name: "password", label: t('password.changeLabel'), className: "reg-item", rules: [{ required: true, message: t('rule.required') }] }), /*#__PURE__*/external_React_default().createElement(FormItems.PasswordInput, { name: "confirmPassword", label: t('password.confirmLabel'), dependencies: ['password'], className: "reg-item", rules: [{ required: true, message: t('rule.required') }, _ref2 => { let { getFieldValue } = _ref2; return { validator(_, value) { if (!value || getFieldValue('password') === value) { return Promise.resolve(); } return Promise.reject(new Error(t('password.rule.notMatch'))); } }; }] }), /*#__PURE__*/external_React_default().createElement(FormItems.SubmitButton, { disabled: state.submitDisabled, formClassName: 'text-align-center' }))); }; /* harmony default export */ const Password_PasswordChangeForm = (PasswordChangeForm); ;// ./src/components/User/UsernameChangeForm.jsx function UsernameChangeForm_extends() { return UsernameChangeForm_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, UsernameChangeForm_extends.apply(null, arguments); } const UsernameChangeForm = _ref => { let { onSubmit, ...props } = _ref; const formLayout = 'vertical'; const { t } = useTranslation_useTranslation(); const [form] = external_antd_.Form.useForm(); const [state, updateState] = (0,external_React_.useState)({ submitDisabled: true }); const { data: statusData, getStatus, loading } = hooks_useStatus({}); (0,external_React_.useEffect)(() => { getStatus(); }, []); const handleSubmit = values => { onSubmit?.(values); }; const handleValuesChange = (changedValues, allValues) => { const { username } = allValues; updateState(prev => ({ ...prev, submitDisabled: !username })); }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Form, UsernameChangeForm_extends({ form: form, layout: formLayout, onFinish: handleSubmit, onValuesChange: handleValuesChange }, props), loading ? '' : /*#__PURE__*/external_React_default().createElement(FormItems.EmailInput, { disabled: true, required: false, label: t('form.currentEmail'), className: "reg-item", initialValue: statusData?.email }), /*#__PURE__*/external_React_default().createElement(FormItems.EmailInput, { name: "username", label: props?.username?.label || t('form.newEmail'), required: true, className: "reg-item" }), /*#__PURE__*/external_React_default().createElement(FormItems.SubmitButton, { disabled: state.submitDisabled, formClassName: 'text-align-center' }))); }; /* harmony default export */ const User_UsernameChangeForm = (UsernameChangeForm); ;// ./src/components/Validators/ConfirmPasswordRule.js // PasswordValidationRule.js const confirmPasswordRule = _ref => { let { getFieldValue, fieldName } = _ref; return { validator(_, value) { if (!value || getFieldValue(fieldName) === value) { return Promise.resolve(); } return Promise.reject(new Error('The two passwords that you entered do not match!')); } }; }; ;// ./src/components/Validators/index.js const FormItemValidators = { confirmPasswordRule: confirmPasswordRule }; ;// ./src/components/index.js const FormItems = { EmailInput: Email_EmailFormItem, PasswordInput: Password_PasswordFormItem, SubmitButton: SubmitBottonFormItem, Validators: FormItemValidators }; const Forms = { PasswordChangeForm: Password_PasswordChangeForm, UsernameChangeForm: User_UsernameChangeForm }; /* harmony default export */ const components = ({ FormItems, Forms }); ;// ./src/viainvest-legacy/Accounts/PasswordRecovery/ForgotPasswordRequestForm.jsx function ForgotPasswordRequestForm_extends() { return ForgotPasswordRequestForm_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, ForgotPasswordRequestForm_extends.apply(null, arguments); } const ForgotPasswordRequestForm = _ref => { let { onSubmit, ...props } = _ref; const formLayout = 'vertical'; const [form] = external_antd_.Form.useForm(); const { t } = useTranslation_useTranslation(); const handleSubmit = values => { onSubmit?.(values); }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Form, ForgotPasswordRequestForm_extends({ form: form, layout: formLayout, onFinish: handleSubmit }, props), /*#__PURE__*/external_React_default().createElement(FormItems.EmailInput, { label: t('form.your-email') }), /*#__PURE__*/external_React_default().createElement(FormItems.SubmitButton, null))); }; /* harmony default export */ const PasswordRecovery_ForgotPasswordRequestForm = (ForgotPasswordRequestForm); ;// ./src/api/invest/Accounts/PasswordRecovery/index.js const createPasswordRecoveryRequest = (username, onSuccess, onError) => ({ method: 'POST', url: `/api/v1/vendors/viainvest/accounts/password-recovery/`, payload: { username: username }, onSuccess, onError }); const getPasswordRecoveryRequest = (linkRef, onSuccess, onError) => ({ method: 'GET', url: `/api/v1/vendors/viainvest/accounts/password-recovery/${linkRef}`, onSuccess, onError }); const updatePasswordRequest = (linkRef, newPassword, onSuccess, onError) => ({ method: 'PATCH', url: `/api/v1/vendors/viainvest/accounts/password-recovery/${linkRef}`, payload: { password: newPassword }, onSuccess, onError }); /* harmony default export */ const PasswordRecovery = ({ createPasswordRecoveryRequest, getPasswordRecoveryRequest, updatePasswordRequest }); ;// ./src/api/invest/Accounts/Account/index.js const updatePassword = (password, onSuccess, onError) => ({ method: 'PATCH', url: `/api/v1/vendors/viainvest/accounts`, payload: { password: password }, onSuccess, onError }); const updateUsername = (username, onSuccess, onError) => ({ method: 'PATCH', url: `/api/v1/vendors/viainvest/accounts`, payload: { "username": username, "type": "email" }, onSuccess, onError }); /* harmony default export */ const Account = ({ updatePassword, updateUsername }); ;// ./src/api/invest/Accounts/index.js /* harmony default export */ const Accounts = ({ PasswordRecovery: PasswordRecovery, Account: Account }); ;// ./src/api/invest/handlers/requestHandler.js const requestHandler = async request => { const { method, url, payload, onSuccess, onError } = request; try { const response = await lib_axios({ method, url, data: payload }); if (onSuccess) onSuccess(response.data); } catch (error) { if (onError) onError(error); } }; /* harmony default export */ const handlers_requestHandler = (requestHandler); ;// ./src/api/invest/index.js /* harmony default export */ const invest = ({ requestHandler: handlers_requestHandler, Accounts: Accounts }); ;// ./src/viainvest-legacy/Accounts/PasswordRecovery/ForgotPasswordRequestFormInline.jsx const ForgotPasswordRequestFormInline = () => { const [loading, setLoading] = (0,external_React_.useState)(false); const { t } = useTranslation_useTranslation(); const handleSuccess = () => { Modal.success({ title: t('passwordRecovery.title'), content: t('passwordRecovery.requestSuccess'), okText: t('button.close'), onClose: () => { window.location = '/users/login'; } }); }; const handleError = error => { Modal.error({ title: t('passwordRecovery.title'), content: t('errors.retryText'), okText: t('button.close') }); }; const handleSubmit = values => { setLoading(true); invest.requestHandler(invest.Accounts.PasswordRecovery.createPasswordRecoveryRequest(values.email, handleSuccess, handleError)); }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, { spinning: loading }, /*#__PURE__*/external_React_default().createElement(PasswordRecovery_ForgotPasswordRequestForm, { onSubmit: handleSubmit }))); }; /* harmony default export */ const PasswordRecovery_ForgotPasswordRequestFormInline = (ForgotPasswordRequestFormInline); ;// ./src/viainvest-legacy/Accounts/PasswordRecovery/ForgotPasswordChangeFormInline.jsx const ForgotPasswordChangeFormInline = _ref => { let { linkref, ...props } = _ref; const [state, updateState] = (0,external_React_.useState)({ loading: true }); const { t } = useTranslation_useTranslation(); const handleSuccess = () => { Modal.success({ title: t('password.changeTitle'), content: t('password.changeSuccess'), okText: t('button.close'), onClose: () => { window.location = '/users/login'; } }); }; const handleError = error => { Modal.error({ title: t('password.changeTitle'), content: t('errors.retryText'), okText: t('button.close'), onClose: () => { updateState(prev => ({ ...prev, loading: false })); } }); }; (0,external_React_.useEffect)(() => { invest.requestHandler(invest.Accounts.PasswordRecovery.getPasswordRecoveryRequest(linkref, () => updateState(prev => ({ ...prev, loading: false })), () => window.location.href = '/users/wrong-resource')); }, [linkref]); const handleSubmit = values => { updateState(prev => ({ ...prev, loading: true })); invest.requestHandler(invest.Accounts.PasswordRecovery.updatePasswordRequest(linkref, values.password, handleSuccess, handleError)); }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, { spinning: state.loading }, /*#__PURE__*/external_React_default().createElement(Forms.PasswordChangeForm, { onSubmit: handleSubmit }))); }; /* harmony default export */ const PasswordRecovery_ForgotPasswordChangeFormInline = (ForgotPasswordChangeFormInline); ;// ./src/viainvest-legacy/Accounts/PasswordRecovery/index.js /* harmony default export */ const Accounts_PasswordRecovery = ({ ForgotPasswordRequestFormInline: PasswordRecovery_ForgotPasswordRequestFormInline, ForgotPasswordChangeFormInline: PasswordRecovery_ForgotPasswordChangeFormInline }); ;// ./src/viainvest-legacy/Accounts/PasswordChange/PasswordChangeFormInline.jsx const PasswordChangeFormInline = _ref => { let { onSubmit, ...props } = _ref; const [state, updateState] = (0,external_React_.useState)({ loading: false }); const { t } = useTranslation_useTranslation(); const handleApiSuccess = () => { updateState(prev => ({ ...prev, loading: false })); Modal.success({ title: t('password.changeTitle'), content: t('password.changeSuccess'), okText: t('button.close'), onClose: () => { onSubmit?.(); } }); }; const handleApiError = error => { Modal.error({ title: t('password.changeTitle'), content: t('errors.retryText'), okText: t('button.close'), onClose: () => { updateState(prev => ({ ...prev, loading: false })); } }); }; const handleFormSubmit = values => { updateState(prev => ({ ...prev, loading: true })); invest.requestHandler(invest.Accounts.Account.updatePassword(values.password, handleApiSuccess, handleApiError)); }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, { spinning: state.loading }, /*#__PURE__*/external_React_default().createElement(Forms.PasswordChangeForm, { onSubmit: handleFormSubmit, className: 'legacy-v1-antd' }))); }; /* harmony default export */ const PasswordChange_PasswordChangeFormInline = (PasswordChangeFormInline); ;// ./src/viainvest-legacy/Accounts/PasswordChange/PasswordChangeFormModalButton.jsx function PasswordChangeFormModalButton_extends() { return PasswordChangeFormModalButton_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, PasswordChangeFormModalButton_extends.apply(null, arguments); } const showPasswordChangeFormModal = () => { const handleOnSubmit = modalInstance => { modalInstance?.destroy(); }; const modal = external_antd_.Modal.success({ title: 'Change Password', closable: true, icon: null, content: /*#__PURE__*/external_React_default().createElement(PasswordChange_PasswordChangeFormInline, { onSubmit: () => { handleOnSubmit(modal); } }), okButtonProps: { style: { display: 'none' } } // Hide the default OK button }); }; const PasswordChangeFormModalButton = _ref => { let { ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(external_antd_.Button, PasswordChangeFormModalButton_extends({ type: "default", onClick: () => showPasswordChangeFormModal() }, props, { shape: "round", size: 'large' }), t('button.change_password')); }; /* harmony default export */ const PasswordChange_PasswordChangeFormModalButton = (PasswordChangeFormModalButton); ;// ./src/viainvest-legacy/Accounts/PasswordChange/index.js /* harmony default export */ const PasswordChange = ({ PasswordChangeFormInline: PasswordChange_PasswordChangeFormInline, PasswordChangeFormModalButton: PasswordChange_PasswordChangeFormModalButton, showPasswordChangeFormModal: showPasswordChangeFormModal }); ;// ./src/viainvest-legacy/Accounts/UsernameChange/UsernameChangeFormInline.jsx const UsernameChangeFormInline = _ref => { let { onSubmit, ...props } = _ref; const [state, updateState] = (0,external_React_.useState)({ loading: false }); const { t } = useTranslation_useTranslation(); const handleApiSuccess = () => { updateState(prev => ({ ...prev, loading: false })); Modal.success({ title: t('username.changeTitle'), content: t('username.changeSuccess'), okText: t('button.close'), onClose: () => { onSubmit?.(); } }); }; const handleApiError = error => { Modal.error({ title: t('username.changeTitle'), content: t('errors.retryText'), okText: t('button.close'), onClose: () => { updateState(prev => ({ ...prev, loading: false })); } }); }; const handleFormSubmit = values => { updateState(prev => ({ ...prev, loading: true })); invest.requestHandler(invest.Accounts.Account.updateUsername(values.username, handleApiSuccess, handleApiError)); }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, { spinning: state.loading }, /*#__PURE__*/external_React_default().createElement(Forms.UsernameChangeForm, { onSubmit: handleFormSubmit, className: 'legacy-v1-antd' }))); }; /* harmony default export */ const UsernameChange_UsernameChangeFormInline = (UsernameChangeFormInline); ;// ./src/viainvest-legacy/Accounts/UsernameChange/UsernameChangeFormModalButton.jsx function UsernameChangeFormModalButton_extends() { return UsernameChangeFormModalButton_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, UsernameChangeFormModalButton_extends.apply(null, arguments); } const showUsernameChangeFormModal = () => { const handleOnSubmit = modalInstance => { modalInstance?.destroy(); }; const modal = external_antd_.Modal.success({ title: 'Change email', closable: true, icon: null, content: /*#__PURE__*/external_React_default().createElement(UsernameChange_UsernameChangeFormInline, { onSubmit: () => { handleOnSubmit(modal); } }), okButtonProps: { style: { display: 'none' } } // Hide the default OK button }); }; const UsernameChangeFormModalButton = _ref => { let { ...props } = _ref; const { t } = useTranslation_useTranslation(); return /*#__PURE__*/external_React_default().createElement(external_antd_.Button, UsernameChangeFormModalButton_extends({ type: "default", onClick: () => showUsernameChangeFormModal() }, props, { shape: "round", size: 'large' }), t('button.change_email')); }; /* harmony default export */ const UsernameChange_UsernameChangeFormModalButton = (UsernameChangeFormModalButton); ;// ./src/viainvest-legacy/Accounts/UsernameChange/index.js /* harmony default export */ const UsernameChange = ({ UsernameChangeFormInline: UsernameChange_UsernameChangeFormInline, UsernameChangeFormModalButton: UsernameChange_UsernameChangeFormModalButton, showUsernameChangeFormModal: showUsernameChangeFormModal }); ;// ./src/viainvest-legacy/Accounts/LoggedIn/UserLoggedInTopMenu.jsx const UserLoggedInTopMenu = _ref => { let { session_valid, is_user, user_profile, request_url } = _ref; const language = (external_i18next_default()).language; const { t } = useTranslation_useTranslation(); const [loggedInViaEvent, setLoggedInViaEvent] = (0,external_React_.useState)(false); const { getStatus, failed } = hooks_useStatus({}); (0,external_React_.useEffect)(() => { if (!isLoggedIn()) { getStatus(() => { showLoggedUserNav(); }); } document.addEventListener('logged_in_user', e => { //hide NAV block for not logged In users. After page reload it will be automatically hidden showLoggedUserNav(); }); }, []); const showLoggedUserNav = () => { document.getElementById("nav-wrap").style.display = 'none'; setLoggedInViaEvent(true); }; const isLoggedIn = () => { return session_valid && is_user || loggedInViaEvent; }; const isMenuShown = () => { if (user_profile === undefined) { return false; } return parseInt(user_profile.idenfy_status) === 7 || parseInt(user_profile.is_idenfy) === 0; }; const isDashboardButtonActive = () => { return request_url.indexOf('users/dashboard') === 0; }; const isInvestButtonActive = () => { let urls = ['auto_investments/primary', 'assets', 'auto_investments', 'auto_investments/add']; let editRuleUrl = 'auto_investments/edit_rule/'; return urls.includes(request_url) || request_url.substr(0, editRuleUrl.length) === editRuleUrl; }; const isInvestmentsButtonActive = () => { let urls = ['projects/myfunds', 'projects/myassets']; return urls.includes(request_url); }; const isTransactionsButtonActive = () => { return request_url === 'transactions'; }; const isSettingsButtonActive = () => { return request_url === 'user_profiles/edit'; }; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, isLoggedIn() ? /*#__PURE__*/external_React_default().createElement("div", { className: "nav-wrap", id: "nav-wrap" }, /*#__PURE__*/external_React_default().createElement("div", { className: "header-wrap grid clearfix" }, /*#__PURE__*/external_React_default().createElement("div", { className: "col-12" }, /*#__PURE__*/external_React_default().createElement("div", { className: "logo" }, /*#__PURE__*/external_React_default().createElement("a", { href: `/${language}/users/dashboard/type:assets` }, "Via Invest")), /*#__PURE__*/external_React_default().createElement("a", { href: "#", className: "nav-toggle js-no-pjax", id: "nav-toggle" }, t('topbar.menu')), /*#__PURE__*/external_React_default().createElement("nav", { className: "main-menu profile-menu", id: "main-menu" }, /*#__PURE__*/external_React_default().createElement("ul", { className: "menu" }, isMenuShown() ? /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement("li", { className: "burger" }, /*#__PURE__*/external_React_default().createElement("a", { href: "#", className: "open-it", "data-transition": "snappy" }, "Open menu")), /*#__PURE__*/external_React_default().createElement("li", { className: isDashboardButtonActive() ? 'act' : '' }, /*#__PURE__*/external_React_default().createElement("a", { href: `/${language}/users/dashboard/type:assets`, className: "js-no-pjax", title: t('topbar.dashboard') }, t('topbar.account'))), /*#__PURE__*/external_React_default().createElement("li", { className: isInvestButtonActive() ? 'act' : '' }, /*#__PURE__*/external_React_default().createElement("a", { href: `/${language}/assets`, title: t('topbar.invest'), className: "js-no-pjax" }, t('topbar.invest'))), /*#__PURE__*/external_React_default().createElement("li", { className: isInvestmentsButtonActive() ? 'act' : '' }, /*#__PURE__*/external_React_default().createElement("a", { href: `/${language}/projects/myassets`, title: t('topbar.investments'), className: "js-no-pjax" }, t('topbar.investments'))), /*#__PURE__*/external_React_default().createElement("li", { className: isTransactionsButtonActive() ? 'act' : '' }, /*#__PURE__*/external_React_default().createElement("a", { href: `/${language}/transactions`, title: t('topbar.transactions'), className: "js-no-pjax" }, t('topbar.transactions'))), /*#__PURE__*/external_React_default().createElement("li", { className: isSettingsButtonActive() ? 'act' : '' }, /*#__PURE__*/external_React_default().createElement("a", { href: `/${language}/user_profiles/edit/d3aa3e7f89c3ce2603ca11fad516d4be`, title: t('topbar.settings'), className: "js-no-pjax" }, t('topbar.settings')))) : '', /*#__PURE__*/external_React_default().createElement("li", { className: 'log-out' }, /*#__PURE__*/external_React_default().createElement("a", { href: `/${language}/users/logout`, title: t('topbar.logout'), className: "js-no-pjax" }))))))) : ''); }; /* harmony default export */ const LoggedIn_UserLoggedInTopMenu = (UserLoggedInTopMenu); ;// ./src/viainvest-legacy/Accounts/LoggedIn/index.js /* harmony default export */ const LoggedIn = ({ UserLoggedInTopMenu: LoggedIn_UserLoggedInTopMenu }); ;// ./src/viainvest-legacy/Accounts/index.js /* harmony default export */ const viainvest_legacy_Accounts = ({ PasswordRecovery: Accounts_PasswordRecovery, PasswordChange: PasswordChange, UsernameChange: UsernameChange, LoggedIn: LoggedIn }); ;// ./src/investor/components/InvestorData/InvestorDataForm.jsx const InvestorDataForm = _ref => { let { values } = _ref; const { t } = useTranslation_useTranslation(); const lang = i18n.language; const [form] = external_antd_.Form.useForm(); const endpoint = '/investor/data'; const [payload, setPayload] = (0,external_React_.useState)(null); const { loading, errors, success, statusCode } = investor_api_api.usePostRequest(endpoint, payload); const onSubmitClick = () => { setPayload({ ...form.getFieldsValue(), lang: lang }); }; const renderPep = () => { const { data: consentData, loading: consentLoading } = investor_api_api.useConsent('kyc_questionnaire', lang); const isPepText = consentData ? Object.values(consentData?.questions).find(question => question?.name === 'is_pep')?.text ?? '' : ''; return /*#__PURE__*/external_React_default().createElement(Inputs_CheckboxWithDependency, { name: 'isNotPep', text: isPepText, className: 'flex', checked: Boolean(Number(values?.isNotPep)), reversed: true }, /*#__PURE__*/external_React_default().createElement(Inputs_QuestionnaireSelect, { consent: consentData, slug: "pep_relation", loading: consentLoading, selectText: t('input.select'), answerRequiredText: t('rule.answerRequired'), className: "reg-item", name: "pepRelation", defaultValue: values['pepRelation'], errors: errors?.isNotPep })); }; return /*#__PURE__*/external_React_default().createElement(external_antd_.Form, { form: form, disabled: loading, layout: "vertical", autoComplete: "off", onFinish: onSubmitClick }, statusCode ? success ? /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: t('alert.investor_data_form.success'), type: "success", closable: true }) : /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: t('alert.investor_data_form.error'), type: "error", closable: true }) : '', /*#__PURE__*/external_React_default().createElement(external_antd_.Row, { gutter: 16 }, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Represantative_Representative.Name.FormItem, { label: t('form.name'), name: "name", className: "reg-item", initialValue: values?.name, disabled: true, required: false, errors: errors?.name })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Represantative_Representative.Surname.FormItem, { label: t('form.surname'), name: "surname", className: "reg-item", initialValue: values?.surname, disabled: true, required: false, errors: errors?.name })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Represantative_Representative.Surname.FormItem, { label: t('form.personCode'), name: "personalCode", className: "reg-item", initialValue: values?.personalCode, disabled: true, required: false, rules: [{ min: 11, message: t('rule.personCodeFormat') }, { max: 12, message: t('rule.personCodeFormat') }, { pattern: new RegExp(/^[A-Za-z0-9\-\s]+$/), message: t('validation.regex') }], errors: errors?.personalCode })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Represantative_Representative.DateOfBirth.FormItem, { label: t('form.dob'), errors: errors?.dateOfBirth, form: form, disabled: true, required: false, value: values?.dateOfBirth, className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Country_Country.FormItem, { label: t('form.citizenshipCountry'), name: "citizenship", className: "reg-item", initialValue: values?.citizenship, disabled: true, required: false, errors: errors?.citizenship })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Country_Country.TaxCountry, { label: t('form.taxCountry'), name: "taxResidence", className: "reg-item", initialValue: values?.taxResidence, disabled: true, required: false, errors: errors?.taxResidence })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Represantative_Representative.DocumentNumber.FormItem, { label: t('form.documentNumber'), name: "documentNumber", className: "reg-item", initialValue: values?.documentNumber, disabled: true, required: false, errors: errors?.documentNumber }))), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, { gutter: 16 }, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Address_Address.Street.FormItem, { label: t('form.streetName'), name: 'address', errors: errors?.address, initialValue: values?.address, className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Address_Address.ZipCode.FormItem, { label: t('form.zip'), name: 'zip', errors: errors?.zip, initialValue: values?.zip, className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Address_Address.City.FormItem, { label: t('form.city'), name: 'city', errors: errors?.city, initialValue: values?.city, className: "reg-item" })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(Country_Country.FormItem, { label: t('form.country'), name: "country", className: "reg-item", initialValue: values?.country, errors: errors?.country }))), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, { gutter: 16 }, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, /*#__PURE__*/external_React_default().createElement(components_FormItem, { label: t('form.phone'), name: 'phone', className: "reg-item", rules: [{ pattern: new RegExp(/^(\+|\d){1,15}$/), message: t('rule.phoneFormat') }, { required: true, message: t('rule.required') }], initialValue: values.phone, errors: errors?.phone }, /*#__PURE__*/external_React_default().createElement(external_antd_.Input, null)))), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, { gutter: 16 }, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12 }, renderPep())), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12, offset: 6, className: 'text-align-center' }, /*#__PURE__*/external_React_default().createElement(Steps_RegStepButtons, { loading: loading, next: t('button.update'), nextAction: form.submit, buttonStyle: { 'paddingTop': '5px' } }))), /*#__PURE__*/external_React_default().createElement(external_antd_.Row, null, /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12, className: 'text-align-right' }, /*#__PURE__*/external_React_default().createElement(viainvest_legacy_Accounts.PasswordChange.PasswordChangeFormModalButton, { className: 'mr-1 w-200' })), /*#__PURE__*/external_React_default().createElement(external_antd_.Col, { span: 12, className: 'text-align-left' }, /*#__PURE__*/external_React_default().createElement(viainvest_legacy_Accounts.UsernameChange.UsernameChangeFormModalButton, { className: 'ml-1 w-200' })))); }; /* harmony default export */ const InvestorData_InvestorDataForm = (InvestorDataForm); ;// ./src/investor/components/InvestorData/InvestorData.jsx const InvestorData = () => { const { t } = useTranslation_useTranslation(); const endpoint = '/investor/data'; const { data, loading, success } = investor_api_api.useGetRequest(endpoint); const containerStyle = { width: '100%', padding: '20px 25px 1px', margin: '0 0' }; const fields = [[{ name: 'name', type: 'text', readonly: true, key: 'name' }, { name: 'surname', type: 'text', readonly: true, key: 'surname' }, { name: 'personalCode', type: 'text', readonly: true, key: 'personCode' }, { name: 'dateOfBirth', type: 'date', readonly: true, key: 'dob' }, { name: 'citizenship', type: 'text', readonly: true, key: 'citizenshipCountry' }, { name: 'taxResidence', type: 'text', readonly: true, key: 'taxCountry' }, { name: 'documentNumber', type: 'text', readonly: true, key: 'documentNumber' }], [{ name: 'address', type: 'text', readonly: false, key: 'streetName' }, { name: 'zip', type: 'text', readonly: false, key: 'zip' }, { name: 'city', type: 'text', readonly: false, key: 'city' }, { name: 'country', type: 'text', readonly: false, key: 'country' }], [{ name: 'phone', type: 'text', readonly: false, key: 'phone' }], [{ name: 'isNotPep', type: 'pep', readonly: false, key: 'isNotPep' }]]; const render = () => { if (!loading && !success) { return /*#__PURE__*/external_React_default().createElement(external_antd_.Alert, { message: t('serviceError'), type: "error", showIcon: true }); } if (loading) { return /*#__PURE__*/external_React_default().createElement(external_antd_.Flex, { align: "center", justify: "center" }, /*#__PURE__*/external_React_default().createElement(external_antd_.Spin, { size: "large" })); } if (data) { return /*#__PURE__*/external_React_default().createElement(InvestorData_InvestorDataForm, { fieldGroups: fields, values: data }); } }; return /*#__PURE__*/external_React_default().createElement("div", { style: containerStyle, className: "investor-data" }, render()); }; /* harmony default export */ const InvestorData_InvestorData = (InvestorData); ;// ./src/investor/components/Modals/MifidResultConfirmModal.jsx const MifidResultConfirmModal = () => { const lang = i18n.language; const { data: mifidData, success: mifidLoaded } = investor_api_api.useMifidRules(); return /*#__PURE__*/React.createElement(React.Fragment, null, mifidLoaded && mifidData?.showConfirmConsent && /*#__PURE__*/React.createElement(Modals_ConsentConfirmModal, { consentName: 'mifid_result_' + mifidData?.level, lang: lang })); }; /* harmony default export */ const Modals_MifidResultConfirmModal = (MifidResultConfirmModal); // EXTERNAL MODULE: ./node_modules/react-is/index.js var react_is = __webpack_require__(363); ;// ./node_modules/rc-util/es/hooks/useMemo.js function useMemo_useMemo(getValue, condition, shouldUpdate) { var cacheRef = external_React_.useRef({}); if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) { cacheRef.current.value = getValue(); cacheRef.current.condition = condition; } return cacheRef.current.value; } ;// ./node_modules/rc-util/es/ref.js var fillRef = function fillRef(ref, node) { if (typeof ref === 'function') { ref(node); } else if (_typeof(ref) === 'object' && ref && 'current' in ref) { ref.current = node; } }; /** * Merge refs into one ref function to support ref passing. */ var composeRef = function composeRef() { for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { refs[_key] = arguments[_key]; } var refList = refs.filter(Boolean); if (refList.length <= 1) { return refList[0]; } return function (node) { refs.forEach(function (ref) { fillRef(ref, node); }); }; }; var useComposeRef = function useComposeRef() { for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { refs[_key2] = arguments[_key2]; } return useMemo_useMemo(function () { return composeRef.apply(void 0, refs); }, refs, function (prev, next) { return prev.length !== next.length || prev.every(function (ref, i) { return ref !== next[i]; }); }); }; var supportRef = function supportRef(nodeOrComponent) { var _type$prototype, _nodeOrComponent$prot; var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type; // Function component node if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== ForwardRef) { return false; } // Class component if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== ForwardRef) { return false; } return true; }; function isReactElement(node) { return /*#__PURE__*/(0,external_React_.isValidElement)(node) && !(0,react_is.isFragment)(node); } var supportNodeRef = function supportNodeRef(node) { return isReactElement(node) && supportRef(node); }; /** * In React 19. `ref` is not a property from node. * But a property from `props.ref`. * To check if `props.ref` exist or fallback to `ref`. */ var getNodeRef = Number(external_React_.version.split('.')[0]) >= 19 ? // >= React 19 function (node) { if (isReactElement(node)) { return node.props.ref; } return null; } : // < React 19 function (node) { if (isReactElement(node)) { return node.ref; } return null; }; ;// ./node_modules/@ant-design/icons/es/components/Icon.js var Icon_excluded = ["className", "component", "viewBox", "spin", "rotate", "tabIndex", "onClick", "children"]; // Seems this is used for iconFont var Icon_Icon = /*#__PURE__*/external_React_.forwardRef(function (props, ref) { var className = props.className, Component = props.component, viewBox = props.viewBox, spin = props.spin, rotate = props.rotate, tabIndex = props.tabIndex, onClick = props.onClick, children = props.children, restProps = _objectWithoutProperties(props, Icon_excluded); var iconRef = external_React_.useRef(); var mergedRef = useComposeRef(iconRef, ref); utils_warning(Boolean(Component || children), 'Should have `component` prop or `children`.'); useInsertStyles(iconRef); var _React$useContext = external_React_.useContext(Context), _React$useContext$pre = _React$useContext.prefixCls, prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre, rootClassName = _React$useContext.rootClassName; var classString = classnames_default()(rootClassName, prefixCls, _defineProperty({}, "".concat(prefixCls, "-spin"), !!spin && !!Component), className); var svgClassString = classnames_default()(_defineProperty({}, "".concat(prefixCls, "-spin"), !!spin)); var svgStyle = rotate ? { msTransform: "rotate(".concat(rotate, "deg)"), transform: "rotate(".concat(rotate, "deg)") } : undefined; var innerSvgProps = _objectSpread2(_objectSpread2({}, svgBaseProps), {}, { className: svgClassString, style: svgStyle, viewBox: viewBox }); if (!viewBox) { delete innerSvgProps.viewBox; } // component > children var renderInnerNode = function renderInnerNode() { if (Component) { return /*#__PURE__*/external_React_.createElement(Component, innerSvgProps, children); } if (children) { utils_warning(Boolean(viewBox) || external_React_.Children.count(children) === 1 && /*#__PURE__*/external_React_.isValidElement(children) && external_React_.Children.only(children).type === 'use', 'Make sure that you provide correct `viewBox`' + ' prop (default `0 0 1024 1024`) to the icon.'); return /*#__PURE__*/external_React_.createElement("svg", _extends({}, innerSvgProps, { viewBox: viewBox }), children); } return null; }; var iconTabIndex = tabIndex; if (iconTabIndex === undefined && onClick) { iconTabIndex = -1; } return /*#__PURE__*/external_React_.createElement("span", _extends({ role: "img" }, restProps, { ref: mergedRef, tabIndex: iconTabIndex, onClick: onClick, className: classString }), renderInnerNode()); }); Icon_Icon.displayName = 'AntdIcon'; /* harmony default export */ const components_Icon = (Icon_Icon); ;// ./src/investor/pages/IdentificationPage.jsx const IdentificationPage = _ref => { let { loggedIn = false } = _ref; const { t } = useTranslation_useTranslation(); const searchParams = new URLSearchParams(document.location.search); const statusParam = searchParams.get('status'); if (!statusParam) { window.location.href = '/'; } const message = () => { switch (statusParam) { case 'expired': case 'error': return t('identification.notVerified'); case 'success': return t('identification.success'); } return ''; }; const [state, setState] = (0,external_React_.useState)({ data: {}, message: message() }); const callback = statusData => { if (statusData) { state.data = statusData; } setState(state); if (redirectTo(statusData)) { window.location.href = '/portal/registration'; } }; const successSvg = () => { return /*#__PURE__*/React.createElement("svg", { "_ngcontent-sfs-c40": "", width: "100%", viewBox: "0 0 152 140", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /*#__PURE__*/React.createElement("rect", { "_ngcontent-sfs-c40": "", width: "152", height: "140", rx: "8", fill: "#EFEBFF", "fill-opacity": "0.4" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M144.416 136.447C147.245 136.442 148.463 134.3 148.458 131.827C148.431 117.989 148.428 104.679 148.448 91.8976C148.451 90.9928 148.88 90.3825 149.735 90.0666C149.894 90.0074 150.064 89.9877 150.244 90.0074C151.405 90.1357 151.985 90.7789 151.985 91.937C151.975 104.508 151.98 117.687 152 131.472C152.005 135.099 150.743 137.991 147.34 139.393C146.349 139.801 144.942 140.003 143.119 140C127.848 139.967 112.803 139.954 97.9849 139.96C97.0935 139.96 96.4665 139.559 96.104 138.756C96.0208 138.575 95.9875 138.394 96.0042 138.213C96.094 137.042 96.7326 136.457 97.9201 136.457C114.319 136.453 129.817 136.45 144.416 136.447Z", fill: "#734BFB" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M3.59112 132.412C3.59112 134.602 5.1871 136.443 7.4963 136.443C22.7413 136.449 38.2623 136.451 54.0592 136.447C55.2263 136.447 55.8713 137.021 55.9943 138.169C56.011 138.33 55.991 138.488 55.9345 138.643C55.6086 139.524 54.9702 139.964 54.0193 139.96C39.313 139.937 24.3639 139.95 9.17208 140C7.0707 140.01 5.52293 139.789 4.52876 139.339C2.7233 138.526 1.42989 137.235 0.648518 135.466C0.209622 134.472 -0.00650106 133.047 0.00014888 131.188C0.0466985 117.999 0.0533489 104.948 0.0200992 92.0348C0.0167742 90.8672 0.598644 90.193 1.76571 90.0121C2.32098 89.9233 2.84965 90.3245 3.35172 91.2159C3.50867 91.4975 3.59103 91.8132 3.59112 92.1335C3.59444 105.783 3.59444 119.209 3.59112 132.412Z", fill: "#734BFB" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M144.741 0.0154287C148.937 0.0203663 151.98 3.6791 151.98 7.64396C151.993 21.3605 152 34.84 152 48.0826C152 49.2873 151.393 49.9259 150.179 49.9984C150.059 50.0049 149.941 49.9918 149.825 49.9589C148.93 49.6955 148.481 49.103 148.478 48.1813C148.418 35.8901 148.415 22.5291 148.468 8.09822C148.483 5.07643 146.871 3.4816 143.833 3.48653C129.128 3.50628 113.78 3.50958 97.7889 3.49641C97.3882 3.49512 96.9991 3.3627 96.6824 3.11979C96.3657 2.87687 96.139 2.53709 96.0377 2.15339C96.0011 2.01185 95.9912 1.87031 96.0078 1.72876C96.1275 0.583249 96.7695 0.00884699 97.9336 0.00555528C113.629 -0.00431984 129.232 -0.00102979 144.741 0.0154287Z", fill: "#734BFB" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M7.54433 3.52916C5.02457 3.52916 3.55262 5.50346 3.55761 7.83313C3.57092 21.4393 3.57591 34.9814 3.57258 48.4593C3.57273 48.7214 3.50079 48.9786 3.36451 49.2029C3.22823 49.4273 3.03277 49.6105 2.79919 49.7327C2.47985 49.9005 2.14554 49.9893 1.79627 49.9992C1.56366 50.0065 1.33195 49.9631 1.1149 49.8716C0.897848 49.7801 0.699893 49.6423 0.532795 49.4664C0.365697 49.2905 0.232868 49.0801 0.142197 48.8478C0.0515265 48.6154 0.00486544 48.3658 0.0049888 48.1138C0.00831523 35.2775 0.00665285 21.9691 0 8.1885C0 2.99116 3.29316 -0.0196465 8.2828 9.64932e-05C23.7274 0.0593254 39.0739 0.0659069 54.3222 0.0198399C54.5572 0.0199608 54.7887 0.0750461 54.9978 0.180578C55.2068 0.286109 55.3874 0.439082 55.5247 0.626938C55.9505 1.20936 56.0902 1.72925 55.9438 2.18663C55.6511 3.08494 55.0274 3.53409 54.0727 3.53409C38.7612 3.53738 23.2517 3.53574 7.54433 3.52916Z", fill: "#734BFB" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M111.928 58.9998C111.928 68.9014 103.901 76.9283 93.999 76.9283C84.0973 76.9283 76.0705 68.9014 76.0705 58.9998C76.0705 49.0981 84.0973 41.0712 93.999 41.0712C103.901 41.0712 111.928 49.0981 111.928 58.9998Z", fill: "#e8f5e9", stroke: "#00C853", "stroke-width": "2.14286", "stroke-miterlimit": "10", "stroke-linecap": "round", "stroke-linejoin": "round", className: "successBackground successBorder" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M85.8555 58.9999L91.284 64.4284L102.141 53.5713", fill: "#e8f5e9", className: "successBackground" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M85.8555 58.9999L91.284 64.4284L102.141 53.5713", stroke: "#00C853", "stroke-width": "2.2619", "stroke-miterlimit": "10", "stroke-linecap": "round", "stroke-linejoin": "round", className: "successBorder" }), /*#__PURE__*/React.createElement("path", { "_ngcontent-sfs-c40": "", d: "M61.4356 87.8989C61.3486 92.3098 61.3622 96.6352 61.4765 100.875C61.5662 103.971 60.4401 105.695 57.8044 107.556C52.4786 111.314 46.7285 114.693 40.5541 117.693C39.6021 118.158 38.8269 117.955 38.2285 117.083C38.1469 116.965 38.0898 116.834 38.0571 116.69C37.8667 115.861 38.1523 115.249 38.9139 114.854C44.8952 111.718 52.5575 107.997 57.2414 103.538C57.818 102.987 58.1064 102.212 58.1064 101.212C58.0955 95.4322 58.0819 89.5804 58.0656 83.6565C58.0654 83.1297 57.8646 82.6208 57.5025 82.2289C56.3819 81.0206 55.5305 79.6305 54.9484 78.0586C50.8412 67.018 49.2146 55.8384 50.0687 44.5198C50.9418 32.8349 56.6702 24.5744 68.9102 22.6256C79.8039 20.8853 92.2806 22.369 98.4333 32.3055C98.9066 33.0754 98.7543 33.6983 97.9763 34.1742L97.5357 34.4468C97.374 34.5453 97.1942 34.6114 97.0066 34.6413C96.819 34.6713 96.6274 34.6643 96.443 34.6211C96.2585 34.5778 96.0848 34.499 95.932 34.3892C95.7792 34.2795 95.6503 34.141 95.5528 33.9817C92.4139 28.8864 87.0201 26.0688 79.3714 25.5288C69.2856 24.815 58.4572 26.7638 54.9647 37.2778C51.4804 47.7838 53.2919 61.0566 56.4907 72.1641C57.4209 75.396 58.3838 77.9544 60.5299 80.6891C64.5854 85.8539 72.1335 96.7608 80.0977 92.1174C84.4715 89.5671 87.6457 85.4529 90.6813 81.5232C90.8935 81.248 91.1732 81.0302 91.4943 80.89C91.8153 80.7497 92.1672 80.6917 92.5173 80.7212C93.4883 80.8014 93.8555 81.8119 93.8555 82.6379C93.8664 88.856 93.8664 95.1569 93.8555 101.541C93.8555 103.594 96.94 105.559 99.3717 107.122C103.501 109.79 108.038 112.341 112.983 114.773C114.043 115.297 114.275 116.062 113.676 117.067L113.521 117.316C113.113 118 112.547 118.171 111.824 117.829C107.445 115.76 103.033 113.354 98.5883 110.611C95.9608 108.986 93.7549 107.318 91.9706 105.607C90.3059 104.019 90.4691 102.174 90.4773 99.9447C90.4881 96.1647 90.5208 92.2965 90.5752 88.34C90.5861 87.4899 90.3195 87.3937 89.7755 88.0513C86.6584 91.7725 82.4559 95.7343 77.4946 96.4561C70.9258 97.4184 65.7686 92.2376 61.9171 87.7305C61.607 87.3669 61.4465 87.4231 61.4356 87.8989Z", fill: "#19181D" })); }; return /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', padding: '30px' } }, /*#__PURE__*/React.createElement(external_antd_.Flex, { vertical: true, justify: "center", aling: "center", gap: "large" }, loggedIn && /*#__PURE__*/React.createElement(external_antd_.Spin, { indicator: /*#__PURE__*/React.createElement(icons_LoadingOutlined, { style: { fontSize: 100 }, spin: true }), className: "slow-spin" }), !loggedIn && /*#__PURE__*/React.createElement(components_Icon, { component: successSvg, style: { width: 260, height: 240, alignItems: 'center', margin: 'auto' } }), /*#__PURE__*/React.createElement("h4", null, state.message, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), !loggedIn && t('identification.closeWindow')), /*#__PURE__*/React.createElement(statusPolling, { initialCall: true, callback: callback }))); }; /* harmony default export */ const pages_IdentificationPage = (IdentificationPage); ;// ./src/investor/investorBundle.jsx ;// ./src/viainvest-legacy/index.js __webpack_require__(467); const renderComponent = (component, elementId, _ref) => { let { language, ...props } = _ref; // Ensure i18n is initialized and language is changed if (i18n) { i18n.changeLanguage(language || 'en'); } else { console.error("i18n is not initialized correctly."); return; } //changing date locales globally external_dayjs_default().locale(language || 'en'); // Ensure the element exists const element = document.getElementById(elementId); if (!element) { console.error(`Element with ID ${elementId} not found.`); return; } // Ensure the component is valid if (!React.isValidElement(React.createElement(component, props))) { console.error("Invalid React component."); return; } // Render the component try { ReactDOM.createRoot(element).render(React.createElement(component, props)); } catch (error) { console.error("Error rendering component:", error); } }; const ViainvestLegacy = { version: '0.1', renderComponent, Accounts: viainvest_legacy_Accounts, RegistrationForm: RegistrationForm_RegistrationForm, PortalContextProvider: PortalContextProvider, MifidQuestionnairePage: pages_MifidQuestionnairePage, InvestorData: InvestorData_InvestorData, captureAffiliate: captureAffiliate, MifidResultConfirmModal: Modals_MifidResultConfirmModal, GoogleCookie: GoogleCookie, IdentificationPage: pages_IdentificationPage }; })(); /******/ return __webpack_exports__; /******/ })() ; });