{"version":3,"sources":["webpack:///./ClientApp/services/Localizer.tsx","webpack:///./ClientApp/shared/components/Spinner.tsx","webpack:///./ClientApp/services/AxiosHelper.ts","webpack:///./ClientApp/shared/edit/fields/FieldInputErrorWrapper.tsx","webpack:///./ClientApp/shared/edit/fields/FieldLabel.tsx","webpack:///./ClientApp/shared/edit/InlineAlert.tsx","webpack:///./ClientApp/shared/components/svg/XSVG.tsx","webpack:///./ClientApp/services/UserData.ts","webpack:///./ClientApp/shared/edit/fields/CheckboxInputField.tsx","webpack:///./ClientApp/shared/edit/fields/CheckBoxField.tsx","webpack:///./ClientApp/shared/edit/fields/DropdownField.tsx","webpack:///./ClientApp/shared/edit/fields/ValidationMessages.tsx","webpack:///./ClientApp/shared/edit/fields/StarRatingField.tsx","webpack:///./ClientApp/shared/edit/fields/TextAreaField.tsx","webpack:///./ClientApp/shared/edit/fields/InputField.tsx","webpack:///./ClientApp/shared/edit/fields/TextBoxField.tsx","webpack:///../Roc.SharedClientApp/types/model-status.ts","webpack:///./ClientApp/features/file-upload/lib/exif-js/exif.js","webpack:///./ClientApp/shared/util/AccountUrls.ts","webpack:///./ClientApp/shared/util/ErrorBoundary.tsx","webpack:///./ClientApp/shared/components/svg/GarbageCanSVG.tsx","webpack:///./ClientApp/shared/polyfills/getAttributeNames.js","webpack:///./ClientApp/shared/util/ApplicationInit.tsx","webpack:///./ClientApp/shared/edit/OptionalFieldMarker.tsx","webpack:///./ClientApp/shared/hooks/useDelayedDisplay.tsx","webpack:///./ClientApp/shared/components/svg/CheckCircleSVG.tsx","webpack:///./ClientApp/shared/util/Misc.ts","webpack:///./ClientApp/features/setup/recaptcha.ts","webpack:///./ClientApp/shared/components/hawksearch/components/svg/DashCircleSVG.tsx","webpack:///./ClientApp/shared/components/svg/CircleExclamationSVG.tsx","webpack:///./ClientApp/shared/components/CircleButton.tsx","webpack:///./ClientApp/shared/components/svg/StarEmptySVG.tsx","webpack:///./ClientApp/shared/components/svg/StarSVG.tsx","webpack:///./ClientApp/shared/components/star-rating/StarRating.tsx","webpack:///./ClientApp/shared/components/star-rating/useStarRating.ts","webpack:///./ClientApp/shared/components/svg/PencilSVG.tsx","webpack:///./ClientApp/features/file-upload/DisplayBytes.tsx","webpack:///./ClientApp/features/file-upload/FileUploadInfo.tsx","webpack:///./ClientApp/features/file-upload/FileUpload.tsx","webpack:///./ClientApp/features/careers-form/JobApplicationForm.tsx","webpack:///./ClientApp/features/careers-form/index.tsx","webpack:///./ClientApp/services/ServerData.ts","webpack:///./ClientApp/shared/hooks/useLoader.ts","webpack:///./ClientApp/shared/components/svg/FolderSVG.tsx","webpack:///./ClientApp/shared/components/svg/GarbageCanCircleSVG.tsx","webpack:///./ClientApp/shared/components/StatusDisplay.tsx","webpack:///./ClientApp/shared/hooks/useInterval.tsx","webpack:///./ClientApp/shared/hooks/useReCaptchaToken.tsx","webpack:///./ClientApp/shared/hooks/useRocReCaptchaToken.tsx","webpack:///./ClientApp/shared/hooks/useBaseAxiosFormSubmitter.ts","webpack:///./ClientApp/shared/hooks/useBaseAxiosSubmitter.ts","webpack:///./ClientApp/util/StringUtil.ts","webpack:///./ClientApp/shared/edit/RocForm.tsx","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css?5a6e","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css","webpack:///./ClientApp/shared/edit/fields/ReCaptchaDisclaimer.tsx"],"names":["LocalizerResources","isAlreadyLogged","initializeLocalizerResources","windowWithResources","window","__ROC_LOCALIZER_RESOURCES__","Array","isArray","forEach","obj","Object","keys","key","Localizer","replaceStrings","length","console","warn","resource","replace","match","index","LocalizedSpan","props","resourceKey","args","localizedString","data-testid","toKebabCase","dangerouslySetInnerHTML","__html","Spinner","light","waitMs","align","block","parentCentered","useDelayedDisplay","spinner","className","classnames","AxiosHelper","axios","create","defaults","headers","common","interceptors","request","use","config","method","toLowerCase","getCsrfToken","csrfToken","RequestVerificationToken","addUnauthorizedAccessInterceptor","history","response","error","status","location","AccountUrls","Login","encodeURIComponent","pathname","Promise","reject","FieldInputErrorWrapper","hideIcon","children","inline","name","meta","useField","invalid","submitError","dirtySinceLastSubmit","submitting","touched","FieldLabel","label","id","isRequired","htmlFor","testId","trim","InlineAlert","title","defaultProps","theme","isTitleOnOwnRow","isCollapsed","onCollapse","message","axiosError","isAxiosError","data","type","onClick","XSVG","rest","viewBox","focusable","aria-hidden","d","userDataPromise","getUserData","get","getUserDataNoCache","userData","requestToken","CheckboxInputField","input","onChange","checked","disabled","readOnly","placeholder","step","defaultValue","dirty","defaultChecked","aria-describedby","CheckBoxField","afterSubmit","allowNull","beforeSubmit","formatOnBlur","initialValue","isEqual","subscription","DropdownField","addSelectOption","options","validateFields","value","onFocus","onBlur","map","option","text","getErrorArray","errorOrSubmitError","errors","push","filter","ValidationMessages","concat","aria-live","aria-atomic","Fragment","StarRatingField","maxRating","OptionalFieldMarker","StarRating","readonly","TextAreaField","rows","validate","component","format","parse","render","InputField","React","forwardRef","ref","TextBoxField","ModelStatus","EXIF","this","EXIFwrapped","exports","module","ExifTags","Tags","TiffTags","GPSTags","0","IFD1Tags","StringValues","ExposureProgram","1","2","3","4","5","6","7","8","MeteringMode","255","LightSource","9","10","11","12","13","14","15","17","18","19","20","21","22","23","24","Flash","SensingMethod","SceneCaptureType","SceneType","CustomRendered","WhiteBalance","GainControl","Contrast","Saturation","Sharpness","SubjectDistanceRange","FileSource","Components","imageHasData","img","exifdata","getImageData","callback","handleBinaryFile","binFile","findEXIFinJPEG","iptcdata","file","dataView","DataView","getUint8","offset","byteLength","isFieldSegmentStart","nameHeaderLength","startOffset","sectionLength","getUint16","readIPTCData","findIPTCinJPEG","isXmpEnabled","xmpdata","self","dom","DOMParser","getStringFromDB","xmpString","xmpEndIndex","indexOf","indexOfXmp","substring","slice","xml2Object","parseFromString","findXMPinJPEG","call","e","src","test","base64","contentType","binary","atob","len","buffer","ArrayBuffer","view","Uint8Array","i","charCodeAt","base64ToArrayBuffer","fileReader","FileReader","onload","target","result","url","http","XMLHttpRequest","open","responseType","send","objectURLToBlob","blob","readAsArrayBuffer","Blob","File","readEXIFData","IptcFieldMap","fieldValue","fieldName","dataSize","segmentType","segmentStartPos","getInt16","hasOwnProperty","readTags","tiffStart","dirStart","strings","bigEnd","entryOffset","entries","tags","readTagValue","vals","val","n","numerator","denominator","numValues","getUint32","valueOffset","Number","getInt32","start","outstr","String","fromCharCode","tag","exifData","gpsData","tiffOffset","firstIFDOffset","ExifIFDPointer","GPSInfoIFDPointer","IFD1OffsetPointer","getNextIFDOffset","thumbTags","JpegIFOffset","JpegIFByteCount","tOffset","tLength","readThumbnailImage","xml2json","xml","json","nodeType","attributes","j","attribute","item","nodeName","nodeValue","hasChildNodes","childNodes","child","old","idx","itemAtt","dataKey","dataValue","undefined","textContent","enableXmp","disableXmp","getData","Image","HTMLImageElement","complete","apply","arguments","getTag","getIptcTag","getAllTags","a","getAllIptcTags","pretty","strPretty","readFromBinaryFile","define","BaseUrl","ServerData","ACCOUNT_URL_BASE","ACCOUNT_LOGIN_URL","Login2fa","ACCOUNT_LOGIN_WITH_2FA_URL","Register","ACCOUNT_REGISTER_URL","ForgotPassword","ACCOUNT_FORGOT_PASSWORD_URL","LoginWithRecoveryCode","ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL","Logout","ACCOUNT_LOGOUT_URL","OrganizationReview","ACCOUNT_ORGANIZATION_REVIEW_URL","OrganizationSelector","ACCOUNT_ORGANIZATION_SELECTOR_URL","ErrorBoundary","setState","state","renderError","Component","renderProps","GarbageCanSVG","Element","prototype","getAttributeNames","getDataPropsFromAttributes","element","s","startsWith","attributeName","toCamelCase","getAttribute","initReactApp","getReactElement","elementId","document","getElementById","ReactDOM","Suspense","fallback","initReactAppByAttribute","elements","querySelectorAll","memo","useState","display","setDisplay","useEffect","timeout","setTimeout","clearTimeout","CheckCircleSVG","ms","resolve","sleep","handleAxiosErrorWithValidation","errorMessage","validationErrorCallback","genericErrorCallback","globalErrors","errorsWithModifiedArrayIndex","reduce","acc","newValidationState","unflatten","FORM_ERROR","getQueryParam","paramName","decodeParam","urlParams","URLSearchParams","search","paramValue","decodeURIComponent","reCaptchaCallbackPromise","setupReCaptcha","windowWithReCaptchaCallbacks","onReCaptchaLoadCallback","DashCircleSVG","class","fill","CircleExclamationSVG","CircleButton","icon","otherProps","StarEmptySVG","StarSVG","params","ratingStars","setRatingStars","ratingHovered","setRatingHovered","newState","isFull","isPending","isHighlighted","isChecked","ratingValue","useStarRating","Error","onInputChange","parseInt","currentTarget","modifierClasses","onMouseEnter","onMouseLeave","PencilSVG","DisplayBytes","bytes","si","thresh","Math","abs","units","u","toFixed","humanFileSize","FileUploadInfo","formApi","onRemoveFile","onUploadError","uploadProgress","uploadComplete","uploadError","previewUrl","URL","createObjectURL","acceptedFile","blobSlice","chunks","ceil","size","currentChunk","spark","SparkMD5","loadNext","end","fileReaderTarget","append","clientSideHash","formData","FormData","post","onUploadProgress","progressEvent","percentCompleted","round","loaded","total","updateProgress","cancelToken","CancelToken","then","x","resp","fileInfo","checksum","change","uploadGuid","guid","catch","Axios","isCancel","consoleError","getElementsByClassName","innerHTML","onerror","abort","removeButtonClicked","revokeObjectURL","source","delete","token","onPreviewImageLoaded","onRemoveButtonClicked","alt","onLoad","style","fontWeight","color","renderThumbnail","event","imageElement","orientation","css","exif2css","transform","transformOrigin","toString","renderUploadProgress","Dropzone","lazy","FileUpload","accept","maxSize","rejectedFile","fileRemovedHandler","onDrop","acceptedFiles","rejectedFiles","multiple","getRootProps","getInputProps","JobApplicationForm","jobPositionsOptions","__TAPECASE_CAREERS_PAGE_DATA__","jobPositions","o","firstName","lastName","email","phone","jobPositionId","uploadedFileInfo","initialValues","setInitialValues","jobApplicationFormSubmitter","useAxiosFormSubmitter","userDataResponse","summary","phoneNumber","submitted","RocForm","onSubmit","handleSubmit","form","ReCaptchaDisclaimer","windowWithServerData","__ROC_SERVER_DATA__","initializeServerData","useLoader","loading","setLoading","setError","setResponse","FolderSVG","GarbageCanCircleSVG","StatusDisplay","Published","Inactive","Deleted","Draft","Archived","useInterval","delay","enabled","savedCallback","useRef","intervalId","current","setInterval","clearInterval","ReCaptchaKeyWarning","useReCaptchaToken","reCaptchaKey","action","initialEnabled","reCaptchaWindow","tokenPromise","tokenPromiseIsResolved","initPromise","setEnabled","useLayoutEffect","grecaptcha","ready","getToken","invalidateToken","force","execute","useRocReCaptchaToken","ReCaptchaV3Key","isReCaptchaEnabled","IsReCaptchaEnabled","useRocFormSubmitter","axiosParams","reCaptchaActionName","csrfEnabled","stateful","invalidateTokenOnSuccess","useBaseAxiosFormSubmitter","responseCallback","submitterCallback","formValidationState","submitter","useBaseAxiosSubmitter","formValues","submit","submitResult","responseData","getRecaptchaToken","payload","promises","all","reCaptchaToken","serverResponse","toLocaleLowerCase","word","toUpperCase","stripHtml","html","tmp","createElement","innerText","trimString","focusOnError","createDecorator","debug","destroyOnUnregister","initialValuesEqual","keepDirtyOnReinitialize","validateOnBlur","decorators","mutators","api","content","__esModule","default","locals","___CSS_LOADER_API_IMPORT___"],"mappings":"6/BAwJA,IAAMA,EAAwC,GAKxCC,EAA2C,GAKjD,SAASC,IACR,IAAMC,EAAsBC,OAG3BD,GACAA,EAAoBE,6BACpBC,MAAMC,QAAQJ,EAAoBE,8BAElCF,EAAoBE,4BAA4BG,SAAQ,SAACC,GACxD,cAAkBC,OAAOC,KAAKF,GAA9B,eAAoC,CAA/B,IAAMG,EAAG,KACbZ,EAAmBY,GAAOH,EAAIG,OAc3B,SAASC,EACfD,GAEC,2BADEE,EACF,iCADEA,EACF,kBAKD,GAJ+C,IAA3CJ,OAAOC,KAAKX,GAAoBe,QACnCb,KAGIF,IAAuBA,EAAmBY,GAQ9C,OALMX,EAAgBW,KACpBI,QAAQC,KAAKL,EAAK,2DAClBX,EAAgBW,IAAO,GAGlBA,EAGR,IAAMM,EAAWlB,EAAmBY,GAEpC,OAAKE,EAIEI,EAASC,QAAQ,YAAY,SAACC,EAAeC,GACnD,OAAOP,EAAeO,GAASP,EAAeO,GAAS,MAJ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5CnB,IAAIG,EAAM,EAAQ,IACFC,EAAU,EAAQ,IAIC,iBAFvBA,EAAUA,EAAQC,WAAaD,EAAQE,QAAUF,KAG/CA,EAAU,CAAC,CAACtgB,EAAOkG,EAAIoa,EAAS,MAG9C,IAAI9iB,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEP6iB,EAAIC,EAAS9iB,GAI1BwC,EAAOD,QAAUugB,EAAQG,QAAU,I,oBChBnC1gB,EADkC,EAAQ,IAChC2gB,EAA4B,IAE9BviB,KAAK,CAAC6B,EAAOkG,EAAI,6lGAA8lG,KAEvnGlG,EAAOD,QAAUA,G,gCCNjB,oEAOe,SAAS+a,IACvB,IAAM4B,EAAehQ,IAAWgR,eAC1BC,EAAqBjR,IAAWkR,mBACtC,OAAOlB,GAAgBiB,EACtB,yBAAKlmB,UAAU,kBACd,yBAAKA,UAAU,sBACd,kBAAC,IAAD,CACCf,YAAY,gBACZC,KAAM,CAAC,sCAAuC,yCAI9C,Q","file":"careers-form.js","sourcesContent":["import { AddressResourceKeys } from 'features/address-book/resources';\r\nimport { ContactFormResourceKeys } from 'features/contact-form/resources';\r\nimport { CreatePasswordResourceKeys } from 'features/create-password/resources';\r\nimport { LoginWith2faResourceKeys } from 'features/login-with-2fa/resources';\r\nimport { LoginWithRecoveryCodeResourceKeys } from 'features/login-with-recovery-code/resources';\r\nimport { LoginResourceKeys } from 'features/login/resources';\r\nimport { MyAccountResourceKeys } from 'features/my-account/resources';\r\nimport { ResetPasswordResourceKeys } from 'features/reset-password/resources';\r\nimport { SubmitQuestionResourceKeys } from 'features/submit-question/resources';\r\nimport * as React from 'react';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\n// #region Commerce\r\nimport { CommerceResourceKeys } from 'features/commerce/CommerceResourceKeys';\r\n// #endregion\r\n\r\n// #region TapeCase Customization\r\nimport { SubmitQuoteResourceKeys } from 'features/submit-quote/resources';\r\nimport { TapeCaseRegistrationResourceKeys } from 'features/register-tapecase/resources';\r\nimport { CareersFormResourceKeys } from 'features/careers-form/resources';\r\nimport { FileUploadResourceKeys } from 'features/file-upload/resources';\r\n// #endregion\r\n\r\n/**\r\n * Type that will hold all the global localization keys\r\n */\r\ntype LocalizerGlobalResourceKeys =\r\n\t| 'Success'\r\n\t| 'OfTotalPages'\r\n\t| 'Cancel'\r\n\t| 'Confirm'\r\n\t| 'FirstName'\r\n\t| 'LastName'\r\n\t| 'Email'\r\n\t| 'Username'\r\n\t| 'Amount'\r\n\t| 'NameOnCard'\r\n\t| 'CardNumber'\r\n\t| 'ExpDate'\r\n\t| 'ExpMonth'\r\n\t| 'ExpYear'\r\n\t| 'Expires'\r\n\t| 'Expired'\r\n\t| 'SecurityCode'\r\n\t| 'Submit'\r\n\t| 'Save'\r\n\t| 'ZipCode'\r\n\t| 'Remove'\r\n\t| 'Removed'\r\n\t| 'Update'\r\n\t| 'Undo'\r\n\t| 'Cancel'\r\n\t| 'Enter'\r\n\t| 'Close'\r\n\t| 'SortBy'\r\n\t| 'PleaseWait'\r\n\t| 'Unknown'\r\n\t| 'Yes'\r\n\t| 'No'\r\n\t| 'Delete'\r\n\t| 'Update'\r\n\t| 'SaveAndContinueButtonText'\r\n\t| 'SaveAndContinue'\r\n\t| 'Continue'\r\n\t| 'SaveErrorMessage'\r\n\t| 'Edit'\r\n\t| 'ErrorMessageGenericTitle'\r\n\t| 'CheckEnteredValues'\r\n\t| 'ErrorMessageForbidden'\r\n\t| 'ErrorMessageNetwork'\r\n\t| 'ErrorOccurredSubmittingTheForm'\r\n\t| 'UnexpectedErrorOccurred'\r\n\t| 'Login'\r\n\t| 'ReturnToShipping'\r\n\t| 'BreadcrumbsLabel'\r\n\t| 'Other'\r\n\t| 'RememberMe'\r\n\t| 'ForgotYourPassword'\r\n\t| 'RegisterNewUserLinkText'\r\n\t| 'LoginPageTitleText'\r\n\t| 'ForgotPasswordPageTitle'\r\n\t| 'ForgotPasswordConfirmationPageTitle'\r\n\t| 'ForgotPasswordConfirmation'\r\n\t| 'Optional'\r\n\t| 'SearchBoxPlaceholder'\r\n\t| 'XOutOfYStars'\r\n\t| 'XToYOfZ'\r\n\t| 'ModalLabel'\r\n\t| 'RequiredFields'\r\n\t| 'Status'\r\n\t| 'Version'\r\n\t| 'CreatedOn'\r\n\t| 'CreatedBy'\r\n\t| 'ModifiedOn'\r\n\t| 'ModifiedBy'\r\n\t| 'OpenStatusInformation'\r\n\t| 'CloseStatusInformation'\r\n\t| 'SearchFilter'\r\n\t| 'Pagination'\r\n\t| 'Previous'\r\n\t| 'Next'\r\n\t| 'ClearFilter';\r\n\r\n/**\r\n * Type that will hold all the localization keys\r\n */\r\nexport type LocalizerResourceKey =\r\n\t| LocalizerGlobalResourceKeys\r\n\t| LoginResourceKeys\r\n\t| ContactFormResourceKeys\r\n\t// #region Commerce\r\n\t| CommerceResourceKeys\r\n\t// #endregion\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| SubmitQuestionResourceKeys\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| MyAccountResourceKeys\r\n\t| LoginWith2faResourceKeys\r\n\t| LoginWithRecoveryCodeResourceKeys\r\n\t| AddressResourceKeys\r\n\t// #region TapeCase Customization\r\n\t| SubmitQuoteResourceKeys\r\n\t| TapeCaseRegistrationResourceKeys\r\n\t| CareersFormResourceKeys\r\n\t| FileUploadResourceKeys;\r\n// #endregion\r\n\r\n/**\r\n * Interface for the resources\r\n *\r\n * @export\r\n * @interface LocalizerResource\r\n */\r\ninterface LocalizerResource {\r\n\t[id: string]: string;\r\n}\r\n\r\n/**\r\n * Extends Window with a property that will hold the localizer resources\r\n *\r\n * @interface WindowWithResources\r\n * @extends {Window}\r\n */\r\nexport interface WindowWithResources extends Window {\r\n\t__ROC_LOCALIZER_RESOURCES__?: LocalizerResource[];\r\n}\r\n\r\n/**\r\n * Main object that will hold all the localized resources\r\n */\r\nconst LocalizerResources: LocalizerResource = {};\r\n\r\n/**\r\n * To prevent redundant logging\r\n */\r\nconst isAlreadyLogged: Record = {};\r\n\r\n/**\r\n * Initializer function that will populate the main localized resources object\r\n */\r\nfunction initializeLocalizerResources() {\r\n\tconst windowWithResources = window as WindowWithResources;\r\n\r\n\tif (\r\n\t\twindowWithResources &&\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__ &&\r\n\t\tArray.isArray(windowWithResources.__ROC_LOCALIZER_RESOURCES__)\r\n\t) {\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__.forEach((obj) => {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tLocalizerResources[key] = obj[key];\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Function that can be used to load the localized strings with support to parameter replacements\r\n *\r\n * @export\r\n * @param {string} key\r\n * @param {...string[]} replaceStrings\r\n * @returns\r\n */\r\nexport function Localizer(\r\n\tkey: TResourceKey,\r\n\t...replaceStrings: string[]\r\n) {\r\n\tif (Object.keys(LocalizerResources).length === 0) {\r\n\t\tinitializeLocalizerResources();\r\n\t}\r\n\r\n\tif (!LocalizerResources || !LocalizerResources[key]) {\r\n\t\t// if running in a test environment, just skip any warnings.\r\n\t\tif (process.env.NODE_ENV !== 'test') {\r\n\t\t\tif (!isAlreadyLogged[key]) {\r\n\t\t\t\tconsole.warn(key, 'Localizer Resource not found. Key will be used instead.');\r\n\t\t\t\tisAlreadyLogged[key] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn key;\r\n\t}\r\n\r\n\tconst resource = LocalizerResources[key];\r\n\r\n\tif (!replaceStrings) {\r\n\t\treturn resource;\r\n\t}\r\n\r\n\treturn resource.replace(/{(\\d+)}/g, (match: string, index: number) => {\r\n\t\treturn replaceStrings[index] ? replaceStrings[index] : '';\r\n\t});\r\n}\r\n\r\n/**\r\n * Interface for the LocalizedSpan component\r\n *\r\n * @interface LocalizedSpanProps\r\n */\r\ninterface LocalizedSpanProps {\r\n\tresourceKey: LocalizerResourceKey;\r\n\targs?: string[];\r\n}\r\n\r\n/**\r\n * Component responsible for the initialization of the react app\r\n */\r\nexport function LocalizedSpan(props: LocalizedSpanProps) {\r\n\tconst { resourceKey, args = [] } = props;\r\n\tconst localizedString = Localizer(resourceKey, ...args);\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport useDelayedDisplay from 'shared/hooks/useDelayedDisplay';\r\nimport classnames from 'classnames';\r\n\r\ntype SpinnerAlignment = 'left' | 'right' | 'none';\r\n\r\ninterface SpinnerProps {\r\n\tlight?: boolean;\r\n\twaitMs?: number;\r\n\talign?: SpinnerAlignment;\r\n\tblock?: boolean;\r\n\tparentCentered?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable roc-spinner component with color, alignment and wait time props.\r\n *\r\n * @export\r\n * @param {SpinnerProps} { light = false, waitMs = 200, align = 'right', block }\r\n * @returns\r\n */\r\nexport default function Spinner({\r\n\tlight = false,\r\n\twaitMs = 200,\r\n\talign = 'right',\r\n\tblock,\r\n\tparentCentered = false,\r\n}: SpinnerProps) {\r\n\tconst display = useDelayedDisplay(waitMs);\r\n\r\n\tif (!display) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst spinner = (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n\r\n\tif (parentCentered) {\r\n\t\treturn
{spinner}
;\r\n\t}\r\n\r\n\treturn spinner;\r\n}\r\n","import axios, { AxiosInstance, AxiosResponse, AxiosError } from 'axios';\r\nimport AccountUrls from 'shared/util/AccountUrls';\r\nimport { getCsrfToken } from './UserData';\r\n\r\n/**\r\n * Helper that creates an instance of Axios to be used throughout the client application\r\n * and adds a default X-Requested-With header to all requests.\r\n *\r\n */\r\nconst AxiosHelper: AxiosInstance = axios.create();\r\nAxiosHelper.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\r\n\r\n// Add CSRF tokens to all commands that are not GET, HEAD, or OPTIONS\r\nAxiosHelper.interceptors.request.use(async (config) => {\r\n\tif (\r\n\t\tconfig.method?.toLowerCase() !== 'get' &&\r\n\t\tconfig.method?.toLowerCase() !== 'head' &&\r\n\t\tconfig.method?.toLowerCase() !== 'options'\r\n\t) {\r\n\t\tconst csrfToken = await getCsrfToken();\r\n\t\tconfig.headers = { RequestVerificationToken: csrfToken, ...config.headers };\r\n\t}\r\n\treturn config;\r\n});\r\n\r\nexport default AxiosHelper;\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nexport const addUnauthorizedAccessInterceptor = (history) => {\r\n\t// this allows us to act when any request going through axios succeeds or fails.\r\n\tAxiosHelper.interceptors.response.use(\r\n\t\t(response: AxiosResponse) => {\r\n\t\t\treturn response;\r\n\t\t},\r\n\t\t(error: AxiosError) => {\r\n\t\t\tif (error.response && error.response.status === 401) {\r\n\t\t\t\twindow.location.replace(\r\n\t\t\t\t\t`${AccountUrls.Login}?ReturnUrl=${encodeURIComponent(window.location.pathname)}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.reject(error);\r\n\t\t},\r\n\t);\r\n};\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport CircleExclamationSVG from 'shared/components/svg/CircleExclamationSVG';\r\nimport { useField } from 'react-final-form';\r\n\r\ninterface FieldInputErrorWrapperProps {\r\n\thideIcon?: boolean;\r\n\tchildren: React.ReactNode;\r\n\tinline?: boolean;\r\n\tname: string;\r\n}\r\n\r\n/**\r\n * Component for handling the invalid styles for inputs.\r\n *\r\n * @export\r\n * @param {FieldInputErrorWrapperProps} props\r\n * @returns\r\n */\r\nexport default function FieldInputErrorWrapper(props: FieldInputErrorWrapperProps) {\r\n\tconst { hideIcon = false, children, inline = false, name } = props;\r\n\tconst { meta } = useField(name);\r\n\tconst invalid =\r\n\t\t(meta.error || (meta.submitError && !meta.dirtySinceLastSubmit && !meta.submitting)) &&\r\n\t\tmeta.touched &&\r\n\t\tmeta.invalid\r\n\t\t\t? meta.invalid\r\n\t\t\t: false;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\t{invalid && !hideIcon ? : null}\r\n\t\t
\r\n\t);\r\n}\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\nimport React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\n\r\nexport interface FieldLabelProps extends WithTestIdOptional {\r\n\tlabel: string;\r\n\tname: string;\r\n\tid?: string;\r\n\tisRequired: boolean;\r\n\thtmlFor?: string;\r\n\tchildren?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Wrapper component for all field labels for ease of use.\r\n */\r\nexport default function FieldLabel(props: FieldLabelProps) {\r\n\tconst { label, id, isRequired, htmlFor, children, testId } = props;\r\n\r\n\tif (!label || !label.trim()) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{label}\r\n\t\t\t{!isRequired ? : null}\r\n\t\t\t{children ? children : null}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AxiosError } from 'axios';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\n\r\ntype Theme = 'danger' | 'warning' | 'info' | 'success';\r\n\r\nexport interface ErrorAlertProps {\r\n\t/**\r\n\t * The title of the error message such as \"Uh Oh!\" or \"An Unexpected Error has Occurred!\"\r\n\t */\r\n\ttitle: string;\r\n\r\n\t/**\r\n\t * The error message to display if an error object doesn't have a more appropriate message.\r\n\t */\r\n\tmessage: React.ReactNode | string;\r\n\r\n\tchildren?: any;\r\n\r\n\ttheme?: Theme;\r\n\r\n\tisTitleOnOwnRow?: boolean;\r\n\r\n\t/** The error responsible for this message. */\r\n\terror: AxiosError | Error | null;\r\n\r\n\t/**\r\n\t * Method from parent that handles collapse state.\r\n\t */\r\n\tonCollapse?: (collased: boolean) => void;\r\n\r\n\t/**\r\n\t * Controlled collapse state from parent.\r\n\t */\r\n\tisCollapsed?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable Error Alert Component.\r\n */\r\nexport default function InlineAlert(props: ErrorAlertProps) {\r\n\tconst {\r\n\t\ttitle = InlineAlert.defaultProps.title,\r\n\t\tchildren,\r\n\t\ttheme = 'danger',\r\n\t\tisTitleOnOwnRow = false,\r\n\t\terror = InlineAlert.defaultProps.error,\r\n\t\tisCollapsed = false,\r\n\t\tonCollapse,\r\n\t} = props;\r\n\r\n\tlet { message = InlineAlert.defaultProps.message } = props;\r\n\r\n\tconst axiosError = error as AxiosError | null;\r\n\tif (axiosError?.isAxiosError && axiosError != null && axiosError.response == null && axiosError.request != null) {\r\n\t\tmessage = Localizer('ErrorMessageNetwork');\r\n\t}\r\n\r\n\tif (axiosError?.isAxiosError && (axiosError?.response?.status === 401 || axiosError?.response?.status === 403)) {\r\n\t\tmessage = Localizer('ErrorMessageForbidden');\r\n\t}\r\n\r\n\tif (axiosError?.response?.data?.message) {\r\n\t\tmessage = axiosError.response.data.message;\r\n\t}\r\n\r\n\tif (isCollapsed) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{onCollapse ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{title ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{title}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{message ? {message} : null}\r\n\r\n\t\t\t{children ? <> {children} : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Error Alert Default Props\r\n */\r\nInlineAlert.defaultProps = {\r\n\ttitle: Localizer('ErrorMessageGenericTitle'),\r\n\tmessage: Localizer('UnexpectedErrorOccurred'),\r\n\terror: null,\r\n};\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * X SVG\r\n *\r\n * @returns\r\n */\r\nfunction XSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default XSVG;\r\n","import AxiosHelper from 'services/AxiosHelper';\r\nimport { AxiosResponse } from 'axios';\r\n\r\nexport interface UserSummary {\r\n\tisSignedIn: boolean;\r\n\tuserName: string | null;\r\n\tfirstName: string | null;\r\n\tlastName: string | null;\r\n\temail: string | null;\r\n\tphoneNumber: string | null;\r\n\ttwoFactorEnabled: boolean;\r\n\thasRecoveryCodes: boolean;\r\n\tisMachineRemembered: boolean;\r\n\tannouncements: UserAnnouncement[];\r\n\tisExternalLoginUser: boolean;\r\n\r\n\t// #region TapeCase\r\n\tisOptedInForMarketingEmails: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/** Represents the details about an admin impersonation session of the logged in user. */\r\nexport interface Impersonation {\r\n\t/** The id of the admin impersonating the front end user. */\r\n\timpersonatorId: string;\r\n\r\n\t/** The name of the admin impersonating the front end user. */\r\n\timpersonatorName: string;\r\n\r\n\t/** The id of the active user impersonation session. */\r\n\tsessionId: string;\r\n}\r\n\r\nexport interface UserData {\r\n\t/**\r\n\t * Summary of user-specific details\r\n\t */\r\n\tsummary?: UserSummary;\r\n\r\n\t/**\r\n\t * CSRF validation token generated by the server\r\n\t */\r\n\trequestToken?: string;\r\n\r\n\t/**\r\n\t * The information on an impersonation session if one is active.\r\n\t * If an impersonation session isn't active this field will be undefined.\r\n\t */\r\n\timpersonation?: Impersonation;\r\n}\r\n\r\nexport interface UserAnnouncement {\r\n\t/** The id used as the primary key for the announcement in the database */\r\n\tid: string;\r\n\r\n\t/** An announcement to be displayed to the user */\r\n\tmessage: string;\r\n\r\n\t/** A list of pages where the announcement will be displayed. This will be an empty array if it is to be displayed on all pages. */\r\n\tpages: string[];\r\n}\r\n\r\nlet userDataPromise: Promise> | null = null;\r\n\r\n/**\r\n * Returns details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserData = () => {\r\n\tif (userDataPromise === null) {\r\n\t\tuserDataPromise = AxiosHelper.get('/ajax/user');\r\n\t}\r\n\r\n\treturn userDataPromise;\r\n};\r\n\r\n/**\r\n * Returns non-cached details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserDataNoCache = () => {\r\n\treturn AxiosHelper.get('/ajax/user');\r\n};\r\n\r\n/**\r\n * Returns a promise that will contain the CSRF token generated on the server to be used to validate\r\n * forms being posted via AJAX.\r\n */\r\nexport async function getCsrfToken() {\r\n\ttry {\r\n\t\tconst userData = await getUserData();\r\n\t\treturn userData.data.requestToken;\r\n\t} catch (error) {\r\n\t\tconsole.warn('Unable to load CSRF token.');\r\n\t\treturn '';\r\n\t}\r\n}\r\n\r\n// #region Commerce\r\nimport { CartSummary } from './UserData.Commerce';\r\nimport { LocationDto } from 'features/commerce/store-locator/types';\r\nimport { OrganizationInvite, OrganizationShipTo } from 'shared-client/types/commerce/organization';\r\nimport { AutoSuggestOption } from '../../../Roc.SharedClientApp/types/fields';\r\n\r\n// Commerce extensions to the UserData interface\r\nexport interface UserData {\r\n\tcartSummary?: CartSummary;\r\n\r\n\t/***\r\n\t * The customer's default store location or null if not set\r\n\t */\r\n\tdefaultStoreLocation?: LocationDto | null;\r\n\r\n\t/**\r\n\t * If store is enabled for this site\r\n\t */\r\n\tenableStoreLocation?: boolean;\r\n}\r\n\r\n/***\r\n * Organization data and permissions\r\n */\r\nexport interface Organization {\r\n\tid: string;\r\n\tpurchaseOrderNumberRequired: boolean;\r\n\tcreditCardAllowed: boolean;\r\n\tgiftCardAllowed: boolean;\r\n\torganizationName: string;\r\n\tcorpAccountAllowed: boolean;\r\n\t//#region TapeCase Customization\r\n\tisApprovedDistributor: boolean;\r\n\tpurchaseOrderAllowed: boolean;\r\n\t//#endregion\r\n}\r\n\r\n/***\r\n * Organization dto data\r\n */\r\nexport interface OrganizationDto extends AutoSuggestOption {}\r\n\r\n/***\r\n * User's organization and permissions data\r\n */\r\nexport interface UserSummary {\r\n\t/***\r\n\t * User's current default organization\r\n\t */\r\n\torganization: Organization | null;\r\n\r\n\t/***\r\n\t * The list of organizations the user is part of\r\n\t */\r\n\tuserOrganizations?: OrganizationDto[] | null;\r\n\r\n\t/***\r\n\t * The selected organization ship to\r\n\t */\r\n\tselectedShipTo: OrganizationShipTo | null;\r\n\r\n\t/***\r\n\t * Defines if the user has multiple shiptos to select from\r\n\t */\r\n\thasMultipleShipTos: boolean | null;\r\n\r\n\t/***\r\n\t * Defines if the user has saved payment methods\r\n\t */\r\n\thasSavedPaymentMethods: boolean | null;\r\n\r\n\t/***\r\n\t * The list of user permissions\r\n\t */\r\n\tpermissions?: UserPermissions;\r\n\r\n\t/***\r\n\t * The list of organizations the user is invited to join\r\n\t */\r\n\torganizationInvites?: OrganizationInvite[];\r\n\r\n\t/***\r\n\t * The user organization removal notification\r\n\t * Used to notify the user if he is no more part of his default organization\r\n\t */\r\n\tuserOrganizationRemovalNotification?: string;\r\n}\r\n\r\n/***\r\n * User's permissions\r\n */\r\nexport interface UserPermissions {\r\n\t/***\r\n\t * Defines if the current user can see organization users\r\n\t */\r\n\tcanSeeOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can assign roles to organization users\r\n\t */\r\n\tcanAssignRolesToOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can remove users from an organization\r\n\t */\r\n\tremoveUserFromOrganization?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can create organization users\r\n\t */\r\n\tcreateOrganizationUser?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can enable/disable ShipTos for organization users\r\n\t */\r\n\tmanageShipTosAssociation?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can see status of the organization users\r\n\t */\r\n\tcanSeePendingOrganizationUsers?: boolean;\r\n}\r\n// #endregion\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { BaseInputProps } from './InputField';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\n/**\r\n * Component that renders a checkbox input with form field.\r\n */\r\nexport default function CheckboxInputField({\r\n\tinput: { name, onChange, checked }, //#region TapeCase Customization (bugfix), added attribute `checked` instead of value\r\n\tmeta,\r\n\ttype,\r\n\tlabel = '',\r\n\tdisabled = false,\r\n\treadOnly = false,\r\n\tplaceholder = '',\r\n\tstep,\r\n\ttestId,\r\n\tdefaultValue = false,\r\n}: InputFieldProps) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport CheckboxInputField from './CheckboxInputField';\r\nimport { BaseInputProps } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a checkbox field\r\n */\r\nexport default function CheckBoxField({\r\n\tname,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tsubscription,\r\n\tdefaultValue,\r\n\t//#region TapeCase Customization (bugfix)\r\n\tchecked,\r\n}: //endregion\r\nInputFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\nexport type DropdownProps = FormFieldProps & {\r\n\taddSelectOption?: boolean;\r\n\toptions: DropdownOption[];\r\n};\r\n\r\nexport type DropdownFieldProps = DropdownProps &\r\n\tFieldProps>;\r\n\r\n/**\r\n * Component that renders a Dropdown field component\r\n */\r\nexport default function DropdownField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\taddSelectOption = true,\r\n\toptions,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tisEqual,\r\n\tsubscription,\r\n\tvalidateFields,\r\n\ttestId,\r\n}: DropdownFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange, onFocus, onBlur }, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{addSelectOption ? \r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\n\r\ntype ValidationMessagesProps = Pick, 'meta'> & {\r\n\tid: string;\r\n};\r\n\r\nfunction getErrorArray(errorOrSubmitError) {\r\n\tlet errors: string[] = [];\r\n\tif (typeof errorOrSubmitError === 'string') {\r\n\t\terrors.push(errorOrSubmitError);\r\n\t} else if (Array.isArray(errorOrSubmitError)) {\r\n\t\terrors = errorOrSubmitError.filter((error) => !Array.isArray(error) && typeof error === 'string');\r\n\t}\r\n\r\n\treturn errors;\r\n}\r\n\r\n/**\r\n * Displays validation errors for fields\r\n *\r\n * @class ValidationMessages\r\n * @extends {React.Component}\r\n */\r\nfunction ValidationMessages(props: ValidationMessagesProps) {\r\n\tconst { meta } = props;\r\n\r\n\tif (!meta) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet errors: string[] = [];\r\n\r\n\t/* \r\n\t almost all validation comes from the server, so we only need to check `submitError` despite there being `error`\r\n\t there are 3 kinds of values for submitError, string, string[] and [string|[]|object]\r\n\t the third type happens when you're using FieldArray, so we're going to filter those out and only\r\n\t take the strings if submitError is an array. this is due to a bug (possibly feature?) of final form\r\n\t where the submit errors for field array fields bubble up into the parent field.\r\n\t */\r\n\tif (meta.submitError) {\r\n\t\terrors = errors.concat(getErrorArray(meta.submitError));\r\n\r\n\t\t// for server-side validation, we need to stop showing these after any changes are made.\r\n\t\tif (meta.dirtySinceLastSubmit || meta.submitting) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} else if (meta.error) {\r\n\t\t// sometimes we validate on the client, so we need to support these as well.\r\n\t\terrors = errors.concat(getErrorArray(meta.error));\r\n\t}\r\n\r\n\treturn (\r\n\t\t// #region Tapecase\r\n\t\t\r\n\t\t\t{/* #endregion */}\r\n\t\t\t{(meta.submitError || meta.error) &&\r\n\t\t\t\tmeta.touched &&\r\n\t\t\t\terrors.length > 0 &&\r\n\t\t\t\terrors.map((error, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{error}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t))}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default ValidationMessages;\r\n","import React from 'react';\r\nimport StarRating from '~/shared/components/star-rating/StarRating';\r\nimport { Field } from 'react-final-form';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\nimport ValidationMessages from './ValidationMessages';\r\nimport { FormFieldProps } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { LocalizedSpan } from 'services/Localizer';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport interface StarRatingFieldProps extends FormFieldProps {\r\n\t/**\r\n\t * The maximum number of stars to display (default is 5)\r\n\t */\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * Reusable RFF-compatible field that displays a star rating input\r\n * @param props\r\n */\r\nexport default function StarRatingField({\r\n\tname,\r\n\tlabel = '',\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tmaxRating = 5,\r\n\tisRequired = true,\r\n\ttestId,\r\n}: StarRatingFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange }, meta }) => (\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{label} {!isRequired ? : null}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t${value}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t\t`${maxRating}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { ValidationMessages, FormFieldProps } from '.';\r\nimport { FieldProps, Field, FieldRenderProps } from 'react-final-form';\r\nimport FieldLabel from './FieldLabel';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport type TextAreaFieldProps = FieldProps> &\r\n\tFormFieldProps & {\r\n\t\trows?: number;\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\n/**\r\n * Component that renders a textarea input component.\r\n */\r\nexport default function TextAreaField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tplaceholder = '',\r\n\tlabel = '',\r\n\trows = 5,\r\n\tvalidate,\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tcomponent,\r\n\tdefaultValue,\r\n\tformat,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tparse,\r\n\trender,\r\n\tsubscription,\r\n\tvalue,\r\n\ttestId,\r\n}: TextAreaFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\n\r\nexport interface BaseInputProps extends FormFieldProps {\r\n\ttype?: string;\r\n\tstep?: string;\r\n}\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\nexport type HTMLInputRef = React.MutableRefObject;\r\n/**\r\n * Component that renders an input with form field.\r\n */\r\nconst InputField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tinput: { name, onChange, value },\r\n\t\tmeta,\r\n\t\ttype,\r\n\t\tlabel = '',\r\n\t\tisRequired = true,\r\n\t\tdisabled = false,\r\n\t\treadOnly = false,\r\n\t\tplaceholder = '',\r\n\t\tstep,\r\n\t\ttestId,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n});\r\n\r\nexport default InputField;\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport InputField, { BaseInputProps, HTMLInputRef } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a text box component, of the specified type\r\n */\r\nconst TextBoxField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tname,\r\n\t\ttype = 'text',\r\n\t\tisRequired = true,\r\n\t\treadOnly = false,\r\n\t\tdisabled = false,\r\n\t\tplaceholder = '',\r\n\t\tlabel = '',\r\n\t\tvalidate,\r\n\t\tafterSubmit,\r\n\t\tallowNull,\r\n\t\tbeforeSubmit,\r\n\t\tcomponent,\r\n\t\tdefaultValue,\r\n\t\tformat,\r\n\t\tformatOnBlur,\r\n\t\tinitialValue,\r\n\t\tisEqual,\r\n\t\tparse,\r\n\t\trender,\r\n\t\tsubscription,\r\n\t\tvalue,\r\n\t\ttestId,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n});\r\n\r\nexport default TextBoxField;\r\n","export enum ModelStatus {\r\n\tPublished = 'Published',\r\n\tInactive = 'Inactive',\r\n\tDeleted = 'Deleted',\r\n\tDraft = 'Draft',\r\n\tArchived = 'Archived',\r\n}\r\n","/*\r\n\tPulled from https://github.com/exif-js/exif-js. \r\n\tLibrary had small bugs and maintainer is not active, so copied directly to the project and applied some fixes.\r\n\tDisabling lint below to keep the file as close to the original library as possible\r\n*/\r\nconst root = {};\r\n/* tslint:disable */\r\n\r\nvar debug = false;\r\n\r\nvar EXIF = function (obj) {\r\n\tif (obj instanceof EXIF) return obj;\r\n\tif (!(this instanceof EXIF)) return new EXIF(obj);\r\n\tthis.EXIFwrapped = obj;\r\n};\r\n\r\nif (typeof exports !== 'undefined') {\r\n\tif (typeof module !== 'undefined' && module.exports) {\r\n\t\texports = module.exports = EXIF;\r\n\t}\r\n\texports.EXIF = EXIF;\r\n} else {\r\n\troot.EXIF = EXIF;\r\n}\r\n\r\nvar ExifTags = (EXIF.Tags = {\r\n\t// version tags\r\n\t0x9000: 'ExifVersion', // EXIF version\r\n\t0xa000: 'FlashpixVersion', // Flashpix format version\r\n\r\n\t// colorspace tags\r\n\t0xa001: 'ColorSpace', // Color space information tag\r\n\r\n\t// image configuration\r\n\t0xa002: 'PixelXDimension', // Valid width of meaningful image\r\n\t0xa003: 'PixelYDimension', // Valid height of meaningful image\r\n\t0x9101: 'ComponentsConfiguration', // Information about channels\r\n\t0x9102: 'CompressedBitsPerPixel', // Compressed bits per pixel\r\n\r\n\t// user information\r\n\t0x927c: 'MakerNote', // Any desired information written by the manufacturer\r\n\t0x9286: 'UserComment', // Comments by user\r\n\r\n\t// related file\r\n\t0xa004: 'RelatedSoundFile', // Name of related sound file\r\n\r\n\t// date and time\r\n\t0x9003: 'DateTimeOriginal', // Date and time when the original image was generated\r\n\t0x9004: 'DateTimeDigitized', // Date and time when the image was stored digitally\r\n\t0x9290: 'SubsecTime', // Fractions of seconds for DateTime\r\n\t0x9291: 'SubsecTimeOriginal', // Fractions of seconds for DateTimeOriginal\r\n\t0x9292: 'SubsecTimeDigitized', // Fractions of seconds for DateTimeDigitized\r\n\r\n\t// picture-taking conditions\r\n\t0x829a: 'ExposureTime', // Exposure time (in seconds)\r\n\t0x829d: 'FNumber', // F number\r\n\t0x8822: 'ExposureProgram', // Exposure program\r\n\t0x8824: 'SpectralSensitivity', // Spectral sensitivity\r\n\t0x8827: 'ISOSpeedRatings', // ISO speed rating\r\n\t0x8828: 'OECF', // Optoelectric conversion factor\r\n\t0x9201: 'ShutterSpeedValue', // Shutter speed\r\n\t0x9202: 'ApertureValue', // Lens aperture\r\n\t0x9203: 'BrightnessValue', // Value of brightness\r\n\t0x9204: 'ExposureBias', // Exposure bias\r\n\t0x9205: 'MaxApertureValue', // Smallest F number of lens\r\n\t0x9206: 'SubjectDistance', // Distance to subject in meters\r\n\t0x9207: 'MeteringMode', // Metering mode\r\n\t0x9208: 'LightSource', // Kind of light source\r\n\t0x9209: 'Flash', // Flash status\r\n\t0x9214: 'SubjectArea', // Location and area of main subject\r\n\t0x920a: 'FocalLength', // Focal length of the lens in mm\r\n\t0xa20b: 'FlashEnergy', // Strobe energy in BCPS\r\n\t0xa20c: 'SpatialFrequencyResponse', //\r\n\t0xa20e: 'FocalPlaneXResolution', // Number of pixels in width direction per FocalPlaneResolutionUnit\r\n\t0xa20f: 'FocalPlaneYResolution', // Number of pixels in height direction per FocalPlaneResolutionUnit\r\n\t0xa210: 'FocalPlaneResolutionUnit', // Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution\r\n\t0xa214: 'SubjectLocation', // Location of subject in image\r\n\t0xa215: 'ExposureIndex', // Exposure index selected on camera\r\n\t0xa217: 'SensingMethod', // Image sensor type\r\n\t0xa300: 'FileSource', // Image source (3 == DSC)\r\n\t0xa301: 'SceneType', // Scene type (1 == directly photographed)\r\n\t0xa302: 'CFAPattern', // Color filter array geometric pattern\r\n\t0xa401: 'CustomRendered', // Special processing\r\n\t0xa402: 'ExposureMode', // Exposure mode\r\n\t0xa403: 'WhiteBalance', // 1 = auto white balance, 2 = manual\r\n\t0xa404: 'DigitalZoomRation', // Digital zoom ratio\r\n\t0xa405: 'FocalLengthIn35mmFilm', // Equivalent foacl length assuming 35mm film camera (in mm)\r\n\t0xa406: 'SceneCaptureType', // Type of scene\r\n\t0xa407: 'GainControl', // Degree of overall image gain adjustment\r\n\t0xa408: 'Contrast', // Direction of contrast processing applied by camera\r\n\t0xa409: 'Saturation', // Direction of saturation processing applied by camera\r\n\t0xa40a: 'Sharpness', // Direction of sharpness processing applied by camera\r\n\t0xa40b: 'DeviceSettingDescription', //\r\n\t0xa40c: 'SubjectDistanceRange', // Distance to subject\r\n\r\n\t// other tags\r\n\t0xa005: 'InteroperabilityIFDPointer',\r\n\t0xa420: 'ImageUniqueID', // Identifier assigned uniquely to each image\r\n});\r\n\r\nvar TiffTags = (EXIF.TiffTags = {\r\n\t0x0100: 'ImageWidth',\r\n\t0x0101: 'ImageHeight',\r\n\t0x8769: 'ExifIFDPointer',\r\n\t0x8825: 'GPSInfoIFDPointer',\r\n\t0xa005: 'InteroperabilityIFDPointer',\r\n\t0x0102: 'BitsPerSample',\r\n\t0x0103: 'Compression',\r\n\t0x0106: 'PhotometricInterpretation',\r\n\t0x0112: 'Orientation',\r\n\t0x0115: 'SamplesPerPixel',\r\n\t0x011c: 'PlanarConfiguration',\r\n\t0x0212: 'YCbCrSubSampling',\r\n\t0x0213: 'YCbCrPositioning',\r\n\t0x011a: 'XResolution',\r\n\t0x011b: 'YResolution',\r\n\t0x0128: 'ResolutionUnit',\r\n\t0x0111: 'StripOffsets',\r\n\t0x0116: 'RowsPerStrip',\r\n\t0x0117: 'StripByteCounts',\r\n\t0x0201: 'JPEGInterchangeFormat',\r\n\t0x0202: 'JPEGInterchangeFormatLength',\r\n\t0x012d: 'TransferFunction',\r\n\t0x013e: 'WhitePoint',\r\n\t0x013f: 'PrimaryChromaticities',\r\n\t0x0211: 'YCbCrCoefficients',\r\n\t0x0214: 'ReferenceBlackWhite',\r\n\t0x0132: 'DateTime',\r\n\t0x010e: 'ImageDescription',\r\n\t0x010f: 'Make',\r\n\t0x0110: 'Model',\r\n\t0x0131: 'Software',\r\n\t0x013b: 'Artist',\r\n\t0x8298: 'Copyright',\r\n});\r\n\r\nvar GPSTags = (EXIF.GPSTags = {\r\n\t0x0000: 'GPSVersionID',\r\n\t0x0001: 'GPSLatitudeRef',\r\n\t0x0002: 'GPSLatitude',\r\n\t0x0003: 'GPSLongitudeRef',\r\n\t0x0004: 'GPSLongitude',\r\n\t0x0005: 'GPSAltitudeRef',\r\n\t0x0006: 'GPSAltitude',\r\n\t0x0007: 'GPSTimeStamp',\r\n\t0x0008: 'GPSSatellites',\r\n\t0x0009: 'GPSStatus',\r\n\t0x000a: 'GPSMeasureMode',\r\n\t0x000b: 'GPSDOP',\r\n\t0x000c: 'GPSSpeedRef',\r\n\t0x000d: 'GPSSpeed',\r\n\t0x000e: 'GPSTrackRef',\r\n\t0x000f: 'GPSTrack',\r\n\t0x0010: 'GPSImgDirectionRef',\r\n\t0x0011: 'GPSImgDirection',\r\n\t0x0012: 'GPSMapDatum',\r\n\t0x0013: 'GPSDestLatitudeRef',\r\n\t0x0014: 'GPSDestLatitude',\r\n\t0x0015: 'GPSDestLongitudeRef',\r\n\t0x0016: 'GPSDestLongitude',\r\n\t0x0017: 'GPSDestBearingRef',\r\n\t0x0018: 'GPSDestBearing',\r\n\t0x0019: 'GPSDestDistanceRef',\r\n\t0x001a: 'GPSDestDistance',\r\n\t0x001b: 'GPSProcessingMethod',\r\n\t0x001c: 'GPSAreaInformation',\r\n\t0x001d: 'GPSDateStamp',\r\n\t0x001e: 'GPSDifferential',\r\n\t0x001f: 'GPSHPositioningError',\r\n});\r\n\r\n// EXIF 2.3 Spec\r\nvar IFD1Tags = (EXIF.IFD1Tags = {\r\n\t0x0100: 'ImageWidth',\r\n\t0x0101: 'ImageHeight',\r\n\t0x0102: 'BitsPerSample',\r\n\t0x0103: 'Compression',\r\n\t0x0106: 'PhotometricInterpretation',\r\n\t0x0111: 'StripOffsets',\r\n\t0x0112: 'Orientation',\r\n\t0x0115: 'SamplesPerPixel',\r\n\t0x0116: 'RowsPerStrip',\r\n\t0x0117: 'StripByteCounts',\r\n\t0x011a: 'XResolution',\r\n\t0x011b: 'YResolution',\r\n\t0x011c: 'PlanarConfiguration',\r\n\t0x0128: 'ResolutionUnit',\r\n\t0x0201: 'JpegIFOffset', // When image format is JPEG, this value show offset to JPEG data stored.(aka \"ThumbnailOffset\" or \"JPEGInterchangeFormat\")\r\n\t0x0202: 'JpegIFByteCount', // When image format is JPEG, this value shows data size of JPEG image (aka \"ThumbnailLength\" or \"JPEGInterchangeFormatLength\")\r\n\t0x0211: 'YCbCrCoefficients',\r\n\t0x0212: 'YCbCrSubSampling',\r\n\t0x0213: 'YCbCrPositioning',\r\n\t0x0214: 'ReferenceBlackWhite',\r\n});\r\n\r\nvar StringValues = (EXIF.StringValues = {\r\n\tExposureProgram: {\r\n\t\t0: 'Not defined',\r\n\t\t1: 'Manual',\r\n\t\t2: 'Normal program',\r\n\t\t3: 'Aperture priority',\r\n\t\t4: 'Shutter priority',\r\n\t\t5: 'Creative program',\r\n\t\t6: 'Action program',\r\n\t\t7: 'Portrait mode',\r\n\t\t8: 'Landscape mode',\r\n\t},\r\n\tMeteringMode: {\r\n\t\t0: 'Unknown',\r\n\t\t1: 'Average',\r\n\t\t2: 'CenterWeightedAverage',\r\n\t\t3: 'Spot',\r\n\t\t4: 'MultiSpot',\r\n\t\t5: 'Pattern',\r\n\t\t6: 'Partial',\r\n\t\t255: 'Other',\r\n\t},\r\n\tLightSource: {\r\n\t\t0: 'Unknown',\r\n\t\t1: 'Daylight',\r\n\t\t2: 'Fluorescent',\r\n\t\t3: 'Tungsten (incandescent light)',\r\n\t\t4: 'Flash',\r\n\t\t9: 'Fine weather',\r\n\t\t10: 'Cloudy weather',\r\n\t\t11: 'Shade',\r\n\t\t12: 'Daylight fluorescent (D 5700 - 7100K)',\r\n\t\t13: 'Day white fluorescent (N 4600 - 5400K)',\r\n\t\t14: 'Cool white fluorescent (W 3900 - 4500K)',\r\n\t\t15: 'White fluorescent (WW 3200 - 3700K)',\r\n\t\t17: 'Standard light A',\r\n\t\t18: 'Standard light B',\r\n\t\t19: 'Standard light C',\r\n\t\t20: 'D55',\r\n\t\t21: 'D65',\r\n\t\t22: 'D75',\r\n\t\t23: 'D50',\r\n\t\t24: 'ISO studio tungsten',\r\n\t\t255: 'Other',\r\n\t},\r\n\tFlash: {\r\n\t\t0x0000: 'Flash did not fire',\r\n\t\t0x0001: 'Flash fired',\r\n\t\t0x0005: 'Strobe return light not detected',\r\n\t\t0x0007: 'Strobe return light detected',\r\n\t\t0x0009: 'Flash fired, compulsory flash mode',\r\n\t\t0x000d: 'Flash fired, compulsory flash mode, return light not detected',\r\n\t\t0x000f: 'Flash fired, compulsory flash mode, return light detected',\r\n\t\t0x0010: 'Flash did not fire, compulsory flash mode',\r\n\t\t0x0018: 'Flash did not fire, auto mode',\r\n\t\t0x0019: 'Flash fired, auto mode',\r\n\t\t0x001d: 'Flash fired, auto mode, return light not detected',\r\n\t\t0x001f: 'Flash fired, auto mode, return light detected',\r\n\t\t0x0020: 'No flash function',\r\n\t\t0x0041: 'Flash fired, red-eye reduction mode',\r\n\t\t0x0045: 'Flash fired, red-eye reduction mode, return light not detected',\r\n\t\t0x0047: 'Flash fired, red-eye reduction mode, return light detected',\r\n\t\t0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode',\r\n\t\t0x004d: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',\r\n\t\t0x004f: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',\r\n\t\t0x0059: 'Flash fired, auto mode, red-eye reduction mode',\r\n\t\t0x005d: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',\r\n\t\t0x005f: 'Flash fired, auto mode, return light detected, red-eye reduction mode',\r\n\t},\r\n\tSensingMethod: {\r\n\t\t1: 'Not defined',\r\n\t\t2: 'One-chip color area sensor',\r\n\t\t3: 'Two-chip color area sensor',\r\n\t\t4: 'Three-chip color area sensor',\r\n\t\t5: 'Color sequential area sensor',\r\n\t\t7: 'Trilinear sensor',\r\n\t\t8: 'Color sequential linear sensor',\r\n\t},\r\n\tSceneCaptureType: {\r\n\t\t0: 'Standard',\r\n\t\t1: 'Landscape',\r\n\t\t2: 'Portrait',\r\n\t\t3: 'Night scene',\r\n\t},\r\n\tSceneType: {\r\n\t\t1: 'Directly photographed',\r\n\t},\r\n\tCustomRendered: {\r\n\t\t0: 'Normal process',\r\n\t\t1: 'Custom process',\r\n\t},\r\n\tWhiteBalance: {\r\n\t\t0: 'Auto white balance',\r\n\t\t1: 'Manual white balance',\r\n\t},\r\n\tGainControl: {\r\n\t\t0: 'None',\r\n\t\t1: 'Low gain up',\r\n\t\t2: 'High gain up',\r\n\t\t3: 'Low gain down',\r\n\t\t4: 'High gain down',\r\n\t},\r\n\tContrast: {\r\n\t\t0: 'Normal',\r\n\t\t1: 'Soft',\r\n\t\t2: 'Hard',\r\n\t},\r\n\tSaturation: {\r\n\t\t0: 'Normal',\r\n\t\t1: 'Low saturation',\r\n\t\t2: 'High saturation',\r\n\t},\r\n\tSharpness: {\r\n\t\t0: 'Normal',\r\n\t\t1: 'Soft',\r\n\t\t2: 'Hard',\r\n\t},\r\n\tSubjectDistanceRange: {\r\n\t\t0: 'Unknown',\r\n\t\t1: 'Macro',\r\n\t\t2: 'Close view',\r\n\t\t3: 'Distant view',\r\n\t},\r\n\tFileSource: {\r\n\t\t3: 'DSC',\r\n\t},\r\n\r\n\tComponents: {\r\n\t\t0: '',\r\n\t\t1: 'Y',\r\n\t\t2: 'Cb',\r\n\t\t3: 'Cr',\r\n\t\t4: 'R',\r\n\t\t5: 'G',\r\n\t\t6: 'B',\r\n\t},\r\n});\r\n\r\nfunction addEvent(element, event, handler) {\r\n\tif (element.addEventListener) {\r\n\t\telement.addEventListener(event, handler, false);\r\n\t} else if (element.attachEvent) {\r\n\t\telement.attachEvent('on' + event, handler);\r\n\t}\r\n}\r\n\r\nfunction imageHasData(img) {\r\n\treturn !!img.exifdata;\r\n}\r\n\r\nfunction base64ToArrayBuffer(base64, contentType) {\r\n\tcontentType = contentType || base64.match(/^data\\:([^\\;]+)\\;base64,/im)[1] || ''; // e.g. 'data:image/jpeg;base64,...' => 'image/jpeg'\r\n\tbase64 = base64.replace(/^data\\:([^\\;]+)\\;base64,/gim, '');\r\n\tvar binary = atob(base64);\r\n\tvar len = binary.length;\r\n\tvar buffer = new ArrayBuffer(len);\r\n\tvar view = new Uint8Array(buffer);\r\n\tfor (var i = 0; i < len; i++) {\r\n\t\tview[i] = binary.charCodeAt(i);\r\n\t}\r\n\treturn buffer;\r\n}\r\n\r\nfunction objectURLToBlob(url, callback) {\r\n\tvar http = new XMLHttpRequest();\r\n\thttp.open('GET', url, true);\r\n\thttp.responseType = 'blob';\r\n\thttp.onload = function (e) {\r\n\t\tif (this.status == 200 || this.status === 0) {\r\n\t\t\tcallback(this.response);\r\n\t\t}\r\n\t};\r\n\thttp.send();\r\n}\r\n\r\nfunction getImageData(img, callback) {\r\n\tfunction handleBinaryFile(binFile) {\r\n\t\ttry {\r\n\t\t\tvar data = findEXIFinJPEG(binFile);\r\n\t\t\timg.exifdata = data || {};\r\n\t\t\tvar iptcdata = findIPTCinJPEG(binFile);\r\n\t\t\timg.iptcdata = iptcdata || {};\r\n\t\t\tif (EXIF.isXmpEnabled) {\r\n\t\t\t\tvar xmpdata = findXMPinJPEG(binFile);\r\n\t\t\t\timg.xmpdata = xmpdata || {};\r\n\t\t\t}\r\n\t\t\tif (callback) {\r\n\t\t\t\tcallback.call(img);\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tif (debug) console.error('An error occurred while handling binary file:', e);\r\n\t\t\tif (callback) {\r\n\t\t\t\tcallback.call(img, e);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (img.src) {\r\n\t\tif (/^data\\:/i.test(img.src)) {\r\n\t\t\t// Data URI\r\n\t\t\tvar arrayBuffer = base64ToArrayBuffer(img.src);\r\n\t\t\thandleBinaryFile(arrayBuffer);\r\n\t\t} else if (/^blob\\:/i.test(img.src)) {\r\n\t\t\t// Object URL\r\n\t\t\tvar fileReader = new FileReader();\r\n\t\t\tfileReader.onload = function (e) {\r\n\t\t\t\thandleBinaryFile(e.target.result);\r\n\t\t\t};\r\n\t\t\tobjectURLToBlob(img.src, function (blob) {\r\n\t\t\t\tfileReader.readAsArrayBuffer(blob);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tvar http = new XMLHttpRequest();\r\n\t\t\thttp.onload = function () {\r\n\t\t\t\tif (this.status == 200 || this.status === 0) {\r\n\t\t\t\t\thandleBinaryFile(http.response);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow 'Could not load image';\r\n\t\t\t\t}\r\n\t\t\t\thttp = null;\r\n\t\t\t};\r\n\t\t\thttp.open('GET', img.src, true);\r\n\t\t\thttp.responseType = 'arraybuffer';\r\n\t\t\thttp.send(null);\r\n\t\t}\r\n\t} else if (self.FileReader && (img instanceof self.Blob || img instanceof self.File)) {\r\n\t\tvar fileReader = new FileReader();\r\n\t\tfileReader.onload = function (e) {\r\n\t\t\tif (debug) console.log('Got file of length ' + e.target.result.byteLength);\r\n\t\t\thandleBinaryFile(e.target.result);\r\n\t\t};\r\n\r\n\t\tfileReader.readAsArrayBuffer(img.slice(0, 131072)); // only need the first 128kb for getting exif/iptc data\r\n\t}\r\n}\r\n\r\nfunction findEXIFinJPEG(file) {\r\n\tvar dataView = new DataView(file);\r\n\r\n\tif (debug) console.log('Got file of length ' + file.byteLength);\r\n\tif (dataView.getUint8(0) != 0xff || dataView.getUint8(1) != 0xd8) {\r\n\t\tif (debug) console.log('Not a valid JPEG');\r\n\t\treturn false; // not a valid jpeg\r\n\t}\r\n\r\n\tvar offset = 2,\r\n\t\tlength = file.byteLength - 5,\r\n\t\tmarker;\r\n\r\n\twhile (offset < length) {\r\n\t\tif (dataView.getUint8(offset) != 0xff) {\r\n\t\t\tif (debug) console.log('Not a valid marker at offset ' + offset + ', found: ' + dataView.getUint8(offset));\r\n\t\t\treturn false; // not a valid marker, something is wrong\r\n\t\t}\r\n\r\n\t\tmarker = dataView.getUint8(offset + 1);\r\n\t\tif (debug) console.log(marker);\r\n\r\n\t\t// we could implement handling for other markers here,\r\n\t\t// but we're only looking for 0xFFE1 for EXIF data\r\n\r\n\t\tif (marker == 225) {\r\n\t\t\tif (debug) console.log('Found 0xFFE1 marker');\r\n\r\n\t\t\treturn readEXIFData(dataView, offset + 4, dataView.getUint16(offset + 2) - 2);\r\n\r\n\t\t\t// offset += 2 + file.getShortAt(offset+2, true);\r\n\t\t} else {\r\n\t\t\toffset += 2 + dataView.getUint16(offset + 2);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction findIPTCinJPEG(file) {\r\n\tvar dataView = new DataView(file);\r\n\r\n\tif (debug) console.log('Got file of length ' + file.byteLength);\r\n\tif (dataView.getUint8(0) != 0xff || dataView.getUint8(1) != 0xd8) {\r\n\t\tif (debug) console.log('Not a valid JPEG');\r\n\t\treturn false; // not a valid jpeg\r\n\t}\r\n\r\n\tvar offset = 2,\r\n\t\tlength = file.byteLength;\r\n\r\n\tvar isFieldSegmentStart = function (dataView, offset) {\r\n\t\treturn (\r\n\t\t\tdataView.getUint8(offset) === 0x38 &&\r\n\t\t\tdataView.getUint8(offset + 1) === 0x42 &&\r\n\t\t\tdataView.getUint8(offset + 2) === 0x49 &&\r\n\t\t\tdataView.getUint8(offset + 3) === 0x4d &&\r\n\t\t\tdataView.getUint8(offset + 4) === 0x04 &&\r\n\t\t\tdataView.getUint8(offset + 5) === 0x04\r\n\t\t);\r\n\t};\r\n\r\n\twhile (offset < length) {\r\n\t\tif (isFieldSegmentStart(dataView, offset)) {\r\n\t\t\t// Get the length of the name header (which is padded to an even number of bytes)\r\n\t\t\tvar nameHeaderLength = dataView.getUint8(offset + 7);\r\n\t\t\tif (nameHeaderLength % 2 !== 0) nameHeaderLength += 1;\r\n\t\t\t// Check for pre photoshop 6 format\r\n\t\t\tif (nameHeaderLength === 0) {\r\n\t\t\t\t// Always 4\r\n\t\t\t\tnameHeaderLength = 4;\r\n\t\t\t}\r\n\r\n\t\t\tvar startOffset = offset + 8 + nameHeaderLength;\r\n\t\t\tvar sectionLength = dataView.getUint16(offset + 6 + nameHeaderLength);\r\n\r\n\t\t\treturn readIPTCData(file, startOffset, sectionLength);\r\n\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t// Not the marker, continue searching\r\n\t\toffset++;\r\n\t}\r\n}\r\nvar IptcFieldMap = {\r\n\t0x78: 'caption',\r\n\t0x6e: 'credit',\r\n\t0x19: 'keywords',\r\n\t0x37: 'dateCreated',\r\n\t0x50: 'byline',\r\n\t0x55: 'bylineTitle',\r\n\t0x7a: 'captionWriter',\r\n\t0x69: 'headline',\r\n\t0x74: 'copyright',\r\n\t0x0f: 'category',\r\n};\r\nfunction readIPTCData(file, startOffset, sectionLength) {\r\n\tvar dataView = new DataView(file);\r\n\tvar data = {};\r\n\tvar fieldValue, fieldName, dataSize, segmentType, segmentSize;\r\n\tvar segmentStartPos = startOffset;\r\n\twhile (segmentStartPos < startOffset + sectionLength) {\r\n\t\tif (dataView.getUint8(segmentStartPos) === 0x1c && dataView.getUint8(segmentStartPos + 1) === 0x02) {\r\n\t\t\tsegmentType = dataView.getUint8(segmentStartPos + 2);\r\n\t\t\tif (segmentType in IptcFieldMap) {\r\n\t\t\t\tdataSize = dataView.getInt16(segmentStartPos + 3);\r\n\t\t\t\tsegmentSize = dataSize + 5;\r\n\t\t\t\tfieldName = IptcFieldMap[segmentType];\r\n\t\t\t\tfieldValue = getStringFromDB(dataView, segmentStartPos + 5, dataSize);\r\n\t\t\t\t// Check if we already stored a value with this name\r\n\t\t\t\tif (data.hasOwnProperty(fieldName)) {\r\n\t\t\t\t\t// Value already stored with this name, create multivalue field\r\n\t\t\t\t\tif (data[fieldName] instanceof Array) {\r\n\t\t\t\t\t\tdata[fieldName].push(fieldValue);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdata[fieldName] = [data[fieldName], fieldValue];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdata[fieldName] = fieldValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsegmentStartPos++;\r\n\t}\r\n\treturn data;\r\n}\r\n\r\nfunction readTags(file, tiffStart, dirStart, strings, bigEnd) {\r\n\tvar entries = file.getUint16(dirStart, !bigEnd),\r\n\t\ttags = {},\r\n\t\tentryOffset,\r\n\t\ttag,\r\n\t\ti;\r\n\r\n\tfor (i = 0; i < entries; i++) {\r\n\t\tentryOffset = dirStart + i * 12 + 2;\r\n\t\ttag = strings[file.getUint16(entryOffset, !bigEnd)];\r\n\t\tif (!tag && debug) console.log('Unknown tag: ' + file.getUint16(entryOffset, !bigEnd));\r\n\t\ttags[tag] = readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd);\r\n\t}\r\n\treturn tags;\r\n}\r\n\r\nfunction readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd) {\r\n\tvar type = file.getUint16(entryOffset + 2, !bigEnd),\r\n\t\tnumValues = file.getUint32(entryOffset + 4, !bigEnd),\r\n\t\tvalueOffset = file.getUint32(entryOffset + 8, !bigEnd) + tiffStart,\r\n\t\toffset,\r\n\t\tvals,\r\n\t\tval,\r\n\t\tn,\r\n\t\tnumerator,\r\n\t\tdenominator;\r\n\r\n\tswitch (type) {\r\n\t\tcase 1: // byte, 8-bit unsigned int\r\n\t\tcase 7: // undefined, 8-bit byte, value depending on field\r\n\t\t\tif (numValues == 1) {\r\n\t\t\t\treturn file.getUint8(entryOffset + 8, !bigEnd);\r\n\t\t\t} else {\r\n\t\t\t\toffset = numValues > 4 ? valueOffset : entryOffset + 8;\r\n\t\t\t\tvals = [];\r\n\t\t\t\tfor (n = 0; n < numValues; n++) {\r\n\t\t\t\t\tvals[n] = file.getUint8(offset + n);\r\n\t\t\t\t}\r\n\t\t\t\treturn vals;\r\n\t\t\t}\r\n\r\n\t\tcase 2: // ascii, 8-bit byte\r\n\t\t\toffset = numValues > 4 ? valueOffset : entryOffset + 8;\r\n\t\t\treturn getStringFromDB(file, offset, numValues - 1);\r\n\r\n\t\tcase 3: // short, 16 bit int\r\n\t\t\tif (numValues == 1) {\r\n\t\t\t\treturn file.getUint16(entryOffset + 8, !bigEnd);\r\n\t\t\t} else {\r\n\t\t\t\toffset = numValues > 2 ? valueOffset : entryOffset + 8;\r\n\t\t\t\tvals = [];\r\n\t\t\t\tfor (n = 0; n < numValues; n++) {\r\n\t\t\t\t\tvals[n] = file.getUint16(offset + 2 * n, !bigEnd);\r\n\t\t\t\t}\r\n\t\t\t\treturn vals;\r\n\t\t\t}\r\n\r\n\t\tcase 4: // long, 32 bit int\r\n\t\t\tif (numValues == 1) {\r\n\t\t\t\treturn file.getUint32(entryOffset + 8, !bigEnd);\r\n\t\t\t} else {\r\n\t\t\t\tvals = [];\r\n\t\t\t\tfor (n = 0; n < numValues; n++) {\r\n\t\t\t\t\tvals[n] = file.getUint32(valueOffset + 4 * n, !bigEnd);\r\n\t\t\t\t}\r\n\t\t\t\treturn vals;\r\n\t\t\t}\r\n\r\n\t\tcase 5: // rational = two long values, first is numerator, second is denominator\r\n\t\t\tif (numValues == 1) {\r\n\t\t\t\tnumerator = file.getUint32(valueOffset, !bigEnd);\r\n\t\t\t\tdenominator = file.getUint32(valueOffset + 4, !bigEnd);\r\n\t\t\t\tval = new Number(numerator / denominator);\r\n\t\t\t\tval.numerator = numerator;\r\n\t\t\t\tval.denominator = denominator;\r\n\t\t\t\treturn val;\r\n\t\t\t} else {\r\n\t\t\t\tvals = [];\r\n\t\t\t\tfor (n = 0; n < numValues; n++) {\r\n\t\t\t\t\tnumerator = file.getUint32(valueOffset + 8 * n, !bigEnd);\r\n\t\t\t\t\tdenominator = file.getUint32(valueOffset + 4 + 8 * n, !bigEnd);\r\n\t\t\t\t\tvals[n] = new Number(numerator / denominator);\r\n\t\t\t\t\tvals[n].numerator = numerator;\r\n\t\t\t\t\tvals[n].denominator = denominator;\r\n\t\t\t\t}\r\n\t\t\t\treturn vals;\r\n\t\t\t}\r\n\r\n\t\tcase 9: // slong, 32 bit signed int\r\n\t\t\tif (numValues == 1) {\r\n\t\t\t\treturn file.getInt32(entryOffset + 8, !bigEnd);\r\n\t\t\t} else {\r\n\t\t\t\tvals = [];\r\n\t\t\t\tfor (n = 0; n < numValues; n++) {\r\n\t\t\t\t\tvals[n] = file.getInt32(valueOffset + 4 * n, !bigEnd);\r\n\t\t\t\t}\r\n\t\t\t\treturn vals;\r\n\t\t\t}\r\n\r\n\t\tcase 10: // signed rational, two slongs, first is numerator, second is denominator\r\n\t\t\tif (numValues == 1) {\r\n\t\t\t\treturn file.getInt32(valueOffset, !bigEnd) / file.getInt32(valueOffset + 4, !bigEnd);\r\n\t\t\t} else {\r\n\t\t\t\tvals = [];\r\n\t\t\t\tfor (n = 0; n < numValues; n++) {\r\n\t\t\t\t\tvals[n] =\r\n\t\t\t\t\t\tfile.getInt32(valueOffset + 8 * n, !bigEnd) / file.getInt32(valueOffset + 4 + 8 * n, !bigEnd);\r\n\t\t\t\t}\r\n\t\t\t\treturn vals;\r\n\t\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Given an IFD (Image File Directory) start offset\r\n * returns an offset to next IFD or 0 if it's the last IFD.\r\n */\r\nfunction getNextIFDOffset(dataView, dirStart, bigEnd) {\r\n\t//the first 2bytes means the number of directory entries contains in this IFD\r\n\tvar entries = dataView.getUint16(dirStart, !bigEnd);\r\n\r\n\t// After last directory entry, there is a 4bytes of data,\r\n\t// it means an offset to next IFD.\r\n\t// If its value is '0x00000000', it means this is the last IFD and there is no linked IFD.\r\n\r\n\treturn dataView.getUint32(dirStart + 2 + entries * 12, !bigEnd); // each entry is 12 bytes long\r\n}\r\n\r\nfunction readThumbnailImage(dataView, tiffStart, firstIFDOffset, bigEnd) {\r\n\t// get the IFD1 offset\r\n\tvar IFD1OffsetPointer = getNextIFDOffset(dataView, tiffStart + firstIFDOffset, bigEnd);\r\n\r\n\tif (!IFD1OffsetPointer) {\r\n\t\t// console.log('******** IFD1Offset is empty, image thumb not found ********');\r\n\t\treturn {};\r\n\t} else if (IFD1OffsetPointer > dataView.byteLength) {\r\n\t\t// this should not happen\r\n\t\t// console.log('******** IFD1Offset is outside the bounds of the DataView ********');\r\n\t\treturn {};\r\n\t}\r\n\t// console.log('******* thumbnail IFD offset (IFD1) is: %s', IFD1OffsetPointer);\r\n\r\n\tvar thumbTags = readTags(dataView, tiffStart, tiffStart + IFD1OffsetPointer, IFD1Tags, bigEnd);\r\n\r\n\t// EXIF 2.3 specification for JPEG format thumbnail\r\n\r\n\t// If the value of Compression(0x0103) Tag in IFD1 is '6', thumbnail image format is JPEG.\r\n\t// Most of Exif image uses JPEG format for thumbnail. In that case, you can get offset of thumbnail\r\n\t// by JpegIFOffset(0x0201) Tag in IFD1, size of thumbnail by JpegIFByteCount(0x0202) Tag.\r\n\t// Data format is ordinary JPEG format, starts from 0xFFD8 and ends by 0xFFD9. It seems that\r\n\t// JPEG format and 160x120pixels of size are recommended thumbnail format for Exif2.1 or later.\r\n\r\n\tif (thumbTags['Compression']) {\r\n\t\t// console.log('Thumbnail image found!');\r\n\r\n\t\tswitch (thumbTags['Compression']) {\r\n\t\t\tcase 6:\r\n\t\t\t\t// console.log('Thumbnail image format is JPEG');\r\n\t\t\t\tif (thumbTags.JpegIFOffset && thumbTags.JpegIFByteCount) {\r\n\t\t\t\t\t// extract the thumbnail\r\n\t\t\t\t\tvar tOffset = tiffStart + thumbTags.JpegIFOffset;\r\n\t\t\t\t\tvar tLength = thumbTags.JpegIFByteCount;\r\n\t\t\t\t\tthumbTags['blob'] = new Blob([new Uint8Array(dataView.buffer, tOffset, tLength)], {\r\n\t\t\t\t\t\ttype: 'image/jpeg',\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 1:\r\n\t\t\t\tconsole.log('Thumbnail image format is TIFF, which is not implemented.');\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.log(\"Unknown thumbnail image format '%s'\", thumbTags['Compression']);\r\n\t\t}\r\n\t} else if (thumbTags['PhotometricInterpretation'] == 2) {\r\n\t\tconsole.log('Thumbnail image format is RGB, which is not implemented.');\r\n\t}\r\n\treturn thumbTags;\r\n}\r\n\r\nfunction getStringFromDB(buffer, start, length) {\r\n\tvar outstr = '';\r\n\tfor (var n = start; n < start + length; n++) {\r\n\t\toutstr += String.fromCharCode(buffer.getUint8(n));\r\n\t}\r\n\treturn outstr;\r\n}\r\n\r\nfunction readEXIFData(file, start) {\r\n\tif (getStringFromDB(file, start, 4) != 'Exif') {\r\n\t\tif (debug) console.log('Not valid EXIF data! ' + getStringFromDB(file, start, 4));\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar bigEnd,\r\n\t\ttags,\r\n\t\ttag,\r\n\t\texifData,\r\n\t\tgpsData,\r\n\t\ttiffOffset = start + 6;\r\n\r\n\t// test for TIFF validity and endianness\r\n\tif (file.getUint16(tiffOffset) == 0x4949) {\r\n\t\tbigEnd = false;\r\n\t} else if (file.getUint16(tiffOffset) == 0x4d4d) {\r\n\t\tbigEnd = true;\r\n\t} else {\r\n\t\tif (debug) console.log('Not valid TIFF data! (no 0x4949 or 0x4D4D)');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (file.getUint16(tiffOffset + 2, !bigEnd) != 0x002a) {\r\n\t\tif (debug) console.log('Not valid TIFF data! (no 0x002A)');\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar firstIFDOffset = file.getUint32(tiffOffset + 4, !bigEnd);\r\n\r\n\tif (firstIFDOffset < 0x00000008) {\r\n\t\tif (debug)\r\n\t\t\tconsole.log('Not valid TIFF data! (First offset less than 8)', file.getUint32(tiffOffset + 4, !bigEnd));\r\n\t\treturn false;\r\n\t}\r\n\r\n\ttags = readTags(file, tiffOffset, tiffOffset + firstIFDOffset, TiffTags, bigEnd);\r\n\r\n\tif (tags.ExifIFDPointer) {\r\n\t\texifData = readTags(file, tiffOffset, tiffOffset + tags.ExifIFDPointer, ExifTags, bigEnd);\r\n\t\tfor (tag in exifData) {\r\n\t\t\tswitch (tag) {\r\n\t\t\t\tcase 'LightSource':\r\n\t\t\t\tcase 'Flash':\r\n\t\t\t\tcase 'MeteringMode':\r\n\t\t\t\tcase 'ExposureProgram':\r\n\t\t\t\tcase 'SensingMethod':\r\n\t\t\t\tcase 'SceneCaptureType':\r\n\t\t\t\tcase 'SceneType':\r\n\t\t\t\tcase 'CustomRendered':\r\n\t\t\t\tcase 'WhiteBalance':\r\n\t\t\t\tcase 'GainControl':\r\n\t\t\t\tcase 'Contrast':\r\n\t\t\t\tcase 'Saturation':\r\n\t\t\t\tcase 'Sharpness':\r\n\t\t\t\tcase 'SubjectDistanceRange':\r\n\t\t\t\tcase 'FileSource':\r\n\t\t\t\t\texifData[tag] = StringValues[tag][exifData[tag]];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ExifVersion':\r\n\t\t\t\tcase 'FlashpixVersion':\r\n\t\t\t\t\texifData[tag] = String.fromCharCode(\r\n\t\t\t\t\t\texifData[tag][0],\r\n\t\t\t\t\t\texifData[tag][1],\r\n\t\t\t\t\t\texifData[tag][2],\r\n\t\t\t\t\t\texifData[tag][3],\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ComponentsConfiguration':\r\n\t\t\t\t\texifData[tag] =\r\n\t\t\t\t\t\tStringValues.Components[exifData[tag][0]] +\r\n\t\t\t\t\t\tStringValues.Components[exifData[tag][1]] +\r\n\t\t\t\t\t\tStringValues.Components[exifData[tag][2]] +\r\n\t\t\t\t\t\tStringValues.Components[exifData[tag][3]];\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttags[tag] = exifData[tag];\r\n\t\t}\r\n\t}\r\n\r\n\tif (tags.GPSInfoIFDPointer) {\r\n\t\tgpsData = readTags(file, tiffOffset, tiffOffset + tags.GPSInfoIFDPointer, GPSTags, bigEnd);\r\n\t\tfor (tag in gpsData) {\r\n\t\t\tswitch (tag) {\r\n\t\t\t\tcase 'GPSVersionID':\r\n\t\t\t\t\tgpsData[tag] =\r\n\t\t\t\t\t\tgpsData[tag][0] + '.' + gpsData[tag][1] + '.' + gpsData[tag][2] + '.' + gpsData[tag][3];\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttags[tag] = gpsData[tag];\r\n\t\t}\r\n\t}\r\n\r\n\t// extract thumbnail\r\n\ttags['thumbnail'] = readThumbnailImage(file, tiffOffset, firstIFDOffset, bigEnd);\r\n\r\n\treturn tags;\r\n}\r\n\r\nfunction findXMPinJPEG(file) {\r\n\tif (!('DOMParser' in self)) {\r\n\t\t// console.warn('XML parsing not supported without DOMParser');\r\n\t\treturn;\r\n\t}\r\n\tvar dataView = new DataView(file);\r\n\r\n\tif (debug) console.log('Got file of length ' + file.byteLength);\r\n\tif (dataView.getUint8(0) != 0xff || dataView.getUint8(1) != 0xd8) {\r\n\t\tif (debug) console.log('Not a valid JPEG');\r\n\t\treturn false; // not a valid jpeg\r\n\t}\r\n\r\n\tvar offset = 2,\r\n\t\tlength = file.byteLength,\r\n\t\tdom = new DOMParser();\r\n\r\n\twhile (offset < length - 4) {\r\n\t\tif (getStringFromDB(dataView, offset, 4) == 'http') {\r\n\t\t\tvar startOffset = offset - 1;\r\n\t\t\tvar sectionLength = dataView.getUint16(offset - 2) - 1;\r\n\t\t\tvar xmpString = getStringFromDB(dataView, startOffset, sectionLength);\r\n\t\t\tvar xmpEndIndex = xmpString.indexOf('xmpmeta>') + 8;\r\n\t\t\txmpString = xmpString.substring(xmpString.indexOf(' 0) {\r\n\t\t\tjson['@attributes'] = {};\r\n\t\t\tfor (var j = 0; j < xml.attributes.length; j++) {\r\n\t\t\t\tvar attribute = xml.attributes.item(j);\r\n\t\t\t\tjson['@attributes'][attribute.nodeName] = attribute.nodeValue;\r\n\t\t\t}\r\n\t\t}\r\n\t} else if (xml.nodeType == 3) {\r\n\t\t// text node\r\n\t\treturn xml.nodeValue;\r\n\t}\r\n\r\n\t// deal with children\r\n\tif (xml.hasChildNodes()) {\r\n\t\tfor (var i = 0; i < xml.childNodes.length; i++) {\r\n\t\t\tvar child = xml.childNodes.item(i);\r\n\t\t\tvar nodeName = child.nodeName;\r\n\t\t\tif (json[nodeName] == null) {\r\n\t\t\t\tjson[nodeName] = xml2json(child);\r\n\t\t\t} else {\r\n\t\t\t\tif (json[nodeName].push == null) {\r\n\t\t\t\t\tvar old = json[nodeName];\r\n\t\t\t\t\tjson[nodeName] = [];\r\n\t\t\t\t\tjson[nodeName].push(old);\r\n\t\t\t\t}\r\n\t\t\t\tjson[nodeName].push(xml2json(child));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn json;\r\n}\r\n\r\nfunction xml2Object(xml) {\r\n\ttry {\r\n\t\tvar obj = {};\r\n\t\tif (xml.children.length > 0) {\r\n\t\t\tfor (var i = 0; i < xml.children.length; i++) {\r\n\t\t\t\tvar item = xml.children.item(i);\r\n\t\t\t\tvar attributes = item.attributes;\r\n\t\t\t\tfor (var idx in attributes) {\r\n\t\t\t\t\tvar itemAtt = attributes[idx];\r\n\t\t\t\t\tvar dataKey = itemAtt.nodeName;\r\n\t\t\t\t\tvar dataValue = itemAtt.nodeValue;\r\n\r\n\t\t\t\t\tif (dataKey !== undefined) {\r\n\t\t\t\t\t\tobj[dataKey] = dataValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar nodeName = item.nodeName;\r\n\r\n\t\t\t\tif (typeof obj[nodeName] == 'undefined') {\r\n\t\t\t\t\tobj[nodeName] = xml2json(item);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (typeof obj[nodeName].push == 'undefined') {\r\n\t\t\t\t\t\tvar old = obj[nodeName];\r\n\r\n\t\t\t\t\t\tobj[nodeName] = [];\r\n\t\t\t\t\t\tobj[nodeName].push(old);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tobj[nodeName].push(xml2json(item));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tobj = xml.textContent;\r\n\t\t}\r\n\t\treturn obj;\r\n\t} catch (e) {\r\n\t\tconsole.log(e.message);\r\n\t}\r\n}\r\n\r\nEXIF.enableXmp = function () {\r\n\tEXIF.isXmpEnabled = true;\r\n};\r\n\r\nEXIF.disableXmp = function () {\r\n\tEXIF.isXmpEnabled = false;\r\n};\r\n\r\nEXIF.getData = function (img, callback) {\r\n\tif (\r\n\t\t((self.Image && img instanceof self.Image) ||\r\n\t\t\t(self.HTMLImageElement && img instanceof self.HTMLImageElement)) &&\r\n\t\t!img.complete\r\n\t)\r\n\t\treturn false;\r\n\r\n\tif (!imageHasData(img)) {\r\n\t\tgetImageData.apply(this, arguments);\r\n\t} else {\r\n\t\tif (callback) {\r\n\t\t\tcallback.call(img);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n};\r\n\r\nEXIF.getTag = function (img, tag) {\r\n\tif (!imageHasData(img)) return;\r\n\treturn img.exifdata[tag];\r\n};\r\n\r\nEXIF.getIptcTag = function (img, tag) {\r\n\tif (!imageHasData(img)) return;\r\n\treturn img.iptcdata[tag];\r\n};\r\n\r\nEXIF.getAllTags = function (img) {\r\n\tif (!imageHasData(img)) return {};\r\n\tvar a,\r\n\t\tdata = img.exifdata,\r\n\t\ttags = {};\r\n\tfor (a in data) {\r\n\t\tif (data.hasOwnProperty(a)) {\r\n\t\t\ttags[a] = data[a];\r\n\t\t}\r\n\t}\r\n\treturn tags;\r\n};\r\n\r\nEXIF.getAllIptcTags = function (img) {\r\n\tif (!imageHasData(img)) return {};\r\n\tvar a,\r\n\t\tdata = img.iptcdata,\r\n\t\ttags = {};\r\n\tfor (a in data) {\r\n\t\tif (data.hasOwnProperty(a)) {\r\n\t\t\ttags[a] = data[a];\r\n\t\t}\r\n\t}\r\n\treturn tags;\r\n};\r\n\r\nEXIF.pretty = function (img) {\r\n\tif (!imageHasData(img)) return '';\r\n\tvar a,\r\n\t\tdata = img.exifdata,\r\n\t\tstrPretty = '';\r\n\tfor (a in data) {\r\n\t\tif (data.hasOwnProperty(a)) {\r\n\t\t\tif (typeof data[a] == 'object') {\r\n\t\t\t\tif (data[a] instanceof Number) {\r\n\t\t\t\t\tstrPretty += a + ' : ' + data[a] + ' [' + data[a].numerator + '/' + data[a].denominator + ']\\r\\n';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstrPretty += a + ' : [' + data[a].length + ' values]\\r\\n';\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tstrPretty += a + ' : ' + data[a] + '\\r\\n';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn strPretty;\r\n};\r\n\r\nEXIF.readFromBinaryFile = function (file) {\r\n\treturn findEXIFinJPEG(file);\r\n};\r\n\r\nif (typeof define === 'function' && define.amd) {\r\n\tdefine('exif-js', [], function () {\r\n\t\treturn EXIF;\r\n\t});\r\n}\r\n\r\nexport default EXIF;\r\n","import { ServerData } from 'services/ServerData';\r\n\r\nexport default {\r\n\tBaseUrl: ServerData.ACCOUNT_URL_BASE ?? '/my-account',\r\n\tLogin: ServerData.ACCOUNT_LOGIN_URL ?? '/my-account/login',\r\n\tLogin2fa: ServerData.ACCOUNT_LOGIN_WITH_2FA_URL ?? '/my-account/login-with-2fa',\r\n\tRegister: ServerData.ACCOUNT_REGISTER_URL ?? '/my-account/register',\r\n\tForgotPassword: ServerData.ACCOUNT_FORGOT_PASSWORD_URL ?? '/my-account/forgot-password',\r\n\tLoginWithRecoveryCode: ServerData.ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL ?? '/my-account/login-with-recovery-code',\r\n\tLogout: ServerData.ACCOUNT_LOGOUT_URL ?? '/my-account/logout',\r\n\t// #region Commerce\r\n\tOrganizationReview: ServerData.ACCOUNT_ORGANIZATION_REVIEW_URL ?? '/my-account/organization-review',\r\n\tOrganizationSelector: ServerData.ACCOUNT_ORGANIZATION_SELECTOR_URL ?? '/my-account/organization-selector',\r\n\t// #endregion\r\n};\r\n","import React from 'react';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\n\r\n// eslint-disable-next-line\r\n// tslint:disable-next-line\r\nexport interface ErrorBoundaryRenderProps extends ErrorBoundaryState {}\r\n\r\nexport interface ErrorBoundaryProps {\r\n\tchildren: React.ReactNode;\r\n\trenderError?: (renderProps: ErrorBoundaryRenderProps) => React.ReactNode;\r\n}\r\n\r\nexport interface ErrorBoundaryState {\r\n\terror?: Error;\r\n}\r\n\r\n/**\r\n * Default Error Boundary component for frontend components, so that in case a JS error occurs, we show\r\n * something instead of nothing.\r\n */\r\nexport default class ErrorBoundary extends React.Component {\r\n\tpublic static defaultProps = {\r\n\t\trenderError: (renderProps: ErrorBoundaryRenderProps) => ,\r\n\t};\r\n\r\n\tpublic state: ErrorBoundaryState = {};\r\n\r\n\tpublic componentDidCatch(error: Error) {\r\n\t\tthis.setState({\r\n\t\t\terror,\r\n\t\t});\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tif (this.state.error) {\r\n\t\t\treturn this.props.renderError!(this.state);\r\n\t\t}\r\n\r\n\t\treturn this.props.children;\r\n\t}\r\n}\r\n","import * as React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Garbage Can SVG\r\n *\r\n * @returns\r\n */\r\n\r\nfunction GarbageCanSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default GarbageCanSVG;\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames\r\n/* eslint-disable no-var */\r\n(function () {\r\n\tif (Element.prototype.getAttributeNames == undefined) {\r\n\t\tElement.prototype.getAttributeNames = function () {\r\n\t\t\tvar attributes = this.attributes;\r\n\t\t\tvar length = attributes.length;\r\n\t\t\tvar result = new Array(length);\r\n\t\t\tfor (var i = 0; i < length; i++) {\r\n\t\t\t\tresult[i] = attributes[i].name;\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t}\r\n})();\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport ErrorBoundary from './ErrorBoundary';\r\nimport { toCamelCase } from 'util/StringUtil';\r\nimport 'shared/polyfills/getAttributeNames';\r\nimport Spinner from 'shared/components/Spinner';\r\n\r\ninterface AttributeProps {\r\n\t[index: string]: string;\r\n}\r\n\r\nfunction getDataPropsFromAttributes(element: Element): AttributeProps {\r\n\tconst props: AttributeProps = {};\r\n\r\n\tconst dataAttributePrefix = 'data-';\r\n\r\n\tconst attributeNames = element.getAttributeNames().filter((s) => s.startsWith(dataAttributePrefix));\r\n\tfor (const attributeName of attributeNames) {\r\n\t\tconst strippedName = toCamelCase(attributeName.substring(dataAttributePrefix.length));\r\n\t\tprops[strippedName] = element.getAttribute(attributeName) ?? '';\r\n\t}\r\n\r\n\treturn props;\r\n}\r\n\r\n/**\r\n * A helper function to facilitate initializing react applications on top of server-side rendered elements.\r\n * @param getReactElement Function that returns the react component to render.\r\n * @param elementId The ID of the DOM element being targeted.\r\n */\r\nexport const initReactApp = (getReactElement: (props: unknown) => React.ReactElement, elementId: string) => {\r\n\tif (typeof getReactElement !== 'function' || !elementId) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst element = document.getElementById(elementId);\r\n\r\n\tif (!element) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Element with ID '${elementId}' was not found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\tconsole.debug(`Rendering application inside element with ID ${elementId}.`);\r\n\t\tReactDOM.render(\r\n\t\t\t}>\r\n\t\t\t\t{getReactElement(props)}\r\n\t\t\t,\r\n\t\t\telement,\r\n\t\t);\r\n\t};\r\n};\r\n\r\nexport const initReactAppByAttribute = (\r\n\tgetReactElement: (props: unknown, domElement: Element) => React.ReactElement,\r\n\tattribute: string,\r\n) => {\r\n\tif (typeof getReactElement !== 'function' || !attribute) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst elements = document.querySelectorAll(`[${attribute}]`);\r\n\r\n\tif (!elements || elements.length == 0) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`No elements with data attribute '${attribute}' were found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tfor (let i = 0; i < elements.length; ++i) {\r\n\t\t\tconst element = elements[i];\r\n\t\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\t\tconsole.debug(`Rendering application inside element with attribute ${attribute}.`);\r\n\t\t\tReactDOM.render(\r\n\t\t\t\t}>\r\n\t\t\t\t\t{getReactElement(props, element)}\r\n\t\t\t\t,\r\n\t\t\t\telement,\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n};\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Reusable component for the optional field marker\r\n */\r\nfunction OptionalFieldMarker() {\r\n\treturn ({Localizer('Optional')});\r\n}\r\n\r\nexport default React.memo(OptionalFieldMarker);\r\n","import { useState, useEffect } from 'react';\r\n\r\n/**\r\n * Reusable hook that returns true after a certain amount of time has passed. Useful to delay\r\n * displaying components in render functions.\r\n *\r\n * @export\r\n * @param {number} [waitMs=200]\r\n * @returns\r\n */\r\nexport default function useDelayedDisplay(waitMs: number = 200) {\r\n\tconst [display, setDisplay] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\t// after a set amount of time, show the spinner\r\n\t\tconst timeout = setTimeout(() => {\r\n\t\t\tsetDisplay(true);\r\n\t\t}, waitMs);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timeout);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn display;\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Check circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CheckCircleSVG;\r\n","import { AxiosError } from 'axios';\r\nimport { FORM_ERROR } from 'final-form';\r\nimport { unflatten } from 'flat';\r\n\r\nexport const getFormattedPageTitle = (subTitle: string = ''): string => {\r\n\t// load from config?\r\n\tconst siteName = 'ROC';\r\n\r\n\tif (!subTitle || !subTitle.trim()) {\r\n\t\treturn siteName;\r\n\t}\r\n\r\n\treturn `${subTitle.trim()} - ${siteName}`;\r\n};\r\n\r\n/**\r\n * Promise version of setTimeout.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const timeout = (ms) => {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n};\r\n\r\n/**\r\n * Allows you to await on a timeout, useful for avoiding setTimeout callbacks and for troubleshooting.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const sleep = async (ms: number = 0) => {\r\n\tawait timeout(ms);\r\n};\r\n\r\n/**\r\n * Handles Axios error for React Final Form. If the error is a validation error, the error is transformed into React\r\n * Final Form field validation object. If the error is a generic error, the error is rethrown instead.\r\n *\r\n * @param error - The Axios Error object to handle errors for.\r\n * @param errorMessage - The form error message to provide back to React Final Form.\r\n * @param validationErrorCallback - Optional callback that is triggered right before the validation object is returned\r\n * to Final Form, so that you can run logic that should occur during validation errors.\r\n * @param genericErrorCallback - Optional callback that is triggered right before the generic error is rethrown, so that\r\n * you can run logic that should occur during generic errors.\r\n */\r\nexport const handleAxiosErrorWithValidation = (\r\n\terror: AxiosError,\r\n\terrorMessage: string | null = 'An error occurred while saving.',\r\n\tvalidationErrorCallback?: () => void,\r\n\tgenericErrorCallback?: () => void,\r\n): { [index: string]: string } => {\r\n\tif (error?.response?.status === 400 && error.response.data) {\r\n\t\tlet globalErrors;\r\n\r\n\t\tconst errors = error.response.data;\r\n\r\n\t\tconst errorsWithModifiedArrayIndex = Object.keys(errors).reduce((acc, value) => {\r\n\t\t\tif (value === '') {\r\n\t\t\t\t// in case we are getting back a non field specific error store it in the global errors\r\n\t\t\t\tglobalErrors = errors[value];\r\n\t\t\t} else {\r\n\t\t\t\tconst newKey = value.replace(/\\[([0-9]+)\\]/g, '.$1');\r\n\t\t\t\tacc[newKey] = errors[value];\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tconst newValidationState = { ...unflatten(errorsWithModifiedArrayIndex) };\r\n\r\n\t\tconsole.debug('newValidationState:', newValidationState);\r\n\r\n\t\tif (validationErrorCallback) {\r\n\t\t\tvalidationErrorCallback();\r\n\t\t}\r\n\r\n\t\treturn { ...newValidationState, [FORM_ERROR]: globalErrors ? globalErrors : errorMessage };\r\n\t} else {\r\n\t\t// generic error.\r\n\t\tif (genericErrorCallback) {\r\n\t\t\tgenericErrorCallback();\r\n\t\t}\r\n\r\n\t\tif (error?.response?.data?.message) {\r\n\t\t\treturn { [FORM_ERROR]: error.response.data.message };\r\n\t\t}\r\n\r\n\t\tif (errorMessage) {\r\n\t\t\treturn { [FORM_ERROR]: errorMessage };\r\n\t\t} else {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Get an html class or ID safe string from provided string.\r\n *\r\n * @function getHtmlSafeName\r\n */\r\nexport const getHtmlSafeName = (name: string = ''): string => {\r\n\treturn name.replace(/[^a-z0-9]/g, (s) => {\r\n\t\tconst c = s.charCodeAt(0);\r\n\t\tif (c === 32) {\r\n\t\t\treturn '-';\r\n\t\t}\r\n\t\tif (c >= 65 && c <= 90) {\r\n\t\t\treturn '_' + s.toLowerCase();\r\n\t\t}\r\n\t\treturn '__' + ('000' + c.toString(16)).slice(-4);\r\n\t});\r\n};\r\n\r\n/**\r\n * Gets the specified param value from the querystring\r\n *\r\n * @param paramName the name of the query string parameter\r\n * @param decodeParam specifies if the param value should be decoded before returning it\r\n */\r\nexport const getQueryParam = (paramName: string = '', decodeParam: boolean = false): string | null => {\r\n\tconst urlParams = new URLSearchParams(window.location.search);\r\n\tconst paramValue = urlParams.get(paramName);\r\n\r\n\tif (!paramValue) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (decodeParam) {\r\n\t\treturn decodeURIComponent(paramValue);\r\n\t} else {\r\n\t\treturn paramValue;\r\n\t}\r\n};\r\n","/**\r\n * Extends Window with recaptcha callback fields\r\n */\r\ninterface WindowWithReCaptchaCallbacks extends Window {\r\n\t/**\r\n\t * Executes the methods in the rocReCaptchaCallbacks array\r\n\t */\r\n\tonReCaptchaLoadCallback: () => void;\r\n\t/**\r\n\t * List of recaptcha callbacks\r\n\t */\r\n\trocReCaptchaCallbacks: Array<() => void>;\r\n}\r\n\r\nexport let reCaptchaCallbackPromise: Promise | null = null;\r\n\r\n/**\r\n * Setup function for recaptcha.\r\n * The window.onReCaptchaLoadCallback() gets called when the recaptcha script is loaded.\r\n * Then this method calls the recaptcha instances init functions, stored in window.rocReCaptchaCallbacks\r\n *\r\n * @export\r\n */\r\nexport default function setupReCaptcha() {\r\n\tconst windowWithReCaptchaCallbacks = (window as unknown) as WindowWithReCaptchaCallbacks;\r\n\r\n\treCaptchaCallbackPromise = new Promise((resolve) => {\r\n\t\twindowWithReCaptchaCallbacks.onReCaptchaLoadCallback = resolve;\r\n\t});\r\n}\r\n","import * as React from 'react';\r\n\r\ninterface DashCircleSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Dash circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction DashCircleSVG(props: DashCircleSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DashCircleSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Circle Exclaimation SVG component\r\n *\r\n * @returns\r\n */\r\nfunction CircleExclamationSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleExclamationSVG;\r\n","import React from 'react';\r\nimport XSVG from './svg/XSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { WithTestIdOptional } from '../../../../Roc.SharedClientApp/types/test';\r\n\r\ninterface CircleButtonProps extends WithTestIdOptional {\r\n\ticon?: React.ReactNode;\r\n}\r\n\r\nfunction CircleButton(props: React.HTMLProps & CircleButtonProps) {\r\n\tconst { icon, testId, ...otherProps } = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleButton;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star Empty SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarEmptySVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarEmptySVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarSVG;\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { WithTestId } from 'shared-client/types/test';\r\nimport StarEmptySVG from 'shared/components/svg/StarEmptySVG';\r\nimport StarSVG from 'shared/components/svg/StarSVG';\r\nimport useStarRating from './useStarRating';\r\n\r\n/**\r\n * Product Rating Props\r\n */\r\ninterface RatingProps extends WithTestId {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\treadonly?: boolean;\r\n\tonChange?: (rating: number) => void;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * If readonly, displays the rating with blank and filled stars (1-maxRating)\r\n * If not readonly, displays the rating picker with blank and filled stars (1-maxRating)\r\n * @param props\r\n */\r\nexport default function StarRating(props: RatingProps) {\r\n\tconst { value, name, readonly = false, onChange, maxRating = 5, testId } = props;\r\n\r\n\tconst { ratingStars, setRatingHovered } = useStarRating({\r\n\t\tvalue,\r\n\t\tname,\r\n\t\tmaxRating,\r\n\t});\r\n\r\n\tif (!readonly && !onChange) {\r\n\t\tthrow new Error('Rating component is set to non-readonly, yet onChange is not defined.');\r\n\t}\r\n\r\n\t/**\r\n\t * Handle changes to the radio button that backs the star rating selection\r\n\t *\r\n\t * @param {*} e\r\n\t */\r\n\tconst onInputChange = (e) => {\r\n\t\tif (onChange) {\r\n\t\t\tonChange(parseInt(e.currentTarget.value));\r\n\t\t}\r\n\t};\r\n\r\n\tif (readonly) {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{ratingStars.map(({ id, isFull }) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{ratingStars.map(({ id, isFull, isChecked, isPending, isHighlighted, ratingValue }) => {\r\n\t\t\t\tconst modifierClasses = classnames({\r\n\t\t\t\t\t'roc-rating__input--full': isFull,\r\n\t\t\t\t\t'roc-rating__input--pending': isPending,\r\n\t\t\t\t\t'roc-rating__label--highlighted': isHighlighted,\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t setRatingHovered(ratingValue)}\r\n\t\t\t\t\t\t\tonMouseLeave={() => setRatingHovered(null)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t\r\n\t);\r\n}\r\n","import { useEffect, useState } from 'react';\r\n\r\n/**\r\n * The state of all of the stars being displayed, these change together frequently\r\n * so lets store them together. This is also slightly better than calculating\r\n * on every single render. Makes it easier to reuse as well.\r\n */\r\ninterface RatingStarState {\r\n\tid: string;\r\n\tisFull: boolean;\r\n\tisPending: boolean;\r\n\tisHighlighted: boolean;\r\n\tisChecked: boolean;\r\n\tratingValue: number;\r\n}\r\n\r\n/**\r\n * The params for the useStarRating hook.\r\n */\r\ninterface UseStarRatingParams {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * The values returned by the custom star rating hook\r\n */\r\ninterface UseStarRatingResult {\r\n\tratingStars: RatingStarState[];\r\n\tsetRatingHovered: (value: number | null) => void;\r\n}\r\n\r\n/**\r\n * Custom hook that manages state for simple star rating implementations\r\n * @param params\r\n */\r\nexport default function useStarRating(params: UseStarRatingParams): UseStarRatingResult {\r\n\tconst { value, name, maxRating = 5 } = params;\r\n\tconst [ratingStars, setRatingStars] = useState([]);\r\n\tconst [ratingHovered, setRatingHovered] = useState(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst newState: RatingStarState[] = [];\r\n\r\n\t\tfor (let i = 1; i <= maxRating; i++) {\r\n\t\t\tconst id = 'rating-group-' + name + '-' + i;\r\n\t\t\tconst isFull = value !== null && value >= i;\r\n\t\t\tconst isPending = ratingHovered ? i > ratingHovered && isFull : false;\r\n\t\t\tconst isHighlighted = ratingHovered ? i <= ratingHovered : false;\r\n\t\t\tconst isChecked = value === i;\r\n\r\n\t\t\tnewState.push({\r\n\t\t\t\tid,\r\n\t\t\t\tisFull,\r\n\t\t\t\tisPending,\r\n\t\t\t\tisHighlighted,\r\n\t\t\t\tisChecked,\r\n\t\t\t\tratingValue: i,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsetRatingStars(newState);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [value, ratingHovered]);\r\n\r\n\treturn { ratingStars, setRatingHovered };\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Pencil SVG\r\n *\r\n * @returns\r\n */\r\nfunction PencilSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PencilSVG;\r\n","import * as React from 'react';\r\n\r\ninterface DisplayBytesProps {\r\n\tbytes: number;\r\n}\r\n\r\n// https://stackoverflow.com/a/14919494/2249545\r\nfunction humanFileSize(bytes: number, si: boolean = true) {\r\n\tconst thresh = si ? 1000 : 1024;\r\n\tif (Math.abs(bytes) < thresh) {\r\n\t\treturn bytes + ' B';\r\n\t}\r\n\tconst units = si\r\n\t\t? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\r\n\t\t: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];\r\n\tlet u = -1;\r\n\tdo {\r\n\t\tbytes /= thresh;\r\n\t\t++u;\r\n\t} while (Math.abs(bytes) >= thresh && u < units.length - 1);\r\n\treturn bytes.toFixed(1) + ' ' + units[u];\r\n}\r\n\r\n/**\r\n * Displays a readable string of bytes, automatically modifying the suffix.\r\n *\r\n * @class DisplayBytes\r\n * @extends {React.PureComponent}\r\n */\r\nclass DisplayBytes extends React.PureComponent {\r\n\tpublic render() {\r\n\t\treturn humanFileSize(this.props.bytes);\r\n\t}\r\n}\r\n\r\nexport default DisplayBytes;\r\n","import * as axios from 'axios';\r\nimport Axios, { AxiosError, AxiosResponse } from 'axios';\r\nimport exif2css from 'exif2css';\r\nimport { FormApi } from 'final-form';\r\nimport * as React from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport GarbageCanSVG from 'shared/components/svg/GarbageCanSVG';\r\nimport SparkMD5 from 'spark-md5';\r\nimport EXIF from './lib/exif-js/exif';\r\nimport { FileUploadResponse, FormValuesWithFileUploadField } from './FileUpload';\r\nimport DisplayBytes from './DisplayBytes';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { useState } from 'react';\r\n\r\nexport type FileUploadInfoProps = {\r\n\tformApi: FormApi;\r\n\tfile: any;\r\n\tonRemoveFile: () => void;\r\n\tonUploadError: (error: string) => void;\r\n};\r\n\r\nexport interface FileUploadInfoState {\r\n\tuploadProgress: number;\r\n\tuploadComplete: boolean;\r\n\tuploadError: boolean;\r\n\tpreviewUrl: string;\r\n}\r\n\r\n/**\r\n * Renders all fields needed for uploading a file, and handles file uploads and deletes.\r\n */\r\nfunction FileUploadInfo({\r\n\tfile,\r\n\tformApi,\r\n\tonRemoveFile,\r\n\tonUploadError,\r\n}: FileUploadInfoProps) {\r\n\tconst [state, setState] = useState({\r\n\t\tuploadProgress: 0,\r\n\t\tuploadComplete: false,\r\n\t\tuploadError: false,\r\n\t\tpreviewUrl: URL.createObjectURL(file),\r\n\t} as FileUploadInfoState);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst acceptedFile = file;\r\n\r\n\t\tsetState({\r\n\t\t\tuploadProgress: 0,\r\n\t\t\tuploadComplete: false,\r\n\t\t\tuploadError: false,\r\n\t\t\tpreviewUrl: URL.createObjectURL(file),\r\n\t\t} as FileUploadInfoState);\r\n\r\n\t\t// START SPARKMD5\r\n\t\t// Calculates the md5 hash for the file to compare against the hash generated by the server\r\n\t\t// This ensures the file has been uploaded correctly and also allows for checking of duplicate files\r\n\t\tconst blobSlice = File.prototype.slice;\r\n\t\tconst chunkSize = 2097152; // Read in chunks of 2MB\r\n\t\tconst chunks = Math.ceil(acceptedFile.size / chunkSize);\r\n\t\tlet currentChunk = 0;\r\n\t\tconst spark = new SparkMD5.ArrayBuffer();\r\n\r\n\t\tconst fileReader = new FileReader();\r\n\r\n\t\tfileReader.onload = (e) => {\r\n\t\t\tif (e.target) {\r\n\t\t\t\tconst fileReaderTarget = e.target as FileReader;\r\n\t\t\t\tspark.append(fileReaderTarget.result); // Append array buffer\r\n\t\t\t\tcurrentChunk++;\r\n\r\n\t\t\t\tif (currentChunk < chunks) {\r\n\t\t\t\t\tloadNext();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst clientSideHash = spark.end();\r\n\r\n\t\t\t\t\tconst formData = new FormData();\r\n\t\t\t\t\tformData.append('file', acceptedFile, acceptedFile.name);\r\n\r\n\t\t\t\t\tconst url = `ajax/file-upload/`;\r\n\r\n\t\t\t\t\tAxiosHelper.post(url, formData, {\r\n\t\t\t\t\t\ttimeout: 1000000, // 1000 seconds\r\n\t\t\t\t\t\theaders: { 'Content-type': 'multipart/form-data' },\r\n\t\t\t\t\t\tonUploadProgress(progressEvent) {\r\n\t\t\t\t\t\t\tconst percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);\r\n\t\t\t\t\t\t\tupdateProgress(percentCompleted);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tcancelToken: new axios.default.CancelToken(() => {}),\r\n\t\t\t\t\t})\r\n\t\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\t(x) =>\r\n\t\t\t\t\t\t\t\tnew Promise((resolve) => {\r\n\t\t\t\t\t\t\t\t\tupdateProgress(100);\r\n\t\t\t\t\t\t\t\t\tsetTimeout(() => resolve(x), 500); // half a second seems to produce best visual effect\r\n\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t) // delay so user can see the 100% progress\r\n\t\t\t\t\t\t.then((resp: AxiosResponse) => {\r\n\t\t\t\t\t\t\tconst fileInfo = resp.data as FileUploadResponse;\r\n\t\t\t\t\t\t\tif (fileInfo.checksum === clientSideHash) {\r\n\t\t\t\t\t\t\t\tsetState({ ...state, uploadComplete: true });\r\n\t\t\t\t\t\t\t\tformApi.change('uploadedFileInfo', fileInfo);\r\n\t\t\t\t\t\t\t\tfile.uploadGuid = fileInfo.guid;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// reset the upload form, and show the error message\r\n\t\t\t\t\t\t\t\tonUploadError(Localizer('ChecksumValidationError'));\r\n\t\t\t\t\t\t\t\tsetState({ ...state, uploadComplete: false, uploadError: true });\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\t\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tlet consoleError = error.message;\r\n\r\n\t\t\t\t\t\t\t// try to parse message from the html to log a more specific error to the console\r\n\t\t\t\t\t\t\tif (error.response && error.response.status >= 500) {\r\n\t\t\t\t\t\t\t\tconst errorResponse = new DOMParser().parseFromString(error.response.data, 'text/html');\r\n\t\t\t\t\t\t\t\tconst errorMessage = errorResponse.getElementsByClassName('stackerror');\r\n\t\t\t\t\t\t\t\tif (errorMessage && errorMessage.length > 0) {\r\n\t\t\t\t\t\t\t\t\tconsoleError = errorMessage[0].innerHTML;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.error(consoleError);\r\n\r\n\t\t\t\t\t\t\t// reset the upload form, and show the error message\r\n\t\t\t\t\t\t\tonUploadError(Localizer('FileServerSideValidation'));\r\n\t\t\t\t\t\t\tsetState({ ...state, uploadComplete: false, uploadError: true });\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfileReader.onerror = (e) => {\r\n\t\t\tconsole.error('File could not be read!');\r\n\t\t\tconst fileReaderTarget = e.target as FileReader;\r\n\t\t\tfileReaderTarget.abort();\r\n\t\t\tif (fileReaderTarget) {\r\n\t\t\t\tconsole.debug(' -> Code ' + fileReaderTarget.error);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction loadNext() {\r\n\t\t\tconst start = currentChunk * chunkSize;\r\n\t\t\tconst end = start + chunkSize >= acceptedFile.size ? acceptedFile.size : start + chunkSize;\r\n\r\n\t\t\tfileReader.readAsArrayBuffer(blobSlice.call(acceptedFile, start, end));\r\n\t\t}\r\n\r\n\t\tloadNext();\r\n\t\t// END SPARKMD5\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [file]);\r\n\r\n\tconst updateProgress = (percentCompleted) => {\r\n\t\tsetState({ ...state, uploadProgress: percentCompleted });\r\n\t};\r\n\r\n\t/**\r\n\t * Rotates the preview image using CSS based on the EXIF Orientation value.\r\n\t */\r\n\tconst onPreviewImageLoaded = (event) => {\r\n\t\tconst imageElement: HTMLImageElement = event.target;\r\n\r\n\t\t// rotate the image based on exif data, if there is any\r\n\t\tEXIF.getData(imageElement, () => {\r\n\t\t\tconst orientation = EXIF.getTag(imageElement, 'Orientation');\r\n\t\t\tif (orientation) {\r\n\t\t\t\tconst css = exif2css(orientation);\r\n\t\t\t\tif (css.transform) {\r\n\t\t\t\t\timageElement.style.transform = css.transform;\r\n\t\t\t\t}\r\n\t\t\t\tif (css['transform-origin']) {\r\n\t\t\t\t\timageElement.style.transformOrigin = css['transform-origin'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Triggers the onRemoveFile property that was passed into the component to remove the file from the form\r\n\t */\r\n\tconst removeButtonClicked = async () => {\r\n\t\t// revoke preview blob url, avoid memory leak\r\n\t\tURL.revokeObjectURL(file.previewUrl);\r\n\r\n\t\tformApi.change('uploadedFileInfo', null);\r\n\t\tonRemoveFile();\r\n\r\n\t\t// delete from temporary upload\r\n\t\tconst url = `/ajax/file-upload/` + file.uploadGuid;\r\n\t\tconst requestToken = Axios.CancelToken.source();\r\n\t\tawait AxiosHelper.delete(url, {\r\n\t\t\ttimeout: 1000000,\r\n\t\t\tcancelToken: requestToken.token,\r\n\t\t});\r\n\t};\r\n\r\n\tconst renderThumbnail = (file, onPreviewImageLoaded, onRemoveButtonClicked) => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{file.type.toLowerCase().indexOf('image') > -1 ? (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{file.name}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t{Localizer('FileSizeLabel')} \r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderUploadProgress = (state) => {\r\n\t\t
\r\n\t\t\t{Localizer('UploadProgress', state.uploadProgress.toString())}\r\n\t\t
;\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{renderThumbnail(file, onPreviewImageLoaded, removeButtonClicked)}\r\n\t\t\t{!state.uploadComplete && !state.uploadError ? renderUploadProgress(state) : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileUploadInfo;\r\n","import { FormApi } from 'final-form';\r\nimport React, { useState } from 'react';\r\nimport { LocalizedSpan, Localizer } from 'services/Localizer';\r\nimport FileUploadFields from './FileUploadInfo';\r\n\r\nconst Dropzone = React.lazy(() => import(/* webpackChunkName: \"react-dropzone\" */ 'react-dropzone'));\r\n\r\nexport type FileUploadFormProps = {\r\n\tformApi: FormApi;\r\n\t// Maximum file size (in bytes) accepted by this FileUploadComponent\r\n\tmaxSize: number;\r\n\t// Accepted file types\r\n\taccept: string;\r\n};\r\n\r\n/**\r\n * Represents a successfully uploaded file.\r\n */\r\nexport interface FileUploadResponse {\r\n\toriginalFileName: string;\r\n\tfriendlyName: string;\r\n\tguid: string;\r\n\tfileSize: number;\r\n\tchecksum: string;\r\n}\r\n\r\nexport interface FileUploadFormState {\r\n\tacceptedFile: File | null;\r\n\trejectedFile: File | null;\r\n\tuploadError: string | null;\r\n}\r\n\r\nexport interface FormValuesWithFileUploadField {\r\n\tuploadedFileInfo: FileUploadResponse | null;\r\n}\r\n\r\n/**\r\n * A helper component which lets users upload a single file and add the information to custom form\r\n */\r\nfunction FileUpload({ formApi, accept, maxSize }: FileUploadFormProps) {\r\n\tconst [state, setState] = useState({\r\n\t\tacceptedFile: null,\r\n\t\trejectedFile: null,\r\n\t\tuploadError: null,\r\n\t} as FileUploadFormState);\r\n\r\n\t/**\r\n\t * onDrop event provided by the Dropzone component.\r\n\t */\r\n\tconst onDrop = (acceptedFiles, rejectedFiles) => {\r\n\t\tif (acceptedFiles.length > 0) {\r\n\t\t\t// we only need the first accepted file\r\n\t\t\tsetState({\r\n\t\t\t\tacceptedFile: acceptedFiles[0] as File,\r\n\t\t\t\trejectedFile: null,\r\n\t\t\t\tuploadError: null,\r\n\t\t\t});\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (rejectedFiles.length > 0) {\r\n\t\t\t// we only need the first rejected file\r\n\t\t\tsetState({\r\n\t\t\t\t...state,\r\n\t\t\t\trejectedFile: rejectedFiles[0] as File,\r\n\t\t\t\tacceptedFile: null,\r\n\t\t\t\tuploadError: null,\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tconst fileRemovedHandler = () => {\r\n\t\tsetState({ ...state, acceptedFile: null });\r\n\t};\r\n\r\n\tconst onUploadError = (error: string) => {\r\n\t\tsetState({ ...state, uploadError: error, acceptedFile: null });\r\n\t};\r\n\r\n\treturn (\r\n\t\t{Localizer('LoadingDropzone')}}>\r\n\t\t\t\r\n\t\t\t\t{({ getRootProps, getInputProps }) => (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{!state.acceptedFile ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{state.uploadError ? (\r\n\t\t\t\t\t\t\t\t\t{state.uploadError}\r\n\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : state.acceptedFile && !state.rejectedFile ? (\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t{state.rejectedFile ? (\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{Localizer('RejectedFileError', state.rejectedFile.name)}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default FileUpload;\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { getUserData } from 'services/UserData';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport { TextBoxField, DropdownField } from 'shared/edit/fields';\r\nimport ReCaptchaDisclaimer from 'shared/edit/fields/ReCaptchaDisclaimer';\r\nimport { useAxiosFormSubmitter } from 'shared/hooks/useBaseAxiosFormSubmitter';\r\nimport RocForm from 'shared/edit/RocForm';\r\nimport { CareersPageData, JobApplicationFormValues } from './types';\r\nimport { DropdownOption } from '../../../../Roc.SharedClientApp/types/fields';\r\nimport FileUpload from 'features/file-upload/FileUpload';\r\n\r\nfunction getCareersData(): CareersPageData {\r\n\treturn (window as any).__TAPECASE_CAREERS_PAGE_DATA__ ?? {};\r\n}\r\n\r\n/**\r\n * Job Application Form component\r\n */\r\nfunction JobApplicationForm() {\r\n\tconst { jobPositions } = getCareersData();\r\n\r\n\tconst jobPositionsOptions = jobPositions.map((o) => ({ text: o.name, value: o.value } as DropdownOption));\r\n\r\n\tconst [initialValues, setInitialValues] = useState({\r\n\t\tfirstName: '',\r\n\t\tlastName: '',\r\n\t\temail: '',\r\n\t\tphone: '',\r\n\t\tjobPositionId: '',\r\n\t\tuploadedFileInfo: null,\r\n\t});\r\n\r\n\tconst jobApplicationFormSubmitter = useAxiosFormSubmitter(\r\n\t\t{\r\n\t\t\turl: '/ajax/careers',\r\n\t\t},\r\n\t\t'JobApplicationForm',\r\n\t);\r\n\r\n\t// initialize the job application fields with values from the user record.\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\tconst userDataResponse = await getUserData();\r\n\r\n\t\t\tif (!userDataResponse.data || !userDataResponse.data.summary) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst { firstName, lastName, email, phoneNumber } = userDataResponse.data.summary;\r\n\r\n\t\t\tsetInitialValues({\r\n\t\t\t\t...initialValues,\r\n\t\t\t\tfirstName: firstName || '',\r\n\t\t\t\tlastName: lastName || '',\r\n\t\t\t\temail: email || '',\r\n\t\t\t\tphone: phoneNumber || '',\r\n\t\t\t});\r\n\t\t})();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn !jobApplicationFormSubmitter.submitted ? (\r\n\t\t\r\n\t\t\tonSubmit={jobApplicationFormSubmitter.handleSubmit}\r\n\t\t\tinitialValues={initialValues}\r\n\t\t\trender={({ handleSubmit, submitError, submitting, form }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{submitError ? : null}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
{Localizer('FileUploadDisclaimer')}
\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Localizer('Apply')} {submitting ? : null}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t) : (\r\n\t\t

{Localizer('JobApplicationFormSubmitted')}

\r\n\t);\r\n}\r\n\r\nexport default JobApplicationForm;\r\n","import React from 'react';\r\nimport JobApplicationForm from './JobApplicationForm';\r\nimport { initReactApp } from 'shared/util/ApplicationInit';\r\n\r\nconst render = initReactApp(() => , 'careers-form');\r\n\r\nrender();\r\n\r\n// optional, use this to enable hot reloading\r\nif ((module as any).hot) {\r\n\t(module as any).hot.accept('./JobApplicationForm', () => {\r\n\t\trender();\r\n\t});\r\n}\r\n","import { ExternalLoginProvider } from 'features/login/ExternalLogins';\r\n\r\n/**\r\n * Extends Window with a property that will hold the client data\r\n *\r\n * @interface WindowWithClientData\r\n * @extends {Window}\r\n */\r\ninterface WindowWithServerData extends Window {\r\n\t__ROC_SERVER_DATA__?: Array<{\r\n\t\t[name: string]: string;\r\n\t}>;\r\n}\r\n\r\n/**\r\n * This type will hold all the keys that are used by ServerData\r\n */\r\ninterface ServerData {\r\n\tIsReCaptchaEnabled?: boolean;\r\n\tReCaptchaV3Key?: string;\r\n\tTimeZone?: string;\r\n\tUSE_EMAIL_AS_USERNAME?: boolean;\r\n\tRegistrationThankYouTitle?: string;\r\n\tRegistrationThankYouMessage?: string;\r\n\tForgotPasswordConfirmationTitle?: string;\r\n\tForgotPasswordConfirmationMessage?: string;\r\n\tPageTitleSuffix?: string;\r\n\tRequireConfirmEmail?: boolean;\r\n\tACCOUNT_URL_BASE?: string;\r\n\tACCOUNT_LOGIN_URL?: string;\r\n\tACCOUNT_LOGOUT_URL?: string;\r\n\tACCOUNT_REGISTER_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_2FA_URL?: string;\r\n\tACCOUNT_FORGOT_PASSWORD_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL?: string;\r\n\tEXTERNAL_LOGIN_PROVIDERS?: ExternalLoginProvider[];\r\n\t// #region Commerce\r\n\tACCOUNT_ORGANIZATION_REVIEW_URL?: string;\r\n\tACCOUNT_ORGANIZATION_SELECTOR_URL?: string;\r\n\tGoogleMapsApiKey?: string; // used in Store Locator\r\n\tMinimumTimeBeforeRecentlyViewedProductsAreValidated?: number;\r\n\tQuickOrderItemMinumumSearchCharacters?: number;\r\n\tMaxAllowedQuickOrderItems?: number;\r\n\tMaxNumberForQuantityDropdown?: number;\r\n\tOrderDetailsUIComponent?: string;\r\n\tGuestCheckoutEnabled?: boolean;\r\n\t// #endregion\r\n\t// #region TapeCase Customizations\r\n\tListPriceMessagingForNotApprovedDistributors?: string;\r\n\tMaxNumberOfDaysToCancelOrders?: number;\r\n\tMaxNumberOfDaysToCancelOrdersMessage?: string;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Main object that will hold all the client data\r\n */\r\nexport const ServerData: ServerData = {};\r\n\r\n/**\r\n * Initializer function that will populate the main settings object\r\n */\r\nfunction initializeServerData() {\r\n\tconst windowWithServerData = window as WindowWithServerData;\r\n\r\n\tif (\r\n\t\twindowWithServerData &&\r\n\t\twindowWithServerData.__ROC_SERVER_DATA__ &&\r\n\t\tArray.isArray(windowWithServerData.__ROC_SERVER_DATA__)\r\n\t) {\r\n\t\tfor (const obj of windowWithServerData.__ROC_SERVER_DATA__) {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tServerData[key] = obj[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\ninitializeServerData();\r\n","import { useState } from 'react';\r\n\r\n/**\r\n * Custom hook for commonly used loading states.\r\n */\r\nexport function useLoader() {\r\n\tconst [loading, setLoading] = useState(false);\r\n\tconst [error, setError] = useState(undefined);\r\n\tconst [response, setResponse] = useState(null);\r\n\r\n\treturn {\r\n\t\tloading,\r\n\t\tsetLoading,\r\n\t\terror,\r\n\t\tsetError,\r\n\t\tresponse,\r\n\t\tsetResponse,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Folder SVG\r\n *\r\n * @returns\r\n */\r\nfunction FolderSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FolderSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Garbage Can SVG\r\n *\r\n * @returns\r\n */\r\nfunction GarbageCanCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default GarbageCanCircleSVG;\r\n","import React from 'react';\r\nimport { ModelStatus } from '../../../../Roc.SharedClientApp/types/model-status';\r\nimport DashCircleSVG from './hawksearch/components/svg/DashCircleSVG';\r\nimport CheckCircleSVG from './svg/CheckCircleSVG';\r\nimport FolderSVG from './svg/FolderSVG';\r\nimport GarbageCanCircleSVG from './svg/GarbageCanCircleSVG';\r\nimport PencilSVG from './svg/PencilSVG';\r\n\r\ninterface PageEditorStatusDisplayProps {\r\n\tstatus: ModelStatus;\r\n}\r\n\r\nexport function StatusDisplay(props: PageEditorStatusDisplayProps) {\r\n\tconst { status } = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{status === ModelStatus.Published ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Inactive ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Deleted ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Draft ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Archived ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t
\r\n\t);\r\n}\r\n","import { useEffect, useRef } from 'react';\r\n\r\n/**\r\n * Reusable hook that can be used where setInterval is needed.\r\n *\r\n * @export\r\n * @param {() => void} callback\r\n * @param {(number | null)} delay\r\n */\r\nexport default function useInterval(callback: () => void, delay: number, enabled: boolean = true) {\r\n\tconst savedCallback = useRef<(() => void) | null>(null);\r\n\t// eslint-disable-next-line no-undef\r\n\tconst intervalId = useRef(null);\r\n\r\n\t// Remember the latest callback.\r\n\tuseEffect(() => {\r\n\t\tsavedCallback.current = callback;\r\n\t}, [callback]);\r\n\r\n\t// Set up the interval.\r\n\tuseEffect(() => {\r\n\t\tfunction tick() {\r\n\t\t\tsavedCallback.current!();\r\n\t\t}\r\n\r\n\t\tif (delay === null || !enabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tintervalId.current = setInterval(tick, delay);\r\n\t\treturn () => {\r\n\t\t\tif (intervalId.current) {\r\n\t\t\t\tclearInterval(intervalId.current);\r\n\t\t\t}\r\n\t\t};\r\n\t}, [delay, enabled]);\r\n}\r\n","import { reCaptchaCallbackPromise } from 'features/setup/recaptcha';\r\nimport { useLayoutEffect, useRef, useState } from 'react';\r\nimport useInterval from './useInterval';\r\n\r\n/**\r\n * Window extended with recaptcha specific fields\r\n */\r\ninterface ReCaptchaWindow extends Window {\r\n\trocReCaptchaCallbacks: Array<() => void>;\r\n\tgrecaptcha: GoogleRecaptcha;\r\n}\r\n\r\n/**\r\n * Google ReCaptcha Interface\r\n */\r\ninterface GoogleRecaptcha {\r\n\tready(callback: () => void): void;\r\n\texecute: (key: string, config: { action: string }) => Promise;\r\n}\r\n\r\nexport interface UseReCaptchaToken {\r\n\tgetToken: () => Promise;\r\n\tinvalidateToken: () => void;\r\n\tenabled: boolean;\r\n\tsetEnabled: (enabled: boolean) => void;\r\n}\r\n\r\nlet ReCaptchaKeyWarning = false;\r\n\r\n/**\r\n * Reusable hook that generates a recaptcha token from google and generates fresh tokens\r\n * frequently as these will expire every 2 minutes\r\n *\r\n * @export\r\n * @param {string} reCaptchaKey\r\n * @param {string} action\r\n * @returns\r\n */\r\nexport default function useReCaptchaToken(\r\n\treCaptchaKey: string,\r\n\taction: string,\r\n\tinitialEnabled: boolean = !!action,\r\n): UseReCaptchaToken {\r\n\tconst reCaptchaWindow = (window as unknown) as ReCaptchaWindow;\r\n\r\n\t// keeps track of the promise that is getting the token across renders. using a ref ensures it updates immediately\r\n\t// state updates are async and therefore we cannot read the state value immediately after.\r\n\t// there is no longer a callback after setting state with hooks 💣\r\n\tconst tokenPromise = useRef | null>(null);\r\n\r\n\t// store whether the promise is resolved in a ref. same reasoning as above.\r\n\tconst tokenPromiseIsResolved = useRef(false);\r\n\r\n\t// this is the promise that will handle waiting on recaptcha initialization\r\n\tconst initPromise = useRef | null>(null);\r\n\r\n\t// this will allow for the recaptcha to be disabled on demand or by an invalid token\r\n\tconst [enabled, setEnabled] = useState(initialEnabled);\r\n\r\n\t// need to use LayoutEffect because we have to make sure this code runs before google's recaptcha handlers\r\n\t// when the dom becomes ready.\r\n\tuseLayoutEffect(() => {\r\n\t\t(async () => {\r\n\t\t\tinitPromise.current = new Promise(async (resolve) => {\r\n\t\t\t\t// wait until google calls this callback.\r\n\t\t\t\tif (reCaptchaCallbackPromise) {\r\n\t\t\t\t\tawait reCaptchaCallbackPromise;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// also wait for recaptcha to be ready for us\r\n\t\t\t\treCaptchaWindow.grecaptcha.ready(() => {\r\n\t\t\t\t\tresolve();\r\n\t\t\t\t\tgetToken();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tif (!reCaptchaKey && !ReCaptchaKeyWarning) {\r\n\t\t\t\tReCaptchaKeyWarning = true;\r\n\t\t\t\tconsole.warn('No ReCaptchaKey has been set.');\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\t/**\r\n\t * Invalidates the current token promise as long as it isn't currently unresolved\r\n\t */\r\n\tconst invalidateToken = async () => {\r\n\t\t// scenario 1: not initialized\r\n\t\tawait initPromise.current;\r\n\r\n\t\t// if we are working on getting a token, do nothing\r\n\t\tif (!tokenPromiseIsResolved) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ttokenPromise.current = getToken(true);\r\n\t};\r\n\r\n\t// tokens expire in 2 minutes, so let's invalidate the token a little more frequently to avoid having a stale one\r\n\tuseInterval(invalidateToken, 2 * 60 * 1000 - 5000, enabled);\r\n\r\n\t/**\r\n\t * Returns a promise that will eventually resolve to a fresh recaptcha token\r\n\t */\r\n\tconst getToken = async (force: boolean = false): Promise => {\r\n\t\tif (!reCaptchaKey || !enabled) {\r\n\t\t\t// if there's no recaptcha key, we'll simple return an empty string. the server will not validate recaptcha\r\n\t\t\t// because the key is missing.\r\n\t\t\treturn Promise.resolve('');\r\n\t\t}\r\n\r\n\t\t// wait for the callback to fire\r\n\t\tawait initPromise.current;\r\n\r\n\t\t// first time or if we need a new one\r\n\t\tif (tokenPromise.current === null || force) {\r\n\t\t\ttokenPromiseIsResolved.current = false;\r\n\r\n\t\t\ttokenPromise.current = new Promise(async (resolve) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst result = await reCaptchaWindow.grecaptcha.execute(reCaptchaKey, { action });\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\tconsole.warn(\r\n\t\t\t\t\t\t'ReCaptcha warning:',\r\n\t\t\t\t\t\terror?.message || 'An unexpected ReCaptcha error occurred. Ensure you have a valid key.',\r\n\t\t\t\t\t);\r\n\t\t\t\t\tsetEnabled(false);\r\n\t\t\t\t\tresolve('');\r\n\t\t\t\t}\r\n\t\t\t\ttokenPromiseIsResolved.current = true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// in some cases this is the existing promise because it not resolved yet, so we don't want to\r\n\t\t// start another request separately.\r\n\t\treturn tokenPromise.current;\r\n\t};\r\n\r\n\treturn { getToken: () => getToken(), invalidateToken, enabled, setEnabled };\r\n}\r\n","import { ServerData } from 'services/ServerData';\r\nimport useReCaptchaToken, { UseReCaptchaToken } from './useReCaptchaToken';\r\n\r\n/**\r\n * Reusable hook that calls the generic useReCaptchaToken with key loaded from ServerData\r\n *\r\n * @export\r\n * @param {string} action\r\n * @returns\r\n */\r\nexport default function useRocReCaptchaToken(action: string, initialEnabled: boolean = true): UseReCaptchaToken {\r\n\tconst reCaptchaKey = ServerData.ReCaptchaV3Key;\r\n\tconst isReCaptchaEnabled = initialEnabled && ServerData.IsReCaptchaEnabled;\r\n\r\n\t// the server will not render anything if the keys aren't set, which means we could get null\r\n\t// or even undefined here, so let's just do a truthy check and return an empty string if there\r\n\t// is nothing from the server.\r\n\treturn useReCaptchaToken(reCaptchaKey || '', action, isReCaptchaEnabled);\r\n}\r\n","import { AxiosError, AxiosRequestConfig } from 'axios';\r\nimport { handleAxiosErrorWithValidation } from 'shared/util/Misc';\r\nimport { useBaseAxiosSubmitter } from './useBaseAxiosSubmitter';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\nexport interface UseAxiosFormSubmitterPostResult {\r\n\tformValidationState?: { [index: string]: string };\r\n\terror?: Error | AxiosError;\r\n}\r\n\r\nexport type RocFormSubmitterParams = {\r\n\taxiosParams: AxiosRequestConfig;\r\n\treCaptchaActionName?: string;\r\n\tcsrfEnabled?: boolean;\r\n\tstateful?: boolean;\r\n\tinvalidateTokenOnSuccess?: boolean;\r\n\tresponseCallback?: (response?: TResponse, error?: Error) => void;\r\n};\r\n\r\nexport type ResponseCallback = (response?: TResponse, error?: Error, invalidateToken?: () => void) => void;\r\n\r\n/**\r\n * A custom hook that can be used to facilitate posting forms. It handles processing server-side validation automatically.\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param reCaptchaActionName An optional action name for the ReCaptcha request sent to Google. If left empty, no ReCaptcha token will be sent to the server.\r\n * @param csrfEnabled Specifies whether CSRF protection should be enabled or not.\r\n * @param stateful A flag for setting the form submitter to store submitting and error state. Not recommended to be true when dealing with react-final-form.\r\n * @param invalidateTokenOnSuccess A flag for invalidating ReCaptcha token on success. This can be helpful for resetting a form with ReCaptcha.\r\n * @param responseCallback An optional callback that can be executed on the response or error that is returned.\r\n */\r\nexport function useRocFormSubmitter({\r\n\taxiosParams,\r\n\treCaptchaActionName,\r\n\tcsrfEnabled = true,\r\n\tstateful = false,\r\n\tinvalidateTokenOnSuccess = false,\r\n\tresponseCallback,\r\n}: RocFormSubmitterParams) {\r\n\treturn useBaseAxiosFormSubmitter(\r\n\t\taxiosParams,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\tstateful,\r\n\t\tinvalidateTokenOnSuccess,\r\n\t\tresponseCallback,\r\n\t);\r\n}\r\n\r\n/**\r\n * Form submitter that only stores the last response in state. Ideal when dealing with react-final-form.\r\n */\r\nexport function useAxiosFormSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tresponseCallback?: ResponseCallback,\r\n\tinvalidateTokenOnSuccess = false,\r\n) {\r\n\treturn useBaseAxiosFormSubmitter(\r\n\t\taxiosParams,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\tfalse,\r\n\t\tinvalidateTokenOnSuccess,\r\n\t\tresponseCallback,\r\n\t);\r\n}\r\n\r\n/**\r\n * Form submitter that stores submitting and error state. Not recommended when dealing with react-final-form.\r\n */\r\nexport function useStatefulAxiosFormSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tresponseCallback?: ResponseCallback,\r\n\tinvalidateTokenOnSuccess = false,\r\n) {\r\n\treturn useBaseAxiosFormSubmitter(\r\n\t\taxiosParams,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\ttrue,\r\n\t\tinvalidateTokenOnSuccess,\r\n\t\tresponseCallback,\r\n\t);\r\n}\r\n\r\n/**\r\n * A custom hook that can be used to facilitate posting forms. It handles processing server-side validation automatically.\r\n * Do not use this hook directly unless you know what you're doing. Prefer useAxiosFormSubmitter, useAxiosStatefulFormSubmitter, or useRocFormSubmitter instead.\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param reCaptchaActionName An optional action name for the ReCaptcha request sent to Google. If left empty, no ReCaptcha token will be sent to the server.\r\n * @param csrfEnabled Specifies whether CSRF protection should be enabled or not.\r\n * @param stateful A flag for setting the form submitter to store submitting and error state. Not recommended to be true when dealing with react-final-form.\r\n * @param invalidateTokenOnSuccess A flag for invalidating ReCaptcha token on success. This can be helpful for resetting a form with ReCaptcha.\r\n * @param responseCallback An optional callback that can be executed on the response or error that is returned.\r\n */\r\nexport function useBaseAxiosFormSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tstateful = false,\r\n\tinvalidateTokenOnSuccess = false,\r\n\tresponseCallback?: ResponseCallback,\r\n) {\r\n\tif (axiosParams.method === undefined) {\r\n\t\taxiosParams.method = 'POST';\r\n\t}\r\n\r\n\t/**\r\n\t * Callback to be executed after a form submission has taken place.\r\n\t */\r\n\tconst submitterCallback = (response?: R, error?: Error, invalidateToken?: () => void) => {\r\n\t\tif (error) {\r\n\t\t\tconsole.error(error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (invalidateToken) {\r\n\t\t\t\tinvalidateToken();\r\n\t\t\t}\r\n\r\n\t\t\tif (responseCallback !== undefined) {\r\n\t\t\t\tresponseCallback(response, error);\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve({\r\n\t\t\t\tformValidationState: handleAxiosErrorWithValidation(\r\n\t\t\t\t\taxiosError,\r\n\t\t\t\t\tLocalizer('ErrorOccurredSubmittingTheForm'),\r\n\t\t\t\t),\r\n\t\t\t\terror,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (responseCallback !== undefined) {\r\n\t\t\tresponseCallback(response);\r\n\t\t}\r\n\r\n\t\tif (invalidateToken && invalidateTokenOnSuccess) {\r\n\t\t\tinvalidateToken();\r\n\t\t}\r\n\r\n\t\treturn Promise.resolve({});\r\n\t};\r\n\r\n\tconst submitter = useBaseAxiosSubmitter(\r\n\t\taxiosParams,\r\n\t\tsubmitterCallback,\r\n\t\treCaptchaActionName,\r\n\t\tcsrfEnabled,\r\n\t\tstateful,\r\n\t);\r\n\r\n\tlet result = {\r\n\t\thandleSubmit: async (formValues: T) => {\r\n\t\t\tconst submitResult = await submitter.submit(formValues);\r\n\t\t\treturn submitResult && submitResult.formValidationState;\r\n\t\t},\r\n\t\tsubmitted: submitter.response !== null && submitter.response.status === 200,\r\n\t\tresponseData: submitter.response !== null ? submitter.response.data : null,\r\n\t};\r\n\r\n\tif (stateful) {\r\n\t\tresult = {\r\n\t\t\t...submitter,\r\n\t\t\t...result,\r\n\t\t};\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n","import Axios, { AxiosRequestConfig, AxiosError, AxiosResponse, CancelTokenSource } from 'axios';\r\nimport useRocReCaptchaToken from './useRocReCaptchaToken';\r\nimport { useLoader } from './useLoader';\r\nimport { useRef } from 'react';\r\nimport { getCsrfToken } from 'services/UserData';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\n\r\n/**\r\n * A reusable hook to be used to submit data via Axios. Handles CSRF and ReCaptcha tokens.\r\n * Do not call this directly, use useAxiosFormSubmitter or useAxiosStatefulFormSubmitter instead.\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param submitterCallback An optional callback that will be called after a request is submitted. The error and the function to invalidate the used ReCaptcha token will be passed if something goes wrong.\r\n * @param reCaptchaActionName An optional action name for the ReCaptcha request sent to Google. If left empty, no ReCaptcha token will be sent to the server.\r\n * @param csrfEnabled Specifies whether CSRF protection should be enabled or not.\r\n * @param stateful An optional value to determine whether this component should use all useLoader state.\r\n */\r\nexport function useBaseAxiosSubmitter(\r\n\taxiosParams: AxiosRequestConfig,\r\n\tsubmitterCallback?: (response: R, error?: Error | AxiosError, invalidateRecaptchaToken?: () => void) => Promise,\r\n\treCaptchaActionName?: string,\r\n\tcsrfEnabled = true,\r\n\tstateful = false,\r\n) {\r\n\tif (axiosParams.method === undefined) {\r\n\t\taxiosParams.method = 'POST';\r\n\t}\r\n\r\n\tconst { getToken: getRecaptchaToken, invalidateToken } = useRocReCaptchaToken(reCaptchaActionName || '');\r\n\tconst { loading, setLoading, error, setError, response, setResponse } = useLoader>();\r\n\tconst cancelToken = useRef();\r\n\r\n\t/**\r\n\t * The main method that allows imperative posting of data\r\n\t * @param payload The data that should be posted in the body of the request\r\n\t */\r\n\tasync function submit(payload: T): Promise {\r\n\t\ttry {\r\n\t\t\t// avoid duplicate requests if there's a pending one\r\n\t\t\tif (cancelToken.current) {\r\n\t\t\t\tconsole.warn('Already posting... Did you forget to disable your submit button while this was saving?');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tcancelToken.current = Axios.CancelToken.source();\r\n\r\n\t\t\tconst promises: Array | undefined> = [];\r\n\r\n\t\t\tpromises.push(csrfEnabled ? getCsrfToken() : undefined);\r\n\t\t\tpromises.push(reCaptchaActionName ? getRecaptchaToken() : undefined);\r\n\r\n\t\t\tconst [csrfToken, reCaptchaToken] = await Promise.all(promises);\r\n\r\n\t\t\tif (stateful) {\r\n\t\t\t\tsetLoading(true);\r\n\t\t\t\tsetError(undefined);\r\n\t\t\t}\r\n\r\n\t\t\t// eslint-disable-next-line no-unused-vars\r\n\t\t\tconst { data, ...rest } = axiosParams;\r\n\t\t\tconst request = {\r\n\t\t\t\t...rest,\r\n\t\t\t\tdata: {\r\n\t\t\t\t\t...payload,\r\n\t\t\t\t\treCaptchaToken: reCaptchaToken || undefined,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\r\n\t\t\tif (csrfToken) {\r\n\t\t\t\tif (!request.headers) {\r\n\t\t\t\t\trequest.headers = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\trequest.headers.RequestVerificationToken = csrfToken;\r\n\t\t\t}\r\n\r\n\t\t\tconst serverResponse = (await AxiosHelper(request)) as AxiosResponse;\r\n\r\n\t\t\t// reset cancellation token ref to allow new requests.\r\n\t\t\tcancelToken.current = undefined;\r\n\r\n\t\t\tsetResponse(serverResponse);\r\n\r\n\t\t\tif (submitterCallback !== undefined) {\r\n\t\t\t\treturn await submitterCallback(serverResponse.data);\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t} catch (error) {\r\n\t\t\t// reset cancellation token ref to allow new requests.\r\n\t\t\tcancelToken.current = undefined;\r\n\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (stateful) {\r\n\t\t\t\tsetError(error);\r\n\t\t\t}\r\n\r\n\t\t\tif (submitterCallback !== undefined) {\r\n\t\t\t\treturn await submitterCallback(error.data, error, invalidateToken);\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t} finally {\r\n\t\t\tif (stateful) {\r\n\t\t\t\tsetLoading(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tsubmitting: loading,\r\n\t\terror,\r\n\t\tresponse,\r\n\t\tcancelToken: cancelToken.current,\r\n\t\tsubmit,\r\n\t};\r\n}\r\n","// These functions may be potentially innaccurate in certain locales that use differing amounts of characters in different cases\r\n\r\n/**\r\n * Tests if a string includes another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyIncludes(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().includes(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string starts with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyStartsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().startsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string ends with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyEndsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().endsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToUpper(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleUpperCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToLower(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleLowerCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\r\nexport function padStart(value, targetLength, padString) {\r\n\t// tslint:disable-next-line:no-bitwise\r\n\ttargetLength = targetLength >> 0; // truncate if number, or convert non-number to 0;\r\n\tpadString = String(typeof padString !== 'undefined' ? padString : ' ');\r\n\tif (value.length >= targetLength) {\r\n\t\treturn String(value);\r\n\t} else {\r\n\t\ttargetLength = targetLength - value.length;\r\n\t\tif (targetLength > padString.length) {\r\n\t\t\tpadString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed\r\n\t\t}\r\n\t\treturn padString.slice(0, targetLength) + String(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts a string from \" Something Like This\" to \"something-like-this\"\r\n * @param value The string to convert\r\n */\r\nexport function toKebabCase(value: string) {\r\n\tif (!value || !value.trim()) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn value\r\n\t\t.trim()\r\n\t\t.replace(/[^a-zA-Z0-9]+/g, '-')\r\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\r\n\t\t.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')\r\n\t\t.replace(/-$/, '')\r\n\t\t.toLocaleLowerCase();\r\n}\r\n\r\n/**\r\n * Converts a string from PascalCase, camelCase, snake_case, or space separated to camelCase. Beginning and trailing whitespace are trimmed.\r\n * @param value The string to convert\r\n */\r\nexport function toCamelCase(value: string) {\r\n\treturn value\r\n\t\t.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (word, index) {\r\n\t\t\treturn index === 0 ? word.toLowerCase() : word.toUpperCase();\r\n\t\t})\r\n\t\t.replace(/(?:\\s+|[-_])/g, '');\r\n}\r\n\r\n/**\r\n * Removes html characters\r\n *\r\n * @export\r\n * @param {*} html\r\n * @returns\r\n */\r\nexport function stripHtml(html) {\r\n\tconst tmp = document.createElement('div');\r\n\ttmp.innerHTML = html;\r\n\treturn tmp.textContent || tmp.innerText || '';\r\n}\r\n\r\n/**\r\n * Cuts of text and adds ellipsis (...) after a certain number of characters\r\n * @param text The text to format\r\n * @param cutoff The number of characters to add the ellipsis after\r\n */\r\nexport function addEllipsis(text: string, cutoff: number = 20) {\r\n\tif (!text || text.length < cutoff) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\treturn text.substring(0, cutoff) + '...';\r\n}\r\n\r\n/**\r\n * Trims a string value\r\n */\r\nexport function trimString(value: string) {\r\n\treturn value ? value.trim() : '';\r\n}\r\n","import React from 'react';\r\nimport { FormProps, Form } from 'react-final-form';\r\nimport createDecorator from 'final-form-focus';\r\nimport { AnyObject } from 'final-form';\r\n\r\ntype RocFormProps = FormProps;\r\n\r\nconst focusOnError = createDecorator();\r\n\r\n/**\r\n * Wrapper component for react-final-form so that we can add useful defaults across the board.\r\n * @param props props\r\n */\r\nexport default function RocForm({\r\n\tonSubmit,\r\n\trender,\r\n\tdebug,\r\n\tdestroyOnUnregister,\r\n\tform,\r\n\tcomponent,\r\n\tinitialValues,\r\n\tinitialValuesEqual,\r\n\tkeepDirtyOnReinitialize,\r\n\tvalidate,\r\n\tvalidateOnBlur,\r\n\tdecorators = [focusOnError],\r\n\tmutators,\r\n\tsubscription,\r\n}: RocFormProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\tonSubmit={onSubmit}\r\n\t\t\tdecorators={decorators}\r\n\t\t\trender={render}\r\n\t\t\tdebug={debug}\r\n\t\t\tdestroyOnUnregister={destroyOnUnregister}\r\n\t\t\tform={form}\r\n\t\t\tcomponent={component}\r\n\t\t\tinitialValues={initialValues}\r\n\t\t\tinitialValuesEqual={initialValuesEqual}\r\n\t\t\tkeepDirtyOnReinitialize={keepDirtyOnReinitialize}\r\n\t\t\tmutators={mutators}\r\n\t\t\tsubscription={subscription}\r\n\t\t\tvalidate={validate}\r\n\t\t\tvalidateOnBlur={validateOnBlur}\r\n\t\t/>\r\n\t);\r\n}\r\n","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!./style.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".react-toggle {\\n touch-action: pan-x;\\n\\n display: inline-block;\\n position: relative;\\n cursor: pointer;\\n background-color: transparent;\\n border: 0;\\n padding: 0;\\n\\n -webkit-touch-callout: none;\\n -webkit-user-select: none;\\n -khtml-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n\\n -webkit-tap-highlight-color: rgba(0,0,0,0);\\n -webkit-tap-highlight-color: transparent;\\n}\\n\\n.react-toggle-screenreader-only {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n margin: -1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px;\\n}\\n\\n.react-toggle--disabled {\\n cursor: not-allowed;\\n opacity: 0.5;\\n -webkit-transition: opacity 0.25s;\\n transition: opacity 0.25s;\\n}\\n\\n.react-toggle-track {\\n width: 50px;\\n height: 24px;\\n padding: 0;\\n border-radius: 30px;\\n background-color: #4D4D4D;\\n -webkit-transition: all 0.2s ease;\\n -moz-transition: all 0.2s ease;\\n transition: all 0.2s ease;\\n}\\n\\n.react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #000000;\\n}\\n\\n.react-toggle--checked .react-toggle-track {\\n background-color: #19AB27;\\n}\\n\\n.react-toggle--checked:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #128D15;\\n}\\n\\n.react-toggle-track-check {\\n position: absolute;\\n width: 14px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n left: 8px;\\n opacity: 0;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-check {\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle-track-x {\\n position: absolute;\\n width: 10px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n right: 10px;\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-x {\\n opacity: 0;\\n}\\n\\n.react-toggle-thumb {\\n transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0ms;\\n position: absolute;\\n top: 1px;\\n left: 1px;\\n width: 22px;\\n height: 22px;\\n border: 1px solid #4D4D4D;\\n border-radius: 50%;\\n background-color: #FAFAFA;\\n\\n -webkit-box-sizing: border-box;\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n\\n -webkit-transition: all 0.25s ease;\\n -moz-transition: all 0.25s ease;\\n transition: all 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-thumb {\\n left: 27px;\\n border-color: #19AB27;\\n}\\n\\n.react-toggle--focus .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 3px 2px #0099E0;\\n -moz-box-shadow: 0px 0px 3px 2px #0099E0;\\n box-shadow: 0px 0px 2px 3px #0099E0;\\n}\\n\\n.react-toggle:active:not(.react-toggle--disabled) .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 5px 5px #0099E0;\\n -moz-box-shadow: 0px 0px 5px 5px #0099E0;\\n box-shadow: 0px 0px 5px 5px #0099E0;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import React from 'react';\r\nimport { LocalizedSpan } from 'services/Localizer';\r\nimport { ServerData } from 'services/ServerData';\r\n\r\n/**\r\n * Recaptcha usage disclaimer\r\n */\r\nexport default function ReCaptchaDisclaimer() {\r\n\tconst reCaptchaKey = ServerData.ReCaptchaV3Key;\r\n\tconst isReCaptchaEnabled = ServerData.IsReCaptchaEnabled;\r\n\treturn reCaptchaKey && isReCaptchaEnabled ? (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t) : null;\r\n}\r\n"],"sourceRoot":""}