\n {t('project.stay_informed')}\n
\n{t('project.get_notified_message')}
\n{"version":3,"file":"public.98cc4e0a.js","sources":["../../../node_modules/react-cookie/es6/CookiesContext.js","../../../node_modules/react-cookie/es6/CookiesProvider.js","../../../frontend/api/rest/subscribers.js","../../../frontend/api/v3/private/ideaBoard.js","../../../node_modules/swr/infinite/dist/index.esm.js","../../../node_modules/react-speech-recognition/lib/utils.js","../../../node_modules/react-speech-recognition/lib/constants.js","../../../node_modules/react-speech-recognition/lib/actions.js","../../../node_modules/react-speech-recognition/lib/reducers.js","../../../node_modules/react-speech-recognition/lib/isAndroid.js","../../../node_modules/react-speech-recognition/lib/NativeSpeechRecognition.js","../../../node_modules/react-speech-recognition/lib/RecognitionManager.js","../../../node_modules/react-speech-recognition/lib/SpeechRecognition.js","../../../node_modules/react-speech-recognition/lib/index.js","../../../frontend/features/common/components/NotificationsSignupModal/Success/index.js","../../../frontend/features/common/utils/rules.js","../../../frontend/features/common/components/CheckBox/index.js","../../../frontend/features/common/components/CheckboxGroup/index.js","../../../frontend/features/common/components/NotificationsSignupModal/Form/index.js","../../../frontend/features/common/components/NotificationsSignupModal/index.js","../../../frontend/features/common/components/NotificationsSignup/index.js","../../../frontend/features/ideation/components/base/CheckboxInput/index.js","../../../frontend/features/ideation/components/base/TextInput/index.js","../../../frontend/features/ideation/components/base/InputLengthDisplay/index.js","../../../frontend/features/ideation/components/base/FileInput/index.js","../../../frontend/features/ideation/validations/ideaValidations.js","../../../frontend/features/ideation/enums/sortOrder.js","../../../frontend/features/ideation/components/createIdea/CreateIdeaForm/index.js","../../../frontend/features/ideation/components/createIdea/CreateIdeaModal/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaBoardActions/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaBoardHeaderContainer/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaBoardHeader/index.js","../../../frontend/features/ideation/components/base/SearchInput/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaBoardSearch/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaBoardSort/index.js","../../../frontend/features/ideation/utils/userAuthorize.js","../../../frontend/features/ideation/enums/votingTypes.js","../../../frontend/features/ideation/components/ideaActions/VotingWidget/index.js","../../../frontend/features/ideation/enums/propTypes.js","../../../frontend/features/ideation/components/ideaActions/CommentCountWidget/index.js","../../../frontend/features/ideation/enums/flagIdeaReasons.js","../../../frontend/features/ideation/components/ideaActions/FlagIdeaWidgetMenu/index.js","../../../frontend/features/ideation/components/ideaActions/FlagIdeaWidget/index.js","../../../frontend/features/ideation/components/ideaActions/IdeaActionContainer/index.js","../../../frontend/features/common/enums/ModerationStatuses.js","../../../frontend/features/ideation/components/ideaBoard/IdeaCard/WarningMessage/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaCard/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaCards/index.js","../../../frontend/features/common/components/Notification/index.js","../../../frontend/features/ideation/components/ideaBoard/ApprovedNotification/index.js","../../../frontend/features/ideation/components/ideaBoard/PendingNotification/index.js","../../../frontend/features/ideation/components/ideaBoard/UserBannedNotification/index.js","../../../frontend/features/ideation/components/ideaBoard/UserSuspendedNotification/index.js","../../../frontend/features/ideation/enums/submissionStatus.js","../../../frontend/features/ideation/enums/userStatusErrors.js","../../../frontend/features/common/hooks/useScrollIntoView.js","../../../frontend/features/ideation/components/ideaBoard/SubmissionNotification/index.js","../../../frontend/features/ideation/components/ideaBoard/ClosedNotification/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaBoard/index.js","../../../frontend/features/ideation/components/ideaBoard/IdeaBoardContainer/index.js","../../../frontend/features/ideation/components/idea/IdeaHeader/index.js","../../../frontend/features/discussion/enums/sortOrder.js","../../../frontend/features/discussion/enums/reportReason.js","../../../frontend/features/discussion/components/CommentInput/CommentActionBar/index.js","../../../frontend/features/discussion/components/CommentInput/CommentInputToast/index.js","../../../frontend/features/discussion/components/CommentInput/index.js","../../../frontend/features/discussion/utils/index.js","../../../node_modules/date-fns/esm/compareDesc/index.js","../../../frontend/features/discussion/components/DiscussionComment/ReportButton/index.js","../../../frontend/features/discussion/components/DiscussionComment/index.js","../../../frontend/features/discussion/components/DiscussionCommentList/SortOptions/index.js","../../../frontend/features/discussion/components/DiscussionCommentList/index.js","../../../frontend/features/discussion/components/DiscussionBoard/index.js","../../../frontend/features/discussion/components/LoginSection/index.js","../../../frontend/features/discussion/components/ProfileSection/index.js","../../../frontend/features/ideation/components/idea/IdeaContainer/index.js","../../../frontend/features/common/components/PreviewModeBanner/index.js","../../../node_modules/pure-react-carousel/dist/index.es.js","../../../frontend/features/engagement/components/ImageGallery/Thumbnails/index.js","../../../frontend/features/engagement/components/ImageGallery/index.js","../../../frontend/features/engagement/components/Content/Media/index.js","../../../frontend/features/engagement/components/Content/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/BasicQuestion/inputs/TextInput/index.js","../../../frontend/features/common/components/Textarea/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/BasicQuestion/inputs/TextareaInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/BasicQuestion/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/SingleSelectQuestion/index.js","../../../frontend/features/engagement/components/inputs/CheckboxSelectInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/MultiSelectQuestion/index.js","../../../node_modules/react-transition-group/esm/config.js","../../../node_modules/react-transition-group/esm/TransitionGroupContext.js","../../../node_modules/react-transition-group/esm/Transition.js","../../../node_modules/react-transition-group/esm/utils/ChildMapping.js","../../../node_modules/react-transition-group/esm/TransitionGroup.js","../../../node_modules/react-select/animated/dist/react-select-animated.esm.js","../../../frontend/features/engagement/components/QuestionContainer/questions/DropdownQuestion/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/MatrixQuestion/MatrixInput/Options/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/MatrixQuestion/MatrixInput/Rows/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/MatrixQuestion/MatrixInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/MatrixQuestion/index.js","../../../frontend/features/engagement/components/inputs/AnnotationInput/Marker/index.js","../../../frontend/features/engagement/components/inputs/AnnotationInput/Tooltip/index.js","../../../frontend/features/engagement/components/inputs/AnnotationInput/index.js","../../../frontend/features/engagement/components/inputs/GeolocationAnnotationInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/GeolocationQuestion/index.js","../../../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../../../node_modules/invariant/browser.js","../../../node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js","../../../frontend/features/engagement/components/inputs/SortableInput/SortableList/SortableItem/index.js","../../../frontend/features/engagement/components/inputs/SortableInput/SortableList/index.js","../../../frontend/features/engagement/components/inputs/SortableInput/MobileSortableList/MobileSortableItem/index.js","../../../frontend/features/engagement/components/inputs/SortableInput/MobileSortableList/index.js","../../../frontend/features/engagement/components/inputs/SortableInput/index.js","../../../frontend/features/engagement/components/inputs/SortableInput/SortableAccessibility/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OrderedQuestion/index.js","../../../frontend/features/engagement/components/inputs/ImageAnnotationInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/ImageQuestion/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/Budget/BudgetMediaModal/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/Budget/BudgetCheckbox/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/Budget/BudgetCheckboxGroup/index.js","../../../frontend/features/engagement/components/inputs/BudgetInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/Budget/BudgetBox/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/Budget/BudgetQuestion/index.js","../../../frontend/features/common/components/NumberInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/NumericQuestion/index.js","../../../frontend/features/common/enums/SliderPosition.js","../../../node_modules/react-slider/dist/es/prod/components/ReactSlider/ReactSlider.mjs","../../../frontend/features/common/components/Slider/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/SliderQuestion/SliderQuestionInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/SliderQuestion/index.js","../../../node_modules/react-rater/node_modules/react/cjs/react.production.min.js","../../../node_modules/react-rater/node_modules/react/index.js","../../../node_modules/react-rater/lib/star.js","../../../node_modules/react-rater/lib/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/RatingQuestion/RatingQuestionStar/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/RatingQuestion/RatingQuestionInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/RatingQuestion/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OpenBudgetQuestion/OpenBudgetOverview/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OpenBudgetQuestion/OpenBudgetInputsHeader/index.js","../../../frontend/features/common/components/Image/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OpenBudgetQuestion/OpenBudgetComparison/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OpenBudgetQuestion/OpenBudgetInput/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OpenBudgetQuestion/OpenBudgetChartTooltip/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OpenBudgetQuestion/OpenBudgetChart/index.js","../../../frontend/features/engagement/components/QuestionContainer/questions/OpenBudgetQuestion/index.js","../../../frontend/features/engagement/components/QuestionContainer/index.js","../../../frontend/features/engagement/components/Block/index.js","../../../frontend/features/engagement/components/Quote/index.js","../../../frontend/features/engagement/components/FingerprintCollectionConsent/index.js","../../../frontend/features/engagement/components/SectionsContainer/Section/index.js","../../../frontend/features/engagement/components/ProgressBarContainer/index.js","../../../frontend/features/engagement/components/QuitConfirmationModal/index.js","../../../frontend/features/common/components/Link/index.js","../../../frontend/features/engagement/components/VisitHubLink/index.js","../../../frontend/features/engagement/components/NavigationContainer/index.js","../../../frontend/features/project/components/Tag/index.js","../../../frontend/features/project/components/DateInfo/index.js","../../../frontend/features/project/components/CallToActionTile/index.js","../../../frontend/features/project/components/EngagementTile/index.js","../../../frontend/features/common/components/QRCodeImage/index.js","../../../frontend/features/engagement/components/CompleteEngagementFooter/index.js","../../../frontend/features/engagement/components/SocialShareModal/index.js","../../../frontend/features/engagement/components/SectionsContainer/index.js","../../../frontend/features/engagement/components/QuitPageContainer/index.js","../../../frontend/features/engagement/components/ClosedPageContainer/index.js","../../../frontend/features/engagement/components/ErrorPageContainer/index.js","../../../frontend/features/engagement/components/EngagementContainer/index.js","../../../frontend/features/announcement/components/AnnouncementHero/index.js","../../../frontend/features/announcement/components/AnnouncementDetails/index.js","../../../frontend/features/common/components/ShowMoreList/index.js","../../../frontend/features/announcement/components/AnnouncementListItem/index.js","../../../frontend/features/announcement/components/AnnouncementSidebar/index.js","../../../frontend/features/announcement/components/AnnouncementContainer/index.js","../../../frontend/features/project/components/Hero/index.js","../../../frontend/features/project/components/IdeaBoardTile/index.js","../../../frontend/features/project/components/DiscussionTopicTile/index.js","../../../frontend/features/project/components/SponsorQuote/index.js","../../../frontend/features/project/components/ProjectDetail/index.js","../../../frontend/features/project/components/ProjectMeta/index.js","../../../frontend/features/project/components/Phases/index.js","../../../frontend/features/project/components/StoryPhases/index.js","../../../frontend/features/project/components/Announcements/index.js","../../../frontend/features/project/components/Events/index.js","../../../node_modules/lodash.startcase/index.js","../../../frontend/features/project/components/Documents/index.js","../../../frontend/features/project/components/Sidebar/index.js","../../../frontend/features/project/components/ProjectContainer/index.js","../../../frontend/features/project/enums/ProjectGrouping.js","../../../frontend/features/project/components/ProjectsContainer/ProjectTile/index.js","../../../frontend/features/project/components/ProjectsContainer/ActiveProjects/SingleList/index.js","../../../frontend/features/project/components/ProjectsContainer/ActiveProjects/CategoryGrouping/index.js","../../../frontend/features/project/components/ProjectsContainer/ActiveProjects/index.js","../../../frontend/features/project/components/ProjectsContainer/CategoryList/CategoryItem/index.js","../../../frontend/features/project/components/ProjectsContainer/CategoryList/index.js","../../../frontend/features/project/components/ProjectsContainer/FinishedProjects/index.js","../../../frontend/features/project/components/ProjectsContainer/Opportunities/index.js","../../../frontend/features/project/components/ProjectsContainer/index.js","../../../frontend/features/project/components/CategoryContainer/index.js","../../../frontend/features/discussionTopic/components/DiscussionTopicHeader/index.js","../../../frontend/features/discussionTopic/components/StayInformed/index.js","../../../frontend/features/discussionTopic/components/CommunityRules/index.js","../../../frontend/features/discussionTopic/components/DiscussionTopic/index.js","../../../frontend/features/discussionTopic/components/DiscussionTopicContainer/index.js","../../../frontend/features/sitemap/components/Sitemap/index.js","../../../frontend/entrypoints/public.js"],"sourcesContent":["import * as React from 'react';\r\nimport Cookies from './Cookies';\r\nvar CookiesContext = React.createContext(new Cookies());\r\nexport var Provider = CookiesContext.Provider, Consumer = CookiesContext.Consumer;\r\nexport default CookiesContext;\r\n","var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nimport * as React from 'react';\r\nimport Cookies from 'universal-cookie';\r\nimport { Provider } from './CookiesContext';\r\nvar CookiesProvider = /** @class */ (function (_super) {\r\n __extends(CookiesProvider, _super);\r\n function CookiesProvider(props) {\r\n var _this = _super.call(this, props) || this;\r\n if (props.cookies) {\r\n _this.cookies = props.cookies;\r\n }\r\n else {\r\n _this.cookies = new Cookies();\r\n }\r\n return _this;\r\n }\r\n CookiesProvider.prototype.render = function () {\r\n return React.createElement(Provider, { value: this.cookies }, this.props.children);\r\n };\r\n return CookiesProvider;\r\n}(React.Component));\r\nexport default CookiesProvider;\r\n","import { apiCall } from './helper';\n\nexport const subscribeUser = (name, email, projectId) => {\n const body = {\n data: {\n type: 'subscriber',\n attributes: {\n name,\n email,\n project_id: projectId,\n all_projects: !projectId,\n },\n },\n };\n\n return apiCall('/subscribers', 'POST', JSON.stringify(body));\n};\n","// Helpers\nimport { privateApiUrl } from 'api/v3';\n\nexport function getIdeaBoardUrl(id, { include = ['hero_image', 'project'] } = {}) {\n return privateApiUrl(`idea_boards/${id}`, { include });\n}\n","import { useEffect, useLayoutEffect, useState, useRef, useCallback } from 'react';\nimport useSWR from 'swr';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\n\nvar noop = function () { };\n// Using noop() as the undefined value as undefined can possibly be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nvar UNDEFINED = ( /*#__NOINLINE__*/noop());\nvar OBJECT = Object;\nvar isUndefined = function (v) { return v === UNDEFINED; };\nvar isFunction = function (v) { return typeof v == 'function'; };\nvar STR_UNDEFINED = 'undefined';\n// NOTE: Use function to guarantee it's re-evaluated between jsdom and node runtime for tests.\nvar hasWindow = function () { return typeof window != STR_UNDEFINED; };\n\nvar IS_SERVER = !hasWindow() || 'Deno' in window;\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nvar useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nvar table = new WeakMap();\n// counter of the key\nvar counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsible.\nvar stableHash = function (arg) {\n var type = typeof arg;\n var constructor = arg && arg.constructor;\n var isDate = constructor == Date;\n var result;\n var index;\n if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result)\n return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (constructor == Array) {\n // Array.\n result = '@';\n for (index = 0; index < arg.length; index++) {\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (constructor == OBJECT) {\n // Object, sort keys.\n result = '#';\n var keys = OBJECT.keys(arg).sort();\n while (!isUndefined((index = keys.pop()))) {\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n }\n else {\n result = isDate\n ? arg.toJSON()\n : type == 'symbol'\n ? arg.toString()\n : type == 'string'\n ? JSON.stringify(arg)\n : '' + arg;\n }\n return result;\n};\n\nvar serialize = function (key) {\n if (isFunction(key)) {\n try {\n key = key();\n }\n catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n var args = [].concat(key);\n // If key is not falsy, or not an empty array, hash it.\n key =\n typeof key == 'string'\n ? key\n : (Array.isArray(key) ? key.length : key)\n ? stableHash(key)\n : '';\n var infoKey = key ? '$swr$' + key : '';\n return [key, args, infoKey];\n};\n\nvar normalize = function (args) {\n return isFunction(args[1])\n ? [args[0], args[1], args[2] || {}]\n : [args[0], null, (args[1] === null ? args[2] : args[1]) || {}];\n};\n\n// Create a custom hook with a middleware\nvar withMiddleware = function (useSWR, middleware) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var _a = normalize(args), key = _a[0], fn = _a[1], config = _a[2];\n var uses = (config.use || []).concat(middleware);\n return useSWR(key, fn, __assign(__assign({}, config), { use: uses }));\n };\n};\n\n// We have to several type castings here because `useSWRInfinite` is a special\nvar INFINITE_PREFIX = '$inf$';\nvar getFirstPageKey = function (getKey) {\n return serialize(getKey ? getKey(0, null) : null)[0];\n};\nvar unstable_serialize = function (getKey) {\n return INFINITE_PREFIX + getFirstPageKey(getKey);\n};\nvar infinite = (function (useSWRNext) {\n return function (getKey, fn, config) {\n var rerender = useState({})[1];\n var didMountRef = useRef(false);\n var dataRef = useRef();\n var cache = config.cache, _a = config.initialSize, initialSize = _a === void 0 ? 1 : _a, _b = config.revalidateAll, revalidateAll = _b === void 0 ? false : _b, _c = config.persistSize, persistSize = _c === void 0 ? false : _c, _d = config.revalidateFirstPage, revalidateFirstPage = _d === void 0 ? true : _d, _e = config.revalidateOnMount, revalidateOnMount = _e === void 0 ? false : _e;\n // The serialized key of the first page.\n var firstPageKey = null;\n try {\n firstPageKey = getFirstPageKey(getKey);\n }\n catch (err) {\n // not ready\n }\n // We use cache to pass extra info (context) to fetcher so it can be globally\n // shared. The key of the context data is based on the first page key.\n var contextCacheKey = null;\n // Page size is also cached to share the page data between hooks with the\n // same key.\n var pageSizeCacheKey = null;\n if (firstPageKey) {\n contextCacheKey = '$ctx$' + firstPageKey;\n pageSizeCacheKey = '$len$' + firstPageKey;\n }\n var resolvePageSize = useCallback(function () {\n var cachedPageSize = cache.get(pageSizeCacheKey);\n return isUndefined(cachedPageSize) ? initialSize : cachedPageSize;\n // `cache` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pageSizeCacheKey, initialSize]);\n // keep the last page size to restore it with the persistSize option\n var lastPageSizeRef = useRef(resolvePageSize());\n // When the page key changes, we reset the page size if it's not persisted\n useIsomorphicLayoutEffect(function () {\n if (!didMountRef.current) {\n didMountRef.current = true;\n return;\n }\n if (firstPageKey) {\n // If the key has been changed, we keep the current page size if persistSize is enabled\n cache.set(pageSizeCacheKey, persistSize ? lastPageSizeRef.current : initialSize);\n }\n // `initialSize` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [firstPageKey]);\n // Needs to check didMountRef during mounting, not in the fetcher\n var shouldRevalidateOnMount = revalidateOnMount && !didMountRef.current;\n // Actual SWR hook to load all pages in one fetcher.\n var swr = useSWRNext(firstPageKey ? INFINITE_PREFIX + firstPageKey : null, function () { return __awaiter(void 0, void 0, void 0, function () {\n var _a, forceRevalidateAll, originalData, data, pageSize, previousPageData, i, _b, pageKey, pageArgs, pageData, shouldFetchPage;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = cache.get(contextCacheKey) || [], forceRevalidateAll = _a[0], originalData = _a[1];\n data = [];\n pageSize = resolvePageSize();\n previousPageData = null;\n i = 0;\n _c.label = 1;\n case 1:\n if (!(i < pageSize)) return [3 /*break*/, 5];\n _b = serialize(getKey(i, previousPageData)), pageKey = _b[0], pageArgs = _b[1];\n if (!pageKey) {\n // `pageKey` is falsy, stop fetching new pages.\n return [3 /*break*/, 5];\n }\n pageData = cache.get(pageKey);\n shouldFetchPage = revalidateAll ||\n forceRevalidateAll ||\n isUndefined(pageData) ||\n (revalidateFirstPage && !i && !isUndefined(dataRef.current)) ||\n shouldRevalidateOnMount ||\n (originalData &&\n !isUndefined(originalData[i]) &&\n !config.compare(originalData[i], pageData));\n if (!(fn && shouldFetchPage)) return [3 /*break*/, 3];\n return [4 /*yield*/, fn.apply(void 0, pageArgs)];\n case 2:\n pageData = _c.sent();\n cache.set(pageKey, pageData);\n _c.label = 3;\n case 3:\n data.push(pageData);\n previousPageData = pageData;\n _c.label = 4;\n case 4:\n ++i;\n return [3 /*break*/, 1];\n case 5:\n // once we executed the data fetching based on the context, clear the context\n cache.delete(contextCacheKey);\n // return the data\n return [2 /*return*/, data];\n }\n });\n }); }, config);\n // update dataRef\n useIsomorphicLayoutEffect(function () {\n dataRef.current = swr.data;\n }, [swr.data]);\n var mutate = useCallback(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var data = args[0];\n // Default to true.\n var shouldRevalidate = args[1] !== false;\n // It is possible that the key is still falsy.\n if (!contextCacheKey)\n return;\n if (shouldRevalidate) {\n if (!isUndefined(data)) {\n // We only revalidate the pages that are changed\n var originalData = dataRef.current;\n cache.set(contextCacheKey, [false, originalData]);\n }\n else {\n // Calling `mutate()`, we revalidate all pages\n cache.set(contextCacheKey, [true]);\n }\n }\n return args.length ? swr.mutate(data, shouldRevalidate) : swr.mutate();\n }, \n // swr.mutate is always the same reference\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [contextCacheKey]);\n // Function to load pages data from the cache based on the page size.\n var resolvePagesFromCache = function (pageSize) {\n // return an array of page data\n var data = [];\n var previousPageData = null;\n for (var i = 0; i < pageSize; ++i) {\n var pageKey = serialize(getKey(i, previousPageData))[0];\n // Get the cached page data.\n var pageData = pageKey ? cache.get(pageKey) : UNDEFINED;\n // Return the current data if we can't get it from the cache.\n if (isUndefined(pageData))\n return dataRef.current;\n data.push(pageData);\n previousPageData = pageData;\n }\n // Return the data\n return data;\n };\n // Extend the SWR API\n var setSize = useCallback(function (arg) {\n // It is possible that the key is still falsy.\n if (!pageSizeCacheKey)\n return;\n var size;\n if (isFunction(arg)) {\n size = arg(resolvePageSize());\n }\n else if (typeof arg == 'number') {\n size = arg;\n }\n if (typeof size != 'number')\n return;\n cache.set(pageSizeCacheKey, size);\n lastPageSizeRef.current = size;\n rerender({});\n return mutate(resolvePagesFromCache(size));\n }, \n // `cache` and `rerender` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [pageSizeCacheKey, resolvePageSize, mutate]);\n // Use getter functions to avoid unnecessary re-renders caused by triggering\n // all the getters of the returned swr object.\n return {\n size: resolvePageSize(),\n setSize: setSize,\n mutate: mutate,\n get error() {\n return swr.error;\n },\n get data() {\n return swr.data;\n },\n get isValidating() {\n return swr.isValidating;\n }\n };\n };\n});\nvar index = withMiddleware(useSWR, infinite);\n\nexport { index as default, infinite, unstable_serialize };\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.browserSupportsPolyfills = exports.compareTwoStringsUsingDiceCoefficient = exports.commandToRegExp = exports.concatTranscripts = exports.debounce = void 0;\n\nvar debounce = function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this;\n var args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\n\nexports.debounce = debounce;\n\nvar concatTranscripts = function concatTranscripts() {\n for (var _len = arguments.length, transcriptParts = new Array(_len), _key = 0; _key < _len; _key++) {\n transcriptParts[_key] = arguments[_key];\n }\n\n return transcriptParts.map(function (t) {\n return t.trim();\n }).join(' ').trim();\n}; // The command matching code is a modified version of Backbone.Router by Jeremy Ashkenas, under the MIT license.\n\n\nexports.concatTranscripts = concatTranscripts;\nvar optionalParam = /\\s*\\((.*?)\\)\\s*/g;\nvar optionalRegex = /(\\(\\?:[^)]+\\))\\?/g;\nvar namedParam = /(\\(\\?)?:\\w+/g;\nvar splatParam = /\\*/g;\nvar escapeRegExp = /[-{}[\\]+?.,\\\\^$|#]/g;\n\nvar commandToRegExp = function commandToRegExp(command) {\n if (command instanceof RegExp) {\n return new RegExp(command.source, 'i');\n }\n\n command = command.replace(escapeRegExp, '\\\\$&').replace(optionalParam, '(?:$1)?').replace(namedParam, function (match, optional) {\n return optional ? match : '([^\\\\s]+)';\n }).replace(splatParam, '(.*?)').replace(optionalRegex, '\\\\s*$1?\\\\s*');\n return new RegExp('^' + command + '$', 'i');\n}; // this is from https://github.com/aceakash/string-similarity\n\n\nexports.commandToRegExp = commandToRegExp;\n\nvar compareTwoStringsUsingDiceCoefficient = function compareTwoStringsUsingDiceCoefficient(first, second) {\n first = first.replace(/\\s+/g, '').toLowerCase();\n second = second.replace(/\\s+/g, '').toLowerCase();\n if (!first.length && !second.length) return 1; // if both are empty strings\n\n if (!first.length || !second.length) return 0; // if only one is empty string\n\n if (first === second) return 1; // identical\n\n if (first.length === 1 && second.length === 1) return 0; // both are 1-letter strings\n\n if (first.length < 2 || second.length < 2) return 0; // if either is a 1-letter string\n\n var firstBigrams = new Map();\n\n for (var i = 0; i < first.length - 1; i++) {\n var bigram = first.substring(i, i + 2);\n var count = firstBigrams.has(bigram) ? firstBigrams.get(bigram) + 1 : 1;\n firstBigrams.set(bigram, count);\n }\n\n var intersectionSize = 0;\n\n for (var _i = 0; _i < second.length - 1; _i++) {\n var _bigram = second.substring(_i, _i + 2);\n\n var _count = firstBigrams.has(_bigram) ? firstBigrams.get(_bigram) : 0;\n\n if (_count > 0) {\n firstBigrams.set(_bigram, _count - 1);\n intersectionSize++;\n }\n }\n\n return 2.0 * intersectionSize / (first.length + second.length - 2);\n};\n\nexports.compareTwoStringsUsingDiceCoefficient = compareTwoStringsUsingDiceCoefficient;\n\nvar browserSupportsPolyfills = function browserSupportsPolyfills() {\n return typeof window !== 'undefined' && window.navigator !== undefined && window.navigator.mediaDevices !== undefined && window.navigator.mediaDevices.getUserMedia !== undefined && (window.AudioContext !== undefined || window.webkitAudioContext !== undefined);\n};\n\nexports.browserSupportsPolyfills = browserSupportsPolyfills;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.APPEND_TRANSCRIPT = exports.CLEAR_TRANSCRIPT = void 0;\nvar CLEAR_TRANSCRIPT = 'CLEAR_TRANSCRIPT';\nexports.CLEAR_TRANSCRIPT = CLEAR_TRANSCRIPT;\nvar APPEND_TRANSCRIPT = 'APPEND_TRANSCRIPT';\nexports.APPEND_TRANSCRIPT = APPEND_TRANSCRIPT;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.appendTranscript = exports.clearTranscript = void 0;\n\nvar _constants = require(\"./constants\");\n\nvar clearTranscript = function clearTranscript() {\n return {\n type: _constants.CLEAR_TRANSCRIPT\n };\n};\n\nexports.clearTranscript = clearTranscript;\n\nvar appendTranscript = function appendTranscript(interimTranscript, finalTranscript) {\n return {\n type: _constants.APPEND_TRANSCRIPT,\n payload: {\n interimTranscript: interimTranscript,\n finalTranscript: finalTranscript\n }\n };\n};\n\nexports.appendTranscript = appendTranscript;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.transcriptReducer = void 0;\n\nvar _constants = require(\"./constants\");\n\nvar _utils = require(\"./utils\");\n\nvar transcriptReducer = function transcriptReducer(state, action) {\n switch (action.type) {\n case _constants.CLEAR_TRANSCRIPT:\n return {\n interimTranscript: '',\n finalTranscript: ''\n };\n\n case _constants.APPEND_TRANSCRIPT:\n return {\n interimTranscript: action.payload.interimTranscript,\n finalTranscript: (0, _utils.concatTranscripts)(state.finalTranscript, action.payload.finalTranscript)\n };\n\n default:\n throw new Error();\n }\n};\n\nexports.transcriptReducer = transcriptReducer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _default = function _default() {\n return /(android)/i.test(typeof navigator !== 'undefined' ? navigator.userAgent : '');\n};\n\nexports[\"default\"] = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = exports.isNative = void 0;\nvar NativeSpeechRecognition = typeof window !== 'undefined' && (window.SpeechRecognition || window.webkitSpeechRecognition || window.mozSpeechRecognition || window.msSpeechRecognition || window.oSpeechRecognition);\n\nvar isNative = function isNative(SpeechRecognition) {\n return SpeechRecognition === NativeSpeechRecognition;\n};\n\nexports.isNative = isNative;\nvar _default = NativeSpeechRecognition;\nexports[\"default\"] = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _isAndroid = _interopRequireDefault(require(\"./isAndroid\"));\n\nvar _utils = require(\"./utils\");\n\nvar _NativeSpeechRecognition = require(\"./NativeSpeechRecognition\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar RecognitionManager = /*#__PURE__*/function () {\n function RecognitionManager(SpeechRecognition) {\n _classCallCheck(this, RecognitionManager);\n\n this.recognition = null;\n this.pauseAfterDisconnect = false;\n this.interimTranscript = '';\n this.finalTranscript = '';\n this.listening = false;\n this.isMicrophoneAvailable = true;\n this.subscribers = {};\n\n this.onStopListening = function () {};\n\n this.previousResultWasFinalOnly = false;\n this.resetTranscript = this.resetTranscript.bind(this);\n this.startListening = this.startListening.bind(this);\n this.stopListening = this.stopListening.bind(this);\n this.abortListening = this.abortListening.bind(this);\n this.setSpeechRecognition = this.setSpeechRecognition.bind(this);\n this.disableRecognition = this.disableRecognition.bind(this);\n this.setSpeechRecognition(SpeechRecognition);\n\n if ((0, _isAndroid[\"default\"])()) {\n this.updateFinalTranscript = (0, _utils.debounce)(this.updateFinalTranscript, 250, true);\n }\n }\n\n _createClass(RecognitionManager, [{\n key: \"setSpeechRecognition\",\n value: function setSpeechRecognition(SpeechRecognition) {\n var browserSupportsRecogniser = !!SpeechRecognition && ((0, _NativeSpeechRecognition.isNative)(SpeechRecognition) || (0, _utils.browserSupportsPolyfills)());\n\n if (browserSupportsRecogniser) {\n this.disableRecognition();\n this.recognition = new SpeechRecognition();\n this.recognition.continuous = false;\n this.recognition.interimResults = true;\n this.recognition.onresult = this.updateTranscript.bind(this);\n this.recognition.onend = this.onRecognitionDisconnect.bind(this);\n this.recognition.onerror = this.onError.bind(this);\n }\n\n this.emitBrowserSupportsSpeechRecognitionChange(browserSupportsRecogniser);\n }\n }, {\n key: \"subscribe\",\n value: function subscribe(id, callbacks) {\n this.subscribers[id] = callbacks;\n }\n }, {\n key: \"unsubscribe\",\n value: function unsubscribe(id) {\n delete this.subscribers[id];\n }\n }, {\n key: \"emitListeningChange\",\n value: function emitListeningChange(listening) {\n var _this = this;\n\n this.listening = listening;\n Object.keys(this.subscribers).forEach(function (id) {\n var onListeningChange = _this.subscribers[id].onListeningChange;\n onListeningChange(listening);\n });\n }\n }, {\n key: \"emitMicrophoneAvailabilityChange\",\n value: function emitMicrophoneAvailabilityChange(isMicrophoneAvailable) {\n var _this2 = this;\n\n this.isMicrophoneAvailable = isMicrophoneAvailable;\n Object.keys(this.subscribers).forEach(function (id) {\n var onMicrophoneAvailabilityChange = _this2.subscribers[id].onMicrophoneAvailabilityChange;\n onMicrophoneAvailabilityChange(isMicrophoneAvailable);\n });\n }\n }, {\n key: \"emitTranscriptChange\",\n value: function emitTranscriptChange(interimTranscript, finalTranscript) {\n var _this3 = this;\n\n Object.keys(this.subscribers).forEach(function (id) {\n var onTranscriptChange = _this3.subscribers[id].onTranscriptChange;\n onTranscriptChange(interimTranscript, finalTranscript);\n });\n }\n }, {\n key: \"emitClearTranscript\",\n value: function emitClearTranscript() {\n var _this4 = this;\n\n Object.keys(this.subscribers).forEach(function (id) {\n var onClearTranscript = _this4.subscribers[id].onClearTranscript;\n onClearTranscript();\n });\n }\n }, {\n key: \"emitBrowserSupportsSpeechRecognitionChange\",\n value: function emitBrowserSupportsSpeechRecognitionChange(browserSupportsSpeechRecognitionChange) {\n var _this5 = this;\n\n Object.keys(this.subscribers).forEach(function (id) {\n var _this5$subscribers$id = _this5.subscribers[id],\n onBrowserSupportsSpeechRecognitionChange = _this5$subscribers$id.onBrowserSupportsSpeechRecognitionChange,\n onBrowserSupportsContinuousListeningChange = _this5$subscribers$id.onBrowserSupportsContinuousListeningChange;\n onBrowserSupportsSpeechRecognitionChange(browserSupportsSpeechRecognitionChange);\n onBrowserSupportsContinuousListeningChange(browserSupportsSpeechRecognitionChange);\n });\n }\n }, {\n key: \"disconnect\",\n value: function disconnect(disconnectType) {\n if (this.recognition && this.listening) {\n switch (disconnectType) {\n case 'ABORT':\n this.pauseAfterDisconnect = true;\n this.abort();\n break;\n\n case 'RESET':\n this.pauseAfterDisconnect = false;\n this.abort();\n break;\n\n case 'STOP':\n default:\n this.pauseAfterDisconnect = true;\n this.stop();\n }\n }\n }\n }, {\n key: \"disableRecognition\",\n value: function disableRecognition() {\n if (this.recognition) {\n this.recognition.onresult = function () {};\n\n this.recognition.onend = function () {};\n\n this.recognition.onerror = function () {};\n\n if (this.listening) {\n this.stopListening();\n }\n }\n }\n }, {\n key: \"onError\",\n value: function onError(event) {\n if (event && event.error && event.error === 'not-allowed') {\n this.emitMicrophoneAvailabilityChange(false);\n this.disableRecognition();\n }\n }\n }, {\n key: \"onRecognitionDisconnect\",\n value: function onRecognitionDisconnect() {\n this.onStopListening();\n this.listening = false;\n\n if (this.pauseAfterDisconnect) {\n this.emitListeningChange(false);\n } else if (this.recognition) {\n if (this.recognition.continuous) {\n this.startListening({\n continuous: this.recognition.continuous\n });\n } else {\n this.emitListeningChange(false);\n }\n }\n\n this.pauseAfterDisconnect = false;\n }\n }, {\n key: \"updateTranscript\",\n value: function updateTranscript(_ref) {\n var results = _ref.results,\n resultIndex = _ref.resultIndex;\n var currentIndex = resultIndex === undefined ? results.length - 1 : resultIndex;\n this.interimTranscript = '';\n this.finalTranscript = '';\n\n for (var i = currentIndex; i < results.length; ++i) {\n if (results[i].isFinal && (!(0, _isAndroid[\"default\"])() || results[i][0].confidence > 0)) {\n this.updateFinalTranscript(results[i][0].transcript);\n } else {\n this.interimTranscript = (0, _utils.concatTranscripts)(this.interimTranscript, results[i][0].transcript);\n }\n }\n\n var isDuplicateResult = false;\n\n if (this.interimTranscript === '' && this.finalTranscript !== '') {\n if (this.previousResultWasFinalOnly) {\n isDuplicateResult = true;\n }\n\n this.previousResultWasFinalOnly = true;\n } else {\n this.previousResultWasFinalOnly = false;\n }\n\n if (!isDuplicateResult) {\n this.emitTranscriptChange(this.interimTranscript, this.finalTranscript);\n }\n }\n }, {\n key: \"updateFinalTranscript\",\n value: function updateFinalTranscript(newFinalTranscript) {\n this.finalTranscript = (0, _utils.concatTranscripts)(this.finalTranscript, newFinalTranscript);\n }\n }, {\n key: \"resetTranscript\",\n value: function resetTranscript() {\n this.disconnect('RESET');\n }\n }, {\n key: \"startListening\",\n value: function () {\n var _startListening = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _ref2,\n _ref2$continuous,\n continuous,\n language,\n isContinuousChanged,\n isLanguageChanged,\n _args = arguments;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$continuous = _ref2.continuous, continuous = _ref2$continuous === void 0 ? false : _ref2$continuous, language = _ref2.language;\n\n if (this.recognition) {\n _context.next = 3;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 3:\n isContinuousChanged = continuous !== this.recognition.continuous;\n isLanguageChanged = language && language !== this.recognition.lang;\n\n if (!(isContinuousChanged || isLanguageChanged)) {\n _context.next = 11;\n break;\n }\n\n if (!this.listening) {\n _context.next = 9;\n break;\n }\n\n _context.next = 9;\n return this.stopListening();\n\n case 9:\n this.recognition.continuous = isContinuousChanged ? continuous : this.recognition.continuous;\n this.recognition.lang = isLanguageChanged ? language : this.recognition.lang;\n\n case 11:\n if (this.listening) {\n _context.next = 22;\n break;\n }\n\n if (!this.recognition.continuous) {\n this.resetTranscript();\n this.emitClearTranscript();\n }\n\n _context.prev = 13;\n _context.next = 16;\n return this.start();\n\n case 16:\n this.emitListeningChange(true);\n _context.next = 22;\n break;\n\n case 19:\n _context.prev = 19;\n _context.t0 = _context[\"catch\"](13);\n\n // DOMExceptions indicate a redundant microphone start - safe to swallow\n if (!(_context.t0 instanceof DOMException)) {\n this.emitMicrophoneAvailabilityChange(false);\n }\n\n case 22:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[13, 19]]);\n }));\n\n function startListening() {\n return _startListening.apply(this, arguments);\n }\n\n return startListening;\n }()\n }, {\n key: \"abortListening\",\n value: function () {\n var _abortListening = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var _this6 = this;\n\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n this.disconnect('ABORT');\n this.emitListeningChange(false);\n _context2.next = 4;\n return new Promise(function (resolve) {\n _this6.onStopListening = resolve;\n });\n\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function abortListening() {\n return _abortListening.apply(this, arguments);\n }\n\n return abortListening;\n }()\n }, {\n key: \"stopListening\",\n value: function () {\n var _stopListening = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n var _this7 = this;\n\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n this.disconnect('STOP');\n this.emitListeningChange(false);\n _context3.next = 4;\n return new Promise(function (resolve) {\n _this7.onStopListening = resolve;\n });\n\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function stopListening() {\n return _stopListening.apply(this, arguments);\n }\n\n return stopListening;\n }()\n }, {\n key: \"getRecognition\",\n value: function getRecognition() {\n return this.recognition;\n }\n }, {\n key: \"start\",\n value: function () {\n var _start = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (!(this.recognition && !this.listening)) {\n _context4.next = 4;\n break;\n }\n\n _context4.next = 3;\n return this.recognition.start();\n\n case 3:\n this.listening = true;\n\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function start() {\n return _start.apply(this, arguments);\n }\n\n return start;\n }()\n }, {\n key: \"stop\",\n value: function stop() {\n if (this.recognition && this.listening) {\n this.recognition.stop();\n this.listening = false;\n }\n }\n }, {\n key: \"abort\",\n value: function abort() {\n if (this.recognition && this.listening) {\n this.recognition.abort();\n this.listening = false;\n }\n }\n }]);\n\n return RecognitionManager;\n}();\n\nexports[\"default\"] = RecognitionManager;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = exports.useSpeechRecognition = void 0;\n\nvar _react = require(\"react\");\n\nvar _utils = require(\"./utils\");\n\nvar _actions = require(\"./actions\");\n\nvar _reducers = require(\"./reducers\");\n\nvar _RecognitionManager = _interopRequireDefault(require(\"./RecognitionManager\"));\n\nvar _isAndroid = _interopRequireDefault(require(\"./isAndroid\"));\n\nvar _NativeSpeechRecognition = _interopRequireDefault(require(\"./NativeSpeechRecognition\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar _browserSupportsSpeechRecognition = !!_NativeSpeechRecognition[\"default\"];\n\nvar _browserSupportsContinuousListening = _browserSupportsSpeechRecognition && !(0, _isAndroid[\"default\"])();\n\nvar recognitionManager;\n\nvar useSpeechRecognition = function useSpeechRecognition() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$transcribing = _ref.transcribing,\n transcribing = _ref$transcribing === void 0 ? true : _ref$transcribing,\n _ref$clearTranscriptO = _ref.clearTranscriptOnListen,\n clearTranscriptOnListen = _ref$clearTranscriptO === void 0 ? true : _ref$clearTranscriptO,\n _ref$commands = _ref.commands,\n commands = _ref$commands === void 0 ? [] : _ref$commands;\n\n var _useState = (0, _react.useState)(SpeechRecognition.getRecognitionManager()),\n _useState2 = _slicedToArray(_useState, 1),\n recognitionManager = _useState2[0];\n\n var _useState3 = (0, _react.useState)(_browserSupportsSpeechRecognition),\n _useState4 = _slicedToArray(_useState3, 2),\n browserSupportsSpeechRecognition = _useState4[0],\n setBrowserSupportsSpeechRecognition = _useState4[1];\n\n var _useState5 = (0, _react.useState)(_browserSupportsContinuousListening),\n _useState6 = _slicedToArray(_useState5, 2),\n browserSupportsContinuousListening = _useState6[0],\n setBrowserSupportsContinuousListening = _useState6[1];\n\n var _useReducer = (0, _react.useReducer)(_reducers.transcriptReducer, {\n interimTranscript: recognitionManager.interimTranscript,\n finalTranscript: ''\n }),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n _useReducer2$ = _useReducer2[0],\n interimTranscript = _useReducer2$.interimTranscript,\n finalTranscript = _useReducer2$.finalTranscript,\n dispatch = _useReducer2[1];\n\n var _useState7 = (0, _react.useState)(recognitionManager.listening),\n _useState8 = _slicedToArray(_useState7, 2),\n listening = _useState8[0],\n setListening = _useState8[1];\n\n var _useState9 = (0, _react.useState)(recognitionManager.isMicrophoneAvailable),\n _useState10 = _slicedToArray(_useState9, 2),\n isMicrophoneAvailable = _useState10[0],\n setMicrophoneAvailable = _useState10[1];\n\n var commandsRef = (0, _react.useRef)(commands);\n commandsRef.current = commands;\n\n var dispatchClearTranscript = function dispatchClearTranscript() {\n dispatch((0, _actions.clearTranscript)());\n };\n\n var resetTranscript = (0, _react.useCallback)(function () {\n recognitionManager.resetTranscript();\n dispatchClearTranscript();\n }, [recognitionManager]);\n\n var testFuzzyMatch = function testFuzzyMatch(command, input, fuzzyMatchingThreshold) {\n var commandToString = _typeof(command) === 'object' ? command.toString() : command;\n var commandWithoutSpecials = commandToString.replace(/[&/\\\\#,+()!$~%.'\":*?<>{}]/g, '').replace(/ +/g, ' ').trim();\n var howSimilar = (0, _utils.compareTwoStringsUsingDiceCoefficient)(commandWithoutSpecials, input);\n\n if (howSimilar >= fuzzyMatchingThreshold) {\n return {\n command: command,\n commandWithoutSpecials: commandWithoutSpecials,\n howSimilar: howSimilar,\n isFuzzyMatch: true\n };\n }\n\n return null;\n };\n\n var testMatch = function testMatch(command, input) {\n var pattern = (0, _utils.commandToRegExp)(command);\n var result = pattern.exec(input);\n\n if (result) {\n return {\n command: command,\n parameters: result.slice(1)\n };\n }\n\n return null;\n };\n\n var matchCommands = (0, _react.useCallback)(function (newInterimTranscript, newFinalTranscript) {\n commandsRef.current.forEach(function (_ref2) {\n var command = _ref2.command,\n callback = _ref2.callback,\n _ref2$matchInterim = _ref2.matchInterim,\n matchInterim = _ref2$matchInterim === void 0 ? false : _ref2$matchInterim,\n _ref2$isFuzzyMatch = _ref2.isFuzzyMatch,\n isFuzzyMatch = _ref2$isFuzzyMatch === void 0 ? false : _ref2$isFuzzyMatch,\n _ref2$fuzzyMatchingTh = _ref2.fuzzyMatchingThreshold,\n fuzzyMatchingThreshold = _ref2$fuzzyMatchingTh === void 0 ? 0.8 : _ref2$fuzzyMatchingTh,\n _ref2$bestMatchOnly = _ref2.bestMatchOnly,\n bestMatchOnly = _ref2$bestMatchOnly === void 0 ? false : _ref2$bestMatchOnly;\n var input = !newFinalTranscript && matchInterim ? newInterimTranscript.trim() : newFinalTranscript.trim();\n var subcommands = Array.isArray(command) ? command : [command];\n var results = subcommands.map(function (subcommand) {\n if (isFuzzyMatch) {\n return testFuzzyMatch(subcommand, input, fuzzyMatchingThreshold);\n }\n\n return testMatch(subcommand, input);\n }).filter(function (x) {\n return x;\n });\n\n if (isFuzzyMatch && bestMatchOnly && results.length >= 2) {\n results.sort(function (a, b) {\n return b.howSimilar - a.howSimilar;\n });\n var _results$ = results[0],\n _command = _results$.command,\n commandWithoutSpecials = _results$.commandWithoutSpecials,\n howSimilar = _results$.howSimilar;\n callback(commandWithoutSpecials, input, howSimilar, {\n command: _command,\n resetTranscript: resetTranscript\n });\n } else {\n results.forEach(function (result) {\n if (result.isFuzzyMatch) {\n var _command2 = result.command,\n _commandWithoutSpecials = result.commandWithoutSpecials,\n _howSimilar = result.howSimilar;\n callback(_commandWithoutSpecials, input, _howSimilar, {\n command: _command2,\n resetTranscript: resetTranscript\n });\n } else {\n var _command3 = result.command,\n parameters = result.parameters;\n callback.apply(void 0, _toConsumableArray(parameters).concat([{\n command: _command3,\n resetTranscript: resetTranscript\n }]));\n }\n });\n }\n });\n }, [resetTranscript]);\n var handleTranscriptChange = (0, _react.useCallback)(function (newInterimTranscript, newFinalTranscript) {\n if (transcribing) {\n dispatch((0, _actions.appendTranscript)(newInterimTranscript, newFinalTranscript));\n }\n\n matchCommands(newInterimTranscript, newFinalTranscript);\n }, [matchCommands, transcribing]);\n var handleClearTranscript = (0, _react.useCallback)(function () {\n if (clearTranscriptOnListen) {\n dispatchClearTranscript();\n }\n }, [clearTranscriptOnListen]);\n (0, _react.useEffect)(function () {\n var id = SpeechRecognition.counter;\n SpeechRecognition.counter += 1;\n var callbacks = {\n onListeningChange: setListening,\n onMicrophoneAvailabilityChange: setMicrophoneAvailable,\n onTranscriptChange: handleTranscriptChange,\n onClearTranscript: handleClearTranscript,\n onBrowserSupportsSpeechRecognitionChange: setBrowserSupportsSpeechRecognition,\n onBrowserSupportsContinuousListeningChange: setBrowserSupportsContinuousListening\n };\n recognitionManager.subscribe(id, callbacks);\n return function () {\n recognitionManager.unsubscribe(id);\n };\n }, [transcribing, clearTranscriptOnListen, recognitionManager, handleTranscriptChange, handleClearTranscript]);\n var transcript = (0, _utils.concatTranscripts)(finalTranscript, interimTranscript);\n return {\n transcript: transcript,\n interimTranscript: interimTranscript,\n finalTranscript: finalTranscript,\n listening: listening,\n isMicrophoneAvailable: isMicrophoneAvailable,\n resetTranscript: resetTranscript,\n browserSupportsSpeechRecognition: browserSupportsSpeechRecognition,\n browserSupportsContinuousListening: browserSupportsContinuousListening\n };\n};\n\nexports.useSpeechRecognition = useSpeechRecognition;\nvar SpeechRecognition = {\n counter: 0,\n applyPolyfill: function applyPolyfill(PolyfillSpeechRecognition) {\n if (recognitionManager) {\n recognitionManager.setSpeechRecognition(PolyfillSpeechRecognition);\n } else {\n recognitionManager = new _RecognitionManager[\"default\"](PolyfillSpeechRecognition);\n }\n\n var browserSupportsPolyfill = !!PolyfillSpeechRecognition && (0, _utils.browserSupportsPolyfills)();\n _browserSupportsSpeechRecognition = browserSupportsPolyfill;\n _browserSupportsContinuousListening = browserSupportsPolyfill;\n },\n removePolyfill: function removePolyfill() {\n if (recognitionManager) {\n recognitionManager.setSpeechRecognition(_NativeSpeechRecognition[\"default\"]);\n } else {\n recognitionManager = new _RecognitionManager[\"default\"](_NativeSpeechRecognition[\"default\"]);\n }\n\n _browserSupportsSpeechRecognition = !!_NativeSpeechRecognition[\"default\"];\n _browserSupportsContinuousListening = _browserSupportsSpeechRecognition && !(0, _isAndroid[\"default\"])();\n },\n getRecognitionManager: function getRecognitionManager() {\n if (!recognitionManager) {\n recognitionManager = new _RecognitionManager[\"default\"](_NativeSpeechRecognition[\"default\"]);\n }\n\n return recognitionManager;\n },\n getRecognition: function getRecognition() {\n var recognitionManager = SpeechRecognition.getRecognitionManager();\n return recognitionManager.getRecognition();\n },\n startListening: function () {\n var _startListening = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _ref3,\n continuous,\n language,\n recognitionManager,\n _args = arguments;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _ref3 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, continuous = _ref3.continuous, language = _ref3.language;\n recognitionManager = SpeechRecognition.getRecognitionManager();\n _context.next = 4;\n return recognitionManager.startListening({\n continuous: continuous,\n language: language\n });\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n function startListening() {\n return _startListening.apply(this, arguments);\n }\n\n return startListening;\n }(),\n stopListening: function () {\n var _stopListening = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var recognitionManager;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n recognitionManager = SpeechRecognition.getRecognitionManager();\n _context2.next = 3;\n return recognitionManager.stopListening();\n\n case 3:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n function stopListening() {\n return _stopListening.apply(this, arguments);\n }\n\n return stopListening;\n }(),\n abortListening: function () {\n var _abortListening = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n var recognitionManager;\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n recognitionManager = SpeechRecognition.getRecognitionManager();\n _context3.next = 3;\n return recognitionManager.abortListening();\n\n case 3:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n function abortListening() {\n return _abortListening.apply(this, arguments);\n }\n\n return abortListening;\n }(),\n browserSupportsSpeechRecognition: function browserSupportsSpeechRecognition() {\n return _browserSupportsSpeechRecognition;\n },\n browserSupportsContinuousListening: function browserSupportsContinuousListening() {\n return _browserSupportsContinuousListening;\n }\n};\nvar _default = SpeechRecognition;\nexports[\"default\"] = _default;","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"useSpeechRecognition\", {\n enumerable: true,\n get: function get() {\n return _SpeechRecognition.useSpeechRecognition;\n }\n});\nexports[\"default\"] = void 0;\n\nvar _SpeechRecognition = _interopRequireWildcard(require(\"./SpeechRecognition\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nvar _default = _SpeechRecognition[\"default\"];\nexports[\"default\"] = _default;","// Libraries\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { withTranslation } from 'react-i18next';\n\n// Components\nimport Button from '../../Button';\n\nexport const Success = ({ hideModal, t }) => (\n
{t('common.you_have_signed_up')}
\n \n{t(getWarningMsg())}
\n{idea.responseText}
\n{idea.description}
\n{t('project.get_notified_message')}
\n{t('ideation.pre_moderate_warning_msg')}
\n{msg}
\n{t('ideation.flagged_msg')}
\n{body}
\n \n \n {t('ideation.pending_comment_reminder')}\n \n >\n );\n\n // rejected comment\n if (!approved)\n return (\n \n \n {t('ideation.moderator_message')}\n \n );\n\n return{body}
;\n };\n\n const shouldDisplayActions = approved && !requireModeration;\n\n return (\n\n {t(\n disabled\n ? 'ideation.idea_board_closed_notification'\n : 'ideation.thoughts_or_feedback'\n )}\n
\n{title}
\n {description &&{description}
}\n{t('engagement.responses_allowed', { choicesLimit })}
}\n{item.description}
}\n{index + 1}
\n {index !== lastIndex && (\n onChange(index + 1)} />\n )}\n{`${units} ${t('engagement.used')}`}
\n{currentBudgetUsed.toLocaleString()}
\n{t('engagement.remaining')}
\n{remainingBudget.toLocaleString()}
\n{t('engagement.errors.question_required_error')}
;\n case Rules.ALL_ROWS_REQUIRED:\n return{t('engagement.errors.all_rows_required_error')}
;\n case Rules.BUDGET:\n return{t('engagement.errors.over_budget_error')}
;\n case Rules.NUMBER:\n return{t('engagement.errors.number_error')}
;\n case Rules.NUMBER_RANGE: {\n const { rangeStart, rangeEnd } = question.displayData;\n return (\n\n {t('engagement.errors.number_range_error', { rangeStart, rangeEnd })}\n
\n );\n }\n case Rules.LENGTH_RANGE: {\n const { characterCountMin, characterCountMax } = question.displayData;\n return (\n\n {t('engagement.errors.length_range_error', {\n characterCountMin,\n characterCountMax,\n })}\n
\n );\n }\n case Rules.VALIDATION_TYPE: {\n const { validationType } = question.displayData;\n return (\n\n {t('engagement.errors.validation_type_error', {\n validationType: t(Validations[validationType]?.label),\n })}\n
\n );\n }\n case Rules.REGULAR_EXPRESSION:\n return{t('engagement.errors.regular_expression_error')}
;\n case Rules.EXCEEDED_MAX_CHOICES:\n return{t('engagement.errors.max_choices_limit_error')}
;\n default:\n return null;\n }\n });\n\n if (errors?.length) {\n return\n {name}\n {position}\n
\n\n {customizeDescription}\n\n ) : (\n
\n For the purpose of preventing duplicate submissions to this survey from the same\n participant, we would like your consent to collect information about your browser and\n attach it to your submission.\n
\n\n You have the option to continue without consent, but your submission may be excluded\n from the results of this survey.\n
\n\n {quote.message ?\n{quote.message}: }\n
{t('engagement.quit_confirm')}
\n{description}
\n\n
{t('engagement.get_notified_message')}
\n{t('engagement.learn_more')}
\n{t('engagement.share_with_friends')}
\n{t('engagement.responses_erased_message')}
\n{t('engagement.try_again_message')}
\n{t('engagement.engagement_thanks_for_coming')}
\n {project?.public && project?.projectHubEnabled && !isEmbedded() && (\n\n
\n In the meantime, you can\n Click here \n to give it another try.\n
\n {projectLink && (\n \n \n {backToProjectText}\n \n )}\n
\n )}\n {title &&\n {projectUpdateText}\n {projectUpdateText && -}\n {translateDate(date, t)}\n
\n )}\n\n {t('project.get_notified_message')}\n
\n\n {spanText}\n this.showMore()}\n onKeyPress={(e) => this.handleKeyPress(e)}\n tabIndex={0}\n aria-controls=\"#show-more-list-1\"\n id=\"show-more-button\"\n >\n {showMoreButtonText}\n \n
\n )}\n >\n );\n }\n}\n\nShowMoreList.propTypes = {\n children: PropTypes.arrayOf(PropTypes.node),\n};\n\nShowMoreList.defaultProps = {\n children: [],\n};\n\nexport default ShowMoreList;\n","/* eslint-disable react/forbid-prop-types */\n// Libraries\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { withTranslation } from 'react-i18next';\nimport classNames from 'classnames';\n\n// Utilities\nimport { populatePath, rtlLanguage, translateDate } from 'common/utils/helpers';\n\n// Routes\nimport Routes from 'routes';\n\n// Components\nimport Link from 'common/components/Link';\n\nconst AnnouncementListItem = ({ t, match, announcement }) => {\n const {\n id,\n attributes: {\n title,\n shortDescription,\n titleTranslations,\n shortDescriptionTranslations,\n publishedAt,\n slug,\n },\n } = announcement;\n const {\n params: { locale },\n } = match;\n const announcementTitle = titleTranslations ? titleTranslations[locale] : title;\n const announcementDescription = shortDescriptionTranslations\n ? shortDescriptionTranslations[locale]\n : shortDescription;\n return (\n{translateDate(publishedAt, t)}
\n )}\n {announcementDescription && (\n{announcementDescription}
\n )}\n\n \n {title}\n
\n\n {quote.message &&\n );\n};\n\nSponsorQuote.propTypes = {\n quote: PropTypes.shape({\n avatarUrls: PropTypes.shape({\n desktop: PropTypes.string,\n card: PropTypes.string,\n mobile: PropTypes.string,\n }),\n message: PropTypes.string,\n name: PropTypes.string,\n jobTitle: PropTypes.string,\n }).isRequired,\n};\n\nexport default SponsorQuote;\n","// Libraries\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { useTranslation } from 'react-i18next';\n\n// Utilities\nimport {\n renderMarkdown,\n determineImageSize,\n classicTheme,\n storyTheme,\n getVariationByLocale,\n getMediaDataByLocale,\n} from 'common/utils/helpers';\n\n// Components\nimport YoutubeEmbedder from 'common/components/YoutubeEmbedder';\nimport NotificationsSignup from 'common/components/NotificationsSignup';\nimport EngagementTile from 'project/components/EngagementTile';\nimport IdeaBoardTile from 'project/components/IdeaBoardTile';\nimport DiscussionTopicTile from 'project/components/DiscussionTopicTile';\nimport SponsorQuote from 'project/components/SponsorQuote';\n\nconst ProjectDetail = (props) => {\n const { project } = props;\n const {\n title,\n welcomeText,\n introduction,\n video,\n supportingImage,\n sortedAssociatedRecords,\n notificationSignUpEnabled,\n quote,\n category,\n } = project;\n const { t } = useTranslation();\n const { title: categoryTitle } = category || {};\n const { inDefaultLanguage } = gon;\n let supportingImageInSelectedLocale = supportingImage;\n let videoInSelectedLocale = video;\n\n if (!inDefaultLanguage) {\n supportingImageInSelectedLocale = getMediaDataByLocale(supportingImage, gon.currentLocale);\n videoInSelectedLocale = getVariationByLocale(video?.variations, gon.currentLocale, video);\n }\n\n return (\n{quote.message}
}\n\n {headshotImg && (\n\n\n\n )}\n \n\n
\n {quote.name}\n {quote.jobTitle}\n
\n \n
{t('project.get_notified_message')}
\n{project.teaser}
}\n{category.description}
\n{description}
\n{project.teaser}
}\n{item.description || item.shortDescription}
\n\n {(descriptionTranslations && descriptionTranslations[locale]) || description}\n
\n{featured.teaser}
}\n{t('project.stay_informed_desc')}
\n{category.description}
\n{featured.teaser}
}\n{t('project.stay_informed_desc')}
\n{t('project.get_notified_message')}
\n