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YAAa,CACL,MAAAC,EAAQxwF,EAAQ,SAClBtC,GACAsC,EAAQ,UACRpC,GACAoC,EAAQ,MACRnC,GACAF,GACJ,QAAQ,IAAI,sBAAsB,EAClC8yF,GAAW,WAAW,CAAE,MAAOD,GAAA,YAAAA,EAAO,OAAQ,EAQlD,ECtBA,SAASE,IAAW,CACX,OAAAtwF,GAAM,WAAW,OAC1B,CAEA,SAASuwF,GAAan6E,EAAiB,CACrC,OAAO+oB,GAASn/B,GAAM,SAAW,mBAAiB,IAAKoW,CAAM,CAC/D,CAEAxM,GAAW,CACT,SAAA0mF,GACA,aAAAC,GACAC,cACF,CAAC,ECCG5wF,EAAQ,YAAkB,sBAAyB,WAAW,EAClE,SAAS,MAAQ,GAAGk6B,GAAM,OAAO,eAEjC,MAAMd,GAAOy3D,GAAW,SAAS,eAAe,MAAM,CAAE,EACxDz3D,GAAK,aACF82D,GAAc,OAAA9vF,GACb,eAAC0wF,GAAS,OAAA1wF,GACR,gBAACgwF,GACC,WAAA7iF,EAAA,IAACwjF,GAAY,IACZxjF,EAAA,IAAAyjF,GAAA,CACC,SAACzjF,MAAAwjC,GAAA,EAAI,CACP,GACF,EACF,EACF,EACF,EAEApkB,GAAU,KAAK,EACf+X,GAAW,KAAK","names":["CLI_REACHABLE_ERROR_CODE","REGEX_LAST_NUMBER","REGEX_NAME_SAFE","MAX_NAME_LENGTH","IP_OPEN","IP_LATCH","IP_PRIVATE","DEFAULT_CONNECTION","DEFAULT_SERVICE","env","__vite_import_meta_env__","MODE","CLIENT_ID","MOBILE_CLIENT_ID","COGNITO_USER_POOL_ID","COGNITO_AUTH_DOMAIN","API_URL","AUTH_API_URL","GRAPHQL_API","GRAPHQL_BETA_API","PORTAL","DEVELOPER_KEY","PROTOCOL","REDIRECT_URL","SIGNOUT_REDIRECT_URL","CALLBACK_URL","WEBSOCKET_URL","WEBSOCKET_BETA_URL","PORT","PASSWORD_MIN_LENGTH","PASSWORD_MAX_LENGTH","RECAPTCHA_SITE_KEY","BT_BASE_UUID","BT_UUIDS","DEMO_DEVICE_CLAIM_CODE","DEMO_DEVICE_ID","TEST_HEADER","AIRBRAKE_ID","AIRBRAKE_KEY","ZENDESK_URL","ZENDESK_KEY","GOOGLE_TAG_MANAGER_PORTAL_KEY","GOOGLE_TAG_MANAGER_DESKTOP_KEY","GOOGLE_TAG_MANAGER_ANDROID_KEY","GOOGLE_TAG_MANAGER_IOS_KEY","CERTIFICATE_DOMAIN","ANONYMOUS_MANUFACTURER_CODE","SCREEN_VIEW_APP_LINK","DEMO_SCRIPT_URL","REGEX_LAST_PATH","REGEX_FIRST_PATH","REGEX_IP_SAFE","REGEX_PORT_SAFE","REGEX_DOMAIN_SAFE","REGEX_EMAIL_SAFE","REGEX_CHARACTERS","REGEX_HIDDEN_PASSWORD","REGEX_URL_PATHNAME","REGEX_VALID_IP","REGEX_VALID_HOSTNAME","REGEX_TAG_SAFE","REGEX_SERVICE_ID","REGEX_SCHEME","FRONTEND_RETRY_DELAY","MAX_CONNECTION_NAME_LENGTH","MAX_DESCRIPTION_LENGTH","SIDEBAR_WIDTH","ORGANIZATION_BAR_WIDTH","HIDE_SIDEBAR_WIDTH","HIDE_TWO_PANEL_WIDTH","APP_MAX_WIDTH","MOBILE_WIDTH","BINARY_DATA_TOKEN","VALID_JOB_ID_LENGTH","LANGUAGES","version","json","fullVersion","platform","browser","dev","numericVersion","getApiURL","store","apiGraphqlURL","switchApi","overrides","defaultURL","getWebSocketURL","apis","getTestHeader","testHeader","parts","apiError","error","ui","getToken","auth","currentSession","_a","EventEmitter","__publicField","now","dispatch","args","event","network","Network","sleep","ms","resolve","errorCount","resetErrorCount","post","data","path","token","request","axios","postFile","file","form","key","value","_b","_c","CLIENT_DEPRECATED","graphQLBasicRequest","query","variables","response","graphQLGetErrors","silent","details","errors","warning","graphQLLogin","graphQLFiles","accountId","ids","graphQLJobs","fileIds","graphQLUser","graphQLRegistration","props","graphQLRestoreDevice","graphQLPreloadNetworks","graphQLFetchNetworkSingle","id","LICENSES_QUERY","PLANS_QUERY","LIMITS_QUERY","graphQLFetchPlans","graphQLFetchOrganizations","index","graphQLFetchGuests","graphQLFetchSessions","graphQLGetResellerReportUrl","graphQLSetAttributes","attributes","serviceId","graphQLSetDeviceNotification","deviceID","emailNotifications","desktopNotifications","graphQLConnect","hostIP","graphQLDisconnect","connectionId","graphQLSurvey","sessionId","quality","graphQLSetLink","params","graphQLRemoveLink","graphQLRename","name","graphQLDeleteDevice","deviceId","graphQLDeleteDevices","graphQLUnShareDevice","graphQLShareDevice","graphQLSetOrganization","graphQLSetIdentityProvider","graphQLRemoveOrganization","graphQLSetMembers","email","roleId","license","graphQLRemoveMembers","graphQLLeaveMembership","graphQLClaimDevice","code","graphQLCreditCard","graphQLSubscribe","graphQLUpdateSubscription","graphQLUnsubscribe","licenseId","graphQLAddService","graphQLUpdateService","graphQLRemoveService","graphQLInstallApp","graphQLRemoveApp","graphQLReadNotice","graphQLCreateRole","graphQLUpdateRole","graphQLRemoveRole","graphQLSetTag","tag","graphQLAddDeviceTag","graphQLAddNetworkTag","networkId","graphQLRemoveDeviceTag","graphQLRemoveNetworkTag","graphQLRenameTag","from","to","graphQLMergeTag","graphQLDeleteTag","graphQLNotificationSettings","graphQLTransferDevice","graphQLUpdateNetwork","graphQLAddNetwork","graphQLDeleteNetwork","graphQLSetConnection","graphQLRemoveConnection","graphQLAddNetworkShare","graphQLRemoveNetworkShare","graphQLAddCustomer","resellerId","graphQLRemoveCustomer","graphQLLeaveReseller","graphQLDeleteFile","fileId","graphQLSetJob","graphQLStartJob","jobId","graphQLCancelJob","adaptor","initialize","sharedAdaptor","attributeName","instance","replaceHost","url","localhost","environment","privateIP","removeDeviceName","deviceName","nameExt","combinedName","service","device","join","safeHostname","blacklist","osName","os","serviceNameValidation","emptyOk","isToday","dateToCheck","today","check","getDateFormatString","obj","getTimeZone","findLongestLength","limitDuration","resolution","lengths","TimeSeriesLengths","length","Duration","connectionTypes","secondResolutions","defaultDeviceTimeSeries","defaultServiceTimeSeries","humanizeResolutionLookup","TimeSeriesTypeScale","TimeSeriesTypeLookup","TimeSeriesAvailableResolutions","Platforms","__variableDynamicImportRuntimeHelper","s","type","typeIds","platforms","PlatformIcon","originalProps","useSelector","state","Component","jsx","fontSizes","spacing","lightColors","darkColors","radius","R3gray","jsxs","library","fal","fab","far","fas","Icon","React","color","platformIcon","fixedWidth","size","fontSize","rotate","spin","scale","styles","inline","inlineLeft","modified","ref","theme","useTheme","fontType","icon","FontAwesomeIcon","Badge","TargetPlatform","tooltip","label","typeName","Tooltip","Box","Quote","margin","indent","noInset","className","children","css","useStyles","classnames","makeStyles","palette","marginLeft","Percent","Fragment","Round","QualityDetails","small","title","Divider","Typography","ServiceLinkIcon","licenseChipLookup","getLicenseChip","LicenseChip","chip","Chip","ServiceMiniState","connection","onClick","colorBackground","onMouseDown","alpha","MAX_INDICATORS","ServiceIndicators","services","connections","history","useHistory","extra","display","e","INITIATOR_PLATFORMS","initiatorPlatformIcon","user","thisDevice","lanShareRestriction","isIPClass","lanShared","checkIP","maskedIP","maskIPClass","DeviceListContext","createContext","DeviceContext","DiagramContext","IconButton","sx","forceTitle","disabled","hideDisableFade","variant","shiftDown","buttonBaseSize","iconInlineLeft","loading","submit","hide","placement","onMouseEnter","onMouseLeave","clickHandler","updatedSx","darken","button","MuiIconButton","GraphColumn","timeSeries","humanize","ServiceGraphColumn","useContext","DeviceGraphColumn","DEVICE_TYPE","KEY_APPS","LaunchMethod","options","UrlLaunchMethod","CommandLaunchMethod","TerminalLaunchMethod","ScriptLaunchMethod","Application","portal","method","lookup","secure","template","search","replace","matches","m","unique","getApplication","globalDefaults","typeID","app","getApplicationType","typeId","preferences","sshConfig","windows","android","mac","ios","launchMethods","rdpCommand","NOTICE_VERSION_ID","defaultState","backend","createModel","_","getOs","result","newId","devices","thisId","t","emit","updateVersion","setLocalStorage","optionalParam","first","optionalSecondParam","second","optionalThirdParam","third","getUser","getUserId","getMemberships","optionalAccountId","optionalCustomerId","customerId","getActiveId","getPlans","getPlansTests","getLimitsOverride","getOrganizations","getDevicesState","getColumns","optionalId","getSessions","getConnections","optionalService","getConnectionDefaults","getApplicationTypes","getApplicationParams","getAllNetworks","getTags","getDefaultSelected","getThemeDark","getDeviceTimeSeries","getServiceTimeSeries","getUpdateStatus","getPreferences","getAnnouncements","getNotifiedVersion","getLocalStorage","getFiles","getJobs","selectActiveAccountId","createSelector","activeId","userId","isUserAccount","activeAccountId","selectActiveUser","memberships","getThisMembership","selectMembership","thisMembership","selectApplication","selectApplicationTypesGrouped","applicationTypes","types","groupMap","map","group","processed","groupObjects","o","useApplication","selectNetworks","allNetworks","selectNetworkByService","networks","DEFAULT_ID","testData","CloudSync","methods","parallel","spinner","cloudSync","REMOTEIT_PRODUCT_ID","AWS_PRODUCT_ID","PERSONAL_PLAN_ID","PROFESSIONAL_PLAN_ID","BUSINESS_PLAN_ID","FLEET_PLAN_ID","ENTERPRISE_PLAN_ID","RESELLER_PLAN_ID","LicenseLookup","defaultLicense","planDetails","plans","gqlResponse","checkout","_d","planId","last","card","who","states","updated","getDevices","isPersonal","selectRemoteitLicense","getInformed","lookupLicenseProductId","l","selectFullLicense","productId","selectLicenses","limits","selectLimits","informed","serviceLimit","evaluationLimit","noticeType","warnDate","selectOwnLicenses","selectLicensesWithLimits","selectLicenseIndicator","indicators","licenses","limitDays","humanizeDays","milliseconds","deviceUserTotal","quantity","plan","defaults","users","selectOrganization","organizations","myMembership","organization","membership","selectOrganizationName","selectOrganizationReseller","selectResellerRef","reseller","selectCustomer","c","selectRole","r","DEFAULT_ROLE","selectMembersWithAccess","canMemberView","selectRemoteitPlans","p","tests","customer","selectPlan","selectLimit","limitName","limit","selectLimitsLookup","baseLimits","limitsOverride","selectPermissions","selectOwner","selectAvailableUsers","PERMISSION","DEFAULT_RESELLER","SYSTEM_ROLES","defaultAccountState","getAccountIds","accounts","guests","parseGuests","orgs","parseOrganization","parseLicense","members","action","member","role","roles","permissions","emails","_e","org","g","d","n","getOwnOrganization","canRoleView","canViewByTags","filter","tags","names","DEFAULT_NETWORK","defaultLocalNetwork","defaultCloudNetwork","recentNetwork","defaultNetwork","fetchAll","redirect","gqlNetworks","allDevices","selectVisibleDevices","selectNetwork","copy","clearOnly","joined","structuredClone","selectById","selectConnection","all","serviceIds","match","a","owner","selectAccessibleNetworks","selectSharedNetwork","getConnectionsLookup","allConnections","selectSessions","sessions","selectEnabledConnections","selectConnections","selectEnabledConnectionsCount","enabled","selectIdleConnections","selectAllConnectionSessions","active","selectConnectionSessions","newConnection","selectConnectionsByType","activeUser","connectionState","getManufacturerType","reverseProxy","getManufacturerUser","isSecureReverseProxy","isRelay","isFileToken","findLocalConnection","cd","routeType","routeTypeToSettings","usedPorts","updateImmutableData","identity","tokens","route","launchDisabled","launchSettingHidden","validPort","port","updateConnection","setConnection","clearConnectionError","getFetchConnectionIds","getRoute","getConnectionLookup","getEndpoint","cleanOrphanConnections","expectedIds","loadedIds","getAllDevices","InlineFileFieldSetting","disableGutters","dense","onSave","filePath","useDispatch","filePrompt","useEffect","ListItemButton","ListItemText","InputLabel","ListItemSecondaryAction","filled","PromptModal","open","onSubmit","onClose","toLookup","item","setTokens","useState","setError","update","Dialog","foundError","DialogTitle","DialogContent","List","ListItem","TextField","DialogActions","Button","useClipboard","copiedTimeout","copied","setCopied","useCallback","copyValue","Clipboard","COPY_TIMEOUT","CopyIconButton","colorCopied","onCopy","setOpen","clipboard","autoCopy","DynamicButton","forwardRef","iconType","iconSize","rest","IconComponent","background","hover","foreground","style","ConnectButton","preventDefault","instanceId","autoConnect","forceStop","Stack","Notice","severity","fullWidth","gutterTop","gutterBottom","solid","invert","closeTitle","iconOverride","iconName","iconColor","Paper","ComboButton","containerProps","windowOpen","HEARTBEAT_INTERVAL","CAFFEINATE_INTERVAL","Heartbeat","count","heartbeat","LaunchButton","menuItem","onLaunch","iconButtonProps","prompt","setPrompt","ready","autoLaunch","launch","close","LaunchIcon","MenuItem","ListItemIcon","ConnectAttribute","buttons","RestoreButton","useLabel","labels","Tag","dot","hideLabels","onDelete","getColor","Tags","max","showEmpty","colorSort","b","AVERAGE_TAG_WIDTH","ReactiveTags","Title","offline","ColorChip","typeColor","hoverColor","backgroundColor","DeviceName","menu","useLocation","unlicensed","isRemoteUI","createColor","seedRandom","selectTags","array","pickTruthy","keys","object","currencyFormatter","currency","digits","findTagIndex","haystack","needle","h","tagsInclude","removeObject","callback","newArray","removedElement","removeObjectAttribute","containsNonPrintableChars","text","nonPrintableCount","charCode","labelLookup","getNextLabel","used","colors","available","Avatar","border","fallback","marginRight","md5","Element","MuiAvatar","AvatarList","AvatarGroup","u","DeviceRole","useInterval","delay","savedCallback","useRef","tick","dateOptions","startTime","endTime","startDate","endDate","ago","humanizeOptions","setNow","aDay","duration","RESENT_THRESHOLD","badgeState","offlineDuration","onlineDuration","StatusChip","badge","setBadge","timer","remaining","BarGraph","width","height","min","onHover","bars","setBars","d3.max","xScale","d3.scaleBand","yScale","d3.scaleLinear","newBars","i","x","y","bar","timeOptions","Timestamp","TimeSeries","online","setDisplay","yAxisDisplay","barDisplay","DeviceGeo","geo","Link","noUnderline","RouterLink","MUILink","Attribute$1","columnWidths","feature","DeviceAttribute","Attribute","InstanceAttribute","ServiceAttribute","ConnectionAttribute","RestoreAttribute","ATTRIBUTES","session","start","end","application","attributeLookup","deviceAttributes","deviceAttributesAll","networkAttributes","serviceAttributes","serviceAttributesAll","restoreAttributes","connectionAttributes","getAttribute","DEVICE_PRELOAD_ATTRIBUTES","SERVICE_PRELOAD_ATTRIBUTES","ServiceSelectLookup","SERVICE_SELECT","k","DeviceSelectLookup","DEVICE_SELECT","DEVICE_TIME_SERIES_PARAMS","SERVICE_TIME_SERIES_PARAMS","graphQLFetchDeviceList","deviceQueryColumns","_f","_g","graphQLPreloadDevices","graphQLFetchConnections","selectDeviceColumns","graphQLFetchFullDevice","serviceTimeSeries","deviceTimeSeries","graphQLFetchDeviceCount","graphQLDeviceAdaptor","gqlDevices","hidden","loaded","serviceLoaded","customAttributes","_h","_i","_j","processDeviceAttributes","_k","graphQLServiceAdaptor","_l","processTimeSeries","_m","processServiceAttributes","selectedColumns","columns","attributeQuery","serviceQuery","attribute","processAttributes","root","$","config","ArrowIcon","jssTheme","isDark","addBrandColors","ListItemStyles","getTheme","createTheme","isDarkMode","themeMode","darkMode","brandColors","brand","selectDefaultSelectedPage","defaultSelected","selectTheme","selectUpdateNotice","updateStatus","notifiedVersion","selectTimeSeriesDefaults","logLimit","selectTimeSeries","timeSeriesDefaults","deviceModel","selectDeviceModelAttributes","selectActiveColumns","set","graphQLListProcessor","truncateMergeDevices","appendUniqueDevices","append","searched","total","newDevice","isService","gqlData","getDeviceModel","sortKeys","direction","keyA","keyB","subKey","valueA","valueB","rootState","expired","graphQLMetadata","selectDevice","registrationCommand","registrationCode","restoreCommand","restoreCode","deviceIds","deviceState","mergeDevice","overwrite","isOffline","getDeviceModelFn","findById","selectOwnDevices","selectAllDeviceAttributes","limitsLookup","selectDeviceAttributes","allDeviceAttributes","selectAllActiveAttributes","deviceModelAttributes","selectActiveAttributes","allActiveAttributes","activeAttributes","selectDeviceDetailAttributes","selectDeviceService","selectDeviceListAttributes","required","selectIsFiltered","accountsState","mergedDevices","devicesMap","ow","existingDevices","ed","prepend","previousDevices","filtered","accountFromDevice","ownerId","access","orgIds","sharedId","announcements","globalState","APPLICATION_TYPES_ORDER","APPLICATION_TYPES_QUERY","sortFunction","indexA","indexB","rankA","rankB","findType","emptyServiceType","getType","isReverseProxy","applicationType","CloudTimes","cleanupMinutes","timestamp","selectScripts","files","jobs","f","job","j","selectFiles","selectJobs","selectFile","selectJob","selectScript","allJobs","actions","notify","notificationSupported","showNotice","checkNotificationPermission","stateNotification","connectNotification","shareNotification","target","body","createNotification","you","disconnect","accountIds","accountTo","notification","show","stateTimes","connectTimes","CloudController","message","agent","ReconnectingWebSocket","onlineState","jobDevice","jobDevices","jd","refreshIds","deleteIds","cloudController","AuthService","username","cognitoUser","refreshToken","res","rej","err","password","challengeName","CognitoHostedUIIdentityProvider","domain","provider","authUrl","resp","shortcode","recoveryType","emailVerificationCode","recoveryCode","newUser","Auth","verificationCode","awsUser","existingPassword","newPassword","logoutUrl","authProvider","oauth","Zendesk","visible","insertScript","zendesk","authServiceConfig","authService","Controller","passwordValues","signInError","persistor","Authorization","billing","invoices","binaries","info","reason","eventName","getApp","CHARACTERISTIC_NAMES","START_MARKER","END_MARKER","SCAN_TIMEOUT","bluetooth","scanTimer","BleClient","ignoreConnected","connected","characteristic","buffers","chunk","characteristics","MTU","offset","textToDataView","ssid","pwd","write","command","completeData","reading","networks_list","urlParse","merged","exists","picked","queue","trigger","different","proxyConnection","creating","rating","clear","nameSort","contacts","feedback","subject","snackbar","finalBody","createZendeskTicket","get","initialForm","contentType","formAdaptor","script","tagValues","graphQLGetAccessKeys","graphQLCreateAccessKey","graphQLDeleteAccessKeys","graphQLToggleAccessKeys","properties","apiKey","accessKeys","EVENTS","EVENTS_URL","graphQLGetDeviceLogs","after","minDate","maxDate","graphQLGetLogs","account","graphQLGetDeviceUrl","graphQLGetUrl","logs","events","items","mfa","userInfo","AWSUser","mfaMethod","phone","searchState","isServiceId","parsedDevices","serviceName","sortSearch","sessionsState","parsed","publicConnections","getAccess","ac","scripting","sanitizeEmail","input","localPart","domainPart","RememberMe","storage","settings","rememberMe","shares","v","userDevice","selectedServices","indeterminate","scriptIndeterminate","currentDevice","intersection","userSelectedServices","userSelectedScript","matchServices","uniqueSelectedServices","eachSelectedDevice","selected","getSelectedTags","add","removeTag","found","original","canEditTags","DEFAULT_INTERFACE","SAVED_ACROSS_LOGOUT","migrateColumnStates","themeDark","StatusBar","Style","guide","guides","bubble","poppedBubbles","accordion","defaultSelection","selectPriorityGuide","metadata","language","models","isIsoDateString","DateTransform","createTransform","inboundState","outboundState","convertDates","loggerConfig","persistConfig","localForage","init","immerPlugin","persistPlugin","createLogger","getPersistor","startLog","Environment","isElectron","isMobile","isPortal","isRemote","Capacitor","isAndroidWeb","isMac","isWindows","isIOSWeb","userAgent","removeLocalStorage","windowName","external","AppLauncher","Browser","scheme","windowClose","reject","protocol","host","isDev","credentials","getEventHandlers","io","handler","errorEvent","retry","force","controller","canNavigate","progress","status","defaultInsets","useSafeArea","insets","setInsets","statusBarHeight","setStatusBarHeight","adjustInsets","SafeArea","useCapacitor","teardown","App","urlOpen","handleAppStateChange","hideSplashScreen","SplashScreen","Body","inset","center","flex","bodyRef","maxHeight","verticalOverflow","horizontalOverflow","scrollbarBackground","setHover","breakpoints","scrollbarWidth","Logo","fill","InstallationNotice","installing","isError","Gutters","bottom","top","LoadingMessage","logo","Container","LinearProgress","CircularProgress","calculateDimensions","maxArea","aspectRatio","newHeight","ResellerLogo","dimensions","setDimensions","img","GuideStep","step","instructions","acknowledge","component","autoNext","autoStart","highlight","hideArrow","showNavigation","showStart","GuideBubble","enterDelay","queueAfter","sidebar","sidebarOpen","waiting","setWaiting","hideForSidebar","queued","timeout","OrganizationSelect","location","mobile","useMediaQuery","activeOrg","ownOrg","ownOrgId","onSelect","mySessions","ButtonBase","option","primary","OrganizationSidebar","addSpace","RemoteOnLan","RemoteOnRemote","RemoteManagement","hostname","isLocalhost","remoteUI","Graphic","diagram","RegisterMenu","buttonSize","layout","unauthorized","useMatches","exactMatch","ListItemLocation","subtitle","iconPlatform","disableIcon","showDisabled","iconEl","Contents","ItemProps","UpgradeBanner","ListItemLink","href","iconProps","handleClick","ExpandIcon","selectAnnouncements","unread","useCounts","unreadAnnouncements","SidebarNav","more","setMore","counts","defaultSelectedPage","rootPaths","pathname","Collapse","Confirm","onConfirm","onDeny","maxWidth","Transition","Slide","ListItemSetting","hideIcon","subLabel","toggle","onButtonClick","quote","confirm","confirmProps","content","secondaryContent","secondaryContentWidth","showTip","setShowTip","iconRef","showToggle","showButton","handleButtonClick","handleConfirm","ListItemContent","TooltipWrapper","ListItemContents","Switch","DesktopUI","isDesktop","ENTER_DELAY","LEAVE_DELAY","TRANSITION_DURATION","AVATAR_SIZE","AVATAR_BORDER","AvatarMenu","altMenu","setAltMenu","buttonRef","enterTimer","leaveTimer","sidebarHidden","testUI","backendAuthenticated","licenseIndicator","handleOpen","checkAltMenu","handleClose","handleEnter","clearTimers","handleLeave","Menu","Sidebar","SidebarMenu","activeOrgId","Drawer","CoBrandingLogo","hostName","onLoaded","PageHeading","AuthLayout","i18nKey","showLogo","back","backLink","useTranslation","AccountRecovery","onSignIn","onVerifyRecoveryCode","setLoading","sentEmailVerifyRequest","setSentEmailVerifyRequest","setEmailVerificationCode","setRecoveryCode","handleSendEmailVerifyRequest","challenge","localError","handleSubmit","SupportRecoveryRequest","ForgotPassword","onRecoverPasswordRequest","titleKey","buttonKey","stateEmail","setEmail","emailChange","handleForgotPassword","MFACode","onConfirmSignIn","onSendCustomChallengeAnswer","onSignInSuccess","localCognitoUser","setAuthUser","setCode","authUser","PasswordStrengthInput","isNewPassword","onChange","setPassword","passwordConfirmation","setPasswordConfirmation","valid","setValid","tooShort","setTooShort","tooLong","setTooLong","hasMatch","setHasMatch","checkTestedResult","pass","zxcvbn","checkTooShort","checkTooLong","checkMatches","passConfirm","checkPasswordConfirmation","val","isValid","checkValid","isMatching","sendChange","handlePasswordChange","createPasswordStrengthLabel","score","confirmError","PasswordVerify","onVerifyPasswordChange","setShortcode","isValidPassword","setIsValidPassword","verificationRequestSent","setVerificationRequestSent","localEmail","resetPasswordNeeded","handlePasswordValidation","validation","handleVerifyPasswordChange","GoogleSignInButton","AppleSignInButton","SignIn","onCheckSaml","onUsernameChange","onGoogleSignIn","onAppleSignIn","onOktaSignIn","onSamlSignIn","errorMessage","externalError","setUsername","showPassword","setShowPassword","emailProcessed","setEmailProcessed","remember","setRemember","passRef","scrollIntoView","scrollReset","InputAdornment","Grid","FormControlLabel","Checkbox","Captcha","ReCAPTCHA","SignUp","onSignUp","onResend","hideCaptcha","useParams","showResend","setShowResend","terms","setTerms","verified","setVerified","resend","forgotPassword","alert","setPasswordValidation","SignUpVerify","sending","setSending","i18n","LanguageDetector","initReactI18next","enTranslation","Wrapper","I18nextProvider","Routes","onRecoverySignIn","inputEmail","setChallenge","handleSignIn","handleSamlSignIn","handleSignIn2","handleRecoverPasswordRequest","recoveryEmail","handleUsernameChange","handleSignup","newEmail","handleResend","Route","CognitoAuth","cognito","handleCheckSignIn","handleCheckSaml","handleRecoverySignIn","handleOktaSignIn","handleVerifyRecoveryCode","handleConfirmSignIn","handleSendCustomChallengeAnswer","handleSignUp","SignInApp","useMobileBack","customHistory","newHistory","upPath","DeleteServiceMenuItem","setupBusy","deleting","CopyMenuItem","awaitCopy","DeleteButton","destroying","setDeleting","DeleteIcon","DeleteDevice","setupDeletingDevice","destroy","LeaveDevice","leave","InfoButton","MobileUI","DeviceOptionMenu","anchorEl","setAnchorEl","devicesSection","deviceOnly","HeaderDeviceOptionMenu","serviceID","singlePanel","ScriptDeleteButton","fileID","oneWeek","UpgradeNotice","overLimit","ColumnsButton","isEqual","RefreshButton","jobID","fetching","connectionPage","useRouteMatch","networkPage","logsPage","devicesPage","scriptingPage","scriptPage","refresh","GlobalSearch","inputRef","userEmail","queryDefault","enabledIds","setQuery","fetch","useMemo","debounce","select","selection","Autocomplete","newValue","newQuery","createFilterOptions","reactStringReplace","escapeRegexp","ListSubheader","FilterButton","Header","mobileGoBack","showSearch","setShowSearch","manager","isRootMenu","Panel","header","SignInPage","short","allowSwitch","switchUrl","BottomMenu","BottomNavigation","BottomNavigationAction","getDepth","useMobileNavigation","currentDepth","nextHistory","lastDepth","ListItemBack","drawer","footer","integrated","bodyProps","OrganizationRolesPage","Redirect","PermissionsList","allowed","locked","permission","RoleAccessCounts","setCounts","TagAutocomplete","placeholder","indicator","targetEl","onItemColor","hideIcons","allowAdding","createOnly","InputProps","inputValue","setInputValue","matched","Popper","BoxComponent","createElement","TagEditor","buttonProps","keyboardShortcut","onCreate","setCreating","chipRef","onKeyDown","TagFilter","systemRole","selectedIds","countsSx","selectAll","selectDevices","onSelectIds","filteredTags","formAccess","formTag","NAME_MAX_LENGTH","OrganizationRolePage","roleID","setForm","saving","setSaving","changed","changeForm","changedForm","handlePermissionChange","fp","usePanelWidth","resize","panelWidth","setPanelWidth","MIN_WIDTH","PADDING","DoublePanel","secondary","handleRef","primaryRef","moveRef","setWidth","parentWidth","setParentWidth","grab","setGrab","sidePanelWidth","onMove","measure","parent","onDown","onUp","DynamicPanel","matchPath","RolesRouter","OutOfBand","InterfaceIcon","ScanNetwork","interfaceType","setupServicesLimit","allClosed","row","toggleAll","isAdded","ip","Scan","interfaces","scanLoading","scanTimestamp","scanInterface","selectedTimestamp","selectedLoading","noResults","scan","ScanPage","scanData","AccordionMenuItem","expanded","defaultExpanded","gutters","elevation","square","onClear","Accordion","AccordionSummary","AccordionDetails","useURLForm","urlError","setUrlError","field","setField","safeURL","string","safeParse","safePathname","formToField","fieldToForm","launchTemplate","AddFromNetwork","allowScanning","scanEnabled","ListItemCheckbox","checked","ServiceFormApplications","allowedApplications","keyApplications","otherApplications","otherSelected","PortScanIcon","StateIcon","usePortScan","portReachable","lastScan","setLastScan","portScan","ServiceForm","editable","adding","onCancel","setupAdded","initForm","defaultType","defaultForm","setDefaultForm","urlField","setUrlField","appType","newForm","nextForm","ServiceAttributesForm","TemplateSetting","SelectSetting","values","helpMessage","defaultValue","ROUTES","RouteSetting","connectionRoute","defaultRoute","customTokens","customTokensNote","routingLock","routingMessage","ConnectionDefaultsForm","ServiceDefaultsPage","LicensingTitle","LicensingNoticeDisplay","notice","UpgradeButton","LicensingNotice","ConnectionErrorMenu","ConnectionErrorMessage","hasError","setHasError","ErrorButton","ServiceConnectButton","showError","setShowError","ShareButton","DiagramIcon","highlightTypes","activeTypes","errorTypes","proxy","link","isp","DiagramPath","flexGrow","GUTTERS","SIZE","DiagramIndicator","DiagramLabel","right","titleColor","Diagram","toTypes","relay","lan","publik","protekted","page","ServiceHeaderMenu","connectThisDevice","displayThisDevice","ClearButton","UserListItem","remove","isConnected","ShareDetails","SharedUsersPaginatedList","perPage","setPage","pageCount","pageUsers","Slider","Pagination","SharedUsersLists","hasOrganization","disconnected","_u","sort","selectSessionUsers","activeSessionIds","ServiceUsersPage","EmptyMessage","NoConnectionPage","PublicSetting","EditButton","FormDisplay","actionIcon","displayValue","hideEmpty","displayOnly","InlineSetting","debug","resetValue","fieldRef","onResetClick","onShowEdit","DisplayComponent","edit","setEdit","canceled","triggerEdit","cancelBlur","editForm","viewForm","InlineTextFieldSetting","maxLength","autoCorrect","multiline","fieldProps","onError","editValue","setEditValue","Field","Input","PUBLIC_TIMEOUT","TimeoutSetting","save","newTimeout","ConnectionLogSetting","log","HeaderOverrideSetting","targetHost","LaunchQuickSelect","handleSelect","launchType","ConnectionDetails","showTitle","basicRef","copyRef","launchRef","displayHeight","setDisplayHeight","useResizeObserver","endpoint","endpointName","secureIcon","basicDisplay","nameDisplay","portDisplay","copyDisplay","launchDisplay","SubdomainSetting","LanShareSelect","shared","ListItemQuote","CustomConnectionSettings","ConfirmIconButton","InlineTemplateSetting","secureReverseProxy","LaunchTypeSelect","LaunchSelect","handleChange","invertBackground","showBackground","alwaysWhite","MuiListItemButton","ListItemCopy","PortSetting","freePort","ConnectAdvanced","ServiceEditPage","exit","updatedService","LanSharePage","lanIp","currentIp","setCurrentIp","selections","address","enabledLocalSharing","setEnabledLocalSharing","restriction","setSelection","setAddress","setDisabled","getSelectionValue","getSelectionMask","handleLocalNetworkSecurity","handleBindIP","handleEnableLocalSharing","setSharing","ContactSelector","isMulti","labelComponent","CreatableSelect","isEmail","customStyles","ServiceCheckboxes","indeterminateServices","allIndeterminate","selectAllChecked","sI","ShareSaveActions","SharingForm","handleChangeServices","handleChangeScripting","mapShareData","share","isNew","handleShare","shareData","SharePage","userID","guest","handleUnshare","notP2P","notP2PDisconnected","notProxy","checklist","ConnectionChecklist","anyFailed","shadows","DataDisplay","disablePadding","minWidth","ConnectionData","MAX_PASSWORD_LENGTH","ConnectLinkSetting","security","setSecurity","canManage","ServiceAttributes","ConnectionName","ConnectionListItem","connectionsPage","manufacturer","NetworkListTitle","noLink","NetworksJoined","NetworksAddMenu","menuWidth","setMenuWidth","closeHandler","selectHandler","Fade","NetworksAccordion","joinedNetworks","accessibleNetworks","CopyCodeBlock","hideCopyLabel","ServiceKeySetting","AutoLaunchToggle","Countdown","SUCCESS_DISMISS","FEEDBACK_DISMISS","formId","ConnectionSurvey","rated","setRated","handleRating","resetRating","sendFeedback","AutoCloseToggle","AccessAccordion","ForgetMenuItem","forget","ConnectionMenu","GraphTitle","GraphItem","PortalUI","Connect","sessionID","showDesktopNotice","ServiceRouter","basename","LicensingServiceNotice","ServiceAddPage","forward","setForward","maxReached","ListHorizontal","UsersTab","usersLinked","DeviceHeaderMenu","CSVDownloadButton","fetchUrl","setFetching","download","DatePicker","minDay","selectedDate","LocalizationProvider","AdapterLuxon","MuiDatePicker","DateTime","date","DAY","EventHeader","activeAccount","getMinDays","lifetimeDays","createdAt","handleChangeDate","EventActions","EventState","EventMessage","loggedInUser","actorName","actorAdjective","messageDevice","userList","affected","statusDisplay","JobStatusIcon","padding","EventIcon","EventItem","EventList","planUpgrade","fetchingMore","fetchMore","DeviceLogPage","DeviceDetailPage","DeviceUsersPage","DeviceDescriptionSetting","description","TestUI","DevicePresenceSetting","NotificationSettings","globalNotificationEmail","globalNotificationSystem","emailNotification","setEmailNotification","inAppNotification","setInAppNotification","inAppOverridden","setInAppOverridden","emailOverridden","setEmailOverridden","handleEmailNotifications","currentEmailNotification","handleInAppNotifications","currentDesktopNotification","itemInApp","itemEmail","chipOverridden","inapp","DeviceNameSetting","nameBlacklist","DeviceEditPage","DeviceTagEditor","canEdit","AddServiceButton","getSortOptions","optionSortServices","SortServices","sortService","servicesSort","DeviceScriptingMenu","ConnectionStateIcon","mini","showQuality","element","DeviceNameLocation","NetworksIndicator","PlanActionChip","MuiLinearProgress","JumpIndicator","CopyRegistrationCode","setMessage","RestoreModal","showRestoreModal","setResult","DevicePage","setupAddingService","setupDeletingService","disableThisConnect","servicePage","DeviceTransferPage","transferring","setSelected","onTransfer","DeviceRouter","initialized","defaultServiceLookup","defaultService","lookupResult","NetworkListItem","fallbackName","recent","collapsed","networkEnabled","networkConnected","NetworksPage","empty","NetworkTagEditor","NetworkHeaderMenu","NetworkUsersPage","networkID","NetworkSharePage","setEmails","NetworkAdd","setName","setAdding","reset","NetworkAddPage","NetworkSettings","orgName","NetworkPage","NetworkRouter","ReactiveTagNames","allTags","completeTags","tagName","JobAttribute","jobAttributes","getJobAttribute","JobDeviceDetailPage","jobDeviceID","FileUpload","filename","setFilename","isText","setIsText","onDrop","reader","buffer","getRootProps","getInputProps","isDragActive","useDropzone","showUpload","paste","demo","ScriptForm","setUnauthorized","running","setRunning","canSave","scriptChanged","canRun","run","clearUnauthorized","checkSelected","ScriptEditPage","savedForm","defaultDeviceIds","fileVersionId","setupForm","ScriptAddPage","ScriptingActionBar","tabs","tabTitles","ScriptingTabBar","tabIndex","Tabs","tab","Tab","ScriptingHeader","RouteLink","ScriptAttribute","scriptAttributes","AttributeValue","AttributeValueMemo","GridListItem","FileListItem","GridListHeaderTitle","sticky","GridListHeader","setResize","containerRef","containerX","containerY","px","GridList","rowHeight","rowShrink","headerIcon","headerContextData","HeaderContextProvider","requiredWidth","w","FileList","scripts","FilesPage","handleDemo","RunButton","onRun","onRunAgain","clickAction","ScriptPage","noDevices","validJobID","JobListItem","JobList","JobsPage","ScriptingRouter","locationParts","RedirectOffsite","useAutoRegistration","redirected","setRedirected","getRedirect","OnboardMessage","cache","setCache","OnboardRegistration","reg","processing","register","OnboardScanning","next","searching","wlan","setReady","help","setHelp","onScan","SignalIcon","strength","OnboardWifi","eth","cel","passwordRef","selectedNetwork","hasConnection","steps","OnboardRouter","onNext","nextStep","DeviceContextWrapper","ConnectionOtherPage","stopping","setStopping","thisStopping","StickyTitle","SessionsList","ConnectionsPage","idle","otherKeys","SettingsPage","ClaimPage","claimID","TestPage","setTestHeader","setAPIPreference","DeviceSetupItem","registered","ownDevice","restoring","canRestore","thisLink","BluetoothScan","AndroidSetup","ConfirmButton","CLAIM_CODE_LENGTH","ClaimDevice","claiming","AddPage","hasDemo","DeviceListEmpty","isFiltered","userAccount","WIDTH","ClickAwayListener","ColumnsDrawer","onReset","TagFilterToggle","onUpdate","matchAny","FilterSelector","filterList","isActive","AccordionMenu","menus","drawerAccordion","sortFilters","deviceFilters","ownerFilters","platformFilter","FilterDrawer","onSort","onTag","onState","onOwner","onPlatform","DevicesDrawers","DeviceListHeaderCheckbox","MobileServiceName","duplicateName","Restore","restore","onComplete","onRestore","DeviceListItem","startRestore","setStartRestore","isSelected","LoadMore","results","pages","nextPage","DeviceList","ServiceList","previousName","rows","hasFilter","divider","DevicesActionBar","removing","DevicesSelectBar","DevicesActionBars","MasterTab","SCREEN_VIEW_ID","DevicesApplicationsTabs","allTypes","DevicesHeader","DevicesPage","initLoad","setInitLoad","deviceFetching","shouldRedirect","LocalhostScanForm","setState","updateTargets","SetupDevice","disableRegister","setDisableRegister","nameError","setNameError","DocsLinks","SetupWaiting","CustomerAttribute","customerAttributes","price","amount","CustomerListItem","CustomerList","customers","ResellerPage","LicensingIcon","LimitSetting","sortLimits","order","LimitsSetting","LicensingSetting","CustomerPage","removeCustomer","TEMP_DATE","AddPlatformServices","selectedTags","AddPlatformTags","AddDownload","openDownloads","OrganizationIndicator","avatarSize","AddDevice","minimal","redirectUrl","codeOnly","codeBlock","PlatformAddPage","platformObj","defaultServices","platformTags","setPlatformTags","setApplicationTypes","xs","CustomerAddPage","OrganizationPage","admin","Overlay","PlanCard","caption","note","features","promoted","wide","Item","PlanGutters","QuantitySelector","setQuantity","PlanCheckout","onSuccess","purchasing","selectedPlan","selectedPrice","totals","setNextInterval","priceArray","priceId","unchanged","NoticeCustomPlan","Plans","includeLicenseId","getDefaults","personal","success","push","planPrice","planInterval","isDowngrade","CustomerPlansPage","AnnouncementCard","scrollPosition","read","setRead","cardRef","handleRead","Card","CardHeader","CardMedia","CardContent","CardActions","AnnouncementCardTest","AnnouncementsPage","setScrollPosition","currentBodyRef","onScroll","announcement","RoleSelect","OrganizationAddPage","allContacts","freeUsers","enterprise","setRoleId","REASONS","DeleteAccountSection","paidPlan","deleteAccount","setConfirm","contact","setContact","reasons","setReasons","setBody","handleDelete","handleReason","ProfilePage","RemoveMemberButton","setRemoving","LeaveOrganizationButton","organizationId","LicenseSelect","OrganizationMemberDetails","availableUsers","accessible","OrganizationGuestDetails","fetched","setFetched","missing","OrganizationUserPage","isOwnerAccount","isMyAccount","OrganizationEmptyPage","OrganizationGuestList","guestsLoaded","pageGuests","alphaEmailSort","aa","bb","OrganizationGuestsPage","MegaButton","RaspberrypiOptionsPage","OrganizationMember","hideActions","OrganizationMemberList","SeatsSetting","context","OrganizationMembersPage","OrganizationSAMLUpload","onUpload","OrganizationSAMLSettings","updating","defaultDomain","checking","setChecking","incomplete","disable","enable","ResellerSettings","OrganizationSettingsPage","isOrgOwner","OrganizationLicensingPage","OrganizationMembershipPage","ConnectionDefaultsPage","customConnectionSetting","customConnectionNote","addCustomSettings","el","connectionDefaults","applicationID","idForm","LicensingPage","SettingsDisableNetworkItem","toggleChange","setToggleChange","subLabelText","ListItemSelect","UpdateSetting","nextCheck","downloaded","downloading","updateAvailable","currentVersion","OptionsPage","cliVersion","notOwner","CreditCard","Invoices","Table","TableHead","TableRow","TableCell","TableBody","invoice","BillingPage","PlanEnterprise","PlanReseller","PlanCustomer","PlansPage","isReseller","isEnterprise","removeReseller","ColorSelect","setTooltip","Select","TagsPage","rename","LogsPage","TimeSeriesSelect","timeSeriesOptions","GraphsPage","AccountPage","externalBilling","ProgressBar","checkPassword","ChangePassword","currentPassword","setCurrentPassword","evaluateCurrentPassword","updatePassword","MFASelectMethod","verificationMethod","changeVerificationMethod","nextVerificationMethod","setShowEnableSelection","setShowMFASelection","MFAConfigureApp","totpCode","loadTotpCode","totpVerified","sendVerifyTotp","setTotpVerificationCode","totpVerificationCode","cancel","QRCodeSVG","MFAPhoneForm","AWSPhone","originalPhone","setPhone","validPhone","setValidPhone","country","handleOnChange","updateUsersPhone","PhoneInput","MFAConfigureSms","cancelEditPhone","successfulPhoneUpdate","sendVerifyPhone","hasOldSentVerification","resendCode","setCancelShowVerificationCode","showPhone","showVerificationCode","MFAMethod","phoneNumber","backupCode","MFAPreference","showMFASelection","showSMSConfig","showEnableSelection","showAuthenticatorConfig","setShowAuthenticatorConfig","setTotpCode","cancelShowVerificationCode","setVerificationMethod","setHasOldSentVerification","setVerificationCode","setShowPhone","setShowVerificationCode","setShowSMSConfig","cancelTotp","orginalNumber","newNumber","SecurityPage","GlobalSignOut","signedOut","FeedbackPage","presets","setSubject","DeleteAccessKey","deleteKey","deleteText","setDeleteText","confirmDelete","CreateAccessKey","newKey","secretKey","showAccessKey","setShowAccessKey","handleShowAccessKey","downloadCredentials","CodeBlock","AccountAccessKey","showDialog","setShowDialog","handleToggle","AccessKeyPage","ListItemSwitch","NotificationMode","notificationUrl","urlNotifications","updateNotificationSettings","webHookUrl","setWebhookUrl","onEmailChange","onSystemChange","onWebChange","changeWebHookUrl","isURL","NotificationsPage","Router","initialRoute","DragAppRegion","ConnectionNotice","queueCount","queueEnabling","queueFinished","queueConnection","clearConnectionsMessage","stopped","started","Snackbar","GLOBAL_DIALOGS","GlobalConfirm","dialog","UpdateNotice","updateReady","handleDisable","RemoteHeader","showFrame","fullscreen","setFullscreen","fullscreenEnabled","screenfull","toggleFullscreen","Page","successMessage","noticeMessage","clearSuccessMessage","clearErrorMessage","reconnect","authInitialized","installed","waitMessage","showOrgs","hideSidebar","overlapHeader","showBottomMenu","PersistGate","ErrorBoundary","Notifier","Layout","StyledEngineProvider","ThemeProvider","analytics","gtmId","TagManager","getState","getCloudData","escapeRegex","createRoot","Provider","CssBaseline","HashRouter"],"ignoreList":[],"sources":["../../src/polyfills.ts","../../../common/src/constants.ts","../../src/constants.ts","../../src/helpers/versionHelper.ts","../../src/helpers/apiHelper.ts","../../src/services/remoteit.ts","../../src/services/Network.ts","../../src/helpers/sleep.ts","../../src/services/post.ts","../../src/services/graphQL.ts","../../src/services/graphQLRequest.ts","../../src/services/graphQLMutation.ts","../../../common/src/adaptor.ts","../../../common/src/nameHelper.ts","../../src/helpers/dateHelper.ts","../../src/platforms/index.ts","../../src/components/PlatformIcon.tsx","../../src/styling/index.ts","../../src/assets/R3gray.tsx","../../src/components/Icon.tsx","../../src/components/TargetPlatform/TargetPlatform.tsx","../../src/components/Quote.tsx","../../src/components/Percent.tsx","../../src/components/Round.tsx","../../src/components/QualityDetails.tsx","../../src/components/ServiceLinkIcon.tsx","../../src/components/LicenseChip.tsx","../../src/components/ServiceMiniState.tsx","../../src/components/ServiceIndicators.tsx","../../src/components/InitiatorPlatform.tsx","../../src/helpers/lanSharing.ts","../../src/services/Context.ts","../../src/buttons/IconButton.tsx","../../src/components/GraphColumn.tsx","../../src/components/ServiceGraphColumn.tsx","../../src/components/DeviceGraphColumn.tsx","../../../common/src/applications.ts","../../src/models/backend.ts","../../src/selectors/state.ts","../../src/selectors/accounts.ts","../../src/selectors/applications.ts","../../src/hooks/useApplication.ts","../../src/selectors/networks.ts","../../src/test/licensing.ts","../../src/services/CloudSync.ts","../../src/models/plans.ts","../../src/selectors/organizations.ts","../../src/models/organization.ts","../../src/models/networks.ts","../../src/selectors/connections.ts","../../src/helpers/connectionHelper.ts","../../src/components/InlineFileFieldSetting.tsx","../../src/components/PromptModal.tsx","../../src/hooks/useClipboard.ts","../../src/buttons/CopyIconButton.tsx","../../src/buttons/DynamicButton.tsx","../../src/buttons/ConnectButton.tsx","../../src/components/Notice.tsx","../../src/buttons/ComboButton/ComboButton.tsx","../../src/services/Heartbeat.ts","../../src/buttons/LaunchButton/LaunchButton.tsx","../../src/components/ConnectAttribute.tsx","../../src/buttons/RestoreButton.tsx","../../src/hooks/useLabel.ts","../../src/components/Tag.tsx","../../src/components/Tags.tsx","../../src/components/ReactiveTags.tsx","../../src/components/Title.tsx","../../src/components/ColorChip.tsx","../../src/components/DeviceName.tsx","../../src/helpers/uiHelper.ts","../../src/selectors/tags.ts","../../src/helpers/utilHelper.ts","../../src/models/labels.ts","../../src/components/Avatar/Avatar.tsx","../../src/components/AvatarList.tsx","../../src/components/DeviceRole.tsx","../../src/hooks/useInterval.ts","../../src/components/Duration/Duration.tsx","../../src/components/StatusChip.tsx","../../src/components/BarGraph.tsx","../../src/components/Timestamp.tsx","../../src/components/TimeSeries.tsx","../../src/components/DeviceGeo.tsx","../../src/components/Link.tsx","../../src/components/Attributes.tsx","../../src/services/graphQLDevice.ts","../../../common/src/brand/config.ts","../../src/components/ArrowIcon.tsx","../../src/styling/theme.ts","../../src/selectors/ui.ts","../../src/models/devices.ts","../../src/components/Attribute.tsx","../../src/selectors/devices.ts","../../src/models/accounts.ts","../../src/models/announcements.ts","../../src/models/applicationTypes.ts","../../src/services/CloudTimes.ts","../../src/selectors/scripting.ts","../../src/assets/noticeIcon.png","../../src/services/Notifications.ts","../../src/services/cloudController.ts","../../src/cognito/auth.ts","../../src/services/zendesk.ts","../../src/models/auth.ts","../../src/models/billing.ts","../../src/models/binaries.ts","../../src/services/event.ts","../../src/models/bluetooth.ts","../../src/models/connections.ts","../../src/models/contacts.ts","../../src/models/feedback.ts","../../src/services/get.ts","../../src/models/files.ts","../../src/models/jobs.ts","../../src/services/graphQLAccessKeys.ts","../../src/models/keys.ts","../../src/services/graphQLLogs.ts","../../src/models/logs.ts","../../src/models/mfa.ts","../../src/models/search.ts","../../src/models/sessions.ts","../../src/helpers/userHelper.ts","../../src/models/shares.ts","../../src/helpers/selectedHelper.ts","../../src/models/tags.ts","../../src/models/ui.ts","../../src/models/user.ts","../../src/models/index.ts","../../src/helpers/DateTransform.ts","../../src/store.ts","../../src/services/browser.ts","../../src/services/Controller.ts","../../src/hooks/useSafeArea.ts","../../src/hooks/useCapacitor.ts","../../src/components/Body.tsx","../../../common/src/brand/Logo.tsx","../../src/components/InstallationNotice/InstallationNotice.tsx","../../src/components/Gutters.tsx","../../src/components/LoadingMessage/LoadingMessage.tsx","../../src/components/ResellerLogo.tsx","../../src/components/GuideStep.tsx","../../src/components/GuideBubble.tsx","../../src/components/OrganizationSelect.tsx","../../src/components/OrganizationSidebar.tsx","../../src/assets/RemoteOnLan.tsx","../../src/assets/RemoteOnRemote.tsx","../../src/components/RemoteManagement.tsx","../../src/components/RegisterMenu.tsx","../../src/hooks/useMatches.ts","../../src/components/ListItemLocation.tsx","../../src/components/UpgradeBanner.tsx","../../src/components/ListItemLink.tsx","../../src/components/ExpandIcon.tsx","../../src/selectors/announcements.ts","../../src/hooks/useCounts.ts","../../src/components/SidebarNav.tsx","../../src/components/Confirm.tsx","../../src/components/ListItemSetting/ListItemSetting.tsx","../../src/components/DesktopUI.tsx","../../src/components/AvatarMenu.tsx","../../src/components/Sidebar.tsx","../../src/components/SidebarMenu.tsx","../../src/cognito/components/CoBrandingLogo/CoBrandingLogo.tsx","../../src/cognito/components/SplashScreen/SplashScreen.tsx","../../src/cognito/components/PageHeading/PageHeading.tsx","../../src/cognito/components/AuthLayout/AuthLayout.tsx","../../src/cognito/components/AccountRecovery/AccountRecovery.tsx","../../src/cognito/components/ForgotPassword/ForgotPassword.tsx","../../src/cognito/components/MFACode/MFACode.tsx","../../src/cognito/components/PasswordStrengthInput/PasswordStrengthInput.tsx","../../src/cognito/components/PasswordVerify/PasswordVerify.tsx","../../src/cognito/components/GoogleSignInButton.tsx","../../src/cognito/components/AppleSignInButton.tsx","../../src/cognito/components/SignIn/SignIn.tsx","../../src/cognito/components/Captcha/Captcha.tsx","../../src/cognito/components/SignUp/SignUp.tsx","../../src/cognito/components/SignUpVerify/SignUpVerify.tsx","../../src/cognito/i18n.ts","../../src/cognito/components/Wrapper/Wrapper.tsx","../../src/cognito/components/Auth/Auth.tsx","../../src/cognito/components/CognitoAuth/CognitoAuth.tsx","../../src/components/SignInApp.tsx","../../src/hooks/useMobileBack.ts","../../src/buttons/DeleteServiceMenuItem.tsx","../../src/components/CopyMenuItem.tsx","../../src/buttons/DeleteButton.tsx","../../src/components/DeleteDevice.tsx","../../src/components/LeaveDevice.tsx","../../src/buttons/InfoButton.tsx","../../src/components/MobileUI.tsx","../../src/components/DeviceOptionMenu.tsx","../../src/components/HeaderDeviceOptionMenu.tsx","../../src/components/ScriptDeleteButton.tsx","../../src/components/UpgradeNotice.tsx","../../src/buttons/ColumnsButton.tsx","../../src/buttons/RefreshButton/RefreshButton.tsx","../../src/components/GlobalSearch.tsx","../../src/buttons/FilterButton/FilterButton.tsx","../../src/components/Header/Header.tsx","../../src/components/Panel.tsx","../../src/pages/SignInPage/SignInPage.tsx","../../src/components/BottomMenu.tsx","../../src/hooks/useMobileNavigation.ts","../../src/components/ListItemBack.tsx","../../src/components/Container/Container.tsx","../../src/pages/OrganizationRolesPage.tsx","../../src/components/PermissionsList.tsx","../../src/components/RoleAccessCounts.tsx","../../src/components/TagAutocomplete.tsx","../../src/components/TagEditor.tsx","../../src/components/TagFilter.tsx","../../src/pages/OrganizationRolePage.tsx","../../src/hooks/usePanelWidth.ts","../../src/components/DoublePanel.tsx","../../src/components/DynamicPanel.tsx","../../src/routers/RolesRouter.tsx","../../src/components/OutOfBand/OutOfBand.tsx","../../src/components/ScanNetwork/ScanNetwork.tsx","../../src/components/Scan/Scan.tsx","../../src/pages/ScanPage.tsx","../../src/components/AccordionMenuItem.tsx","../../src/hooks/useURLForm.ts","../../src/components/AddFromNetwork.tsx","../../src/components/ListItemCheckbox/ListItemCheckbox.tsx","../../src/components/ServiceFormApplications.tsx","../../src/components/PortScanIcon.tsx","../../src/hooks/usePortScan.ts","../../src/components/ServiceForm.tsx","../../src/components/TemplateSetting.tsx","../../src/components/SelectSetting.tsx","../../src/components/RouteSetting.tsx","../../src/components/ServiceAttributesForm.tsx","../../src/components/ConnectionDefaultsForm.tsx","../../src/pages/ServiceDefaultsPage.tsx","../../src/components/LicensingTitle.tsx","../../src/components/LicensingNoticeDisplay.tsx","../../src/components/LicensingNotice.tsx","../../src/components/ConnectionErrorMenu.tsx","../../src/components/ConnectionErrorMessage/ConnectionErrorMessage.tsx","../../src/buttons/ErrorButton/ErrorButton.tsx","../../src/buttons/ServiceConnectButton.tsx","../../src/buttons/ShareButton.tsx","../../src/components/DiagramIcon.tsx","../../src/components/DiagramPath.tsx","../../src/components/DiagramIndicator.tsx","../../src/components/DiagramLabel.tsx","../../src/components/Diagram.tsx","../../src/components/ServiceHeaderMenu.tsx","../../src/buttons/ClearButton/ClearButton.tsx","../../src/components/UserListItem/UserListItem.tsx","../../src/components/ShareDetails/ShareDetails.tsx","../../src/components/SharedUsersPaginatedList.tsx","../../src/components/SharedUsersLists.tsx","../../src/selectors/sessions.ts","../../src/pages/ServiceUsersPage.tsx","../../src/components/EmptyMessage.tsx","../../src/pages/NoConnectionPage.tsx","../../src/components/PublicSetting.tsx","../../src/buttons/EditButton.tsx","../../src/components/FormDisplay.tsx","../../src/components/InlineSetting.tsx","../../src/components/InlineTextFieldSetting.tsx","../../src/components/TimeoutSetting.tsx","../../src/components/ConnectionLogSetting.tsx","../../src/components/HeaderOverrideSetting.tsx","../../src/components/LaunchQuickSelect.tsx","../../src/components/ConnectionDetails.tsx","../../src/components/SubdomainSetting.tsx","../../src/components/LanShareSelect/LanShareSelect.tsx","../../src/components/ListItemQuote.tsx","../../src/components/CustomConnectionSettings.tsx","../../src/buttons/ConfirmIconButton.tsx","../../src/components/InlineTemplateSetting/InlineTemplateSetting.tsx","../../src/components/LaunchTypeSelect.tsx","../../src/components/LaunchSelect/LaunchSelect.tsx","../../src/buttons/ListItemButton.tsx","../../src/components/ListItemCopy.tsx","../../src/components/PortSetting/PortSetting.tsx","../../src/components/ConnectAdvanced.tsx","../../src/pages/ServiceEditPage/ServiceEditPage.tsx","../../src/pages/LanSharePage/LanSharePage.tsx","../../src/components/ContactSelector.tsx","../../src/components/SharingForm/ServiceCheckboxes.tsx","../../src/components/ShareSaveActions/ShareSaveActions.tsx","../../src/components/SharingForm/SharingForm.tsx","../../src/pages/SharePage/SharePage.tsx","../../src/helpers/checklistHelper.ts","../../src/components/ConnectionChecklist.tsx","../../src/components/DataDisplay/DataDisplay.tsx","../../src/components/ConnectionData.tsx","../../src/components/ConnectLinkSetting.tsx","../../src/components/ServiceAttributes.tsx","../../src/components/ConnectionName.tsx","../../src/components/ConnectionListItem.tsx","../../src/components/NetworkListTitle.tsx","../../src/components/NetworksJoined.tsx","../../src/components/NetworkAddMenu.tsx","../../src/components/NetworksAccordion.tsx","../../src/components/CopyCodeBlock.tsx","../../src/components/ServiceKeySetting.tsx","../../src/components/AutoLaunchToggle.tsx","../../src/components/Countdown.tsx","../../src/components/ConnectionSurvey.tsx","../../src/components/AutoCloseToggle.tsx","../../src/components/AccessAccordion.tsx","../../src/components/ForgetMenuItem.tsx","../../src/components/ConnectionMenu.tsx","../../src/components/GraphTitle.tsx","../../src/components/GraphItem.tsx","../../src/components/PortalUI.tsx","../../src/components/Connect.tsx","../../src/routers/ServiceRouter.tsx","../../src/components/LicensingServiceNotice.tsx","../../src/pages/ServiceAddPage/ServiceAddPage.tsx","../../src/components/ListHorizontal.tsx","../../src/components/UsersTab.tsx","../../src/components/DeviceHeaderMenu.tsx","../../src/buttons/CSVDownloadButton/CSVDownloadButton.tsx","../../src/components/DatePicker/DatePicker.tsx","../../src/components/EventList/EventHeader.tsx","../../src/components/EventList/EventMessage.tsx","../../src/components/JobStatusIcon.tsx","../../src/components/EventList/EventIcon.tsx","../../src/components/EventList/EventItem.tsx","../../src/components/EventList/EventList.tsx","../../src/pages/DeviceLogPage/DeviceLogPage.tsx","../../src/pages/DeviceDetailPage.tsx","../../src/pages/DeviceUsersPage.tsx","../../src/components/DeviceDescriptionSetting.tsx","../../src/components/TestUI.tsx","../../src/components/DevicePresenceSetting.tsx","../../src/components/NotificationSettings/NotificationSettings.tsx","../../src/components/DeviceNameSetting/DeviceNameSetting.tsx","../../src/pages/DeviceEditPage.tsx","../../src/components/DeviceTagEditor.tsx","../../src/buttons/AddServiceButton/AddServiceButton.tsx","../../src/components/SortServices.tsx","../../src/components/DeviceScriptingMenu.tsx","../../src/components/ConnectionStateIcon/ConnectionStateIcon.tsx","../../src/components/DeviceNameLocation.tsx","../../src/components/NetworksIndicator.tsx","../../src/components/PlanActionChip.tsx","../../src/components/LinearProgress.tsx","../../src/components/JumpIndicator.tsx","../../src/components/CopyRegistrationCode.tsx","../../src/components/RestoreModal.tsx","../../src/pages/DevicePage.tsx","../../src/pages/DeviceTransferPage/DeviceTransferPage.tsx","../../src/routers/DeviceRouter.tsx","../../src/components/NetworkListItem.tsx","../../src/components/Network.tsx","../../src/pages/NetworksPage.tsx","../../src/components/NetworkTagEditor.tsx","../../src/components/NetworkHeaderMenu.tsx","../../src/pages/NetworkUsersPage.tsx","../../src/pages/NetworkSharePage.tsx","../../src/components/NetworkAdd.tsx","../../src/pages/NetworkAddPage.tsx","../../src/components/NetworkSettings.tsx","../../src/pages/NetworkPage.tsx","../../src/routers/NetworkRouter.tsx","../../src/components/ReactiveTagNames.tsx","../../src/components/JobAttributes.tsx","../../src/pages/JobDeviceDetailPage.tsx","../../src/components/FileUpload.tsx","../../src/components/ScriptForm.tsx","../../src/pages/ScriptEditPage.tsx","../../src/pages/ScriptAddPage.tsx","../../src/components/ScriptingActionBar.tsx","../../src/components/ScriptingTabBar.tsx","../../src/components/ScriptingHeader.tsx","../../src/components/FileAttributes.tsx","../../src/components/AttributeValue.tsx","../../src/components/GridListItem.tsx","../../src/components/FileListItem.tsx","../../src/components/GridListHeaderTitle.tsx","../../src/components/GridListHeader.tsx","../../src/components/GridList.tsx","../../src/components/FileList.tsx","../../src/pages/FilesPage.tsx","../../src/buttons/RunButton.tsx","../../src/pages/ScriptPage.tsx","../../src/components/JobListItem.tsx","../../src/components/JobList.tsx","../../src/pages/JobsPage.tsx","../../src/routers/ScriptingRouter.tsx","../../src/components/RedirectOffsite.tsx","../../src/hooks/useAutoRegistration.ts","../../src/components/OnboardMessage.tsx","../../src/components/OnboardRegisteration.tsx","../../src/components/OnboardScanning.tsx","../../src/buttons/SignalIcon.tsx","../../src/components/OnboardWifi.tsx","../../src/routers/OnboardRouter.tsx","../../src/components/DeviceContextWrapper.tsx","../../src/pages/ConnectionOtherPage.tsx","../../src/components/StickyTitle.tsx","../../src/components/SessionsList/SessionsList.tsx","../../src/pages/ConnectionsPage.tsx","../../src/pages/SettingsPage/SettingsPage.tsx","../../src/pages/ClaimPage.tsx","../../src/pages/TestPage.tsx","../../src/components/DeviceSetupItem/DeviceSetupItem.tsx","../../src/components/BluetoothScan.tsx","../../src/components/AndroidSetup.tsx","../../src/buttons/ConfirmButton.tsx","../../src/components/ClaimDevice.tsx","../../src/pages/AddPage.tsx","../../src/components/DeviceListEmpty.tsx","../../src/components/Drawer.tsx","../../src/components/ColumnsDrawer.tsx","../../src/components/TagFilterToggle.tsx","../../src/components/FilterSelector.tsx","../../src/components/AccordionMenu.tsx","../../src/components/FilterDrawer.tsx","../../src/components/DevicesDrawers.tsx","../../src/components/DeviceListHeaderCheckbox.tsx","../../src/components/MobileServiceName.tsx","../../src/components/Restore.tsx","../../src/components/DeviceListItem.tsx","../../src/components/LoadMore/LoadMore.tsx","../../src/components/DeviceList.tsx","../../src/components/ServiceList.tsx","../../src/components/DevicesActionBar.tsx","../../src/components/DevicesSelectBar.tsx","../../src/components/DevicesActionBars.tsx","../../src/components/MasterTab.tsx","../../src/components/DevicesApplicationsTabs.tsx","../../src/components/DevicesHeader.tsx","../../src/pages/DevicesPage.tsx","../../src/components/LocalhostScanForm/LocalhostScanForm.tsx","../../src/pages/SetupDevice/SetupDevice.tsx","../../src/components/DocsLinks/DocsLinks.tsx","../../src/pages/SetupWaiting/SetupWaiting.tsx","../../src/components/CustomerAttributes.tsx","../../src/components/CustomerListItem.tsx","../../src/components/CustomerList.tsx","../../src/pages/ResellerPage.tsx","../../src/components/LicensingIcon.tsx","../../src/components/LimitSetting.tsx","../../src/components/LimitsSetting.tsx","../../src/components/LicensingSetting.tsx","../../src/pages/CustomerPage.tsx","../../src/components/AddPlatformServices.tsx","../../src/components/AddPlatformTags.tsx","../../src/components/AddDownload.tsx","../../src/components/OrganizationIndicator.tsx","../../src/components/AddDevice.tsx","../../src/pages/PlatformAddPage.tsx","../../src/pages/CustomerAddPage.tsx","../../src/pages/OrganizationPage.tsx","../../src/components/Overlay.tsx","../../src/components/PlanCard.tsx","../../src/components/PlanGutters.tsx","../../src/components/QuantitySelector.tsx","../../src/components/PlanCheckout.tsx","../../src/components/NoticeCustomPlan.tsx","../../src/components/Plans.tsx","../../src/pages/CustomerPlansPage.tsx","../../src/components/AnnouncementCard.tsx","../../src/components/AnnouncementCardTest.tsx","../../src/pages/AnnouncementsPage.tsx","../../src/components/RoleSelect.tsx","../../src/pages/OrganizationAddPage.tsx","../../src/components/DeleteAccountSection.tsx","../../src/pages/ProfilePage.tsx","../../src/buttons/RemoveMemberButton.tsx","../../src/buttons/LeaveOrganizationButton.tsx","../../src/components/LicenseSelect.tsx","../../src/components/OrganizationMemberDetails.tsx","../../src/components/OrganizationGuestDetails.tsx","../../src/pages/OrganizationUserPage.tsx","../../src/pages/OrganizationEmptyPage.tsx","../../src/components/OrganizationGuestList.tsx","../../src/pages/OrganizationGuestsPage.tsx","../../src/components/MegaButton.tsx","../../src/pages/RaspberrypiOptionsPage.tsx","../../src/components/OrganizationMember.tsx","../../src/components/OrganizationMemberList.tsx","../../src/components/SeatsSetting.tsx","../../src/pages/OrganizationMembersPage.tsx","../../src/components/OrganizationSAMLUpload.tsx","../../src/components/OrganizationSAMLSettings.tsx","../../src/components/ResellerSettings.tsx","../../src/pages/OrganizationSettingsPage.tsx","../../src/pages/OrganizationLicensingPage.tsx","../../src/pages/OrganizationMembershipPage.tsx","../../src/pages/ConnectionDefaultsPage.tsx","../../src/pages/LicensingPage.tsx","../../src/components/SettingsDisableNetworkItem/SettingsDisableNetworkItem.tsx","../../src/components/ListItemSelect.tsx","../../src/components/UpdateSetting/UpdateSetting.tsx","../../src/pages/OptionsPage.tsx","../../src/components/CreditCard.tsx","../../src/components/Invoices.tsx","../../src/pages/BillingPage.tsx","../../src/components/PlanEnterprise.tsx","../../src/components/PlanReseller.tsx","../../src/components/PlanCustomer.tsx","../../src/pages/PlansPage.tsx","../../src/components/ColorSelect.tsx","../../src/pages/TagsPage.tsx","../../src/pages/LogsPage.tsx","../../src/components/TimeSeriesSelect.tsx","../../src/pages/GraphsPage.tsx","../../src/pages/AccountPage.tsx","../../src/components/ChangePassword/ProgressBar.tsx","../../src/components/ChangePassword/PasswordStrengthInput.tsx","../../src/components/ChangePassword/ChangePassword.tsx","../../src/components/MFA/MFASelectMethod.tsx","../../src/components/MFA/MFAConfigureApp.tsx","../../src/components/MFA/MFAPhoneForm.tsx","../../src/components/MFA/MFAConfigureSms.tsx","../../src/components/MFA/MFAMethod.tsx","../../src/components/MFA/MFAPreference.tsx","../../src/pages/SecurityPage.tsx","../../src/pages/FeedbackPage.tsx","../../src/components/AccountAccessKey/DeleteAccessKey.tsx","../../src/components/AccountAccessKey/CreateAccessKey.tsx","../../src/components/CodeBlock.tsx","../../src/components/AccountAccessKey/AccountAccessKey.tsx","../../src/pages/AccessKeyPage.tsx","../../src/components/ListItemSwitch/ListItemSwitch.tsx","../../src/pages/NotificationsPage/NotificationsMode.tsx","../../src/pages/NotificationsPage/NotificationsPage.tsx","../../src/routers/Router.tsx","../../src/components/DragAppRegion.tsx","../../src/components/ConnectionNotice.tsx","../../src/components/GlobalConfirm.tsx","../../src/components/UpdateNotice/UpdateNotice.tsx","../../src/components/RemoteHeader.tsx","../../src/pages/Page.tsx","../../src/components/App.tsx","../../src/components/ErrorBoundary.tsx","../../src/components/Layout.tsx","../../src/services/analytics.ts","../../src/initializeCommon.ts","../../src/main.tsx"],"sourcesContent":["if (typeof global === 'undefined') {\n window.global = window\n}\n","export const CLI_AGENT_ERROR_CODE = 101\nexport const CLI_REACHABLE_ERROR_CODE = 523\nexport const CLI_CERT_FAILURE_ERROR_CODE = 496\n\nexport const REGEX_LAST_NUMBER = /-*\\d*$/\nexport const REGEX_NAME_SAFE = /[^a-zA-Z0-9_ -]/g\nexport const REGEX_NOT_FILE_SAFE = /[\\W]/g\nexport const MAX_NAME_LENGTH = 100\n\nexport const IP_OPEN: ipAddress = '0.0.0.0'\nexport const IP_LATCH: ipAddress = '255.255.255.255'\nexport const IP_PRIVATE: ipAddress = '127.0.0.1'\n\nexport const DEFAULT_CONNECTION: IConnection = {\n id: '',\n name: '',\n owner: { id: '', email: '' },\n deviceID: '',\n online: true,\n timeout: 15,\n enabled: false,\n ip: IP_PRIVATE,\n targetHost: '',\n autoLaunch: false,\n restriction: IP_OPEN,\n publicRestriction: IP_LATCH,\n default: true,\n}\n\nexport const DEFAULT_SERVICE: IService = {\n id: '',\n contactedAt: new Date(),\n createdAt: new Date(),\n name: '',\n subdomain: '',\n lastReported: new Date(),\n state: 'inactive',\n type: '',\n typeID: 1,\n deviceID: '',\n access: [],\n license: 'UNKNOWN',\n attributes: {},\n}\n","const env = import.meta.env\nexport const MODE = env.MODE || 'development'\nexport const CLIENT_ID = env.VITE_CLIENT_ID\nexport const MOBILE_CLIENT_ID = env.VITE_MOBILE_CLIENT_ID\nexport const COGNITO_USER_POOL_ID = env.VITE_COGNITO_USER_POOL_ID || 'us-west-2_6nKjyW7yg'\nexport const COGNITO_AUTH_DOMAIN = env.VITE_COGNITO_AUTH_DOMAIN || 'auth.remote.it'\nexport const API_URL = env.VITE_API_URL || 'https://api.remote.it/apv/v27'\nexport const AUTH_API_URL = env.VITE_AUTH_API_URL || env.AUTH_API_URL || 'https://auth.api.remote.it/v1'\nexport const GRAPHQL_API = env.VITE_GRAPHQL_API || 'https://api.remote.it/graphql/v1'\nexport const GRAPHQL_BETA_API = env.VITE_GRAPHQL_BETA_API || 'https://api.remote.it/graphql/beta'\nexport const PORTAL = (env.VITE_PORTAL || env.PORTAL) === 'true' ? true : false\nexport const DEVELOPER_KEY = env.VITE_DEVELOPER_KEY || 'Mjc5REIzQUQtMTQyRC00NTcxLTlGRDktMTVGNzVGNDYxQkE3'\n\nexport const PROTOCOL = env.PROTOCOL || 'remoteit://'\nexport const REDIRECT_URL = env.VITE_REDIRECT_URL || PROTOCOL + 'authCallback'\nexport const SIGNOUT_REDIRECT_URL = PROTOCOL + 'signoutCallback'\nexport const CALLBACK_URL =\n env.VITE_CALLBACK_URL || env.MODE === 'development'\n ? env.VITE_DEV_CALLBACK_URL || 'https://dev-auth.internal.remote.it/v1/callback/'\n : env.VITE_PROD_CALLBACK_URL || 'https://auth.api.remote.it/v1/callback/'\n\nexport const WEBSOCKET_URL = env.VITE_WEBSOCKET_URL\nexport const WEBSOCKET_BETA_URL = env.VITE_WEBSOCKET_BETA_URL\nexport const PORT = env.VITE_PORT || 29999\nexport const PASSWORD_MIN_LENGTH = env.PASSWORD_MIN_LENGTH ? Number(env.PASSWORD_MIN_LENGTH) : 7\nexport const PASSWORD_MAX_LENGTH = env.PASSWORD_MAX_LENGTH ? Number(env.PASSWORD_MAX_LENGTH) : 64\nexport const RECAPTCHA_SITE_KEY = String(env.RECAPTCHA_SITE_KEY || '6Ldt3W4UAAAAAFtJAA4erruG9zT9TCOulJHO4L5e')\n\nconst BT_BASE_UUID = '-6802-4573-858e-5587180c32ea'\nexport const BT_UUIDS = {\n SERVICE: `0000a000${BT_BASE_UUID}`,\n WIFI_LIST: `0000a004${BT_BASE_UUID}`,\n WIFI_STATUS: `0000a001${BT_BASE_UUID}`,\n REGISTRATION_STATUS: `0000a011${BT_BASE_UUID}`,\n COMMAND: `0000a020${BT_BASE_UUID}`,\n}\n\nexport const DEMO_DEVICE_CLAIM_CODE = 'GUESTVPC'\nexport const DEMO_DEVICE_ID = '80:00:01:7F:7E:00:48:1B'\nexport const TEST_HEADER = 'test-header'\n\n//Airbrake\nexport const AIRBRAKE_ID = parseInt(env.VITE_AIRBRAKE_ID || '', 10)\nexport const AIRBRAKE_KEY = String(env.VITE_AIRBRAKE_KEY)\n\n//API Zendesk\nexport const ZENDESK_URL = env.ZENDESK_URL || env.VITE_ZENDESK_URL\nexport const ZENDESK_KEY = env.ZENDESK_KEY || env.VITE_ZENDESK_KEY\n//Analytics\nexport const GOOGLE_TAG_MANAGER_PORTAL_KEY = env.VITE_GOOGLE_TAG_MANAGER_PORTAL_KEY\nexport const GOOGLE_TAG_MANAGER_DESKTOP_KEY = env.VITE_GOOGLE_TAG_MANAGER_DESKTOP_KEY\nexport const GOOGLE_TAG_MANAGER_ANDROID_KEY = env.VITE_GOOGLE_TAG_MANAGER_ANDROID_KEY\nexport const GOOGLE_TAG_MANAGER_IOS_KEY = env.VITE_GOOGLE_TAG_MANAGER_IOS_KEY\n\nexport const CERTIFICATE_DOMAIN = 'at.remote.it'\nexport const ANONYMOUS_MANUFACTURER_CODE = 34560\nexport const SCREEN_VIEW_APP_LINK = 'https://play.google.com/store/apps/details?id=it.remote.screenview'\nexport const DEMO_SCRIPT_URL =\n 'https://raw.githubusercontent.com/remoteit/code_samples/refs/heads/main/scripts/linux/script_demo.sh'\n\nexport const REGEX_LAST_PATH = /\\/[^/]+$/g\nexport const REGEX_FIRST_PATH = /^\\/([^\\/]+)/g\nexport const REGEX_IP_SAFE = /[^0-9.]+/g\nexport const REGEX_PORT_SAFE = /[^0-9]+/g\nexport const REGEX_DOMAIN_SAFE = /[^a-zA-Z0-9-.]+/g\nexport const REGEX_EMAIL_SAFE = /[^a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+/g\nexport const REGEX_NUMERIC_VALUE = /=(\\d+)/\nexport const REGEX_CHARACTERS = /^([^0-9]*)$/\nexport const REGEX_HIDDEN_PASSWORD = /^\\*+$/\nexport const REGEX_URL_PATHNAME = /(\\w*:\\/\\/)([^/]+\\/)(.*)/\n// export const REGEX_URL_PATHNAME = /\\w*:\\/\\/[^/]*/\nexport const REGEX_VALID_IP =\n /\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/\nexport const REGEX_VALID_HOSTNAME =\n /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$/\nexport const REGEX_TAG_SAFE = /[\\s]/g\nexport const REGEX_CONNECTION_NAME = /[^a-zA-Z0-9-]+/g\nexport const REGEX_CONNECTION_TRIM = /^-|-$/\nexport const REGEX_SERVICE_ID = /^..(:..){7}$/\nexport const REGEX_SCHEME = /^(.*?):\\/\\//\n\nexport const DESKTOP_EPOCH = new Date('2020-01-01T00:00:00')\nexport const MOBILE_LAUNCH_DATE = new Date('2023-12-20')\nexport const FRONTEND_RETRY_DELAY = 20000\nexport const MAX_CONNECTION_NAME_LENGTH = 62\nexport const MAX_DESCRIPTION_LENGTH = 1024\nexport const SIDEBAR_WIDTH = 250\nexport const ORGANIZATION_BAR_WIDTH = 70\nexport const HIDE_SIDEBAR_WIDTH = 1150\nexport const HIDE_TWO_PANEL_WIDTH = 750\nexport const APP_MAX_WIDTH = 1800\nexport const MOBILE_WIDTH = 500\nexport const BINARY_DATA_TOKEN = '!BINARY-DATA'\nexport const VALID_JOB_ID_LENGTH = 36\n\nexport const LANGUAGES: ILookup = {\n en: 'English',\n ja: 'Japanese',\n}\n","import json from '../../package.json'\nimport browser from '../services/browser'\n\nexport const version = json.version\n\nexport function fullVersion() {\n let platform = 'Portal'\n if (browser.isElectron) platform = 'Desktop'\n if (browser.isRemote) platform = 'Remote'\n if (browser.isIOS) platform = 'IOS'\n if (browser.isAndroid) platform = 'Android'\n const dev = browser.environment() === 'development' ? 'Development' : ''\n return `${platform} Version ${json.version} ${dev}`\n}\n\nexport function numericVersion() {\n return parseInt(version.replace(/\\D/g, ''), 10)\n}\n\nexport const floatVersion = parseFloat(version)","import { GRAPHQL_API, GRAPHQL_BETA_API, API_URL, WEBSOCKET_BETA_URL, WEBSOCKET_URL, TEST_HEADER } from '../constants'\nimport { version } from './versionHelper'\nimport { store } from '../store'\n\nexport function getApiURL(): string | undefined {\n if (!store) return GRAPHQL_API\n\n const { apiGraphqlURL, switchApi } = store.getState().ui.apis\n const { overrides } = store.getState().backend.environment\n const defaultURL =\n version.includes('alpha') || version.includes('beta')\n ? overrides?.betaApiURL || GRAPHQL_BETA_API\n : overrides?.apiURL || GRAPHQL_API\n return apiGraphqlURL && switchApi ? apiGraphqlURL : defaultURL\n}\n\nexport function getRestApi(): string | undefined {\n try {\n if (!store) return API_URL\n const { apiURL, switchApi } = store.getState().ui.apis\n return apiURL && switchApi ? apiURL : API_URL\n } catch {\n return API_URL\n }\n}\n\nexport function getWebSocketURL(): string | undefined {\n if (!store) return WEBSOCKET_URL\n\n const apis = store.getState().ui.apis\n const defaultURL = version.includes('alpha') || version.includes('beta') ? WEBSOCKET_BETA_URL : WEBSOCKET_URL\n return apis?.webSocketURL && apis?.switchApi ? apis.webSocketURL : defaultURL\n}\n\nexport function getTestHeader(): { [key: string]: string } {\n const testHeader = window.localStorage.getItem(TEST_HEADER)\n if (!testHeader) return {}\n const parts = testHeader.split(':')\n console.log('USING TEST HEADER', { [parts[0].trim()]: parts[1].trim() })\n return { [parts[0].trim()]: parts[1].trim() }\n}\n\nexport async function apiError(error: unknown) {\n const { ui } = store.dispatch\n console.error('API ERROR:', error)\n console.trace()\n\n if (error instanceof Error) {\n ui.set({ errorMessage: error.message })\n }\n}\n","import { store } from '../store'\n\nexport async function getToken(): Promise {\n const { auth } = store.dispatch\n\n try {\n const currentSession = await store.getState().auth.authService?.currentCognitoSession()\n if (!currentSession) throw new Error('No current cognito session')\n const token = 'Bearer ' + currentSession?.getAccessToken().getJwtToken()\n return token\n } catch (error) {\n console.error('GET TOKEN ERROR', error.message, error.code, error)\n if (error.code && error.code == 'NotAuthorizedException') {\n auth.signInError('Session Expired')\n }\n return ''\n }\n}\n\nexport async function hasCredentials() {\n const { auth } = store.dispatch\n try {\n await store.getState().auth.authService?.currentCognitoSession()\n return true\n } catch (error) {\n console.error('HAS CREDENTIALS ERROR', error.message, error)\n if (error.code && error.code == 'NotAuthorizedException') {\n auth.signInError('Session Expired')\n }\n return false\n }\n}\n","import { dispatch } from '../store'\nimport { EventEmitter } from 'events'\n\nclass Network extends EventEmitter {\n // connect, disconnect, change events are emitted\n\n tickDuration = 60 * 1000 // 1 minute\n sleepDuration = 10 * this.tickDuration // 10 minutes\n shouldConnect: boolean = false\n interval?: NodeJS.Timeout\n then = 0\n\n constructor() {\n super()\n this.monitorSleep()\n window.addEventListener('online', this.online)\n window.addEventListener('offline', this.offline)\n window.addEventListener('focus', this.focus)\n }\n\n log(...args) {\n console.log(`%c${args[0]}`, 'color:red;font-weight:bold', ...args.slice(1))\n }\n\n monitorSleep() {\n this.interval = setInterval(this.tick, this.tickDuration)\n if (Date.now() - this.then > this.sleepDuration) this.log('SHOULD AWAKE')\n }\n\n isActive() {\n return document.hasFocus() && navigator.onLine\n }\n\n tick = () => {\n var now = Date.now()\n if (now - this.then > this.sleepDuration) this.awake()\n this.then = now\n }\n\n awake = () => {\n this.log('WAKE')\n this.shouldConnect = true\n this.connect()\n }\n\n focus = () => {\n this.connect()\n }\n\n offline = () => {\n if (navigator.onLine) return\n this.log('DISCONNECT')\n dispatch.ui.set({\n offline: { title: 'Disconnected', message: 'Internet access is required.', severity: 'warning' },\n })\n this.shouldConnect = true\n this.emit('disconnect')\n }\n\n online = () => {\n if (!navigator.onLine) return\n this.log('NETWORK ONLINE')\n dispatch.ui.set({ offline: undefined })\n this.connect()\n }\n\n connect = () => {\n if (this.shouldConnect && this.isActive()) {\n this.shouldConnect = false\n this.log('CONNECT')\n this.emit('connect')\n }\n }\n\n emit(event: string | symbol, ...args: any[]) {\n super.emit('change', ...args)\n super.emit(event, ...args)\n return true\n }\n}\n\nexport default new Network()\n","export default function sleep(ms: number) {\n return new Promise(resolve => setTimeout(resolve, ms))\n}\n","import axios from 'axios'\nimport { getApiURL, getTestHeader } from '../helpers/apiHelper'\nimport { getToken } from './remoteit'\nimport { store } from '../store'\nimport network from './Network'\nimport sleep from '../helpers/sleep'\n\nlet errorCount = 0\n\nexport function resetErrorCount() {\n errorCount = 0\n}\n\nexport async function post(data: ILookup = {}, path: string = '') {\n if (store.getState().ui.offline) return\n\n const token = await getToken()\n if (!token) {\n console.warn('Unable to get token for API request.', data)\n return\n }\n const request = {\n url: getApiURL() + path,\n method: 'post' as 'post',\n headers: { Authorization: token, ...getTestHeader() },\n data,\n }\n\n try {\n return await axios.request(request)\n } catch (error) {\n console.error('POST ERROR', { data, path })\n await apiError(error)\n return 'ERROR'\n }\n}\n\nexport async function postFile(file: File, data: ILookup = {}, path: string = '') {\n const form = new FormData()\n\n form.append('file', file)\n Object.entries(data).forEach(([key, value]) => form.append(key, value))\n\n return await post(form, path)\n}\n\nexport async function apiError(error: unknown) {\n const { ui, auth } = store.dispatch\n console.error('API ERROR:', error)\n console.trace()\n errorCount = errorCount + 1\n\n if (axios.isAxiosError(error)) {\n console.error('AXIOS ERROR DETAILS:', { ...error })\n\n if (!navigator.onLine) network.offline()\n\n if (error.response?.status === 429) {\n ui.set({\n errorMessage:\n 'API request failure. Your API usage has been throttled. Check the usage on your account and if issues persist please contact support.',\n })\n return\n }\n\n if (error.response?.status === 401 || error.response?.status === 403) {\n if (errorCount > 10) {\n auth.signOut()\n }\n console.log('Incrementing error count: ', errorCount)\n await sleep(1000 * errorCount * errorCount)\n auth.checkSession({ refreshToken: true })\n }\n }\n\n if (error instanceof Error || axios.isAxiosError(error)) {\n ui.set({ errorMessage: error.message })\n }\n}\n","import { AxiosResponse } from 'axios'\nimport { post, resetErrorCount } from './post'\nimport { store } from '../store'\n\nconst CLIENT_DEPRECATED = '121'\n\nexport async function graphQLBasicRequest(query: String, variables: ILookup = {}) {\n const response = await post({ query, variables })\n const errors = graphQLGetErrors(response, false, { query, variables })\n return errors ? 'ERROR' : response\n}\n\nexport function graphQLGetErrors(\n response: AxiosResponse | 'ERROR' | void,\n silent?: boolean,\n details?: { query: String; variables: ILookup }\n) {\n if (!response || response === 'ERROR') return\n const { ui } = store.dispatch\n\n const errors: undefined | Error[] = response?.data?.errors\n const warning: undefined | string = response?.headers?.['X-R3-Warning']\n\n if (warning) {\n const code = warning.split(' ')[0]\n if (code === CLIENT_DEPRECATED) ui.deprecated()\n }\n\n if (errors) {\n errors.forEach(error => {\n console.error('graphQL error:', JSON.stringify(error, null, 2))\n if (details) console.error('graphQL error details:', JSON.stringify(details, null, 2))\n })\n if (!silent)\n store.dispatch.ui.set({\n errorMessage:\n 'GraphQL: ' + errors[0].message + (errors.length > 1 ? ` (+${errors.length - 1} more errors)` : ''),\n })\n } else {\n resetErrorCount()\n }\n\n return errors\n}\n","import { graphQLBasicRequest } from './graphQL'\n\nexport async function graphQLLogin() {\n return await graphQLBasicRequest(\n ` query Auth {\n login {\n id\n email\n authhash\n yoicsId\n }\n }`\n )\n}\n\nexport async function graphQLFiles(accountId: string, ids?: string[]) {\n return await graphQLBasicRequest(\n ` query Files($accountId: String, $ids: [ID!]) {\n login {\n account(id: $accountId) {\n files(ids: $ids) {\n id\n name\n created\n updated\n shortDesc\n longDesc\n executable\n versions(latest: true) {\n items {\n id\n arguments {\n name\n desc\n order\n argumentType\n options\n }\n }\n }\n }\n }\n }\n }`,\n { accountId, ids }\n )\n}\n\nexport async function graphQLJobs(accountId: string, fileIds?: string[], ids?: string[]) {\n return await graphQLBasicRequest(\n ` query Jobs($accountId: String, $ids: [ID!], $fileIds: [ID!]) {\n login {\n account(id: $accountId) {\n jobs(ids: $ids, fileIds: $fileIds, size: 50) {\n items {\n id\n status\n created\n updated\n owner {\n id\n email\n }\n user {\n id\n email\n }\n tag {\n operator\n values\n }\n file {\n id\n name\n }\n jobDevices {\n id\n status\n created\n updated\n attributes {\n key\n value\n }\n device {\n id\n name\n }\n }\n }\n }\n }\n }\n }`,\n { accountId, fileIds, ids }\n )\n}\n\nexport async function graphQLUser(accountId: string) {\n return await graphQLBasicRequest(\n ` query User($accountId: String) {\n login {\n account(id: $accountId) {\n id\n email\n language\n created\n reseller {\n name\n email\n logoUrl\n }\n notificationSettings {\n emailNotifications\n desktopNotifications\n urlNotifications\n notificationEmail\n notificationUrl\n }\n attributes\n }\n }\n }`,\n { accountId }\n )\n}\n\nexport async function graphQLRegistration(props: {\n name?: string\n tags?: string[]\n platform?: number\n services: IServiceRegistration[]\n accountId: string\n}) {\n return await graphQLBasicRequest(\n ` query Registration($accountId: String, $name: String, $platform: Int, $tags: [String!], $services: [ServiceInput!]) {\n login {\n account(id: $accountId) {\n registrationCode(name: $name, platform: $platform, tags: $tags, services: $services)\n registrationCommand(name: $name, platform: $platform, tags: $tags, services: $services)\n }\n }\n }`,\n props\n )\n}\n\nexport async function graphQLRestoreDevice(props: { id: string; accountId: string }) {\n return await graphQLBasicRequest(\n ` query Restore($id: [String!]!, $accountId: String) {\n login {\n account(id: $accountId) {\n device(id: $id) {\n restoreCommand\n restoreCode\n }\n }\n }\n }`,\n props\n )\n}\n\nexport async function graphQLPreloadNetworks(accountId: string) {\n return await graphQLBasicRequest(\n ` query Networks($accountId: String) {\n login {\n account(id: $accountId) {\n networks {\n id\n name\n created\n permissions\n owner {\n id\n email\n }\n connections {\n service {\n id\n device {\n id\n } \n }\n name\n port\n }\n tags {\n name\n color\n created\n }\n access {\n user {\n id\n email\n }\n }\n }\n }\n }\n }`,\n { accountId }\n )\n}\n\n/* \n Fetches single network across shared accounts by id\n*/\nexport async function graphQLFetchNetworkSingle(id: string) {\n return await graphQLBasicRequest(\n ` query NetworkServices($id: String!) {\n login {\n network(id: $id) {\n connections {\n service {\n id\n device {\n id\n }\n }\n }\n }\n }\n }`,\n { id }\n )\n}\n\nconst LICENSES_QUERY = `\n id\n updated\n created\n expiration\n valid\n quantity\n custom\n plan {\n id\n name\n description\n commercial\n billing\n product {\n id\n name\n description\n }\n }\n subscription {\n total\n status\n price {\n id\n amount\n currency\n interval\n }\n card {\n brand\n month\n year\n last\n name\n email\n phone\n postal\n country\n expiration\n }\n }`\n\nconst PLANS_QUERY = `\n id\n name\n description\n product {\n id\n }\n prices {\n id\n amount\n currency\n interval\n }\n limits {\n name\n value\n scale\n }`\n\nconst LIMITS_QUERY = `\n name\n value\n actual\n base\n scale\n license {\n id\n }`\n\nexport async function graphQLFetchPlans() {\n return await graphQLBasicRequest(\n ` query Plans {\n plans {\n ${PLANS_QUERY}\n }\n }`\n )\n}\n\nexport async function graphQLFetchOrganizations(ids: string[]) {\n return await graphQLBasicRequest(\n ` query Organizations {\n login {\n ${ids\n .map(\n (id, index) => `\n _${index}: account(id: \"${id}\") {\n organization {\n id\n name\n domain\n created\n verified\n verificationCNAME\n verificationValue\n roles {\n id\n name\n system\n permissions\n access\n tag {\n operator\n values\n }\n }\n members {\n created\n customRole {\n id\n name\n }\n license\n user {\n id\n email\n }\n }\n reseller {\n name\n email\n logoUrl\n plans {\n ${PLANS_QUERY}\n }\n licenses {\n user {\n id\n email\n created\n limits {\n ${LIMITS_QUERY}\n }\n reseller {\n email\n }\n }\n ${LICENSES_QUERY}\n }\n }\n providers\n identityProvider {\n type\n clientId\n issuer\n }\n }\n licenses {\n ${LICENSES_QUERY}\n }\n limits {\n ${LIMITS_QUERY}\n }\n }`\n )\n .join('\\n')}\n }\n }`\n )\n}\n\nexport async function graphQLFetchGuests(accountId: string) {\n return await graphQLBasicRequest(\n ` query Guests($accountId: String) {\n login {\n account(id: $accountId) {\n guest {\n user {\n id\n email\n }\n devices {\n id\n }\n networks {\n id\n }\n }\n }\n }\n }`,\n { accountId }\n )\n}\n\nexport async function graphQLFetchSessions(ids: string[]) {\n return await graphQLBasicRequest(\n ` query Sessions {\n login {\n ${ids\n .map(\n (id, index) => `\n _${index}: account(id: \"${id}\") {\n sessions {\n id\n timestamp\n source\n endpoint {\n proxy\n platform\n manufacturer\n geo {\n city\n stateName\n countryName\n }\n }\n user {\n id\n email\n }\n target {\n id\n name\n platform\n application\n owner {\n id\n }\n device {\n id\n name\n }\n }\n }\n }`\n )\n .join('\\n')}\n }\n }`\n )\n}\n\nexport async function graphQLGetResellerReportUrl(accountId: string) {\n return await graphQLBasicRequest(\n ` query ResellerReportUrl($accountId: String) {\n login {\n account(id: $accountId) {\n organization {\n reseller {\n reportUrl\n }\n }\n }\n }\n }`,\n { accountId }\n )\n}\n","import { graphQLBasicRequest } from './graphQL'\nimport { addConnectionProps } from '../models/networks'\n\nexport async function graphQLSetAttributes(attributes: ILookup, serviceId?: String) {\n return await graphQLBasicRequest(\n ` mutation SetAttributes($attributes: Object!, $serviceId: String) {\n setAttributes(attributes: $attributes, serviceId: $serviceId)\n }`,\n { attributes: { $remoteit: attributes }, serviceId }\n )\n}\n\nexport async function graphQLSetDeviceNotification(\n deviceID: string,\n emailNotifications?: boolean | null,\n desktopNotifications?: boolean | null\n) {\n return await graphQLBasicRequest(\n ` mutation SetDeviceNotification($deviceID: String!, $emailNotifications: Boolean, $desktopNotifications: Boolean ){\n setNotificationSettings(\n serviceId: $deviceID, \n emailNotifications: $emailNotifications, \n desktopNotifications: $desktopNotifications\n )\n }\n `,\n { emailNotifications, desktopNotifications, deviceID }\n )\n}\n\nexport async function graphQLConnect(serviceId: string, hostIP?: string) {\n return await graphQLBasicRequest(\n ` mutation Connect($serviceId: String!, $hostIP: String) {\n connect(serviceId: $serviceId, hostIP: $hostIP) {\n id\n created\n host\n port\n reverseProxy\n timeout\n }\n }`,\n { serviceId, hostIP }\n )\n}\n\nexport async function graphQLDisconnect(serviceId: string, connectionId: string) {\n return await graphQLBasicRequest(\n ` mutation Disconnect($serviceId: String!, $connectionId: String!) {\n disconnect(serviceId: $serviceId, connectionId: $connectionId)\n }`,\n { serviceId, connectionId }\n )\n}\n\nexport async function graphQLSurvey(serviceId: string, sessionId: string, quality: number) {\n return await graphQLBasicRequest(\n ` mutation Survey($serviceId: String!, $sessionId: String!, $quality: Int!) {\n rateConnection(serviceId: $serviceId, sessionId: $sessionId, quality: $quality)\n }`,\n { serviceId, sessionId, quality }\n )\n}\n\nexport async function graphQLSetLink(params: { serviceId: string; password?: string | null; enabled?: boolean }) {\n return await graphQLBasicRequest(\n ` mutation SetLink($serviceId: String!, $password: String, $enabled: Boolean) {\n setConnectLink(serviceId: $serviceId, password: $password, enabled: $enabled) {\n url\n code\n enabled\n created\n }\n }`,\n params\n )\n}\n\nexport async function graphQLRemoveLink(serviceId: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveLink($serviceId: String!) {\n removeConnectLink(serviceId: $serviceId)\n }`,\n { serviceId }\n )\n}\n\nexport async function graphQLRename(serviceId: string, name: string) {\n return await graphQLBasicRequest(\n ` mutation Rename($serviceId: String!, $name: String!) {\n renameService(serviceId: $serviceId, name: $name)\n }`,\n { serviceId, name }\n )\n}\n\nexport async function graphQLDeleteDevice(deviceId: string) {\n return await graphQLBasicRequest(\n ` mutation DeleteDevice($deviceId: String!) {\n deleteDevice(deviceId: $deviceId)\n }`,\n { deviceId }\n )\n}\n\nexport async function graphQLDeleteDevices(deviceId: string[]) {\n return await graphQLBasicRequest(\n ` mutation DeleteDevices($deviceId: [String!]) {\n deleteDevices(deviceId: $deviceId)\n }`,\n { deviceId }\n )\n}\n\nexport async function graphQLUnShareDevice(params: IShareProps) {\n return await graphQLBasicRequest(\n ` mutation UnShare($deviceId: String!, $email: [String!]!) {\n share(deviceId: $deviceId, email: $email, action: REMOVE)\n }`,\n params\n )\n}\n\nexport async function graphQLShareDevice(params: IShareProps) {\n return await graphQLBasicRequest(\n ` mutation Share($deviceId: String!, $email: [String!]!, $scripting: Boolean, $services: [ServiceSharingOptions!]) {\n share(\n deviceId: $deviceId, \n email: $email, \n scripting: $scripting,\n services: $services\n )\n }`,\n params\n )\n}\n\nexport async function graphQLSetOrganization(params: IOrganizationSettings & { accountId: string }) {\n return await graphQLBasicRequest(\n ` mutation SetOrganization($accountId: String, $name: String, $domain: String, $logoUrl: String, $providers: [AuthenticationProvider!]) {\n setOrganization(accountId: $accountId, name: $name, domain: $domain, logoUrl: $logoUrl, providers: $providers)\n }`,\n params\n )\n}\n\nexport async function graphQLSetIdentityProvider(params: IIdentityProviderSettings & { accountId: string }) {\n return await graphQLBasicRequest(\n ` mutation SetIdentityProvider($accountId: String, $enabled: Boolean, $type: String, $metadata: String, $clientId: String, $clientSecret: String, $issuer: String) {\n configureOrgIdentityProvider(\n accountId: $accountId,\n enabled: $enabled,\n type: $type,\n metadata: $metadata,\n clientId: $clientId,\n clientSecret: $clientSecret,\n issuer: $issuer\n )\n }`,\n params\n )\n}\n\nexport async function graphQLRemoveOrganization() {\n return await graphQLBasicRequest(\n ` mutation {\n deleteOrganization\n }`\n )\n}\n\nexport async function graphQLSetMembers(\n email: string[],\n accountId?: string,\n roleId?: IOrganizationRoleIdType,\n license?: ILicenseTypes\n) {\n return await graphQLBasicRequest(\n ` mutation SetMember($accountId: String, $email: [String!]!, $roleId: ID, $license: LicenseOption) {\n setMember(accountId: $accountId, email: $email, roleId: $roleId, license: $license)\n }`,\n { accountId, email, roleId, license }\n )\n}\n\nexport async function graphQLRemoveMembers(email: string[], accountId?: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveMembers($accountId: String, $email: [String!]!) {\n removeMember(accountId: $accountId, email: $email)\n }`,\n { accountId, email }\n )\n}\n\nexport async function graphQLLeaveMembership(id: string) {\n return await graphQLBasicRequest(\n ` mutation LeaveMembership($id: ID!) {\n leaveOrganization(id: $id)\n }`,\n { id }\n )\n}\n\nexport async function graphQLClaimDevice(code: string, accountId?: string) {\n return await graphQLBasicRequest(\n ` mutation Claim($code: String!, $accountId: String) {\n claimDevice(code: $code, accountId: $accountId) {\n id\n name\n }\n }`,\n { code, accountId }\n )\n}\n\nexport async function graphQLCreditCard() {\n return await graphQLBasicRequest(\n ` mutation UpdateCreditCard($successUrl: String!, $cancelUrl: String!) {\n updateCreditCard(successUrl: $successUrl, cancelUrl: $cancelUrl) {\n url\n }\n }`,\n {\n successUrl: window.location.href + '/success',\n cancelUrl: window.location.href,\n }\n )\n}\n\nexport async function graphQLSubscribe(params: IPurchase) {\n console.log('SUBSCRIBE: ' + JSON.stringify(params))\n return await graphQLBasicRequest(\n ` mutation Subscribe($licenseId: String, $priceId: String!, $quantity: Int, $successUrl: String!, $cancelUrl: String!) {\n createSubscription(licenseId: $licenseId, priceId: $priceId, quantity: $quantity, successUrl: $successUrl, cancelUrl: $cancelUrl) {\n url\n }\n }`,\n {\n ...params,\n successUrl: window.location.href + '/success',\n cancelUrl: window.location.href,\n }\n )\n}\n\nexport async function graphQLUpdateSubscription(params: IPurchase) {\n console.log('UPDATE SUBSCRIPTION: ' + JSON.stringify(params))\n return await graphQLBasicRequest(\n ` mutation UpdateSubscription($licenseId: String, $priceId: String!, $quantity: Int) {\n updateSubscription(licenseId: $licenseId, priceId: $priceId, quantity: $quantity)\n }`,\n params\n )\n}\n\nexport async function graphQLUnsubscribe(licenseId?: string) {\n console.log('UNSUBSCRIBE: ' + JSON.stringify(licenseId))\n return await graphQLBasicRequest(\n ` mutation Unsubscribe($licenseId: String) {\n cancelSubscription(licenseId: $licenseId)\n }`,\n { licenseId }\n )\n}\n\nexport async function graphQLAddService(form: ICloudAddService) {\n return await graphQLBasicRequest(\n ` mutation AddService($deviceId: String!, $name: String, $application: Int, $host: String, $port: Int, $enabled: Boolean) {\n addService(\n deviceId: $deviceId,\n name: $name,\n application: $application,\n host: $host,\n port: $port,\n enabled: $enabled,\n ) {\n id\n }\n }`,\n form\n )\n}\n\nexport async function graphQLUpdateService(form: ICloudUpdateService) {\n return await graphQLBasicRequest(\n ` mutation UpdateService($id: ID!, $name: String, $application: Int, $host: String, $port: Int, $enabled: Boolean, $presenceAddress: String) {\n updateService(\n id: $id,\n name: $name,\n application: $application,\n host: $host,\n port: $port,\n enabled: $enabled,\n presenceAddress: $presenceAddress\n ) {\n id\n }\n }`,\n form\n )\n}\n\nexport async function graphQLRemoveService(id: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveService($id: ID!) {\n removeService(id: $id)\n }`,\n { id }\n )\n}\n\nexport async function graphQLInstallApp(props: { deviceIds: string[]; application: number }) {\n return await graphQLBasicRequest(\n ` mutation InstallApp($deviceIds: [String!], $application: Int!) {\n installApp(\n deviceIds: $deviceIds,\n application: $application,\n )\n }`,\n props\n )\n}\n\nexport async function graphQLRemoveApp(props: { deviceIds: string[]; application: number }) {\n return await graphQLBasicRequest(\n ` mutation RemoveApp($deviceIds: [String!], $application: Int!) {\n removeApp(\n deviceIds: $deviceIds,\n application: $application,\n )\n }`,\n props\n )\n}\n\nexport async function graphQLReadNotice(id: string) {\n return await graphQLBasicRequest(\n ` mutation ReadNotice($id: String!) {\n readNotice(id: $id)\n }`,\n { id }\n )\n}\n\nexport async function graphQLCreateRole(params: ICreateRole) {\n return await graphQLBasicRequest(\n ` mutation CreateRole($name: String, $grant: [RolePermission!], $revoke: [RolePermission!], $tag: ListFilter, $accountId: String) {\n createRole(name: $name, grant: $grant, revoke: $revoke, tag: $tag, accountId: $accountId) {\n id\n }\n }`,\n params\n )\n}\n\nexport async function graphQLUpdateRole(params: ICreateRole) {\n return await graphQLBasicRequest(\n ` mutation UpdateRole($id: String!, $name: String, $grant: [RolePermission!], $revoke: [RolePermission!], $tag: ListFilter, $access: CustomRoleAccess, $accountId: String) {\n updateRole(id: $id, name: $name, grant: $grant, revoke: $revoke, tag: $tag, access: $access, accountId: $accountId) {\n id\n }\n }`,\n params\n )\n}\n\nexport async function graphQLRemoveRole(id: string, accountId: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveRole($id: String!, $accountId: String) {\n deleteRole(id: $id, accountId: $accountId)\n }`,\n { id, accountId }\n )\n}\n\nexport async function graphQLSetTag(tag: { name: string; color: number }, accountId: string) {\n return await graphQLBasicRequest(\n ` mutation SetTag($tag: [TagInput!]!, $accountId: String) {\n setTag(tag: $tag, accountId: $accountId)\n }`,\n { tag, accountId }\n )\n}\n\nexport async function graphQLAddDeviceTag(serviceId: string | string[], name: string | string[], accountId: string) {\n return await graphQLBasicRequest(\n ` mutation AddTag($serviceId: [String!]!, $name: [String!]!, $accountId: String) {\n addTag(serviceId: $serviceId, name: $name, accountId: $accountId)\n }`,\n { serviceId, name, accountId }\n )\n}\n\nexport async function graphQLAddNetworkTag(networkId: string, name: string | string[]) {\n return await graphQLBasicRequest(\n ` mutation AddNetworkTag($networkId: String!, $name: [String!]!) {\n addNetworkTag(networkId: $networkId, name: $name)\n }`,\n { networkId, name }\n )\n}\n\nexport async function graphQLRemoveDeviceTag(serviceId: string | string[], name: string, accountId: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveTag($serviceId: [String!]!, $name: [String!]!, $accountId: String) {\n removeTag(serviceId: $serviceId, name: $name, accountId: $accountId)\n }`,\n { serviceId, name, accountId }\n )\n}\n\nexport async function graphQLRemoveNetworkTag(networkId: string | string[], name: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveNetworkTag($networkId: String!, $name: [String!]!) {\n removeNetworkTag(networkId: $networkId, name: $name)\n }`,\n { networkId, name }\n )\n}\n\nexport async function graphQLRenameTag(from: string, to: string, accountId: string) {\n return await graphQLBasicRequest(\n ` mutation RenameTag($from: String!, $to: String!, $accountId: String) {\n renameTag(from: $from, to: $to, accountId: $accountId)\n }`,\n { from, to, accountId }\n )\n}\n\nexport async function graphQLMergeTag(from: string, to: string, accountId: string) {\n return await graphQLBasicRequest(\n ` mutation MergeTag($from: String!, $to: String!, $accountId: String) {\n mergeTag(from: $from, to: $to, accountId: $accountId)\n }`,\n { from, to, accountId }\n )\n}\n\nexport async function graphQLDeleteTag(name: string, accountId: string) {\n return await graphQLBasicRequest(\n ` mutation DeleteTag($name: [String!]!, $accountId: String) {\n deleteTag(name: $name, accountId: $accountId)\n }`,\n { name, accountId }\n )\n}\n\nexport async function graphQLNotificationSettings(params: INotificationSetting) {\n return await graphQLBasicRequest(\n ` mutation NotificationSettings($emailNotifications: Boolean, $desktopNotifications: Boolean, $urlNotifications: Boolean, $notificationUrl: String) {\n setNotificationSettings(\n emailNotifications: $emailNotifications, \n desktopNotifications: $desktopNotifications, \n urlNotifications: $urlNotifications, \n notificationUrl: $notificationUrl\n )\n }`,\n params\n )\n}\n\nexport async function graphQLTransferDevice(params: ITransferProps) {\n return await graphQLBasicRequest(\n ` mutation TransferDevice($deviceId: String!, $email: String!) {\n transfer(\n deviceId: $deviceId, \n email: $email\n )\n }`,\n {\n deviceId: params.device?.id,\n email: params.email,\n }\n )\n}\n\nexport async function graphQLUpdateNetwork(params: INetwork) {\n return await graphQLBasicRequest(\n ` mutation UpdateNetwork($id: String!, $name: String) {\n updateNetwork(id: $id, name: $name) {\n id\n }\n }`,\n params\n )\n}\n\nexport async function graphQLAddNetwork(name: string, accountId: string) {\n return await graphQLBasicRequest(\n ` mutation CreateNetwork($accountId: String, $name: String) {\n createNetwork(accountId: $accountId, name: $name) {\n id\n }\n }`,\n {\n name,\n accountId,\n }\n )\n}\n\nexport async function graphQLDeleteNetwork(networkId: string) {\n return await graphQLBasicRequest(\n ` mutation DeleteNetwork($networkId: String!) {\n deleteNetwork(id: $networkId) \n }`,\n {\n networkId,\n }\n )\n}\n\nexport async function graphQLSetConnection(props: addConnectionProps) {\n return await graphQLBasicRequest(\n ` mutation SetConnection(\n $networkId: String!,\n $serviceId: String!,\n $port: Int,\n $name: String,\n ) {\n addNetworkConnection(networkId: $networkId, serviceId: $serviceId, port: $port, name: $name)\n }`,\n props\n )\n}\n\nexport async function graphQLRemoveConnection(networkId: string, serviceId: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveConnection($networkId: String!, $serviceId: String!) {\n removeNetworkConnection(networkId: $networkId, serviceId: $serviceId)\n }`,\n { networkId, serviceId }\n )\n}\n\nexport async function graphQLAddNetworkShare(networkId: string, email: string[] | string) {\n return await graphQLBasicRequest(\n ` mutation AddNetworkShare($networkId: String!, $email: [String!]!) {\n addNetworkShare(networkId: $networkId, email: $email)\n }`,\n { networkId, email }\n )\n}\n\nexport async function graphQLRemoveNetworkShare(networkId: string, email: string[] | string) {\n return await graphQLBasicRequest(\n ` mutation RemoveNetworkShare($networkId: String!, $email: [String!]!) {\n removeNetworkShare(networkId: $networkId, email: $email)\n }`,\n { networkId, email }\n )\n}\n\nexport async function graphQLAddCustomer(email: string[], resellerId?: string) {\n return await graphQLBasicRequest(\n ` mutation AddCustomer($resellerId: String!, $email: [String!]!) {\n addCustomer(resellerId: $resellerId, email: $email)\n }`,\n { resellerId, email }\n )\n}\n\nexport async function graphQLRemoveCustomer(email: string[], resellerId?: string) {\n return await graphQLBasicRequest(\n ` mutation RemoveCustomer($resellerId: String!, $email: [String!]!) {\n removeCustomer(resellerId: $resellerId, email: $email)\n }`,\n { resellerId, email }\n )\n}\n\nexport async function graphQLLeaveReseller() {\n return await graphQLBasicRequest(\n ` mutation LeaveReseller {\n leaveReseller\n }`\n )\n}\n\nexport async function graphQLDeleteFile(fileId: string) {\n return await graphQLBasicRequest(\n ` mutation DeleteFile($fileId: String!) {\n deleteFile(fileId: $fileId)\n }`,\n { fileId }\n )\n}\n\nexport async function graphQLSetJob(params: {\n fileId: string\n jobId?: string\n arguments?: IFileArgument[]\n tagFilter?: ITagFilter\n deviceIds?: string[]\n}) {\n return await graphQLBasicRequest(\n ` mutation SetJob($fileId: String!, $jobId: String, $arguments: [ArgumentInput!], $tagFilter: ListFilter, $deviceIds: [String!]) {\n setJob(fileId: $fileId, jobId: $jobId, arguments: $arguments, tagFilter: $tagFilter, deviceIds: $deviceIds)\n }`,\n params\n )\n}\n\nexport async function graphQLStartJob(jobId: string) {\n return await graphQLBasicRequest(\n ` mutation StartJob($jobId: String) {\n startJob(jobId: $jobId)\n }`,\n { jobId }\n )\n}\n\nexport async function graphQLCancelJob(jobId?: string) {\n return await graphQLBasicRequest(\n ` mutation CancelJob($jobId: String) {\n cancelJob(jobId: $jobId)\n }`,\n { jobId }\n )\n}\n","export let adaptor: CommonAdaptorInterface | undefined\n\nexport function initialize(sharedAdaptor: CommonAdaptorInterface) {\n adaptor = sharedAdaptor\n}\n","import {\n REGEX_LAST_NUMBER,\n REGEX_NAME_SAFE,\n REGEX_NOT_FILE_SAFE,\n IP_PRIVATE,\n IP_OPEN,\n MAX_NAME_LENGTH,\n} from './constants'\nimport { adaptor } from './adaptor'\n\nconst separator = ' - '\n\nexport function attributeName(instance?: IDevice | IService) {\n if (!instance) return ''\n return instance.attributes?.name || instance.name\n}\n\nexport function replaceHost(url?: string, localhost?: boolean) {\n if (!url) return ''\n if (localhost && url.includes(IP_PRIVATE)) {\n return url.replace(new RegExp(IP_PRIVATE, 'g'), 'localhost')\n }\n if (url.includes(IP_OPEN)) {\n const environment = adaptor?.getState().environment\n const privateIP = environment?.privateIP || IP_PRIVATE\n return url.replace(IP_OPEN, privateIP)\n }\n return url\n}\n\nexport function hostName(connection?: IConnection) {\n if (!connection) return ''\n const { host = '', port } = connection\n if (!port) return ''\n return `${replaceHost(host)}:${port}`\n}\n\nexport function removeDeviceName(deviceName: string, name?: string) {\n const nameExt = new RegExp(`^${adaptor?.escapeRegex(deviceName)}[- _]+`, 'gi')\n return name?.toString().replace(nameExt, '') || ''\n}\n\nexport function addDeviceName(deviceName: string, name: string) {\n const ext = removeDeviceName(deviceName, name)\n return deviceName + separator + ext\n}\n\ntype nameObj = { name: string }\n\nexport function combinedName(service?: nameObj, device?: nameObj, join: string = ' '): string {\n let name: string[] = []\n if (device) {\n name.push(device.name)\n if (service && service.name !== device.name) name.push(removeDeviceName(device.name, service.name))\n } else if (service) name.push(service.name)\n return name.join(join)\n}\n\nexport function safeHostname(name: string, blacklist: string[]) {\n let index = 1\n name = name.replace('.local', '')\n while (blacklist.includes(name.toLowerCase().trim())) {\n name = name.replace(REGEX_LAST_NUMBER, `-${index}`)\n index++\n }\n return name.replace(REGEX_NAME_SAFE, '-')\n}\n\nexport function osName(os?: Ios) {\n const name = {\n mac: 'Mac',\n windows: 'Windows PC',\n linux: 'Linux system',\n rpi: 'Raspberry Pi',\n android: 'Android',\n ios: 'iPhone or iPad',\n }\n return os ? name[os] : 'system'\n}\n\nexport function safeFilename(name: string) {\n return name.replace(REGEX_NOT_FILE_SAFE, '-')\n}\n\nexport function serviceNameValidation(name: string, emptyOk?: boolean) {\n const value = name\n if (value.length > MAX_NAME_LENGTH) {\n return {\n error: `Cannot exceed ${MAX_NAME_LENGTH} characters`,\n value: value.substring(0, MAX_NAME_LENGTH),\n }\n }\n if (!emptyOk && !value.length) {\n return {\n error: `Cannot be empty`,\n value,\n }\n }\n return { value }\n}\n","import { DateTime, Duration } from 'luxon'\nimport { Unit } from 'humanize-duration'\n\nexport function isToday(dateToCheck: Date): boolean {\n const today = new Date().toLocaleDateString()\n const check = dateToCheck.toLocaleDateString()\n\n return today === check\n}\n\nexport const getDateFormatString = () => {\n const formatObj = new Intl.DateTimeFormat(window.navigator.language).formatToParts(new Date())\n return formatObj\n .map(obj => {\n switch (obj.type) {\n case 'day':\n return 'dd'\n case 'month':\n return 'MM'\n case 'year':\n return 'yyyy'\n default:\n return obj.value\n }\n })\n .join('')\n}\n\nexport const getTimeZone = () => {\n return Intl.DateTimeFormat().resolvedOptions().timeZone\n}\n\nexport const getStart = (resolution: ITimeSeriesResolution) => {\n return DateTime.local().minus(getMaxDuration(resolution)).toJSDate()\n}\n\nexport const getMaxDuration = (unit: ITimeSeriesResolution) => {\n return Duration.fromObject({ [resolutionMaxLookup[unit]]: 1 })\n}\n\nexport const findLongestLength = (limitDuration: Duration, resolution: string) => {\n const lengths: number[] = []\n TimeSeriesLengths[resolution].forEach(length => {\n if (limitDuration.valueOf() >= Duration.fromObject({ [resolution]: length }).valueOf()) {\n lengths.push(length)\n }\n })\n return lengths[lengths.length - 1]\n}\n\nexport const connectionTypes = ['USAGE', 'CONNECT_DURATION', 'CONNECT', 'DISCONNECT']\nexport const secondResolutions = ['SECOND', 'MINUTE', 'HOUR']\n\nexport const defaultDeviceTimeSeries: ITimeSeriesOptions = {\n type: 'ONLINE_DURATION',\n resolution: 'DAY',\n length: 7,\n}\n\nexport const defaultServiceTimeSeries: ITimeSeriesOptions = {\n type: 'CONNECT_DURATION',\n resolution: 'DAY',\n length: 7,\n}\n\nexport const humanizeResolutionLookup: ILookup = {\n SECOND: 's',\n MINUTE: 'm',\n HOUR: 'h',\n DAY: 'd',\n WEEK: 'w',\n MONTH: 'mo',\n QUARTER: 'mo',\n YEAR: 'y',\n}\n\nexport const humanizeMaxResolutionLookup: ILookup = {\n SECOND: 'm',\n MINUTE: 'h',\n HOUR: 'd',\n DAY: 'w',\n WEEK: 'mo',\n MONTH: 'y',\n QUARTER: 'y',\n YEAR: 'y',\n}\n\nexport const TimeSeriesTypeScale: ILookup = {\n AVAILABILITY: { unit: '%', scale: 100 },\n ONLINE_DURATION: { unit: 'time', scale: 1 },\n ONLINE: { unit: 'events', scale: 1 },\n OFFLINE: { unit: 'events', scale: 1 },\n USAGE: { unit: '%', scale: 100 },\n CONNECT_DURATION: { unit: 'time', scale: 1 },\n CONNECT: { unit: 'events', scale: 1 },\n DISCONNECT: { unit: 'events', scale: 1 },\n}\n\nexport const TimeSeriesTypeLookup: ILookup = {\n AVAILABILITY: 'Online %',\n ONLINE_DURATION: 'Online Time',\n ONLINE: 'Online events',\n OFFLINE: 'Offline events',\n USAGE: 'Connected %',\n CONNECT_DURATION: 'Connected Time',\n CONNECT: 'Connect events',\n DISCONNECT: 'Disconnect events',\n}\n\nexport const TimeSeriesAvailableResolutions: Partial> = {\n // SECOND: 'Second',\n // MINUTE: 'Minute',\n HOUR: 'Hour',\n DAY: 'Day',\n WEEK: 'Week',\n MONTH: 'Month',\n // QUARTER: 'Quarter',\n // YEAR: 'Year',\n}\n\nexport const TimeSeriesLengths: ILookup = {\n SECOND: [60],\n MINUTE: [60],\n HOUR: [12, 24, 48],\n DAY: [7, 14, 30],\n WEEK: [4, 12],\n MONTH: [12],\n QUARTER: [4],\n YEAR: [1],\n}\n\nexport const resolutionMaxLookup: ILookup = {\n SECOND: 'minutes',\n MINUTE: 'hours',\n HOUR: 'days',\n DAY: 'weeks',\n WEEK: 'months',\n MONTH: 'quarters',\n QUARTER: 'years',\n YEAR: 'years',\n}\n","export interface IPlatform {\n id: string\n name: string\n hidden?: boolean\n subtitle?: string\n component: (props: any) => React.ReactElement\n types?: INumberLookup\n services?: IServiceRegistration[]\n listItemTitle?: React.ReactNode\n route?: string\n hasScreenView?: boolean\n installation?: {\n label?: string\n download?: boolean\n command?: boolean | string\n instructions?: string | React.ReactNode\n qualifier: string\n link?: string\n altLink?: string\n }\n}\n\nclass Platforms {\n platforms: ILookup = {}\n lookup: INumberLookup = {}\n nameLookup: INumberLookup = {}\n installed: string[] = [\n 'advantech',\n 'alpine',\n 'amnimo',\n 'android-screenview',\n 'android',\n 'arm',\n 'aws',\n 'axis',\n 'azure',\n 'cachengo',\n 'docker-extension',\n 'docker-jumpbox',\n 'docker',\n 'embedded-works',\n 'firewalla',\n 'gcp',\n 'idy',\n 'ios',\n 'linux',\n 'liverock',\n 'mac',\n 'nas',\n 'nvidia',\n 'openwrt',\n 'raspberrypi',\n 'remoteit',\n 'this',\n 'tinkerboard',\n 'ubiquiti',\n 'ubuntu',\n 'unknown',\n 'windows',\n ]\n\n constructor() {\n this.initialize()\n }\n\n async initialize() {\n for (const platform of this.installed) {\n await import(`./${platform}/index.tsx`)\n }\n }\n\n register(platform: IPlatform) {\n platform.types = platform.types || {}\n platform.hasScreenView = platform.services?.some(s => s.application === 48)\n this.platforms[platform.id] = platform\n Object.keys(platform.types).forEach(type => {\n if (platform.hidden) return\n this.lookup[type] = platform.id\n this.nameLookup[type] = platform.types?.[type]\n })\n }\n\n type(type: number): IPlatform {\n return this.get(this.lookup[type] || 'unknown')\n }\n\n get(id: string = 'unknown'): IPlatform {\n return this.platforms[id] || {}\n }\n\n findType(id?: string): number | undefined {\n const typeIds = Object.keys(this.get(id).types || {})\n return Number(typeIds[0])\n }\n\n component(id?: string): IPlatform['component'] {\n return this.get(id).component || (() => null)\n }\n\n componentByType(type: number): IPlatform['component'] {\n return this.component(this.type(type).id)\n }\n}\n\nexport const platforms = new Platforms()\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { platforms } from '../platforms'\n\ntype Props = React.SVGProps & {\n name?: string\n platform?: number\n currentColor?: boolean\n}\n\nexport const PlatformIcon: React.FC = ({ name, platform, ...originalProps }) => {\n const props = { ...originalProps, darkMode: useSelector((state: State) => state.ui.themeDark) }\n const Component = platform !== undefined ? platforms.componentByType(platform) : platforms.component(name)\n return \n}\n","export type Sizes = 'bug' | 'xxxs' | 'xxs' | 'xs' | 'sm' | 'base' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl' | 'max'\n\nexport const fontSizes: { [key in Sizes]: string } = {\n bug: '0.4375rem', // 7px\n xxxs: '0.5rem', // 8px\n xxs: '0.625rem', // 10px\n xs: '0.6875rem', // 11px\n sm: '0.75rem', // 12px\n base: '0.875rem', // 14px\n md: '1rem', // 16px\n lg: '1.1875rem', // 19px\n xl: '1.5rem', // 24px\n xxl: '2.25rem', // 36px\n xxxl: '3rem', // 48px\n max: '4rem', // 64px\n}\n\nexport const spacing: { [key in Sizes]: number } = {\n // px theme.spacing\n bug: 1, // 7 0.125\n xxxs: 2, // 8 0.25\n xxs: 3, // 10 0.375\n xs: 6, // 11 0.75\n sm: 12, // 12 1.5\n base: 14, // 14 1.75\n md: 18, // 16 2.25\n lg: 24, // 19 3\n xl: 36, // 24 4.5\n xxl: 48, // 36 6\n xxxl: 64, // 48 8\n max: 96, // 64 12\n}\n\nexport type Colors = { [key in Color]: string }\n\nexport const lightColors: Colors = {\n primary: '#0096e7',\n primaryDark: '#034b9d',\n primaryLight: '#9ed3f0',\n primaryLighter: '#daf0ff',\n primaryHighlight: '#edf8ff',\n primaryBackground: '#EAF4FA',\n brandPrimary: '#0096e7', // Default to primary, will be overridden by brand config\n brandSecondary: '#034b9d', // Default secondary color\n // secondary: '#75bd00', - can become the reseller logo color\n successLight: '#a4db4c',\n success: '#75bd00',\n successDark: '#436807',\n dangerLight: '#e07562',\n danger: '#d6290a',\n warning: '#ed9912',\n warningLightest: 'rgba(237,153,18,0.16)',\n warningHighlight: 'rgba(237,153,18,0.06)',\n grayLightest: '#f8fafc',\n grayLighter: '#f3f5f7',\n grayLight: '#e3e6e8',\n gray: '#b6bbbe',\n grayDark: '#9199a1',\n grayDarker: '#666',\n grayDarkest: '#333',\n black: '#000',\n white: '#fff',\n alwaysWhite: '#fff',\n hover: 'rgba(161, 180, 191, 0.13)',\n darken: 'rgba(0, 16, 26, 0.5)',\n screen: 'rgba(161, 180, 191, 0.08)',\n shadow: 'rgba(0, 16, 26, 0.2)',\n rpi: '#C51A4A',\n guide: '#593098', // '#001247',\n test: '#ffcc001d',\n}\n\nexport const darkColors: Colors = {\n primary: '#0096e7',\n primaryDark: '#034b9d',\n primaryLight: '#1C72AD', // 70%\n primaryLighter: '#21435B', // 20%\n primaryHighlight: '#1f3042', //'#222D38', // 10%\n primaryBackground: '#212a35',\n brandPrimary: '#0096e7', // Default to primary, will be overridden by brand config\n brandSecondary: '#034b9d', // Default secondary color\n // secondary: '#75bd00',\n successLight: '#436807',\n success: '#75bd00',\n successDark: '#a4db4c',\n dangerLight: '#e07562',\n danger: '#d6290a',\n warning: '#ed9912',\n warningLightest: 'rgba(237,153,18,0.16)',\n warningHighlight: 'rgba(237,153,18,0.06)',\n grayLightest: '#1a1b1d', //'#222326',\n grayLighter: '#292A2D', //'#35363A',\n grayLight: '#35363A', //'#54565b',\n gray: '#797c86',\n grayDark: '#97979b',\n grayDarker: '#bebec2',\n grayDarkest: '#d8d8da',\n black: '#fff',\n white: '#202124',\n alwaysWhite: '#fff',\n hover: 'rgba(255,255,255,0.04)',\n darken: 'rgba(255,255,255,0.3)',\n screen: 'rgba(255,255,255,0.06)',\n shadow: 'rgba(0,0,0,0.3)',\n rpi: '#C51A4A',\n guide: '#ebe985',\n test: '#ffcc001d',\n}\n\nexport const radius = {\n sm: 7,\n lg: 14,\n}\n","import React from 'react'\n\nexport const R3gray = props => {\n return (\n \n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { useTheme, Badge } from '@mui/material'\nimport { PlatformIcon } from './PlatformIcon'\nimport { fontSizes, spacing, Sizes } from '../styling'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport { library, IconName, IconPrefix } from '@fortawesome/fontawesome-svg-core'\nimport { fab } from '@fortawesome/free-brands-svg-icons'\nimport { fal } from '@fortawesome/pro-light-svg-icons'\nimport { far } from '@fortawesome/pro-regular-svg-icons'\nimport { fas } from '@fortawesome/pro-solid-svg-icons'\nimport { R3gray } from '../assets/R3gray'\n\nlibrary.add(fal, fab, far, fas)\n\nexport interface IconProps {\n name?: string\n color?: Color | string\n platformIcon?: boolean\n platform?: number\n className?: string\n title?: string\n fixedWidth?: boolean\n fontSize?: number\n onClick?: (event: React.MouseEvent) => void\n size?: Sizes\n styles?: React.CSSProperties\n rotate?: number\n spin?: boolean\n scale?: number\n type?: IconType\n inline?: boolean\n inlineLeft?: boolean\n modified?: boolean\n currentColor?: boolean\n}\n\nexport const Icon = React.forwardRef(\n (\n {\n color,\n platformIcon,\n fixedWidth,\n name,\n size = 'base',\n fontSize,\n rotate,\n spin,\n scale,\n styles = {},\n type = 'regular',\n inline,\n inlineLeft,\n modified,\n ...props\n },\n ref\n ) => {\n // Custom icon name handling\n if (name === 'share') {\n name = 'arrow-up-from-bracket'\n }\n if (name === 'port') {\n name = 'neuter'\n rotate = 90\n }\n if (name === 'host') {\n name = 't'\n rotate = -90\n }\n if (name === 'launch') {\n name = 'arrow-right'\n rotate = -45\n }\n if (name === 'circle-medium') {\n name = 'circle'\n scale = 0.8\n }\n if (name === 'scripting') {\n name = 'rectangle-terminal'\n }\n\n const theme = useTheme()\n styles.objectFit = 'contain'\n\n if (color) styles.color = theme.palette[color]?.main || color\n if (inline) styles.marginLeft = size ? fontSizes[size] : spacing.md\n if (inlineLeft) styles.marginRight = size ? fontSizes[size] : spacing.md\n if (size) {\n styles.fontSize = fontSizes[size]\n styles.height = fontSizes[size]\n styles.maxWidth = `calc(${fontSizes[size]} + ${spacing.sm}px)`\n }\n if (fontSize) {\n styles.fontSize = fontSize\n styles.height = fontSize\n styles.maxWidth = `${fontSize + spacing.sm}px`\n }\n if (scale) styles.height = `calc(${styles.height || 0} * ${scale})`\n if (rotate) styles.transform = `rotate(${rotate}deg)`\n\n // Handling for different icon sources (platform-specific or FontAwesome)\n if (platformIcon || props.platform) return \n\n if (!name) return null\n\n // Handle special icon cases\n if (name === 'r3') return \n\n let fontType: IconPrefix = 'far'\n\n switch (type) {\n case 'brands':\n fontType = 'fab'\n break\n case 'regular':\n fontType = 'far'\n break\n case 'solid':\n fontType = 'fas'\n break\n case 'light':\n fontType = 'fal'\n break\n default:\n fontType = 'far'\n }\n\n let icon = (\n }\n icon={[fontType, name as IconName]}\n spin={spin}\n fixedWidth={fixedWidth}\n style={styles}\n />\n )\n\n if (modified)\n icon = (\n \n {icon}\n \n )\n\n return icon\n }\n)\n","import React from 'react'\nimport { platforms } from '../../platforms'\nimport { Tooltip, Box } from '@mui/material'\nimport { Sizes } from '../../styling'\nimport { Icon } from '../Icon'\n\nexport const TargetPlatform: React.FC<{\n id?: number\n size?: Sizes\n tooltip?: boolean\n label?: boolean\n inlineLeft?: boolean\n}> = ({ id = -1, size, tooltip, label, inlineLeft }) => {\n const icon = \n const platform = platforms.type(id)\n const typeName = platform.types?.[id] || platform.name\n\n if (tooltip)\n return (\n \n {icon}\n \n )\n\n if (label)\n return (\n \n {icon}\n {typeName}\n \n )\n\n return icon\n}\n","import React from 'react'\nimport classnames from 'classnames'\nimport { spacing, Sizes } from '../styling'\nimport { makeStyles } from '@mui/styles'\nimport { Box } from '@mui/material'\n\ntype Props = {\n margin?: Sizes | null\n indent?: 'listItem' | 'checkbox'\n noInset?: boolean\n className?: string\n children?: React.ReactNode\n}\n\nexport const Quote: React.FC = ({ margin = 'lg', indent, noInset, className, children }) => {\n const css = useStyles({ margin, noInset, indent })\n return {children}\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n quote: ({ margin, noInset, indent }: Props) => {\n let marginLeft\n if (indent === 'listItem') marginLeft = 27\n if (indent === 'checkbox') marginLeft = 14\n return {\n width: `calc(100% - ${marginLeft}px)`,\n position: 'relative',\n marginTop: margin ? spacing[margin] : undefined,\n marginBottom: margin ? spacing[margin] : undefined,\n paddingLeft: noInset ? undefined : spacing.lg,\n borderLeft: `1px solid ${palette.grayLighter.main}`,\n marginLeft,\n }\n },\n}))\n","import React from 'react'\n\nexport const Percent: React.FC<{ value: number }> = ({ value }) => {\n return value ? <>{Math.round(value)}% : null\n}\n","import React from 'react'\n\nexport const Round: React.FC<{ value: number }> = ({ value }) => {\n return <>{Math.round(value * 10) / 10}\n}\n","import React from 'react'\nimport { Icon } from './Icon'\nimport { Quote } from './Quote'\nimport { Percent } from './Percent'\nimport { Round } from './Round'\nimport { Typography, Divider, Box } from '@mui/material'\n\nexport const QualityDetails: React.FC<{ device?: IDevice; small?: boolean }> = ({ device, small }) => {\n let title: string = 'Unknown'\n let color: Color = 'gray'\n\n if (!device) return null\n\n switch (device.quality) {\n case 'GOOD':\n title = 'Good'\n color = 'success'\n break\n case 'MODERATE':\n title = 'Moderate'\n color = 'warning'\n break\n case 'POOR':\n title = 'Poor'\n color = 'danger'\n break\n }\n\n const icon = (\n <>\n {title}\n \n )\n if (small) return icon\n\n return (\n \n {icon}\n \n \n \n Availability: \n \n Average time online per day.\n
\n
\n \n Instability: \n \n Average number of disconnects per day.\n
\n
\n )\n}\n","import React from 'react'\nimport { Icon, IconProps } from './Icon'\n\ntype Props = IconProps & {\n service?: IService\n}\n\nexport const ServiceLinkIcon: React.FC = ({ service, ...props }) =>\n service?.link?.enabled && \n","import React from 'react'\nimport { Chip } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\n\nconst licenseChipLookup: ILookup = {\n UNKNOWN: { name: 'Unknown', colorName: 'grayDarker' },\n EVALUATION: {\n name: 'Evaluation',\n background: 'warningHighlight',\n colorName: 'warning',\n show: true,\n },\n LICENSED: {\n name: 'Licensed',\n background: 'primary',\n colorName: 'alwaysWhite',\n hoverColor: 'primaryLight',\n },\n UNLICENSED: {\n name: 'Unlicensed',\n background: 'warningHighlight',\n colorName: 'warning',\n hoverColor: 'warningLightest',\n disabled: true,\n show: true,\n },\n NON_COMMERCIAL: { name: 'Non-commercial', colorName: 'grayDarker' },\n LEGACY: { name: 'Legacy', colorName: 'grayDarker' },\n EXEMPT: { name: 'Exempt', colorName: 'grayDarker' },\n}\n\nexport function getLicenseChip(license?: ILicenseTypes): ILicenseChip {\n return licenseChipLookup[license || ''] || licenseChipLookup.UNKNOWN\n}\n\nexport const LicenseChip: React.FC<{ license?: ILicenseTypes }> = ({ license }) => {\n const chip = getLicenseChip(license)\n const css = useStyles(chip)\n return \n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n chip: (chip: ILicenseChip) => ({\n color: palette[chip.colorName].main,\n backgroundColor: chip.background ? palette[chip.background].main : undefined,\n fontWeight: 500,\n letterSpacing: 0.2,\n }),\n}))\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Box, alpha, useTheme } from '@mui/material'\nimport { spacing, fontSizes, radius } from '../styling'\nimport { ServiceLinkIcon } from './ServiceLinkIcon'\nimport { getLicenseChip } from './LicenseChip'\nimport classnames from 'classnames'\n\ninterface Props {\n connection?: IConnection\n service?: IService\n onClick?: (IContextMenu) => void\n className?: string\n}\n\nexport const ServiceMiniState: React.FC = ({ connection, service, onClick, className }) => {\n const theme = useTheme()\n const css = useStyles()\n\n let color: Color = 'grayDark'\n let colorBackground: string = ''\n let state = service ? service.state : 'unknown'\n\n if (state !== 'inactive' && connection) {\n if (connection.connecting || connection.stopping) state = 'transition'\n if (connection.connected || connection.enabled) state = 'connected'\n if (connection.error?.message) state = 'error'\n }\n\n switch (state) {\n case 'error':\n color = 'danger'\n break\n case 'active':\n color = 'grayDark'\n colorBackground = 'grayLighter.main'\n break\n case 'inactive':\n color = 'grayDark'\n colorBackground = 'grayLighter.main'\n break\n case 'connected':\n color = 'primary'\n break\n case 'transition':\n color = 'grayDarkest'\n break\n case 'restricted':\n color = 'danger'\n break\n case 'unknown':\n color = 'grayLight'\n }\n\n if (!service) return null\n\n const chip = getLicenseChip(service.license)\n if (chip.show) color = chip.colorName\n\n const onMouseDown = event => {\n event.stopPropagation()\n onClick && onClick({ el: event.currentTarget, serviceID: service.id })\n }\n\n return (\n \n \n {service.type}\n \n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n indicator: {\n display: 'inline-flex',\n alignItems: 'center',\n '& > span': {\n borderRadius: radius.sm,\n fontSize: fontSizes.xs,\n fontWeight: 500,\n padding: 1,\n paddingLeft: spacing.xs,\n paddingRight: spacing.xs,\n marginLeft: 1,\n marginRight: 1,\n '& svg': { marginRight: 2 },\n },\n },\n clickable: {\n cursor: 'pointer',\n '&:hover > span': { backgroundColor: palette.action.hover },\n },\n}))\n","import React from 'react'\nimport { ServiceMiniState } from './ServiceMiniState'\nimport { useHistory } from 'react-router-dom'\nimport { Chip, Box } from '@mui/material'\n\ntype Props = {\n device?: IDevice\n connections?: IConnection[]\n services?: IService[]\n restore?: boolean\n columns?: string[]\n}\n\nconst MAX_INDICATORS = 6\n\nexport const ServiceIndicators: React.FC = ({ device, services = [], connections = [] }) => {\n const history = useHistory()\n\n if (!device?.services.length && !services.length) return null\n\n services = device?.services.length ? device.services : services\n const extra = Math.max(services.length - MAX_INDICATORS, 0)\n const display = services.slice(0, MAX_INDICATORS)\n\n return (\n e.stopPropagation()} onMouseDown={e => e.stopPropagation()}>\n {display.map(service => (\n c.id === service.id)}\n onClick={() => history.push(`/devices/${service.deviceID}/${service.id}/connect`)}\n />\n ))}\n {!!extra && }\n \n )\n}\n","import React from 'react'\nimport { Tooltip } from '@mui/material'\nimport { Sizes } from '../styling'\nimport { Icon } from './Icon'\n\nexport const INITIATOR_PLATFORMS = [\n 'Generic',\n 'Windows Desktop',\n 'Windows',\n 'Mac Desktop',\n 'Mac',\n 'Web',\n 'Linux Desktop',\n 'Linux',\n 'Generic',\n 'Phone',\n 'iPhone/IOS',\n 'iPad',\n 'iTouch',\n 'Java Linux',\n 'Android',\n 'Java Windows',\n 'Java Mac',\n 'Unknown',\n 'BSD',\n]\n\ntype Props = {\n id?: number\n user?: boolean\n thisDevice?: boolean\n}\n\nexport function initiatorPlatformIcon({ id, user, thisDevice }: Props): [string, IconType | undefined] {\n let name: string\n let type: IconType | undefined\n switch (id) {\n case 1:\n case 2:\n name = 'windows'\n type = 'brands'\n break\n case 3:\n case 4:\n name = 'apple'\n type = 'brands'\n break\n case 5:\n name = 'cloud'\n break\n case 6:\n case 7:\n name = 'linux'\n type = 'brands'\n break\n case 8:\n name = 'cloud'\n break\n case 9:\n case 10:\n name = 'mobile'\n break\n case 11:\n case 12:\n name = 'tablet'\n break\n case 13:\n name = 'linux'\n type = 'brands'\n break\n case 14:\n name = 'mobile-android'\n break\n case 15:\n name = 'windows'\n type = 'brands'\n break\n case 16:\n name = 'apple'\n type = 'brands'\n break\n case 17:\n case 18:\n default:\n name = user ? 'user' : thisDevice ? 'laptop' : 'router'\n break\n }\n\n return [name, type]\n}\n\nexport const InitiatorPlatform: React.FC<\n Props & {\n connected?: boolean\n className?: string\n }\n> = ({ id, connected, user, thisDevice, className }) => {\n let color: Color | undefined = connected ? 'primary' : undefined\n const size: Sizes = 'md'\n const [name, type] = initiatorPlatformIcon({ id, user, thisDevice })\n\n return connected && id ? (\n \n \n \n ) : (\n \n )\n}\n","import { IP_OPEN, IP_LATCH, IP_PRIVATE } from '@common/constants'\nimport { store } from '../store'\n\nexport function lanShareRestriction(connection?: IConnection) {\n if (!connection || connection.public || connection.ip === IP_PRIVATE) return 'Off'\n const { privateIP } = store.getState().backend.environment\n\n if (connection.restriction === undefined) return 'Off'\n if (connection.restriction === IP_OPEN) return 'No restriction'\n if (connection.restriction === IP_LATCH) return 'IP Latching'\n if (isIPClass(connection.restriction, privateIP, 'A')) return 'Class-A Restriction'\n if (isIPClass(connection.restriction, privateIP, 'B')) return 'Class-B Restriction'\n if (isIPClass(connection.restriction, privateIP, 'C')) return 'Class-C Restriction'\n return 'Single IP Restriction'\n}\n\nexport function lanShared(connection?: IConnection) {\n return !connection?.public && !!(connection?.ip && connection.ip !== IP_PRIVATE)\n}\n\nexport function isIPClass(checkIP: ipAddress, privateIP: ipAddress, type: ipClass) {\n const maskedIP = maskIPClass(privateIP, type)\n return checkIP === maskedIP\n}\n\n// IP class-A: *.0.0.0\n// IP class-B: *.*.0.0\n// IP class-C: *.*.*.0\nexport function maskIPClass(privateIP: ipAddress, type: ipClass) {\n let parts = privateIP.split('.')\n switch (type) {\n case 'A':\n parts[1] = '0'\n case 'B':\n parts[2] = '0'\n case 'C':\n parts[3] = '0'\n }\n return parts.join('.')\n}\n","import { createContext } from 'react'\nimport { Attribute } from '../components/Attributes'\n\nexport const DeviceListContext = createContext({\n device: {} as IDevice,\n service: {} as IService,\n connections: [],\n attributes: [],\n required: {} as Attribute,\n})\n\nexport const DeviceContext = createContext({\n user: {} as IUser,\n device: undefined,\n network: undefined,\n connections: [],\n service: undefined,\n connection: {} as IConnection,\n instance: undefined,\n waiting: false,\n})\n\nexport const DiagramContext = createContext({\n toTypes: undefined,\n errorTypes: [],\n activeTypes: [],\n highlightTypes: [],\n state: undefined,\n proxy: undefined,\n relay: undefined,\n})\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { SxProps, Theme, Tooltip, TooltipProps, IconButton as MuiIconButton, darken } from '@mui/material'\nimport { Icon, IconProps } from '../components/Icon'\n\ntype VariantType = 'text' | 'contained' | 'outlined'\n\nexport type ButtonProps = Omit & {\n to?: string\n title?: React.ReactNode\n forceTitle?: boolean\n icon?: string\n name?: string\n sx?: SxProps\n disabled?: boolean\n hideDisableFade?: boolean\n iconInlineLeft?: boolean\n buttonBaseSize?: 'small' | 'medium' | 'large'\n variant?: VariantType\n shiftDown?: boolean\n loading?: boolean\n submit?: boolean\n hide?: boolean\n placement?: TooltipProps['placement']\n children?: React.ReactNode\n onMouseEnter?: (e: React.MouseEvent) => void\n onMouseLeave?: (e: React.MouseEvent) => void\n onMouseDown?: (e: React.MouseEvent) => void\n onClick?: (e: React.MouseEvent) => void\n}\n\nexport const IconButton = React.forwardRef(\n (\n {\n to,\n sx = {},\n title,\n forceTitle,\n icon,\n name,\n disabled,\n hideDisableFade,\n spin,\n color,\n variant,\n shiftDown,\n size = 'base',\n buttonBaseSize,\n inline,\n inlineLeft,\n iconInlineLeft,\n className,\n loading,\n submit,\n hide,\n placement = 'top',\n fixedWidth = true,\n onMouseEnter,\n onMouseLeave,\n onMouseDown,\n onClick,\n children,\n ...props\n },\n ref\n ) => {\n const history = useHistory()\n\n if (hide) return null\n icon = icon || name\n if (loading) {\n icon = 'spinner-third'\n spin = true\n }\n const clickHandler = (e: React.MouseEvent) => {\n if (onClick) onClick(e)\n if (to) history.push(to)\n }\n\n let updatedSx: SxProps = {\n opacity: disabled && !hideDisableFade ? 0.5 : undefined,\n marginBottom: shiftDown ? -0.75 : undefined,\n marginTop: shiftDown ? -0.75 : undefined,\n marginLeft: inline ? 1.5 : undefined,\n marginRight: inlineLeft ? 1.5 : undefined,\n ...sx,\n }\n\n switch (variant) {\n case 'contained':\n updatedSx = {\n color: 'alwaysWhite.main',\n backgroundColor: `${color || 'primary'}.main`,\n ['&:hover']: {\n backgroundColor: ({ palette }) => darken(palette[color || 'primary'].main, 0.2),\n },\n ...updatedSx,\n }\n break\n case 'outlined':\n updatedSx = {\n border: `1px solid ${color || 'primary'}.main`,\n ...updatedSx,\n }\n }\n\n const button = (\n \n \n {children}\n \n )\n\n return !(forceTitle && title) && (disabled || !title) ? (\n button\n ) : (\n \n {button}\n \n )\n }\n)","import React from 'react'\nimport { humanizeResolutionLookup, TimeSeriesTypeLookup } from '../helpers/dateHelper'\nimport { IconButton } from '../buttons/IconButton'\nimport { Box } from '@mui/material'\nimport humanize from 'humanize-duration'\n\nexport const GraphColumn: React.FC<{ title: string; timeSeries?: ITimeSeries }> = ({ title, timeSeries }) => {\n if (!timeSeries) return <>{title}\n return (\n <>\n {TimeSeriesTypeLookup[timeSeries.type]}\n \n \n \n \n )\n}\n","import React, { useContext } from 'react'\nimport { DeviceListContext } from '../services/Context'\nimport { GraphColumn } from './GraphColumn'\n\nexport const ServiceGraphColumn: React.FC = () => {\n const { service } = useContext(DeviceListContext)\n return \n}\n","import React, { useContext } from 'react'\nimport { DeviceListContext } from '../services/Context'\nimport { GraphColumn } from './GraphColumn'\n\nexport const DeviceGraphColumn: React.FC = () => {\n const { device } = useContext(DeviceListContext)\n return \n}\n","import { adaptor } from './adaptor'\nimport { replaceHost } from './nameHelper'\n\nexport const DEVICE_TYPE = 35\nexport const KEY_APPS = new Set([5, 7, 8, 28, 48, 49])\n\nclass LaunchMethod {\n type: Exclude = 'NONE'\n icon: string = ''\n name: string = ''\n template: string = ''\n defaultTemplate: string = ''\n copyIcon?: string = ''\n sshConfig?: string\n disconnect?: string\n disconnectDisplay?: string\n\n constructor(options?: Partial<{ [key in keyof LaunchMethod]: LaunchMethod[key] }>) {\n this.setDefaults()\n if (options) {\n options.defaultTemplate = options.defaultTemplate || options.template\n Object.assign(this, options)\n }\n }\n\n setDefaults() {\n // intended to be used by child classes\n }\n\n get form() {\n return { key: this.type, name: this.name }\n }\n}\n\nclass UrlLaunchMethod extends LaunchMethod {\n setDefaults() {\n this.type = 'URL'\n this.icon = 'launch'\n this.copyIcon = 'link-horizontal'\n this.name = 'URL'\n this.template = 'https://[host]:[port]'\n }\n}\n\nclass CommandLaunchMethod extends LaunchMethod {\n setDefaults() {\n this.type = 'COMMAND'\n this.icon = 'code-simple'\n this.name = 'Command'\n this.template = '[host]:[port]'\n }\n}\n\nclass TerminalLaunchMethod extends LaunchMethod {\n setDefaults() {\n this.type = 'TERMINAL'\n this.icon = 'terminal'\n this.name = 'Terminal'\n this.template = '[host]:[port]'\n }\n}\n\nclass ScriptLaunchMethod extends LaunchMethod {\n setDefaults() {\n this.type = 'SCRIPT'\n this.icon = 'code-simple'\n this.name = 'Script'\n this.template = ''\n }\n}\n\nexport class Application {\n title: string = ''\n use: string = ''\n urlForm: boolean = false\n sshConfig: boolean = false\n appLaunchType: IConnection['launchType'] = 'NONE'\n launchMethods: LaunchMethod[] = [new UrlLaunchMethod(), new TerminalLaunchMethod(), new CommandLaunchMethod()]\n defaultAppTokens: string[] = ['host', 'port', 'id']\n defaultTokenData: ILookup = {}\n globalDefaults: ILookup = {}\n cloudData?: IApplicationType\n localhost?: boolean\n helpMessage?: string\n autoLaunch?: boolean\n autoClose?: boolean // run command on disconnect\n canShare?: boolean\n\n connection?: IConnection\n service?: IService\n\n windows: boolean = false\n portal: boolean = false\n\n REGEX_PARSE: RegExp = /\\[[^\\W\\[\\]]+\\]/g\n\n constructor(options: Partial<{ [key in keyof Application]: Application[key] }>) {\n const environment = adaptor?.getState().environment\n const portal = environment?.portal\n const os = environment?.os\n options.windows = os === 'windows'\n options.portal = !!portal\n Object.assign(this, options)\n }\n\n value(token: string) {\n return this.lookup[token]\n }\n\n preview(data: ILookup) {\n return this.parse(this.template, { ...this.lookup, ...data })\n }\n\n visibility(device?: IDevice) {\n return true\n }\n\n get canLaunch() {\n return !(this.portal && this.launchType !== 'URL') && this.launchType !== 'NONE'\n }\n\n get icon() {\n return this.launchMethod.icon\n }\n\n get copyIcon() {\n return this.launchMethod.copyIcon || this.icon\n }\n\n get contextTitle() {\n return `${this.title} ${this.launchMethod.name}`\n }\n\n get commandTitle() {\n return `${this.title} Command`\n }\n\n get launchTitle() {\n return `${this.title} URL`\n }\n\n get launchMethod(): LaunchMethod {\n return this.getLaunchMethod(this.launchType)\n }\n\n get commandLaunchMethod(): LaunchMethod {\n return this.getLaunchMethod('COMMAND')\n }\n\n get urlLaunchMethod(): LaunchMethod {\n return this.getLaunchMethod('URL')\n }\n\n get defaultTemplate() {\n return this.launchMethod.defaultTemplate // need resolved\n }\n\n get template() {\n return this.getTemplate(this.launchType)\n }\n\n get launchTemplate() {\n return this.getTemplate('URL')\n }\n\n get commandTemplate() {\n return this.getTemplate('COMMAND')\n }\n\n get string() {\n return this.parse(this.template, this.lookup)\n }\n\n get sshConfigString() {\n return this.parse(this.launchMethod?.sshConfig || this.template, this.lookup)\n }\n\n get commandString() {\n return this.parse(this.commandTemplate, this.lookup)\n }\n\n get launchString() {\n return this.parse(this.launchTemplate, this.lookup)\n }\n\n get disconnectString() {\n return this.parse(this.launchMethod.disconnect, this.lookup)\n }\n\n get prompt() {\n return this.missingTokens.length\n }\n\n get tokens() {\n return this.extractTokens(this.template)\n }\n\n get allTokens() {\n return this.extractTokens(this.launchMethods.map(method => this.getTemplate(method.type)).join())\n }\n\n get commandTokens() {\n return this.extractTokens(this.commandTemplate)\n }\n\n get launchTokens() {\n return this.extractTokens(this.launchTemplate)\n }\n\n get launchType() {\n return this.connection?.launchType || this.defaultLaunchType || 'NONE'\n }\n\n get defaultLaunchType(): IConnection['launchType'] {\n return this.globalDefaults?.launchType || this.appLaunchType\n }\n\n get defaultCommandTemplate() {\n return this.commandLaunchMethod.template\n }\n\n get defaultLaunchTemplate() {\n return this.urlLaunchMethod.template\n }\n\n get defaultTokens() {\n return this.defaultAppTokens\n }\n\n get customTokens() {\n return this.tokens.filter(token => !this.defaultTokens.includes(token))\n }\n\n get launchCustomTokens() {\n return this.launchTokens.filter(token => !this.defaultTokens.includes(token))\n }\n\n get commandCustomTokens() {\n return this.commandTokens.filter(token => !this.defaultTokens.includes(token))\n }\n\n get allCustomTokens() {\n return this.allTokens.filter(token => !this.defaultTokens.includes(token))\n }\n\n get missingTokens() {\n return this.extractTokens(this.parse(this.template, this.lookup)) || []\n }\n\n get lookup() {\n let lookup: ILookup = { ...this.defaultTokenData, ...this.globalDefaults }\n if (this.service) lookup = { ...lookup, ...this.service.attributes }\n if (this.connection) lookup = { ...lookup, ...this.connection }\n return lookup\n }\n\n get reverseProxy() {\n return this.cloudData ? this.cloudData.proxy : false\n }\n\n getReverseProxyTemplate(secure: boolean) {\n return secure ? this.template.replace('http:', 'https:') : this.template.replace('https:', 'http:')\n }\n\n private getTemplate(type: LaunchMethod['type']) {\n if (this.connection?.connectLink) return this.resolvedDefaultTemplate(type)\n return this.connection?.launchTemplates?.[type] || this.resolvedDefaultTemplate(type)\n }\n\n private resolvedDefaultTemplate(type?: LaunchMethod['type']): string {\n switch (type) {\n case 'URL':\n return (\n this.service?.attributes.launchTemplate || this.globalDefaults.launchTemplate || this.defaultLaunchTemplate\n )\n case 'COMMAND':\n return (\n this.service?.attributes.commandTemplate || this.globalDefaults.commandTemplate || this.defaultCommandTemplate\n )\n default:\n return this.launchMethod.defaultTemplate\n }\n }\n\n private getLaunchMethod(type?: LaunchMethod['type']) {\n return this.launchMethods.find(method => method.type === type) || this.launchMethods[0]\n }\n\n private parse(template: string = '', lookup: ILookup) {\n this.allTokens.forEach(token => {\n if (lookup[token]) {\n const search = new RegExp(`\\\\[${token}\\\\]`, 'g')\n const replace = lookup[token]\n template = template.replace(search, replace)\n }\n })\n template = replaceHost(template, this.localhost)\n if (!lookup.port) template = template.replace(':[port]', '')\n return template\n }\n\n private extractTokens(template: string) {\n const matches: string[] = (template.match(this.REGEX_PARSE) || []).map(m => m.slice(1, -1))\n const unique = new Set(matches)\n return [...Array.from(unique)]\n }\n}\n\nexport function getApplication(service?: IService, connection?: IConnection, globalDefaults?: ILookup) {\n const typeID = service?.typeID || connection?.typeID\n const app = getApplicationType(typeID)\n\n app.service = service\n app.connection = connection\n app.globalDefaults = globalDefaults?.[typeID || ''] || {}\n app.cloudData = adaptor?.getCloudData(typeID)\n\n // Handle legacy connection templates\n if (connection && !connection.launchTemplates) {\n if (connection.launchTemplate) connection.launchTemplates = { URL: connection.launchTemplate }\n if (connection.commandTemplate) connection.launchTemplates = { COMMAND: connection.commandTemplate }\n }\n\n // Handle connect links\n if (app.connection?.connectLink && service?.link?.url) {\n const url = service.link.url\n app.title = app.reverseProxy ? 'Public' : 'Unauthenticated'\n app.canShare = true\n app.launchMethods = [new UrlLaunchMethod({ template: url }), new CommandLaunchMethod({ template: url })]\n app.appLaunchType = app.reverseProxy ? 'URL' : 'NONE'\n }\n\n return app\n}\n\nexport function getApplicationType(typeId?: number) {\n const { environment, preferences } = adaptor?.getState() || {}\n const { sshConfig } = preferences || {}\n const portal = environment?.portal // includes mobile\n const os = environment?.os\n const windows = os === 'windows'\n const android = os === 'android'\n const mac = os === 'mac'\n const ios = os === 'ios'\n\n switch (typeId) {\n case 1:\n return new Application({\n title: 'TCP',\n appLaunchType: 'URL',\n use: 'Use for custom TCP connections not involving web traffic, as it lacks reverse proxy capabilities. Ideal for direct application-to-application communication.',\n })\n case 4:\n const launchMethods = [new UrlLaunchMethod({ template: 'vnc://[username]@[host]:[port]', icon: 'desktop' })]\n if (windows || mac)\n launchMethods.push(\n new CommandLaunchMethod({\n template: windows\n ? '\"[path]\" -Username \"[username]\" [host]:[port]'\n : 'open -a \"[app]\" --args -Username [username] [host]:[port]',\n })\n )\n return new Application({\n title: 'VNC',\n use: 'Ideal for remote desktop access to graphical interfaces on computers or servers. Use when you need to control a device with a graphical desktop remotely.',\n appLaunchType: windows ? 'COMMAND' : 'URL',\n defaultTokenData: windows ? undefined : { app: 'VNC Viewer' },\n launchMethods,\n })\n case 28:\n return new Application({\n title: 'SSH',\n use: 'For secure terminal access and command-line execution on servers or devices. Essential for system admins and developers.',\n autoLaunch: !(windows && portal),\n appLaunchType: portal && !windows ? 'URL' : 'TERMINAL',\n launchMethods: [\n new UrlLaunchMethod({ template: 'ssh://[username]@[host]:[port]' }),\n new TerminalLaunchMethod({\n template: sshConfig\n ? 'ssh_config [User]'\n : windows\n ? 'ssh [username]@[host] -p [port]'\n : 'ssh -l [username] [host] -p [port]',\n sshConfig: sshConfig ? 'ssh [host]' : undefined,\n }),\n ],\n helpMessage: sshConfig ? 'Any ssh config attribute may be added' : undefined,\n sshConfig,\n })\n case 5:\n const rdpCommand = 'rdp://full%20address=s%3A[host]%3A[port]'\n return new Application({\n title: 'RDP',\n use: 'For remote desktop access to Windows servers or devices. Use when you need to control a device with a graphical desktop remotely.',\n appLaunchType: ios || android ? 'URL' : 'COMMAND',\n defaultTokenData: windows ? undefined : { app: 'Microsoft Remote Desktop' },\n launchMethods: [\n new UrlLaunchMethod({ template: rdpCommand }),\n new CommandLaunchMethod({\n template: windows ? 'mstsc /v: [host]:[port]' : mac ? `open -a \"[app]\" \"${rdpCommand}\"` : rdpCommand,\n }),\n ],\n })\n case 8:\n case 10:\n case 33:\n return new Application({\n title: 'Secure Browser',\n use: 'Essential for any web application handling sensitive data, or any content requiring secure communication over the internet.',\n appLaunchType: 'URL',\n urlForm: true,\n autoLaunch: true,\n })\n case 7:\n case 30:\n return new Application({\n title: 'Browser',\n use: 'Use for accessing or hosting web applications that do not support encrypted connections. Ideal for local development environments or internal networks where security is not a concern.',\n appLaunchType: 'URL',\n urlForm: true,\n autoLaunch: true,\n })\n case 34:\n return new Application({\n title: 'Samba',\n use: 'Utilize for setting up shared access to files, printers, and serial ports within a Windows network or across different operating systems supporting SMB protocol.',\n localhost: true,\n appLaunchType: 'URL',\n launchMethods: [\n new UrlLaunchMethod({ template: 'smb://[host]:[port]', icon: 'folder' }),\n new CommandLaunchMethod({\n template: windows ? '\\\\\\\\[host]:[port]' : '[host]:[port]',\n name: 'Copy command',\n icon: 'clipboard',\n }),\n ],\n })\n case 37:\n return new Application({\n title: 'NxWitness',\n use: 'Use for connecting to Nx Witness Video Management Systems (VMS), suitable for security professionals managing IP camera networks.',\n appLaunchType: 'URL',\n urlForm: true,\n autoLaunch: true,\n })\n case 38:\n return new Application({\n title: 'Nextcloud',\n use: 'Select for secure access to Nextcloud hubs, allowing for file sharing, collaboration, and communication within a secure, private cloud environment.',\n appLaunchType: 'URL',\n urlForm: true,\n autoLaunch: true,\n })\n case 39:\n return new Application({\n title: 'OpenVPN',\n use: 'Choose for secure VPN access to networks, allowing for remote work or access to network resources with encryption.',\n })\n case 41:\n return new Application({\n title: 'Minecraft',\n use: 'Set up for hosting or connecting to a Minecraft server using TCP for gameplay, allowing players to join your Minecraft world.',\n })\n case 42:\n return new Application({\n title: 'Admin Panel',\n use: 'Remote.It admin panel running on the device. Previously used to remotely manage a device’s configuration. Now most devices can be managed from the Remote.it app or web portal.',\n appLaunchType: 'URL',\n urlForm: true,\n autoLaunch: true,\n visibility: (device?: IDevice) =>\n !!device && [0, 5, 10, 1120, 1076, 256, 769, 1121, 1200, 1185].includes(device?.targetPlatform),\n })\n case 43:\n return new Application({\n title: 'Terraria',\n use: 'Set up for hosting or connecting to a Terraria game server, allowing players to explore, build, and adventure together in a unique 2D world.',\n })\n case 44:\n return new Application({\n title: 'Redis',\n use: 'Select for connecting to Redis servers, ideal for developers working with high-performance databases for caching and messaging.',\n })\n case 45:\n return new Application({\n title: 'MySQL',\n use: 'Utilize for remote access to MySQL databases. Ideal for developers and database administrators managing databases remotely.',\n })\n case 46:\n return new Application({\n title: 'PostgreSQL',\n use: 'Utilize for remote access to PostgreSQL databases, essential for database administrators and developers needing to manage data remotely.',\n })\n case 47:\n return new Application({\n title: 'Docker API',\n use: 'Use for remote management of Docker containers. Ideal for developers and system administrators who need to control Docker environments remotely.',\n appLaunchType: 'COMMAND',\n launchMethods: [\n new UrlLaunchMethod({ template: 'https://[host]:[port]' }),\n new CommandLaunchMethod({\n template: windows ? 'start cmd /k docker -H [host]:[port] ps' : 'docker -H [host]:[port] ps',\n }),\n ],\n })\n case 48:\n return new Application({\n title: 'ScreenView (Beta)',\n use: 'Use for remote screen viewing or control via Remote.It’s ScreenView app. Facilitates support, collaboration and remote access.',\n appLaunchType: 'URL',\n autoLaunch: true,\n visibility: (device?: IDevice) =>\n !!(device?.targetPlatform === 1213 || device?.supportedAppInstalls.includes(typeId)),\n })\n case 49:\n return new Application({\n title: 'SOCKS Proxy (Beta)',\n use: 'Use as a proxy server for handling internet traffic via the SOCKS protocol. Provides secure and anonymous communication, allowing users to bypass internet restrictions and protect their online privacy.',\n defaultTokenData: windows ? undefined : { app: 'Google Chrome' },\n appLaunchType: portal ? 'NONE' : 'SCRIPT',\n autoClose: true,\n autoLaunch: true,\n launchMethods: [\n new ScriptLaunchMethod({\n name: 'Browser',\n template: windows\n ? 'socks.ps1 -path \"[app]\" -proxy \"socks5://[host]:[port]\"'\n : 'socks.sh \"[app]\" \"socks5://[host]:[port]\"',\n disconnect: windows ? 'socks.ps1 -path \"[app]\"' : 'socks.sh \"[app]\"',\n disconnectDisplay: 'Restarts your browser to remove SOCKS Proxy on disconnect',\n }),\n // new ScriptLaunchMethod({\n // template:\n // 'networksetup -setsocksfirewallproxy Wi-Fi [host] [port] && networksetup -setsocksfirewallproxystate Wi-Fi on',\n // disconnect:\n // 'networksetup -setsocksfirewallproxystate Wi-Fi off && networksetup -setsocksfirewallproxystate Ethernet off',\n // disconnectDisplay: 'Turns off system SOCKS Proxy on disconnect',\n // }),\n ],\n visibility: (device?: IDevice) => (device?.version || 0) >= 5.2,\n })\n case 32769:\n return new Application({\n title: 'UDP',\n use: 'Select for applications that require fast communication where reliability is less critical, such as streaming, gaming, or broadcasting.',\n })\n case 32770:\n return new Application({\n title: 'WireGuard',\n use: 'Choose for a modern, secure VPN connection, offering fast and secure access to private networks with ease of setup and management.',\n })\n case 32771:\n return new Application({\n title: 'Minecraft Bedrock',\n use: 'Choose for Minecraft Bedrock Edition servers, using UDP for gameplay on platforms like mobile and consoles, enabling players to connect and play together.',\n })\n default:\n return new Application({})\n }\n}\n","import browser, { setLocalStorage, getOs } from '../services/browser'\nimport { createModel } from '@rematch/core'\nimport { RootModel } from '.'\nimport { emit } from '../services/Controller'\nimport sleep from '../helpers/sleep'\n\nexport const NOTICE_VERSION_ID = 'notice-version'\n\nexport type IBackendState = {\n initialized: boolean\n thisId: string\n scanData: IScanData\n interfaces: IInterface[]\n freePort?: number\n updateStatus: {\n version?: string\n nextCheck: number\n checking: boolean\n available: boolean\n downloaded: boolean\n downloading: boolean\n error: boolean\n }\n environment: {\n os?: Ios\n osVersion?: string\n arch?: string\n manufacturerDetails?: ManufacturerDetails\n privateIP: ipAddress\n hostname: string\n oobAvailable: boolean\n overrides: IOverrides\n portal: boolean\n }\n preferences: IPreferences\n deferredAttributes?: IService['attributes']\n reachablePort?: IPortScan\n canNavigate: { canGoBack: boolean; canGoForward: boolean }\n filePath?: string\n}\n\nconst defaultState: IBackendState = {\n initialized: false,\n thisId: '',\n scanData: { wlan0: { data: [], timestamp: 0 } },\n interfaces: [],\n freePort: undefined,\n updateStatus: {\n nextCheck: 0,\n checking: false,\n available: false,\n downloaded: false,\n downloading: false,\n error: false,\n },\n environment: {\n os: 'linux',\n osVersion: '',\n arch: '',\n manufacturerDetails: undefined,\n privateIP: '',\n hostname: '',\n oobAvailable: false,\n overrides: {},\n portal: true,\n },\n preferences: {\n version: '',\n cliVersion: '',\n },\n deferredAttributes: undefined,\n reachablePort: undefined,\n canNavigate: { canGoBack: false, canGoForward: false },\n filePath: undefined,\n}\n\nexport default createModel()({\n state: defaultState,\n effects: dispatch => ({\n async init(_: void, state) {\n dispatch.backend.set({\n initialized: true,\n environment: { ...state.backend.environment, os: getOs(), portal: browser.isPortal },\n })\n },\n async environment(_: void, state) {\n let result: string = ''\n const keys = ['os', 'osVersion', 'arch', 'manufacturerDetails']\n keys.forEach(key => {\n if (result) result += '\\n'\n result += `${key}: ${JSON.stringify(state.backend.environment[key], null, 2)}`\n })\n return result\n },\n async targetDeviceUpdated(newId: string, state) {\n const { ui, backend, devices } = dispatch\n const { thisId } = state.backend\n\n if (newId !== thisId) {\n // registered\n if (newId && state.ui.setupRegisteringDevice) {\n await sleep(1000)\n ui.set({ setupRegisteringDevice: false })\n\n // deleted\n } else if (state.ui.setupDeletingDevice) {\n console.log('THIS DEVICE DELETED', thisId)\n ui.set({\n setupBusy: false,\n setupDeletingDevice: false,\n successMessage: 'Device unregistered successfully!',\n })\n\n // restored\n } else if (state.ui.restoring) {\n devices.fetchList()\n ui.set({\n restoring: false,\n successMessage: 'Device restored successfully!',\n })\n }\n }\n\n backend.set({ thisId: newId })\n },\n async registerDevice({ services, name, accountId }: { services: IService[]; name: string; accountId: string }) {\n dispatch.ui.set({ setupRegisteringDevice: true })\n const code = await dispatch.devices.createRegistration({\n name,\n accountId,\n services: services.map(t => ({\n name: t.name,\n application: t.typeID,\n port: t.port,\n host: t.host,\n })),\n })\n emit('registration', code)\n },\n async setUpdateNotice(updateVersion: string | undefined, state) {\n setLocalStorage(state, NOTICE_VERSION_ID, updateVersion)\n },\n async disableAutoUpdate(_: void, state) {\n emit('preferences', { ...state.backend.preferences, autoUpdate: false })\n },\n async install() {\n dispatch.ui.set({ waitMessage: 'updating' })\n emit('update/install')\n },\n }),\n\n reducers: {\n reset(state: IBackendState) {\n state = { ...defaultState }\n return state\n },\n set(state: IBackendState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { State } from '../store'\nimport { getLocalStorage } from '../services/browser'\nimport { NOTICE_VERSION_ID } from '../models/backend'\n\nexport const optionalParam = (_: State, first?: any) => first\nexport const optionalSecondParam = (_: State, first?: string, second?: any) => second\nexport const optionalThirdParam = (_: State, first?: string, second?: any, third?: any) => third\n\nexport const getUser = (state: State) => state.user\nexport const getUserId = (state: State) => state.auth.user?.id || ''\nexport const getMemberships = (state: State) => state.accounts.membership\nexport const optionalAccountId = (_: State, accountId?: string) => accountId\nexport const optionalCustomerId = (_: State, accountId?: string, customerId?: string) => customerId\nexport const getActiveId = (state: State) => state.accounts.activeId\nexport const getPlans = (state: State) => state.plans.plans\nexport const getPlansTests = (state: State) => state.plans.tests\nexport const getLimitsOverride = (state: State) => state.ui.limitsOverride\nexport const getOrganizations = (state: State) => state.organization.accounts\nexport const getTestLimits = (state: State) => (state.plans.tests.limit ? state.plans.tests.limits : undefined)\n\nexport const getDevicesState = (state: State) => state.devices\nexport const getColumns = (state: State) => state.ui.columns\nexport const optionalId = (_: State, accountId?: string, id?: string) => id\nexport const optionalDeviceId = (_: State, accountId?: string, deviceId?: string) => deviceId\n\nexport const getSessions = (state: State) => state.sessions.all\nexport const getConnections = (state: State) => state.connections.all\nexport const optionalService = (_: State, service?: IService) => service\n\nexport const getConnectionDefaults = (state: State) => state.user.attributes?.connectionDefaults || {}\nexport const getApplicationTypes = (state: State) => state.applicationTypes\nexport const getApplicationParams = (_: State, service?: IService, connection?: IConnection) => ({\n service,\n connection,\n})\n\nexport const getAllNetworks = (state: State) => state.networks.all\nexport const getTags = (state: State) => state.tags.all\nexport const getDefaultSelected = (state: State) => state.ui.defaultSelection\nexport const getThemeDark = (state: State) => state.ui.themeDark\nexport const getDeviceTimeSeries = (state: State) => state.ui.deviceTimeSeries\nexport const getServiceTimeSeries = (state: State) => state.ui.serviceTimeSeries\nexport const getUpdateStatus = (state: State) => state.backend.updateStatus\nexport const getPreferences = (state: State) => state.backend.preferences\nexport const getAnnouncements = (state: State) => state.announcements.all\nexport const getNotifiedVersion = (state: State) => getLocalStorage(state, NOTICE_VERSION_ID)\nexport const getFiles = (state: State) => state.files.all\nexport const getJobs = (state: State) => state.jobs.all","import { createSelector } from 'reselect'\nimport { getUserId, getUser, getActiveId, optionalAccountId, getMemberships } from './state'\n\nexport const selectActiveAccountId = createSelector(\n [optionalAccountId, getActiveId, getUserId],\n (accountId, activeId, userId) => accountId || activeId || userId\n)\n\nexport const isUserAccount = createSelector(\n [selectActiveAccountId, getUserId],\n (activeAccountId, userId) => activeAccountId === userId\n)\n\nexport const selectActiveUser = createSelector(\n [selectActiveAccountId, getMemberships, getUser],\n (accountId, memberships, user): IUserRef => {\n const membershipOrganizations = memberships.map(m => ({\n id: m.account.id || '',\n email: m.account.email || 'unknown',\n created: m.created,\n }))\n return membershipOrganizations.find(m => m.id === accountId) || user\n }\n)\n\nconst getThisMembership = createSelector([getUser], user => ({\n roleId: 'OWNER',\n roleName: 'Owner',\n license: 'UNKNOWN',\n created: user.created || new Date(),\n account: {\n id: user.id,\n email: user.email,\n },\n}))\n\nexport const selectMembership = createSelector(\n [selectActiveAccountId, getMemberships, getThisMembership, isUserAccount],\n (accountId, memberships, thisMembership, isUserAccount): IMembership => {\n if (isUserAccount) return thisMembership\n return (\n memberships.find(m => m.account.id === accountId) ||\n (console.log('CANT FIND THIS MEMBERSHIP', thisMembership.license), thisMembership)\n )\n }\n)\n","import { createSelector } from 'reselect'\nimport { getApplication } from '@common/applications'\nimport { getConnectionDefaults, getApplicationParams, getApplicationTypes } from './state'\nimport { selectActiveAccountId } from './accounts'\n\nexport const selectApplication = createSelector(\n [getConnectionDefaults, getApplicationParams],\n (globalDefaults, { service, connection }) => getApplication(service, connection, globalDefaults)\n)\n\nexport const selectApplicationTypesGrouped = createSelector(\n [getApplicationTypes, selectActiveAccountId],\n (applicationTypes, accountId): IApplicationTypeGroup[] => {\n const types = applicationTypes.account[accountId] || []\n\n const groupMap: { [key: number]: string } = applicationTypes.groups.reduce((map, group) => {\n group.ids.forEach(id => (map[id] = group.name))\n return map\n }, {})\n\n let result: IApplicationTypeGroup[] = []\n let processed = new Set()\n\n types.forEach(obj => {\n if (groupMap[obj.id] && !processed.has(obj.id)) {\n // Find all objects in the same group\n const groupObjects = types.filter(o => groupMap[o.id] === groupMap[obj.id])\n\n // Add group object to result\n result.push({\n ...obj,\n name: groupMap[obj.id],\n ids: groupObjects.map(o => o.id),\n })\n\n // Mark these ids as processed\n groupObjects.forEach(o => processed.add(o.id))\n } else if (!groupMap[obj.id]) {\n // If not in a group, add it as is, but with ids as an array\n result.push({ ...obj, ids: [obj.id] })\n }\n })\n\n return result\n }\n)\n","import { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { selectApplication } from '../selectors/applications'\n\nexport const useApplication = (service?: IService, connection?: IConnection) => {\n return useSelector((state: State) => selectApplication(state, service, connection))\n}\n","import { DEFAULT_ID } from '../models/networks'\nimport { createSelector } from 'reselect'\nimport { getAllNetworks, optionalId } from './state'\nimport { selectActiveAccountId } from './accounts'\n\nexport const selectNetworks = createSelector(\n [selectActiveAccountId, getAllNetworks],\n (activeAccountId, allNetworks) => allNetworks[activeAccountId] || []\n)\n\nexport const selectNetworkByService = createSelector(\n [selectNetworks, optionalId],\n (networks, serviceId = DEFAULT_ID): INetwork[] => networks.filter(network => network.serviceIds.includes(serviceId))\n)\n","export const testData: {\n license: boolean\n limit: boolean\n unlicensed: boolean\n licenses: ILicense[]\n limits: ILimit[]\n} = {\n license: false,\n limit: false,\n unlicensed: false,\n licenses: [\n {\n id: 'e46e5c55-7d12-46c5-aee3-493e29e604db',\n created: new Date('2020-10-17T01:03:47.976Z'),\n updated: new Date('2020-10-17T01:03:47.976Z'),\n expiration: new Date('2020-11-05T01:03:48.000Z'),\n valid: true,\n quantity: null,\n custom: false,\n subscription: {\n total: 1,\n status: 'ACTIVE',\n price: null,\n card: null,\n },\n plan: {\n id: '649b2e68-05fd-11eb-bda8-021f403e8c27',\n name: 'TRIAL',\n description: 'trial',\n product: {\n id: '55d9e884-05fd-11eb-bda8-021f403e8c27',\n name: 'AWS',\n description: 'AWS',\n },\n },\n },\n {\n id: '4a5ed500-ef07-4a98-be11-PERSONAL',\n created: new Date('2021-03-12T05:44:32.421Z'),\n updated: new Date('2021-03-12T05:44:32.421Z'),\n expiration: new Date('2021-02-12T05:44:32.421Z'),\n valid: false,\n quantity: null,\n custom: false,\n subscription: {\n total: 1,\n status: 'CANCELED',\n price: null,\n card: null,\n },\n plan: {\n id: 'e147a026-81d7-11eb-afc8-02f048730623',\n name: 'PERSONAL',\n description: 'personal',\n product: {\n id: 'b999e047-5532-11eb-8872-063ce187bcd7',\n name: 'remote.it',\n description: 'remote.it',\n },\n },\n },\n {\n id: '4a5ed500-ef07-4a98-be11-PROFESSIONAL',\n created: new Date('2021-03-12T05:44:32.421Z'),\n updated: new Date('2021-03-12T05:44:32.421Z'),\n expiration: new Date('2021-02-12T05:44:32.421Z'),\n valid: false,\n quantity: null,\n custom: true,\n subscription: {\n total: 1,\n status: 'INCOMPLETE',\n price: null,\n card: null,\n },\n plan: {\n id: 'e147a026-81d7-11eb-afc8-02f048730623',\n name: 'PROFESSIONAL',\n description: 'professional',\n product: {\n id: 'b999e047-5532-11eb-8872-063ce187bcd7',\n name: 'remote.it',\n description: 'remote.it',\n },\n },\n },\n {\n id: '4a5ed500-ef07-4a98-be11-BUSINESS',\n created: new Date('2021-03-12T05:44:32.421Z'),\n updated: new Date('2021-03-12T05:44:32.421Z'),\n expiration: null,\n valid: true,\n quantity: null,\n custom: false,\n subscription: {\n total: 1,\n status: 'INCOMPLETE_EXPIRED',\n price: null,\n card: null,\n },\n plan: {\n id: 'e147a026-81d7-11eb-afc8-02f048730623',\n name: 'BUSINESS',\n description: 'business',\n product: {\n id: 'b999e047-5532-11eb-8872-063ce187bcd7',\n name: 'remote.it',\n description: 'remote.it',\n },\n },\n },\n {\n id: '4a5ed500-ef07-4a98-be11-BUSINESS',\n created: new Date('2021-03-12T05:44:32.421Z'),\n updated: new Date('2021-03-12T05:44:32.421Z'),\n expiration: null,\n valid: true,\n quantity: null,\n custom: false,\n subscription: {\n total: 1,\n status: 'PAST_DUE',\n price: null,\n card: null,\n },\n plan: {\n id: 'e147a026-81d7-11eb-afc8-02f048730623',\n name: 'BUSINESS',\n description: 'business',\n product: {\n id: 'b999e047-5532-11eb-8872-063ce187bcd7',\n name: 'remote.it',\n description: 'remote.it',\n },\n },\n },\n {\n id: '4a5ed500-ef07-4a98-be11-35ab8fa69a5f',\n created: new Date('2021-03-12T05:44:32.421Z'),\n updated: new Date('2021-04-28T17:08:25.000Z'),\n expiration: null,\n valid: true,\n quantity: null,\n custom: false,\n subscription: {\n total: 1,\n status: 'PAST_DUE',\n price: null,\n card: null,\n },\n plan: {\n id: 'b44f92a6-a7b9-11eb-b094-02a962787033',\n name: 'ENTERPRISE',\n description: 'enterprise',\n product: {\n id: 'b999e047-5532-11eb-8872-063ce187bcd7',\n name: 'remote.it',\n description: 'remote.it',\n },\n },\n },\n ],\n limits: [],\n}\n","import network from './Network'\nimport { dispatch } from '../store'\n\nclass CloudSync {\n initialized = false\n\n log(...args) {\n console.log(`%c${args[0]}`, 'color:magenta;font-weight:bold', ...args.slice(1))\n }\n\n init() {\n if (this.initialized) return\n this.initialized = true\n network.on('connect', async () => {\n await dispatch.devices.expire()\n this.all()\n })\n }\n\n reset() {\n this.initialized = false\n network.off('connect', this.all)\n }\n\n async call(methods: Methods, parallel?: boolean, spinner: boolean = true) {\n if (spinner) await dispatch.ui.set({ fetching: true })\n\n if (parallel) await Promise.all(methods.map(method => method()))\n else for (const method of methods) await method()\n\n if (spinner) await dispatch.ui.set({ fetching: false })\n }\n\n async cancel() {\n await dispatch.ui.set({ fetching: false })\n }\n\n async core(spinner: boolean = false) {\n // Account first because organization depends on it\n await this.call([dispatch.accounts.fetch], false, spinner)\n await this.call(\n [\n dispatch.user.fetch,\n dispatch.organization.fetch,\n dispatch.sessions.fetch,\n dispatch.tags.fetch,\n dispatch.plans.fetch,\n dispatch.announcements.fetch,\n dispatch.applicationTypes.fetch,\n ],\n true,\n spinner\n )\n }\n\n all = async () => {\n console.log('CLOUD SYNC ALL')\n await this.core()\n await dispatch.devices.set({ from: 0 })\n await this.call([\n dispatch.files.fetch,\n dispatch.jobs.fetch,\n dispatch.devices.fetchList,\n dispatch.networks.fetch,\n dispatch.connections.fetch,\n dispatch.files.fetch,\n ])\n }\n}\n\nexport default new CloudSync()\n","import { State } from '../store'\nimport { Duration } from 'luxon'\nimport { testData } from '../test/licensing'\nimport { createModel } from '@rematch/core'\nimport { AxiosResponse } from 'axios'\nimport {\n graphQLSubscribe,\n graphQLUnsubscribe,\n graphQLUpdateSubscription,\n graphQLCreditCard,\n} from '../services/graphQLMutation'\nimport {\n selectLicensesWithLimits,\n selectRemoteitLicense,\n selectLimits,\n selectLicenses,\n} from '../selectors/organizations'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { graphQLFetchPlans } from '../services/graphQLRequest'\nimport { getDevices } from '../selectors/devices'\nimport { RootModel } from '.'\nimport cloudSync from '../services/CloudSync'\nimport humanize from 'humanize-duration'\n\ntype ILicenseLookup = { productId: string; platform?: number }\n\nexport const REMOTEIT_PRODUCT_ID = 'b999e047-5532-11eb-8872-063ce187bcd7'\nexport const AWS_PRODUCT_ID = '55d9e884-05fd-11eb-bda8-021f403e8c27'\nexport const PERSONAL_PLAN_ID = 'e147a026-81d7-11eb-afc8-02f048730623'\nexport const PROFESSIONAL_PLAN_ID = '6b5e1e70-045d-11ec-8a08-02ea65a4da2d'\nexport const BUSINESS_PLAN_ID = '85ce6edf-9e70-11ec-b51a-0a63867cb0b9'\nexport const FLEET_PLAN_ID = 'ce579369-9deb-11ee-9f81-0a5b07a7ad3f'\nexport const ENTERPRISE_PLAN_ID = 'b44f92a6-a7b9-11eb-b094-02a962787033'\nexport const RESELLER_PLAN_ID = '4c5ea4d8-d10a-11ee-9f81-0a5b07a7ad3f'\n\nexport const LicenseLookup: ILicenseLookup[] = [\n {\n productId: REMOTEIT_PRODUCT_ID,\n platform: undefined,\n },\n {\n productId: AWS_PRODUCT_ID,\n platform: 1185,\n },\n]\n\nconst defaultLicense = LicenseLookup[0]\n\nexport const planDetails = {\n [PERSONAL_PLAN_ID]: {\n description: 'For non-commercial usage only',\n features: [\n '5 Devices',\n '7 days of activity logs',\n 'Limited API usage',\n 'Web/Desktop/Mobile apps',\n 'SSO with Google',\n ],\n },\n [PROFESSIONAL_PLAN_ID]: {\n description: 'Basic commercial use plan',\n note: 'when billed annually',\n features: [\n '3 Devices & 1 user per license',\n 'Commercial usage',\n 'Organization Management (basic roles)',\n 'Basic device tagging',\n 'Virtual Networks',\n '30 days of activity logs',\n 'Limited API usage',\n 'Forum support',\n ],\n },\n [BUSINESS_PLAN_ID]: {\n description: 'Simplifies network management',\n note: 'when billed annually',\n features: [\n '10 Devices & 1 user per license',\n 'Organization Management including custom roles',\n 'Virtual networks with custom roles, enhanced device tagging',\n 'Persistent Public URLs without the splash screen',\n 'SSO with SAML or select identity providers',\n 'Scripting',\n '1 year of activity logs',\n 'Unrestricted API usage',\n 'Email support',\n ],\n },\n [FLEET_PLAN_ID]: {\n description: 'Device centric business plan',\n note: 'discounted monthly price',\n features: [\n '100 devices per license',\n '5 user accounts',\n 'Add additional devices in 100 device increments',\n 'Discounted monthly pricing matches annual pricing',\n 'Includes all Business Plan features',\n ],\n },\n [RESELLER_PLAN_ID]: {\n description: 'Authorized Remote.It reseller plan',\n caption: 'Partner pricing',\n note: 'For changes, and support:',\n features: [\n '25 Devices',\n '10 user accounts',\n 'Customer account management',\n 'Exclusive reseller pricing',\n 'Exclusive Reseller support',\n ],\n },\n [ENTERPRISE_PLAN_ID]: {\n description: 'Custom plan for large scale deployment',\n features: [\n 'Volume based discounts for users and devices',\n 'Statement of Work based projects: development, support, deployment & onboarding',\n 'Custom activity log retention',\n 'Additional support options: Slack, phone',\n 'Provision of customer specific environments: custom portals, dedicated proxy, named device URLs, and more',\n 'Fixed permanent named endpoint URLs',\n 'Support for embedded devices and custom device packages',\n 'Large-scale solutions for unique and custom use-cases',\n ],\n },\n}\n\ntype IPlans = {\n initialized: boolean\n plans: IPlan[]\n updating?: string\n purchasing?: string\n informed: boolean\n tests: {\n license: boolean\n limit: boolean\n unlicensed: boolean\n licenses: ILicense[]\n limits: ILimit[]\n }\n}\n\nconst defaultState: IPlans = {\n initialized: false,\n plans: [],\n updating: undefined,\n purchasing: undefined,\n informed: false,\n tests: testData,\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async restore(_: void, state) {\n dispatch.plans.set({ purchasing: undefined, updating: undefined })\n },\n\n async fetch() {\n const result = await graphQLFetchPlans()\n if (result === 'ERROR') return\n await dispatch.plans.parse(result)\n },\n\n async parse(gqlResponse: AxiosResponse | void, state) {\n if (!gqlResponse) return\n const data = gqlResponse?.data?.data\n await dispatch.plans.set({\n plans: data.plans,\n updating: undefined,\n initialized: true,\n })\n },\n\n async subscribe(form: IPurchase, state) {\n dispatch.plans.set({ purchasing: form.planId })\n const result = await graphQLSubscribe(form)\n\n if (result === 'ERROR' || !result?.data?.data?.createSubscription) {\n dispatch.ui.set({ errorMessage: 'Checkout failed, please contact support.' })\n dispatch.plans.set({ purchasing: undefined })\n return\n }\n\n const checkout = result?.data?.data?.createSubscription\n console.log('PURCHASE', checkout)\n if (checkout?.url) window.location.href = checkout.url\n else {\n dispatch.ui.set({ errorMessage: 'Error purchasing license' })\n dispatch.plans.set({ purchasing: undefined })\n }\n },\n\n async updateSubscription(form: IPurchase) {\n if (!form.priceId) {\n dispatch.ui.set({ errorMessage: 'Plan selection missing price' })\n return\n }\n dispatch.plans.set({ purchasing: form.planId })\n const result = await graphQLUpdateSubscription(form)\n if (result !== 'ERROR') {\n const success = result?.data?.data?.updateSubscription\n if (!success) {\n dispatch.ui.set({ errorMessage: 'Subscription update failed, please contact support.' })\n }\n }\n // event should come from ws and cause the update, otherwise:\n setTimeout(() => cloudSync.all(), 20 * 1000)\n console.log('UPDATE SUBSCRIPTION', form)\n dispatch.plans.set({ purchasing: undefined })\n },\n\n async unsubscribe({ planId, licenseId }: IPurchase) {\n dispatch.plans.set({ purchasing: planId })\n const result = await graphQLUnsubscribe(licenseId)\n if (result === 'ERROR' || !result?.data?.data?.cancelSubscription) {\n dispatch.ui.set({ errorMessage: 'Subscription cancellation failed, please contact support.' })\n dispatch.plans.set({ purchasing: undefined })\n return\n }\n dispatch.devices.fetchList()\n dispatch.plans.set({ purchasing: undefined })\n console.log('UNSUBSCRIBE')\n },\n\n async updateCreditCard(last: string | undefined) {\n dispatch.plans.set({ updating: last })\n const result = await graphQLCreditCard()\n if (result !== 'ERROR') {\n const card = result?.data?.data?.updateCreditCard\n console.log('UPDATE CREDIT CARD', card)\n if (card?.url) window.location.href = card.url\n }\n },\n\n async updated(event: { owner?: IUserRef; planName?: string; quantity?: number }, state) {\n const who = event.owner?.id === state.user.id ? 'Your' : `${event.owner?.email}'s`\n await cloudSync.call([dispatch.plans.fetch, dispatch.organization.fetch, dispatch.devices.fetchList], true)\n dispatch.plans.set({ purchasing: undefined, updating: undefined })\n dispatch.ui.set({ successMessage: `${who} ${event.planName?.toLowerCase()} subscription updated.` })\n },\n\n async testServiceLicensing(_: void, state) {\n const states: ILicenseTypes[] = [\n 'UNKNOWN',\n 'EVALUATION',\n 'LICENSED',\n 'UNLICENSED',\n 'NON_COMMERCIAL',\n 'EXEMPT',\n 'LEGACY',\n ]\n const devices = getDevices(state)\n const updated = devices.map((device, index) => ({\n ...device,\n services: device.services.map(service => ({\n ...service,\n license: states[index % 6],\n })),\n }))\n dispatch.accounts.setDevices({ devices: updated })\n },\n }),\n reducers: {\n reset(state: IPlans) {\n state = { ...defaultState }\n return state\n },\n set(state: IPlans, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nexport function isPersonal(state: State) {\n const license = selectRemoteitLicense(state)\n return license?.plan.id === PERSONAL_PLAN_ID\n}\n\nexport function getInformed(state: State) {\n return state.plans.tests.limit ? false : state.plans.informed\n}\n\nexport function lookupLicenseProductId(instance?: IInstance) {\n let lookup = LicenseLookup.find(l => l.platform === (instance as IDevice)?.targetPlatform)\n if (!lookup) lookup = defaultLicense\n return lookup.productId\n}\n\nexport function selectFullLicense(state: State, { productId, license }: { productId?: string; license?: ILicense }) {\n license = license || selectLicenses(state).find(l => l.plan.product.id === productId)\n const limits = selectLimits(state)\n const informed = getInformed(state)\n\n const serviceLimit = limits.find(l => l.name === 'aws-services')\n const evaluationLimit = limits.find(l => l.name === 'aws-evaluation')\n\n if (!license) return {}\n let noticeType: string = license.subscription?.status || ''\n let warnDate = new Date()\n warnDate.setDate(warnDate.getDate() + 3) // warn 3 days in advance\n\n if (license.expiration && warnDate > license.expiration && license.plan.name === 'TRIAL')\n noticeType = 'EXPIRATION_WARNING'\n if (serviceLimit?.value !== null && serviceLimit?.actual > serviceLimit?.value) noticeType = 'LIMIT_EXCEEDED'\n if (!license.valid) noticeType = 'EXPIRED'\n\n return {\n noticeType,\n license,\n informed,\n limits,\n serviceLimit,\n evaluationLimit,\n }\n}\n\nexport function selectOwnLicenses(state: State) {\n return selectLicensesWithLimits(state, state.auth.user?.id)\n}\n\nexport function selectLicenseIndicator(state: State) {\n const accountId = selectActiveAccountId(state)\n const informed = getInformed(state)\n if (informed) return 0\n let indicators = 0\n const { licenses } = selectLicensesWithLimits(state, accountId)\n for (var license of licenses) {\n const { noticeType } = selectFullLicense(state, { license })\n if (noticeType && noticeType !== 'ACTIVE') indicators++\n }\n return indicators\n}\n\nexport function limitDays(value?: string) {\n return value ? Duration.fromISO(value).as('days') : 0\n}\n\nexport function humanizeDays(value?: string) {\n const milliseconds = limitDays(value) * 8.64e7\n return humanize(milliseconds, { round: true, largest: 1 })\n}\n\nexport function deviceUserTotal(quantity: number, plan?: IPlan) {\n const defaults = { devices: null, users: null }\n if (!plan) return defaults\n const users = plan.limits?.find(l => l.name === 'org-users')\n const devices = plan.limits?.find(l => l.name === 'iot-devices')\n if (!users || !devices) return defaults\n return { devices: devices.value + quantity * devices.scale, users: users.value + quantity * users.scale }\n}\n","import { createSelector } from 'reselect'\nimport { REMOTEIT_PRODUCT_ID } from '../models/plans'\nimport {\n getUser,\n getOrganizations,\n getPlans,\n getLimitsOverride,\n getPlansTests,\n optionalCustomerId,\n optionalSecondParam,\n} from './state'\nimport { selectActiveAccountId, isUserAccount, selectActiveUser } from './accounts'\nimport { defaultState, canMemberView, DEFAULT_ROLE } from '../models/organization'\nimport { selectMembership } from './accounts'\n\nexport const selectOrganization = createSelector(\n [selectActiveAccountId, getOrganizations, selectMembership, getUser],\n (accountId, organizations, myMembership, user) => {\n const organization = organizations[accountId] || defaultState\n const membership: IOrganizationMember = { ...myMembership, user, organizationId: organization.id }\n return {\n ...organization,\n membership,\n }\n }\n)\n\nexport const selectOrganizationName = createSelector(\n [selectOrganization],\n (organization): string => organization.name || 'Unknown'\n)\n\nexport const selectOrganizationReseller = createSelector([selectOrganization], organization => {\n return organization.reseller\n})\n\nexport const selectResellerRef = createSelector([selectOrganizationReseller, getUser], (reseller, user) => {\n return reseller || user.reseller\n})\n\nexport const selectCustomer = createSelector(\n [selectOrganizationReseller, optionalSecondParam],\n (reseller, customerId) => {\n return reseller?.customers.find(c => c.id === customerId)\n }\n)\n\nexport const selectRole = createSelector([selectOrganization, selectMembership], (organization, membership) => {\n return organization.roles?.find(r => r.id === membership.roleId) || DEFAULT_ROLE\n})\n\nexport const selectMembersWithAccess = createSelector(\n [selectOrganization, optionalSecondParam],\n (organization, instance?: IInstance) =>\n organization.members.filter(m => canMemberView(organization.roles, m, instance)) || []\n)\n\nexport const selectRemoteitPlans = createSelector([getPlans], plans => {\n return plans.filter(p => p.product.id === REMOTEIT_PRODUCT_ID)\n})\n\nexport const selectLicenses = createSelector(\n [getPlansTests, selectOrganization, optionalCustomerId],\n (tests, organization, customerId): ILicense[] => {\n if (tests.license) return tests.licenses\n if (organization.reseller && customerId) {\n const customer = organization.reseller.customers.find(c => c.id === customerId)\n return customer ? [customer.license] : []\n }\n return organization.licenses\n }\n)\n\nexport const selectRemoteitLicense = createSelector(\n [selectLicenses],\n (licenses): ILicense | null => licenses.find(l => l.plan.product.id === REMOTEIT_PRODUCT_ID) || null\n)\n\nexport const selectPlan = createSelector([selectRemoteitPlans, selectRemoteitLicense], (plans, license) => {\n return plans.find(plan => plan.id === license?.plan?.id)\n})\n\nexport const selectLimits = createSelector([selectOrganization], (organization): ILimit[] => {\n return organization.limits || []\n})\n\nexport const selectLimit = createSelector(\n [selectLimits, optionalSecondParam],\n (limits, limitName): ILimit | undefined => limits.find(limit => limit.name === limitName)\n)\n\nexport const selectLimitsLookup = createSelector(\n [selectLimits, isUserAccount, getLimitsOverride],\n (baseLimits, isUserAccount, limitsOverride): ILookup => {\n let result: ILookup = {}\n baseLimits.forEach(l => {\n result[l.name] = limitsOverride[l.name] === undefined || !isUserAccount ? l.value : limitsOverride[l.name]\n })\n return result\n }\n)\n\nexport const selectLicensesWithLimits = createSelector([selectLicenses, selectLimits], (licenses, limits) => {\n return {\n licenses: licenses.map(license => ({\n ...license,\n limits: limits.filter(limit => limit.license?.id === license.id),\n })),\n limits: limits.filter(limit => !limit.license),\n }\n})\n\nexport const selectPermissions = createSelector(\n [selectMembership, selectOrganization],\n (membership, organization): IPermission[] => {\n return organization.roles.find(r => r.id === membership.roleId)?.permissions || []\n }\n)\n\nexport const selectOwner = createSelector(\n [selectActiveUser, selectRemoteitLicense],\n (user, license): IOrganizationMember | undefined => {\n return {\n created: user.created || new Date(),\n roleId: 'OWNER',\n license: license?.plan.commercial ? 'LICENSED' : 'UNLICENSED',\n organizationId: user.id,\n user: {\n id: user.id,\n email: user.email,\n },\n }\n }\n)\n\nexport const selectAvailableUsers = createSelector(\n [state => selectLimit(state, undefined, 'org-users')],\n (limit): number => Math.max(limit?.value - limit?.actual || -1, 0)\n)\n","import { createModel } from '@rematch/core'\nimport {\n graphQLSetOrganization,\n graphQLRemoveOrganization,\n graphQLSetMembers,\n graphQLRemoveMembers,\n graphQLAddCustomer,\n graphQLRemoveCustomer,\n graphQLSetIdentityProvider,\n graphQLCreateRole,\n graphQLUpdateRole,\n graphQLRemoveRole,\n} from '../services/graphQLMutation'\nimport { getAccountIds } from './accounts'\nimport { graphQLFetchOrganizations, graphQLFetchGuests, graphQLGetResellerReportUrl } from '../services/graphQLRequest'\nimport { selectOrganization, selectOrganizationReseller } from '../selectors/organizations'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { AxiosResponse } from 'axios'\nimport { RootModel } from '.'\nimport { State } from '../store'\n\nexport const PERMISSION: ILookup<{\n name: string\n description: string\n icon: string\n system?: boolean\n user?: boolean\n hidden?: boolean\n}> = {\n VIEW: { name: 'View', description: 'See devices and their current state', icon: 'eye', system: true },\n CONNECT: { name: 'Connect', description: 'Connect to device services', icon: 'arrow-right' },\n SCRIPTING: { name: 'Script', description: 'View and run device scripts', icon: 'scripting', hidden: false },\n MANAGE: {\n name: 'Manage',\n description: 'Edit, delete, transfer and share devices and networks',\n icon: 'pencil',\n },\n ADMIN: {\n name: 'Administer',\n description: 'Manage organization tags, scripts, members and device registrations',\n icon: 'user-pen',\n user: true,\n },\n}\n\nexport const DEFAULT_ROLE: IOrganizationRole = {\n id: '',\n name: '',\n tag: { operator: 'ANY', values: [] },\n permissions: ['VIEW', 'CONNECT'],\n access: 'NONE',\n}\n\nexport const DEFAULT_RESELLER: IReseller = {\n name: '',\n email: '',\n logoUrl: '',\n plans: [],\n customers: [],\n}\n\nexport const SYSTEM_ROLES: IOrganizationRole[] = [\n {\n id: 'OWNER',\n name: 'Owner',\n system: true,\n permissions: ['VIEW', 'MANAGE', 'CONNECT', 'SCRIPTING', 'ADMIN'],\n disabled: true,\n access: 'ALL',\n },\n {\n id: 'GUEST',\n name: 'Guest',\n system: true,\n permissions: ['VIEW', 'CONNECT'],\n disabled: true,\n access: 'NONE',\n },\n]\n\nexport type IOrganizationState = {\n id: string\n name: string\n created?: Date\n reseller: null | IReseller\n licenses: ILicense[]\n limits: ILimit[]\n guests: IGuest[]\n members: IOrganizationMember[]\n roles: IOrganizationRole[]\n domain?: string\n identityProvider?: {\n type: string\n clientId: string\n issuer: string\n }\n providers: null | IOrganizationProvider[]\n verificationCNAME?: string\n verificationValue?: string\n verified: boolean\n guestsLoaded: boolean\n}\n\nexport const defaultState: IOrganizationState = {\n id: '',\n name: '',\n domain: undefined,\n reseller: null,\n identityProvider: undefined,\n providers: null,\n verificationCNAME: undefined,\n verificationValue: undefined,\n verified: false,\n created: undefined,\n members: [],\n roles: [...SYSTEM_ROLES],\n licenses: [],\n limits: [],\n guests: [],\n guestsLoaded: false,\n}\n\ntype IOrganizationAccountState = {\n initialized: boolean\n updating: boolean\n accounts: ILookup\n}\n\nconst defaultAccountState: IOrganizationAccountState = {\n initialized: false,\n updating: false,\n accounts: {},\n}\n\nexport default createModel()({\n state: { ...defaultAccountState },\n effects: dispatch => ({\n async fetch(_: void, state) {\n const ids: string[] = getAccountIds(state)\n const result = await graphQLFetchOrganizations(ids)\n if (result === 'ERROR') return\n const accounts = await dispatch.organization.parse({ result, ids })\n console.log('ORGANIZATION FETCH', accounts)\n if (accounts) await dispatch.organization.set({ accounts, initialized: true })\n else await dispatch.organization.clearActive()\n },\n\n async fetchGuests(_: void, state) {\n const accountId = selectActiveAccountId(state)\n const result = await graphQLFetchGuests(accountId)\n if (result === 'ERROR') return\n const guests = parseGuests(result)\n console.log('LOAD GUESTS', accountId, guests)\n await dispatch.organization.setActive({ guests, guestsLoaded: true, id: accountId })\n },\n\n async parse({ result, ids }: { result: AxiosResponse | undefined; ids: string[] }) {\n const data = result?.data?.data?.login\n let orgs: IOrganizationAccountState['accounts'] = {}\n ids.forEach((id, index) => {\n if (!data?.[`_${index}`]) return\n const { organization, licenses, limits } = data[`_${index}`]\n orgs[id] = parseOrganization(organization)\n orgs[id].licenses = licenses?.map(l => parseLicense(l))\n orgs[id].limits = limits\n })\n return orgs\n },\n\n async setOrganization(params: IOrganizationSettings, state) {\n let organization = selectOrganization(state)\n await dispatch.organization.setActive({ ...params, id: organization.id || state.auth.user?.id })\n const result = await graphQLSetOrganization({ ...params, accountId: organization.id })\n if (result !== 'ERROR') {\n if (!organization.id) dispatch.ui.set({ successMessage: 'Your organization has been created.' })\n }\n await dispatch.organization.fetch()\n },\n\n async setIdentityProvider(params: IIdentityProviderSettings, state) {\n dispatch.organization.set({ updating: true })\n const result = await graphQLSetIdentityProvider({ ...params, accountId: selectActiveAccountId(state) })\n if (result !== 'ERROR') {\n dispatch.ui.set({\n successMessage: params.enabled ? `${params.type} enabled.` : `${params.type} disabled.`,\n })\n } else {\n dispatch.ui.set({\n errorMessage: `${params.type} update failed, please validate your form data.`,\n })\n }\n await dispatch.organization.fetch()\n dispatch.organization.set({ updating: false })\n },\n\n async setMembers(members: IOrganizationMember[] = [], state) {\n const organization = selectOrganization(state)\n let updated = [...organization.members]\n\n members.forEach(m => {\n const index = updated.findIndex(u => u.user.email === m.user.email)\n if (index > -1) updated[index] = m\n else updated.push(m)\n })\n await dispatch.organization.setActive({ members: updated })\n\n const action = updated.length > organization.members.length ? 'added' : 'updated'\n const member = members[0]\n const result = await graphQLSetMembers(\n members.map(member => member.user.email),\n organization.id,\n member.roleId,\n member.license\n )\n if (result !== 'ERROR') {\n dispatch.ui.set({\n successMessage:\n members.length > 1\n ? `${members.length} members have been ${action}.`\n : `The member “${members[0].user.email}” has been ${action}.`,\n })\n }\n dispatch.organization.fetch()\n },\n\n async removeMember(member: IOrganizationMember, state) {\n const organization = selectOrganization(state)\n const result = await graphQLRemoveMembers([member.user.email], organization.id)\n if (result !== 'ERROR') {\n dispatch.organization.setActive({\n members: organization.members.filter(m => m.user.email !== member.user.email),\n })\n dispatch.ui.set({ successMessage: `Successfully removed “${member.user?.email}”.` })\n }\n },\n\n async removeOrganization(_: void) {\n const result = await graphQLRemoveOrganization()\n if (result !== 'ERROR') {\n dispatch.organization.clearActive()\n dispatch.ui.set({ successMessage: `Your organization has been removed.` })\n }\n },\n\n async setRole(role: IOrganizationRole, state) {\n let roles = [...selectOrganization(state).roles]\n const index = roles.findIndex(r => r.id === role.id)\n const permissions = Object.keys(PERMISSION) as IPermission[]\n const data = {\n id: role.id,\n name: role.name,\n grant: role.permissions,\n revoke: permissions.filter(p => !role.permissions.includes(p)),\n tag: role.tag,\n access: role.access,\n accountId: selectActiveAccountId(state),\n }\n\n let result\n if (index > -1) {\n roles[index] = role\n result = await graphQLUpdateRole(data)\n } else {\n result = await graphQLCreateRole(data)\n if (result !== 'ERROR') role.id = result?.data?.data?.createRole?.id\n roles.push(role)\n dispatch.ui.set({ redirect: `/organization/roles/${role.id}` })\n }\n\n if (result === 'ERROR') {\n dispatch.organization.fetch()\n return\n }\n\n dispatch.ui.set({\n successMessage: index > -1 ? `Successfully updated ${role.name}.` : `Successfully added ${role.name}.`,\n })\n\n await dispatch.organization.setActive({ roles })\n },\n\n async removeRole(role: IOrganizationRole, state) {\n let roles = [...selectOrganization(state).roles]\n const index = roles.findIndex(r => r.id === role.id)\n if (index > -1) roles.splice(index, 1)\n const result = await graphQLRemoveRole(role.id, selectActiveAccountId(state))\n\n if (result === 'ERROR') {\n dispatch.organization.fetch()\n return\n }\n\n dispatch.ui.set({ successMessage: `Successfully removed “${role.name}”.` })\n dispatch.organization.setActive({ roles })\n },\n\n async clearActive() {\n dispatch.organization.setActive({ ...defaultState })\n },\n\n async setReseller(params: Partial, state) {\n const previousReseller = selectOrganizationReseller(state) || { ...DEFAULT_RESELLER }\n const reseller = { ...previousReseller, ...params }\n dispatch.organization.setActive({ reseller })\n await dispatch.organization.setOrganization({ ...params })\n },\n\n async addCustomer({ id, emails }: { id: string; emails: string[] }) {\n const result = await graphQLAddCustomer(emails, id)\n if (result === 'ERROR') return\n\n if (!result?.data?.data?.addCustomer) {\n dispatch.ui.set({\n errorMessage:\n 'One of the customers couldn’t be added. \\\n Users must not have an existing subscription or belong to another reseller.',\n })\n return\n }\n\n await dispatch.ui.set({\n successMessage:\n emails.length > 1\n ? `Successfully added ${emails.length} customers.`\n : `Successfully added “${emails[0]}” as a customer.`,\n })\n\n await dispatch.organization.fetch()\n },\n\n async removeCustomer({ id, emails }: { id: string; emails: string[] }) {\n const result = await graphQLRemoveCustomer(emails, id)\n if (result === 'ERROR') return\n\n if (!result?.data?.data?.removeCustomer) {\n dispatch.ui.set({\n errorMessage: 'There was a problem removing a customer. Please contact support if the issue persists',\n })\n return\n }\n\n await dispatch.ui.set({\n successMessage:\n emails.length > 1\n ? `Successfully removed ${emails.length} customers.`\n : `Successfully removed “${emails[0]}” as a customer.`,\n })\n\n await dispatch.organization.fetch()\n },\n\n async resellerReportUrl(_: void, state): Promise {\n const accountId = selectActiveAccountId(state)\n const response = await graphQLGetResellerReportUrl(accountId)\n console.log('RESPONSE', response)\n if (response === 'ERROR') {\n dispatch.ui.set({ errorMessage: 'Failed to get reseller report URL' })\n return\n }\n const result = response?.data?.data?.login?.account?.organization?.reseller\n console.log('RESELLER REPORT URL', result.reportUrl)\n return result?.reportUrl\n },\n\n async setActive(params: Partial, state) {\n const id = params.id || selectActiveAccountId(state)\n let org = { ...selectOrganization(state, id) }\n Object.keys(params).forEach(key => (org[key] = params[key]))\n const accounts = { ...state.organization.accounts }\n accounts[id] = org\n dispatch.organization.set({ accounts })\n },\n }),\n reducers: {\n set(state: IOrganizationAccountState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n reset(state: IOrganizationAccountState) {\n state = { ...defaultAccountState }\n return state\n },\n },\n})\n\nfunction parseGuests(result: AxiosResponse | undefined) {\n const guest = result?.data?.data?.login?.account?.guest || []\n const parsed: IOrganizationState['guests'] = guest.map(g => ({\n id: g.user.id,\n email: g.user.email || g.user.id,\n deviceIds: g.devices.map(d => d.id),\n networkIds: g.networks.map(n => n.id),\n }))\n return parsed\n}\n\nexport function parseOrganization(data: any): IOrganizationState {\n if (!data) return { ...defaultState }\n return {\n ...defaultState,\n ...data,\n // verified: true, // for development\n // identityProvider { // for development\n // type:\n // clientId\n // issuer\n // },\n created: new Date(data.created),\n reseller: data.reseller && {\n ...DEFAULT_RESELLER,\n ...data.reseller,\n customers: data.reseller.licenses.map((l): ICustomer => {\n const { user, ...license } = l\n return {\n id: user.id,\n email: user.email,\n created: user.created,\n reseller: user.reseller.email,\n license: parseLicense(license),\n limits: user.limits,\n }\n }),\n },\n members: [\n ...data.members.map(m => ({\n ...m,\n roleId: m.customRole.id,\n roleName: m.customRole.name,\n created: new Date(m.created),\n user: {\n email: m.user.email || '',\n id: m.user.id || '',\n },\n })),\n ],\n roles: [...defaultState.roles, ...data.roles],\n }\n}\n\nexport function parseLicense(data): ILicense {\n return {\n ...data,\n // custom: true, // for development\n // plan: {\n // ...data.plan,\n // billing: true, // for development\n // },\n created: new Date(data.created),\n updated: new Date(data.updated),\n expiration: data.expiration && new Date(data.expiration),\n subscription: data.subscription && {\n ...data.subscription,\n card: data.subscription.card && {\n ...data.subscription.card,\n expiration: data.subscription.card.expiration && new Date(data.subscription.card.expiration),\n },\n },\n }\n}\n\nexport function getOwnOrganization(state: State) {\n const id = state.auth.user?.id || ''\n return selectOrganization(state, id)\n}\n\nexport function canMemberView(roles: IOrganizationRole[], member: IOrganizationMember, instance?: IInstance) {\n if (!instance) return true\n const role = roles.find(r => r.id === member?.roleId)\n return canRoleView(role, instance)\n}\n\nexport function canRoleView(role?: Partial, instance?: IInstance) {\n if (instance?.shared) return false\n if (!role?.permissions?.includes('VIEW')) return false\n if (role?.tag && instance?.tags) return canViewByTags(role.tag, instance.tags)\n return true\n}\n\nexport function canViewByTags(filter: ITagFilter, tags: ITag[]) {\n const names = tags.map(t => t.name)\n if (filter.operator === 'ANY') {\n return filter.values.some(tag => names.includes(tag))\n } else if (filter.operator === 'ALL') {\n return filter.values.every(tag => names.includes(tag))\n }\n return true\n}\n","import browser from '../services/browser'\nimport structuredClone from '@ungap/structured-clone'\nimport { State } from '../store'\nimport { createModel } from '@rematch/core'\nimport { selectConnection } from '../selectors/connections'\nimport { selectActiveAccountId, selectActiveUser } from '../selectors/accounts'\nimport { selectNetworks, selectNetworkByService } from '../selectors/networks'\nimport { IOrganizationState, canMemberView, canViewByTags, canRoleView } from '../models/organization'\nimport { graphQLFetchNetworkSingle, graphQLPreloadNetworks } from '../services/graphQLRequest'\nimport { selectById, selectVisibleDevices } from '../selectors/devices'\nimport {\n graphQLAddNetwork,\n graphQLDeleteNetwork,\n graphQLUpdateNetwork,\n graphQLSetConnection,\n graphQLRemoveConnection,\n graphQLAddNetworkShare,\n graphQLRemoveNetworkShare,\n} from '../services/graphQLMutation'\nimport { AxiosResponse } from 'axios'\nimport { RootModel } from '.'\n\nexport const DEFAULT_ID = 'local'\nexport const DEFAULT_NETWORK: INetwork = {\n id: '',\n name: '',\n cloud: false,\n shared: false,\n loaded: false,\n accountId: '',\n owner: { id: '', email: '' },\n permissions: ['VIEW', 'CONNECT', 'MANAGE', 'ADMIN'],\n connectionNames: {},\n serviceIds: [],\n access: [],\n tags: [],\n icon: 'chart-network',\n}\n\nconst defaultLocalNetwork: INetwork = {\n ...DEFAULT_NETWORK,\n id: DEFAULT_ID,\n name: 'Active',\n permissions: [],\n shared: false,\n icon: 'network-wired',\n}\n\nconst defaultCloudNetwork: INetwork = {\n ...DEFAULT_NETWORK,\n id: DEFAULT_ID,\n name: 'Cloud Proxy',\n permissions: [],\n icon: 'cloud',\n}\n\nexport const recentNetwork: INetwork = {\n ...DEFAULT_NETWORK,\n id: 'recent',\n name: 'Recent',\n permissions: [],\n icon: 'clock-rotate-left',\n}\n\nexport type addConnectionProps = {\n serviceId: string\n networkId: string\n port?: number\n name?: string\n enabled?: boolean\n}\n\ntype INetworksAccountState = {\n initialized: boolean\n loading: boolean\n all: ILookup\n default: INetwork\n}\n\nconst defaultAccountState: INetworksAccountState = {\n initialized: false,\n loading: false,\n default: defaultCloudNetwork,\n all: {},\n}\n\nexport default createModel()({\n state: { ...defaultAccountState },\n effects: dispatch => ({\n async init(_: void, state) {\n dispatch.networks.set({ default: defaultNetwork(state) })\n },\n\n async fetch(fetchAll: boolean | void, state) {\n const accountId = selectActiveAccountId(state)\n\n dispatch.networks.set({ loading: true })\n const response = await graphQLPreloadNetworks(accountId)\n\n if (response === 'ERROR') return\n\n const networks = await dispatch.networks.parse({ response, accountId })\n await dispatch.networks.preloadNetworkDevices({\n gqlNetworks: response?.data?.data?.login?.account?.networks,\n fetchAll: !!fetchAll,\n accountId,\n })\n await dispatch.networks.setNetworks({ networks, accountId })\n\n console.log('LOADED NETWORKS', networks)\n dispatch.networks.set({ loading: false, initialized: true })\n },\n\n async fetchAll() {\n await dispatch.networks.fetch(true)\n },\n\n async fetchSingle({ network, redirect }: { network: INetwork; redirect?: string }, state) {\n if (!network || !network.cloud) return\n\n const accountId = selectActiveAccountId(state)\n await dispatch.devices.set({ fetching: true, accountId })\n const gqlResponse = await graphQLFetchNetworkSingle(network.id)\n\n if (gqlResponse === 'ERROR') {\n if (redirect) dispatch.ui.set({ redirect })\n return\n }\n\n const gqlNetworks = [gqlResponse?.data?.data?.login?.network]\n await dispatch.networks.preloadNetworkDevices({ gqlNetworks, accountId, fetchAll: true })\n await dispatch.networks.setNetwork({ ...network, loaded: true })\n\n dispatch.devices.set({ fetching: false, accountId })\n },\n\n async fetchIfEmpty(_: void, state) {\n const accountId = selectActiveAccountId(state)\n if (!state.networks.all[accountId]) {\n await dispatch.networks.set({ initialized: false })\n await dispatch.networks.fetch()\n await dispatch.networks.set({ initialized: true })\n }\n },\n\n async preloadNetworkDevices(props: { gqlNetworks?: any[]; accountId: string; fetchAll?: boolean }, state) {\n const { gqlNetworks, accountId, fetchAll } = props\n if (!gqlNetworks) return\n\n const allDevices = new Set(fetchAll ? [] : selectVisibleDevices(state, accountId).map(device => device.id))\n\n const ids = new Set()\n for (const network of gqlNetworks) {\n for (const connection of network.connections) {\n const id = connection.service?.device?.id\n if (!allDevices.has(id)) ids.add(id)\n }\n }\n\n if (ids.size) {\n console.log('PRELOAD NETWORK DEVICE IDS', ids)\n await dispatch.devices.fetchDevices({ ids: Array.from(ids), accountId, hidden: true })\n }\n },\n\n async parse({ response, accountId }: { response: AxiosResponse | undefined; accountId: string }) {\n const networks = response?.data?.data?.login?.account?.networks || []\n\n const parsed: INetwork[] = networks.map(n => ({\n ...DEFAULT_NETWORK,\n accountId,\n id: n.id,\n name: n.name,\n owner: n.owner,\n shared: accountId !== n.owner.id,\n permissions: n.permissions,\n created: new Date(n.created),\n // FIXME this is not enough data to generate new network connections... need full generation for shared networks...\n // ...maybe can be done by adding the network service IDs to the connection query\n connectionNames: n.connections.reduce((obj, c) => ({ ...obj, [c.service.id]: c.name }), {}),\n serviceIds: n.connections.map(c => c.service.id),\n access: n.access.map(s => ({ email: s.user.email, id: s.user.id })),\n tags: n.tags.map(t => ({ ...t, created: new Date(t.created) })),\n icon: 'chart-network',\n cloud: true,\n }))\n\n return parsed\n },\n\n async fetchCount(role: Partial, state) {\n if (role.access === 'NONE') return 0\n const networks: INetwork[] = selectNetworks(state).filter(n => canRoleView(role, n))\n return networks.length\n },\n\n async join(serviceId: string, state) {\n const joined = selectNetworkByService(state, serviceId)\n if (!joined.length) dispatch.networks.add({ serviceId, networkId: DEFAULT_ID })\n },\n\n async add(props: addConnectionProps, state) {\n const network = selectNetwork(state, props.networkId)\n let copy = { ...network }\n const unique = new Set(copy.serviceIds.concat(props.serviceId))\n copy.serviceIds = Array.from(unique)\n dispatch.networks.setNetwork(copy)\n if (props.networkId !== DEFAULT_ID) {\n const result = await graphQLSetConnection(props)\n if (result === 'ERROR' || !result?.data?.data?.addNetworkConnection) {\n dispatch.ui.set({ errorMessage: `Adding network failed. Please contact support.` })\n dispatch.networks.setNetwork(network)\n return\n }\n }\n },\n\n async remove(\n { serviceId = '', networkId, clearOnly }: { serviceId?: string; networkId?: string; clearOnly?: boolean },\n state\n ) {\n const joined = selectNetworkByService(state, serviceId)\n let network = selectNetwork(state, networkId)\n\n if (!network.permissions.includes('MANAGE')) return\n\n let copy = structuredClone(network)\n const index = copy.serviceIds.indexOf(serviceId)\n copy.serviceIds.splice(index, 1)\n dispatch.networks.setNetwork(copy)\n if (networkId && !clearOnly) {\n const result = await graphQLRemoveConnection(networkId, serviceId)\n if (result === 'ERROR' || !result?.data?.data?.removeNetworkConnection) {\n console.error('Failed to remove network connection', serviceId, network, result)\n dispatch.ui.set({\n errorMessage: `Failed to remove network connection (${serviceId}) from ${network.name}. Please contact support.`,\n })\n dispatch.networks.setNetwork(network)\n return\n }\n }\n if (joined.length <= 1) {\n const [service] = selectById(state, undefined, serviceId)\n const connection = selectConnection(state, service)\n dispatch.connections.disconnect({ connection })\n }\n },\n\n async clearById(id: string, state) {\n let all = { ...state.networks.all }\n all[DEFAULT_ID] = [state.networks.default]\n const [_, device] = selectById(state, undefined, id)\n const serviceIds = id === device?.id ? device?.services.map(s => s.id) : [id]\n Object.keys(all).forEach(key => {\n all[key].forEach(async network => {\n const match = network.serviceIds.find(serviceId => serviceIds.includes(serviceId))\n if (match) await dispatch.networks.remove({ serviceId: match, networkId: network.id, clearOnly: true })\n })\n })\n },\n\n async deleteNetwork(params: INetwork, state) {\n const id = selectActiveAccountId(state)\n const response = await graphQLDeleteNetwork(params.id)\n if (response === 'ERROR') return\n let networks = [...state.networks.all[id]]\n const index = networks.findIndex(network => network.id === params.id)\n networks.splice(index, 1)\n dispatch.networks.set({ all: { ...state.networks.all, [id]: [...networks] } })\n },\n\n async addNetwork(params: INetwork, state) {\n const id = selectActiveAccountId(state)\n const response = await graphQLAddNetwork(params.name, id)\n if (response === 'ERROR') return\n params.id = response?.data?.data?.createNetwork?.id\n console.log('ADDING NETWORK', params)\n await dispatch.networks.setNetwork(params)\n await dispatch.networks.fetch()\n dispatch.ui.set({ redirect: `/networks/${params.id}` })\n },\n\n async updateNetwork(network: INetwork) {\n await dispatch.networks.setNetwork(network)\n await graphQLUpdateNetwork(network)\n await dispatch.networks.fetch()\n },\n\n async shareNetwork({ id, emails }: { id: string; emails: string[] }, state) {\n const response = await graphQLAddNetworkShare(id, emails)\n if (response === 'ERROR' || !response?.data?.data?.addNetworkShare) return\n const network = selectNetwork(state, id)\n await dispatch.networks.fetch()\n dispatch.ui.set({\n successMessage:\n emails.length > 1\n ? `${emails.length} accounts shared to ${network.name}.`\n : `${network.name} shared to ${emails[0]}.`,\n })\n },\n\n async unshareNetwork({ networkId, email }: { networkId: string; email: string }, state) {\n const response = await graphQLRemoveNetworkShare(networkId, email)\n if (response === 'ERROR' || !response?.data?.data?.removeNetworkShare) return\n const network = structuredClone(selectNetwork(state, networkId))\n const index = network.access.findIndex(a => a.email === email)\n network.access.splice(index, 1)\n await dispatch.networks.setNetwork(network)\n },\n\n async setNetwork(params: INetwork, state) {\n const id = selectActiveAccountId(state)\n if (params.id === DEFAULT_ID) return\n\n let networks: INetwork[] = [...(state.networks.all[id] || [])]\n const index = networks.findIndex(network => network.id === params.id)\n\n if (index >= 0) {\n networks[index] = { ...networks[index], ...params }\n dispatch.networks.setNetworks({ networks, accountId: id })\n }\n },\n\n async setNetworks(props: { networks: INetwork[]; accountId?: string }, state) {\n const id = props.accountId || selectActiveAccountId(state)\n dispatch.networks.set({ all: { ...state.networks.all, [id]: [...props.networks] } })\n },\n }),\n reducers: {\n reset(state: INetworksAccountState) {\n state = { ...defaultAccountState }\n return state\n },\n set(state: INetworksAccountState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nexport function defaultNetwork(state?: State): INetwork {\n if (state) {\n const owner = selectActiveUser(state)\n const accountId = selectActiveAccountId(state)\n const defaultNetwork = browser.hasBackend ? defaultLocalNetwork : defaultCloudNetwork\n return { ...defaultNetwork, owner, accountId }\n }\n return DEFAULT_NETWORK\n}\n\nexport function selectNetwork(state: State, networkId?: string): INetwork {\n return selectNetworks(state).find(n => n.id === networkId) || defaultNetwork(state)\n}\n\nexport function selectNetworkByTag(state: State, tags: ITagFilter): INetwork[] {\n const networks = selectNetworks(state).filter(n => canViewByTags(tags, n.tags))\n return networks\n}\n\nexport function selectAccessibleNetworks(state: State, organization: IOrganizationState, member?: IOrganizationMember) {\n if (!member) return []\n const networks = selectNetworks(state)\n return networks.filter(n => canMemberView(organization.roles, member, n))\n}\n\nexport function selectSharedNetwork(state: State, serviceId?: string): INetwork | undefined {\n if (!serviceId) return\n const networks = selectNetworkByService(state, serviceId)\n if (!networks.length) return\n return networks.find(n => n.shared)\n}\n","import { createSelector } from 'reselect'\nimport { DEFAULT_NETWORK } from '../models/networks'\nimport { newConnection } from '../helpers/connectionHelper'\nimport { selectActiveAccountId, selectActiveUser } from './accounts'\nimport { getUser, getConnections, getSessions, optionalService } from './state'\n\nexport const getConnectionsLookup = createSelector(\n [getConnections, selectActiveAccountId],\n (allConnections, accountId) =>\n allConnections.reduce((lookup: { [deviceID: string]: IConnection[] }, c: IConnection) => {\n if (!c.deviceID || accountId !== c.accountId) return lookup\n if (lookup[c.deviceID]) lookup[c.deviceID].push(c)\n else lookup[c.deviceID] = [c]\n return lookup\n }, {})\n)\n\nexport const selectSessions = createSelector([getSessions, selectActiveAccountId], (sessions, accountId) => {\n return sessions.filter(s => s.target.accountId === accountId)\n})\n\nexport const selectEnabledConnections = createSelector([getConnections], connections => {\n return connections.filter(c => !!c.createdTime || c.enabled)\n})\n\nexport const selectConnections = createSelector([getConnections, selectActiveAccountId], (connections, accountId) => {\n return connections.filter(c => c.accountId === accountId && (!!c.createdTime || c.enabled))\n})\n\nexport const selectEnabledConnectionsCount = createSelector(\n [selectConnections, selectSessions],\n (connections, sessions) => {\n const enabled = connections.filter(\n connection => connection.online && connection.enabled && !sessions.find(s => s.target.id === connection.id)\n ).length\n return sessions.length + enabled\n }\n)\n\nexport const selectConnectedConnections = createSelector([selectConnections], connections => {\n return connections.filter(connection => connection.online && connection.connected)\n})\n\nexport const selectIdleConnections = createSelector([selectConnections], connections => {\n return connections.filter(connection => connection.enabled && connection.online && !connection.connected)\n})\n\nexport const selectAllConnectionSessions = createSelector(\n [getConnections, getSessions, getUser],\n (connections, sessions, user) => {\n const active: ISession[] = connections\n .filter(c => c.online && c.connected && !sessions.find(s => s.target.id === c.id))\n .map(c => ({\n timestamp: new Date(c.startTime || 0),\n platform: 1, // FIXME this device state platform\n source: 'UNKNOWN',\n manufacturer: 'UNKNOWN',\n reverseProxy: false,\n user: user,\n target: {\n id: c.id,\n accountId: c.accountId || user.id,\n deviceId: c.deviceID || '',\n platform: 1, // FIXME target device platform\n name: c.name || '', // FIXME target device name\n },\n }))\n return sessions.concat(active)\n }\n)\n\nexport const selectConnectionSessions = createSelector(\n [selectAllConnectionSessions, selectActiveAccountId],\n (sessions, accountId) => sessions.filter(s => s.target.accountId === accountId)\n)\n\nexport const selectConnection = createSelector([getConnections, optionalService], (connections, service?: IService) => {\n let connection = connections.find(c => c.id === service?.id)\n if (!connection?.typeID && service) return { ...newConnection(service), ...connection }\n if (!connection) return newConnection(service)\n return connection\n})\n\nexport const selectConnectionsByType = createSelector(\n [selectActiveUser, selectIdleConnections],\n (activeUser, connections): INetwork[] => {\n const connection: IConnection | undefined = connections[0]\n\n const networks: INetwork[] = [\n {\n ...DEFAULT_NETWORK,\n cloud: true,\n id: 'public',\n name: 'Public',\n icon: 'globe',\n accountId: connection?.accountId || activeUser.id,\n serviceIds: [],\n },\n {\n ...DEFAULT_NETWORK,\n id: 'local',\n name: 'Local',\n icon: 'network-wired',\n accountId: connection?.accountId || activeUser.id,\n serviceIds: [],\n },\n ]\n\n connections.forEach(c => {\n if (c.public || c.connectLink) networks[0].serviceIds.push(c.id)\n else networks[1].serviceIds.push(c.id)\n })\n\n if (networks[0].serviceIds.length === 0) networks.shift()\n\n return networks\n }\n)\n","import { emit } from '../services/Controller'\nimport { ANONYMOUS_MANUFACTURER_CODE } from '../constants'\nimport { IP_PRIVATE, DEFAULT_CONNECTION } from '@common/constants'\nimport { Application, getApplicationType } from '@common/applications'\nimport { State, store } from '../store'\nimport { selectEnabledConnections } from '../selectors/connections'\nimport { selectActiveUser } from '../selectors/accounts'\nimport { getAllDevices } from '../selectors/devices'\nimport { selectById } from '../selectors/devices'\nimport browser from '../services/browser'\n\nexport function connectionState(instance?: IService | IDevice, connection?: IConnection): IConnectionState {\n if (instance?.state === 'inactive') return 'offline'\n if (connection) {\n if (connection.starting) return 'starting'\n if (connection.disconnecting) return 'disconnecting'\n if (connection.stopping) return 'stopping'\n if (connection.connecting) return 'connecting'\n if (connection.connected) return 'connected'\n if (connection.enabled) return 'ready'\n }\n return 'online'\n}\n\nexport function getManufacturerType(code?: number, reverseProxy?: boolean): ISession['manufacturer'] {\n if (code === ANONYMOUS_MANUFACTURER_CODE) {\n return reverseProxy ? 'ANONYMOUS' : 'KEY'\n }\n return 'UNKNOWN'\n}\n\nexport function getManufacturerUser(code?: number, reverseProxy?: boolean): IUserRef | undefined {\n if (code === ANONYMOUS_MANUFACTURER_CODE) {\n return reverseProxy ? { id: 'ANON', email: 'Anonymous' } : { id: 'KEY', email: 'Service Key' }\n }\n return undefined\n}\n\nexport function isSecureReverseProxy(template?: string) {\n if (!template) return null\n if (template.startsWith('https:')) return true\n if (template.startsWith('http:')) return false\n return null\n}\n\nexport function isRelay(service?: IService) {\n return !!(service && service.host && service.host !== IP_PRIVATE && service.host !== 'localhost')\n}\n\nexport function isFileToken(token: string) {\n return token === 'path' || token === 'app' || token.toLowerCase().includes('file')\n}\n\nexport function findLocalConnection(state: State, id: string, sessionId: string | undefined) {\n return state.connections.all.find(c => c.id === id || c.sessionId === sessionId)\n}\n\nexport function newConnection(service?: IService | null): IConnection {\n const state = store.getState()\n const user = selectActiveUser(state)\n const cd: ILookup = state.user.attributes?.connectionDefaults?.[service?.typeID || '']\n let routeType: IRouteType = service?.attributes.route || cd?.route || 'failover'\n if (!browser.hasBackend && routeType === 'failover') routeType = 'public'\n\n let connection: IConnection = {\n ...DEFAULT_CONNECTION,\n ...routeTypeToSettings(routeType),\n owner: { id: user?.id || '', email: user?.email || 'Unknown' },\n autoLaunch: cd?.autoLaunch === undefined ? getApplicationType(service?.typeID || 0)?.autoLaunch : cd.autoLaunch,\n autoClose: getApplicationType(service?.typeID || 0)?.autoClose,\n }\n\n if (service) {\n const [_, device] = selectById(state, undefined, service.deviceID)\n connection = {\n ...connection,\n name: service.subdomain,\n id: service.id,\n deviceID: service.deviceID,\n owner: device?.owner || connection.owner,\n accountId: device?.accountId || user.id,\n online: service.state === 'active',\n typeID: service.typeID,\n targetHost: service.attributes.targetHost,\n description: service.attributes.description,\n disableSecurity: isSecureReverseProxy(service?.attributes.launchTemplate || cd?.launchTemplate) === false,\n }\n if (service.attributes.defaultPort && !usedPorts(state).includes(service.attributes.defaultPort)) {\n connection.port = service.attributes.defaultPort\n }\n }\n\n return connection\n}\n\nexport function updateImmutableData(connection: IConnection, app?: Application): IConnection {\n if (!app) return connection\n let identity: ILookup | undefined\n\n if (app.sshConfig) {\n const { lookup, tokens } = app\n identity = Object.fromEntries(tokens.map(token => [token, lookup?.[token]]))\n }\n\n return {\n ...connection,\n online: app.service?.state === 'active',\n typeID: app.service?.typeID,\n identity,\n }\n}\n\nexport function routeTypeToSettings(route: IRouteType) {\n return {\n failover: route !== 'p2p',\n proxyOnly: route === 'proxy',\n public: route === 'public',\n }\n}\n\nexport function usedPorts(state: State) {\n return state.connections.all.map(c => c.port)\n}\n\nexport function launchDisabled(connection?: IConnection) {\n if (!connection) return true\n return !!(\n (connection.launchType === 'COMMAND' && !browser.hasBackend) ||\n connection.launchType === 'NONE' ||\n !connection.enabled ||\n !connection.online\n )\n}\n\nexport function launchSettingHidden(connection?: IConnection) {\n if (!connection) return true\n return !!(\n (connection.launchType === 'COMMAND' && !browser.hasBackend) ||\n connection.connectLink ||\n connection.launchType === 'NONE'\n )\n}\n\nexport const validPort = (event: React.ChangeEvent) => {\n const port = Math.max(0, Math.min(+event.target.value, 65535))\n return isNaN(port) ? 0 : port\n}\n\nexport function updateConnection(app: Application, connection: IConnection) {\n app.connection = connection\n connection = updateImmutableData(connection, app)\n setConnection(connection)\n}\n\nexport function setConnection(connection: IConnection) {\n const { auth } = store.getState()\n const { connections } = store.dispatch\n\n if (!connection.id || !connection.name || !connection.deviceID) {\n var error = new Error()\n console.warn('Connection missing data. Set failed', connection, error.stack)\n return false\n }\n if (!browser.hasBackend) {\n connections.updateConnection({ ...connection, default: false })\n } else if (auth.backendAuthenticated) {\n emit('connection', { ...connection, default: false })\n }\n}\n\nexport function clearConnectionError(connection: IConnection) {\n console.log('CLEAR ERROR', connection)\n setConnection({ ...connection, error: undefined })\n}\n\nexport function getFetchConnectionIds(state: State) {\n const thisId = state.backend.thisId\n const serviceIds = selectEnabledConnections(state).map(c => {\n // @TODO see if it would be better to put the connections into the correct accountId device model\n // console.log('connection ids', c.id, c.accountId)\n return c.id\n })\n if (thisId && !serviceIds.includes(thisId)) serviceIds.push(thisId)\n return serviceIds\n}\n\nexport function getRoute(connection: IConnection): IRouteType {\n return connection.public ? 'public' : connection.proxyOnly ? 'proxy' : connection.failover ? 'failover' : 'p2p'\n}\n\nexport function getConnectionSessionIds() {\n const { all } = store.getState().connections\n return all.map(c => c.sessionId)\n}\n\nexport function getConnectionLookup(state: State) {\n const { all } = state.connections\n return all.reduce((result: ConnectionLookup, c: IConnection) => {\n result[c.id] = c\n return result\n }, {})\n}\n\nexport function getEndpoint(name?: string, port?: number) {\n if (!name) {\n name = 'Connecting...'\n port = undefined\n }\n\n return name + (port ? ':' + port : '')\n}\n\nexport function cleanOrphanConnections(expectedIds?: IService['id'][]) {\n const state = store.getState()\n if (!expectedIds?.length || state.ui.offline) return\n\n const loadedIds = getAllDevices(state)\n .map(d => d.services.map(s => s.id))\n .flat()\n\n expectedIds.forEach(id => {\n if (!loadedIds.includes(id)) {\n store.dispatch.connections.forget(id)\n console.log('FORGET ORPHANED CONNECTION', id)\n }\n })\n}\n","import React, { useEffect } from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { makeStyles } from '@mui/styles'\nimport { ListItemButton, ListItemText, ListItemSecondaryAction, InputLabel, TextFieldProps } from '@mui/material'\nimport { IconButton } from '../buttons/IconButton'\nimport { spacing } from '../styling'\nimport { emit } from '../services/Controller'\nimport classnames from 'classnames'\n\ntype Props = {\n label?: string\n value?: string\n token: string\n variant?: TextFieldProps['variant']\n disabled?: boolean\n disableGutters?: boolean\n dense?: boolean\n onSave?: (value?: string) => void\n className?: string\n}\n\nexport const InlineFileFieldSetting: React.FC = ({\n label,\n value = '',\n token,\n variant,\n disabled,\n disableGutters,\n dense = true,\n onSave,\n className,\n}) => {\n const { filePath } = useSelector((state: State) => state.backend)\n const dispatch = useDispatch()\n const css = useStyles({ filled: variant === 'filled' })\n\n const filePrompt = () => emit('filePrompt', token)\n\n useEffect(() => {\n if (filePath) {\n onSave && onSave(filePath)\n dispatch.backend.set({ filePath: undefined })\n }\n }, [filePath])\n\n return (\n \n \n {label && {label}}\n {value || '–'}\n \n \n onSave && onSave(undefined)} />\n \n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n container: ({ filled }: { filled?: boolean }) => ({\n backgroundColor: filled ? palette.grayLightest.main : undefined,\n '& .MuiListItemText-root': { marginLeft: spacing.sm },\n '& .MuiListItemSecondaryAction-root': { right: spacing.xs },\n }),\n}))\n","import {\n List,\n ListItem,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n TextField,\n Typography,\n} from '@mui/material'\nimport React, { useState, useEffect } from 'react'\nimport { InlineFileFieldSetting } from './InlineFileFieldSetting'\nimport { isFileToken } from '../helpers/connectionHelper'\nimport { Application } from '@common/applications'\nimport browser from '../services/browser'\n\ntype Props = {\n app: Application\n open: boolean\n onClose: () => void\n onSubmit: (tokens: ILookup) => void\n}\n\nexport const PromptModal: React.FC = ({ app, open, onSubmit, onClose }) => {\n const toLookup = () => app.missingTokens.reduce((obj, item) => ({ ...obj, [item]: '' }), {})\n const [tokens, setTokens] = useState>(toLookup())\n const [error, setError] = useState()\n\n useEffect(() => {\n setTokens(toLookup())\n }, [open])\n\n const update = (token: string, value: string) => {\n let updated: ILookup = { ...tokens, [token]: value }\n if (!value) delete updated[token]\n setTokens(updated)\n }\n\n return (\n \n {\n event.preventDefault()\n let foundError = false\n Object.keys(tokens).forEach(key => {\n if (!tokens[key]) {\n setError(key)\n foundError = true\n }\n })\n if (!foundError) onSubmit(tokens)\n }}\n >\n Missing info found\n \n {app.preview(tokens)}\n \n {app.missingTokens.map((token, index) =>\n isFileToken(token) && browser.hasBackend ? (\n update(token, value || '')}\n />\n ) : (\n \n setTokens({ ...tokens, [token]: event.target.value })}\n />\n \n )\n )}\n \n \n \n \n \n \n \n \n )\n}\n","import { useState, useCallback } from 'react'\nimport { Clipboard } from '@capacitor/clipboard'\n\ntype ClipboardOptions = {\n copiedTimeout?: number\n}\n\nconst useClipboard = (options: ClipboardOptions = {}) => {\n const { copiedTimeout = 1500 } = options\n const [copied, setCopied] = useState(false)\n\n const copy = useCallback(\n async copyValue => {\n await Clipboard.write({ string: copyValue.toString() })\n setCopied(true)\n setTimeout(() => setCopied(false), copiedTimeout)\n },\n [copiedTimeout]\n )\n\n return { copy, copied }\n}\n\nexport default useClipboard\n","import React, { useState, useEffect } from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { IconButton, ButtonProps } from './IconButton'\nimport { updateConnection } from '../helpers/connectionHelper'\nimport { Sizes } from '../styling'\nimport { Application } from '@common/applications'\nimport { PromptModal } from '../components/PromptModal'\nimport useClipboard from '../hooks/useClipboard'\n\nexport type CopyButtonProps = ButtonProps & {\n icon: string\n app?: Application\n title?: string\n value?: string | number\n color?: Color\n colorCopied?: Color\n size?: Sizes\n type?: IconType\n onMouseEnter?: () => void\n onMouseLeave?: () => void\n onClick?: () => void\n onCopy?: () => void\n}\n\nconst COPY_TIMEOUT = 800\n\nexport const CopyIconButton = React.forwardRef(\n ({ icon, app, value, title, size = 'lg', colorCopied = 'success', onClick, onCopy, ...props }, ref) => {\n const [open, setOpen] = useState(false)\n const clipboard = useClipboard({ copiedTimeout: COPY_TIMEOUT })\n const autoCopy = useSelector((state: State) => state.ui.autoCopy)\n const { ui } = useDispatch()\n\n useEffect(() => {\n if (autoCopy) {\n check()\n ui.set({ autoCopy: false })\n }\n }, [autoCopy])\n\n const check = () => {\n onClick?.()\n app?.prompt ? setOpen(true) : copy()\n }\n\n const copy = () => {\n clipboard.copy(value || app?.commandString || '')\n setTimeout(() => {\n onCopy?.()\n }, COPY_TIMEOUT)\n }\n\n const onSubmit = (tokens: ILookup) => {\n if (app?.connection) updateConnection(app, { ...app.connection, ...tokens })\n setTimeout(copy, 100)\n setOpen(false)\n }\n\n const onClose = () => setOpen(false)\n\n title = clipboard.copied ? 'Copied!' : title\n\n return (\n <>\n \n {app && }\n \n )\n }\n)\n","import React, { forwardRef } from 'react'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { IconButton, Tooltip, Button, ButtonProps, alpha, darken } from '@mui/material'\nimport { Icon, IconProps } from '../components/Icon'\nimport { spacing } from '../styling'\n\nexport type DynamicButtonProps = Omit & {\n title?: string\n icon?: string | React.ReactNode\n iconType?: IconProps['type']\n color?: Color\n size?: 'icon' | 'chip' | 'medium' | 'small' | 'large'\n iconSize?: IconProps['size']\n loading?: boolean\n}\n\nexport const DynamicButton = forwardRef((props, ref) => {\n const css = useStyles(props)\n let {\n title,\n icon,\n iconType = 'regular',\n iconSize,\n color,\n size = 'icon',\n variant = 'contained',\n className,\n loading,\n ...rest\n }: DynamicButtonProps = props\n\n if (icon && loading && size === 'small') {\n icon = 'spinner-third'\n iconType = 'solid'\n }\n\n if (size === 'chip') {\n return (\n \n )\n }\n\n const IconComponent =\n typeof icon === 'string' ? (\n \n ) : icon ? (\n icon\n ) : null\n\n if (size === 'small' || size === 'medium' || size === 'large') {\n return (\n \n )\n }\n\n return (\n \n \n \n {IconComponent}\n \n \n \n )\n})\n\nconst useStyles = makeStyles(({ palette }) => ({\n button: (props: DynamicButtonProps) => {\n let background = props.disabled ? palette.grayLight.main : props.color ? palette[props.color].main : undefined\n let hover = background ? darken(background, 0.25) : undefined\n let foreground = palette.alwaysWhite.main\n let style: any = {}\n\n if (props.variant === 'text' && background) {\n foreground = background\n background = alpha(foreground, 0.1)\n hover = alpha(foreground, 0.2)\n }\n\n if (props.size === 'chip') {\n style.textTransform = 'none'\n style.height = 20\n style.fontWeight = 500\n style.letterSpacing = 0.3\n style.padding = `0px ${spacing.sm}px`\n }\n\n return {\n '&.MuiButton-root': {\n '&:hover': { backgroundColor: props.disabled ? background : hover },\n backgroundColor: background,\n color: foreground,\n minWidth: 0,\n ...style,\n },\n }\n },\n}))\n","import React, { useEffect } from 'react'\nimport browser from '../services/browser'\nimport { Stack } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { connectionState, newConnection, launchDisabled } from '../helpers/connectionHelper'\nimport { DynamicButton, DynamicButtonProps } from './DynamicButton'\nimport { getLicenseChip } from '../components/LicenseChip'\nimport { useHistory } from 'react-router-dom'\n\nexport type ConnectButtonProps = Omit & {\n connection?: IConnection\n service?: IService\n permissions?: IPermission[]\n preventDefault?: boolean\n all?: boolean\n onClick?: (event: React.MouseEvent) => void\n}\n\nexport const ConnectButton: React.FC = ({\n connection,\n service,\n permissions,\n color = 'primary',\n disabled,\n preventDefault,\n all,\n onClick,\n ...props\n}) => {\n const instanceId = service?.id || connection?.id || ''\n const { autoConnect } = useSelector((state: State) => state.ui)\n const dispatch = useDispatch()\n const history = useHistory()\n const chip = getLicenseChip(service?.license)\n const state = connectionState(service, connection)\n\n let clickHandler = async (event?: React.MouseEvent, forceStop?: boolean) => {\n event?.stopPropagation()\n event?.preventDefault()\n\n if (preventDefault) {\n event && onClick?.(event)\n return\n }\n\n if (connection?.connectLink) {\n await dispatch.connections.setConnectLink({ ...connection, enabled: false })\n } else if (connection?.connecting || connection?.enabled || connection?.starting) {\n if (connection.connected) await dispatch.connections.onClose(connection)\n await dispatch.connections.disconnect({ connection, forceStop })\n } else {\n connection = connection || newConnection(service)\n await dispatch.connections.connect({ ...connection, connectOnReady: true })\n await dispatch.networks.join(instanceId)\n }\n event && onClick?.(event)\n }\n\n useEffect(() => {\n if (autoConnect && service) {\n dispatch.ui.set({ autoConnect: false })\n clickHandler()\n }\n }, [autoConnect, service])\n\n let title = 'Connect'\n let variant: 'text' | 'outlined' | 'contained' | undefined = 'text'\n let loading = false\n let icon: string | undefined = 'play'\n\n if (connection?.autoLaunch && !launchDisabled(connection)) title += ' + Launch'\n\n if (!permissions?.includes('CONNECT')) {\n disabled = true\n title = 'Unauthorized'\n }\n\n if (chip && chip.show) {\n color = chip.colorName\n title = chip.disabled ? chip.name : title\n if (chip.disabled) clickHandler = async () => history.push('/account/plans')\n }\n\n switch (state) {\n case 'ready':\n title = 'Stop'\n icon = 'stop'\n break\n case 'connected':\n title = 'Disconnect'\n icon = connection?.public ? 'stop' : 'pause'\n break\n case 'disconnecting':\n title = 'Disconnecting'\n loading = true\n break\n case 'starting':\n title = 'Starting'\n loading = true\n break\n case 'offline':\n title = 'Offline'\n disabled = disabled || !connection?.enabled\n color = 'grayLight'\n variant = 'contained'\n icon = 'stop'\n break\n case 'stopping':\n title = 'Removing'\n color = 'grayDark'\n loading = true\n break\n case 'connecting':\n title = 'Connecting'\n loading = true\n break\n default:\n variant = 'contained'\n }\n\n if (all) title += ' all'\n\n props.loading = props.loading || loading\n\n if (props.loading) icon = 'spinner-third'\n if (service?.attributes.route === 'p2p' && !browser.hasBackend) disabled = true\n if (disabled && props.size === 'icon') title = ''\n if (connection?.connectLink && state !== 'offline') {\n title = connection.enabled ? 'Disable' : 'Enable'\n icon = 'circle-medium'\n }\n\n const button = (\n \n )\n\n return state === 'connected' && props.size === 'large' && browser.hasBackend ? (\n \n {button}\n clickHandler(event, true)}\n sx={{ marginLeft: 2 }}\n />\n \n ) : (\n button\n )\n}\n","import React from 'react'\nimport { Icon } from './Icon'\nimport { IconButton } from '../buttons/IconButton'\nimport { spacing, fontSizes } from '../styling'\nimport { alpha, SxProps, Theme, Paper, Box } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport classnames from 'classnames'\n\nexport type NoticeProps = {\n severity?: 'info' | 'warning' | 'error' | 'success'\n button?: React.ReactNode\n gutterTop?: boolean\n gutterBottom?: boolean\n fullWidth?: boolean\n loading?: boolean\n solid?: boolean\n invert?: boolean\n onClose?: () => void\n closeTitle?: string\n iconOverride?: React.ReactNode\n className?: string\n sx?: SxProps\n children?: React.ReactNode\n}\n\nexport const Notice: React.FC = ({\n severity = 'info',\n button,\n fullWidth = false,\n gutterTop,\n gutterBottom,\n loading,\n solid,\n invert,\n onClose,\n closeTitle = 'Close',\n iconOverride,\n className,\n sx,\n children,\n}) => {\n const css = useStyles({ fullWidth, gutterBottom, gutterTop })\n let iconName: string\n let iconColor: string = severity\n\n switch (severity) {\n case 'info':\n iconName = 'info-circle'\n iconColor = 'primary'\n break\n case 'error':\n iconName = 'exclamation-triangle'\n break\n case 'warning':\n iconName = 'exclamation-triangle'\n break\n case 'success':\n iconName = 'check-circle'\n break\n }\n\n let icon: React.ReactNode = \n if (iconOverride) icon = iconOverride\n if (loading) icon = \n\n return (\n \n {icon}\n \n {children}\n \n {button}\n {onClose && (\n \n )}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n info: { color: palette.primary.main, backgroundColor: alpha(palette.primary.main, 0.1) },\n error: { color: palette.error.main, backgroundColor: alpha(palette.error.main, 0.1) },\n warning: { color: palette.warning.main, backgroundColor: alpha(palette.warning.main, 0.1) },\n success: { color: palette.success.main, backgroundColor: alpha(palette.success.main, 0.1) },\n infoSolid: { color: palette.alwaysWhite.main, backgroundColor: palette.primary.main },\n errorSolid: { color: palette.alwaysWhite.main, backgroundColor: palette.error.main },\n warningSolid: { color: palette.alwaysWhite.main, backgroundColor: palette.warning.main },\n successSolid: { color: palette.alwaysWhite.main, backgroundColor: palette.success.main },\n notice: ({ fullWidth, gutterBottom, gutterTop }: NoticeProps) => ({\n flexGrow: 1,\n alignItems: 'flex-start',\n marginLeft: fullWidth ? 0 : spacing.md,\n marginRight: fullWidth ? 0 : spacing.md,\n marginBottom: gutterBottom ? spacing.md : 0,\n marginTop: gutterTop ? spacing.md : 0,\n padding: `${spacing.xs}px ${spacing.md}px`,\n display: 'flex',\n position: 'relative',\n '& > svg': {\n marginLeft: spacing.xxs,\n marginRight: spacing.md,\n width: 21,\n paddingTop: spacing.sm,\n paddingBottom: spacing.sm,\n },\n '& em': { display: 'block', fontWeight: 400, fontSize: fontSizes.sm, fontStyle: 'normal' },\n '& strong': { fontSize: fontSizes.base, fontWeight: 500 },\n '& .MuiButton-root': { marginTop: 5 },\n }),\n}))\n","import React from 'react'\nimport browser, { windowOpen } from '../../services/browser'\nimport { PROTOCOL } from '../../constants'\nimport { ConnectButton, ConnectButtonProps } from '../ConnectButton'\nimport { DynamicButton } from '../DynamicButton'\nimport { Notice } from '../../components/Notice'\nimport { Box } from '@mui/material'\n\ntype Props = ConnectButtonProps & {\n className?: string\n fullWidth?: boolean\n disabled?: boolean\n containerProps?: React.HTMLAttributes\n children?: React.ReactNode\n}\n\nexport const ComboButton: React.FC = ({ className, containerProps, children, ...props }) => {\n return (\n \n {props.service?.attributes.route === 'p2p' && !browser.hasBackend ? (\n
\n {props.size !== 'chip' && (\n \n <>\n You cannot make a proxy connection to this service, it is set to peer to peer only.\n {browser.hasBackend && Please try again in a few minutes.}\n \n \n )}\n {browser.isPortal && (\n windowOpen(`${PROTOCOL}connect/${props.service?.id || props.connection?.id}`)}\n />\n )}\n
\n ) : (\n \n )}\n {children}\n \n )\n}\n","import network from '../services/Network'\nimport browser from './browser'\nimport { store } from '../store'\nimport { emit } from './Controller'\n\nconst HEARTBEAT_INTERVAL = 1000 * 20 // 20 SEC\nconst CAFFEINATE_INTERVAL = 1000 // 1 SEC\n\nclass Heartbeat {\n count = 0\n restInterval?: number = undefined\n caffeineInterval?: number = undefined\n checkAll?: true = undefined\n\n init() {\n if (browser.hasBackend) {\n window.onfocus = this.start\n window.onblur = this.stop\n network.on('connect', this.start)\n network.on('disconnect', this.stop)\n if (document.hasFocus()) this.start()\n }\n }\n\n start = () => {\n if (network.isActive() && !this.restInterval) {\n this.restInterval = window.setInterval(this.beat, HEARTBEAT_INTERVAL)\n this.beat()\n }\n }\n\n stop = () => {\n if (this.restInterval) {\n window.clearInterval(this.restInterval)\n this.restInterval = undefined\n }\n }\n\n beat = () => {\n const { auth } = store.getState()\n if (navigator.onLine && auth.backendAuthenticated) {\n emit('heartbeat', this.checkAll)\n }\n }\n\n connect = () => {\n this.caffeinate(12)\n }\n\n disconnect = () => {\n setTimeout(() => this.caffeinate(6), 2000)\n }\n\n caffeinate = (count: number) => {\n this.count = 0\n console.log('START CAFFEINATE')\n if (this.caffeineInterval) window.clearInterval(this.caffeineInterval)\n this.caffeineInterval = window.setInterval(() => {\n if (this.count++ > count) {\n window.clearInterval(this.caffeineInterval)\n this.caffeineInterval = undefined\n }\n this.beat()\n }, CAFFEINATE_INTERVAL)\n }\n}\n\nexport default new Heartbeat()\n","import React, { useState, useEffect } from 'react'\nimport heartbeat from '../../services/Heartbeat'\nimport { MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { updateConnection, launchDisabled } from '../../helpers/connectionHelper'\nimport { State, Dispatch } from '../../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { IconButton, ButtonProps } from '../../buttons/IconButton'\nimport { Sizes } from '../../styling'\nimport { Application } from '@common/applications'\nimport { PromptModal } from '../../components/PromptModal'\nimport { windowOpen } from '../../services/browser'\nimport { Icon } from '../../components/Icon'\nimport { emit } from '../../services/Controller'\n\ntype Props = {\n menuItem?: boolean\n size?: Sizes\n color?: Color\n type?: IconType\n app?: Application\n connection?: IConnection\n iconButtonProps?: ButtonProps\n onMouseEnter?: () => void\n onMouseLeave?: () => void\n onLaunch?: () => void\n}\n\nexport const LaunchButton: React.FC = ({\n menuItem,\n onLaunch,\n onMouseEnter,\n onMouseLeave,\n iconButtonProps,\n connection,\n app,\n ...props\n}) => {\n const dispatch = useDispatch()\n const [prompt, setPrompt] = useState(false)\n const ready = connection?.connectLink || connection?.ready\n const loading = !ready || connection?.starting || (app?.service && !app.service.loaded)\n const disabled = launchDisabled(connection) || loading\n const autoLaunch = useSelector((state: State) => state.ui.autoLaunch === connection?.id && connection?.autoLaunch)\n\n useEffect(() => {\n if (autoLaunch && !launchDisabled(connection) && ready) {\n dispatch.ui.set({ autoLaunch: undefined })\n clickHandler()\n }\n }, [autoLaunch, connection])\n\n if (!app) return null\n\n const clickHandler = async () => {\n if (app.service && !app.service.loaded) {\n await dispatch.devices.fetchSingleFull({ id: app.service.deviceID, hidden: true })\n dispatch.ui.set({ autoLaunch: connection?.id })\n return\n }\n if (app.prompt) setPrompt(true)\n else launch()\n onLaunch?.()\n }\n\n const close = () => setPrompt(false)\n\n const onSubmit = (tokens: ILookup) => {\n if (!app.connection) return\n updateConnection(app, { ...app.connection, ...tokens })\n launch()\n close()\n }\n\n const launch = () => {\n if (!app.connection) return\n updateConnection(app, { ...app.connection, launched: true })\n if (app.launchType === 'URL') windowOpen(app.string, '_blank', !app.string.startsWith('http'))\n else emit('launch/app', app.sshConfigString, app.launchType)\n heartbeat.connect()\n }\n\n const LaunchIcon = \n\n return (\n <>\n {menuItem ? (\n \n {LaunchIcon}\n \n \n ) : (\n \n {LaunchIcon}\n \n )}\n \n \n )\n}\n","import React from 'react'\nimport { useApplication } from '../hooks/useApplication'\nimport { CopyIconButton } from '../buttons/CopyIconButton'\nimport { ComboButton } from '../buttons/ComboButton'\nimport { LaunchButton } from '../buttons/LaunchButton'\nimport { Box } from '@mui/material'\n\nexport const ConnectAttribute = ({ device, service, connection }: IDataOptions) => {\n const app = useApplication(service, connection)\n const buttons =\n connection &&\n connection.online &&\n (connection.enabled ||\n connection.connecting ||\n connection.starting ||\n connection.stopping ||\n connection.disconnecting ||\n connection.connectLink)\n\n return (\n e.stopPropagation()} onMouseDown={e => e.stopPropagation()}>\n \n {buttons && (\n <>\n  \n \n \n \n )}\n \n \n )\n}\n","import React from 'react'\nimport { Button, Box } from '@mui/material'\n\nexport const RestoreButton: React.FC<{ device: IDevice }> = ({ device }) => {\n return (\n \n \n \n )\n}\n","import { useSelector } from 'react-redux'\nimport { State } from '../store'\n\nexport const useLabel = () => {\n const labels = useSelector((state: State) => state.labels)\n return id => labels.find(l => l.id === id)?.color || labels[1].color\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Tooltip, Chip, IconButton, alpha } from '@mui/material'\nimport { spacing, Sizes } from '../styling'\nimport { useLabel } from '../hooks/useLabel'\nimport { Icon } from '../components/Icon'\n\ntype Props = {\n tag?: ITag\n dot?: boolean\n size?: Sizes\n hideLabels?: boolean\n onClick?: () => void\n onDelete?: () => void\n}\n\nexport const Tag: React.FC = ({ tag, dot, size = 'xs', hideLabels, onClick, onDelete }) => {\n const getColor = useLabel()\n const color = tag && !hideLabels ? getColor(tag.color) : undefined\n const css = useStyles({ color })\n\n if (!tag) return null\n\n if (dot)\n return (\n \n \n {tag.name}\n \n }\n placement=\"top\"\n arrow\n >\n \n \n \n \n )\n\n return (\n \n {!hideLabels && }\n {tag.name}\n \n }\n size=\"small\"\n sx={{\n color: 'grayDarker.main',\n marginBottom: 0.3,\n '& .MuiChip-label > *': { marginRight: 1 },\n '& .MuiChip-deleteIconSmall': {\n marginLeft: -1,\n marginRight: 0,\n },\n }}\n deleteIcon={\n \n \n \n }\n onClick={onClick}\n onDelete={onDelete}\n />\n )\n}\n\nconst useStyles = makeStyles({\n tooltip: ({ color }: any) => ({\n backgroundColor: color,\n '& .MuiTooltip-arrow': { color },\n }),\n dot: {\n '& + span': { marginLeft: spacing.xxs },\n },\n})\n","import React from 'react'\nimport { Chip, BoxProps, Typography } from '@mui/material'\nimport { Tag } from './Tag'\n\nexport type TagProps = BoxProps & {\n tags: ITag[]\n small?: boolean\n max?: number\n showEmpty?: boolean\n hideLabels?: boolean\n onClick?: (tag: ITag) => void\n onDelete?: (tag: ITag) => void\n}\n\nexport const Tags: React.FC = ({ tags, small, max = 1, showEmpty, hideLabels, onClick, onDelete }) => {\n const dot = tags.length > max && small\n\n const Tags = [...tags]\n .sort(colorSort)\n .map((tag, index) => (\n onDelete(tag) : undefined}\n onClick={onClick ? () => onClick(tag) : undefined}\n />\n ))\n\n if (!tags.length && showEmpty)\n return (\n \n No tags\n \n )\n\n return <>{dot ? : Tags}\n}\n\nfunction colorSort(a: ITag, b: ITag) {\n return a.color < b.color ? -1 : 1\n // return a.name.localeCompare(b.name)\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { Tags, TagProps } from './Tags'\n\nconst AVERAGE_TAG_WIDTH = 85\n\nexport const ReactiveTags: React.FC = props => {\n const max = useSelector((state: State) => Math.floor((state.ui.columnWidths?.tags || 120) / AVERAGE_TAG_WIDTH))\n\n return \n}\n","import React from 'react'\nimport { Box, BoxProps } from '@mui/material'\nimport { spacing } from '../styling'\n\ninterface TitleProps extends BoxProps {\n inline?: boolean\n enabled?: boolean\n offline?: boolean\n}\n\nexport function Title({ children, inline, enabled, offline, ...props }: TitleProps) {\n return (\n \n {children}\n \n )\n}\n","import React, { forwardRef } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Chip, ChipProps, alpha, darken } from '@mui/material'\nimport { spacing } from '../styling'\nimport classnames from 'classnames'\n\nexport type Props = Omit & {\n color?: Color\n variant?: 'outlined' | 'contained' | 'text'\n inline?: boolean\n}\n\nexport const ColorChip = forwardRef(({ variant, color, ...props }, ref) => {\n const css = useStyles({ variant, color, ...props })\n return \n})\n\nconst useStyles = makeStyles(({ palette }) => ({\n color: ({ variant, color, inline }: Props) => {\n variant ||= 'text'\n color ||= 'grayDarker'\n\n let typeColor: string\n let hoverColor: string\n let backgroundColor: string | undefined\n\n switch (variant) {\n case 'outlined':\n typeColor = palette[color].main\n hoverColor = alpha(palette[color].main, 0.1)\n break\n case 'contained':\n typeColor = palette.alwaysWhite.main\n backgroundColor = palette[color].main\n hoverColor = darken(palette[color].main, 0.1)\n break\n case 'text':\n default:\n typeColor = palette[color].main\n backgroundColor = alpha(palette[color].main, 0.1)\n hoverColor = alpha(palette[color].main, 0.2)\n break\n }\n\n return {\n backgroundColor: backgroundColor,\n color: typeColor,\n fontWeight: 500,\n letterSpacing: 0.3,\n marginRight: inline ? spacing.sm : undefined,\n marginLeft: inline ? spacing.sm : undefined,\n '&:hover': { backgroundColor: hoverColor },\n }\n },\n}))\n","import React from 'react'\nimport { Icon } from './Icon'\nimport { Title } from './Title'\nimport { ColorChip } from './ColorChip'\nimport { useLocation } from 'react-router-dom'\nimport { attributeName } from '@common/nameHelper'\nimport { REGEX_FIRST_PATH } from '../constants'\nimport { Tooltip } from '@mui/material'\n\ntype Props = {\n connection?: IConnection\n service?: IService\n device?: IDevice\n shared?: boolean\n inline?: boolean\n children?: React.ReactNode\n}\n\nexport const DeviceName: React.FC = ({ connection, service, device, inline, children }) => {\n const location = useLocation()\n const menu = location.pathname.match(REGEX_FIRST_PATH)\n const instance = service || device\n const unlicensed = instance?.license === 'EVALUATION' || instance?.license === 'UNLICENSED'\n\n let name = ''\n\n if (device) name += attributeName(device)\n if (service) {\n if (device) name += ' - '\n name += attributeName(service)\n }\n if (connection?.name && menu?.[0] === '/networks') name = connection.name\n\n return (\n \n {children}\n {name || 'No device found'}\n {unlicensed && (\n <Tooltip title=\"Unlicensed\" placement=\"top\" arrow>\n <sup>\n <Icon name=\"exclamation-triangle\" size=\"xxxs\" type=\"solid\" color=\"warning\" fixedWidth />\n </sup>\n </Tooltip>\n )}\n {device?.newDevice && (\n <sup>\n <ColorChip label=\"NEW\" size=\"small\" color=\"success\" variant=\"contained\" />\n </sup>\n )}\n {device?.shared && (\n <Tooltip title={`Shared by ${device?.owner.email}`} placement=\"top\" arrow>\n <sup>\n <Icon name=\"user-group\" size=\"xxxs\" type=\"solid\" fixedWidth />\n </sup>\n </Tooltip>\n )}\n \n )\n}\n","import { State } from '../store'\nimport seedRandom from 'seedrandom'\nimport browser from '../services/browser'\n\nexport function isRemoteUI(state: State) {\n return browser.isRemote && !state.backend.preferences.remoteUIOverride\n}\n\nexport function createColor(email?: string) {\n return Math.ceil(seedRandom(email || '')() * 12)\n}\n","import { getTags } from './state'\nimport { createSelector } from 'reselect'\nimport { selectActiveAccountId } from './accounts'\n\nexport const selectTags = createSelector([getTags, selectActiveAccountId], (tags, accountId) => tags[accountId] || [])\n","import { REGEX_VALID_IP } from '../constants'\n\nexport function toLookup(array: T[], key: string): ILookup {\n return array.reduce((obj, item) => ({ ...obj, [item[key]]: item }), {})\n}\n\nexport function dedupe(collection: T[], id: string) {\n let keys: string[] = []\n return collection.reduce((result: T[], item) => {\n if (!keys.includes(item[id])) result.push(item)\n keys.push(item[id])\n return result\n }, [])\n}\n\nexport function pickTruthy(keys: string[], object: object) {\n return keys.reduce((result, key) => {\n if (object[key]) result[key] = object[key]\n return result\n }, {})\n}\n\nexport const currencyFormatter = (currency?: string, value?: number, digits: number = 2) => {\n if (!currency || !value) return '-'\n const result = new Intl.NumberFormat('en-US', {\n currency,\n style: 'currency',\n minimumFractionDigits: digits,\n }).format(Math.abs(value / 100))\n\n if (value < 0) return `(${result})`\n return result\n}\n\nexport const findTagIndex = (haystack: ILookup[], needle: string) =>\n haystack.findIndex(h => h.name.toLowerCase() === needle.toLowerCase())\n\nexport const tagsInclude = (haystack: ILookup[], needle: string) =>\n !!haystack.find(h => h.name.toLowerCase() === needle.toLowerCase())\n\nexport const mergeTags = (legacy: ITag[], tags: ITag[]) => {\n const unique = legacy.filter(l => findTagIndex(tags, l.name) === -1) || []\n return tags.concat(unique)\n}\n\nexport function containsIpAddress(url: URL): boolean {\n return REGEX_VALID_IP.test(url.hostname)\n}\n\n// Remove an object from an array by object value and return it without modifying the original array\nexport function removeObject(array: T[], callback: (item: T) => boolean): [T | undefined, T[]] {\n const index = array.findIndex(callback)\n\n if (index !== -1) {\n const newArray = [...array]\n const [removedElement] = newArray.splice(index, 1)\n return [removedElement, newArray]\n }\n\n return [undefined, array]\n}\n\nexport function removeObjectAttribute(obj: T, key: K): Omit {\n const { [key]: _, ...rest } = obj\n return rest\n}\n\n\nexport function createMemoDebugger(componentName) {\n return (prevProps, nextProps) => {\n Object.keys(prevProps).forEach(key => {\n if (prevProps[key] !== nextProps[key]) {\n console.log(`[${componentName}] ${key} prop changed`)\n }\n })\n return Object.keys(prevProps).every(key => prevProps[key] === nextProps[key])\n }\n}\n\nexport function containsNonPrintableChars(text: string): boolean {\n const nonPrintableCharLimit = 0.1 // Allow 10% of non-printable chars max\n let nonPrintableCount = 0\n\n for (let i = 0; i < text.length; i++) {\n const charCode = text.charCodeAt(i)\n // Consider characters below 32, except common text ones like tab, newline, carriage return as non-printable\n if (charCode < 32 && ![9, 10, 13].includes(charCode)) {\n nonPrintableCount++\n }\n }\n\n // Calculate the ratio of non-printable characters in the text\n return nonPrintableCount / text.length > nonPrintableCharLimit\n}\n","import { State } from '../store'\nimport { createModel } from '@rematch/core'\nimport { selectTags } from '../selectors/tags'\nimport { RootModel } from '.'\nimport { toLookup } from '../helpers/utilHelper'\n\nconst state: ILabel[] = [\n {\n id: 0,\n name: 'none',\n color: 'inherit',\n hidden: true,\n },\n {\n id: 1,\n name: 'Gray',\n color: '#797c86',\n },\n {\n id: 2,\n name: 'Red',\n color: '#E65B4C',\n },\n {\n id: 3,\n name: 'Orange',\n color: '#EF922E',\n },\n {\n id: 4,\n name: 'Yellow',\n color: '#F5CC17',\n },\n {\n id: 5,\n name: 'Lime',\n color: '#BBD40F',\n },\n {\n id: 6,\n name: 'Green',\n color: '#61C951',\n },\n {\n id: 7,\n name: 'Teal',\n color: '#31C49E',\n },\n {\n id: 8,\n name: 'Sky',\n color: '#4AB8F4',\n },\n {\n id: 9,\n name: 'Blue',\n color: '#6193FE',\n },\n {\n id: 10,\n name: 'Violet',\n color: '#6F54CC',\n },\n {\n id: 11,\n name: 'Purple',\n color: '#8F4EBA',\n },\n {\n id: 12,\n name: 'Berry',\n color: '#C236AB',\n },\n {\n id: 13,\n name: 'Pink',\n color: '#E13F88',\n },\n]\n\nexport const labelLookup = toLookup(state, 'id')\n\nexport default createModel()({\n state,\n reducers: {\n // setup as a model for when we can edit labels\n },\n})\n\nexport function getNextLabel(state: State) {\n const used = selectTags(state).reduce((colors: number[], tag: ITag) => {\n if (!colors.includes(tag.color)) colors.push(tag.color)\n return colors\n }, [])\n let available = state.labels.filter(l => !used.includes(l.id) && !l.hidden)\n if (!available.length) available = state.labels.filter(l => !l.hidden)\n const index = Math.floor(Math.random() * available.length)\n return available[index].id\n}\n\n/* \n Problem:\n Randomly select the next unused color label\n\n State:\n labels: ILabel[]\n tags: ITag[]\n\n Questions:\n How do we handle the case where there are no unused colors available?\n\n Considerations:\n Don't select hidden labels\n How to we ensure we balance the results so that it will auto select the least used color?\n*/\n","import md5 from 'md5'\nimport React from 'react'\nimport classnames from 'classnames'\nimport { createColor } from '../../helpers/uiHelper'\nimport { labelLookup } from '../../models/labels'\nimport { makeStyles } from '@mui/styles'\nimport { Avatar as MuiAvatar, Tooltip } from '@mui/material'\nimport { spacing } from '../../styling'\n\nexport interface Props {\n email?: string\n size?: number\n button?: boolean\n tooltip?: boolean\n inline?: boolean\n title?: string\n active?: boolean\n border?: number\n fallback?: string\n marginRight?: number\n children?: React.ReactNode\n}\n\nexport const Avatar: React.FC = ({\n email,\n size = 36,\n title,\n button,\n inline,\n tooltip,\n active,\n border = 1,\n fallback,\n marginRight,\n children,\n}) => {\n const url = `https://www.gravatar.com/avatar/${md5(email || '')}?s=${size * 2}&d=force-fail`\n const color = createColor(email)\n const css = useStyles({ size, color, button, inline, marginRight, active, border })\n fallback = (fallback || email || '?').substring(0, 1).toUpperCase()\n\n let Element = (\n <>\n \n
{fallback}
\n
\n {children}\n \n )\n\n if (button) Element = {Element}\n\n return tooltip ? (\n \n {Element}\n \n ) : (\n Element\n )\n}\n\ntype StyleProps = {\n button?: boolean\n inline?: boolean\n marginRight?: number\n active?: boolean\n size: number\n color: number\n border: number\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n avatar: ({ size, color, inline, marginRight, border }: StyleProps) => ({\n color: palette.alwaysWhite.main,\n fontSize: size * 0.625,\n height: size,\n width: size,\n verticalAlign: 'middle',\n display: 'inline-flex',\n fontFamily: 'Roboto Mono',\n backgroundColor: labelLookup[color].color,\n border: `${border}px solid ${palette.white.main}`,\n marginRight: inline ? spacing.sm : marginRight,\n }),\n button: ({ active, border }: StyleProps) => ({\n backgroundColor: active ? undefined : palette.white.main,\n borderRadius: '50%',\n padding: border,\n borderWidth: 2,\n borderStyle: 'solid',\n borderColor: active ? palette.primary.main : palette.grayLighter.main,\n cursor: 'pointer',\n position: 'relative',\n color: palette.primaryLight.main,\n boxShadow: active ? '0 0 10px' : undefined,\n '&:hover': {\n borderColor: active ? palette.grayDark.main : palette.primary.main,\n color: palette.gray.main,\n },\n }),\n}))\n","import React from 'react'\nimport { AvatarGroup } from '@mui/material'\nimport { Avatar } from './Avatar'\n\nexport interface Props {\n users?: IUser[]\n size?: number\n}\n\nexport const AvatarList: React.FC = ({ users, size = 22 }) => {\n if (!users) return null\n\n return (\n \n {users.map((u, i) => (\n \n ))}\n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { selectOrganization } from '../selectors/organizations'\nimport { selectMembership, selectActiveAccountId } from '../selectors/accounts'\nimport { Chip } from '@mui/material'\n\ntype Props = { device?: IDevice }\n\nexport const DeviceRole: React.FC = ({ device }) => {\n const accountId = useSelector((state: State) => selectActiveAccountId(state, device?.accountId))\n const membership = useSelector((state: State) => selectMembership(state, accountId))\n const roles = useSelector((state: State) => selectOrganization(state, accountId).roles)\n\n let roleId = membership.roleId\n if (roleId === 'OWNER' && device?.owner.id !== membership.account.id) roleId = 'GUEST'\n const label = roles.find(r => r.id === roleId)?.name || 'Unknown'\n\n return \n}\n","import { useEffect, useRef } from 'react'\n\nexport const useInterval = (callback: () => void, delay?: number, ...args: any[]) => {\n const savedCallback = useRef()\n\n useEffect(() => {\n savedCallback.current = callback\n }, [callback])\n\n useEffect(() => {\n function tick() {\n if (savedCallback.current) {\n savedCallback.current(...args)\n }\n }\n if (delay) {\n let id = setInterval(tick, delay)\n return () => clearInterval(id)\n }\n }, [delay, args])\n}\n","import React, { useState } from 'react'\nimport { useInterval } from '../../hooks/useInterval'\nimport humanize, { HumanizerOptions } from 'humanize-duration'\n\nexport const dateOptions: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n}\n\ntype Props = {\n startTime?: number\n endTime?: number\n startDate?: Date\n endDate?: Date\n ago?: boolean\n humanizeOptions?: HumanizerOptions\n}\n\nexport const Duration: React.FC = ({\n startTime,\n endTime,\n startDate,\n endDate,\n ago = false,\n humanizeOptions = { largest: 2 },\n}) => {\n startTime = startTime || startDate?.getTime()\n endTime = endTime || endDate?.getTime()\n const [now, setNow] = useState(endTime || Date.now())\n const aDay = 1000 * 60 * 60 * 24\n\n useInterval(() => {\n if (startTime && !endTime) setNow(Date.now())\n }, 1000)\n\n if (!startTime) return null\n\n const duration = Math.round((now - startTime) / 1000) * 1000\n const display =\n duration > aDay\n ? new Date(startTime).toLocaleString(navigator.language, dateOptions)\n : humanize(duration, humanizeOptions) + (ago ? ' ago' : '')\n\n return <>{display || '-'}\n}\n","import React, { useState, useEffect } from 'react'\nimport { ColorChip } from './ColorChip'\nimport { Duration } from './Duration'\nimport { Badge, Tooltip } from '@mui/material'\n\nexport type Props = {\n device?: IDevice\n service?: IService\n connections?: IConnection[]\n}\n\nconst RESENT_THRESHOLD = 1000 * 60 * 30\n\nfunction badgeState(device?: IDevice) {\n const offlineDuration = Date.now() - (device?.offlineSince || 0)\n const onlineDuration = Date.now() - (device?.onlineSince || 0)\n return {\n dropped: offlineDuration < RESENT_THRESHOLD && offlineDuration < onlineDuration,\n activated: onlineDuration < RESENT_THRESHOLD && onlineDuration < offlineDuration,\n }\n}\n\nexport const StatusChip: React.FC = ({ device, service, connections }) => {\n const [badge, setBadge] = useState(badgeState(device))\n const instance = device || service\n\n useEffect(() => {\n if (!device) return\n\n let timer: NodeJS.Timeout\n const state = badgeState(device)\n\n if (state.dropped || state.activated) {\n const remaining = RESENT_THRESHOLD - (Date.now() - (state.dropped ? device.offlineSince : device.onlineSince))\n timer = setTimeout(() => setBadge(badgeState(device)), remaining)\n }\n\n setBadge(state)\n return () => clearTimeout(timer)\n }, [device])\n\n const Chip =\n instance?.license === 'UNLICENSED' ? (\n \n ) : instance?.state === 'inactive' ? (\n \n ) : connections?.some(c => c.connected) ? (\n \n ) : device?.services.some(s => s.link?.enabled && s.link?.web) || (service?.link?.enabled && service?.link?.web) ? (\n \n ) : connections?.some(c => c.enabled && c.online) ? (\n \n ) : instance?.state === 'active' ? (\n \n ) : (\n \n )\n\n return badge.dropped || badge.activated ? (\n \n {badge.dropped ? 'Offline ' : 'Online '}\n \n \n }\n >\n \n {Chip}\n \n \n ) : (\n Chip\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { useTheme, makeStyles } from '@mui/styles'\nimport * as d3 from 'd3'\n\nexport type BarGraphProps = React.HTMLAttributes & {\n data: ITimeSeries\n width?: number\n height?: number\n max?: number\n min?: number\n color?: Color\n onHover?: (value?: [Date, number]) => void\n}\n\nexport const BarGraph: React.FC = ({\n data,\n width = 100,\n height = 18,\n max,\n min,\n color = 'grayDark',\n onHover,\n ...props\n}) => {\n const theme = useTheme()\n const css = useStyles({ height })\n const [bars, setBars] = useState<{ x: number; y: number; width: number; height: number }[]>([])\n\n max ||= Math.max(d3.max(data.data), 0.1)\n min ||= 0 // Math.max(d3.min(data.data), 0)\n\n useEffect(() => {\n const xScale = d3.scaleBand().domain(data.time).range([0, width])\n\n const yScale = d3.scaleLinear().domain([min, max]).range([height, 0])\n\n const newBars = data.data.map((d, i) => {\n const x = xScale(data.time[i])\n const y = yScale(d)\n return { x, y, width: xScale.bandwidth(), height: height - y }\n })\n\n setBars(newBars)\n }, [data, width, height])\n\n return (\n \n {bars.map((bar, i) => [\n ,\n onHover && (\n onHover && onHover([data.time![i]!, data.data![i]!])}\n onMouseOut={() => onHover && onHover(undefined)}\n />\n ),\n ])}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n graph: ({ height }: { height: number }) => ({\n backgroundColor: palette.white.main,\n borderBottomLeftRadius: height / 8,\n borderLeft: `1px solid ${palette.gray.main}`,\n borderBottom: `1px solid ${palette.gray.main}`,\n }),\n bar: {\n fill: 'transparent',\n '&:hover': { fill: palette.screen.main },\n },\n}))\n","import React from 'react'\n\ntype FormatProp = 'numeric' | 'minutes' | 'short' | 'long'\ntype Props = { time?: number; date?: Date; variant?: FormatProp }\n\nexport const timeOptions: ILookup = {\n numeric: {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n minutes: {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n },\n short: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n },\n long: {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n },\n}\n\nexport const Timestamp: React.FC = ({ time: startTime, date: startDate, variant = 'numeric' }) => {\n startDate = startDate || (startTime ? new Date(startTime) : undefined)\n if (!startDate) return null\n const display = !isNaN(startDate.getTime()) && startDate.toLocaleDateString(navigator.language, timeOptions[variant])\n return <>{display || '-'}\n}\n","import React from 'react'\nimport {\n TimeSeriesTypeScale,\n humanizeResolutionLookup,\n connectionTypes,\n secondResolutions,\n} from '../helpers/dateHelper'\nimport { BarGraph, BarGraphProps } from './BarGraph'\nimport { Typography, Stack, Box } from '@mui/material'\nimport { Timestamp } from './Timestamp'\nimport humanize from 'humanize-duration'\nimport * as d3 from 'd3'\n\ntype Props = Omit & {\n timeSeries?: ITimeSeries\n online?: boolean\n variant?: 'large' | 'small'\n}\n\nexport const TimeSeries: React.FC = ({ timeSeries, online, variant = 'small', ...props }) => {\n const color = connectionTypes.includes(timeSeries?.type || '') ? 'primary' : online ? 'success' : 'gray'\n const [display, setDisplay] = React.useState<[Date, number]>()\n\n if (!timeSeries) return null\n\n const max = Math.max(d3.max(timeSeries?.data), 0.1)\n const min = 0 // Math.max(d3.min(timeSeries?.data), 0)\n\n if (variant === 'small') return \n\n return (\n \n \n \n {yAxisDisplay(timeSeries, max)}\n \n \n {min}\n \n \n \n \n setDisplay(value)}\n />\n \n Last \n {humanize(timeSeries.end.getTime() - timeSeries.start.getTime(), {\n largest: 1,\n round: true,\n units: [humanizeResolutionLookup[timeSeries.resolution || 'DAY']],\n })}\n \n \n {display && (\n \n \n \n \n \n {barDisplay(timeSeries.type, display[1])}\n \n \n )}\n \n \n )\n}\n\nfunction barDisplay(type: ITimeSeriesType, value: number) {\n const scale = TimeSeriesTypeScale[type]\n switch (scale.unit) {\n case '%':\n return Math.round(value) + '%'\n case 'time':\n return humanize(value * 1000, { largest: 2 })\n case 'events':\n return value === 0 ? 'No events' : value === 1 ? '1 event' : value + ' events'\n }\n}\n\nfunction yAxisDisplay(timeSeries: ITimeSeries, max: number) {\n const scale = TimeSeriesTypeScale[timeSeries.type]\n switch (scale.unit) {\n case '%':\n return Math.round(max) + '%'\n case 'time':\n return humanize(max * 1000, { largest: 1, round: true })\n case 'events':\n return max === 0 ? 'No Events' : max === 1 ? '1 Event' : max + ' Events'\n }\n}\n","import React from 'react'\n\nexport const DeviceGeo: React.FC<{ geo?: IDevice['geo'] }> = ({ geo }) => {\n if (!geo) return null\n return (\n <>\n {geo.city && (\n <>\n {geo.city}\n
\n \n )}\n {geo.stateName && (\n <>\n {geo.stateName}\n
\n \n )}\n {geo.countryName && geo.countryName}\n \n )\n}\n","import React from 'react'\nimport browser, { windowOpen } from '../services/browser'\nimport { Link as RouterLink, LinkProps as RouterLinkProps } from 'react-router-dom'\nimport { Link as MUILink, LinkProps as MuiLinkProps } from '@mui/material'\n\nexport type LinkProps = Omit &\n MuiLinkProps & {\n to?: string\n noUnderline?: boolean\n }\n\nexport const Link = React.forwardRef(({ children, noUnderline, ...props }, ref) => {\n const attributes = { ...props }\n if (attributes.href?.startsWith('http')) {\n attributes.target = '_blank'\n attributes.rel = 'noopener'\n if (browser.isMobile) {\n attributes.onClick = () => windowOpen(attributes.href, '_blank', true)\n attributes.href = undefined\n }\n }\n\n attributes.sx = { ...attributes.sx, cursor: 'pointer' }\n if (attributes.to) attributes.component = RouterLink\n\n return (\n \n {children || attributes.to || attributes.href}\n \n )\n})\n","import React from 'react'\nimport { IP_PRIVATE } from '@common/constants'\nimport { TargetPlatform } from './TargetPlatform'\nimport { QualityDetails } from './QualityDetails'\nimport { ServiceIndicators } from './ServiceIndicators'\nimport { INITIATOR_PLATFORMS } from './InitiatorPlatform'\nimport { ListItemText, Chip, Typography } from '@mui/material'\nimport { lanShareRestriction, lanShared } from '../helpers/lanSharing'\nimport { ServiceGraphColumn } from './ServiceGraphColumn'\nimport { DeviceGraphColumn } from './DeviceGraphColumn'\nimport { ConnectAttribute } from './ConnectAttribute'\nimport { ServiceMiniState } from './ServiceMiniState'\nimport { RestoreButton } from '../buttons/RestoreButton'\nimport { ReactiveTags } from './ReactiveTags'\nimport { DeviceName } from './DeviceName'\nimport { LicenseChip } from './LicenseChip'\nimport { AvatarList } from './AvatarList'\nimport { PERMISSION } from '../models/organization'\nimport { DeviceRole } from './DeviceRole'\nimport { StatusChip } from './StatusChip'\nimport { TimeSeries } from './TimeSeries'\nimport { Timestamp } from './Timestamp'\nimport { DeviceGeo } from './DeviceGeo'\nimport { Duration } from './Duration'\nimport { toLookup } from '../helpers/utilHelper'\nimport { Avatar } from './Avatar'\nimport { Link } from './Link'\nimport { Icon } from './Icon'\n\nexport class Attribute {\n id: string = ''\n label: string | React.ReactNode = ''\n help?: string\n required: boolean = false\n align?: 'left' | 'right' | 'center'\n defaultWidth: number = 150\n type: 'MASTER' | 'SERVICE' | 'DEVICE' | 'INSTANCE' | 'CONNECTION' | 'RESTORE' | 'CUSTOMER' | 'SCRIPT' = 'MASTER'\n feature?: string // key to plan limit name - used for tagging visibility\n multiline?: boolean\n details: boolean = true // show on device details page\n column: boolean = true // show as device list column\n query?: string // key to device query - fall back to id\n value: (options: IDataOptions) => any = options => options\n width = (columnWidths: ILookup) => columnWidths[this.id] || this.defaultWidth\n\n constructor(options: {\n id: Attribute['id']\n label: Attribute['label']\n help?: Attribute['help']\n required?: Attribute['required']\n align?: Attribute['align']\n column?: Attribute['column']\n defaultWidth?: Attribute['defaultWidth']\n feature?: Attribute['feature']\n multiline?: Attribute['multiline']\n details?: Attribute['details']\n query?: Attribute['query']\n type?: Attribute['type']\n value?: Attribute['value']\n }) {\n Object.assign(this, options)\n }\n\n show(feature?: ILookup) {\n return !this.feature || !feature ? true : feature[this.feature]\n }\n}\n\nexport class DeviceAttribute extends Attribute {\n type: Attribute['type'] = 'DEVICE'\n}\n\nclass InstanceAttribute extends Attribute {\n type: Attribute['type'] = 'INSTANCE'\n}\n\nclass ServiceAttribute extends Attribute {\n type: Attribute['type'] = 'SERVICE'\n}\n\nclass ConnectionAttribute extends Attribute {\n type: Attribute['type'] = 'CONNECTION'\n}\n\nclass RestoreAttribute extends Attribute {\n type: Attribute['type'] = 'RESTORE'\n}\n\nconst ATTRIBUTES = [\n { label: 'Category A', id: 'categoryA' },\n { label: 'Category B', id: 'categoryB' },\n { label: 'Category C', id: 'categoryC' },\n { label: 'Category D', id: 'categoryD' },\n { label: 'Category E', id: 'categoryE' },\n { label: 'Status A', id: 'statusA' },\n { label: 'Status B', id: 'statusB' },\n { label: 'Status C', id: 'statusC' },\n { label: 'Status D', id: 'statusD' },\n { label: 'Status E', id: 'statusE' },\n]\n\nexport const attributes: Attribute[] = [\n new RestoreAttribute({\n id: 'restore',\n label: 'Restore',\n value: ({ device }) => device && ,\n required: true,\n }),\n new Attribute({\n id: 'deviceName',\n label: 'Name',\n defaultWidth: 400,\n required: true,\n details: false,\n value: ({ device, connection }) => (\n }\n secondary={device?.thisDevice ? 'This system' : undefined}\n sx={{ marginRight: 1, opacity: device?.state === 'active' ? 1 : 0.4 }}\n />\n ),\n }),\n new ServiceAttribute({\n id: 'serviceStatus',\n label: 'Status',\n defaultWidth: 100,\n details: false,\n value: ({ service, connection }) => (\n \n ),\n }),\n new ServiceAttribute({\n id: 'serviceAction',\n label: 'Action',\n details: false,\n defaultWidth: 160,\n value: ({ device, service, connection }) => ,\n }),\n new ServiceAttribute({\n id: 'serviceName',\n query: 'serviceView',\n label: 'Service Name',\n defaultWidth: 300,\n required: true,\n details: false,\n value: ({ service, connection }) => (\n }\n sx={{ marginRight: 1, opacity: service?.state === 'active' ? 1 : 0.4 }}\n />\n ),\n }),\n new ServiceAttribute({\n id: 'serviceState',\n query: 'serviceId',\n label: 'Type',\n defaultWidth: 110,\n details: false,\n value: ({ service, connection }) => ,\n }),\n new DeviceAttribute({\n id: 'status',\n label: 'Status',\n query: 'deviceName',\n defaultWidth: 100,\n value: ({ device, connections }) => ,\n }),\n new DeviceAttribute({\n id: 'deviceTimeSeries',\n query: 'deviceTimeSeries',\n label: ,\n details: false,\n value: ({ device }) => (\n event.stopPropagation()}\n sx={{ position: 'relative', zIndex: 3, paddingTop: 1 }}\n >\n \n \n ),\n }),\n new ServiceAttribute({\n id: 'serviceTimeSeries',\n details: false,\n label: ,\n value: ({ device, service }) => (\n event.stopPropagation()}\n sx={{ position: 'relative', zIndex: 3, paddingTop: 1 }}\n >\n \n \n ),\n }),\n new DeviceAttribute({\n id: 'tags',\n label: 'Tags',\n defaultWidth: 120,\n details: false,\n value: ({ instance }) => ,\n feature: 'tagging',\n }),\n new Attribute({\n id: 'qualitySmall',\n query: 'endpoint',\n label: 'Quality',\n defaultWidth: 120,\n value: ({ device }) => ,\n }),\n new DeviceAttribute({\n id: 'services',\n label: 'Services',\n details: false,\n value: ({ device, connections }) => ,\n defaultWidth: 300,\n }),\n new DeviceAttribute({\n id: 'deviceDescription',\n label: 'Description',\n query: 'attributes',\n multiline: true,\n details: false,\n value: ({ device }) => device?.attributes?.description,\n }),\n new DeviceAttribute({\n id: 'targetPlatform',\n label: 'Platform',\n query: 'deviceName',\n defaultWidth: 180,\n value: ({ device }) => TargetPlatform({ id: device?.targetPlatform, label: true }),\n }),\n new DeviceAttribute({\n id: 'quality',\n query: 'endpoint',\n label: 'Stability',\n value: ({ device }) => ,\n column: false,\n }),\n new InstanceAttribute({\n id: 'permissions',\n label: 'Permissions',\n defaultWidth: 210,\n value: ({ instance }) => {\n return instance?.permissions.map(p => (\n \n ))\n },\n }),\n new DeviceAttribute({\n id: 'role',\n query: 'owner',\n label: 'Role',\n defaultWidth: 100,\n value: ({ device }) => ,\n }),\n new DeviceAttribute({\n id: 'configurable',\n label: 'Configurable',\n query: 'attributes',\n help: 'Can be remotely configured',\n value: ({ device }) =>\n device?.configurable ? (\n <>\n \n   Yes\n \n ) : (\n <>\n \n   No\n \n ),\n }),\n new InstanceAttribute({\n id: 'owner',\n label: 'Owner',\n defaultWidth: 210,\n value: ({ instance }) =>\n instance && (\n \n {instance.owner.email}\n \n ),\n }),\n new InstanceAttribute({\n id: 'access',\n label: 'Guests',\n defaultWidth: 200,\n value: ({ instance }) => (instance?.access.length ? : null),\n }),\n new DeviceAttribute({\n id: 'license',\n label: 'License',\n defaultWidth: 100,\n value: ({ device }) => ,\n }),\n new DeviceAttribute({\n id: 'lastReported',\n label: 'Last reported',\n defaultWidth: 175,\n value: ({ device }) => (\n <>\n  \n {device?.state === 'active' && (\n \n since refresh\n \n )}\n \n ),\n }),\n new DeviceAttribute({\n id: 'created',\n label: 'Created date',\n defaultWidth: 175,\n value: ({ device }) => (device?.createdAt ? : undefined),\n }),\n new DeviceAttribute({\n id: 'isp',\n query: 'endpoint',\n label: 'ISP',\n value: ({ device }) => device?.geo?.isp,\n }),\n new DeviceAttribute({\n id: 'connectionType',\n query: 'endpoint',\n label: 'Connection type',\n value: ({ device }) => device?.geo?.connectionType,\n }),\n new DeviceAttribute({\n id: 'location',\n query: 'endpoint',\n label: 'Location',\n column: false,\n value: ({ device, session }) => {\n const geo = device?.geo || session?.geo\n return geo && \n },\n }),\n new DeviceAttribute({\n id: 'city',\n label: 'City',\n details: false,\n query: 'endpoint',\n defaultWidth: 115,\n value: ({ device }) => device?.geo?.city,\n }),\n new DeviceAttribute({\n id: 'state',\n label: 'State',\n details: false,\n query: 'endpoint',\n defaultWidth: 100,\n value: ({ device }) => device?.geo?.stateName,\n }),\n new DeviceAttribute({\n id: 'country',\n label: 'Country',\n details: false,\n query: 'endpoint',\n defaultWidth: 130,\n value: ({ device }) => device?.geo?.countryName,\n }),\n new DeviceAttribute({\n id: 'externalAddress',\n label: 'External IP',\n query: 'endpoint',\n defaultWidth: 180,\n value: ({ device }) => device?.externalAddress,\n }),\n new DeviceAttribute({\n id: 'internalAddress',\n label: 'Internal IP',\n query: 'endpoint',\n value: ({ device }) => device?.internalAddress,\n }),\n new DeviceAttribute({\n id: 'id',\n label: 'Device ID',\n defaultWidth: 180,\n value: ({ device }) => device?.id,\n }),\n new DeviceAttribute({\n id: 'hardwareId',\n label: 'Hardware ID',\n defaultWidth: 190,\n value: ({ device }) => device?.hardwareId,\n }),\n new DeviceAttribute({\n id: 'version',\n label: 'Daemon version',\n defaultWidth: 80,\n value: ({ device }) => device?.version,\n }),\n // @TODO add attributes to the device model on graphql request\n ...ATTRIBUTES.map(\n a =>\n new DeviceAttribute({\n id: a.id,\n label: a.label,\n query: 'attributes',\n value: ({ device }) => device?.attributes[a.id],\n multiline: true,\n })\n ),\n new DeviceAttribute({\n id: 'initiatorPlatform',\n label: 'Platform',\n value: ({ session }) => session && INITIATOR_PLATFORMS[session.platform],\n column: false,\n }),\n new ServiceAttribute({\n id: 'license',\n label: 'License',\n value: ({ service }) => ,\n }),\n new ServiceAttribute({\n id: 'serviceLink',\n label: 'Service Key',\n query: 'serviceView',\n details: false,\n value: ({ service }) => (service?.link?.url && !service.link.web ?
{service.link.code}
: null),\n }),\n new ServiceAttribute({\n id: 'serviceAccess',\n label: 'Users',\n defaultWidth: 200,\n details: false,\n value: ({ device, service }) => ,\n }),\n new ServiceAttribute({\n id: 'serviceLastReported',\n label: 'Last Reported',\n defaultWidth: 230,\n value: ({ service }) =>\n service?.state !== 'active' && service?.lastReported ? (\n \n ) : undefined,\n }),\n new ServiceAttribute({\n id: 'serviceCreated',\n label: 'Service Created',\n defaultWidth: 175,\n value: ({ service }) => ,\n }),\n new ServiceAttribute({\n id: 'serviceHost',\n label: 'Service Host',\n defaultWidth: 130,\n value: ({ service }) => service?.host || IP_PRIVATE,\n }),\n new ServiceAttribute({\n id: 'servicePort',\n label: 'Service Port',\n defaultWidth: 130,\n value: ({ service }) => service?.port,\n }),\n new ServiceAttribute({\n id: 'serviceProtocol',\n label: 'Service Protocol',\n value: ({ service }) => service?.protocol,\n }),\n new ServiceAttribute({\n id: 'serviceType',\n label: 'Service Type',\n value: ({ service }) => service?.type,\n }),\n new ServiceAttribute({\n id: 'serviceDockerId',\n label: 'Docker ID',\n value: ({ service }) => service?.attributes.docker?.id,\n }),\n new ServiceAttribute({\n id: 'serviceDockerName',\n label: 'Docker Name',\n value: ({ service }) => service?.attributes.docker?.name,\n }),\n new ServiceAttribute({\n id: 'serviceDockerImage',\n label: 'Docker Image',\n value: ({ service }) => service?.attributes.docker?.image,\n }),\n new ServiceAttribute({\n id: 'presenceAddress',\n label: 'Presence',\n value: ({ service }) => service?.presenceAddress,\n }),\n new ServiceAttribute({\n id: 'serviceId',\n label: 'Service ID',\n value: ({ service }) => service?.id,\n }),\n new ServiceAttribute({\n id: 'serviceDeviceId',\n label: 'Device ID',\n defaultWidth: 180,\n value: ({ device }) => device?.id,\n }),\n new ConnectionAttribute({\n id: 'duration',\n label: 'Duration',\n value: ({ connection, session }) => {\n const start = connection?.startTime ? new Date(connection.startTime) : session?.timestamp\n const end =\n start && connection?.endTime && connection.endTime > start.getTime() ? new Date(connection.endTime) : undefined\n return start && \n },\n }),\n new ConnectionAttribute({\n id: 'connection',\n label: 'Connection',\n value: ({ connection, session, application }) => {\n if (!connection) return null\n return connection.enabled\n ? connection.connecting\n ? 'Connecting...'\n : connection.public\n ? connection.connectLink\n ? 'Persistent Public Endpoint'\n : application?.reverseProxy\n ? 'Public Reverse Proxy'\n : 'Public Proxy'\n : !connection.connected && !session\n ? 'Idle - Connect on demand'\n : session?.source === 'WEBSOCKET'\n ? 'Peer to Peer WebSocket'\n : connection.isP2P || session?.isP2P\n ? 'Peer to Peer'\n : 'Local Proxy'\n : 'Inactive'\n },\n }),\n new ConnectionAttribute({\n id: 'session',\n label: 'Connection',\n value: ({ session, connection }) =>\n connection\n ? null\n : session?.isP2P\n ? session?.source === 'WEBSOCKET'\n ? 'Peer to Peer WebSocket'\n : 'Peer to Peer'\n : session?.manufacturer === 'ANONYMOUS'\n ? 'Public Reverse Proxy'\n : session?.manufacturer === 'KEY'\n ? 'Service Key'\n : 'Proxy',\n }),\n // new ConnectionAttribute({\n // id: 'security',\n // label: 'Security',\n // value: ({ connection, application }) => {\n // if (!connection) return undefined\n\n // if (connection.public)\n // return connection.publicRestriction === IP_LATCH\n // ? application?.reverseProxy\n // ? 'Public randomized url'\n // : 'This IP address only'\n // : 'Public'\n\n // return (\n // <>\n // \n // {lanShared(connection) ? 'Zero Trust (LAN shared)' : 'Zero Trust'}\n // \n // )\n // },\n // }),\n new ConnectionAttribute({\n id: 'bind',\n label: 'Bind Address',\n value: ({ connection }) => {\n if (lanShared(connection)) return connection?.ip\n },\n }),\n new ConnectionAttribute({\n id: 'restrict',\n label: 'Local Security',\n value: ({ connection }) => {\n if (lanShared(connection)) return lanShareRestriction(connection)\n },\n }),\n]\n\nconst attributeLookup = toLookup(attributes, 'id')\n\nexport const masterAttributes = attributes.filter(a => a.type === 'MASTER')\nexport const deviceAttributes = attributes.filter(a => ['DEVICE', 'INSTANCE'].includes(a.type))\nexport const deviceAttributesAll = attributes.filter(a => ['DEVICE', 'INSTANCE', 'MASTER'].includes(a.type))\nexport const networkAttributes = attributes.filter(a => a.type === 'INSTANCE')\nexport const serviceAttributes = attributes.filter(a => a.type === 'SERVICE')\nexport const serviceAttributesAll = attributes.filter(a => ['SERVICE', 'MASTER'].includes(a.type))\nexport const restoreAttributes = attributes.filter(a => a.type === 'RESTORE')\nexport const connectionAttributes = attributes.filter(a => a.type === 'CONNECTION')\n\nexport function getAttribute(id: string): Attribute {\n return attributeLookup[id] || new Attribute({ id: 'unknown', label: 'Unknown' })\n}\n","import { selectDeviceColumns } from '../selectors/devices'\nimport { graphQLBasicRequest } from './graphQL'\nimport { removeDeviceName } from '@common/nameHelper'\nimport { getTimeZone } from '../helpers/dateHelper'\nimport { getAttribute } from '../components/Attributes'\nimport { store } from '../store'\n\nconst DEVICE_PRELOAD_ATTRIBUTES = ['id', 'deviceName', 'status', 'permissions', 'owner', 'quality', 'license']\n\nconst SERVICE_PRELOAD_ATTRIBUTES = ['serviceId']\n\nconst ServiceSelectLookup: ILookup = {\n serviceId: `\n id\n name\n state\n title\n license\n application\n subdomain\n proxy\n link(type: [HTTPS, WSS]) {\n url\n code\n created\n password\n enabled\n }`,\n\n serviceView: `\n enabled\n created\n lastReported\n port\n host\n type\n protocol\n attributes\n presenceAddress\n access {\n user {\n id\n email\n }\n }`,\n\n serviceTimeSeries: `\n timeSeries(type: $serviceTSType, resolution: $serviceTSResolution, length: $serviceTSLength, timezone: \"${getTimeZone()}\") {\n type\n resolution\n start\n end\n time\n data\n }`,\n}\n\nconst SERVICE_SELECT = Object.keys(ServiceSelectLookup)\n .map(k => ServiceSelectLookup[k])\n .join('')\n\nconst DeviceSelectLookup: ILookup = {\n id: `\n id`,\n\n deviceName: `\n name\n configurable\n scriptable\n platform\n state`,\n\n license: `\n license`,\n\n version: `\n version`,\n\n hardwareId: `\n hardwareId`,\n\n lastReported: `\n lastReported`,\n\n permissions: `\n permissions`,\n\n created: `\n created`,\n\n attributes: `\n attributes`,\n\n tags: `\n tags (accountId: $accountId) {\n name\n color\n created\n }`,\n\n access: `\n access {\n user {\n id\n email\n }\n scripting\n }`,\n\n endpoint: `\n endpoint {\n onlineSince\n offlineSince\n externalAddress\n internalAddress\n availability\n instability\n quality\n geo {\n connectionType\n countryName\n stateName\n city\n isp\n }\n }`,\n\n owner: `\n owner {\n id\n email\n }`,\n\n presence: `\n presenceAddress\n `,\n\n installs: `\n supportedAppInstalls {\n id\n }\n `,\n\n notifications: `\n notificationSettings {\n emailNotifications\n desktopNotifications\n }`,\n\n deviceTimeSeries: `\n timeSeries(type: $deviceTSType, resolution: $deviceTSResolution, length: $deviceTSLength, timezone: \"${getTimeZone()}\") {\n type\n resolution\n start\n end\n time\n data\n }`,\n}\n\nconst DEVICE_SELECT = Object.keys(DeviceSelectLookup)\n .filter(k => k !== 'services')\n .map(k => DeviceSelectLookup[k])\n .join('')\n\nconst DEVICE_TIME_SERIES_PARAMS =\n ', $deviceTSType: TimeSeriesType!, $deviceTSResolution: TimeSeriesResolution!, $deviceTSLength: Int'\n\nconst SERVICE_TIME_SERIES_PARAMS =\n ', $serviceTSType: TimeSeriesType!, $serviceTSResolution: TimeSeriesResolution!, $serviceTSLength: Int'\n\nexport async function graphQLFetchDeviceList(params: gqlOptions) {\n return await graphQLBasicRequest(\n ` query DeviceList($size: Int, $from: Int, $name: String, $state: String, $tag: ListFilter, $accountId: String, $sort: String, $owner: Boolean, $application: [Int!], $platform: [Int!]${\n (params.columns.includes('deviceTimeSeries') ? DEVICE_TIME_SERIES_PARAMS : '') +\n (params.columns.includes('serviceTimeSeries') ? SERVICE_TIME_SERIES_PARAMS : '')\n }) {\n login {\n id\n account(id: $accountId) {\n devices(size: $size, from: $from, name: $name, state: $state, tag: $tag, sort: $sort, owner: $owner, application: $application, platform: $platform) {\n total\n items {\n ${deviceQueryColumns(params.columns)}\n }\n }\n }\n }\n }`,\n {\n tag: params.tag,\n size: params.size,\n from: params.from,\n state: params.state,\n sort: params.sort,\n owner: params.owner,\n application: params.applicationTypes,\n accountId: params.accountId,\n platform: params.platform,\n name: params.name?.trim() || undefined,\n deviceTSLength: params.deviceTimeSeries?.length,\n deviceTSType: params.deviceTimeSeries?.type,\n deviceTSResolution: params.deviceTimeSeries?.resolution,\n serviceTSLength: params.serviceTimeSeries?.length,\n serviceTSType: params.serviceTimeSeries?.type,\n serviceTSResolution: params.serviceTimeSeries?.resolution,\n }\n )\n}\n\nexport async function graphQLPreloadDevices(params: {\n accountId: string\n ids: string[]\n columns: string[]\n serviceTimeSeries?: ITimeSeriesOptions\n deviceTimeSeries?: ITimeSeriesOptions\n}) {\n return await graphQLBasicRequest(\n ` query DevicePreload($ids: [String!]!, $accountId: String${\n (params.columns.includes('deviceTimeSeries') ? DEVICE_TIME_SERIES_PARAMS : '') +\n (params.columns.includes('serviceTimeSeries') ? SERVICE_TIME_SERIES_PARAMS : '')\n }) {\n login {\n id\n account(id: $accountId) {\n device(id: $ids) {\n ${deviceQueryColumns(params.columns)}\n }\n }\n }\n }`,\n {\n ...params,\n deviceTSLength: params.deviceTimeSeries?.length,\n deviceTSType: params.deviceTimeSeries?.type,\n deviceTSResolution: params.deviceTimeSeries?.resolution,\n serviceTSLength: params.serviceTimeSeries?.length,\n serviceTSType: params.serviceTimeSeries?.type,\n serviceTSResolution: params.serviceTimeSeries?.resolution,\n }\n )\n}\n\nexport async function graphQLFetchConnections(params: { ids: string[] }) {\n return await graphQLBasicRequest(\n ` query Connections($ids: [String!]!) {\n login {\n id\n device(id: $ids) {\n ${deviceQueryColumns(selectDeviceColumns(store.getState()), ['tags', 'deviceTimeSeries'])}\n }\n }\n }`,\n params\n )\n}\n\n/* \n Fetches single, or array of devices across shared accounts by id\n*/\nexport async function graphQLFetchFullDevice(\n id: string,\n accountId: string,\n serviceTimeSeries?: ITimeSeriesOptions,\n deviceTimeSeries?: ITimeSeriesOptions\n) {\n return await graphQLBasicRequest(\n ` query Device($id: [String!]!, $accountId: String${SERVICE_TIME_SERIES_PARAMS + DEVICE_TIME_SERIES_PARAMS}) {\n login {\n id\n device(id: $id) {\n ${DEVICE_SELECT}\n services {\n ${SERVICE_SELECT}\n }\n }\n }\n }`,\n {\n id,\n accountId,\n deviceTSLength: deviceTimeSeries?.length,\n deviceTSType: deviceTimeSeries?.type,\n deviceTSResolution: deviceTimeSeries?.resolution,\n serviceTSLength: serviceTimeSeries?.length,\n serviceTSType: serviceTimeSeries?.type,\n serviceTSResolution: serviceTimeSeries?.resolution,\n }\n )\n}\n\nexport async function graphQLFetchDeviceCount({ size, tag, owner, accountId }: gqlOptions) {\n return await graphQLBasicRequest(\n ` query DeviceCount($size: Int, $tag: ListFilter, $accountId: String, $owner: Boolean) {\n login {\n account(id: $accountId) {\n devices(tag: $tag, owner: $owner, size: $size) {\n total\n }\n }\n }\n }`,\n {\n size,\n tag,\n owner,\n accountId,\n }\n )\n}\n\nexport function graphQLDeviceAdaptor({\n gqlDevices,\n accountId,\n hidden,\n loaded,\n serviceLoaded,\n}: {\n gqlDevices: any[]\n accountId: string\n hidden?: boolean\n loaded?: boolean\n serviceLoaded?: boolean\n}): IDevice[] {\n if (!gqlDevices || !gqlDevices.length) return []\n const state = store.getState()\n const thisId = state.backend.thisId\n let customAttributes = new Set()\n let data: IDevice[] = gqlDevices?.map((d: any): IDevice => {\n const owner = d.owner || state.auth.user\n return {\n id: d.id,\n name: d.name,\n owner: owner,\n state: d.state,\n loaded: !!loaded,\n configurable: d.configurable,\n scriptable: d.scriptable,\n hardwareId: d.hardwareId,\n createdAt: d.created ? new Date(d.created) : undefined,\n contactedAt: d.endpoint?.timestamp ? new Date(d.endpoint?.timestamp) : undefined,\n shared: accountId !== owner.id, //loginId !== owner.id && accountId === loginId,\n lastReported: d.lastReported && new Date(d.lastReported),\n externalAddress: d.endpoint?.externalAddress,\n internalAddress: d.endpoint?.internalAddress,\n targetPlatform: d.platform, // || 1214,\n availability: d.endpoint?.availability,\n instability: d.endpoint?.instability,\n quality: d.endpoint?.quality,\n onlineSince: new Date(d.endpoint?.onlineSince).getTime(),\n offlineSince: new Date(d.endpoint?.offlineSince).getTime(),\n version: d.version ? parseFloat(d.version) : undefined,\n geo: d.endpoint?.geo,\n license: d.license,\n permissions: d.permissions || [],\n attributes: processDeviceAttributes(d, customAttributes),\n tags: d.tags?.map(t => ({ ...t, created: new Date(t.created) })) || [],\n services: graphQLServiceAdaptor(d, loaded || serviceLoaded),\n presenceAddress: d.presenceAddress,\n notificationSettings: d.notificationSettings,\n supportedAppInstalls: d.supportedAppInstalls?.map(i => i.id) || [],\n timeSeries: processTimeSeries(d),\n access:\n d.access?.map((a: any) => ({\n id: a.user?.id,\n email: a.user?.email || a.user?.id,\n scripting: a.scripting,\n })) || [],\n thisDevice: d.id === thisId,\n hidden: !!hidden,\n accountId,\n }\n })\n store.dispatch.devices.customAttributes(customAttributes)\n store.dispatch.connections.updateFromServices({ devices: data, accountId })\n return data\n}\n\nexport function graphQLServiceAdaptor(device: any, loaded?: boolean): IService[] {\n return (\n device.services?.map(\n (s: any): IService => ({\n id: s.id,\n type: s.title,\n state: s.state,\n loaded: !!loaded,\n enabled: s.enabled,\n typeID: s.application,\n deviceID: device.id,\n subdomain: s.subdomain,\n createdAt: new Date(s.created),\n lastReported: s.lastReported && new Date(s.lastReported),\n contactedAt: new Date(s.endpoint?.timestamp),\n license: s.license,\n attributes: processServiceAttributes(s),\n name: removeDeviceName(device.name, s.name),\n port: s.port,\n host: s.host,\n protocol: s.protocol,\n presenceAddress: s.presenceAddress,\n timeSeries: processTimeSeries(s),\n link: s.link && {\n ...s.link,\n web: s.link?.url.startsWith('http'),\n created: new Date(s.link.created),\n },\n access: s.access?.map(e => ({\n email: e.user?.email || e.user?.id,\n id: e.user?.id,\n })),\n })\n ) || []\n )\n}\n\nfunction deviceQueryColumns(selectedColumns: string[], filter?: string[]) {\n let columns = DEVICE_PRELOAD_ATTRIBUTES.concat(SERVICE_PRELOAD_ATTRIBUTES).concat(selectedColumns)\n columns = columns.filter(c => (filter ? !filter.includes(c) : true))\n return attributeQuery(columns)\n}\n\nfunction attributeQuery(attributes: string[]) {\n let lookup = new Set()\n let query = ''\n let serviceQuery = ''\n\n attributes.forEach(c => {\n const a = getAttribute(c)\n lookup.add(a.query || a.id)\n })\n\n for (const l of lookup) {\n if (DeviceSelectLookup[l]) {\n query += DeviceSelectLookup[l]\n } else if (ServiceSelectLookup[l]) {\n serviceQuery += ServiceSelectLookup[l]\n // } else {\n // console.warn(`Missing query for attribute %c${l}`, 'font-weight: bold')\n }\n }\n\n if (serviceQuery) {\n query += `\n services { ${serviceQuery} }`\n }\n\n return query\n}\n\nfunction processDeviceAttributes(response: any, customAttributes: Set): IDevice['attributes'] {\n for (const attribute in response.attributes) {\n if (attribute !== '$remoteit') customAttributes.add(attribute)\n }\n return processAttributes(response)\n}\n\nfunction processServiceAttributes(response: any): IService['attributes'] {\n return processAttributes(response)\n}\n\nfunction processAttributes(response: any): ILookup {\n const root = response.attributes || {}\n const $ = root.$remoteit || {}\n let result = { ...root, ...$ }\n delete result.$remoteit\n return result\n}\n\nfunction processTimeSeries(response: any): ITimeSeries | undefined {\n if (!response.timeSeries) return\n const timeSeries = response.timeSeries\n return {\n ...timeSeries,\n start: new Date(timeSeries.start),\n end: new Date(timeSeries.end),\n time: timeSeries.time.map((t: any) => new Date(t)),\n }\n}\n","const config: BrandingConfig = {\n name: 'remoteit',\n appName: 'Remote.It',\n package: {\n homepage: 'https://app.remote.it',\n description: 'Remote.It cross platform desktop application for creating and hosting connections',\n author: {\n name: 'Remote.It',\n email: 'support@remote.it',\n },\n build: {\n appId: 'it.remote.desktop',\n copyright: 'remot3.it, Inc',\n productName: 'Remote.It',\n },\n },\n colors: {\n light: {\n brandPrimary: '#0096e7',\n brandSecondary: '#034b9d',\n },\n dark: {\n brandPrimary: '#0096e7',\n brandSecondary: '#034b9d',\n },\n },\n}\n\nexport default config\n","import React from 'react'\nimport { Icon, IconProps } from './Icon'\n\nexport const ArrowIcon: React.FC = props => {\n return \n}\n","import browser from '../services/browser'\nimport brand from '@common/brand/config'\nimport { lightColors, darkColors, spacing, radius, fontSizes } from './'\nimport { createTheme, Theme, ThemeOptions, PaletteOptions, ComponentsOverrides } from '@mui/material/styles'\nimport { ArrowIcon } from '../components/ArrowIcon'\nimport { State } from '../store'\n\ndeclare module '@mui/styles' {\n interface DefaultTheme extends Theme {}\n}\n\nexport const jssTheme = (isDark: boolean): ThemeOptions => {\n const LIST_ITEM_ICON_WIDTH = 56\n let colors = isDark ? darkColors : lightColors\n\n if (!browser.isApple) {\n radius.sm = 2\n radius.lg = 3\n }\n\n colors = addBrandColors(colors, isDark)\n\n const palette = {\n mode: isDark ? 'dark' : 'light',\n info: { main: colors.grayDark },\n action: { hover: colors.hover },\n primary: { main: colors.primary, dark: colors.primaryDark },\n // secondary: { main: '#F0F', contrastText: colors.white }, // this can later become the reseller editable color\n error: { main: colors.danger },\n primaryLight: { main: colors.primaryLight },\n primaryLighter: { main: colors.primaryLighter },\n primaryHighlight: { main: colors.primaryHighlight },\n primaryBackground: { main: colors.primaryBackground },\n brandPrimary: { main: colors.brandPrimary },\n brandSecondary: { main: colors.brandSecondary },\n successLight: { main: colors.successLight },\n success: { main: colors.success },\n successDark: { main: colors.successDark },\n dangerLight: { main: colors.dangerLight },\n danger: { main: colors.danger },\n warning: { main: colors.warning },\n warningLightest: { main: colors.warningLightest },\n warningHighlight: { main: colors.warningHighlight },\n gray: { main: colors.gray },\n grayLightest: { main: colors.grayLightest },\n grayLighter: { main: colors.grayLighter },\n grayLight: { main: colors.grayLight },\n grayDark: { main: colors.grayDark },\n grayDarker: { main: colors.grayDarker },\n grayDarkest: { main: colors.grayDarkest },\n black: { main: colors.black },\n white: { main: colors.white },\n alwaysWhite: { main: colors.alwaysWhite },\n darken: { main: colors.darken },\n screen: { main: colors.screen },\n shadow: { main: colors.shadow },\n rpi: { main: colors.rpi },\n guide: { main: colors.guide },\n test: { main: colors.test },\n }\n\n const ListItemStyles: ComponentsOverrides['MuiListItemButton'] & ComponentsOverrides['MuiListItem'] = {\n root: {\n opacity: 1,\n marginTop: 1,\n marginBottom: 1,\n borderRadius: radius.sm,\n padding: `5px 0px`,\n '&.Mui-selected': { backgroundColor: palette.primaryHighlight.main },\n '&.Mui-selected:hover': { backgroundColor: palette.primaryLighter.main },\n '& > .hidden, & > div > .hidden': { opacity: 0, transition: 'opacity 200ms 100ms' },\n '& > .hoverHide, & > div > .hoverHide': { opacity: 1, transition: 'opacity 400ms' },\n '&:hover': {\n '& > .hidden, & > div > .hidden': { opacity: 1 },\n '& > .hoverHide, & > div > .hoverHide': { opacity: 0 },\n },\n },\n gutters: {\n width: `calc(100% - ${spacing.md * 2}px)`,\n marginLeft: spacing.md,\n marginRight: spacing.md,\n },\n dense: {\n '& .MuiInputBase-root': { fontSize: fontSizes.base },\n '& .MuiFormHelperText-contained': { marginTop: 0, marginBottom: spacing.xs },\n },\n }\n\n return {\n palette: palette as PaletteOptions,\n typography: {\n fontFamily: \"'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif\",\n },\n // breakpoints: { @TODO: move arbitrary breakpoints to theme\n // values: {\n // xs: 0,\n // sm: 600, // 500 mobile?\n // md: 960,\n // lg: 1280,\n // xl: 1920, // 1800 max?\n // },\n // },\n components: {\n MuiCssBaseline: {\n styleOverrides: {\n body: {\n fontSize: '0.875rem',\n lineHeight: 1.43,\n },\n },\n },\n MuiDivider: {\n styleOverrides: {\n root: { borderColor: palette.action.hover, '&.MuiDivider-flexItem': { height: 1 } },\n inset: { marginRight: spacing.lg, marginLeft: spacing.lg },\n },\n },\n MuiAccordion: {\n styleOverrides: {\n root: {\n margin: 0,\n '&.Mui-disabled': { backgroundColor: palette.white.main },\n '&.Mui-expanded': { margin: 0 },\n '&:before': { display: 'none' },\n },\n rounded: {\n borderRadius: `${radius.lg}px !important`,\n paddingTop: spacing.sm,\n paddingBottom: spacing.sm,\n marginTop: spacing.md,\n '&.Mui-expanded, &.Mui-expanded:first-of-type': { marginTop: spacing.md },\n },\n },\n },\n MuiAccordionDetails: {\n styleOverrides: {\n root: { display: 'block', padding: 0 },\n },\n },\n MuiAccordionSummary: {\n styleOverrides: {\n root: {\n minHeight: 0,\n padding: 0,\n '&.Mui-disabled': {\n opacity: 1,\n pointerEvents: 'all',\n '& .fa-caret-down': { display: 'none' },\n '& .MuiButton-root:first-of-type': { pointerEvents: 'none' },\n },\n '&.Mui-expanded': { minHeight: 0 },\n },\n content: { margin: 0, '&.Mui-expanded': { margin: 0 } },\n },\n },\n MuiFormHelperText: {\n styleOverrides: {\n root: { fontSize: 10 },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: { borderRadius: radius.sm, padding: spacing.sm },\n sizeSmall: { padding: spacing.xs },\n },\n },\n MuiButton: {\n defaultProps: {\n disableElevation: true,\n },\n styleOverrides: {\n root: {\n color: palette.grayDark.main,\n borderRadius: radius.sm,\n fontWeight: 700,\n letterSpacing: 1.5,\n whiteSpace: 'nowrap',\n fontSize: fontSizes.xs,\n padding: `${spacing.sm}px ${spacing.md}px`,\n '&.MuiSvgIcon-root': { marginLeft: spacing.sm },\n },\n containedPrimary: {\n '&:hover': { backgroundColor: palette.primary.dark },\n },\n contained: {\n color: palette.alwaysWhite.main,\n '&:hover': { backgroundColor: palette.grayDarkest.main },\n '&:hover.Mui-disabled, &.Mui-disabled': {\n backgroundColor: palette.gray.main,\n color: palette.alwaysWhite.main,\n },\n },\n text: { padding: `${spacing.sm}px ${spacing.md}px` },\n outlined: { padding: `${spacing.sm}px ${spacing.md}px`, borderColor: palette.grayLighter.main },\n sizeLarge: {\n fontSize: fontSizes.sm,\n padding: `${spacing.sm}px ${spacing.lg}px`,\n borderRadius: radius.lg + radius.sm,\n },\n fullWidth: {\n '&.MuiButton-sizeLarge': {\n width: `calc(100% + ${spacing.md}px)`,\n marginLeft: -spacing.md / 2,\n marginRight: -spacing.md / 2,\n },\n },\n sizeSmall: {\n borderRadius: radius.lg,\n fontSize: fontSizes.xxs,\n padding: `${spacing.xs}px ${spacing.md}px`,\n minWidth: spacing.xxl,\n },\n },\n },\n MuiButtonBase: {\n styleOverrides: {\n root: {\n borderRadius: radius.sm,\n WebkitAppRegion: 'no-drag',\n '& .MuiTouchRipple-root': { color: palette.primary.main },\n },\n },\n },\n MuiChip: {\n styleOverrides: {\n root: {\n color: palette.grayDarker.main,\n borderRadius: radius.sm,\n backgroundColor: palette.grayLightest.main,\n textTransform: 'initial',\n '& .MuiChip-icon': { color: 'inherit', marginLeft: 8 },\n },\n clickable: {\n '&:hover': { backgroundColor: palette.primaryLighter.main },\n '&.MuiChip-colorPrimary:hover': { backgroundColor: palette.grayDarker.main },\n '&.MuiChip-colorPrimary:focus': { backgroundColor: palette.primary.main },\n },\n colorPrimary: {\n color: palette.alwaysWhite.main,\n backgroundColor: palette.primary.main,\n },\n sizeSmall: {\n height: 20,\n fontWeight: 400,\n color: 'inherit',\n borderRadius: radius.lg,\n fontSize: fontSizes.xs,\n paddingLeft: spacing.xxs,\n paddingRight: spacing.xxs,\n marginRight: spacing.xxs,\n },\n outlined: {\n borderColor: palette.grayLighter.main,\n color: palette.grayDarker.main,\n },\n },\n },\n MuiTabs: {\n styleOverrides: {\n root: {\n minHeight: 0,\n position: 'relative',\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n width: spacing.lg,\n top: 0,\n right: 0,\n bottom: 0,\n zIndex: 7,\n pointerEvents: 'none',\n backgroundImage: `linear-gradient(90deg, transparent, ${palette.white.main})`,\n },\n },\n flexContainer: {\n // Adding space to end of tabs to allow for fade\n '&::after': {\n content: '\"\"',\n minWidth: spacing.md,\n },\n },\n scrollButtons: {\n color: palette.grayDark.main,\n '&.Mui-disabled': { opacity: 0.2 },\n },\n },\n },\n MuiTab: {\n styleOverrides: {\n root: {\n borderRadius: radius.sm,\n minWidth: 0,\n minHeight: 0,\n textTransform: 'initial',\n fontWeight: 400,\n fontSize: fontSizes.xs,\n padding: `${spacing.xs}px ${spacing.sm}px`,\n color: palette.grayDark.main,\n '&:hover': { backgroundColor: palette.grayLighter.main, color: palette.grayDarkest.main },\n '&.Mui-selected': {\n backgroundColor: palette.primaryHighlight.main,\n fontWeight: 500,\n '&:hover': { color: palette.primary.main },\n },\n },\n },\n },\n MuiSnackbarContent: {\n styleOverrides: {\n root: {\n borderRadius: radius.lg,\n flexWrap: 'nowrap',\n padding: 0,\n '& .MuiSnackbarContent-message': { padding: 0 },\n },\n message: {\n width: '100%',\n },\n },\n },\n MuiCardHeader: {\n styleOverrides: {\n root: {\n paddingTop: spacing.xs,\n paddingBottom: spacing.xs,\n color: palette.white.main,\n },\n title: {\n fontSize: fontSizes.xxs,\n color: palette.white.main,\n letterSpacing: 0.5,\n },\n action: {\n fontSize: fontSizes.xxs,\n marginTop: 1,\n marginRight: 'initial',\n },\n },\n },\n MuiCardActions: {\n styleOverrides: {\n spacing: {\n paddingTop: 0,\n marginTop: -spacing.sm,\n paddingBottom: spacing.sm,\n justifyContent: 'flex-end',\n },\n },\n },\n MuiList: {\n styleOverrides: {\n padding: {\n paddingTop: spacing.sm,\n paddingBottom: spacing.sm,\n },\n },\n },\n MuiBadge: {\n styleOverrides: {\n badge: {\n fontSize: fontSizes.xxs,\n height: 16,\n minWidth: 16,\n padding: spacing.xxs,\n },\n dot: {\n padding: 0,\n height: 8,\n minWidth: 8,\n },\n },\n },\n MuiListSubheader: {\n styleOverrides: {\n root: {\n color: palette.grayDarkest.main,\n fontSize: fontSizes.xxs,\n lineHeight: `${spacing.xl}px`,\n textTransform: 'uppercase',\n letterSpacing: 2,\n fontWeight: 500,\n paddingLeft: spacing.md,\n paddingRight: spacing.md,\n },\n sticky: {\n zIndex: 5,\n backgroundColor: palette.white.main,\n },\n gutters: {\n marginLeft: spacing.md,\n marginRight: spacing.md,\n },\n },\n },\n MuiPaper: {\n styleOverrides: {\n rounded: { borderRadius: radius.lg },\n root: { backgroundColor: palette.white.main, backgroundImage: 'none' },\n },\n },\n MuiListItem: {\n styleOverrides: {\n ...ListItemStyles,\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n ...ListItemStyles,\n },\n },\n MuiListItemSecondaryAction: {\n defaultProps: {\n onMouseDown: (event: React.MouseEvent) => {\n event.stopPropagation()\n event.preventDefault()\n },\n onClick: (event: React.MouseEvent) => {\n event.stopPropagation()\n },\n },\n styleOverrides: {\n root: {\n zIndex: 2,\n right: spacing.md,\n '& .MuiTextField-root': { verticalAlign: 'middle' },\n },\n },\n },\n MuiListItemIcon: {\n styleOverrides: {\n root: { justifyContent: 'center', minWidth: LIST_ITEM_ICON_WIDTH, color: palette.grayDark.main },\n },\n },\n MuiListItemText: {\n styleOverrides: {\n root: { zIndex: 1 },\n primary: { lineHeight: 1.4 },\n secondary: {\n fontSize: fontSizes.xs,\n color: palette.grayDark.main,\n '& b': { color: palette.grayDarkest.main, fontWeight: 400 },\n },\n },\n },\n MuiMenu: {\n styleOverrides: {\n list: {\n backgroundColor: palette.grayLightest.main,\n '& .MuiListItemButton-dense, & .MuiMenuItem-dense': {\n width: `calc(100% - ${spacing.xs * 2}px)`,\n marginLeft: spacing.xs,\n marginRight: spacing.xs,\n paddingRight: spacing.sm,\n paddingLeft: spacing.xs,\n whiteSpace: 'nowrap',\n '& .MuiListItemText-root': { paddingRight: spacing.md },\n '& .MuiListItemIcon-root': { minWidth: LIST_ITEM_ICON_WIDTH },\n },\n '& .MuiMenuItem-dense': { paddingTop: '2px !important', paddingBottom: '2px !important' },\n '& > .MuiList-padding': { padding: 0 },\n '& .MuiListItemIcon-root': { minWidth: LIST_ITEM_ICON_WIDTH },\n '& .MuiListItemSecondaryAction-root': { right: spacing.sm },\n '& .MuiDivider-root': {\n marginTop: 10,\n marginBottom: 10,\n minWidth: 200,\n },\n },\n },\n },\n MuiMenuItem: {\n styleOverrides: {\n root: {\n color: palette.grayDarkest.main,\n fontSize: fontSizes.base,\n },\n gutters: {\n marginLeft: spacing.sm,\n marginRight: spacing.sm,\n },\n },\n },\n MuiInput: {\n styleOverrides: {\n root: {\n 'label+&': { marginTop: 10 },\n '&.Mui-disabled': {\n color: palette.grayDarker.main,\n '& svg': { display: 'none' },\n },\n },\n underline: {\n '&.Mui-disabled:before': { borderColor: palette.grayLight.main },\n '&:before, &:after': { display: 'none' },\n },\n },\n },\n MuiInputBase: {\n defaultProps: {\n // to keep from re-injecting styles in the head - slowing performance\n disableInjectingGlobalStyles: true,\n },\n styleOverrides: {\n root: {\n '& .MuiInputBase-input': {\n borderRadius: 0,\n height: '1.1876em',\n },\n '&.MuiFilledInput-root .MuiInputBase-input': {\n borderRadius: radius.sm,\n },\n '& .MuiInputBase-inputSizeSmall': {\n paddingTop: spacing.xxs,\n paddingBottom: spacing.xxs,\n },\n },\n input: {\n paddingTop: spacing.xxs,\n paddingBottom: spacing.xxs,\n borderRadius: radius.sm,\n },\n adornedEnd: {\n // interferers with global search adornment\n // '&.MuiInputBase-adornedEnd svg': { marginRight: 0 },\n // '&.MuiInputBase-adornedEnd > *': { marginRight: spacing.md },\n },\n },\n },\n MuiInputLabel: {\n styleOverrides: {\n shrink: {\n fontSize: fontSizes.sm,\n color: palette.grayDark.main,\n letterSpacing: 0.5,\n fontWeight: 500,\n textTransform: 'uppercase',\n },\n },\n },\n MuiTextField: {\n defaultProps: {\n onKeyDown: (event: React.KeyboardEvent) => {\n if (event.key === '#') event.stopPropagation()\n },\n },\n styleOverrides: {\n root: {\n '& .MuiSelect-iconStandard': { right: spacing.md },\n '& .MuiInputBase-sizeSmall': {\n marginTop: spacing.xxs,\n marginBottom: spacing.xxs,\n height: 20,\n borderRadius: radius.sm * 1.25,\n '& .MuiSelect-select': { fontSize: fontSizes.xxs },\n '& .MuiSelect-icon': { marginRight: 2 },\n },\n '& .MuiInputBase-hiddenLabel': { paddingTop: spacing.xxs, paddingBottom: spacing.xxs },\n '& .MuiSelect-filled.MuiInputBase-inputHiddenLabel.MuiFilledInput-input': {\n paddingRight: spacing.lg,\n '&.Mui-disabled': { WebkitTextFillColor: 'inherit' },\n },\n '& .MuiSelect-filled.MuiInputBase-inputHiddenLabel.Mui-disabled': { paddingRight: spacing.sm },\n '& .MuiSelect-icon.Mui-disabled': { display: 'none' },\n '& .MuiSelect-icon': { marginRight: spacing.xs },\n },\n },\n },\n MuiFilledInput: {\n styleOverrides: {\n root: {\n padding: 0,\n borderTopLeftRadius: radius.sm,\n borderBottomLeftRadius: radius.sm,\n borderTopRightRadius: radius.sm,\n borderBottomRightRadius: radius.sm,\n backgroundColor: palette.grayLightest.main,\n '&.Mui-focused': { backgroundColor: palette.primaryHighlight.main },\n '&.Mui-disabled': { backgroundColor: palette.grayLightest.main },\n '&:hover': { backgroundColor: palette.primaryHighlight.main },\n '&:focused': { backgroundColor: palette.primaryHighlight.main },\n // '& svg': { marginRight: spacing.xs }, // interfering with global search\n },\n input: { padding: '22px 12px 10px' },\n underline: { '&:before, &:after': { display: 'none' } },\n inputHiddenLabel: {\n paddingTop: spacing.sm,\n paddingBottom: spacing.sm,\n },\n },\n },\n MuiOutlinedInput: {\n styleOverrides: {\n root: { borderRadius: radius.sm },\n },\n },\n MuiSelect: {\n defaultProps: {\n disableInjectingGlobalStyles: true,\n IconComponent: ArrowIcon,\n },\n styleOverrides: {\n select: {\n '&:focus': { backgroundColor: 'inherit' },\n },\n },\n },\n MuiFormControl: {\n styleOverrides: {\n marginDense: {\n '& .MuiFilledInput-input': { paddingTop: spacing.sm, paddingBottom: spacing.sm },\n },\n },\n },\n MuiLink: {\n styleOverrides: {\n root: { padding: `0px ${spacing.xs}px` },\n underlineHover: {\n '&:hover': {\n backgroundColor: palette.primaryHighlight.main,\n borderRadius: radius.sm,\n textDecoration: 'none',\n cursor: 'pointer',\n },\n },\n },\n },\n MuiTypography: {\n styleOverrides: {\n h1: {\n fontSize: fontSizes.xl,\n fontWeight: 500,\n color: palette.grayDarkest.main,\n letterSpacing: -0.2,\n },\n h2: {\n fontSize: fontSizes.lg,\n fontWeight: 400,\n },\n h3: {\n fontSize: fontSizes.md,\n fontWeight: 400,\n '& > b': { fontWeight: 500 },\n },\n h4: {\n fontSize: fontSizes.sm,\n fontFamily: \"'Roboto Mono', Roboto\",\n color: palette.grayDark.main,\n marginTop: spacing.xs,\n marginBottom: spacing.sm,\n },\n h5: {\n fontSize: fontSizes.xxs, //'0.5625rem', // inputLabel shrink (12px * 0.75 || 9px)\n letterSpacing: 0.5,\n fontWeight: 500,\n textTransform: 'uppercase',\n },\n subtitle1: {\n fontFamily: \"'Roboto Mono', Roboto\",\n fontSize: fontSizes.xxs,\n color: palette.grayDarkest.main,\n display: 'flex',\n alignItems: 'center',\n minHeight: spacing.xl,\n padding: `${spacing.xxs}px ${spacing.md}px ${spacing.xxs}px ${spacing.xl}px`,\n textTransform: 'uppercase',\n letterSpacing: 2,\n marginTop: spacing.lg,\n fontWeight: 500,\n },\n subtitle2: {\n fontFamily: \"'Roboto Mono', Roboto\",\n fontSize: fontSizes.xxs,\n color: palette.grayDarkest.main,\n display: 'flex',\n alignItems: 'center',\n minHeight: spacing.lg,\n textTransform: 'uppercase',\n letterSpacing: 1.5,\n fontWeight: 500,\n },\n body1: {\n fontSize: fontSizes.md,\n '& b': { fontWeight: 500, color: palette.grayDarker.main },\n },\n body2: {\n fontSize: fontSizes.base,\n '& b': { fontWeight: 500 },\n },\n caption: {\n fontSize: fontSizes.sm,\n color: palette.grayDark.main,\n lineHeight: '1.25em',\n '& b': { color: palette.grayDarkest.main, fontWeight: 400 },\n },\n gutterBottom: { marginBottom: spacing.md },\n },\n },\n MuiDialogTitle: {\n styleOverrides: {\n root: { margin: `${spacing.lg}px ${spacing.xl}px 0`, padding: 0, lineHeight: '1.1em' },\n },\n },\n MuiDialogContent: {\n styleOverrides: {\n root: { margin: `${spacing.sm}px ${spacing.xl}px`, padding: 0 },\n },\n },\n MuiDialogActions: {\n styleOverrides: {\n root: { margin: `0 ${spacing.md}px ${spacing.sm}px`, padding: 0 },\n },\n },\n MuiTooltip: {\n styleOverrides: {\n tooltip: {\n '& .MuiDivider-root': { margin: `${spacing.xxs}px 0`, borderColor: palette.alwaysWhite.main, opacity: 0.3 },\n },\n },\n defaultProps: {\n enterTouchDelay: 200,\n },\n },\n MuiTableCell: {\n styleOverrides: {\n root: {\n borderBottom: `1px solid ${palette.grayLighter.main}`,\n },\n },\n },\n MuiBottomNavigation: {\n styleOverrides: {\n root: { backgroundColor: palette.white.main },\n },\n },\n },\n }\n}\n\nexport function getTheme(isDark: boolean) {\n console.log('SELECT THEME. DARK MODE:', isDark)\n const theme = createTheme(jssTheme(isDark))\n return theme\n}\n\nexport function isDarkMode(themeMode?: State['ui']['themeMode']) {\n let darkMode = window?.matchMedia && window?.matchMedia('(prefers-color-scheme: dark)').matches\n if (themeMode === 'dark') darkMode = true\n if (themeMode === 'light') darkMode = false\n return darkMode\n}\n\nexport function addBrandColors(colors: any, isDark: boolean) {\n const brandColors = isDark ? brand.colors.dark : brand.colors.light\n return { ...colors, ...brandColors }\n}\n","import { Duration } from 'luxon'\nimport { createSelector } from 'reselect'\nimport { findLongestLength, defaultDeviceTimeSeries, defaultServiceTimeSeries } from '../helpers/dateHelper'\nimport {\n getDefaultSelected,\n getThemeDark,\n getUpdateStatus,\n getNotifiedVersion,\n getPreferences,\n getDeviceTimeSeries,\n getServiceTimeSeries,\n} from './state'\nimport { selectActiveAccountId } from './accounts'\nimport { selectLimit } from './organizations'\nimport { getTheme } from '../styling/theme'\nimport { version } from '../helpers/versionHelper'\n\nexport const selectDefaultSelectedPage = createSelector(\n [selectActiveAccountId, getDefaultSelected],\n (activeAccountId, defaultSelected) => defaultSelected[activeAccountId] || {}\n)\n\nexport const selectTheme = createSelector([getThemeDark], getTheme)\n\nexport const selectUpdateNotice = createSelector(\n [getUpdateStatus, getPreferences, getNotifiedVersion],\n (updateStatus, preferences, notifiedVersion) => {\n if (preferences.autoUpdate && updateStatus.downloaded && updateStatus.version !== version) {\n if (!notifiedVersion || notifiedVersion !== updateStatus.version) return updateStatus.version\n }\n }\n)\n\nexport const selectTimeSeriesDefaults = createSelector([state => selectLimit(state, undefined, 'log-limit')], logLimit => ({\n deviceTimeSeries: {\n ...defaultDeviceTimeSeries,\n length: findLongestLength(Duration.fromISO(logLimit?.value), defaultDeviceTimeSeries.resolution),\n },\n serviceTimeSeries: {\n ...defaultServiceTimeSeries,\n length: findLongestLength(Duration.fromISO(logLimit?.value), defaultServiceTimeSeries.resolution),\n },\n}))\n\nexport const selectTimeSeries = createSelector(\n [selectTimeSeriesDefaults, getDeviceTimeSeries, getServiceTimeSeries],\n (timeSeriesDefaults, deviceTimeSeries, serviceTimeSeries) => {\n return {\n deviceTimeSeries: deviceTimeSeries || timeSeriesDefaults.deviceTimeSeries,\n serviceTimeSeries: serviceTimeSeries || timeSeriesDefaults.serviceTimeSeries,\n }\n }\n)\n","import structuredClone from '@ungap/structured-clone'\nimport { graphQLRegistration, graphQLRestoreDevice } from '../services/graphQLRequest'\nimport {\n graphQLDeleteDevice,\n graphQLDeleteDevices,\n graphQLUnShareDevice,\n graphQLRename,\n graphQLSetAttributes,\n graphQLClaimDevice,\n graphQLAddService,\n graphQLUpdateService,\n graphQLRemoveService,\n graphQLInstallApp,\n graphQLRemoveApp,\n graphQLSetDeviceNotification,\n graphQLTransferDevice,\n graphQLRemoveLink,\n graphQLSetLink,\n} from '../services/graphQLMutation'\nimport {\n graphQLFetchDeviceCount,\n graphQLFetchDeviceList,\n graphQLFetchFullDevice,\n graphQLPreloadDevices,\n graphQLDeviceAdaptor,\n} from '../services/graphQLDevice'\nimport { selectTimeSeries } from '../selectors/ui'\nimport {\n getAllDevices,\n getDeviceModel,\n selectDevice,\n selectById,\n selectActiveColumns,\n selectDeviceModelAttributes,\n} from '../selectors/devices'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { AxiosResponse } from 'axios'\nimport { createModel } from '@rematch/core'\nimport { RootModel } from '.'\nimport { State } from '../store'\n\ntype IDeviceState = {\n all: IDevice[]\n initialized: boolean\n accountId: string\n total: number\n results: number\n searched: boolean\n fetching: boolean\n fetchingMore: boolean\n query: string\n append: boolean\n filter: 'all' | 'active' | 'inactive'\n sort: string\n tag?: ITagFilter\n owner: 'all' | 'me' | 'others'\n platform?: number[]\n applicationTypes?: number[]\n size: number\n from: number\n eventsUrl: string\n sortServiceOption: ISortServiceType\n customAttributes: string[]\n}\n\nexport const defaultState: IDeviceState = {\n all: [],\n initialized: false,\n accountId: '',\n total: 0,\n results: 0,\n searched: false,\n fetching: true,\n fetchingMore: false,\n query: '',\n append: false,\n filter: 'all',\n sort: 'state,name',\n tag: undefined,\n owner: 'all',\n platform: undefined,\n applicationTypes: undefined,\n size: 50,\n from: 0,\n eventsUrl: '',\n sortServiceOption: 'ATOZ',\n customAttributes: [],\n}\n\ntype IDeviceAccountState = {\n [accountId: string]: IDeviceState\n}\n\nconst defaultAccountState: IDeviceAccountState = {\n default: { ...defaultState },\n}\n\nexport default createModel()({\n state: { ...defaultAccountState },\n effects: dispatch => ({\n async fetchList(_: void, state) {\n const accountId = selectActiveAccountId(state)\n const deviceModel = selectDeviceModelAttributes(state, accountId)\n const columns = selectActiveColumns(state, accountId)\n const { set, graphQLListProcessor } = dispatch.devices\n const { truncateMergeDevices, appendUniqueDevices } = dispatch.accounts\n const { query, owner, filter, append, searched } = deviceModel\n const { deviceTimeSeries, serviceTimeSeries } = selectTimeSeries(state)\n\n const options: gqlOptions = {\n accountId,\n name: query,\n columns,\n deviceTimeSeries,\n serviceTimeSeries,\n size: deviceModel.size,\n from: deviceModel.from,\n tag: deviceModel.tag,\n sort: deviceModel.sort,\n platform: deviceModel.platform,\n applicationTypes: deviceModel.applicationTypes,\n state: filter === 'all' ? undefined : filter,\n owner: owner === 'all' ? undefined : owner === 'me',\n }\n\n set({ fetching: true, accountId })\n const { devices, total, error } = await graphQLListProcessor(options)\n\n if (searched) set({ results: total, accountId })\n else set({ total, accountId })\n\n if (append) {\n await appendUniqueDevices({ devices, accountId })\n } else {\n await truncateMergeDevices({ devices, accountId })\n }\n\n if (!error) dispatch.search.updateSearch()\n set({ fetching: false, append: false, initialized: true, accountId })\n },\n\n async fetchIfEmpty(_: void, state) {\n const deviceModel = selectDeviceModelAttributes(state)\n if (!deviceModel.initialized) {\n await dispatch.devices.fetchList()\n await dispatch.applicationTypes.fetch()\n }\n },\n\n async fetchDevices({ ids, hidden, accountId }: { ids: string[]; hidden?: boolean; accountId?: string }, state) {\n accountId = accountId || selectActiveAccountId(state)\n const gqlResponse = await graphQLPreloadDevices({\n ids,\n accountId,\n columns: selectActiveColumns(state, accountId),\n ...selectTimeSeries(state),\n })\n\n if (gqlResponse === 'ERROR') return []\n\n const result = gqlResponse?.data?.data?.login?.account?.device\n const devices = graphQLDeviceAdaptor({ gqlDevices: result, accountId, hidden })\n if (devices.length) {\n await dispatch.accounts.mergeDevices({ devices, accountId })\n await dispatch.connections.updateConnectionState({ devices, accountId })\n }\n },\n\n async fetchSingleFull(\n {\n id,\n hidden,\n redirect,\n thisDevice,\n newDevice,\n isService,\n accountId,\n silent,\n }: {\n id: string // service or device id\n hidden?: boolean\n redirect?: string\n thisDevice?: boolean\n newDevice?: boolean\n isService?: boolean\n accountId?: string\n silent?: boolean\n },\n state\n ) {\n if (!id) return\n\n accountId = accountId || selectActiveAccountId(state)\n let result: IDevice | undefined\n\n if (!silent) dispatch.devices.set({ fetching: true, accountId })\n const { serviceTimeSeries, deviceTimeSeries } = selectTimeSeries(state)\n\n const gqlResponse = await graphQLFetchFullDevice(id, accountId, serviceTimeSeries, deviceTimeSeries)\n if (gqlResponse !== 'ERROR') {\n const gqlData = gqlResponse?.data?.data?.login || {}\n result = graphQLDeviceAdaptor({ gqlDevices: gqlData.device, accountId, hidden, loaded: true })[0]\n }\n\n if (result) {\n result.thisDevice = result.thisDevice || thisDevice\n if (newDevice) {\n result.newDevice = true\n dispatch.devices.incrementTotal(accountId)\n }\n console.log('FETCHED FULL DEVICE', { id, device: result, accountId })\n await dispatch.connections.updateConnectionState({ devices: [result], accountId })\n await dispatch.accounts.setDevice({ id: result.id, device: result, accountId, prepend: newDevice })\n } else {\n if (!isService && state.ui.silent !== id)\n dispatch.ui.set({\n noticeMessage: `You don't have access to that ${isService ? 'service' : 'device'}. (${id})`,\n })\n if (redirect) dispatch.ui.set({ redirect })\n if (gqlResponse !== 'ERROR') {\n if (isService) dispatch.connections.forget(id)\n else dispatch.devices.cleanup([id])\n }\n }\n\n if (!silent) dispatch.devices.set({ fetching: false, accountId })\n },\n\n async fetchCount(params: Partial, state) {\n const options: gqlOptions = {\n size: 0,\n from: 0,\n owner: true,\n columns: [],\n accountId: selectActiveAccountId(state),\n tag: params.tag?.values.length ? params.tag : undefined,\n }\n\n if (params.access === 'NONE' || (params.access === 'TAG' && !options.tag)) return 0\n\n const result = await graphQLFetchDeviceCount(options)\n if (result === 'ERROR') return\n const count = result?.data?.data?.login?.account?.devices?.total || 0\n return count\n },\n\n async sortByState(accountId: string | void, state) {\n accountId = accountId || selectActiveAccountId(state)\n const deviceModel = getDeviceModel(state, accountId)\n const all = [...deviceModel.all]\n\n const sortKeys = deviceModel.sort.split(',').map(k => {\n const direction = k.startsWith('-') ? -1 : 1\n const key = k.startsWith('-') ? k.slice(1) : k\n return { key, direction }\n })\n /* \n Because some of the internal key names don't match the gql ones\n and we are accounting for stage changes, we can just sort if it's by state.\n */\n if (sortKeys[0].key !== 'state') return\n\n const result = all.sort((a, b) => {\n for (let { key, direction } of sortKeys) {\n let [keyA, keyB]: any = [a, b]\n key.split('.').forEach(subKey => {\n keyA = keyA?.[subKey]\n keyB = keyB?.[subKey]\n })\n\n const valueA = typeof keyA === 'string' ? keyA.toLowerCase() : keyA\n const valueB = typeof keyB === 'string' ? keyB.toLowerCase() : keyB\n\n if (valueA < valueB) return -1 * direction\n if (valueA > valueB) return 1 * direction\n }\n return 0\n })\n\n console.log('SORT DEVICES', { accountId, sortKeys })\n await dispatch.devices.set({ all: result, accountId })\n },\n\n async expire(_: void, state) {\n const activeAccountId = selectActiveAccountId(state)\n const rootState = structuredClone(state.devices)\n const expired: string[] = []\n\n for (const accountId in rootState) {\n if (['default', 'connections', activeAccountId].includes(accountId)) continue\n rootState[accountId].initialized = false\n expired.push(accountId)\n }\n\n console.log('EXPIRE DEVICES CACHE', expired)\n await dispatch.devices.rootSet(rootState)\n },\n\n async clearLoaded(_: void, state) {\n const accountId = selectActiveAccountId(state)\n const all = [...getDeviceModel(state, accountId).all]\n for (const id in all) {\n if (all[id].loaded) all[id] = { ...all[id], loaded: false }\n }\n await dispatch.devices.set({ all, accountId })\n },\n\n async graphQLListProcessor(options: gqlOptions) {\n const gqlResponse = await graphQLFetchDeviceList(options)\n if (gqlResponse === 'ERROR') return { devices: [], total: 0, error: true }\n\n const [gqlDevices, total] = graphQLMetadata(gqlResponse)\n const devices = graphQLDeviceAdaptor({\n gqlDevices,\n accountId: options.accountId,\n serviceLoaded: !!options.applicationTypes?.length,\n })\n return { devices, total }\n },\n\n async rename({ id, name }: { id: string; name: string }) {\n await graphQLRename(id, name)\n },\n\n async addService({ deviceId, service }: { deviceId: string; service: IService }, state) {\n let device = await selectDevice(state, undefined, deviceId)\n device = structuredClone(device)\n if (!device) return\n device.services.push({ ...service, deviceID: deviceId })\n dispatch.accounts.setDevice({ id: deviceId, device })\n },\n\n async updateService({ id, set }: { id: string; set: Partial }, state) {\n let [_, device] = selectById(state, undefined, id)\n device = structuredClone(device)\n if (!device) return\n const index = device.services.findIndex((s: IService) => s.id === id)\n if (index === -1) return\n for (const key in set) device.services[index][key] = set[key]\n dispatch.accounts.setDevice({ id: device.id, device })\n },\n\n async removeService(id: string, state) {\n let [_, device] = selectById(state, undefined, id)\n device = structuredClone(device)\n if (!device) return\n const index = device.services.findIndex((s: IService) => s.id === id)\n device.services.splice(index, 1)\n dispatch.accounts.setDevice({ id: device.id, device })\n },\n\n async setAttributes(device: IDevice) {\n graphQLSetAttributes(device.attributes, device.id)\n dispatch.accounts.setDevice({ id: device.id, device })\n },\n\n async setNotificationDevice(device: IDevice) {\n graphQLSetDeviceNotification(\n device.id,\n device.notificationSettings.emailNotifications,\n device.notificationSettings.desktopNotifications\n )\n dispatch.accounts.setDevice({ id: device.id, device })\n },\n\n async setServiceAttributes(service: IService, state) {\n let [_, device] = selectById(state, undefined, service.deviceID)\n device = structuredClone(device)\n if (!device) return\n const index = device.services.findIndex((s: IService) => s.id === service.id)\n if (index === -1) return\n device.services[index].attributes = service.attributes\n graphQLSetAttributes(service.attributes, service.id)\n dispatch.accounts.setDevice({ id: device.id, device })\n },\n\n async cloudAddService({ form, deviceId }: { form: IService; deviceId: string }, state) {\n if (!form.host || !form.port) return\n const result = await graphQLAddService({\n deviceId,\n name: form.name,\n application: form.typeID,\n host: form.host,\n port: form.port,\n enabled: !!form.enabled,\n })\n if (result !== 'ERROR') {\n const id = result?.data?.data?.addService?.id\n console.log('CLOUD ADD SERVICE', { id, form })\n if (id) {\n await graphQLSetAttributes(form.attributes, id)\n dispatch.devices.addService({ deviceId, service: { ...form, id } })\n dispatch.ui.set({ redirect: `/devices/${deviceId}/${id}/connect` })\n }\n\n const device = await selectDevice(state, undefined, deviceId)\n if (device?.supportedAppInstalls.includes(form.typeID)) {\n await graphQLInstallApp({\n deviceIds: [deviceId],\n application: form.typeID,\n })\n }\n }\n },\n\n async cloudUpdatePresenceAddress({ id, set }: { id: string; set: ILookup }, state) {\n let device = structuredClone(selectDevice(state, undefined, id))\n if (!device) return\n for (const key in set) device[key] = set[key]\n dispatch.accounts.setDevice({ id: device.id, device })\n await graphQLUpdateService({ id, presenceAddress: set.presenceAddress })\n },\n\n async cloudUpdateService({ form, deviceId }: { form: IService; deviceId: string }) {\n if (!form.host || !form.port) return\n dispatch.ui.set({ setupServiceBusy: form.id })\n const set: ICloudUpdateService = {\n id: form.id || deviceId,\n name: form.name,\n application: form.typeID,\n host: form.host,\n port: form.port,\n enabled: !!form.enabled,\n presenceAddress: form.presenceAddress,\n }\n await graphQLUpdateService(set)\n dispatch.devices.updateService({ id: form.id, set })\n dispatch.ui.set({ setupServiceBusy: undefined })\n },\n\n async cloudRemoveService({ serviceId, deviceId }: { serviceId: string; deviceId: string }, state) {\n console.log('REMOVING SERVICE', serviceId, deviceId)\n dispatch.ui.set({\n setupServiceBusy: serviceId,\n setupDeletingService: serviceId,\n silent: serviceId,\n redirect: `/devices/${deviceId}/details`,\n })\n const result = await graphQLRemoveService(serviceId)\n\n if (result !== 'ERROR') {\n await dispatch.devices.cleanupService(serviceId)\n dispatch.ui.set({\n successMessage: `Service was successfully removed.`,\n })\n }\n\n let [service, device] = selectById(state, undefined, serviceId)\n if (service && device?.supportedAppInstalls.includes(service.typeID)) {\n await graphQLRemoveApp({\n deviceIds: [deviceId],\n application: service.typeID,\n })\n }\n\n dispatch.ui.set({ setupServiceBusy: undefined, setupDeletingService: undefined })\n },\n\n async setLink({ serviceId, enabled }: { serviceId: string; enabled: boolean }) {\n if (!serviceId) return\n\n const result = await graphQLSetLink({ serviceId, enabled })\n\n if (result === 'ERROR' || !result?.data?.data?.setConnectLink?.code) {\n dispatch.ui.set({ errorMessage: 'Could not update service.' })\n return\n }\n\n const data = result?.data?.data?.setConnectLink\n await dispatch.devices.updateService({\n id: serviceId,\n set: {\n link: {\n ...data,\n created: new Date(data.created),\n },\n },\n })\n },\n\n async removeLink(id: string) {\n await dispatch.devices.updateService({ id, set: { link: undefined } })\n const result = await graphQLRemoveLink(id)\n\n if (result === 'ERROR') {\n dispatch.ui.set({ errorMessage: 'An error occurred when trying to remove the service link.' })\n await dispatch.devices.fetchSingleFull({ id, isService: true })\n }\n },\n\n async claimDevice({ code, redirect }: { code: string; redirect?: boolean }, state) {\n const accountId = selectActiveAccountId(state)\n\n dispatch.ui.set({ claiming: true })\n dispatch.ui.guide({ guide: 'aws', step: 2 })\n\n const result = await graphQLClaimDevice(code, accountId)\n await dispatch.accounts.set({ activeId: accountId })\n\n if (result !== 'ERROR') {\n const device = result?.data?.data?.claimDevice\n if (device?.id) {\n // fixme should fetch single and in memory sort\n await dispatch.devices.fetchList() // fetch all so that the sorting is correct\n await dispatch.applicationTypes.fetch()\n dispatch.ui.set({\n redirect: redirect ? `/devices/${device.id}` : undefined,\n successMessage: `'${device.name}' was successfully registered!`,\n })\n } else {\n dispatch.ui.set({ noticeMessage: `Your device (${code}) could not be found.` })\n }\n dispatch.ui.set({ claiming: false })\n }\n\n dispatch.ui.guide({ guide: 'aws', step: 3 })\n },\n\n async createRegistration({\n name,\n services,\n platform,\n tags,\n accountId,\n template,\n }: {\n name?: string\n services: IServiceRegistration[]\n platform?: number\n tags?: string[]\n accountId: string\n template?: string | boolean\n }) {\n if (platform === 65535) platform = undefined // Clear out the platform if it's the unknown type\n const result = await graphQLRegistration({ name, services, platform, tags, accountId })\n if (result !== 'ERROR') {\n let { registrationCommand, registrationCode } = result?.data?.data?.login?.account\n if (template && typeof template === 'string') registrationCommand = template.replace('[CODE]', registrationCode)\n console.log('CREATE REGISTRATION', registrationCode)\n dispatch.ui.set({ registrationCommand, registrationCode })\n return registrationCode\n }\n },\n\n async getRestoreCommand(deviceId, state): Promise<{ restoreCommand?: string; restoreCode?: string }> {\n const accountId = selectActiveAccountId(state)\n const result = await graphQLRestoreDevice({ id: deviceId, accountId })\n if (result !== 'ERROR') {\n let { restoreCommand, restoreCode } = result?.data?.data?.login?.account?.device?.[0]\n console.log('GET RESTORE CODE', restoreCode)\n return { restoreCommand, restoreCode }\n }\n return {}\n },\n\n async destroy(device: IDevice) {\n dispatch.ui.set({ destroying: true, silent: device.id })\n const result = await graphQLDeleteDevice(device.id)\n if (result !== 'ERROR') {\n await dispatch.devices.cleanup([device.id])\n dispatch.ui.set({\n successMessage: `\"${device.name}\" was successfully deleted.`,\n })\n }\n dispatch.ui.set({ destroying: false })\n },\n\n async destroySelected(deviceIds: string[], state) {\n if (!deviceIds.length) return\n\n // Check that delete is allowed for all devices\n for (const id of deviceIds) {\n const device = selectDevice(state, undefined, id)\n if (!device) {\n dispatch.ui.set({\n errorMessage: `A device id could not be found. Deselect ${id} and try again.`,\n })\n return\n }\n if (device.shared) {\n dispatch.ui.set({\n errorMessage: `You cannot delete a shared device. Deselect or leave \"${device.name}\" and try again.`,\n })\n return\n }\n if (device.state !== 'inactive') {\n dispatch.ui.set({\n errorMessage: `You cannot delete an online device. Deselect \"${device.name}\" and try again.`,\n })\n return\n }\n if (!device.permissions.includes('MANAGE')) {\n dispatch.ui.set({\n errorMessage: `You do not have permission to delete a device. Deselect \"${device.name}\" and try again.`,\n })\n return\n }\n }\n\n dispatch.ui.set({ destroying: true })\n const result = await graphQLDeleteDevices(deviceIds)\n if (result !== 'ERROR') {\n await dispatch.ui.set({ selected: [] })\n await dispatch.devices.cleanup(deviceIds)\n dispatch.ui.set({\n successMessage: `${deviceIds.length} device${deviceIds.length > 1 ? 's were' : ' was'} successfully deleted.`,\n })\n }\n dispatch.ui.set({ destroying: false })\n },\n\n async leave(device: IDevice, state) {\n const { auth } = state\n dispatch.ui.set({ destroying: true, silent: device.id })\n const result = await graphQLUnShareDevice({\n deviceId: device.id,\n email: [auth.user?.email || ''],\n })\n if (result !== 'ERROR') {\n await dispatch.devices.cleanup([device.id])\n dispatch.ui.set({\n successMessage: `\"${device.name}\" was successfully removed.`,\n })\n }\n dispatch.ui.set({ destroying: false })\n },\n\n async customAttributes(customAttributes: Set, state) {\n const unique = new Set([...customAttributes, ...selectDeviceModelAttributes(state).customAttributes])\n dispatch.devices.set({ customAttributes: [...Array.from(unique)].sort() })\n },\n\n async transferDevice(data: ITransferProps) {\n if (data.email && data.device) {\n dispatch.ui.set({ transferring: true, silent: data.device.id })\n const result = await graphQLTransferDevice(data)\n if (result !== 'ERROR') {\n await dispatch.devices.cleanup([data.device.id])\n dispatch.ui.set({\n successMessage: `\"${data.device.name}\" was successfully transferred to ${data.email}.`,\n })\n }\n dispatch.ui.set({ transferring: false })\n }\n },\n\n async cleanup(deviceIds: string[]) {\n for (const id of deviceIds) {\n await dispatch.connections.clearByDevice(id)\n await dispatch.networks.clearById(id)\n await dispatch.accounts.removeDevice(id)\n }\n await dispatch.connections.fetch()\n },\n\n async cleanupService(serviceId: string) {\n await dispatch.devices.removeService(serviceId)\n await dispatch.connections.clear(serviceId)\n await dispatch.networks.clearById(serviceId)\n },\n\n async incrementTotal(accountId: string, state) {\n accountId = accountId || selectActiveAccountId(state)\n const total = selectDeviceModelAttributes(state, accountId).total + 1\n console.log('INCREMENT TOTAL', { total, accountId })\n await dispatch.devices.set({ total, accountId })\n },\n\n async set(params: Partial, state) {\n const accountId = params.accountId || selectActiveAccountId(state)\n const deviceState = { ...getDeviceModel(state, accountId) }\n\n Object.keys(params).forEach(key => {\n deviceState[key] = params[key]\n })\n\n await dispatch.devices.rootSet({ [accountId]: deviceState })\n },\n }),\n\n reducers: {\n reset(state: IDeviceAccountState) {\n state = { ...defaultAccountState }\n return state\n },\n rootSet(state: IDeviceAccountState, params: IDeviceAccountState) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nfunction graphQLMetadata(gqlData?: AxiosResponse) {\n const total = gqlData?.data?.data?.login?.account?.devices?.total || 0\n const devices = gqlData?.data?.data?.login?.account?.devices?.items || []\n const id = gqlData?.data?.data?.login?.id\n return [devices, total, id]\n}\n\nexport function mergeDevice(overwrite: IDevice, device: IDevice): IDevice {\n const serviceIds = new Set(device.services.map(s => s.id))\n return {\n ...overwrite,\n ...device,\n services: [...overwrite.services.filter(os => !serviceIds.has(os.id)), ...device.services],\n hidden: device.hidden && overwrite.hidden,\n }\n}\n\nexport function isOffline(instance?: IDevice | IService, connection?: IConnection) {\n const inactive = instance?.state !== 'active' && !connection?.connected\n return inactive\n}\n\nexport function eachDevice(state: State, callback: (device: IDevice) => void) {\n getAllDevices(state).forEach(device => callback(device))\n}\n","import React from 'react'\nimport { spacing } from '../styling'\n\nexport const Attribute = (value, indent: number = 0) => {\n if (Array.isArray(value)) return value.join(', ')\n\n if (typeof value === 'object')\n return Object.keys(value).map(key => (\n
\n {key}: {Attribute(value[key], spacing.md)}\n
\n ))\n\n return value.toString()\n}\n","import { State } from '../store'\nimport { defaultState } from '../models/devices'\nimport { createSelector } from 'reselect'\nimport { selectActiveAccountId } from './accounts'\nimport { removeObject, removeObjectAttribute } from '../helpers/utilHelper'\nimport { getUserId, getDevicesState, getColumns, optionalId, optionalSecondParam, optionalThirdParam } from './state'\nimport { deviceAttributes, DeviceAttribute, deviceAttributesAll, serviceAttributesAll } from '../components/Attributes'\nimport { selectLimitsLookup } from './organizations'\nimport { Attribute } from '../components/Attribute'\n\nexport function getDeviceModelFn(devices: State['devices'], activeAccountId: string, accountId?: string) {\n return devices[accountId || activeAccountId] || devices.default\n}\n\nexport function findById(devices: IDevice[], id?: string) {\n let service: IService | undefined\n const device = devices.find(\n d =>\n d.id === id ||\n d?.services?.find(s => {\n if (s.id === id) {\n service = s\n return true\n }\n return false\n })\n )\n return [service, device] as [IService | undefined, IDevice | undefined]\n}\n\nexport function selectAllByIds(state: State, ids?: string[]) {\n return (\n ids?.reduce((result: [IService, IDevice | undefined][], serviceId: string) => {\n const [service, device] = selectById(state, undefined, serviceId)\n if (service) result.push([service, device])\n return result\n }, []) || []\n )\n}\n\nexport const getDeviceModel = createSelector([getDevicesState, selectActiveAccountId], (devices, activeAccountId) =>\n getDeviceModelFn(devices, activeAccountId)\n)\n\nexport const getDevices = createSelector(\n [getDevicesState, selectActiveAccountId],\n (devices, activeAccountId): IDevice[] => getDeviceModelFn(devices, activeAccountId).all || []\n)\n\nexport const selectVisibleDevices = createSelector([getDevices], devices => devices.filter((d: IDevice) => !d.hidden))\n\nexport const selectOwnDevices = createSelector(\n [getDevicesState, getUserId],\n (devices, userId) => getDeviceModelFn(devices, userId).all || []\n)\n\nexport const getAllDevices = createSelector(\n [getDevicesState],\n devices => Object.keys(devices).reduce((all: IDevice[], accountId) => all.concat(devices[accountId].all), []) || []\n)\n\nexport const selectDeviceModelAttributes = createSelector([getDeviceModel], deviceModel =>\n removeObjectAttribute(deviceModel, 'all')\n)\n\nexport const selectById = createSelector([getDevices, getAllDevices, optionalId], (devices, allDevices, id) => {\n const result = findById(devices, id)\n return result[0] || result[1] ? result : findById(allDevices, id)\n})\n\nexport const selectAllDeviceAttributes = createSelector([selectLimitsLookup], limitsLookup =>\n deviceAttributesAll.filter(a => a.show(limitsLookup))\n)\n\nexport const selectDeviceAttributes = createSelector(\n [selectAllDeviceAttributes, getColumns],\n (allDeviceAttributes, columns) => allDeviceAttributes.filter(a => columns.includes(a.id))\n)\n\nexport const selectDeviceColumns = createSelector([selectDeviceAttributes], deviceAttributes =>\n deviceAttributes.map(a => a.id)\n)\n\nexport const selectAllActiveAttributes = createSelector(\n [selectLimitsLookup, selectDeviceModelAttributes],\n (limitsLookup, deviceModelAttributes) =>\n (deviceModelAttributes.applicationTypes?.length ? serviceAttributesAll : deviceAttributesAll).filter(a =>\n a.show(limitsLookup)\n )\n)\n\nexport const selectActiveAttributes = createSelector(\n [selectAllActiveAttributes, getColumns],\n (allActiveAttributes, columns) => allActiveAttributes.filter(a => columns.includes(a.id))\n)\n\nexport const selectActiveColumns = createSelector([selectActiveAttributes], activeAttributes =>\n activeAttributes.map(a => a.id)\n)\n\nexport const selectDevice = createSelector(\n [getAllDevices, getDevices, optionalSecondParam],\n (allDevices, devices, deviceId) => devices.find(d => d.id === deviceId) || allDevices.find(d => d.id === deviceId)\n)\n\nexport const selectDeviceDetailAttributes = createSelector([selectDeviceModelAttributes], deviceModelAttributes =>\n deviceAttributes\n .filter(d => d.details)\n .concat(\n deviceModelAttributes.customAttributes.map(\n id =>\n new DeviceAttribute({\n id: `attribute-${id}`,\n label: id,\n value: ({ device }) => (device?.attributes[id] ? Attribute(device.attributes[id]) : undefined),\n })\n )\n )\n)\n\n// selectService params (accountId, deviceId, serviceId)\nexport const selectDeviceService = createSelector(\n [selectDevice, getDevices, getAllDevices, optionalThirdParam],\n (device, devices, allDevices, serviceId): [IService | undefined, IDevice | undefined] => {\n let service: IService | undefined\n\n if (device) {\n if (serviceId) service = device.services.find(s => s.id === serviceId)\n } else if (serviceId) {\n const result = findById(devices, serviceId)\n return result[0] || result[1] ? result : findById(allDevices, serviceId)\n }\n return [service, device]\n }\n)\n\nexport const selectDeviceListAttributes = createSelector([selectActiveAttributes], activeAttributes => {\n const [required, attributes] = removeObject(activeAttributes, a => a.required === true)\n return { attributes, required: required || activeAttributes[0] }\n})\n\nexport const selectIsFiltered = createSelector(\n [selectDeviceModelAttributes],\n deviceModelAttributes =>\n deviceModelAttributes.sort !== defaultState.sort ||\n deviceModelAttributes.filter !== defaultState.filter ||\n deviceModelAttributes.owner !== defaultState.owner ||\n deviceModelAttributes.platform !== defaultState.platform ||\n deviceModelAttributes.tag !== defaultState.tag\n)\n","import { State } from '../store'\nimport { createModel } from '@rematch/core'\nimport { getDevices } from '../selectors/devices'\nimport { graphQLLeaveMembership } from '../services/graphQLMutation'\nimport { graphQLBasicRequest } from '../services/graphQL'\nimport { AxiosResponse } from 'axios'\nimport { mergeDevice } from './devices'\nimport { RootModel } from '.'\n\nexport type IAccountsState = {\n membership: IMembership[]\n activeId?: string // user.id\n}\n\nconst accountsState: IAccountsState = {\n membership: [],\n activeId: undefined,\n}\n\nexport default createModel()({\n state: { ...accountsState },\n effects: dispatch => ({\n async fetch() {\n const result = await graphQLBasicRequest(\n ` query Accounts {\n login {\n membership {\n created\n customRole {\n id\n name\n }\n license\n organization {\n name\n account {\n id\n email\n }\n }\n }\n }\n }`\n )\n if (result === 'ERROR') return\n await dispatch.accounts.parse(result)\n },\n async parse(gqlResponse: AxiosResponse | undefined, state) {\n const gqlData = gqlResponse?.data?.data?.login\n console.log('MEMBERSHIPS', gqlData)\n if (!gqlData) return\n const membership = gqlData.membership || []\n dispatch.accounts.set({\n membership: membership.map(m => ({\n created: new Date(m.created),\n roleId: m.customRole.id,\n roleName: m.customRole.name,\n license: m.license || [],\n account: m.organization.account,\n name: m.organization.name,\n })),\n })\n if (!membership.find(m => m.organization.account.id === state.accounts.activeId)) {\n dispatch.accounts.set({ activeId: undefined })\n }\n },\n async select(accountId: string) {\n await dispatch.logs.reset()\n await dispatch.accounts.set({ activeId: accountId })\n dispatch.devices.fetchIfEmpty()\n dispatch.tags.fetchIfEmpty()\n },\n async leaveMembership(id: string, state) {\n const { membership } = state.accounts\n const result = await graphQLLeaveMembership(id)\n if (result !== 'ERROR') {\n dispatch.accounts.set({ membership: membership.filter(m => m.account.id !== id), activeId: state.user.id })\n dispatch.ui.set({ successMessage: 'You have successfully left the organization.' })\n }\n },\n async setDevices({ devices, accountId }: { devices: IDevice[]; accountId?: string }) {\n await dispatch.devices.set({ all: devices, accountId })\n },\n /*\n Takes new list of devices and merges the existing into them\n -- forgets any existing devices that are not in the new devices\n -- used when new device list query is made\n */\n async truncateMergeDevices({ devices, accountId }: { devices?: IDevice[]; accountId: string }, state) {\n if (!devices) return\n const all = getDevices(state, accountId)\n const mergedDevices = devices.map(device => {\n const overwrite = all.find(o => o.id === device.id)\n if (!overwrite) return device\n return mergeDevice(overwrite, device)\n })\n\n await dispatch.accounts.setDevices({ devices: mergedDevices, accountId })\n },\n /* \n Keeps the existing devices and device list order and merges in newly loaded device data\n -- For adding hidden device data or fully loaded device data\n */\n async mergeDevices({ devices, accountId }: { devices?: IDevice[]; accountId: string }, state) {\n if (!devices || !devices.length) return\n const all = getDevices(state, accountId)\n const devicesMap = new Map(devices.map(device => [device.id, device]))\n\n let mergedDevices: IDevice[] = all.map(overwrite => {\n const device = devicesMap.get(overwrite.id)\n if (device) {\n return mergeDevice(overwrite, device)\n } else {\n return overwrite\n }\n })\n\n const append: IDevice[] = devices.filter(k => !all.find(ow => ow.id === k.id))\n if (append.length) console.log('APPENDING DEVICES IN MERGE', { mergeDevice, append })\n\n await dispatch.accounts.setDevices({ devices: [...mergedDevices, ...append], accountId })\n },\n /* \n Used when loading more devices from device list \n */\n async appendUniqueDevices({ devices, accountId }: { devices?: IDevice[]; accountId: string }, state) {\n if (!devices?.length) return\n\n accountId = accountId || devices[0]?.accountId\n if (!accountId) return console.error('APPEND DEVICES WITH MISSING ACCOUNT ID', { accountId, devices })\n\n const devicesMap = new Map(devices.map(device => [device.id, device]))\n const existingDevices = getDevices(state, accountId).filter(ed => !devicesMap.has(ed.id))\n\n await dispatch.accounts.setDevices({\n devices: [...existingDevices, ...devices],\n accountId,\n })\n },\n async setDevice(\n { id, accountId, device, prepend }: { id: string; accountId?: string; device?: IDevice; prepend?: boolean },\n state\n ) {\n accountId = accountId || device?.accountId\n if (!accountId) return console.error('SET DEVICE WITH MISSING ACCOUNT ID', { id, accountId, device })\n\n const previousDevices = getDevices(state, accountId)\n let updated = false\n\n const devices = previousDevices\n .map(d => {\n if (d.id === id) {\n updated = true\n return device ? { ...device, hidden: d.hidden } : null\n }\n return d\n })\n .filter((d): d is IDevice => !!d)\n\n // Add if new\n if (!updated && device) prepend ? devices.unshift(device) : devices.push(device)\n await dispatch.accounts.setDevices({ devices, accountId })\n },\n /* \n Remove all references to a device for cleanup after device is deleted\n */\n async removeDevice(id: string, state) {\n for (const accountId in state.devices) {\n const all = state.devices[accountId].all\n const filtered = all.filter(d => d.id !== id)\n if (filtered.length !== all.length) {\n await dispatch.accounts.setDevices({ devices: filtered, accountId })\n await dispatch.devices.set({ total: state.devices[accountId].total - 1, accountId })\n }\n }\n },\n }),\n reducers: {\n reset(state: IAccountsState) {\n state = { ...accountsState }\n return state\n },\n set(state: IAccountsState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nexport function accountFromDevice(state: State, ownerId: string, access: string[]) {\n const userId = state.auth.user?.id || state.user.id\n const orgIds = state.accounts.membership.map(m => m.account.id)\n orgIds.push(userId) // add current user to accounts\n\n // My device\n if (userId === ownerId) return ownerId\n // Org device\n if (orgIds.includes(ownerId)) return ownerId\n // Shared device\n const sharedId = orgIds.find(a => access.includes(a))\n if (sharedId) return sharedId\n // Default\n return userId\n}\n\nexport function getAccountIds(state: State) {\n let ids = state.accounts.membership.map(m => m.account.id)\n state.auth.user && ids.unshift(state.auth.user.id)\n return ids\n}\n","import { createModel } from '@rematch/core'\nimport { graphQLBasicRequest } from '../services/graphQL'\nimport { graphQLReadNotice } from '../services/graphQLMutation'\nimport { AxiosResponse } from 'axios'\nimport { RootModel } from '.'\n\ntype IAnnouncementsState = ILookup & {\n all: IAnnouncement[]\n}\n\nconst defaultState: IAnnouncementsState = {\n all: [],\n}\n\nexport default createModel()({\n state: defaultState,\n effects: dispatch => ({\n async fetch() {\n const response = await graphQLBasicRequest(\n ` query Announcements {\n notices {\n id\n title\n body\n image\n link\n type\n modified\n read\n }\n }`\n )\n if (response === 'ERROR') return\n const all = await dispatch.announcements.parse(response)\n dispatch.announcements.set({ all })\n },\n async parse(response: AxiosResponse | void, globalState): Promise {\n if (!response) return []\n const all = response?.data?.data?.notices\n if (!all) return []\n console.log('ANNOUNCEMENTS', all)\n return all.map(n => ({\n id: n.id,\n title: n.title,\n body: n.body,\n image: n.image,\n link: n.link,\n type: n.type,\n modified: new Date(n.modified),\n read: n.read ? new Date(n.read) : undefined,\n }))\n },\n async read(id: string, state) {\n console.log('ANNOUNCEMENT READ', id)\n await graphQLReadNotice(id)\n dispatch.announcements.setRead(id)\n },\n }),\n reducers: {\n reset(state: IAnnouncementsState) {\n state = { ...defaultState }\n return state\n },\n setRead(state, id: string) {\n state.all.find((a, i) => {\n if (a.id === id) {\n state.all[i].read = new Date()\n return true\n }\n return false\n })\n return state\n },\n set(state, params: ILookup) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { createModel } from '@rematch/core'\nimport { DEFAULT_SERVICE } from '@common/constants'\nimport { graphQLBasicRequest } from '../services/graphQL'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { RootModel } from '.'\nimport { State } from '../store'\n\ntype IApplicationTypeState = {\n all: IApplicationType[]\n groups: Pick[]\n account: ILookup\n}\n\nconst defaultState: IApplicationTypeState = {\n all: [],\n groups: [{ name: 'HTTP/S', ids: [7, 8] }],\n account: {},\n}\n\nconst APPLICATION_TYPES_ORDER = [48, 49, 8, 7, 66, 28, 4, 5, 34]\n\nconst APPLICATION_TYPES_QUERY = `\n applicationTypes {\n name \n id\n port\n proxy\n scheme\n protocol\n description\n }`\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch(_: void, state) {\n const accountId = selectActiveAccountId(state)\n const result = await graphQLBasicRequest(\n ` query ApplicationTypes($accountId: String) {\n login {\n account(id: $accountId) {\n ${APPLICATION_TYPES_QUERY}\n }\n }\n }`,\n { accountId }\n )\n if (result === 'ERROR') return\n const applicationTypes: IApplicationType[] = result?.data?.data?.login?.account?.applicationTypes\n dispatch.applicationTypes.set({\n account: { ...state.applicationTypes.account, [accountId]: applicationTypes.sort(sortFunction) },\n })\n },\n async fetchAll(_: void, state) {\n const result = await graphQLBasicRequest(\n ` query ApplicationTypesAll {\n ${APPLICATION_TYPES_QUERY}\n }`\n )\n if (result === 'ERROR') return\n const all = result?.data?.data?.applicationTypes\n all.sort(sortFunction)\n dispatch.applicationTypes.set({ all })\n },\n }),\n reducers: {\n reset(state: IApplicationTypeState) {\n state = { ...defaultState }\n return state\n },\n set(state: IApplicationTypeState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nfunction sortFunction(a: IApplicationType, b: IApplicationType) {\n const indexA = APPLICATION_TYPES_ORDER.indexOf(a.id)\n const indexB = APPLICATION_TYPES_ORDER.indexOf(b.id)\n\n const rankA = indexA === -1 ? Number.MAX_VALUE : indexA\n const rankB = indexB === -1 ? Number.MAX_VALUE : indexB\n\n return rankA - rankB\n}\n\nexport function findType(all?: IApplicationType[], typeId?: number): IApplicationType {\n return all?.find(t => t.id === typeId) || all?.[0] || emptyServiceType\n}\n\nexport function getType(all: IApplicationType[], port?: number) {\n const type = all?.find(t => t.port === port)\n return type ? type.id : DEFAULT_SERVICE.typeID\n}\n\nexport function isReverseProxy(state: State, typeId?: number) {\n if (!typeId) return false\n const applicationType = findType(state.applicationTypes.all, typeId)\n return applicationType?.proxy\n}\n\nconst emptyServiceType: IApplicationType = {\n id: 1,\n name: '',\n port: 0,\n scheme: '',\n proxy: false,\n protocol: 'TCP',\n description: '',\n}\n","class CloudTimes {\n private times: Map\n private cleanupInterval?: NodeJS.Timeout\n private threshold: number\n\n constructor(cleanupMinutes: number = 5) {\n this.times = new Map()\n this.threshold = cleanupMinutes * 60 * 1000\n this.cleanupInterval = setInterval(() => this.cleanup(), this.threshold)\n }\n\n outdated(timestamp: number, id?: string): boolean {\n if (!id) return false\n const last = this.times.get(id)\n this.times.set(id, timestamp)\n if (!last || last < timestamp) return false\n console.log('%cOUTDATED EVENT DETECTED', 'color:red;font-weight:bold', id, last, ' < ', timestamp)\n return true\n }\n\n private cleanup() {\n const now = Date.now()\n this.times.forEach((timestamp, id) => {\n if (now - timestamp > this.threshold) {\n this.times.delete(id)\n }\n })\n }\n}\n\nexport default CloudTimes\n","import { getFiles, getJobs, optionalSecondParam, optionalThirdParam } from './state'\nimport { createSelector } from 'reselect'\nimport { selectActiveAccountId } from './accounts'\n\nexport const selectScripts = createSelector([getFiles, getJobs, selectActiveAccountId], (files, jobs, accountId) => {\n const scripts: IScript[] = (files[accountId] || [])\n .filter(f => f.executable)\n .map(f => {\n const job = (jobs[accountId] || []).find(j => j.file?.id === f.id)\n return { ...f, job }\n })\n return scripts\n})\n\nexport const selectFiles = createSelector([getFiles, selectActiveAccountId], (files, accountId) => {\n return files[accountId]?.filter(f => !f.executable) || []\n})\n\nexport const selectJobs = createSelector(\n [getJobs, selectActiveAccountId, optionalSecondParam],\n (jobs, accountId, fileId) => (fileId ? jobs[accountId].filter(f => f.file?.id === fileId) : jobs[accountId] || [])\n)\n\nexport const selectFile = createSelector(\n [getFiles, selectActiveAccountId, optionalSecondParam],\n (files, accountId, fileId) => {\n return files[accountId]?.find(f => f.id === fileId)\n }\n)\n\nexport const selectJob = createSelector(\n [getJobs, selectActiveAccountId, optionalSecondParam],\n (jobs, accountId, jobId) => {\n return jobs[accountId]?.find(j => j.id === jobId)\n }\n)\n\nexport const selectScript = createSelector(\n [getFiles, getJobs, selectActiveAccountId, optionalSecondParam, optionalThirdParam],\n (files, allJobs, accountId, fileId, jobId) => {\n const file = files[accountId]?.find(f => f.id === fileId)\n const jobs = allJobs[accountId]?.filter(j => j.file?.id === fileId) || []\n const job = jobs.find(j => j.id === jobId) || jobs[0]\n return file ? { ...file, job, jobs } : undefined\n }\n)\n","export default \"__VITE_ASSET__DtiAm5IU__\"","import { DEVICE_TYPE } from '@common/applications'\nimport { getAccountIds } from '../models/accounts'\nimport { selectOrganization } from '../selectors/organizations'\nimport { platforms } from '../platforms'\nimport { store } from '../store'\nimport browser from './browser'\nimport icon from '../assets/noticeIcon.png'\n\nconst actions = {\n // DEVICE_STATE\n active: 'came online',\n inactive: 'went offline',\n connected: 'connected',\n disconnected: 'disconnected',\n // DEVICE_SHARE\n add: 'was shared',\n update: 'share was updated',\n remove: 'was unshared',\n}\n\nexport async function notify(event: ICloudEvent) {\n if (!notificationSupported()) return\n if (!showNotice(event)) return\n\n await checkNotificationPermission()\n\n switch (event.type) {\n case 'DEVICE_STATE':\n stateNotification(event)\n break\n\n case 'DEVICE_CONNECT':\n connectNotification(event)\n break\n\n case 'DEVICE_SHARE':\n shareNotification(event)\n }\n}\n\n/* \n My laptop came online\n Windows - otheruser@email.com\n*/\nfunction stateNotification(event: ICloudEvent) {\n event.target.forEach(target => {\n // notify if device changes state only\n if (target.typeID === DEVICE_TYPE) {\n let body = platforms.nameLookup[target.platform]\n let url = `/devices/${target.deviceId}`\n if (target.service?.id) url += `/${target.service?.id}`\n if (event.authUserId !== target.owner?.id) body += ' - ' + target.owner?.email\n createNotification(`${target.name} ${actions[event.state]}`, url, { body })\n }\n })\n}\n\n/* \n You connected\n To connection name\n*/\nfunction connectNotification(event: ICloudEvent) {\n event.target.forEach(target => {\n const you = event.authUserId === event.actor.id\n const disconnect = event.state === 'disconnected'\n const title = (you ? 'You ' : event.actor.email + ' ') + actions[event.state]\n let url = `/devices/${target.deviceId}`\n if (target.service?.id) url += `/${target.service?.id}`\n let body = (disconnect ? 'From ' : 'To ') + target.name + (event.isP2P ? '' : ' by proxy')\n if (event.state === 'disconnected' && !!event.target[0].connection) {\n body += '\\n- Provide connection feedback'\n url = url.replace('devices', 'feedback')\n }\n createNotification(title, url, { body })\n })\n}\n\nfunction shareNotification(event: ICloudEvent) {\n // don't notify of actions you've done\n if (event.authUserId === event.actor.id) return\n\n let name\n const state = store.getState()\n const accountIds = getAccountIds(state)\n const accountTo = event.users.find(u => accountIds.includes(u.id))\n\n if (accountTo) {\n if (event.authUserId === accountTo.id) name = 'you'\n else name = selectOrganization(state, accountTo.id)?.name || accountTo.email\n\n event.target.forEach(target => {\n if (target.typeID === DEVICE_TYPE) {\n const title = `${target.name} ${actions[event.action]}`\n const body = `with ${name} by ${event.actor.email}.`\n const url = event.action === 'add' || event.action === 'update' ? `/devices/${target.id}` : '/devices'\n createNotification(title, url, { body })\n }\n })\n }\n}\n\nfunction createNotification(title: string, redirect: string, options?: NotificationOptions) {\n const notification = new Notification(title, { ...options, icon: browser.isPortal ? icon : undefined })\n notification.onclick = () => store.dispatch.ui.set({ redirect })\n notification.onclose = e => e.preventDefault()\n}\n\nfunction showNotice(event: ICloudEvent) {\n const target = event?.target?.[0]\n let show\n\n if (typeof target?.device?.notificationSettings?.desktopNotifications === 'boolean') {\n show = !!target?.device?.notificationSettings?.desktopNotifications\n } else {\n show = !!store.getState().user.notificationSettings.desktopNotifications\n }\n\n return show\n}\n\nasync function checkNotificationPermission() {\n if (Notification?.permission === 'granted') return\n\n const permission = await Notification?.requestPermission()\n if (permission === 'granted') console.log('User granted notification permission')\n}\n\nfunction notificationSupported() {\n return !!window.Notification && !!Notification.requestPermission\n}\n","import ReconnectingWebSocket from 'reconnecting-websocket'\nimport structuredClone from '@ungap/structured-clone'\nimport CloudTimes from './CloudTimes'\nimport network from '../services/Network'\nimport { selectJob } from '../selectors/scripting'\nimport { AxiosResponse } from 'axios'\nimport { isReverseProxy } from '../models/applicationTypes'\nimport { getAccountIds, accountFromDevice } from '../models/accounts'\nimport { getWebSocketURL, getTestHeader } from '../helpers/apiHelper'\nimport { DEVICE_TYPE } from '@common/applications'\nimport { getToken } from './remoteit'\nimport { version } from '../helpers/versionHelper'\nimport { store } from '../store'\nimport { notify } from './Notifications'\nimport { selectById } from '../selectors/devices'\nimport { combinedName } from '@common/nameHelper'\nimport {\n setConnection,\n findLocalConnection,\n getManufacturerType,\n getManufacturerUser,\n} from '../helpers/connectionHelper'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { graphQLGetErrors } from './graphQL'\nimport { agent } from './browser'\nimport { emit } from './Controller'\n\nconst stateTimes = new CloudTimes()\nconst connectTimes = new CloudTimes()\n\nclass CloudController {\n initialized: boolean = false\n socket?: ReconnectingWebSocket\n token?: string\n pingInterval = 5 * 60 * 1000 + Math.floor(Math.random() * 60 * 1000) // 5 + random 60 seconds\n pongReceived: number = Date.now()\n timer?: NodeJS.Timeout\n\n init() {\n if (this.initialized) {\n console.warn('CLOUD CONTROLLER ALREADY INITIALIZED')\n return\n }\n this.connect()\n network.on('connect', this.reconnect)\n network.on('disconnect', this.close)\n this.initialized = true\n }\n\n log(...args) {\n console.log(`%cCLOUD SOCKET ${args[0]}`, 'color:cyan;font-weight:bold', ...args.slice(1))\n }\n\n connect() {\n if (this.socket instanceof ReconnectingWebSocket) {\n this.log('ALREADY CONNECTED')\n return\n }\n\n const url = getWebSocketURL()\n\n if (!navigator.onLine || !url) return\n\n this.log('CONNECT', url, this.socket)\n if (url) {\n this.socket = new ReconnectingWebSocket(url, [], {})\n this.socket.addEventListener('open', this.onOpen)\n this.socket.addEventListener('message', this.onMessage)\n this.socket.addEventListener('close', this.onClose)\n this.socket.addEventListener('error', this.onError)\n }\n }\n\n startPing() {\n if (this.timer) clearInterval(this.timer)\n this.log('START PING', this.pingInterval)\n this.timer = setInterval(this.ping, this.pingInterval)\n }\n\n ping = () => {\n const timeSincePong = Date.now() - this.pongReceived\n if (timeSincePong > this.pingInterval * 2) {\n this.log('NO PONG RECEIVED')\n this.reconnect()\n return\n }\n this.log('PING')\n this.socket?.send('ping')\n }\n\n reconnect = () => {\n if (store.getState().auth.authenticated) {\n this.log('RECONNECT')\n this.close()\n this.connect()\n }\n }\n\n close = () => {\n this.log('CLOSE')\n this.socket?.removeEventListener('open', this.onOpen)\n this.socket?.removeEventListener('message', this.onMessage)\n this.socket?.removeEventListener('close', this.onClose)\n this.socket?.removeEventListener('error', this.onError)\n this.socket?.close()\n delete this.socket\n }\n\n onClose = event => this.log('CLOSED', event)\n\n onError = error => this.log('ERROR', error)\n\n onOpen = event => {\n this.log('OPENED', event)\n this.authenticate()\n this.startPing()\n }\n\n authenticate = async () => {\n const message = JSON.stringify({\n action: 'subscribe',\n headers: {\n authorization: await getToken(),\n 'User-Agent': `remoteit/${version} ${agent()}`,\n ...getTestHeader(),\n },\n query: `\n {\n event {\n type\n state\n action\n timestamp\n target {\n id\n name\n application\n platform\n owner {\n id\n email\n }\n device {\n id\n name\n created\n }\n }\n actor {\n id\n email\n }\n ... on DeviceStateEvent {\n target {\n id\n name\n application\n platform\n owner {\n id\n email\n }\n device {\n id\n name\n created\n access {\n user {\n id\n }\n }\n }\n }\n }\n ... on DeviceConnectEvent {\n platform\n session\n source\n proxy\n manufacturer\n sourceGeo {\n city\n stateName\n countryName\n }\n }\n ... on DeviceShareEvent {\n scripting\n users {\n id\n email\n }\n }\n ... on DeviceJobEvent {\n job {\n id\n status\n owner {\n id\n }\n }\n jobDevice {\n id\n status\n device {\n id\n }\n }\n }\n ... on JobEvent {\n job {\n id\n status\n owner {\n id\n }\n }\n }\n ... on LicenseUpdatedEvent {\n owner {\n id\n email\n }\n plan {\n name\n product {\n name\n }\n }\n quantity\n expiration\n }\n }\n }`,\n })\n this.socket?.send(message)\n }\n\n onMessage = response => {\n this.log('MESSAGE\\n', response.data)\n\n if (response.data === 'pong') {\n this.pongReceived = Date.now()\n return\n }\n\n let event = this.parse(response)\n if (!event) return\n\n this.log('EVENT', event)\n event = this.update(event)\n notify(event)\n }\n\n errors(data) {\n const errors = graphQLGetErrors({ data } as AxiosResponse, true)\n return !!errors?.length\n }\n\n parse(response): ICloudEvent | undefined {\n if (response.data === 'pong') return\n\n const state = store.getState()\n try {\n const json = JSON.parse(response.data)\n if (this.errors(json)) {\n console.error('CLOUD GRAPHQL WS ERROR', json.errors)\n this.log('ERROR', json.errors)\n }\n let event = json.data.event\n const reverseProxy = isReverseProxy(state, event.target[0]?.application)\n return {\n reverseProxy,\n type: event.type,\n state: event.state,\n action: event.action,\n timestamp: new Date(event.timestamp).getTime(),\n isP2P: !event.proxy,\n actor: getManufacturerUser(event.manufacturer, reverseProxy) || event.actor,\n users: event.users,\n owner: event.owner,\n authUserId: state.auth.user?.id || '',\n platform: event.platform,\n sessionId: event.session,\n source: event.source,\n geo: event.sourceGeo,\n quantity: event.quantity,\n manufacturer: event.manufacturer,\n manufacturerType: getManufacturerType(event.manufacturer, reverseProxy),\n expiration: event.expiration && new Date(event.expiration),\n plan: event.plan,\n job: {\n ...event.job,\n jobDevice: event.jobDevice,\n target: selectJob(state, event.job?.owner.id, event.job?.id),\n },\n target: event.target.map(t => {\n const [service, device] = selectById(state, undefined, t.id)\n const connection = findLocalConnection(state, t.id, event.session)\n return {\n id: t.id,\n name: combinedName(t, t.device),\n owner: t.owner,\n accountId: accountFromDevice(state, t.owner?.id, t.device?.access?.map(a => a.user.id) || []),\n typeID: t.application,\n platform: t.platform,\n deviceId: t.device?.id || device?.id,\n deviceCreated: new Date(t.device?.created),\n connection: structuredClone(connection),\n service: structuredClone(service),\n device: structuredClone(device),\n }\n }),\n }\n } catch (error) {\n console.warn('Event parsing error', response, error)\n }\n }\n\n update(event: ICloudEvent) {\n const dispatch = store.dispatch\n\n switch (event.type) {\n case 'DEVICE_STATE':\n // active | inactive\n const onlineState = event.state === 'active' ? 'active' : 'inactive'\n event.target.forEach(target => {\n if (stateTimes.outdated(event.timestamp, target.id)) return\n\n // if device exists and is the target\n if (target.device && target.device.id === target.id) {\n target.device.state = onlineState\n target.device[onlineState === 'active' ? 'onlineSince' : 'offlineSince'] = event.timestamp\n } else {\n // if service exists and is the target\n target.device?.services.forEach(service => {\n if (service.id === target.service?.id) {\n service.state = onlineState\n }\n })\n }\n\n // Update connection state\n if (target.connection) {\n target.connection.online = onlineState === 'active'\n setConnection(target.connection)\n }\n\n // if device exists\n if (target.device?.id) {\n dispatch.accounts.setDevice({ id: target.device.id, device: target.device, accountId: target.accountId })\n dispatch.devices.sortByState(target.accountId)\n }\n\n // New unknown device discovered\n if (!target.device && target.id === target.deviceId && onlineState === 'active') {\n const state = store.getState()\n\n // Device created within one minute of the event\n if (\n target.owner?.id === selectActiveAccountId(state) &&\n event.timestamp - target.deviceCreated.getTime() < 1000 * 60\n ) {\n if (state.ui.registrationCommand) dispatch.ui.set({ redirect: `/devices/${target.deviceId}` })\n dispatch.ui.set({ successMessage: `${target.name} registered successfully!` })\n dispatch.devices.fetchSingleFull({ id: target.deviceId, newDevice: true })\n }\n }\n })\n break\n\n case 'DEVICE_CONNECT':\n // connected | disconnected\n emit('heartbeat') // sync with backend\n event.target.forEach(target => {\n if (connectTimes.outdated(event.timestamp, target.id)) return\n\n // Local connection state\n if (target.connection) {\n if (target.connection.public) {\n target.connection.enabled = event.state === 'connected'\n if (event.state !== 'connected') target.connection.endTime = Date.now()\n }\n target.connection.connected = event.state === 'connected'\n target.connection.connecting = false\n setConnection(target.connection)\n }\n\n // session state\n if (event.state === 'connected') {\n dispatch.sessions.setSession({\n id: event.sessionId,\n manufacturer: event.manufacturerType,\n reverseProxy: event.reverseProxy,\n timestamp: new Date(event.timestamp),\n source: event.source,\n platform: event.platform,\n isP2P: event.isP2P,\n user: event.actor,\n geo: event.geo,\n target: {\n id: target.id,\n accountId: target.accountId,\n deviceId: target.deviceId,\n platform: target.platform,\n name: target.name,\n },\n })\n } else {\n dispatch.sessions.removeSession(event.sessionId)\n }\n })\n break\n\n case 'DEVICE_SHARE':\n // don't handle actions you've done\n if (event.authUserId === event.actor.id) break\n\n const state = store.getState()\n const accountIds = getAccountIds(state)\n const accountTo = event.users.find(u => accountIds.includes(u.id))\n\n // device unshared from me or my org\n if (accountTo && event.action === 'remove') {\n event.target.forEach(target => {\n if (target.typeID === DEVICE_TYPE) dispatch.devices.cleanup([target.id])\n })\n }\n\n // device shared or updated with me or my org\n else if (accountTo && ['add', 'update'].includes(event.action)) {\n event.target.forEach(target => {\n if (target.typeID === DEVICE_TYPE)\n dispatch.devices.fetchSingleFull({ id: target.deviceId, newDevice: event.action === 'add' })\n })\n }\n break\n\n case 'JOB':\n case 'DEVICE_JOB':\n if (!event.job) break\n console.log('JOB EVENT', event.job)\n\n if (!event.job.target) {\n const state = store.getState()\n if (!state.jobs.fetching) dispatch.jobs.fetchSingle({ accountId: event.job.owner.id, jobId: event.job.id })\n break\n }\n\n const jobDevice = event.job.jobDevice\n const jobDevices = event.job.target.jobDevices\n\n dispatch.jobs.setJobs({\n accountId: event.job.owner.id,\n jobs: [\n {\n ...event.job.target,\n status: event.job.status,\n jobDevices: jobDevice\n ? jobDevices.map(jd =>\n jd.device.id === jobDevice.device.id ? { ...jd, status: jobDevice.status } : jd\n )\n : jobDevices,\n },\n ],\n })\n\n if (event.type === 'JOB' && event.job?.status === 'SUCCESS') {\n dispatch.jobs.fetchSingle({ accountId: event.job.owner.id, jobId: event.job.id })\n }\n\n break\n\n case 'DEVICE_REFRESH':\n let accountId = ''\n const refreshIds = event.target.reduce((result: string[], target) => {\n // Check that it's the bulk service and that the device is loaded in the ui\n if (target.typeID === DEVICE_TYPE && target.device) result.push(target.deviceId)\n accountId = target.accountId\n return result\n }, [])\n // avoid double loading device if on the device page\n for (const id of refreshIds) {\n if (window.location.href.includes(id)) {\n dispatch.devices.fetchSingleFull({ id, hidden: true, silent: true, accountId })\n refreshIds.splice(refreshIds.indexOf(id), 1)\n }\n }\n // fetch the rest\n if (refreshIds.length) {\n dispatch.devices.fetchDevices({ ids: refreshIds, accountId })\n }\n break\n\n case 'DEVICE_DELETE':\n const deleteIds = event.target.reduce((result: string[], target) => {\n if (target.device) result.push(target.deviceId)\n return result\n }, [])\n this.log('DEVICE DELETE EVENT', deleteIds, event)\n if (deleteIds.length) dispatch.devices.cleanup(deleteIds)\n break\n\n case 'LICENSE_UPDATED':\n setTimeout(\n () =>\n dispatch.plans.updated({\n owner: event.owner,\n planName: event.plan?.name,\n quantity: event.quantity,\n }),\n 1000 // because event comes in before plan is fully updated\n )\n break\n }\n return event\n }\n}\n\nconst cloudController = new CloudController()\nexport default cloudController","import browser, { windowOpen } from '../services/browser'\n// import { OAuth2Client } from '@byteowls/capacitor-oauth2'\nimport { ICredentials } from '@aws-amplify/core'\nimport { DEVELOPER_KEY } from '../constants'\nimport { CognitoHostedUIIdentityProvider, Auth } from '@aws-amplify/auth'\nimport {\n AuthProvider,\n CodeDeliveryDetails,\n CognitoUser,\n ISignUpResult,\n RecoveryChallengeType,\n CognitoUserResult,\n SamlOrgResult,\n} from './types'\nimport { CognitoUserSession } from 'amazon-cognito-identity-js'\nimport axios from 'axios'\n\nexport interface ConfigInterface {\n cognitoAuthDomain: string\n cognitoClientID?: string\n cognitoRegion: string\n cognitoUserPoolID: string\n callbackURL: string\n signoutCallbackURL?: string\n checkSamlURL: string\n redirectURL: string\n urlOpener?: any\n}\n\nexport class AuthService {\n public username?: string\n private cognitoAuth: typeof Auth\n private config: ConfigInterface\n private cognitoUser?: CognitoUser\n scope = ['email', 'profile', 'openid', 'aws.cognito.signin.user.admin']\n responseType = 'code'\n\n constructor(config: ConfigInterface) {\n this.config = config\n this.cognitoAuth = this.configureCognito()\n }\n\n public async checkSaml(username: string): Promise {\n const response = await axios.post(\n this.config.checkSamlURL,\n { username },\n { headers: { developerKey: DEVELOPER_KEY } }\n )\n\n // console.log ('setMFAPreference MFA PREF RESPONSE')\n // console.log(response)\n // console.log(response.data)\n if (response.status == 200) {\n return response.data\n } else {\n return { isSaml: false }\n }\n }\n\n public async forceTokenRefresh(): Promise {\n await this.cognitoAuth.currentAuthenticatedUser({ bypassCache: true })\n }\n\n public async checkSignIn(\n options: { refreshToken: boolean } = {\n refreshToken: false,\n }\n ): Promise {\n // Get the main Cognito user first.\n try {\n const cognitoUser: CognitoUser = await this.cognitoAuth.currentAuthenticatedUser()\n\n if (!cognitoUser) return { error: new Error('No cognito user') }\n\n const email = cognitoUser?.attributes?.email\n if (!email) throw new Error('no cognito email exists for this user')\n\n // TODO: this is duplicated also in CognitoAuth.tsx, cleanup\n cognitoUser.authProvider = this.determineAuthProvider(cognitoUser)\n\n // Check for session\n let currentSession = await this.currentCognitoSession()\n if (options.refreshToken) {\n try {\n const refreshToken = currentSession.getRefreshToken()\n const refreshRequest = new Promise((res, rej) => {\n // @ts-ignore\n cognitoUser.refreshSession(refreshToken, (err: any, data: unknown) => {\n return err ? rej(err) : res(data)\n })\n })\n await refreshRequest // note that rejections will be caught and handled in the catch block.\n currentSession = await this.currentCognitoSession()\n } catch (err) {\n // should not throw because user might just be on guest access or is authenticated through federation\n console.log('Error attempting to refreshing the session', err)\n }\n }\n if (currentSession) {\n currentSession.getAccessToken().getJwtToken()\n } else {\n return { error: new Error('no current session') }\n }\n this.cognitoUser = cognitoUser\n return { cognitoUser }\n } catch (error) {\n // Unable to get cognito user\n return { error }\n }\n }\n\n public async signIn(username: string, password?: string): Promise {\n this.username = username\n\n let cognitoUser: CognitoUser\n try {\n if (!password) {\n cognitoUser = await this.cognitoAuth.signIn(this.username)\n } else {\n cognitoUser = await this.cognitoAuth.signIn(this.username, password)\n }\n } catch (error) {\n return { error }\n }\n\n // this.user = { cognitoUser, remoteitUser: undefined }\n\n if (cognitoUser) {\n cognitoUser.authProvider = this.determineAuthProvider(cognitoUser)\n }\n\n this.cognitoUser = cognitoUser\n\n return { cognitoUser }\n }\n\n /**\n * Confirm the sign in of a MFA session by providing the given\n * verification code. This is the second step in a MFA flow.\n */\n public async confirmSignIn(code: string, challengeName?: any): Promise {\n if (!this.cognitoUser) return { error: new Error('no user set, cannot finish signin') } //throw new Error('no user set, cannot finish signin')\n\n try {\n const cognitoUser: CognitoUser = await this.cognitoAuth.confirmSignIn(this.cognitoUser, code, challengeName)\n\n if (!cognitoUser || !this.username) return { error: new Error('confirm signin failed, not enough information') }\n\n // Update the Cognito user from the sign in response since\n // now we have all of their account details.\n this.cognitoUser = cognitoUser\n } catch (error) {\n return { error }\n }\n\n return { cognitoUser: this.cognitoUser }\n }\n\n public async googleSignIn() {\n if (browser.isMobile) {\n this.mobileAuth(CognitoHostedUIIdentityProvider.Google)\n } else {\n await this.cognitoAuth.federatedSignIn({\n customState: this.config.redirectURL,\n provider: CognitoHostedUIIdentityProvider.Google,\n })\n }\n }\n\n // async loginWithCognito() {\n // const oauth2Options = {\n // appId: '4r5la59beqqc82gkefqmq3pejh',\n // authorizationBaseUrl: 'https://auth.remote.it/oauth2/authorize',\n // accessTokenEndpoint: 'https://auth.remote.it/oauth2/token',\n // responseType: 'code', // You're using authorization code flow\n // redirectUrl: 'remoteit://authCallback', // Must match the registered redirect URI\n // scope: 'openid profile email', // Adjust the scope to match what is required for your Cognito setup\n // additionalParameters: {\n // // These parameters should reflect the Cognito and Google setup\n // response_type: 'code',\n // client_id: '4r5la59beqqc82gkefqmq3pejh',\n // redirect_uri: 'remoteit://authCallback',\n // identity_provider: 'Google',\n // },\n // pkceEnabled: true,\n // android: {\n // responseType: 'code', // Set to 'code' to ensure the use of the authorization code flow\n // },\n // ios: {\n // responseType: 'code', // Set to 'code' to ensure the use of the authorization code flow\n // },\n // }\n\n // try {\n // const result = await OAuth2Client.authenticate(oauth2Options)\n // console.log('OAuth result:', result)\n\n // // The result object will contain \"access_token\" among other tokens\n // } catch (e) {\n // console.error('OAuth failed:', e)\n // }\n // }\n\n public async oktaSignIn(): Promise {\n return this.cognitoAuth.federatedSignIn({\n customState: this.config.redirectURL,\n customProvider: 'Okta',\n })\n }\n\n public async appleSignIn() {\n if (browser.isMobile) {\n this.mobileAuth(CognitoHostedUIIdentityProvider.Apple)\n } else {\n this.cognitoAuth.federatedSignIn({\n customState: this.config.redirectURL,\n provider: CognitoHostedUIIdentityProvider.Apple,\n })\n }\n }\n\n public async amazonSignIn(): Promise {\n return this.cognitoAuth.federatedSignIn({\n customState: this.config.redirectURL,\n provider: CognitoHostedUIIdentityProvider.Amazon,\n })\n }\n\n public async samlSignIn(domain: string): Promise {\n return this.cognitoAuth.federatedSignIn({\n customState: this.config.redirectURL,\n customProvider: domain,\n })\n }\n\n public async mobileAuth(provider: string) {\n const params = [\n `identity_provider=${provider}`,\n `redirect_uri=${this.config.callbackURL}`,\n `client_id=${this.config.cognitoClientID}`,\n `response_type=${this.responseType}`,\n `scope=${this.scope.join('+')}`,\n ]\n const authUrl = `https://${this.config.cognitoAuthDomain}/oauth2/authorize?${params.join('&')}`\n await windowOpen(authUrl, 'auth')\n // await this.loginWithCognito() @TODO implement with oauth2\n }\n\n public async signUp(username: string, password: string): Promise {\n // r3.user.create(email)\n try {\n const resp: ISignUpResult = await this.cognitoAuth.signUp({\n username,\n password,\n })\n\n this.cognitoUser = {\n ...resp.user,\n username,\n preferredMFA: 'NOMFA',\n }\n\n return { cognitoUser: this.cognitoUser }\n } catch (error) {\n return { error }\n }\n }\n\n public async resendSignUp(username: string): Promise {\n await this.cognitoAuth.resendSignUp(username)\n }\n\n public async forgotPassword(email: string): Promise {\n const resp: CodeDeliveryDetails = await this.cognitoAuth.forgotPassword(email)\n return resp\n }\n\n public async forgotPasswordSubmit(shortcode: string, password: string, email?: string): Promise {\n email = email || this.username\n if (!email) throw new Error('Cannot send password reset, no email provided!')\n this.username = email\n return this.cognitoAuth.forgotPasswordSubmit(email, shortcode, password)\n }\n\n /**\n * requestAccountRecovery attempts to signin without password which sends\n * an email to the user with a verification code. They can then use this\n * code along with their two-factor account recovery code using the\n * method \"verifyRecoveryCode\" to turn off two-factor and sign in.\n */\n public async requestAccountRecovery(email?: string): Promise {\n email = email || this.username\n if (!email) return { error: new Error('Cannot request account recovery, no email provided!') }\n\n this.username = email\n\n // Signing in without a password triggers a request to reset\n // the account.\n const result = await this.signIn(email)\n\n if (result.error) {\n return { error: result.error }\n }\n\n this.cognitoUser = result.cognitoUser\n\n // This shouldn't happen, but handle it anyways.\n if (!result.cognitoUser?.challengeName)\n return { error: new Error('No challenge code provided, cannot reset account!') }\n\n const recoveryType: RecoveryChallengeType | undefined = this.cognitoUser?.challengeParam?.challengeType\n\n if (\n !this.cognitoUser?.challengeParam?.challengeType ||\n !['EMAIL_CODE', 'BACKUP_CODE'].includes(this.cognitoUser?.challengeParam?.challengeType)\n )\n return { error: new Error('Invalid recovery type returned: ' + recoveryType) }\n\n return { cognitoUser: this.cognitoUser }\n }\n\n /**\n * verifyRecoveryCode is the second part of a two-factor account recovery process.\n * The first step is to call \"requestAccountRecovery\" which will send a recovery email\n * to the user. They then take that code and their two-factor recovery code and pass it\n * into this method which allows them to login and change their settings.\n */\n public async verifyRecoveryCode(emailVerificationCode: string, recoveryCode: string): Promise {\n if (!emailVerificationCode) return { error: new Error('No email verification code provided!') }\n\n if (!this.username || !this.cognitoUser)\n return { error: new Error('no user instance exists, please attempt signin first!') }\n\n try {\n // This is an email only account recovery\n let newUser: CognitoUser = await this.cognitoAuth.sendCustomChallengeAnswer(\n this.cognitoUser,\n emailVerificationCode\n )\n\n // Update the local copy of the Cognito user\n this.cognitoUser = newUser\n\n // If only a the email verification code was provided,\n // we assume that the user does not have two-factor setup\n // and thus does not need the secondary challenge.\n // if (recoveryCode) {\n newUser = await this.cognitoAuth.sendCustomChallengeAnswer(this.cognitoUser, recoveryCode)\n\n // Update the local copy of the Cognito user\n this.cognitoUser = newUser\n } catch (error) {\n return { error }\n }\n\n if (this.cognitoUser.challengeName === 'CUSTOM_CHALLENGE') {\n return { error: new Error('Backup code is invalid, please double check and try again!') }\n }\n\n // Now get the Remote.It specific account information and\n // then return the full user object.\n // Removing this check for now\n // this.user.remoteitUser = await this.getRemoteitUserInfo(this.username)\n\n return { cognitoUser: this.cognitoUser }\n }\n\n public async currentCognitoSession(): Promise {\n return this.cognitoAuth.currentSession()\n }\n\n public async currentUserInfo(): Promise {\n return await this.cognitoAuth.currentUserInfo()\n }\n\n public async currentAuthenticatedUser(): Promise {\n return await this.cognitoAuth.currentAuthenticatedUser()\n }\n\n public async updateCurrentUserAttributes(attributes: any) {\n const user = this.cognitoUser\n return await Auth.updateUserAttributes(user, attributes)\n }\n\n public async verifyCurrentUserAttribute(attribute: string) {\n Auth.verifyCurrentUserAttribute(attribute)\n }\n\n public async verifyCurrentUserAttributeSubmit(attribute: string, verificationCode: string) {\n await Auth.verifyCurrentUserAttributeSubmit(attribute, verificationCode)\n // .then(result => {\n // console.log('verify number', result)\n // })\n }\n\n public async setupTOTP() {\n const awsUser = await this.cognitoAuth.currentAuthenticatedUser()\n const code = await Auth.setupTOTP(awsUser) //.then(code => {\n // You can directly display the `code` to the user or convert it to a QR code to be scanned.\n // E.g., use following code sample to render a QR code with `qrcode.react` component:\n // import QRCode from 'qrcode.react';\n // const str = \"otpauth://totp/AWSCognito:\"+ username + \"?secret=\" + code + \"&issuer=\" + issuer;\n // \n return code\n }\n\n public async verifyTotpToken(code: string) {\n const awsUser = await this.cognitoAuth.currentAuthenticatedUser()\n await Auth.verifyTotpToken(awsUser, code)\n }\n\n public async changePassword(existingPassword: string, newPassword: string) {\n const awsUser = await this.cognitoAuth.currentAuthenticatedUser()\n await Auth.changePassword(awsUser, existingPassword, newPassword)\n }\n\n public async signOut() {\n try {\n if (browser.isMobile) {\n const params = [\n `client_id=${this.config.cognitoClientID}`,\n `redirect_uri=${this.config.redirectURL}`,\n `logout_uri=${this.config.signoutCallbackURL}`,\n `response_type=${this.responseType}`,\n `scope=${this.scope.join('+')}`,\n ]\n const logoutUrl = `https://${this.config.cognitoAuthDomain}/logout?${params.join('&')}`\n await windowOpen(logoutUrl, 'auth')\n }\n await this.cognitoAuth.signOut()\n } catch {}\n }\n\n /* ------------------------------------------------------\n Private methods\n ------------------------------------------------------ */\n\n // private async getRemoteitUserInfo(email: string): Promise {\n // const [remoteitUser, partnerPortalAccess] = await Promise.all([\n // this.remoteit?.user\n // .userData(email)\n // .catch((e: Error) => console.error(e.message)),\n // this.remoteit?.entities\n // .acl()\n // .then(() => true)\n // .catch(() => false),\n // ])\n // if (!remoteitUser) throw new Error('Could not get Remote.It user info!')\n // return { ...remoteitUser, partnerPortalAccess }\n // }\n\n private determineAuthProvider(cognitoUser: CognitoUser): AuthProvider {\n let authProvider: AuthProvider = ''\n if (cognitoUser?.username?.includes('Google') || cognitoUser?.username?.includes('google')) {\n authProvider = 'Google'\n }\n\n if (cognitoUser?.username?.includes('Apple') || cognitoUser?.username?.includes('apple')) {\n authProvider = 'Apple'\n }\n return authProvider\n }\n\n private configureCognito() {\n const config = this.config\n\n Auth.configure({\n Auth: {\n mandatorySignIn: true,\n region: config.cognitoRegion,\n userPoolId: config.cognitoUserPoolID,\n userPoolWebClientId: config.cognitoClientID,\n },\n })\n\n let oauth = {\n domain: config.cognitoAuthDomain,\n scope: this.scope,\n redirectSignIn: config.callbackURL,\n redirectSignOut: config.signoutCallbackURL ? config.signoutCallbackURL : config.callbackURL,\n responseType: this.responseType, // or 'token', note that REFRESH token will only be generated when the responseType is code\n urlOpener: config.urlOpener,\n }\n\n // your Cognito Hosted UI configuration\n Auth.configure({ oauth })\n\n return Auth\n }\n}\n","import network from './Network'\nimport browser, { insertScript } from './browser'\nimport { ZENDESK_KEY } from '../constants'\nimport { selectLimitsLookup } from '../selectors/organizations'\nimport { store } from '../store'\nimport sleep from '../helpers/sleep'\n\ndeclare const window: Window & {\n zE?: any\n zESettings?: any\n}\n\nclass Zendesk {\n visible?: boolean\n\n constructor() {\n network.on('connect', async () => {\n if (this.visible) this.showChat()\n else this.hideChat()\n })\n }\n\n async initChat(user?: IUser) {\n if (browser.isMobile) return\n if (!window.zE) await this.loadChat()\n\n if (user)\n window.zE?.('webWidget', 'identify', {\n name: user.email.split('@')[0],\n email: user.email,\n })\n\n this.subscribe()\n }\n\n subscribe() {\n store.subscribe(() => {\n const state = store.getState()\n const limits = selectLimitsLookup(state)\n const visible = limits.support > 10\n if (visible !== this.visible) {\n visible ? this.showChat() : this.hideChat()\n }\n })\n }\n\n async loadChat() {\n window.zESettings = {\n webWidget: {\n launcher: {\n chatLabel: { '*': 'Chat' },\n mobile: {\n labelVisible: false,\n },\n },\n chat: {\n suppress: false,\n },\n contactForm: {\n suppress: true,\n },\n helpCenter: {\n suppress: true,\n },\n },\n }\n\n const url = `https://static.zdassets.com/ekr/snippet.js?key=${ZENDESK_KEY}`\n await insertScript(url, 'ze-snippet')\n await sleep(5000)\n }\n\n showChat() {\n window.zE?.('webWidget', 'show')\n this.visible = true\n console.log('SHOW CHAT')\n }\n\n hideChat() {\n window.zE?.('webWidget', 'hide')\n this.visible = false\n console.log('HIDE CHAT')\n }\n\n endChat() {\n this.hideChat()\n window.zE?.('webWidget', 'logout')\n }\n}\n\nexport default new Zendesk()\n","import cloudSync from '../services/CloudSync'\nimport cloudController from '../services/cloudController'\nimport Controller, { emit } from '../services/Controller'\nimport network from '../services/Network'\nimport browser from '../services/browser'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport {\n CLIENT_ID,\n MOBILE_CLIENT_ID,\n CALLBACK_URL,\n AUTH_API_URL,\n COGNITO_USER_POOL_ID,\n COGNITO_AUTH_DOMAIN,\n REDIRECT_URL,\n SIGNOUT_REDIRECT_URL,\n API_URL,\n DEVELOPER_KEY,\n} from '../constants'\nimport { persistor } from '../store'\nimport { graphQLLogin } from '../services/graphQLRequest'\nimport { getToken } from '../services/remoteit'\nimport { CognitoUser } from '../cognito/types'\nimport { AuthService, ConfigInterface } from '../cognito/auth'\nimport { createModel } from '@rematch/core'\nimport { RootModel } from '.'\nimport sleep from '../helpers/sleep'\nimport zendesk from '../services/zendesk'\nimport axios from 'axios'\n\nexport interface AWSUser {\n authProvider: string\n email?: string\n email_verified?: boolean\n phone_number?: string\n phone_number_verified?: boolean\n given_name?: string //first_name\n family_name?: string //last_name\n gender?: string\n 'custom:backup_code'?: string\n}\n\nexport interface AuthState {\n initialized: boolean\n authenticated: boolean\n backendAuthenticated: boolean\n signInError?: string\n authService?: AuthService\n user?: IUser\n mfaMethod: string\n AWSUser: AWSUser\n}\n\nconst defaultState: AuthState = {\n initialized: false,\n authenticated: false,\n backendAuthenticated: false,\n signInError: undefined,\n user: undefined,\n authService: undefined,\n mfaMethod: '',\n AWSUser: { authProvider: '' },\n}\n\nconst authServiceConfig = (): ConfigInterface => ({\n cognitoClientID: browser.isMobile ? MOBILE_CLIENT_ID : CLIENT_ID,\n cognitoUserPoolID: COGNITO_USER_POOL_ID,\n cognitoAuthDomain: COGNITO_AUTH_DOMAIN,\n checkSamlURL: AUTH_API_URL + '/checkSaml',\n cognitoRegion: 'US-WEST-2',\n redirectURL:\n browser.isPortal || browser.isElectron || browser.isMobile ? window.origin : window.origin + '/v1/callback/',\n callbackURL: browser.isPortal ? window.origin : browser.isElectron || browser.isMobile ? REDIRECT_URL : CALLBACK_URL,\n signoutCallbackURL: browser.isPortal\n ? window.origin\n : browser.isElectron || browser.isMobile\n ? SIGNOUT_REDIRECT_URL\n : CALLBACK_URL,\n})\n\nexport default createModel()({\n state: defaultState,\n effects: dispatch => ({\n async init(_: void, state) {\n const { user } = state.auth\n console.log('AUTH INIT START', { user })\n if (!user) {\n console.log('AUTH SERVICE CONFIG', authServiceConfig())\n const authService = new AuthService(authServiceConfig())\n console.log('AUTH INIT', { authService })\n await sleep(500)\n await dispatch.auth.set({ authService })\n await dispatch.auth.checkSession({ refreshToken: true })\n }\n dispatch.auth.set({ initialized: true })\n console.log('AUTH INIT END')\n },\n async fetchUser(_: void, state) {\n const { auth } = dispatch\n const response = await graphQLLogin()\n if (response === 'ERROR') return\n\n const user = response?.data?.data?.login\n\n auth.set({ user, signInError: undefined })\n if (user.authhash && user.yoicsId) {\n Controller.setupConnection({ username: user.yoicsId, authHash: user.authhash, guid: user.id })\n auth.signedIn()\n } else {\n console.warn('Login failed!', response)\n dispatch.ui.set({ errorMessage: 'Login failed.' })\n }\n },\n async changePassword(passwordValues: IPasswordValue, state) {\n const existingPassword = passwordValues.currentPassword\n const newPassword = passwordValues.password\n\n try {\n await state.auth.authService?.changePassword(existingPassword, newPassword)\n sleep(300)\n window.location.reload()\n dispatch.ui.set({ successMessage: `Password Changed Successfully` })\n } catch (error) {\n dispatch.ui.set({ errorMessage: `Change password error: ${error}` })\n }\n },\n /* TODO validate and hook changeEmail up */\n async changeEmail(email: string) {\n const mailFormat = /^\\w+([.-]?\\w+)*@\\w+([.-]?\\w+)*(\\.\\w{2,3})+$/\n if (mailFormat.test(email)) {\n await axios.post(\n '/user/email/',\n { email },\n {\n baseURL: API_URL,\n headers: {\n 'Content-Type': 'application/json',\n developerKey: DEVELOPER_KEY,\n Authorization: await getToken(),\n },\n }\n )\n dispatch.auth.setAWSUserEmail(email)\n dispatch.ui.set({ successMessage: `Email modified successfully.` })\n } else {\n dispatch.ui.set({ errorMessage: `Invalid format.` })\n }\n },\n async forceRefreshToken(_: void, state) {\n if (!state.auth.authService) return\n await state.auth.authService.forceTokenRefresh()\n },\n async checkSession(options: { refreshToken: boolean }, state) {\n if (!state.auth.authService) return\n try {\n const result = await state.auth.authService.checkSignIn(options)\n if (result.cognitoUser) {\n await dispatch.auth.handleSignInSuccess(result.cognitoUser)\n } else {\n console.error('SESSION ERROR', result.error, result)\n if (result.error?.message) dispatch.ui.set({ errorMessage: result.error.message })\n }\n } catch (error) {\n console.error('Check sign in error', error)\n }\n },\n async handleSignInSuccess(cognitoUser: CognitoUser, state): Promise {\n if (cognitoUser?.username) {\n await dispatch.auth.set({ authenticated: true })\n await dispatch.auth.fetchUser()\n await dispatch.mfa.getAWSUser()\n console.log('AUTHENTICATED SUCCESS')\n }\n },\n async backendAuthenticated(_: void, state) {\n if (state.auth.authenticated) {\n dispatch.auth.set({ backendAuthenticated: true })\n console.log('BACKEND AUTHENTICATED')\n if (!state.backend.initialized) {\n emit('init')\n console.log('INIT BACKEND')\n }\n }\n },\n async disconnect(_: void, state) {\n if (!state.auth.authenticated && !state.auth.backendAuthenticated && browser.hasBackend) {\n await dispatch.auth.signedOut()\n if (!state.auth.signInError) dispatch.auth.set({ signInError: 'Sign in failed, please try again.' })\n }\n dispatch.ui.set({ connected: false })\n dispatch.auth.set({ backendAuthenticated: false })\n },\n async signInError(signInError: string) {\n dispatch.auth.set({ signInError })\n //send message to backend to sign out\n emit('user/lock')\n },\n async backendSignInError(signInError: string, state) {\n console.error(signInError)\n await dispatch.auth.set({ signInError })\n await dispatch.auth.signedOut()\n },\n async appReady(_: void, state) {\n // Temp migration of state\n await dispatch.connections.migrate()\n\n if (state.backend.initialized) {\n console.warn('BACKEND ALREADY INITIALIZED')\n return\n }\n\n if (selectDeviceModelAttributes(state).initialized) {\n console.warn('STATE ALREADY INITIALIZED')\n return\n } else {\n console.log('INITIALIZE STATE')\n }\n\n dispatch.backend.init()\n dispatch.applicationTypes.fetchAll()\n dispatch.contacts.fetch()\n await dispatch.accounts.fetch()\n await dispatch.networks.init()\n await cloudSync.all()\n },\n async signedIn(_: void, state) {\n dispatch.ui.init()\n zendesk.initChat(state.auth.user)\n cloudController.init()\n cloudSync.init()\n network.tick()\n if (!browser.hasBackend) dispatch.auth.appReady()\n },\n async signOut(_: void, state) {\n if (state.auth.backendAuthenticated) emit('user/sign-out')\n else await dispatch.auth.signedOut()\n },\n /**\n * Gets called when the backend signs the user out\n */\n async signedOut(_: void, state) {\n await persistor.purge()\n // purge has to happen before signOut because signOut can trigger a reload\n await state.auth.authService?.signOut()\n await dispatch.auth.set({ user: undefined })\n dispatch.user.reset()\n dispatch.organization.reset()\n dispatch.networks.reset()\n dispatch.accounts.reset()\n dispatch.connections.reset()\n dispatch.devices.reset()\n dispatch.sessions.reset()\n dispatch.logs.reset()\n dispatch.search.reset()\n dispatch.announcements.reset()\n dispatch.applicationTypes.reset()\n dispatch.plans.reset()\n dispatch.contacts.reset()\n dispatch.billing.reset()\n dispatch.backend.reset()\n dispatch.files.reset()\n dispatch.jobs.reset()\n dispatch.tags.reset()\n dispatch.mfa.reset()\n dispatch.ui.reset()\n\n cloudSync.reset()\n dispatch.accounts.set({ activeId: undefined })\n dispatch.auth.set({ authenticated: false })\n window.location.hash = ''\n zendesk.endChat()\n emit('user/sign-out-complete')\n cloudController.close()\n Controller.close()\n },\n async globalSignOut() {\n const Authorization = await getToken()\n const response = await axios.get(`${AUTH_API_URL}/globalSignout`, {\n headers: { Authorization },\n })\n console.log(`globalSignOut: `, response)\n dispatch.auth.signOut()\n },\n }),\n reducers: {\n setAWSUserEmail(state: AuthState, value: string) {\n state.AWSUser.email = value\n return state\n },\n set(state: AuthState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { createModel } from '@rematch/core'\nimport { AxiosResponse } from 'axios'\nimport { graphQLBasicRequest } from '../services/graphQL'\nimport { RootModel } from '.'\n\ntype IBilling = {\n invoices: IInvoice[]\n loading: boolean\n}\n\nconst defaultState: IBilling = {\n invoices: [],\n loading: false,\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch() {\n dispatch.billing.set({ loading: true })\n const result = await graphQLBasicRequest(\n ` {\n login {\n invoices {\n plan {\n name\n }\n quantity\n price {\n id\n amount\n currency\n interval\n }\n total\n paid\n url\n created\n }\n }\n }`\n )\n if (result === 'ERROR') return\n dispatch.billing.parse(result)\n dispatch.billing.set({ loading: false })\n },\n async parse(result: AxiosResponse | undefined) {\n if (!result) return\n const invoices = result?.data?.data?.login?.invoices\n console.log('LICENSING', result)\n dispatch.billing.set({\n invoices: invoices.map(i => ({\n ...i,\n created: new Date(i.created),\n })),\n })\n },\n }),\n reducers: {\n reset(state: IBilling) {\n state = { ...defaultState }\n return state\n },\n set(state: IBilling, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { createModel } from '@rematch/core'\nimport { emit } from '../services/Controller'\nimport { RootModel } from '.'\n\nexport interface BinariesState {\n error?: any\n installing: boolean\n installed: boolean\n path?: string\n version?: string\n installedVersion?: string\n reason?: BinaryReason\n}\n\nconst state: BinariesState = {\n error: undefined,\n installing: false,\n installed: true,\n path: undefined,\n version: undefined,\n installedVersion: undefined,\n}\n\nexport default createModel()({\n state,\n effects: dispatch => ({\n async install() {\n dispatch.binaries.clearError()\n dispatch.binaries.installing()\n emit('binaries/install')\n },\n }),\n reducers: {\n installing(state: BinariesState) {\n state.installing = true\n return state\n },\n installed(state: BinariesState, info: InstallationInfo) {\n console.log('BINARY INSTALLED', info)\n state.installing = false\n state.error = undefined\n state.installed = true\n state.path = info.path\n state.version = info.version\n state.installedVersion = info.installedVersion\n state.reason = undefined\n return state\n },\n notInstalled(state: BinariesState, reason: BinaryReason) {\n console.log('BINARY NOT INSTALLED', reason)\n state.installed = false\n state.path = undefined\n state.version = undefined\n state.reason = reason\n return state\n },\n installError(state: BinariesState, error: string) {\n console.error('BINARY INSTALL ERROR', error)\n state.error = error\n state.installing = false\n return state\n },\n clearError(state: BinariesState) {\n state.error = undefined\n state.installing = false\n return state\n },\n },\n})\n","import { post } from './post'\nimport { getOs, getApp } from './browser'\nimport { version } from '../helpers/versionHelper'\n\nexport default async (eventName: EventName, data) => {\n const event = { eventName, data, os: getOs().toUpperCase(), app: getApp(), version }\n console.log('EVENT', event)\n await post(event, '/event')\n}\n","import browser from '../services/browser'\nimport { createModel } from '@rematch/core'\nimport { BleClient, textToDataView } from '@capacitor-community/bluetooth-le'\nimport { RootModel } from '.'\nimport { BT_UUIDS } from '../constants'\nimport { emit } from '../services/Controller'\nimport event from '../services/event'\n\ninterface DeviceInfo {\n deviceId: string\n name?: string\n}\n\ninterface NetworkInfo {\n ssid: string\n signal: number\n}\n\ninterface Notification {\n ssid?: string\n wlan?: 'CONNECTED' | 'CONNECTING' | 'DISCONNECTED' | 'FAILED_START' | 'INVALID_PASSWORD' | 'INVALID_SSID'\n eth?: 'CONNECTED' | 'DISCONNECTED'\n cel?: 'CONNECTED' | 'DISCONNECTED'\n scan?: 'SCANNING' | 'COMPLETE'\n reg?: 'UNREGISTERED' | 'REGISTERING' | 'REGISTERED'\n id?: string // device id if registered\n}\n\nconst CHARACTERISTIC_NAMES = {\n [BT_UUIDS.SERVICE]: 'Service',\n [BT_UUIDS.COMMAND]: 'Command',\n [BT_UUIDS.WIFI_LIST]: 'WiFi List',\n [BT_UUIDS.WIFI_STATUS]: 'WiFi Status',\n [BT_UUIDS.REGISTRATION_STATUS]: 'Registration Status',\n}\n\nexport interface BluetoothState extends Notification {\n device?: DeviceInfo\n buffers?: { [key: string]: string }\n notify: Set\n initialized: boolean\n searching: boolean // scanning for devices\n connected: boolean // bluetooth connected\n networks: NetworkInfo[]\n message: string\n severity?: 'info' | 'warning' | 'error' | 'success'\n eventAutoRegister: boolean\n eventRegistering: boolean\n}\n\nconst defaultState: BluetoothState = {\n notify: new Set(),\n initialized: false,\n searching: false,\n connected: false,\n networks: [],\n message: '',\n eventRegistering: false,\n eventAutoRegister: true,\n}\n\n// Buffer markers\nconst START_MARKER = '[START]'\nconst END_MARKER = '[END]'\nconst SCAN_TIMEOUT = 30000\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async start() {\n await dispatch.bluetooth.initialize()\n if (browser.isAndroid) await dispatch.bluetooth.disconnect()\n await dispatch.bluetooth.connect()\n await dispatch.bluetooth.startNotifications()\n },\n\n async initialize() {\n let scanTimer: NodeJS.Timeout | undefined\n\n try {\n console.log('BLUETOOTH INITIALIZING')\n await dispatch.bluetooth.set({ message: '', searching: true })\n await BleClient.initialize({ androidNeverForLocation: true })\n\n scanTimer = setTimeout(async () => {\n clearTimeout(scanTimer)\n scanTimer = undefined\n await dispatch.bluetooth.cancel()\n }, SCAN_TIMEOUT)\n\n const device = await BleClient.requestDevice({ services: [BT_UUIDS.SERVICE] })\n console.log('BLUETOOTH DEVICE', device)\n clearTimeout(scanTimer)\n\n await dispatch.bluetooth.set({\n device,\n initialized: true,\n buffers: {},\n })\n } catch (error) {\n console.error('BLUETOOTH INITIALIZATION ERROR', { error, code: error.code, message: error.message })\n\n await dispatch.bluetooth.stop()\n if (scanTimer) {\n clearTimeout(scanTimer)\n await dispatch.bluetooth.set({ message: 'Bluetooth scan canceled', severity: 'info' })\n } else if (error.code === 'UNAVAILABLE') {\n await dispatch.bluetooth.set({\n message: 'Bluetooth is not available from this browser or device. Try Google Chrome.',\n severity: 'error',\n })\n } else {\n await dispatch.bluetooth.set({ message: 'No bluetooth devices found', severity: 'warning' })\n }\n }\n },\n\n async stop(_: void, state) {\n await dispatch.bluetooth.stopNotifications()\n await dispatch.bluetooth.disconnect()\n await dispatch.bluetooth.reset()\n },\n\n async cancel(_: void) {\n event('BLE_DEVICE_SCAN', { success: false })\n emit('cancelBluetooth')\n },\n\n async connect(_: void, state, ignoreConnected = false) {\n const { device, connected } = state.bluetooth\n const set = dispatch.bluetooth.set\n\n if (!device) {\n console.log('NO DEVICE TO CONNECT TO', device)\n return\n }\n\n if (connected && !ignoreConnected) {\n console.log('ALREADY CONNECTED')\n return\n }\n\n try {\n await set({ message: '', searching: true })\n\n await BleClient.connect(device.deviceId, async deviceId => {\n // Called on disconnect\n console.log('BLUETOOTH DISCONNECTED', deviceId)\n // Set Connected false\n await set({ message: 'Bluetooth disconnected', severity: 'warning', connected: false, device: undefined })\n })\n\n const services = await BleClient.getServices(device.deviceId)\n if (services.length) {\n event('BLE_DEVICE_SCAN', { success: true })\n await set({ connected: true, searching: false })\n console.log('BLUETOOTH SERVICES', services)\n } else {\n console.log('NO SERVICES FOUND')\n }\n } catch (error) {\n console.error('ERROR processing TO DEVICE', error)\n event('BLE_DEVICE_SCAN', { success: false })\n await set({\n message: `Failed to connect to device: ${error.message}`,\n severity: 'error',\n connected: false,\n searching: false,\n })\n }\n },\n\n async disconnect(_: void, state) {\n if (!state.bluetooth.device) return\n try {\n console.log('DISCONNECTING')\n await BleClient.disconnect(state.bluetooth.device.deviceId)\n } catch (error) {\n console.error('ERROR DISCONNECTING', error)\n }\n },\n\n async reconnect(_: void) {\n await dispatch.bluetooth.disconnect()\n await dispatch.bluetooth.connect()\n },\n\n async notify(characteristic: string, state) {\n const notify = new Set(state.bluetooth.notify)\n const device = state.bluetooth.device\n if (!device) return\n\n try {\n if (notify.has(characteristic)) await dispatch.bluetooth.stopNotify(characteristic)\n notify.add(characteristic)\n console.log('SETUP NOTIFY ON', characteristic)\n\n await BleClient.startNotifications(device.deviceId, BT_UUIDS.SERVICE, characteristic, async value => {\n try {\n // Ensure state.bluetooth.buffers exists and is mutable\n const buffers = { ...state.bluetooth.buffers }\n\n const decoder = new TextDecoder('utf-8')\n let chunk = decoder.decode(value)\n\n if (chunk.includes(START_MARKER)) {\n if (buffers[characteristic]) {\n throw new Error('Received unexpected [START] without [END]')\n }\n chunk = chunk.replace(START_MARKER, '')\n buffers[characteristic] = ''\n }\n\n if (chunk.includes(END_MARKER)) {\n if (buffers[characteristic] === undefined) {\n throw new Error('Received unexpected [END] without [START]')\n }\n\n chunk = chunk.replace(END_MARKER, '')\n buffers[characteristic] += chunk\n\n // Process the complete message\n const result: Notification = JSON.parse(buffers[characteristic])\n console.log('NOTIFY', CHARACTERISTIC_NAMES[characteristic], result)\n\n // Remove key from buffers\n delete buffers[characteristic]\n\n dispatch.bluetooth.set({ buffers })\n dispatch.bluetooth.notifyHandler(result)\n dispatch.bluetooth.set({ ...result })\n\n return\n } else {\n // Add the chunk to the buffer\n if (buffers[characteristic] === undefined) {\n throw new Error('Received chunk without [START]')\n }\n buffers[characteristic] += chunk\n dispatch.bluetooth.set({ buffers })\n }\n } catch (error) {\n console.error('NOTIFY ERROR', error)\n dispatch.bluetooth.set({ message: 'Notify Error: ' + error, severity: 'error' })\n }\n })\n } catch (error) {\n console.error('NOTIFY ERROR', error)\n }\n\n await dispatch.bluetooth.set({ notify })\n },\n\n async notifyHandler(result: Notification, state) {\n switch (result.reg) {\n case 'REGISTERING':\n dispatch.bluetooth.set({ eventRegistering: true })\n break\n case 'REGISTERED':\n if (state.bluetooth.eventRegistering)\n event('BLE_DEVICE_REGISTER', {\n success: true,\n deviceId: result.id,\n autoRegister: state.bluetooth.eventAutoRegister,\n })\n break\n }\n\n switch (result.wlan) {\n case 'FAILED_START':\n case 'INVALID_SSID':\n dispatch.bluetooth.set({ message: 'Invalid Network SSID', severity: 'error' })\n break\n case 'INVALID_PASSWORD':\n dispatch.bluetooth.set({ message: 'Invalid Password', severity: 'error' })\n break\n case 'CONNECTED':\n event('BLE_DEVICE_WIFI_CONNECT', { success: true })\n break\n }\n },\n\n async stopNotify(characteristic: string, state) {\n const notify = new Set(state.bluetooth.notify)\n const device = state.bluetooth.device\n if (!device) return\n try {\n console.log('STOP NOTIFY', characteristic)\n await BleClient.stopNotifications(device.deviceId, BT_UUIDS.SERVICE, characteristic)\n notify.delete(characteristic)\n await dispatch.bluetooth.set({ notify })\n } catch (error) {\n console.error('STOP NOTIFY ERROR', error)\n } \n },\n\n async startNotifications(_: void, state) {\n if (!state.bluetooth.connected) return\n const characteristics = [BT_UUIDS.WIFI_STATUS, BT_UUIDS.REGISTRATION_STATUS]\n for (const characteristic of characteristics) {\n await dispatch.bluetooth.notify(characteristic)\n const result = await dispatch.bluetooth.read(characteristic)\n console.log('READ', CHARACTERISTIC_NAMES[characteristic], result)\n await dispatch.bluetooth.set(result)\n }\n },\n\n async stopNotifications(_: void) {\n const characteristics = [BT_UUIDS.WIFI_STATUS, BT_UUIDS.REGISTRATION_STATUS]\n for (const characteristic of characteristics) {\n await dispatch.bluetooth.stopNotify(characteristic)\n }\n },\n\n async write({ value, characteristic }: { value: string; characteristic: string }, state) {\n const device = state.bluetooth.device\n if (!device) return\n\n let connected = await this.isConnected()\n if (!connected) {\n // Try to connect\n await dispatch.bluetooth.connect()\n connected = await this.isConnected()\n\n if (!connected) {\n console.log('DEVICE DISCONNECTED setting status')\n await dispatch.bluetooth.set({ message: 'Device disconnected', severity: 'warning', connected: false })\n return\n }\n }\n\n const MTU = 248 // Maximum Transmission Unit size in bytes\n const START_MARKER = '[START]'\n const END_MARKER = '[END]'\n let offset = 0\n\n console.log('WRITING', value, characteristic)\n\n while (offset < value.length) {\n let chunk = ''\n if (offset === 0) {\n chunk = START_MARKER\n }\n\n if (chunk.length < MTU) {\n const remaining = MTU - chunk.length\n chunk += value.substring(offset, offset + remaining)\n offset += remaining\n }\n\n if (offset >= value.length) {\n const remaining = MTU - chunk.length\n if (remaining > END_MARKER.length) {\n chunk += END_MARKER\n }\n }\n\n await BleClient.write(device.deviceId, BT_UUIDS.SERVICE, characteristic, textToDataView(chunk))\n }\n },\n\n async isConnected(_: void, state) {\n if (!state.bluetooth.device) return false\n try {\n const services = await BleClient.getServices(state.bluetooth.device?.deviceId)\n return services.length > 0\n } catch (error) {\n return false\n }\n },\n\n async writeWifi({ ssid, pwd }: { ssid: string; pwd: string }, state) {\n const { set, write } = dispatch.bluetooth\n const device = state.bluetooth.device\n if (!device) return\n await set({ message: '', wlan: 'CONNECTING' })\n try {\n await write({\n value: JSON.stringify({ command: 'WIFI_CONNECT', ssid, password: pwd }),\n characteristic: BT_UUIDS.COMMAND,\n })\n console.log('WIFI WRITTEN', ssid, pwd)\n } catch (error) {\n event('BLE_DEVICE_WIFI_CONNECT', { success: false })\n await set({ message: `Could not set WiFi: ${error.message}`, severity: 'error', wlan: 'FAILED_START' })\n console.error('ERROR WRITING WIFI', error)\n }\n },\n\n async writeRegistrationCode(code: string, state) {\n const device = state.bluetooth.device\n if (!device) return\n await dispatch.bluetooth.set({ reg: 'REGISTERING', eventAutoRegister: false })\n try {\n await dispatch.bluetooth.write({\n value: JSON.stringify({ command: 'R3_REGISTER', code }),\n characteristic: BT_UUIDS.COMMAND,\n })\n console.log('REGISTRATION CODE WRITTEN', code)\n } catch (error) {\n await dispatch.bluetooth.set({ message: `Could not register this device: ${error.message}`, severity: 'error' })\n console.error('ERROR WRITING REGISTRATION CODE', error)\n }\n },\n\n async scanSSIDs(_: void, state) {\n const device = state.bluetooth.device\n if (!device) return\n\n try {\n console.log('SCANNING NETWORKS')\n await dispatch.bluetooth.set({ message: '', scan: 'SCANNING' })\n const command = { command: 'WIFI_SCAN' }\n await dispatch.bluetooth.write({ value: JSON.stringify(command), characteristic: BT_UUIDS.COMMAND })\n } catch (error) {\n console.error('Error scanning SSIDs', error)\n await dispatch.bluetooth.set({\n message: `Unable to scan for WiFi: ${error.message}`,\n severity: 'error',\n scan: 'COMPLETE',\n })\n }\n },\n\n async read(characteristic: string, state) {\n const device = state.bluetooth.device\n if (!device) return\n\n let connected = await this.isConnected()\n if (!connected) {\n // Try to connect\n await dispatch.bluetooth.connect()\n connected = await this.isConnected()\n\n if (!connected) {\n console.log('DEVICE DISCONNECTED setting status')\n await dispatch.bluetooth.set({ message: 'Device disconnected', severity: 'warning', connected: false })\n return\n }\n }\n\n const START_MARKER = '[START]'\n const END_MARKER = '[END]'\n\n let completeData = ''\n let reading = true\n let count = 0\n\n try {\n console.log('READING', CHARACTERISTIC_NAMES[characteristic])\n\n while (reading) {\n const value = await BleClient.read(device.deviceId, BT_UUIDS.SERVICE, characteristic, { timeout: 10000 })\n const decoder = new TextDecoder('utf-8')\n let data = decoder.decode(value)\n\n if (data.includes(START_MARKER)) {\n if (count > 0) {\n throw new Error('START_MARKER found after the first read.')\n }\n data = data.replace(START_MARKER, '')\n }\n\n if (data.includes(END_MARKER)) {\n // Remove the END_MARKER from the data\n data = data.replace(END_MARKER, '')\n reading = false\n }\n completeData += data\n count++\n }\n\n // Parse the complete data\n try {\n return JSON.parse(completeData)\n } catch (error) {\n throw new Error('Failed to parse JSON data.')\n }\n } catch (error) {\n dispatch.bluetooth.set({\n message: `Failed to read ${CHARACTERISTIC_NAMES[characteristic]}: ${error.message}`,\n severity: 'error',\n })\n console.error(`ERROR READING VALUE ${CHARACTERISTIC_NAMES[characteristic]}`, error.message, error.code, error)\n }\n },\n\n async readSSIDs(_: void, state) {\n if (!state.bluetooth.device) return\n await dispatch.bluetooth.set({ scan: 'SCANNING' })\n const networks: NetworkInfo[] = []\n const networks_list = await dispatch.bluetooth.read(BT_UUIDS.WIFI_LIST)\n // Load the networks into the networks array\n if (networks_list) {\n networks_list.forEach((network: NetworkInfo) => {\n networks.push(network)\n })\n }\n\n console.log('WIFI LIST', networks)\n event('BLE_DEVICE_WIFI_LIST', { count: networks.length })\n dispatch.bluetooth.set({ networks, scan: 'COMPLETE' })\n },\n }),\n reducers: {\n reset(state: BluetoothState) {\n state = { ...defaultState }\n return state\n },\n set(state: BluetoothState, params: Partial) {\n if (!params) return state\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import sleep from '../helpers/sleep'\nimport browser from '../services/browser'\nimport structuredClone from '@ungap/structured-clone'\nimport { createModel } from '@rematch/core'\nimport { parse as urlParse } from 'url'\nimport { pickTruthy } from '../helpers/utilHelper'\nimport { DEFAULT_CONNECTION, IP_PRIVATE } from '@common/constants'\nimport { REGEX_HIDDEN_PASSWORD, CERTIFICATE_DOMAIN } from '../constants'\nimport {\n cleanOrphanConnections,\n getFetchConnectionIds,\n newConnection,\n setConnection,\n getConnectionLookup,\n updateImmutableData,\n} from '../helpers/connectionHelper'\nimport {\n graphQLConnect,\n graphQLDisconnect,\n graphQLSurvey,\n graphQLSetLink,\n graphQLRemoveLink,\n} from '../services/graphQLMutation'\nimport { graphQLFetchConnections, graphQLDeviceAdaptor } from '../services/graphQLDevice'\nimport { selectApplication } from '../selectors/applications'\nimport { accountFromDevice } from './accounts'\nimport { selectConnection } from '../selectors/connections'\nimport { selectById } from '../selectors/devices'\nimport { RootModel } from '.'\nimport { emit } from '../services/Controller'\nimport heartbeat from '../services/Heartbeat'\n\ntype IConnectionsState = {\n all: IConnection[]\n queue: IConnection[]\n queueCount?: number\n queueEnabling: boolean\n queueFinished: boolean\n queueConnection?: IConnection\n initialized: boolean\n updating: boolean\n}\n\nconst defaultState: IConnectionsState = {\n all: [],\n queue: [],\n queueCount: 0,\n queueEnabling: false,\n queueFinished: false,\n queueConnection: undefined,\n initialized: false,\n updating: false,\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async migrate(_: void, state) {\n // Migrate launch templates (v3.30)\n console.log('CONNECTIONS MIGRATE LAUNCH TEMPLATES')\n const connections = state.connections.all.map(c => {\n const app = selectApplication(state, undefined, c)\n c = { ...structuredClone(c) } // clone and spread to avoid \"object is not extensible\" error\n if (c.launchTemplate || c.commandTemplate) console.log('MIGRATING', c.name, c.id)\n if (!c.launchTemplates) c.launchTemplates = {}\n if (c.launchTemplate) c.launchTemplates.URL = c.launchTemplate\n if (c.commandTemplate) c.launchTemplates.COMMAND = c.commandTemplate\n if (!app.launchMethods.find(m => m.type === c.launchType)) delete c.launchType\n delete c.launchTemplate\n delete c.commandTemplate\n return c\n })\n await dispatch.connections.setAll(connections)\n },\n\n async fetch(_: void, state) {\n const accountId = state.auth.user?.id || state.user.id\n const serviceIds = getFetchConnectionIds(state)\n const gqlResponse = await graphQLFetchConnections({ ids: serviceIds })\n if (gqlResponse === 'ERROR') return\n\n const gqlDevices = gqlResponse?.data?.data?.login?.device || []\n const devices = graphQLDeviceAdaptor({ gqlDevices, accountId, hidden: true })\n await dispatch.accounts.truncateMergeDevices({ devices, accountId: 'connections' })\n\n cleanOrphanConnections(serviceIds)\n await dispatch.connections.set({ initialized: true })\n },\n\n async updateFromServices({ devices, accountId }: { devices: IDevice[]; accountId: string }) {\n await dispatch.connections.updateConnectionState({ devices, accountId })\n await dispatch.connections.updateCLI()\n },\n\n async updateConnectionState({ devices, accountId }: { devices: IDevice[]; accountId: string }, state) {\n let lookup = getConnectionLookup(state)\n let result: IConnection[] = []\n\n devices.forEach(d => {\n d.services.forEach(async s => {\n let connection = structuredClone(lookup[s.id])\n const online = s.state === 'active'\n\n // add / update enabled connect links\n if (s.link?.enabled && s.link.web) {\n connection = connection || newConnection(s)\n connection = {\n ...connection,\n id: s.id,\n deviceID: d.id,\n name: connection.name || `${d.name} ${s.name}`,\n createdTime: s.link.created.getTime(),\n enabled: s.link.enabled,\n connectLink: s.link.enabled,\n }\n\n const url = urlParse(s.link.url)\n if (url.host) connection.host = url.host\n if (url.port) connection.port = parseInt(url.port, 10)\n if (s.link.password) connection.password = s.link.password\n }\n\n if (connection) {\n // assign account id\n connection.accountId = accountFromDevice(\n state,\n d.owner.id,\n d.access.map(a => a.id)\n )\n\n // disable connection if service is offline\n if (!online && !connection.connectLink && connection.enabled) {\n console.log('DISABLING OFFLINE CONNECTION', connection.name)\n await dispatch.connections.disconnect({ connection })\n }\n\n // remove connect links\n if (connection.connectLink && (!s.link || !s.link.enabled)) {\n console.log('UNLINK CONNECT LINK', s.id)\n connection.connectLink = DEFAULT_CONNECTION.connectLink\n connection.enabled = DEFAULT_CONNECTION.enabled\n }\n\n const app = selectApplication(state, s, connection)\n connection = updateImmutableData(connection, app)\n\n result.push(connection)\n }\n })\n })\n\n await dispatch.connections.mergeConnections(result)\n },\n\n async mergeConnections(connections: IConnection[], state) {\n if (!connections.length) return\n const all = state.connections.all\n // merge and remove new connections\n const updated = all.map(c => {\n const index = connections.findIndex(a => a.id === c.id)\n if (index >= 0) {\n const merged = { ...c, ...connections[index] }\n connections.splice(index, 1)\n return merged\n }\n return c\n })\n await dispatch.connections.setAll([...updated, ...connections])\n },\n\n async updateConnection(connection: IConnection, state) {\n const all = structuredClone(state.connections.all)\n\n let exists = false\n all.some((c, index) => {\n if (c.id === connection.id) {\n all[index] = connection\n dispatch.connections.setAll(all)\n exists = true\n return true\n }\n return false\n })\n\n if (!exists) {\n all.push(connection)\n dispatch.connections.setAll(all)\n }\n },\n\n async updateCLI(_: void, state) {\n emit('connections', state.connections.all)\n },\n\n async restoreConnections(connections: IConnection[], state) {\n connections.forEach((connection, index) => {\n // data missing from cli if our connections file is lost\n if (!connection.owner || !connection.name) {\n console.log('CONNECTION MISSING DATA', connection.id)\n const [service] = selectById(state, undefined, connection.id)\n if (!connection.id) {\n delete connections[index]\n console.warn('No id found in connection', { connection })\n } else if (service) {\n let keep: string[] = [\n 'host',\n 'port',\n 'enabled',\n 'createdTime',\n 'startTime',\n 'endTime',\n 'connected',\n 'isP2P',\n 'checklist',\n 'restriction',\n 'sessionId',\n 'default',\n ]\n const picked = pickTruthy(keep, connection)\n connection = { ...newConnection(service), ...picked }\n setConnection(connection)\n } else if (!connection.port) {\n console.error('No service or connection port found in connection. Connection cleared.', { connection })\n dispatch.connections.forget(connection.id)\n } else {\n console.warn(`No service found for connection ${connection.id}`, { connection })\n // @TODO fetch device if trying to restore a non-loaded connection\n // const device = await dispatch.devices.fetchSingle({ id: connection.id, hidden: true })\n // console.log('FETCHED DEVICE RETURNED:', device)\n }\n }\n // clear errors on connect\n if (connection.error && connection.connecting) {\n connection.error = undefined\n }\n })\n dispatch.connections.setAll(connections.filter(c => !!c))\n },\n\n async queueEnable({ serviceIds, enabled }: { serviceIds: string[]; enabled: boolean }) {\n const queue: IConnection[] = serviceIds.map(id => ({ id, enabled }))\n await dispatch.connections.set({ queue })\n dispatch.connections.checkQueue()\n },\n\n async checkQueue(_: void, state) {\n if (!state.connections.queue.length) {\n await dispatch.connections.set({ queueFinished: true })\n return\n }\n\n const queue = [...state.connections.queue]\n const trigger = queue.shift()\n\n if (!trigger) return\n\n const [service] = selectById(state, undefined, trigger.id)\n const connection = selectConnection(state, service)\n\n let different = false\n Object.keys(trigger).forEach(key => {\n if (trigger[key] !== connection[key]) {\n different = true\n }\n })\n\n console.log('QUEUE', { trigger, connection })\n console.log('NEXT', { different })\n\n if (different) {\n if (trigger.enabled) dispatch.connections.connect({ ...connection, ...trigger, autoStart: true })\n else dispatch.connections.disconnect({ connection: { ...connection, ...trigger } })\n }\n\n dispatch.connections.set({ queue })\n setTimeout(dispatch.connections.checkQueue, 200)\n },\n\n async proxyConnect(connection: IConnection): Promise {\n const proxyConnection = {\n ...connection,\n createdTime: Date.now(),\n startTime: Date.now(),\n connecting: true,\n }\n\n setConnection(proxyConnection)\n const result = await graphQLConnect(connection.id, connection.publicRestriction)\n\n if (result === 'ERROR') {\n connection.error = { message: 'An error occurred connecting. Please ensure that the device is online.' }\n setConnection(connection)\n if (connection.deviceID) dispatch.devices.fetchSingleFull({ id: connection.deviceID })\n } else {\n const data = result?.data?.data?.connect\n console.log('PROXY CONNECTED', data)\n setConnection({\n ...proxyConnection,\n ready: true,\n connecting: false,\n connected: true,\n error: undefined,\n isP2P: false,\n startTime: data.created,\n sessionId: data.id,\n timeout: data.timeout / 60,\n port: data.port,\n host: data.host,\n })\n }\n },\n\n async proxyDisconnect(connection: IConnection) {\n let disconnect = { ...connection, enabled: false }\n setConnection(disconnect)\n\n if (!connection.sessionId) {\n console.warn('No sessionId for connection to proxy disconnect', connection)\n return\n }\n\n const result = await graphQLDisconnect(connection.id, connection.sessionId)\n\n if (result === 'ERROR') {\n setConnection(connection)\n } else {\n setConnection({ ...disconnect, connected: false })\n console.log('PROXY DISCONNECTED', result)\n }\n },\n\n async setConnectLink(connection: IConnection) {\n const creating: IConnection = { ...connection, connectLink: connection.enabled, updating: true }\n\n console.log('SET CONNECT LINK', connection)\n\n dispatch.connections.updateConnection(creating)\n const result = await graphQLSetLink({\n serviceId: connection.id,\n enabled: connection.enabled,\n password: REGEX_HIDDEN_PASSWORD.test(connection.password || '')\n ? undefined\n : connection.password?.trim() || null,\n })\n\n if (result === 'ERROR' || !result?.data?.data?.setConnectLink?.url) {\n connection.error = { message: 'Persistent connection update failed. Please contact support.' }\n dispatch.connections.updateConnection(connection)\n dispatch.devices.fetchSingleFull({ id: connection.id, isService: true })\n return\n }\n\n const data = result?.data?.data?.setConnectLink\n const url = urlParse(data?.url)\n\n setConnection({\n ...creating,\n updating: undefined,\n enabled: !!data?.enabled,\n createdTime: new Date(data.created).getTime(),\n port: url.port ? parseInt(url.port, 10) : undefined,\n host: url.hostname || undefined,\n error: undefined,\n starting: false,\n isP2P: false,\n })\n\n await dispatch.devices.updateService({\n id: connection.id,\n set: {\n link: {\n ...data,\n created: new Date(data.created),\n },\n },\n })\n\n dispatch.connections.set({ updating: false })\n },\n\n async removeConnectLink(connection?: IConnection) {\n if (!connection) return console.warn('No connection to disconnect')\n\n dispatch.connections.setConnectLink({ ...connection, enabled: false })\n dispatch.devices.updateService({ id: connection.id, set: { link: undefined } })\n const result = await graphQLRemoveLink(connection.id)\n\n if (result === 'ERROR') {\n connection.error = { message: 'An error occurred removing your persistent connection. Please contact support.' }\n await dispatch.connections.updateConnection(connection)\n }\n\n await dispatch.devices.fetchSingleFull({ id: connection.id, isService: true })\n },\n\n async connect(connection: IConnection, state) {\n connection = structuredClone(connection)\n const [service] = selectById(state, undefined, connection.id)\n if (connection.autoLaunch && !connection.autoStart) dispatch.ui.set({ autoLaunch: connection.id })\n connection.online = service ? service?.state === 'active' : connection.online\n connection.host = undefined\n connection.error = undefined\n connection.autoStart = undefined\n connection.checkpoint = undefined\n connection.stopLock = undefined\n connection.enabled = true\n connection.ready = false\n\n if (connection.public || !browser.hasBackend) {\n dispatch.connections.proxyConnect(connection)\n return\n }\n\n connection.starting = true\n connection.host = state.backend.preferences.useCertificate\n ? `${connection.name}.${CERTIFICATE_DOMAIN}`\n : IP_PRIVATE\n dispatch.connections.updateConnection(connection)\n emit('service/connect', connection)\n heartbeat.connect()\n },\n\n async disconnect({ connection, forceStop }: { connection?: IConnection; forceStop?: boolean }) {\n if (!connection) {\n console.warn('No connection to disconnect')\n return\n }\n\n if (connection.public || !browser.hasBackend) {\n dispatch.connections.proxyDisconnect(connection)\n return\n }\n\n if (connection.connected && !forceStop) {\n connection = { ...connection, disconnecting: true }\n dispatch.connections.updateConnection(connection)\n emit('service/disconnect', connection)\n } else {\n connection = { ...connection, stopping: true, stopLock: Date.now(), error: undefined, enabled: false }\n dispatch.connections.updateConnection(connection)\n emit('service/stop', connection)\n }\n heartbeat.disconnect()\n },\n\n async survey({ rating, connection }: { rating: number; connection: IConnection }) {\n if (!connection.sessionId) return\n const result = await graphQLSurvey(connection.id, connection.sessionId, rating)\n if (result === 'ERROR' || !result?.data?.data?.rateConnection) {\n dispatch.ui.set({ errorMessage: 'Connection survey submission failed. Please contact support.' })\n }\n },\n\n async forget(id: string, state) {\n const { set } = dispatch.connections\n const { all } = state.connections\n set({ all: all.filter(c => c.id !== id) })\n if (state.auth.backendAuthenticated) emit('service/forget', { id })\n },\n\n async clear(id: string, state) {\n const { set } = dispatch.connections\n const { all } = state.connections\n set({ all: all.filter(c => c.id !== id) })\n if (state.auth.backendAuthenticated) emit('service/clear', { id })\n },\n\n async clearByDevice(deviceId: string, state) {\n const { clear, disconnect } = dispatch.connections\n const { all } = state.connections\n all.forEach(async connection => {\n if (connection.deviceID === deviceId) {\n if (connection.connected) await disconnect({ connection })\n await clear(connection.id)\n }\n })\n },\n\n async clearRecent(_: void, state) {\n const { set } = dispatch.connections\n const { all } = state.connections\n if (state.auth.backendAuthenticated) emit('service/clearRecent')\n else set({ all: all.filter(c => c.enabled && c.online) })\n },\n\n async onClose(connection: IConnection, state) {\n const app = selectApplication(state, undefined, connection)\n if (connection.launched && connection.autoClose && app.disconnectString) {\n console.log('ON CONNECTION CLOSE', app.disconnectString)\n emit('launch/app', app.disconnectString, app.launchType)\n await sleep(2000)\n }\n dispatch.connections.updateConnection({ ...connection, launched: false })\n },\n\n async setAll(all: IConnection[], state) {\n all.sort((a, b) => nameSort(a.name || '', b.name || ''))\n dispatch.connections.set({ all: [...all] }) // to ensure we trigger update\n },\n }),\n reducers: {\n reset(state: IConnectionsState) {\n state = { ...defaultState }\n return state\n },\n set(state: IConnectionsState, params: Partial) {\n Object.keys(params).forEach(key => {\n state[key] = params[key]\n })\n return state\n },\n },\n})\n\nfunction nameSort(a: string, b: string) {\n return a.toLowerCase() < b.toLowerCase() ? -1 : a.toLowerCase() > b.toLowerCase() ? 1 : 0\n}\n","import { createModel } from '@rematch/core'\nimport { AxiosResponse } from 'axios'\nimport { graphQLBasicRequest } from '../services/graphQL'\nimport { RootModel } from '.'\n\ntype IContactsState = {\n all: IUserRef[]\n}\n\nconst defaultState: IContactsState = {\n all: [],\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch() {\n const result = await graphQLBasicRequest(\n ` query Contacts {\n login {\n contacts {\n id\n email\n }\n }\n }`\n )\n if (result === 'ERROR') return\n const all = await dispatch.contacts.parse(result)\n dispatch.contacts.set({ all })\n },\n\n async parse(result: AxiosResponse | undefined) {\n return result?.data?.data?.login?.contacts\n },\n }),\n\n reducers: {\n reset(state: IContactsState) {\n state = { ...defaultState }\n return state\n },\n set(state: IContactsState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import axios from 'axios'\nimport { createModel } from '@rematch/core'\nimport { ZENDESK_URL } from '../constants'\nimport { RootModel } from '.'\nimport { apiError } from '../helpers/apiHelper'\nimport { fullVersion } from '../helpers/versionHelper'\n\ntype FeedbackParams = { [key: string]: any }\n\nexport type IFeedbackState = {\n subject: string\n body: string\n data: string\n snackbar?: string\n}\n\nconst defaultState: IFeedbackState = {\n subject: '',\n body: '',\n data: '',\n snackbar: undefined,\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async sendFeedback(_: void, state) {\n const { subject, body, data, snackbar } = state.feedback\n const { user } = state.auth\n try {\n const env = await dispatch.backend.environment()\n let finalBody = body\n if (data) finalBody += '\\n\\n-- data\\n\\n' + JSON.stringify(data, null, 4)\n finalBody += '\\n\\n--\\n\\n' + fullVersion()\n finalBody += '\\n\\n' + env + '\\n\\n' + navigator.userAgent\n if (finalBody.trim().length === 0) return\n await createZendeskTicket({\n subject,\n body: finalBody,\n name: user?.email,\n email: user?.email,\n })\n dispatch.ui.set({ successMessage: snackbar || 'Thank you. Your message was sent!' })\n dispatch.feedback.reset()\n } catch (error) {\n dispatch.ui.set({ errorMessage: 'Sending message encountered an error. Please try again.' })\n await apiError(error)\n }\n },\n }),\n reducers: {\n reset(state: IFeedbackState) {\n state = { ...defaultState }\n return state\n },\n set(state: IFeedbackState, params: FeedbackParams) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nasync function createZendeskTicket(params: FeedbackParams) {\n const result = await axios.post(\n `${ZENDESK_URL}requests.json`,\n {\n request: {\n subject: params.subject,\n comment: {\n body: params.body,\n },\n requester: {\n name: params.name,\n email: params.email,\n },\n custom_fields: [{ version: fullVersion() }],\n },\n },\n {\n headers: {\n 'Content-Type': 'application/json',\n },\n }\n )\n console.log('FEEDBACK RESULT', result)\n}\n","import axios from 'axios'\nimport { getApiURL, getTestHeader } from '../helpers/apiHelper'\nimport { getToken } from './remoteit'\nimport { apiError } from './post'\nimport { store } from '../store'\n\nexport async function get(path: string = '') {\n if (store.getState().ui.offline) return\n\n const token = await getToken()\n if (!token) {\n console.warn('Unable to get token for API request.')\n return\n }\n\n const request = {\n url: getApiURL() + path,\n method: 'get',\n headers: { Authorization: token, ...getTestHeader() },\n }\n\n try {\n return await axios.request(request)\n } catch (error) {\n console.error('POST ERROR', { path })\n await apiError(error)\n return 'ERROR'\n }\n}\n","import axios, { AxiosResponse } from 'axios'\nimport structuredClone from '@ungap/structured-clone'\nimport { DEMO_SCRIPT_URL, BINARY_DATA_TOKEN } from '../constants'\nimport { createModel } from '@rematch/core'\nimport { graphQLFiles } from '../services/graphQLRequest'\nimport { graphQLDeleteFile } from '../services/graphQLMutation'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { RootModel } from '.'\nimport { postFile } from '../services/post'\nimport { get } from '../services/get'\n\ntype FilesState = {\n initialized: boolean\n fetching: boolean\n all: {\n [accountId: string]: IFile[]\n }\n}\n\nexport const initialForm: IFileForm = {\n name: '',\n description: '',\n executable: true,\n tag: { operator: 'ALL', values: [] },\n deviceIds: [],\n access: 'NONE',\n fileId: '',\n script: '',\n}\n\nconst defaultState: FilesState = {\n initialized: false,\n fetching: true,\n all: {},\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch(accountId: string | void, state) {\n dispatch.files.set({ fetching: true })\n accountId = accountId || selectActiveAccountId(state)\n const result = await graphQLFiles(accountId)\n if (result === 'ERROR') return\n const files = await dispatch.files.parse(result)\n console.log('LOADED FILES', accountId, files)\n dispatch.files.setAccount({ accountId, files })\n dispatch.files.set({ fetching: false, initialized: true })\n },\n async fetchSingle({ accountId, fileId }: { accountId?: string; fileId: string }, state) {\n dispatch.files.set({ fetching: true })\n accountId = accountId || selectActiveAccountId(state)\n const result = await graphQLFiles(accountId, [fileId])\n if (result === 'ERROR') return\n const files = await dispatch.files.parse(result)\n console.log('LOADED FILE', accountId, files)\n dispatch.files.setFile({ accountId, file: files[0] })\n dispatch.files.set({ fetching: false })\n },\n async fetchIfEmpty(accountId: string | void, state) {\n accountId = accountId || selectActiveAccountId(state)\n if (!state.files.all[accountId]) dispatch.files.fetch(accountId)\n },\n async parse(result: AxiosResponse | undefined): Promise {\n const data = result?.data?.data?.login?.account\n return data?.files.map(file => ({ ...file, versions: file.versions.items }))\n },\n async upload(form: IFileForm, state): Promise {\n if (!form.file) return ''\n\n const data = {\n accountId: selectActiveAccountId(state),\n executable: form.executable,\n shortDesc: form.description,\n name: form.name,\n }\n\n const result = await postFile(form.file, data, `/file/upload`)\n if (result === 'ERROR') return ''\n\n console.log('UPLOADED FILE', { form, data, result })\n\n const fileId: string = result?.data.fileId\n await dispatch.files.fetchSingle({ fileId })\n return fileId\n },\n async download(fileId: string) {\n const result = await get(`/file/download/${fileId}`)\n if (!result || result === 'ERROR') return\n\n const contentType = result.headers['content-type']\n if (!result.data && contentType === 'application/octet-stream') {\n result.data = BINARY_DATA_TOKEN\n }\n\n console.log('DOWNLOADED FILE', result)\n return result.data\n },\n async downloadDemoScript() {\n try {\n const result = await axios.get(DEMO_SCRIPT_URL)\n return result.data\n } catch (error) {\n console.error('Error downloading demo script', error)\n return\n }\n },\n async delete(fileId: string, state) {\n console.log('DELETE FILE', fileId)\n\n const result = await graphQLDeleteFile(fileId)\n if (result === 'ERROR') {\n dispatch.ui.set({ errorMessage: 'Error deleting file' })\n return\n }\n\n await dispatch.files.fetch()\n },\n async setFile({ accountId, file }: { accountId: string; file: IFile }, state) {\n const files = structuredClone(state.files.all[accountId] || [])\n const index = files.findIndex(f => f.id === file.id)\n if (index === -1) files.unshift(file)\n else files[index] = file\n dispatch.files.setAccount({ accountId, files })\n },\n async setAccount(params: { files: IFile[]; accountId: string }, state) {\n let all = structuredClone(state.files.all)\n all[params.accountId] = params.files\n dispatch.files.set({ all })\n },\n }),\n reducers: {\n reset(state) {\n state = { ...defaultState }\n return state\n },\n set(state, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","// import sleep from '../helpers/sleep'\nimport structuredClone from '@ungap/structured-clone'\nimport { VALID_JOB_ID_LENGTH } from '../constants'\nimport { selectJobs } from '../selectors/scripting'\nimport { getDevices } from '../selectors/devices'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { graphQLSetJob, graphQLStartJob, graphQLCancelJob } from '../services/graphQLMutation'\nimport { AxiosResponse } from 'axios'\nimport { createModel } from '@rematch/core'\nimport { graphQLJobs } from '../services/graphQLRequest'\nimport { RootModel } from '.'\n\ntype ScriptsState = {\n initialized: boolean\n fetching: boolean\n all: {\n [accountId: string]: IJob[]\n }\n}\n\nconst defaultState: ScriptsState = {\n initialized: false,\n fetching: true,\n all: {},\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch(accountId: string | void, state) {\n dispatch.jobs.set({ fetching: true })\n accountId = accountId || selectActiveAccountId(state)\n const result = await graphQLJobs(accountId)\n if (result === 'ERROR') return\n const jobs = await dispatch.jobs.parse(result)\n console.log('LOADED JOBS', accountId, jobs)\n dispatch.jobs.setAccount({ accountId, jobs })\n dispatch.jobs.set({ fetching: false, initialized: true })\n },\n async fetchSingle({ accountId, jobId }: { accountId?: string; jobId: string }, state) {\n dispatch.jobs.set({ fetching: true })\n\n // // Find latest job by fileId if jobId is not valid\n // if (jobId.length < VALID_JOB_ID_LENGTH) {\n // alert('Invalid job ID: ' + jobId)\n // jobId = selectJobs(state).find(j => j.file?.id === fileId)?.id || jobId\n // }\n\n accountId = accountId || selectActiveAccountId(state)\n const result = await graphQLJobs(accountId, undefined, [jobId])\n if (result === 'ERROR') return\n const jobs = await dispatch.jobs.parse(result)\n console.log('LOADED JOB', accountId, jobs)\n dispatch.jobs.setJobs({ accountId, jobs })\n dispatch.jobs.set({ fetching: false })\n },\n async fetchByFileIds({ accountId, fileIds }: { accountId?: string; fileIds: string[] }, state) {\n dispatch.jobs.set({ fetching: true })\n accountId = accountId || selectActiveAccountId(state)\n\n const result = await graphQLJobs(accountId, fileIds, undefined)\n if (result === 'ERROR') return\n\n const jobs = await dispatch.jobs.parse(result)\n console.log('LOADED FILE JOBS', accountId, jobs)\n\n dispatch.jobs.setJobs({ accountId, jobs })\n dispatch.jobs.set({ fetching: false })\n },\n async fetchIfEmpty(accountId: string | void, state) {\n accountId = accountId || selectActiveAccountId(state)\n if (!state.jobs.all[accountId]) dispatch.jobs.fetch(accountId)\n },\n async parse(result: AxiosResponse | undefined): Promise {\n const data = result?.data?.data?.login?.account\n return (\n data?.jobs.items.map(j => ({\n ...j,\n jobDevices: j.jobDevices.map(jd => ({\n ...jd,\n attributes: jd.attributes.map(a => ({\n key: a.key.replace('$remoteit.', ''),\n value: a.value,\n })),\n })),\n })) || []\n )\n },\n async saveRun(form: IFileForm): Promise {\n console.log('SAVE AND RUN JOB', form)\n const jobId = await dispatch.jobs.save(form)\n await dispatch.jobs.run({ jobId, fileId: form.fileId })\n return jobId\n },\n async save(form: IFileForm, state): Promise {\n const job = selectJobs(state).find(j => j.id === form.jobId)\n if (job?.status !== 'READY') delete form.jobId\n const data = formAdaptor(form)\n const result = await graphQLSetJob(data)\n if (result === 'ERROR') return '-'\n console.log('SAVED JOB', form, result?.data)\n const jobId: string = result?.data.data.setJob\n await dispatch.jobs.fetchSingle({ jobId })\n dispatch.ui.set({ redirect: `/script/${form.fileId}/latest` })\n return jobId\n },\n async run({ jobId, fileId }: { jobId?: string; fileId: string }, state) {\n if (!jobId) return console.error('NO JOB ID TO RUN')\n const result = await graphQLStartJob(jobId)\n if (result === 'ERROR') return\n console.log('STARTED JOB', { result, jobId })\n dispatch.ui.set({ redirect: `/script/${fileId}/latest` })\n },\n async runAgain(script: IScript) {\n const deviceIds = script?.job?.jobDevices.map(d => d.device.id) || []\n const tagValues = script?.job?.tag?.values || []\n await dispatch.jobs.saveRun({\n deviceIds,\n jobId: script.job?.id || '',\n fileId: script.id,\n name: script.name || '',\n description: script.shortDesc || '',\n executable: script.executable,\n tag: script.job?.tag,\n access: tagValues.length ? 'TAG' : deviceIds.length ? 'CUSTOM' : 'NONE',\n })\n },\n async cancel(jobId: string | undefined) {\n const result = await graphQLCancelJob(jobId)\n if (result === 'ERROR') return\n console.log('CANCELED JOB', { result, jobId })\n },\n async unauthorized(deviceIds: string[], state) {\n return getDevices(state).filter(\n d => deviceIds.includes(d.id) && (!d.permissions.includes('SCRIPTING') || !d.scriptable)\n )\n },\n async setJobs({ accountId, jobs }: { accountId: string; jobs: IJob[] }, state) {\n const updated = structuredClone(state.jobs.all[accountId] || [])\n\n jobs.forEach(job => {\n const index = updated.findIndex(j => j.id === job.id)\n if (index === -1) updated.unshift(job)\n else updated[index] = job\n })\n\n dispatch.jobs.setAccount({ accountId, jobs: updated })\n },\n async setAccount(params: { jobs: IJob[]; accountId: string }, state) {\n let all = structuredClone(state.jobs.all)\n all[params.accountId] = params.jobs\n dispatch.jobs.set({ all })\n },\n }),\n reducers: {\n reset() {\n return { ...defaultState }\n },\n set(state, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nfunction formAdaptor(form: IFileForm) {\n return {\n fileId: form.fileId,\n jobId: form.jobId,\n arguments: undefined, // form.arguments to be implemented\n tagFilter: form.access === 'TAG' ? form.tag : undefined,\n deviceIds: form.access === 'SELECTED' || form.access === 'CUSTOM' ? form.deviceIds : undefined,\n // all: form.access === 'ALL',\n }\n}\n","import { graphQLBasicRequest } from './graphQL'\n\nexport async function graphQLGetAccessKeys() {\n return await graphQLBasicRequest(\n ` query Keys {\n login {\n apiKey {\n key\n updated\n }\n accessKeys {\n key\n enabled\n created\n lastUsed\n } \n }\n }`\n )\n}\n\nexport async function graphQLCreateAccessKey() {\n return await graphQLBasicRequest(\n ` mutation {\n createAccessKey {\n key\n secret\n }\n }`\n )\n}\n\nexport async function graphQLDeleteAccessKeys(key: string) {\n return await graphQLBasicRequest(\n ` mutation deleteAccessKey($key: String!) {\n deleteAccessKey(key: $key) \n }`,\n { key }\n )\n}\n\nexport async function graphQLToggleAccessKeys(properties: { key: string; enabled: boolean }) {\n return await graphQLBasicRequest(\n ` mutation updateAccessKey($key: String!, $enabled: Boolean!) {\n updateAccessKey(key: $key, enabled: $enabled) {\n key\n enabled\n }\n }`,\n properties\n )\n}\n","import { createModel } from '@rematch/core'\nimport { AxiosResponse } from 'axios'\nimport {\n graphQLGetAccessKeys,\n graphQLCreateAccessKey,\n graphQLDeleteAccessKeys,\n graphQLToggleAccessKeys,\n} from '../services/graphQLAccessKeys'\nimport { RootModel } from '.'\n\ntype IKeysState = {\n init: boolean\n updating?: string\n accessKeys: IAccessKey[]\n secretKey?: string\n apiKey?: string\n key?: string\n}\n\nconst defaultState: IKeysState = {\n init: false,\n updating: undefined,\n accessKeys: [],\n secretKey: undefined,\n apiKey: undefined,\n key: undefined,\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async init(_: void, globalState) {\n if (globalState.keys.init) return\n await dispatch.keys.fetch()\n dispatch.keys.set({ init: true })\n },\n async fetch() {\n const result = await graphQLGetAccessKeys()\n if (result === 'ERROR') return\n const { apiKey, accessKeys } = await dispatch.keys.parse(result)\n dispatch.keys.set({ apiKey, accessKeys })\n },\n async parse(result: AxiosResponse | undefined, globalState) {\n const data = result?.data?.data?.login\n const parsed = {\n apiKey: data?.apiKey?.key,\n accessKeys: data?.accessKeys?.map(k => ({\n ...k,\n created: new Date(k.created),\n lastUsed: k.lastUsed && new Date(k.lastUsed),\n })),\n }\n return parsed\n },\n async toggleAccessKeys(properties: { key: string; enabled: boolean }) {\n dispatch.keys.set({ updating: properties.key })\n const result = await graphQLToggleAccessKeys(properties)\n if (result === 'ERROR') return\n await dispatch.keys.fetch()\n dispatch.keys.set({ updating: undefined })\n },\n async deleteAccessKeys(key: string) {\n dispatch.keys.set({ updating: key })\n const result = await graphQLDeleteAccessKeys(key)\n if (result === 'ERROR') return\n await dispatch.keys.fetch()\n dispatch.keys.set({ updating: undefined })\n },\n async createAccessKey() {\n const result = await graphQLCreateAccessKey()\n if (result === 'ERROR') return\n const data = result?.data.data.createAccessKey\n await dispatch.keys.set({ key: data.key, secretKey: data.secret })\n dispatch.keys.fetch()\n },\n }),\n reducers: {\n reset(state: IKeysState) {\n state = { ...defaultState }\n return state\n },\n set(state: IKeysState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { graphQLBasicRequest } from './graphQL'\n\nconst EVENTS = `\n events(after: $after, size: $size, minDate: $minDate, maxDate: $maxDate) {\n hasMore\n last\n total\n items {\n state\n timestamp\n type\n action\n actor {\n email\n }\n target {\n id\n name\n device {\n id\n name\n }\n }\n users {\n email\n }\n devices {\n id\n name\n }\n ... on DeviceShareEvent {\n scripting\n }\n ... on DeviceJobEvent {\n job {\n file {\n name\n }\n }\n }\n ... on JobEvent {\n job {\n file {\n name\n }\n }\n }\n }\n }`\n\nconst EVENTS_URL = 'eventsUrl(minDate: $minDate, maxDate: $maxDate)'\n\nexport async function graphQLGetDeviceLogs(id: string, size: number, after?: string, minDate?: Date, maxDate?: Date) {\n return await graphQLBasicRequest(\n ` query DeviceLogs($id: [String!]!, $after: ID, $size: Int, $minDate: DateTime, $maxDate: DateTime) {\n login {\n id\n device(id: $id) { \n id\n ${EVENTS}\n }\n }\n }\n `,\n {\n id,\n after,\n minDate: minDate?.toISOString(),\n maxDate: maxDate?.toISOString(),\n size,\n }\n )\n}\n\nexport async function graphQLGetLogs(account: string, size: number, after?: string, minDate?: Date, maxDate?: Date) {\n return await graphQLBasicRequest(\n ` query Logs($account: String!, $after: ID, $size: Int, $minDate: DateTime, $maxDate: DateTime) {\n login {\n account(id: $account) {\n id\n ${EVENTS}\n }\n }\n }\n `,\n {\n account,\n after,\n minDate: minDate?.toISOString(),\n maxDate: maxDate?.toISOString(),\n size,\n }\n )\n}\n\nexport async function graphQLGetDeviceUrl(id: string, minDate?: Date, maxDate?: Date) {\n return await graphQLBasicRequest(\n ` query DeviceLogsUrl($id: [String!]!, $minDate: DateTime, $maxDate: DateTime) {\n login {\n id\n device(id: $id) { \n id\n ${EVENTS_URL}\n }\n }\n }\n `,\n {\n id,\n minDate: minDate?.toISOString(),\n maxDate: maxDate?.toISOString(),\n }\n )\n}\n\nexport async function graphQLGetUrl(minDate?: Date, maxDate?: Date) {\n return await graphQLBasicRequest(\n ` query LogsUrl($minDate: DateTime, $maxDate: DateTime) {\n login {\n id\n ${EVENTS_URL}\n }\n }\n `,\n {\n minDate: minDate?.toISOString(),\n maxDate: maxDate?.toISOString(),\n }\n )\n}\n","import { createModel } from '@rematch/core'\nimport { graphQLGetLogs, graphQLGetDeviceLogs, graphQLGetUrl, graphQLGetDeviceUrl } from '../services/graphQLLogs'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { RootModel } from '.'\n\ntype ILogState = {\n size: number\n after?: string\n maxDate?: Date\n minDate?: Date\n deviceId?: string\n fetching: boolean\n fetchingMore: boolean\n eventsUrl: string\n selectedDate?: Date\n planUpgrade: boolean\n daysAllowed: number\n events: IEventList\n}\n\nconst defaultState: ILogState = {\n after: undefined,\n size: 100,\n maxDate: undefined,\n minDate: undefined,\n deviceId: undefined,\n fetching: false,\n fetchingMore: false,\n eventsUrl: '',\n selectedDate: undefined,\n planUpgrade: false,\n daysAllowed: 0,\n events: {\n total: 0,\n last: '',\n items: [],\n hasMore: false,\n },\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch(_: void, state) {\n const { set } = dispatch.logs\n const { deviceId, size, after, maxDate, minDate, events } = state.logs\n const accountId = selectActiveAccountId(state)\n let items = after ? events.items : []\n\n after ? set({ fetchingMore: true }) : set({ fetching: true })\n\n let result\n let response: Awaited>\n\n if (deviceId) {\n response = await graphQLGetDeviceLogs(deviceId, size, after, minDate, maxDate)\n if (response === 'ERROR') return\n result = response?.data?.data?.login?.device[0] || {}\n } else {\n response = await graphQLGetLogs(accountId, size, after, minDate, maxDate)\n if (response === 'ERROR') return\n result = response?.data?.data?.login?.account || {}\n }\n\n set({\n events: {\n ...result.events,\n items: items.concat(result?.events?.items || []),\n deviceId,\n },\n })\n\n set({ fetching: false, fetchingMore: false })\n },\n\n async fetchUrl(_: void, state): Promise {\n const { deviceId, minDate, maxDate } = state.logs\n\n let result\n let response: Awaited>\n\n if (deviceId) {\n response = await graphQLGetDeviceUrl(deviceId, minDate, maxDate)\n if (response === 'ERROR') return\n result = response?.data?.data?.login?.device[0] || {}\n } else {\n response = await graphQLGetUrl(minDate, maxDate)\n if (response === 'ERROR') return\n result = response?.data?.data?.login || {}\n }\n // const { events, eventsUrl } = result.events\n console.log('LOG URL', result?.eventsUrl)\n return result?.eventsUrl\n },\n }),\n\n reducers: {\n reset(state: ILogState) {\n state = { ...defaultState }\n return state\n },\n set(state: ILogState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { createModel } from '@rematch/core'\nimport { AUTH_API_URL, DEVELOPER_KEY } from '../constants'\nimport { getToken } from '../services/remoteit'\nimport { RootModel } from '.'\nimport axios from 'axios'\n\nexport type IMfa = {\n mfaMethod: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA' | 'NO_MFA'\n verificationCode: string\n backupCode?: string\n showPhone: boolean\n showMFASelection: boolean\n showVerificationCode: boolean\n showSMSConfig: boolean\n lastCode: string | null\n totpVerificationCode: string\n showAuthenticatorConfig: boolean\n showEnableSelection: boolean\n error: string | null\n}\n\nconst defaultState: IMfa = {\n mfaMethod: 'NO_MFA',\n verificationCode: '',\n backupCode: undefined,\n showPhone: false,\n showMFASelection: false,\n showVerificationCode: false,\n showSMSConfig: false,\n lastCode: null,\n totpVerificationCode: '',\n showAuthenticatorConfig: false,\n showEnableSelection: false,\n error: null,\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async getAWSUser(_: void, state) {\n const userInfo = await state.auth.authService?.currentUserInfo()\n if (!userInfo) {\n console.error('Could not getAWSUser', userInfo)\n return\n }\n const response = await axios.get(`${AUTH_API_URL}/mfaPref`, {\n headers: {\n developerKey: DEVELOPER_KEY,\n Authorization: await getToken(),\n },\n })\n dispatch.mfa.set({ mfaMethod: response.data.MfaPref })\n if (userInfo.attributes) {\n delete userInfo.attributes['identities']\n delete userInfo.attributes['sub']\n }\n const AWSUser = {\n ...state.auth.AWSUser,\n ...userInfo.attributes,\n authProvider: userInfo.username?.toLowerCase().includes('google') ? 'Google' : '',\n }\n await dispatch.auth.set({ AWSUser })\n },\n\n async setMFAPreference(mfaMethod: IMfa['mfaMethod']) {\n try {\n const response = await axios.post(\n `${AUTH_API_URL}/mfaPref`,\n { MfaPref: mfaMethod },\n { headers: { developerKey: DEVELOPER_KEY, Authorization: await getToken() } }\n )\n dispatch.mfa.set({ mfaMethod: response.data.MfaPref, backupCode: response.data.backupCode })\n if (response.data.MfaPref !== 'NO_MFA') {\n dispatch.ui.set({ successMessage: 'Two-factor authentication enabled successfully.' })\n }\n console.log('SET MFA PREFERENCE', response)\n } catch (error) {\n if (error instanceof Error) {\n dispatch.ui.set({ errorMessage: `Two-factor authentication enabled error: ${error.message}` })\n }\n }\n },\n\n async updatePhone(phone: string, state) {\n try {\n await state.auth.authService?.updateCurrentUserAttributes({ phone_number: phone })\n await dispatch.mfa.getAWSUser()\n await state.auth.authService?.verifyCurrentUserAttribute('phone_number')\n await dispatch.mfa.setMFAPreference('NO_MFA')\n dispatch.ui.set({ successMessage: 'Verification sent.' })\n return true\n } catch (error) {\n console.error(error)\n if (error instanceof Error) {\n dispatch.ui.set({ errorMessage: ' Update phone error: ' + error.message })\n }\n }\n },\n\n async verifyPhone(verificationCode: string, state) {\n try {\n await state.auth.authService?.verifyCurrentUserAttributeSubmit('phone_number', verificationCode)\n await dispatch.mfa.setMFAPreference('SMS_MFA')\n await dispatch.mfa.getAWSUser()\n } catch (error) {\n console.error(error)\n if (error instanceof Error) {\n dispatch.ui.set({ errorMessage: 'Phone verification error: ' + error.message })\n }\n }\n },\n\n async getTotpCode(_: void, state) {\n return state.auth.authService?.setupTOTP()\n },\n\n async verifyTotpCode(code: string, state) {\n try {\n await state.auth.authService?.verifyTotpToken(code)\n } catch (error) {\n console.error(error)\n if (error instanceof Error) {\n dispatch.ui.set({ errorMessage: `Invalid TOTP Code. (${error.message})` })\n }\n return\n }\n await dispatch.mfa.setMFAPreference('SOFTWARE_TOKEN_MFA')\n },\n }),\n reducers: {\n reset(state: IMfa) {\n state = { ...defaultState }\n return state\n },\n set(state: IMfa, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { createModel } from '@rematch/core'\nimport { REGEX_SERVICE_ID } from '../constants'\nimport { removeDeviceName } from '@common/nameHelper'\nimport { graphQLBasicRequest } from '../services/graphQL'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { RootModel } from '.'\n\ntype ISearchState = ILookup & {\n search: ISearch[]\n fetching: boolean\n cloudSearch: boolean\n}\n\nconst searchState: ISearchState = {\n search: [],\n fetching: false,\n cloudSearch: true,\n}\n\nexport default createModel()({\n state: { ...searchState },\n effects: dispatch => ({\n async updateSearch(_: void, state) {\n const { total, size } = selectDeviceModelAttributes(state)\n const { membership: member } = state.accounts\n\n dispatch.search.set({ cloudSearch: total > size || !!member.length })\n },\n async fetch(name: string, state) {\n if (!state.auth.user) return\n if (!state.search.cloudSearch) return\n\n name = name.trim()\n const isServiceId = REGEX_SERVICE_ID.test(name)\n\n dispatch.search.set({ fetching: true })\n\n const id = selectActiveAccountId(state)\n const size = 10\n const accountQuery = `\n account(id: $id) {\n id\n devices(size: $size, name: $name, id: $serviceId) {\n items {\n id\n name\n platform\n owner {\n email\n }\n services {\n name\n id\n }\n }\n }\n networks {\n id\n name\n connections {\n name\n service {\n name\n id\n }\n }\n owner {\n email\n }\n }\n }`\n\n const response = await graphQLBasicRequest(\n ` query Search($id: String, $size: Int, $name: String, $serviceId: [String!]) {\n login {\n ${accountQuery}\n }\n }`,\n {\n id,\n size,\n name: isServiceId ? undefined : name,\n serviceId: isServiceId ? [name] : undefined,\n }\n )\n\n if (response === 'ERROR') return\n const search = await dispatch.search.parse({ response, id })\n await dispatch.search.set({ search })\n dispatch.search.set({ fetching: false })\n },\n\n async parse({ response, id }: { response: any; id: string }): Promise {\n const data = response?.data?.data?.login?.account\n\n const accountId = data.id\n const devices = data.devices.items\n const networks = data.networks\n const parsedDevices = devices.map(device =>\n device.services.map(service => {\n const serviceName = removeDeviceName(device.name, service.name)\n return {\n accountId,\n serviceName,\n nodeId: device.id,\n nodeName: device.name,\n nodeType: 'DEVICE',\n combinedName: serviceName + ' ' + device.name + ' ' + device.id + ' ' + service.id,\n serviceId: service.id,\n ownerEmail: device.owner.email,\n targetPlatform: device.platform,\n }\n })\n )\n\n const parsedNetworks = networks.map(network =>\n network.connections.map(connection => {\n const service = connection.service\n return {\n accountId,\n serviceName: connection.name || service.name,\n nodeId: network.id,\n nodeName: network.name,\n nodeType: 'NETWORK',\n combinedName: service.name + ' ' + network.name + ' ' + connection.name,\n serviceId: service.id,\n ownerEmail: network.owner.email,\n targetPlatform: undefined,\n }\n })\n )\n\n const all = parsedNetworks.concat(parsedDevices).flat()\n\n // remove duplicates\n const result = all.filter(\n (item, index) => all.findIndex(({ combinedName }) => combinedName === item.combinedName) === index\n )\n\n console.log('search result', result)\n return result\n },\n }),\n\n reducers: {\n reset(state: ISearchState) {\n state = { ...searchState }\n return state\n },\n set(state: ISearchState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nexport function sortSearch(search: ISearch[]): ISearch[] {\n const sorted = search.sort((a, b) => {\n if (a.nodeName.toLowerCase() > b.nodeName.toLowerCase()) return 1\n if (a.nodeName.toLowerCase() < b.nodeName.toLowerCase()) return -1\n return 0\n })\n return sorted || []\n}\n","import { State } from '../store'\nimport { createModel } from '@rematch/core'\nimport { getAccountIds } from './accounts'\nimport { graphQLFetchSessions } from '../services/graphQLRequest'\nimport { setConnection, getManufacturerType, getManufacturerUser } from '../helpers/connectionHelper'\nimport { graphQLDisconnect } from '../services/graphQLMutation'\nimport { isReverseProxy } from './applicationTypes'\nimport { AxiosResponse } from 'axios'\nimport { combinedName } from '@common/nameHelper'\nimport { RootModel } from '.'\n\ntype ISessionsState = ILookup & {\n all: ISession[]\n}\n\nconst sessionsState: ISessionsState = {\n all: [],\n}\n\nexport default createModel()({\n state: sessionsState,\n effects: dispatch => ({\n async fetch(_: void, state) {\n const ids: string[] = getAccountIds(state)\n const result = await graphQLFetchSessions(ids)\n if (result === 'ERROR') return\n\n const all = await dispatch.sessions.parse({ result, ids })\n console.log('SESSIONS', all)\n dispatch.sessions.updatePublicConnections(all)\n dispatch.sessions.set({ all })\n },\n\n async parse({ result, ids }: { result: AxiosResponse | undefined; ids: string[] }): Promise {\n if (!result) return []\n const data = result?.data?.data?.login\n let all: ISession[] = []\n for (let index = 0; index < ids.length; index++) {\n const accountId = ids[index]\n if (!data?.[`_${index}`]) continue\n const { sessions } = data[`_${index}`]\n const parsed = await dispatch.sessions.parseSessions({ data: sessions, accountId })\n all = all.concat(parsed)\n }\n return all\n },\n\n /* \n Sort and filter session data\n - Sort by timestamp\n - Filter out this user's sessions\n - Combine same user sessions\n */\n async parseSessions({ data, accountId }: { data: any; accountId: string }, state): Promise {\n if (!data) return []\n const dates = data.map((e: any) => ({ ...e, timestamp: new Date(e.timestamp) }))\n const sorted = dates.sort((a: any, b: any) => a.timestamp - b.timestamp)\n return sorted.reduce((sessions: ISession[], s: any) => {\n // if (!sessions.some(s => s.id === e.user?.id && s.platform === e.endpoint?.platform))\n if (!s.endpoint) return sessions\n const reverseProxy = isReverseProxy(state, s.target.application)\n // const accountIdFromDevice = accountFromDevice(\n // state,\n // s.target.owner.id,\n // s.target.device.access.map(a => a.user.id)\n // )\n // if (accountIdFromDevice !== accountId) console.warn('ACCOUNT MISMATCH', accountId, accountIdFromDevice, s)\n sessions.push({\n id: s.id,\n reverseProxy,\n manufacturer: getManufacturerType(s.endpoint.manufacturer, reverseProxy),\n timestamp: new Date(s.timestamp),\n source: s.source,\n isP2P: !s.endpoint.proxy,\n platform: s.endpoint.platform,\n user: getManufacturerUser(s.endpoint.manufacturer, reverseProxy) || s.user,\n geo: s.endpoint.geo,\n target: {\n id: s.target.id,\n accountId,\n deviceId: s.target.device.id,\n platform: s.target.platform,\n name: combinedName(s.target, s.target.device),\n },\n })\n return sessions\n }, [])\n },\n\n // updating public proxy connections mainly for portal\n async updatePublicConnections(all: ISession[], state) {\n const publicConnections = state.connections.all.filter(c => c.public && !c.connectLink)\n console.log('PUBLIC CONNECTIONS', publicConnections)\n publicConnections.forEach(connection => {\n const session = all.find(s => s.id === connection.sessionId)\n if (connection.connecting !== false || connection.enabled !== !!session || connection.connected !== !!session) {\n setConnection({ ...connection, connecting: false, enabled: !!session, connected: !!session })\n }\n })\n },\n\n async disconnect({ id, sessionId }: { id: string; sessionId?: string }) {\n if (!sessionId) {\n console.warn('No sessionId for disconnect')\n return\n }\n\n const result = await graphQLDisconnect(id, sessionId)\n\n if (result === 'ERROR') {\n return false\n }\n\n console.log('PROXY DISCONNECTED', result)\n return true\n },\n }),\n reducers: {\n setSession(state, session: ISession) {\n const index = state.all.findIndex(s => s.id === session.id)\n if (index > -1) state.all[index] = session\n else state.all.push(session)\n return state\n },\n removeSession(state, sessionId: string) {\n const index = state.all.findIndex(s => s.id === sessionId)\n state.all.splice(index, 1)\n return state\n },\n reset(state: ISessionsState) {\n state = sessionsState\n return state\n },\n set(state, params: ILookup) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nexport function selectSessionsByService(state: State, id?: string) {\n const sessions = state.sessions.all.filter(s => s.target.id === id)\n return sessions\n}\n","import { REGEX_EMAIL_SAFE, REGEX_DOMAIN_SAFE } from '../constants'\n\nexport function getAccess(device?: IDevice, email?: string) {\n if (!device) return { services: [], scripting: false }\n\n let services = device.services.filter(s => s.access?.find(ac => ac.email === email)) || []\n const scripting = device.access?.find(ac => ac.email === email)?.scripting || false\n\n return { services, scripting }\n}\n\nexport function sanitizeEmail(input: string): string {\n const index = input.lastIndexOf('@')\n\n if (index === -1) {\n return input.replace(REGEX_EMAIL_SAFE, '')\n } else {\n const localPart = input.substring(0, index)\n const domainPart = input.substring(index + 1)\n\n return localPart.replace(REGEX_EMAIL_SAFE, '') + '@' + domainPart.replace(REGEX_DOMAIN_SAFE, '')\n }\n}\n\nclass RememberMe {\n key: string = 'rememberMe'\n username: string = ''\n emailProcessed: boolean = false\n\n constructor() {\n const storage = window.localStorage.getItem(this.key)\n if (!storage) return\n try {\n const state = JSON.parse(storage)\n this.username = state.username\n this.emailProcessed = state.emailProcessed\n } catch (e) {\n console.error('REMEMBER ME ERROR', e)\n }\n }\n\n get checked() {\n return !!this.username\n }\n\n set(settings: { username: string; emailProcessed: boolean }) {\n this.username = settings.username\n this.emailProcessed = settings.emailProcessed\n window.localStorage.setItem(this.key, JSON.stringify(settings))\n }\n\n toggle(settings: { username: string; emailProcessed: boolean }) {\n if (this.checked) {\n this.username = ''\n this.emailProcessed = false\n window.localStorage.removeItem(this.key)\n } else {\n this.set(settings)\n }\n }\n}\n\nexport const rememberMe = new RememberMe()\n","import { createModel } from '@rematch/core'\nimport { graphQLUnShareDevice, graphQLShareDevice } from '../services/graphQLMutation'\nimport { getAccess } from '../helpers/userHelper'\nimport { attributeName } from '@common/nameHelper'\nimport { getDevices } from '../selectors/devices'\nimport { RootModel } from '.'\n\ntype ShareParams = { [key: string]: any }\n\ntype CurrentDevice = {\n device: IDevice\n serviceId: string\n userSelected: IUserRef | undefined\n selectedServices: string[]\n users: string[]\n script: boolean\n hasChange: boolean\n indeterminate: string[]\n scriptIndeterminate: boolean\n shareChanged: boolean\n}\n\ntype IShareState = {\n deleting: boolean\n updating: boolean\n sharing: boolean\n currentDevice?: CurrentDevice\n}\n\nconst defaultState: IShareState = {\n deleting: false,\n updating: false,\n sharing: false,\n currentDevice: undefined,\n}\n\nexport default createModel()({\n state: defaultState,\n effects: dispatch => ({\n async fetch(data: { email?: string; serviceId: string; device?: IDevice }, state) {\n const { set } = dispatch.shares\n const user = state.contacts.all.find(c => c.email === data.email)\n const permissions = data.device && getAccess(data.device, data.email)\n\n set({\n currentDevice: {\n device: data.device,\n serviceId: data.serviceId,\n userSelected: user,\n selectedServices: permissions?.services.map(s => s.id).filter(v => v) || [],\n script: permissions?.scripting || false,\n indeterminate: [],\n scriptIndeterminate: false,\n },\n })\n },\n\n async delete(userDevice: { deviceId: string; email: string }) {\n const { deviceId, email } = userDevice\n const { set } = dispatch.shares\n set({ deleting: true })\n const result = await graphQLUnShareDevice({ deviceId, email: [email] })\n if (result !== 'ERROR') {\n await dispatch.devices.fetchSingleFull({ id: deviceId })\n await dispatch.organization.fetch()\n dispatch.ui.set({ successMessage: `${email} successfully removed.` })\n }\n set({ deleting: false })\n },\n\n async share(data: IShareProps, state) {\n const { set } = dispatch.shares\n set({ sharing: true })\n const device = getDevices(state).find((d: IDevice) => d.id === data.deviceId)\n const result = await graphQLShareDevice(data)\n if (result !== 'ERROR') {\n await dispatch.devices.fetchSingleFull({ id: data.deviceId })\n await dispatch.contacts.fetch()\n dispatch.ui.set({\n successMessage:\n data.email.length > 1\n ? `${data.email.length} accounts shared to ${attributeName(device)}.`\n : `${attributeName(device)} shared to ${data.email[0]}.`,\n })\n }\n set({ sharing: false })\n },\n\n async setScript(script: boolean, state) {\n const { set } = dispatch.shares\n set({\n currentDevice: {\n ...state.shares.currentDevice,\n script,\n },\n })\n },\n\n async setSelectedServices(selectedServices: string[], state) {\n const { set } = dispatch.shares\n set({\n currentDevice: {\n ...state.shares.currentDevice,\n selectedServices,\n },\n })\n },\n\n async changeIndeterminate(indeterminate: string[], state) {\n const { set } = dispatch.shares\n set({\n currentDevice: {\n ...state.shares.currentDevice,\n indeterminate,\n },\n })\n },\n\n async selectAllServices(_: void, state) {\n const { set } = dispatch.shares\n set({\n currentDevice: {\n ...state.shares.currentDevice,\n indeterminate: [],\n },\n })\n },\n\n async changeScriptIndeterminate(scriptIndeterminate: boolean, state) {\n const { set } = dispatch.shares\n set({\n currentDevice: {\n ...state.shares.currentDevice,\n scriptIndeterminate,\n },\n })\n },\n\n async selectContacts(emails: string[], state) {\n if (!state.shares.currentDevice) return\n\n const currentDevice = structuredClone(state.shares.currentDevice)\n const { device } = currentDevice\n\n currentDevice.userSelected = state.contacts.all.find(c => emails.includes(c.email))\n currentDevice.users = emails\n\n let intersection: string[] = []\n let userSelectedServices: string[][] = emails.map(email => {\n return device ? getAccess(device, email).services.map(s => s.id) : []\n })\n\n let userSelectedScript: boolean[] = emails.map(email => {\n return device ? getAccess(device, email).scripting : false\n })\n\n const match = userSelectedServices.map((services, index) => {\n intersection = index === 0 ? services : intersection.filter(value => services.includes(value))\n return intersection\n })\n const matchServices = match[match.length - 1] || []\n\n currentDevice.indeterminate = userSelectedServices\n .flat()\n .filter((v, i, a) => a.indexOf(v) === i)\n .filter(value => !matchServices.includes(value))\n\n const unique: any = new Set(userSelectedScript)\n switch (Array.from(unique).length) {\n case 1: {\n currentDevice.scriptIndeterminate = false\n currentDevice.script = userSelectedScript[0]\n break\n }\n case 0: {\n currentDevice.scriptIndeterminate = false\n currentDevice.script = false\n break\n }\n default: {\n currentDevice.scriptIndeterminate = true\n currentDevice.script = false\n }\n }\n\n const uniqueSelectedServices = new Set([...currentDevice.selectedServices, ...matchServices])\n currentDevice.selectedServices = Array.from(uniqueSelectedServices).filter(v => v)\n\n console.log('SELECT CONTACT', currentDevice)\n dispatch.shares.set({ currentDevice })\n },\n }),\n reducers: {\n set(state: IShareState, params: ShareParams) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import structuredClone from '@ungap/structured-clone'\nimport { getDevices } from '../selectors/devices'\nimport { State } from '../store'\n\nexport function eachSelectedDevice(state: State, selected: IDevice['id'][], callback: (device: IDevice) => void) {\n getDevices(state).forEach(device => {\n if (selected.includes(device.id)) callback(structuredClone(device))\n })\n}\n\nexport function getSelectedTags(devices?: IDevice[], selected?: IDevice['id'][]) {\n let result: ITag[] = []\n devices?.forEach(d => {\n if (selected?.includes(d.id)) {\n d.tags.forEach(t => {\n if (!result.find(r => r.name === t.name)) result.push(t)\n })\n }\n })\n // sort\n return result\n}\n","import structuredClone from '@ungap/structured-clone'\nimport { createModel } from '@rematch/core'\nimport { AxiosResponse } from 'axios'\nimport { eachSelectedDevice } from '../helpers/selectedHelper'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { selectPermissions } from '../selectors/organizations'\nimport { selectTags } from '../selectors/tags'\nimport {\n graphQLSetTag,\n graphQLAddDeviceTag,\n graphQLAddNetworkTag,\n graphQLRemoveDeviceTag,\n graphQLRemoveNetworkTag,\n graphQLDeleteTag,\n graphQLRenameTag,\n graphQLMergeTag,\n} from '../services/graphQLMutation'\nimport { graphQLBasicRequest } from '../services/graphQL'\nimport { State } from '../store'\nimport { findTagIndex } from '../helpers/utilHelper'\nimport { getNextLabel } from './labels'\nimport { RootModel } from '.'\n\ntype ITagState = {\n all: { [accountId: string]: ITag[] }\n adding?: boolean\n creating?: boolean\n removing?: boolean\n deleting?: string\n updating?: string\n}\n\nconst defaultState: ITagState = {\n all: {},\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch(accountId: string | void, state) {\n accountId = accountId || selectActiveAccountId(state)\n const result = await graphQLBasicRequest(\n ` query Tags($account: String) {\n login {\n account(id: $account) {\n tags {\n name\n color\n created\n }\n }\n }\n }`,\n {\n account: accountId,\n }\n )\n if (result === 'ERROR') return\n const tags = await dispatch.tags.parse(result)\n if (tags) dispatch.tags.setTags({ tags, accountId })\n },\n\n async fetchIfEmpty(accountId: string | void, state) {\n accountId = accountId || selectActiveAccountId(state)\n if (!state.tags.all[accountId]) dispatch.tags.fetch(accountId)\n },\n\n async parse(result: AxiosResponse | undefined) {\n const all = result?.data?.data?.login?.account?.tags\n if (!all) return\n const parsed: ITag[] = all.map(t => ({\n name: t.name,\n color: t.color,\n created: new Date(t.created),\n }))\n return parsed\n },\n\n async addDevice({ tag, device, accountId }: { tag: ITag; device: IDevice; accountId: string }) {\n if (!device) return\n const copy = structuredClone(device)\n copy.tags.push(tag)\n dispatch.accounts.setDevice({ id: copy.id, device: copy })\n const result = await graphQLAddDeviceTag(copy.id, tag.name, accountId)\n if (result === 'ERROR' || !result?.data?.data?.addTag) {\n dispatch.accounts.setDevice({ id: device.id, device })\n }\n },\n\n async addNetwork({ tag, network }: { tag: ITag; network: INetwork }) {\n if (!network) return\n const copy = structuredClone(network)\n copy.tags.push(tag)\n dispatch.networks.setNetwork(copy)\n const result = await graphQLAddNetworkTag(copy.id, tag.name)\n if (result === 'ERROR' || !result?.data?.data?.addNetworkTag) {\n dispatch.networks.setNetwork(network)\n }\n },\n\n async addSelected({ tag, selected }: { tag: ITag; selected: IDevice['id'][] }, state) {\n dispatch.tags.set({ adding: true })\n let add: IDevice['id'][] = []\n eachSelectedDevice(state, selected, device => {\n const index = findTagIndex(device.tags, tag.name)\n if (index === -1) {\n device.tags.push(tag)\n add.push(device.id)\n dispatch.accounts.setDevice({ id: device.id, device })\n }\n })\n const result = await graphQLAddDeviceTag(add, tag.name, selectActiveAccountId(state))\n if (result !== 'ERROR')\n dispatch.ui.set({\n successMessage: `${tag.name} added to ${add.length} device${add.length === 1 ? '' : 's'}.`,\n })\n dispatch.tags.set({ adding: false })\n },\n\n async removeDevice({ tag, device, accountId }: { tag: ITag; device: IDevice; accountId: string }) {\n const copy: IDevice = removeTag(device, tag)\n dispatch.accounts.setDevice({ id: copy.id, device: copy })\n const result = await graphQLRemoveDeviceTag(device.id, tag.name, accountId)\n if (result === 'ERROR' || !result?.data?.data?.removeTag) {\n dispatch.accounts.setDevice({ id: device.id, device })\n }\n },\n\n async removeNetwork({ tag, network }: { tag: ITag; network: INetwork }) {\n const copy = removeTag(network, tag)\n dispatch.networks.setNetwork(copy)\n const result = await graphQLRemoveNetworkTag(copy.id, tag.name)\n if (result === 'ERROR' || !result?.data?.data?.removeNetworkTag) {\n dispatch.networks.setNetwork(network)\n }\n },\n\n async removeSelected({ tag, selected }: { tag: ITag; selected: IDevice['id'][] }, state) {\n let count = 0\n dispatch.tags.set({ removing: true })\n eachSelectedDevice(state, selected, device => {\n const index = findTagIndex(device.tags, tag.name)\n if (index !== -1) {\n count++\n device.tags.splice(index, 1)\n dispatch.accounts.setDevice({ id: device.id, device })\n }\n })\n const result = await graphQLRemoveDeviceTag(selected, tag.name, selectActiveAccountId(state))\n if (result !== 'ERROR')\n dispatch.ui.set({\n successMessage: `${tag.name} removed from ${count} device${count > 1 ? 's' : ''}.`,\n })\n dispatch.tags.set({ removing: false })\n },\n\n async create({ tag, accountId }: { tag: ITag; accountId?: string }, state) {\n accountId = accountId || selectActiveAccountId(state)\n const tags = selectTags(state)\n dispatch.tags.set({ creating: true })\n tag.color = tag.color || getNextLabel(state)\n const result = await graphQLSetTag({ name: tag.name, color: tag.color }, accountId)\n if (result === 'ERROR') return\n dispatch.tags.setTags({ tags: [...tags, tag], accountId })\n dispatch.tags.set({ creating: false })\n },\n\n async update({ tag, accountId }: { tag: ITag; accountId: string }, state) {\n dispatch.tags.set({ updating: tag.name })\n const tags = structuredClone(selectTags(state, accountId))\n const result = await graphQLSetTag({ name: tag.name, color: tag.color }, accountId)\n if (result === 'ERROR') return\n const index = findTagIndex(tags, tag.name)\n tags[index] = tag\n dispatch.tags.setTags({ tags, accountId })\n dispatch.tags.set({ updating: undefined })\n dispatch.devices.fetchList()\n },\n\n async rename({ tag, name, accountId }: { tag: ITag; name: string; accountId: string }, state) {\n dispatch.tags.set({ updating: tag.name })\n const tags = structuredClone(selectTags(state, accountId))\n const found = findTagIndex(tags, name)\n const index = findTagIndex(tags, tag.name)\n if (found >= 0 && tag.name.toLowerCase() !== name.toLowerCase()) {\n // merge\n const result = await graphQLMergeTag(tag.name, name, accountId)\n if (result === 'ERROR') return\n tags.splice(index, 1)\n dispatch.ui.set({ noticeMessage: `Tag merged into existing tag ‘${name}.’` })\n } else {\n // rename\n const result = await graphQLRenameTag(tag.name, name, accountId)\n if (result === 'ERROR' || !result?.data?.data?.renameTag) {\n dispatch.ui.set({ errorMessage: `Your tag (${name}) could not be renamed.` })\n return\n }\n tags[index].name = name\n }\n dispatch.tags.setTags({ tags, accountId })\n dispatch.tags.set({ updating: undefined })\n dispatch.devices.fetchList()\n },\n\n async delete({ tag, accountId }: { tag: ITag; accountId: string }, state) {\n const tags = [...selectTags(state)]\n dispatch.tags.set({ deleting: tag.name })\n const result = await graphQLDeleteTag(tag.name, accountId)\n if (result === 'ERROR') return\n const index = findTagIndex(tags, tag.name)\n tags.splice(index, 1)\n dispatch.tags.setTags({ tags, accountId })\n dispatch.tags.set({ deleting: undefined })\n dispatch.devices.fetchList()\n },\n\n async setTags({ tags, accountId }: { tags: ITag[]; accountId: string }, state) {\n tags = tags.sort((a, b) => (b.created?.getTime() || 0) - (a.created?.getTime() || 0))\n let all = { ...state.tags.all }\n all[accountId] = tags\n dispatch.tags.set({ all })\n },\n }),\n reducers: {\n reset(state: ITagState) {\n state = { ...defaultState }\n return state\n },\n set(state: ITagState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n\nfunction removeTag(original: T, tag: ITag): T {\n const copy = structuredClone(original)\n const index = findTagIndex(copy.tags, tag.name)\n copy.tags.splice(index, 1)\n return copy\n}\n\nexport function canEditTags(state: State, accountId?: string) {\n const permissions = selectPermissions(state, accountId)\n return !!permissions.includes('ADMIN')\n}\n","import structuredClone from '@ungap/structured-clone'\nimport { emit } from '../services/Controller'\nimport { StatusBar, Style } from '@capacitor/status-bar'\nimport { RootModel } from '.'\nimport { isDarkMode } from '../styling/theme'\nimport { NoticeProps } from '../components/Notice'\nimport { createModel } from '@rematch/core'\nimport { SIDEBAR_WIDTH } from '../constants'\nimport { State } from '../store'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport browser, { getLocalStorage, setLocalStorage } from '../services/browser'\n\nexport const DEFAULT_INTERFACE = 'searching'\n\nconst SAVED_ACROSS_LOGOUT = [\n 'apis',\n 'guides',\n 'panelWidth',\n 'poppedBubbles',\n 'expireBubbles',\n 'themeMode',\n 'accordion',\n 'drawerMenu',\n 'drawerAccordion',\n 'collapsed',\n 'columns',\n 'columnWidths',\n 'limitsOverride',\n 'defaultService',\n 'testUI',\n 'updateNoticeCleared',\n 'deviceTimeSeries',\n 'serviceTimeSeries',\n 'showDesktopNotice',\n 'mobileWelcome',\n]\n\nexport type UIState = {\n themeMode: 'light' | 'dark' | 'system'\n themeDark: boolean\n testUI?: 'ON' | 'HIGHLIGHT'\n apis: {\n switchApi?: IPreferences['switchApi']\n apiGraphqlURL?: IPreferences['apiGraphqlURL']\n webSocketURL?: IPreferences['webSocketURL']\n apiURL?: IPreferences['apiURL']\n }\n layout: ILayout\n silent: string | null\n selected: IDevice['id'][]\n connected: boolean\n offline?: { severity: NoticeProps['severity']; title: string; message: NoticeProps['children'] }\n mobileNavigation: string[]\n waitMessage?: string\n claiming: boolean\n fetching: boolean\n destroying: boolean\n transferring: boolean\n deleteAccount: boolean\n routingLock?: IRouteType\n routingMessage?: string\n sidebarMenu: boolean\n drawerMenu: 'FILTER' | 'COLUMNS' | null\n drawerAccordion: string | number\n columns: string[]\n columnWidths: ILookup\n collapsed: string[]\n limitsOverride: ILookup\n globalTooltip?: IGlobalTooltip\n defaultService: ILookup\n defaultSelection: ILookup>\n registrationCommand?: string\n registrationCode?: string\n redirect?: string\n restoring: boolean\n scanEnabled: boolean\n scanLoading: { [interfaceName: string]: boolean }\n scanTimestamp: { [interfaceName: string]: number }\n scanInterface: string\n setupBusy: boolean\n setupAdded?: Partial\n setupRegisteringDevice: boolean\n setupDeletingDevice: boolean\n setupAddingService: boolean\n setupDeletingService?: string\n setupServiceBusy?: string\n setupServicesCount: number\n setupServicesNew: boolean\n setupServicesLimit: number\n successMessage: React.ReactNode\n noticeMessage: React.ReactNode\n errorMessage: React.ReactNode\n panelWidth: ILookup\n guides: ILookup\n poppedBubbles: string[]\n expireBubbles: boolean\n confirm?: { id: string; callback: () => void }\n accordion: ILookup\n autoConnect: boolean\n autoLaunch?: string\n autoCopy: boolean\n updateNoticeCleared?: number\n showRestoreModal: boolean\n deviceTimeSeries?: ITimeSeriesOptions\n serviceTimeSeries?: ITimeSeriesOptions\n connectThisDevice: boolean\n mobileWelcome: boolean\n showDesktopNotice: boolean\n scriptForm?: IFileForm\n}\n\nexport const defaultState: UIState = {\n themeMode: 'system',\n themeDark: isDarkMode(),\n testUI: undefined,\n apis: {},\n layout: {\n mobile: false,\n showOrgs: false,\n hideSidebar: false,\n singlePanel: false,\n sidePanelWidth: SIDEBAR_WIDTH,\n showBottomMenu: false,\n insets: { top: 0, left: 0, bottom: 0, right: 0, topPx: '', bottomPx: '', leftPx: '', rightPx: '' },\n },\n silent: null,\n selected: [],\n connected: false,\n offline: undefined,\n mobileNavigation: [],\n waitMessage: undefined,\n claiming: false,\n fetching: false,\n destroying: false,\n transferring: false,\n deleteAccount: false,\n routingLock: undefined,\n routingMessage: undefined,\n sidebarMenu: false,\n drawerMenu: null,\n drawerAccordion: 'sort',\n columns: [\n 'deviceName',\n 'status',\n 'deviceTimeSeries',\n 'tags',\n 'services',\n 'serviceName',\n 'serviceState',\n 'serviceStatus',\n 'serviceAction',\n 'serviceTimeSeries',\n ],\n columnWidths: {},\n collapsed: [],\n limitsOverride: {},\n globalTooltip: undefined,\n defaultService: {},\n defaultSelection: {},\n registrationCommand: undefined,\n registrationCode: undefined,\n redirect: undefined,\n restoring: false,\n scanEnabled: true,\n scanLoading: {},\n scanTimestamp: {},\n scanInterface: DEFAULT_INTERFACE,\n setupBusy: false,\n setupAdded: undefined,\n setupRegisteringDevice: false,\n setupDeletingDevice: false,\n setupServiceBusy: undefined,\n setupDeletingService: undefined,\n setupAddingService: false,\n setupServicesCount: 0,\n setupServicesNew: true,\n setupServicesLimit: 100,\n successMessage: '',\n noticeMessage: '',\n errorMessage: '',\n panelWidth: {\n devices: 400,\n networks: 450,\n connections: 450,\n settings: 350,\n account: 300,\n organization: 350,\n scripting: 550,\n script: 450,\n },\n guides: {\n // all multi-step guides disabled while testing the guide bubbles\n // - consider removing guide steps feature if not needed any longer\n aws: { title: 'AWS Guide', step: 1, total: 6, done: true, weight: 20 },\n network: { title: 'Add Network Guide', step: 1, total: 3, done: true, weight: 30 },\n service: { title: 'Add Service Guide ', step: 1, total: 3, done: true, weight: 40 },\n register: { title: 'Device Registration Guide', step: 1, total: 1, done: true, weight: 10 },\n },\n poppedBubbles: [],\n expireBubbles: false,\n accordion: { config: false, configConnected: false, options: false, service: false, networks: false, logs: false },\n confirm: undefined,\n autoConnect: false,\n autoLaunch: undefined,\n autoCopy: false,\n updateNoticeCleared: undefined,\n showRestoreModal: false,\n deviceTimeSeries: undefined,\n serviceTimeSeries: undefined,\n connectThisDevice: false,\n mobileWelcome: true,\n showDesktopNotice: true,\n scriptForm: undefined,\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async init() {\n console.log('UI INIT')\n // add color scheme listener\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {\n dispatch.ui.setTheme(undefined)\n })\n await dispatch.ui.restoreState()\n },\n async restoreState(_: void, state) {\n let states: ILookup = {}\n SAVED_ACROSS_LOGOUT.forEach(key => {\n const value = getLocalStorage(state, `ui-${key}`)\n if (value !== null) {\n if (typeof value === 'object' && !Array.isArray(value)) states[key] = { ...state.ui[key], ...value }\n else states[key] = value\n }\n })\n console.log('RESTORE UI STATE', states)\n states = migrateColumnStates(states)\n dispatch.ui.set(states)\n dispatch.ui.setTheme(states.themeMode)\n },\n async setupUpdated(count: number, state) {\n if (count !== state.ui.setupServicesCount) {\n dispatch.ui.updated()\n dispatch.ui.set({ setupServicesCount: count, setupAdded: undefined, setupServicesNew: true })\n }\n },\n async setTheme(themeMode: UIState['themeMode'] | void, state) {\n themeMode = themeMode || state.ui.themeMode\n const themeDark = isDarkMode(themeMode)\n dispatch.ui.setPersistent({ themeMode })\n dispatch.ui.set({ themeDark })\n if (browser.isAndroid) StatusBar.setStyle({ style: themeDark ? Style.Dark : Style.Light })\n },\n async resizeColumn(params: { id: string; width: number }, state) {\n const columnWidths = { ...state.ui.columnWidths, [params.id]: params.width }\n console.log('SET COLUMN WIDTHS', columnWidths)\n dispatch.ui.setPersistent({ columnWidths })\n },\n async guide({ guide, ...props }: ILookup, state) {\n let original = state.ui.guides[guide]\n if (!original) return\n const active = props.active === undefined ? original.active : props.active\n\n if (active) {\n if (props.step > original.total) {\n props.done = true\n props.step = 0\n }\n if (props.done) props.active = false\n }\n\n const guides = { ...state.ui.guides, [guide]: { ...original, ...props } }\n dispatch.ui.setPersistent({ guides })\n },\n async pop(bubble: string, state) {\n let poppedBubbles = [...state.ui.poppedBubbles]\n poppedBubbles.push(bubble)\n dispatch.ui.setPersistent({ poppedBubbles })\n },\n async popAll(_: void) {\n dispatch.ui.setPersistent({ expireBubbles: true })\n },\n async resetHelp(_: void) {\n dispatch.ui.setPersistent({\n guides: { ...defaultState.guides },\n poppedBubbles: [...defaultState.poppedBubbles],\n expireBubbles: false,\n })\n },\n async accordion(params: ILookup, state) {\n const accordion = { ...state.ui.accordion, ...params }\n dispatch.ui.setPersistent({ accordion })\n },\n async setDefaultService({ deviceId, serviceId }: { deviceId: string; serviceId: string | null }, state) {\n const all = { ...state.ui.defaultService }\n all[deviceId] = serviceId\n dispatch.ui.setPersistent({ defaultService: all })\n },\n async setDefaultSelected({ key, value }: { key: string; value?: string }, state) {\n const accountId = selectActiveAccountId(state)\n let defaultSelection = structuredClone(state.ui.defaultSelection)\n defaultSelection[accountId] = defaultSelection[accountId] || {}\n defaultSelection[accountId][key] = value\n dispatch.ui.set({ defaultSelection })\n },\n async setPersistent(params: ILookup, state) {\n dispatch.ui.set(params)\n Object.keys(params).forEach(key => {\n if (SAVED_ACROSS_LOGOUT.includes(key)) setLocalStorage(state, `ui-${key}`, params[key])\n })\n },\n async deprecated(_: void, state) {\n if (!browser.isElectron) return\n const { preferences } = state.backend\n dispatch.ui.set({\n errorMessage: 'This version of Desktop is no longer supported. It should auto update shortly.',\n })\n emit('preferences', { ...preferences, autoUpdate: true })\n },\n }),\n reducers: {\n set(state: UIState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n updated(state: UIState) {\n state.setupBusy = false\n state.setupAddingService = false\n state.setupServiceBusy = undefined\n state.restoring = false\n return state\n },\n reset(state: UIState) {\n state = { ...defaultState }\n return state\n },\n },\n})\n\nexport function selectPriorityGuide(state: State, guide: string, startDate: Date): IGuide {\n const all = state.ui.guides\n const result = all[guide] || {}\n let active = result.active\n for (let key in all) {\n const g = all[key]\n if (g.active && g.weight < result.weight) active = false\n }\n if (state.user.created < startDate) active = false\n return { ...result, active }\n}\n\nfunction migrateColumnStates(states: ILookup): ILookup {\n if (!states.columns || states.columns.includes('serviceName')) return states\n console.log('MIGRATE COLUMN STATES')\n return {\n ...states,\n columns: [...states.columns, 'serviceName', 'serviceStatus', 'serviceState', 'serviceAction', 'serviceTimeSeries'],\n }\n}","import axios, { AxiosResponse } from 'axios'\nimport { createModel } from '@rematch/core'\nimport { API_URL, DEVELOPER_KEY, LANGUAGES } from '../constants'\nimport { graphQLNotificationSettings, graphQLSetAttributes, graphQLLeaveReseller } from '../services/graphQLMutation'\nimport { graphQLUser } from '../services/graphQLRequest'\nimport { RootModel } from '.'\nimport { getToken } from '../services/remoteit'\n\ntype IUserState = {\n id: string\n email: string\n created: Date\n notificationSettings: INotificationSetting\n reseller: IResellerRef | null\n language: string\n attributes: ILookup\n}\n\nconst defaultState: IUserState = {\n id: '',\n email: '',\n created: new Date(0),\n notificationSettings: {},\n reseller: null,\n language: 'en',\n attributes: {},\n}\n\nexport default createModel()({\n state: { ...defaultState },\n effects: dispatch => ({\n async fetch(_: void, state) {\n const account = state.auth.user?.id\n if (!account) return\n const result = await graphQLUser(account)\n if (result === 'ERROR') return\n const data = await dispatch.user.parse(result)\n if (data) dispatch.user.set(data)\n },\n async parse(result: AxiosResponse | undefined) {\n const data = result?.data?.data?.login?.account\n console.log('USER DATA', data)\n return {\n ...data,\n created: new Date(data?.created),\n attributes: data?.attributes?.$remoteit,\n }\n },\n async leaveReseller() {\n const result = await graphQLLeaveReseller()\n if (result === 'ERROR') {\n dispatch.ui.set({ errorMessage: 'Failed to leave reseller' })\n return\n }\n await dispatch.user.fetch()\n await dispatch.organization.fetch()\n },\n async setAttribute(attribute: ILookup, state) {\n dispatch.user.set({ attributes: { ...state.user.attributes, ...attribute } })\n await graphQLSetAttributes(attribute)\n },\n async updateNotificationSettings(metadata: INotificationSetting) {\n const result = await graphQLNotificationSettings(metadata)\n if (result === 'ERROR') return\n dispatch.user.set({ notificationSettings: metadata })\n },\n async changeLanguage(language: string) {\n await axios.post(\n '/user/language/',\n { language },\n {\n baseURL: API_URL,\n headers: {\n 'Content-Type': 'application/json',\n developerKey: DEVELOPER_KEY,\n Authorization: await getToken(),\n },\n }\n )\n dispatch.ui.set({ successMessage: `Language changed to ${LANGUAGES[language]}` })\n dispatch.user.set({ language })\n },\n }),\n reducers: {\n reset(state: IUserState) {\n state = { ...defaultState }\n return state\n },\n set(state: IUserState, params: Partial) {\n Object.keys(params).forEach(key => (state[key] = params[key]))\n return state\n },\n },\n})\n","import { Models } from '@rematch/core'\nimport accounts from './accounts'\nimport announcements from './announcements'\nimport applicationTypes from './applicationTypes'\nimport auth from './auth'\nimport backend from './backend'\nimport billing from './billing'\nimport binaries from './binaries'\nimport bluetooth from './bluetooth'\nimport connections from './connections'\nimport contacts from './contacts'\nimport devices from './devices'\nimport feedback from './feedback'\nimport files from './files'\nimport jobs from './jobs'\nimport keys from './keys'\nimport labels from './labels'\nimport logs from './logs'\nimport mfa from './mfa'\nimport networks from './networks'\nimport organization from './organization'\nimport plans from './plans'\nimport search from './search'\nimport sessions from './sessions'\nimport shares from './shares'\nimport tags from './tags'\nimport ui from './ui'\nimport user from './user'\n\nexport interface RootModel extends Models {\n accounts: typeof accounts\n announcements: typeof announcements\n applicationTypes: typeof applicationTypes\n auth: typeof auth\n backend: typeof backend\n billing: typeof billing\n binaries: typeof binaries\n bluetooth: typeof bluetooth\n connections: typeof connections\n contacts: typeof contacts\n devices: typeof devices\n feedback: typeof feedback\n files: typeof files\n jobs: typeof jobs\n keys: typeof keys\n labels: typeof labels\n logs: typeof logs\n mfa: typeof mfa\n networks: typeof networks\n organization: typeof organization\n plans: typeof plans\n search: typeof search\n sessions: typeof sessions\n shares: typeof shares\n tags: typeof tags\n ui: typeof ui\n user: typeof user\n}\n\nexport const models: RootModel = {\n accounts,\n announcements,\n applicationTypes,\n auth,\n backend,\n billing,\n binaries,\n bluetooth,\n connections,\n contacts,\n devices,\n feedback,\n files,\n jobs,\n keys,\n labels,\n logs,\n mfa,\n networks,\n organization,\n plans,\n search,\n sessions,\n shares,\n tags,\n ui,\n user,\n}\n","import { createTransform } from 'redux-persist'\n\n// Utility function to determine if a string is an ISO date string\nconst isIsoDateString = value => {\n const isoDateRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$/\n return typeof value === 'string' && isoDateRegex.test(value)\n}\n\n// Transform function\nconst DateTransform = createTransform(\n // Transform state going to storage (no changes needed)\n (inboundState, key) => inboundState,\n\n // Transform state coming out of storage\n (outboundState, key) => {\n // Recursively convert date strings to Date objects\n const convertDates = obj => {\n if (obj !== null && typeof obj === 'object') {\n Object.keys(obj).forEach(key => {\n const value = obj[key]\n if (isIsoDateString(value)) {\n obj[key] = new Date(value)\n } else if (typeof value === 'object') {\n convertDates(value)\n }\n })\n }\n return obj\n }\n return convertDates(outboundState)\n }\n)\n\nexport default DateTransform\n","import { numericVersion } from './helpers/versionHelper'\nimport { models, RootModel } from './models'\nimport { createLogger, ReduxLoggerOptions } from 'redux-logger'\nimport { init, RematchDispatch, RematchRootState } from '@rematch/core'\nimport { PersistConfig } from 'redux-persist'\nimport persistPlugin, { getPersistor } from '@rematch/persist'\nimport DateTransform from './helpers/DateTransform'\nimport immerPlugin from '@rematch/immer'\nimport localForage from 'localforage'\n\nconst loggerConfig: ReduxLoggerOptions = {\n predicate: () => !!(window as any).stateLogging,\n}\n\nconst persistConfig: PersistConfig = {\n key: 'app',\n version: numericVersion(),\n storage: localForage,\n whitelist: [\n 'accounts',\n 'announcements',\n 'applicationTypes',\n 'connections',\n 'contacts',\n 'devices',\n 'files',\n 'jobs',\n 'networks',\n 'organization',\n 'plans',\n 'sessions',\n 'tags',\n 'user',\n ],\n throttle: 1000,\n transforms: [DateTransform],\n}\n\nexport const store = init({\n models,\n plugins: [immerPlugin(), persistPlugin(persistConfig)],\n // @ts-ignore\n redux: { middlewares: [createLogger(loggerConfig)] },\n})\n\nexport const { dispatch } = store\nexport const persistor = getPersistor()\n\nexport type Store = typeof store\nexport type Dispatch = RematchDispatch\nexport type State = RematchRootState\n","import { IP_PRIVATE } from '@common/constants'\nimport { PORTAL, MODE, REGEX_SCHEME } from '../constants'\nimport { State, store } from '../store'\nimport { fullVersion } from '../helpers/versionHelper'\nimport { AppLauncher } from '@capacitor/app-launcher'\nimport { Capacitor } from '@capacitor/core'\nimport { Browser } from '@capacitor/browser'\n\nfunction startLog() {\n console.log(\n `%c\n\n s t a r t i n g\n ______ _____ ________ _______ ________ _____ __ _______ \n / ____/ ___/ / _ /__ ___/ ___/ / /__ __/ \n / / / ___/ / / / /_/ / / / / ___/__/ / / / \n /__/ /_____/__/__/__/_______/ /__/ /_____/__/__/ /__/ \n\n ${fullVersion()}\n Set window.stateLogging = true to enable redux state logging\n\n `,\n 'font-family:monospace;color:#0096e7'\n )\n}\n\nclass Environment {\n isElectron: boolean = false\n isMobile: boolean = false\n isPortal: boolean = false\n isRemote: boolean = false\n isMac: boolean = false\n isWindows: boolean = false\n isIOS: boolean = false\n isAndroid: boolean = false\n isAndroidBrowser: boolean = false\n isApple: boolean = false\n hasBackend: boolean = false\n hasBilling: boolean = false\n\n constructor() {\n this.isElectron = isElectron()\n this.isMobile = isMobile()\n this.isPortal = isPortal()\n this.isRemote = isRemote()\n this.isIOS = Capacitor.getPlatform() === 'ios'\n this.isAndroid = Capacitor.getPlatform() === 'android'\n this.isAndroidBrowser = isAndroidWeb()\n\n this.isMac = isMac()\n this.isWindows = isWindows()\n this.isApple = this.isIOS || this.isMac\n\n this.hasBackend = !this.isPortal && !this.isMobile\n this.hasBilling = this.isPortal\n\n console.log('Environment', this)\n console.log('Build Environment', this.environment())\n }\n\n environment() {\n return MODE\n }\n}\n\nconst browser = new Environment()\nexport default browser\n\nstartLog()\n\nfunction isPortal() {\n return PORTAL || (!isElectron() && !isMobile() && window.location.port === '3000')\n}\n\nfunction isMobile() {\n return Capacitor.isNativePlatform()\n}\n\n// limited remote management interface\nfunction isRemote() {\n const { port, hostname } = window.location\n return !(\n isElectron() ||\n isPortal() ||\n isMobile() ||\n ((port === '29999' || port === '29998') && hostname === IP_PRIVATE)\n )\n}\n\nfunction isElectron() {\n return navigator.userAgent.toLowerCase().includes('electron')\n}\n\nfunction isMac() {\n return navigator.userAgent.toLowerCase().includes('mac')\n}\n\nfunction isWindows() {\n return navigator.userAgent.toLowerCase().includes('win')\n}\n\nfunction isAndroidWeb() {\n return navigator.userAgent.toLowerCase().includes('android')\n}\n\nfunction isIOSWeb(): boolean {\n const userAgent = window.navigator.userAgent.toLowerCase()\n return (\n /iphone|ipad|ipod/.test(userAgent) ||\n !!(navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /macintel/.test(userAgent))\n )\n}\n\nexport function getOs(): Ios {\n if (isAndroidWeb()) return 'android'\n if (isIOSWeb()) return 'ios'\n if (isMac()) return 'mac'\n if (isWindows()) return 'windows'\n return 'linux'\n}\n\nexport function getApp(): 'PORTAL' | 'DESKTOP' | 'MOBILE' {\n if (isElectron()) return 'DESKTOP'\n if (isMobile()) return 'MOBILE'\n return 'PORTAL'\n}\n\nexport function agent() {\n const result = navigator.userAgent.match(/\\(.*?\\)/)\n return result?.length ? result[0] : ''\n}\n\nexport function getLocalStorage(state: State | null, key: string) {\n const currentSession = state?.auth.user?.id || 'app'\n const value = currentSession ? window.localStorage.getItem(currentSession + ':' + key) : null\n try {\n return value && JSON.parse(value)\n } catch (e) {\n return value\n }\n}\n\nexport function setLocalStorage(state: State | null, key: string, value: any) {\n const currentSession = state?.auth.user?.id || 'app'\n if (!value) {\n console.log('REMOVE LOCAL STORAGE', key, 'value:', value, 'session:', currentSession)\n removeLocalStorage(state, key)\n } else {\n currentSession && window.localStorage.setItem(currentSession + ':' + key, JSON.stringify(value))\n }\n}\n\nexport function removeLocalStorage(state: State | null, key: string) {\n const currentSession = state?.auth.user?.id || 'app'\n currentSession && window.localStorage.removeItem(currentSession + ':' + key)\n}\n\nexport async function windowOpen(url?: string, windowName?: string, external?: boolean) {\n console.log('WINDOW OPEN', { url, windowName, external })\n if (!url) return\n\n if (browser.isMobile) {\n try {\n external ? await AppLauncher.openUrl({ url }) : await Browser.open({ url, windowName })\n } catch (error) {\n console.error('URL error:', error, { url, windowName, external })\n const scheme = url.match(REGEX_SCHEME)?.[0]\n store.dispatch.ui.set({ errorMessage: `We couldn't find an application to handle ${scheme}` })\n }\n return\n }\n\n try {\n window.open(url, windowName)\n } catch (error) {\n console.error('window.open error:', error)\n store.dispatch.ui.set({ errorMessage: `${error.message}: ${url}, ${windowName}` })\n }\n}\n\nexport async function windowClose() {\n if (browser.isMobile) {\n try {\n await Browser.close()\n } catch (e) {\n console.error('NO BROWSER WINDOW OPEN', e)\n }\n }\n}\n\nexport function insertScript(name: string, id: string) {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = name\n script.id = id\n document.head.appendChild(script)\n script.onload = resolve\n script.onerror = reject\n })\n}\n","import io, { Socket } from 'socket.io-client'\nimport browser from './browser'\nimport { store } from '../store'\nimport { IP_PRIVATE } from '@common/constants'\nimport { IBackendState } from '../models/backend'\nimport { PORT, FRONTEND_RETRY_DELAY } from '../constants'\nimport { EventEmitter } from 'events'\nimport network from '../services/Network'\n\nclass Controller extends EventEmitter {\n private socket?: Socket\n private retrying?: NodeJS.Timeout\n private credentials?: UserCredentials\n private url: string = '/'\n handlers: ILookup<(result: any) => void> = {}\n\n init() {\n const { protocol, host } = window.location\n const isDev = host === `${IP_PRIVATE}:3000`\n this.url = protocol === 'file:' || isDev ? `http://${IP_PRIVATE}:${PORT}` : '/'\n this.onNetworkConnect()\n if (!navigator.onLine) network.offline()\n network.on('connect', this.onNetworkConnect)\n network.on('disconnect', this.close)\n }\n\n log(...args) {\n console.log(`%c${args[0]}`, 'color:limegreen;font-weight:bold', ...args.slice(1))\n }\n\n onNetworkConnect = () => {\n const state = store.getState()\n const { ui, auth } = store.dispatch\n\n if (!navigator.onLine) return\n if (state.auth.backendAuthenticated) {\n this.log('-- ONLINE AUTHORIZED RE-CONNECT')\n this.open()\n } else {\n this.log('1- ONLINE AUTHORIZE AND CONNECT')\n ui.set({ errorMessage: '' })\n auth.init()\n }\n }\n\n setupConnection(credentials: UserCredentials) {\n this.credentials = credentials\n this.handlers = getEventHandlers()\n\n if (!browser.hasBackend) return\n\n this.socket = io(this.url, {\n transports: ['websocket'],\n forceNew: true,\n reconnectionDelay: FRONTEND_RETRY_DELAY,\n })\n\n this.logErrors()\n\n for (const eventName in this.handlers) {\n if (this.handlers.hasOwnProperty(eventName)) {\n const name = eventName as SocketEvent\n const handler = this.handlers[name]\n this.on(name, handler)\n }\n }\n }\n\n logErrors() {\n for (const errorEvent of ['error', 'reconnect_error', 'connect_error']) {\n this.socket?.on(errorEvent, error => {\n this.log(errorEvent.toUpperCase(), error.message)\n store.dispatch.ui.set({\n offline: { title: 'Network Error', message: error.message, severity: 'error' },\n })\n })\n }\n }\n\n auth() {\n if (browser.hasBackend) emit('authentication', this.credentials)\n }\n\n // Retry open with delay, force skips delay\n open(retry?: boolean, force?: boolean) {\n if (force || (navigator.onLine && !this.socket?.connected && !this.retrying)) {\n this.retrying = setTimeout(\n () => {\n this.log('Retrying local socket.io connection')\n this.retrying = undefined\n this.socket?.open()\n store.dispatch.ui.set({ offline: undefined })\n },\n retry ? FRONTEND_RETRY_DELAY : 0\n )\n }\n }\n\n close() {\n this.log('CLOSE LOCAL SOCKET')\n this.socket?.close()\n }\n\n on(eventName: SocketEvent, handler: (...args: any[]) => void) {\n this.socket?.on(eventName, handler)\n return this\n }\n\n off(eventName: SocketEvent) {\n this.socket?.off(eventName)\n return this\n }\n\n emit = (event: SocketAction, ...args: any[]): boolean => {\n if (!this.socket?.connected) {\n if (browser.hasBackend) this.log('EMIT CANCELED - LOCAL SOCKET DISCONNECTED', event, ...args)\n return false\n }\n this.log('Controller emit', event, ...args)\n this.socket?.emit(event, ...args)\n return true\n }\n}\n\ntype EventHandlers = { [event: string]: (data?: any) => any }\n\nfunction getEventHandlers() {\n const { connections, binaries, auth, backend, ui } = store.dispatch\n\n return {\n connect: () => {\n controller.log('event: CONNECT LOCAL SOCKET')\n controller.auth()\n ui.set({ connected: true })\n },\n\n unauthorized: (error: Error) => auth.backendSignInError(error.message),\n\n authenticated: () => {\n controller.log('event: BACKEND AUTHENTICATED')\n auth.backendAuthenticated()\n },\n\n appReady: () => {\n controller.log('event: DATA READY')\n auth.appReady()\n },\n\n disconnect: () => {\n controller.log('event: DISCONNECT')\n auth.disconnect()\n },\n\n 'signed-out': () => auth.signedOut(),\n\n pool: (result: IConnection[]) => {\n controller.log('event: socket pool', result)\n connections.restoreConnections(result)\n },\n\n updated: (result: IConnection) => {\n controller.log('event: socket connection', result)\n connections.updateConnection(result)\n },\n\n device: (result: string) => {\n controller.log('event: socket device', result)\n backend.targetDeviceUpdated(result)\n },\n\n scan: (result: IScanData) => {\n controller.log('event: socket scan', result)\n if (result) backend.set({ scanData: result })\n },\n\n interfaces: (result: IInterface[]) => {\n controller.log('event: socket interfaces', result)\n if (result) backend.set({ interfaces: result })\n },\n\n freePort: (result: number) => backend.set({ freePort: result }),\n\n reachablePort: (result: boolean) => {\n backend.set({ reachablePort: result ? 'REACHABLE' : 'UNREACHABLE' })\n },\n\n environment: (result: IBackendState['environment']) => {\n backend.set({ environment: result })\n },\n\n preferences: (result: IPreferences) => backend.set({ preferences: result }),\n\n 'app/filePath': (filePath: string) => backend.set({ filePath }),\n 'app/canNavigate': canNavigate => backend.set({ canNavigate }),\n\n // AutoUpdate\n 'update/status': (updateStatus: IBackendState['updateStatus']) => {\n backend.set({ updateStatus })\n },\n\n 'cli/error': error => {\n ui.set({ errorMessage: error })\n ui.updated()\n },\n\n 'binary/install/error': (error: string) => binaries.installError(error),\n 'binary/install/progress': (progress: number) => controller.log('event: binary/install/progress', progress),\n 'binary/installed': (info: InstallationInfo) => binaries.installed(info),\n 'binary/not-installed': (status: BinaryReason) => binaries.notInstalled(status),\n } as EventHandlers\n}\n\nconst controller = new Controller()\nexport default controller\nexport const emit = controller.emit\n","import { useEffect, useState } from 'react'\nimport { SafeArea } from 'capacitor-plugin-safe-area'\nimport { spacing } from '../styling'\nimport browser from '../services/browser'\n\ntype UseSafeAreaResult = {\n insets: ILayout['insets']\n statusBarHeight: number\n}\n\nconst defaultInsets = { top: 0, left: 0, bottom: 0, right: 0, topPx: '', bottomPx: '', leftPx: '', rightPx: '' }\n\nconst useSafeArea = (): UseSafeAreaResult => {\n const [insets, setInsets] = useState(defaultInsets)\n const [statusBarHeight, setStatusBarHeight] = useState(0)\n\n useEffect(() => {\n if (!browser.isMobile) return\n\n const adjustInsets = (insets: Omit) => ({\n ...insets,\n top: insets.top - spacing.sm,\n bottom: insets.bottom - spacing.xs,\n topPx: insets.top - spacing.sm + 'px',\n bottomPx: insets.bottom - spacing.xs + 'px',\n leftPx: insets.left + 'px',\n rightPx: insets.right + 'px',\n })\n\n SafeArea.addListener('safeAreaChanged', data => {\n console.log('SAFE-AREA CHANGED', data)\n setInsets(adjustInsets(data.insets))\n })\n\n const fetchInsets = async () => {\n const { insets } = await SafeArea.getSafeAreaInsets()\n const { statusBarHeight } = await SafeArea.getStatusBarHeight()\n setInsets(adjustInsets(insets))\n setStatusBarHeight(statusBarHeight)\n }\n\n fetchInsets()\n\n return () => {\n SafeArea.removeAllListeners()\n }\n }, [])\n\n return { insets, statusBarHeight }\n}\n\nexport default useSafeArea\n","import network from '../services/Network'\nimport browser, { windowClose } from '../services/browser'\nimport { PROTOCOL } from '../constants'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { App, URLOpenListenerEvent, AppState } from '@capacitor/app'\nimport { SplashScreen } from '@capacitor/splash-screen'\nimport { useHistory } from 'react-router-dom'\nimport { useEffect } from 'react'\n\nfunction useCapacitor() {\n const history = useHistory()\n const dispatch = useDispatch()\n\n useEffect(() => {\n if (!browser.isMobile) return\n initialize()\n return teardown\n }, [])\n\n async function initialize() {\n console.log('INITIALIZING CAPACITOR')\n await App.addListener('appUrlOpen', urlOpen)\n await App.addListener('appStateChange', handleAppStateChange)\n }\n\n function teardown() {\n App.removeAllListeners()\n }\n\n function handleAppStateChange(state: AppState) {\n console.log('APP STATE CHANGE', state)\n if (state.isActive) {\n network.focus()\n setTimeout(() => dispatch.ui.setTheme(undefined), 1000)\n }\n }\n\n async function hideSplashScreen() {\n await SplashScreen.hide()\n }\n\n async function urlOpen(data: URLOpenListenerEvent) {\n if (!data.url.includes(PROTOCOL)) {\n console.warn('BAD APP URL', data.url)\n return\n }\n\n const path = data.url.substring(PROTOCOL.length)\n\n if (path.includes('authCallback')) {\n await windowClose()\n SplashScreen.show()\n console.log('AUTH CALLBACK', window.origin + path.replace('authCallback', ''))\n location.href = window.origin + path.replace('authCallback', '')\n return\n }\n\n if (path.includes('signoutCallback')) {\n await windowClose()\n console.log('LOGOUT CALLBACK', path)\n return\n }\n\n console.log('APP URL OPENED', path)\n history.push(path)\n }\n\n return hideSplashScreen\n}\n\nexport default useCapacitor\n","import React, { useState } from 'react'\nimport browser from '../services/browser'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../styling'\n\nexport type BodyProps = {\n inset?: boolean\n center?: boolean\n flex?: boolean\n bodyRef?: React.RefObject\n className?: string\n maxHeight?: string\n gutterBottom?: boolean\n gutterTop?: boolean\n verticalOverflow?: boolean\n horizontalOverflow?: boolean\n scrollbarBackground?: Color\n children?: React.ReactNode\n}\n\nexport const Body: React.FC = ({\n inset,\n center,\n flex,\n bodyRef,\n maxHeight,\n className = '',\n gutterBottom,\n gutterTop,\n verticalOverflow,\n horizontalOverflow,\n scrollbarBackground,\n children,\n}) => {\n const css = useStyles({\n horizontalOverflow,\n verticalOverflow,\n scrollbarWidth: browser.isMobile ? 0 : 15,\n scrollbarBackground: scrollbarBackground || 'white',\n })\n const [hover, setHover] = useState(true)\n className = classnames(\n className,\n css.body,\n flex && css.flex,\n center && css.center,\n inset && css.inset,\n gutterBottom && css.gutterBottom,\n gutterTop && css.gutterTop,\n hover && css.showScroll\n )\n let style = maxHeight ? { maxHeight } : {}\n\n return (\n <>\n {verticalOverflow &&
}\n {horizontalOverflow &&
}\n setHover(true)}\n onMouseLeave={() => setHover(false)}\n >\n {children}\n
\n \n )\n}\n\ntype StyleProps = {\n verticalOverflow?: boolean\n horizontalOverflow?: boolean\n scrollbarWidth: number\n scrollbarBackground: Color\n}\n\nconst useStyles = makeStyles(({ palette, breakpoints }) => ({\n body: ({ scrollbarBackground, verticalOverflow, horizontalOverflow, scrollbarWidth }: StyleProps) => ({\n flexGrow: 1,\n height: '100%',\n overflow: verticalOverflow && horizontalOverflow ? 'scroll' : 'auto',\n overscrollBehaviorX: 'none',\n position: 'relative',\n '-webkit-overflow-scrolling': 'touch',\n '&::-webkit-scrollbar': { '-webkit-appearance': 'none' },\n '&::-webkit-scrollbar:vertical': { width: scrollbarWidth },\n '&::-webkit-scrollbar:horizontal': { height: scrollbarWidth },\n '&::-webkit-scrollbar-corner': { background: palette[scrollbarBackground].main },\n '&::-webkit-scrollbar-thumb': {\n borderRadius: 8,\n border: `4px solid ${palette[scrollbarBackground].main}`,\n backgroundColor: `${palette[scrollbarBackground].main}`,\n },\n [breakpoints.down('sm')]: {\n overflowX: 'hidden',\n },\n '& > *:first-of-type': horizontalOverflow ? { minHeight: '100.1%' } : undefined, // forces right scrollbar to appear (overflow: scroll causes extra padding)\n }),\n verticalOverflow: ({ horizontalOverflow, scrollbarWidth, scrollbarBackground }: StyleProps) => ({\n position: 'absolute',\n height: 30,\n zIndex: 7,\n width: '100%',\n right: horizontalOverflow ? scrollbarWidth : undefined,\n bottom: horizontalOverflow ? scrollbarWidth : 0,\n backgroundImage: `linear-gradient(transparent, ${palette[scrollbarBackground].main})`,\n pointerEvents: 'none',\n }),\n horizontalOverflow: ({ scrollbarWidth, scrollbarBackground }: StyleProps) => ({\n position: 'absolute',\n width: 30,\n top: 0,\n bottom: scrollbarWidth,\n zIndex: 7,\n right: scrollbarWidth,\n backgroundImage: `linear-gradient(90deg, transparent, ${palette[scrollbarBackground].main})`,\n pointerEvents: 'none',\n }),\n showScroll: {\n '&::-webkit-scrollbar-thumb': {\n backgroundColor: `${palette.grayLight.main} !important`,\n },\n },\n flex: {\n display: 'flex',\n alignContent: 'flex-start',\n flexWrap: 'wrap',\n justifyContent: 'space-evenly',\n },\n inset: {\n padding: `${spacing.sm}px ${spacing.xl}px`,\n },\n gutterBottom: {\n paddingBottom: spacing.xxl,\n },\n gutterTop: {\n paddingTop: spacing.sm,\n },\n center: ({ verticalOverflow }: StyleProps) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: verticalOverflow && browser.isAndroid ? undefined : 'center',\n flexDirection: 'column',\n padding: `${spacing.md}px ${spacing.md}px ${spacing.xl}px`,\n }),\n}))\n","import React from 'react'\nimport { Box, useTheme } from '@mui/material'\n\nexport const Logo: React.FC = ({ color = 'primary', ...props }) => {\n const { palette } = useTheme()\n let fill\n\n //@ts-ignore\n if (color) fill = palette[color].main\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React, { useEffect } from 'react'\nimport heartbeat from '../../services/Heartbeat'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../../store'\nimport { Button, Typography } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../../styling'\nimport { Notice } from '../Notice'\nimport { Body } from '../Body'\nimport { Icon } from '../Icon'\nimport { Logo } from '@common/brand/Logo'\n\nexport const InstallationNotice: React.FC = () => {\n const { connected, error, installing, reason } = useSelector((state: State) => ({\n error: state.binaries.error,\n installing: state.binaries.installing,\n connected: state.ui.connected,\n reason: state.binaries.reason,\n }))\n const dispatch = useDispatch()\n const css = useStyles()\n\n useEffect(() => {\n heartbeat.checkAll = true\n return () => (heartbeat.checkAll = undefined)\n }, [])\n\n if (!connected) return null\n if (error) console.error(error)\n\n const isError = error && JSON.stringify(error) !== JSON.stringify({})\n\n return (\n \n \n Welcome to\n \n \n {isError && (\n dispatch.binaries.clearError()}>\n {error === 'User did not grant permission.'\n ? 'Please grant permissions to install CLI tools'\n : JSON.stringify(error)}\n \n )}\n \n We need to install our system agent\n
in order to maintain background connections.\n
\n dispatch.binaries.install()}\n >\n {installing ? (\n <>\n Installing\n \n \n ) : (\n <>\n Install Agent\n \n \n )}\n \n \n \n You will be prompted for permission to continue the installation.\n
\n {reason &&\n (reason.agentStopped\n ? 'The agent is not running.'\n : reason.agentMismatched\n ? 'The running version is incorrect.'\n : reason.binariesOutdated\n ? 'The agent’s version is incorrect.'\n : reason.cliUpdated\n ? 'There is a new version available.'\n : reason.desktopUpdated && 'The desktop app has been updated')}\n
\n \n )\n}\n\nconst useStyles = makeStyles({\n welcome: { marginBottom: spacing.md, letterSpacing: 3 },\n space: { marginBottom: spacing.xl },\n})\n","import React from 'react'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { spacing, Sizes } from '../styling'\n\nexport type GuttersProps = React.HTMLAttributes & {\n inset?: Sizes | 'icon' | null\n size?: Sizes | null\n bottom?: Sizes | null\n top?: Sizes | null\n center?: boolean\n className?: string\n children?: React.ReactNode\n}\n\nexport const Gutters: React.FC = ({\n inset,\n size,\n center,\n className,\n bottom,\n top,\n children,\n ...props\n}) => {\n const css = useStyles({ inset, size, bottom, top, center })\n return (\n
\n {children}\n
\n )\n}\n\nconst useStyles = makeStyles({\n gutters: ({ inset, size = 'xl', bottom = 'md', top = 'md', center }: GuttersProps) => ({\n margin: `${top ? spacing[top] : 0}px ${size ? spacing[size] : 0}px ${bottom ? spacing[bottom] : 0}px`,\n paddingLeft: inset ? (inset === 'icon' ? 44 : spacing[inset]) : 0,\n textAlign: center ? 'center' : undefined,\n }),\n})\n","import React from 'react'\nimport { Box, Typography, CircularProgress, LinearProgress } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { Gutters } from '../Gutters'\nimport { Body } from '../Body'\n\nexport interface LoadingMessageProps {\n message?: React.ReactNode\n spinner?: boolean\n logo?: React.ReactNode\n inline?: boolean\n invert?: boolean\n children?: React.ReactNode\n}\n\nexport function LoadingMessage({ message, logo, invert, spinner = true, inline, children }: LoadingMessageProps) {\n const css = useStyles()\n const Container = inline ? Gutters : Body\n return (\n \n \n {logo}\n {spinner && logo ? (\n \n ) : (\n spinner && \n )}\n \n {message && (\n \n {message}\n \n )}\n {children}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n invert: { backgroundColor: palette.brandSecondary.main },\n fadeIn: { animation: '$fadeIn 600ms ease-in' },\n '@keyframes fadeIn': {\n '0%': { opacity: 0 },\n '100%': { opacity: 1 },\n },\n}))\n","import React, { useState, useEffect } from 'react'\nimport { Box, BoxProps } from '@mui/material'\n\ntype Props = BoxProps & {\n reseller?: IResellerRef | null\n size?: 'small' | 'medium'\n}\n\nconst calculateDimensions = (width: number, height: number, maxArea: number) => {\n const aspectRatio = width / height\n const newHeight = Math.sqrt(maxArea / aspectRatio)\n const newWidth = aspectRatio * newHeight\n return { width: newWidth, height: newHeight }\n}\n\nexport const ResellerLogo: React.FC = ({ reseller, size = 'medium', children, ...props }) => {\n const [dimensions, setDimensions] = useState<{ width: number; height: number } | null>(null)\n const maxArea = size === 'small' ? 2400 : 6400\n\n useEffect(() => {\n if (reseller?.logoUrl) {\n const img = new Image()\n img.onload = () => setDimensions(calculateDimensions(img.width, img.height, maxArea))\n img.src = reseller.logoUrl\n }\n }, [reseller?.logoUrl, size])\n\n if (!reseller?.logoUrl || !dimensions) return null\n\n return (\n <>\n \n \n \n {children}\n \n )\n}\n\n/* \nTest Logos\nhttps://downloads.remote.it/organizations/remoteit.svg\nhttps://upload.wikimedia.org/wikipedia/commons/3/34/Levis-logo.svg\nhttps://www.freepnglogos.com/uploads/google-logo-png/file-google-logo-svg-wikimedia-commons-23.png\nhttps://cdn.worldvectorlogo.com/logos/british-telecom.svg\nhttps://www.flanders-china.be/storage/137/vito-nv-vector-logo.svg\n*/\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Box, Tooltip, Typography, TooltipProps, BoxProps, Button, alpha } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { selectPriorityGuide } from '../models/ui'\nimport { IconButton } from '../buttons/IconButton'\nimport { spacing, radius, fontSizes } from '../styling'\n\ntype Props = {\n guide: string\n step: number\n placement?: TooltipProps['placement']\n instructions: React.ReactNode\n component?: BoxProps['component']\n startDate?: Date\n acknowledge?: boolean\n autoNext?: boolean\n autoStart?: boolean\n highlight?: boolean\n hideArrow?: boolean\n showNavigation?: boolean\n showStart?: boolean\n show?: boolean\n hide?: boolean\n children?: React.ReactNode\n}\n\nexport const GuideStep: React.FC = ({\n guide,\n step,\n placement,\n instructions,\n acknowledge,\n startDate = new Date(0),\n component = 'div',\n autoNext,\n autoStart,\n highlight,\n hideArrow,\n showNavigation,\n showStart,\n show,\n hide,\n children,\n}) => {\n const { ui } = useDispatch()\n const state = useSelector((state: State) => selectPriorityGuide(state, guide, startDate))\n const open: boolean = !!(!hide && (state.step === step || !!show) && state.active)\n const css = useStyles({ highlight: highlight && open })\n const start = () => ui.guide({ guide, step, active: true, done: false })\n const last = step === state.total\n\n React.useEffect(() => {\n if (!state.done && state.step === 1 && autoStart) start()\n }, [])\n\n if (step !== 1 && !open) return <>{children}\n\n return (\n \n {acknowledge || (\n ui.guide({ guide, step: 0, done: true })}\n />\n )}\n \n {instructions}\n \n {acknowledge && (\n \n )}\n {showNavigation && (\n \n ui.guide({ guide, step: step - 1, back: true })}\n />\n = state.total}\n onClick={() => ui.guide({ guide, step: step + 1 })}\n />\n \n )}\n {state.total > 1 && (\n \n {step} of {state.total}\n \n )}\n \n }\n >\n autoNext && ui.guide({ guide, step: last ? 0 : step + 1, done: last })}\n component={component}\n >\n {showStart && (\n \n )}\n {children}\n \n \n )\n}\n\nexport const useStyles = makeStyles(({ palette }) => ({\n icon: { position: 'absolute', zIndex: 1, top: -spacing.lg, right: -spacing.xl },\n box: ({ highlight }: any) => ({\n border: highlight ? `1px dotted ${palette.guide.main}` : undefined,\n // boxShadow: highlight ? `0 0 2px 0px ${palette.guide.main} inset` : undefined,\n // background: highlight ? alpha(palette.guide.main, 0.05) : undefined,\n borderRadius: radius.lg,\n position: 'relative',\n }),\n nav: {\n position: 'absolute',\n right: spacing.sm,\n bottom: spacing.sm,\n },\n tip: {\n backgroundColor: palette.guide.main,\n color: palette.white.main,\n fontSize: fontSizes.lg,\n padding: spacing.lg,\n paddingRight: spacing.xl,\n margin: spacing.lg,\n position: 'relative',\n borderRadius: radius.lg,\n '& .MuiTypography-caption': { color: palette.white.main, marginTop: spacing.md, display: 'block' },\n '& .MuiLink-root': {\n color: palette.white.main,\n marginRight: -spacing.sm,\n textDecoration: 'none',\n fontSize: fontSizes.xs,\n fontWeight: 400,\n cursor: 'pointer',\n opacity: 0.3,\n },\n '& .MuiLink-root:hover': { opacity: 1 },\n '& .IconButtonTooltip': {\n position: 'absolute',\n right: spacing.xs,\n top: spacing.xs,\n },\n '& .MuiButton-root': { background: alpha(palette.white.main, 0.15), color: palette.white.main },\n '& .MuiButton-root:hover': { background: alpha(palette.white.main, 0.3) },\n '& cite': {\n fontStyle: 'normal',\n textTransform: 'uppercase',\n fontWeight: 700,\n fontSize: '0.8em',\n letterSpacing: 1,\n paddingLeft: spacing.xs,\n paddingRight: spacing.xs,\n },\n },\n arrow: {\n color: palette.guide.main,\n },\n}))\n","import React from 'react'\nimport { Box, Tooltip, TooltipProps, BoxProps, Button } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { useStyles } from './GuideStep'\nimport { Link } from './Link'\n\ntype Props = {\n guide: string\n placement?: TooltipProps['placement']\n instructions: React.ReactNode\n component?: BoxProps['component']\n startDate?: Date // Show to users created before this date\n highlight?: boolean\n hideArrow?: boolean\n hide?: boolean\n enterDelay?: number\n queueAfter?: string\n sidebar?: boolean\n sx?: BoxProps['sx']\n children?: React.ReactNode\n}\n\nexport const GuideBubble: React.FC = ({\n guide,\n placement,\n instructions,\n startDate = new Date(0),\n component = 'div',\n highlight,\n hideArrow,\n hide,\n enterDelay,\n queueAfter,\n sidebar,\n sx,\n children,\n}) => {\n const { ui } = useDispatch()\n const expired = useSelector(\n (state: State) => (startDate > state.user.created && !state.ui.testUI) || state.ui.expireBubbles\n )\n const poppedBubbles = useSelector((state: State) => state.ui.poppedBubbles)\n const sidebarOpen = useSelector((state: State) => state.ui.sidebarMenu)\n const [waiting, setWaiting] = React.useState(true)\n const hideForSidebar = sidebarOpen && !sidebar\n const queued = !!queueAfter && !poppedBubbles.includes(queueAfter)\n const open: boolean = !hide && !poppedBubbles.includes(guide) && !expired && !waiting && !queued && !hideForSidebar\n const css = useStyles({ highlight: highlight && open })\n\n React.useEffect(() => {\n const timeout = setTimeout(() => setWaiting(false), enterDelay || 0)\n return () => clearTimeout(timeout)\n }, [])\n\n if (!open) return <>{children}\n\n return (\n \n {instructions}\n \n \n ui.popAll()}>dismiss all\n \n \n }\n >\n ui.pop(guide)} component={component}>\n {children}\n \n \n )\n}\n","import React from 'react'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { REGEX_FIRST_PATH, MOBILE_WIDTH } from '../constants'\nimport { useMediaQuery, Typography, Tooltip, ButtonBase, Box, Badge, Divider, List, ListItem } from '@mui/material'\nimport { getOwnOrganization, defaultState } from '../models/organization'\nimport { selectAllConnectionSessions } from '../selectors/connections'\nimport { selectOrganization } from '../selectors/organizations'\nimport { GuideBubble } from './GuideBubble'\nimport { fontSizes } from '../styling'\nimport { Avatar } from './Avatar'\nimport { Icon } from './Icon'\n\nexport const OrganizationSelect: React.FC = () => {\n const css = useStyles()\n const history = useHistory()\n const location = useLocation()\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const { accounts, devices, files, tags, networks, logs } = useDispatch()\n\n let activeOrg = useSelector(selectOrganization)\n const defaultSelection = useSelector((state: State) => state.ui.defaultSelection)\n const memberships = useSelector((state: State) => state.accounts.membership)\n const organizations = useSelector((state: State) => state.organization.accounts)\n const options = memberships.map(m => {\n const org = organizations[m.account.id] || defaultState\n return {\n id: m.account.id,\n email: m.account.email,\n name: org.name,\n roleId: m.roleId,\n roleName: m.roleName,\n disabled: !org.id,\n }\n })\n\n const ownOrg = useSelector(getOwnOrganization)\n const sessions = useSelector(selectAllConnectionSessions)\n const userId = useSelector((state: State) => state.user.id)\n\n const ownOrgId = ownOrg?.id\n let menu = location.pathname.match(REGEX_FIRST_PATH)?.[0] || ''\n\n if (menu === '/account') {\n activeOrg = ownOrg\n menu = '/devices'\n }\n\n const onSelect = async (id: string) => {\n id = id || userId\n await logs.reset()\n await accounts.set({ activeId: id.toString() })\n networks.fetchIfEmpty()\n devices.fetchIfEmpty()\n files.fetchIfEmpty()\n tags.fetchIfEmpty()\n if (!mobile && ['/devices', '/networks', '/connections'].includes(menu)) {\n history.push(defaultSelection[id]?.[menu] || menu)\n }\n }\n\n options.sort((a, b) => (a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1))\n if (!options.length) return null\n\n const mySessions = sessions.filter(s => s.target.accountId === ownOrg?.id).length\n\n return (\n <>\n \n {activeOrg.name || 'Organizations'}\n \n \n \n Select an organization\n \n \n See devices, networks and logs that belong to this organization.\n \n \n }\n >\n \n \n }\n placement=\"right\"\n enterDelay={800}\n arrow\n >\n \n onSelect(ownOrgId || userId)}\n >\n \n \n \n \n \n \n \n {options.map(option => {\n const count = sessions.filter(s => s.target.accountId === option.id).length\n return (\n \n }\n placement=\"right\"\n enterDelay={800}\n arrow\n >\n \n onSelect(option.id)}\n className={classnames(css.button, option.id === activeOrg.id && css.active)}\n >\n \n \n \n \n \n )\n })}\n {/* \n \n */}\n \n \n \n )\n}\n\nfunction Title({ primary, count }: { primary: string; count: number }) {\n return (\n <>\n {primary}\n {!!count && (\n <>\n \n {count} active connection{count > 1 ? 's' : ''}\n \n )}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette, spacing }) => ({\n list: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: palette.grayLighter.main,\n boxShadow: `0 0 10px 10px ${palette.grayLighter.main}`,\n marginBottom: spacing(3),\n '& > *': {\n display: 'flex',\n justifyContent: 'center',\n borderRadius: '50%',\n height: 51,\n padding: 0,\n },\n },\n buttonContainer: {\n width: 42,\n },\n button: {\n borderRadius: '50%',\n border: `2px solid ${palette.grayLighter.main}`,\n transition: 'border-color 0.5s',\n width: 42,\n height: 42,\n '&:hover': { borderColor: palette.primaryLight.main },\n },\n active: {\n borderColor: palette.primary.main,\n boxShadow: `0 0 10px ${palette.primaryLight.main}`,\n '& > *': { border: `2px solid ${palette.grayLightest.main}` },\n '& > .MuiBox-root': { backgroundColor: palette.grayLightest.main },\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n right: -16,\n borderTop: '6px solid transparent',\n borderRight: `8px solid ${palette.primary.main}`,\n borderBottom: '6px solid transparent',\n },\n },\n home: {\n width: 42,\n height: 38,\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: palette.white.main,\n },\n badge: {\n fontWeight: 700,\n marginTop: 3,\n marginLeft: 1,\n color: palette.alwaysWhite.main,\n backgroundColor: palette.primary.main,\n },\n name: {\n transform: 'rotate(270deg)',\n transformOrigin: 'center',\n whiteSpace: 'nowrap',\n position: 'relative',\n height: '2em',\n '& > *': {\n position: 'absolute',\n right: 0,\n color: palette.grayDarkest.main,\n letterSpacing: '0.15em',\n fontSize: fontSizes.base,\n textTransform: 'uppercase',\n },\n },\n // fade: {\n // // opacity: 0.5,\n // transition: 'opacity 0.4s',\n // '&:hover': { opacity: 1 },\n // },\n}))\n","import React from 'react'\nimport browser from '../services/browser'\nimport classnames from 'classnames'\nimport { Box } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { ORGANIZATION_BAR_WIDTH } from '../constants'\nimport { OrganizationSelect } from './OrganizationSelect'\nimport { spacing } from '../styling'\n\ntype Props = { hide?: boolean; insets: ILayout['insets']; children?: React.ReactNode }\n\nexport const OrganizationSidebar: React.FC = ({ hide, insets, children }) => {\n const css = useStyles({ addSpace: browser.isMac && browser.isElectron, insets })\n\n return hide ? (\n <>{children}\n ) : (\n \n \n \n \n {children}\n \n )\n}\n\ntype StyleProps = {\n addSpace: boolean\n insets: ILayout['insets']\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n container: ({ insets }: StyleProps) => ({\n backgroundColor: palette.grayLighter.main,\n display: 'flex',\n height: '100%',\n contain: 'layout',\n // for iOS mobile\n paddingLeft: insets.left ? insets.left : undefined,\n }),\n organizationBar: ({ insets, addSpace }: StyleProps) => ({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n alignItems: 'center',\n width: ORGANIZATION_BAR_WIDTH,\n minWidth: ORGANIZATION_BAR_WIDTH,\n maxWidth: ORGANIZATION_BAR_WIDTH,\n borderRight: `1px solid ${palette.grayLight.main}`,\n position: 'relative',\n overflow: 'hidden',\n // for iOS mobile\n paddingTop: spacing.md + (insets.top ? insets.top : addSpace ? spacing.md : 0),\n paddingBottom: insets?.bottom,\n }),\n}))\n","import React from 'react'\n\nexport const RemoteOnLan: React.FC = () => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\n\nexport const RemoteOnRemote: React.FC = () => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { IP_PRIVATE } from '@common/constants'\nimport { makeStyles } from '@mui/styles'\nimport { Typography, List, ListItem, ListItemText, Box } from '@mui/material'\nimport { spacing, fontSizes } from '../styling'\nimport { attributeName } from '@common/nameHelper'\nimport { selectOwnDevices } from '../selectors/devices'\nimport { useSelector } from 'react-redux'\nimport { isRemoteUI } from '../helpers/uiHelper'\nimport { RemoteOnLan } from '../assets/RemoteOnLan'\nimport { RemoteOnRemote } from '../assets/RemoteOnRemote'\nimport browser from '../services/browser'\n\ntype NetworkType = { primary: string; secondary?: string }\n\nexport const RemoteManagement: React.FC = () => {\n const { hostname } = window.location\n const isLocalhost = hostname === 'localhost' || hostname === IP_PRIVATE\n const device = useSelector(selectOwnDevices).find(d => d.thisDevice)\n const remoteUI = useSelector((state: State) => isRemoteUI(state))\n const name = attributeName(device)\n const css = useStyles()\n\n if (!browser.isRemote) return null\n\n let Graphic = RemoteOnLan\n let diagram: NetworkType[] = [\n { primary: 'You' },\n { primary: 'Local network' },\n { primary: 'This system', secondary: name },\n { primary: 'Internet devices' },\n ]\n\n if (isLocalhost) {\n Graphic = RemoteOnRemote\n diagram = [diagram[0], diagram[3], diagram[2], diagram[1]]\n }\n\n return (\n \n
\n \n You are managing
a remote device\n
\n {!remoteUI && name && (\n \n Any connections you create will be to {name}, not your local machine.\n \n )}\n \n \n \n {diagram.map((i: NetworkType, key) => (\n \n \n \n ))}\n \n \n
\n
\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n container: {\n padding: spacing.sm,\n },\n graphic: {\n display: 'flex',\n marginTop: spacing.lg,\n '& svg': { height: 220, margin: spacing.xs, marginRight: spacing.md },\n '& ul': {\n padding: 0,\n display: 'flex',\n flexGrow: 1,\n flexDirection: 'column',\n justifyContent: 'space-between',\n },\n '& li > div': { justifyContent: 'left', minWidth: 45 },\n '& li > div span': { fontSize: fontSizes.base, color: palette.grayDarker.main },\n '& li > div + div': { flexGrow: 1 },\n },\n}))\n","import React from 'react'\nimport { State } from '../store'\nimport { useLocation } from 'react-router-dom'\nimport { IconButton, ButtonProps } from '../buttons/IconButton'\nimport { selectPermissions } from '../selectors/organizations'\nimport { Typography, Paper } from '@mui/material'\nimport { useSelector } from 'react-redux'\nimport { GuideBubble } from './GuideBubble'\nimport { spacing } from '../styling'\n\ntype Props = ButtonProps & { fab?: boolean; buttonSize: number; sidebar?: boolean }\n\nexport const RegisterMenu: React.FC = ({ fab, buttonSize = 38, sidebar, ...props }) => {\n const location = useLocation()\n const layout = useSelector((state: State) => state.ui.layout)\n const permissions = useSelector(selectPermissions)\n const unauthorized = !permissions.includes('MANAGE')\n const disabled = unauthorized || location.pathname === '/add'\n\n if (unauthorized || (fab && !layout.hideSidebar)) return null\n\n const button = (\n \n \n Add a device\n \n \n First step is to install our agent on any device you would like to connect to.\n \n \n Your device will automatically register and appear on the devices page.\n \n \n }\n >\n \n Register permission required to
\n add a device to this organization.\n \n ) : (\n 'Add device'\n )\n }\n to=\"/add\"\n forceTitle\n hideDisableFade\n variant=\"contained\"\n disabled={disabled}\n color=\"primary\"\n icon=\"plus\"\n />\n \n )\n\n return fab ? (\n \n {button}\n \n ) : (\n button\n )\n}\n","import { useLocation } from 'react-router-dom'\n\nexport type MatchesProps = {\n to?: string\n match?: string | string[]\n exactMatch?: boolean\n}\n\nexport function useMatches({ to, match, exactMatch }: MatchesProps): boolean {\n const location = useLocation()\n\n if (!match) match = to\n if (typeof match === 'string') match = [match]\n const matches = match?.find(s => (exactMatch ? location.pathname === s : location.pathname.startsWith(s)))\n\n return !!matches\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { useMatches } from '../hooks/useMatches'\nimport { SxProps, Theme, MenuItem, ListItem, ListItemButton, ListItemIcon, ListItemText, Badge } from '@mui/material'\nimport { Sizes } from '../styling'\nimport { Icon } from './Icon'\n\nexport type ListItemLocationProps = {\n key?: React.Key\n to?: string\n title?: React.ReactNode\n subtitle?: React.ReactNode\n icon?: React.ReactNode\n iconColor?: Color\n iconType?: IconType\n iconSize?: Sizes\n iconPlatform?: boolean\n disabled?: boolean\n showDisabled?: boolean\n disableGutters?: boolean\n disableIcon?: boolean\n dense?: boolean\n inset?: number\n className?: string\n menuItem?: boolean\n match?: string | string[]\n exactMatch?: boolean\n badge?: number\n sx?: SxProps\n children?: React.ReactNode | React.ReactNode[]\n onClick?: (event: React.MouseEvent) => void\n}\n\nexport const ListItemLocation: React.FC = ({\n to,\n title,\n subtitle,\n icon,\n iconColor,\n iconType,\n iconSize,\n iconPlatform,\n disabled,\n disableIcon,\n showDisabled,\n menuItem,\n match,\n exactMatch,\n inset,\n badge,\n className,\n children,\n ...props\n}) => {\n const history = useHistory()\n const matches = useMatches({ to, match, exactMatch })\n\n const onClick = (event: React.MouseEvent) => {\n props.onClick?.(event)\n if (!disabled && to) history.push(to)\n }\n\n const iconEl =\n icon && typeof icon === 'string' ? (\n \n ) : (\n icon\n )\n\n const Contents = (\n <>\n {icon && (\n \n {badge ? (\n 1 ? undefined : 'dot'} badgeContent={badge} color=\"error\">\n {iconEl}\n \n ) : (\n iconEl\n )}\n \n )}\n {title && }\n {children}\n \n )\n\n let ItemProps = {\n ...props,\n onClick,\n disabled,\n className,\n selected: !!matches,\n sx: {\n paddingLeft: disableIcon ? 2 + (inset || 0) : inset,\n paddingRight: inset,\n ...props.sx,\n },\n style: showDisabled ? undefined : { opacity: 1 },\n }\n\n return menuItem ? (\n {Contents}\n ) : to || props.onClick ? (\n {Contents}\n ) : (\n {Contents}\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\nimport { selectPlan } from '../selectors/organizations'\nimport { PERSONAL_PLAN_ID } from '../models/plans'\nimport { useSelector } from 'react-redux'\nimport { ColorChip } from './ColorChip'\nimport { Notice } from './Notice'\nimport { Box } from '@mui/material'\n\nexport const UpgradeBanner: React.FC = () => {\n const plan = useSelector(selectPlan)\n if (plan?.id !== PERSONAL_PLAN_ID) return null\n return (\n \n Access premium features & support\n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { ListItemButton, ListItemButtonProps, ListItemIcon, ListItemText } from '@mui/material'\nimport { windowOpen } from '../services/browser'\nimport { Icon, IconProps } from './Icon'\n\nexport type Props = ListItemButtonProps & {\n href: string\n title?: React.ReactNode\n subtitle?: string\n icon?: string\n iconProps?: IconProps\n badge?: number\n}\n\nexport const ListItemLink: React.FC = ({\n href,\n title,\n subtitle,\n icon,\n iconProps,\n badge,\n onClick,\n children,\n ...props\n}) => {\n const handleClick = event => {\n windowOpen(href, '_blank', true)\n onClick?.(event)\n }\n\n return (\n \n {icon && (\n \n \n \n )}\n {title && }\n {children}\n \n \n )\n}\n","import React from 'react'\nimport { Icon, IconProps } from './Icon'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../styling'\n\ntype Props = IconProps & { open?: boolean }\n\nexport const ExpandIcon: React.FC = ({ open, ...props }) => {\n const css = useStyles()\n return (\n \n )\n}\n\nconst useStyles = makeStyles({\n icon: {\n marginLeft: spacing.sm,\n transformOrigin: 'center',\n transition: 'transform 300ms, margin-bottom 300ms',\n },\n})\n","import { createSelector } from 'reselect'\nimport { getAnnouncements, optionalParam } from './state'\n\nexport const selectAnnouncements = createSelector(\n [getAnnouncements, optionalParam],\n (announcements, unread?: boolean) => announcements.filter(a => !unread || !a.read)\n)\n","import { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { selectNetworks } from '../selectors/networks'\nimport { selectAnnouncements } from '../selectors/announcements'\nimport { selectConnectionSessions } from '../selectors/connections'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { selectEnabledConnectionsCount } from '../selectors/connections'\n\nexport function useCounts() {\n const unreadAnnouncements = useSelector((state: State) => selectAnnouncements(state, true).length)\n const connections = useSelector(selectEnabledConnectionsCount)\n const networks = useSelector(selectNetworks).length\n const active = useSelector(selectConnectionSessions).length\n const devices = useSelector(selectDeviceModelAttributes).total\n const memberships = useSelector((state: State) => state.accounts.membership.length)\n return { unreadAnnouncements, connections, networks, active, devices, memberships }\n}\n","import React, { useState } from 'react'\nimport browser from '../services/browser'\nimport { makeStyles } from '@mui/styles'\nimport { MOBILE_WIDTH } from '../constants'\nimport { selectLimitsLookup } from '../selectors/organizations'\nimport { selectDefaultSelectedPage } from '../selectors/ui'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport {\n Box,\n Badge,\n List,\n ListItemButton,\n Divider,\n Typography,\n Tooltip,\n Collapse,\n Chip,\n useMediaQuery,\n} from '@mui/material'\nimport { ListItemLocation } from './ListItemLocation'\nimport { UpgradeBanner } from './UpgradeBanner'\nimport { ResellerLogo } from './ResellerLogo'\nimport { ListItemLink } from './ListItemLink'\nimport { ExpandIcon } from './ExpandIcon'\nimport { isRemoteUI } from '../helpers/uiHelper'\nimport { useCounts } from '../hooks/useCounts'\nimport { spacing } from '../styling'\n\nexport const SidebarNav: React.FC = () => {\n const [more, setMore] = useState()\n const counts = useCounts()\n const reseller = useSelector((state: State) => state.user.reseller)\n const defaultSelectedPage = useSelector(selectDefaultSelectedPage)\n const remoteUI = useSelector(isRemoteUI)\n const limits = useSelector(selectLimitsLookup)\n const insets = useSelector((state: State) => state.ui.layout.insets)\n const rootPaths = useSelector((state: State) => !browser.isElectron && state.ui.layout.hideSidebar)\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const dispatch = useDispatch()\n const css = useStyles({ active: counts.active, insets })\n const pathname = path => (rootPaths ? path : defaultSelectedPage[path] || path)\n\n if (remoteUI)\n return (\n \n \n \n \n )\n\n return (\n \n {!mobile && (\n <>\n \n {!!counts.active && !counts.memberships ? (\n \n \n \n ) : (\n !!counts.connections && (\n \n \n \n \n \n )\n )}\n \n \n {!!counts.devices && (\n \n \n \n )}\n \n \n {!!counts.networks && (\n \n \n \n )}\n \n \n )}\n \n \n \n \n \n setMore(!more)} sx={{ marginTop: 2 }}>\n \n More\n \n \n \n \n \n \n \n \n \n \n \n \n \n {limits.support > 10 ? (\n dispatch.feedback.reset()}\n to=\"/feedback\"\n icon=\"envelope-open-text\"\n dense\n />\n ) : (\n \n )}\n \n \n \n )\n}\n\ntype StyleProps = {\n active: number\n insets: ILayout['insets']\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n list: {\n position: 'static',\n '& .MuiListItemIcon-root': { color: palette.grayDark.main },\n '& .MuiListItemText-primary': { color: palette.grayDarkest.main },\n '& .MuiChip-root': { marginRight: spacing.sm },\n '& .MuiListItemButton-root:hover .MuiListItemText-primary': { color: palette.black.main },\n '& .MuiDivider-root': { margin: `${spacing.md}px ${spacing.lg}px`, borderColor: palette.grayLight.main },\n '& .Mui-selected, & .Mui-selected:hover': {\n backgroundColor: palette.primaryLighter.main,\n '& .MuiListItemIcon-root': { color: palette.grayDarker.main },\n '& .MuiListItemText-primary': { color: palette.black.main, fontWeight: 500 },\n },\n },\n active: {\n fontWeight: 500,\n },\n footer: ({ insets }: StyleProps) => ({\n width: '100%',\n position: 'fixed',\n bottom: insets.bottom || spacing.lg,\n backgroundColor: palette.grayLighter.main,\n zIndex: 3,\n }),\n}))\n","import {\n Slide,\n Button,\n Dialog,\n DialogTitle,\n DialogActions,\n DialogContent,\n DialogProps,\n ButtonProps,\n} from '@mui/material'\nimport { TransitionProps } from '@mui/material/transitions'\nimport React from 'react'\n\nexport type ConfirmProps = {\n title?: React.ReactNode\n action?: string\n open: boolean\n disabled?: boolean\n maxWidth?: DialogProps['maxWidth']\n color?: ButtonProps['color']\n children?: React.ReactNode\n onConfirm: (e: React.MouseEvent) => void\n onDeny?: () => void\n}\n\nexport const Confirm: React.FC = ({\n title,\n action = 'Ok',\n open,\n onConfirm,\n onDeny,\n maxWidth = 'xs',\n color = 'primary',\n disabled,\n children,\n}) => (\n \n {title}\n {children}\n \n {onDeny && (\n \n )}\n \n \n \n)\n\nconst Transition = React.forwardRef(function Transition(\n props: TransitionProps & { children: React.ReactElement },\n ref: React.Ref\n) {\n return \n})\n","import React, { useState, useRef } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport {\n Tooltip,\n ListItem,\n ListItemButton,\n ListItemText,\n ListItemIcon,\n ListItemSecondaryAction,\n Switch,\n Button,\n} from '@mui/material'\nimport { Confirm, ConfirmProps } from '../Confirm'\nimport { Icon, IconProps } from '../Icon'\nimport { spacing } from '../../styling'\nimport { Quote } from '../Quote'\n\ntype Props = {\n icon?: string\n iconColor?: IconProps['color']\n iconType?: IconProps['type']\n hideIcon?: boolean\n label?: React.ReactNode\n subLabel?: React.ReactNode\n size?: 'small' | 'medium'\n button?: React.ReactNode\n toggle?: boolean\n tooltip?: string\n disabled?: boolean\n confirm?: boolean\n confirmProps?: Omit\n quote?: boolean\n modified?: boolean\n disableGutters?: boolean\n content?: React.ReactNode\n secondaryContent?: React.ReactNode\n secondaryContentWidth?: string | number\n onClick?: () => void\n onButtonClick?: () => void\n}\n\nexport const ListItemSetting = React.forwardRef(\n (\n {\n icon,\n iconColor,\n iconType,\n hideIcon,\n label,\n subLabel,\n size,\n button,\n toggle,\n tooltip,\n onClick,\n onButtonClick,\n disabled,\n quote,\n modified,\n confirm,\n confirmProps,\n disableGutters,\n content,\n secondaryContent,\n secondaryContentWidth,\n },\n ref\n ) => {\n const [open, setOpen] = useState(false)\n const [showTip, setShowTip] = useState(false)\n const iconRef = useRef(null)\n const showToggle = toggle !== undefined\n const showButton = button !== undefined\n const css = useStyles()\n\n secondaryContentWidth = secondaryContentWidth || (showButton || showToggle || secondaryContent ? '60px' : undefined)\n\n if (!onClick) confirm = false\n\n const handleClick = () => {\n if (disabled) return\n if (confirm) setOpen(true)\n else onClick?.()\n }\n\n const handleButtonClick = event => {\n event.stopPropagation()\n onButtonClick?.()\n }\n\n const handleConfirm = () => {\n onClick?.()\n setOpen(false)\n }\n\n const ListItemContent = (\n <>\n {(label || subLabel) && }\n {content}\n \n )\n\n const TooltipWrapper = ({ children }) =>\n tooltip ? (\n \n {children}\n \n ) : (\n children\n )\n\n const ListItemContents = (\n <>\n \n \n \n \n \n {quote ? {ListItemContent} : ListItemContent}\n \n {secondaryContent}\n {showButton && (\n \n )}\n {showToggle && (\n \n )}\n \n \n )\n\n return (\n <>\n {disabled || !onClick ? (\n \n {ListItemContents}\n \n ) : (\n setShowTip(true)}\n onMouseLeave={() => setShowTip(false)}\n sx={{ paddingRight: secondaryContentWidth }}\n >\n {ListItemContents}\n \n )}\n {confirm && onClick && (\n setOpen(false)}>\n {confirmProps?.children}\n \n )}\n \n )\n }\n)\n\nconst useStyles = makeStyles({ hideIcon: { minWidth: spacing.sm } })\n","import React from 'react'\nimport browser from '../services/browser'\n\nexport const DesktopUI: React.FC<{ hide?: boolean; children?: React.ReactNode }> = ({ hide, children }) => {\n let isDesktop = !browser.hasBackend\n if (hide) isDesktop = !isDesktop\n if (isDesktop) return null\n return <>{children}\n}\n","import React, { useState, useRef, useCallback } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { useHistory } from 'react-router-dom'\nimport { State, Dispatch } from '../store'\nimport { HIDE_SIDEBAR_WIDTH } from '../constants'\nimport { useMediaQuery, ButtonBase, Divider, Menu } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectLicenseIndicator } from '../models/plans'\nimport { ListItemLocation } from './ListItemLocation'\nimport { ListItemSetting } from './ListItemSetting'\nimport { selectActiveUser } from '../selectors/accounts'\nimport { ListItemLink } from './ListItemLink'\nimport { isRemoteUI } from '../helpers/uiHelper'\nimport { DesktopUI } from './DesktopUI'\nimport { Avatar } from './Avatar'\nimport { emit } from '../services/Controller'\n\nconst ENTER_DELAY = 300\nconst LEAVE_DELAY = 400 // must be longer than transition duration\nconst TRANSITION_DURATION = 200\nconst AVATAR_SIZE = 40\nconst AVATAR_BORDER = 6\n\nexport const AvatarMenu: React.FC = () => {\n const history = useHistory()\n const [open, setOpen] = useState(false)\n const [altMenu, setAltMenu] = useState(false)\n const buttonRef = useRef(null)\n const enterTimer = useRef()\n const leaveTimer = useRef()\n const dispatch = useDispatch()\n const sidebarHidden = useMediaQuery(`(max-width:${HIDE_SIDEBAR_WIDTH}px)`)\n const user = useSelector((state: State) => state.auth.user)\n const remoteUI = useSelector(isRemoteUI)\n const testUI = useSelector((state: State) => ['ON', 'HIGHLIGHT'].includes(state.ui?.testUI || ''))\n const backendAuthenticated = useSelector((state: State) => state.auth.backendAuthenticated)\n const licenseIndicator = useSelector(selectLicenseIndicator)\n const activeUser = useSelector(selectActiveUser)\n\n const css = useStyles()\n const handleOpen = () => {\n window.addEventListener('keydown', checkAltMenu)\n setOpen(true)\n }\n const handleClose = () => {\n window.removeEventListener('keydown', checkAltMenu)\n setOpen(false)\n setAltMenu(false)\n }\n const handleEnter = () => {\n clearTimers()\n if (sidebarHidden) return\n enterTimer.current = window.setTimeout(handleOpen, ENTER_DELAY)\n }\n const handleLeave = () => {\n clearTimers()\n leaveTimer.current = window.setTimeout(handleClose, LEAVE_DELAY)\n }\n const clearTimers = () => {\n if (enterTimer.current) {\n clearTimeout(enterTimer.current)\n enterTimer.current = undefined\n }\n if (leaveTimer.current) {\n clearTimeout(leaveTimer.current)\n leaveTimer.current = undefined\n }\n }\n const checkAltMenu = useCallback((event: KeyboardEvent) => {\n if (event.altKey && event.shiftKey) setAltMenu(true)\n }, [])\n\n return (\n <>\n \n \n \n \n \n {\n await dispatch.feedback.set({\n subject: 'Bug Report',\n data: { location: window.location.href },\n })\n handleClose()\n }}\n dense\n />\n \n \n {(altMenu || testUI) && (\n {\n dispatch.ui.setPersistent({ testUI: 'HIGHLIGHT' })\n history.push('/settings/test')\n handleClose()\n }}\n />\n )}\n {/* \n */}\n \n \n emit('user/lock')}\n confirmProps={{\n title: 'Are you sure?',\n children:\n 'Locking the app will leave all active connections and hosted services running and prevent others from signing in.',\n }}\n />\n \n {\n await dispatch.auth.signOut()\n history.replace('/sign-in')\n }}\n confirmProps={{\n children:\n 'Signing out will allow this device to be transferred or another user to sign in. It will stop all connections.',\n }}\n />\n {remoteUI || (\n \n emit('user/quit')}\n confirmProps={{\n title: 'Are you sure?',\n children: 'Quitting will not close your connections.',\n }}\n />\n \n )}\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette, spacing }) => ({\n menu: {\n '& .MuiPaper-root': {\n overflow: 'visible',\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n top: -AVATAR_SIZE - AVATAR_BORDER,\n width: AVATAR_SIZE + AVATAR_BORDER,\n height: AVATAR_SIZE + AVATAR_BORDER,\n cursor: 'pointer',\n },\n },\n '& .MuiList-root': {\n backgroundColor: 'transparent',\n },\n },\n}))\n","import React from 'react'\nimport browser from '../services/browser'\nimport { makeStyles } from '@mui/styles'\nimport { SIDEBAR_WIDTH } from '../constants'\nimport { OrganizationSidebar } from './OrganizationSidebar'\nimport { RemoteManagement } from './RemoteManagement'\nimport { RegisterMenu } from './RegisterMenu'\nimport { SidebarNav } from './SidebarNav'\nimport { AvatarMenu } from './AvatarMenu'\nimport { spacing } from '../styling'\nimport { Body } from './Body'\n\nexport const Sidebar: React.FC<{ layout: ILayout }> = ({ layout }) => {\n const addSpace = browser.isMac && browser.isElectron && !layout.showOrgs\n const css = useStyles({ insets: layout.insets, addSpace })\n\n return (\n \n \n
\n \n \n
\n \n \n \n
\n )\n}\n\ntype StyleProps = {\n addSpace: boolean\n insets: ILayout['insets']\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n sidebar: ({ insets, addSpace }: StyleProps) => ({\n display: 'flex',\n flexDirection: 'column',\n contain: 'layout',\n backgroundColor: palette.grayLighter.main,\n width: SIDEBAR_WIDTH,\n minWidth: SIDEBAR_WIDTH,\n maxWidth: SIDEBAR_WIDTH,\n '& section': { margin: `${spacing.xl}px ${spacing.md}px ${spacing.sm}px`, padding: 0 },\n '& section:first-of-type': { marginTop: spacing.sm },\n // for iOS mobile\n paddingTop: spacing.md + (insets.top ? insets.top : addSpace ? spacing.md : 0),\n paddingBottom: insets?.bottom,\n }),\n header: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: spacing.sm,\n },\n}))\n","import React from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { selectOrganization } from '../selectors/organizations'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { Drawer } from '@mui/material'\nimport { Sidebar } from './Sidebar'\n\nexport const SidebarMenu: React.FC = () => {\n const dispatch = useDispatch()\n const location = useLocation()\n const activeOrgId = useSelector((state: State) => selectOrganization(state).id)\n const open = useSelector((state: State) => state.ui.sidebarMenu)\n const layout = useSelector((state: State) => state.ui.layout)\n\n React.useEffect(() => {\n if (open) dispatch.ui.set({ sidebarMenu: false })\n }, [location, activeOrgId])\n\n return (\n dispatch.ui.set({ sidebarMenu: false })}>\n \n \n )\n}\n","import React from 'react'\n\nexport type CoBrandingLogoProps = React.DetailedHTMLProps<\n React.ImgHTMLAttributes,\n HTMLImageElement\n> & {\n email?: string\n hostName?: string\n fallback?: JSX.Element\n onLoaded?: () => void\n}\n\nexport function CoBrandingLogo({\n fallback,\n hostName = window.location.hostname,\n onLoaded,\n ...props\n}: CoBrandingLogoProps): JSX.Element {\n try {\n return \n } catch (error) {\n if (fallback) return fallback\n return <>\n }\n}\n","import React from 'react'\nimport { Box } from '@mui/material'\nimport { CoBrandingLogo } from '../CoBrandingLogo'\nimport { spacing } from '../../../styling'\nimport { Logo } from '@common/brand/Logo'\n\nexport function SplashScreen(): JSX.Element {\n return (\n <>\n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Typography } from '@mui/material'\n\nexport type PageHeadingProps = {\n children: React.ReactNode\n}\n\nexport function PageHeading({ children }: PageHeadingProps) {\n return {children}\n}\n","import React from 'react'\nimport { Box, Stack, Tooltip, IconButton } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { useHistory } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { SplashScreen } from '../SplashScreen'\nimport { PageHeading } from '../PageHeading'\nimport { Icon } from '../../../components/Icon'\n\nexport type AuthLayoutProps = {\n children: React.ReactNode\n i18nKey?: string\n showLogo?: boolean\n back?: boolean\n backLink?: string\n fullWidth?: boolean\n}\n\nexport function AuthLayout({ children, i18nKey, showLogo, back, backLink, fullWidth }: AuthLayoutProps): JSX.Element {\n const { t } = useTranslation()\n const history = useHistory()\n const css = useStyles()\n\n let logo: null | React.ReactElement = null\n if (showLogo) {\n logo = \n }\n\n return (\n \n {logo}\n {i18nKey && (\n \n \n {!!back && (\n \n (backLink ? history.push(backLink) : history.goBack())}>\n \n \n \n )}\n {t(i18nKey)}\n \n \n )}\n {children}\n \n )\n}\nconst useStyles = makeStyles({\n back: {\n position: 'absolute',\n marginLeft: -60,\n marginTop: -10,\n },\n})\n","import React, { useState } from 'react'\nimport { Box, Button, TextField, Typography } from '@mui/material'\nimport { useTranslation } from 'react-i18next'\nimport { AuthLayout } from '../AuthLayout'\nimport { Notice } from '../../../components/Notice'\nimport { Icon } from '../../../components/Icon'\nimport { VerifyRecoveryCodeFunc, SignInFunc } from '../../types'\n\nexport type AccountRecoveryProps = {\n onVerifyRecoveryCode: VerifyRecoveryCodeFunc\n onSignIn: SignInFunc\n email: string\n fullWidth?: boolean\n}\n\nexport function AccountRecovery({\n onSignIn,\n onVerifyRecoveryCode,\n email,\n fullWidth,\n}: AccountRecoveryProps): JSX.Element {\n const { t } = useTranslation()\n const [error, setError] = useState(null)\n const [loading, setLoading] = useState(false)\n const [sentEmailVerifyRequest, setSentEmailVerifyRequest] = useState(false)\n const [emailVerificationCode, setEmailVerificationCode] = useState('')\n const [recoveryCode, setRecoveryCode] = useState('')\n\n async function handleSendEmailVerifyRequest(e: React.FormEvent): Promise {\n e.preventDefault()\n\n if (!email) return\n\n setError('')\n setLoading(true)\n\n try {\n const challenge = await onSignIn(email)\n console.log('SIGN IN RETURNED')\n console.log('Challenge:')\n console.log(challenge)\n if (challenge && challenge.includes('CUSTOM_CHALLENGE')) {\n console.log('setSentEmail')\n setSentEmailVerifyRequest(true)\n }\n } catch (localError) {\n // console.log('Error: ')\n // console.log(error)\n setError(localError.message)\n }\n\n setLoading(false)\n }\n\n async function handleSubmit(e: React.FormEvent): Promise {\n e.preventDefault()\n\n if (!email) return\n\n setError('')\n setLoading(true)\n\n try {\n const result = await onVerifyRecoveryCode(emailVerificationCode, recoveryCode)\n if (result.error) {\n setError(result.error.message)\n } else {\n window.location.href = '/#devices'\n }\n } catch (e) {\n setError(t(`pages.auth-mfa.errors.${e.code}`))\n }\n\n setLoading(false)\n }\n\n if (!email) return <>\n console.log('sentEmailVerifyRequest:')\n console.log(sentEmailVerifyRequest)\n\n return (\n <>\n \n {sentEmailVerifyRequest ? (\n <>\n
\n {error && (\n \n {error}\n \n )}\n {t('pages.account-recovery.description')}\n \n setEmailVerificationCode(e.currentTarget.value.trim())}\n InputProps={{ disableUnderline: true }}\n required\n value={emailVerificationCode}\n variant=\"filled\"\n />\n \n \n setRecoveryCode(e.currentTarget.value.trim())}\n InputProps={{ disableUnderline: true }}\n required\n value={recoveryCode}\n variant=\"filled\"\n />\n \n \n \n {t('global.actions.submit')}\n \n \n \n
\n \n \n ) : (\n <>\n
\n \n {t('pages.account-recovery.account-recovery-code')} \n \n \n \n \n
\n \n \n \n \n )}\n
\n \n )\n}\n\nfunction SupportRecoveryRequest(): JSX.Element {\n const { t } = useTranslation()\n return (\n \n \n \n {t('pages.account-recovery.lost-recovery-code-heading')}\n \n \n {t('pages.account-recovery.lost-recovery-code')}\n \n \n {t('pages.account-recovery.lost-recovery-code-button')}\n \n \n \n )\n}\n","import React from 'react'\nimport { Box, Button, TextField } from '@mui/material'\nimport { Link } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { Notice } from '../../../components/Notice'\nimport { AuthLayout } from '../AuthLayout'\nimport { Icon } from '../../../components/Icon'\nimport { useHistory } from 'react-router-dom'\nimport { RecoverPasswordRequestFunc } from '../../types'\n\nexport type ForgotPasswordProps = {\n email?: string\n onRecoverPasswordRequest: RecoverPasswordRequestFunc\n titleKey?: string\n buttonKey?: string\n fullWidth?: boolean\n}\n\nexport function ForgotPassword({\n email,\n onRecoverPasswordRequest,\n titleKey,\n buttonKey,\n fullWidth,\n}: ForgotPasswordProps): JSX.Element {\n const { t } = useTranslation()\n const history = useHistory()\n const [stateEmail, setEmail] = React.useState(email ? email : '')\n const [error, setError] = React.useState(null)\n const [loading, setLoading] = React.useState(false)\n\n if (titleKey === undefined) {\n titleKey = 'pages.forgot-password.title'\n }\n if (buttonKey === undefined) {\n buttonKey = 'pages.forgot-password.reset-password'\n }\n\n function emailChange(e: React.ChangeEvent): void {\n setEmail(e.currentTarget.value.toLowerCase().trim())\n }\n\n async function handleForgotPassword(e: React.FormEvent): Promise {\n e.preventDefault()\n\n setError(null)\n setLoading(true)\n\n try {\n await onRecoverPasswordRequest(stateEmail)\n history.push(`/forgot-password/verify`)\n return\n } catch (error) {\n setError(error)\n }\n\n setLoading(false)\n }\n\n return (\n \n
\n {error && (\n \n {error.message}\n \n )}\n \n \n \n \n \n \n \n \n \n
\n
\n )\n}\n","import React, { useState } from 'react'\nimport { Box, Button, Container, TextField, Typography, Divider } from '@mui/material'\nimport { Link as RouterLink } from 'react-router-dom'\nimport { Link } from '../../../components/Link'\nimport {\n CognitoUser,\n ChallengeOption,\n ConfirmSignInFunc,\n SendCustomChallengeAnswerFunc,\n SignInSuccessFunc,\n} from '../../types'\nimport { useTranslation } from 'react-i18next'\nimport { AuthLayout } from '../AuthLayout'\nimport { Notice } from '../../../components/Notice'\nimport { Icon } from '../../../components/Icon'\n\nexport type MFACodeProps = {\n challengeName?: ChallengeOption\n onConfirmSignIn: ConfirmSignInFunc\n onSendCustomChallengeAnswer: SendCustomChallengeAnswerFunc\n onSignInSuccess: SignInSuccessFunc\n cognitoUser?: CognitoUser\n}\n\nexport function MFACode({\n challengeName,\n onConfirmSignIn,\n onSendCustomChallengeAnswer,\n onSignInSuccess,\n cognitoUser,\n}: MFACodeProps): JSX.Element {\n const { t } = useTranslation()\n const [localCognitoUser, setAuthUser] = useState(cognitoUser)\n const [code, setCode] = useState('')\n const [error, setError] = useState(null)\n const [loading, setLoading] = useState(false)\n\n async function handleSubmit(e: React.FormEvent): Promise {\n e.preventDefault()\n if (!localCognitoUser) return\n\n // Clear out previous state\n setError('')\n setLoading(true)\n\n // You need to get the code from the UI inputs\n // and then trigger the following function with a button click\n //const code = 'GET_A_CODE_HERE' //TODO: getCodeFromUserInput()\n // If MFA is enabled, sign-in should be confirmed with the confirmation code\n\n if (challengeName === 'CUSTOM_CHALLENGE') {\n try {\n const authUser = await onSendCustomChallengeAnswer(code)\n if (localCognitoUser?.challengeName === 'CUSTOM_CHALLENGE') {\n setAuthUser(authUser)\n setCode('')\n return\n }\n\n onSignInSuccess(authUser)\n } catch (e) {\n console.error('verificationError', e)\n setError(e.message)\n }\n } else {\n try {\n if (challengeName === 'SMS_MFA' || challengeName === 'SOFTWARE_TOKEN_MFA') {\n await onConfirmSignIn(code, challengeName)\n // console.error('challengeReturned: ', localCognitoUser.challengeName)\n // console.error('localCognitoUser: ', localCognitoUser)\n if (!localCognitoUser.signInUserSession) {\n setError(t('pages.auth-mfa-totp.invalid-code'))\n } else {\n onSignInSuccess(localCognitoUser)\n }\n }\n } catch (e) {\n console.error('verificationError', e)\n setError(t(`pages.auth-mfa.errors.${e.code}`))\n }\n }\n\n setLoading(false)\n }\n\n let title = 'pages.auth-mfa.title'\n if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n title = 'pages.auth-mfa-totp.title'\n }\n\n if (!localCognitoUser)\n return (\n \n \n Sorry, something went wrong, please try again.\n \n \n )\n\n return (\n \n
\n {error && (\n \n {error}\n \n )}\n \n {challengeName === 'SMS_MFA' && {t('pages.auth-mfa.mfa-verification-sent')}}\n {challengeName === 'SOFTWARE_TOKEN_MFA' && (\n {t('pages.auth-mfa.totp-mfa-verification')}\n )}\n {challengeName === 'CUSTOM_CHALLENGE' && (\n {t('CUSTOM CHALLENGE')}\n // TODO: No translation key!!!\n )}\n \n \n setCode(e.currentTarget.value.toLowerCase().trim())}\n required\n value={code}\n variant=\"filled\"\n />\n \n \n \n \n \n \n \n \n \n {t('pages.auth-mfa.having-problems')}\n \n {t('pages.auth-mfa.no-device-access')}\n \n \n \n
\n )\n}\n","import React, { useState } from 'react'\nimport { PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH } from '../../../constants'\nimport { makeStyles } from '@mui/styles'\nimport { useTranslation } from 'react-i18next'\nimport { Box, TextField, Typography } from '@mui/material'\nimport zxcvbn from 'zxcvbn'\n\n\nexport type Props = {\n isNewPassword?: boolean\n onChange: (password: string, isValid: boolean) => void\n}\n\nexport function PasswordStrengthInput({ isNewPassword, onChange }: Props): JSX.Element {\n const { t } = useTranslation()\n const css = useStyles()\n const [password, setPassword] = useState('')\n const [passwordConfirmation, setPasswordConfirmation] = useState('')\n const [valid, setValid] = useState(false)\n const [tooShort, setTooShort] = useState(true)\n const [tooLong, setTooLong] = useState(false)\n // const [hasDigit, setHasDigit] = useState(true)\n // const [hasLower, setHasLower] = useState(true)\n // const [hasUpper, setHasUpper] = useState(true)\n // const [hasSpecialChar, setHasSpecialChar] = useState(true)\n const [hasMatch, setHasMatch] = useState(false)\n\n // const passwordSpecialChars = '^$*.[]{}()?-\"!@#%&/,><\\':;|_~'\n\n function checkTestedResult(pass: string): zxcvbn.ZXCVBNScore {\n return zxcvbn(pass).score\n }\n\n function checkTooShort(pass: string): boolean {\n const value = (pass ? pass.length : 0) < PASSWORD_MIN_LENGTH\n setTooShort(value)\n return value\n }\n\n function checkTooLong(pass: string): boolean {\n const value = (pass ? pass.length : 0) > PASSWORD_MAX_LENGTH\n setTooLong(value)\n return value\n }\n\n // function checkHasDigit(pass: string): boolean {\n // const value = /(.*\\d+.*)/g.test(pass)\n // setHasDigit(value)\n // return value\n // }\n\n // function checkHasLower(pass: string): boolean {\n // const value = /(.*[a-z]+.*)/g.test(pass)\n // setHasLower(value)\n // return value\n // }\n\n // function checkHasUpper(pass: string): boolean {\n // const value = /(.*[A-Z]+.*)/g.test(pass)\n // setHasUpper(value)\n // return value\n // }\n\n // function checkHasSpecialChar(pass: string): boolean {\n // const value = /(.*[$*.{}?\"!@#%&/,><\\':;|_~`^\\]\\[\\)\\(]+.*)/g.test(pass)\n // setHasSpecialChar(value)\n // return value\n // }\n\n function checkMatches(pass: string, passConfirm: string): boolean {\n const value = pass !== '' && passConfirm !== '' && pass === passConfirm\n setHasMatch(value)\n return value\n }\n\n function checkPasswordConfirmation(e: React.SyntheticEvent): void {\n const val = e.currentTarget.value\n setPasswordConfirmation(val)\n const isValid = checkValid(password)\n const isMatching = checkMatches(password, val)\n sendChange(password, isValid && isMatching)\n }\n\n function handlePasswordChange(e: React.FormEvent): void {\n const val = e.currentTarget.value\n setPassword(val)\n const isValid = checkValid(val)\n const isMatching = checkMatches(val, passwordConfirmation)\n sendChange(password, isValid && isMatching)\n }\n\n function createPasswordStrengthLabel(score: number): string {\n switch (score) {\n case 0:\n return t('pages.forgot-password-verify.password-strength-score.0')\n case 1:\n return t('pages.forgot-password-verify.password-strength-score.1')\n case 2:\n return t('pages.forgot-password-verify.password-strength-score.2')\n case 3:\n return t('pages.forgot-password-verify.password-strength-score.3')\n case 4:\n return t('pages.forgot-password-verify.password-strength-score.4')\n default:\n return t('pages.forgot-password-verify.password-strength-score.0')\n }\n }\n\n //Check full validation disabled for now\n // function checkValid(pass: string): boolean {\n // const isValid =\n // !checkTooShort(pass) &&\n // !checkTooLong(pass) &&\n // checkHasDigit(pass) &&\n // checkHasLower(pass) &&\n // checkHasUpper(pass) &&\n // checkHasSpecialChar(pass)\n // setValid(isValid)\n // return isValid\n // }\n\n function checkValid(pass: string): boolean {\n const isValid = !checkTooShort(pass) && !checkTooLong(pass)\n setValid(isValid)\n return isValid\n }\n\n function sendChange(pass: string, isValid: boolean): void {\n onChange(pass, isValid)\n }\n\n const error = password && !valid\n const confirmError = passwordConfirmation != '' && !hasMatch\n\n return (\n <>\n \n \n {tooShort &&\n t('pages.forgot-password-verify.password-error.too-short', {\n min_length: PASSWORD_MIN_LENGTH,\n })}\n {tooLong &&\n t('pages.forgot-password-verify.password-error.too-long', {\n max_length: PASSWORD_MAX_LENGTH,\n })}\n {/* {!hasDigit && (\n t(\n 'pages.forgot-password-verify.password-error.missing-number'\n )}\n )}\n {!hasLower && (\n t(\n 'pages.forgot-password-verify.password-error.missing-lower'\n )}\n )}\n {!hasUpper && (\n t(\n 'pages.forgot-password-verify.password-error.missing-upper'\n )}\n )}\n {!hasSpecialChar && (\n t(\n 'pages.forgot-password-verify.password-error.missing-special-char'\n )}\n \n ${passwordSpecialChars.spListItemt('').join(' ')}\n \n )} */}\n \n ) : (\n t('pages.forgot-password-verify.password-rules-reduced', {\n min_length: PASSWORD_MIN_LENGTH,\n max_length: PASSWORD_MAX_LENGTH,\n })\n )\n }\n />\n \n \n checkPasswordConfirmation(e)}\n type=\"password\"\n variant=\"filled\"\n InputProps={{ disableUnderline: true }}\n error={!!confirmError}\n helperText={confirmError ? t('pages.forgot-password-verify.password-error.passwords-do-not-match') : ' '}\n />\n \n \n \n \n \n \n \n {/* \n {passwordSpecialChars.split('').join(' ')}\n */}\n \n )\n}\n\nconst useStyles = makeStyles({\n meter: { textAlign: 'right', height: 40, '& progress': { width: '100%' } },\n disabled: { opacity: 0.3 },\n})\n","import React, { useState } from 'react'\nimport { Box, Button, TextField, Typography } from '@mui/material'\nimport { useTranslation } from 'react-i18next'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { AuthLayout } from '../AuthLayout'\nimport { Notice } from '../../../components/Notice'\nimport { Icon } from '../../../components/Icon'\nimport { PasswordStrengthInput } from '../PasswordStrengthInput'\n\nexport type PasswordVerifyProps = {\n onVerifyPasswordChange: (email: string, password: string, shortcode: string) => Promise\n email?: string\n fullWidth?: boolean\n}\n\nexport function PasswordVerify({ onVerifyPasswordChange, email, fullWidth }: PasswordVerifyProps): JSX.Element {\n const { t } = useTranslation()\n const history = useHistory()\n const location = useLocation()\n const [error, setError] = useState(null)\n const [loading, setLoading] = useState(false)\n const [shortcode, setShortcode] = useState('')\n const [password, setPassword] = useState('')\n const [isValidPassword, setIsValidPassword] = useState(false)\n const [verificationRequestSent, setVerificationRequestSent] = useState(true)\n\n // Get the email from the URL bar\n const { search } = location\n const localEmail = email ? email : ''\n const resetPasswordNeeded = search.includes('resetRequired=true')\n\n function handlePasswordValidation(password: string, validation: boolean): void {\n setPassword(password)\n setIsValidPassword(validation)\n }\n\n async function handleVerifyPasswordChange(e: React.FormEvent): Promise {\n e.preventDefault()\n\n setError(null)\n setLoading(true)\n setVerificationRequestSent(false)\n\n try {\n await onVerifyPasswordChange(localEmail.trim(), password.trim(), shortcode.trim())\n history.push(`/sign-in`, {\n alert: {\n type: 'success',\n message: t('pages.forgot-password-verify.success-message'),\n },\n })\n return\n } catch (e) {\n console.error(e)\n if (e.code) setError(t(`pages.auth-mfa.errors.${e.code}`))\n else setError(e.message)\n }\n\n setLoading(false)\n }\n\n return (\n \n
\n {verificationRequestSent && resetPasswordNeeded && (\n \n {t('pages.password-reset.cognito-reset-password-required', {\n email,\n })}\n \n )}\n {verificationRequestSent && !resetPasswordNeeded && (\n <>\n \n {t('pages.password-reset.verification-code-message', {\n email,\n })}\n \n {t('pages.password-reset.signout-all-text')}\n \n )}\n {error && (\n \n {error}\n \n )}\n \n setShortcode(e.currentTarget?.value.trim())}\n InputProps={{ disableUnderline: true }}\n // maxLength={6}\n required\n value={shortcode}\n variant=\"filled\"\n />\n \n \n \n \n \n \n \n
\n
\n )\n}\n","import React from 'react'\nimport { Button, ButtonProps } from '@mui/material'\n\nexport type GoogleSignInButtonProps = Omit\n\nexport function GoogleSignInButton(props: GoogleSignInButtonProps): JSX.Element {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n Sign in with Google\n \n )\n}\n","import React from 'react'\nimport { Stack, Button, ButtonProps } from '@mui/material'\nimport { Icon } from '../../components/Icon'\n\nexport type AppleSignInButtonProps = Omit\n\nexport function AppleSignInButton(props: AppleSignInButtonProps) {\n return (\n \n \n \n \n Sign in with Apple\n \n )\n}\n","import React from 'react'\nimport { rememberMe, sanitizeEmail } from '../../../helpers/userHelper'\nimport { makeStyles } from '@mui/styles'\nimport {\n Box,\n Button,\n TextField,\n Typography,\n Divider,\n Checkbox,\n Grid,\n FormControlLabel,\n InputAdornment,\n Collapse,\n} from '@mui/material'\nimport { SignInFunc, SamlSignInFunc, UsernameChangeFunc, CheckSamlFunc } from '../../types'\nimport { useTranslation } from 'react-i18next'\nimport { Notice } from '../../../components/Notice'\nimport { Icon } from '../../../components/Icon'\nimport { AuthLayout } from '../AuthLayout'\nimport { GoogleSignInButton } from '../GoogleSignInButton'\nimport { AppleSignInButton } from '../AppleSignInButton'\nimport { Link } from '../../../components/Link'\nimport { spacing } from '../../../styling'\nimport { useHistory } from 'react-router-dom'\nimport { IconButton } from '../../../buttons/IconButton'\n\nconst useStyles = makeStyles({\n or: {\n display: 'flex',\n justifyContent: 'space-evenly',\n alignItems: 'center',\n '& span': { padding: spacing.sm },\n '& hr': { flexGrow: 1 },\n },\n})\n\nexport type SignInProps = {\n email?: string\n onCheckSaml: CheckSamlFunc\n onUsernameChange?: UsernameChangeFunc\n onGoogleSignIn: () => void\n onAppleSignIn: () => void\n onOktaSignIn: () => void\n onSignIn: SignInFunc\n onSamlSignIn: SamlSignInFunc\n showLogo?: boolean\n errorMessage?: string\n fullWidth?: boolean\n}\n\nexport function SignIn({\n email,\n onCheckSaml,\n onUsernameChange,\n onGoogleSignIn,\n onAppleSignIn,\n onOktaSignIn,\n onSignIn,\n onSamlSignIn,\n showLogo = true,\n errorMessage = undefined,\n fullWidth,\n}: SignInProps): JSX.Element {\n let externalError: Error | null = null\n if (errorMessage) {\n externalError = new Error(errorMessage)\n }\n const { t } = useTranslation()\n const history = useHistory()\n const [username, setUsername] = React.useState(email || rememberMe.username)\n const [password, setPassword] = React.useState('')\n const [error, setError] = React.useState(externalError)\n const [loading, setLoading] = React.useState(false)\n const [showPassword, setShowPassword] = React.useState(false)\n const [emailProcessed, setEmailProcessed] = React.useState(rememberMe.emailProcessed)\n const [remember, setRemember] = React.useState(rememberMe.checked)\n const passRef = React.useRef()\n const css = useStyles()\n\n function scrollIntoView(event: React.FocusEvent) {\n event.target.scrollIntoView({ behavior: 'smooth', block: 'start' })\n }\n\n function scrollReset(event: React.FocusEvent) {\n event.target.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n\n async function handleSubmit(e: React.FormEvent): Promise {\n e.preventDefault()\n setError(null)\n\n if (!username || (!password && emailProcessed)) return alert('Please enter a username and password')\n\n setLoading(true)\n if (remember) rememberMe.set({ username, emailProcessed })\n\n if (emailProcessed) {\n try {\n // await onSignIn(username, password)\n const challenge = await onSignIn(username, password)\n\n if (onUsernameChange) onUsernameChange(username)\n\n if (challenge) {\n // They need to recover their account.\n if (challenge === 'CUSTOM_CHALLENGE') {\n history.push('/account-recovery')\n return\n }\n\n // MFA verification is required, send them to verify.\n if (challenge === 'SMS_MFA' || challenge === 'SOFTWARE_TOKEN_MFA') {\n history.push('/mfa-verify')\n return\n }\n\n // TODO: handle other challenge options\n }\n } catch (error) {\n console.error(error)\n setError(error)\n }\n } else {\n if (username) {\n const result = await onCheckSaml(username)\n if (result.isSaml && result.orgName) {\n //Its an org!\n onSamlSignIn(result.orgName)\n } else {\n setEmailProcessed(true)\n }\n }\n }\n\n setLoading(false)\n }\n\n return (\n \n \n {\n setLoading(true)\n onGoogleSignIn()\n }}\n disabled={loading}\n />\n {\n setLoading(true)\n onAppleSignIn()\n }}\n disabled={loading}\n />\n \n \n \n {t('pages.sign-in.or')?.toLowerCase()}\n \n \n
\n {error?.message && (\n \n {error.message}\n \n )}\n \n ) => {\n setUsername(sanitizeEmail(e?.currentTarget?.value))\n }}\n onFocus={scrollIntoView}\n onBlur={scrollReset}\n value={username}\n variant=\"filled\"\n type=\"email\"\n />\n \n passRef.current?.focus()}>\n \n ) => {\n setPassword(e?.currentTarget?.value)\n }}\n type={showPassword ? 'text' : 'password'}\n variant=\"filled\"\n InputProps={{\n endAdornment: (\n spacing(1) }}>\n setShowPassword(!showPassword)}\n icon={showPassword ? 'eye' : 'eye-slash'}\n />\n \n ),\n }}\n />\n \n \n \n \n {loading ? t('pages.sign-in.signing-in') : t('pages.sign-in.sign-in')}\n \n \n \n \n {\n setRemember(!remember)\n rememberMe.toggle({ username, emailProcessed })\n }}\n checkedIcon={}\n icon={}\n color=\"primary\"\n />\n }\n label={Remember me}\n />\n \n \n \n \n \n {t('pages.sign-in.forgot-password')}\n \n \n \n \n \n
\n \n \n {t('pages.sign-in.create-account')}\n {t('pages.sign-in.sign-up-link')}\n \n \n {!emailProcessed && (\n \n \n {\n setEmailProcessed(true)\n }}\n >\n {t('pages.sign-in.user-password-link')}\n \n \n \n )}\n {emailProcessed && (\n \n \n {\n setEmailProcessed(false)\n }}\n >\n {t('pages.sign-in.saml-link')}\n \n \n \n )}\n
\n )\n}\n","import React from 'react'\nimport ReCAPTCHA from 'reaptcha'\nimport { RECAPTCHA_SITE_KEY } from '../../../constants'\n\nexport type CaptchaProps = {\n id?: string\n onVerify: () => void\n}\n\nexport function Captcha({ ...props }: CaptchaProps): JSX.Element {\n return \n}\n","import React, { useState } from 'react'\nimport { Box, Button, Checkbox, TextField, Typography, FormControlLabel } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { useTranslation } from 'react-i18next'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { SignUpFunc, ResendFunc } from '../../types'\nimport { AuthLayout } from '../AuthLayout'\nimport { Captcha } from '../Captcha'\nimport { Notice } from '../../../components/Notice'\nimport { Icon } from '../../../components/Icon'\nimport { Link } from '../../../components/Link'\nimport { PasswordStrengthInput } from '../PasswordStrengthInput'\n\nexport type SignUpProps = {\n onSignUp: SignUpFunc\n onResend: ResendFunc\n hideCaptcha?: boolean\n fullWidth?: boolean\n}\n\nexport function SignUp({ onSignUp, onResend, hideCaptcha, fullWidth }: SignUpProps): JSX.Element {\n const { t } = useTranslation()\n const history = useHistory()\n const params = useParams<{ email?: string }>()\n const [error, setError] = useState(null)\n const [showResend, setShowResend] = useState(false)\n const [loading, setLoading] = useState(false)\n const [terms, setTerms] = useState(false)\n const [password, setPassword] = React.useState('')\n const [verified, setVerified] = useState(hideCaptcha || false)\n const [isValidPassword, setIsValidPassword] = useState(false)\n const [email, setEmail] = useState(decodeURIComponent(params?.email || ''))\n const css = useStyles()\n\n async function resend() {\n onResend(email)\n }\n\n async function forgotPassword() {\n history.push(`/forgot-password`)\n }\n\n async function handleSubmit(e: React.FormEvent): Promise {\n e.preventDefault()\n setError(null)\n setLoading(true)\n\n await onSignUp(email, password)\n .then(() => history.push(`/sign-up/verify`))\n .catch((err: Error) => {\n if (err.name == 'UsernameExistsException') {\n setShowResend(true)\n }\n setError(err)\n })\n\n setLoading(false)\n }\n\n // Grab possible alerts to show\n let alert\n const { state }: any = window.location\n if (state && state.alert) alert = state.alert\n\n function setPasswordValidation(password: string, isValidPassword: boolean): void {\n setPassword(password.trim())\n setIsValidPassword(isValidPassword)\n }\n\n return (\n \n {alert && (\n \n {alert.message}\n \n )}\n
\n {error && (\n \n {error.message}\n \n )}\n {showResend && (\n <>\n \n If you have not yet confirmed your account choose resend verification. If your account is confirmed but\n you don't know your password you can go to forgot password and set a new one.\n \n \n \n \n \n \n )}\n \n setEmail(e.currentTarget.value.toLowerCase().trim())}\n inputProps={{ maxLength: 254 }}\n placeholder=\"Email address...\"\n required\n type=\"email\"\n variant=\"filled\"\n />\n \n \n setPasswordValidation(password, isValidPassword)}\n />\n \n {!hideCaptcha && (\n \n setVerified(true)} />\n \n )}\n \n setTerms(e.target.checked)}\n checkedIcon={}\n icon={}\n color=\"primary\"\n />\n }\n label={\n \n I agree to the Remote.It\n Terms of Use,\n Privacy Policy\n and\n Fair Use Policy.\n \n }\n />\n \n \n \n {loading ? t('pages.auth.create-account.button-loading') : t('pages.auth.create-account.button-label')}\n \n \n {/* \n \n Already have an account? Sign in\n \n */}\n
\n
\n )\n}\n\nconst useStyles = makeStyles({\n captcha: { transition: 'height 600ms', overflow: 'hidden', position: 'relative' },\n})\n","import React from 'react'\nimport { Dispatch } from '../../../store'\nimport { useDispatch } from 'react-redux'\nimport { Box, Button, Typography } from '@mui/material'\nimport { useTranslation } from 'react-i18next'\nimport { AuthLayout } from '../AuthLayout'\nimport { Link } from '../../../components/Link'\nimport { Icon } from '../../../components/Icon'\nimport { ResendFunc } from '../../types'\nexport type SignUpVerifyProps = {\n email: string\n onResend: ResendFunc\n fullWidth?: boolean\n}\n\nexport function SignUpVerify({ email, onResend, fullWidth }: SignUpVerifyProps): JSX.Element {\n const [sending, setSending] = React.useState(false)\n const dispatch = useDispatch()\n const { t } = useTranslation()\n\n return (\n \n \n \n {t('pages.forgot-password-verify.verification-link-message')}\n \n \n \n {email}\n \n \n \n \n \n \n {t('pages.verify-account.verification-received-message')}\n
\n {t('pages.verify-account.check-spam')}\n {\n setSending(true)\n await onResend(email)\n dispatch.ui.set({ noticeMessage: t('pages.verify-account.resent-notice') || '' })\n setSending(false)\n }}\n >\n {sending ? t('pages.verify-account.sending') : t('pages.verify-account.resend-confirmation')}\n \n
\n
\n
\n )\n}\n","import i18n from 'i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport enTranslation from './locales/en/translations.json'\nimport { initReactI18next } from 'react-i18next'\n\ni18n\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n lng: 'en',\n fallbackLng: 'en',\n debug: false,\n interpolation: { escapeValue: false },\n react: { useSuspense: false },\n resources: { en: { translation: enTranslation } },\n })\n\nexport default i18n\n","import React from 'react'\nimport i18n from '../../i18n'\nimport { I18nextProvider } from 'react-i18next'\n\nexport type WrapperProps = {\n children: React.ReactNode\n}\n\nexport function Wrapper({ children }: WrapperProps): JSX.Element {\n return {children}\n}\n","import React from 'react'\nimport { Route, Switch, useLocation } from 'react-router-dom'\nimport {\n CheckSamlFunc,\n CognitoUser,\n ChallengeOption,\n ConfirmSignInFunc,\n RecoverPasswordRequestFunc,\n SendCustomChallengeAnswerFunc,\n SignInFunc,\n SignInSuccessFunc,\n SignUpFunc,\n SamlSignInFunc,\n VerifyPasswordChangeFunc,\n VerifyRecoveryCodeFunc,\n ResendFunc,\n} from '../../types'\nimport { AccountRecovery } from '../AccountRecovery'\nimport { ForgotPassword } from '../ForgotPassword'\nimport { MFACode } from '../MFACode'\nimport { PasswordVerify } from '../PasswordVerify'\nimport { SignIn } from '../SignIn'\nimport { SignUp } from '../SignUp'\nimport { SignUpVerify } from '../SignUpVerify'\nimport { Wrapper } from '../Wrapper'\n\nexport type AuthProps = {\n onConfirmSignIn: ConfirmSignInFunc\n onGoogleSignIn: () => void\n onAppleSignIn: () => void\n onOktaSignIn: () => void\n onRecoverPasswordRequest: RecoverPasswordRequestFunc\n onSendCustomChallengeAnswer: SendCustomChallengeAnswerFunc\n onSignIn: SignInFunc\n onCheckSaml: CheckSamlFunc\n onRecoverySignIn: SignInFunc\n onSignInSuccess: SignInSuccessFunc\n onSamlSignIn: SamlSignInFunc\n onSignUp: SignUpFunc\n onResend: ResendFunc\n onVerifyPasswordChange: VerifyPasswordChangeFunc\n onVerifyRecoveryCode: VerifyRecoveryCodeFunc\n cognitoUser?: CognitoUser\n showLogo?: boolean\n errorMessage?: string\n hideCaptcha?: boolean\n inputEmail?: string // move to global state?\n fullWidth?: boolean\n}\n\nexport function Auth(props: AuthProps): JSX.Element {\n console.log('AUTH WRAPPER render')\n return (\n \n \n \n )\n}\n\nfunction Routes({\n onCheckSaml,\n onConfirmSignIn,\n onGoogleSignIn,\n onAppleSignIn,\n onOktaSignIn,\n onRecoverPasswordRequest,\n onSendCustomChallengeAnswer,\n onSignIn,\n onSamlSignIn,\n onRecoverySignIn,\n onSignInSuccess,\n onSignUp,\n onResend,\n onVerifyPasswordChange,\n onVerifyRecoveryCode,\n cognitoUser,\n showLogo,\n errorMessage,\n hideCaptcha,\n inputEmail,\n fullWidth,\n}: AuthProps): JSX.Element {\n const location = useLocation()\n const [challenge, setChallenge] = React.useState()\n const [email, setEmail] = React.useState(inputEmail || '')\n\n // save initial route for after sign in\n React.useEffect(() => {\n if (location.pathname !== '/sign-in') window.localStorage.setItem('initialRoute', location.pathname)\n }, [])\n\n async function handleSignIn(username: string, password?: string): Promise {\n const challenge = await onSignIn(username, password)\n if (challenge) setChallenge(challenge)\n return challenge\n }\n\n async function handleSamlSignIn(domain: string) {\n onSamlSignIn(domain)\n }\n\n async function handleSignIn2(username: string) {\n const challenge = await onRecoverySignIn(username)\n return challenge\n }\n\n async function handleRecoverPasswordRequest(recoveryEmail: string): Promise {\n setEmail(recoveryEmail)\n onRecoverPasswordRequest(recoveryEmail)\n }\n\n async function handleUsernameChange(username: string): Promise {\n setEmail(username)\n }\n\n async function handleSignup(newEmail: string, password: string): Promise {\n await onSignUp(newEmail, password)\n setEmail(newEmail)\n }\n\n async function handleResend(newEmail: string): Promise {\n await onResend(newEmail)\n }\n\n return (\n <>\n \n (\n \n )}\n path=\"/forgot-password/verify\"\n />\n (\n \n )}\n path=\"/forgot-password\"\n />\n (\n \n )}\n path=\"/update-password\"\n />\n } path=\"/sign-up/verify\" />\n (\n \n )}\n path=\"/sign-up/:email?\"\n />\n (\n \n )}\n path=\"/account-recovery\"\n />\n (\n \n )}\n path=\"/mfa-verify\"\n />\n (\n \n )}\n path=\"*\"\n />\n \n \n )\n}\n","import React from 'react'\nimport { CognitoUser, ChallengeOption, SignInSuccessFunc, CognitoUserResult, SamlOrgResult } from '../../types'\nimport { SplashScreen } from '../SplashScreen'\nimport { AuthService } from '../../auth'\nimport { Auth } from '../Auth'\n\nexport type CognitoAuthProps = {\n onSignInSuccess: SignInSuccessFunc\n clientId?: string\n errorMessage?: string\n hideCaptcha?: boolean\n authService: AuthService\n fullWidth?: boolean\n}\n\nexport function CognitoAuth({\n onSignInSuccess,\n errorMessage,\n authService,\n hideCaptcha,\n fullWidth,\n}: CognitoAuthProps): JSX.Element {\n const [authUser, setAuthUser] = React.useState()\n const [loading, setLoading] = React.useState(false)\n const [cognito] = React.useState(authService)\n\n React.useEffect(() => {\n handleCheckSignIn()\n }, [])\n\n async function handleCheckSignIn(): Promise {\n setLoading(true)\n try {\n const result = await cognito.checkSignIn()\n if (result.cognitoUser) {\n setAuthUser(result.cognitoUser)\n onSignInSuccess(result.cognitoUser)\n }\n } catch (err) {\n console.error(err)\n }\n setLoading(false)\n }\n\n async function handleCheckSaml(username: string): Promise {\n return await cognito.checkSaml(username)\n }\n\n async function handleSignIn(username: string, password?: string): Promise {\n const result = await cognito.signIn(username, password)\n\n if (result.error) throw result.error\n\n if (result.cognitoUser) {\n setAuthUser(result.cognitoUser)\n\n if (result.cognitoUser.challengeName) {\n return result.cognitoUser.challengeName\n }\n\n onSignInSuccess(result.cognitoUser)\n }\n\n return\n }\n\n async function handleRecoverySignIn(username: string, password?: string): Promise {\n const result = await cognito.signIn(username, password)\n\n if (result.error) throw result.error\n\n if (result.cognitoUser) {\n // setAuthUser(result.cognitoUser)\n\n if (result.cognitoUser.challengeName) {\n return result.cognitoUser.challengeName\n }\n\n onSignInSuccess(result.cognitoUser)\n }\n\n return\n }\n\n async function handleSamlSignIn(domain: string): Promise {\n return await cognito.samlSignIn(domain)\n }\n\n async function handleOktaSignIn(): Promise {\n return await cognito.oktaSignIn()\n }\n\n async function handleVerifyPasswordChange(email: string, password: string, shortcode: string): Promise {\n return await cognito.forgotPasswordSubmit(shortcode, password, email)\n }\n\n async function handleRecoverPasswordRequest(email: string): Promise {\n return await cognito.forgotPassword(email)\n // .catch(e => {\n // //don't give the user the hint that the email doesn't exist to prevent brute force attacks and to avoid possible users listing through a script\n // console.error('recoverPasswordRequest Error', e)\n // })\n }\n\n async function handleVerifyRecoveryCode(\n emailVerificationCode: string,\n recoveryCode: string\n ): Promise {\n return await cognito.verifyRecoveryCode(emailVerificationCode, recoveryCode)\n }\n\n async function handleConfirmSignIn(code: string, challengeName?: ChallengeOption): Promise {\n await cognito.confirmSignIn(code, challengeName)\n }\n\n async function handleSendCustomChallengeAnswer(code: string): Promise {\n alert('send custom challenge answer')\n return {} as CognitoUser\n }\n\n async function handleSignUp(username: string, password: string): Promise {\n const response = await cognito.signUp(username, password)\n if (response.error) {\n // await cognito.resendSignUp(username)\n throw response.error\n }\n }\n\n async function handleResend(username: string): Promise {\n await cognito.resendSignUp(username)\n }\n\n if (loading) {\n return \n }\n\n console.log('COGNITO AUTH RENDER')\n\n return (\n cognito.googleSignIn()}\n onAppleSignIn={() => cognito.appleSignIn()}\n onOktaSignIn={handleOktaSignIn}\n onRecoverPasswordRequest={handleRecoverPasswordRequest}\n onRecoverySignIn={handleRecoverySignIn}\n onResend={handleResend}\n onSamlSignIn={handleSamlSignIn}\n onSendCustomChallengeAnswer={handleSendCustomChallengeAnswer}\n onSignIn={handleSignIn}\n onSignInSuccess={onSignInSuccess}\n onSignUp={handleSignUp}\n onVerifyPasswordChange={handleVerifyPasswordChange}\n onVerifyRecoveryCode={handleVerifyRecoveryCode}\n />\n )\n}\n","import React from 'react'\nimport { CognitoUser } from '../cognito/types'\nimport { CognitoAuth } from '../cognito/components/CognitoAuth'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\n\nexport function SignInApp() {\n const { signInError, authService } = useSelector((state: State) => state.auth)\n const { auth } = useDispatch()\n\n const onSignInSuccess = (user: CognitoUser) => {\n setTimeout(() => auth.handleSignInSuccess(user), 100)\n }\n\n if (!authService) return null\n\n return (\n \n )\n}\n","import { REGEX_FIRST_PATH } from '../constants'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\n\nconst useMobileBack = () => {\n const history = useHistory()\n const location = useLocation()\n const customHistory = useSelector((state: State) => state.ui.mobileNavigation)\n\n const goUp = () => {\n const newHistory = [...customHistory]\n\n if (newHistory.length <= 1) {\n // If no previous history just go to root of the pathname\n newHistory[0] = location.pathname.match(REGEX_FIRST_PATH)?.[0] || '/'\n } else {\n // Remove the last entry (current path)\n newHistory.pop()\n }\n\n // Get the last entry from the updated history array\n const upPath = newHistory[newHistory.length - 1]\n\n console.log('MOBILE NAVIGATION goUp', upPath)\n\n // Navigate to the previous path\n history.push(upPath)\n }\n\n return goUp\n}\n\nexport default useMobileBack\n","import React, { useState } from 'react'\nimport { MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { Dispatch, State } from '../store'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Confirm } from '../components/Confirm'\nimport { Icon } from '../components/Icon'\n\ntype Props = {\n device?: IDevice\n service?: IService\n}\n\nexport const DeleteServiceMenuItem: React.FC = ({ device, service }) => {\n const [open, setOpen] = useState(false)\n const { devices } = useDispatch()\n const setupBusy = useSelector((state: State) => state.ui.setupBusy)\n const deleting = useSelector((state: State) => service && state.ui.setupDeletingService === service.id)\n\n let disabled = deleting || setupBusy\n\n if (!service) return null\n if (!device?.permissions.includes('MANAGE')) disabled = true\n\n let title = 'Delete Service'\n let message = \"Deleting services can't be undone.\"\n\n if (device?.thisDevice) {\n title = 'Unregister Service'\n message =\n \"Deleting services can't be undone. If this service is providing you remote access, you may have to physically connect to the device to recover it.\"\n }\n\n return (\n <>\n setOpen(true)} disabled={disabled}>\n \n \n \n \n \n {\n if (device && service) devices.cloudRemoveService({ serviceId: service.id, deviceId: device.id })\n setOpen(false)\n }}\n onDeny={() => setOpen(false)}\n title=\"Are you sure?\"\n color=\"error\"\n action=\"Delete\"\n >\n {message}\n \n \n )\n}\n","import React from 'react'\nimport useClipboard from '../hooks/useClipboard'\nimport { MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { Icon, IconProps } from './Icon'\n\nexport type CopyMenuItemProps = {\n icon: string\n title?: string\n value?: string | number\n disabled?: boolean\n awaitCopy?: () => Promise\n iconProps?: IconProps\n className?: string\n}\n\nexport const CopyMenuItem: React.FC = ({\n icon,\n value,\n title,\n disabled,\n awaitCopy,\n iconProps,\n className,\n}) => {\n const clipboard = useClipboard({ copiedTimeout: 1000 })\n return (\n {\n await awaitCopy?.()\n clipboard.copy(value)\n }}\n disabled={disabled}\n className={className}\n >\n \n \n \n \n \n )\n}\n","import React, { useState } from 'react'\nimport { Tooltip, IconButton, MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { Confirm } from '../components/Confirm'\nimport { Icon } from '../components/Icon'\n\ntype Props = {\n title?: string\n warning?: React.ReactNode\n icon?: string\n disabled?: boolean\n destroying?: boolean\n menuItem?: boolean\n onDelete: () => void\n}\n\nexport const DeleteButton: React.FC = ({\n title = 'delete',\n warning,\n icon = 'trash',\n disabled,\n destroying,\n menuItem,\n onDelete,\n}) => {\n const [open, setOpen] = useState(false)\n const [deleting, setDeleting] = useState(false)\n let color, spin\n\n if (deleting || destroying) {\n icon = 'spinner-third'\n color = 'danger'\n spin = true\n }\n\n const DeleteIcon = \n\n return (\n <>\n {menuItem ? (\n setOpen(true)} disabled={disabled}>\n {DeleteIcon}\n \n \n ) : (\n \n \n setOpen(true)} color=\"info\" size=\"large\">\n {DeleteIcon}\n \n \n \n )}\n {\n setOpen(false)\n setDeleting(true)\n await onDelete()\n setDeleting(false)\n }}\n onDeny={() => setOpen(false)}\n title=\"Are you sure?\"\n action={title}\n color=\"error\"\n >\n {warning}\n \n \n )\n}\n","import React from 'react'\nimport { emit } from '../services/Controller'\nimport { Tooltip } from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { Typography } from '@mui/material'\nimport { Notice } from './Notice'\n\ntype Props = {\n device?: IDevice\n menuItem?: boolean\n hide?: boolean\n onClick?: () => void\n}\n\nexport const DeleteDevice: React.FC = ({ device, menuItem, hide, onClick }) => {\n const { devices, ui } = useDispatch()\n const userId = useSelector((state: State) => state.auth.user?.id)\n const destroying = useSelector((state: State) => state.ui.destroying)\n const setupBusy = useSelector((state: State) => state.ui.setupBusy)\n const setupDeletingDevice = useSelector((state: State) => state.ui.setupDeletingDevice)\n\n let disabled: boolean = false\n let icon: string = 'trash'\n let title: string = 'Delete Device'\n let warning: React.ReactNode = (\n <>\n \n Deleting devices can't be undone so may require you to physically access the device if you wish to recover it.\n \n \n We recommend uninstalling Remote.It before
\n deleting devices.\n
\n \n )\n\n if (!device || hide || device.shared || (device.accountId !== userId && !device.permissions.includes('MANAGE')))\n return null\n\n const destroy = () => {\n if (device.thisDevice && device.permissions.includes('MANAGE')) {\n ui.set({ setupDeletingDevice: true, setupBusy: true, silent: device.id })\n emit('registration', 'DELETE')\n } else {\n devices.destroy(device)\n }\n onClick && onClick()\n }\n\n if (device.state === 'active') disabled = true\n\n if (device.thisDevice && device.permissions.includes('MANAGE')) {\n disabled = false\n title = 'Unregister Device'\n warning = (\n \n You are about to permanently remove this device and all of its services.\n \n )\n }\n\n const button = (\n \n )\n\n return disabled ? (\n \n {button}\n \n ) : (\n button\n )\n}\n","import React from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { DeleteButton } from '../buttons/DeleteButton'\n\ntype Props = {\n device?: IDevice\n menuItem?: boolean\n hide?: boolean\n}\n\nexport const LeaveDevice: React.FC = ({ device, menuItem, hide }) => {\n const { devices } = useDispatch()\n const { destroying } = useSelector((state: State) => state.ui)\n\n if (!device || hide || !device.shared) return null\n\n const leave = () => devices.leave(device)\n\n return (\n \n )\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { Tooltip, IconButton } from '@mui/material'\nimport { Icon } from '../components/Icon'\n\ntype Props = {\n device: IDevice\n service?: IService\n onClick?: () => void\n}\n\nexport const InfoButton: React.FC = ({ onClick, device, service }) => {\n const history = useHistory()\n const instance = device || service\n\n let title = 'Details'\n if (service) title = 'Service Details'\n else if (device) title = 'Device Details'\n\n if (instance)\n onClick = () => {\n let path = `/devices/${device?.id}`\n if (service) path += `/${service.id}`\n history.push(path)\n }\n\n return (\n \n \n {/* */}\n \n \n \n )\n}\n","import React from 'react'\nimport browser from '../services/browser'\nimport { useMediaQuery } from '@mui/material'\nimport { MOBILE_WIDTH } from '../constants'\n\ntype Props = {\n ios?: boolean\n android?: boolean\n hide?: boolean\n children?: React.ReactNode\n}\n\nexport const MobileUI: React.FC = ({ ios, android, hide, children }) => {\n let mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n\n if (android) mobile = mobile && browser.isAndroid\n if (ios) mobile = mobile && browser.isIOS\n if (hide) mobile = !mobile\n\n return mobile ? <>{children} : null\n}\n","import React, { useState } from 'react'\nimport { PROTOCOL } from '../constants'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { Link, useParams } from 'react-router-dom'\nimport { Divider, Menu, MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { DeleteServiceMenuItem } from '../buttons/DeleteServiceMenuItem'\nimport { DeviceScriptingMenu } from './DeviceScriptingMenu'\nimport { ListItemLocation } from './ListItemLocation'\nimport { CopyMenuItem } from './CopyMenuItem'\nimport { DeleteDevice } from './DeleteDevice'\nimport { LeaveDevice } from './LeaveDevice'\nimport { InfoButton } from '../buttons/InfoButton'\nimport { IconButton } from '../buttons/IconButton'\nimport { MobileUI } from './MobileUI'\nimport { Icon } from './Icon'\n\ntype Props = { device?: IDevice; service?: IService; user?: IUser }\n\nexport const DeviceOptionMenu: React.FC = ({ device, service }) => {\n const { deviceID } = useParams<{ deviceID?: string }>()\n const [anchorEl, setAnchorEl] = useState(null)\n const handleClick = event => setAnchorEl(event.currentTarget)\n const handleClose = () => setAnchorEl(null)\n const dispatch = useDispatch()\n const devicesSection = !!deviceID\n const deviceOnly = device && !service\n\n if (!device) return null\n\n return (\n <>\n {!devicesSection && }\n \n \n \n {device.permissions.includes('MANAGE') && (\n \n \n \n \n \n \n )}\n \n {(!devicesSection || service) && (\n \n )}\n {service && (\n \n )}\n {devicesSection && deviceOnly && (\n \n )}\n {device.permissions.includes('MANAGE') &&\n devicesSection &&\n deviceOnly && [\n dispatch.ui.set({ showRestoreModal: true })}>\n \n \n \n \n ,\n \n \n \n \n \n ,\n ]}\n {device.permissions.includes('MANAGE') &&\n devicesSection &&\n deviceOnly && [, ]}\n {device.permissions.includes('MANAGE') &&\n service &&\n devicesSection && [\n ,\n ,\n ]}\n \n \n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { REGEX_SERVICE_ID } from '../constants'\nimport { DeviceOptionMenu } from './DeviceOptionMenu'\nimport { selectDevice } from '../selectors/devices'\nimport { useSelector } from 'react-redux'\nimport { useParams } from 'react-router-dom'\n\nexport function HeaderDeviceOptionMenu() {\n let { deviceID, serviceID } = useParams<{ deviceID?: string; serviceID?: string }>()\n\n if (!serviceID || !REGEX_SERVICE_ID.test(serviceID)) serviceID = undefined\n\n const device = useSelector((state: State) => selectDevice(state, undefined, deviceID))\n const singlePanel = useSelector((state: State) => state.ui.layout.singlePanel)\n const hide = !device || (singlePanel && serviceID)\n\n return hide ? null : \n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { useParams } from 'react-router-dom'\nimport { selectPermissions } from '../selectors/organizations'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { Notice } from './Notice'\n\ntype Props = { device?: IDevice; service?: IService; user?: IUser }\n\nexport const ScriptDeleteButton: React.FC = ({ device, service }) => {\n const { fileID } = useParams<{ fileID?: string }>()\n const permissions = useSelector(selectPermissions)\n const dispatch = useDispatch()\n\n if (!permissions.includes('ADMIN') || !fileID) return null\n\n return (\n \n This can not be undone.\n \n }\n onDelete={async () => await dispatch.files.delete(fileID)}\n />\n )\n}\n","import React from 'react'\nimport { Route, Link } from 'react-router-dom'\nimport { Notice } from './Notice'\nimport { Button } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { selectLimits } from '../selectors/organizations'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { Pre } from './Pre'\n\nconst oneWeek = 1000 * 60 * 60 * 24 * 7\n\nexport const UpgradeNotice: React.FC> = () => {\n const limits = useSelector(selectLimits)\n const visible = useSelector(\n (state: State) => !state.ui.updateNoticeCleared || state.ui.updateNoticeCleared < Date.now() - oneWeek\n )\n const limit = limits.find(l => l.name === 'iot-devices')\n const overLimit = limit && limit.actual > limit.value\n const dispatch = useDispatch()\n const css = useStyles()\n\n if (!visible || !limit || !overLimit) return null\n\n let message = 'A license is required for commercial use. Personal use is free for up to 5 devices.'\n if (overLimit) message = `You have ${limit.actual} devices, but your plan only allows ${limit.value}.`\n\n return (\n \n dispatch.ui.setPersistent({ updateNoticeCleared: Date.now() })}\n button={\n \n \n \n }\n >\n {message}\n \n \n )\n}\n\nconst useStyles = makeStyles({\n notice: { zIndex: 9 },\n})\n","import React from 'react'\nimport isEqual from 'lodash.isequal'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { Tooltip, IconButton } from '@mui/material'\nimport { defaultState } from '../models/ui'\nimport { Icon } from '../components/Icon'\n\nexport const ColumnsButton: React.FC = () => {\n const open = useSelector((state: State) => state.ui.drawerMenu === 'COLUMNS')\n const modified = useSelector((state: State) => !isEqual(state.ui.columns, defaultState.columns))\n const { ui } = useDispatch()\n const icon = open ? 'times' : 'line-columns'\n return (\n \n {\n event.stopPropagation()\n ui.set({ drawerMenu: open ? null : 'COLUMNS' })\n }}\n size=\"large\"\n >\n \n \n \n )\n}\n","import React from 'react'\nimport network from '../../services/Network'\nimport cloudController from '../../services/cloudController'\nimport cloudSync from '../../services/CloudSync'\nimport { emit } from '../../services/Controller'\nimport { Dispatch, State } from '../../store'\nimport { VALID_JOB_ID_LENGTH } from '../../constants'\nimport { useParams, useRouteMatch } from 'react-router-dom'\nimport { selectDeviceModelAttributes, selectDevice } from '../../selectors/devices'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { IconButton, ButtonProps } from '../IconButton'\nimport { attributeName } from '@common/nameHelper'\nimport { GuideBubble } from '../../components/GuideBubble'\nimport { Typography } from '@mui/material'\n\nexport const RefreshButton: React.FC = props => {\n const dispatch = useDispatch()\n const { deviceID, fileID, jobID } = useParams<{ deviceID?: string; fileID?: string; jobID?: string }>()\n const device = useSelector((state: State) => selectDevice(state, undefined, deviceID))\n const fetching = useSelector(\n (state: State) =>\n selectDeviceModelAttributes(state).fetching || (deviceID && state.logs.fetching) || state.ui.fetching\n )\n const connectionPage = useRouteMatch('/connections')\n const networkPage = useRouteMatch('/networks')\n const logsPage = useRouteMatch(['/logs', '/devices/:deviceID/logs'])\n const devicesPage = useRouteMatch('/devices')\n const scriptingPage = useRouteMatch('/scripting')\n const scriptPage = useRouteMatch('/script')\n\n let title = 'Refresh application'\n let methods: Methods = []\n\n // connection pages\n if (connectionPage) {\n title = 'Refresh connections'\n methods.push(dispatch.connections.fetch)\n\n // network pages\n } else if (networkPage) {\n title = 'Refresh networks'\n methods.push(dispatch.networks.fetchAll)\n\n // scripting pages\n } else if (scriptingPage) {\n title = 'Refresh scripts'\n methods.push(dispatch.files.fetch)\n methods.push(dispatch.jobs.fetch)\n\n // script pages\n } else if (scriptPage) {\n title = 'Refresh script'\n if (fileID) methods.push(async () => await dispatch.files.fetchSingle({ fileId: fileID }))\n if (jobID && jobID.length >= VALID_JOB_ID_LENGTH)\n methods.push(async () => await dispatch.jobs.fetchSingle({ jobId: jobID }))\n else if (fileID) methods.push(async () => await dispatch.jobs.fetchByFileIds({ fileIds: [fileID] }))\n\n // log pages\n } else if (logsPage) {\n title = device ? `Refresh ${attributeName(device)} logs` : 'Refresh logs'\n methods.push(async () => {\n if (device) await dispatch.devices.fetchSingleFull({ id: device.id })\n await dispatch.logs.set({ after: undefined, maxDate: undefined })\n await dispatch.logs.fetch()\n })\n\n // device pages\n } else if (devicesPage) {\n title = device ? `Refresh ${attributeName(device)}` : 'Refresh devices'\n methods.push(async () => {\n if (device) {\n await dispatch.devices.fetchSingleFull({ id: device.id })\n } else {\n await dispatch.devices.set({ from: 0 })\n await dispatch.devices.fetchList()\n }\n })\n }\n\n const refresh = async () => {\n if (fetching) {\n await cloudSync.cancel()\n await dispatch.devices.set({ fetching: false })\n return\n }\n await cloudSync.call(methods)\n await cloudSync.core(!methods.length)\n dispatch.devices.expire()\n cloudController.ping()\n network.connect()\n emit('refresh')\n }\n\n return (\n \n \n Refresh the application\n \n \n Device state will update automatically while your system is on and the app is running.\n \n \n }\n >\n \n \n )\n}\n","import React, { useEffect, useState, useMemo } from 'react'\nimport reactStringReplace from 'react-string-replace'\nimport escapeRegexp from 'escape-string-regexp'\nimport debounce from 'lodash.debounce'\nimport classnames from 'classnames'\nimport { sortSearch } from '../models/search'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { TextField, Typography, ListItem, ListSubheader, Autocomplete, createFilterOptions } from '@mui/material'\nimport { spacing, fontSizes } from '../styling'\nimport { TargetPlatform } from './TargetPlatform'\nimport { makeStyles } from '@mui/styles'\nimport { useHistory } from 'react-router-dom'\nimport { Icon } from './Icon'\n\ntype Props = { inputRef?: React.RefObject; onClose?: () => void }\n\nexport const GlobalSearch: React.FC = ({ inputRef, onClose }) => {\n const search = useSelector((state: State) => state.search.search)\n const userEmail = useSelector((state: State) => state.user.email)\n const fetching = useSelector((state: State) => state.search.fetching)\n const queryDefault = useSelector(selectDeviceModelAttributes).query\n const enabledIds = useSelector((state: State) => state.connections.all)\n .filter(c => c.enabled)\n .map(c => c.id)\n const data = sortSearch([...search])\n const css = useStyles()\n const history = useHistory()\n const dispatch = useDispatch()\n const [query, setQuery] = useState(queryDefault)\n\n const fetch = useMemo(\n () =>\n debounce(\n value => {\n console.log('FETCHING', value)\n dispatch.search.fetch(value)\n },\n 400,\n { trailing: true }\n ),\n []\n )\n\n const clear = () => {\n setQuery('')\n dispatch.devices.set({ query: '', searched: false, from: 0 })\n dispatch.devices.fetchList()\n }\n\n const select = (selection: ISearch) => {\n // dispatch.devices.set({ query: '' })\n if (selection.nodeType === 'NETWORK') {\n dispatch.accounts.select(selection.accountId)\n history.push(`/networks/${selection?.nodeId}/${selection?.serviceId}`)\n } else {\n history.push(`/devices/${selection?.nodeId}/${selection?.serviceId}`)\n }\n }\n\n const submit = () => {\n console.log('SUBMIT', query)\n dispatch.devices.set({ query, searched: true, from: 0 })\n dispatch.devices.fetchList()\n onClose?.()\n history.push(`/devices`)\n }\n\n useEffect(() => {\n if (query) fetch(query)\n }, [query])\n\n return (\n
\n {\n console.log('CHANGE', newValue, reason)\n if (reason === 'selectOption') select(newValue)\n if (reason === 'createOption') submit()\n }}\n groupBy={option => option.nodeId}\n onInputChange={(event, newQuery, reason) => {\n if (reason === 'input') setQuery(newQuery)\n if (reason === 'clear') clear()\n }}\n onSubmit={submit}\n getOptionLabel={option => option.serviceName || option}\n isOptionEqualToValue={(option, value) => option.serviceId === value.serviceId}\n filterOptions={createFilterOptions({ stringify: option => option.combinedName })}\n clearIcon={\n <>\n {fetching && }\n \n \n }\n renderInput={params => (\n onClose?.()}\n onKeyDown={event => event.key === 'Enter' && !query && clear()}\n InputProps={{\n ...params.InputProps,\n endAdornment: <>{params.InputProps.endAdornment},\n }}\n />\n )}\n renderOption={(props, option: ISearch, state) => {\n const parts = reactStringReplace(\n option.serviceName,\n new RegExp(`(${escapeRegexp(query.trim())})`, 'i'),\n (match, i) => (\n \n {match}\n \n )\n )\n const enabled = enabledIds.includes(option.serviceId)\n return (\n \n \n {parts}\n \n \n )\n }}\n renderGroup={option => {\n const props = option.children && option.children[0].props.children.props\n return [\n \n \n {props['data-platform'] === 'NETWORK' ? (\n \n ) : (\n \n )}\n {reactStringReplace(\n props['data-name'],\n new RegExp(`(${escapeRegexp(query.trim())})`, 'i'),\n (match, i) => (\n \n {match}\n \n )\n )}\n \n {userEmail !== props['data-email'] && {props['data-email']}}\n ,\n option.children,\n ]\n }}\n />\n
\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n container: {\n padding: 0,\n width: '100%',\n zIndex: 1,\n },\n input: {\n WebkitAppRegion: 'no-drag',\n '& .MuiInputBase-root .MuiInputBase-input.MuiAutocomplete-input': {\n padding: `${spacing.sm}px`,\n fontSize: fontSizes.base,\n },\n },\n button: { marginBottom: -spacing.sm },\n enabled: { color: palette.primary.main },\n subhead: {\n top: -8,\n display: 'flex',\n justifyContent: 'space-between',\n padding: `${spacing.sm}px ${spacing.md}px`,\n fontSize: fontSizes.base,\n color: palette.grayDarkest.main,\n backgroundColor: palette.grayLightest.main,\n width: '100%',\n borderRadius: 0,\n textTransform: 'inherit',\n letterSpacing: 'inherit',\n '& > p': { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', fontWeight: 500 },\n },\n listbox: {\n maxHeight: '60vh',\n backgroundColor: palette.grayLightest.main,\n '& .MuiAutocomplete-option': {\n display: 'block',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n padding: 0,\n paddingLeft: spacing.xxs,\n fontSize: fontSizes.base,\n color: palette.grayDarker.main,\n '&[data-focus=\"true\"]': { backgroundColor: palette.primaryHighlight.main },\n },\n },\n indent: {\n display: 'inline-block',\n marginLeft: spacing.xs,\n padding: `${spacing.xs}px ${spacing.lg}px`,\n borderLeft: `1px solid ${palette.grayLight.main}`,\n },\n highlight: {\n borderRadius: 4,\n backgroundColor: palette.primaryLighter.main,\n color: palette.black.main,\n },\n}))\n","import React from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { Tooltip, IconButton } from '@mui/material'\nimport { selectIsFiltered } from '../../selectors/devices'\nimport { Icon } from '../../components/Icon'\n\nexport const FilterButton: React.FC = () => {\n const modified = useSelector(selectIsFiltered)\n const drawerMenu = useSelector((state: State) => state.ui.drawerMenu)\n const open = drawerMenu === 'FILTER'\n const { ui } = useDispatch()\n const icon = open ? 'times' : 'filter'\n\n return (\n \n {\n event.stopPropagation()\n ui.set({ drawerMenu: open ? null : 'FILTER' })\n }}\n size=\"large\"\n >\n \n \n \n )\n}\n","import { REGEX_FIRST_PATH, HIDE_SIDEBAR_WIDTH, MOBILE_WIDTH } from '../../constants'\nimport React, { useState, useRef } from 'react'\nimport useMobileBack from '../../hooks/useMobileBack'\nimport browser from '../../services/browser'\nimport { emit } from '../../services/Controller'\nimport { State } from '../../store'\nimport { Dispatch } from '../../store'\nimport { makeStyles } from '@mui/styles'\nimport { useMediaQuery } from '@mui/material'\nimport { selectDeviceModelAttributes } from '../../selectors/devices'\nimport { selectPermissions } from '../../selectors/organizations'\nimport { useLocation, Switch, Route } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { HeaderDeviceOptionMenu } from '../HeaderDeviceOptionMenu'\nimport { ScriptDeleteButton } from '../ScriptDeleteButton'\nimport { UpgradeNotice } from '../UpgradeNotice'\nimport { ColumnsButton } from '../../buttons/ColumnsButton'\nimport { RefreshButton } from '../../buttons/RefreshButton'\nimport { GlobalSearch } from '../GlobalSearch'\nimport { FilterButton } from '../../buttons/FilterButton'\nimport { IconButton } from '../../buttons/IconButton'\nimport { spacing } from '../../styling'\nimport { Title } from '../Title'\nimport { Pre } from '../Pre'\n\nexport const Header: React.FC = () => {\n const { searched } = useSelector(selectDeviceModelAttributes)\n const permissions = useSelector(selectPermissions)\n const canNavigate = useSelector((state: State) => state.backend.canNavigate)\n const layout = useSelector((state: State) => state.ui.layout)\n\n const mobileGoBack = useMobileBack()\n const [showSearch, setShowSearch] = useState(false)\n const sidebarHidden = useMediaQuery(`(max-width:${HIDE_SIDEBAR_WIDTH}px)`)\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const inputRef = useRef(null)\n const dispatch = useDispatch()\n const location = useLocation()\n const css = useStyles()\n\n const manager = permissions.includes('MANAGE')\n const menu = location.pathname.match(REGEX_FIRST_PATH)?.[0]\n const isRootMenu = menu === location.pathname\n\n return (\n <>\n
\n {sidebarHidden && (layout.singlePanel ? isRootMenu : true) && menu !== '/add' && (\n dispatch.ui.set({ sidebarMenu: true })} />\n )}\n {(layout.hideSidebar || browser.isMobile) && (\n <>\n \n \n \n {!isRootMenu && }\n \n )}\n {!(showSearch || searched) && browser.isElectron && !layout.hideSidebar && (\n <>\n emit('navigate', 'BACK')}\n icon=\"chevron-left\"\n size=\"md\"\n color={canNavigate.canGoBack ? 'grayDarker' : 'grayLight'}\n />\n emit('navigate', 'FORWARD')}\n icon=\"chevron-right\"\n size=\"md\"\n color={canNavigate.canGoForward ? 'grayDarker' : 'grayLight'}\n />\n \n )}\n {!showSearch && }\n \n {!showSearch && !searched && (\n {\n setShowSearch(true)\n setTimeout(() => inputRef.current?.focus(), 20)\n }}\n />\n )}\n {(!!showSearch || searched) && setShowSearch(false)} />}\n \n \n {!(showSearch && mobile) && (\n <>\n <Route path={['/devices', '/devices/select']} exact>\n <FilterButton />\n {!mobile && <ColumnsButton />}\n </Route>\n {manager && (\n <Switch>\n <Route path=\"/devices\" exact>\n <IconButton to=\"/devices/select\" icon=\"check-square\" title=\"Show Select\" />\n </Route>\n <Route path=\"/devices/select\" exact>\n <IconButton to=\"/devices\" icon=\"check-square\" type=\"solid\" color=\"primary\" title=\"Hide Select\" />\n </Route>\n </Switch>\n )}\n {!showSearch && (\n <Route path=\"/devices/:deviceID/:serviceID?\">\n <HeaderDeviceOptionMenu />\n </Route>\n )}\n <Route path=\"/script/:fileID/:jobID\">\n <ScriptDeleteButton />\n </Route>\n </>\n )}\n </div>\n <UpgradeNotice />\n </>\n )\n}\n\nconst useStyles = makeStyles({\n header: {\n display: 'flex',\n margin: `${spacing.sm}px 0 0`,\n padding: `0 ${spacing.md}px`,\n justifyContent: 'flex-start',\n alignItems: 'center',\n height: 45,\n maxHeight: 45,\n width: '100%',\n zIndex: 14,\n },\n search: {\n // flexGrow: 1,\n zIndex: 1,\n },\n noDrag: {\n WebkitAppRegion: 'no-drag',\n },\n selected: {\n marginRight: spacing.sm,\n marginLeft: spacing.sm,\n },\n})\n","import React from 'react'\nimport { Box } from '@mui/material'\nimport { Header } from './Header'\n\ntype Props = { layout: ILayout; header?: boolean; children?: React.ReactNode }\n\nexport const Panel: React.FC<Props> = ({ layout, header = true, children }) => {\n return (\n <Box\n sx={{\n flexGrow: 1,\n height: '100%',\n width: `calc(100% - ${layout.sidePanelWidth}px)`,\n display: 'flex',\n flexDirection: 'column',\n contain: 'content',\n margin: 'auto',\n // for iOS mobile\n paddingTop: layout.insets?.topPx,\n paddingBottom: layout.showBottomMenu ? 0 : layout.insets?.bottomPx,\n paddingLeft: layout.hideSidebar ? layout.insets?.leftPx : 0,\n paddingRight: layout.insets?.rightPx,\n }}\n >\n {header && <Header />}\n {children}\n </Box>\n )\n}","import React from 'react'\nimport browser from '../../services/browser'\nimport { IP_PRIVATE } from '@common/constants'\nimport { Typography } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { SignInApp } from '../../components/SignInApp'\nimport { Panel } from '../../components/Panel'\nimport { Body } from '../../components/Body'\nimport { Icon } from '../../components/Icon'\nimport { Link } from '../../components/Link'\nimport { spacing } from '../../styling'\n\ntype Props = {\n layout: ILayout\n}\n\nexport function SignInPage({ layout }: Props) {\n const short = browser.isAndroid || browser.isAndroidBrowser\n const css = useStyles({ short })\n const { hostname, protocol } = window.location\n const allowSwitch =\n !browser.isElectron && !browser.isMobile && hostname !== 'localhost' && hostname !== IP_PRIVATE && hostname\n const secure: boolean = protocol.includes('https')\n const switchUrl = secure ? `http://${hostname}:29999` : `https://${hostname}:29998`\n\n return (\n <Panel layout={layout} header={false}>\n <Body className={css.body} center={!short}>\n <SignInApp />\n {allowSwitch && !secure && (\n <div className={css.insecure}>\n <Typography variant=\"body2\" align=\"center\">\n On an insecure network?\n <Link href={switchUrl}>\n <Icon name=\"lock\" type=\"solid\" size=\"xs\" inlineLeft inline />\n Use secure session\n </Link>\n </Typography>\n <Typography variant=\"caption\">\n You will be prompted by your browser with a security message regarding the remoteitpi.local certificate.\n This is normal for local connections.\n <br /> Your data is still encrypted.\n <Link href=\"https://link.remote.it/documentation-desktop/https-connections\">Learn more</Link>\n </Typography>\n </div>\n )}\n </Body>\n </Panel>\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n body: ({ short }: { short: boolean }) => ({\n paddingTop: short ? 20 : 0,\n paddingBottom: short ? '50vh' : 0,\n '& > div': { maxWidth: 440 },\n }),\n insecure: {\n marginTop: spacing.xl,\n margin: `${spacing.xs}px auto`,\n textAlign: 'center',\n lineHeight: '1em',\n '& > a': { color: palette.success.main },\n },\n}))\n","import React from 'react'\nimport { REGEX_FIRST_PATH } from '../constants'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { Box, BottomNavigation, BottomNavigationAction, Badge } from '@mui/material'\nimport { useCounts } from '../hooks/useCounts'\nimport { Icon } from './Icon'\n\ntype Props = {\n layout: ILayout\n}\n\nexport const BottomMenu: React.FC<Props> = ({ layout }) => {\n const location = useLocation()\n const history = useHistory()\n const counts = useCounts()\n\n const menu = location.pathname.match(REGEX_FIRST_PATH)?.[0] || '/devices'\n\n return (\n <Box\n sx={{\n borderTop: '1px solid',\n borderColor: layout.mobile ? 'transparent' : 'grayLighter.main',\n paddingBottom: layout.insets.bottom ? layout.insets.bottom + 'px' : 0,\n '& .MuiBadge-badge': {\n top: -2,\n right: -10,\n },\n }}\n >\n <BottomNavigation value={menu} onChange={(_, value) => history.push(value)}>\n <BottomNavigationAction\n label=\"Connections\"\n icon={\n <Badge badgeContent={counts.active} color=\"primary\">\n <Icon size=\"md\" name=\"arrow-right-arrow-left\" />\n </Badge>\n }\n value=\"/connections\"\n />\n <BottomNavigationAction label=\"Devices\" icon={<Icon size=\"md\" name=\"router\" />} value=\"/devices\" />\n <BottomNavigationAction label=\"Networks\" icon={<Icon size=\"md\" name=\"chart-network\" />} value=\"/networks\" />\n </BottomNavigation>\n </Box>\n )\n}\n","import { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { REGEX_FIRST_PATH } from '../constants'\n\nconst getDepth = (path: string) => {\n return path.split('/').filter(Boolean).length\n}\n\nconst useMobileNavigation = () => {\n const customHistory = useSelector((state: State) => state.ui.mobileNavigation)\n const dispatch = useDispatch<Dispatch>()\n const { pathname, state } = useLocation<{ isRedirect?: boolean }>()\n\n const init = () => {\n const currentDepth = getDepth(pathname)\n const menu = pathname.match(REGEX_FIRST_PATH)?.[0] || '/'\n const nextHistory: string[] = []\n\n if (currentDepth > 1) {\n nextHistory.push(menu)\n }\n\n nextHistory.push(pathname)\n console.log('MOBILE NAVIGATION init', nextHistory, pathname)\n dispatch.ui.set({ mobileNavigation: nextHistory })\n }\n\n useEffect(() => {\n if (!customHistory.length) {\n init()\n return\n }\n\n let nextHistory = [...customHistory]\n const menu = pathname.match(REGEX_FIRST_PATH)?.[0] || '/'\n const currentDepth = getDepth(pathname)\n\n if (pathname === menu) {\n // if the next location is a root menu, reset the history\n // if (menu !== nextHistory[0]) {\n // If the menu has changed, reset the history\n // @TODO see if we can improve this so it doesn't reset when not navigating to a root menu\n nextHistory = [menu]\n } else if (currentDepth === 1) {\n // If at the root, replace the last entry\n nextHistory = [pathname]\n }\n\n const lastDepth = nextHistory.length ? getDepth(nextHistory[nextHistory.length - 1]) : 0\n\n if (state?.isRedirect || currentDepth === lastDepth) {\n // If the last navigation was a redirect, or at the same depth replace the last entry\n nextHistory[nextHistory.length - 1] = pathname\n } else if (currentDepth < lastDepth) {\n // Remove the last entry if going up\n nextHistory.pop()\n } else {\n // Otherwise, push a new entry\n nextHistory.push(pathname)\n }\n\n if (!nextHistory.length) {\n nextHistory.push(pathname)\n }\n\n if (state?.isRedirect) console.log('MOBILE NAVIGATION isRedirect', pathname)\n\n dispatch.ui.set({ mobileNavigation: nextHistory })\n }, [dispatch, pathname])\n}\n\nexport default useMobileNavigation\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { ListItemButtonProps, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'\nimport { Icon } from './Icon'\n\nexport type Props = ListItemButtonProps & {\n to: string\n title?: string\n}\n\nexport const ListItemBack: React.FC<Props> = ({ to, title, children, ...props }) => {\n const history = useHistory()\n return (\n <ListItemButton dense disableGutters {...props} onClick={() => history.push(to)}>\n <ListItemIcon>\n <Icon name=\"angle-left\" size=\"md\" fixedWidth />\n </ListItemIcon>\n <ListItemText primary={title || 'Back'} />\n {children}\n </ListItemButton>\n )\n}\n","import React from 'react'\nimport classnames from 'classnames'\nimport { Divider } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { spacing, radius } from '../../styling'\nimport { Body, BodyProps } from '../Body'\n\ntype Props = {\n header?: React.ReactNode\n drawer?: React.ReactNode\n footer?: React.ReactNode\n integrated?: boolean\n bodyProps?: BodyProps\n bodyRef?: React.RefObject<HTMLDivElement>\n gutterBottom?: boolean\n backgroundColor?: Color\n className?: string\n children?: React.ReactNode\n}\n\nexport const Container: React.FC<Props> = ({\n header,\n drawer,\n footer,\n integrated,\n bodyProps,\n bodyRef,\n gutterBottom,\n backgroundColor,\n className,\n children,\n}) => {\n const css = useStyles({ backgroundColor })\n return (\n <div className={classnames(className, css.container)}>\n {header && (\n <div className={css.header}>\n {header}\n {integrated || !!backgroundColor || <Divider variant=\"inset\" />}\n </div>\n )}\n {drawer && <div className={css.drawer}>{drawer}</div>}\n <Body bodyRef={bodyRef} {...bodyProps} gutterBottom={gutterBottom} scrollbarBackground={backgroundColor}>\n {children}\n </Body>\n {footer && (\n <div className={css.footer}>\n <Divider variant=\"inset\" />\n {footer}\n </div>\n )}\n </div>\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n container: ({ backgroundColor }: any) => ({\n backgroundColor: backgroundColor ? palette[backgroundColor].main : palette.white.main,\n display: 'flex',\n alignItems: 'stretch',\n flexFlow: 'column',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n }),\n header: ({ backgroundColor }: any) => ({\n position: 'relative',\n zIndex: 10,\n backgroundColor: palette.white.main,\n borderBottom: backgroundColor && `1px solid ${palette.grayLighter.main}`,\n '& .MuiTypography-h1': {\n display: 'flex',\n padding: `${spacing.xxs}px ${spacing.xl - 8}px ${spacing.xxs}px ${spacing.xl}px`,\n },\n }),\n drawer: {\n display: 'flex',\n flexFlow: 'row',\n flexGrow: 1,\n overflow: 'hidden',\n position: 'absolute',\n height: '100%',\n borderTopLeftRadius: radius.lg,\n backgroundColor: palette.white.main,\n boxShadow: `0 3px 5px ${palette.shadow.main}`,\n right: 0,\n zIndex: 12,\n },\n footer: {\n position: 'relative',\n zIndex: 7,\n },\n}))\n","import React from 'react'\nimport { Redirect, useHistory } from 'react-router-dom'\nimport { List, ListItemSecondaryAction, Typography, Chip, Box, Button } from '@mui/material'\nimport { selectPermissions, selectLimitsLookup, selectOrganization } from '../selectors/organizations'\nimport { State } from '../store'\nimport { ListItemLocation } from '../components/ListItemLocation'\nimport { useSelector } from 'react-redux'\nimport { ListItemBack } from '../components/ListItemBack'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from '../components/Container'\nimport { MobileUI } from '../components/MobileUI'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\nimport { Icon } from '../components/Icon'\n\nexport const OrganizationRolesPage: React.FC = () => {\n const history = useHistory()\n const { name, roles, members, limits, permissions } = useSelector((state: State) => ({\n ...selectOrganization(state),\n limits: selectLimitsLookup(state),\n permissions: selectPermissions(state),\n }))\n\n if (!permissions.includes('ADMIN'))\n return <Redirect to={{ pathname: '/organization', state: { isRedirect: true } }} />\n\n return (\n <Container\n gutterBottom\n header={\n <>\n <Typography variant=\"h1\">\n <Title>Roles\n \n \n \n \n \n \n \n }\n >\n {!limits.roles && (\n \n Upgrade your plan to Business to add custom roles.\n history.push('/account/plans')}\n sx={{ display: 'block', marginTop: 1, marginBottom: 1 }}\n >\n Upgrade\n \n \n )}\n \n Role\n {limits.roles && }\n \n \n {roles.map(r => {\n if (r.disabled) return null\n const count = members.filter(m => m.roleId === r.id).length\n return (\n \n {r.system && }\n {r.name}\n \n }\n to={`/organization/roles/${r.id}`}\n exactMatch\n disableIcon\n dense\n >\n \n history.push('/organization/members')}\n />\n \n \n )\n })}\n \n \n )\n}\n","import React from 'react'\nimport { PERMISSION } from '../models/organization'\nimport { ListItemSetting } from './ListItemSetting'\n\ntype Props = {\n permissions: string[]\n allowed: IPermission[]\n locked?: boolean\n disabled?: boolean\n onChange: (toggle: boolean, permission: IPermission) => void\n}\n\nexport const PermissionsList: React.FC = ({ permissions, allowed, locked, disabled, onChange }) => {\n return (\n <>\n {permissions.map(p => {\n const permission = p as IPermission\n const toggle = allowed.includes(permission)\n return (\n onChange(toggle, permission)}\n />\n )\n })}\n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Stack, Chip } from '@mui/material'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\n\ntype Props = {\n role: Partial\n}\n\nexport const RoleAccessCounts: React.FC = ({ role }) => {\n const dispatch = useDispatch()\n const [loading, setLoading] = useState(true)\n const [counts, setCounts] = useState<{ devices: number; networks: number } | null>(null)\n\n useEffect(() => {\n ;(async () => {\n setLoading(true)\n const devices = await dispatch.devices.fetchCount(role)\n const networks = await dispatch.networks.fetchCount(role)\n setCounts({ devices, networks })\n setLoading(false)\n })()\n }, [role.permissions, role.access, role.tag])\n\n return counts === null ? (\n \n ) : (\n \n \n \n \n )\n}\n","import React from 'react'\nimport reactStringReplace from 'react-string-replace'\nimport escapeRegexp from 'escape-string-regexp'\nimport { makeStyles } from '@mui/styles'\nimport {\n Box,\n MenuItem,\n ListItemIcon,\n ListItemText,\n Paper,\n Popper,\n PopperProps,\n TextField,\n TextFieldProps,\n Autocomplete,\n} from '@mui/material'\nimport { spacing, radius, fontSizes } from '../styling'\nimport { REGEX_TAG_SAFE } from '../constants'\nimport { tagsInclude } from '../helpers/utilHelper'\nimport { Icon } from './Icon'\n\ninterface Props {\n open: boolean\n items: ITag[]\n filter?: ITag[]\n targetEl: Element | null\n placeholder: string\n allowAdding?: boolean\n createOnly?: boolean\n indicator?: string\n hideIcons?: boolean\n InputProps?: TextFieldProps['InputProps']\n onItemColor?: (value: ITag) => string\n onSelect?: (action: 'add' | 'new', value: ITag) => void\n onChange?: (value?: string) => void\n onClose?: () => void\n}\n\nexport const TagAutocomplete: React.FC = ({\n open,\n items,\n filter = [],\n placeholder,\n indicator,\n targetEl,\n onItemColor,\n onSelect,\n onChange,\n onClose,\n hideIcons,\n allowAdding,\n createOnly,\n InputProps = {},\n}) => {\n const [inputValue, setInputValue] = React.useState('')\n const css = useStyles()\n const matched = tagsInclude(items, inputValue)\n items = createOnly ? [] : items.filter(i => !tagsInclude(filter, i.name))\n const exists = tagsInclude(filter, inputValue)\n const disabled = (createOnly && matched) || exists\n const options = exists\n ? items.concat({\n name: `${inputValue} already tagged`,\n color: 0,\n })\n : disabled\n ? items.concat({\n name: `${inputValue} already exists`,\n color: 0,\n })\n : allowAdding && inputValue.length && !matched\n ? items.concat({\n name: `Add: ${inputValue}`,\n color: 0,\n })\n : items\n\n if (!targetEl) return null\n\n return (\n \n \n {\n if (!value || !onSelect || disabled) return\n if (value.created) onSelect('add', value)\n else onSelect('new', { name: inputValue, color: value.color, created: new Date() })\n }}\n isOptionEqualToValue={(option, value) => option.name === value.name || !option.created}\n PopperComponent={BoxComponent}\n noOptionsText={false}\n getOptionLabel={option => option.name || ''}\n onInputChange={(event, newValue) => {\n const result = newValue.replace(REGEX_TAG_SAFE, '')\n setInputValue(result)\n if (onChange) onChange(result)\n }}\n renderOption={(props, option) => (\n \n {hideIcons ? (\n <>     \n ) : (\n \n \n \n )}\n (\n \n {match}\n \n )\n )}\n />\n \n )}\n renderInput={params => (\n \n )}\n />\n \n \n )\n}\n\ntype BoxProps = Omit\n\nexport const BoxComponent: React.FC = ({ className, children, placement }) => (\n \n {typeof children === 'function' ? children({ placement: placement || 'auto' }) : children}\n \n)\n\nconst useStyles = makeStyles(({ palette }) => ({\n inputContainer: {\n minWidth: 200,\n backgroundColor: palette.grayLightest.main,\n '& .MuiAutocomplete-root .MuiFilledInput-root': { padding: 0 },\n },\n input: {\n margin: 0,\n padding: `${spacing.xs}px ${spacing.xs}px 0`,\n '& .MuiFilledInput-input.MuiAutocomplete-input': {\n padding: `${spacing.xs}px ${spacing.sm}px`,\n fontSize: fontSizes.base,\n color: palette.grayDarkest.main,\n },\n },\n popper: {\n width: '100%',\n position: 'relative',\n },\n popperPaper: {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n boxShadow: 'none',\n },\n listbox: {\n paddingTop: spacing.xxs,\n paddingBottom: spacing.xxs,\n backgroundColor: palette.grayLightest.main,\n },\n empty: {\n display: 'none',\n },\n spanItem: {\n color: palette.primary.main,\n fontWeight: 500,\n },\n option: {\n '&.MuiAutocomplete-option': {\n borderRadius: radius.sm,\n marginLeft: spacing.xs,\n marginRight: spacing.xs,\n marginBottom: 1,\n paddingLeft: 2,\n paddingRight: 2,\n minHeight: 20,\n color: palette.grayDarker.main,\n '&.Mui-focused': { backgroundColor: palette.primaryHighlight.main },\n '&.Mui-selected': { backgroundColor: palette.primaryHighlight.main },\n '& .MuiListItemText-primary': { fontSize: fontSizes.sm },\n '& .MuiListItemIcon-root': { minWidth: 40 },\n },\n },\n}))\n","import React, { useEffect } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Chip, Tooltip } from '@mui/material'\nimport { TagAutocomplete } from './TagAutocomplete'\nimport { IconButton, ButtonProps } from '../buttons/IconButton'\nimport { useLabel } from '../hooks/useLabel'\nimport { Icon } from './Icon'\n\ntype Props = {\n tags?: ITag[]\n filter?: ITag[]\n label?: string\n placeholder?: string\n allowAdding?: boolean\n hideIcons?: boolean\n createOnly?: boolean\n button?: string\n buttonProps?: ButtonProps\n disabled?: boolean\n keyboardShortcut?: boolean\n onCreate?: (tag: ITag) => void\n onSelect?: (tag: ITag) => void\n}\n\nexport const TagEditor: React.FC = ({\n tags = [],\n filter = [],\n label = 'TAG',\n placeholder = 'New tag...',\n allowAdding = true,\n hideIcons,\n createOnly,\n button,\n buttonProps,\n disabled,\n keyboardShortcut = true,\n onCreate,\n onSelect,\n}) => {\n const getColor = useLabel()\n const [open, setOpen] = React.useState(false)\n const [creating, setCreating] = React.useState(false)\n const buttonRef = React.useRef(null)\n const chipRef = React.useRef(null)\n const css = useStyles()\n\n const handleOpen = () => setOpen(!open)\n const handleClose = () => setOpen(false)\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === '#') {\n event.preventDefault()\n handleOpen()\n }\n }\n\n useEffect(() => {\n if (keyboardShortcut) window.addEventListener('keydown', onKeyDown)\n return () => {\n if (keyboardShortcut) window.removeEventListener('keydown', onKeyDown)\n }\n }, [])\n\n return (\n <>\n {button ? (\n \n ) : (\n \n \n {label}\n \n }\n className={css.chip}\n size=\"small\"\n onClick={handleOpen}\n ref={chipRef}\n />\n )}\n getColor(tag.color)}\n onClose={handleClose}\n allowAdding={allowAdding}\n InputProps={{\n endAdornment: keyboardShortcut && (\n \n \n \n ),\n }}\n onSelect={async (action, tag) => {\n if (action === 'new') {\n setCreating(true)\n await onCreate?.(tag)\n setCreating(false)\n }\n await onSelect?.(tag)\n }}\n />\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n chip: { fontWeight: 500, letterSpacing: 1, color: palette.grayDarker.main },\n}))\n","import React from 'react'\nimport structuredClone from '@ungap/structured-clone'\nimport { Dispatch } from '../store'\nimport { useHistory } from 'react-router-dom'\nimport { DEFAULT_ROLE } from '../models/organization'\nimport {\n SxProps,\n Theme,\n Box,\n Chip,\n Stack,\n Typography,\n ListItem,\n ListItemIcon,\n ListItemProps,\n ListItemSecondaryAction,\n MenuItem,\n TextField,\n} from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { RoleAccessCounts } from './RoleAccessCounts'\nimport { selectTags } from '../selectors/tags'\nimport { TagEditor } from './TagEditor'\nimport { ColorChip } from './ColorChip'\nimport { Tags } from './Tags'\nimport { Icon } from './Icon'\n// import { Pre } from './Pre'\n\ntype Props = ListItemProps & {\n form: Partial\n name?: string\n disabled?: boolean\n systemRole?: boolean\n icon?: boolean\n selectedIds?: string[]\n countsSx?: SxProps\n selectAll?: boolean\n selectDevices?: boolean\n onSelectIds?: () => void\n onChange: (form: Partial) => void\n}\n\nexport const TagFilter: React.FC = ({\n form,\n name = 'Access',\n disabled,\n systemRole,\n icon,\n selectedIds,\n countsSx,\n onChange,\n selectAll,\n selectDevices,\n onSelectIds,\n ...props\n}) => {\n const dispatch = useDispatch()\n const history = useHistory()\n const tags = useSelector(selectTags)\n const filteredTags = tags.filter(t => form.tag?.values.includes(t.name))\n\n // Handle empty states\n let formAccess = form.access\n if (formAccess === 'CUSTOM' && !form.deviceIds?.length) formAccess = 'NONE'\n if (formAccess === 'ALL' && !selectAll) formAccess = 'NONE'\n\n return (\n <>\n \n {icon && (\n \n \n \n )}\n {\n let tag: ITagFilter | undefined\n const access = event.target.value as IRoleAccess\n if (access === 'TAG') tag = structuredClone(DEFAULT_ROLE.tag)\n onChange({ ...form, access, tag })\n if (access === 'SELECTED') onSelectIds?.()\n }}\n >\n None\n {selectAll && All}\n Tagged\n {selectDevices && {selectedIds?.length ? 'Selected' : 'Select'} Devices}\n {form.deviceIds?.length && Saved Devices}\n \n \n {formAccess === 'CUSTOM' && form.deviceIds?.length ? (\n 1 ? 's' : ''}`} />\n ) : formAccess === 'SELECTED' && selectedIds?.length ? (\n onSelectIds?.()}\n />\n ) : formAccess === 'SELECTED' ? (\n onSelectIds?.()}\n />\n ) : formAccess === 'NONE' ? (\n \n ) : (\n \n )}\n \n \n {formAccess === 'TAG' && (\n \n {icon && }\n \n {\n let tag = structuredClone(form.tag || DEFAULT_ROLE.tag) as ITagFilter\n if (!tag.values) return\n const index = tag.values.indexOf(name)\n tag.values.splice(index, 1)\n form.tag = tag\n onChange(form)\n }}\n onClick={tag => {\n dispatch.devices.set({ tag: { values: [tag.name], operator: tag.operator } })\n dispatch.devices.fetchList()\n history.push('/devices')\n }}\n />\n \n \n await dispatch.tags.create({ tag })}\n onSelect={tag => {\n const formTag = structuredClone(form.tag || DEFAULT_ROLE.tag)\n formTag.values.push(tag.name)\n onChange({ ...form, tag: formTag })\n }}\n tags={tags}\n filter={filteredTags}\n />\n \n \n Match:  \n {\n form.tag && (form.tag.operator = event.target.value as ITagOperator)\n onChange(form)\n }}\n >\n \n Any\n \n \n All\n \n \n \n \n )}\n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport isEqual from 'lodash.isequal'\nimport structuredClone from '@ungap/structured-clone'\nimport { makeStyles } from '@mui/styles'\nimport { useParams } from 'react-router-dom'\nimport { DEFAULT_ROLE, PERMISSION } from '../models/organization'\nimport { selectOrganization } from '../selectors/organizations'\nimport { Button, Typography, List, ListItem, ListItemIcon, TextField } from '@mui/material'\nimport { Dispatch, State } from '../store'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { PermissionsList } from '../components/PermissionsList'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { Container } from '../components/Container'\nimport { TagFilter } from '../components/TagFilter'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\nimport { Icon } from '../components/Icon'\n\nconst NAME_MAX_LENGTH = 64\n\nexport const OrganizationRolePage: React.FC = () => {\n const { roleID } = useParams<{ roleID?: string }>()\n const dispatch = useDispatch()\n const css = useStyles()\n const disabled = useSelector((state: State) => state.organization.updating)\n const roles = useSelector((state: State) => selectOrganization(state).roles)\n const role = structuredClone(roles?.find(r => r.id === roleID) || DEFAULT_ROLE)\n const [form, setForm] = useState(role)\n const [saving, setSaving] = useState(false)\n const systemRole = !!role.system\n const changed = !isEqual(form, role)\n\n const changeForm = async (changedForm: Partial) => setForm({ ...form, ...changedForm })\n const handlePermissionChange = (toggle, permission) => {\n if (toggle) {\n setForm({ ...form, permissions: form.permissions.filter(fp => fp !== permission) })\n } else {\n setForm({ ...form, permissions: [...form.permissions, permission] })\n }\n }\n\n useEffect(() => {\n changeForm(role)\n }, [roleID])\n\n return (\n \n {role.name || 'New Role'}\n {!systemRole && role.id && (\n \n \n You will be permanently deleting the role {role.name}.\n \n Any members with this role will lose access until they have been set to another role.\n \n }\n onDelete={async () => await dispatch.organization.removeRole(form)}\n />\n )}\n \n }\n >\n \n {systemRole && (\n \n System roles cannot be modified.\n \n )}\n \n \n \n \n {\n const name = event.target.value.substring(0, NAME_MAX_LENGTH)\n setForm({ ...form, name })\n }}\n />\n \n \n User Permissions\n \n PERMISSION[p].user)}\n onChange={handlePermissionChange}\n />\n \n Device and Network Permissions\n \n \n {form.access !== 'NONE' && (\n !PERMISSION[p].user && !PERMISSION[p].hidden)}\n onChange={handlePermissionChange}\n />\n )}\n \n {!systemRole && (\n \n {\n setSaving(true)\n if (form.tag && form.tag.values.length === 0) form.tag = undefined\n if (!form.tag && form.access === 'TAG') form.access = 'NONE'\n await dispatch.organization.setRole(form)\n setSaving(false)\n changeForm(form)\n }}\n >\n {saving ? 'Saving...' : changed ? 'Save' : 'Saved'}\n \n \n )}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n form: {\n '& .MuiTextField-root': { maxWidth: 400 },\n '& .MuiListItem-secondaryAction': { paddingRight: 130 },\n },\n button: { fontWeight: 500, letterSpacing: 1, color: palette.grayDarker.main },\n}))\n","// import React from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { REGEX_FIRST_PATH } from '../constants'\nimport { useLocation } from 'react-router-dom'\n\nexport function usePanelWidth(): [number, (value: number) => void] {\n const { ui } = useDispatch()\n const location = useLocation()\n\n const match = location.pathname.match(REGEX_FIRST_PATH)\n const resize = match ? match[0].substring(1) : ''\n const panelWidth = useSelector((state: State) => state.ui.panelWidth)\n\n const setPanelWidth = (value: number) => {\n console.log('setPanelWidth', resize, value)\n ui.setPersistent({ panelWidth: { ...panelWidth, [resize]: value } })\n }\n\n return [panelWidth[resize] || 9999, setPanelWidth]\n}\n","import React, { useRef, useState, useEffect } from 'react'\nimport { usePanelWidth } from '../hooks/usePanelWidth'\nimport { makeStyles } from '@mui/styles'\nimport { Header } from './Header'\nimport classnames from 'classnames'\n\ntype Props = {\n primary: React.ReactNode\n secondary?: React.ReactNode\n layout: ILayout\n}\n\nconst MIN_WIDTH = 250\nconst PADDING = 9\n\nexport const DoublePanel: React.FC = ({ primary, secondary, layout }) => {\n const [panelWidth, setPanelWidth] = usePanelWidth()\n const handleRef = useRef(panelWidth)\n const primaryRef = useRef(null)\n const moveRef = useRef(0)\n const [width, setWidth] = useState(panelWidth)\n const [parentWidth, setParentWidth] = useState()\n const [grab, setGrab] = useState(false)\n const css = useStyles({ layout })\n\n const sidePanelWidth = layout.sidePanelWidth + PADDING\n\n const onMove = (event: MouseEvent) => {\n const fullWidth = primaryRef.current?.parentElement?.offsetWidth || 1000\n handleRef.current += event.clientX - moveRef.current\n moveRef.current = event.clientX\n if (handleRef.current > MIN_WIDTH && handleRef.current < fullWidth - MIN_WIDTH - sidePanelWidth) {\n setWidth(handleRef.current)\n }\n }\n\n const measure = () => {\n const parent = (primaryRef.current?.parentElement?.offsetWidth || 1000) - sidePanelWidth\n setParentWidth(parent)\n if (width < MIN_WIDTH) setWidth(MIN_WIDTH)\n else if (width > parent - MIN_WIDTH) setWidth(parent - MIN_WIDTH)\n }\n\n const onDown = (event: React.MouseEvent) => {\n setGrab(true)\n measure()\n moveRef.current = event.clientX\n handleRef.current = primaryRef.current?.offsetWidth || width\n event.preventDefault()\n window.addEventListener('mousemove', onMove)\n window.addEventListener('mouseup', onUp)\n }\n\n const onUp = (event: MouseEvent) => {\n setGrab(false)\n event.preventDefault()\n window.removeEventListener('mousemove', onMove)\n window.removeEventListener('mouseup', onUp)\n setPanelWidth(primaryRef.current?.offsetWidth || width)\n }\n\n useEffect(() => {\n setWidth(panelWidth)\n }, [panelWidth])\n\n useEffect(() => {\n measure()\n window.addEventListener('resize', measure)\n return function cleanup() {\n window.removeEventListener('resize', measure)\n }\n }, [layout])\n\n return (\n <>\n
\n
\n {primary}\n
\n
\n
\n
\n
\n
\n \n {secondary}\n
\n \n )\n}\n\ntype StyleProps = {\n layout: ILayout\n}\n\nconst useStyles = makeStyles(({ palette, spacing }) => ({\n panel: ({ layout }: StyleProps) => ({\n height: '100%',\n display: 'flex',\n flexDirection: 'column',\n contain: 'content',\n // for iOS mobile\n paddingTop: layout.insets?.topPx,\n paddingBottom: layout.showBottomMenu ? 0 : layout.insets?.bottomPx,\n }),\n primary: ({ layout }: StyleProps) => ({\n // for iOS mobile\n paddingLeft: layout.hideSidebar ? layout.insets?.leftPx : 0,\n }),\n secondary: ({ layout }: StyleProps) => ({\n flexGrow: 1,\n flexShrink: 10,\n paddingTop: spacing(3),\n // for iOS mobile\n paddingRight: layout.insets?.rightPx,\n }),\n anchor: {\n position: 'relative',\n height: '100%',\n },\n handle: {\n zIndex: 8,\n position: 'absolute',\n height: '100%',\n marginLeft: -5,\n padding: `0 ${spacing(0.375)}px`,\n WebkitAppRegion: 'no-drag',\n '&:hover': {\n cursor: 'col-resize',\n },\n '& > div': {\n width: 1,\n marginLeft: 1,\n marginRight: 1,\n height: '100%',\n backgroundColor: palette.grayLighter.main,\n transition: 'background-color 100ms 200ms, width 100ms 200ms, margin 100ms 200ms',\n },\n '&:hover > div, & .active': {\n width: 3,\n marginLeft: 0,\n marginRight: 0,\n backgroundColor: palette.primary.main,\n },\n },\n}))\n","import React from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\nimport { DoublePanel } from './DoublePanel'\nimport { Panel } from './Panel'\n\ntype Props = {\n primary: React.ReactNode\n secondary?: React.ReactNode\n layout: ILayout\n root?: string | string[]\n}\n\nexport const DynamicPanel: React.FC = ({ root, ...props }) => {\n const location = useLocation()\n const match = matchPath(location.pathname, { path: root, exact: true })\n\n if (props.layout.singlePanel || !props.secondary) {\n return {match ? props.primary : props.secondary}\n }\n\n return \n}\n","import React from 'react'\nimport { Switch, Route, Redirect } from 'react-router-dom'\nimport { State } from '../store'\nimport { selectOrganization } from '../selectors/organizations'\nimport { OrganizationRolesPage } from '../pages/OrganizationRolesPage'\nimport { OrganizationRolePage } from '../pages/OrganizationRolePage'\nimport { DynamicPanel } from '../components/DynamicPanel'\nimport { useSelector } from 'react-redux'\n\nexport const RolesRouter: React.FC<{ layout: ILayout }> = ({ layout }) => {\n const organization = useSelector((state: State) => selectOrganization(state))\n\n return (\n }\n secondary={\n \n \n \n \n \n !r.disabled)?.id}`,\n state: { isRedirect: true },\n }}\n />\n \n \n }\n layout={layout}\n root=\"/organization/roles\"\n />\n )\n}\n","import React from 'react'\nimport { Link } from '../Link'\nimport { State } from '../../store'\nimport { Tooltip } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { useSelector } from 'react-redux'\nimport { spacing, fontSizes } from '../../styling'\n\nexport const OutOfBand: React.FC<{ inline?: boolean }> = ({ inline }) => {\n const css = useStyles()\n const available = useSelector((state: State) => state.backend.environment.oobAvailable)\n const active = useSelector((state: State) => state.backend.interfaces.length > 1)\n\n if (!available) return null\n\n return (\n \n \n \n
\n \n Out of Band\n
\n \n
\n
\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n container: {\n top: spacing.xs,\n right: spacing.lg,\n position: 'absolute',\n zIndex: 3,\n },\n oob: {\n border: `1px solid ${palette.grayLight.main}`,\n padding: `${spacing.xxs}px ${spacing.sm}px`,\n borderRadius: spacing.xs,\n display: 'inline-flex',\n color: palette.gray.main,\n alignItems: 'center',\n '& small': {\n fontWeight: 400,\n fontSize: fontSizes.xxs,\n textTransform: 'uppercase',\n letterSpacing: 1,\n },\n '& span': {\n width: spacing.xs,\n height: spacing.xs,\n borderRadius: '50%',\n display: 'block',\n marginRight: spacing.xs,\n backgroundColor: palette.grayLight.main,\n },\n },\n active: {\n border: 0,\n backgroundColor: palette.primary.main,\n color: palette.white.main,\n '& small': {\n fontWeight: 500,\n },\n '& span': {\n backgroundColor: palette.white.main,\n boxShadow: `0 0 8px ${palette.white.main}`,\n },\n },\n}))\n","import React, { useState } from 'react'\nimport {\n List,\n ListItem,\n ListItemButton,\n ListItemText,\n ListItemIcon,\n ListItemSecondaryAction,\n IconButton,\n Collapse,\n Button,\n Chip,\n Typography,\n} from '@mui/material'\nimport { Icon } from '../Icon'\nimport { makeStyles } from '@mui/styles'\nimport { getType } from '../../models/applicationTypes'\nimport { REGEX_LAST_PATH } from '../../constants'\nimport { IP_PRIVATE, REGEX_NAME_SAFE } from '@common/constants'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { spacing, fontSizes } from '../../styling'\n\ntype Props = {\n data: IScan[]\n services: IService[]\n interfaceType: IInterfaceType\n privateIP: string\n}\n\ntype IInterfaceIcon = { [interfaceType in IInterfaceType]: any }\n\nconst InterfaceIcon: IInterfaceIcon = {\n Wireless: ,\n Wired: ,\n FireWire: ,\n Thunderbolt: ,\n Bluetooth: ,\n Other: ,\n}\n\nexport const ScanNetwork: React.FC = ({ data, services, interfaceType, privateIP }) => {\n const css = useStyles()\n const history = useHistory()\n const location = useLocation()\n const { ui } = useDispatch()\n const [open, setOpen] = useState([])\n const { applicationTypes, setupServicesLimit } = useSelector((state: State) => ({\n applicationTypes: state.applicationTypes.all,\n setupServicesLimit: state.ui.setupServicesLimit,\n }))\n const allClosed = open.length === 0\n const disabled = services.length + 1 > setupServicesLimit\n\n function toggle(row: number) {\n const index = open.indexOf(row)\n\n if (index === -1) {\n setOpen([...open, row])\n } else {\n open.splice(index, 1)\n setOpen([...open])\n }\n }\n\n function toggleAll() {\n if (allClosed) {\n setOpen(Array.from(Array(data.length).keys()))\n } else {\n setOpen([])\n }\n }\n\n function isAdded(ip: string, port: number) {\n return services.find(\n service => (service.host === ip || (IP_PRIVATE === service.host && privateIP === ip)) && service.port === port\n )\n }\n\n return (\n <>\n
\n \n Add a service\n \n \n {allClosed ? 'Expand All' : 'Close All'}\n {allClosed ? : }\n \n }\n />\n
\n \n {data.map((ip, row) => (\n \n toggle(row)}>\n \n {ip[0] === privateIP ? : InterfaceIcon[interfaceType]}\n \n \n \n \n \n \n \n {ip[1].map((port, key) => (\n \n \n \n \n {isAdded(ip[0], port[0]) ? (\n \n ) : (\n {\n ui.set({\n setupAdded: {\n typeID: getType(applicationTypes, port[0]),\n host: ip[0] === privateIP ? IP_PRIVATE : ip[0],\n port: port[0],\n name: (ip[0] === privateIP ? '' : 'Forwarded ') + port[1].replace(REGEX_NAME_SAFE, ''),\n },\n })\n history.push(location.pathname.replace(REGEX_LAST_PATH, ''))\n }}\n >\n Add\n \n )}\n \n \n ))}\n \n \n ))}\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n caption: {\n color: palette.gray.main,\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n width: '100%',\n },\n chip: {\n marginRight: spacing.md,\n },\n port: {\n paddingLeft: 70,\n paddingRight: spacing.lg,\n '& div.MuiListItemText-root:nth-child(1)': {\n maxWidth: '20%',\n },\n },\n loading: {\n alignItems: 'center',\n flexDirection: 'column',\n '& p': {\n fontSize: fontSizes.sm,\n margin: spacing.lg,\n color: palette.grayLight.main,\n },\n },\n}))\n","import React, { useEffect, useCallback, useMemo } from 'react'\nimport { DEFAULT_INTERFACE } from '../../models/ui'\nimport { makeStyles } from '@mui/styles'\nimport { Button, TextField, MenuItem } from '@mui/material'\nimport { Dispatch, State } from '../../store'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { spacing, fontSizes } from '../../styling'\nimport { ScanNetwork } from '../ScanNetwork'\nimport { Container } from '../Container'\nimport { Gutters } from '../Gutters'\nimport { Icon } from '../Icon'\nimport { emit } from '../../services/Controller'\n\ntype Props = {\n data: IScanData\n interfaces: IInterface[]\n services: IService[]\n privateIP: string\n}\n\nexport const Scan: React.FC = ({ data, interfaces, services, privateIP }) => {\n const css = useStyles()\n const { ui } = useDispatch()\n const { scanLoading, scanTimestamp, scanInterface } = useSelector((state: State) => state.ui)\n\n const selected = useMemo(() => data[scanInterface] || {}, [data, scanInterface])\n\n const selectedTimestamp = scanTimestamp[scanInterface]\n const selectedLoading = scanLoading[scanInterface]\n const noResults = selected.data && !selected.data.length\n\n const scan = useCallback(\n (i: string) => {\n emit('scan', i)\n ui.set({\n scanLoading: { [i]: true },\n scanTimestamp: { [i]: selected.timestamp },\n })\n },\n [selected, ui]\n )\n\n useEffect(() => {\n if (interfaces.length && scanInterface === DEFAULT_INTERFACE) {\n let name = interfaces[0].name\n interfaces.forEach(i => i.active && (name = i.name))\n ui.set({ scanInterface: name })\n if (!selected.data) scan(name) // auto scan\n }\n }, [interfaces, scanInterface, scan, ui])\n\n useEffect(() => {\n if (selected.timestamp !== selectedTimestamp && selectedLoading) {\n ui.set({\n scanLoading: { [scanInterface]: false },\n scanTimestamp: { [scanInterface]: selected.timestamp },\n })\n }\n }, [selected.timestamp, selectedTimestamp, selectedLoading, scanInterface, ui])\n\n function interfaceType() {\n const i = interfaces.find(i => i.name === scanInterface)\n return (i ? i.type : '') as IInterfaceType\n }\n\n return (\n \n
\n ui.set({ scanInterface: event.target.value as string })}\n >\n {interfaces.length ? (\n interfaces.map((i: IInterface) => (\n \n {i.type}\n \n ))\n ) : (\n \n Finding Network...\n \n )}\n \n
\n \n \n }\n >\n \n
{noResults && 'No results'}
\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n loading: {\n alignItems: 'center',\n flexDirection: 'column',\n color: palette.grayLighter.main,\n fontSize: fontSizes.xl,\n },\n controls: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginTop: 0,\n '& > div': { flexGrow: 1 },\n '& .MuiCircularProgress-root': { marginLeft: spacing.md },\n '& .MuiButton-contained': { marginRight: 0 },\n '& .MuiFormControl-root': { width: 250 },\n '& .MuiTypography-root': { textAlign: 'right', marginRight: spacing.md, marginLeft: spacing.md, maxWidth: 150 },\n '& samp': {\n fontSize: fontSizes.sm,\n fontFamily: 'Roboto Mono',\n color: palette.grayDark.main,\n },\n },\n}))\n","import React, { useEffect } from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { selectOwnDevices } from '../selectors/devices'\nimport { Typography } from '@mui/material'\nimport { OutOfBand } from '../components/OutOfBand'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Scan } from '../components/Scan'\nimport { emit } from '../services/Controller'\n\nexport const ScanPage: React.FC = () => {\n const { interfaces, services, scanData, privateIP } = useSelector((state: State) => ({\n interfaces: state.backend.interfaces,\n services: selectOwnDevices(state).find(d => d.thisDevice)?.services || [],\n scanData: state.backend.scanData,\n privateIP: state.backend.environment.privateIP,\n }))\n\n useEffect(() => {\n emit('interfaces')\n }, [])\n\n return (\n \n \n Network Scan\n \n \n Scan your system and local network for available ports to host.\n \n \n \n }\n >\n \n \n )\n}\n","import React, { useState } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Button, ListSubheader, Accordion, AccordionSummary, AccordionDetails } from '@mui/material'\nimport { ExpandIcon } from './ExpandIcon'\nimport { spacing } from '../styling'\n\ntype IAccordionMenu = {\n subtitle: string\n expanded?: boolean\n defaultExpanded?: boolean\n gutters?: boolean\n elevation?: number\n square?: boolean\n disabled?: boolean\n onClear?: () => void\n onClick?: (expanded: boolean) => void\n action?: React.ReactNode\n children?: React.ReactNode\n}\n\nexport const AccordionMenuItem: React.FC = ({\n expanded,\n defaultExpanded,\n subtitle,\n gutters,\n elevation = 0,\n square,\n disabled,\n onClear,\n onClick,\n action,\n children,\n}) => {\n const css = useStyles({ gutters })\n const [open, setOpen] = useState(!!defaultExpanded)\n const clickHandler = () => {\n onClick && onClick(!open)\n setOpen(!open)\n }\n\n expanded = expanded === undefined ? open : expanded\n\n return (\n \n \n \n {onClear && (\n {\n event.stopPropagation()\n onClear()\n }}\n >\n Clear\n \n )}\n {action && action}\n \n {children}\n \n )\n}\n\nconst useStyles = makeStyles({\n item: ({ gutters }: any) => ({\n marginTop: spacing.xxs,\n marginBottom: spacing.xxs,\n marginLeft: gutters && spacing.md,\n marginRight: gutters && spacing.md,\n '& .MuiIconButton-root': {\n marginTop: -spacing.xxs,\n marginBottom: -spacing.xxs,\n },\n '& .MuiButton-root:first-of-type': {\n width: '100%',\n textAlign: 'left',\n display: 'block',\n padding: 0,\n margin: 0,\n },\n '& .MuiButton-root + .MuiButton-root': {\n marginRight: spacing.md,\n },\n }),\n})\n","import React, { useState } from 'react'\nimport { REGEX_URL_PATHNAME } from '../constants'\nimport { getApplicationType } from '@common/applications'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\n\ntype ReturnProps = [urlField: string, setUrlField: (value?: string | IService) => void, error?: string]\n\nexport function useURLForm(\n form: IService | undefined,\n setForm: React.Dispatch>,\n enabled: boolean\n): ReturnProps {\n const applicationTypes = useSelector((state: State) => state.applicationTypes.all)\n const [urlError, setUrlError] = useState()\n const [field, setField] = useState('')\n\n function safeURL(form?: IService): string {\n if (!form) return ''\n const applicationType = applicationTypes.find(a => a.id === form.typeID)\n let string = `${applicationType?.scheme || 'http'}://${form.host}:${form.port}`\n string = safeParse(string)?.origin || string\n if (form.attributes) string += `${safePathname(form.attributes.launchTemplate)}`\n return string\n }\n\n function safeParse(field: string) {\n let result\n try {\n result = new URL(field)\n if (urlError) setUrlError(undefined)\n } catch (e) {\n result = field\n if (!urlError && setUrlError) setUrlError('Please enter a valid url.')\n }\n return result\n }\n\n function safePathname(url?: string) {\n if (!url) return ''\n const match = url.match(REGEX_URL_PATHNAME)\n return match ? `/${match[3]}` : ''\n }\n\n const formToField = (form?: IService) => {\n if (!form) return\n setField(safeURL(form))\n }\n\n const fieldToForm = (value: string) => {\n if (!form || !enabled) return\n\n value = 'http' + value.slice(4)\n value = value.replace(/\\s+/g, '')\n setField(value)\n\n const parsed = safeParse(value)\n const scheme = parsed.protocol?.slice(0, -1)\n const applicationType = applicationTypes?.find(a => a.scheme === scheme)\n const port = parsed.port ? parseInt(parsed.port, 10) : applicationType?.port\n const app = getApplicationType(applicationType?.id)\n const template = form?.attributes.launchTemplate || app.launchTemplate\n const match = template.match(REGEX_URL_PATHNAME)\n const baseTemplate = match ? match[1] + match[2].substring(0, match[2].length - 1) : template\n const launchTemplate = baseTemplate + safePathname(value)\n\n setForm({\n ...form,\n port,\n typeID: applicationType?.id || form.typeID,\n host: parsed.hostname || form.host,\n attributes: {\n ...form.attributes,\n launchTemplate,\n },\n })\n }\n\n const smartSetField = (value?: string | IService) => {\n if (typeof value === 'string') fieldToForm(value)\n else formToField(value)\n }\n\n return [field, smartSetField, urlError]\n}\n","import React from 'react'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { Link } from './Link'\nimport { IconButton } from '../buttons/IconButton'\n\ntype Props = {\n allowScanning?: boolean\n button?: boolean\n}\n\nexport const AddFromNetwork: React.FC = ({ allowScanning, button }) => {\n const { deviceID } = useParams<{ deviceID: string }>()\n const { scanEnabled } = useSelector((state: State) => state.ui)\n const history = useHistory()\n\n if (!allowScanning || !scanEnabled) return null\n\n return button ? (\n history.push(`/devices/${deviceID}/add/scan`)}\n />\n ) : (\n Scan network\n )\n}\n","import React, { useRef } from 'react'\nimport { Icon } from '../Icon'\nimport { ListItemButton, ListItemButtonProps, ListItemText, ListItemIcon, Checkbox } from '@mui/material'\n\ntype Props = Omit & {\n label: string | React.ReactNode\n subLabel?: string | React.ReactNode\n height?: number\n checked?: boolean\n indeterminate?: boolean\n onClick: (checked: boolean) => void\n}\n\nexport const ListItemCheckbox: React.FC = ({\n label,\n subLabel,\n height,\n disabled,\n checked,\n indeterminate,\n disableGutters,\n onClick,\n children,\n}) => {\n const inputRef = useRef(null)\n return (\n inputRef.current?.click()}\n >\n \n onClick(event.target.checked)}\n onClick={event => event.stopPropagation()}\n checkedIcon={}\n indeterminateIcon={}\n icon={}\n color=\"primary\"\n />\n \n \n {children}\n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Chip, Menu, MenuItem } from '@mui/material'\nimport { KEY_APPS, getApplicationType } from '@common/applications'\nimport { spacing } from '../styling'\nimport { Gutters } from './Gutters'\nimport { Icon } from './Icon'\n\ntype Props = {\n device?: IDevice\n applicationTypes: IApplicationType[]\n selected?: IApplicationType['id']\n disabled?: boolean\n onSelect: (selected: IApplicationType) => void\n}\n\nexport const ServiceFormApplications: React.FC = ({\n device,\n applicationTypes,\n selected,\n disabled,\n onSelect,\n}) => {\n const css = useStyles()\n const [anchorEl, setAnchorEl] = React.useState(null)\n const allowedApplications = applicationTypes.filter(a => getApplicationType(a.id).visibility(device))\n const keyApplications = allowedApplications.filter(a => KEY_APPS.has(a.id)).slice(0, 5)\n const otherApplications = allowedApplications.filter(a => !keyApplications.find(k => k.id === a.id))\n const otherSelected = otherApplications.find(a => a.id === selected)\n\n return (\n \n {keyApplications.map(t => (\n onSelect(t)}\n color={t.id === selected ? 'primary' : undefined}\n variant=\"filled\"\n />\n ))}\n \n {otherSelected?.name || 'More'}\n \n \n }\n disabled={disabled}\n onClick={event => setAnchorEl(event.currentTarget)}\n color={otherSelected ? 'primary' : undefined}\n variant=\"filled\"\n />\n setAnchorEl(null)}>\n {otherApplications.map(a => (\n {\n onSelect(a)\n setAnchorEl(null)\n }}\n dense\n >\n {a.name}\n \n ))}\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n item: {\n display: 'flex',\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n flexWrap: 'wrap',\n '& > *': { margin: spacing.xxs },\n },\n}))\n","import React from 'react'\nimport { Icon, IconProps } from './Icon'\nimport { Tooltip } from '@mui/material'\n\nexport const PortScanIcon: React.FC<{ state?: IPortScan; port?: number; host?: string }> = ({ state, port, host }) => {\n if (!state) return null\n\n let title: React.ReactNode,\n props: IconProps = {}\n\n switch (state) {\n case 'INVALID':\n props.name = 'circle-minus'\n props.color = 'gray'\n break\n\n case 'REACHABLE':\n title = (\n <>\n Service found!\n
\n {host}:{port}\n \n )\n props.name = 'check-circle'\n props.color = 'success'\n break\n\n case 'UNREACHABLE':\n title = (\n <>\n Service not found.\n
\n {host}:{port}\n \n )\n props.name = 'exclamation-triangle'\n props.color = 'warning'\n break\n\n case 'SCANNING':\n props.color = 'gray'\n props.spin = true\n props.name = 'spinner-third'\n break\n }\n\n const StateIcon = \n\n return title ? (\n \n {StateIcon}\n \n ) : (\n StateIcon\n )\n}\n","import { useState } from 'react'\nimport { REGEX_VALID_IP, REGEX_VALID_HOSTNAME } from '../constants'\nimport { State, Dispatch } from '../store'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { emit } from '../services/Controller'\n\ntype Props = {\n port?: number\n host?: string\n}\n\nexport function usePortScan(): [typeof portReachable, (props: Props) => void] {\n const portReachable = useSelector((state: State) => state.backend.reachablePort)\n const [lastScan, setLastScan] = useState({})\n const { backend } = useDispatch()\n\n function portScan({ port, host }: Props) {\n if (lastScan.port === port && lastScan.host === host) return\n\n if (!host || !port) {\n backend.set({ reachablePort: 'INVALID' })\n return\n }\n\n if (REGEX_VALID_IP.test(host) || REGEX_VALID_HOSTNAME.test(host)) {\n backend.set({ reachablePort: 'SCANNING' })\n emit('reachablePort', { port, host })\n setLastScan({ port, host })\n console.log('PORT SCANNING', host, port)\n } else {\n backend.set({ reachablePort: 'INVALID' })\n }\n }\n\n return [portReachable, portScan]\n}\n","import React, { useState, useEffect } from 'react'\nimport isEqual from 'lodash.isequal'\nimport structuredClone from '@ungap/structured-clone'\nimport { MAX_DESCRIPTION_LENGTH } from '../constants'\nimport { IP_PRIVATE, DEFAULT_SERVICE, DEFAULT_CONNECTION } from '@common/constants'\nimport { Typography, TextField, List, ListItem, Button } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { useURLForm } from '../hooks/useURLForm'\nimport { AddFromNetwork } from './AddFromNetwork'\nimport { useApplication } from '../hooks/useApplication'\nimport { State, Dispatch } from '../store'\nimport { ListItemCheckbox } from './ListItemCheckbox'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { ServiceFormApplications } from './ServiceFormApplications'\nimport { serviceNameValidation } from '@common/nameHelper'\nimport { ServiceAttributesForm } from './ServiceAttributesForm'\nimport { AccordionMenuItem } from './AccordionMenuItem'\nimport { LoadingMessage } from './LoadingMessage'\nimport { PortScanIcon } from './PortScanIcon'\nimport { usePortScan } from '../hooks/usePortScan'\nimport { validPort } from '../helpers/connectionHelper'\nimport { findType } from '../models/applicationTypes'\nimport { Gutters } from './Gutters'\nimport { spacing } from '../styling'\nimport { Notice } from './Notice'\nimport { Pre } from './Pre'\n\nexport type ServiceFormProps = {\n device?: IDevice\n service?: IService\n thisDevice: boolean\n editable: boolean\n disabled?: boolean\n adding?: boolean\n onChange?: (form: IService) => void /// swap for URL form?\n onSubmit: (form: IService) => void\n onCancel: () => void\n}\n\nexport const ServiceForm: React.FC = ({\n device,\n service,\n thisDevice,\n editable,\n disabled,\n adding,\n onChange,\n onSubmit,\n onCancel,\n}) => {\n const { ui } = useDispatch()\n const applicationTypes = useSelector((state: State) => state.applicationTypes.all)\n const saving = useSelector(\n (state: State) => !!(state.ui.setupAddingService || (service?.id && state.ui.setupServiceBusy === service.id))\n )\n const setupAdded = useSelector((state: State) => state.ui.setupAdded)\n\n const initForm = () => {\n setError(undefined)\n const defaultType = findType(applicationTypes, service?.typeID || setupAdded?.typeID || (adding ? 8 : undefined))\n return {\n ...DEFAULT_SERVICE,\n id: service?.id || '',\n host: service?.host || IP_PRIVATE,\n port: service?.port || defaultType.port,\n type: defaultType.name,\n typeID: defaultType.id,\n enabled: !service || service.enabled,\n presenceAddress: service?.presenceAddress,\n name: service?.name || '',\n attributes: service ? { ...service.attributes } : {},\n ...setupAdded,\n }\n }\n\n const [defaultForm, setDefaultForm] = useState()\n const [portReachable, portScan] = usePortScan()\n const [error, setError] = useState()\n const [form, setForm] = useState()\n const application = useApplication(form)\n const [urlField, setUrlField, urlError] = useURLForm(form, setForm, application.urlForm)\n const appType = findType(applicationTypes, form?.typeID)\n const changed = !isEqual(form, defaultForm)\n const css = useStyles()\n\n disabled = disabled || saving\n\n useEffect(() => {\n const newForm = initForm()\n setForm(newForm)\n setUrlField(newForm)\n if (!adding) setDefaultForm(structuredClone(newForm))\n if (setupAdded) ui.set({ setupAdded: undefined })\n }, [service?.id])\n\n useEffect(() => {\n if (form && thisDevice) portScan({ port: form.port, host: form.host })\n }, [form])\n\n if (!form) return \n\n return (\n {\n event.preventDefault()\n const newForm = {\n ...structuredClone(form),\n port: form.port || 1,\n name: form.name || serviceNameValidation(appType.name).value,\n }\n onSubmit(newForm)\n setDefaultForm(newForm)\n }}\n >\n \n \n {editable && (\n <>\n {\n const nextForm = {\n ...form,\n typeID: type.id,\n type: type.name,\n port: type.port,\n attributes: {\n ...form.attributes,\n commandTemplate: undefined,\n launchTemplate: undefined,\n },\n }\n setForm(nextForm)\n setUrlField(nextForm)\n }}\n />\n {appType.description && (\n \n \n \n {appType.description} - {application.use}\n \n \n \n )}\n {thisDevice && (\n \n portScan({ port: form.port, host: form.host })}\n >\n Retry\n \n )\n }\n >\n {portReachable === 'REACHABLE' ? (\n <>\n Service found on \n \n {form.host}:{form.port}\n \n \n ) : (\n <>\n No service found running on {form.host}:{form.port}.\n \n Double check that the host application running.\n \n )}\n \n \n )}\n {application.urlForm ? (\n \n {\n setUrlField(event.target.value)\n onChange?.(form)\n }}\n InputProps={{\n endAdornment: thisDevice && (\n \n ),\n }}\n />\n \n Full URL of the service you want to connect to. Example: https://localhost:8001/api/dashboard{' '}\n or\n http://192.168.1.68/ui/login.\n \n \n ) : (\n <>\n \n {\n const host = event.target.value\n setForm({ ...form, host })\n }}\n InputProps={{\n endAdornment: thisDevice && (\n \n ),\n }}\n />\n \n Enter a local network IP address or fully qualified domain name to configure this as a jump\n service to a system on your local network.\n
\n AWS example:\n vpc-domain-name-identifier.region.es.amazonaws.com\n
\n
\n \n {\n const port = validPort(event)\n setForm({ ...form, port })\n }}\n InputProps={{\n endAdornment: thisDevice && (\n \n ),\n }}\n />\n \n Port the application's service is running on. Do not change this unless you know it is running on\n a custom port.\n \n \n \n )}\n \n )}\n \n {\n const validation = serviceNameValidation(event.target.value, true)\n setForm({ ...form, name: validation.value })\n validation.error ? setError(validation.error) : setError(undefined)\n }}\n />\n \n \n {\n form.attributes.description = event.target.value.substring(0, MAX_DESCRIPTION_LENGTH)\n setForm({ ...form })\n }}\n />\n \n Service description or connection instructions.\n Optional\n \n \n {editable ? (\n \n Disabling your service will take it offline. \n \n Service is\n {form.enabled ? ' enabled' : ' disabled'}\n \n \n }\n disabled={disabled}\n onClick={() => setForm({ ...form, enabled: !form.enabled })}\n />\n ) : (\n \n \n This service isn't remote configurable.\n Update it's device package to the latest version to be able to remote configure it.\n \n \n )}\n
\n
\n \n \n {\n const result = { ...form, attributes }\n setForm(result)\n setUrlField(result)\n }}\n />\n \n \n \n \n {saving ? 'Saving...' : changed ? 'Save' : 'Saved'}\n \n \n {/*
 */}\n      \n    \n  )\n}\n\nexport const useStyles = makeStyles(({ breakpoints }) => ({\n  field: {\n    paddingRight: spacing.lg,\n    paddingLeft: spacing.md,\n    alignItems: 'flex-start',\n    '& > *': {\n      width: '50%',\n      maxWidth: 400,\n    },\n    '& > span.MuiTypography-root': {\n      width: `calc(50% - ${spacing.lg}px)`,\n      marginLeft: spacing.lg,\n    },\n  },\n  [breakpoints.down('sm')]: {\n    field: {\n      flexDirection: 'column',\n      '& > *': { width: '100%' },\n      '& > span.MuiTypography-root': { margin: spacing.xs, width: '100%', marginBottom: spacing.md },\n    },\n  },\n}))\n","import React from 'react'\nimport { ListItem, TextField, TextFieldProps, Typography } from '@mui/material'\n\ntype Props = TextFieldProps & {\n  onChange: (value: string) => void\n  className?: string\n}\n\nexport const TemplateSetting: React.FC = ({ onChange, className, children, ...props }) => {\n  return (\n    \n       onChange(event.target.value)} multiline={true} />\n      {children}\n    \n  )\n}\n","import React, { useState } from 'react'\nimport {\n  ListItemButton,\n  ListItemIcon,\n  ListItemText,\n  ListItemSecondaryAction,\n  MenuItem,\n  Typography,\n  TextField,\n  TextFieldProps,\n  Tooltip,\n} from '@mui/material'\nimport { spacing } from '../styling'\nimport { Icon } from './Icon'\n\ntype Props = Omit & {\n  label?: string\n  value?: string | number\n  values: ISelect[]\n  icon?: string\n  modified?: boolean\n  hideIcon?: boolean\n  helpMessage?: string\n  defaultValue?: string | number\n  disableGutters?: boolean\n  onChange?: (value: string) => void\n}\n\nexport const SelectSetting: React.FC = ({\n  label,\n  value,\n  values,\n  icon,\n  hideIcon,\n  disabled,\n  modified,\n  helpMessage,\n  defaultValue,\n  disableGutters,\n  onChange,\n  children,\n  ...props\n}) => {\n  const [open, setOpen] = useState(false)\n  const handleClick = () => setOpen(!open)\n\n  modified = modified || (!!defaultValue && value !== defaultValue)\n\n  return (\n    \n      \n        {hideIcon ? null : }\n      \n       values.find(r => r.key === value)?.name }}\n        label={\n          <>\n            {label}\n            {helpMessage && (\n              \n                \n                  \n                \n              \n            )}\n          \n        }\n        value={value}\n        onChange={e => {\n          handleClick()\n          onChange && onChange(e.target.value)\n        }}\n      >\n        {values.map(type => (\n          \n            {type.name}\n            {type.description && (\n              \n                {type.description}\n              \n            )}\n            {defaultValue === type.key && (\n              \n                default\n              \n            )}\n          \n        ))}\n      \n      {children && {children}}\n    \n  )\n}\n","import React, { useState } from 'react'\nimport { IP_OPEN } from '@common/constants'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { newConnection, setConnection, getRoute, routeTypeToSettings } from '../helpers/connectionHelper'\nimport { SelectSetting } from './SelectSetting'\n\nexport const ROUTES: IRoute[] = [\n  {\n    key: 'failover',\n    icon: 'code-branch',\n    name: 'Adaptive',\n    description: 'Will pick the best route available, prioritizing a direct connection to this service.',\n  },\n  {\n    key: 'p2p',\n    icon: 'arrows-h',\n    name: 'Peer to peer only',\n    description: 'A direct connection to this service.',\n  },\n  {\n    key: 'proxy',\n    icon: 'cloud',\n    name: 'Proxy only',\n    description: 'A private proxy connection routed through the cloud.',\n  },\n  {\n    key: 'public',\n    icon: 'globe',\n    name: 'Public Proxy',\n    description: 'A cloud proxy connection with a temporary public URL.',\n  },\n]\n\nexport const RouteSetting: React.FC<{ service: IService; connection: IConnection }> = ({ service, connection }) => {\n  const [open, setOpen] = useState(false)\n  const dispatch = useDispatch()\n\n  if (!service) return null\n\n  const defaults = newConnection(service)\n  const disabled =\n    connection.connected || ['p2p', 'proxy'].includes(service.attributes.route || '') || connection.connectLink\n  const connectionRoute = getRoute(connection)\n  const defaultRoute = getRoute(defaults)\n  const route = ROUTES.find(r => r.key === connectionRoute)\n\n  return (\n     ({ key: r.key, name: r.name, description: r.description }))}\n      onChange={route => {\n        setOpen(!open)\n        const updated = {\n          ...connection,\n          ...routeTypeToSettings(route as IRouteType),\n          publicRestriction: route === 'public' ? IP_OPEN : undefined,\n          enabled: route === 'public' ? false : !!connection.enabled,\n          port: connectionRoute === 'public' ? undefined : connection.port,\n        }\n\n        if (updated.public && connection.enabled) {\n          dispatch.connections.disconnect({ connection })\n        }\n        setConnection(updated)\n      }}\n    />\n  )\n}\n","import React from 'react'\nimport browser from '../services/browser'\nimport { State } from '../store'\nimport { useStyles } from './ServiceForm'\nimport { useSelector } from 'react-redux'\nimport { useApplication } from '../hooks/useApplication'\nimport { Typography, TextField, List, ListItem, MenuItem } from '@mui/material'\nimport { validPort, isFileToken } from '../helpers/connectionHelper'\nimport { InlineFileFieldSetting } from './InlineFileFieldSetting'\nimport { ListItemCheckbox } from './ListItemCheckbox'\nimport { TemplateSetting } from './TemplateSetting'\nimport { ROUTES } from './RouteSetting'\nimport { Notice } from './Notice'\nimport { Quote } from './Quote'\n\ntype Props = IService['attributes'] & {\n  connection?: IConnection\n  disabled: boolean\n  customTokens?: string[]\n  customTokensNote?: ILookup\n  attributes: IService['attributes']\n  globalDefaults?: boolean\n  onChange: (attributes: IService['attributes']) => void\n}\n\nexport const ServiceAttributesForm: React.FC = ({\n  disabled,\n  connection,\n  customTokens = [],\n  customTokensNote = {},\n  attributes,\n  globalDefaults,\n  onChange,\n}) => {\n  const { routingLock, routingMessage } = useSelector((state: State) => state.ui)\n  const app = useApplication(undefined, connection)\n  const css = useStyles()\n\n  customTokens = customTokens.length ? customTokens : app.allCustomTokens\n\n  return (\n    <>\n      {!globalDefaults && (\n        \n           onChange({ ...attributes, defaultPort: validPort(event) })}\n          />\n          \n            Default local port to use when a system connects to this service. Port will auto assign if unset.\n          \n        \n      )}\n      \n         onChange({ ...attributes, route: event.target.value as IRouteType })}\n        >\n          \n            No default override\n          \n          {ROUTES.map(route => (\n            \n              {route.name}\n            \n          ))}\n        \n        \n          {routingMessage || ROUTES.find(route => route.key === attributes.route)?.description}\n           Routing is only available on desktop.\n           Default adaptive routing\n        \n      \n      {!globalDefaults && app.reverseProxy && (\n        \n           onChange({ ...attributes, targetHost: event.target.value.toString() })}\n          />\n          \n            A way to specify a different hostname in the host header of an HTTP request. Can be used in load balancing\n            scenarios to route requests to the appropriate server.\n            \n               Example\n               webui.example.com\n            \n          \n        \n      )}\n      {globalDefaults && (\n        <>\n          \n             onChange({ ...attributes, launchType: event.target.value })}\n            >\n              \n                No default override\n              \n              URL\n              Command\n            \n          \n          \n            \n                onChange({ ...attributes, autoLaunch: attributes.autoLaunch === false ? undefined : autoLaunch })\n              }\n            />\n          \n        \n      )}\n       onChange({ ...attributes, launchTemplate: value })}\n      >\n        Default tokens {app.defaultTokens.join(', ')}\n        
\n Default template {globalDefaults ? app.defaultLaunchTemplate : app.launchTemplate}\n {!!app.launchCustomTokens.length && (\n <>\n
\n Custom tokens {app.launchCustomTokens.join(', ')}\n \n )}\n \n onChange({ ...attributes, commandTemplate: value })}\n >\n Default tokens {app.defaultTokens.join(', ')}\n
\n Default template {globalDefaults ? app.defaultCommandTemplate : app.commandTemplate}\n {!!app.commandCustomTokens.length && (\n <>\n
\n Custom tokens {app.commandCustomTokens.join(', ')}\n \n )}\n \n \n {customTokens.length ? (\n \n \n {customTokens.map(token =>\n isFileToken(token) && browser.hasBackend ? (\n onChange({ ...attributes, [token]: value })}\n />\n ) : (\n \n onChange({ ...attributes, [token]: event.target.value })}\n />\n {customTokensNote[token] && (\n This token was found in {customTokensNote[token]}\n )}\n \n )\n )}\n \n \n ) : (\n \n Add custom [tokens]\n \n You can add custom [tokens] to the templates above. Just enclose a tag in brackets to create a [token] you\n can set a default value for. If not filled out, tokens will prompt you at time of connection.\n \n \n )}\n \n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport isEqual from 'lodash.isequal'\nimport structuredClone from '@ungap/structured-clone'\nimport { IP_PRIVATE, DEFAULT_SERVICE, DEFAULT_CONNECTION } from '@common/constants'\nimport { List, Button } from '@mui/material'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { serviceNameValidation } from '@common/nameHelper'\nimport { ServiceAttributesForm } from './ServiceAttributesForm'\nimport { findType } from '../models/applicationTypes'\nimport { Gutters } from './Gutters'\n\nexport type ServiceFormProps = {\n service?: IService\n editable: boolean\n disabled?: boolean\n onSubmit: (form: IService) => void\n onCancel?: () => void\n}\n\nexport const ConnectionDefaultsForm: React.FC = ({ service, disabled, onSubmit, onCancel }) => {\n const { applicationTypes, saving, setupAdded } = useSelector((state: State) => ({\n applicationTypes: state.applicationTypes.all,\n saving: !!(state.ui.setupBusy || (state.ui.setupServiceBusy === service?.id && service?.id)),\n setupAdded: state.ui.setupAdded,\n }))\n\n const initForm = () => {\n setError(undefined)\n const defaultType = findType(applicationTypes, service?.typeID || setupAdded?.typeID)\n return {\n ...DEFAULT_SERVICE,\n host: service?.host || IP_PRIVATE,\n id: service?.id || '',\n port: service?.port || defaultType.port,\n type: defaultType.name,\n typeID: defaultType.id,\n enabled: !service || service.enabled,\n name: service?.name || serviceNameValidation(defaultType.name).value,\n attributes: service?.attributes || {},\n ...setupAdded,\n }\n }\n const [defaultForm, setDefaultForm] = useState()\n const [error, setError] = useState()\n const [form, setForm] = useState()\n const changed = !isEqual(form, defaultForm)\n\n disabled = disabled || saving\n\n useEffect(() => {\n const newForm = initForm()\n setForm(newForm)\n setDefaultForm(structuredClone(newForm))\n }, [service])\n\n if (!form) return null\n\n return (\n {\n event.preventDefault()\n onSubmit({ ...form, port: form.port || 1 })\n }}\n >\n \n setForm({ ...form, attributes })}\n />\n \n \n \n {onCancel && }\n \n \n )\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { ListItemBack } from '../components/ListItemBack'\nimport { AccordionMenuItem } from '../components/AccordionMenuItem'\nimport { ConnectionDefaultsForm } from '../components/ConnectionDefaultsForm'\nimport { DeviceContext } from '../services/Context'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { Notice } from '../components/Notice'\nimport { Gutters } from '../components/Gutters'\n\nexport const ServiceDefaultsPage: React.FC = () => {\n const { device, service } = React.useContext(DeviceContext)\n const history = useHistory()\n const dispatch = useDispatch()\n\n if (!service || !device) return null\n\n return (\n \n \n \n \n Default local settings for any connections to this service.\n \n history.goBack()}\n onSubmit={async form => {\n if (device?.permissions.includes('MANAGE')) {\n await dispatch.devices.setServiceAttributes({\n ...service,\n attributes: { ...service.attributes, ...form.attributes },\n })\n if (device?.configurable) await dispatch.devices.cloudUpdateService({ form, deviceId: device?.id })\n }\n }}\n />\n \n \n )\n}\n","import React from 'react'\n\ntype Props = { count: number }\n\nexport const LicensingTitle: React.FC = ({ count }) => {\n if (count < 1) return <>does not include services.\n if (count === 1) return <>is for one service.\n return <>is for {count} services.\n}\n","import React from 'react'\nimport { Dispatch, State } from '../store'\nimport { ListItem, Button, Tooltip, IconButton } from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { PERSONAL_PLAN_ID } from '../models/plans'\nimport { LicensingTitle } from './LicensingTitle'\nimport { Timestamp } from './Timestamp'\nimport { Notice } from './Notice'\nimport { Link } from './Link'\nimport { Icon } from './Icon'\n\ntype Props = {\n noticeType: string\n license: ILicense | null\n serviceLimit?: ILimit\n fullWidth?: boolean\n}\n\nexport const LicensingNoticeDisplay: React.FC = ({ noticeType, license, serviceLimit, fullWidth }) => {\n const informed = useSelector((state: State) => state.plans.informed)\n const { plans } = useDispatch()\n\n if (informed) return null\n\n const onClose = () => plans.set({ informed: true })\n\n let notice: React.ReactNode | null = null\n const title = `Your ${license?.plan.description} plan of ${license?.plan.product.name}`\n\n const UpgradeButton = (\n <>\n \n \n \n \n \n \n \n \n \n )\n\n // 'ACTIVE' | 'CANCELED' | 'INCOMPLETE' | 'INCOMPLETE_EXPIRED' | 'PAST_DUE' | 'TRIALING' | 'UNPAID'\n switch (noticeType) {\n case 'EXPIRED':\n notice = (\n \n {title} has expired.\n \n Please upgrade your license. Learn more.\n \n \n )\n break\n case 'PAST_DUE':\n notice = (\n \n {title} is past due.\n \n Please update your payment method. Learn more.\n \n \n )\n break\n case 'INCOMPLETE_EXPIRED':\n case 'INCOMPLETE':\n notice = (\n \n {title} is incomplete.\n \n Please update your payment information to continue service.\n \n \n )\n break\n case 'CANCELED':\n notice = (\n \n {title} has been canceled.\n \n Please please check. Learn more.\n \n \n )\n break\n case 'LIMIT_EXCEEDED':\n notice = (\n \n {title} \n \n You have exceeded your limit by {serviceLimit?.actual - serviceLimit?.value}.{' '}\n Learn more.\n \n \n )\n break\n case 'EXPIRATION_WARNING':\n if (license?.expiration)\n notice = (\n \n {title} will renew on {/* replace with countdown */}\n .\n \n )\n break\n case 'PERSONAL_ORGANIZATION':\n if (license?.plan?.id === PERSONAL_PLAN_ID)\n notice = (\n \n Upgrade to a professional plan to enable full device list access and features.\n \n )\n break\n }\n\n return notice ? fullWidth ? notice : {notice} : null\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { selectFullLicense, lookupLicenseProductId } from '../models/plans'\nimport { LicensingNoticeDisplay } from './LicensingNoticeDisplay'\nimport { useSelector } from 'react-redux'\n\ntype Props = { instance?: IInstance; license?: ILicense; fullWidth?: boolean }\n\nexport const LicensingNotice: React.FC = ({ instance, fullWidth, ...props }) => {\n const { noticeType, license, informed, serviceLimit } = useSelector((state: State) => {\n const productId = instance && state.user.id === instance.owner.id ? lookupLicenseProductId(instance) : undefined\n return selectFullLicense(state, { productId, license: props.license })\n })\n\n if (!noticeType || !license || informed) return null\n\n return (\n \n )\n}\n","import React from 'react'\nimport { emit } from '../services/Controller'\nimport { Dispatch } from '../store'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch } from 'react-redux'\nimport { Menu, MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { clearConnectionError } from '../helpers/connectionHelper'\nimport { IconButton } from '../buttons/IconButton'\nimport { DesktopUI } from './DesktopUI'\nimport { Icon } from './Icon'\n\ntype Props = {\n connection: IConnection\n}\n\nexport const ConnectionErrorMenu: React.FC = ({ connection }) => {\n const history = useHistory()\n const dispatch = useDispatch()\n const [anchorEl, setAnchorEl] = React.useState(null)\n const handleClick = event => setAnchorEl(event.currentTarget)\n const handleClose = () => setAnchorEl(null)\n\n return (\n <>\n \n \n {\n await dispatch.feedback.set({\n subject: `Connection Issue Report for ${connection?.name}`,\n data: connection,\n })\n history.push('/feedback')\n }}\n >\n \n \n \n \n \n clearConnectionError(connection)}>\n \n \n \n \n \n \n emit('service/clearErrors')}>\n \n \n \n \n \n \n \n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport { List, ListItem, ListItemText, Collapse } from '@mui/material'\nimport { ConnectionErrorMenu } from '../ConnectionErrorMenu'\nimport { radius, spacing } from '../../styling'\nimport { useDispatch } from 'react-redux'\nimport { makeStyles } from '@mui/styles'\nimport { Dispatch } from '../../store'\nimport { Gutters } from '../Gutters'\n\ntype Props = { connection?: IConnection; visible?: boolean }\n\nexport const ConnectionErrorMessage: React.FC = ({ connection, visible }) => {\n const dispatch = useDispatch()\n const [hasError, setHasError] = useState(!!connection?.error)\n const css = useStyles()\n\n useEffect(() => {\n // update device if new connection error\n if (connection?.error && connection?.deviceID && !hasError) {\n console.log('NEW CONNECTION ERROR - Load device')\n dispatch.devices.fetchDevices({ ids: [connection.deviceID], hidden: true })\n setHasError(true)\n }\n }, [connection?.error])\n\n if (!connection || !connection.error?.message) return null\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n )\n}\n\nconst size = 9\n\nconst useStyles = makeStyles(({ palette }) => ({\n container: {\n position: 'relative',\n backgroundColor: palette.danger.main,\n borderRadius: radius.lg,\n color: palette.alwaysWhite.main,\n '& .MuiListItemSecondaryAction-root': { right: spacing.sm },\n '& .MuiListItemText-secondary': { color: palette.alwaysWhite.main },\n },\n pointer: {\n position: 'absolute',\n top: -size + 1,\n left: 14,\n width: 0,\n height: 0,\n borderLeft: `${size}px solid transparent`,\n borderRight: `${size}px solid transparent`,\n borderBottom: `${size}px solid ${palette.danger.main}`,\n },\n}))\n","import React from 'react'\nimport { IconButton } from '../IconButton'\n\ntype Props = { connection?: IConnection; onClick?: () => void; visible: boolean }\n\nexport const ErrorButton: React.FC = ({ connection, onClick, visible }) => {\n if (!connection || !connection.error?.message) return null\n\n return (\n {\n event.stopPropagation()\n onClick && onClick()\n }}\n title={visible ? 'Hide error' : 'Show error'}\n icon=\"exclamation-triangle\"\n size=\"md\"\n color=\"danger\"\n inlineLeft\n />\n )\n}\n","import React, { useState, useContext } from 'react'\nimport { ConnectionErrorMessage } from '../components/ConnectionErrorMessage'\nimport { Typography, Collapse } from '@mui/material'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { DeviceContext } from '../services/Context'\nimport { ComboButton } from './ComboButton'\nimport { GuideBubble } from '../components/GuideBubble'\nimport { ErrorButton } from '../buttons/ErrorButton'\nimport { makeStyles } from '@mui/styles'\nimport { DesktopUI } from '../components/DesktopUI'\nimport { Gutters } from '../components/Gutters'\nimport { spacing } from '../styling'\n\nexport const ServiceConnectButton: React.FC = () => {\n const { device, service, connection, instance } = useContext(DeviceContext)\n const [showError, setShowError] = useState(true)\n const dispatch = useDispatch()\n const css = useStyles()\n\n return (\n \n \n \n \n \n Starting a connection\n Connect on demand\n \n \n \n \n Create a connection to this service with the connect button.\n \n \n \n \n Start listening on to this endpoint for network requests. On request, automatically create the\n connection and disconnect when idle.\n \n \n {connection.autoLaunch && (\n \n \n This connection will launch when connected because the \"Auto Launch\" configuration toggle is on.\n \n \n )}\n \n }\n >\n \n setShowError(!showError)} visible={showError} />\n dispatch.ui.guide({ guide: 'aws', step: 6 })}\n fullWidth\n />\n \n \n \n \n \n )\n}\n\nconst useStyles = makeStyles({\n actions: {\n marginRight: spacing.md,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n gutters: { display: 'flex', alignItems: 'flex-end', '& button': { height: 45 } },\n})\n","import React from 'react'\nimport { IconButton, ButtonProps } from './IconButton'\n\nexport const ShareButton: React.FC = ({ icon, children, ...props }) => {\n return (\n \n {children}\n \n )\n}\n","import React, { useContext } from 'react'\nimport { getAttribute } from './Attributes'\nimport { Tooltip, TooltipProps, Divider } from '@mui/material'\nimport { DiagramContext, DeviceContext } from '../services/Context'\nimport { Icon, IconProps } from './Icon'\nimport { Link } from './Link'\n\ntype Props = { type: DiagramGroupType; end?: boolean }\n\nexport const DiagramIcon: React.FC = ({ type, end }) => {\n const [hover, setHover] = React.useState(false)\n const { highlightTypes, activeTypes, errorTypes, state, proxy } = useContext(DiagramContext)\n const { device } = useContext(DeviceContext)\n const error = type ? errorTypes.includes(type) : false\n const active = type ? activeTypes.includes(type) : false\n const highlight = type ? highlightTypes.includes(type) : false\n let tooltip: TooltipProps['title'] = ''\n let link: string | undefined\n let props: IconProps = {\n type: hover ? 'solid' : 'regular',\n color: 'grayDarkest',\n }\n\n switch (type) {\n case 'initiator':\n props.name = 'circle'\n tooltip = 'Endpoint on this system'\n link = 'connect'\n break\n case 'proxy':\n props.name = 'cloud'\n tooltip = 'Proxy server'\n link = 'advanced'\n break\n case 'target':\n props.name = 'bullseye'\n link = 'edit'\n const location = getAttribute('location').value({ device })\n tooltip = (\n <>\n Remote endpoint\n {location && (\n <>\n \n {location}\n \n )}\n \n )\n break\n case 'agent':\n props.name = 'diamond'\n link = 'advanced'\n tooltip = proxy ? 'Proxy agent' : 'Local agent'\n break\n case 'relay':\n props.name = 'diamond'\n link = 'edit'\n const isp = getAttribute('isp').value({ device })\n tooltip = (\n <>\n Remote agent\n {isp && (\n <>\n \n {isp}\n \n )}\n \n )\n break\n case 'public':\n props.name = 'globe'\n link = 'connect'\n tooltip = 'Publicly available'\n break\n case 'lan':\n props.name = 'chart-network'\n link = 'lan'\n tooltip = 'The local network'\n break\n }\n\n switch (state) {\n case 'offline':\n if (!['initiator', 'lan'].includes(type)) props.color = 'gray'\n break\n case 'connected':\n props.type = hover ? 'regular' : 'solid'\n break\n }\n\n if (active && state !== 'offline') {\n props.color = 'primary'\n }\n\n if (highlight) {\n props.color = 'primary'\n }\n\n if (error) {\n props.color = 'danger'\n }\n\n return (\n setHover(true)} onMouseLeave={() => setHover(false)} arrow>\n \n \n \n \n )\n}\n","import React, { useContext } from 'react'\nimport { DiagramContext } from '../services/Context'\nimport { Divider, DividerProps } from '@mui/material'\n\ntype Props = {\n type?: DiagramGroupType\n flexGrow?: number\n}\n\nexport const DiagramPath: React.FC = ({ type, flexGrow = 1 }) => {\n const { highlightTypes, activeTypes, errorTypes, state, proxy } = useContext(DiagramContext)\n const error = type ? errorTypes.includes(type) : false\n const active = type ? activeTypes.includes(type) : false\n const highlight = type ? highlightTypes.includes(type) : false\n let sx: DividerProps['sx'] = {\n flexGrow,\n borderBottomWidth: 1.5,\n borderStyle: 'dotted',\n borderColor: 'grayDarkest.main',\n maxWidth: 50,\n width: 50,\n }\n\n switch (type) {\n case 'proxy':\n break\n case 'tunnel':\n sx.maxWidth = type === 'tunnel' ? 'initial' : 70\n sx.borderTopWidth = 1\n sx.borderBottomWidth = 1\n sx.minHeight = '6px'\n sx.marginLeft = '-2px'\n sx.marginRight = '-2px'\n if (state === 'connected') {\n sx.borderTopWidth = 1.5\n sx.borderBottomWidth = 1.5\n sx.borderStyle = 'solid'\n }\n break\n case 'initiator':\n if (!proxy) sx.borderStyle = 'solid'\n break\n case 'relay':\n break\n case 'target':\n sx.borderStyle = 'solid'\n break\n case 'public':\n break\n }\n\n switch (state) {\n case 'ready':\n sx.borderColor = 'grayDarker.main'\n break\n case 'offline':\n if (type !== 'initiator') sx.borderColor = 'grayLight.main'\n }\n\n if (active && state !== 'offline') {\n sx.borderColor = 'primary.main'\n }\n\n if (highlight) {\n sx.borderColor = 'primary.main'\n }\n\n if (error) {\n sx.borderColor = 'error.main'\n }\n\n return \n}\n","import React from 'react'\nimport { Paper } from '@mui/material'\nimport { Icon } from './Icon'\n\nexport type IndicatorProps = {\n color?: Color\n placement?: 'left' | 'right'\n hide?: boolean\n}\n\nconst GUTTERS = 24\nconst SIZE = 32\n\nexport const DiagramIndicator: React.FC = ({ color, placement, hide }) => {\n if (hide) return null\n\n return (\n \n \n \n )\n}","import React, { useContext } from 'react'\nimport { Typography, Box } from '@mui/material'\nimport { DiagramContext } from '../services/Context'\n\ntype Props = {\n type?: DiagramGroupType\n right?: boolean\n}\n\nexport const DiagramLabel: React.FC = ({ type, right }) => {\n const { state, highlightTypes } = useContext(DiagramContext)\n const highlight = type ? highlightTypes.includes(type) : false\n\n let titleColor: string | undefined = undefined\n let name: string = ''\n\n switch (type) {\n case 'lan':\n name = 'LAN'\n break\n case 'proxy':\n name = 'Cloud'\n break\n case 'public':\n name = 'Public'\n break\n case 'tunnel':\n name = 'Tunnel'\n break\n case 'initiator':\n name = 'Local'\n break\n case 'relay':\n name = 'Jump'\n break\n case 'target':\n name = 'Service'\n break\n }\n\n switch (state) {\n case 'connected':\n titleColor = 'primary.main'\n break\n }\n\n if (highlight) titleColor = 'black.main'\n\n return (\n \n \n {name}\n \n \n )\n}\n","import React, { useContext } from 'react'\nimport { Box } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { DiagramIcon } from './DiagramIcon'\nimport { DiagramPath } from './DiagramPath'\nimport { useLocation } from 'react-router-dom'\nimport { isRelay, connectionState } from '../helpers/connectionHelper'\nimport { DeviceContext, DiagramContext } from '../services/Context'\nimport { IP_LATCH, CLI_REACHABLE_ERROR_CODE } from '@common/constants'\nimport { DiagramIndicator, IndicatorProps } from './DiagramIndicator'\nimport { REGEX_LAST_PATH } from '../constants'\nimport { DiagramLabel } from './DiagramLabel'\nimport { lanShared } from '../helpers/lanSharing'\nimport { Pre } from './Pre'\n\ntype Props = {\n to?: { [key in DiagramGroupType]?: string }\n relay?: boolean\n highlightTypes?: DiagramGroupType[]\n}\n\nexport const Diagram: React.FC = ({ to: toTypes, relay, highlightTypes = [] }) => {\n const { service, connection } = useContext(DeviceContext)\n const location = useLocation()\n const state = connectionState(service, connection)\n const lan = lanShared(connection)\n const css = useStyles()\n\n const proxy = connection.proxyOnly\n const publik = connection.connectLink || connection.public\n const protekted = connection.connectLink ? !!connection.password : connection.publicRestriction === IP_LATCH\n const page = location.pathname.match(REGEX_LAST_PATH)?.[0]\n\n relay = relay || isRelay(service)\n let activeTypes: DiagramGroupType[] = []\n let errorTypes: DiagramGroupType[] = []\n let indicator: IndicatorProps = { color: 'grayDarkest' }\n\n switch (page) {\n case '/connect':\n case '/users':\n indicator.hide = true\n break\n case '/advanced':\n case '/defaults':\n case '/lan':\n indicator.placement = 'left'\n break\n case '/edit':\n case '/add':\n indicator.placement = 'right'\n break\n }\n\n switch (state) {\n case 'ready':\n case 'starting':\n case 'connecting':\n activeTypes = ['lan', 'initiator', 'target', 'relay']\n indicator.color = 'primary'\n break\n case 'connected':\n case 'disconnecting':\n activeTypes = ['public', 'lan', 'initiator', 'target', 'proxy', 'agent', 'tunnel', 'relay']\n indicator.color = 'primary'\n break\n case 'online':\n case 'stopping':\n activeTypes = ['target', 'relay']\n if (indicator.placement === 'right') indicator.color = 'primary'\n break\n case 'offline':\n }\n\n if (publik && connection.enabled) {\n // todo public and connected should appear the same, so maybe pass connected state and also add public to it\n activeTypes = ['public', 'lan', 'initiator', 'target', 'proxy', 'agent', 'tunnel', 'relay']\n }\n\n if (connection.error) {\n errorTypes = ['initiator', 'agent']\n if (connection.error.code === CLI_REACHABLE_ERROR_CODE) {\n errorTypes = ['relay', 'target']\n }\n }\n\n return (\n \n {/*
 */}\n      \n        {lan && (\n          <>\n            \n            \n            \n          \n        )}\n        {/* end node */}\n        {publik && protekted ? (\n          <>\n            \n            \n            \n          \n        ) : publik ? (\n          <>\n            \n            \n            \n          \n        ) : (\n          <>\n            \n            \n            \n          \n        )}\n        {/* cloud and agent */}\n        {publik && proxy ? (\n          <>\n            \n            \n            \n            \n          \n        ) : proxy ? (\n          <>\n            \n            \n            \n            \n          \n        ) : publik ? (\n          <>\n            \n            \n          \n        ) : (\n          <>\n            \n            \n          \n        )}\n        {/* tunnel */}\n        \n        {/* jump and target */}\n        \n        {relay ?  : }\n        \n        \n        {/* selection indicator */}\n        \n      \n    \n  )\n}\n\nconst useStyles = makeStyles({\n  diagram: {\n    display: 'flex',\n    alignItems: 'center',\n    justifyContent: 'stretch',\n    position: 'relative',\n    paddingTop: 24,\n    paddingBottom: 6,\n  },\n})\n","import React, { useContext, useEffect } from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { attributeName } from '@common/nameHelper'\nimport { useHistory } from 'react-router-dom'\nimport { Title } from './Title'\nimport { OutOfBand } from './OutOfBand'\nimport { Typography, ButtonBase, Box } from '@mui/material'\nimport { LicensingNotice } from './LicensingNotice'\nimport { DeviceOptionMenu } from './DeviceOptionMenu'\nimport { ServiceConnectButton } from '../buttons/ServiceConnectButton'\nimport { ShareButton } from '../buttons/ShareButton'\nimport { Container } from './Container'\nimport { MobileUI } from './MobileUI'\nimport { Gutters } from './Gutters'\nimport { Diagram } from './Diagram'\nimport { Notice } from '../components/Notice'\nimport { Icon } from '../components/Icon'\n\ntype Props = {\n  footer?: React.ReactNode\n  backgroundColor?: Color\n  children?: React.ReactNode\n}\n\nexport const ServiceHeaderMenu: React.FC = ({ footer, backgroundColor, children }) => {\n  const { connectThisDevice, layout } = useSelector((state: State) => state.ui)\n  const { device, service, instance, user } = useContext(DeviceContext)\n  const dispatch = useDispatch()\n  const history = useHistory()\n\n  useEffect(() => {\n    if (connectThisDevice) dispatch.ui.set({ connectThisDevice: false })\n  }, [device?.id])\n\n  if (!service || !device) return null\n\n  const thisDevice = device?.thisDevice && instance?.owner.id === user.id\n  const displayThisDevice = thisDevice && !connectThisDevice\n  const deviceName = attributeName(device)\n\n  return (\n    \n          \n          \n            \n              {layout.mobile && (\n                \n                   history.push(`/devices/${device.id}`)}>\n                     history.push(`/devices/${device.id}`)}>\n                      \n                      {deviceName}\n                    \n                  \n                \n              )}\n              \n                {service.name || 'unknown'}\n              \n            \n            \n              \n            \n            \n          \n          {service.attributes.description && (\n            \n              \n                \n                  {service.attributes.description}\n                \n              \n            \n          )}\n          {service.license === 'UNLICENSED' && }\n          {displayThisDevice ? (\n            \n               dispatch.ui.set({ connectThisDevice: true })}>\n                This service is running on this device.\n                
\n It can be connected to from anywhere using Remote.It.\n Select another device from the devices menu to connect to it remotely.\n
\n
\n ) : (\n <>\n \n \n \n \n \n )}\n \n }\n footer={footer}\n >\n {service.attributes.description && (\n \n \n \n {service.attributes.description}\n \n \n \n )}\n {children}\n \n )\n}\n","import React, { useState } from 'react'\nimport { Button } from '@mui/material'\nimport { IconButton } from '../IconButton'\n\ntype Props = {\n id?: string\n all?: boolean\n disabled?: boolean\n className?: string\n onClick?: () => void\n}\n\nexport const ClearButton: React.FC = ({ all, onClick, ...props }) => {\n const [deleting, setDeleting] = useState(false)\n\n const handleClick = (event: React.MouseEvent) => {\n event.stopPropagation()\n setDeleting(true)\n onClick?.()\n }\n\n return all ? (\n \n ) : (\n \n )\n}\n","import React from 'react'\nimport { ListItemText, ListItemIcon, ListItemSecondaryAction } from '@mui/material'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../../store'\nimport { ListItemLocation } from '../ListItemLocation'\nimport { Avatar } from '../Avatar'\nimport { Duration } from '../Duration'\nimport { ClearButton } from '../../buttons/ClearButton'\nimport { useLocation } from 'react-router-dom'\nimport { spacing } from '../../styling'\n\ninterface Props {\n user: IUser\n remove?: string\n isConnected?: boolean\n member?: boolean\n children?: React.ReactNode\n}\n\nexport const UserListItem: React.FC = ({ user, remove, isConnected, member, children }) => {\n const dispatch = useDispatch()\n const location = useLocation()\n return (\n \n \n \n \n {isConnected ? (\n }\n />\n ) : (\n \n )}\n {!member && children}\n {remove && (\n \n dispatch.networks.unshareNetwork({ networkId: remove, email: user.email })}\n />\n \n )}\n \n )\n}\n","import React from 'react'\nimport { getAccess } from '../../helpers/userHelper'\nimport { ListItemSecondaryAction, Tooltip } from '@mui/material'\nimport { ServiceIndicators } from '../ServiceIndicators'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../../styling'\nimport { Icon } from '../Icon'\n\ntype Props = {\n user: IUser\n device?: IDevice\n}\n\nexport const ShareDetails: React.FC = ({ user, device }) => {\n const css = useStyles()\n\n if (!device) return null\n\n const { services, scripting } = getAccess(device, user.email)\n return (\n \n {scripting && (\n \n \n \n \n \n )}\n \n \n )\n}\n\nconst useStyles = makeStyles({\n indicators: {\n display: 'flex',\n alignItems: 'center',\n '& svg': { marginRight: spacing.sm },\n },\n})\n","import React, { useState } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { List, Pagination, Slider, Box } from '@mui/material'\nimport { spacing, fontSizes } from '../styling'\nimport { AccordionMenuItem } from './AccordionMenuItem'\nimport { UserListItem } from './UserListItem'\nimport { ShareDetails } from './ShareDetails'\nimport { IconButton } from '../buttons/IconButton'\n\ninterface Props {\n title: string\n device?: IDevice\n remove?: string\n users?: IUser[]\n members?: boolean\n connected?: boolean\n perPage?: number\n}\n\nexport const SharedUsersPaginatedList: React.FC = ({\n title,\n device,\n remove,\n users = [],\n members,\n connected,\n perPage = 12,\n}) => {\n const [page, setPage] = useState(1)\n const css = useStyles()\n\n if (!users?.length) return null\n\n const pageCount = Math.ceil(users.length / perPage)\n const start = (page - 1) * perPage\n const pageUsers = users.slice(start, start + perPage)\n\n return (\n \n {users.length > perPage * 3 ? (\n <>\n setPage(page - 1)} />\n pageUsers[0]?.email?.substring(0, 1) || '-'}\n max={pageCount}\n onChange={(e, page) => setPage(Number(page))}\n size=\"small\"\n />\n setPage(page + 1)} />\n \n ) : (\n users.length > perPage && (\n setPage(Math.max(page, 1))}\n size=\"small\"\n />\n )\n )}\n \n }\n defaultExpanded\n >\n \n {pageUsers.map((user, i) => (\n \n \n \n ))}\n \n \n )\n}\n\nexport const useStyles = makeStyles(({ palette }) => ({\n pagination: {\n margin: 0,\n whiteSpace: 'nowrap',\n flexWrap: 'nowrap',\n '& .MuiSlider-sizeSmall': { width: 200 },\n '& .MuiIconButton-root': { marginTop: -spacing.lg },\n '& .MuiPaginationItem-sizeSmall': { fontSize: fontSizes.xxs },\n '& .MuiPaginationItem-page.Mui-selected': {\n backgroundColor: palette.primary.main,\n color: palette.alwaysWhite.main,\n fontWeight: 500,\n },\n },\n center: { display: 'flex', justifyContent: 'center' },\n}))\n","import React from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { useLocation } from 'react-router-dom'\nimport { Typography, Box, Paper, Tooltip } from '@mui/material'\nimport { SharedUsersPaginatedList } from './SharedUsersPaginatedList'\nimport { selectMembersWithAccess } from '../selectors/organizations'\nimport { selectOrganization } from '../selectors/organizations'\nimport { ShareButton } from '../buttons/ShareButton'\nimport { IconButton } from '../buttons/IconButton'\nimport { Gutters } from './Gutters'\nimport { Icon } from './Icon'\n\ninterface Props {\n device?: IDevice\n network?: INetwork\n users?: IUser[]\n connected?: IUser[]\n}\n\nexport const SharedUsersLists: React.FC = ({ device, network, connected = [], users = [] }) => {\n const instance = device || network\n const location = useLocation()\n const members = useSelector((state: State) => selectMembersWithAccess(state, undefined, instance)).map(m => m.user)\n const hasOrganization = useSelector((state: State) => !!selectOrganization(state).id)\n const disconnected = users.filter(user => !connected.find(_u => _u.email === user.email))\n const manager = !!instance?.permissions.includes('MANAGE')\n\n if (!connected.length && !disconnected.length && !members.length)\n return (\n \n \n \n \n \n \n \n \n Share to a guest\n \n \n or\n \n {hasOrganization ? (\n \n    Add an organization member\n \n ) : (\n \n    Create your organization\n \n )}\n \n \n )\n\n return (\n <>\n \n \n {manager && (\n \n )}\n \n )\n}\n\nconst sort = (users: IUser[]) => users.sort((a, b) => (a.email > b.email ? 1 : b.email > a.email ? -1 : 0))\n","import { createSelector } from 'reselect'\nimport { getSessions, optionalId } from './state'\nimport { selectConnections } from './connections'\n\nexport const selectSessionUsers = createSelector(\n [selectConnections, getSessions, optionalId],\n (connections, sessions, id) => {\n let ids: string[] = []\n const activeSessionIds = connections.map(c => c.sessionId)\n return sessions.reduce((users: IUserRef[], session) => {\n if (\n session.user &&\n !ids.includes(session.user.id) &&\n !activeSessionIds.includes(session.id) &&\n (session.target.id === id || session.target.deviceId === id)\n ) {\n ids.push(session.user.id)\n users.push(session.user)\n }\n return users\n }, [])\n }\n)\n","import React from 'react'\nimport { State } from '../store'\nimport { useParams } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { SharedUsersLists } from '../components/SharedUsersLists'\nimport { selectSessionUsers } from '../selectors/sessions'\nimport { ListItemBack } from '../components/ListItemBack'\nimport { IconButton } from '../buttons/IconButton'\nimport { Gutters } from '../components/Gutters'\nimport { MobileUI } from '../components/MobileUI'\nimport { Box } from '@mui/material'\n\nexport const ServiceUsersPage: React.FC<{ device?: IDevice }> = ({ device }) => {\n const { serviceID = '' } = useParams<{ serviceID: string }>()\n const connected = useSelector((state: State) => selectSessionUsers(state, undefined, serviceID))\n const service = device?.services.find(s => s.id === serviceID)\n const users = service?.access\n\n return (\n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Typography, Box } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../styling'\nimport { Icon } from './Icon'\n\ntype Props = {\n message: string | React.ReactNode\n}\n\nexport const EmptyMessage: React.FC = ({ message }) => {\n const css = useStyles()\n return (\n \n \n \n {message}\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n box: {\n backgroundColor: palette.grayLightest.main,\n borderRadius: spacing.md,\n padding: spacing.xl,\n },\n icon: { marginBottom: spacing.md },\n}))\n","import React from 'react'\nimport { Box } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { EmptyMessage } from '../components/EmptyMessage'\n\nexport const NoConnectionPage: React.FC = () => {\n const css = useStyles()\n return (\n \n \n Select an
\n item on the left
\n to view its details.\n \n }\n />\n
\n )\n}\n\nconst useStyles = makeStyles({\n container: {\n display: 'flex',\n justifyContent: 'center',\n paddingTop: '5vw',\n },\n})\n","import React from 'react'\nimport { setConnection } from '../helpers/connectionHelper'\nimport { IP_OPEN, IP_LATCH } from '@common/constants'\nimport { SelectSetting } from './SelectSetting'\n\nexport const PublicSetting: React.FC<{ service: IService; connection?: IConnection }> = ({ service, connection }) => {\n if (!connection || !connection.public || connection.connectLink) return null\n\n const disabled = connection.enabled || service.attributes.route === 'p2p'\n const helpMessage =\n connection.publicRestriction === IP_LATCH\n ? 'The connection will latch onto the first device to connect with IP restriction.'\n : 'Any device will be able to connect while the connection is active.'\n\n return (\n {\n connection &&\n setConnection({\n ...connection,\n publicRestriction: key.toString(),\n })\n }}\n />\n )\n}\n","import React from 'react'\nimport { Tooltip, IconButton } from '@mui/material'\nimport { Icon } from '../components/Icon'\n\ntype Props = {\n onClick?: () => void\n}\n\nexport const EditButton: React.FC = ({ onClick }) => {\n return (\n \n onClick && onClick()} size=\"large\">\n \n \n \n )\n}\n","import React from 'react'\nimport {\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n ListItemSecondaryAction,\n InputLabel,\n} from '@mui/material'\nimport { EditButton } from '../buttons/EditButton'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { useStyles } from './InlineSetting'\nimport { Title } from './Title'\nimport { Icon } from './Icon'\n\nexport type FormDisplayProps = {\n label?: React.ReactNode\n icon?: React.ReactNode\n value?: string | number | React.ReactNode\n actionIcon?: React.ReactNode\n displayValue?: string | number | React.ReactNode\n disabled?: boolean\n loading?: boolean\n color?: string\n warning?: React.ReactNode\n hideIcon?: boolean\n modified?: boolean\n disableGutters?: boolean\n displayOnly?: boolean\n hideEmpty?: boolean\n onDelete?: () => void\n onClick?: () => void\n}\n\nexport const FormDisplay: React.FC = ({\n label,\n icon,\n value = '',\n actionIcon,\n displayValue,\n disabled,\n loading,\n color,\n warning,\n hideIcon,\n modified,\n hideEmpty,\n disableGutters,\n displayOnly,\n onDelete,\n onClick,\n}) => {\n const css = useStyles()\n\n if (hideEmpty && !value) return null\n if (typeof icon === 'string') icon = \n icon = {icon}\n\n const content = (\n <>\n {icon}\n \n {label && <InputLabel shrink>{label}</InputLabel>}\n <ListItemText style={{ color }}>{(displayValue === undefined ? value : displayValue) || '–'}</ListItemText>\n \n {!disabled && !displayOnly && (\n \n \n {onDelete && }\n \n )}\n {loading && (\n \n \n \n )}\n \n )\n\n return (\n <>\n {actionIcon && {actionIcon}}\n {displayOnly ? (\n \n {content}\n \n ) : (\n \n {content}\n \n )}\n \n )\n}\n","import React, { useEffect, useState, useRef } from 'react'\nimport { ListItem, ListItemIcon, ListItemSecondaryAction } from '@mui/material'\nimport { FormDisplay, FormDisplayProps } from './FormDisplay'\nimport { spacing, fontSizes } from '../styling'\nimport { IconButton } from '../buttons/IconButton'\nimport { makeStyles } from '@mui/styles'\nimport { Icon } from './Icon'\n\ntype Props = {\n value?: string | number\n label?: React.ReactNode\n icon?: React.ReactNode\n actionIcon?: React.ReactNode\n displayValue?: React.ReactNode\n disabled?: boolean\n loading?: boolean\n color?: string\n resetValue?: string | number\n hideIcon?: boolean\n fieldRef?: React.RefObject\n debug?: boolean\n warning?: React.ReactNode\n modified?: boolean\n disableGutters?: boolean\n DisplayComponent?: React.ReactElement\n children?: React.ReactNode\n onSubmit: () => void\n onResetClick: () => void\n onCancel: () => void\n onShowEdit: () => void\n onDelete?: () => void\n}\n\nexport const InlineSetting: React.FC = ({\n icon,\n debug,\n resetValue,\n onSubmit,\n fieldRef,\n onResetClick,\n onCancel,\n onShowEdit,\n hideIcon,\n modified,\n disableGutters,\n DisplayComponent,\n children,\n ...props\n}) => {\n const css = useStyles()\n const [edit, setEdit] = useState(false)\n const canceled = useRef(false)\n\n function triggerEdit() {\n setEdit(true)\n onShowEdit()\n }\n\n function cancelBlur() {\n canceled.current = true\n }\n\n useEffect(() => {\n if (!fieldRef?.current) return\n if (edit) {\n fieldRef.current.focus()\n fieldRef.current.onblur = () => {\n if (!canceled.current && !debug) setTimeout(() => setEdit(false), 200)\n canceled.current = false\n }\n }\n }, [edit])\n\n if (typeof icon === 'string') icon = \n icon = {icon}\n\n const editForm = (\n <>\n {props.actionIcon && {props.actionIcon}}\n \n {icon}\n {\n e.preventDefault()\n onSubmit()\n setEdit(false)\n }}\n >\n {children}\n \n {resetValue != null && (\n {\n onResetClick()\n setEdit(false)\n }}\n />\n )}\n {\n setEdit(false)\n onCancel()\n }}\n />\n \n \n \n \n \n )\n\n const viewForm = DisplayComponent ? (\n React.cloneElement(DisplayComponent, {\n ...props,\n icon,\n onClick: triggerEdit, // or another event handler\n })\n ) : (\n \n )\n\n return edit ? editForm : viewForm\n}\n\nexport const useStyles = makeStyles(({ palette }) => ({\n view: {\n paddingTop: 7,\n paddingBottom: 7,\n '& .MuiInputLabel-root': { position: 'absolute', marginTop: 1 },\n '& .MuiInputLabel-root + .MuiListItemText-root': { marginTop: 15, marginBottom: 3 },\n },\n form: {\n display: 'flex',\n width: '100%',\n marginRight: 120,\n alignItems: 'center',\n '& .MuiInput-input': { paddingTop: 13, paddingBottom: 13, marginLeft: spacing.sm },\n '& .MuiFilledInput-input': { paddingTop: 21, paddingBottom: 10, fontSize: 14 },\n '& .MuiFilledInput-multiline': { paddingTop: 0, paddingBottom: 0 },\n '& .select': { marginLeft: 0, marginTop: 8, height: 40, '& .MuiInput-root': { marginTop: 9 } },\n '& .MuiSelect-select': { fontSize: fontSizes.base, paddingTop: 3, paddingBottom: 4 },\n '& .MuiListItemSecondaryAction-root': { right: spacing.xs },\n },\n active: {\n paddingTop: 0,\n paddingBottom: 0,\n backgroundColor: palette.primaryHighlight.main,\n minHeight: 51,\n },\n action: {\n position: 'absolute',\n display: 'flex',\n minWidth: 60,\n justifyContent: 'center',\n zIndex: 1,\n right: 'auto',\n left: 18,\n marginTop: spacing.xs,\n },\n hideIcon: {\n minWidth: spacing.sm,\n },\n}))\n","import React, { useEffect, useState, useRef } from 'react'\nimport { TextField, TextFieldProps, Input, InputProps } from '@mui/material'\nimport { FormDisplayProps } from './FormDisplay'\nimport { InlineSetting } from './InlineSetting'\nimport { spacing } from '../styling'\n\nexport type InlineTextFieldSettingProps = {\n value?: string | number\n label?: React.ReactNode\n icon?: React.ReactNode\n placeholder?: TextFieldProps['placeholder']\n actionIcon?: React.ReactNode\n displayValue?: string | number\n filter?: RegExp\n color?: string\n required?: boolean\n disabled?: boolean\n resetValue?: string | number\n maxLength?: number\n hideIcon?: boolean\n warning?: React.ReactNode\n modified?: boolean\n disableGutters?: boolean\n autoCorrect?: boolean\n multiline?: boolean\n type?: InputProps['type']\n debug?: boolean\n fieldProps?: TextFieldProps\n DisplayComponent?: React.ReactElement\n onError?: (value: string | undefined) => void\n onSave?: (value: string | number) => void\n onDelete?: () => void\n}\n\nexport const InlineTextFieldSetting: React.FC = ({\n label,\n filter,\n required,\n value = '',\n resetValue,\n placeholder,\n maxLength,\n autoCorrect,\n multiline,\n type,\n fieldProps = {},\n onError,\n onSave,\n ...props\n}) => {\n const fieldRef = useRef(null)\n const [editValue, setEditValue] = useState('')\n const [error, setError] = useState()\n\n useEffect(() => {\n onError && onError(error)\n }, [error])\n\n let Field\n fieldProps.type = type\n\n if (label) {\n Field = TextField\n fieldProps.helperText = error\n } else {\n Field = Input\n }\n\n multiline = multiline === undefined ? value?.toString().length > 50 : multiline\n\n return (\n onSave && onSave(resetValue || '')}\n onSubmit={() => onSave && onSave(editValue)}\n onCancel={() => setEditValue(value)}\n onShowEdit={() => setEditValue(value)}\n >\n {\n let value = event.target.value\n if (required && !value.length) {\n setError(`Required field`)\n } else if (maxLength && value.length > maxLength) {\n setError(`Cannot exceed ${maxLength} characters`)\n value = value.substring(0, maxLength)\n } else if (filter && value.length > 1) {\n const original = value.trim()\n value = value.replace(filter, '')\n if (original !== value.trim()) {\n if (!autoCorrect) setError(`Invalid character. (${original.replace(value, '')})`)\n } else {\n setError(undefined)\n }\n } else {\n setError(undefined)\n }\n setEditValue(value)\n }}\n />\n \n )\n}\n","import React from 'react'\nimport { Tooltip } from '@mui/material'\nimport { newConnection, setConnection } from '../helpers/connectionHelper'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { DEFAULT_CONNECTION } from '@common/constants'\nimport { REGEX_CHARACTERS } from '../constants'\nimport { Icon } from './Icon'\n\nconst PUBLIC_TIMEOUT = 15\n\nexport const TimeoutSetting: React.FC<{ service: IService; connection?: IConnection }> = ({ service, connection }) => {\n if (!service) return null\n if (!connection) connection = newConnection(service)\n if (connection.timeout === undefined) connection.timeout = DEFAULT_CONNECTION.timeout\n\n const disabled = connection.connected || connection.public\n const timeout = connection.public ? PUBLIC_TIMEOUT : connection.timeout\n let display = timeout === 0 ? 'Never' : `${timeout} minutes`\n\n const save = (newTimeout?: number) =>\n connection &&\n setConnection({\n ...connection,\n timeout: newTimeout,\n })\n\n return (\n \n Idle Timeout\n \n Time until connection is closed and returns to waiting state.\n
\n Enter zero (0) for persistent connections.\n \n }\n placement=\"top\"\n arrow\n >\n \n \n \n \n \n }\n disabled={disabled}\n resetValue={DEFAULT_CONNECTION.timeout}\n onSave={timeout => save(+timeout)}\n />\n )\n}\n","import React from 'react'\nimport { ListItemSetting } from './ListItemSetting'\nimport { newConnection, setConnection } from '../helpers/connectionHelper'\nimport { emit } from '../services/Controller'\n\nexport const ConnectionLogSetting: React.FC<{ service: IService; connection?: IConnection }> = ({\n service,\n connection,\n}) => {\n if (!service) return null\n if (!connection) connection = newConnection(service)\n const disabled = connection.connected || connection.public\n const log = connection.public ? false : connection.log\n\n return (\n .log` : undefined}\n modified={log}\n disabled={disabled}\n icon=\"file-alt\"\n toggle={!!log}\n button={log ? 'Show Log' : undefined}\n onButtonClick={() => emit('showFolder', 'connections')}\n onClick={() =>\n connection &&\n setConnection({\n ...connection,\n log: !connection.log,\n })\n }\n />\n )\n}\n","import React from 'react'\nimport { Tooltip } from '@mui/material'\nimport { useSelector } from 'react-redux'\nimport { isReverseProxy } from '../models/applicationTypes'\nimport { State } from '../store'\nimport { DEFAULT_CONNECTION } from '@common/constants'\nimport { newConnection, setConnection } from '../helpers/connectionHelper'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { Icon } from './Icon'\n\nexport const HeaderOverrideSetting: React.FC<{ service: IService; connection?: IConnection }> = ({\n service,\n connection,\n}) => {\n const reverseProxy = useSelector((state: State) => isReverseProxy(state, service.typeID))\n if (!reverseProxy) return null\n if (!connection) connection = newConnection(service)\n if (connection.timeout === undefined) connection.timeout = DEFAULT_CONNECTION.timeout\n\n const disabled = connection.connected || connection.public\n const resetValue = service?.attributes.targetHost\n\n const save = (targetHost: string) =>\n connection &&\n setConnection({\n ...connection,\n targetHost,\n })\n\n return (\n \n Host header override\n \n \n \n \n \n \n }\n disabled={disabled}\n resetValue={resetValue}\n onSave={value => save(value.toString())}\n />\n )\n}\n","import React from 'react'\nimport { Application } from '@common/applications'\nimport { Menu, MenuItem, Button, ListItemIcon, ListItemText, Typography } from '@mui/material'\nimport { setConnection } from '../helpers/connectionHelper'\nimport { Icon } from './Icon'\n\ntype Props = {\n app: Application\n disabled?: boolean\n}\n\nexport const LaunchQuickSelect: React.FC = ({ app, disabled }) => {\n const [anchorEl, setAnchorEl] = React.useState(null)\n const handleClick = event => setAnchorEl(event.currentTarget)\n const handleClose = () => setAnchorEl(null)\n\n const handleSelect = launchType => {\n app.connection && setConnection({ ...app.connection, launchType })\n setAnchorEl(null)\n }\n\n if (app.launchMethods.length <= 1)\n return (\n \n Launch\n \n )\n\n return (\n <>\n \n \n Launch\n \n \n \n \n {/* handleSelect('NONE')} selected={app.launchType === 'NONE'}>\n \n \n \n \n */}\n {app.launchMethods.map(method => (\n handleSelect(method.type)}\n >\n \n \n \n \n \n ))}\n \n \n )\n}\n","import React, { useRef, useState, useEffect } from 'react'\nimport useResizeObserver from 'use-resize-observer'\nimport { makeStyles } from '@mui/styles'\nimport { replaceHost } from '@common/nameHelper'\nimport { Application } from '@common/applications'\nimport { Typography, Tooltip, Collapse, Paper, Box, alpha } from '@mui/material'\nimport { getEndpoint, isSecureReverseProxy } from '../helpers/connectionHelper'\nimport { LaunchQuickSelect } from './LaunchQuickSelect'\nimport { CopyIconButton } from '../buttons/CopyIconButton'\nimport { LaunchButton } from '../buttons/LaunchButton'\nimport { GuideBubble } from './GuideBubble'\nimport { IconButton } from '../buttons/IconButton'\nimport { DesktopUI } from './DesktopUI'\nimport { Gutters } from './Gutters'\nimport { spacing } from '../styling'\nimport { Icon } from './Icon'\n\ntype Props = {\n showTitle?: string\n show?: boolean\n app: Application\n connection?: IConnection\n session?: ISession\n children?: React.ReactNode\n}\n\nexport const ConnectionDetails: React.FC = ({ showTitle, show, app, connection, session, children }) => {\n const basicRef = useRef(null)\n const copyRef = useRef(null)\n const launchRef = useRef(null)\n const buttonRef = useRef(null)\n const [hover, setHover] = useState<'host' | 'port' | 'endpoint' | 'launch' | 'copy' | undefined>()\n const [copied, setCopied] = useState()\n const [displayHeight, setDisplayHeight] = useState(33)\n const css = useStyles()\n\n const measure = () => {\n const height = Math.max(\n Number(basicRef.current?.offsetHeight),\n Number(copyRef.current?.offsetHeight),\n Number(launchRef.current?.offsetHeight)\n )\n if (height !== displayHeight) {\n setDisplayHeight(height)\n }\n }\n\n const { ref } = useResizeObserver({ onResize: measure })\n\n useEffect(() => {\n const timeout = setTimeout(measure, 100)\n return () => clearTimeout(timeout)\n }, [connection, app])\n\n if (!connection && !session) return null\n\n let name = replaceHost(connection?.host)\n let port = connection?.port\n\n const disabled = !(connection?.enabled || session) || !connection?.online\n const endpoint = getEndpoint(name, port)\n const endpointName = (connection?.public || connection?.connectLink ? 'Public' : 'Local') + ' Endpoint'\n const secureReverseProxy = isSecureReverseProxy(app.string)\n const secureIcon = secureReverseProxy === false && (\n \n \n \n )\n\n const basicDisplay = (\n
\n \n {endpointName} {copied}\n \n {\n buttonRef.current?.click()\n setCopied('Copied')\n }}\n >\n {secureIcon}\n {endpoint}\n \n
\n )\n\n const nameDisplay = (\n
\n \n Host\n \n \n {secureIcon}\n {name && {name}}\n {port && :{port}}\n \n
\n )\n\n const portDisplay = (\n
\n \n Port\n \n \n {secureIcon}\n {name}:\n {port}\n \n
\n )\n\n const copyDisplay = (\n
\n \n {endpointName}\n \n \n {secureIcon}\n {endpoint}\n \n
\n )\n\n const launchDisplay = (\n
\n \n {app.contextTitle}\n \n \n {secureIcon}\n {app.sshConfigString}\n \n
\n )\n\n return (\n \n \n \n {!!showTitle ? (\n \n \n User\n \n {showTitle}\n \n ) : (\n <>\n \n
\n {basicDisplay}\n {nameDisplay}\n {portDisplay}\n {copyDisplay}\n {launchDisplay}\n
\n
\n \n \n Using a connection\n \n \n \n A connection was created to this service.\n \n \n \n \n A fixed endpoint has been generated.\n \n \n \n Copy the endpoint or launch the application according to the\n launch method \n configured in the connection configuration.\n \n \n }\n >\n \n \n \n Copy {hover === 'launch' ? '' : hover === 'copy' ? app.contextTitle : hover}\n \n setHover('endpoint')}\n onMouseLeave={() => setHover(undefined)}\n onCopy={() => setCopied(undefined)}\n />\n {connection?.host && (\n <>\n {connection.port && (\n <>\n setHover('host')}\n onMouseLeave={() => setHover(undefined)}\n />\n setHover('port')}\n onMouseLeave={() => setHover(undefined)}\n />\n \n )}\n setHover('copy')}\n onMouseLeave={() => setHover(undefined)}\n />\n \n )}\n \n {app.canShare && (\n \n \n Share\n \n navigator.share?.({ url: app.string })}\n onMouseEnter={() => setHover('launch')}\n onMouseLeave={() => setHover(undefined)}\n />\n \n )}\n {app.launchType !== 'NONE' && (\n \n \n {app.canLaunch ? (\n setHover('launch')}\n onMouseLeave={() => setHover(undefined)}\n />\n ) : (\n \n )}\n \n )}\n \n \n \n )}\n
\n {children}\n
\n
\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n show: {\n opacity: 1,\n position: 'absolute',\n },\n hide: {\n opacity: 0,\n position: 'absolute',\n pointerEvents: 'none',\n },\n inactive: {\n color: alpha(palette.alwaysWhite.main, 0.25),\n },\n h3: {\n wordBreak: 'break-word',\n overflow: 'hidden',\n fontWeight: 500,\n lineHeight: '1.33em',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n transition: 'height 200ms',\n marginTop: spacing.xs,\n marginBottom: spacing.xxs,\n '-webkit-line-clamp': 2,\n '-webkit-box-orient': 'vertical',\n '& span': { wordBreak: 'break-word' },\n },\n address: {\n color: palette.alwaysWhite.main,\n padding: spacing.xs,\n '& label': { color: palette.alwaysWhite.main },\n },\n paper: {\n marginTop: spacing.md,\n overflow: 'hidden',\n },\n buttons: {\n display: 'flex',\n justifyContent: 'space-between',\n '& > :first-of-type': { flexGrow: 1 },\n },\n share: {\n display: 'inline-flex',\n alignItems: 'center',\n flexDirection: 'column',\n },\n marginLeft: {\n marginLeft: spacing.md,\n },\n}))\n","import React from 'react'\nimport { setConnection } from '../helpers/connectionHelper'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { MAX_CONNECTION_NAME_LENGTH } from '../constants'\n\nexport const SubdomainSetting: React.FC<{ service: IService; instance?: IInstance; connection: IConnection }> = ({\n service,\n connection,\n}) => {\n const resetValue = service.subdomain\n return (\n \n setConnection({\n ...connection,\n name: name.toString() || connection.name,\n })\n }\n />\n )\n}\n","import React from 'react'\nimport { ListItemIcon, ListItemText } from '@mui/material'\nimport { lanShareRestriction, lanShared } from '../../helpers/lanSharing'\nimport { ListItemLocation } from '../ListItemLocation'\nimport { Icon } from '../Icon'\n\ntype Props = {\n connection?: IConnection\n}\n\nexport const LanShareSelect: React.FC = ({ connection }) => {\n const shared = lanShared(connection)\n const disabled = connection?.connected || connection?.public\n\n return (\n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { List, ListItem } from '@mui/material'\nimport { spacing } from '../styling'\nimport { Quote } from './Quote'\n\ntype Props = {\n children?: React.ReactNode\n}\n\nexport const ListItemQuote: React.FC = ({ children }) => {\n const css = useStyles()\n return (\n \n \n \n {children}\n \n \n \n )\n}\n\nconst useStyles = makeStyles({\n indent: { marginRight: -spacing.md, marginTop: spacing.xs },\n group: { marginBottom: spacing.sm },\n})\n","import React from 'react'\nimport browser from '../services/browser'\nimport { Application } from '@common/applications'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { InlineFileFieldSetting } from './InlineFileFieldSetting'\nimport { newConnection, updateConnection, isFileToken } from '../helpers/connectionHelper'\n\ntype Props = {\n app: Application\n service: IService\n connection?: IConnection\n disabled?: boolean\n}\n\nexport const CustomConnectionSettings: React.FC = ({\n app,\n service,\n connection = newConnection(service),\n disabled,\n}) => {\n const update = (token: string, value?: string) => {\n let updated = { ...connection, [token]: value }\n if (!value) delete updated[token]\n updateConnection(app, updated)\n }\n\n return (\n <>\n {app.customTokens.map(token =>\n isFileToken(token) && browser.hasBackend ? (\n update(token, value)}\n />\n ) : (\n connection && update(token, value.toString())}\n />\n )\n )}\n \n )\n}\n","import React, { useState, forwardRef } from 'react'\nimport { IconButton, ButtonProps } from './IconButton'\nimport { Confirm, ConfirmProps } from '../components/Confirm'\n\ntype Props = ButtonProps & {\n confirm?: boolean\n confirmProps?: Omit\n}\n\nexport const ConfirmIconButton = forwardRef(({ onClick, confirm, confirmProps, ...props }, ref) => {\n const [open, setOpen] = useState(false)\n\n const handleClick = (e: React.MouseEvent) => {\n if (confirm) setOpen(true)\n else onClick?.(e)\n }\n\n const handleConfirm = (e: React.MouseEvent) => {\n onClick?.(e)\n setOpen(false)\n }\n\n return (\n <>\n \n {confirm && onClick && (\n setOpen(false)}>\n {confirmProps?.children}\n \n )}\n \n )\n})\n","import React from 'react'\nimport { Application } from '@common/applications'\nimport { InlineTextFieldSetting } from '../InlineTextFieldSetting'\nimport { newConnection, setConnection, isSecureReverseProxy } from '../../helpers/connectionHelper'\nimport { ConfirmIconButton } from '../../buttons/ConfirmIconButton'\nimport { Tooltip } from '@mui/material'\nimport { Icon } from '../Icon'\n\ntype Props = {\n app: Application\n service: IService\n connection?: IConnection\n disabled?: boolean\n disableGutters?: boolean\n}\n\nexport const InlineTemplateSetting: React.FC = ({ app, service, connection, disabled, disableGutters }) => {\n if (!connection) connection = newConnection(service)\n const secureReverseProxy = isSecureReverseProxy(app.template)\n\n const update = (template: string) =>\n connection &&\n app.launchType &&\n setConnection({\n ...connection,\n launchTemplates: { ...connection.launchTemplates, [app.launchType]: template },\n disableSecurity: isSecureReverseProxy(template) === false,\n })\n\n return (\n update(app.getReverseProxyTemplate(!secureReverseProxy))}\n />\n )\n }\n disableGutters={disableGutters}\n disabled={disabled}\n value={app.template}\n label={\n <>\n {app.contextTitle} Template\n \n {app.helpMessage && (\n <>\n {app.helpMessage}\n
\n \n )}\n Default tokens - {app.defaultTokens.join(', ')}\n \n }\n placement=\"top\"\n arrow\n >\n \n \n \n \n \n }\n resetValue={app.defaultTemplate}\n onSave={template => update(template.toString())}\n />\n )\n}\n","import React from 'react'\nimport { Application } from '@common/applications'\nimport { SelectSetting } from './SelectSetting'\n\ntype Props = {\n app: Application\n onChange: (launchType: string) => void\n disabled?: boolean\n}\n\nexport const LaunchTypeSelect: React.FC = ({ app, disabled, onChange }) => {\n return (\n method.form)]}\n onChange={onChange}\n />\n )\n}\n","import React from 'react'\nimport { ListItemQuote } from '../ListItemQuote'\nimport { newConnection, setConnection } from '../../helpers/connectionHelper'\nimport { CustomConnectionSettings } from '../CustomConnectionSettings'\nimport { InlineTemplateSetting } from '../InlineTemplateSetting'\nimport { LaunchTypeSelect } from '../LaunchTypeSelect'\nimport { useApplication } from '../../hooks/useApplication'\n\ntype Props = {\n service: IService\n connection?: IConnection\n}\n\nexport const LaunchSelect: React.FC = ({ service, connection }) => {\n if (!connection) connection = newConnection(service)\n\n const app = useApplication(service, connection)\n\n const handleChange = (value: any) => {\n connection &&\n setConnection({\n ...connection,\n launchType: value.toString(),\n })\n }\n\n return (\n <>\n \n {app.launchType !== 'NONE' && (\n \n \n \n \n )}\n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport {\n ListItemButton as MuiListItemButton,\n ListItemText,\n ListItemSecondaryAction,\n InputLabel,\n Tooltip,\n alpha,\n} from '@mui/material'\nimport { spacing, fontSizes } from '../styling'\nimport { Icon } from '../components/Icon'\n\nexport type DataButtonProps = {\n title: string\n value?: string\n label?: string\n dense?: boolean\n icon: React.ReactNode | null\n iconColor?: Color\n gutterBottom?: boolean\n fullWidth?: boolean\n invertBackground?: boolean\n showBackground?: boolean\n alwaysWhite?: boolean\n action?: React.ReactNode\n onClick: (event?: any) => void\n}\n\nexport const ListItemButton: React.FC = ({\n title,\n value,\n label,\n dense,\n icon,\n iconColor,\n gutterBottom,\n fullWidth,\n invertBackground,\n showBackground,\n alwaysWhite,\n onClick,\n action,\n}) => {\n const css = useStyles({ icon: !!icon, showBackground, invertBackground, fullWidth, gutterBottom, alwaysWhite, dense })\n\n return (\n \n \n \n {typeof icon === 'string' ? : icon}\n \n {label}\n
{value}
\n
\n {action && {action}}\n
\n
\n
\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n box: ({\n icon,\n showBackground,\n invertBackground,\n fullWidth,\n gutterBottom,\n alwaysWhite,\n dense,\n }: {\n icon?: boolean\n showBackground?: boolean\n invertBackground?: boolean\n fullWidth?: boolean\n gutterBottom?: boolean\n alwaysWhite?: boolean\n dense?: boolean\n }) => ({\n display: 'flex',\n alignItems: 'center',\n textAlign: 'left',\n color: alwaysWhite ? palette.alwaysWhite.main : palette.grayDarkest.main,\n padding: dense ? spacing.xxs : spacing.sm,\n paddingLeft: icon ? spacing.xxs : dense ? spacing.md : undefined,\n paddingRight: dense ? spacing.md : spacing.lg,\n width: fullWidth ? '100%' : undefined,\n marginBottom: gutterBottom ? spacing.sm : undefined,\n backgroundColor: showBackground\n ? invertBackground\n ? alpha(palette.white.main, 0.7)\n : palette.screen.main\n : undefined,\n '& .MuiTypography-root > *': { color: alwaysWhite ? palette.alwaysWhite.main : palette.grayDarkest.main },\n '&:hover': {\n backgroundColor: showBackground ? (invertBackground ? palette.white.main : undefined) : undefined,\n },\n '& svg': { minWidth: 60 },\n }),\n key: {\n fontSize: fontSizes.sm,\n color: palette.grayDarker.main,\n margin: 0,\n whiteSpace: 'pre-wrap',\n overflowWrap: 'break-word',\n userSelect: 'text',\n },\n}))\n","import React from 'react'\nimport useClipboard from '../hooks/useClipboard'\nimport { makeStyles } from '@mui/styles'\nimport { ListItemButton, DataButtonProps } from '../buttons/ListItemButton'\nimport { IconButton } from '../buttons/IconButton'\nimport { spacing } from '../styling'\n\ntype Props = Omit & {\n hideIcon?: boolean\n link?: string\n}\n\nexport const ListItemCopy: React.FC = ({ hideIcon, link, ...props }) => {\n const clipboard = useClipboard({ copiedTimeout: 1000 })\n const css = useStyles()\n\n if (!props.value) return null\n\n return (\n clipboard.copy(props.value)}\n action={\n link ? (\n (window.location.href = link)}\n className={css.button}\n />\n ) : undefined\n }\n />\n )\n}\n\nconst useStyles = makeStyles(() => ({\n button: {\n minHeight: 80,\n width: 80,\n marginRight: -spacing.xxl,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n}))\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { setConnection } from '../../helpers/connectionHelper'\nimport { InlineTextFieldSetting } from '../InlineTextFieldSetting'\nimport { State } from '../../store'\nimport { REGEX_PORT_SAFE } from '../../constants'\n\nexport const PortSetting: React.FC<{ service: IService; connection: IConnection }> = ({ service, connection }) => {\n const freePort = useSelector((state: State) => state.backend.freePort)\n\n if (!service) return null\n\n const save = (port?: number) =>\n connection &&\n setConnection({\n ...connection,\n port: port || connection.port,\n })\n\n return (\n save(+port)}\n />\n )\n}\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { List, ListItem, ListItemIcon, ListItemText, Box } from '@mui/material'\nimport { PublicSetting } from './PublicSetting'\nimport { DeviceContext } from '../services/Context'\nimport { RouteSetting } from './RouteSetting'\nimport { TimeoutSetting } from './TimeoutSetting'\nimport { useApplication } from '../hooks/useApplication'\nimport { ConnectionLogSetting } from './ConnectionLogSetting'\nimport { HeaderOverrideSetting } from './HeaderOverrideSetting'\nimport { AccordionMenuItem } from './AccordionMenuItem'\nimport { ConnectionDetails } from './ConnectionDetails'\nimport { SubdomainSetting } from './SubdomainSetting'\nimport { NoConnectionPage } from '../pages/NoConnectionPage'\nimport { LanShareSelect } from './LanShareSelect'\nimport { ListItemQuote } from './ListItemQuote'\nimport { LaunchSelect } from './LaunchSelect'\nimport { ListItemBack } from './ListItemBack'\nimport { ListItemCopy } from './ListItemCopy'\nimport { PortSetting } from './PortSetting'\nimport { IconButton } from '../buttons/IconButton'\nimport { DesktopUI } from './DesktopUI'\nimport { Gutters } from './Gutters'\nimport { Icon } from './Icon'\n\nexport const ConnectAdvanced: React.FC = () => {\n const { connection, service, instance, device } = React.useContext(DeviceContext)\n const accordion = useSelector((state: State) => state.ui.accordion)\n const dispatch = useDispatch()\n const app = useApplication(service, connection)\n\n if (!service) return \n\n return (\n \n \n \n \n dispatch.connections.forget(connection.id)}\n />\n \n \n \n \n \n }\n >\n \n {!connection.public && (\n \n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n {!connection.public && (\n dispatch.ui.accordion({ logs: !accordion.logs })}\n elevation={0}\n >\n \n \n \n \n \n \n \n \n {connection.commandLog?.map((l, i) => (\n \n \n \n ))}\n \n \n {(connection.rawCommand || connection.rawEndpoint) && (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n \n )}\n \n )\n}\n","import React, { useEffect } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../../store'\nimport { useHistory, useLocation, useParams } from 'react-router-dom'\nimport { REGEX_LAST_PATH } from '../../constants'\nimport { ListItemBack } from '../../components/ListItemBack'\nimport { ServiceForm } from '../../components/ServiceForm'\nimport { Gutters } from '../../components/Gutters'\n\ntype Props = { device?: IDevice }\n\nexport const ServiceEditPage: React.FC = ({ device }) => {\n const { thisId } = useSelector((state: State) => state.backend)\n const { serviceID } = useParams<{ serviceID?: string }>()\n const dispatch = useDispatch()\n const service = device?.services.find(s => s.id === serviceID)\n const thisDevice = service?.deviceID === thisId\n const location = useLocation()\n const history = useHistory()\n\n useEffect(() => {\n dispatch.applicationTypes.fetchAll()\n }, [])\n\n if (!service) {\n history.push(`/devices/${device?.id}`)\n return null\n }\n\n const exit = () => history.push(location.pathname.replace(REGEX_LAST_PATH, ''))\n\n return (\n \n \n {\n dispatch.ui.set({ setupServiceBusy: form.id })\n if (device?.permissions.includes('MANAGE')) {\n const updatedService = structuredClone(service)\n updatedService.attributes = { ...service.attributes, ...form.attributes }\n await dispatch.devices.setServiceAttributes(updatedService)\n if (device.configurable) {\n await dispatch.devices.cloudUpdateService({ form, deviceId: device.id })\n } else {\n await dispatch.devices.rename({ id: service.id, name: form.name })\n await dispatch.devices.fetchSingleFull({ id: device.id, hidden: true })\n }\n }\n dispatch.ui.set({ setupServiceBusy: undefined })\n }}\n />\n \n )\n}\n","import React, { useState } from 'react'\nimport { Button, List, Typography, TextField, MenuItem, Box } from '@mui/material'\nimport { REGEX_IP_SAFE, REGEX_VALID_HOSTNAME } from '../../constants'\nimport { IP_OPEN, IP_LATCH, IP_PRIVATE } from '@common/constants'\nimport { ListItemSetting } from '../../components/ListItemSetting'\nimport { setConnection } from '../../helpers/connectionHelper'\nimport { selectConnection } from '../../selectors/connections'\nimport { selectById } from '../../selectors/devices'\nimport { makeStyles } from '@mui/styles'\nimport { AccordionMenuItem } from '../../components/AccordionMenuItem'\nimport { ListItemBack } from '../../components/ListItemBack'\nimport { Gutters } from '../../components/Gutters'\nimport { spacing } from '../../styling'\nimport { State } from '../../store'\nimport { useParams, useHistory } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { maskIPClass } from '../../helpers/lanSharing'\nimport { Quote } from '../../components/Quote'\nimport { Pre } from '../../components/Pre'\n\ntype Selections = { value: string | Function; name: string; note: string; id: number }\n\nexport const LanSharePage: React.FC = () => {\n const { serviceID = '' } = useParams<{ serviceID: string }>()\n const { service, lanIp, connection } = useSelector((state: State) => {\n const [service] = selectById(state, undefined, serviceID)\n return {\n service,\n lanIp: state.backend.environment.privateIP,\n connection: selectConnection(state, service),\n }\n })\n\n const [currentIp, setCurrentIp] = useState((connection && connection.ip) || IP_PRIVATE)\n\n // prettier-ignore\n const selections: Selections[] = [\n { id: 0, value: IP_LATCH, name: 'IP Latching', note: 'Allow any single device on the local network to connect. IP restriction will be set to the IP address of the first device that connects.' },\n { id: 1, value: maskIPClass(lanIp, 'A'), name: 'Class-A Restriction', note: 'IP restricted to the local network' },\n { id: 2, value: maskIPClass(lanIp, 'B'), name: 'Class-B Restriction', note: 'Narrowly IP restrict on the local network' },\n { id: 3, value: maskIPClass(lanIp, 'C'), name: 'Class-C Restriction', note: 'Focused IP restriction on the local network' },\n { id: 4, value: () => address, name: 'Single IP Restriction', note: 'Only allow a single IP address to connect to this device on the local network.' },\n { id: 5, value: IP_OPEN, name: 'None', note: 'Available to all incoming requests.' },\n ]\n\n const [enabledLocalSharing, setEnabledLocalSharing] = useState(connection.ip !== IP_PRIVATE)\n const restriction: ipAddress = enabledLocalSharing && connection.restriction ? connection.restriction : IP_LATCH\n const [selection, setSelection] = useState(() => {\n let s = selections.findIndex(s => s.value === restriction)\n if (s === -1) s = selections.findIndex(s => typeof s.value === 'function')\n return s\n })\n const [address, setAddress] = useState(restriction || '192.168.')\n const selected = selections[selection] || {}\n const history = useHistory()\n const css = useStyles()\n const [error, setError] = useState()\n const [disabled, setDisabled] = useState(true)\n\n const getSelectionValue = () => {\n if (!enabledLocalSharing) return IP_PRIVATE\n const value = selected.value\n return typeof value === 'function' ? value() : value\n }\n\n const getSelectionMask = () => {\n switch (selected.id) {\n case 1:\n return '/8'\n case 2:\n return '/16'\n case 3:\n return '/24'\n default:\n return ''\n }\n }\n\n if (!connection || !service) return null\n\n const save = () => {\n setConnection({\n ...connection,\n ip: enabledLocalSharing ? currentIp : IP_PRIVATE,\n restriction: getSelectionValue(),\n })\n history.goBack()\n }\n\n const handleLocalNetworkSecurity = (event: React.ChangeEvent) => {\n setSelection(parseInt(event.target.value))\n setDisabled(false)\n }\n\n const handleBindIP = event => {\n const { value } = event.target\n setCurrentIp(value)\n\n if (!REGEX_VALID_HOSTNAME.test(value)) {\n setError('invalid IP')\n setDisabled(true)\n } else {\n setError('')\n setDisabled(false)\n }\n }\n\n const handleEnableLocalSharing = () => {\n const setSharing = !enabledLocalSharing\n setCurrentIp(setSharing ? IP_OPEN : IP_PRIVATE)\n setEnabledLocalSharing(setSharing)\n setDisabled(false)\n }\n\n return (\n \n \n \n \n \n \n \n \n\n
\n
\n Your local IP address\n {lanIp}\n
\n \n Allow users to connect to your remote device through your IP address using a custom port.\n \n {enabledLocalSharing && (\n <>\n 30}\n label=\"Bind IP Address\"\n error={!!error}\n defaultValue={currentIp}\n variant=\"filled\"\n helperText={error}\n onChange={handleBindIP}\n />\n
\n \n {selections.map((option, key) => (\n \n {option.name}\n \n ))}\n \n \n {selected.note}
\n \n Mask {getSelectionValue()}\n {getSelectionMask()}\n \n
\n {typeof selected.value === 'function' && (\n \n setAddress(event.target.value.replace(REGEX_IP_SAFE, ''))}\n />\n \n )}\n \n )}\n
\n
\n \n \n
\n
\n
\n )\n}\n\nconst useStyles = makeStyles({\n container: {\n paddingLeft: spacing.xl,\n margin: `${spacing.sm}px ${spacing.xxl}px ${spacing.lg}px`,\n '& > p': { marginBottom: spacing.md },\n '& > div': { marginBottom: spacing.sm },\n },\n textField: {\n minWidth: 300,\n },\n mask: {\n fontStyle: 'italic',\n },\n})\n","import React from 'react'\nimport isEmail from 'validator/lib/isEmail'\nimport CreatableSelect from 'react-select/creatable'\nimport { Theme } from 'react-select'\nimport { makeStyles } from '@mui/styles'\nimport { spacing, fontSizes } from '../styling'\nimport { Typography, Link } from '@mui/material'\n\ninterface Option {\n readonly label: string\n readonly value: string\n}\n\ntype Props = {\n isMulti?: boolean\n contacts: IUserRef[]\n selected: string[]\n onSelect: (emails: string[]) => void\n}\n\nexport const ContactSelector: React.FC = ({ contacts, selected, onSelect, isMulti = true }) => {\n const [inputValue, setInputValue] = React.useState()\n const options: Option[] = contacts.map(c => ({ value: c.email, label: c.email }))\n const uniqueSelected = [...Array.from(new Set(selected))]\n const value: Option[] = uniqueSelected.map(s => ({ value: s.trim(), label: s.trim() }))\n const css = useStyles()\n\n const labelComponent = (inputValue: string) => (\n \n Add {inputValue}\n \n )\n\n return (\n {\n const result: string[] = Array.isArray(options)\n ? options.map(o => o.value.trim())\n : options\n ? // @ts-ignore\n [options.value.trim()]\n : []\n onSelect(result)\n }}\n isValidNewOption={o => isEmail(o.trim())}\n onInputChange={v => {\n const parts = v.trim().split(/[, ]+/)\n const emails = parts.filter(p => isEmail(p))\n if (emails.length > 1) {\n onSelect([...selected, ...emails])\n setInputValue('')\n } else {\n setInputValue(v)\n }\n }}\n formatCreateLabel={labelComponent}\n styles={customStyles}\n />\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n select: {\n flexGrow: 1,\n margin: `${spacing.md}px 0`,\n fontSize: fontSizes.base,\n width: '100%',\n fontWeight: 400,\n '& .select__placeholder': { color: palette.primary.main },\n '& .select__multi-value': { backgroundColor: palette.primary.main, padding: `${spacing.xxs}px ${spacing.xs}px` },\n '& .select__multi-value__label': { fontSize: fontSizes.base, fontWeight: 500, color: palette.alwaysWhite.main },\n '& .select__multi-value__remove': { color: palette.white.main },\n '& .select__control': { backgroundColor: palette.white.main, borderColor: palette.primary.main },\n '& .select__input': { color: `${palette.grayDarkest.main} !important` },\n '& .select__menu': { backgroundColor: palette.grayLightest.main },\n '& .select__option:active': { backgroundColor: palette.primary.main },\n '& .select__option--is-focused': { backgroundColor: palette.primaryHighlight.main },\n '& .select__single-value': {\n backgroundColor: palette.primary.main,\n padding: `${spacing.xxs}px ${spacing.sm}px ${spacing.xxs}px ${spacing.sm}px`,\n fontSize: fontSizes.base,\n fontWeight: 500,\n color: palette.white.main,\n borderRadius: `${spacing.xxs}px`,\n },\n },\n}))\n\nconst selectTheme = (theme: Theme) => {\n return {\n ...theme,\n borderRadius: spacing.xs,\n colors: {\n ...theme.colors,\n primary: theme.colors.primary,\n },\n }\n}\n\nconst customStyles = {\n option: (styles: any) => ({ ...styles, cursor: 'pointer' }),\n control: (styles: any) => ({ ...styles, cursor: 'pointer' }),\n}\n","import React from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { List } from '@mui/material'\nimport { ListItemCheckbox } from '../ListItemCheckbox'\n\ninterface CheckboxItem {\n label: string\n value: string\n}\n\nexport function ServiceCheckboxes({\n onChange,\n services = [],\n saving,\n selectedServices = [],\n}: {\n onChange: (services: string[]) => void\n services: CheckboxItem[]\n saving: boolean\n selectedServices: string[]\n}): JSX.Element {\n const { shares } = useDispatch()\n const indeterminateServices = useSelector((state: State) => state.shares.currentDevice?.indeterminate || [])\n\n const allIndeterminate = !!selectedServices.length && services.length !== selectedServices.length\n const selectAllChecked = !!selectedServices.length && services.length === selectedServices.length\n\n const update = (checked: boolean, id: string): void => {\n const all = checked ? [...selectedServices, id] : selectedServices.filter(v => v !== id && v)\n shares.changeIndeterminate(indeterminateServices.filter(sI => sI !== id))\n onChange(all)\n }\n\n const selectAll = (checked: boolean, services: CheckboxItem[]): void => {\n const ids = services.map(service => service.value).filter(id => [...selectedServices, id])\n const all = checked ? ids : []\n shares.selectAllServices()\n onChange(all)\n }\n\n return (\n \n Select all}\n onClick={checked => selectAll(checked, services)}\n checked={selectAllChecked}\n indeterminate={allIndeterminate}\n />\n {services.map((service, key) => (\n update(checked, service.value)}\n indeterminate={indeterminateServices.includes(service.value)}\n />\n ))}\n \n )\n}\n","import React from 'react'\nimport { Button } from '@mui/material'\nimport { State } from '../../store'\nimport { useSelector } from 'react-redux'\nimport { Gutters } from '../Gutters'\n\nexport function ShareSaveActions({\n onCancel,\n onSave,\n disabled,\n}: {\n onCancel: () => void\n onSave: () => void\n disabled: boolean\n}): JSX.Element {\n const { sharing: saving } = useSelector((state: State) => state.shares)\n return (\n \n \n \n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Divider, List, Typography, Box } from '@mui/material'\nimport { ListItemCheckbox } from '../ListItemCheckbox'\nimport { ServiceCheckboxes } from './ServiceCheckboxes'\nimport { ShareSaveActions } from '../ShareSaveActions'\nimport { TargetPlatform } from '../TargetPlatform'\nimport { useHistory } from 'react-router-dom'\nimport { State, Dispatch } from '../../store'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Gutters } from '../Gutters'\n\nexport interface SharingDetails {\n access: SharingAccess\n emails: string[]\n deviceID?: string\n}\n\nexport interface SharingAccess {\n script: boolean\n services: string[]\n}\n\nexport function SharingForm({ device, user }: { device: IDevice; user?: IUser }): JSX.Element {\n const users = useSelector((state: State) => state.shares.currentDevice?.users)\n const scriptIndeterminate = useSelector((state: State) => !!state.shares.currentDevice?.scriptIndeterminate)\n const selectedServices = useSelector((state: State) => state.shares.currentDevice?.selectedServices || [])\n const script = useSelector((state: State) => !!state.shares.currentDevice?.script)\n const saving = useSelector((state: State) => state.shares.sharing)\n\n const history = useHistory()\n const dispatch = useDispatch()\n\n const disabled = !users?.length && !user\n const handleChangeServices = (services: string[]) => dispatch.shares.setSelectedServices(services)\n const handleChangeScripting = () => dispatch.shares.setScript(!script)\n\n const mapShareData = (share: SharingDetails, isNew: boolean): IShareProps | undefined => {\n const scripting = share.access.script\n const services =\n device?.services.map((s: { id: string }) => ({\n serviceId: s.id,\n action: share.access.services.includes(s.id) ? 'ADD' : 'REMOVE',\n })) || []\n const email = isNew ? share.emails : [share.emails[0]]\n\n if (device) {\n return {\n deviceId: device.id,\n scripting,\n services,\n email,\n }\n }\n }\n\n const handleShare = async (share: SharingDetails, isNew: boolean) => {\n const shareData = mapShareData(share, isNew)\n if (!shareData) return\n await dispatch.shares.share(shareData)\n history.goBack()\n }\n\n const action = () => {\n handleShare({ access: { script, services: selectedServices }, emails: user ? [user?.email] : users || [] }, !user)\n }\n\n return (\n <>\n \n \n \n \n {device.name}\n \n Choose the services you'd like to provide access to.\n \n \n \n \n Services\n ({ label: s.name, value: s.id }))}\n saving={saving}\n selectedServices={selectedServices}\n />\n \n \n \n \n history.goBack()} onSave={action} disabled={disabled} />\n \n )\n}\n","import React, { useEffect, useContext } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { DeviceContext } from '../../services/Context'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../../store'\nimport { useParams, useHistory } from 'react-router-dom'\nimport { Typography, IconButton, Tooltip, CircularProgress } from '@mui/material'\nimport { spacing, fontSizes } from '../../styling'\nimport { selectOrganization } from '../../selectors/organizations'\nimport { ContactSelector } from '../../components/ContactSelector'\nimport { SharingForm } from '../../components/SharingForm'\nimport { getAccess } from '../../helpers/userHelper'\nimport { Container } from '../../components/Container'\nimport { Gutters } from '../../components/Gutters'\nimport { Avatar } from '../../components/Avatar'\nimport { Title } from '../../components/Title'\nimport { Icon } from '../../components/Icon'\n\nexport const SharePage: React.FC = () => {\n const dispatch = useDispatch()\n const { device, service } = useContext(DeviceContext)\n const { userID = '' } = useParams<{ userID?: string }>()\n const contacts = useSelector((state: State) => state.contacts.all)\n const guests = device ? device.access : (useSelector(selectOrganization).guests as IUserRef[])\n const deleting = useSelector((state: State) => state.shares.deleting)\n const users = useSelector((state: State) => state.shares.currentDevice?.users || [])\n const guest = guests.find(g => g.id === userID)\n const email = guest?.email || ''\n const history = useHistory()\n const css = useStyles()\n\n useEffect(() => {\n ;(async () => {\n if (!service || !device) return\n if (!guest && userID) await dispatch.organization.fetch()\n await dispatch.shares.fetch({ email, serviceId: service.id, device })\n await dispatch.contacts.fetch()\n })()\n\n // set defaults\n if (device?.loaded) {\n const access = getAccess(device, email)\n if (service && !access.services.length) access.services = [service]\n console.log('ACCESS', access)\n dispatch.shares.setSelectedServices(access.services.map(s => s.id))\n dispatch.shares.setScript(access.scripting)\n }\n }, [device?.loaded, service, email, userID])\n\n const handleUnshare = async () => {\n if (device) await dispatch.shares.delete({ deviceId: device.id, email })\n history.goBack()\n }\n\n const handleChange = (emails: string[]) => {\n dispatch.shares.selectContacts(emails)\n }\n\n return (\n \n \n <Avatar email={email} marginRight={16} />\n {email}\n \n {deleting ? (\n \n ) : (\n \n \n \n \n \n )}\n \n ) : !guest && userID ? (\n \n Loading...\n \n ) : (\n device && (\n \n \n \n )\n )\n }\n >\n {device && }\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n loading: { color: palette.danger.main, margin: spacing.sm },\n}))\n","const notP2P = (connection: IConnection) =>\n !((connection.connected || connection.connecting || connection.disconnecting) && connection.isP2P)\n\nconst notP2PDisconnected = (connection: IConnection) => !connection.isP2P\n\nconst notProxy = (connection: IConnection) =>\n !((connection.connected || connection.connecting || connection.disconnecting) && !connection.isP2P)\n\nexport const checklist: ILookup<{\n title: string\n hide?: (connection: IConnection) => boolean\n}> = {\n // on demand setup\n canBindToPortLocally: {\n title: 'Bound to local port',\n },\n hostnameCanFetch: {\n title: 'Hostname fetched',\n },\n hostnameCanResolve: {\n title: 'Hostname resolved',\n },\n // peer to peer only with connect request\n connectdCanPortBind: {\n title: 'Agent bound to local port',\n hide: notP2P,\n },\n connectdCanStart: {\n title: 'Agent can start',\n hide: notP2P,\n },\n connectdCanConnectToChatServers: {\n title: 'Agent connected to Cloud',\n hide: notP2P,\n },\n connectdCanAuth: {\n title: 'Agent authenticated',\n hide: notP2P,\n },\n connectdTunnelCreated: {\n title: 'Peer to peer tunnel created',\n hide: notP2P,\n },\n targetServiceReachable: {\n title: 'Target service is reachable',\n hide: notP2PDisconnected,\n },\n // proxy only\n proxyCanCreate: {\n title: 'Proxy connection established',\n hide: notProxy,\n },\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { checklist } from '../helpers/checklistHelper'\nimport { Box, Tooltip, Typography } from '@mui/material'\nimport { Icon } from './Icon'\n\ntype Props = { connection?: IConnection }\n\nexport const ConnectionChecklist: React.FC = ({ connection }) => {\n const css = useStyles({})\n\n if (!connection?.checkpoint || connection.public || connection.connectLink) return null\n\n const keys = Object.keys(checklist)\n const anyFailed = keys.some(key => !checklist[key].hide?.(connection) && !connection.checkpoint?.[key])\n\n return (\n \n !checklist[key].hide?.(connection) && (\n \n {connection?.checkpoint?.[key] ? (\n \n ) : (\n \n )}\n {checklist[key].title}\n
\n
\n )\n )}\n >\n \n \n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette, spacing, shadows }) => ({\n tooltip: {\n paddingLeft: spacing(2),\n paddingRight: spacing(2.5),\n paddingTop: spacing(1.5),\n paddingBottom: spacing(1.5),\n boxShadow: shadows[1],\n backgroundColor: palette.grayLightest.main,\n '& .MuiTooltip-arrow': { color: palette.grayLightest.main },\n },\n}))\n","import React from 'react'\nimport { List, ListItem, Tooltip } from '@mui/material'\nimport { fontSizes } from '../../styling'\nimport { makeStyles } from '@mui/styles'\nimport { Attribute } from '../Attributes'\nimport { Icon } from '../Icon'\n\ntype Props = IDataOptions & {\n attributes: Attribute[]\n limits?: ILookup\n disablePadding?: boolean\n width?: number\n}\n\nexport const DataDisplay: React.FC = ({ attributes, limits, width = 140, disablePadding, ...props }) => {\n const css = useStyles(width)()\n if (!props) return null\n return (\n \n {attributes.map((attribute, index) => {\n if (limits && !attribute.show(limits)) return null\n const value = attribute.value(props)\n return (\n value != null && (\n \n \n {attribute.label}:\n {attribute.help && (\n \n \n \n \n \n )}\n \n {value}\n \n )\n )\n })}\n \n )\n}\n\nconst useStyles = minWidth =>\n makeStyles(({ palette }) => ({\n list: {\n width: '100%',\n padding: `4px 0`,\n },\n label: {\n '& > :first-of-type': { alignSelf: 'start' },\n color: palette.grayDark.main,\n textTransform: 'capitalize',\n alignSelf: 'flex-start',\n minWidth,\n },\n attribute: {\n fontSize: fontSizes.sm,\n fontFamily: 'Roboto Mono',\n color: palette.grayDarker.main,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n }))\n","import React from 'react'\nimport { Box } from '@mui/material'\nimport { connectionAttributes } from './Attributes'\nimport { ConnectionChecklist } from './ConnectionChecklist'\nimport { useApplication } from '../hooks/useApplication'\nimport { DataDisplay } from './DataDisplay'\nimport { Gutters } from './Gutters'\n\ntype Props = {\n connection?: IConnection\n service?: IService\n session?: ISession\n}\n\nexport const ConnectionData: React.FC = ({ connection, service, session }) => {\n const app = useApplication(service, connection)\n\n if (!connection && !session) return null\n\n return (\n \n \n \n \n \n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport { Notice } from './Notice'\nimport { SelectSetting } from './SelectSetting'\nimport { ListItemQuote } from './ListItemQuote'\nimport { ListItemSetting } from './ListItemSetting'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { useDispatch } from 'react-redux'\nimport { Typography } from '@mui/material'\nimport { Dispatch } from '../store'\n\ntype ISecurity = 'PROTECTED' | 'OPEN'\nconst MAX_PASSWORD_LENGTH = 49\n\ntype Props = {\n connection: IConnection\n permissions: IPermission[]\n reverseProxy?: boolean\n disabled?: boolean\n}\n\nexport const ConnectLinkSetting: React.FC = ({ connection, permissions, reverseProxy, disabled }) => {\n const dispatch = useDispatch()\n const [security, setSecurity] = useState(connection.password ? 'PROTECTED' : 'OPEN')\n const canManage = permissions.includes('MANAGE')\n disabled = disabled || !canManage || (connection.enabled && !connection.connectLink) || connection.updating\n\n useEffect(() => {\n setSecurity(connection.password ? 'PROTECTED' : 'OPEN')\n }, [connection.password])\n\n return (\n <>\n \n {canManage\n ? disabled\n ? 'Fixed public endpoints are only available for http(s) services.'\n : 'Create a fixed public endpoint for anyone to connect to'\n : \"Requires device 'Manage' permission\"}\n \n }\n toggle={!!connection.connectLink}\n onClick={() => {\n if (connection.connectLink) dispatch.connections.setConnectLink({ ...connection, enabled: false })\n else dispatch.connections.setConnectLink({ ...connection, enabled: true })\n }}\n confirm={!connection.connectLink}\n confirmProps={{\n color: connection.password ? undefined : 'warning',\n action: 'Make Public',\n title: 'Are you sure?',\n children: (\n <>\n {connection.password ? (\n \n This endpoint has password protection.\n \n ) : (\n \n This endpoint has no password protection.\n \n )}\n \n This will create a fixed public endpoint for anyone {connection.password && 'with the password'} to\n connect to.\n \n \n ),\n }}\n />\n {canManage && reverseProxy && (\n \n {\n setSecurity(value as ISecurity)\n if (value === 'OPEN') dispatch.connections.setConnectLink({ ...connection, password: undefined })\n }}\n />\n {security === 'PROTECTED' && (\n dispatch.connections.setConnectLink({ ...connection, password: password.toString() })}\n />\n )}\n \n )}\n \n )\n}\n","import React from 'react'\nimport { serviceAttributes } from './Attributes'\nimport { DataDisplay } from './DataDisplay'\nimport { Gutters } from './Gutters'\n\nexport const ServiceAttributes: React.FC<{\n device?: IDevice\n service?: IService\n disablePadding?: boolean\n}> = props => (\n \n a.details)} />\n \n)\n\n","import React from 'react'\nimport reactStringReplace from 'react-string-replace'\nimport { makeStyles } from '@mui/styles'\n\nexport interface Props {\n name?: string\n port?: number\n color?: string\n}\n\nexport const ConnectionName: React.FC = ({ name = 'Unknown', port, color }) => {\n const css = useStyles({ color })\n return (\n
\n \n {reactStringReplace(name, '-', (match, i) => (\n {match}\n ))}\n \n {port ? :{port} : ''}\n
\n )\n}\n\nexport const useStyles = makeStyles(({ palette, spacing }) => ({\n text: ({ color }: any) => ({\n display: 'flex',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n color: palette[color]?.main,\n '& span ': {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n '& span > span': {\n margin: 1,\n opacity: 0.5,\n },\n }),\n port: {\n fontWeight: 500,\n fontStyle: 'normal',\n marginLeft: 2,\n marginRight: spacing(2),\n },\n}))\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { ListItemText, ListItemIcon } from '@mui/material'\nimport { ListItemLocation } from './ListItemLocation'\nimport { TargetPlatform } from './TargetPlatform'\nimport { ConnectionName } from './ConnectionName'\nimport { spacing } from '../styling'\nimport { Icon } from './Icon'\n\nexport interface Props {\n name: string\n connection?: IConnection\n connectionsPage?: boolean\n to: string\n match?: string\n connected: boolean\n offline: boolean\n platform?: number\n enabled?: boolean\n manufacturer?: ISession['manufacturer']\n children?: React.ReactNode\n}\n\nexport const ConnectionListItem: React.FC = ({\n name,\n connection,\n connectionsPage,\n to,\n match,\n connected,\n offline,\n platform,\n enabled,\n manufacturer,\n children,\n}) => {\n const dispatch = useDispatch()\n const error = !!connection?.error\n const color = offline ? 'gray' : error ? 'error' : connected ? 'primary' : 'grayDarkest'\n const borderColor = error ? 'error' : connected ? 'primary' : 'grayDark'\n const css = useStyles({ connected, color: borderColor, enabled })\n\n let icon: React.ReactNode | null = null\n if (connected) icon = \n if (connection?.connectLink || manufacturer === 'ANONYMOUS' || manufacturer === 'KEY')\n icon = \n\n return (\n \n dispatch.ui.setDefaultSelected({\n key: connectionsPage ? '/connections' : '/networks',\n value: to,\n })\n }\n >\n \n
\n {icon}\n \n \n \n \n } />\n {children}\n \n )\n}\n\nexport const useStyles = makeStyles(({ palette }) => ({\n connection: ({ connected, color, enabled }: any) => ({\n borderColor: enabled ? palette.primary.main : palette[color]?.main,\n borderBottomColor: palette[color]?.main,\n borderWidth: '0 0 1px 1px',\n borderBottomWidth: 1,\n borderBottomStyle: connected ? 'solid' : 'dotted',\n borderStyle: 'solid',\n height: '2.7em',\n width: '1.4em',\n marginTop: '-2.7em',\n marginRight: '-1.4em',\n pointerEvents: 'none',\n }),\n hover: {\n position: 'absolute',\n marginTop: -1,\n },\n name: {\n opacity: 0.8,\n },\n item: {\n marginTop: 0,\n marginBottom: 0,\n marginRight: spacing.xs,\n '& .MuiChip-root': { marginBottom: 0 },\n },\n connectIcon: {\n position: 'relative',\n '& > svg': { position: 'absolute', right: 2, transform: 'translate(0px, -55%)' },\n },\n platform: {\n minWidth: 48,\n '& > span': { flexGrow: 1, textAlign: 'center' },\n },\n mergeIcon: {\n zIndex: 2,\n backgroundImage: `radial-gradient(${palette.white.main}, transparent)`,\n },\n icon: { marginTop: spacing.xxs, marginRight: spacing.md, marginLeft: spacing.sm },\n}))\n","import React from 'react'\nimport classnames from 'classnames'\nimport { ListItemLocation } from './ListItemLocation'\nimport { useStyles } from './ConnectionListItem'\nimport { Avatar } from './Avatar'\nimport { Title } from './Title'\nimport { Icon } from './Icon'\nimport { Box } from '@mui/material'\n\nexport interface Props {\n network?: INetwork\n expanded?: boolean\n offline?: boolean\n noLink?: boolean\n enabled?: boolean\n onClick?: (event: React.MouseEvent) => void\n children?: React.ReactNode\n}\n\nexport const NetworkListTitle: React.FC = ({\n network,\n expanded = true,\n offline,\n noLink,\n enabled,\n onClick,\n children,\n}) => {\n const css = useStyles({ enabled, offline })\n return (\n \n {noLink && network?.owner?.id ? (\n \n \n \n ) : (\n \n )}\n {!noLink && (\n \n )}\n \n }\n to={noLink ? undefined : `/networks/${network?.id}`}\n onClick={noLink ? onClick : undefined}\n title={\n \n {network?.name}\n {expanded ? '' : ' ...'}\n \n }\n dense\n >\n {children}\n \n )\n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { Typography, List } from '@mui/material'\nimport { NetworkListTitle } from './NetworkListTitle'\nimport { ClearButton } from '../buttons/ClearButton'\nimport { Gutters } from './Gutters'\nimport { Tags } from './Tags'\n\nexport const NetworksJoined: React.FC<{ service?: IService; networks: INetwork[] }> = ({ service, networks }) => {\n const dispatch = useDispatch()\n\n if (!networks.length)\n return (\n \n \n None\n \n \n )\n\n return (\n \n {networks.map(network => (\n \n \n dispatch.networks.remove({ serviceId: service?.id, networkId: network.id })} />\n \n ))}\n \n )\n}\n","import React, { useState } from 'react'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { Link } from 'react-router-dom'\nimport { Divider, Menu, MenuItem, ListSubheader, ListItemIcon, Fade, darken } from '@mui/material'\nimport { DynamicButton, DynamicButtonProps } from '../buttons/DynamicButton'\nimport { Icon } from './Icon'\n\ntype Props = DynamicButtonProps & {\n options?: { label: string; value: string; color?: string; disabled?: boolean }[]\n onClick: (value?: string) => void\n}\n\nexport const NetworksAddMenu: React.FC = ({ options = [], onClick, ...props }) => {\n const [anchorEl, setAnchorEl] = useState(null)\n const [menuWidth, setMenuWidth] = useState()\n const css = useStyles(props)\n\n const clickHandler = event => {\n setAnchorEl(event.currentTarget)\n setMenuWidth(event.currentTarget.offsetWidth)\n }\n\n const closeHandler = () => {\n setAnchorEl(null)\n }\n\n const selectHandler = (value?: string) => {\n closeHandler()\n onClick(value)\n }\n\n return (\n <>\n \n \n {!!options.length && (\n \n Networks\n \n )}\n {!!options.length &&\n options.map(option => (\n selectHandler(option.value)}\n value={option.value}\n disabled={option.disabled}\n sx={{ color: option.color + '.main' }}\n >\n {option.label}\n \n ))}\n {!!options.length && }\n \n Create new\n \n \n \n \n \n Network  \n \n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n subhead: {\n paddingTop: 4,\n '& .MuiListSubheader-root + .MuiDivider-root': {\n marginTop: 2,\n },\n },\n menu: {\n '& .MuiList-root': {\n backgroundColor: palette.primary.main,\n },\n '& .MuiListItem-root': {\n color: palette.alwaysWhite.main,\n fontWeight: '500',\n '&:hover': {\n backgroundColor: darken(palette.primary.main, 0.1),\n },\n '&:focus': {\n backgroundColor: darken(palette.primary.main, 0.1),\n },\n '&:focus:hover': {\n backgroundColor: darken(palette.primary.main, 0.15),\n },\n },\n },\n}))\n","import React from 'react'\nimport { NetworksJoined } from './NetworksJoined'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectNetworks, selectNetworkByService } from '../selectors/networks'\nimport { Chip, Box, Tooltip } from '@mui/material'\nimport { AccordionMenuItem } from './AccordionMenuItem'\nimport { State, Dispatch } from '../store'\nimport { NetworksAddMenu } from './NetworkAddMenu'\nimport { Icon } from './Icon'\n\ntype Props = {\n expanded: boolean\n instance?: IInstance\n service?: IService\n connection: IConnection\n onClick: () => void\n}\n\nexport const NetworksAccordion: React.FC = ({ expanded, instance, service, connection, onClick }) => {\n const dispatch = useDispatch()\n const ownerId = useSelector(selectActiveAccountId)\n const allNetworks = useSelector(selectNetworks)\n const joinedNetworks = useSelector((state: State) => selectNetworkByService(state, connection.id))\n const accessibleNetworks = allNetworks.filter(n => n.owner.id === ownerId)\n\n return (\n \n {instance?.permissions.includes('MANAGE') && !instance.shared ? (\n <>\n {!!joinedNetworks.length && }\n ({\n value: n.id,\n label: n.name,\n disabled: !!joinedNetworks.some(j => j.id === n.id),\n }))}\n title={!accessibleNetworks.length ? 'Add a network' : 'Connect to network'}\n size=\"icon\"\n icon=\"plus\"\n onClick={networkId => {\n if (!service) return\n dispatch.networks.add({\n networkId,\n serviceId: service.id,\n name: connection.name,\n port: connection.port,\n enabled: connection.enabled,\n })\n }}\n />\n \n ) : (\n \n {!instance?.permissions.includes('MANAGE') &&\n 'You must be the device owner or manager to modify the networks of this service.'}\n {instance?.shared && 'You can not modify the networks of a device shared to you.'}\n \n }\n placement=\"left\"\n arrow\n >\n \n \n )}\n \n }\n >\n \n \n )\n}\n","import React from 'react'\nimport { windowOpen } from '../services/browser'\nimport { makeStyles } from '@mui/styles'\nimport { Box, Stack, Paper, PaperProps, Typography } from '@mui/material'\nimport { spacing, fontSizes, Sizes } from '../styling'\nimport { CopyIconButton } from '../buttons/CopyIconButton'\nimport { IconButton } from '../buttons/IconButton'\n\nexport type CopyCodeBlockProps = PaperProps & {\n value?: string\n code?: string\n label?: string\n link?: string\n display?: React.ReactNode\n hideCopyLabel?: boolean\n onCopy?: () => void\n}\n\nexport const CopyCodeBlock: React.FC = ({\n value,\n code,\n label,\n display,\n link,\n hideCopyLabel,\n onCopy,\n ...props\n}) => {\n const css = useStyles()\n\n if (code === value) code = undefined\n if (!value) return null\n\n return (\n \n \n {label && {label}}\n \n {display || value}\n \n \n {(code || value) && (\n \n {!hideCopyLabel && (\n \n Copy\n \n )}\n {value && (\n \n )}\n {code && (\n \n )}\n \n )}\n {link && (\n windowOpen(link, '_blank', true)}\n className={css.button}\n />\n )}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n icons: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n padding: spacing.xs,\n borderLeft: `1px solid ${palette.grayLighter.main}`,\n '& .MuiTypography-root': { marginBottom: spacing.xxs },\n '& span': { marginRight: spacing.xs, marginLeft: spacing.xs },\n '& span + span': { marginTop: -spacing.xs },\n },\n paper: {\n display: 'flex',\n backgroundColor: palette.grayLightest.main,\n minWidth: 200,\n },\n button: {\n width: 64,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n key: {\n fontSize: fontSizes.sm,\n color: palette.grayDarker.main,\n marginTop: 2,\n marginBottom: 2,\n whiteSpace: 'pre-wrap',\n overflowWrap: 'anywhere',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n}))\n","import React, { useState, useEffect } from 'react'\nimport { Notice } from './Notice'\nimport { windowOpen } from '../services/browser'\nimport { Typography, Collapse, ButtonBase, Box, Stack } from '@mui/material'\nimport { ListItemSetting } from './ListItemSetting'\nimport { ListItemQuote } from './ListItemQuote'\nimport { CopyCodeBlock } from './CopyCodeBlock'\nimport { ConfirmIconButton } from '../buttons/ConfirmIconButton'\nimport { useDispatch } from 'react-redux'\nimport { IconButton } from '../buttons/IconButton'\nimport { ColorChip } from './ColorChip'\nimport { Dispatch } from '../store'\nimport { Icon } from './Icon'\n\ntype Props = {\n connection: IConnection\n service: IService\n permissions: IPermission[]\n disabled?: boolean\n}\n\nexport const ServiceKeySetting: React.FC = ({ connection, service, permissions, disabled }) => {\n const [loading, setLoading] = useState(false)\n const dispatch = useDispatch()\n const canManage = permissions.includes('MANAGE')\n const enabled = service.link?.enabled\n disabled = disabled || loading || !canManage || connection.updating\n\n useEffect(() => {\n setLoading(false)\n }, [service.link])\n\n return (\n <>\n \n Service Key  \n \n {/* What is a Service Key? Help link... */}\n \n }\n subLabel={\n <>\n \n {canManage\n ? enabled\n ? 'Your Service Key has been generated. Use the key below to authorize connections through our SDK. Keep it secure and do not share it publicly. You can delete it to create a new one.'\n : 'Generate a Service Key to use authorize connections to this service through our SDK.'\n : \"Requires device 'Manage' permission\"}\n \n \n }\n toggle={!!enabled}\n onClick={() => {\n setLoading(true)\n dispatch.devices.setLink({ serviceId: service.id, enabled: !service.link?.enabled })\n }}\n confirm\n confirmProps={\n enabled\n ? {\n action: 'Disable',\n title: 'Disable Service Key?',\n children: 'Anyone with this key will no longer be able to connect.',\n }\n : service.link?.code\n ? {\n action: 'Enable',\n title: 'Enable Service Key?',\n children: 'Anyone with this key will be able to connect.',\n }\n : {\n action: 'Generate Key',\n title: 'Generate Service Key?',\n children: (\n \n You are generating a new Service Key. Anyone with this key will be able to connect.\n \n ),\n }\n }\n />\n \n \n \n \n \n \n \n Get the Node.js package\n \n \n }\n size=\"xl\"\n buttonBaseSize=\"small\"\n onClick={() => windowOpen('https://github.com/remoteit/socket-link.js')}\n inlineLeft\n />\n windowOpen('https://www.npmjs.com/package/@remote.it/socket-link')}\n >\n \n \n \n \n This action cannot be undone. Anyone with this key will no longer be able to connect.\n \n ),\n }}\n disabled={disabled}\n name=\"trash\"\n title=\"Delete Key\"\n onClick={() => {\n setLoading(true)\n dispatch.devices.removeLink(service.id)\n }}\n />\n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { ListItemSetting } from './ListItemSetting'\nimport { newConnection, setConnection, launchSettingHidden } from '../helpers/connectionHelper'\n\nexport const AutoLaunchToggle: React.FC<{ service: IService; connection?: IConnection; disabled?: boolean }> = ({\n service,\n connection,\n disabled,\n}) => {\n if (!service) return null\n if (!connection) connection = newConnection(service)\n if (launchSettingHidden(connection)) return null\n\n return (\n \n connection &&\n setConnection({\n ...connection,\n autoLaunch: !connection.autoLaunch,\n })\n }\n />\n )\n}\n","import React, { useState } from 'react'\nimport { useInterval } from '../hooks/useInterval'\nimport humanize from 'humanize-duration'\n\ntype Props = {\n endTime?: number\n endDate?: Date\n}\n\nexport const Countdown: React.FC = ({ endTime, endDate }) => {\n endTime = endTime || endDate?.getTime()\n const [now, setNow] = useState(endTime || Date.now())\n\n useInterval(() => {\n if (endTime) setNow(Date.now())\n }, 1000)\n\n if (!endTime) return null\n const duration = Math.round((endTime - now) / 1000) * 1000\n if (duration < 0) return null\n const display = humanize(duration, { largest: 2 })\n return <>{display || '-'}\n}\n","import React, { useState } from 'react'\nimport sleep from '../helpers/sleep'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { setConnection } from '../helpers/connectionHelper'\nimport { Typography, Collapse, Paper, Button } from '@mui/material'\nimport { Dispatch, State } from '../store'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { windowOpen } from '../services/browser'\nimport { IconButton } from '../buttons/IconButton'\nimport { Countdown } from './Countdown'\nimport { Gutters } from './Gutters'\nimport { spacing } from '../styling'\n\nconst SUCCESS_DISMISS = 1000\nconst FEEDBACK_DISMISS = 15000\nconst formId = '1FAIpQLSeYtHBGJ8MQ-9I70_ggngkL4S3PcxoIluAds-f9i44CbjKBzg'\n\ntype Props = {\n connection?: IConnection\n highlight?: boolean\n}\n\nexport const ConnectionSurvey: React.FC = ({ connection, highlight }) => {\n const user = useSelector((state: State) => state.user)\n const dispatch = useDispatch()\n const [rated, setRated] = useState(null)\n const css = useStyles()\n\n if (!connection) return null\n\n const show =\n connection.surveyed !== connection.sessionId &&\n !connection.connected &&\n Date.now() - (connection.endTime || 0) < 1000 * 60 * 60 // one hour\n\n const handleRating = async (rating: number) => {\n // call api to rate connection\n setRated(rating)\n dispatch.connections.survey({ rating, connection })\n if (rating === 100) {\n await sleep(SUCCESS_DISMISS)\n } else {\n await sleep(FEEDBACK_DISMISS)\n }\n resetRating()\n }\n\n const resetRating = async () => {\n setConnection({\n ...connection,\n surveyed: connection.sessionId,\n })\n await sleep(400)\n setRated(null)\n }\n\n const sendFeedback = () => {\n windowOpen(\n `https://docs.google.com/forms/d/e/${formId}/viewform?usp=pp_url&entry.1949454489=${user.email}&entry.993582460=${connection.id}&entry.1469201150=${connection.sessionId}&entry.2043964401=${connection.startTime}`\n )\n }\n\n return (\n \n \n {rated === 100 ? (\n \n Thank you for your feedback!\n \n ) : rated === 50 || rated === 0 ? (\n \n \n \n Let us know what happened.\n \n \n Please provide additional information so that we may improve your future connections.\n \n \n \n \n \n \n ) : (\n \n How was your last connection?\n \n handleRating(100)}\n title=\"Good\"\n placement=\"top\"\n name=\"face-smile\"\n color=\"success\"\n size=\"lg\"\n />\n handleRating(50)}\n title=\"Okay\"\n placement=\"top\"\n name=\"face-confused\"\n color=\"warning\"\n size=\"lg\"\n />\n handleRating(0)}\n title=\"Bad\"\n placement=\"top\"\n name=\"face-frown-slight\"\n color=\"danger\"\n size=\"lg\"\n />\n \n \n )}\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n '@keyframes highlight': {\n '0%': { boxShadow: `0 0 0 4px ${palette.primaryHighlight.main}` },\n '30%': { boxShadow: `0 0 0 4px ${palette.primary.main}` },\n '80%': { boxShadow: `0 0 0 4px ${palette.primaryHighlight.main}` },\n },\n survey: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n minHeight: 60,\n '& span': { whiteSpace: 'nowrap', marginTop: -spacing.md, marginBottom: -spacing.md },\n '& .IconButtonTooltip + .IconButtonTooltip': {\n marginLeft: -spacing.xs,\n },\n },\n layout: {\n padding: spacing.lg,\n paddingLeft: spacing.xl,\n position: 'relative',\n '& > .MuiIconButton-root': {\n position: 'absolute',\n right: spacing.sm,\n top: spacing.sm,\n },\n '& .MuiButton-root': {\n marginRight: spacing.md,\n },\n '& > .MuiTypography-caption': {\n color: palette.grayLight.main,\n },\n },\n highlight: {\n animationName: '$highlight',\n animationIterationCount: '6',\n animationTimingFunction: 'ease-out',\n animationDuration: '0.7s',\n },\n}))\n","import React from 'react'\nimport { Application } from '@common/applications'\nimport { ListItemSetting } from './ListItemSetting'\nimport { setConnection, launchSettingHidden } from '../helpers/connectionHelper'\n\nexport const AutoCloseToggle: React.FC<{ app: Application; disabled?: boolean }> = ({ app, disabled }) => {\n if (launchSettingHidden(app.connection)) return null\n if (!app.launchMethod.disconnect) return null\n\n return (\n \n app.connection &&\n setConnection({\n ...app.connection,\n autoClose: !app.connection.autoClose,\n })\n }\n />\n )\n}\n","import React, { useContext } from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { DeviceContext } from '../services/Context'\nimport { selectSessionUsers } from '../selectors/sessions'\nimport { Chip, Box, Typography } from '@mui/material'\nimport { selectMembersWithAccess } from '../selectors/organizations'\nimport { AccordionMenuItem } from './AccordionMenuItem'\nimport { ListItemLocation } from './ListItemLocation'\nimport { ShareButton } from '../buttons/ShareButton'\nimport { Icon } from './Icon'\n\ntype Props = {\n expanded: boolean\n onClick: () => void\n}\n\nexport const AccessAccordion: React.FC = ({ expanded, onClick }) => {\n const { service, instance } = useContext(DeviceContext)\n const connected = useSelector((state: State) =>\n selectSessionUsers(state, undefined, service ? service.id : instance?.id)\n ).length\n const access = useSelector((state: State) => selectMembersWithAccess(state, undefined, instance)).map(m => m.user)\n const guests = (service ? service.access : instance?.access) || []\n const members = access.filter(user => !guests.find(_u => _u.email === user.email))\n const total = guests.length + members.length\n\n if (!instance?.permissions.includes('MANAGE')) return null\n\n return (\n \n {!total && No users}\n {!!connected && }  \n {!!total && !expanded && }\n \n \n }\n >\n {!!guests.length && (\n \n \n \n \n )}\n {!!members.length && (\n \n \n \n \n )}\n \n )\n}\n","import React from 'react'\nimport { MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { Icon } from './Icon'\n\ntype Props = {\n connection?: IConnection\n onClick?: () => void\n}\n\nexport const ForgetMenuItem: React.FC = ({ connection, onClick }) => {\n const dispatch = useDispatch()\n const disabled = !connection || connection.default || connection.connectLink\n\n const forget = () => {\n if (connection) dispatch.connections.forget(connection.id)\n onClick?.()\n }\n\n return (\n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { Menu, MenuItem, ListItemIcon, ListItemText } from '@mui/material'\nimport { ForgetMenuItem } from './ForgetMenuItem'\nimport { IconButton } from '../buttons/IconButton'\nimport { Icon } from './Icon'\n\ntype Props = {\n connection?: IConnection\n service?: IService\n}\n\nexport const ConnectionMenu: React.FC = ({ connection, service }) => {\n const history = useHistory()\n const dispatch = useDispatch()\n const [anchorEl, setAnchorEl] = React.useState(null)\n const handleClick = event => setAnchorEl(event.currentTarget)\n const handleClose = () => setAnchorEl(null)\n\n return (\n <>\n \n \n \n {\n await dispatch.feedback.set({\n subject: `Connection Issue Report for ${connection?.name}`,\n data: connection,\n })\n handleClose()\n history.push('/feedback')\n }}\n >\n \n \n \n \n \n {service?.link?.web && (\n \n dispatch.ui.set({\n confirm: {\n id: 'destroyLink',\n callback: () => {\n dispatch.connections.removeConnectLink(connection)\n handleClose()\n },\n },\n })\n }\n >\n \n \n \n \n \n )}\n \n \n )\n}\n","import React from 'react'\nimport { selectTimeSeries } from '../selectors/ui'\nimport { TimeSeriesTypeLookup } from '../helpers/dateHelper'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\n\ntype Props = {\n variant?: 'device' | 'service'\n}\n\nexport const GraphTitle: React.FC = ({ variant = 'device' }) => {\n const timeSeries = useSelector((state: State) => selectTimeSeries(state)[`${variant}TimeSeries`])\n return <>{TimeSeriesTypeLookup[timeSeries.type]}\n}\n","import React from 'react'\nimport { Typography, Divider, Collapse } from '@mui/material'\nimport { TimeSeries } from './TimeSeries'\nimport { GraphTitle } from './GraphTitle'\nimport { IconButton } from '../buttons/IconButton'\nimport { Gutters } from './Gutters'\nimport { Title } from './Title'\n\ninterface Props {\n service?: IService\n device?: IDevice\n}\n\nexport const GraphItem: React.FC = ({ service, device }) => {\n const variant = service ? 'service' : 'device'\n const instance = service || device\n\n if (!instance) return null\n\n return (\n \n \n \n \n <GraphTitle variant={variant} />\n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport browser from '../services/browser'\n\nexport const PortalUI: React.FC<{ children?: React.ReactNode }> = ({ children }) => {\n if (!browser.isPortal) return null\n return <>{children}\n}\n","import React, { useEffect } from 'react'\nimport { List, Button, Collapse, Divider } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { useParams, useLocation } from 'react-router-dom'\nimport { useApplication } from '../hooks/useApplication'\nimport { isReverseProxy } from '../models/applicationTypes'\nimport { DeviceContext } from '../services/Context'\nimport { windowOpen } from '../services/browser'\nimport { ConnectionData } from './ConnectionData'\nimport { LicensingNotice } from './LicensingNotice'\nimport { ConnectionDetails } from './ConnectionDetails'\nimport { ConnectLinkSetting } from './ConnectLinkSetting'\nimport { ServiceAttributes } from './ServiceAttributes'\nimport { NetworksAccordion } from './NetworksAccordion'\nimport { AccordionMenuItem } from './AccordionMenuItem'\nimport { ServiceKeySetting } from './ServiceKeySetting'\nimport { ListItemLocation } from './ListItemLocation'\nimport { AutoLaunchToggle } from './AutoLaunchToggle'\nimport { ConnectionSurvey } from './ConnectionSurvey'\nimport { AutoCloseToggle } from './AutoCloseToggle'\nimport { AccessAccordion } from './AccessAccordion'\nimport { ConnectionMenu } from './ConnectionMenu'\nimport { GraphItem } from './GraphItem'\nimport { PortalUI } from './PortalUI'\nimport { Gutters } from './Gutters'\nimport { Notice } from './Notice'\nimport { Icon } from './Icon'\nimport { Pre } from './Pre'\n\nexport const Connect: React.FC<{ variant?: 'connection' | 'session' }> = ({ variant = 'connection' }) => {\n const location = useLocation<{\n autoConnect?: boolean\n autoLaunch?: boolean\n autoCopy?: boolean\n autoFeedback?: boolean\n }>()\n const dispatch = useDispatch()\n const { sessionID } = useParams<{ deviceID?: string; sessionID?: string }>()\n const { connection, device, service, instance } = React.useContext(DeviceContext)\n const session = useSelector((state: State) => state.sessions.all.find(s => s.id === sessionID))\n const accordion = useSelector((state: State) => state.ui.accordion)\n const reverseProxy = useSelector((state: State) => isReverseProxy(state, service?.typeID))\n const showDesktopNotice = useSelector((state: State) => state.ui.showDesktopNotice)\n\n const app = useApplication(service, connection)\n\n useEffect(() => {\n if (!location.state) return\n if (location.state.autoConnect) dispatch.ui.set({ autoConnect: true })\n if (location.state.autoLaunch) dispatch.ui.set({ autoLaunch: connection.id })\n if (location.state.autoCopy) dispatch.ui.set({ autoCopy: true })\n }, [location])\n\n if (!service || !instance) return null\n\n return (\n <>\n \n \n \n \n \n {service.license === 'UNLICENSED' && }\n \n \n {variant === 'connection' && (\n dispatch.ui.accordion({ config: !accordion.config })}\n action={}\n >\n \n \n \n \n \n \n \n \n \n {reverseProxy ? (\n \n ) : (\n \n )}\n \n {showDesktopNotice && (\n dispatch.ui.setPersistent({ showDesktopNotice: false })}\n >\n Want Persistent Private Endpoints?\n \n On demand connections with persistent endpoints, remote access, and improved launch commands.\n \n windowOpen('https://link.remote.it/download/desktop')}\n >\n Download Desktop\n \n \n )}\n \n \n \n )}\n \n {device?.permissions.includes('MANAGE') && (\n <>\n \n \n \n \n \n )}\n \n \n \n dispatch.ui.accordion({ networks: !accordion.networks })}\n />\n dispatch.ui.accordion({ access: !accordion.access })}\n />\n \n \n )\n}\n","import React, { useContext } from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { REGEX_FIRST_PATH } from '../constants'\nimport { Switch, Route, Redirect } from 'react-router-dom'\nimport { ServiceDefaultsPage } from '../pages/ServiceDefaultsPage'\nimport { ServiceHeaderMenu } from '../components/ServiceHeaderMenu'\nimport { ServiceUsersPage } from '../pages/ServiceUsersPage'\nimport { NoConnectionPage } from '../pages/NoConnectionPage'\nimport { ConnectAdvanced } from '../components/ConnectAdvanced'\nimport { ServiceEditPage } from '../pages/ServiceEditPage'\nimport { LanSharePage } from '../pages/LanSharePage'\nimport { SharePage } from '../pages/SharePage'\nimport { Connect } from '../components/Connect'\n\nexport const ServiceRouter: React.FC<{ basename: string }> = ({ basename }) => {\n const { device, instance, service, connection } = useContext(DeviceContext)\n\n if (!service || !instance) return \n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { selectFullLicense, lookupLicenseProductId, humanizeDays } from '../models/plans'\nimport { State } from '../store'\nimport { LicensingTitle } from './LicensingTitle'\nimport { useSelector } from 'react-redux'\nimport { Button } from '@mui/material'\nimport { Notice } from './Notice'\nimport { Link } from './Link'\n\ntype Props = { device?: IDevice; license?: ILicense }\n\nexport const LicensingServiceNotice: React.FC = props => {\n const { noticeType, license, serviceLimit, evaluationLimit } = useSelector((state: State) => {\n let productId = props.license?.plan.product.id\n if (props.device && state.auth.user?.id === props.device.owner.id) productId = lookupLicenseProductId(props.device)\n return selectFullLicense(state, { productId })\n })\n\n if (!license) return null\n\n const title = `Your ${license.plan.description} license of ${license.plan.product.name}`\n\n if (noticeType === 'LIMIT_EXCEEDED')\n return (\n \n \n \n }\n >\n {title} \n \n This service will be accessible for {humanizeDays(evaluationLimit?.value)}, unless you upgrade your license.\n Learn more.\n \n \n )\n\n return null\n}\n","import React, { useEffect, useState } from 'react'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { LicensingServiceNotice } from '../../components/LicensingServiceNotice'\nimport { REGEX_LAST_PATH } from '../../constants'\nimport { ServiceForm } from '../../components/ServiceForm'\nimport { Typography } from '@mui/material'\nimport { Container } from '../../components/Container'\nimport { isRelay } from '../../helpers/connectionHelper'\nimport { Diagram } from '../../components/Diagram'\nimport { Gutters } from '../../components/Gutters'\nimport { Title } from '../../components/Title'\n\ntype Props = { device?: IDevice }\n\nexport const ServiceAddPage: React.FC = ({ device }) => {\n const { setupServicesLimit } = useSelector((state: State) => state.ui)\n const [forward, setForward] = useState(false)\n const dispatch = useDispatch()\n const location = useLocation()\n const history = useHistory()\n\n useEffect(() => {\n dispatch.applicationTypes.fetchAll()\n }, [])\n\n const maxReached = device && device.services.length >= setupServicesLimit\n\n return (\n \n \n New service\n \n \n \n \n \n \n }\n >\n {maxReached ? (\n \n Desktop currently supports a maximum of {setupServicesLimit} services.\n \n ) : (\n \n {\n dispatch.ui.set({ setupAddingService: true })\n device?.configurable && (await dispatch.devices.cloudAddService({ form, deviceId: device?.id }))\n dispatch.ui.set({ setupAddingService: false })\n }}\n onChange={form => setForward(isRelay(form))}\n onCancel={() => history.push(location.pathname.replace(REGEX_LAST_PATH, ''))}\n />\n \n )}\n \n )\n}\n","import React from 'react'\nimport classnames from 'classnames'\nimport { MOBILE_WIDTH } from '../constants'\nimport { List, ListProps, useMediaQuery } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../styling'\n\ntype Props = ListProps & {\n size?: 'large' | 'small'\n hideIcons?: boolean\n}\n\nexport const ListHorizontal: React.FC = ({ size = 'large', hideIcons, children, ...props }) => {\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const css = useStyles({ hideIcons, mobile, small: size === 'small' })\n return (\n \n {children}\n \n )\n}\n\nconst useStyles = makeStyles({\n horizontal: ({ mobile, small }: any) => ({\n display: 'flex',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n flexWrap: 'wrap',\n marginTop: spacing.md,\n paddingRight: spacing.xs,\n paddingLeft: spacing.md,\n '& .MuiListItemIcon-root': {\n justifyContent: 'flex-start',\n },\n '& .MuiListItemButton-root': {\n display: small ? undefined : 'block',\n minWidth: mobile ? undefined : 100,\n width: mobile ? 90 : 100,\n paddingLeft: small ? undefined : spacing.md,\n paddingTop: small ? undefined : spacing.lg,\n paddingBottom: small ? undefined : spacing.sm,\n paddingRight: spacing.md,\n flexGrow: 'initial',\n margin: 1,\n },\n '& .MuiListItemText-root > .MuiTypography-root': {\n fontSize: mobile ? '12px' : undefined,\n },\n }),\n})\n","import React from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { selectSessionUsers } from '../selectors/sessions'\nimport { selectMembersWithAccess } from '../selectors/organizations'\nimport { ListItemIcon, ListItemText, Typography } from '@mui/material'\nimport { ListItemLocation } from './ListItemLocation'\nimport { GuideBubble } from './GuideBubble'\nimport { makeStyles } from '@mui/styles'\nimport { Icon } from './Icon'\n\ntype Props = {\n instance?: IInstance\n service?: IService\n menuItem?: boolean\n to: string\n size?: 'large' | 'small'\n}\n\nexport const UsersTab: React.FC = ({ instance, service, menuItem, to, size = 'large' }) => {\n const css = useStyles()\n const connected = useSelector((state: State) =>\n selectSessionUsers(state, undefined, service ? service.id : instance?.id)\n ).length\n const access = useSelector((state: State) => selectMembersWithAccess(state, undefined, instance)).map(m => m.user)\n const users = (service ? service.access : instance?.access) || []\n const usersLinked = access.filter(user => !users.find(_u => _u.email === user.email))\n const total = users.length + usersLinked.length\n\n if (!instance?.permissions.includes('MANAGE')) return null\n\n return (\n \n \n The power of sharing\n \n \n Sharing can be done directly to a guest user from here, or by adding members to your\n Organization.\n \n \n }\n >\n \n \n \n \n \n {total ? total + ' total' : ''}\n
\n {!!connected && {connected} connected}\n \n )\n }\n />\n
\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n text: { color: palette.primary.main },\n}))\n","import React, { useContext } from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { Typography } from '@mui/material'\nimport { attributeName } from '@common/nameHelper'\nimport { ListItemLocation } from './ListItemLocation'\nimport { LoadingMessage } from './LoadingMessage'\nimport { ListHorizontal } from './ListHorizontal'\nimport { ShareButton } from '../buttons/ShareButton'\nimport { Container } from './Container'\nimport { UsersTab } from './UsersTab'\nimport { MobileUI } from './MobileUI'\nimport { Gutters } from './Gutters'\nimport { Title } from './Title'\n\nexport const DeviceHeaderMenu: React.FC<{ header?: any; children?: React.ReactNode }> = ({ header, children }) => {\n const { device } = useContext(DeviceContext)\n\n if (!device) return \n\n return (\n \n \n {attributeName(device) || 'Unknown'}\n \n \n \n \n {device.attributes.description && (\n \n \n {device.attributes.description}\n \n \n )}\n \n \n \n \n \n \n {header}\n \n }\n >\n {children}\n \n )\n}\n","import { IconButton, Tooltip } from '@mui/material'\nimport React, { useState } from 'react'\nimport { windowOpen } from '../../services/browser'\nimport { Icon } from '../../components/Icon'\n\ninterface CSVDownloadButtonProps {\n fetchUrl: () => Promise\n}\n\nexport function CSVDownloadButton({ fetchUrl }: CSVDownloadButtonProps) {\n const [fetching, setFetching] = useState(false)\n\n const download = async () => {\n setFetching(true)\n const url = await fetchUrl()\n if (url) windowOpen(url)\n setFetching(false)\n }\n\n return (\n \n \n \n \n \n )\n}\n","import React, { useState } from 'react'\nimport { DateTime } from 'luxon'\nimport { TextField } from '@mui/material'\nimport { DatePicker as MuiDatePicker, LocalizationProvider } from '@mui/x-date-pickers'\nimport { AdapterLuxon } from '@mui/x-date-pickers/AdapterLuxon'\nimport { getDateFormatString } from '../../helpers/dateHelper'\n\ntype Props = {\n minDay?: Date\n selectedDate?: Date\n onChange?: (date: Date | null) => void\n}\n\nexport const DatePicker: React.FC = ({ onChange, minDay, selectedDate }) => {\n const [open, setOpen] = useState(false)\n if (!onChange) return null\n return (\n \n setOpen(true)} />}\n value={selectedDate ? DateTime.fromJSDate(selectedDate) : DateTime.now()} // Convert Date to DateTime\n onChange={(date: DateTime | null) => onChange(date?.toJSDate() || null)}\n onClose={() => setOpen(false)}\n disableFuture={true}\n minDate={minDay ? DateTime.fromJSDate(minDay) : undefined}\n disableOpenPicker\n >\n \n )\n}\n","import React, { useEffect } from 'react'\nimport { isToday } from '../../helpers/dateHelper'\nimport { DateTime } from 'luxon'\nimport { limitDays } from '../../models/plans'\nimport { selectLimit } from '../../selectors/organizations'\nimport { Dispatch, State } from '../../store'\nimport { selectActiveAccountId } from '../../selectors/accounts'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { List, ListItem, ListItemSecondaryAction } from '@mui/material'\nimport { CSVDownloadButton } from '../../buttons/CSVDownloadButton'\nimport { DatePicker } from '../DatePicker'\n\nconst DAY = 1000 * 60 * 60 * 24\n\nexport const EventHeader: React.FC<{ device?: IDevice }> = ({ device }) => {\n const dispatch = useDispatch()\n const { fetch, set } = dispatch.logs\n\n const logLimit = useSelector((state: State) => selectLimit(state, undefined, 'log-limit'))\n const activeAccount = useSelector(selectActiveAccountId)\n const { events, deviceId, minDate, selectedDate } = useSelector((state: State) => state.logs)\n\n let allowed = limitDays(logLimit?.value)\n\n const getMinDays = () => {\n let lifetimeDays = 0\n if (device) {\n const createdAt = device?.createdAt ? new Date(device.createdAt) : new Date()\n lifetimeDays = Math.floor((new Date().getTime() - createdAt.getTime()) / DAY)\n }\n let limit = allowed\n if (lifetimeDays > 0) {\n if (lifetimeDays > allowed) {\n set({ planUpgrade: true })\n } else {\n set({ planUpgrade: false })\n limit = lifetimeDays\n }\n } else {\n set({ planUpgrade: true })\n }\n return DateTime.now().endOf('day').minus({ days: limit }).toJSDate()\n }\n\n useEffect(() => {\n set({ daysAllowed: allowed, minDate: getMinDays(), maxDate: undefined, selectedDate: undefined })\n if (!events.items.length || device?.id !== deviceId) {\n set({ deviceId: device?.id, after: undefined, events: { ...events, items: [] } })\n fetch()\n }\n }, [activeAccount])\n\n const handleChangeDate = (date: Date | null | undefined) => {\n // set to end of day\n date?.setHours(23, 59, 59, 999)\n date = date || undefined\n set({\n selectedDate: date,\n after: undefined,\n minDate,\n maxDate: date && isToday(date) ? undefined : date,\n events: { ...events, items: [] },\n })\n fetch()\n }\n\n return (\n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { combinedName } from '@common/nameHelper'\nimport { Pre } from '../Pre'\n\nexport const EventActions = ['add', 'update']\n\nexport const EventState = {\n active: 'active',\n connected: 'connected',\n}\n\nexport function EventMessage({\n item,\n device,\n loggedInUser,\n}: {\n item: IEvent\n device?: IDevice\n loggedInUser: IUser\n}): JSX.Element {\n const target = item.target?.[0] //(item.target?.map(service => service.name) || []).join(' + ')\n let name = combinedName(target, target?.device, ' - ')\n if (!name) name = target?.id ? `${target.id} (deleted)` : 'Unknown'\n const actorName = item.actor?.email === loggedInUser.email ? 'You' : item.actor?.email\n const actorAdjective = actorName === 'You' ? 'your' : 'their'\n\n const messageDevice = device || item.devices?.[0]\n const deviceName = messageDevice?.name || ''\n const users = item.users?.map(user => user.email || '(deleted)') || []\n const userList = users.length === 1 ? users[0] : `${users.slice(0, -1).join(', ')} and ${users.slice(-1)}`\n const affected = userList === loggedInUser.email ? 'you' : userList\n\n let message: JSX.Element | string = ''\n switch (item.type) {\n case 'AUTH_LOGIN':\n message = (\n <>\n {actorName} logged in\n \n )\n break\n case 'AUTH_LOGIN_ATTEMPT':\n message = (\n <>\n {actorName} attempted to log in\n \n )\n break\n case 'AUTH_PASSWORD_CHANGE':\n message = (\n <>\n {actorName} changed {actorAdjective} password\n \n )\n break\n case 'AUTH_PASSWORD_RESET':\n message = (\n <>\n {actorName} reset {actorAdjective} password\n \n )\n break\n case 'AUTH_PASSWORD_RESET_CONFIRMED':\n message = (\n <>\n Reset password was confirmed for {actorName}\n \n )\n break\n case 'AUTH_PHONE_CHANGE':\n message = 'Phone number changed'\n break\n case 'AUTH_MFA_ENABLED':\n message = 'Multi-factor authentication (MFA) enabled'\n break\n case 'AUTH_MFA_DISABLED':\n message = 'Multi-factor authentication (MFA) disabled'\n break\n case 'DEVICE_STATE':\n message = (\n <>\n {name} \n {item.state === EventState.active ? 'went online' : 'went offline'}\n \n )\n break\n\n case 'DEVICE_CONNECT':\n message = (\n <>\n {actorName} {item.state === EventState.connected ? 'connected to' : 'disconnected from'} {name} \n \n )\n break\n\n case 'DEVICE_SHARE':\n if (item.shared) {\n message = (\n <>\n {actorName} shared {deviceName} and {item.scripting ? 'allowed' : 'restricted'} script execution with\n {affected}\n \n )\n } else if (EventActions.includes(item.action)) {\n message = (\n <>\n {actorName} shared {deviceName} with {affected}\n \n )\n } else if (actorName?.toLowerCase() === affected) {\n message = (\n <>\n You left the shared device {deviceName}\n \n )\n } else {\n message = (\n <>\n {actorName} removed sharing of {deviceName} from {affected}\n \n )\n }\n break\n\n case 'DEVICE_TRANSFER':\n message = (\n <>\n {actorName} transferred {deviceName} to {affected}\n \n )\n break\n\n case 'DEVICE_DELETE':\n message = (\n <>\n {actorName} deleted {name}\n \n )\n break\n\n case 'LICENSE_UPDATED':\n message = Your license was updated\n break\n\n case 'JOB':\n message = (\n <>\n Script {item.job?.file?.name} {statusDisplay(item.action.toUpperCase() as IJobStatus)} on{' '}\n {item.devices?.length} devices\n \n )\n break\n\n case 'DEVICE_JOB':\n message = (\n <>\n Script {item.job?.file?.name} {statusDisplay(item.action.toUpperCase() as IJobStatus)} on{' '}\n {item.devices?.[0].name}\n {/* \n
{item}
\n
*/}\n \n )\n break\n\n default:\n message = <>Unknown event type {item.type} occurred\n }\n\n return
{message}
\n}\n\nfunction statusDisplay(status?: IJobStatus): string {\n switch (status) {\n case 'READY':\n return 'was ready to run'\n case 'WAITING':\n return 'waited to run'\n case 'RUNNING':\n return 'ran'\n case 'FAILED':\n return 'failed'\n case 'SUCCESS':\n return 'ran successfully'\n case 'CANCELLED':\n return 'was cancelled'\n default:\n return 'did something strange'\n }\n}","import React from 'react'\nimport { Box, Tooltip } from '@mui/material'\nimport { Sizes } from '../styling'\nimport { Icon, IconProps } from './Icon'\n\ntype JobStatusIconProps = IconProps & {\n status?: IJobStatus\n size?: Sizes\n device?: boolean\n title?: boolean\n padding?: number\n}\n\nexport const JobStatusIcon: React.FC = ({\n status,\n title = true,\n padding = 0.7,\n device,\n ...props\n}) => {\n const icon = (\n \n {status === 'READY' ? (\n \n ) : status === 'SUCCESS' ? (\n \n ) : status === 'FAILED' || status === 'CANCELLED' ? (\n \n ) : status === 'WAITING' ? (\n \n ) : status === 'RUNNING' ? (\n \n ) : device ? (\n \n ) : (\n \n )}\n \n )\n\n return title ? (\n \n {icon}\n \n ) : (\n icon\n )\n}\n","import React from 'react'\nimport { Icon } from '../Icon'\nimport { EventState, EventActions } from './EventMessage'\nimport { JobStatusIcon } from '../JobStatusIcon'\n\ntype Props = {\n item: IEvent\n loggedInUser: IUser\n}\n\nexport function EventIcon({ item, loggedInUser }: Props): JSX.Element {\n let color: Color = 'gray'\n let icon = ''\n let title = ''\n switch (item.type) {\n case 'AUTH_LOGIN':\n icon = 'arrow-right-to-bracket'\n color = 'primary'\n break\n case 'AUTH_LOGIN_ATTEMPT':\n icon = 'arrow-right-to-bracket'\n color = 'grayDarker'\n break\n case 'AUTH_PASSWORD_CHANGE':\n case 'AUTH_PASSWORD_RESET':\n case 'AUTH_PASSWORD_RESET_CONFIRMED':\n icon = 'key-skeleton'\n color = 'grayDarker'\n break\n case 'AUTH_PHONE_CHANGE':\n icon = 'phone'\n color = 'grayDarker'\n break\n case 'AUTH_MFA_ENABLED':\n icon = 'shield'\n color = 'success'\n break\n case 'AUTH_MFA_DISABLED':\n icon = 'shield-slash'\n color = 'warning'\n break\n\n case 'DEVICE_STATE':\n if (item.state === EventState.active) {\n icon = 'check-circle'\n color = 'success'\n title = 'Device Online'\n } else {\n icon = 'minus-circle'\n color = 'gray'\n title = 'Device Offline'\n }\n break\n\n case 'DEVICE_CONNECT':\n if (item.state === EventState.connected) {\n icon = 'dot-circle'\n color = 'primary'\n title = 'Device Connected'\n } else {\n icon = 'dot-circle'\n color = 'grayDarker'\n title = 'Device Disconnected'\n }\n break\n\n case 'DEVICE_SHARE':\n if (EventActions.includes(item.action)) {\n icon = 'user-plus'\n color = 'success'\n title = 'Device Shared'\n } else {\n icon = 'user-minus'\n color = 'dangerLight'\n title = 'Device Share Removed'\n }\n break\n\n case 'DEVICE_TRANSFER':\n title = 'Device transferred'\n if (item.actor?.email === loggedInUser.email) {\n icon = 'circle-arrow-right'\n color = 'danger'\n } else {\n icon = 'circle-arrow-left'\n color = 'primary'\n }\n break\n\n case 'DEVICE_DELETE':\n icon = 'circle-xmark'\n color = 'danger'\n title = 'Device deleted'\n break\n\n case 'JOB':\n case 'DEVICE_JOB':\n return \n\n case 'LICENSE_UPDATED':\n icon = 'info-circle'\n color = 'primary'\n title = 'License changed'\n break\n\n default:\n icon = 'question-circle'\n title = 'Unknown Event'\n }\n\n return \n}\n","import React from 'react'\nimport { ListItem, ListItemIcon } from '@mui/material'\nimport { EventIcon } from './EventIcon'\nimport { EventMessage } from './EventMessage'\n\nconst options: Intl.DateTimeFormatOptions = {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n}\n\nexport function EventItem({ item, device, user }: { item: IEvent; device?: IDevice; user: IUser }) {\n // Filter refresh events - eventually we need to exclude these in the API query\n if (item.type === 'DEVICE_REFRESH') return null\n return (\n \n {new Date(item.timestamp).toLocaleDateString(navigator.language, options)}\n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\nimport { makeStyles } from '@mui/styles'\nimport { selectLimit } from '../../selectors/organizations'\nimport { State, Dispatch } from '../../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { List, Box, Button, Typography } from '@mui/material'\nimport { fontSizes, spacing } from '../../styling'\nimport { humanizeDays } from '../../models/plans'\nimport { EventItem } from './EventItem'\nimport { Notice } from '../Notice'\nimport { Pre } from '../Pre'\n\nexport interface LogListProps {\n device?: IDevice\n}\n\nexport const EventList: React.FC = ({ device }) => {\n const css = useStyles()\n const dispatch = useDispatch()\n const user = useSelector((state: State) => state.user)\n const logLimit = useSelector((state: State) => selectLimit(state, undefined, 'log-limit'))\n const { events, planUpgrade, fetching, fetchingMore } = useSelector((state: State) => state.logs)\n\n const fetchMore = async () => {\n await dispatch.logs.set({ deviceId: device?.id, after: events?.last })\n await dispatch.logs.fetch()\n }\n\n return (\n <>\n \n {events?.items?.map((item, index) => (\n \n ))}\n \n {!events?.hasMore && !fetching && planUpgrade ? (\n \n Upgrade\n \n }\n >\n Plan upgrade required to view logs past {humanizeDays(logLimit?.value)}.\n \n ) : (\n \n {fetching || fetchingMore ? (\n \n ) : events?.hasMore ? (\n \n ) : (\n \n End of Logs\n \n )}\n \n )}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette, breakpoints }) => ({\n box: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n padding: spacing.lg,\n paddingBottom: spacing.xl,\n height: 100,\n },\n item: {\n '& li': {\n padding: `4px 0`,\n fontSize: fontSizes.sm,\n color: palette.grayDark.main,\n alignItems: 'start',\n '& > span': {\n fontSize: fontSizes.xxs,\n textAlign: 'right',\n fontFamily: 'Roboto Mono',\n minWidth: 150,\n [breakpoints.down('sm')]: { minWidth: 100, width: 100 },\n },\n '& b': {\n color: palette.grayDarkest.main,\n fontWeight: 400,\n },\n '& i': {\n color: palette.grayDarker.main,\n fontStyle: 'normal',\n },\n },\n },\n}))\n","import React from 'react'\nimport { DeviceHeaderMenu } from '../../components/DeviceHeaderMenu'\nimport { EventHeader } from '../../components/EventList/EventHeader'\nimport { EventList } from '../../components/EventList'\n\nexport const DeviceLogPage: React.FC<{ device?: IDevice }> = ({ device }) => {\n if (!device) return null\n\n return (\n }>\n \n \n )\n}\n","import React, { useContext } from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { DeviceContext } from '../services/Context'\nimport { DeviceHeaderMenu } from '../components/DeviceHeaderMenu'\nimport { selectDeviceDetailAttributes } from '../selectors/devices'\nimport { selectLimitsLookup } from '../selectors/organizations'\nimport { DataDisplay } from '../components/DataDisplay'\nimport { GraphItem } from '../components/GraphItem'\nimport { Gutters } from '../components/Gutters'\n\nexport const DeviceDetailPage: React.FC = () => {\n const { device } = useContext(DeviceContext)\n const limits = useSelector((state: State) => selectLimitsLookup(state, device?.accountId))\n const attributes = useSelector(selectDeviceDetailAttributes)\n\n return (\n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { selectSessionUsers } from '../selectors/sessions'\nimport { SharedUsersLists } from '../components/SharedUsersLists'\nimport { DeviceHeaderMenu } from '../components/DeviceHeaderMenu'\nimport { useSelector } from 'react-redux'\n\nexport const DeviceUsersPage: React.FC<{ device?: IDevice }> = ({ device }) => {\n const connected = useSelector((state: State) => selectSessionUsers(state, undefined, device?.id))\n const users = device?.access\n\n return (\n \n \n \n )\n}\n","import React, { useContext } from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { MAX_DESCRIPTION_LENGTH } from '../constants'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\n\nexport const DeviceDescriptionSetting: React.FC = () => {\n const { devices } = useDispatch()\n const { device } = useContext(DeviceContext)\n\n if (!device) return null\n\n return (\n {\n const updated = structuredClone(device)\n updated.attributes = { ...device.attributes, description: description.toString() }\n devices.setAttributes(updated)\n }}\n />\n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { Box, BoxProps } from '@mui/material'\n\nexport const TestUI: React.FC = ({ children, ...props }) => {\n const { testUI } = useSelector((state: State) => state.ui)\n\n if (!testUI) return null\n\n if (testUI !== 'HIGHLIGHT') return children\n\n return (\n \n {children}\n \n )\n}\n","import React, { useContext } from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { TestUI } from './TestUI'\n\nexport const DevicePresenceSetting: React.FC = () => {\n const dispatch = useDispatch()\n const { device } = useContext(DeviceContext)\n\n if (!device) return null\n\n return (\n \n \n dispatch.devices.cloudUpdatePresenceAddress({\n id: device.id,\n set: { presenceAddress: value?.toString() || '' },\n })\n }\n />\n \n )\n}\n","import React, { useEffect, useState, useContext } from 'react'\nimport { DeviceContext } from '../../services/Context'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport {\n Chip,\n List,\n ListItemIcon,\n ListItemButton,\n ListItemSecondaryAction,\n ListItemText,\n Switch,\n Typography,\n} from '@mui/material'\nimport { IconButton } from '../../buttons/IconButton'\nimport { Title } from '../Title'\nimport { Icon } from '../Icon'\n\nexport const NotificationSettings: React.FC = () => {\n const { device } = useContext(DeviceContext)\n const { devices } = useDispatch()\n const globalNotificationEmail = useSelector((state: State) => state.user.notificationSettings?.emailNotifications)\n const globalNotificationSystem = useSelector((state: State) => state.user.notificationSettings?.desktopNotifications)\n const [emailNotification, setEmailNotification] = useState(\n device?.notificationSettings?.emailNotifications\n )\n const [inAppNotification, setInAppNotification] = useState(\n device?.notificationSettings?.desktopNotifications\n )\n const [inAppOverridden, setInAppOverridden] = useState()\n const [emailOverridden, setEmailOverridden] = useState()\n\n useEffect(() => {\n setInAppOverridden(typeof inAppNotification === 'boolean')\n }, [inAppNotification])\n\n useEffect(() => {\n setEmailOverridden(typeof emailNotification === 'boolean')\n }, [emailNotification])\n\n if (!device) return null // TODO refactor and make undefined check in devicerouter\n\n const handleEmailNotifications = async () => {\n const currentEmailNotification = emailOverridden ? emailNotification || false : globalNotificationEmail\n setEmailNotification(!currentEmailNotification)\n const item = {\n ...device,\n notificationSettings: {\n ...device.notificationSettings,\n emailNotifications: !currentEmailNotification,\n },\n }\n await devices.setNotificationDevice(item)\n }\n\n const handleInAppNotifications = async () => {\n const currentDesktopNotification = inAppOverridden ? inAppNotification || false : globalNotificationSystem\n setInAppNotification(!currentDesktopNotification)\n const item = {\n ...device,\n notificationSettings: {\n ...device.notificationSettings,\n desktopNotifications: !currentDesktopNotification,\n },\n }\n await devices.setNotificationDevice(item)\n }\n\n const onClose = (value: string) => {\n switch (value) {\n case 'inapp':\n setInAppOverridden(false)\n setInAppNotification(undefined)\n const itemInApp = {\n ...device,\n notificationSettings: {\n desktopNotifications: null,\n },\n }\n devices.setNotificationDevice(itemInApp)\n break\n\n case 'email':\n setEmailOverridden(false)\n setEmailNotification(undefined)\n const itemEmail = {\n ...device,\n notificationSettings: {\n emailNotifications: null,\n },\n }\n devices.setNotificationDevice(itemEmail)\n break\n }\n }\n\n const chipOverridden = (value: string = 'inapp') => {\n return (\n }\n onDelete={() => onClose(value)}\n />\n )\n }\n\n if (!device) return null\n\n const inapp = inAppOverridden ? inAppNotification || false : globalNotificationSystem\n const email = emailOverridden ? emailNotification || false : globalNotificationEmail\n\n return (\n <>\n \n Device Notifications\n \n \n \n \n \n \n \n \n \n {inAppOverridden && chipOverridden('inapp')}\n \n \n \n \n \n \n \n \n \n {emailOverridden && chipOverridden('email')}\n \n \n \n \n \n )\n}\n","import React, { useContext } from 'react'\nimport { DeviceContext } from '../../services/Context'\nimport { State, Dispatch } from '../../store'\nimport { MAX_NAME_LENGTH } from '@common/constants'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { safeHostname, attributeName } from '@common/nameHelper'\nimport { InlineTextFieldSetting, InlineTextFieldSettingProps } from '../InlineTextFieldSetting'\nimport { getDevices } from '../../selectors/devices'\n\nexport const DeviceNameSetting: React.FC = props => {\n const { device } = useContext(DeviceContext)\n const dispatch = useDispatch()\n const hostname = useSelector((state: State) => state.backend.environment.hostname)\n const nameBlacklist = useSelector(getDevices)\n .filter((device: IDevice) => !device.shared)\n .map((d: IDevice) => d.name.toLowerCase())\n\n if (!device) return null\n\n const name = attributeName(device)\n const defaultValue = device.thisDevice ? safeHostname(hostname, nameBlacklist) : device.name\n\n return (\n {\n dispatch.accounts.setDevice({ id: device.id, device: { ...device, name: name.toString() } })\n dispatch.devices.rename({ id: device.id, name: name.toString() })\n }}\n {...props}\n />\n )\n}\n","import React, { useContext } from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { DeviceDescriptionSetting } from '../components/DeviceDescriptionSetting'\nimport { DevicePresenceSetting } from '../components/DevicePresenceSetting'\nimport { NotificationSettings } from '../components/NotificationSettings'\nimport { DeviceNameSetting } from '../components/DeviceNameSetting'\nimport { DeviceHeaderMenu } from '../components/DeviceHeaderMenu'\nimport { Gutters } from '../components/Gutters'\nimport { List } from '@mui/material'\n\nexport const DeviceEditPage: React.FC = () => {\n const { device } = useContext(DeviceContext)\n\n return (\n \n {device?.permissions.includes('MANAGE') && (\n \n \n \n \n \n \n \n )}\n \n \n )\n}\n","import React from 'react'\nimport { Stack } from '@mui/material'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { canEditTags } from '../models/tags'\nimport { selectTags } from '../selectors/tags'\nimport { TagEditor } from './TagEditor'\nimport { Tags } from './Tags'\n\ntype Props = { device?: IDevice; button?: string }\n\nexport const DeviceTagEditor: React.FC = ({ device, button }) => {\n const accountId = useSelector((state: State) => selectActiveAccountId(state, device?.accountId))\n const tags = useSelector((state: State) => selectTags(state, accountId))\n const canEdit = useSelector((state: State) => canEditTags(state, accountId))\n const dispatch = useDispatch()\n const history = useHistory()\n\n if (!device) return null\n\n return (\n <>\n dispatch.tags.removeDevice({ tag, device, accountId }) : undefined}\n onClick={tag => {\n dispatch.devices.set({ tag: { values: [tag.name], operator: tag.operator } })\n dispatch.devices.fetchList()\n history.push('/devices')\n }}\n />\n {canEdit && (\n await dispatch.tags.create({ tag, accountId })}\n onSelect={tag => dispatch.tags.addDevice({ tag, device, accountId })}\n tags={tags}\n filter={device.tags}\n button={button}\n />\n )}\n \n )\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { IconButton } from '../IconButton'\nimport { GuideBubble } from '../../components/GuideBubble'\nimport { Typography } from '@mui/material'\n\ntype Props = { device?: IDevice; editable?: boolean; link: string }\n\nexport const AddServiceButton: React.FC = ({ device, editable, link }) => {\n const history = useHistory()\n\n if (!device || !editable) return null\n\n return (\n \n \n Add a service (application)\n \n \n This device can be dynamically setup to host new services.\n \n \n }\n >\n history.push(link)} />\n \n )\n}","import React from 'react'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { IconButton, Menu, MenuItem } from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { Icon } from './Icon'\n\nexport function getSortOptions(key: ISortServiceType) {\n const option = optionSortServices[key]\n return option || {}\n}\n\nconst optionSortServices: IOptionServiceSort = {\n ATOZ: {\n name: 'Alpha A-Z',\n sortService: (a: IService, b: IService) =>\n a.name.toLowerCase() > b.name.toLowerCase() ? 1 : a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 0,\n icon: 'sort-alpha-down',\n },\n ZTOA: {\n name: 'Alpha Z-A',\n sortService: (a: IService, b: IService) =>\n a.name.toLowerCase() < b.name.toLowerCase() ? 1 : a.name.toLowerCase() > b.name.toLowerCase() ? -1 : 0,\n icon: 'sort-alpha-up',\n },\n NEWEST: {\n name: 'Newest first',\n sortService: (a: IService, b: IService) => (a.createdAt < b.createdAt ? 1 : -1),\n icon: 'sort-amount-down',\n },\n OLDEST: {\n name: 'Oldest first',\n sortService: (a: IService, b: IService) => (a.createdAt > b.createdAt ? 1 : -1),\n icon: 'sort-amount-up',\n },\n}\n\nexport const SortServices: React.FC = () => {\n const [anchorEl, setAnchorEl] = React.useState(null)\n const { devices } = useDispatch()\n const sortService = useSelector((state: State) => selectDeviceModelAttributes(state).sortServiceOption)\n const option = getSortOptions(sortService)\n const open = Boolean(anchorEl)\n\n const handleClick = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget)\n }\n\n const handleClose = () => {\n setAnchorEl(null)\n }\n\n const servicesSort = async (option?: ISortServiceType) => {\n devices.set({ sortServiceOption: option })\n handleClose()\n }\n\n if (!option) return null\n\n return (\n <>\n \n \n \n \n {Object.keys(optionSortServices).map(key => (\n servicesSort(key as ISortServiceType)}\n dense\n >\n {optionSortServices[key].name}\n \n ))}\n \n \n )\n}\n","import React, { useState } from 'react'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { Chip, Menu, MenuItem, ListSubheader, ListItemIcon, ListItemText } from '@mui/material'\nimport { Link } from 'react-router-dom'\nimport { Icon } from './Icon'\n\ntype Props = { device?: IDevice }\n\nexport const DeviceScriptingMenu: React.FC = ({ device }) => {\n const [anchorEl, setAnchorEl] = useState(null)\n const handleClick = event => setAnchorEl(event.currentTarget)\n const handleClose = () => setAnchorEl(null)\n const dispatch = useDispatch()\n\n if (!device?.permissions.includes('SCRIPTING')) return null\n\n return (\n <>\n \n \n SCRIPT\n \n }\n sx={{ fontWeight: 500, letterSpacing: 1, color: 'grayDarker.main' }}\n size=\"small\"\n onClick={handleClick}\n />\n {/* */}\n \n \n Run script\n \n dispatch.ui.set({ selected: [device.id] })}\n component={Link}\n >\n \n \n \n \n \n dispatch.ui.set({ selected: [device.id] })} component={Link}>\n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Icon } from '../Icon'\nimport { IconProps } from '../Icon'\nimport { Tooltip } from '@mui/material'\nimport { useHistory } from 'react-router-dom'\nimport { makeStyles } from '@mui/styles'\nimport { IconButton, Badge } from '@mui/material'\nimport { spacing, Sizes } from '../../styling'\n\nexport interface ConnectionStateIconProps extends Partial {\n connection?: IConnection\n service?: IService\n device?: IDevice\n mini?: boolean\n size?: Sizes\n}\n\nexport function ConnectionStateIcon({\n connection,\n service,\n device,\n mini,\n size = 'md',\n ...props\n}: ConnectionStateIconProps) {\n const history = useHistory()\n\n let name\n let showQuality = device?.quality === 'POOR' || device?.quality === 'MODERATE'\n let element: any\n let quality: any\n let spin = false\n\n if (connection?.connecting || connection?.starting) {\n name = 'spinner-third'\n showQuality = false\n spin = true\n }\n\n const css = useStyles()\n\n if (mini)\n element = (\n \n \n \n )\n else {\n element = \n }\n\n if (showQuality && device) {\n quality = (\n <>\n \n Stability {device.quality.toLowerCase()}\n \n )\n\n element = (\n {\n event.stopPropagation()\n history.push(`/devices/${device.id}/details`)\n }}\n size=\"large\"\n >\n \n {element}\n \n \n )\n }\n\n return quality ? (\n \n {element}\n \n ) : (\n element\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n capitalize: { textTransform: 'capitalize' },\n icon: { lineHeight: 1 },\n mini: {\n '& > span': {\n height: 4,\n borderRadius: 4,\n width: spacing.md,\n display: 'inline-block',\n marginLeft: spacing.xxs,\n },\n },\n combo: {\n '& sup': {\n position: 'absolute',\n marginTop: -6,\n marginLeft: -8,\n backgroundColor: palette.white.main,\n borderRadius: '50%',\n },\n },\n moderate: { backgroundColor: palette.warning.main },\n poor: { backgroundColor: palette.danger.main },\n button: { margin: `${-spacing.sm}px ${-spacing.sm}px` },\n badge: { boxShadow: `0 0 4px 3px ${palette.grayLightest.main}` },\n}))\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { MAX_NAME_LENGTH } from '@common/constants'\nimport { ListItemLocation, ListItemLocationProps } from './ListItemLocation'\nimport { Typography, ListItemSecondaryAction, Box } from '@mui/material'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { ConnectionStateIcon } from './ConnectionStateIcon'\nimport { attributeName } from '@common/nameHelper'\nimport { useDispatch } from 'react-redux'\nimport { DeviceName } from './DeviceName'\nimport { IconButton } from '../buttons/IconButton'\nimport { fontSizes } from '../styling'\n\ntype Props = {\n device: IDevice\n connection?: IConnection\n editable: boolean\n}\n\ntype DisplayComponentProps = Props & ListItemLocationProps & { onClick?: () => void }\n\nexport const DeviceNameLocation: React.FC = props => {\n const dispatch = useDispatch()\n const icon = \n return (\n \n }\n onSave={name => {\n dispatch.accounts.setDevice({ id: props.device.id, device: { ...props.device, name: name.toString() } })\n dispatch.devices.rename({ id: props.device.id, name: name.toString() })\n }}\n fieldProps={{\n sx: { '& input.MuiInput-input': { fontSize: fontSizes.md } },\n }}\n />\n \n )\n}\n\nconst DisplayComponent: React.FC = ({\n device,\n connection,\n editable,\n onClick,\n disabled,\n ...props\n}) => {\n const dispatch = useDispatch()\n return (\n \n \n \n }\n subtitle={device.thisDevice ? 'This device' : undefined}\n onClick={() => dispatch.ui.setDefaultService({ deviceId: device.id, serviceId: null })}\n exactMatch\n {...props}\n >\n {editable && (\n \n {\n event.stopPropagation()\n event.preventDefault()\n onClick?.()\n }}\n onMouseDown={event => event.stopPropagation()}\n icon=\"pencil\"\n color=\"grayDark\"\n size=\"sm\"\n sx={{ zIndex: 6 }}\n />\n \n )}\n \n )\n}\n","import React from 'react'\nimport { Divider, Tooltip } from '@mui/material'\nimport { selectNetworkByService } from '../selectors/networks'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { Icon } from './Icon'\n\ntype Props = {\n instance?: IInstance\n service: IService\n}\n\nexport const NetworksIndicator: React.FC = ({ instance, service }) => {\n const joinedNetworks = useSelector((state: State) => selectNetworkByService(state, service.id))\n\n if (!joinedNetworks.length || !instance?.permissions.includes('MANAGE') || instance.shared) return null\n\n return (\n \n Networks\n \n {joinedNetworks.map((n, i) => (\n
{n.name}
\n ))}\n \n }\n >\n \n \n )\n}\n","import React from 'react'\nimport {\n PERSONAL_PLAN_ID,\n PROFESSIONAL_PLAN_ID,\n BUSINESS_PLAN_ID,\n ENTERPRISE_PLAN_ID,\n FLEET_PLAN_ID,\n} from '../models/plans'\nimport { useSelector } from 'react-redux'\nimport { selectRemoteitLicense } from '../selectors/organizations'\nimport { State } from '../store'\nimport { ColorChip, Props as ChipProps } from './ColorChip'\nimport { useHistory } from 'react-router-dom'\n\nexport const PlanActionChip: React.FC = ({ ...props }) => {\n const license = useSelector((state: State) => selectRemoteitLicense(state))\n const history = useHistory()\n\n props.label ||= ''\n props.color ||= 'primary'\n\n switch (license?.plan.id) {\n case PERSONAL_PLAN_ID:\n props.label = 'Subscribe'\n props.variant = 'contained'\n break\n case PROFESSIONAL_PLAN_ID:\n props.label = 'Upgrade'\n break\n case BUSINESS_PLAN_ID:\n case FLEET_PLAN_ID:\n props.label = 'Update'\n break\n case ENTERPRISE_PLAN_ID:\n default:\n return null\n }\n\n return history.push('/account/plans')} />\n}\n","import React from 'react'\nimport { LinearProgress as MuiLinearProgress } from '@mui/material'\n\ntype Props = { loading?: boolean }\n\nexport const LinearProgress: React.FC = ({ loading }) =>\n loading ? (\n \n ) : null\n","import React from 'react'\nimport { IP_PRIVATE } from '@common/constants'\nimport { Tooltip } from '@mui/material'\nimport { Icon } from './Icon'\n\ntype Props = {\n service: IService\n}\n\nexport function JumpIndicator({ service }: Props) {\n if (!service.host || service.host === IP_PRIVATE || service.host.includes('localhost')) return null\n\n return (\n \n \n \n )\n}\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport { selectOrganization } from '../selectors/organizations'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { CopyCodeBlock, CopyCodeBlockProps } from './CopyCodeBlock'\nimport { Confirm } from './Confirm'\n\nexport function CopyRegistrationCode(props: CopyCodeBlockProps) {\n const dispatch = useDispatch()\n const { organization, user } = useSelector((state: State) => ({\n organization: selectOrganization(state),\n user: state.user,\n }))\n\n const setMessage = () => {\n dispatch.ui.set({\n noticeMessage: (\n <>\n The copied code will register devices to the {organization.name} organization.\n \n ),\n })\n }\n\n return \n}\n","import React, { useState, useEffect } from 'react'\nimport { Button, Dialog, DialogProps, DialogActions, DialogContent, DialogTitle, Typography } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { CopyRegistrationCode } from './CopyRegistrationCode'\nimport { attributeName } from '@common/nameHelper'\n\ntype Props = Omit & {\n device: IDevice\n}\n\nexport const RestoreModal: React.FC = ({ device, ...props }) => {\n const { showRestoreModal } = useSelector((state: State) => state.ui)\n const [loading, setLoading] = useState(false)\n const [result, setResult] = useState<{ restoreCommand?: string; restoreCode?: string }>({})\n const dispatch = useDispatch()\n\n useEffect(() => {\n if (!showRestoreModal || loading) return\n ;(async () => {\n setLoading(true)\n const result = await dispatch.devices.getRestoreCommand(device.id)\n setResult(result)\n setLoading(false)\n })()\n\n return function cleanup() {\n setResult({})\n setLoading(false)\n }\n }, [device, showRestoreModal])\n\n function onClose() {\n dispatch.ui.set({ showRestoreModal: false })\n }\n\n return (\n \n Restore “{attributeName(device)}”\n \n \n If you lost or deleted this device you can restore it by running the
\n following command on the device.\n
\n \n
\n \n \n \n
\n )\n}\n","import React, { useContext } from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { AddFromNetwork } from '../components/AddFromNetwork'\nimport { Dispatch, State } from '../store'\nimport { DeviceTagEditor } from '../components/DeviceTagEditor'\nimport { AddServiceButton } from '../buttons/AddServiceButton'\nimport { ListItemLocation } from '../components/ListItemLocation'\nimport { ServiceMiniState } from '../components/ServiceMiniState'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { Typography, Stack, List, ListItemText, ListItemSecondaryAction, CircularProgress } from '@mui/material'\nimport { getSortOptions, SortServices } from '../components/SortServices'\nimport { DeviceScriptingMenu } from '../components/DeviceScriptingMenu'\nimport { DeviceNameLocation } from '../components/DeviceNameLocation'\nimport { spacing, fontSizes } from '../styling'\nimport { NetworksIndicator } from '../components/NetworksIndicator'\nimport { LicensingNotice } from '../components/LicensingNotice'\nimport { PlanActionChip } from '../components/PlanActionChip'\nimport { LinearProgress } from '../components/LinearProgress'\nimport { ConnectButton } from '../buttons/ConnectButton'\nimport { JumpIndicator } from '../components/JumpIndicator'\nimport { RestoreModal } from '../components/RestoreModal'\nimport { GuideBubble } from '../components/GuideBubble'\nimport { DeviceName } from '../components/DeviceName'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from '../components/Container'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\n\nexport const DevicePage: React.FC = () => {\n const { connections, device, user } = useContext(DeviceContext)\n const dispatch = useDispatch()\n const location = useLocation()\n const history = useHistory()\n\n const sort = useSelector(selectDeviceModelAttributes).sortServiceOption\n const setupAddingService = useSelector((state: State) => state.ui.setupAddingService)\n const setupDeletingService = useSelector((state: State) => state.ui.setupDeletingService)\n const connectThisDevice = useSelector((state: State) => state.ui.connectThisDevice)\n\n if (!device)\n return (\n \n Device not found.\n \n )\n\n const editable = device.thisDevice || (device.configurable && device.permissions.includes('MANAGE'))\n const connection = connections?.find(c => c.deviceID === device.id && c.enabled)\n const thisDevice = device.thisDevice && device.owner.id === user.id\n const disableThisConnect = thisDevice && !connectThisDevice\n\n // reverse sort services by creation date\n const services = [...device.services]\n let servicePage = '/' + (location.pathname.split('/')[4] || 'connect')\n\n return (\n \n \n \n \n \n \n \n \n \n \n }\n >\n {device.license === 'UNLICENSED' ? (\n } gutterTop>\n Device unlicensed\n \n ) : (\n device.state === 'inactive' && (\n dispatch.ui.set({ showRestoreModal: true })}\n />\n )\n }\n >\n Device offline\n \n )\n )}\n \n Service\n \n \n \n \n \n {editable && }\n {editable && setupAddingService && (\n \n \n \n \n \n \n )}\n \n \n Available services\n \n \n The device's hosted services (applications) are listed here.\n \n \n Select a service to configure it or to start a connection.\n \n \n }\n >\n {services.sort(getSortOptions(sort).sortService).map(s => {\n const c = connections?.find(c => c.id === s.id)\n let pathname = `/devices/${device.id}/${s.id}${servicePage}`\n if (pathname === location.pathname) pathname = `/devices/${device.id}/${s.id}/connect`\n return (\n dispatch.ui.setDefaultService({ deviceId: device.id, serviceId: s.id })}\n disabled={setupDeletingService === s.id}\n inset={1.5}\n dense\n >\n history.push(`/devices/${device.id}/${s.id}`)}\n />\n } />\n \n \n \n \n )\n })}\n \n \n \n \n )\n}\n","import React, { useState } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../../store'\nimport { Typography, Button } from '@mui/material'\nimport { ContactSelector } from '../../components/ContactSelector'\nimport { useHistory } from 'react-router-dom'\nimport { Container } from '../../components/Container'\nimport { Gutters } from '../../components/Gutters'\nimport { Confirm } from '../../components/Confirm'\nimport { Notice } from '../../components/Notice'\n\ntype Props = { device?: IDevice }\n\nexport const DeviceTransferPage: React.FC = ({ device }) => {\n const { contacts = [], transferring } = useSelector((state: State) => ({\n contacts: state.contacts.all,\n transferring: state.ui.transferring,\n }))\n const history = useHistory()\n const [open, setOpen] = useState(false)\n const [selected, setSelected] = useState()\n const { devices } = useDispatch()\n\n const handleChange = (emails: string[]) => {\n setSelected(undefined)\n if (emails.length > 0) {\n setSelected(emails[0])\n }\n }\n const onCancel = () => history.goBack()\n const onTransfer = () => devices.transferDevice({ device, email: selected })\n\n if (!device) return null\n\n return (\n \n Transfer Device\n \n \n \n \n }\n >\n \n \n Your are transferring \"{device.name}\" to a new owner.\n \n \n Device transfer typically takes a few seconds to complete. An email will be sent to you and the new owner when\n the process is completed.\n \n \n \n \n \n \n {\n setOpen(false)\n onTransfer()\n }}\n onDeny={() => setOpen(false)}\n color=\"error\"\n title=\"Are you sure?\"\n action=\"Transfer\"\n >\n \n You will lose all access and control of this device upon transfer.\n \n \n You are about to transfer ownership of {device.name} and all of its services to\n {selected}.\n \n \n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { ScanPage } from '../pages/ScanPage'\nimport { DeviceContext } from '../services/Context'\nimport { ServiceRouter } from './ServiceRouter'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { Switch, Route, Redirect, useParams } from 'react-router-dom'\nimport { ServiceAddPage } from '../pages/ServiceAddPage'\nimport { DeviceLogPage } from '../pages/DeviceLogPage'\nimport { DeviceDetailPage } from '../pages/DeviceDetailPage'\nimport { DeviceUsersPage } from '../pages/DeviceUsersPage'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { DeviceEditPage } from '../pages/DeviceEditPage'\nimport { DynamicPanel } from '../components/DynamicPanel'\nimport { DevicePage } from '../pages/DevicePage'\nimport { SharePage } from '../pages/SharePage'\nimport { Panel } from '../components/Panel'\nimport { useSelector } from 'react-redux'\nimport { DeviceTransferPage } from '../pages/DeviceTransferPage'\n\nexport const DeviceRouter: React.FC<{ layout: ILayout }> = ({ layout }) => {\n const { deviceID } = useParams<{ deviceID?: string; serviceID?: string; networkID?: string }>()\n const { device } = React.useContext(DeviceContext)\n const { fetching, initialized } = useSelector(selectDeviceModelAttributes)\n const defaultServiceLookup = useSelector((state: State) => state.ui.defaultService)\n const waiting = fetching || !initialized\n\n const defaultService = () => {\n const lookupResult = defaultServiceLookup[deviceID || '']\n const validLookup = lookupResult === null || device?.services.find(s => s.id === lookupResult)\n const serviceId = validLookup ? lookupResult : device?.services?.[0]?.id\n const redirect = device?.state === 'active' && serviceId ? `${serviceId}/connect` : 'details'\n return { pathname: `/devices/${deviceID}/${redirect}`, state: { isRedirect: true } }\n }\n\n if (waiting && !device)\n return (\n \n \n \n )\n\n return (\n }\n secondary={\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n layout={layout}\n root=\"/devices/:deviceID\"\n />\n )\n}\n","import React from 'react'\nimport { selectConnection } from '../selectors/connections'\nimport { State } from '../store'\nimport { ConnectionListItem } from './ConnectionListItem'\nimport { useSelector } from 'react-redux'\nimport { selectById } from '../selectors/devices'\n\nexport interface NetworkListItemProps {\n serviceId: string\n session?: ISession\n network?: INetwork\n enabled?: boolean\n fallbackName?: string\n connectionsPage?: boolean\n children?: React.ReactNode\n}\n\nexport const NetworkListItem: React.FC = ({\n serviceId,\n session,\n network,\n enabled,\n fallbackName,\n connectionsPage,\n children,\n}) => {\n const [service, device] = useSelector((state: State) => selectById(state, undefined, serviceId))\n const connection = useSelector((state: State) => selectConnection(state, service))\n const external = !!session?.id && session.id !== connection.sessionId\n const offline = service?.state !== 'active' && !external\n const name = external ? session.target.name : connection.name || session?.target.name\n let to = `/networks/${network?.id}/${serviceId}`\n if (connectionsPage) to = `/connections/${serviceId}/${session?.id || 'none'}`\n const match = to\n to += connection && !external ? '/connect' : '/other'\n\n return (\n \n {children}\n \n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\nimport { IconButton } from '../buttons/IconButton'\nimport { ClearButton } from '../buttons/ClearButton'\nimport { NetworkListItem } from './NetworkListItem'\nimport { NetworkListTitle } from './NetworkListTitle'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { selectConnectionSessions, selectConnections } from '../selectors/connections'\nimport { Typography, Collapse, List, ListItem, ListItemIcon } from '@mui/material'\nimport { spacing, radius, fontSizes } from '../styling'\nimport { makeStyles } from '@mui/styles'\nimport { Tags } from './Tags'\n\nexport interface Props {\n network?: INetwork\n recent?: boolean\n connectionsPage?: boolean\n highlight?: boolean\n onClear?: (serviceId: string) => void\n}\n\nexport const Network: React.FC = ({ onClear, recent, highlight, network, connectionsPage }) => {\n const dispatch = useDispatch()\n const collapsed = useSelector((state: State) => state.ui.collapsed)\n const sessions = useSelector((state: State) => selectConnectionSessions(state))\n const networkEnabled = useSelector((state: State) =>\n selectConnections(state).some(c => c.enabled && network?.serviceIds.includes(c.id))\n )\n const css = useStyles({ highlight })\n\n if (!network?.id) return null\n\n const networkConnected = sessions.some(s => network?.serviceIds.includes(s.target.id))\n const expanded = !collapsed.includes(network.id)\n const toggle = (event: React.MouseEvent) => {\n event.stopPropagation()\n const updated = [...collapsed]\n if (expanded) updated.push(network.id)\n else updated.splice(updated.indexOf(network.id), 1)\n dispatch.ui.set({ collapsed: updated })\n }\n\n return (\n \n \n {recent && dispatch.connections.clearRecent()} />}\n \n \n \n \n {network?.serviceIds.map(id => (\n s.target.id === id)}\n fallbackName={network.connectionNames[id]}\n connectionsPage={connectionsPage}\n >\n {onClear && onClear(id)} className=\"hidden\" />}\n \n ))}\n {!network?.serviceIds.length && (\n \n \n \n Add services through the device list\n \n \n )}\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n list: ({ highlight }: Props) =>\n highlight\n ? {\n backgroundColor: highlight ? palette.primaryHighlight.main : undefined,\n margin: spacing.md,\n borderRadius: radius.sm,\n '& .MuiListItem-root': {\n width: `calc(100% - ${spacing.lg}px)`,\n marginLeft: spacing.sm,\n },\n '& .MuiListItemIcon-root:first-of-type': {\n marginLeft: -spacing.sm,\n },\n '& .MuiListItem-button': {\n '&:hover,&:focus,&.Mui-selected': {\n backgroundColor: palette.white.main,\n },\n },\n '& .Mui-selected': {\n backgroundColor: palette.white.main,\n },\n }\n : {},\n note: {\n color: palette.primary.main,\n textTransform: 'uppercase',\n letterSpacing: '0.2em',\n fontWeight: 500,\n fontSize: fontSizes.xxxs,\n marginRight: spacing.sm,\n },\n}))\n","import React from 'react'\nimport { Typography, Divider } from '@mui/material'\nimport { selectNetworks } from '../selectors/networks'\nimport { selectPermissions } from '../selectors/organizations'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { LinearProgress } from '../components/LinearProgress'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { GuideBubble } from '../components/GuideBubble'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from '../components/Container'\nimport { Network } from '../components/Network'\nimport { Gutters } from '../components/Gutters'\nimport { Title } from '../components/Title'\nimport { Icon } from '../components/Icon'\n\nexport const NetworksPage: React.FC = () => {\n const dispatch = useDispatch()\n const all = [...useSelector(selectNetworks)].sort((a, b) => (a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1))\n const initialized = useSelector((state: State) => state.networks.initialized)\n const permissions = useSelector(selectPermissions)\n const loading = useSelector(selectDeviceModelAttributes).fetching\n const networks = all.filter(n => !n.shared)\n const shared = all.filter(n => n.shared)\n const empty = !all?.length\n\n return (\n \n \n Networks\n {permissions.includes('MANAGE') && (\n \n \n Welcome to networks\n \n \n A network is a custom group of services organized for ease of access and sharing.\n \n \n Select the + icon to get started.\n \n \n }\n >\n \n \n )}\n \n \n \n }\n >\n {initialized ? (\n <>\n {empty && (\n \n \n \n \n You have no networks\n Add a network with the '+' button above.\n \n )}\n {networks.map(n => (\n dispatch.networks.remove({ serviceId: id, networkId: n.id })\n : undefined\n }\n />\n ))}\n {!!shared.length && (\n <>\n {!!networks.length && (\n <>\n Shared with you\n \n \n )}\n {shared.map(n => (\n \n ))}\n \n )}\n \n ) : (\n \n )}\n \n )\n}\n","import React from 'react'\nimport { Box } from '@mui/material'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { canEditTags } from '../models/tags'\nimport { selectTags } from '../selectors/tags'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { TagEditor } from './TagEditor'\nimport { Tags } from './Tags'\n\ntype Props = { network?: INetwork; button?: string }\n\nexport const NetworkTagEditor: React.FC = ({ network, button }) => {\n const { tags, accountId, canEdit } = useSelector((state: State) => {\n const accountId = selectActiveAccountId(state)\n return {\n accountId,\n tags: selectTags(state, accountId),\n canEdit: canEditTags(state, accountId),\n }\n })\n const dispatch = useDispatch()\n const history = useHistory()\n\n if (!network) return null\n\n return (\n \n dispatch.tags.removeNetwork({ tag, network }) : undefined}\n onClick={tag => {\n dispatch.devices.set({ tag: { values: [tag.name], operator: tag.operator } })\n dispatch.devices.fetchList()\n history.push('/devices')\n }}\n />\n {canEdit && (\n await dispatch.tags.create({ tag, accountId })}\n onSelect={tag => dispatch.tags.addNetwork({ tag, network })}\n tags={tags}\n filter={network.tags}\n button={button}\n />\n )}\n \n )\n}\n","import React from 'react'\nimport { Typography } from '@mui/material'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { ListItemLocation } from '../components/ListItemLocation'\nimport { NetworkTagEditor } from '../components/NetworkTagEditor'\nimport { ListHorizontal } from '../components/ListHorizontal'\nimport { ConfirmIconButton } from '../buttons/ConfirmIconButton'\nimport { ShareButton } from '../buttons/ShareButton'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { Container } from '../components/Container'\nimport { UsersTab } from '../components/UsersTab'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\n\nexport const NetworkHeaderMenu: React.FC<{\n network: INetwork\n email: string\n children?: React.ReactNode | React.ReactNode[]\n}> = ({ network, email, children }) => {\n const history = useHistory()\n const dispatch = useDispatch()\n\n return (\n \n \n {network.name || 'Unknown Network'}\n {network.shared ? (\n \n \n You will be leaving {network.name}. \n \n The network will have to be re-shared to you if you wish to access it again.\n \n ),\n }}\n onClick={async () => {\n await dispatch.networks.unshareNetwork({ networkId: network.id, email })\n history.push('/networks')\n }}\n />\n ) : (\n network.permissions.includes('MANAGE') && (\n <>\n \n \n \n You will be permanently deleting {network.name}. \n \n This will remove this network for you and all of the network's users.\n \n }\n onDelete={async () => {\n await dispatch.networks.deleteNetwork(network)\n history.push('/networks')\n }}\n />\n \n )\n )}\n \n \n \n \n \n \n \n }\n >\n {children}\n \n )\n}\n","import React from 'react'\nimport { useParams } from 'react-router-dom'\nimport { selectNetwork } from '../models/networks'\nimport { State } from '../store'\nimport { SharedUsersLists } from '../components/SharedUsersLists'\nimport { NetworkHeaderMenu } from '../components/NetworkHeaderMenu'\nimport { useSelector } from 'react-redux'\n\nexport const NetworkUsersPage: React.FC<{ device?: IDevice }> = ({ device }) => {\n const { networkID } = useParams<{ networkID?: string }>()\n const { network, email } = useSelector((state: State) => ({\n network: selectNetwork(state, networkID),\n email: state.user.email,\n }))\n\n return (\n \n \n \n )\n}\n","import React, { useState } from 'react'\nimport { useParams, useLocation, useHistory } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { Typography, Button } from '@mui/material'\nimport { ContactSelector } from '../components/ContactSelector'\nimport { selectOrganization } from '../selectors/organizations'\nimport { selectNetwork } from '../models/networks'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\n\nexport const NetworkSharePage = () => {\n const { networkID = '' } = useParams<{ networkID: string }>()\n const { network, contacts } = useSelector((state: State) => {\n const organization = selectOrganization(state)\n return {\n network: selectNetwork(state, networkID),\n contacts: state.contacts.all.filter(c => !organization.members.find(s => s.user.id === c.id)) || [],\n }\n })\n const [loading, setLoading] = useState(false)\n const [emails, setEmails] = useState([])\n const dispatch = useDispatch()\n const location = useLocation()\n const history = useHistory()\n\n const exit = () => history.push(location.pathname.replace('/share', '/users'))\n const add = async () => {\n setLoading(true)\n await dispatch.networks.shareNetwork({ id: network.id, emails })\n exit()\n }\n\n return (\n \n \n Share {network.name || 'Network'}\n \n \n \n \n \n }\n >\n \n \n Granting connection access to all the services in this network.\n \n \n \n \n \n \n \n )\n}\n","import React, { useState, useRef } from 'react'\nimport { MAX_NAME_LENGTH } from '@common/constants'\nimport { useHistory } from 'react-router-dom'\nimport { TextField, Button } from '@mui/material'\nimport { selectNetwork } from '../models/networks'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { GuideStep } from './GuideStep'\nimport { Gutters } from './Gutters'\nimport sleep from '../helpers/sleep'\n\nexport const NetworkAdd: React.FC = () => {\n const history = useHistory()\n const dispatch = useDispatch()\n const [name, setName] = useState('')\n const [adding, setAdding] = useState(false)\n const inputRef = useRef(null)\n const network = useSelector((state: State) => selectNetwork(state))\n\n const reset = async () => {\n await sleep(1000)\n setAdding(false)\n setName('')\n }\n\n return (\n {\n event.preventDefault()\n setAdding(true)\n await dispatch.networks.addNetwork({ ...network, name })\n dispatch.ui.guide({ guide: 'network', step: 3 })\n reset()\n }}\n >\n \n {\n let name = event.target.value.toString()\n if (name.length > MAX_NAME_LENGTH) name.substring(0, MAX_NAME_LENGTH)\n setName(name)\n }}\n />\n \n \n \n \n \n {\n history.goBack()\n reset()\n }}\n >\n Cancel\n \n \n \n )\n}\n","import React from 'react'\nimport { Typography } from '@mui/material'\nimport { NetworkAdd } from '../components/NetworkAdd'\nimport { Container } from '../components/Container'\nimport { Title } from '../components/Title'\n\nexport const NetworkAddPage: React.FC = () => {\n return (\n \n New network\n \n }\n >\n \n \n )\n}\n","import React from 'react'\nimport { List } from '@mui/material'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { MAX_NAME_LENGTH } from '@common/constants'\n\nexport const NetworkSettings: React.FC<{ network: INetwork; orgName: string }> = ({ network, orgName }) => {\n const dispatch = useDispatch()\n const disabled = !network.permissions.includes('MANAGE')\n\n return (\n \n dispatch.networks.updateNetwork({ ...network, name: name.toString() })}\n />\n {/* dispatch.networks.updateNetwork({ ...network, enabled: !network.enabled })}\n /> */}\n \n )\n}\n","import React from 'react'\nimport { DeviceContext } from '../services/Context'\nimport { NoConnectionPage } from './NoConnectionPage'\nimport { Typography, Button } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { selectOrganizationName } from '../selectors/organizations'\nimport { networkAttributes } from '../components/Attributes'\nimport { NetworkHeaderMenu } from '../components/NetworkHeaderMenu'\nimport { NetworkSettings } from '../components/NetworkSettings'\nimport { DataDisplay } from '../components/DataDisplay'\nimport { GuideStep } from '../components/GuideStep'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\n\nexport const NetworkPage: React.FC = () => {\n const dispatch = useDispatch()\n const { network } = React.useContext(DeviceContext)\n const { orgName, email } = useSelector((state: State) => ({\n orgName: selectOrganizationName(state, network?.owner.id),\n email: state.user.email,\n }))\n\n if (!network) return \n const empty = network.serviceIds.length === 0\n\n return (\n \n \n Network added!\n \n \n Next add a service. Find one from the devices page and use the network panel to add.\n \n Note, you can only add from devices you own or manage.\n \n }\n placement=\"left\"\n hideArrow\n autoNext\n >\n \n {empty && (\n \n Empty network Add services to this network from a service page\n \n )}\n Connections\n \n dispatch.connections.queueEnable({ ...network, enabled: true })}\n >\n Start All\n \n dispatch.connections.queueEnable({ ...network, enabled: false })}\n sx={{ marginLeft: 1 }}\n >\n Stop All\n \n \n Settings\n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Switch, Route } from 'react-router-dom'\nimport { ServiceRouter } from './ServiceRouter'\nimport { NetworksPage } from '../pages/NetworksPage'\nimport { NetworkUsersPage } from '../pages/NetworkUsersPage'\nimport { NetworkSharePage } from '../pages/NetworkSharePage'\nimport { NetworkAddPage } from '../pages/NetworkAddPage'\nimport { NetworkPage } from '../pages/NetworkPage'\nimport { LanSharePage } from '../pages/LanSharePage'\nimport { DynamicPanel } from '../components/DynamicPanel'\n\nexport const NetworkRouter: React.FC<{ layout: ILayout }> = ({ layout }) => {\n return (\n }\n secondary={\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n }\n layout={layout}\n root=\"/networks\"\n />\n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { Tags, TagProps } from './Tags'\nimport { selectTags } from '../selectors/tags'\n\ntype Props = Omit & {\n tags: string[]\n}\n\nexport const ReactiveTagNames: React.FC = ({ tags, ...props }) => {\n const allTags = useSelector(selectTags)\n const completeTags = tags.reduce((all: ITag[], tagName) => {\n const tag = allTags.find(t => t.name === tagName)\n if (tag) all.push(tag)\n return all\n }, [])\n return \n}\n","import React from 'react'\nimport { toLookup } from '../helpers/utilHelper'\nimport { Chip, Typography } from '@mui/material'\nimport { ReactiveTagNames } from './ReactiveTagNames'\nimport { JobStatusIcon } from './JobStatusIcon'\nimport { Attribute } from './Attributes'\nimport { Duration } from './Duration'\n\nexport class JobAttribute extends Attribute {\n type: Attribute['type'] = 'SCRIPT'\n}\n\nexport const jobAttributes: JobAttribute[] = [\n new JobAttribute({\n id: 'jobName',\n label: 'Name',\n required: true,\n defaultWidth: 350,\n value: ({ job }) =>\n job?.file?.name ? (\n {job.file.name}\n ) : (\n \n File Deleted \n \n ),\n }),\n new JobAttribute({\n id: 'jobDeviceCount',\n label: ,\n defaultWidth: 50,\n value: ({ job }) => (\n \n {job?.jobDevices.length || '-'}\n \n ),\n }),\n new JobAttribute({\n id: 'jobDeviceSuccess',\n label: ,\n defaultWidth: 50,\n value: ({ job }) => (\n \n {job?.jobDevices.filter(d => d.status === 'SUCCESS').length || '-'}\n \n ),\n }),\n new JobAttribute({\n id: 'jobDeviceFailure',\n label: ,\n defaultWidth: 50,\n value: ({ job }) => (\n \n {job?.jobDevices.filter(d => d.status === 'FAILED' || d.status === 'CANCELLED').length || '-'}\n \n ),\n }),\n new JobAttribute({\n id: 'jobUpdated',\n label: 'Time',\n defaultWidth: 160,\n value: ({ job }) =>\n job?.updated && (\n \n \n \n ),\n }),\n new JobAttribute({\n id: 'jobTags',\n label: 'Filter',\n defaultWidth: 100,\n value: ({ job }) =>\n job?.tag.values.length ? : ,\n }),\n new JobAttribute({\n id: 'jobMatches',\n label: 'Match',\n defaultWidth: 100,\n value: ({ job }) => ,\n }),\n]\n\nconst attributeLookup = toLookup(jobAttributes, 'id')\n\nexport function getJobAttribute(id: string): JobAttribute {\n return attributeLookup[id] || new JobAttribute({ id: 'unknown', label: 'Unknown' })\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { useParams } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { JobStatusIcon } from '../components/JobStatusIcon'\nimport { Box, Typography } from '@mui/material'\nimport { JobAttribute } from '../components/JobAttributes'\nimport { selectScript } from '../selectors/scripting'\nimport { DataDisplay } from '../components/DataDisplay'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from '../components/Container'\nimport { Timestamp } from '../components/Timestamp'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\nimport { radius } from '../styling'\nimport { Pre } from '../components/Pre'\n\nexport const JobDeviceDetailPage: React.FC = () => {\n const { fileID, jobID, jobDeviceID } = useParams<{ fileID?: string; jobID?: string; jobDeviceID?: string }>()\n const script = useSelector((state: State) => selectScript(state, undefined, fileID))\n const job = script?.jobs.find(j => j.id === jobID) || script?.jobs[0]\n const jobDevice = job?.jobDevices.find(jd => jd.id === jobDeviceID)\n const attributes =\n jobDevice?.attributes.map(\n a => new JobAttribute({ id: `attribute-${a.key}`, label: a.key, value: () => a.value })\n ) || []\n\n return (\n \n \n \n \n \n {jobDevice?.device?.name || 'Unknown'}\n \n \n {jobDevice?.updated && (\n \n \n \n )}\n \n }\n >\n \n {attributes.length ? (\n \n \n \n ) : (\n No return values from this device\n )}\n \n \n )\n}\n","import React, { useCallback, useState, useEffect } from 'react'\nimport { BINARY_DATA_TOKEN } from '../constants'\nimport { containsNonPrintableChars } from '../helpers/utilHelper'\nimport { Typography, TextField, Box, ButtonBase, Stack, Divider } from '@mui/material'\nimport { useDropzone } from 'react-dropzone'\nimport { useDispatch } from 'react-redux'\nimport { IconButton } from '../buttons/IconButton'\nimport { Dispatch } from '../store'\nimport { Notice } from './Notice'\nimport { radius } from '../styling'\n\ntype Props = {\n script?: string\n loading?: boolean\n disabled?: boolean\n onChange: (script: string, file?: File) => void\n}\n\nexport const FileUpload: React.FC = ({ script = '', loading, disabled, onChange }) => {\n const dispatch = useDispatch()\n const [filename, setFilename] = useState()\n const [isText, setIsText] = useState(true)\n\n useEffect(() => {\n if (script === BINARY_DATA_TOKEN) setIsText(false)\n }, [script])\n\n const onDrop = useCallback((files: File[]) => {\n files.forEach(file => {\n const reader = new FileReader()\n\n reader.onabort = () => dispatch.ui.set({ errorMessage: 'File reading was aborted' })\n reader.onerror = () => dispatch.ui.set({ errorMessage: 'File reading has failed' })\n reader.onloadend = () => {\n const buffer = new Uint8Array(reader.result as ArrayBuffer)\n\n try {\n const text = new TextDecoder().decode(buffer)\n const isBinary = containsNonPrintableChars(text)\n\n if (!isBinary) {\n setIsText(true)\n setFilename(file.name)\n onChange(text, file)\n } else {\n setIsText(false)\n }\n } catch (e) {\n console.error('Error decoding text:', e)\n dispatch.ui.set({ errorMessage: 'File could not be decoded as text.' })\n setIsText(false)\n }\n }\n\n reader.readAsArrayBuffer(file)\n })\n }, [])\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop })\n const showUpload = !filename && isText\n\n const clear = () => {\n setFilename(undefined)\n onChange('')\n setIsText(true)\n }\n\n const paste = async () => {\n const demo = await dispatch.files.downloadDemoScript()\n onChange(demo + '\\n\\n' + script)\n }\n\n return (\n \n {isText ? (\n <>\n ({\n borderRadius: showUpload ? `${radius.sm}px ${radius.sm}px 0 0` : undefined,\n fontFamily: \"'Roboto Mono', monospace\",\n fontSize: theme.typography.caption.fontSize,\n lineHeight: theme.typography.caption.lineHeight,\n color: theme.palette.grayDarkest.main,\n }),\n }}\n inputProps={{ sx: { transition: 'height 600ms' } }}\n onChange={event => onChange(event.target.value)}\n />\n \n {filename ? (\n \n ) : (\n \n )}\n \n \n ) : (\n \n This script appears to be binary.\n \n )}\n {showUpload && (\n <>\n \n \n \n Upload\n Drag and drop or click \n \n \n )}\n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport isEqual from 'lodash.isequal'\nimport { Dispatch } from '../store'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch } from 'react-redux'\nimport { List, ListItem, TextField, Button, Stack } from '@mui/material'\nimport { DynamicButton } from '../buttons/DynamicButton'\nimport { FileUpload } from './FileUpload'\nimport { TagFilter } from './TagFilter'\nimport { Notice } from './Notice'\n\ntype Props = {\n form: IFileForm\n defaultForm: IFileForm\n selectedIds: string[]\n loading?: boolean\n manager?: boolean\n onChange: (form: IFileForm) => void\n}\n\nexport const ScriptForm: React.FC = ({ form, defaultForm, selectedIds, loading, manager, onChange }) => {\n const [unauthorized, setUnauthorized] = useState()\n const [running, setRunning] = useState(false)\n const [saving, setSaving] = useState(false)\n const dispatch = useDispatch()\n const history = useHistory()\n const changed = !isEqual(form, defaultForm)\n const canSave = !unauthorized && !!form.script && !!form.name\n const scriptChanged =\n form.script !== defaultForm.script || form.description !== defaultForm.description || form.name !== defaultForm.name\n const canRun =\n (form.access === 'SELECTED' && selectedIds.length) ||\n (form.access === 'TAG' && form.tag?.values.length) ||\n (form.access === 'CUSTOM' && form.deviceIds.length)\n\n const save = async (run?: boolean) => {\n if (run) setRunning(true)\n if (changed) setSaving(true)\n\n if (manager && scriptChanged) {\n form.file = new File([form.script ?? form.file ?? ''], form.name, { type: form.file?.type ?? 'text/plain' })\n form.fileId = await dispatch.files.upload(form)\n }\n\n if (form.access === 'SELECTED') form.deviceIds = selectedIds\n\n if (run) await dispatch.jobs.saveRun({ ...form })\n else if (changed) await dispatch.jobs.save({ ...form })\n\n dispatch.ui.set({ selected: [], scriptForm: undefined })\n\n if (changed) setSaving(false)\n if (run) setRunning(false)\n }\n\n const clearUnauthorized = () => {\n unauthorized && dispatch.ui.set({ selected: selectedIds.filter(id => !unauthorized.find(u => u.id === id)) })\n }\n\n useEffect(() => {\n if (!selectedIds.length) return\n\n async function checkSelected() {\n const unauthorized = await dispatch.jobs.unauthorized(selectedIds)\n if (unauthorized.length) {\n setUnauthorized(unauthorized)\n } else {\n setUnauthorized(undefined)\n }\n }\n\n checkSelected()\n }, [selectedIds])\n\n return (\n
(event.preventDefault(), save())}>\n \n \n onChange({ ...form, name: event.target.value })}\n />\n \n \n onChange({ ...form, script, ...(file && { name: file.name, file }) })}\n />\n \n \n onChange({ ...form, description: event.target.value })}\n />\n \n onChange({ ...form, ...structuredClone(f) })}\n selectedIds={selectedIds}\n onSelectIds={() => {\n dispatch.ui.set({ scriptForm: form })\n history.push('/devices/select/scripting')\n }}\n />\n \n {unauthorized && (\n \n You are not allow to run scripts on\n \n {unauthorized.map(d => (\n \n {d.name}\n \n ))}\n \n \n \n )}\n \n save(true)}\n />\n \n {\n dispatch.ui.set({ scriptForm: undefined, selected: [] })\n history.push('/scripting/scripts')\n }}\n >\n Cancel\n \n \n
\n )\n}\n","import sleep from '../helpers/sleep'\nimport React, { useState, useEffect } from 'react'\nimport { useParams } from 'react-router-dom'\nimport { Typography } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { TargetPlatform } from '../components/TargetPlatform'\nimport { selectDevice } from '../selectors/devices'\nimport { selectScript } from '../selectors/scripting'\nimport { initialForm } from '../models/files'\nimport { selectRole } from '../selectors/organizations'\nimport { ScriptForm } from '../components/ScriptForm'\nimport { Container } from '../components/Container'\n\nexport const ScriptEditPage: React.FC = () => {\n const [defaultForm, setDefaultForm] = useState()\n const [loading, setLoading] = useState(false)\n const [form, setForm] = useState()\n const { fileID, jobID } = useParams<{ fileID?: string; jobID?: string }>()\n const role = useSelector(selectRole)\n const manager = role.permissions.includes('MANAGE')\n const script = useSelector((state: State) => selectScript(state, undefined, fileID, jobID))\n const savedForm = useSelector((state: State) => state.ui.scriptForm)\n const selectedIds = useSelector((state: State) => state.ui.selected)\n const dispatch = useDispatch()\n\n const device = useSelector((state: State) =>\n selectedIds.length === 1 ? selectDevice(state, undefined, selectedIds[0]) : undefined\n )\n const defaultDeviceIds = script?.job?.jobDevices.map(d => d.device.id) || []\n const tagValues = script?.job?.tag?.values || []\n const access = () => (tagValues.length ? 'TAG' : defaultDeviceIds.length ? 'CUSTOM' : 'NONE')\n\n // Download script\n useEffect(() => {\n if (loading || !script || !form || !defaultForm || defaultForm.script || savedForm?.script) return\n const download = async () => {\n setLoading(true)\n const fileVersionId = script.versions[0].id\n const result = await dispatch.files.download(fileVersionId)\n setDefaultForm({ ...defaultForm, script: result })\n setForm({ ...form, script: result })\n await sleep(200)\n setLoading(false)\n }\n download()\n }, [script, form, defaultForm])\n\n // Selected devices\n useEffect(() => {\n if (!form) return\n setForm({ ...form, access: selectedIds.length ? 'SELECTED' : access() })\n }, [selectedIds])\n\n // Initialize form\n useEffect(() => {\n const setupForm: IFileForm = {\n ...role,\n ...initialForm,\n deviceIds: defaultDeviceIds,\n jobId: script?.job?.status === 'READY' ? script?.job?.id : initialForm.jobId,\n fileId: script?.id ?? initialForm.fileId,\n name: script?.name ?? initialForm.name,\n description: script?.shortDesc ?? initialForm.description,\n executable: script?.executable ?? initialForm.executable,\n tag: script?.job?.tag ?? initialForm.tag,\n access: access(),\n }\n setDefaultForm(setupForm)\n setForm({ ...setupForm, ...savedForm, access: selectedIds.length ? 'SELECTED' : access() })\n }, [fileID])\n\n if (!form || !defaultForm) return null\n\n return (\n \n \n Scripting\n \n \n \n {device.name}\n \n \n ) : (\n Script\n )\n }\n >\n \n \n )\n}\n","import React, { useState } from 'react'\nimport { State } from '../store'\nimport { Typography, Box } from '@mui/material'\nimport { TargetPlatform } from '../components/TargetPlatform'\nimport { selectDevice } from '../selectors/devices'\nimport { initialForm } from '../models/files'\nimport { selectRole } from '../selectors/organizations'\nimport { ScriptForm } from '../components/ScriptForm'\nimport { useSelector } from 'react-redux'\nimport { Body } from '../components/Body'\n\ntype Props = { center?: boolean }\n\nexport const ScriptAddPage: React.FC = ({ center }) => {\n const role = useSelector(selectRole)\n const manager = role.permissions.includes('MANAGE')\n const savedForm = useSelector((state: State) => state.ui.scriptForm)\n const selectedIds = useSelector((state: State) => state.ui.selected)\n const device = useSelector((state: State) =>\n selectedIds.length === 1 ? selectDevice(state, undefined, selectedIds[0]) : undefined\n )\n const defaultForm: IFileForm = { ...role, ...initialForm }\n const [form, setForm] = useState({\n ...defaultForm,\n ...savedForm,\n access: selectedIds.length ? 'SELECTED' : defaultForm.access,\n })\n\n return (\n \n \n {device && form.access === 'SELECTED' ? (\n <>\n \n Add and run a script on\n \n \n \n {device.name}\n \n \n ) : (\n \n Add and run a script\n \n )}\n \n \n \n )\n}\n","import React from 'react'\nimport { MOBILE_WIDTH } from '../constants'\nimport { useMediaQuery, Stack, Typography } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { useHistory } from 'react-router-dom'\nimport { IconButton } from '../buttons/IconButton'\nimport { radius } from '../styling'\nimport { Icon } from './Icon'\n\nexport const ScriptingActionBar: React.FC = () => {\n const selected = useSelector((state: State) => state.ui.selected)\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const dispatch = useDispatch()\n const history = useHistory()\n\n if (!selected.length) return null\n\n return (\n \n \n Choose a script\n \n \n \n {selected.length} \n {mobile ? : `device${selected.length > 1 ? 's' : ''} selected`}\n \n {\n dispatch.ui.set({ selected: [] })\n history.push('/scripting/scripts')\n }}\n />\n \n \n )\n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { Tabs, Tab } from '@mui/material'\n\nconst tabs = ['scripts', 'runs' /* , 'files' */]\nconst tabTitles = ['Scripts', 'Runs', 'Assets']\n\nexport const ScriptingTabBar: React.FC = () => {\n const dispatch = useDispatch()\n const location = useLocation()\n const history = useHistory()\n const active = location.pathname.split('/')[2]\n const tabIndex = tabs.indexOf(active)\n\n return (\n \n {tabs.map((tab, index) => (\n {\n const to = `/scripting/${tab}`\n dispatch.ui.setDefaultSelected({ key: '/scripting', value: to })\n history.push(to)\n }}\n />\n ))}\n \n )\n}\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { Stack, Button, Tooltip } from '@mui/material'\nimport { Link as RouteLink, Route, useLocation, useHistory } from 'react-router-dom'\nimport { selectPermissions } from '../selectors/organizations'\nimport { ScriptingActionBar } from './ScriptingActionBar'\nimport { ScriptingTabBar } from './ScriptingTabBar'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from './Container'\nimport { ColorChip } from './ColorChip'\nimport { Link } from './Link'\nimport { Icon } from './Icon'\n\ntype Props = {\n children?: React.ReactNode\n}\n\nexport const ScriptingHeader: React.FC = ({ children }) => {\n const dispatch = useDispatch()\n const history = useHistory()\n const location = useLocation()\n const permissions = useSelector(selectPermissions)\n const selectedIds = useSelector((state: State) => state.ui.selected)\n\n return (\n \n \n \n \n {!selectedIds.length && (\n \n \n {\n dispatch.feedback.set({ subject: 'Beta Scripting Feedback' })\n history.push('/feedback')\n }}\n />\n \n \n \n \n \n }\n component={RouteLink}\n >\n Add\n \n \n \n \n \n )}\n \n \n }\n >\n {children}\n \n )\n}\n","import React from 'react'\nimport { Typography } from '@mui/material'\nimport { Attribute } from './Attributes'\nimport { Timestamp } from './Timestamp'\nimport { Icon, IconProps } from './Icon'\nimport { Pre } from './Pre'\n\nconst argumentIconLookup: ILookup = {\n FileSelect: { name: 'cloud' },\n StringSelect: { name: 'triangle', rotate: 180 },\n StringEntry: { name: 'rectangle-wide' },\n}\n\nclass ScriptAttribute extends Attribute {\n type: Attribute['type'] = 'SCRIPT'\n}\n\nexport const scriptAttributes: ScriptAttribute[] = [\n new ScriptAttribute({\n id: 'scriptName',\n label: 'Script',\n required: true,\n defaultWidth: 350,\n value: ({ file }) =>\n file?.name ? (\n {file.name}\n ) : (\n \n Script Deleted \n \n ),\n }),\n // new ScriptAttribute({\n // id: 'scriptArguments',\n // label: 'Arguments',\n // defaultWidth: 150,\n // value: ({ file }) => (\n // <>\n // {file?.versions?.[0].arguments.map(a => (\n // \n // \n // {a.name}\n // \n // ))}\n // \n // ),\n // }),\n new ScriptAttribute({\n id: 'scriptDescription',\n label: 'Description',\n defaultWidth: 400,\n value: ({ file }) => file?.shortDesc,\n }),\n new ScriptAttribute({\n id: 'scriptUpdated',\n label: 'Modified',\n defaultWidth: 150,\n value: ({ file }) =>\n file?.updated && (\n \n \n \n ),\n }),\n new ScriptAttribute({\n id: 'scriptCreated',\n label: 'Created',\n defaultWidth: 150,\n value: ({ file }) =>\n file?.created && (\n \n \n \n ),\n }),\n]\n","import React from 'react'\nimport { Attribute } from './Attributes'\nimport { spacing } from '../styling'\nimport { Box } from '@mui/material'\n\nexport const AttributeValue: React.FC = ({ attribute, ...options }) => {\n const value = attribute?.value({ instance: options.device, ...options }) || ''\n return (\n \n {value}\n \n )\n}\n\nexport const AttributeValueMemo = React.memo(AttributeValue)\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { radius, spacing } from '../styling'\nimport { Box, ListItemIcon, ListItemButton, ListItemButtonProps } from '@mui/material'\n\ntype Props = ListItemButtonProps & {\n data?: any\n icon?: React.ReactNode\n required?: React.ReactNode\n mobile?: boolean\n}\n\nexport const GridListItem: React.FC = ({ required, icon, mobile, children, ...props }) => {\n const css = useStyles()\n\n return (\n \n \n \n {icon}\n {required}\n \n \n {!mobile && children}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n row: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n width: '100%',\n '&:hover': {\n backgroundColor: palette.primaryHighlight.main,\n },\n '&:hover > div:first-of-type, &.Mui-selected > div:first-of-type': {\n backgroundImage: `linear-gradient(90deg, ${palette.primaryHighlight.main} 95%, transparent)`,\n },\n '&.Mui-selected:hover > div:first-of-type': {\n backgroundImage: `linear-gradient(90deg, ${palette.primaryLighter.main} 95%, transparent)`,\n },\n '& > div:first-of-type > div': {\n width: '100%',\n },\n },\n sticky: {\n position: 'sticky',\n left: 0,\n zIndex: 4,\n display: 'flex',\n alignItems: 'start !important',\n borderTopRightRadius: radius.lg,\n borderBottomRightRadius: radius.lg,\n backgroundImage: `linear-gradient(90deg, ${palette.white.main} 95%, transparent)`,\n overflow: 'visible',\n paddingLeft: spacing.md,\n height: '100%',\n },\n}))\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { AttributeValue } from './AttributeValue'\nimport { JobStatusIcon } from './JobStatusIcon'\nimport { GridListItem } from './GridListItem'\nimport { Attribute } from './Attributes'\nimport { Icon } from './Icon'\nimport { Box } from '@mui/material'\n\ntype Props = {\n script: IScript\n attributes: Attribute[]\n required?: Attribute\n mobile?: boolean\n selectedIds?: string[]\n fileID?: string\n}\n\nexport const FileListItem: React.FC = ({ script, required, attributes, mobile, selectedIds, fileID }) => {\n const history = useHistory()\n\n if (!script) return null\n\n const handleClick = () => {\n if (selectedIds?.length) history.push(`/scripting/scripts/${script.id}`)\n else history.push(`/script/${script.id}`)\n }\n\n return (\n \n ) : (\n \n )\n }\n required={}\n selected={script.id === fileID}\n disableGutters\n >\n {attributes?.map(attribute => (\n \n \n \n ))}\n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Box } from '@mui/material'\nimport { Attribute } from './Attributes'\nimport { spacing } from '../styling'\n\ntype Props = {\n attribute: Attribute\n sticky?: boolean\n onMouseDown: (event: React.MouseEvent, Attribute) => void\n children?: React.ReactNode\n}\n\nexport const GridListHeaderTitle: React.FC = ({ attribute, sticky, onMouseDown, children }) => {\n const css = useStyles()\n\n return (\n \n \n {children}\n {attribute.label}\n \n onMouseDown(event, attribute)} />\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n sticky: {\n left: 0,\n zIndex: 4,\n position: 'sticky',\n paddingLeft: spacing.md,\n backgroundImage: `linear-gradient(90deg, ${palette.white.main} 95%, transparent)`,\n borderBottom: `1px solid ${palette.grayLighter.main}`,\n },\n title: {\n paddingLeft: spacing.xxs,\n paddingRight: `${spacing.lg}px !important`,\n backgroundColor: palette.white.main,\n position: 'relative',\n },\n text: {\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n display: 'flex',\n '& .hoverHide': { opacity: 0, transition: 'opacity 200ms' },\n '&:hover .hoverHide': { opacity: 1, transition: 'opacity 200ms' },\n },\n drag: {\n right: 0,\n height: '100%',\n position: 'absolute',\n width: spacing.md,\n '&:hover': {\n cursor: 'col-resize',\n },\n '&::after': {\n content: '\"\"',\n width: 1,\n height: spacing.sm,\n display: 'inline-block',\n background: palette.grayLight.main,\n },\n '&:hover::after': {\n width: 3,\n height: '100%',\n background: palette.primary.main,\n },\n },\n}))\n","import React, { useState, useRef } from 'react'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { makeStyles } from '@mui/styles'\nimport { ListSubheader, ListItemIcon, useMediaQuery } from '@mui/material'\nimport { DeviceListHeaderCheckbox } from './DeviceListHeaderCheckbox'\nimport { GridListHeaderTitle } from './GridListHeaderTitle'\nimport { LinearProgress } from './LinearProgress'\nimport { Attribute } from './Attributes'\n\nconst MIN_WIDTH = 50\n\ntype Props = {\n required?: Attribute\n attributes?: Attribute[]\n columnWidths: ILookup\n icon?: React.ReactNode\n fetching?: boolean\n mobile?: boolean\n}\n\nexport const GridListHeader: React.FC = ({\n required,\n attributes = [],\n columnWidths,\n icon,\n fetching,\n mobile,\n}) => {\n const { ui } = useDispatch()\n const [resize, setResize] = useState(0)\n const containerRef = useRef(null)\n const moveRef = useRef<[string, number, number, number, number]>(['', 0, 0, 0, 0])\n const css = useStyles()\n\n const onDown = (event: React.MouseEvent, attribute: Attribute) => {\n const containerX = containerRef.current?.getBoundingClientRect().left || 0\n const containerY = containerRef.current?.parentElement?.getBoundingClientRect().height || 0\n moveRef.current = [attribute.id, attribute.width(columnWidths), event.clientX, containerX, containerY]\n event.preventDefault()\n window.addEventListener('mousemove', onMove)\n window.addEventListener('mouseup', onUp)\n }\n\n const onUp = (event: MouseEvent) => {\n event.preventDefault()\n window.removeEventListener('mousemove', onMove)\n window.removeEventListener('mouseup', onUp)\n const px = Math.max(moveRef.current[1] + (event.clientX - moveRef.current[2]), MIN_WIDTH)\n ui.resizeColumn({ id: moveRef.current[0], width: px })\n setResize(0)\n }\n\n const onMove = (event: MouseEvent) => {\n if (moveRef.current[1] + (event.clientX - moveRef.current[2]) < MIN_WIDTH) return\n setResize(event.pageX - moveRef.current[3])\n }\n\n return (\n \n \n {required && (\n \n {icon}\n \n )}\n {!mobile &&\n attributes?.map(attribute => (\n \n ))}\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n header: {\n padding: 0,\n minWidth: '100%',\n boxShadow: `inset 0 -1px ${palette.grayLighter.main}`,\n },\n checkbox: {\n maxWidth: 60,\n },\n handle: {\n position: 'absolute',\n zIndex: 80,\n top: 0,\n width: 1,\n borderRight: `1px dotted ${palette.primaryLight.main}`,\n },\n}))\n","import React from 'react'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { List, ListProps } from '@mui/material'\nimport { spacing, fontSizes } from '../styling'\nimport { GridListHeader } from './GridListHeader'\nimport { Attribute } from './Attributes'\n\ntype DeviceListProps = ListProps & {\n attributes: Attribute[]\n required?: Attribute\n columnWidths: ILookup\n mobile?: boolean\n fetching?: boolean\n rowHeight?: number\n rowShrink?: number\n headerIcon?: React.ReactNode\n headerContextData?: any\n headerContextProvider?: React.Provider\n}\n\nexport const GridList: React.FC = ({\n attributes,\n required,\n columnWidths,\n mobile,\n fetching,\n rowHeight = 40,\n rowShrink = 0,\n headerIcon,\n headerContextData,\n headerContextProvider: HeaderContextProvider,\n children,\n ...props\n}) => {\n const requiredWidth = required?.width(columnWidths) || 0\n const css = useStyles({\n attributes,\n requiredWidth,\n columnWidths,\n rowHeight,\n rowShrink,\n mobile,\n })\n\n const header = \n\n return (\n \n {HeaderContextProvider ? (\n {header}\n ) : (\n header\n )}\n {children}\n \n )\n}\n\ntype StyleProps = {\n attributes: Attribute[]\n requiredWidth: number\n columnWidths: ILookup\n mobile?: boolean\n rowHeight: number\n rowShrink: number\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n grid: ({ attributes, requiredWidth, columnWidths, mobile }: StyleProps) => ({\n minWidth: '100%',\n width: requiredWidth + (mobile ? 0 : attributes?.reduce((w, a) => w + a.width(columnWidths), 0)),\n '& .MuiListItemButton-root, & .MuiListSubheader-root': {\n gridTemplateColumns: `${requiredWidth}px ${\n mobile ? '' : attributes?.map(a => a.width(columnWidths)).join('px ') + 'px'\n }`,\n },\n }),\n list: ({ rowHeight, rowShrink }: StyleProps) => ({\n '& .MuiListItemButton-root:nth-child(2)': {\n marginTop: rowShrink / 2,\n },\n '& .MuiListItemButton-root, & .MuiListSubheader-root': {\n display: 'inline-grid',\n alignItems: 'start',\n '& > .MuiBox-root': {\n paddingRight: spacing.sm,\n },\n },\n '& .MuiListItemButton-root': {\n minHeight: rowHeight - rowShrink,\n fontSize: fontSizes.base,\n color: palette.grayDarkest.main,\n },\n '& > * > .MuiBox-root, & > * > * > .MuiBox-root': {\n display: 'flex',\n alignItems: 'center',\n minHeight: rowHeight - 6 - rowShrink,\n },\n '& .attribute': {\n display: 'block',\n minHeight: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n '& .MuiDivider-root': {\n marginTop: rowShrink / 2 - 1,\n marginBottom: rowShrink / 2 - 1,\n },\n }),\n}))\n","import React from 'react'\nimport { State } from '../store'\nimport { useParams } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { MOBILE_WIDTH } from '../constants'\nimport { useMediaQuery } from '@mui/material'\nimport { FileListItem } from './FileListItem'\nimport { Attribute } from './Attributes'\nimport { GridList } from './GridList'\n\ninterface FileListProps {\n attributes: Attribute[]\n required?: Attribute\n columnWidths: ILookup\n fetching?: boolean\n scripts?: IScript[]\n}\n\nexport const FileList: React.FC = ({ attributes, required, scripts = [], columnWidths, fetching }) => {\n const { fileID } = useParams<{ fileID?: string }>()\n const selectedIds = useSelector((state: State) => state.ui.selected)\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n return (\n \n {scripts?.map((script, index) => (\n \n ))}\n \n )\n}\n","import React, { useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { removeObject } from '../helpers/utilHelper'\nimport { State, Dispatch } from '../store'\nimport { ScriptingHeader } from '../components/ScriptingHeader'\nimport { scriptAttributes } from '../components/FileAttributes'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectScripts, selectFiles } from '../selectors/scripting'\nimport { Typography, Button } from '@mui/material'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { initialForm } from '../models/files'\nimport { selectRole } from '../selectors/organizations'\nimport { FileList } from '../components/FileList'\nimport { Body } from '../components/Body'\nimport { Icon } from '../components/Icon'\nimport { Link } from '../components/Link'\n\nexport const FilesPage: React.FC<{ scripts?: boolean }> = ({ scripts }) => {\n const dispatch = useDispatch()\n const history = useHistory()\n const [loading, setLoading] = useState(false)\n const [required, attributes] = removeObject(scriptAttributes, a => a.required === true)\n const { fetching, initialized } = useSelector((state: State) => state.files)\n const columnWidths = useSelector((state: State) => state.ui.columnWidths)\n const files = useSelector(scripts ? selectScripts : selectFiles)\n const role = useSelector(selectRole)\n\n const handleDemo = async () => {\n setLoading(true)\n const script = await dispatch.files.downloadDemoScript()\n dispatch.ui.set({\n scriptForm: {\n ...role,\n ...initialForm,\n name: 'Get Hostname',\n description: 'Demo script to illustrate how to get data and add it to a device',\n access: 'SELECTED',\n script,\n },\n })\n history.push('/scripting/add')\n setLoading(false)\n }\n\n return (\n \n {!initialized ? (\n \n ) : !files.length ? (\n \n \n {scripts ? (\n <>\n \n See how easy it is to run a script with our demo script.\n
\n For more examples and detailed guidance,\n visit our documentation site.\n
\n \n Need a device to test with?\n \n Try a docker container!\n \n \n \n ) : (\n \n No files found\n \n )}\n \n ) : (\n \n )}\n
\n )\n}\n","import React from 'react'\nimport { DynamicButton, DynamicButtonProps } from './DynamicButton'\n\nexport type RunButtonProps = Omit & {\n job?: IJob\n onRun?: () => Promise\n onRunAgain?: () => Promise\n onCancel?: () => Promise\n}\n\nexport const RunButton: React.FC = ({ job, disabled, onRun, onRunAgain, onCancel, ...props }) => {\n const [loading, setLoading] = React.useState(false)\n\n let title = 'Run'\n let variant: 'text' | 'outlined' | 'contained' | undefined = 'text'\n let color: Color = 'primary'\n let icon: string | undefined\n let clickAction = onRunAgain\n\n switch (job?.status) {\n case 'WAITING':\n title = 'Cancel'\n color = 'grayDarker'\n clickAction = onCancel\n break\n case 'RUNNING':\n title = 'Cancel'\n clickAction = onCancel\n break\n case 'FAILED':\n color = 'danger'\n title = 'Retry'\n break\n case 'CANCELLED':\n title = 'Restart'\n break\n case 'SUCCESS':\n title = 'Run Again'\n variant = 'contained'\n break\n case 'READY':\n variant = 'contained'\n clickAction = onRun\n break\n }\n\n let clickHandler = async (event?: React.MouseEvent) => {\n event?.stopPropagation()\n event?.preventDefault()\n setLoading(true)\n await clickAction?.()\n setLoading(false)\n }\n\n props.loading = props.loading || loading\n if (disabled && props.size === 'icon') title = ''\n\n return (\n \n )\n}\n","import React, { useEffect } from 'react'\nimport { VALID_JOB_ID_LENGTH } from '../constants'\nimport { selectFile, selectJobs } from '../selectors/scripting'\nimport { State, Dispatch } from '../store'\nimport { getJobAttribute } from '../components/JobAttributes'\nimport { ListItemLocation } from '../components/ListItemLocation'\nimport { Redirect, useParams } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { Box, Stack, List, Typography } from '@mui/material'\nimport { LinearProgress } from '../components/LinearProgress'\nimport { JobStatusIcon } from '../components/JobStatusIcon'\nimport { Container } from '../components/Container'\nimport { Timestamp } from '../components/Timestamp'\nimport { RunButton } from '../buttons/RunButton'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\nimport { Icon } from '../components/Icon'\n// import { Pre } from '../components/Pre'\n\nexport const ScriptPage: React.FC = () => {\n const dispatch = useDispatch()\n const { fileID, jobID, jobDeviceID } = useParams<{ fileID?: string; jobID?: string; jobDeviceID?: string }>()\n const file = useSelector((state: State) => selectFile(state, undefined, fileID))\n const jobs = useSelector(selectJobs).filter(j => j.file?.id === fileID)\n const job: IJob | undefined = jobs.find(j => j.id === jobID) || jobs[0]\n const fetching = useSelector((state: State) => state.files.fetching)\n const noDevices = !job || !job?.jobDevices.length\n const validJobID = jobID && jobID.length >= VALID_JOB_ID_LENGTH\n\n // load jobs if not already loaded\n useEffect(() => {\n if (!jobs.length && !fetching && file) dispatch.jobs.fetchByFileIds({ fileIds: [file.id] })\n }, [file])\n\n if (!file) return \n\n if (\n jobDeviceID !== 'edit' &&\n (!jobDeviceID || (jobID === 'latest' && !job?.jobDevices.some(jd => jd.id === jobDeviceID)))\n ) {\n return (\n \n )\n }\n\n return (\n \n \n {file.name}}\n icon={}\n exactMatch\n >\n \n \n \n \n \n \n {!!job?.tag.values.length && {getJobAttribute('jobTags').value({ job })}}\n {job?.jobDevices[0]?.updated && (\n \n {job?.status.toLowerCase()}  \n \n \n )}\n {file.shortDesc && (\n \n {file.shortDesc}\n \n )}\n \n \n \n \n \n \n }\n >\n <>\n \n Devices\n \n \n {job?.jobDevices.length || '-'}\n \n \n \n {job?.jobDevices.filter(d => d.status === 'SUCCESS').length || '-'}\n \n \n \n {job?.jobDevices.filter(d => d.status === 'FAILED' || d.status === 'CANCELLED').length || '-'}\n \n \n \n \n {noDevices ? (\n This script has not been run yet.\n ) : (\n \n await dispatch.jobs.run({ jobId: job?.id, fileId: file.id })}\n onRunAgain={async () => await dispatch.jobs.runAgain({ ...file, job })}\n onCancel={async () => await dispatch.jobs.cancel(job?.id)}\n fullWidth\n />\n \n )}\n \n {job?.jobDevices.map(jd => (\n }\n />\n ))}\n \n \n \n )\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { AttributeValue } from './AttributeValue'\nimport { JobStatusIcon } from './JobStatusIcon'\nimport { GridListItem } from './GridListItem'\nimport { Attribute } from './Attributes'\nimport { Box } from '@mui/material'\n\ntype Props = {\n job: IJob\n attributes: Attribute[]\n required?: Attribute\n mobile?: boolean\n}\n\nexport const JobListItem: React.FC = ({ job, required, attributes, mobile }) => {\n const history = useHistory()\n const disabled = !job.file\n\n if (!job) return null\n\n const handleClick = () => {\n history.push(`/script/${job.file?.id}/${job.id}`)\n }\n\n return (\n }\n required={}\n disableGutters\n >\n {attributes?.map(attribute => (\n \n \n \n ))}\n \n )\n}\n","import React from 'react'\nimport { MOBILE_WIDTH } from '../constants'\nimport { useMediaQuery } from '@mui/material'\nimport { JobListItem } from './JobListItem'\nimport { Attribute } from './Attributes'\nimport { GridList } from './GridList'\n\nexport interface ScriptListProps {\n attributes: Attribute[]\n required?: Attribute\n columnWidths: ILookup\n fetching?: boolean\n jobs?: IJob[]\n}\n\nexport const JobList: React.FC = ({ attributes, required, jobs = [], columnWidths, fetching }) => {\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n return (\n \n {jobs?.map((job, index) => (\n \n ))}\n \n )\n}\n","import React, { useEffect } from 'react'\nimport { useParams } from 'react-router-dom'\nimport { selectJobs } from '../selectors/scripting'\nimport { removeObject } from '../helpers/utilHelper'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { Typography, Stack } from '@mui/material'\nimport { ScriptingHeader } from '../components/ScriptingHeader'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { jobAttributes } from '../components/JobAttributes'\nimport { JobList } from '../components/JobList'\nimport { Notice } from '../components/Notice'\nimport { Body } from '../components/Body'\n\nexport const JobsPage: React.FC = () => {\n const dispatch = useDispatch()\n const { fileID } = useParams<{ fileID?: string }>()\n const [required, attributes] = removeObject(jobAttributes, a => a.required === true)\n const jobs = useSelector((state: State) => selectJobs(state, undefined, fileID))\n const accountId = useSelector(selectActiveAccountId)\n const columnWidths = useSelector((state: State) => state.ui.columnWidths)\n const fetching = useSelector((state: State) => state.ui.fetching || state.jobs.fetching)\n\n useEffect(() => {\n dispatch.jobs.fetchIfEmpty()\n }, [accountId])\n\n return (\n \n {fetching && !jobs.length ? (\n \n ) : !jobs.length ? (\n \n \n \n No runs found\n \n Run a script to get started\n \n \n ) : (\n \n )}\n \n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { Switch, Route, Redirect, useLocation } from 'react-router-dom'\nimport { JobDeviceDetailPage } from '../pages/JobDeviceDetailPage'\nimport { selectPermissions } from '../selectors/organizations'\nimport { ScriptEditPage } from '../pages/ScriptEditPage'\nimport { ScriptAddPage } from '../pages/ScriptAddPage'\nimport { DynamicPanel } from '../components/DynamicPanel'\nimport { FilesPage } from '../pages/FilesPage'\nimport { ScriptPage } from '../pages/ScriptPage'\nimport { JobsPage } from '../pages/JobsPage'\nimport { Notice } from '../components/Notice'\nimport { Panel } from '../components/Panel'\nimport { Body } from '../components/Body'\nimport { Box } from '@mui/material'\n\nexport const ScriptingRouter: React.FC<{ layout: ILayout }> = ({ layout }) => {\n const location = useLocation()\n const permissions = useSelector(selectPermissions)\n\n if (!permissions.includes('SCRIPTING'))\n return (\n \n \n \n \n You do not have permission to access scripting\n \n \n \n \n )\n\n const locationParts = location.pathname.split('/')\n if (\n 'runs' === locationParts[2] ||\n (['scripts', 'files', 'add'].includes(locationParts[2]) && locationParts.length === 3)\n )\n layout = { ...layout, singlePanel: true }\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n secondary={\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n layout={layout}\n root=\"/scripting/:tab?/:filter?\"\n />\n )\n}\n","import React, { useEffect } from 'react'\nimport { windowOpen } from '../services/browser'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\n\ninterface RedirectOffsiteProps {\n to?: string\n children?: React.ReactNode\n}\n\nexport const RedirectOffsite: React.FC = ({ to, children }) => {\n const history = useHistory()\n const dispatch = useDispatch()\n\n useEffect(() => {\n console.log('RedirectOffsite', to)\n if (!to) return\n windowOpen(to, '_blank', true)\n dispatch.ui.set({ noticeMessage: 'You were redirected to your account page on the website.' })\n history.goBack()\n }, [to])\n\n return to ? null : <>{children}\n}\n","import { useEffect, useState } from 'react'\nimport { windowOpen } from '../services/browser'\nimport { State, Dispatch } from '../store'\nimport { platforms, IPlatform } from '../platforms'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectOrganization } from '../selectors/organizations'\n\ntype Props = {\n types: number[]\n platform?: IPlatform\n tags?: string[]\n redirect?: string\n}\n\nexport function useAutoRegistration({ platform, tags, types, redirect }: Props) {\n const organization = useSelector((state: State) => selectOrganization(state))\n const registrationCommand = useSelector((state: State) => state.ui.registrationCommand)\n const registrationCode = useSelector((state: State) => state.ui.registrationCode)\n const fetching = useSelector((state: State) => state.ui.fetching)\n const user = useSelector((state: State) => state.user)\n\n const [redirected, setRedirected] = useState(false)\n const dispatch = useDispatch()\n\n let accountId = organization.id || user.id\n\n function getRedirect(location?: string, code?: string) {\n if (!location || !code) return\n const url = new URL(decodeURIComponent(location))\n url.searchParams.set('code', code)\n return url.toString()\n }\n\n useEffect(() => {\n console.log('AUTO REGISTRATION EFFECT', {\n platform,\n tags,\n types,\n fetching,\n accountId,\n })\n if (fetching) return\n ;(async () => {\n let options: Parameters[0] = {\n tags,\n accountId,\n services: types.map(type => ({ application: type })),\n }\n if (platform) {\n options.platform = platforms.findType(platform.id)\n options.template = platform.installation?.command\n }\n\n const code = await dispatch.devices.createRegistration(options)\n\n if (!redirect || redirected) return\n\n try {\n setRedirected(true)\n const url = getRedirect(redirect, code)\n console.log('REDIRECT TO:', url)\n windowOpen(url, '_blank', true)\n } catch (error) {\n console.warn('Failed to redirect to:', error)\n }\n })()\n\n return function cleanup() {\n dispatch.ui.set({ registrationCommand: undefined }) // remove registration code so we don't redirect to new device page\n }\n }, [accountId, platform, tags?.length, types.length, fetching])\n\n return { registrationCommand, registrationCode, redirectUrl: getRedirect(redirect, registrationCode), fetching }\n}\n","import React from 'react'\nimport { Collapse } from '@mui/material'\nimport { Notice } from './Notice' // Assuming you have a Notice component\n\ninterface Props {\n message: string\n severity?: 'info' | 'error' | 'warning' | 'success'\n}\n\nexport const OnboardMessage: React.FC = ({ message, severity }) => {\n const [cache, setCache] = React.useState(message)\n\n React.useEffect(() => {\n if (message) setCache(message)\n }, [message])\n\n return (\n \n \n {cache}\n \n \n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { Typography, Stack, CircularProgress, Box, Button } from '@mui/material'\nimport { useAutoRegistration } from '../hooks/useAutoRegistration'\nimport { OnboardMessage } from './OnboardMessage'\n\nexport const OnboardRegistration: React.FC = () => {\n const dispatch = useDispatch()\n const { registrationCode } = useAutoRegistration({ types: [] })\n const { message, severity, reg, id } = useSelector((state: State) => state.bluetooth)\n const processing = reg === 'REGISTERING' || (reg === 'REGISTERED' && !registrationCode)\n\n const register = async () => {\n if (registrationCode) await dispatch.bluetooth.writeRegistrationCode(registrationCode)\n }\n\n return (\n \n \n \n {reg === 'REGISTERING' ? 'Registering...' : reg === 'UNREGISTERED' ? 'Registration' : 'Registered!'}\n \n \n \n {reg === 'REGISTERED' ? (\n \n Your Raspberry Pi is registered and\n
\n ready for remote access.\n
\n ) : (\n <>\n \n Add and share remote access by
\n registering with Remote.It.\n
\n \n This page will update when complete.\n \n \n )}\n \n {reg === 'REGISTERING' ? (\n \n ) : reg !== 'REGISTERED' ? (\n <>\n \n \n \n \n ) : (\n \n )}\n \n
\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { Typography, Stack, Box, Button, CircularProgress, Collapse } from '@mui/material'\nimport { OnboardMessage } from './OnboardMessage'\nimport { IconButton } from '../buttons/IconButton'\nimport { Notice } from './Notice'\nimport { Link } from './Link'\n\ntype Props = {\n next: () => void\n}\n\nexport const OnboardScanning: React.FC = ({ next }) => {\n const { connected, searching, wlan, message, severity } = useSelector((state: State) => state.bluetooth)\n const dispatch = useDispatch()\n const [ready, setReady] = useState(false)\n const [help, setHelp] = useState(false)\n\n useEffect(() => {\n ;(async () => {\n await dispatch.bluetooth.stop()\n setReady(true)\n })()\n }, [])\n\n useEffect(() => {\n if (ready && connected) next()\n }, [connected, wlan, ready])\n\n const onScan = async () => {\n await dispatch.bluetooth.start()\n }\n\n const onCancel = async () => {\n await dispatch.bluetooth.cancel()\n }\n\n return (\n <>\n \n \n Bluetooth Onboarding\n \n \n Note: This setup is only for Raspberry Pis that are enabled with Remote.It. If you already have a Pi\n onlineadd remote access.\n \n \n \n {searching ? (\n <>\n \n \n \n ) : (\n <>\n \n setHelp(!help)}\n inline\n />\n \n )}\n \n \n \n Turn on your Pi with Remote.It Bluetooth Onboarding now.\n \n On first startup, the device could take up to 2 minutes to appear, and it will be discoverable for 10\n minutes after.\n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Icon, IconProps } from '../components/Icon'\nimport { Box } from '@mui/material'\n\ntype Props = IconProps & {\n strength: number\n}\n\nexport const SignalIcon: React.FC = ({ strength, ...props }) => {\n let icon\n\n if (strength == 100) {\n icon = 'signal-bars'\n } else if (strength >= 80) {\n icon = 'signal-bars-good'\n } else if (strength >= 60) {\n icon = 'signal-bars-fair'\n } else {\n icon = 'signal-bars-weak'\n }\n\n return (\n \n \n \n \n \n \n )\n}\n","import React, { useState, useEffect, useRef } from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport {\n Typography,\n Stack,\n Box,\n Button,\n CircularProgress,\n List,\n ListItemText,\n TextField,\n InputAdornment,\n Autocomplete,\n MenuItem,\n} from '@mui/material'\nimport { OnboardMessage } from './OnboardMessage'\nimport { IconButton } from '../buttons/IconButton'\nimport { SignalIcon } from '../buttons/SignalIcon'\nimport { ColorChip } from './ColorChip'\nimport { Link } from './Link'\n\ntype Props = {\n next: () => void\n}\n\nexport const OnboardWifi: React.FC = ({ next }) => {\n const dispatch = useDispatch()\n let { device, message, severity, ssid, scan, wlan, eth, cel, networks } = useSelector(\n (state: State) => state.bluetooth\n )\n\n const [showPassword, setShowPassword] = useState(false)\n const [ready, setReady] = useState(false)\n const [open, setOpen] = useState(false)\n const [form, setForm] = useState({ ssid: '', pwd: '' })\n const passwordRef = useRef()\n\n useEffect(() => {\n dispatch.bluetooth.readSSIDs()\n }, [])\n\n useEffect(() => {\n if (ssid && !form.ssid) setForm({ ...form, ssid })\n }, [ssid])\n\n useEffect(() => {\n if (ready && !message && wlan === 'CONNECTED') {\n dispatch.bluetooth.set({ message: 'Device WiFi connected', severity: 'info' })\n next()\n }\n }, [wlan, ready])\n\n const onScan = async event => {\n event.stopPropagation()\n await dispatch.bluetooth.scanSSIDs()\n await dispatch.bluetooth.readSSIDs()\n setTimeout(() => {\n if (!form.ssid) setForm({ ...form, ssid: networks[0]?.ssid || '' })\n }, 500)\n }\n\n const onSubmit = async (event: React.FormEvent) => {\n event.preventDefault()\n setShowPassword(false)\n await dispatch.bluetooth.writeWifi(form)\n setTimeout(() => setReady(true), 500)\n }\n\n const selectedNetwork = networks.find(network => network.ssid === form.ssid)\n const disabled = scan === 'SCANNING' || wlan === 'CONNECTING'\n const options = networks.map(n => n.ssid)\n const hasConnection = wlan === 'CONNECTED' || eth === 'CONNECTED' || cel === 'CONNECTED'\n\n if (!options.length) options.push('No networks found')\n\n return (\n \n \n WiFi Setup\n \n \n Connect your Raspberry Pi ({device?.name?.replace('Remote.It Onboard', '').trim() || 'unknown'}) to WiFi.\n
\n Select a network and enter its password.\n
\n \n
\n \n {\n e.stopPropagation()\n setOpen(!open)\n },\n },\n }}\n onOpen={() => setOpen(true)}\n onClose={() => setOpen(false)}\n onChange={(event, ssid, reason) => {\n if (!ssid || disabled) return\n setForm({ ...form, ssid })\n passwordRef.current?.focus()\n }}\n renderOption={(props, ssid) => {\n const network = networks.find(n => n.ssid === ssid)\n return (\n \n {ssid}\n {network && }\n \n )\n }}\n renderInput={params => (\n \n {params.InputProps.endAdornment}\n spacing(3.5) }}\n >\n {selectedNetwork && }\n \n \n \n ),\n }}\n inputProps={{\n ...params.inputProps,\n 'data-lpignore': 'true',\n }}\n />\n )}\n />\n setForm({ ...form, pwd: event.target.value })}\n InputProps={{\n endAdornment: (\n spacing(1) }}>\n setShowPassword(!showPassword)}\n icon={showPassword ? 'eye' : 'eye-slash'}\n />\n \n ),\n }}\n inputProps={{\n 'data-lpignore': 'true',\n }}\n />\n \n \n {wlan === 'CONNECTING' ? (\n \n ) : (\n <>\n \n {hasConnection && (\n \n )}\n \n )}\n \n \n {eth === 'CONNECTED' && (\n \n )}\n {cel === 'CONNECTED' && (\n \n )}\n \n \n
\n \n {!hasConnection && (\n \n My device is connected another way. Skip this step.\n \n )}\n \n
\n )\n}\n","import React, { useEffect } from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { REGEX_LAST_PATH } from '../constants'\nimport { useParams, useHistory, useLocation, Switch, Route, Redirect } from 'react-router-dom'\nimport { OnboardRegistration } from '../components/OnboardRegisteration'\nimport { OnboardScanning } from '../components/OnboardScanning'\nimport { OnboardWifi } from '../components/OnboardWifi'\nimport { Body } from '../components/Body'\nimport { Icon } from '../components/Icon'\nimport { Box } from '@mui/material'\n\nconst steps = ['/scanning', '/wifi', '/configuring']\n\nexport const OnboardRouter: React.FC = () => {\n const history = useHistory()\n const location = useLocation()\n const { platform } = useParams<{ platform?: string }>()\n const bluetooth = useSelector((state: State) => state.bluetooth)\n const step = Math.max(steps.indexOf(location.pathname.match(REGEX_LAST_PATH)?.[0] || ''), 0)\n\n useEffect(() => {\n if (step !== 0 && (!bluetooth.initialized || !bluetooth.connected)) {\n history.push(`/onboard/${platform}${steps[0]}`)\n }\n }, [bluetooth])\n\n const onNext = () => {\n const nextStep = step >= steps.length ? 0 : step + 1\n history.push(`/onboard/${platform}${steps[nextStep]}`)\n }\n\n if (!platform) return \n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React, { useEffect } from 'react'\nimport { selectDeviceService } from '../selectors/devices'\nimport { DeviceContext } from '../services/Context'\nimport { selectNetwork } from '../models/networks'\nimport { REGEX_FIRST_PATH, REGEX_SERVICE_ID } from '../constants'\nimport { useLocation, useParams } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { selectSharedNetwork } from '../models/networks'\nimport { selectConnection } from '../selectors/connections'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { isRemoteUI } from '../helpers/uiHelper'\n\nexport const DeviceContextWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n let { deviceID, serviceID, networkID } = useParams<{ deviceID?: string; serviceID?: string; networkID?: string }>()\n if (!deviceID || !REGEX_SERVICE_ID.test(deviceID)) deviceID = undefined\n if (!serviceID || !REGEX_SERVICE_ID.test(serviceID)) serviceID = undefined\n\n const [service, device] = useSelector((state: State) => selectDeviceService(state, undefined, deviceID, serviceID))\n const user = useSelector((state: State) => state.user)\n const network = useSelector((state: State) =>\n networkID ? selectNetwork(state, networkID) : selectSharedNetwork(state, serviceID)\n )\n const connection = useSelector((state: State) => selectConnection(state, service))\n const connections = useSelector((state: State) => state.connections.all).filter(c => c.deviceID === deviceID)\n const remoteUI = useSelector(isRemoteUI)\n const thisId = useSelector((state: State) => state.backend.thisId)\n const { fetching, initialized } = useSelector(selectDeviceModelAttributes)\n\n const waiting = fetching || !initialized\n\n const dispatch = useDispatch()\n const location = useLocation()\n const instance: IInstance | undefined = network || device\n\n useEffect(() => {\n if ((instance?.loaded && device?.loaded) || waiting) return\n\n if (deviceID && !(remoteUI && thisId)) {\n console.log('LOADING DEVICE DATA', deviceID)\n dispatch.devices.fetchSingleFull({ id: deviceID, hidden: true, redirect: '/devices' })\n } else if (serviceID) {\n const redirect = location.pathname.match(REGEX_FIRST_PATH)?.[0]\n if (network && network.cloud && !network.loaded) {\n console.log('LOADING NETWORK DATA', network, redirect)\n dispatch.networks.fetchSingle({ network, redirect })\n } else {\n console.log('LOADING SERVICE DATA', serviceID, redirect)\n dispatch.devices.fetchSingleFull({ id: serviceID, hidden: true, redirect, isService: true })\n }\n }\n }, [deviceID, serviceID, waiting, thisId, instance?.loaded, device?.loaded])\n\n return (\n \n {children}\n \n )\n}\n","import React, { useState } from 'react'\nimport { useParams } from 'react-router-dom'\nimport { selectById } from '../selectors/devices'\nimport { Typography } from '@mui/material'\nimport { newConnection } from '../helpers/connectionHelper'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { NoConnectionPage } from './NoConnectionPage'\nimport { DynamicButton } from '../buttons/DynamicButton'\nimport { InfoButton } from '../buttons/InfoButton'\nimport { Container } from '../components/Container'\nimport { Connect } from '../components/Connect'\nimport { Gutters } from '../components/Gutters'\nimport { Title } from '../components/Title'\n\nexport const ConnectionOtherPage: React.FC = () => {\n const dispatch = useDispatch()\n const [stopping, setStopping] = useState()\n const { serviceID, sessionID } = useParams<{ serviceID?: string; sessionID?: string }>()\n const { service, device, connection, session } = useSelector((state: State) => {\n const [service, device] = selectById(state, undefined, serviceID)\n return {\n service,\n device,\n connection: state.connections.all.find(c => c.sessionId === sessionID) || newConnection(service),\n session: state.sessions.all.find(s => s.id === sessionID),\n }\n })\n\n if (!session) return \n\n const thisStopping = stopping === session.id\n\n return (\n \n \n {session.target.name}\n {device && }\n \n {device?.permissions.includes('MANAGE') && (\n \n {\n setStopping(session.id)\n await dispatch.sessions.disconnect({ id: connection.id, sessionId: session.id })\n }}\n fullWidth\n />\n \n )}\n \n }\n >\n \n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { ListSubheader } from '@mui/material'\nimport { LinearProgress } from './LinearProgress'\n\ntype Props = { loading?: boolean; children?: React.ReactNode }\n\nexport const StickyTitle: React.FC = ({ loading, children }) => {\n const css = useStyles()\n return (\n \n \n {children}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette, spacing }) => ({\n title: {\n display: 'flex',\n paddingTop: spacing(3),\n paddingBottom: spacing(1),\n borderBottom: `1px solid ${palette.grayLighter.main}`,\n\n '&::after': {\n top: 0,\n content: '\"\"',\n position: 'absolute',\n height: '100%',\n width: 30,\n left: -30,\n backgroundColor: palette.white.main,\n },\n },\n}))\n","import React from 'react'\nimport { Title } from '../Title'\nimport { NetworkListItem } from '../NetworkListItem'\nimport { NetworkListTitle } from '../NetworkListTitle'\nimport { StickyTitle } from '../StickyTitle'\nimport { List, Box } from '@mui/material'\n\nexport interface Props {\n networks?: ILookup\n title: string\n action?: React.ReactNode\n forceConnected?: boolean\n}\n\nexport const SessionsList: React.FC = ({ networks, title, action }) => {\n if (!networks || !Object.keys(networks).length) return null\n return (\n <>\n \n {title}\n {action && {action}}\n \n {Object.keys(networks).map(k => (\n \n \n {networks[k].sessions?.map((s, i) => (\n \n ))}\n \n ))}\n \n )\n}\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport { Typography, Divider } from '@mui/material'\nimport { defaultNetwork, recentNetwork } from '../models/networks'\nimport { selectConnectionsByType, selectConnections, selectConnectionSessions } from '../selectors/connections'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { initiatorPlatformIcon } from '../components/InitiatorPlatform'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { SessionsList } from '../components/SessionsList'\nimport { StickyTitle } from '../components/StickyTitle'\nimport { Container } from '../components/Container'\nimport { Network } from '../components/Network'\nimport { Gutters } from '../components/Gutters'\nimport { Title } from '../components/Title'\nimport { Icon } from '../components/Icon'\n\nexport const ConnectionsPage: React.FC = () => {\n const dispatch = useDispatch()\n const allConnections = useSelector(selectConnections)\n const sessions = useSelector(selectConnectionSessions)\n const initialized = useSelector((state: State) => state.connections.initialized)\n const loading = useSelector(selectDeviceModelAttributes).fetching\n const idle = useSelector(selectConnectionsByType)\n\n let active: ILookup = {}\n\n sessions.forEach(s => {\n const id = s.user?.id || 'default'\n if (!active[id]) {\n const [icon, iconType] = initiatorPlatformIcon({ id: s.platform })\n active[id] = {\n ...defaultNetwork(),\n id: 'other',\n name: s.user?.email || 'Unknown',\n icon,\n iconType,\n sessions: [],\n }\n }\n active[id].sessions?.push(s)\n })\n\n if (active) {\n const otherKeys = Object.keys(active)\n if (!otherKeys.length || !active[otherKeys[0]]?.sessions?.length) active = {}\n }\n\n const recent = { ...recentNetwork, serviceIds: allConnections.filter(c => !c.enabled).map(c => c.id) }\n const empty = !idle?.length\n\n return (\n \n \n \n Idle\n \n {initialized ? (\n <>\n {empty && (\n \n \n \n \n You have no connections\n Begin by selecting a device's service from the Devices menu.\n \n )}\n {idle.map(n => (\n \n ))}\n {!!recent.serviceIds.length && (\n <>\n
\n \n dispatch.connections.clear(id)} connectionsPage />\n \n )}\n \n ) : (\n \n )}\n
\n )\n}\n","import React from 'react'\nimport { List, Typography } from '@mui/material'\nimport { useSelector } from 'react-redux'\nimport { State } from '../../store'\nimport { ListItemLocation } from '../../components/ListItemLocation'\nimport { selectLimitsLookup } from '../../selectors/organizations'\nimport { OutOfBand } from '../../components/OutOfBand'\nimport { Container } from '../../components/Container'\nimport { Gutters } from '../../components/Gutters'\nimport { TestUI } from '../../components/TestUI'\nimport { Title } from '../../components/Title'\n\nexport const SettingsPage: React.FC = () => {\n const preferences = useSelector((state: State) => state.backend)\n const feature = useSelector((state: State) => selectLimitsLookup(state))\n\n if (!preferences) return null\n\n return (\n \n \n Settings\n \n \n \n }\n >\n \n \n {feature.tagging && }\n \n \n \n \n \n \n \n \n )\n}\n","import React, { useEffect } from 'react'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { useDispatch } from 'react-redux'\nimport { makeStyles } from '@mui/styles'\nimport { useParams } from 'react-router-dom'\nimport { Dispatch } from '../store'\n\nexport const ClaimPage: React.FC = () => {\n const css = useStyles()\n const dispatch = useDispatch()\n const { claimID } = useParams<{ claimID: string }>()\n\n useEffect(() => {\n dispatch.devices.claimDevice({ code: claimID.toUpperCase(), redirect: true })\n }, [])\n\n return (\n \n Claiming {claimID.toUpperCase()}\n \n }\n />\n )\n}\n\nconst useStyles = makeStyles(({ palette, spacing }) => ({\n code: {\n fontFamily: \"'Roboto Mono'\",\n color: palette.grayDarker.main,\n backgroundColor: palette.grayLighter.main,\n paddingLeft: spacing(1),\n paddingRight: spacing(1),\n borderRadius: spacing(1),\n },\n}))\n","import React, { useState } from 'react'\nimport cloudSync from '../services/CloudSync'\nimport { TEST_HEADER } from '../constants'\nimport { Dispatch, State } from '../store'\nimport { Typography, List, ListItem, Divider } from '@mui/material'\nimport { getApiURL, getWebSocketURL } from '../helpers/apiHelper'\nimport { selectLimitsLookup, selectLimits } from '../selectors/organizations'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { InlineTextFieldSetting } from '../components/InlineTextFieldSetting'\nimport { ListItemSetting } from '../components/ListItemSetting'\nimport { Container } from '../components/Container'\nimport { PortalUI } from '../components/PortalUI'\nimport { Title } from '../components/Title'\nimport { Quote } from '../components/Quote'\nimport { emit } from '../services/Controller'\n\nexport const TestPage: React.FC = () => {\n const dispatch = useDispatch()\n const [testHeader, setTestHeader] = useState(window.localStorage.getItem(TEST_HEADER) || '')\n const { tests, informed } = useSelector((state: State) => state.plans)\n const apis = useSelector((state: State) => state.ui.apis)\n const testUI = useSelector((state: State) => state.ui.testUI)\n const preferences = useSelector((state: State) => state.backend.preferences)\n const limitsOverride = useSelector(selectLimitsLookup)\n const limits = useSelector(selectLimits)\n\n async function setAPIPreference(key: string, value: string | number | boolean) {\n await dispatch.ui.setPersistent({ apis: { ...apis, [key]: value } })\n emit('preferences', { ...preferences, [key]: value })\n }\n\n return (\n \n Test Settings\n \n }\n >\n Test Options\n \n {\n dispatch.ui.setPersistent({ testUI: undefined })\n emit('preferences', { ...preferences, allowPrerelease: false, switchApi: false })\n }}\n />\n dispatch.ui.setPersistent({ testUI: testUI === 'HIGHLIGHT' ? 'ON' : 'HIGHLIGHT' })}\n />\n \n {\n window.localStorage.setItem(TEST_HEADER, result.toString())\n setTestHeader(result.toString())\n }}\n hideIcon\n />\n \n\n {\n setAPIPreference('switchApi', !apis.switchApi)\n emit('binaries/install')\n }}\n toggle={!!apis.switchApi}\n />\n \n \n \n {\n setAPIPreference('apiGraphqlURL', url)\n emit('binaries/install')\n cloudSync.all()\n }}\n hideIcon\n />\n {\n setAPIPreference('webSocketURL', url)\n emit('binaries/install')\n }}\n hideIcon\n />\n \n \n \n \n Features\n \n {limits.map(l => {\n if (typeof l.value === 'boolean')\n return (\n \n dispatch.ui.setPersistent({\n limitsOverride: { ...limitsOverride, [l.name]: !limitsOverride[l.name] },\n })\n }\n />\n )\n })}\n \n dispatch.ui.setPersistent({ limitsOverride: {} })}\n />\n \n Licensing Options\n \n dispatch.plans.set({ tests: { ...tests, limit: !tests.limit, license: !tests.license } })}\n />\n dispatch.plans.testServiceLicensing()}\n />\n dispatch.plans.set({ informed: !informed })}\n />\n \n \n )\n}\n","import React from 'react'\nimport browser, { getOs } from '../../services/browser'\nimport { safeHostname } from '@common/nameHelper'\nimport { selectDeviceModelAttributes } from '../../selectors/devices'\nimport { Link, useHistory } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { State } from '../../store'\nimport {\n Box,\n List,\n ListItemButton,\n ListItemText,\n ListSubheader,\n ListItemIcon,\n ListItemSecondaryAction,\n Chip,\n ChipProps,\n Divider,\n Typography,\n Tooltip,\n} from '@mui/material'\nimport { getAllDevices } from '../../selectors/devices'\nimport { GuideBubble } from '../../components/GuideBubble'\nimport { IconButton } from '../../buttons/IconButton'\nimport { DesktopUI } from '../../components/DesktopUI'\nimport { Notice } from '../../components/Notice'\nimport { Icon } from '../../components/Icon'\n\ntype Props = { className?: string; onClick?: () => void }\n\nexport const DeviceSetupItem: React.FC = ({ className, onClick }) => {\n const history = useHistory()\n const registered = useSelector((state: State) => !!state.backend.thisId)\n const hostname = useSelector((state: State) => safeHostname(state.backend.environment.hostname, []))\n const ownDevice = useSelector((state: State) =>\n getAllDevices(state).find(d => d.thisDevice && d.owner.id === state.user.id)\n )\n const restoring = useSelector((state: State) => state.ui.restoring)\n const canRestore = useSelector(\n (state: State) =>\n !state.backend.thisId &&\n (selectDeviceModelAttributes(state).total > selectDeviceModelAttributes(state).size ||\n !!getAllDevices(state).find((d: IDevice) => d.state !== 'active' && !d.shared))\n )\n\n if (restoring)\n return (\n \n Restoring device...\n \n )\n\n let secondary: React.ReactNode\n let action: ChipProps | undefined\n let disabled = false\n\n if (registered) {\n if (ownDevice) {\n secondary = 'Already created'\n } else {\n secondary = 'This is not your system.'\n disabled = true\n }\n } else if (canRestore) {\n action = {\n label: 'restore',\n onClick: event => {\n event.preventDefault()\n history.push('/devices/restore')\n },\n }\n }\n\n let thisLink = '/devices/setup'\n if (!browser.hasBackend) thisLink = `/add/${getOs()}`\n\n return (\n \n \n \n This system\n {registered && !ownDevice && (\n \n \n \n \n \n )}\n \n \n \n \n Select a device\n \n \n You can setup the device you are currently using, or follow the simple instructions to setup one of the\n commonly used platforms.\n \n \n }\n >\n \n \n \n \n \n {action && (\n \n \n \n )}\n \n \n \n \n )\n}\n","import React from 'react'\nimport { List, ListItemButton, ListItemText, ListSubheader, ListItemIcon, Divider } from '@mui/material'\nimport { Link } from 'react-router-dom'\nimport { Icon } from '../components/Icon'\n\ntype Props = { className?: string }\n\nexport const BluetoothScan: React.FC = ({ className }) => {\n return (\n \n Onboard\n \n \n *': { marginRight: 0.5 } }}\n >\n \n {/* */}\n {/* */}\n {/* */}\n \n \n Setup WiFi  \n {/* */}\n \n }\n secondary={\n <>\n Connect your Pi to Wifi\n
and Remote.It\n \n }\n />\n
\n
\n )\n}\n","import React from 'react'\nimport browser, { windowOpen } from '../services/browser'\nimport { SCREEN_VIEW_APP_LINK } from '../constants'\nimport { useHistory } from 'react-router-dom'\nimport { List, ListItemButton, ListItemText, ListSubheader, ListItemIcon, Divider, Typography } from '@mui/material'\nimport { GuideBubble } from '../components/GuideBubble'\nimport { MobileUI } from '../components/MobileUI'\nimport { Icon } from '../components/Icon'\n\ntype Props = { className?: string; onClick?: () => void }\n\nexport const AndroidSetup: React.FC = ({ className, onClick }) => {\n const history = useHistory()\n\n const handleClick = () => {\n if (browser.isAndroid) windowOpen(SCREEN_VIEW_APP_LINK, 'store', true)\n else history.push('/add/android')\n onClick?.()\n }\n\n return (\n \n \n This system\n \n \n \n Select a device\n \n \n You can setup your Android device, or follow the simple instructions to setup one of the commonly used\n platforms.\n \n \n }\n >\n \n \n \n \n \n \n \n \n \n )\n}\n","import React, { useState, forwardRef } from 'react'\nimport { Confirm, ConfirmProps } from '../components/Confirm'\nimport { DynamicButton, DynamicButtonProps } from './DynamicButton'\n\ntype Props = DynamicButtonProps & {\n confirm?: boolean\n confirmProps?: Omit\n}\n\nexport const ConfirmButton = forwardRef(\n ({ onClick, confirm, confirmProps, ...props }, ref) => {\n const [open, setOpen] = useState(false)\n\n const handleClick = (e: React.MouseEvent) => {\n if (confirm) setOpen(true)\n else onClick?.(e)\n }\n\n const handleConfirm = (e: React.MouseEvent) => {\n onClick?.(e)\n setOpen(false)\n }\n\n return (\n <>\n \n {confirm && (onClick || props.type === 'submit') && (\n setOpen(false)}>\n {confirmProps?.children}\n \n )}\n \n )\n }\n)\n","import React, { useState, useEffect, useRef } from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { selectOrganization } from '../selectors/organizations'\nimport { ConfirmButton } from '../buttons/ConfirmButton'\nimport { List, ListSubheader, ListItem, TextField } from '@mui/material'\nimport { Icon } from '../components/Icon'\n\nconst CLAIM_CODE_LENGTH = 8\ntype Props = { className?: string }\n\nexport const ClaimDevice: React.FC = ({ className }) => {\n const buttonRef = useRef(null)\n const { devices } = useDispatch()\n const [code, setCode] = useState('')\n const [valid, setValid] = useState(false)\n const organization = useSelector((state: State) => selectOrganization(state))\n const claiming = useSelector((state: State) => state.ui.claiming)\n const user = useSelector((state: State) => state.user)\n\n useEffect(() => {\n if (!claiming) handleClose()\n }, [claiming])\n\n const handleClose = () => {\n setValid(false)\n setCode('')\n }\n\n const handleChange = (event: React.ChangeEvent) => {\n let { value } = event.target\n if (value.length >= CLAIM_CODE_LENGTH) {\n value = value.substring(0, CLAIM_CODE_LENGTH)\n setValid(true)\n } else {\n setValid(false)\n }\n setCode(value.toUpperCase())\n }\n\n return (\n \n Claim a device\n \n {\n e.preventDefault()\n buttonRef.current?.click()\n }}\n >\n \n ),\n }}\n />\n devices.claimDevice({ code, redirect: true })}\n confirmProps={{\n title: `Claiming for ${organization.name}`,\n action: 'Ok',\n children: 'You are claiming this device for an organization instead of yourself.',\n }}\n />\n \n \n \n )\n}\n","import React from 'react'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { selectDevice } from '../selectors/devices'\nimport { DEMO_DEVICE_CLAIM_CODE, DEMO_DEVICE_ID } from '../constants'\nimport { Stack, List, ListItemButton, ListSubheader, ListItemIcon, ListItemText, Typography } from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { ListItemLocation } from '../components/ListItemLocation'\nimport { DeviceSetupItem } from '../components/DeviceSetupItem'\nimport { BluetoothScan } from '../components/BluetoothScan'\nimport { AndroidSetup } from '../components/AndroidSetup'\nimport { ClaimDevice } from '../components/ClaimDevice'\nimport { Container } from '../components/Container'\nimport { platforms } from '../platforms'\nimport { spacing } from '../styling'\nimport { Title } from '../components/Title'\nimport { Icon } from '../components/Icon'\n\nexport const AddPage: React.FC = () => {\n const css = useStyles()\n const { devices } = useDispatch()\n const claiming = useSelector((state: State) => state.ui.claiming)\n const hasDemo = useSelector((state: State) => selectDevice(state, state.user.id, DEMO_DEVICE_ID) !== undefined)\n\n return (\n \n What do you want to connect to?\n \n }\n >\n \n \n Try a device\n {\n devices.claimDevice({ code: DEMO_DEVICE_CLAIM_CODE, redirect: true })\n }}\n >\n \n \n \n \n \n \n \n \n \n \n \n Add an instance\n {['docker-jumpbox', 'aws', 'azure', 'gcp', 'arm'].map(p => {\n const platform = platforms.get(p)\n return (\n \n )\n })}\n \n \n Add a device\n {[\n 'raspberrypi',\n 'linux',\n 'docker',\n 'android',\n 'nas',\n 'openwrt',\n 'firewalla',\n 'tinkerboard',\n 'ubiquiti',\n 'nvidia',\n 'alpine',\n 'axis',\n 'advantech',\n 'idy',\n 'ubuntu',\n 'windows',\n 'mac',\n ].map(p => {\n const platform = platforms.get(p)\n return (\n {platform.listItemTitle || platform.name}}\n subtitle={platform.subtitle}\n disableGutters\n />\n )\n })}\n \n \n \n )\n}\n\nexport const useStyles = makeStyles(({ palette, breakpoints }) => ({\n list: {\n minWidth: 175,\n display: 'flex',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n flexWrap: 'wrap',\n marginTop: spacing.md,\n paddingRight: spacing.xs,\n paddingLeft: spacing.md,\n '& .MuiListItemButton-root': {\n display: 'block',\n paddingLeft: spacing.md,\n paddingTop: spacing.lg,\n paddingRight: spacing.md,\n flexGrow: 'initial',\n },\n '& .MuiListItemText-root': { marginTop: spacing.sm, marginBottom: spacing.sm },\n '& .MuiListItemSecondaryAction-root': { right: spacing.xs, top: 45 },\n '& .MuiListSubheader-root': {\n width: '100%',\n borderBottom: `1px solid ${palette.grayLight.main}`,\n marginBottom: spacing.xs,\n },\n },\n icons: {\n '& .MuiListItemButton-root, & .MuiListItem-root': {\n width: 140,\n minWidth: 140,\n minHeight: 100,\n margin: 1,\n },\n [breakpoints.down('sm')]: {\n '& .MuiListItemButton-root, & .MuiListItem-root': {\n width: 110,\n minWidth: 110,\n },\n },\n },\n smallList: {\n width: '50%',\n [breakpoints.up('sm')]: { width: 200 },\n // [breakpoints.up('md')]: { width: 200 },\n },\n}))\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { selectDeviceModelAttributes, selectIsFiltered } from '../selectors/devices'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { DEMO_DEVICE_CLAIM_CODE } from '../constants'\nimport { Typography, Button, Box } from '@mui/material'\nimport { isUserAccount } from '../selectors/accounts'\nimport { GuideStep } from './GuideStep'\nimport { spacing } from '../styling'\nimport { Notice } from './Notice'\nimport { Icon } from './Icon'\nimport { Body } from './Body'\n\nexport const DeviceListEmpty: React.FC = () => {\n const css = useStyles()\n const { devices } = useDispatch()\n const isFiltered = useSelector(selectIsFiltered)\n const deviceModel = useSelector(selectDeviceModelAttributes)\n const userAccount = useSelector(isUserAccount)\n const claiming = useSelector((state: State) => state.ui.claiming)\n const noResults = deviceModel.searched || isFiltered\n\n return (\n \n {noResults ? (\n \n Your {deviceModel.searched ? 'search' : 'filter'} returned no results\n \n ) : userAccount ? (\n <>\n \n \n devices.claimDevice({ code: DEMO_DEVICE_CLAIM_CODE })}\n variant=\"contained\"\n color=\"primary\"\n size=\"medium\"\n className={css.button}\n disabled={claiming}\n >\n Demo Device\n \n \n \n \n See how simple it is to connect with our AWS demo device, or add your own device from the plus menu in the\n top left of the screen.\n \n \n ) : (\n \n This account has no devices\n \n )}\n \n )\n}\n\nconst useStyles = makeStyles({\n block: { marginBottom: spacing.xl },\n button: { marginBottom: spacing.md },\n})\n","import React, { useEffect } from 'react'\nimport browser from '../services/browser'\nimport { makeStyles } from '@mui/styles'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { ClickAwayListener, Box } from '@mui/material'\nimport { radius } from '../styling'\nimport { Body } from './Body'\n\nconst WIDTH = 275\n\nexport const Drawer: React.FC<{ menu: string; children?: React.ReactNode }> = ({ menu, children }) => {\n const open = useSelector((state: State) => state.ui.drawerMenu === menu)\n const { ui } = useDispatch()\n const width = open ? WIDTH : 0\n const css = useStyles()\n\n useEffect(() => {\n if (!browser.isElectron) return\n\n const body = document.body\n if (open) body.classList.add('body-no-drag')\n else body.classList.remove('body-no-drag')\n\n return () => {\n body.classList.remove('body-no-drag')\n }\n }, [open])\n\n return (\n {\n if (open) {\n event.preventDefault()\n ui.set({ drawerMenu: null })\n }\n }}\n >\n *': { minWidth: width },\n }}\n >\n {children}\n \n \n )\n}\n\nconst useStyles = makeStyles({\n body: { maxHeight: '100%' },\n})\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { ListSubheader, List, ListItemText, ListItemButton, ListItemIcon, Button } from '@mui/material'\nimport { selectAllActiveAttributes } from '../selectors/devices'\nimport { defaultState } from '../models/ui'\nimport { spacing } from '../styling'\nimport { Drawer } from './Drawer'\nimport { Icon } from './Icon'\n\nexport const ColumnsDrawer: React.FC = () => {\n const attributes = useSelector(selectAllActiveAttributes).filter(a => a.column)\n const selected = useSelector((state: State) => state.ui.columns)\n const { ui, devices } = useDispatch()\n const css = useStyles()\n\n const add = name => {\n ui.setPersistent({ columns: [...selected, name] })\n devices.fetchList()\n }\n const remove = index => {\n const columns = [...selected]\n columns.splice(index, 1)\n ui.setPersistent({ columns })\n }\n\n const onReset = () => {\n ui.setPersistent({\n columns: [...defaultState.columns],\n columnWidths: { ...defaultState.columnWidths },\n drawerMenu: null,\n })\n devices.fetchList()\n }\n\n return (\n \n \n \n Columns\n \n \n {attributes.map(data => {\n const checked = selected.indexOf(data.id)\n return (\n (checked >= 0 ? remove(checked) : add(data.id))}\n >\n {checked >= 0 && }\n = 0 ? 'primary' : undefined }}\n />\n \n )\n })}\n \n \n )\n}\n\nconst useStyles = makeStyles({\n list: {\n padding: 0,\n marginBottom: spacing.lg,\n textTransform: 'capitalize',\n '& .MuiListSubheader-root': { display: 'flex', justifyContent: 'space-between', paddingRight: 0 },\n },\n})\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Divider } from '@mui/material'\nimport { ListItemSetting } from './ListItemSetting'\nimport { spacing } from '../styling'\n\ntype Props = {\n tag: ITagFilter | undefined\n onUpdate: ({ tag }: { tag: ITagFilter }) => void\n}\n\nexport const TagFilterToggle: React.FC = ({ tag, onUpdate }) => {\n const css = useStyles()\n const matchAny = tag?.operator !== 'ALL'\n return (\n <>\n \n tag &&\n onUpdate({\n tag: {\n values: tag.values,\n operator: matchAny ? 'ALL' : 'ANY',\n },\n })\n }\n />\n \n \n )\n}\n\nconst useStyles = makeStyles({\n divider: {\n marginBottom: spacing.sm,\n marginRight: spacing.lg,\n marginLeft: 70,\n },\n})\n","import React from 'react'\nimport { List, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'\nimport { Icon } from './Icon'\n\ntype Props = {\n value: string | number | string[] | number[]\n icon: string\n filterList: { value: string | number; name: string; color?: string }[]\n children?: React.ReactNode\n onSelect: (value: any) => void\n}\n\nexport const FilterSelector: React.FC = ({ value, icon, filterList, onSelect, children }) => {\n if (value === undefined) {\n console.warn('FilterSelector: value is undefined', filterList)\n return null\n }\n\n const isActive = v => {\n if (Array.isArray(value)) return value.includes(v as never)\n else return v === value.toString().replace('-', '')\n }\n\n return (\n \n {children}\n {filterList.map((f, index) => (\n onSelect(f.value)} sx={{ paddingY: 0 }}>\n {isActive(f.value) && }\n \n \n ))}\n \n )\n}\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { AccordionMenuItem } from './AccordionMenuItem'\nimport { Divider } from '@mui/material'\n\ntype IAccordionMenu = {\n key: number | string\n disabled?: boolean\n subtitle: string\n onClear?: () => void\n children: React.ReactNode\n}\n\ntype Props = { menus: IAccordionMenu[] }\n\nexport const AccordionMenu: React.FC = ({ menus }) => {\n const { drawerAccordion } = useSelector((state: State) => state.ui)\n const { ui } = useDispatch()\n\n return (\n <>\n {menus.map(\n (menu, index) =>\n menu.disabled || (\n \n {!!index && }\n ui.setPersistent({ drawerAccordion: expanded ? menu.key : undefined })}\n onClear={menu.onClear}\n subtitle={menu.subtitle}\n square\n >\n {menu.children}\n \n \n )\n )}\n \n )\n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { platforms } from '../platforms'\nimport { defaultState } from '../models/devices'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectLimitsLookup } from '../selectors/organizations'\nimport { TagFilterToggle } from './TagFilterToggle'\nimport { FilterSelector } from './FilterSelector'\nimport { AccordionMenu } from './AccordionMenu'\nimport { selectTags } from '../selectors/tags'\nimport { useLabel } from '../hooks/useLabel'\nimport { Drawer } from './Drawer'\n\nconst sortFilters = [\n { value: 'name', name: 'Name' },\n { value: 'state,name', name: 'Status' },\n { value: 'platform,name', name: 'Platform' },\n { value: 'created,state,name', name: 'Created Date' },\n { value: 'lastReported,name', name: 'Last Reported Date' },\n { value: 'owner.email,name', name: 'Owner' },\n { value: 'endpoint.quality,name', name: 'Quality' },\n // { value: 'attributes.$remoteit.color,name', name: 'Color' },\n]\nconst deviceFilters = [\n { value: 'all', name: 'All' },\n { value: 'active', name: 'Online' },\n { value: 'inactive', name: 'Offline' },\n]\nconst ownerFilters = [\n { value: 'all', name: 'All' },\n { value: 'me', name: 'Me' },\n { value: 'others', name: 'Others' },\n]\nlet platformFilter = [{ value: -1, name: 'All' }]\n\nexport const FilterDrawer: React.FC = () => {\n const { devices } = useDispatch()\n const getColor = useLabel()\n const feature = useSelector(selectLimitsLookup)\n const state = useSelector(selectDeviceModelAttributes)\n const tags = useSelector(selectTags).map(t => ({ name: t.name, value: t.name, color: getColor(t.color) }))\n\n const update = values => {\n values = { ...values, from: defaultState.from }\n devices.set(values)\n devices.fetchList()\n }\n\n const onSort = value => {\n if (state.sort === value) value = value.substring(0, 1) === '-' ? value : `-${value}`\n update({ sort: value })\n }\n\n const onTag = value => {\n let result = state.tag ? [...state.tag.values] : undefined\n const index = result && result.indexOf(value)\n console.log({ value, tag: state.tag, index, result })\n\n if (index !== undefined && index >= 0) result?.splice(index, 1)\n else if (value === '') result = undefined\n else result === undefined ? (result = [value]) : result.push(value)\n\n if (!result?.length) update({ tag: undefined })\n else update({ tag: { values: result, operator: state.tag?.operator || 'ANY' } })\n }\n\n const onState = value => update({ filter: value })\n\n const onOwner = value => update({ owner: value })\n\n const onPlatform = value => {\n let result = Array.isArray(state.platform) ? [...state.platform] : undefined\n const index = result && result.indexOf(value)\n\n if (index !== undefined && index >= 0) result?.splice(index, 1)\n else if (value === -1) result = undefined\n else result === undefined ? (result = [value]) : result.push(value)\n\n if (!result?.length) result = undefined\n update({ platform: result })\n }\n\n return (\n \n update({ sort: defaultState.sort }),\n children: (\n \n ),\n },\n {\n key: 'tag',\n subtitle: 'Tags',\n onClear: state.tag === undefined ? undefined : () => update({ tag: undefined }),\n disabled: !feature.tagging,\n children: (\n \n \n \n ),\n },\n {\n key: 'state',\n subtitle: 'State',\n onClear: defaultState.filter === state.filter ? undefined : () => update({ filter: defaultState.filter }),\n children: (\n \n ),\n },\n {\n key: 'owner',\n subtitle: 'Owner',\n onClear: defaultState.owner === state.owner ? undefined : () => update({ owner: defaultState.owner }),\n children: ,\n },\n {\n key: 'platform',\n subtitle: 'Platform',\n onClear: state.platform === undefined ? undefined : () => update({ platform: undefined }),\n children: (\n ({ value: parseInt(p), name: platforms.nameLookup[p] }))\n .sort((a, b) => (a.name?.toLowerCase() > b.name?.toLowerCase() ? 1 : -1))\n )}\n />\n ),\n },\n ]}\n />\n \n )\n}\n","import React from 'react'\nimport { ColumnsDrawer } from './ColumnsDrawer'\nimport { FilterDrawer } from './FilterDrawer'\nimport { Container } from './Container'\n\nexport const DevicesDrawers: React.FC<{ children?: React.ReactNode }> = ({ children }) => {\n return (\n \n \n \n \n }\n >\n {children}\n \n )\n}\n","import React from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { Checkbox } from '@mui/material'\nimport { Icon } from './Icon'\n\ntype Props = { select?: boolean; devices: IDevice[] }\n\nexport const DeviceListHeaderCheckbox: React.FC = ({ select, devices }) => {\n const { selected } = useSelector((state: State) => state.ui)\n const dispatch = useDispatch()\n const indeterminate = selected.length > 0 && selected.length < devices.length\n\n if (!select) return null\n\n const onClick = event => {\n event.stopPropagation()\n if (indeterminate || selected.length === 0) {\n dispatch.ui.set({ selected: devices.map(d => d.id) })\n } else {\n dispatch.ui.set({ selected: [] })\n }\n }\n\n return (\n }\n indeterminateIcon={}\n icon={}\n color=\"primary\"\n />\n )\n}\n","import React from 'react'\nimport { Typography, Box } from '@mui/material'\nimport { DeviceName } from './DeviceName'\n\ntype Props = {\n service: IService\n device: IDevice\n connection?: IConnection\n duplicateName?: boolean\n}\n\nexport const MobileServiceName: React.FC = ({ device, service, connection, duplicateName }) => (\n \n {!duplicateName && (\n *': { color: 'grayDark.main' } }}>\n \n \n )}\n \n \n \n \n)\n","import React, { useState, useEffect } from 'react'\nimport { Dialog, DialogTitle, DialogContent } from '@mui/material'\nimport { useDispatch } from 'react-redux'\nimport { useParams } from 'react-router-dom'\nimport { Dispatch } from '../store'\nimport { Confirm } from '../components/Confirm'\nimport { Notice } from '../components/Notice'\nimport { emit } from '../services/Controller'\n\ninterface Props {\n deviceId: string\n restore: boolean\n onComplete: () => void\n}\n\nexport const Restore: React.FC = ({ deviceId, restore, onComplete }) => {\n const { platform } = useParams<{ platform?: string }>()\n const [open, setOpen] = useState(false)\n const dispatch = useDispatch()\n\n const onRestore = async () => {\n setOpen(true)\n if (platform === 'pi') {\n const result = await dispatch.devices.getRestoreCommand(deviceId)\n if (result?.restoreCode) await dispatch.bluetooth.writeRegistrationCode(result.restoreCode)\n dispatch.ui.set({ redirect: '/onboard/raspberrypi/configuring' })\n }\n }\n\n useEffect(() => {\n if (restore) onRestore()\n }, [restore])\n\n return platform === 'pi' ? (\n \n Restoring device...\n \n ) : (\n {\n dispatch.ui.set({ restoring: true, redirect: '/devices' })\n emit('restore', deviceId)\n setOpen(false)\n }}\n onDeny={() => {\n setOpen(false)\n onComplete()\n }}\n title=\"Restore device from Cloud\"\n >\n We will attempt to restore this device's configuration. Please note this may not completely restore services that\n have custom host information.\n \n )\n}\n","import React, { useState, useContext } from 'react'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { useHistory } from 'react-router-dom'\nimport { MobileServiceName } from './MobileServiceName'\nimport { DeviceListContext } from '../services/Context'\nimport { AttributeValueMemo } from './AttributeValue'\nimport { ConnectionStateIcon } from './ConnectionStateIcon'\nimport { GridListItem } from './GridListItem'\nimport { Restore } from './Restore'\nimport { Icon } from './Icon'\nimport { Box } from '@mui/material'\n\ntype Props = {\n restore?: boolean\n select?: boolean\n selected: string[]\n mobile?: boolean\n disabled?: boolean\n duplicateName?: boolean\n onClick?: () => void\n}\n\nexport const DeviceListItem: React.FC = ({\n restore,\n select,\n selected,\n mobile,\n disabled,\n duplicateName,\n onClick,\n}) => {\n const [startRestore, setStartRestore] = useState(false)\n const dispatch = useDispatch()\n const { connections, device, service, attributes, required } = useContext(DeviceListContext)\n const connection =\n connections && (service ? connections.find(c => c.id === service.id) : connections.find(c => c.enabled))\n const history = useHistory()\n\n if (!device) return null\n\n const isSelected = selected.includes(device.id)\n\n const onSelect = deviceId => {\n const select = [...selected]\n if (isSelected) {\n const index = select.indexOf(deviceId)\n select.splice(index, 1)\n } else {\n select.push(deviceId)\n }\n dispatch.ui.set({ selected: select })\n }\n\n const handleClick = () => {\n onClick?.()\n if (select) onSelect?.(device.id)\n else if (restore) setStartRestore(true)\n else history.push(`/devices/${device.id}${service ? `/${service.id}/connect` : ''}`)\n }\n\n return (\n <>\n \n ) : (\n \n )\n ) : (\n \n )\n }\n required={\n mobile && service ? (\n \n ) : (\n !duplicateName && (\n \n )\n )\n }\n disableGutters\n >\n {attributes?.map(attribute => (\n \n \n \n ))}\n \n {restore && setStartRestore(false)} />}\n \n )\n}\n","import React from 'react'\nimport { Dispatch, State } from '../../store'\nimport { selectDeviceModelAttributes } from '../../selectors/devices'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { makeStyles } from '@mui/styles'\nimport { Box, Button } from '@mui/material'\nimport { spacing } from '../../styling'\n\nexport const LoadMore: React.FC = () => {\n const { from, size, total, results, searched, fetching } = useSelector((state: State) =>\n selectDeviceModelAttributes(state)\n )\n const dispatch = useDispatch()\n const css = useStyles()\n\n const pages = Math.ceil((searched ? results : total) / size)\n const nextPage = Math.floor(from / size) + 1\n\n if (nextPage >= pages) return null\n\n return (\n \n {\n dispatch.devices.set({ from: nextPage * size, append: true })\n dispatch.devices.fetchList()\n }}\n >\n {fetching ? `Loading ${from} - ${from + size}...` : 'Load More'}\n \n \n )\n}\n\nconst useStyles = makeStyles({\n box: {\n position: 'absolute',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n flexDirection: 'column',\n padding: spacing.lg,\n paddingBottom: spacing.xl,\n height: 100,\n marginLeft: spacing.xl,\n marginTop: spacing.xl,\n },\n})\n","import React from 'react'\nimport browser from '../services/browser'\nimport { useLocation } from 'react-router-dom'\nimport { MOBILE_WIDTH } from '../constants'\nimport { DeviceListContext } from '../services/Context'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { DeviceListHeaderCheckbox } from './DeviceListHeaderCheckbox'\nimport { Typography, useMediaQuery } from '@mui/material'\nimport { DeviceListItem } from './DeviceListItem'\nimport { Attribute } from './Attributes'\nimport { isOffline } from '../models/devices'\nimport { GuideBubble } from './GuideBubble'\nimport { LoadMore } from './LoadMore'\nimport { GridList } from './GridList'\n\nexport interface DeviceListProps {\n attributes: Attribute[]\n required: Attribute\n connections: { [deviceID: string]: IConnection[] }\n columnWidths: ILookup\n fetching?: boolean\n devices?: IDevice[]\n restore?: boolean\n select?: boolean\n selected?: string[]\n}\n\nexport const DeviceList: React.FC = ({\n attributes,\n required,\n devices = [],\n connections = {},\n columnWidths,\n fetching,\n restore,\n select,\n selected = [],\n}) => {\n const location = useLocation()\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const dispatch = useDispatch()\n\n return (\n }\n headerContextData={{ device: devices[0] }}\n headerContextProvider={DeviceListContext.Provider}\n >\n {devices?.map((device, index) => {\n const canRestore = isOffline(device) && !device.shared\n if (restore && !canRestore) return null\n const disabled = select && !device.scriptable && location.pathname.includes('scripting')\n return (\n \n dispatch.ui.pop('deviceList')}\n disabled={disabled}\n />\n {!index && (\n \n \n Access a device\n \n \n A device can host it's own applications (services), or it can host another service on it's local\n network.\n \n \n Select a device to connect to a service, or configure it.\n \n \n }\n />\n )}\n \n )\n })}\n \n \n )\n}\n","import React, { useRef } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { MOBILE_WIDTH } from '../constants'\nimport { getSortOptions } from './SortServices'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { DeviceListHeaderCheckbox } from './DeviceListHeaderCheckbox'\nimport { Divider, useMediaQuery } from '@mui/material'\nimport { DeviceListContext } from '../services/Context'\nimport { DeviceListItem } from './DeviceListItem'\nimport { Attribute } from './Attributes'\nimport { GridList } from './GridList'\nimport { LoadMore } from './LoadMore'\n\nexport interface DeviceListProps {\n attributes: Attribute[]\n required: Attribute\n applicationTypes?: number[]\n connections: { [deviceID: string]: IConnection[] }\n columnWidths: ILookup\n fetching?: boolean\n devices?: IDevice[]\n restore?: boolean\n select?: boolean\n selected?: string[]\n}\n\nexport const ServiceList: React.FC = ({\n attributes,\n required,\n applicationTypes,\n devices = [],\n connections = {},\n columnWidths,\n fetching,\n select,\n selected = [],\n}) => {\n const { sortService } = getSortOptions(useSelector(selectDeviceModelAttributes).sortServiceOption)\n const location = useLocation()\n const previousName = useRef('')\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n\n const rows = devices.reduce((row, device) => {\n const hasFilter = applicationTypes?.length\n const services = [...device.services].sort(sortService)\n for (const s of services) {\n if (!hasFilter) row.push([s, device])\n else if (applicationTypes.includes(s.typeID)) row.push([s, device])\n }\n return row\n }, [] as [IService, IDevice][])\n\n // Reset previous name when the list changes\n previousName.current = ''\n\n return (\n }\n headerContextData={{ device: devices[0], service: devices[0].services[0] }}\n headerContextProvider={DeviceListContext.Provider}\n >\n {rows.map(([service, device]) => {\n const disabled = select && !device.scriptable && location.pathname.includes('scripting')\n const duplicateName = device.id === previousName.current\n const divider = !duplicateName && !!previousName.current\n previousName.current = device.id\n return (\n \n {divider && }\n \n \n )\n })}\n \n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { MOBILE_WIDTH } from '../constants'\nimport { useMediaQuery, Box, Divider, Typography, InputLabel, Collapse } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectLimitsLookup, selectPermissions } from '../selectors/organizations'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { getSelectedTags } from '../helpers/selectedHelper'\nimport { ConfirmIconButton } from '../buttons/ConfirmIconButton'\nimport { IconButton } from '../buttons/IconButton'\nimport { useHistory } from 'react-router-dom'\nimport { selectTags } from '../selectors/tags'\nimport { TagEditor } from './TagEditor'\nimport { Notice } from './Notice'\nimport { TestUI } from './TestUI'\nimport { Title } from './Title'\nimport { Icon } from './Icon'\nimport { spacing, radius } from '../styling'\n\ntype Props = { devices?: IDevice[] }\n\nexport const DevicesActionBar: React.FC = ({ devices }) => {\n const accountId = useSelector(selectActiveAccountId)\n const feature = useSelector(selectLimitsLookup)\n const tags = useSelector(selectTags)\n const selected = useSelector((state: State) => state.ui.selected)\n const adding = useSelector((state: State) => state.tags.adding)\n const removing = useSelector((state: State) => state.tags.removing)\n const destroying = useSelector((state: State) => state.ui.destroying)\n const permissions = useSelector(selectPermissions)\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const dispatch = useDispatch()\n const history = useHistory()\n const css = useStyles()\n\n const onCreate = async tag => await dispatch.tags.create({ tag, accountId })\n\n return (\n \n \n <Typography variant=\"subtitle1\">\n {selected.length} \n {mobile ? <Icon name=\"check\" inline /> : 'Selected'}\n </Typography>\n \n {feature.tagging && (\n <>\n {mobile || tags}\n dispatch.tags.addSelected({ tag, selected })}\n />\n dispatch.tags.removeSelected({ tag, selected })}\n />\n \n \n )}\n {permissions.includes('SCRIPTING') && !mobile && (\n <>\n \n script\n \n \n \n \n \n )}\n await dispatch.devices.destroySelected(selected)}\n confirmProps={{\n title: 'Confirm Device Deletion',\n color: 'error',\n action: `Delete ${selected.length} device${selected.length === 1 ? '' : 's'}`,\n children: (\n <>\n \n Deletion is irreversible and may require device access for recovery.\n \n Uninstall the Remote.It agent before deletion for best results.\n \n ),\n }}\n confirm\n />\n {\n dispatch.ui.set({ selected: [] })\n history.push('/devices')\n }}\n />\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n actions: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderTop: `1px solid ${palette.white.main}`,\n position: 'relative',\n overflow: 'hidden',\n backgroundColor: palette.primary.main,\n borderRadius: radius.lg,\n marginLeft: spacing.sm,\n marginRight: spacing.sm,\n marginBottom: spacing.xs,\n paddingRight: spacing.sm,\n zIndex: 10,\n '& .MuiTypography-subtitle1': {\n marginTop: spacing.xs,\n marginBottom: spacing.xs,\n fontWeight: 800,\n color: palette.alwaysWhite.main,\n },\n '& .MuiInputLabel-root': {\n color: palette.alwaysWhite.main,\n marginRight: spacing.xs,\n transform: 'translate(0, 3px) scale(0.75)',\n },\n '& > div + div': {\n marginLeft: -spacing.xs,\n },\n '& .MuiDivider-root': {\n height: '1.5em',\n backgroundColor: palette.alwaysWhite.main,\n marginLeft: spacing.sm,\n marginRight: spacing.sm,\n opacity: 0.3,\n },\n },\n}))\n","import React from 'react'\nimport { State } from '../store'\nimport { MOBILE_WIDTH } from '../constants'\nimport { useMediaQuery, Stack, Typography, Button } from '@mui/material'\nimport { useSelector } from 'react-redux'\nimport { useHistory } from 'react-router-dom'\nimport { radius } from '../styling'\nimport { Icon } from './Icon'\n\nexport const DevicesSelectBar: React.FC = () => {\n const selected = useSelector((state: State) => state.ui.selected)\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const history = useHistory()\n\n return (\n \n {selected.length ? (\n \n {selected.length} \n {mobile ? : 'Selected'}\n \n ) : (\n \n Select devices\n \n )}\n \n \n {!!selected.length && (\n \n )}\n \n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { Switch, Route } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { DevicesActionBar } from './DevicesActionBar'\nimport { DevicesSelectBar } from './DevicesSelectBar'\nimport { Collapse } from '@mui/material'\n\ntype Props = { select?: boolean; devices?: IDevice[] }\n\nexport const DevicesActionBars: React.FC = ({ select, devices }) => {\n const selected = useSelector((state: State) => state.ui.selected)\n\n return (\n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Divider, Tab, TabProps } from '@mui/material'\n\nexport const MasterTab = (props: TabProps) => (\n <>\n \n \n \n)\n","import React from 'react'\nimport isEqual from 'lodash/isEqual'\nimport { Dispatch } from '../store'\nimport { defaultState } from '../models/devices'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectApplicationTypesGrouped } from '../selectors/applications'\nimport { selectDeviceModelAttributes } from '../selectors/devices'\nimport { Stack, Tabs, Tab } from '@mui/material'\nimport { MasterTab } from './MasterTab'\nimport { Icon } from './Icon'\n\nconst SCREEN_VIEW_ID = 48\n\nexport const DevicesApplicationsTabs: React.FC = () => {\n const dispatch = useDispatch()\n const allTypes = [...useSelector(selectApplicationTypesGrouped)]\n const { applicationTypes } = useSelector(selectDeviceModelAttributes)\n\n if (!allTypes.length) return null\n\n let selection = allTypes.findIndex(t => isEqual(applicationTypes, t.ids))\n\n const update = async (updated?: number[]) => {\n await dispatch.devices.set({ applicationTypes: updated, from: defaultState.from })\n await dispatch.devices.fetchList()\n }\n\n return (\n \n update(undefined)} />\n {allTypes.map(app => {\n return app.ids.includes(SCREEN_VIEW_ID) ? (\n \n \n   ScreenView\n \n }\n onClick={() => update([SCREEN_VIEW_ID])}\n />\n ) : (\n update(app.ids)} />\n )\n })}\n \n )\n}\n","import React from 'react'\nimport { Container } from './Container'\nimport { DevicesActionBars } from './DevicesActionBars'\nimport { DevicesApplicationsTabs } from './DevicesApplicationsTabs'\nimport { Notice } from './Notice'\nimport { Route } from 'react-router-dom'\n\ntype Props = { select?: boolean; devices?: IDevice[]; children?: React.ReactNode }\n\nexport const DevicesHeader: React.FC = ({ select, devices, children }) => {\n return (\n \n \n \n \n Please select a device to restore.\n \n \n }\n >\n {children}\n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { State } from '../store'\nimport { useHistory } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { selectDeviceListAttributes, selectDeviceModelAttributes, selectVisibleDevices } from '../selectors/devices'\nimport { getConnectionsLookup } from '../selectors/connections'\nimport { selectPermissions } from '../selectors/organizations'\nimport { restoreAttributes } from '../components/Attributes'\nimport { DeviceListEmpty } from '../components/DeviceListEmpty'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { DevicesDrawers } from '../components/DevicesDrawers'\nimport { RegisterMenu } from '../components/RegisterMenu'\nimport { DeviceList } from '../components/DeviceList'\nimport { ServiceList } from '../components/ServiceList'\nimport { DevicesHeader } from '../components/DevicesHeader'\n\ntype Props = { restore?: boolean; select?: boolean }\n\nexport const DevicesPage: React.FC = ({ restore, select }) => {\n const history = useHistory()\n const [initLoad, setInitLoad] = useState(false)\n const { attributes, required } = useSelector(selectDeviceListAttributes)\n const { fetching: deviceFetching, initialized, applicationTypes } = useSelector(selectDeviceModelAttributes)\n const devices = useSelector(selectVisibleDevices)\n const permissions = useSelector(selectPermissions)\n const connections = useSelector(getConnectionsLookup)\n const columnWidths = useSelector((state: State) => state.ui.columnWidths)\n const selected = useSelector((state: State) => state.ui.selected)\n const fetching = useSelector((state: State) => state.ui.fetching) || deviceFetching\n\n const shouldRedirect = initLoad && permissions.includes('MANAGE')\n\n useEffect(() => {\n if (!initialized) setInitLoad(true)\n if (shouldRedirect && !devices.length) {\n history.push('/add')\n }\n }, [initialized, history])\n\n return (\n \n \n \n {(fetching || shouldRedirect) && !devices.length ? (\n \n ) : !devices.length ? (\n \n ) : !restore && applicationTypes?.length ? (\n \n ) : (\n \n )}\n \n \n )\n}\n","import React, { useState, useEffect, useCallback } from 'react'\nimport { DEFAULT_SERVICE, REGEX_NAME_SAFE } from '@common/constants'\nimport { List, Chip, Typography } from '@mui/material'\nimport { getType, findType } from '../../models/applicationTypes'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { ListItemCheckbox } from '../ListItemCheckbox'\nimport { LoadingMessage } from '../LoadingMessage'\nimport { IconButton } from '../../buttons/IconButton'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../../styling'\nimport { Title } from '../Title'\nimport { emit } from '../../services/Controller'\n\ntype Props = {\n onSelect: (services: IService[]) => void\n}\n\nexport const LocalhostScanForm: React.FC = ({ onSelect }) => {\n const css = useStyles()\n const { ui } = useDispatch()\n const [state, setState] = useState([])\n const { applicationTypes, timestamp, loading, scanTimestamp, scanData } = useSelector((state: State) => {\n const { localhost } = state.backend.scanData\n const applicationTypes = state.applicationTypes.all\n return {\n applicationTypes,\n timestamp: state.ui.scanTimestamp.localhost,\n loading: state.ui.scanLoading.localhost,\n scanTimestamp: localhost?.timestamp,\n scanData:\n localhost?.data[0] &&\n localhost?.data[0][1].map(row => ({\n ...DEFAULT_SERVICE,\n typeID: getType(applicationTypes, row[0]),\n port: row[0],\n name: row[1].replace(REGEX_NAME_SAFE, ''),\n })),\n }\n })\n const updateTargets = useCallback(\n checked => {\n const selected = scanData.filter((_, key) => checked[key])\n onSelect(selected)\n },\n [scanData, onSelect]\n )\n\n const scan = () => {\n ui.set({ scanLoading: { localhost: true } })\n emit('scan', 'localhost')\n }\n\n useEffect(() => {\n scan()\n }, [])\n\n useEffect(() => {\n if (scanTimestamp !== timestamp && loading) {\n ui.set({\n scanLoading: { localhost: false },\n scanTimestamp: { localhost: scanTimestamp },\n })\n }\n }, [scanTimestamp, timestamp, loading])\n\n if (!scanData) return \n\n return (\n <>\n \n Select any found services to auto setup\n \n \n \n {scanData.map((row, key) => (\n {\n state[key] = !state[key]\n setState([...state])\n updateTargets([...state])\n }}\n >\n \n \n ))}\n \n
\n You can always add additional services after registration.\n \n )\n}\n\nconst useStyles = makeStyles({\n chip: { marginRight: spacing.md },\n body: { display: 'flex', alignItems: 'center' },\n})\n","import React, { useState, useEffect } from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { safeHostname, osName, serviceNameValidation } from '@common/nameHelper'\nimport { TextField, Button, Typography } from '@mui/material'\nimport { LocalhostScanForm } from '../../components/LocalhostScanForm'\nimport { selectActiveUser } from '../../selectors/accounts'\nimport { spacing, radius } from '../../styling'\nimport { useHistory } from 'react-router-dom'\nimport { makeStyles } from '@mui/styles'\nimport { getDevices } from '../../selectors/devices'\nimport { emit } from '../../services/Controller'\nimport { Body } from '../../components/Body'\nimport { Link } from '../../components/Link'\n\ntype Props = { os?: Ios }\n\nexport const SetupDevice: React.FC = ({ os }) => {\n const { activeUser, hostname, nameBlacklist } = useSelector((state: State) => ({\n activeUser: selectActiveUser(state),\n hostname: state.backend.environment.hostname,\n nameBlacklist: getDevices(state)\n .filter((device: IDevice) => !device.shared)\n .map((d: IDevice) => d.name.toLowerCase()),\n }))\n const css = useStyles()\n const history = useHistory()\n const { backend } = useDispatch()\n const [name, setName] = useState(safeHostname(hostname, nameBlacklist) || '')\n const [disableRegister, setDisableRegister] = useState(false)\n const [nameError, setNameError] = useState()\n const [selected, setSelected] = useState([])\n\n useEffect(() => {\n setName(safeHostname(hostname, nameBlacklist))\n }, [hostname])\n\n useEffect(() => {\n emit('device')\n }, [])\n\n return (\n \n \n Setup your {osName(os)} for remote access oradd different {osName(os)}\n \n {\n if (!name) return\n event.preventDefault()\n backend.registerDevice({ services: selected, name, accountId: activeUser.id })\n history.push('/devices/setupWaiting')\n }}\n >\n
\n {\n const validation = serviceNameValidation(event.target.value)\n setName(validation.value)\n if (validation.error) {\n setNameError(validation.error)\n return\n }\n if (nameBlacklist.includes(validation.value.toLowerCase().trim())) {\n setNameError('That device name is already in use.')\n setDisableRegister(true)\n } else {\n setNameError(undefined)\n setDisableRegister(false)\n }\n }}\n onFocus={event => event.target.select()}\n helperText={nameError}\n />\n \n Add Device\n \n
\n \n \n \n )\n}\n\nconst useStyles = makeStyles({\n device: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'start',\n marginBottom: spacing.xl,\n },\n})\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Typography } from '@mui/material'\nimport { spacing } from '../../styling'\nimport { Icon } from '../../components/Icon'\nimport { Link } from '../../components/Link'\n\nexport const DocsLinks: React.FC<{ os?: Ios }> = ({ os }) => {\n const css = useStyles()\n return (\n
\n \n See how to:\n \n \n Use Remote.It Desktop\n \n \n \n Connect to this device from anywhere\n \n \n
\n )\n}\n\nconst useStyles = makeStyles({\n links: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n marginBottom: spacing.xl,\n '& svg': { paddingLeft: 5, marginLeft: 3 },\n },\n})\n","import React, { useEffect } from 'react'\nimport { Typography, CircularProgress, Divider } from '@mui/material'\nimport { State } from '../../store'\nimport { useSelector } from 'react-redux'\nimport { useHistory } from 'react-router-dom'\nimport { getDevices } from '../../selectors/devices'\nimport { makeStyles } from '@mui/styles'\nimport { DocsLinks } from '../../components/DocsLinks'\nimport { osName } from '@common/nameHelper'\nimport { Body } from '../../components/Body'\nimport { spacing } from '../../styling'\n\ntype Props = { os?: Ios }\n\nexport const SetupWaiting: React.FC = ({ os }) => {\n const { errorMessage, device } = useSelector((state: State) => ({\n errorMessage: state.ui.errorMessage,\n device: getDevices(state).find(d => d.thisDevice),\n }))\n const history = useHistory()\n const css = useStyles()\n\n useEffect(() => {\n if (device) {\n console.log('GO TO THIS DEVICE', device)\n history.push(`/devices/${device.id}`)\n }\n }, [device])\n\n if (errorMessage) history.push('/devices/setup')\n\n return (\n \n \n
\n \n Your {osName(os)} is being registered with Remote.It\n \n
\n
\n \n
\n \n \n )\n}\n\nconst useStyles = makeStyles({\n title: { marginTop: spacing.xl },\n divider: { width: 400, marginBottom: spacing.xl, marginTop: spacing.md },\n})\n","import React from 'react'\nimport { currencyFormatter } from '../helpers/utilHelper'\nimport { ColorChip } from './ColorChip'\nimport { Attribute } from './Attributes'\nimport { Avatar } from './Avatar'\n\nclass CustomerAttribute extends Attribute {\n type: Attribute['type'] = 'CUSTOMER'\n}\n\nexport const customerAttributes: CustomerAttribute[] = [\n new CustomerAttribute({\n id: 'customerEmail',\n label: 'Email',\n required: true,\n defaultWidth: 300,\n value: ({ customer }) => <>{customer?.email},\n }),\n new CustomerAttribute({\n id: 'customerPlan',\n label: 'Plan',\n defaultWidth: 100,\n value: ({ customer }) => (\n \n ),\n }),\n new CustomerAttribute({\n id: 'customerQuantity',\n label: 'Quantity',\n defaultWidth: 100,\n value: ({ customer }) => <>{customer?.license?.quantity || '–'},\n }),\n new CustomerAttribute({\n id: 'customerPrice',\n label: 'Price',\n defaultWidth: 74,\n value: ({ customer }) => {\n const price = customer?.license?.subscription?.price\n const amount = price?.amount || 0\n const quantity = customer?.license?.quantity || 1\n return currencyFormatter(price?.currency, amount * quantity)\n },\n }),\n new CustomerAttribute({\n id: 'customerReseller',\n label: 'Rep',\n defaultWidth: 74,\n value: ({ customer }) => ,\n }),\n]\n","import React from 'react'\nimport { Attribute } from './Attributes'\nimport { useHistory } from 'react-router-dom'\nimport { AttributeValue } from './AttributeValue'\nimport { Box, ListItemButtonProps } from '@mui/material'\nimport { GridListItem } from './GridListItem'\n\ntype Props = ListItemButtonProps & {\n customer: ICustomer\n icon?: React.ReactElement\n required?: Attribute\n attributes: Attribute[]\n mobile?: boolean\n}\n\nexport const CustomerListItem: React.FC = ({ customer, required, attributes, mobile, icon, ...props }) => {\n const history = useHistory()\n return (\n }\n onClick={() => history.push(`/organization/customer/${customer.id}`)}\n disableGutters\n {...props}\n >\n {attributes.map(attribute => (\n \n \n \n ))}\n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { customerAttributes } from './CustomerAttributes'\nimport { MOBILE_WIDTH } from '../constants'\nimport { removeObject } from '../helpers/utilHelper'\nimport { useMediaQuery, Stack, Typography } from '@mui/material'\nimport { CustomerListItem } from './CustomerListItem'\nimport { GridList } from './GridList'\nimport { Avatar } from './Avatar'\nimport { Icon } from './Icon'\n\nexport interface CustomerListProps {\n customers: ICustomer[]\n disabled?: boolean\n}\n\nexport const CustomerList: React.FC = ({ customers = [], disabled }) => {\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const columnWidths = useSelector((state: State) => state.ui.columnWidths)\n const [required, attributes] = removeObject(customerAttributes, a => a.required === true)\n\n return (\n \n {!customers.length && (\n \n \n \n You have no customers yet.\n \n \n )}\n {customers.map(customer => (\n }\n {...{ disabled, mobile, required, attributes, customer }}\n />\n ))}\n \n )\n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { Redirect } from 'react-router-dom'\nimport { Typography, Box } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectOrganization, selectOrganizationReseller } from '../selectors/organizations'\nimport { CSVDownloadButton } from '../buttons/CSVDownloadButton'\nimport { CustomerList } from '../components/CustomerList'\nimport { ResellerLogo } from '../components/ResellerLogo'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from '../components/Container'\nimport { Title } from '../components/Title'\n\nexport const ResellerPage: React.FC = () => {\n const dispatch = useDispatch()\n const organization = useSelector(selectOrganization)\n const reseller = useSelector(selectOrganizationReseller)\n\n if (!reseller) return \n\n return (\n \n \n Customers\n \n {organization?.id && (\n \n )}\n \n \n \n }\n >\n \n \n \n \n )\n}\n","import React from 'react'\nimport { REMOTEIT_PRODUCT_ID, AWS_PRODUCT_ID } from '../models/plans'\nimport { Icon } from './Icon'\n\nexport const LicensingIcon: React.FC<{ license: ILicense }> = ({ license }) => {\n let type: IconType = 'brands'\n let name: string = ''\n\n switch (license.id) {\n case AWS_PRODUCT_ID:\n name = 'aws'\n break\n case REMOTEIT_PRODUCT_ID:\n default:\n name = 'r3'\n break\n }\n\n if (!name) return null\n\n return \n}\n","import React from 'react'\nimport { humanizeDays } from '../models/plans'\nimport { makeStyles } from '@mui/styles'\nimport { LinearProgress, Typography, Box } from '@mui/material'\nimport { spacing } from '../styling'\n\nexport const LimitSetting: React.FC<{ limit: ILimit }> = ({ limit }) => {\n const css = useStyles()\n const v = (value?: number): string => (value || 0).toLocaleString()\n const overLimit = limit.value !== null && limit.actual > limit.value ? limit.actual - limit.value : 0\n\n let template: 'value' | 'text' | undefined\n let message: React.ReactNode | undefined\n\n if (limit.value === 0 && limit.actual === 0) return null\n\n switch (limit.name) {\n case 'org-users':\n template = 'value'\n message = limit.value !== null ? `${v(limit.actual)} of ${v(limit.value)} user licenses used` : undefined\n break\n case 'saml':\n template = 'text'\n message = limit.value ? 'SAML login is available' : 'SAML login is unavailable'\n break\n case 'roles':\n template = 'text'\n message = limit.value ? 'Custom roles are available' : 'Custom roles are unavailable'\n break\n case 'tagging':\n // ignore\n break\n case 'no-splash':\n template = 'text'\n message = limit.value\n ? 'No splash screen displayed on persistent web pages'\n : 'Persistent web pages will display a splash screen'\n break\n case 'aws-services':\n template = 'value'\n message =\n limit.value !== null ? `${v(limit.actual)} of ${v(limit.value)} services registered` : 'Unlimited services'\n break\n case 'aws-evaluation':\n template = 'text'\n message = `Services are granted an evaluation period of ${humanizeDays(limit.value)}`\n break\n case 'support':\n template = 'text'\n message = limit.value > 10 ? 'Email support available' : 'Forum support only'\n break\n case 'log-limit':\n template = 'text'\n message = `Log history is available for ${humanizeDays(limit.value)}`\n break\n case 'iot-devices':\n template = 'value'\n message = limit.value === null ? 'Unlimited devices' : `${v(limit.actual)} of ${v(limit.value)} licensed devices`\n if (overLimit)\n message = `You are ${v(overLimit)} device${overLimit > 1 ? 's' : ''} over your ${v(limit.value)} device limit`\n break\n case 'trial-devices':\n // ignore\n break\n case 'iot-nc-devices':\n template = 'value'\n message =\n limit.value === null\n ? 'Unlimited non-commercial devices'\n : `${v(limit.actual)} of ${v(limit.value)} non-commercial devices`\n if (overLimit)\n message = `You are ${v(overLimit)} device${overLimit > 1 ? 's' : ''} over your ${v(\n limit.value\n )} device non-commercial limit`\n break\n }\n\n // Templates\n switch (template) {\n case 'text':\n return (\n \n {message}\n \n )\n case 'value':\n let value = limit.value ? (limit.actual / limit.value) * 100 : 0\n if (value > 100) value = (100 / value) * 100\n return (\n \n {message}\n \n \n )\n default:\n return null\n }\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n root: {\n height: spacing.xs,\n borderRadius: spacing.xxs,\n width: '100%',\n marginTop: spacing.xxs,\n },\n background: {\n backgroundColor: palette.grayLighter.main,\n },\n warning: {\n backgroundColor: palette.warning.main,\n },\n warningBar: {\n backgroundColor: palette.primary.main,\n },\n}))\n","import React from 'react'\nimport { ListItem, ListItemIcon, Box } from '@mui/material'\nimport { ListItemCopy } from './ListItemCopy'\nimport { LimitSetting } from './LimitSetting'\n\nfunction sortLimits(a, b) {\n const order = ['iot-devices', 'org-users', 'tagging']\n const indexA = order.indexOf(a.name)\n const indexB = order.indexOf(b.name)\n if (indexA === -1) return 1 // a is not in the order array, it should come last\n if (indexB === -1) return -1 // b is not in the order array, it should come last\n return indexA - indexB // both are in the order array, sort them accordingly\n}\n\nexport const LimitsSetting: React.FC<{ limits?: ILimit[]; id?: string }> = ({ limits = [], id }) => {\n if (!id && !limits?.length) return null\n return (\n \n \n \n {!!limits.length && (\n \n {[...limits].sort(sortLimits).map(limit => (\n \n ))}\n \n )}\n {id && }\n \n \n )\n}\n","import React from 'react'\nimport { List, ListItem, ListItemIcon, ListItemText, Typography } from '@mui/material'\nimport { LicensingNotice } from './LicensingNotice'\nimport { LicensingIcon } from './LicensingIcon'\nimport { LimitsSetting } from './LimitsSetting'\nimport { Timestamp } from './Timestamp'\n\nexport const LicensingSetting: React.FC<{ licenses: ILicense[]; limits?: ILimit[] }> = ({ licenses, limits = [] }) => {\n if (!licenses.length) return null\n return (\n <>\n {licenses.map((license, index) => (\n \n \n \n \n \n \n \n {license.plan.product.description}\n  {license.plan.description} plan\n \n }\n secondary={\n !license.id\n ? 'Not subscribed'\n : license.expiration && (\n <>\n Renews \n \n )\n }\n />\n \n \n \n ))}\n {!!limits.length && (\n \n \n \n )}\n \n )\n}\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { useParams, Redirect, Link } from 'react-router-dom'\nimport { selectCustomer, selectOrganization } from '../selectors/organizations'\nimport { Typography, Button } from '@mui/material'\nimport { LicensingSetting } from '../components/LicensingSetting'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { FormDisplay } from '../components/FormDisplay'\nimport { Container } from '../components/Container'\nimport { Avatar } from '../components/Avatar'\nimport { Title } from '../components/Title'\n\nexport const CustomerPage: React.FC = () => {\n const { userID = '' } = useParams<{ userID: string }>()\n const dispatch = useDispatch()\n const organization = useSelector(selectOrganization)\n const customer = useSelector((state: State) => selectCustomer(state, undefined, userID))\n const license = customer?.license\n const limits = customer?.limits\n\n if (!customer) return \n\n const removeCustomer = async () => {\n await dispatch.organization.removeCustomer({ id: organization.id, emails: [customer.email] })\n }\n\n return (\n \n \n <Avatar email={customer?.email} marginRight={16} />\n {customer?.email}\n \n \n \n }\n >\n \n License\n \n \n \n }\n label=\"Sales Rep\"\n displayValue={customer?.reseller}\n displayOnly\n />\n \n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { Stack, StackProps } from '@mui/material'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { canEditTags } from '../models/tags'\nimport { TagEditor } from './TagEditor'\nimport { Tags } from './Tags'\n\nconst TEMP_DATE = new Date()\ntype Props = StackProps & { button?: string; types: number[]; onChange: (tags: number[]) => void }\n\nexport const AddPlatformServices: React.FC = ({ button, types, onChange, ...props }) => {\n const { allTypes, canEdit } = useSelector((state: State) => ({\n accountId: selectActiveAccountId(state),\n allTypes: state.applicationTypes.all,\n canEdit: canEditTags(state),\n }))\n const selectedApplicationTypes = allTypes.filter(t => types.includes(t.id))\n const selectedTags = selectedApplicationTypes.map(t => ({ name: t.name, created: TEMP_DATE, color: t.id }))\n const allTags = allTypes.map(t => ({ name: t.name, created: TEMP_DATE, color: t.id }))\n\n return (\n \n onChange(types.filter(t => t !== tag.color)) : undefined}\n />\n {canEdit && (\n onChange([...types, tag.color])}\n tags={allTags}\n filter={selectedTags}\n button={button}\n />\n )}\n \n )\n}\n","import React from 'react'\nimport { Stack, StackProps } from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { canEditTags } from '../models/tags'\nimport { selectTags } from '../selectors/tags'\nimport { TagEditor } from './TagEditor'\nimport { Tags } from './Tags'\n\ntype Props = StackProps & { button?: string; tags: string[]; onChange: (tags: string[]) => void }\n\nexport const AddPlatformTags: React.FC = ({ button, tags, onChange, ...props }) => {\n const { allTags, accountId, canEdit } = useSelector((state: State) => ({\n accountId: selectActiveAccountId(state),\n allTags: selectTags(state),\n canEdit: canEditTags(state),\n }))\n const dispatch = useDispatch()\n const selectedTags = allTags.filter(t => tags.includes(t.name))\n\n return (\n \n onChange(tags.filter(t => t !== tag.name)) : undefined}\n />\n {canEdit && (\n await dispatch.tags.create({ tag, accountId })}\n onSelect={tag => onChange([...tags, tag.name])}\n tags={allTags}\n filter={selectedTags}\n button={button}\n />\n )}\n \n )\n}\n","import React from 'react'\nimport browser, { windowOpen, getOs } from '../services/browser'\nimport { safeHostname } from '@common/nameHelper'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { Button, Typography } from '@mui/material'\nimport { IPlatform } from '../platforms'\nimport { Link } from './Link'\nimport { Icon } from './Icon'\n\nexport const AddDownload: React.FC<{ platform: IPlatform }> = ({ platform }) => {\n const hostname = useSelector((state: State) => safeHostname(state.backend.environment.hostname, []))\n const openDownloads = () => windowOpen(platform.installation?.link, '_blank', browser.isAndroid)\n\n return (\n <>\n \n {platform.installation?.qualifier}\n \n {platform.installation?.instructions}\n \n }\n >\n {browser.isAndroid ? 'Install' : browser.hasBackend ? 'Downloads Page' : 'View'}\n \n {platform.installation?.altLink && (\n \n or addthis device ({hostname})\n \n )}\n \n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { Box, BoxProps, ListItemText } from '@mui/material'\nimport { selectOrganization } from '../selectors/organizations'\nimport { selectActiveUser } from '../selectors/accounts'\nimport { Avatar } from '../components/Avatar'\n\ntype Props = BoxProps & { accountId?: string; avatarSize?: number }\n\nexport const OrganizationIndicator: React.FC = ({ accountId, avatarSize, ...props }) => {\n const organization = useSelector((state: State) => selectOrganization(state, accountId))\n const owner = useSelector((state: State) => selectActiveUser(state, accountId))\n return (\n \n \n \n \n )\n}\n","import React from 'react'\nimport { IPlatform } from '../platforms'\nimport { List, Box, Typography } from '@mui/material'\nimport { useSelector } from 'react-redux'\nimport { selectPermissions } from '../selectors/organizations'\nimport { OrganizationIndicator } from '../components/OrganizationIndicator'\nimport { CopyRegistrationCode } from './CopyRegistrationCode'\nimport { useAutoRegistration } from '../hooks/useAutoRegistration'\nimport { Notice } from './Notice'\nimport { Link } from './Link'\n\ntype Props = {\n platform: IPlatform\n types: number[]\n tags?: string[]\n redirect?: string\n minimal?: boolean\n}\n\nexport const AddDevice: React.FC = ({ platform, tags, types, redirect, minimal }) => {\n const { registrationCode, registrationCommand, redirectUrl, fetching } = useAutoRegistration({\n platform,\n tags,\n types,\n redirect,\n })\n const permissions = useSelector(selectPermissions)\n const codeOnly = platform.installation?.command === '[CODE]'\n\n if (!permissions.includes('MANAGE')) {\n return (\n \n You must have the register permission to add a device to this organization.\n \n )\n }\n\n const codeBlock = (\n \n \n \n )\n\n return minimal ? (\n codeBlock\n ) : (\n <>\n \n \n {platform.installation?.qualifier},\n {codeOnly ? <> copy the code below: : <> run this command on your device:}\n \n {codeBlock}\n \n {platform.installation?.instructions ? (\n platform.installation.instructions\n ) : (\n <>\n This page will automatically update when complete.\n {platform.installation?.link && Instructions.}\n {platform.installation?.altLink && (\n <>\n In production do not clone devices, please follow these\n oem instructions.\n \n )}\n \n )}\n \n \n )\n}\n","import React, { useState } from 'react'\nimport { State } from '../store'\nimport { useParams } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { useMediaQuery, Typography, Box, Stack, Divider, Theme } from '@mui/material'\nimport { AddPlatformServices } from '../components/AddPlatformServices'\nimport { selectPermissions } from '../selectors/organizations'\nimport { AddPlatformTags } from '../components/AddPlatformTags'\nimport { AddDownload } from '../components/AddDownload'\nimport { AddDevice } from '../components/AddDevice'\nimport { platforms } from '../platforms'\nimport { Body } from '../components/Body'\nimport { Icon } from '../components/Icon'\n\nexport const PlatformAddPage: React.FC = () => {\n let { platform = '', redirect } = useParams<{ platform?: string; redirect?: string }>()\n const platformObj = platforms.get(platform)\n const defaultServices = platformObj.services ? platformObj.services.map(s => s.application) : [28]\n const permissions = useSelector(selectPermissions)\n const [platformTags, setPlatformTags] = useState([])\n const [applicationTypes, setApplicationTypes] = useState(defaultServices)\n const xs = useMediaQuery((theme: Theme) => theme.breakpoints.down('md'))\n\n return (\n \n \n \n \n {platformObj.installation?.command && permissions.includes('MANAGE') && (\n \n {!xs && }\n setApplicationTypes(type)}\n alignItems={{ xs: 'flex-start', md: 'flex-end' }}\n />\n setPlatformTags(tags)}\n alignItems={{ xs: 'flex-start', md: 'flex-end' }}\n />\n \n )}\n \n \n {platformObj.installation?.command && !platformObj.installation?.download ? (\n \n ) : (\n <>\n \n {platformObj.hasScreenView && (\n <>\n \n Or use this registration code to manually claim the ScreenView app.\n \n \n \n )}\n \n )}\n \n \n \n )\n}\n","import React from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { selectOrganization } from '../selectors/organizations'\nimport { Dispatch, State } from '../store'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Typography, Button } from '@mui/material'\nimport { ContactSelector } from '../components/ContactSelector'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\nimport { useHistory } from 'react-router-dom'\n\nexport const CustomerAddPage = () => {\n const [emails, setEmails] = React.useState([])\n const [adding, setAdding] = React.useState(false)\n const organization = useSelector(selectOrganization)\n const all = useSelector((state: State) => state.contacts.all)\n const contacts = all.filter(a => !organization?.reseller?.customers.find(c => c.id === a.id)) || []\n\n const dispatch = useDispatch()\n const location = useLocation()\n const history = useHistory()\n\n const exit = () => history.push(location.pathname.replace('/add', ''))\n const add = async () => {\n setAdding(true)\n await dispatch.organization.addCustomer({ emails, id: organization.id })\n exit()\n setAdding(false)\n }\n\n return (\n \n \n Add Customers\n \n \n \n \n \n }\n >\n \n \n Add a user to your reseller account.\n \n \n New customers will be added to your reseller account and given a free plan.\n You can upgrade them to a paid plan afterwards.\n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { ListItemLocation } from '../components/ListItemLocation'\nimport { List, Typography, Box } from '@mui/material'\nimport { Redirect, useParams } from 'react-router-dom'\nimport { selectLicenseIndicator } from '../models/plans'\nimport {\n selectRemoteitLicense,\n selectPermissions,\n selectLimitsLookup,\n selectOrganization,\n} from '../selectors/organizations'\nimport { selectActiveUser } from '../selectors/accounts'\nimport { PlanActionChip } from '../components/PlanActionChip'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Avatar } from '../components/Avatar'\nimport { Title } from '../components/Title'\n\nexport const OrganizationPage: React.FC = () => {\n const { userID = '', deviceID = '' } = useParams<{ userID: string; deviceID: string }>()\n const user = useSelector((state: State) => state.user)\n const initialized = useSelector((state: State) => state.organization.initialized)\n const organization = useSelector(selectOrganization)\n const owner = useSelector(selectActiveUser)\n const permissions = useSelector(selectPermissions)\n const limits = useSelector(selectLimitsLookup)\n const license = useSelector(selectRemoteitLicense)\n const licenseIndicator = useSelector(selectLicenseIndicator)\n const admin = !!permissions.includes('ADMIN')\n const manager = !!permissions.includes('MANAGE')\n\n if (initialized && !organization.id)\n return \n\n return (\n \n \n \n \n {license && (\n \n {license?.plan.description} Plan\n \n \n )}\n \n {organization.name || '...'}\n \n \n \n \n }\n >\n {!admin && (\n \n You need admin privileges to change this organization.\n \n )}\n \n \n {organization.reseller && (\n \n )}\n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../styling'\n\nexport const Overlay: React.FC<{ children?: React.ReactNode }> = ({ children }) => {\n const css = useStyles()\n return
{children}
\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n overlay: {\n backgroundColor: palette.white.main,\n padding: spacing.md,\n paddingBottom: '10%',\n position: 'fixed',\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'column',\n display: 'flex',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n zIndex: 1,\n },\n}))\n","import React from 'react'\nimport classnames from 'classnames'\nimport { makeStyles } from '@mui/styles'\nimport { MOBILE_WIDTH } from '../constants'\nimport { useMediaQuery, Typography, List, ListItem, ListItemIcon, Divider, Button } from '@mui/material'\nimport { spacing, fontSizes, radius } from '../styling'\nimport { Icon } from './Icon'\n\ntype Props = {\n name: string | React.ReactNode\n description: string\n price?: string\n caption: React.ReactNode\n note?: string\n features?: string[]\n button: string\n promoted?: boolean\n disabled?: boolean\n selected?: boolean\n loading?: boolean\n wide?: boolean\n onSelect?: () => void\n}\n\ntype StyleProps = {\n wide?: boolean\n selected?: boolean\n}\n\nexport const PlanCard: React.FC = ({\n name,\n description,\n price,\n caption,\n note,\n features = [],\n button,\n promoted,\n disabled,\n selected,\n loading,\n wide,\n onSelect,\n}) => {\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n wide = wide && !mobile\n const css = useStyles({ wide, selected })\n\n return (\n
\n {selected ?
Current plan
: promoted &&
New
}\n
\n {name}\n {description}\n
\n \n
\n
\n
\n {price !== undefined && {price}}\n \n {caption}\n \n {note !== undefined && {note}}\n
\n \n {loading ? 'Processing...' : button}\n \n
\n {!!features.length && (\n
\n \n {features[0] && (\n \n {features[0]}\n \n )}\n {features.map((f, index) => index > 0 && {f})}\n \n
\n )}\n
\n
\n )\n}\n\nexport const Item: React.FC<{ children?: React.ReactNode }> = ({ children }) => {\n return (\n \n \n \n \n {children}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette, breakpoints }) => ({\n card: ({ wide, selected }: StyleProps) => ({\n display: 'flex',\n width: '100%',\n maxWidth: 840,\n flexDirection: 'column',\n alignItems: 'center',\n textAlign: 'center',\n borderRadius: radius.lg,\n backgroundColor: selected ? palette.primaryHighlight.main : palette.grayLightest.main,\n paddingBottom: spacing.md,\n marginBottom: spacing.md,\n [breakpoints.up('sm')]: {\n '& + .planCard': { marginLeft: spacing.md },\n },\n '& .planCardColumn': {\n // paddingBottom: spacing.lg,\n display: wide ? 'flex' : 'block',\n '& > div + div': { marginLeft: wide ? spacing.md : undefined },\n },\n }),\n selected: {\n borderRadius: radius.lg,\n position: 'relative',\n overflow: 'hidden',\n '& .MuiDivider-root': { borderColor: palette.primaryLight.main },\n '& header': {\n width: '100%',\n position: 'absolute',\n textTransform: 'uppercase',\n textAlign: 'center',\n backgroundColor: palette.primaryLight.main,\n letterSpacing: spacing.xxs,\n fontSize: fontSizes.xxxs,\n color: palette.alwaysWhite.main,\n fontWeight: 700,\n lineHeight: 2,\n },\n },\n promoted: {\n position: 'relative',\n overflow: 'hidden',\n '& header': {\n width: 160,\n left: -40,\n top: 24,\n position: 'absolute',\n textTransform: 'uppercase',\n transform: 'rotate(-45deg)',\n backgroundColor: palette.danger.main,\n letterSpacing: spacing.xxs,\n fontSize: fontSizes.xs,\n color: palette.alwaysWhite.main,\n fontWeight: 700,\n lineHeight: 2.6,\n },\n },\n plan: {\n padding: spacing.md,\n paddingTop: spacing.xl,\n textAlign: 'center',\n '& h1': { textTransform: 'capitalize' },\n },\n price: {\n padding: spacing.md,\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: 100,\n '& .MuiButton-root': { marginTop: spacing.sm },\n },\n select: {\n marginBottom: spacing.sm,\n },\n features: ({ wide }: StyleProps) => ({\n paddingRight: spacing.sm,\n color: palette.grayDarker.main,\n fontSize: fontSizes.sm,\n maxWidth: wide ? 440 : 200,\n lineHeight: 1.3,\n '& b': { fontWeight: 400, color: palette.grayDarkest.main },\n '& .MuiListItemIcon-root': { minWidth: 40 },\n }),\n}))\n","import React from 'react'\nimport { Gutters, GuttersProps } from './Gutters'\nimport { useMediaQuery } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\n\nexport const PlanGutters: React.FC = ({ children, ...props }) => {\n const small = useMediaQuery(`(max-width:600px)`)\n const css = useStyles({ small })\n\n return (\n \n {children}\n \n )\n}\n\nconst useStyles = makeStyles({\n plans: ({ small }: { small: boolean }) => ({\n display: 'flex',\n justifyContent: 'center',\n flexWrap: small ? 'wrap' : 'nowrap',\n marginBottom: 0,\n marginTop: 0,\n maxWidth: 840,\n }),\n})\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { TextField, Button } from '@mui/material'\nimport { spacing, fontSizes } from '../styling'\nimport { Icon } from './Icon'\n\ntype Props = {\n quantity: number\n onChange: (quantity: number) => void\n}\n\nexport const QuantitySelector: React.FC = ({ quantity, onChange }) => {\n const css = useStyles()\n\n const setQuantity = (value: number) => {\n let result = Math.ceil(Math.max(Math.min(+value, 9999), 0))\n if (isNaN(result)) result = 1\n onChange(result)\n }\n\n return (\n
\n setQuantity(quantity - 1)}\n >\n \n \n setQuantity(+e.target.value)}\n className={css.quantity}\n />\n setQuantity(quantity + 1)}\n >\n \n \n
\n )\n}\n\nexport const useStyles = makeStyles(({ palette }) => ({\n group: {\n border: `1px solid ${palette.grayLighter.main}`,\n borderRadius: spacing.md,\n backgroundColor: palette.white.main,\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n marginTop: spacing.xs,\n marginBottom: spacing.xs,\n '& > .MuiButton-root': { height: 30, borderRadius: 0 },\n '& > .MuiButton-root + .MuiButton-root': { marginLeft: 0 },\n '& > .MuiButton-root:first-of-type': { borderTopLeftRadius: spacing.md, borderBottomLeftRadius: spacing.md },\n '& > .MuiButton-root:last-child': { borderTopRightRadius: spacing.md, borderBottomRightRadius: spacing.md },\n },\n button: {\n padding: 0,\n },\n quantity: {\n maxWidth: 60,\n '& .MuiInputBase-input': {\n height: spacing.sm,\n fontSize: fontSizes.base,\n fontWeight: 500,\n padding: spacing.xs,\n textAlign: 'center',\n margin: 0,\n },\n },\n}))\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { PERSONAL_PLAN_ID, deviceUserTotal } from '../models/plans'\nimport { Divider, List, ListItem, ListItemSecondaryAction, Typography, Button } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { currencyFormatter } from '../helpers/utilHelper'\nimport { QuantitySelector } from './QuantitySelector'\nimport { spacing } from '../styling'\nimport { Icon } from './Icon'\nimport { Pre } from './Pre'\n\ntype Props = {\n plans: IPlan[]\n form: IPurchase\n license: ILicense | null\n onChange: (form: IPurchase) => void\n onCancel: () => void\n onSuccess: () => void\n}\n\nexport const PlanCheckout: React.FC = ({ plans, form, license, onChange, onCancel, onSuccess }) => {\n const css = useStyles()\n const dispatch = useDispatch()\n const purchasing = useSelector((state: State) => state.plans.purchasing === form.planId)\n const selectedPlan = plans.find(plan => plan.id === form.planId)\n const selectedPrice = selectedPlan?.prices?.find(price => price.id === form.priceId)\n const totals = deviceUserTotal(form.quantity, selectedPlan)\n\n const setQuantity = (value: string | number) => {\n let quantity = Math.ceil(Math.max(Math.min(+value, 9999), 0))\n if (isNaN(quantity)) quantity = 1\n onChange({ ...form, quantity })\n }\n\n const setNextInterval = () => {\n const priceArray = selectedPlan?.prices || []\n const next = priceArray.findIndex(p => form.priceId === p.id) + 1\n const index = priceArray.length <= next ? 0 : next\n const priceId = priceArray[index]?.id\n onChange({ ...form, priceId })\n }\n\n const onSubmit = async () => {\n if (license?.subscription) await dispatch.plans.updateSubscription(form)\n else await dispatch.plans.subscribe(form)\n onSuccess()\n }\n\n const unchanged = () =>\n form.planId === license?.plan?.id &&\n form.priceId === license?.subscription?.price?.id &&\n form.quantity === (license?.quantity || 1)\n\n if (form.planId === PERSONAL_PLAN_ID)\n return (\n <>\n \n \n Personal plan\n \n \n \n Are you sure you want to switch to the Personal plan? This will cancel your subscription.\n \n \n \n \n \n {\n await dispatch.plans.unsubscribe(form)\n onSuccess()\n }}\n color=\"primary\"\n variant=\"contained\"\n disabled={purchasing}\n >\n {purchasing ? 'Processing...' : 'Downgrade'}\n \n \n \n \n \n )\n\n return (\n <>\n \n \n {selectedPlan?.description} plan\n \n \n \n setNextInterval()}>\n Interval\n \n
\n {selectedPlan?.prices?.map(price => (\n onChange({ ...form, priceId: price.id })}\n >\n {price.interval}\n \n ))}\n
\n
\n
\n setQuantity(form.quantity + 1)}>\n Licenses\n \n \n \n \n \n Users\n \n \n {totals.users}\n \n \n \n \n \n Devices\n \n \n {totals.devices}\n \n \n \n \n
\n \n \n \n Total\n \n \n {selectedPrice?.amount ? (\n <>\n {currencyFormatter(selectedPrice?.currency, (selectedPrice?.amount || 0) * form.quantity)}\n  / \n {selectedPrice?.interval?.toLowerCase()}\n \n ) : (\n Free\n )}\n \n \n \n \n \n \n \n {purchasing ? 'Processing...' : 'Submit'}\n \n \n \n \n \n )\n}\n\nexport const useStyles = makeStyles(({ palette }) => ({\n list: {\n width: '50%',\n minWidth: 400,\n '& .MuiListItem-root': { padding: spacing.sm },\n '& h2': { textTransform: 'capitalize' },\n },\n group: {\n border: `1px solid ${palette.grayLighter.main}`,\n borderRadius: spacing.md,\n backgroundColor: palette.white.main,\n display: 'inline-block',\n '& > .MuiButton-root': { height: 30, borderRadius: 0 },\n '& > .MuiButton-root + .MuiButton-root': { marginLeft: 0 },\n '& > .MuiButton-root:first-of-type': { borderTopLeftRadius: spacing.md, borderBottomLeftRadius: spacing.md },\n '& > .MuiButton-root:last-child': { borderTopRightRadius: spacing.md, borderBottomRightRadius: spacing.md },\n },\n}))\n","import React from 'react'\nimport { Notice, NoticeProps } from './Notice'\nimport { Link } from './Link'\n\nexport const NoticeCustomPlan: React.FC = props => (\n \n Your plan has a custom license\n \n Please contact\n sales@remote.itfor\n changes. Selecting another plan will revoke any special licensing.\n \n \n)\n","import React from 'react'\nimport { Notice } from './Notice'\nimport { Overlay } from './Overlay'\nimport { PlanCard } from './PlanCard'\nimport { makeStyles } from '@mui/styles'\nimport { PlanGutters } from './PlanGutters'\nimport { PlanCheckout } from './PlanCheckout'\nimport { LoadingMessage } from './LoadingMessage'\nimport { State, Dispatch } from '../store'\nimport { currencyFormatter } from '../helpers/utilHelper'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { PERSONAL_PLAN_ID, planDetails, deviceUserTotal } from '../models/plans'\nimport { NoticeCustomPlan } from '../components/NoticeCustomPlan'\nimport { Confirm } from '../components/Confirm'\n\ntype Props = {\n license: ILicense | null\n includeLicenseId?: boolean\n plan?: IPlan\n plans: IPlan[]\n}\n\nexport const Plans: React.FC = ({ license, includeLicenseId, plan, plans }) => {\n const css = useStyles()\n const history = useHistory()\n const location = useLocation()\n const dispatch = useDispatch()\n const initialized = useSelector((state: State) => state.organization.initialized)\n const purchasing = useSelector((state: State) => state.plans.purchasing)\n\n function getDefaults(): IPurchase {\n const price = plan?.prices?.find(p => p.id === license?.subscription?.price?.id) || plan?.prices?.[0]\n return {\n checkout: false,\n planId: plan?.id,\n priceId: price?.id,\n quantity: license?.quantity || 1,\n confirm: false,\n licenseId: includeLicenseId ? license?.id : undefined,\n }\n }\n const [form, setForm] = React.useState(getDefaults())\n const personal = !license || license.plan.id === PERSONAL_PLAN_ID\n\n const success = async (push?: boolean) => {\n await dispatch.organization.set({ initialized: false })\n await dispatch.plans.restore()\n setForm(getDefaults())\n if (push) history.push('.')\n }\n\n React.useEffect(() => {\n if (location.pathname.includes('success')) success(true)\n }, [location.pathname])\n\n if (!initialized) return \n\n return (\n <>\n {form.checkout && (\n \n setForm(form)}\n onCancel={() => setForm(getDefaults())}\n onSuccess={success}\n />\n \n )}\n {license?.custom && (\n \n \n \n )}\n \n {plans.map(plan => {\n const totals = deviceUserTotal(license?.quantity || 1, plan)\n const details = plan.id ? planDetails[plan.id] : {}\n const selected = license?.plan?.id === plan.id\n const loading = purchasing === plan.id\n\n let note = details.note\n let caption = 'per month / per license'\n let planPrice: IPrice | undefined\n let planInterval: string\n let price: string = '-'\n\n if (plan.prices) {\n planInterval = 'YEAR'\n planPrice = plan.prices.find(p => p.interval === planInterval)\n price = currencyFormatter(planPrice?.currency, (planPrice?.amount || 1) / 12, 0)\n if (!planPrice) {\n planInterval = 'MONTH'\n planPrice = plan.prices.find(p => p.interval === planInterval)\n price = currencyFormatter(planPrice?.currency, planPrice?.amount || 1, 0)\n note = 'billed monthly'\n }\n }\n\n if (selected && license?.subscription?.total && license?.subscription?.price?.amount) {\n price =\n currencyFormatter(license.subscription.price.currency, license.subscription.total, 0) +\n ` / ${license.subscription.price.interval?.toLowerCase()}`\n caption = `${license.quantity} license${(license.quantity || 0) > 1 ? 's' : ''}`\n note = `${totals.users} users + ${totals.devices} devices`\n }\n\n const result = plan.prices?.find(p => p.id === form.priceId)\n const priceId = result?.id || (plan.prices && plan.prices[0].id)\n const downgradePrice = plan.prices?.find(p => p.interval === license?.subscription?.price?.interval)?.amount\n const isDowngrade = (downgradePrice || 0) < (license?.subscription?.price?.amount || 0)\n\n return (\n \n loading\n ? dispatch.plans.restore()\n : setForm({\n ...form,\n confirm: isDowngrade,\n checkout: !isDowngrade,\n planId: plan.id,\n priceId,\n })\n }\n features={details.features}\n />\n )\n })}\n \n \n \n personal\n ? setForm({ ...form, confirm: false, checkout: true, planId: PERSONAL_PLAN_ID })\n : setForm({ ...form, confirm: true, checkout: false, planId: PERSONAL_PLAN_ID })\n }\n features={planDetails[PERSONAL_PLAN_ID].features}\n />\n \n setForm({ ...form, confirm: false, checkout: true })}\n onDeny={() => setForm({ ...form, confirm: false })}\n title=\"Downgrade Plan?\"\n action=\"Continue\"\n color=\"warning\"\n maxWidth=\"xs\"\n >\n \n This plan will downgrade your service.\n You will lose access to some features and may lose access to some devices.\n \n \n \n )\n}\n\nconst useStyles = makeStyles({\n notice: {\n maxWidth: 840,\n },\n})\n","import React from 'react'\nimport { State } from '../store'\nimport { useParams } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { Typography, Stack } from '@mui/material'\nimport { selectCustomer, selectOrganizationReseller } from '../selectors/organizations'\nimport { Container } from '../components/Container'\nimport { Avatar } from '../components/Avatar'\nimport { Plans } from '../components/Plans'\n\nexport const CustomerPlansPage: React.FC = () => {\n const { userID = '' } = useParams<{ userID: string }>()\n const reseller = useSelector(selectOrganizationReseller)\n const customer = useSelector((state: State) => selectCustomer(state, undefined, userID))\n const license = customer?.license\n\n if (!customer || !license) return null\n\n return (\n \n \n \n Select a plan for\n {customer?.email}\n \n \n \n {/* \n \n \n \n */}\n \n }\n >\n {reseller && }\n \n )\n}\n","import React, { useEffect, useState, useRef } from 'react'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { dateOptions } from './Duration/Duration'\nimport { makeStyles } from '@mui/styles'\nimport { Tooltip, Card, CardContent, CardMedia, CardHeader, CardActions, Button, Typography } from '@mui/material'\n\nconst types = {\n GENERIC: 'Notice',\n SYSTEM: 'System Update',\n RELEASE: 'Release Note',\n SECURITY: 'Security Notice',\n COMMUNICATION: 'Announcement',\n}\n\nexport const AnnouncementCard: React.FC<{ data: IAnnouncement; scrollPosition?: number }> = ({\n data,\n scrollPosition,\n}) => {\n const { announcements } = useDispatch()\n const [read, setRead] = useState(false)\n const cardRef = useRef(null)\n\n const unread = !(data.read && data.read < new Date())\n const date = data.read && data.read.toLocaleString(navigator.language, dateOptions)\n const css = useStyles({ unread })\n\n const handleRead = () => {\n setRead(true)\n announcements.read(data.id)\n console.log('READ', data.title)\n }\n\n useEffect(() => {\n const top = cardRef.current?.offsetTop || 0\n const height = cardRef.current?.offsetHeight || 0\n if (!read && scrollPosition && scrollPosition > top + height) handleRead()\n }, [data.read, scrollPosition])\n\n if (!data) return null\n\n return (\n \n \n {data.image && }\n \n \n {data.title}\n {unread && (\n \n \n \n )}\n \n {typeof data.body === 'string' ? (\n \n ) : (\n \n {data.body}\n \n )}\n \n {data.link && (\n \n \n \n )}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette, breakpoints, spacing }) => ({\n card: {\n width: 500,\n overflow: 'hidden',\n marginTop: spacing(2.25),\n marginLeft: spacing(1.5),\n marginRight: spacing(1.5),\n backgroundColor: palette.grayLightest.main,\n '& .MuiButtonBase-root': { float: 'right' },\n [breakpoints.down('sm')]: { marginLeft: 0, marginRight: 0, width: '100%' },\n },\n header: ({ unread }: { unread: boolean }) => ({\n transition: 'background-color 1s',\n backgroundColor: unread ? palette.primary.main : palette.grayDarker.main,\n }),\n media: {\n height: 150,\n backgroundColor: palette.primaryLight.main,\n [breakpoints.down('sm')]: { height: 100 },\n },\n}))\n","import React from 'react'\nimport { AnnouncementCard } from './AnnouncementCard'\n\nexport const AnnouncementCardTest: React.FC<{ hide?: boolean }> = ({ hide }) => {\n if (hide) return null\n return (\n \n

\n 🗓️   March 12 - 14
\n 📍   The Venetian, Las Vegas
\n 👋   Visit Us at Booth 1156!\n

\n

\n Discover our new ScreenView for Android, and explore innovative connectivity solutions with the Remote.It\n team!\n

\n

Get your free Expo + Keynote Pass

\n
    \n
  1. \n Visit the\n \n Expo website\n \n
  2. \n
  3. \n Click on Register\n
  4. \n
  5. Login/Create an Account
  6. \n
  7. \n Select the $350 Expo + Keynote Pass option
    \n business type VAR only\n
  8. \n
  9. \n Enter the promo code EMBEDDED at checkout\n
  10. \n
\n \n ),\n image: '',\n }}\n />\n )\n}\n","import React, { useEffect, useState, useRef } from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { Typography } from '@mui/material'\nimport { selectAnnouncements } from '../selectors/announcements'\nimport { AnnouncementCardTest } from '../components/AnnouncementCardTest'\nimport { AnnouncementCard } from '../components/AnnouncementCard'\nimport { Container } from '../components/Container'\nimport { Title } from '../components/Title'\n\nexport const AnnouncementsPage = () => {\n const announcements = useSelector((state: State) => selectAnnouncements(state))\n const [scrollPosition, setScrollPosition] = useState(0)\n const bodyRef = useRef(null)\n\n useEffect(() => {\n const currentBodyRef = bodyRef.current\n\n const onScroll = () => {\n const top = bodyRef.current?.scrollTop || 0\n const height = bodyRef.current?.offsetHeight || 0\n setScrollPosition(top + height)\n }\n onScroll()\n\n currentBodyRef?.addEventListener('scroll', onScroll)\n return () => currentBodyRef?.removeEventListener('scroll', onScroll)\n }, [])\n\n return (\n \n Notifications\n \n }\n >\n \n {announcements.map((announcement, index) => (\n \n ))}\n \n )\n}\n","import React from 'react'\nimport { Box, TextField, TextFieldProps, MenuItem } from '@mui/material'\nimport { Icon } from './Icon'\n\ntype Props = Omit & {\n roles: IOrganizationRole[]\n roleId: IOrganizationRoleIdType\n onSelect: (roleId: string) => void\n}\n\nexport const RoleSelect: React.FC = ({ roleId, roles, size = 'small', onSelect, ...props }) => {\n const disabled = roleId === 'OWNER'\n\n return (\n onSelect(e.target.value)}\n {...props}\n >\n {roles.map(r => (\n \n \n {r.system && }\n {r.name}\n \n \n ))}\n \n )\n}\n","import React from 'react'\nimport { Dispatch, State } from '../store'\nimport { ENTERPRISE_PLAN_ID } from '../models/plans'\nimport { selectAvailableUsers } from '../selectors/organizations'\nimport { useLocation, useHistory, Link } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Typography, Button, Box } from '@mui/material'\nimport { selectOrganization } from '../selectors/organizations'\nimport { ContactSelector } from '../components/ContactSelector'\nimport { RoleSelect } from '../components/RoleSelect'\nimport { Container } from '../components/Container'\nimport { ColorChip } from '../components/ColorChip'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\n\nexport const OrganizationAddPage = () => {\n const organization = useSelector(selectOrganization)\n const allContacts = useSelector((state: State) => state.contacts.all)\n const freeUsers = useSelector(selectAvailableUsers)\n const enterprise = organization.licenses.find(l => l.plan.id === ENTERPRISE_PLAN_ID)\n const contacts = allContacts.filter(c => !organization.members.find(s => s.user.id === c.id)) || []\n\n const [emails, setEmails] = React.useState([])\n const [roleId, setRoleId] = React.useState(\n organization.roles.find(r => r.name === 'Member')?.id || ''\n )\n const dispatch = useDispatch()\n const location = useLocation()\n const history = useHistory()\n const license = freeUsers ? 'LICENSED' : 'UNLICENSED'\n\n const exit = () => history.push(location.pathname.replace('/add', ''))\n const add = () => {\n dispatch.organization.setMembers(\n emails.map(email => ({\n roleId,\n license,\n created: new Date(),\n organizationId: organization.id || '',\n user: { email, id: '' },\n }))\n )\n exit()\n }\n\n return (\n \n \n Add Organization Members\n \n \n \n \n \n }\n >\n Role Assignment\n \n \n \n setRoleId(id)}\n fullWidth\n />\n \n {!freeUsers && !enterprise && (\n \n \n \n }\n fullWidth\n >\n Purchase additional licenses to grant this user full access.\n
\n \n )}\n
\n
\n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { Typography, Box, Button, TextField, List } from '@mui/material'\nimport { ListItemCheckbox } from '../components/ListItemCheckbox'\nimport { useDispatch } from 'react-redux'\nimport { Dispatch } from '../store'\nimport { Gutters } from '../components/Gutters'\nimport { Confirm } from '../components/Confirm'\nimport { Notice } from '../components/Notice'\nimport { spacing } from '../styling'\n\nconst REASONS = [\n 'My device isn’t supported',\n 'Installation was too difficult',\n 'Connection quality or performance issues',\n 'Couldn’t get my device online',\n 'Couldn’t connect',\n 'Cost of service',\n 'Have another account',\n 'Too hard to use',\n 'Not what I thought it was',\n 'Not using it anymore',\n 'Using something else',\n]\ninterface DeleteAccountSectionProps {\n user?: IUser\n paidPlan?: boolean\n deleteAccount?: boolean\n}\n\nexport const DeleteAccountSection: React.FC = ({\n user,\n paidPlan = false,\n deleteAccount,\n}) => {\n const connections = useSelector((state: State) => state.connections.all).slice(0, 5)\n const [confirm, setConfirm] = React.useState(false)\n const [contact, setContact] = React.useState(true)\n const [reasons, setReasons] = React.useState([])\n const [body, setBody] = React.useState('')\n const dispatch = useDispatch()\n\n const handleDelete = () => setConfirm(true)\n const handleReason = (reason: string) => {\n if (reasons.includes(reason)) setReasons(reasons.filter(r => r !== reason))\n else setReasons([...reasons, reason])\n }\n const handleConfirm = () => {\n dispatch.feedback.set({\n subject: `Account deletion request for ${user?.email}`,\n body,\n data: {\n email: user?.email,\n userId: user?.id,\n reasons,\n contactMe: contact ? 'Yes' : 'No',\n createdDate: user?.created?.toLocaleString(navigator.language, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n }),\n lastConnections: connections,\n },\n snackbar: 'Your account delete request has been sent.',\n })\n dispatch.feedback.sendFeedback()\n dispatch.ui.set({ deleteAccount: true })\n setConfirm(false)\n }\n return (\n \n {paidPlan ? (\n \n You have a paid subscription plan. Please downgrade to Personal to request an account deletion.\n \n ) : (\n <>\n \n If you no longer want/need your Remote.It account, you can request an account deletion. Once your delete\n request is processed, all your account information is removed permanently.\n \n \n \n setConfirm(false)}\n title={\n <>\n \n {/* Pleading Emoji */}\n 🥺\n \n Why do you want to delete your account?\n \n We are sorry to see you go! \n
\n Please help us improve by telling us why it didn't work out.\n
\n \n }\n action=\"Delete\"\n disabled={body.length < 2 && reasons.length < 1}\n >\n \n {REASONS.map((reason, i) => (\n {\n handleReason(reason)\n }}\n />\n ))}\n \n setBody(e.target.value)}\n />\n setContact(checked)}\n />\n \n I understand that this is permanent and that accounts and related devices can not be recovered.\n \n \n \n Deletion requests take 3 to 5 business days to complete.\n \n )}\n
\n )\n}\n","import React from 'react'\nimport { LANGUAGES } from '../constants'\nimport { Dispatch, State } from '../store'\nimport { makeStyles } from '@mui/styles'\nimport { isPersonal } from '../models/plans'\nimport { Typography, List } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { DeleteAccountSection } from '../components/DeleteAccountSection'\nimport { SelectSetting } from '../components/SelectSetting'\nimport { FormDisplay } from '../components/FormDisplay'\nimport { Timestamp } from '../components/Timestamp'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Avatar } from '../components/Avatar'\nimport { Title } from '../components/Title'\nimport { Icon } from '../components/Icon'\nimport { Link } from '../components/Link'\nimport { spacing } from '../styling'\n\nexport const ProfilePage: React.FC = () => {\n const { paidPlan, user, deleteAccount } = useSelector((state: State) => ({\n user: state.user,\n paidPlan: !isPersonal(state),\n deleteAccount: state.ui.deleteAccount,\n }))\n const dispatch = useDispatch()\n const css = useStyles()\n\n if (!user) return null\n\n return (\n \n \n Profile\n \n \n }\n >\n \n \n \n Your profile picture is imported from the free service Gravatar.\n
To edit or add a profile image please visitgravatar.com.\n
\n
\n \n } label=\"Email\" displayValue={user.email} displayOnly />\n }\n label=\"Member since\"\n displayValue={}\n displayOnly\n />\n dispatch.user.changeLanguage(value)}\n />\n \n Account deletion\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n profile: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: 500,\n '& .MuiAvatar-root': { marginRight: spacing.xl },\n },\n}))\n","import React, { useState } from 'react'\nimport { Dispatch } from '../store'\nimport { useHistory } from 'react-router-dom'\nimport { useDispatch } from 'react-redux'\nimport { ConfirmIconButton } from './ConfirmIconButton'\n\nexport const RemoveMemberButton = ({ member }: { member: IOrganizationMember }) => {\n const [removing, setRemoving] = useState(false)\n const dispatch = useDispatch()\n const history = useHistory()\n return (\n \n This will remove {member.user.email}’s \n access to all the organization’s devices\n \n ),\n }}\n title=\"Remove Member\"\n icon=\"trash\"\n size=\"md\"\n color={removing ? 'danger' : undefined}\n loading={removing}\n disabled={removing}\n onClick={async () => {\n setRemoving(true)\n await dispatch.organization.removeMember(member)\n history.push('/organization/members')\n setRemoving(false)\n }}\n />\n )\n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { ConfirmIconButton } from './ConfirmIconButton'\nimport { Notice } from '../components/Notice'\n\nexport const LeaveOrganizationButton = ({ organizationId }: { organizationId: string }) => {\n const dispatch = useDispatch()\n return (\n \n This action cannot be undone.\n You would need to contact the Organization owner to be re-added.\n \n ),\n }}\n onClick={() => dispatch.accounts.leaveMembership(organizationId)}\n />\n )\n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { getLicenseChip } from './LicenseChip'\nimport { makeStyles } from '@mui/styles'\nimport { TextField, TextFieldProps, MenuItem } from '@mui/material'\n\ntype Props = { member: IOrganizationMember; size?: TextFieldProps['size']; disabled?: boolean }\n\nexport const LicenseSelect: React.FC = ({ member, size = 'small', disabled }) => {\n const dispatch = useDispatch()\n const css = useStyles({ chip: getLicenseChip(member.license) })\n\n const handleSelect = (license: ILicenseTypes) => {\n dispatch.organization.setMembers([{ ...member, license }])\n }\n\n return (\n handleSelect(e.target.value as ILicenseTypes)}\n onClick={event => event.stopPropagation()}\n className={disabled ? '' : css.licensed}\n >\n \n Licensed\n \n \n Unlicensed\n \n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n licensed: ({ chip }: { chip: ILicenseChip }) => ({\n '& .MuiFormLabel-root': { color: palette[chip.colorName].main },\n '& .MuiInputBase-root': {\n color: palette[chip.colorName].main,\n backgroundColor: chip.background && palette[chip.background].main,\n fontWeight: 500,\n letterSpacing: 0.2,\n '&:hover:not(.Mui-disabled)': { backgroundColor: chip.hoverColor && palette[chip.hoverColor].main },\n },\n '& .MuiSelect-icon': { color: palette[chip.colorName].main },\n }),\n}))\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport { ENTERPRISE_PLAN_ID } from '../models/plans'\nimport { IOrganizationState } from '../models/organization'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectRemoteitLicense, selectPermissions, selectAvailableUsers } from '../selectors/organizations'\nimport { selectAccessibleNetworks } from '../models/networks'\nimport { Typography, List, Box } from '@mui/material'\nimport { RoleAccessCounts } from './RoleAccessCounts'\nimport { ListItemLocation } from './ListItemLocation'\nimport { LicenseSelect } from './LicenseSelect'\nimport { FormDisplay } from './FormDisplay'\nimport { RoleSelect } from './RoleSelect'\nimport { Timestamp } from './Timestamp'\nimport { Gutters } from './Gutters'\nimport { Icon } from './Icon'\n\ntype Props = {\n member?: IOrganizationMember\n organization: IOrganizationState\n}\n\nexport const OrganizationMemberDetails: React.FC = ({ member, organization }) => {\n const dispatch = useDispatch()\n const license = useSelector(selectRemoteitLicense)\n const permissions = useSelector(selectPermissions)\n const availableUsers = useSelector(selectAvailableUsers)\n const accessible = useSelector((state: State) => selectAccessibleNetworks(state, organization, member))\n\n const enterprise = license?.plan.id === ENTERPRISE_PLAN_ID\n const role = organization.roles.find(r => r.id === member?.roleId)\n const disabled = !permissions.includes('ADMIN')\n\n return (\n <>\n {member && (\n <>\n Member\n \n \n \n dispatch.organization.setMembers([{ ...member, roleId }])}\n disabled={disabled}\n />\n {!enterprise && (\n \n )}\n \n \n {role && }\n \n \n \n }\n label=\"Member since\"\n displayValue={}\n displayOnly\n />\n \n )}\n {!!accessible.length && (\n <>\n Networks\n \n {accessible.map(network => (\n : }\n title={network ? network.name : loading...}\n />\n ))}\n \n \n )}\n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { getAllDevices } from '../selectors/devices'\nimport { selectNetworks } from '../selectors/networks'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { LinearProgress, Typography, List, Box } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { ListItemLocation } from './ListItemLocation'\nimport { LoadingMessage } from './LoadingMessage'\nimport { TargetPlatform } from './TargetPlatform'\nimport { ShareDetails } from './ShareDetails'\nimport { Gutters } from './Gutters'\nimport { Icon } from './Icon'\n\ntype Props = {\n guest?: IGuest\n loaded?: boolean\n}\n\nexport const OrganizationGuestDetails: React.FC = ({ guest, loaded }) => {\n const dispatch = useDispatch()\n const [fetched, setFetched] = useState(false)\n\n const networks = useSelector((state: State) => selectNetworks(state))\n const devices = useSelector((state: State) => getAllDevices(state)).filter(device =>\n guest?.deviceIds.includes(device.id)\n )\n\n useEffect(() => {\n setFetched(false)\n const missing = guest?.deviceIds.filter(id => !devices.find(device => device.id === id))\n if (missing?.length && !fetched) {\n ;(async () => {\n await dispatch.devices.fetchDevices({ ids: missing, hidden: true })\n setFetched(true)\n })()\n }\n }, [guest])\n\n useEffect(() => {\n if (!loaded) dispatch.organization.fetchGuests()\n }, [guest, loaded])\n\n if (!loaded) return \n\n if (!guest?.deviceIds.length && !guest?.networkIds.length) return null\n\n return (\n <>\n \n Guest Access\n \n {!!guest?.deviceIds.length && (\n <>\n Devices\n \n {guest?.deviceIds.map(id => {\n const device = devices.find(d => d.id === id)\n return (\n \n ) : fetched ? (\n \n ) : (\n \n )\n }\n title={\n device ? (\n device.name\n ) : (\n {fetched ? `Loading failed (${id})` : 'loading...'}\n )\n }\n >\n \n \n )\n })}\n \n \n )}\n {!!guest?.networkIds.length && (\n <>\n Networks\n \n {guest?.networkIds.map(id => {\n const network = networks.find(d => d.id === id)\n return (\n : }\n title={network ? network.name : loading...}\n />\n )\n })}\n \n \n )}\n \n )\n}\n","import React from 'react'\nimport { Redirect } from 'react-router-dom'\nimport { State } from '../store'\nimport { Typography } from '@mui/material'\nimport { useSelector } from 'react-redux'\nimport { ProfilePage } from './ProfilePage'\nimport { REGEX_LAST_PATH } from '../constants'\nimport { RemoveMemberButton } from '../buttons/RemoveMemberButton'\nimport { useParams, useLocation } from 'react-router-dom'\nimport { LeaveOrganizationButton } from '../buttons/LeaveOrganizationButton'\nimport { OrganizationMemberDetails } from '../components/OrganizationMemberDetails'\nimport { selectOrganization, selectOwner } from '../selectors/organizations'\nimport { OrganizationGuestDetails } from '../components/OrganizationGuestDetails'\nimport { Container } from '../components/Container'\nimport { Avatar } from '../components/Avatar'\nimport { Title } from '../components/Title'\n\nexport const OrganizationUserPage: React.FC = () => {\n const location = useLocation()\n const { userID = '' } = useParams<{ userID: string }>()\n\n let user: IUser = useSelector((state: State) => state.user)\n const owner = useSelector(selectOwner)\n const organization = useSelector(selectOrganization)\n const isOwnerAccount = user.id === userID && organization.id === userID\n const isMyAccount = user.id === userID || undefined\n const member = organization.members.find(m => m.user.id === userID) || (isMyAccount && organization.membership)\n const guest = organization.guests.find(g => g.id === userID)\n\n user = guest || member?.user || (owner?.user.id === userID && owner.user) || user\n\n if (isOwnerAccount) return \n\n if (!user)\n return (\n \n )\n\n return (\n \n \n <Avatar email={user?.email} marginRight={16} />\n {user?.email}\n \n {isMyAccount ? (\n \n ) : (\n member && \n )}\n \n }\n >\n \n \n \n )\n}\n","import React from 'react'\nimport { Redirect } from 'react-router-dom'\nimport { useHistory } from 'react-router-dom'\nimport { makeStyles } from '@mui/styles'\nimport { Dispatch, State } from '../store'\nimport { selectOrganization } from '../selectors/organizations'\nimport { TextField, Typography, Button } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { spacing } from '../styling'\nimport { Gutters } from '../components/Gutters'\nimport { Body } from '../components/Body'\n\nexport const OrganizationEmptyPage: React.FC = () => {\n const { username, hasOrganization } = useSelector((state: State) => ({\n username: (state.auth.user?.email || '').split('@')[0],\n hasOrganization: selectOrganization(state)?.id && state.organization.initialized,\n }))\n const [name, setName] = React.useState(`${username}'s org`)\n const history = useHistory()\n const dispatch = useDispatch()\n const css = useStyles()\n\n if (hasOrganization) return \n\n return (\n \n \n Create an organization to
\n automatically share devices to your members.\n
\n \n {\n event.preventDefault()\n await dispatch.organization.setOrganization({ name })\n history.push('/organization')\n }}\n >\n setName(event.target.value.toString())}\n />\n \n \n \n \n )\n}\n\nconst useStyles = makeStyles({\n form: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n '& .MuiTextField-root': {\n width: 260,\n margin: spacing.xs,\n },\n },\n})\n","import React, { useState, useEffect } from 'react'\nimport { useStyles } from './SharedUsersPaginatedList'\nimport { Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { List, ListSubheader, ListItemSecondaryAction, Box, Chip } from '@mui/material'\nimport { ListItemLocation } from './ListItemLocation'\nimport { selectOrganization } from '../selectors/organizations'\nimport { LoadingMessage } from './LoadingMessage'\nimport { Pagination } from '@mui/lab'\nimport { Gutters } from './Gutters'\nimport { Avatar } from './Avatar'\nimport { Icon } from './Icon'\n\nexport const OrganizationGuestList: React.FC = () => {\n const css = useStyles()\n const dispatch = useDispatch()\n const [page, setPage] = useState(1)\n const { guests, guestsLoaded } = useSelector(selectOrganization)\n const perPage = 20\n const pageCount = Math.ceil(guests.length / perPage)\n const start = (page - 1) * perPage\n const pageGuests = [...guests].sort(alphaEmailSort).slice(start, start + perPage)\n\n useEffect(() => {\n if (!guestsLoaded) dispatch.organization.fetchGuests()\n }, [guests])\n\n if (!guestsLoaded) return \n\n return (\n <>\n \n \n Guest\n Shares\n \n {pageGuests.map(guest => (\n }\n >\n \n {!!guest.networkIds.length && (\n \n \n {guest.networkIds.length}\n \n }\n />\n )}\n {!!guest.deviceIds.length && (\n \n \n {guest.deviceIds.length}\n \n }\n />\n )}\n \n \n ))}\n \n {guests.length > perPage && (\n \n setPage(page)} size=\"small\" />\n \n )}\n \n )\n}\n\nfunction alphaEmailSort(a, b) {\n const aa = a.email.toLowerCase()\n const bb = b.email.toLowerCase()\n return aa > bb ? 1 : aa < bb ? -1 : 0\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { useSelector } from 'react-redux'\nimport { Typography } from '@mui/material'\nimport { selectPermissions } from '../selectors/organizations'\nimport { OrganizationGuestList } from '../components/OrganizationGuestList'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Title } from '../components/Title'\nimport { Body } from '../components/Body'\n\nexport const OrganizationGuestsPage: React.FC = () => {\n const permissions = useSelector(selectPermissions)\n\n if (!permissions.includes('MANAGE'))\n return (\n \n \n Please contact the organization owner to request device manager privileges.\n \n \n )\n\n return (\n \n \n Guests\n \n \n \n Users that have devices directly shared to them.\n \n \n \n }\n >\n \n \n )\n}\n","import React from 'react'\nimport { Typography, ButtonBase } from '@mui/material'\nimport { Link, LinkProps } from './Link'\n\ntype OptionProps = LinkProps & {\n icon: React.ReactNode\n title: string\n description?: React.ReactNode\n width?: number\n}\n\nexport const MegaButton: React.FC = ({ icon, title, description, width = 250, ...props }) => {\n return (\n \n \n {icon}\n \n {title}\n \n {description && (\n \n {description}\n \n )}\n \n \n )\n}\n","import React from 'react'\nimport { Typography, Stack } from '@mui/material'\nimport { MegaButton } from '../components/MegaButton'\nimport { Body } from '../components/Body'\nimport { Icon } from '../components/Icon'\n\nexport const RaspberrypiOptionsPage: React.FC = () => (\n \n \n Set Up Your Raspberry Pi for Remote Access\n \n \n }\n to=\"/add/raspberrypi\"\n title=\"Add Remote Access\"\n description={\n <>\n Already have a Raspberry Pi set up?
\n Get remote access with a
\n single line of code.\n \n }\n />\n \n \n \n \n \n }\n to=\"/onboard/raspberrypi\"\n title=\"Onboard via Bluetooth\"\n description={\n <>\n Have our custom Pi image? Set up WiFi via Bluetooth and register your device for remote access.\n \n }\n />\n \n \n \n \n \n }\n href=\"https://link.remote.it/getting-started/rpi-ble-image\"\n title=\"Download Pi Image\"\n description={\n <>\n New to Pi? Download our disk
\n image for easy, headless setup with Bluetooth WiFi onboarding.\n \n }\n />\n \n \n)\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\nimport { MOBILE_WIDTH } from '../constants'\nimport { Box, useMediaQuery, ListItemSecondaryAction } from '@mui/material'\nimport { ListItemLocation } from './ListItemLocation'\nimport { LicenseSelect } from './LicenseSelect'\nimport { RoleSelect } from './RoleSelect'\nimport { Duration } from './Duration'\nimport { spacing } from '../styling'\nimport { Avatar } from './Avatar'\n\ntype Props = {\n member: IOrganizationMember\n roles?: IOrganizationRole[]\n disabled?: boolean\n enterprise?: boolean\n link?: boolean\n}\n\nexport const OrganizationMember: React.FC = ({ member, roles = [], disabled, enterprise, link = true }) => {\n const hideActions = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const dispatch = useDispatch()\n return (\n }\n title={member.user.email}\n subtitle={\n <>\n Added \n \n }\n >\n {hideActions || (\n \n dispatch.organization.setMembers([{ ...member, roleId }])}\n onClick={event => event.stopPropagation()}\n />\n {!enterprise && (\n \n \n \n )}\n \n )}\n \n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { selectAvailableUsers } from '../selectors/organizations'\nimport { OrganizationMember } from '../components/OrganizationMember'\nimport { IOrganizationState } from '../models/organization'\nimport { List } from '@mui/material'\n\ntype Props = { organization?: IOrganizationState; owner?: IOrganizationMember; enterprise?: boolean }\n\nexport const OrganizationMemberList: React.FC = ({ organization, owner, enterprise }) => {\n const freeUsers = useSelector(selectAvailableUsers)\n const members = organization?.members ? [...organization.members].sort(alphaEmailSort) : []\n return (\n \n {owner && (\n \n )}\n {members.map(member => (\n \n ))}\n \n )\n}\n\nfunction alphaEmailSort(a, b) {\n const aa = a.user.email.toLowerCase()\n const bb = b.user.email.toLowerCase()\n return aa > bb ? 1 : aa < bb ? -1 : 0\n}\n","import React, { useState, useEffect } from 'react'\nimport browser from '../services/browser'\nimport { PERSONAL_PLAN_ID, ENTERPRISE_PLAN_ID, deviceUserTotal } from '../models/plans'\nimport { List, Stack } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { currencyFormatter } from '../helpers/utilHelper'\nimport { selectRemoteitLicense, selectPlan, selectLimits } from '../selectors/organizations'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { QuantitySelector } from './QuantitySelector'\nimport { NoticeCustomPlan } from './NoticeCustomPlan'\nimport { InlineSetting } from './InlineSetting'\nimport { Confirm } from './Confirm'\nimport { Gutters } from './Gutters'\nimport { Icon } from './Icon'\n\nexport const SeatsSetting: React.FC<{ context?: 'user' | 'device' }> = ({ context }) => {\n const dispatch = useDispatch()\n const accountId = useSelector(selectActiveAccountId)\n const limits = useSelector(selectLimits)\n const license = useSelector(selectRemoteitLicense) || null\n const plan = useSelector(selectPlan)\n const purchasing = useSelector((state: State) => !!state.plans.purchasing)\n\n useEffect(() => {\n setForm(getDefaults())\n }, [license])\n\n const getDefaults = () => {\n const price = plan?.prices?.find(p => p.id === license?.subscription?.price?.id) || plan?.prices?.[0]\n return {\n accountId,\n priceId: price?.id,\n quantity: license?.quantity || 1,\n }\n }\n\n const [form, setForm] = useState(getDefaults())\n const [confirm, setConfirm] = useState(false)\n const enterprise = license?.plan.id === ENTERPRISE_PLAN_ID\n const price = plan?.prices?.find(price => price.id === form.priceId)\n const displayOnly = context === 'user' && !plan?.limits?.find(l => l.name === 'org-users')?.scale\n const totals = deviceUserTotal(form.quantity, plan)\n\n const setQuantity = (value: string | number) => {\n let quantity = Math.max(Math.min(+value, 9999), 0)\n if (isNaN(quantity)) quantity = 1\n setForm({ ...form, quantity })\n }\n\n if (license?.plan?.id === PERSONAL_PLAN_ID || enterprise || !browser.hasBilling) return null\n\n const display = (\n *': { marginLeft: 0.7, marginRight: 2 } }}>\n {limits.find(l => l.name === 'org-users')?.value}\n \n {limits.find(l => l.name === 'iot-devices')?.value}\n \n \n )\n\n if (license?.custom)\n return (\n <>\n {display}\n \n \n \n \n )\n\n if (displayOnly) return {display}\n\n return (\n \n setForm(getDefaults())}\n onSubmit={async () => {\n if (form.quantity === getDefaults().quantity) return\n setConfirm(true)\n }}\n onCancel={() => setForm(getDefaults())}\n onShowEdit={() => setForm(getDefaults())}\n >\n \n \n      \n {price?.amount && (\n \n {currencyFormatter(price?.currency, (price?.amount || 0) * form.quantity)}\n  / \n {price?.interval?.toLowerCase()}    \n \n {totals.users} users\n \n {totals.devices} devices\n \n )}\n \n \n {confirm && (\n {\n dispatch.plans.updateSubscription(form)\n setConfirm(false)\n }}\n onDeny={() => {\n setForm(getDefaults())\n setConfirm(false)\n }}\n >\n Please confirm that you want to change your billing to  \n \n {currencyFormatter(price?.currency, (price?.amount || 0) * form.quantity)}\n  / \n {price?.interval?.toLowerCase()}\n \n   for {form.quantity} user license{form.quantity > 1 ? 's' : ''}.\n \n )}\n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { Redirect } from 'react-router-dom'\nimport { useSelector } from 'react-redux'\nimport { Typography, List } from '@mui/material'\nimport { ENTERPRISE_PLAN_ID } from '../models/plans'\nimport { selectRemoteitLicense, selectPermissions, selectOrganization, selectOwner } from '../selectors/organizations'\nimport { OrganizationMemberList } from '../components/OrganizationMemberList'\nimport { LicensingNoticeDisplay } from '../components/LicensingNoticeDisplay'\nimport { SeatsSetting } from '../components/SeatsSetting'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Title } from '../components/Title'\n\nexport const OrganizationMembersPage: React.FC = () => {\n const organization = useSelector(selectOrganization)\n const permissions = useSelector(selectPermissions)\n const license = useSelector(selectRemoteitLicense) || null\n const owner = useSelector(selectOwner)\n const userId = useSelector((state: State) => state.user.id)\n const enterprise = license?.plan.id === ENTERPRISE_PLAN_ID\n\n if (!permissions.includes('ADMIN'))\n return \n\n return (\n \n \n Members\n {organization?.id && }\n \n {organization?.id && (\n <>\n \n \n \n Members will automatically have devices shared to them.  \n {!enterprise && Unlicensed members will only be able to connect to the first five devices.}\n \n \n \n \n \n \n )}\n \n }\n >\n \n \n )\n}\n","import React, { useCallback, useState } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Typography, Box, ButtonBase } from '@mui/material'\nimport { useDropzone } from 'react-dropzone'\nimport { useDispatch } from 'react-redux'\nimport { IconButton } from '../buttons/IconButton'\nimport { Dispatch } from '../store'\nimport { spacing, radius } from '../styling'\n\nexport const OrganizationSAMLUpload: React.FC<{ onUpload: (data: any) => void }> = ({ onUpload }) => {\n const { ui } = useDispatch()\n const [filename, setFilename] = useState()\n const onDrop = useCallback(files => {\n files.forEach(file => {\n const reader = new FileReader()\n let result = ''\n reader.onabort = () => ui.set({ errorMessage: 'File reading was aborted' })\n reader.onerror = () => ui.set({ errorMessage: 'File reading has failed' })\n reader.onload = () => (result += reader.result)\n reader.onloadend = () => {\n onUpload(result)\n setFilename(file.name)\n }\n reader.readAsText(file)\n })\n }, [])\n const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop })\n const css = useStyles({ isDragActive })\n\n if (filename)\n return (\n \n \n {filename} selected\n \n {\n setFilename(undefined)\n onUpload(undefined)\n }}\n />\n \n )\n return (\n \n \n \n Select SAML metadata file\n Drag and drop or click \n \n \n )\n}\n\ntype styleProps = { isDragActive: boolean }\n\nconst useStyles = makeStyles(({ palette }) => ({\n paper: ({ isDragActive }: styleProps) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n border: `2px dotted ${isDragActive ? palette.primary.main : palette.grayLightest.main}`,\n background: palette.grayLightest.main,\n padding: `${spacing.lg}px ${spacing.xl}px`,\n borderRadius: radius.lg,\n minWidth: 400,\n '&:hover': { background: palette.primaryHighlight.main, borderColor: palette.primaryHighlight.main },\n }),\n}))\n","import React, { useState } from 'react'\nimport { Redirect } from 'react-router-dom'\nimport { REGEX_DOMAIN_SAFE } from '../constants'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport {\n TextField,\n Typography,\n Button,\n Box,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n ListItemSecondaryAction,\n} from '@mui/material'\nimport { selectPermissions, selectOrganization, selectLimitsLookup } from '../selectors/organizations'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { OrganizationSAMLUpload } from './OrganizationSAMLUpload'\nimport { ListItemSetting } from './ListItemSetting'\nimport { SelectSetting } from './SelectSetting'\nimport { ListItemCopy } from './ListItemCopy'\nimport { FormDisplay } from './FormDisplay'\nimport { ColorChip } from './ColorChip'\nimport { Notice } from './Notice'\nimport { Icon } from './Icon'\nimport { Link } from './Link'\n\nexport const OrganizationSAMLSettings: React.FC = () => {\n const organization = useSelector(selectOrganization)\n const updating = useSelector((state: State) => state.organization.updating)\n const defaultDomain = useSelector((state: State) => state.auth.user?.email.split('@')[1])\n const limits = useSelector(selectLimitsLookup)\n const permissions = useSelector(selectPermissions)\n const dispatch = useDispatch()\n const [checking, setChecking] = useState(false)\n const [form, setForm] = useState({\n enabled: !!organization.identityProvider,\n type: (organization.identityProvider?.type as IOrganizationProvider) || 'SAML',\n })\n\n const domain = organization.domain || ''\n const required = !!organization.providers?.includes(form.type)\n\n const incomplete =\n (form.type === 'SAML' && !form.metadata) ||\n (form.type === 'OIDC' && !(form.clientId && form.clientSecret && form.issuer))\n\n const disable = () => dispatch.organization.setIdentityProvider({ type: form.type, enabled: false })\n\n const enable = () => {\n if (incomplete) return\n dispatch.organization.setIdentityProvider({ ...form, enabled: true })\n }\n\n React.useEffect(() => {\n setForm({ ...form, enabled: !!organization.identityProvider })\n }, [organization])\n\n if (!permissions.includes('ADMIN'))\n return \n\n if (!limits.saml) return null\n\n return (\n <>\n \n {\n await dispatch.organization.setOrganization({ domain: value.toString() })\n setTimeout(() => dispatch.organization.fetch(), 1000)\n }}\n />\n {domain ? (\n organization.verified ? (\n \n \n }\n />\n }\n />\n \n ) : (\n \n \n \n \n Add the following CNAME and Value to your DNS records to validate your domain:\n Instructions.\n \n \n \n \n {\n setChecking(true)\n await dispatch.organization.fetch()\n setChecking(false)\n }}\n >\n {checking ? 'checking...' : 'Check domain'}\n \n \n \n \n )\n ) : (\n \n \n \n Enter your Organization's domain name.\n Instructions.\n \n \n )}\n \n Identity Provider\n \n {organization.verified ? (\n organization.identityProvider ? (\n <>\n \n {/* */}\n }\n />\n }\n />\n \n \n \n \n dispatch.organization.setOrganization({ providers: required ? null : [form.type] })}\n icon=\"shield-alt\"\n />\n \n \n \n ) : (\n <>\n setForm({ ...form, type: provider as IOrganizationProvider })}\n />\n {form.type === 'SAML' ? (\n <>\n \n \n \n \n \n \n setForm({ ...form, metadata })} />\n \n \n ) : (\n \n \n \n setForm({ ...form, issuer: event.target.value })}\n />\n setForm({ ...form, clientId: event.target.value })}\n />\n setForm({ ...form, clientSecret: event.target.value })}\n />\n \n \n )}\n \n \n \n \n \n Setup\n Instructions.\n \n \n \n \n )\n ) : (\n \n \n Validate your domain name to use an Identity Provider\n SAML and ODIC are both supported\n \n \n )}\n \n \n )\n}\n","import React from 'react'\nimport { Dispatch } from '../store'\nimport { Stack, List, ListSubheader, Paper } from '@mui/material'\nimport { InlineTextFieldSetting } from './InlineTextFieldSetting'\nimport { ResellerLogo } from './ResellerLogo'\nimport { useDispatch } from 'react-redux'\nimport { lightColors, darkColors, radius } from '../styling'\n\nexport const ResellerSettings: React.FC<{ reseller?: IReseller | null }> = ({ reseller }) => {\n const dispatch = useDispatch()\n\n if (!reseller) return null\n\n return (\n \n Reseller\n dispatch.organization.setReseller({ logoUrl: value.toString() })}\n />\n {reseller.logoUrl && (\n \n \n \n \n \n \n \n \n )}\n \n )\n}\n","import React from 'react'\nimport { Redirect } from 'react-router-dom'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { Typography, List, ListSubheader } from '@mui/material'\nimport { selectPermissions, selectOrganization } from '../selectors/organizations'\nimport { OrganizationSAMLSettings } from '../components/OrganizationSAMLSettings'\nimport { InlineTextFieldSetting } from '../components/InlineTextFieldSetting'\nimport { ResellerSettings } from '../components/ResellerSettings'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { Container } from '../components/Container'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\n\nexport const OrganizationSettingsPage: React.FC = () => {\n const organization = useSelector(selectOrganization)\n const permissions = useSelector(selectPermissions)\n const isOrgOwner = useSelector((state: State) => organization.id === state.user.id)\n const dispatch = useDispatch()\n\n if (!permissions.includes('ADMIN'))\n return \n\n return (\n \n Settings\n {isOrgOwner && (\n \n \n You will be permanently deleting {organization.name}. \n \n This will remove all your members and their access to your devices.\n \n }\n onDelete={async () => await dispatch.organization.removeOrganization()}\n />\n )}\n \n }\n >\n \n \n General\n dispatch.organization.setOrganization({ name: name.toString() })}\n />\n \n \n \n )\n}\n","import React from 'react'\nimport { Redirect } from 'react-router-dom'\nimport { Typography } from '@mui/material'\nimport { selectLicensesWithLimits } from '../selectors/organizations'\nimport { LicensingSetting } from '../components/LicensingSetting'\nimport { useSelector } from 'react-redux'\nimport { Container } from '../components/Container'\n\nexport const OrganizationLicensingPage: React.FC = () => {\n const { licenses, limits } = useSelector(selectLicensesWithLimits)\n\n if (!licenses.length) return \n\n return (\n License}>\n \n \n )\n}\n","import React from 'react'\nimport { State, Dispatch } from '../store'\nimport {\n Typography,\n Divider,\n Box,\n Chip,\n List,\n ListItem,\n ListItemText,\n ListItemIcon,\n ListItemSecondaryAction,\n} from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectRemoteitLicense } from '../selectors/organizations'\nimport { getOwnOrganization } from '../models/organization'\nimport { ConfirmIconButton } from '../buttons/ConfirmIconButton'\nimport { LicenseChip } from '../components/LicenseChip'\nimport { IconButton } from '../buttons/IconButton'\nimport { Container } from '../components/Container'\nimport { Duration } from '../components/Duration'\nimport { spacing } from '../styling'\nimport { Notice } from '../components/Notice'\nimport { Avatar } from '../components/Avatar'\nimport { Title } from '../components/Title'\nimport { Body } from '../components/Body'\n\nconst AVATAR_SIZE = 32\n\nexport const OrganizationMembershipPage: React.FC = () => {\n const { memberships, organization, license, email } = useSelector((state: State) => ({\n memberships: state.accounts.membership,\n organization: getOwnOrganization(state),\n license: selectRemoteitLicense(state, state.user.id),\n email: state.user.email || '',\n }))\n const { accounts } = useDispatch()\n\n return (\n \n Organization Memberships\n \n }\n >\n {memberships.length ? (\n \n {organization && (\n <>\n \n \n \n \n \n \n r.id === 'OWNER')?.name} size=\"small\" />\n \n \n \n \n \n \n \n \n )}\n {memberships.map(m => (\n \n \n \n \n \n Owner {m.account.email}\n   - Joined \n \n }\n />\n \n \n \n \n \n \n This action cannot be undone.\n You would need to contact the Organization owner to be re-added.\n \n ),\n }}\n onClick={() => accounts.leaveMembership(m.account.id)}\n />\n \n \n ))}\n \n ) : (\n \n \n No Organization Memberships\n \n \n Organizations can add you to their account to provide access to the devices they own.\n \n \n )}\n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport isEqual from 'lodash.isequal'\nimport { getAllDevices } from '../selectors/devices'\nimport { newConnection } from '../helpers/connectionHelper'\nimport { useParams, useHistory } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { DEFAULT_CONNECTION, DEFAULT_SERVICE } from '@common/constants'\nimport { List, MenuItem, TextField, Typography, Button } from '@mui/material'\nimport { ServiceAttributesForm } from '../components/ServiceAttributesForm'\nimport { getApplication } from '@common/applications'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Title } from '../components/Title'\nimport { Link } from '../components/Link'\n\nexport const ConnectionDefaultsPage: React.FC = () => {\n let customConnectionSetting: ILookup> = {}\n let customConnectionNote: ILookup> = {}\n\n function addCustomSettings(tokens: string[], id: number, el: React.ReactNode) {\n customConnectionSetting[id] = customConnectionSetting[id] || new Set()\n customConnectionNote[id] = customConnectionNote[id] || {}\n tokens.forEach(item => {\n customConnectionSetting[id].add(item)\n customConnectionNote[id][item] = el\n })\n }\n\n const dispatch = useDispatch()\n const { connectionDefaults, applicationTypes, connections, devices } = useSelector((state: State) => ({\n connectionDefaults: state.user.attributes?.connectionDefaults,\n applicationTypes: state.applicationTypes.all,\n connections: state.connections.all,\n devices: getAllDevices(state),\n }))\n const history = useHistory()\n const { applicationID } = useParams<{ applicationID: string | undefined }>()\n const [form, setForm] = useState>({})\n const [saving, setSaving] = useState(false)\n\n const id = Number(applicationID)\n const data = connectionDefaults?.[id] || {}\n const changed = !isEqual(form, data)\n const app = getApplication(undefined, { ...form, enabled: false, id: '', typeID: id })\n addCustomSettings(app.allCustomTokens, id, <>the application type defaults)\n\n applicationTypes.forEach(t => {\n const a = getApplication(undefined, { ...DEFAULT_CONNECTION, typeID: t.id })\n const el = <>application type {t.name}\n addCustomSettings(a.allCustomTokens, t.id, el)\n })\n connections.forEach(c => {\n const a = getApplication(undefined, c)\n const el = (\n <>\n connection {c.name}\n \n )\n addCustomSettings(a.allCustomTokens, c.typeID || 0, el)\n })\n devices.forEach(device =>\n device.services.forEach(service => {\n const a = getApplication(service)\n const el = (\n <>\n service\n \n {service.name} - {device.name}\n \n \n )\n addCustomSettings(a.allCustomTokens, service.typeID || 0, el)\n })\n )\n\n const connection = newConnection({ ...DEFAULT_SERVICE, ...form, typeID: id })\n\n useEffect(() => {\n if (!applicationID) history.push(`/settings/defaults/${applicationTypes[0]?.id}`)\n }, [applicationTypes])\n\n useEffect(() => {\n setForm(data)\n }, [id])\n\n return (\n \n \n Connection Defaults\n \n \n Defaults can be overridden by service specific default settings.\n \n \n history.push(`/settings/defaults/${e.target.value}`)}\n >\n {applicationTypes.map(a => (\n \n {a.name}\n \n ))}\n \n \n \n }\n >\n {applicationTypes.find(t => t.id === id)?.description}\n \n \n setForm({ ...form, ...attributes })}\n />\n \n \n \n {\n setSaving(true)\n const idForm = Object.keys(form).length === 0 ? null : form\n await dispatch.user.setAttribute({ connectionDefaults: { ...connectionDefaults, [id]: idForm } })\n setSaving(false)\n }}\n >\n {saving ? 'Saving...' : changed ? 'Save' : 'Saved'}\n \n \n \n \n )\n}\n","import React from 'react'\nimport { Typography } from '@mui/material'\nimport { selectOwnLicenses } from '../models/plans'\nimport { LicensingSetting } from '../components/LicensingSetting'\nimport { useSelector } from 'react-redux'\nimport { Container } from '../components/Container'\n\nexport const LicensingPage: React.FC = () => {\n const { licenses, limits } = useSelector(selectOwnLicenses)\n return (\n License} bodyProps={{ gutterTop: true }}>\n \n \n )\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { makeStyles } from '@mui/styles'\nimport { State } from '../../store'\nimport { ListItemSetting } from '../ListItemSetting'\nimport { emit } from '../../services/Controller'\n\nexport const SettingsDisableNetworkItem: React.FC = () => {\n const css = useStyles()\n const { preferences } = useSelector((state: State) => state.backend)\n const [toggleChange, setToggleChange] = React.useState(false)\n const subLabelText = toggleChange ? (\n Please restart for changes to take effect.\n ) : (\n 'This will allow network access to the desktop UI on ports 29999 and 29998 in addition to sharing through Remote.It'\n )\n\n if (!preferences) return null\n\n const handleClick = () => {\n setToggleChange(!toggleChange)\n emit('preferences', { ...preferences, disableLocalNetwork: !preferences.disableLocalNetwork })\n }\n\n return (\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n span: { color: palette.warning.main },\n}))\n","import React from 'react'\nimport { ListItem, ListItemText, ListItemIcon, ListItemSecondaryAction, TextField, MenuItem } from '@mui/material'\nimport { Icon } from './Icon'\n\ntype Props = {\n icon?: string\n label: React.ReactNode\n subLabel?: React.ReactNode\n value?: string | number\n options: { label: string; value?: string }[]\n onChange: React.ChangeEventHandler\n disabled?: boolean\n}\n\n\n/* \n deprecate for SelectSetting?\n*/\n\nexport const ListItemSelect: React.FC = ({ icon, label, subLabel, value, options, onChange, disabled }) => {\n return (\n \n \n \n \n \n \n \n {options.map(option => (\n \n {option.label}\n \n ))}\n \n \n \n )\n}\n","import React from 'react'\nimport { emit } from '../../services/Controller'\nimport { Button } from '@mui/material'\nimport { fullVersion, version as currentVersion } from '../../helpers/versionHelper'\nimport { State, Dispatch } from '../../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { ListItemSetting } from '../ListItemSetting'\nimport { DesktopUI } from '../DesktopUI'\nimport { ColorChip } from '../ColorChip'\nimport { Duration } from '../Duration'\nimport { TestUI } from '../TestUI'\n\nexport const UpdateSetting: React.FC<{ preferences: IPreferences; os?: Ios }> = ({ preferences, os }) => {\n const { version, nextCheck, checking, downloaded, downloading, error } = useSelector(\n (state: State) => state.backend.updateStatus\n )\n const dispatch = useDispatch()\n const updateAvailable = downloaded && version !== currentVersion\n\n let label = 'About'\n if (updateAvailable) label = `Version ${version} available`\n if (checking) label = 'Checking for updates...'\n\n return (\n <>\n {(os === 'mac' || os === 'windows') && (\n \n \n Next check in \n \n ) : undefined\n }\n icon=\"chevron-double-up\"\n secondaryContent={\n preferences.autoUpdate && (\n {\n event.stopPropagation()\n emit('update/check')\n }}\n color=\"primary\"\n size=\"small\"\n disabled={downloading}\n >\n {downloading ? 'Downloading...' : checking ? 'Checking...' : 'Check'}\n \n )\n }\n toggle={!!preferences.autoUpdate}\n onClick={() => emit('preferences', { ...preferences, autoUpdate: !preferences.autoUpdate })}\n />\n {preferences.autoUpdate && (\n \n emit('preferences', { ...preferences, allowPrerelease: !preferences.allowPrerelease })}\n />\n \n )}\n \n )}\n {fullVersion()} — © remot3.it inc.}\n icon=\"copyright\"\n secondaryContent={\n error ? (\n \n ) : updateAvailable && downloaded ? (\n \n Install\n \n ) : undefined\n }\n />\n \n )\n}\n","import React from 'react'\nimport browser from '../services/browser'\nimport { emit } from '../services/Controller'\nimport { State, Dispatch } from '../store'\nimport { List, Typography } from '@mui/material'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { SettingsDisableNetworkItem } from '../components/SettingsDisableNetworkItem'\nimport { AccordionMenuItem } from '../components/AccordionMenuItem'\nimport { selectOwnDevices } from '../selectors/devices'\nimport { ListItemSetting } from '../components/ListItemSetting'\nimport { ListItemSelect } from '../components/ListItemSelect'\nimport { UpdateSetting } from '../components/UpdateSetting'\nimport { isRemoteUI } from '../helpers/uiHelper'\nimport { DesktopUI } from '../components/DesktopUI'\nimport { Container } from '../components/Container'\nimport { ColorChip } from '../components/ColorChip'\nimport { Title } from '../components/Title'\n\nexport const OptionsPage: React.FC = () => {\n const os = useSelector((state: State) => state.backend.environment.os)\n const installing = useSelector((state: State) => state.binaries.installing)\n const cliVersion = useSelector((state: State) => state.binaries.installedVersion || '(loading...)')\n const preferences = useSelector((state: State) => state.backend.preferences)\n const thisDevice = useSelector((state: State) => selectOwnDevices(state).find(d => d.thisDevice))\n const notOwner = useSelector(\n (state: State) => !!state.backend.thisId && !selectOwnDevices(state).find(d => d.thisDevice)\n )\n const themeMode = useSelector((state: State) => state.ui.themeMode)\n const remoteUI = useSelector((state: State) => isRemoteUI(state))\n\n const { binaries, ui } = useDispatch()\n\n return (\n \n Application\n \n }\n >\n \n ui.setTheme(e.target.value as State['ui']['themeMode'])}\n />\n {browser.isRemote && (\n emit('preferences', { ...preferences, remoteUIOverride: !preferences.remoteUIOverride })}\n confirmProps={{\n title: 'Are you sure?',\n children: `New connections will be from ${thisDevice?.name || 'this device'} and not your local machine.`,\n }}\n />\n )}\n \n emit('preferences', { ...preferences, openAtLogin: !preferences.openAtLogin })}\n />\n emit('sshConfig', !preferences.sshConfig)}\n secondaryContentWidth=\"140px\"\n secondaryContent={}\n />\n emit('useCertificate', !preferences.useCertificate)}\n confirmProps={{\n title: 'Continue?',\n children: 'Changing the certificate handling will require we restart all connections.',\n }}\n />\n \n ui.resetHelp()}\n />\n \n \n {!remoteUI && (\n \n \n \n emit('service/clearErrors')}\n />\n emit('preferences', { ...preferences, disableDeepLinks: !preferences.disableDeepLinks })}\n confirm\n confirmProps={{\n title: 'Restart required',\n children:\n 'Please restart the desktop application for changes to take affect. You may also have to reset your default file handler on Linux.',\n }}\n />\n \n binaries.install()}\n confirmProps={{\n title: 'Are you sure?',\n children: 'This will stop and attempt to re-install the system agent.',\n }}\n />\n {os !== 'windows' && (\n {\n emit('uninstall')\n ui.set({ waitMessage: 'uninstalling' })\n }}\n />\n )}\n emit('showFolder', 'logs')}\n />\n \n \n \n )}\n \n )\n}\n","import React from 'react'\nimport {\n Typography,\n Button,\n List,\n ListItem,\n ListItemButton,\n ListItemText,\n ListItemIcon,\n ListItemSecondaryAction,\n} from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { useLocation, useHistory } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { selectRemoteitLicense } from '../selectors/organizations'\nimport { Notice } from './Notice'\nimport { Icon } from './Icon'\n\nexport const CreditCard: React.FC = () => {\n const history = useHistory()\n const location = useLocation()\n const dispatch = useDispatch()\n const { license, updating } = useSelector((state: State) => ({\n license: selectRemoteitLicense(state, state.user.id),\n updating: state.plans.updating,\n }))\n const card = license?.subscription?.card\n const expired = !!card && card.expiration < new Date()\n const update = () => dispatch.plans.updateCreditCard(license?.subscription?.card?.last)\n\n React.useEffect(() => {\n if (location.pathname.includes('success')) {\n dispatch.plans.restore()\n history.push('.')\n }\n }, [])\n\n if (!card) return null\n\n return (\n <>\n Credit Card\n \n {expired && (\n \n \n Credit Card Expired. Please update your card to continue service.\n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { Gutters } from './Gutters'\nimport { Timestamp } from './Timestamp'\nimport { makeStyles } from '@mui/styles'\nimport { Table, TableHead, TableBody, TableRow, TableCell, Tooltip, Typography } from '@mui/material'\nimport { currencyFormatter } from '../helpers/utilHelper'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { LoadingMessage } from './LoadingMessage'\nimport { Notice } from './Notice'\nimport { Link } from './Link'\nimport { Icon } from './Icon'\n\nexport const Invoices: React.FC = () => {\n const css = useStyles()\n const dispatch = useDispatch()\n const { invoices, loading } = useSelector((state: State) => state.billing)\n\n React.useEffect(() => {\n dispatch.billing.fetch()\n }, [])\n\n if (!invoices.length && loading) return \n\n return (\n <>\n Billing History\n {!invoices.length && !loading ? (\n \n \n No invoices found.\n \n \n ) : (\n \n \n \n \n Date\n Plan\n Amount\n Invoice\n \n \n \n {invoices.map((invoice: IInvoice, index) => (\n \n \n \n \n \n {invoice.plan.name.toLowerCase()} /{' '}\n {invoice.price.interval ? invoice.price.interval.toLowerCase() : 'one-time'}\n \n \n {currencyFormatter(invoice.price.currency, invoice.total)}\n \n \n {invoice.url && (\n \n \n \n \n \n )}\n \n \n ))}\n \n
\n
\n )}\n \n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n amount: {\n textAlign: 'right',\n color: palette.danger,\n },\n amountWithoutColor: {\n textAlign: 'right',\n },\n plan: { textTransform: 'capitalize' },\n}))\n","import React from 'react'\nimport { Typography } from '@mui/material'\nimport { CreditCard } from '../components/CreditCard'\nimport { Container } from '../components/Container'\nimport { Invoices } from '../components/Invoices'\nimport { Title } from '../components/Title'\n\nexport const BillingPage: React.FC = () => {\n return (\n \n Billing\n \n }\n >\n \n \n \n )\n}\n","import React from 'react'\nimport { PlanCard } from './PlanCard'\nimport { windowOpen } from '../services/browser'\nimport { PlanGutters } from './PlanGutters'\nimport { ENTERPRISE_PLAN_ID, planDetails } from '../models/plans'\n\ntype Props = { license: ILicense | null }\n\nexport const PlanEnterprise: React.FC = ({ license }) => {\n const enterprise = license?.plan.id === ENTERPRISE_PLAN_ID\n return (\n \n \n For changes, see\n
your administrator or\n \n ) : (\n <>\n Large-scale solutions for\n
unique and custom use-cases\n \n )\n }\n button=\"Contact Us\"\n selected={enterprise}\n onSelect={() => {\n if (enterprise) window.location.href = encodeURI(`mailto:sales@remote.it?subject=Enterprise Plan`)\n else windowOpen('https://link.remote.it/contact', '_blank')\n }}\n features={enterprise ? undefined : planDetails[ENTERPRISE_PLAN_ID].features}\n />\n
\n )\n}\n","import React from 'react'\nimport { PlanCard } from './PlanCard'\nimport { PlanGutters } from './PlanGutters'\nimport { RESELLER_PLAN_ID, planDetails } from '../models/plans'\n\ntype Props = {\n license: ILicense | null\n}\n\nexport const PlanReseller: React.FC = ({ license }) => {\n return (\n \n (window.location.href = encodeURI('mailto:support@remote.it?subject=Reseller Support'))}\n {...planDetails[RESELLER_PLAN_ID]}\n />\n \n )\n}\n","import React from 'react'\nimport { PlanCard } from './PlanCard'\nimport { PlanGutters } from './PlanGutters'\nimport { ResellerLogo } from '../components/ResellerLogo'\nimport { Typography } from '@mui/material'\n\ntype Props = { customer: IResellerRef }\n\nexport const PlanCustomer: React.FC = ({ customer }) => {\n return (\n \n \n \n \n {customer.name}\n \n Experience tailored services and dedicated support.
\n For help and inquiries, please reach out to {customer.email}.\n \n }\n button=\"Contact\"\n onSelect={() => (window.location.href = encodeURI(`mailto:${customer.email}?subject=Remote.It Plan`))}\n />\n
\n )\n}\n","import React from 'react'\nimport { getUser } from '../selectors/state'\nimport { State, Dispatch } from '../store'\nimport { ENTERPRISE_PLAN_ID, RESELLER_PLAN_ID } from '../models/plans'\nimport { selectPlan, selectRemoteitPlans, selectRemoteitLicense } from '../selectors/organizations'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { Typography, Divider } from '@mui/material'\nimport { LoadingMessage } from '../components/LoadingMessage'\nimport { PlanEnterprise } from '../components/PlanEnterprise'\nimport { PlanReseller } from '../components/PlanReseller'\nimport { PlanCustomer } from '../components/PlanCustomer'\nimport { DeleteButton } from '../buttons/DeleteButton'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\nimport { Plans } from '../components/Plans'\n\nexport const PlansPage: React.FC = () => {\n const dispatch = useDispatch()\n const { initialized } = useSelector((state: State) => state.plans)\n const license = useSelector((state: State) => selectRemoteitLicense(state, state.user.id))\n const plans = useSelector((state: State) => selectRemoteitPlans(state))\n const plan = useSelector((state: State) => selectPlan(state, state.user.id))\n const user = useSelector(getUser)\n\n const isReseller = license?.plan.id === RESELLER_PLAN_ID\n const isEnterprise = license?.plan.id === ENTERPRISE_PLAN_ID\n\n if (!initialized) return \n\n const removeReseller = async () => {\n await dispatch.user.leaveReseller()\n }\n\n return (\n \n Subscriptions\n {user.reseller && (\n \n \n This will sever your reseller relationship!\n \n You are removing ”{user.reseller.name}” as your reseller. This will remove your current plan\n and return you to the free plan.\n \n }\n onDelete={removeReseller}\n />\n )}\n \n }\n >\n {user.reseller ? (\n \n ) : isReseller ? (\n \n ) : (\n <>\n {!isEnterprise && }\n \n {!isEnterprise && (\n <>\n \n \n \n Pricing is represented and billed in US$ on most popular credit cards.\n \n \n \n )}\n \n )}\n \n )\n}\n","import React, { useState } from 'react'\nimport { useSelector } from 'react-redux'\nimport { State } from '../store'\nimport { Tooltip, Select, MenuItem } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../styling'\nimport { Icon } from './Icon'\n\nexport const ColorSelect: React.FC<{ tag: ITag; onSelect: (color: number) => void }> = ({ tag, onSelect }) => {\n const [tooltip, setTooltip] = useState(false)\n const labels = useSelector((state: State) => state.labels).filter(l => !l.hidden)\n const selected = labels.find(l => l.id === tag.color) || labels[0]\n const css = useStyles()\n\n return (\n \n setTooltip(true)}\n onMouseLeave={() => setTooltip(false)}\n onOpen={() => setTooltip(false)}\n onChange={event => onSelect(Number(event.target.value))}\n onClick={event => {\n event.preventDefault()\n event.stopPropagation()\n }}\n >\n {labels.map(\n l =>\n l.id.toString() && (\n \n \n \n )\n )}\n \n \n )\n}\nconst useStyles = makeStyles(({ palette }) => ({\n select: {\n border: '1px solid blue',\n },\n item: {\n width: spacing.xxl,\n paddingRight: 0,\n paddingLeft: 0,\n marginLeft: spacing.xxs,\n marginRight: spacing.xxs,\n justifyContent: 'center',\n },\n menu: { paddingRight: '0 !important' },\n menuPaper: { marginLeft: -spacing.md, border: `0.5px solid ${palette.grayLighter.main}` },\n icon: { display: 'none' },\n}))\n","import React, { useState } from 'react'\nimport { Icon } from '../components/Icon'\nimport { Title } from '../components/Title'\nimport { Notice } from '../components/Notice'\nimport { Confirm } from '../components/Confirm'\nimport { TagEditor } from '../components/TagEditor'\nimport { Container } from '../components/Container'\nimport { ColorSelect } from '../components/ColorSelect'\nimport { findTagIndex } from '../helpers/utilHelper'\nimport { Typography, List } from '@mui/material'\nimport { selectActiveAccountId } from '../selectors/accounts'\nimport { InlineTextFieldSetting } from '../components/InlineTextFieldSetting'\nimport { State, Dispatch } from '../store'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { REGEX_TAG_SAFE } from '../constants'\nimport { useLocation } from 'react-router-dom'\nimport { canEditTags } from '../models/tags'\nimport { selectTags } from '../selectors/tags'\nimport { useLabel } from '../hooks/useLabel'\n\nexport const TagsPage: React.FC = () => {\n const getColor = useLabel()\n const location = useLocation()\n const dispatch = useDispatch()\n const [confirm, setConfirm] = useState<{ tag: ITag; name: string }>()\n const { accountId, deleting, updating, creating, canEdit, tags } = useSelector((state: State) => {\n const userAccount = location.pathname.includes('/settings')\n const accountId = userAccount ? state.user.id : selectActiveAccountId(state)\n return {\n accountId,\n deleting: state.tags.deleting,\n updating: state.tags.updating,\n creating: state.tags.creating,\n canEdit: canEditTags(state, accountId),\n tags: selectTags(state, accountId),\n }\n })\n\n const rename = (tag: ITag, name: string) => {\n if (findTagIndex(tags, name) >= 0) {\n setConfirm({ tag, name })\n } else {\n dispatch.tags.rename({ tag, name, accountId })\n }\n }\n\n React.useEffect(() => {\n dispatch.tags.fetchIfEmpty(accountId)\n }, [dispatch, accountId])\n\n return (\n \n \n Tags\n {canEdit && (\n await dispatch.tags.create({ tag, accountId })}\n />\n )}\n \n \n }\n >\n \n {tags.map((tag, index) => (\n \n ) : (\n dispatch.tags.update({ tag: { ...tag, color }, accountId })}\n />\n )\n }\n resetValue={tag.name}\n filter={REGEX_TAG_SAFE}\n disabled={!canEdit || deleting === tag.name || updating === tag.name}\n warning={\n <>\n \n You are deleting the tag \n \n {tag.name}\n \n
\n This cannot be undone.\n
\n All devices will have this tag removed from them.\n \n }\n onDelete={() => dispatch.tags.delete({ tag, accountId })}\n onSave={value => rename(tag, value.toString())}\n />\n ))}\n
\n {\n confirm && dispatch.tags.rename({ ...confirm, accountId })\n setConfirm(undefined)\n }}\n onDeny={() => setConfirm(undefined)}\n title=\"Merge tags?\"\n action=\"Merge\"\n >\n \n This cannot be undone.\n \n \n You are about merge all instances of the {confirm?.tag.name} tag into the\n {confirm?.name} tag.\n \n \n \n )\n}\n","import React from 'react'\nimport { Typography } from '@mui/material'\nimport { EventList } from '../components/EventList'\nimport { EventHeader } from '../components/EventList/EventHeader'\nimport { Container } from '../components/Container'\n\nexport const LogsPage: React.FC = () => (\n \n Logs\n \n \n }\n >\n \n \n)\n","import React from 'react'\nimport { TimeSeriesTypeLookup, TimeSeriesAvailableResolutions, TimeSeriesLengths } from '../helpers/dateHelper'\nimport { SelectSetting } from './SelectSetting'\nimport { Duration } from 'luxon'\nimport { List } from '@mui/material'\n\ntype Props = {\n timeSeriesOptions: ITimeSeriesOptions\n logLimit: string\n defaults: ITimeSeriesOptions\n onChange?: (value: ITimeSeriesOptions) => void\n}\n\nexport const TimeSeriesSelect: React.FC = ({ timeSeriesOptions, logLimit, defaults, onChange }) => {\n const limitDuration = Duration.fromISO(logLimit)\n return (\n \n ({ key, name: TimeSeriesTypeLookup[key] }))}\n onChange={value => onChange?.({ ...timeSeriesOptions, type: value as ITimeSeriesType })}\n />\n {\n const disabled = limitDuration.valueOf() < Duration.fromObject({ [key]: TimeSeriesLengths[key][0] }).valueOf()\n return {\n key,\n name: TimeSeriesAvailableResolutions[key] + (disabled ? ' (over limit)' : ''),\n disabled,\n }\n })}\n onChange={value =>\n onChange?.({\n ...timeSeriesOptions,\n resolution: value as ITimeSeriesResolution,\n length: TimeSeriesLengths[value][0],\n })\n }\n />\n {\n const disabled =\n limitDuration.valueOf() < Duration.fromObject({ [timeSeriesOptions.resolution]: key }).valueOf()\n return {\n key,\n name: `${key} ${TimeSeriesAvailableResolutions[timeSeriesOptions.resolution]}s${\n disabled ? ' (over limit)' : ''\n }`,\n disabled,\n }\n })}\n onChange={value => onChange?.({ ...timeSeriesOptions, length: +value })}\n />\n \n )\n}\n","import React from 'react'\nimport { Container } from '../components/Container'\nimport { humanizeDays } from '../models/plans'\nimport { Dispatch, State } from '../store'\nimport { selectLimit } from '../selectors/organizations'\nimport { selectTimeSeries, selectTimeSeriesDefaults } from '../selectors/ui'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { TimeSeriesSelect } from '../components/TimeSeriesSelect'\nimport { PlanActionChip } from '../components/PlanActionChip'\nimport { Typography } from '@mui/material'\nimport { Notice } from '../components/Notice'\nimport { Title } from '../components/Title'\n\nexport const GraphsPage: React.FC = () => {\n const dispatch = useDispatch()\n const logLimit = useSelector((state: State) => selectLimit(state, undefined, 'log-limit'))\n const timeSeriesDefaults = useSelector((state: State) => selectTimeSeriesDefaults(state))\n const { deviceTimeSeries, serviceTimeSeries } = useSelector((state: State) => selectTimeSeries(state))\n\n return (\n \n Graphs\n \n }\n >\n } gutterTop>\n {humanizeDays(logLimit?.value)} of logs are available with your plan. Update to see more.\n \n Device list and details\n {\n await dispatch.ui.setPersistent({ deviceTimeSeries: value })\n await dispatch.devices.fetchList()\n }}\n />\n Service details\n {\n await dispatch.ui.setPersistent({ serviceTimeSeries: value })\n await dispatch.devices.clearLoaded()\n }}\n />\n \n )\n}\n","import React from 'react'\nimport browser from '../services/browser'\nimport { State } from '../store'\nimport { List, Typography, Tooltip, ButtonBase } from '@mui/material'\nimport { selectRemoteitLicense } from '../selectors/organizations'\nimport { ListItemLocation } from '../components/ListItemLocation'\nimport { useSelector } from 'react-redux'\nimport { windowOpen } from '../services/browser'\nimport { Container } from '../components/Container'\nimport { Logo } from '@common/brand/Logo'\nimport { Icon } from '../components/Icon'\n\nexport const AccountPage: React.FC = () => {\n const billing = useSelector((state: State) => !!selectRemoteitLicense(state, state.user.id)?.plan?.billing)\n\n const externalBilling = browser.hasBilling ? null : (\n \n )\n\n return (\n \n \n \n windowOpen('https://remote.it')}>\n \n \n \n \n \n }\n >\n \n \n \n \n {externalBilling}\n \n {billing && (\n \n {externalBilling}\n \n )}\n \n \n \n \n )\n}\n","import React from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { Box, LinearProgress, Typography } from '@mui/material'\n\nexport interface Props {\n description?: string\n value?: number\n color?: ''\n}\n\nexport const ProgressBar: React.FC = ({ description, value }) => {\n const css = useStyles()\n\n return (\n \n \n {description && {description}}\n \n )\n}\n\nconst useStyles = makeStyles({\n progress: {\n height: 8,\n borderRadius: 3,\n },\n})\n","import zxcvbn from 'zxcvbn'\nimport React, { useState } from 'react'\nimport { PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH } from '../../constants'\nimport { Stack, TextField, Typography } from '@mui/material'\nimport { ProgressBar } from './ProgressBar'\nimport { Notice } from '../Notice'\n\nexport interface Props {\n onChange: (password: string, isValid: boolean) => void\n}\n\nexport function PasswordStrengthInput({ onChange }: Props) {\n const [password, setPassword] = useState('')\n const [passwordConfirmation, setPasswordConfirmation] = useState('')\n const [valid, setValid] = useState(false)\n const [tooShort, setTooShort] = useState(true)\n const [tooLong, setTooLong] = useState(false)\n const [hasMatch, setHasMatch] = useState(false)\n\n const checkTestedResult = (pass: string) => {\n return zxcvbn(pass).score\n }\n\n const checkTooShort = (pass: string) => {\n const value = (pass ? pass.length : 0) < PASSWORD_MIN_LENGTH\n setTooShort(value)\n return value\n }\n\n const checkTooLong = (pass: string) => {\n const value = (pass ? pass.length : 0) > PASSWORD_MAX_LENGTH\n setTooLong(value)\n return value\n }\n\n const checkMatches = (pass: string, passConfirm: string) => {\n const value = pass !== '' && passConfirm !== '' && pass === passConfirm\n setHasMatch(value)\n return value\n }\n\n const checkPasswordConfirmation = (e: any) => {\n setPasswordConfirmation(e.target.value)\n const isValid = checkValid(password)\n const isMatching = checkMatches(password, e.target.value)\n sendChange(password, isValid && isMatching)\n }\n\n const checkPassword = (e: any) => {\n setPassword(e.target.value)\n const isValid = checkValid(e.target.value)\n const isMatching = checkMatches(e.target.value, passwordConfirmation)\n sendChange(password, isValid && isMatching)\n }\n\n const createPasswordStrengthLabel = (score: any) => {\n switch (score) {\n case 0:\n return 'Very Weak'\n case 1:\n return 'Weak'\n case 2:\n return 'Fair'\n case 3:\n return 'Good'\n case 4:\n return 'Strong'\n default:\n return 'Very Weak'\n }\n }\n\n const checkValid = (pass: string) => {\n const isValid = !checkTooShort(pass) && !checkTooLong(pass)\n setValid(isValid)\n return isValid\n }\n\n const sendChange = (pass: string, isValid: boolean) => {\n onChange(pass, isValid)\n }\n\n return (\n <>\n checkPassword(e)}\n fullWidth\n />\n checkPasswordConfirmation(e)}\n />\n {((password !== '' && !valid) || (passwordConfirmation != '' && !hasMatch)) && (\n \n Please fix the following problems\n {tooShort && The password must be at least {PASSWORD_MIN_LENGTH} characters long.}\n {tooLong && The password must be no more than {PASSWORD_MAX_LENGTH} characters long.}\n {passwordConfirmation != '' && !hasMatch && The passwords do not match}\n \n )}\n {valid && (\n \n )}\n \n )\n}\n","import React, { useState } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { useHistory } from 'react-router-dom'\nimport { PasswordStrengthInput } from './PasswordStrengthInput'\nimport { Button, TextField, Typography } from '@mui/material'\nimport { useDispatch } from 'react-redux'\nimport { ConfirmButton } from '../../buttons/ConfirmButton'\nimport { Dispatch } from '../../store'\nimport { Gutters } from '../Gutters'\nimport { spacing } from '../../styling'\n\nexport const ChangePassword = () => {\n const [currentPassword, setCurrentPassword] = useState('')\n const [password, setPassword] = useState('')\n const [isValid, setValid] = useState(false)\n const { auth } = useDispatch()\n const history = useHistory()\n const css = useStyles()\n\n const evaluateCurrentPassword = (e: { target: { value: React.SetStateAction } }) => {\n setCurrentPassword(e.target.value.toString())\n }\n const updatePassword = (event: { preventDefault: () => void }) => {\n event.preventDefault()\n auth.changePassword({ currentPassword: currentPassword, password: password })\n }\n return (\n <>\n \n Change Password\n \n
\n \n evaluateCurrentPassword(e)}\n />\n {\n setPassword(password)\n setValid(isValid)\n }}\n />\n \n \n \n \n Changing your password will NOT automatically sign you out of other sessions.\n \n \n You can manually sign out from all sessions below.\n \n \n ),\n }}\n />\n \n \n
\n \n )\n}\n\nconst useStyles = makeStyles({\n form: {\n maxWidth: 422,\n '& .MuiTextField-root': { marginRight: spacing.lg, marginBottom: spacing.sm },\n },\n})\n\n//

\n// You are signed in with your Google account. You can change your password in your Google account settings. If\n// you also have Remote.It login and password, you can sign in with those credentials and then change your\n// password.\n//

\n","import React from 'react'\nimport { Box, Button, MenuItem, TextField, Typography } from '@mui/material'\n\ntype Props = {\n verificationMethod: string\n changeVerificationMethod: (e: any) => void\n nextVerificationMethod: () => void\n setShowEnableSelection: (e: any) => void\n setShowMFASelection: (e: any) => void\n}\n\nexport const MFASelectMethod: React.FC = ({\n verificationMethod,\n changeVerificationMethod,\n nextVerificationMethod,\n setShowEnableSelection,\n setShowMFASelection,\n}) => {\n return (\n \n \n Choose a verification method:\n \n changeVerificationMethod(e.target.value)}\n >\n SMS Number\n Authenticator app\n \n \n \n {\n setShowEnableSelection(true)\n setShowMFASelection(false)\n }}\n >\n Cancel\n \n \n \n )\n}\n","import React from 'react'\nimport { QRCodeSVG } from 'qrcode.react'\nimport { makeStyles } from '@mui/styles'\nimport { Box, Button, TextField, Typography } from '@mui/material'\nimport { spacing, radius } from '../../styling'\n\ntype Props = {\n email?: string\n totpCode?: string\n loadTotpCode: () => Promise\n totpVerified: boolean\n sendVerifyTotp: (event: any) => void\n setTotpVerificationCode: (event: any) => void\n totpVerificationCode: string\n loading: boolean\n cancel: (event: any) => void\n}\n\nexport const MFAConfigureApp: React.FC = ({\n email,\n totpCode,\n loadTotpCode,\n totpVerified,\n sendVerifyTotp,\n setTotpVerificationCode,\n totpVerificationCode,\n loading,\n cancel,\n}) => {\n const css = useStyles()\n\n return (\n \n \n \n \n \n \n Scan this QR Code with your Authenticator app.\n \n Code: {totpCode}\n \n {!totpVerified && (\n
\n \n setTotpVerificationCode(e.currentTarget.value.trim())}\n value={totpVerificationCode}\n />\n    \n \n {loading ? 'Processing...' : 'Submit'}\n \n \n \n
\n )}\n
\n
\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n qrcode: {\n padding: spacing.md,\n backgroundColor: palette.alwaysWhite.main,\n borderRadius: radius.sm,\n },\n}))\n","import 'react-phone-input-2/lib/material.css'\nimport PhoneInput from 'react-phone-input-2'\nimport React, { useState } from 'react'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { Typography, Button, Box } from '@mui/material'\nimport { makeStyles } from '@mui/styles'\nimport { Notice } from '../Notice'\n\nexport interface Props {\n onClose: () => void\n onSuccess: (orignalNumber, newNumber) => void\n}\n\nexport const MFAPhoneForm: React.FC = ({ onClose, onSuccess }) => {\n const css = useStyles()\n const { AWSPhone, AWSUser, mfaMethod } = useSelector((state: State) => ({\n AWSPhone: state.auth.AWSUser.phone_number || '',\n AWSUser: state.auth.AWSUser,\n mfaMethod: state.mfa.mfaMethod,\n }))\n const { mfa } = useDispatch()\n const originalPhone = AWSUser.phone_number\n const [phone, setPhone] = useState(AWSPhone)\n const [validPhone, setValidPhone] = React.useState(!!AWSPhone)\n const [error, setError] = React.useState(null)\n const [message, setMessage] = React.useState(null)\n const [loading, setLoading] = React.useState(false)\n const country = 'us'\n const handleOnChange = (value: string, data) => {\n const newValue = value.replace(/[^0-9]+/g, '')\n\n if (newValue !== '' && newValue.startsWith(data.dialCode)) {\n setValidPhone(true)\n } else {\n setValidPhone(false)\n }\n if (phone !== newValue) {\n setPhone('+' + newValue)\n }\n }\n const updateUsersPhone = event => {\n event.preventDefault()\n if (AWSUser.phone_number !== phone) {\n setError(null)\n setMessage(null)\n setLoading(true)\n // console.log('Update phone number')\n mfa\n .updatePhone(phone)\n .then(() => {\n onSuccess(originalPhone, phone)\n })\n .catch(error => {\n console.error(error)\n setError(error.message)\n })\n .finally(() => {\n setLoading(false)\n })\n } else {\n onSuccess(originalPhone, phone)\n }\n }\n return (\n \n {error && (\n \n {error}\n \n )}\n {message && (\n \n {message}\n \n )}\n {AWSUser && AWSUser.phone_number_verified && AWSPhone && (\n <>\n {mfaMethod === 'SMS_MFA' && (\n \n Updating your mobile device number will disable two-factor authentication until the number is verified.\n \n )}\n \n Update your mobile device number and send verification code.\n \n \n )}\n {AWSUser && !AWSPhone && (\n \n Enter your mobile number so we can send you the verification code\n \n )}\n {AWSUser.phone_number_verified && AWSPhone === phone && (\n \n Your mobile device is verified.\n \n )}\n
\n \n \n \n \n \n We will only use this number for account security. Message and data rates may apply.\n \n \n \n \n \n \n
\n
\n )\n}\n\nconst useStyles = makeStyles(({ palette }) => ({\n phone: {\n '& .react-tel-input .form-control': {\n backgroundColor: palette.white.main,\n color: palette.grayDarkest.main,\n borderColor: palette.grayLight.main,\n },\n '& .react-tel-input .form-control:hover': { borderColor: palette.primary.main },\n '& .react-tel-input .special-label': { backgroundColor: palette.white.main, color: palette.grayDarkest.main },\n '& .react-tel-input .country-list': {\n backgroundColor: palette.grayLightest.main,\n color: palette.grayDarkest.main,\n maxHeight: 400,\n },\n '& .react-tel-input .country-list .search': { backgroundColor: palette.grayLightest.main },\n '& .react-tel-input .country-list .search-box': {\n color: palette.grayDarkest.main,\n borderColor: palette.grayLight.main,\n backgroundColor: palette.grayLightest.main,\n },\n '& .react-tel-input .country-list .divider': { borderBottomColor: palette.grayLight.main },\n '& .react-tel-input .country-list .country.highlight': {\n backgroundColor: palette.primaryHighlight.main,\n color: palette.grayDarkest.main,\n },\n '& .react-tel-input .country-list .country:hover': {\n backgroundColor: palette.primaryHighlight.main,\n color: palette.grayDarkest.main,\n },\n },\n}))\n","import React from 'react'\nimport { Link } from '../Link'\nimport { Notice } from '../Notice'\nimport { MFAPhoneForm } from './MFAPhoneForm'\nimport { Box, Button, TextField, Typography } from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../../store'\n\ntype Props = {\n cancelEditPhone: () => void\n successfulPhoneUpdate: (orginalNumber: any, newNumber: any) => Promise\n sendVerifyPhone: (event: any) => void\n hasOldSentVerification: boolean\n verificationCode: string\n loading: boolean\n resendCode: (event: any) => void\n setCancelShowVerificationCode: (event: any) => void\n}\n\nexport const MFAConfigureSms: React.FC = ({\n cancelEditPhone,\n successfulPhoneUpdate,\n sendVerifyPhone,\n hasOldSentVerification,\n verificationCode,\n loading,\n resendCode,\n setCancelShowVerificationCode,\n}) => {\n const { mfa } = useDispatch()\n const { showPhone, showVerificationCode, AWSPhone } = useSelector((state: State) => ({\n showPhone: state.mfa.showPhone,\n showVerificationCode: state.mfa.showVerificationCode,\n AWSPhone: state.auth.AWSUser.phone_number || '',\n }))\n return (\n <>\n {showPhone && (\n {\n cancelEditPhone()\n mfa.set({ showSMSConfig: false })\n }}\n onSuccess={successfulPhoneUpdate}\n />\n )}\n {showVerificationCode && (\n <>\n
\n \n {hasOldSentVerification ? (\n <>\n A verification code had previously been sent to your mobile device.{' '}\n \n A code is only valid for 24 hours. Please request the code again if it has been over 24 hours since\n requested.\n \n \n ) : (\n <>\n A verification code has been sent to your mobile device. {AWSPhone}\n This code is only valid for 24 hours.\n \n )}\n \n \n mfa.set({ verificationCode: e.currentTarget.value.trim() })}\n value={verificationCode}\n />\n    \n \n {loading ? 'Confirming...' : 'Confirm'}\n \n \n \n
\n \n Didn't receive the verification code?\n Resend Verification Code or\n {\n mfa.set({ showPhone: true, showVerificationCode: false })\n setCancelShowVerificationCode(true)\n }}\n >\n Change your verification phone number\n \n \n \n )}\n \n )\n}\n","import React from 'react'\nimport { List } from '@mui/material'\nimport { ListItemCopy } from '../ListItemCopy'\nimport { makeStyles } from '@mui/styles'\nimport { Box, Button, Typography } from '@mui/material'\nimport { ColorChip } from '../ColorChip'\nimport { IMfa } from '../../models/mfa'\nimport { spacing } from '../../styling'\n\ntype Props = {\n method?: IMfa['mfaMethod']\n phoneNumber: string\n verified?: boolean\n backupCode?: string\n loading?: boolean\n onClick: () => void\n}\n\nexport const MFAMethod: React.FC = ({ method, phoneNumber, verified, backupCode, loading, onClick }) => {\n const css = useStyles()\n return (\n <>\n {/* Authenticator Enabled */}\n {method === 'SOFTWARE_TOKEN_MFA' && (\n \n \n \n )}\n\n {/* SMS Enabled */}\n {method === 'SMS_MFA' && (\n \n \n {verified && (\n <>\n {phoneNumber}\n \n Verified\n \n \n )}\n \n )}\n\n {(method === 'SMS_MFA' || method === 'SOFTWARE_TOKEN_MFA') && (\n <>\n \n \n \n \n The recovery code is used to access your account in the event you cannot receive two-factor authentication\n codes.
\n Treat your recovery code with the same level of attention as you would your password.\n
\n \n \n )}\n \n )\n}\n\nconst useStyles = makeStyles(theme => ({\n chip: {\n marginTop: spacing.lg,\n marginBottom: spacing.sm,\n display: 'flex',\n alignItems: 'center',\n '& > *': { marginRight: spacing.md },\n },\n}))\n","import React, { useState } from 'react'\nimport { State, Dispatch } from '../../store'\nimport { Box, Button, Typography, Divider } from '@mui/material'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { MFASelectMethod } from './MFASelectMethod'\nimport { MFAConfigureApp } from './MFAConfigureApp'\nimport { MFAConfigureSms } from './MFAConfigureSms'\nimport { ColorChip } from '../ColorChip'\nimport { MFAMethod } from './MFAMethod'\nimport { Gutters } from '../Gutters'\n\nexport const MFAPreference: React.FC = () => {\n const { AWSPhone, AWSUser, mfaMethod, verificationCode, showMFASelection, showSMSConfig, backupCode } = useSelector(\n (state: State) => ({\n AWSPhone: state.auth.AWSUser.phone_number || '',\n AWSUser: state.auth.AWSUser,\n mfaMethod: state.mfa.mfaMethod,\n verificationCode: state.mfa.verificationCode,\n showMFASelection: state.mfa.showMFASelection,\n showSMSConfig: state.mfa.showSMSConfig,\n backupCode: state.mfa.backupCode,\n })\n )\n const { mfa } = useDispatch()\n const [showEnableSelection, setShowEnableSelection] = useState(mfaMethod === 'NO_MFA')\n const [showAuthenticatorConfig, setShowAuthenticatorConfig] = useState(false)\n const [totpCode, setTotpCode] = useState()\n const [totpVerified] = useState(false)\n const [totpVerificationCode, setTotpVerificationCode] = useState('')\n const [cancelShowVerificationCode, setCancelShowVerificationCode] = useState(false)\n const [loading, setLoading] = useState(false)\n const [verificationMethod, setVerificationMethod] = useState('sms')\n const [hasOldSentVerification, setHasOldSentVerification] = useState(\n AWSUser && !AWSUser.phone_number_verified\n )\n\n const loadTotpCode = async () => setTotpCode(await mfa.getTotpCode())\n const setVerificationCode = (verificationCode: string) => mfa.set({ verificationCode })\n const setShowPhone = (showPhone: boolean) => mfa.set({ showPhone })\n const setShowMFASelection = (showMFASelection: boolean) => mfa.set({ showMFASelection })\n const setShowVerificationCode = (showVerificationCode: boolean) => mfa.set({ showVerificationCode })\n const setShowSMSConfig = (showSMSConfig: boolean) => mfa.set({ showSMSConfig })\n\n const sendVerifyTotp = async event => {\n event.preventDefault()\n setLoading(true)\n await mfa.verifyTotpCode(totpVerificationCode)\n setShowAuthenticatorConfig(false)\n setLoading(false)\n }\n\n const cancelTotp = event => {\n setShowEnableSelection(true)\n setShowAuthenticatorConfig(false)\n }\n\n const successfulPhoneUpdate = async (orginalNumber, newNumber) => {\n setShowPhone(false)\n setVerificationCode('')\n if (AWSUser && AWSUser.phone_number_verified && orginalNumber === newNumber && mfaMethod !== 'SMS_MFA') {\n //no update to verified phone number, so just enable MFA\n await mfa.setMFAPreference('SMS_MFA')\n setShowSMSConfig(false)\n } else if (AWSUser && orginalNumber === newNumber && !AWSUser.phone_number_verified) {\n //not updating the phone but it needs to verify\n setHasOldSentVerification(true)\n setShowVerificationCode(true)\n } else {\n //new phone number and needs to verify\n setHasOldSentVerification(false)\n setShowVerificationCode(true)\n }\n }\n\n const sendVerifyPhone = async event => {\n event.preventDefault()\n setLoading(true)\n await mfa.verifyPhone(verificationCode)\n setVerificationCode('')\n setCancelShowVerificationCode(false)\n setHasOldSentVerification(false)\n setShowPhone(false)\n setShowVerificationCode(false)\n setLoading(false)\n }\n\n const resendCode = async event => {\n event.preventDefault()\n setLoading(true)\n await mfa.updatePhone(AWSPhone)\n setHasOldSentVerification(false)\n setVerificationCode('')\n setShowVerificationCode(true)\n setShowPhone(false)\n setCancelShowVerificationCode(true)\n setLoading(false)\n }\n\n const cancelEditPhone = () => {\n if (cancelShowVerificationCode) {\n setCancelShowVerificationCode(false)\n setShowPhone(false)\n setShowVerificationCode(true)\n } else {\n setShowPhone(false)\n setShowVerificationCode(false)\n setShowEnableSelection(true)\n }\n }\n\n const changeVerificationMethod = (type: any) => {\n setVerificationMethod(type)\n }\n\n const nextVerificationMethod = () => {\n if (verificationMethod === 'sms') {\n setShowMFASelection(false)\n setShowSMSConfig(true)\n setShowPhone(true)\n } else {\n loadTotpCode()\n setShowMFASelection(false)\n setShowAuthenticatorConfig(true)\n }\n }\n\n if (AWSUser && AWSUser.authProvider === 'Google') {\n return (\n <>\n Two-factor Authentication\n \n \n You are signed in with your Google account. You can enable two-factor authentication in your Google account\n settings. If you also have Remote.It login and password, you can sign in with those credentials and then\n enable two-factor authentication.\n \n \n \n )\n }\n\n if (AWSUser) {\n // let totp_code = await mfa.getTotpCode()\n return (\n <>\n Two-factor Authentication\n \n \n Add an additional layer of security to your account by requiring more than just a password to sign in.\n \n \n {\n setShowEnableSelection(true)\n mfa.setMFAPreference('NO_MFA')\n }}\n />\n\n {/* Show Enable Two-Factor*/}\n {mfaMethod === 'NO_MFA' && showEnableSelection && (\n \n \n \n \n {\n setShowEnableSelection(false)\n setShowMFASelection(true)\n }}\n >\n Turn on\n \n \n )}\n\n {/* Select Two-Factor Method */}\n {mfaMethod === 'NO_MFA' && showMFASelection && (\n \n )}\n {/* CONFIGURE Authenticator App */}\n {mfaMethod === 'NO_MFA' && showAuthenticatorConfig && (\n \n )}\n\n {/* CONFIGURE SMS */}\n {mfaMethod === 'NO_MFA' && showSMSConfig && (\n \n )}\n \n \n )\n }\n\n return null\n}\n","import React from 'react'\nimport { Button, Typography, Divider } from '@mui/material'\nimport { Container } from '../components/Container'\nimport { Title } from '../components/Title'\nimport { Gutters } from '../components/Gutters'\nimport { ChangePassword } from '../components/ChangePassword'\nimport { MFAPreference } from '../components/MFA/MFAPreference'\nimport { Dispatch } from '../store'\nimport { useDispatch } from 'react-redux'\n\nexport const SecurityPage: React.FC = () => {\n return (\n \n Security\n \n }\n >\n \n \n \n \n \n \n )\n}\n\nfunction GlobalSignOut(): JSX.Element {\n const { auth } = useDispatch()\n const signedOut = () => {\n auth.globalSignOut()\n }\n return (\n <>\n \n Sign out everywhere\n \n \n This logs you out of Remote.It everywhere you're logged in.\n \n \n \n \n \n )\n}\n","import React, { useState } from 'react'\nimport { makeStyles } from '@mui/styles'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../store'\nimport { Button, Typography, TextField } from '@mui/material'\nimport { AccordionMenuItem } from '../components/AccordionMenuItem'\nimport { fullVersion } from '../helpers/versionHelper'\nimport { useHistory } from 'react-router-dom'\nimport { Container } from '../components/Container'\nimport { Gutters } from '../components/Gutters'\nimport { Link } from '../components/Link'\n\nexport const FeedbackPage: React.FC<{}> = () => {\n const presets = useSelector((state: State) => state.feedback)\n const dispatch = useDispatch()\n const history = useHistory()\n const [subject, setSubject] = useState(presets.subject)\n const [body, setBody] = useState(presets.body)\n const css = useStyles()\n\n const sendFeedback = () => {\n dispatch.feedback.set({ subject, body, data: presets.data })\n dispatch.feedback.sendFeedback()\n history.goBack()\n }\n\n const email = () => {\n window.location.href = encodeURI(`mailto:support@remote.it?subject=${fullVersion()} Feedback`)\n }\n\n return (\n Contact}>\n \n Get support or provide feedback on how can we improve Remote.It.\n \n If you have a feature request, please include why it’s important to you.\n \n \n \n setSubject(e.target.value)}\n />\n \n \n setBody(e.target.value)}\n />\n \n \n \n \n You can also email us atsupport@remote.it\n \n \n {presets.data && (\n \n \n \n
{JSON.stringify(presets.data, null, 2)}
\n
\n
\n
\n )}\n
\n )\n}\n\nconst useStyles = makeStyles({\n input: { '& .MuiInputBase-input': { minHeight: '10rem' } },\n flex: { display: 'flex', justifyContent: 'space-between' },\n})\n","import React, { useState } from 'react'\nimport { Dispatch } from '../../store'\nimport { useDispatch } from 'react-redux'\nimport { Button, Dialog, DialogTitle, DialogContent, DialogActions, TextField, Typography } from '@mui/material'\nimport { IconButton } from '../../buttons/IconButton'\nimport { Notice } from '../Notice'\n\nexport const DeleteAccessKey: React.FC<{ deleteKey: IAccessKey }> = ({ deleteKey }) => {\n const [open, setOpen] = useState(false)\n const [deleteText, setDeleteText] = useState('')\n const dispatch = useDispatch()\n\n function handleClose() {\n setOpen(false)\n setDeleteText('')\n }\n\n function confirmDelete(e) {\n e.preventDefault()\n if (deleteText !== 'DELETE') return\n dispatch.keys.deleteAccessKeys(deleteKey.key)\n handleClose()\n }\n\n return (\n <>\n {!deleteKey.enabled && (\n setOpen(true)}\n />\n )}\n \n Delete Access Key\n
\n \n \n This action is permanent and cannot be undone.\n \n \n Do you wish to delete key {deleteKey.key}?\n \n setDeleteText(e.currentTarget.value)}\n value={deleteText}\n />\n \n \n \n \n \n
\n
\n \n )\n}\n","import React, { useState } from 'react'\nimport { Icon } from '../Icon'\nimport { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from '@mui/material'\nimport { State } from '../../store'\nimport { useSelector } from 'react-redux'\nimport { CopyCodeBlock } from '../CopyCodeBlock'\nimport { IconButton } from '../../buttons/IconButton'\nimport { Notice } from '../Notice'\n\ntype Props = {\n open: boolean\n onClose: () => void\n newKey?: string\n secretKey?: string\n}\n\nexport function CreateAccessKey({ open, onClose, newKey = 'Creating...', secretKey }: Props) {\n const user = useSelector((state: State) => state.auth.user)\n const [showAccessKey, setShowAccessKey] = useState(false)\n const handleShowAccessKey = () => setShowAccessKey(!showAccessKey)\n\n function downloadCredentials() {\n var data = `[DEFAULT]\n# ${user?.email}\nR3_ACCESS_KEY_ID=${newKey}\nR3_SECRET_ACCESS_KEY=${secretKey}`\n\n var element = document.createElement('a')\n element.href = 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(data)\n element.setAttribute('download', 'credentials')\n element.style.display = 'none'\n document.body.appendChild(element)\n element.click()\n document.body.removeChild(element)\n }\n\n return (\n \n Credentials\n \n {secretKey && (\n \n Your new access key is ready to use\n \n )}\n \n You will not see this secret key again. Please download and save it in the .remoteit directory of your home\n folder.\n \n \n \n \n {showAccessKey ? secretKey : '****************************************'}\n \n }\n sx={{ marginTop: 1 }}\n hideCopyLabel\n />\n \n \n \n \n \n \n )\n}\n","import React from 'react'\nimport { fontSizes } from '../styling'\nimport { Paper, PaperProps, Typography } from '@mui/material'\n\ntype Props = PaperProps & {\n children: React.ReactNode\n}\n\nexport function CodeBlock({ children, ...props }: Props) {\n return (\n \n \n {children}\n \n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Button, List, Typography, Box } from '@mui/material'\nimport { DeleteAccessKey } from './DeleteAccessKey'\nimport { CreateAccessKey } from './CreateAccessKey'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { ListItemSetting } from '../ListItemSetting'\nimport { CopyCodeBlock } from '../CopyCodeBlock'\nimport { CodeBlock } from '../CodeBlock'\nimport { Timestamp } from '../Timestamp'\nimport { Gutters } from '../Gutters'\nimport { Notice } from '../Notice'\nimport { Icon } from '../Icon'\n\nexport const AccountAccessKey: React.FC = () => {\n const [showDialog, setShowDialog] = useState(false)\n const { accessKeys, secretKey, key, updating } = useSelector((state: State) => state.keys)\n const dispatch = useDispatch()\n\n useEffect(() => {\n dispatch.keys.init()\n }, [])\n\n const handleToggle = k => {\n dispatch.keys.toggleAccessKeys({\n key: k.key,\n enabled: !k.enabled,\n })\n }\n\n return (\n <>\n Authentication\n \n \n If you lose or forget your secret key, you cannot retrieve it.\n There is a limit of 2 access keys. Keep your keys safe.\n \n \n Access keys are necessary for authenticating with our API. You have the option to create a new key, delete an\n existing one, or temporarily disable a key. It's advisable to download and save your keys in the .remoteit\n directory of your home folder:\n \n ~/.remoteit/credentials\n \n 1}\n onClick={() => {\n dispatch.keys.createAccessKey()\n setShowDialog(true)\n }}\n >\n Generate Credentials\n \n \n \n \n \n {accessKeys?.map((k, index) => (\n \n \n handleToggle(k)}\n disableGutters\n secondaryContent={\n updating === k.key ? (\n \n ) : k.enabled ? undefined : (\n \n )\n }\n subLabel={\n <>\n Created  /  \n {k.lastUsed ? (\n <>\n Last used \n \n ) : (\n 'Never used'\n )}\n \n }\n />\n \n ))}\n \n \n {\n dispatch.keys.set({ key: undefined, secretKey: undefined })\n setShowDialog(false)\n }}\n newKey={key}\n secretKey={secretKey}\n />\n \n )\n}\n","import React from 'react'\nimport { State } from '../store'\nimport { Typography, Divider } from '@mui/material'\nimport { useSelector } from 'react-redux'\nimport { Container } from '../components/Container'\nimport { Title } from '../components/Title'\nimport { CopyCodeBlock } from '../components/CopyCodeBlock'\nimport { AccountAccessKey } from '../components/AccountAccessKey'\nimport { Gutters } from '../components/Gutters'\n\nexport const AccessKeyPage: React.FC = () => {\n const { apiKey } = useSelector((state: State) => ({\n apiKey: state.keys?.apiKey,\n }))\n\n return (\n \n \n Access Keys\n \n \n }\n >\n \n \n Developer\n \n \n This is your unique Developer API key to use and access Remote.It APIs.\n
\n Do not share it with anyone.\n
\n \n
\n \n )\n}\n","import React from 'react'\nimport { Icon } from '../Icon'\nimport { ListItemButton, ListItemText, ListItemIcon, ListItemSecondaryAction, Switch } from '@mui/material'\n\ntype Props = {\n keyProp?: string | number\n label: string | React.ReactNode\n checked?: boolean\n children?: React.ReactNode\n onClick: (checked: boolean) => void\n}\n\nexport const ListItemSwitch: React.FC = ({ label, checked, onClick, children }) => {\n return (\n onClick(!checked)} dense>\n \n \n \n \n \n {children}\n onClick(!checked)} />\n \n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport { TextField, Button, List } from '@mui/material'\nimport { Gutters } from '../../components/Gutters'\nimport { ListItemSwitch } from '../../components/ListItemSwitch'\nimport { Quote } from '../../components/Quote'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { Dispatch, State } from '../../store'\nimport isURL from 'validator/lib/isURL'\n\nexport const NotificationMode: React.FC = () => {\n const { notificationUrl, urlNotifications, emailNotifications, desktopNotifications } = useSelector(\n (state: State) => state.user.notificationSettings\n )\n const dispatch = useDispatch()\n const { updateNotificationSettings } = dispatch.user\n const [webHookUrl, setWebhookUrl] = useState(notificationUrl || '')\n const [loading, setLoading] = useState(false)\n const [error, setError] = useState(false)\n const changed = webHookUrl !== notificationUrl\n const metadata: INotificationSetting = {\n desktopNotifications: desktopNotifications,\n emailNotifications: emailNotifications,\n urlNotifications: urlNotifications,\n notificationUrl: webHookUrl,\n }\n\n useEffect(() => {\n setWebhookUrl(notificationUrl || '')\n }, [notificationUrl])\n\n const onEmailChange = (value: boolean) => {\n updateNotificationSettings({ ...metadata, emailNotifications: value })\n }\n\n const onSystemChange = (value: boolean) => {\n updateNotificationSettings({ ...metadata, desktopNotifications: value })\n }\n\n const onWebChange = (value: boolean) => {\n setWebhookUrl('')\n setError(false)\n updateNotificationSettings({\n ...metadata,\n notificationUrl: '',\n urlNotifications: value,\n })\n }\n\n const changeWebHookUrl = (value: string) => {\n setWebhookUrl(value)\n if (urlNotifications) {\n isURL(value) ? setError(false) : setError(true)\n }\n }\n\n const onSave = async () => {\n if (!error) {\n setLoading(true)\n await updateNotificationSettings({\n ...metadata,\n notificationUrl: urlNotifications && webHookUrl?.length ? webHookUrl : '',\n urlNotifications: urlNotifications,\n })\n setLoading(false)\n }\n }\n\n return (\n <>\n \n \n \n \n \n \n \n changeWebHookUrl(e.currentTarget.value.trim())}\n value={webHookUrl}\n label=\"URL endpoint\"\n placeholder=\"Webhook Endpoint\"\n required\n variant=\"filled\"\n error={error}\n fullWidth\n helperText={error ? 'Please provide a valid URL' : undefined}\n />\n
\n
\n \n {loading ? 'Saving' : 'Save'}\n \n
\n
\n \n )\n}\n","import React from 'react'\nimport { Container } from '../../components/Container'\nimport { Typography } from '@mui/material'\nimport { Title } from '../../components/Title'\nimport { NotificationMode } from './NotificationsMode'\n\nexport const NotificationsPage: React.FC = () => {\n return (\n \n Notifications\n \n }\n >\n Method\n \n \n )\n}\n","import React, { useEffect } from 'react'\nimport useMobileNavigation from '../hooks/useMobileNavigation'\nimport { emit } from '../services/Controller'\nimport { RolesRouter } from './RolesRouter'\nimport { DeviceRouter } from './DeviceRouter'\nimport { ServiceRouter } from './ServiceRouter'\nimport { NetworkRouter } from './NetworkRouter'\nimport { ScriptingRouter } from './ScriptingRouter'\nimport { RedirectOffsite } from '../components/RedirectOffsite'\nimport { State, Dispatch } from '../store'\nimport { REGEX_FIRST_PATH } from '../constants'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { Switch, Route, Redirect, useHistory, useLocation } from 'react-router-dom'\nimport { OnboardRouter } from './OnboardRouter'\nimport { DeviceContextWrapper } from '../components/DeviceContextWrapper'\nimport { ConnectionOtherPage } from '../pages/ConnectionOtherPage'\nimport { ConnectionsPage } from '../pages/ConnectionsPage'\nimport { SettingsPage } from '../pages/SettingsPage'\nimport { ClaimPage } from '../pages/ClaimPage'\nimport { TestPage } from '../pages/TestPage'\nimport { AddPage } from '../pages/AddPage'\nimport { DevicesPage } from '../pages/DevicesPage'\nimport { SetupDevice } from '../pages/SetupDevice'\nimport { SetupWaiting } from '../pages/SetupWaiting'\nimport { ResellerPage } from '../pages/ResellerPage'\nimport { CustomerPage } from '../pages/CustomerPage'\nimport { PlatformAddPage } from '../pages/PlatformAddPage'\nimport { CustomerAddPage } from '../pages/CustomerAddPage'\nimport { OrganizationPage } from '../pages/OrganizationPage'\nimport { CustomerPlansPage } from '../pages/CustomerPlansPage'\nimport { AnnouncementsPage } from '../pages/AnnouncementsPage'\nimport { OrganizationAddPage } from '../pages/OrganizationAddPage'\nimport { OrganizationUserPage } from '../pages/OrganizationUserPage'\nimport { OrganizationEmptyPage } from '../pages/OrganizationEmptyPage'\nimport { OrganizationGuestsPage } from '../pages/OrganizationGuestsPage'\nimport { RaspberrypiOptionsPage } from '../pages/RaspberrypiOptionsPage'\nimport { OrganizationMembersPage } from '../pages/OrganizationMembersPage'\nimport { OrganizationSettingsPage } from '../pages/OrganizationSettingsPage'\nimport { OrganizationLicensingPage } from '../pages/OrganizationLicensingPage'\nimport { OrganizationMembershipPage } from '../pages/OrganizationMembershipPage'\nimport { ConnectionDefaultsPage } from '../pages/ConnectionDefaultsPage'\nimport { LicensingPage } from '../pages/LicensingPage'\nimport { DynamicPanel } from '../components/DynamicPanel'\nimport { OptionsPage } from '../pages/OptionsPage'\nimport { BillingPage } from '../pages/BillingPage'\nimport { PlansPage } from '../pages/PlansPage'\nimport { SharePage } from '../pages/SharePage'\nimport { TagsPage } from '../pages/TagsPage'\nimport { Panel } from '../components/Panel'\nimport { LogsPage } from '../pages/LogsPage'\nimport { isRemoteUI } from '../helpers/uiHelper'\nimport { GraphsPage } from '../pages/GraphsPage'\nimport { ProfilePage } from '../pages/ProfilePage'\nimport { AccountPage } from '../pages/AccountPage'\nimport { SecurityPage } from '../pages/SecurityPage'\nimport { FeedbackPage } from '../pages/FeedbackPage'\nimport { AccessKeyPage } from '../pages/AccessKeyPage'\nimport { NotificationsPage } from '../pages/NotificationsPage'\nimport browser, { getOs } from '../services/browser'\n\nexport const Router: React.FC<{ layout: ILayout }> = ({ layout }) => {\n useMobileNavigation()\n const history = useHistory()\n const location = useLocation()\n const { ui } = useDispatch()\n\n const remoteUI = useSelector(isRemoteUI)\n const redirect = useSelector((state: State) => state.ui.redirect)\n const thisId = useSelector((state: State) => state.backend.thisId)\n const registered = useSelector((state: State) => !!state.backend.thisId)\n const os = useSelector((state: State) => state.backend.environment.os) || getOs()\n\n useEffect(() => {\n const initialRoute = window.localStorage.getItem('initialRoute')\n if (initialRoute) {\n if (initialRoute !== location.pathname) history.push(initialRoute)\n console.log('UI REDIRECT INIT', initialRoute)\n window.localStorage.removeItem('initialRoute')\n }\n }, [])\n\n useEffect(() => {\n if (redirect) {\n console.log('UI REDIRECT', redirect)\n history.push(redirect)\n ui.set({ redirect: undefined })\n }\n // track what page is viewed\n if (window.clarity) window.clarity('set', 'page', location.pathname.match(REGEX_FIRST_PATH)?.[0])\n // update navigation state\n emit('navigate', 'STATUS')\n }, [history.location, ui, redirect])\n\n return (\n \n {/* Deep links */}\n \n \n \n \n \n \n \n {/* Connections */}\n \n \n }\n secondary={\n \n \n \n \n\n \n \n \n \n }\n layout={layout}\n root=\"/connections\"\n />\n \n \n {/* Networks */}\n \n \n \n \n \n {/* Add */}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/* Onboard */}\n \n \n \n \n \n {/* Devices */}\n \n {registered ? (\n \n ) : browser.hasBackend ? (\n \n \n \n ) : (\n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {remoteUI ? (\n registered ? (\n \n ) : (\n \n \n \n )\n ) : (\n \n \n \n )}\n \n \n \n \n \n \n {/* Logs */}\n \n \n \n \n \n {/* Announcements */}\n \n \n \n \n \n {/* Feedback */}\n \n \n \n \n \n {/* Scripting */}\n \n \n \n {/* Settings */}\n \n }\n secondary={\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n layout={layout}\n root=\"/settings\"\n />\n \n {/* Organization */}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n secondary={\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n layout={layout}\n root={['/organization']}\n />\n \n {/* Account */}\n \n }\n secondary={\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n layout={layout}\n root=\"/account\"\n />\n \n {/* Not found */}\n \n \n )\n}\n","import React from 'react'\nimport browser from '../services/browser'\nimport { makeStyles } from '@mui/styles'\nimport { spacing } from '../styling'\nimport { emit } from '../services/Controller'\n\nexport const DragAppRegion: React.FC = () => {\n const css = useStyles()\n if (!browser.isElectron || !browser.isMac) return null\n return
emit('maximize')} />\n}\n\nconst useStyles = makeStyles({\n drag: {\n left: 0,\n top: 0,\n right: 0,\n height: spacing.xxl,\n position: 'absolute',\n // WebkitAppRegion: 'drag', - handled in index.css\n // backgroundColor: 'rgba(255,0,0,0.2)',\n },\n})\n","import React from 'react'\nimport browser from '../services/browser'\nimport { useHistory } from 'react-router-dom'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { Snackbar, Button } from '@mui/material'\nimport { Notice } from './Notice'\nimport { Icon } from './Icon'\n\nexport const ConnectionNotice: React.FC<{ className: string }> = ({ className }) => {\n const { queueCount, queueEnabling, queueFinished, queueConnection } = useSelector((state: State) => state.connections)\n const { connections } = useDispatch()\n const history = useHistory()\n\n const clearConnectionsMessage = () => connections.set({ queueCount: 0, queueFinished: false })\n\n const stopped = browser.hasBackend ? 'stopped' : 'disconnected'\n const started = browser.hasBackend ? 'started' : 'connected'\n let message = `${queueCount} connection${queueCount === 1 ? '' : 's'}`\n message += queueEnabling ? ` ${started}.` : ` ${stopped}.`\n\n return (\n {\n console.log(`/devices/${queueConnection?.deviceID}/${queueConnection?.id}`)\n history.push(`/devices/${queueConnection?.deviceID}/${queueConnection?.id}`)\n }}\n >\n Show Endpoint\n {queueCount === 1 ? '' : 's'}\n \n )\n }\n onClose={clearConnectionsMessage}\n invert\n >\n {message}\n \n }\n />\n )\n}\n","import React, { useEffect } from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../store'\nimport { Confirm } from '../components/Confirm'\nimport { Notice } from '../components/Notice'\n\nconst GLOBAL_DIALOGS: ILookup<{ title: string; message: React.ReactNode; action?: string }> = {\n destroyLink: {\n title: 'Reset persistent endpoint?',\n message: 'This will clear your connect link url so that a new one will be created when you restart again.',\n action: 'Reset',\n },\n forceUnregister: {\n title: 'Force removal?',\n message: (\n <>\n \n This device is owned by another user. You will be permanently removing it.\n \n Use your system admin privileges to unregister this device?\n \n ),\n },\n}\n\nexport const GlobalConfirm: React.FC = () => {\n const dispatch = useDispatch()\n const confirm = useSelector((state: State) => state.ui.confirm)\n const [open, setOpen] = React.useState(false)\n const dialog = GLOBAL_DIALOGS[confirm?.id || '']\n\n const close = () => dispatch.ui.set({ confirm: undefined })\n const handleConfirm = async () => {\n await confirm?.callback()\n close()\n }\n\n useEffect(() => {\n setOpen(!!confirm)\n }, [confirm])\n\n if (!dialog) return null\n\n return (\n \n {dialog.message}\n \n )\n}\n","import React, { useState, useEffect } from 'react'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { State, Dispatch } from '../../store'\nimport { Snackbar, Button } from '@mui/material'\nimport { selectUpdateNotice } from '../../selectors/ui'\nimport { Confirm } from '../Confirm'\nimport { Notice } from '../Notice'\nimport browser from '../../services/browser'\n\nexport const UpdateNotice: React.FC<{ className: string }> = ({ className }) => {\n const updateReady = useSelector((state: State) => selectUpdateNotice(state))\n const [confirm, setConfirm] = useState(false)\n const [open, setOpen] = useState(!!updateReady)\n const dispatch = useDispatch()\n\n const handleClick = () => {\n setConfirm(true)\n }\n\n const handleConfirm = () => {\n setOpen(false)\n setConfirm(false)\n dispatch.backend.install()\n }\n\n const handleDisable = () => {\n setOpen(false)\n setConfirm(false)\n dispatch.backend.disableAutoUpdate()\n }\n\n useEffect(() => {\n setOpen(!!updateReady)\n }, [updateReady])\n\n if (!browser.isElectron || browser.isRemote) return null\n\n return (\n <>\n {\n setOpen(false)\n dispatch.backend.setUpdateNotice(updateReady)\n }}\n fullWidth\n button={[\n ,\n ,\n ]}\n >\n An update is available (v{updateReady}).\n \n }\n />\n {confirm && (\n setConfirm(false)}\n title=\"Are you sure?\"\n action=\"Install\"\n >\n \n Restarting while connected over a Remote.It connection could cause the connection to be permanently lost.\n \n It is recommended to have a local connection when updating.\n \n )}\n \n )\n}\n","import React, { useState } from 'react'\nimport { APP_MAX_WIDTH } from '../constants'\nimport { Tooltip, IconButton, Box, Stack, useMediaQuery } from '@mui/material'\nimport { TargetPlatform } from './TargetPlatform'\nimport { Icon } from './Icon'\nimport screenfull from 'screenfull'\nimport browser from '../services/browser'\n\ntype Props = { device?: IDevice; children: React.ReactNode }\n\nexport const RemoteHeader: React.FC = ({ device, children }) => {\n const maxWidth = !browser.isElectron && useMediaQuery(`(min-width:${APP_MAX_WIDTH}px)`)\n const showFrame = browser.isRemote\n const [fullscreen, setFullscreen] = useState(false)\n const fullscreenEnabled = screenfull.isEnabled\n\n const toggleFullscreen = () => {\n setFullscreen(!fullscreen)\n if (screenfull.isEnabled) screenfull.toggle()\n }\n\n return (\n \n {showFrame && (\n ({\n height: spacing(3),\n paddingTop: 0.75,\n display: 'flex',\n color: 'grayLight.main',\n textAlign: 'center',\n '& button': { position: 'absolute', left: 0, top: 0, color: 'white.main' },\n })}\n >\n {fullscreenEnabled && (\n \n \n \n \n \n )}\n ({ position: 'absolute', height: 3, right: spacing(2.25), top: spacing(0.75) })}>\n \n \n \n )}\n ({\n overflow: 'hidden',\n display: 'flex',\n flexFlow: 'column',\n margin: 'auto',\n contain: 'layout',\n marginTop: maxWidth || showFrame ? 3 / 2 : 0,\n height: `calc(100% - ${showFrame ? spacing(6) : maxWidth ? spacing(3) : '0px'})`,\n width: `calc(100% - ${showFrame ? spacing(6) : '0px'})`,\n maxWidth: maxWidth ? APP_MAX_WIDTH : undefined,\n backgroundColor: 'white.main',\n borderRadius: maxWidth || showFrame ? 5 : undefined,\n boxShadow: maxWidth || showFrame ? 3 : undefined,\n })}\n >\n {children}\n \n \n )\n}","import React from 'react'\nimport Controller from '../services/Controller'\nimport { ORGANIZATION_BAR_WIDTH } from '../constants'\nimport { useSelector, useDispatch } from 'react-redux'\nimport { Snackbar, IconButton, Dialog, Button } from '@mui/material'\nimport { State, Dispatch } from '../store'\nimport { spacing } from '../styling'\nimport { makeStyles } from '@mui/styles'\nimport { selectDevice } from '../selectors/devices'\nimport { DragAppRegion } from '../components/DragAppRegion'\nimport { ConnectionNotice } from '../components/ConnectionNotice'\nimport { GlobalConfirm } from '../components/GlobalConfirm'\nimport { UpdateNotice } from '../components/UpdateNotice'\nimport { RemoteHeader } from '../components/RemoteHeader'\nimport { Notice } from '../components/Notice'\nimport { Icon } from '../components/Icon'\n\nexport interface Props {\n children: React.ReactNode\n}\n\nexport function Page({ children }: Props & React.HTMLProps) {\n const { ui } = useDispatch()\n \n const device = useSelector(selectDevice)\n const connected = useSelector((state: State) => state.ui.connected)\n const backendAuthenticated = useSelector((state: State) => state.auth.backendAuthenticated)\n const successMessage = useSelector((state: State) => state.ui.successMessage)\n const noticeMessage = useSelector((state: State) => state.ui.noticeMessage)\n const errorMessage = useSelector((state: State) => state.ui.errorMessage)\n const offline = useSelector((state: State) => state.ui.offline)\n const layout = useSelector((state: State) => state.ui.layout)\n\n const clearSuccessMessage = () => ui.set({ successMessage: undefined })\n const clearErrorMessage = () => ui.set({ errorMessage: undefined })\n const reconnect = () => Controller.open(false, true)\n const css = useStyles({\n margin: layout.showOrgs && !layout.hideSidebar ? ORGANIZATION_BAR_WIDTH : spacing.sm,\n mobile: layout.mobile,\n })\n\n // only show one message at a time\n let snackbar = ''\n if (noticeMessage) snackbar = 'notice'\n if (successMessage) snackbar = 'success'\n if (errorMessage) snackbar = 'error'\n if (backendAuthenticated && !connected) snackbar = 'retry'\n\n return (\n \n \n {children}\n {offline && (\n \n window.location.reload()}\n color={offline.severity}\n variant=\"contained\"\n >\n Reload\n \n }\n onClose={() => ui.set({ offline: undefined })}\n fullWidth\n >\n {offline.title}\n {offline.message && {offline.message}}\n \n \n )}\n \n \n \n \n \n \n }\n >\n Webserver connection lost. Retrying...\n \n }\n />\n \n {errorMessage}\n \n }\n />\n ui.set({ noticeMessage: '' })}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}\n message={\n \n {noticeMessage}\n \n }\n />\n \n {successMessage}\n \n }\n />\n \n )\n}\n\nconst useStyles = makeStyles({\n snackbar: ({ margin, mobile }: { margin: number; mobile: boolean }) => ({\n marginLeft: mobile ? spacing.xs : margin,\n marginRight: mobile ? spacing.xs : margin,\n bottom: `${mobile ? 110 : 80}px !important`,\n }),\n})","import React, { useEffect } from 'react'\nimport browser from '../services/browser'\nimport useSafeArea from '../hooks/useSafeArea'\nimport useCapacitor from '../hooks/useCapacitor'\nimport { persistor } from '../store'\nimport { useLocation } from 'react-router-dom'\nimport { PersistGate } from 'redux-persist/integration/react'\nimport { selectResellerRef } from '../selectors/organizations'\nimport { useSelector, useDispatch } from 'react-redux'\nimport {\n HIDE_SIDEBAR_WIDTH,\n HIDE_TWO_PANEL_WIDTH,\n SIDEBAR_WIDTH,\n MOBILE_WIDTH,\n ORGANIZATION_BAR_WIDTH,\n REGEX_FIRST_PATH,\n} from '../constants'\nimport { State, Dispatch } from '../store'\nimport { useMediaQuery, Box } from '@mui/material'\nimport { InstallationNotice } from './InstallationNotice'\nimport { LoadingMessage } from './LoadingMessage'\nimport { ResellerLogo } from './ResellerLogo'\nimport { SidebarMenu } from './SidebarMenu'\nimport { SignInPage } from '../pages/SignInPage'\nimport { BottomMenu } from './BottomMenu'\nimport { Sidebar } from './Sidebar'\nimport { Router } from '../routers/Router'\nimport { Page } from '../pages/Page'\nimport { Logo } from '@common/brand/Logo'\n\nexport const App: React.FC = () => {\n const { insets } = useSafeArea()\n const location = useLocation()\n const hideSplashScreen = useCapacitor()\n const authInitialized = useSelector((state: State) => state.auth.initialized)\n const installed = useSelector((state: State) => state.binaries.installed)\n const signedOut = useSelector((state: State) => !state.auth.initialized || !state.auth.authenticated)\n const waitMessage = useSelector((state: State) => state.ui.waitMessage)\n const showOrgs = useSelector((state: State) => !!state.accounts.membership.length)\n const reseller = useSelector(selectResellerRef)\n const dispatch = useDispatch()\n const hideSidebar = useMediaQuery(`(max-width:${HIDE_SIDEBAR_WIDTH}px)`)\n const singlePanel = useMediaQuery(`(max-width:${HIDE_TWO_PANEL_WIDTH}px)`)\n const mobile = useMediaQuery(`(max-width:${MOBILE_WIDTH}px)`)\n const overlapHeader = hideSidebar && browser.isElectron && browser.isMac\n const sidePanelWidth = hideSidebar ? 0 : SIDEBAR_WIDTH + (showOrgs ? ORGANIZATION_BAR_WIDTH : 0)\n const isRootMenu = location.pathname.match(REGEX_FIRST_PATH)?.[0] === location.pathname\n const showBottomMenu = (mobile || browser.isMobile) && isRootMenu && hideSidebar\n\n const layout: ILayout = {\n insets,\n mobile,\n showOrgs,\n hideSidebar,\n showBottomMenu,\n singlePanel,\n sidePanelWidth,\n }\n\n useEffect(() => {\n hideSplashScreen()\n }, [])\n\n useEffect(() => {\n dispatch.ui.set({ layout })\n }, [insets, mobile, showOrgs, hideSidebar, showBottomMenu, singlePanel, sidePanelWidth])\n\n if (waitMessage)\n return (\n \n \n \n )\n\n if (!authInitialized)\n return (\n \n {reseller ? (\n } spinner />\n ) : (\n } invert spinner />\n )}\n \n )\n\n if (signedOut)\n return (\n \n \n \n )\n\n if (!installed)\n return (\n \n \n \n )\n\n return (\n \n }>\n \n {hideSidebar ? : }\n \n \n {showBottomMenu && }\n \n \n )\n}\n","import React, { Component, ErrorInfo } from 'react'\nimport { AIRBRAKE_ID, AIRBRAKE_KEY } from '../constants'\nimport { Notifier } from '@airbrake/browser'\nimport { version } from '../helpers/versionHelper'\nimport { Store } from '../store'\nimport browser from '../services/browser'\n\ntype ErrorBoundaryProps = {\n store?: Store\n children: React.ReactNode\n}\n\ntype ErrorBoundaryState = {\n hasError: boolean\n error?: Error\n info?: ErrorInfo\n userId?: string\n}\n\nexport class ErrorBoundary extends Component {\n private airbrake = new Notifier({\n projectId: AIRBRAKE_ID,\n projectKey: AIRBRAKE_KEY,\n environment: browser.environment(),\n })\n\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n componentDidCatch(error: Error, info: ErrorInfo) {\n const userId = this.props.store?.getState().user.id\n\n this.setState({ hasError: true, error, info, userId })\n this.airbrake.notify({ error, params: { info }, context: { version, userId } })\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <>\n {this.props.children}\n
\n
\n

An error occurred!

\n

\n {\n window.location.hash = ''\n window.location.reload()\n }}\n >\n Restart\n \n

\n

{this.state.userId && this.state.userId}

\n

{this.state.error && this.state.error.toString()}

\n {this.state.error && (\n <>\n

Stack trace:

\n
{this.state.error.stack}
\n \n )}\n {\n e.preventDefault()\n this.setState({ hasError: false })\n }}\n >\n +\n \n
\n
\n \n )\n }\n return this.props.children\n }\n}\n","import React from 'react'\nimport { useSelector } from 'react-redux'\nimport { selectTheme } from '../selectors/ui'\nimport { ThemeProvider, Theme, StyledEngineProvider } from '@mui/material/styles'\n\ndeclare module '@mui/styles/defaultTheme' {\n interface DefaultTheme extends Theme {}\n}\n\nexport interface Props {\n children: React.ReactNode\n}\n\nexport const Layout = ({ children }: Props) => {\n const theme = useSelector(selectTheme)\n\n return (\n \n {children}\n \n )\n}\n","import browser from './browser'\nimport {\n GOOGLE_TAG_MANAGER_DESKTOP_KEY,\n GOOGLE_TAG_MANAGER_PORTAL_KEY,\n GOOGLE_TAG_MANAGER_ANDROID_KEY,\n GOOGLE_TAG_MANAGER_IOS_KEY,\n} from '../constants'\nimport TagManager from 'react-gtm-module'\n\nconst analytics = {\n initialize() {\n const gtmId = browser.isPortal\n ? GOOGLE_TAG_MANAGER_PORTAL_KEY\n : browser.isAndroid\n ? GOOGLE_TAG_MANAGER_ANDROID_KEY\n : browser.isIOS\n ? GOOGLE_TAG_MANAGER_IOS_KEY\n : GOOGLE_TAG_MANAGER_DESKTOP_KEY\n console.log('ANALYTICS INITIALIZE')\n TagManager.initialize({ gtmId: gtmId?.trim() })\n // analytics.initializeClarity()\n },\n\n // initializeClarity() {\n // const user = store.getState().user\n // if (window.clarity) window.clarity('set', 'user', user.email)\n // },\n}\n\nexport default analytics\n","import escapeRegex from 'escape-string-regexp'\nimport { initialize } from '@common/adaptor'\nimport { findType } from './models/applicationTypes'\nimport { store } from './store'\n\nfunction getState() {\n return store.getState().backend\n}\n\nfunction getCloudData(typeId?: number) {\n return findType(store.getState().applicationTypes.all, typeId)\n}\n\ninitialize({\n getState,\n getCloudData,\n escapeRegex,\n})\n","import './polyfills'\nimport React from 'react'\nimport Controller from './services/Controller'\nimport browser from './services/browser'\nimport brand from '@common/brand/config'\nimport { App } from './components/App'\nimport { store } from './store'\nimport { ErrorBoundary } from './components/ErrorBoundary'\nimport { createRoot } from 'react-dom/client'\nimport { CssBaseline } from '@mui/material'\nimport { HashRouter } from 'react-router-dom'\nimport { Provider } from 'react-redux'\nimport { Layout } from './components/Layout'\nimport heartbeat from './services/Heartbeat'\nimport analytics from './services/analytics'\nimport './initializeCommon'\nimport './services/Controller'\n\nif (browser.environment() !== 'development') analytics.initialize()\ndocument.title = `${brand.appName} Application`\n\nconst root = createRoot(document.getElementById('root')!)\nroot.render(\n \n \n \n \n \n \n \n \n \n \n)\n\nheartbeat.init()\nController.init()\n"],"file":"assets/index-DZ0N199g.js"}