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/jC,EAAM,CAC5C,SAASgkC,GAAW,CACZ,MAAEnG,iBAAoBxB,KACtB4H,EAAWC,MAAMnZ,QAAQ/qB,CAAI,EAC/ByG,MAAQw9B,EAAWjkC,EAAO,GAG1B,CAACikC,GAAY,UAAUtd,KAAK3mB,CAAI,IAClCyG,EAAM7F,KAAKZ,EAAKc,QAAQ,YAAa,IAAI,CAAC,EAC1C2F,EAAM7F,KAAKZ,EAAKc,QAAQ,aAAc,EAAE,CAAC,GAE3C,IAAIqjC,EAAU,GACV19B,EAAMonB,OACRsW,EAAU19B,EAAM29B,KAAMtqC,GAAMmK,GAAUnK,EAAG+jC,CAAe,CAAC,EAChD79B,IACCiE,KAAUjE,EAAM69B,CAAe,GAE3C5Y,IAA4B8e,mCAAalG,CAAiBp3B,QAAO09B,mCAAQ,OAAAH,IAC5D7vB,CACXouB,QAAuDqB","names":["window","AbortSignal","timeout","duration","controller","AbortController","setTimeout","abort","signal","URL","parse","url","base","n","l","u","t","i","o","r","f","e","c","s","a","h","p","v","y","d","w","_","g","m","k","b","x","C","M","P","O","j","S","$","N","I","L","V","H","T","A","F","q","z","B","D","E","G","R","U","W","Z","Y","J","K","Q","X","nn","tn","en","rn","on","bn","gn","Cn","Sn","ln","cn","fn","an","sn","hn","vn","dn","pn","mn","yn","_n","En","xn","Rn","_extends","target","source","key","Action","PopStateEventType","createHashHistory","options","createHashLocation","globalHistory","pathname","search","hash","parsePath","createLocation","createHashHref","to","href","hashIndex","createPath","validateHashLocation","location","warning$1","getUrlBasedHistory","invariant","value","message","cond","createKey","getHistoryState","current","state","_ref","path","parsedPath","searchIndex","createClientSideURL","getLocation","createHref","validateLocation","v5Compat","action","listener","handlePop","history","push","historyState","replace","ResultType","matchRoutes","routes","locationArg","basename","stripBasename","branches","flattenRoutes","rankRouteBranches","matches","matchRouteBranch","safelyDecodeURI","parentsMeta","parentPath","flattenRoute","route","index","relativePath","meta","joinPaths","routesMeta","computeScore","_route$path","exploded","explodeOptionalSegments","segments","first","rest","isOptional","required","restExploded","result","subpath","compareIndexes","paramRe","dynamicSegmentValue","indexRouteValue","emptySegmentValue","staticSegmentValue","splatPenalty","isSplat","initialScore","score","segment","branch","matchedParams","matchedPathname","end","remainingPathname","match","matchPath","normalizePathname","pattern","matcher","paramNames","compilePath","pathnameBase","captureGroups","memo","paramName","splatValue","safelyDecodeURIComponent","caseSensitive","warning","regexpSource","error","startIndex","nextChar","resolvePath","fromPathname","toPathname","resolvePathname","normalizeSearch","normalizeHash","getInvalidPathError","char","field","dest","getPathContributingMatches","resolveTo","toArg","routePathnames","locationPathname","isPathRelative","isEmptyPath","from","routePathnameIndex","toSegments","hasExplicitTrailingSlash","hasCurrentTrailingSlash","paths","ErrorResponse","status","statusText","data","internal","isRouteErrorResponse","validMutationMethodsArr","validMutationMethods","validRequestMethodsArr","validRequestMethods","isBrowser","isPolyfill","is","useState","useEffect","useLayoutEffect","useDebugValue","React","useSyncExternalStore$2","subscribe","getSnapshot","getServerSnapshot","inst","forceUpdate","checkIfSnapshotChanged","latestGetSnapshot","prevValue","nextValue","useSyncExternalStore$1","canUseDOM","isServerEnvironment","shim","useSyncExternalStore","module","DataRouterContext","React.createContext","DataRouterStateContext","NavigationContext","LocationContext","RouteContext","RouteErrorContext","useInRouterContext","React.useContext","useLocation","useNavigate","navigator","routePathnamesJson","UNSAFE_getPathContributingMatches","activeRef","React.useRef","React.useEffect","React.useCallback","useParams","routeMatch","useRoutes","dataRouterStateContext","parentMatches","parentParams","parentPathname","parentPathnameBase","parentRoute","locationFromContext","_parsedLocationArg$pa","parsedLocationArg","renderedMatches","_renderMatches","React.createElement","DefaultErrorElement","useRouteError","stack","lightgrey","preStyles","codeStyles","React.Fragment","RenderErrorBoundary","React.Component","props","errorInfo","RenderedRoute","routeContext","children","dataRouterContext","dataRouterState","errors","errorIndex","outlet","errorElement","getChildren","DataRouterHook","DataRouterStateHook","useDataRouterState","hookName","useRouteContext","useCurrentRouteId","thisRoute","_state$errors","routeId","Route","_props","Router","_ref4","basenameProp","locationProp","navigationType","staticProp","navigationContext","React.useMemo","trailingPathname","Routes","_ref5","createRoutesFromChildren","AwaitRenderStatus","neverSettledPromise","React.Children","element","React.isValidElement","treePath","createSearchParams","init","getSearchParamsForLocation","locationSearch","defaultSearchParams","searchParams","HashRouter","_ref2","historyRef","setState","React.useState","React.useLayoutEffect","useSearchParams","defaultInit","defaultSearchParamsRef","navigate","setSearchParams","nextInit","navigateOptions","newSearchParams","isObject","proxyStateMap","refSet","buildProxyFunction","objectIs","newProxy","handler","canProxy","defaultHandlePromise","promise","snapCache","createSnapshot","version","handlePromise","cache","snap","markToTrack","enumerable","desc","target2","ensureVersion","proxyCache","versionHolder","proxyFunction","initialObject","found","listeners","notifyUpdate","op","nextVersion","checkVersion","nextCheckVersion","propProxyStates","propProxyState","propVersion","createPropListener","prop","newOp","addPropListener","define_import_meta_env_default","remove","removePropListener","_a","entry","addListener","prevRemove","baseObject","proxyObject","deleted","receiver","hasPrevValue","getUntracked","childProxyState","proxyState","defaultProxyFunction","proxy","callback","notifyInSync","ops","isListenerActive","removeListener","snapshot","require$$0","useSyncExternalStoreShim_production_min","shimModule","use","ReactExports","useSyncExternalStoreExports","useAffectedDebugValue","affected","pathList","useRef","affectedToPathList","targetCache","useSnapshot","lastSnapshot","lastAffected","inRender","currSnapshot","useCallback","unsub","nextSnapshot","isChanged","currAffected","useMemo","createProxy","fixProto","prototype","setPrototypeOf","fixStack","captureStackTrace","__extends","_extendStatics","__","CustomError","_super","_newTarget","_this","ws","WebSocket$1","createDeferred","resolve","reject","args","onHandler","comEvents","unconsumedDeferred","unHandle","deferred","abortSignal","finished","onAbort","offListener","lastEvent","thrownError","extendStatics","__assign","__rest","__decorate","decorators","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","__awaiter","thisArg","_arguments","generator","adopt","fulfilled","step","rejected","__generator","body","verb","__createBinding","k2","__exportStar","__values","__read","ar","__spread","__spreadArrays","il","jl","__spreadArray","pack","__await","__asyncGenerator","resume","settle","fulfill","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__setModuleDefault","__importStar","mod","__importDefault","__classPrivateFieldGet","kind","__classPrivateFieldSet","__classPrivateFieldIn","lowerCase","str","DEFAULT_SPLIT_REGEXP","DEFAULT_STRIP_REGEXP","noCase","input","splitRegexp","_b","stripRegexp","_c","transform","_d","delimiter","start","re","pascalCaseTransform","firstChar","lowerChars","pascalCase","camelCaseTransform","camelCase","dotCase","snakeCase","MastoUnexpectedError","MastoDeserializeError","contentType","MastoHttpError","errorOptions","MastoTimeoutError","MastoWebSocketError","sleep","ms","isRecord","noop","ExponentialBackoffError","attempts","ExponentialBackoff","createPromiseWithResolvers","res","rej","parseLinkHeader","linkHeader","links","link","PaginatorHttp","http","nextPath","nextParams","direction","response","nextUrl","onfulfilled","onrejected","parsed","HttpActionDispatcher","hook","waitForOpen","WebSocket","handleError","handleClose","handleOpen","waitForClose","WebSocketConnectorImpl","logger","promiseWithResolvers","_e","_f","ctor","toAsyncIterable","e_1","events","events_1","events_1_1","event","e_1_1","WebSocketSubscription","connector","serializer","stream","params","messages","_g","messages_1","messages_1_1","extra","rawEvent","payload","WebSocketActionDispatcher","createActionProxy","actionDispatcher","context","applicable","get","apply","SPECIAL_PROPERTIES","property","_1","_2","isHttpActionType","actionType","toHttpActionType","inferEncoding","waitForMediaAttachment","id","media","processing","HttpActionDispatcherHookMastodon","mediaTimeout","type","encoding","mergeAbortSignals","signals","abortController","mergeHeadersInit","head","tail","headers","HttpConfigImpl","override","requestInit","headersInit","WebSocketConfigImpl","protocols","BaseHttp","getEncoding","HttpNativeImpl","config","request","text","method","errorDescription","details","additionalProperties","LoggerConsoleImpl","level","LOG_TYPES","LogLevel","createLogger","ObjectFlattener","keyMapper","flatten","object","parent","flattenForFormData","flattenForRailsQueryString","_transformKeys","transformKeys","SerializerNativeImpl","rawData","formData","createRestAPIClient","createStreamingAPIClient","getAccount","accounts","store","local","getJSON","find","info","getAccountByAccessToken","accessToken","getAccountByInstance","instance","instanceURL","standaloneMQ","matchMedia","getCurrentAccountID","session","setCurrentAccountID","set","getCurrentAccount","__IGNORE_GET_ACCOUNT_ERROR__","currentAccount","account","getCurrentAccountNS","saveAccount","acc","updateAccount","accountInfo","displayName","currentInstance","getCurrentInstance","instances","console","getInstanceConfiguration","configuration","maxMediaAttachments","maxTootChars","pleroma","pollLimits","statuses","polls","maxCharactersPerOption","maxExpiration","getCurrentInstanceConfiguration","localStorage","getItem","JSON","setJSON","warn","sessionStorage","setItem","del","DEFAULT_INSTANCE","apis","accountApis","__ACCOUNT_APIS__","currentAccountApi","initClient","test","toLowerCase","client","masto","initInstance","uri","streamingApi","urls","domain","streaming","streamClient","implementation","initAccount","vapidKey","mastoAccount","initPreferences","preferences","accountID","authenticated","instanceAccount","getOwnPropertyNames","getOwnPropertySymbols","hasOwnProperty","combineComparators","comparatorA","comparatorB","createIsCircular","areItemsEqual","cachedA","cachedB","getStrictProperties","hasOwn","sameValueZeroEqual","OWNER","getOwnPropertyDescriptor","keys","areArraysEqual","areDatesEqual","areMapsEqual","matchedIndices","aIterable","aResult","bResult","bIterable","hasMatch","matchIndex","aKey","aValue","bKey","bValue","areObjectsEqual","properties","areObjectsEqualStrict","descriptorA","descriptorB","arePrimitiveWrappersEqual","areRegExpsEqual","areSetsEqual","areTypedArraysEqual","ARGUMENTS_TAG","BOOLEAN_TAG","DATE_TAG","MAP_TAG","NUMBER_TAG","OBJECT_TAG","REG_EXP_TAG","SET_TAG","STRING_TAG","isArray","isTypedArray","assign","getTag","createEqualityComparator","constructor","tag","createEqualityComparatorConfig","circular","createCustomConfig","strict","areArraysEqual$1","areMapsEqual$1","areObjectsEqual$1","areSetsEqual$1","createInternalEqualityComparator","compare","_indexOrKeyA","_indexOrKeyB","_parentA","_parentB","createIsEqual","comparator","createState","equals","deepEqual","createCustomEqual","strictDeepEqual","circularDeepEqual","strictCircularDeepEqual","shallowEqual","strictShallowEqual","circularShallowEqual","strictCircularShallowEqual","createCustomInternalComparator","subscribeKey","DEVTOOLS","DUMMY_SYMBOL","isMastodonLinkMaybe","global","factory","this","DEFAULT_OPTIONS_KEYS","slice","cloneArray","arrayLike","length","getCustomOptions","customOptions","isMemoized","isSameValueZero","object1","object2","mergeOptions","existingOptions","newOptions","Cache","isMatchingKeyFunction","keyToMatch","isMatchingKey","maxSize","keysLength","isEqual","keyLength","existingKey","argIndex","startingIndex","values","currentLength","memoized","onCacheChange","onCacheHit","firstKey","firstValue","keyIndex","createMemoizedFunction","isPromise","onCacheAdd","transformKey","normalizedOptions","canTransformKey","shouldCloneArguments","shouldUpdateOnAdd","shouldUpdateOnChange","shouldUpdateOnHit","newValue","newKey","exports","HAS_WEAK_MAP_SUPPORT","isPlainObject","isPromiseLike","isReactElement","getNewCacheFallback","entries","getNewCache","canUseWeakMap","createCircularEqualCreator","_comparator","indexOrKeyA","indexOrKeyB","parentA","parentB","isCacheableA","isCacheableB","isValueEqual","matchedIndices_1","indexA_1","hasMatch_1","matchIndexB_1","keysA","reactElementA","reactElementB","matchedIndices_2","hasMatch_2","matchIndex_1","HAS_MAP_SUPPORT","HAS_SET_SUPPORT","valueOf","createComparator","aShape","bShape","require$$1","memoize","fastEquals","_objectWithoutPropertiesLoose","excluded","sourceKeys","DEFAULT_OPTIONS","combine","_len","functions","_key","compose","_len2","_key2","findExpirationIndex","expirations","createFindKeyIndex","areKeysEqual","cacheKey","keysIndex","originalOptions","isMoized","setName","originalFunctionName","profileName","name","clearExpiration","shouldRemove","expirationIndex","createTimeout","expirationMethod","maxAge","timeoutId","createOnCacheAddSetExpiration","moizedOptions","moized","findKeyIndex","createOnCacheHitResetExpiration","getMaxAgeOptions","statsCache","hasWarningDisplayed","clearStats","collectStats","isCollectingStats","createOnCacheAddIncrementCalls","createOnCacheHitIncrementCallsAndHits","profiles","getDefaultProfileName","getUsagePercentage","calls","hits","getStats","profile","completeStats","completeProfiles","computedProfiles","getStatsOptions","ALWAYS_SKIPPED_PROPERTIES","copyStaticProperties","originalFn","newFn","skippedProperties","descriptor","addInstanceMethods","_moized$_microMemoize","_microMemoizeOptions","cutoff","addInstanceProperties","moizeOptions","originalFunction","microMemoizeOptions","currentCache","createMoizeInstance","REACT_ELEMENT_TYPE","createMoizedComponent","moizer","reactMoizer","Moized","updater","createGetInitialArgs","size","clone","getCutoff","array","createDefaultReplacer","thisCutoff","valueCutoff","getStringifiedArgument","arg","typeOfArg","defaultArgumentSerializer","getSerializerFunction","getIsSerializedKeyEqual","createOnCacheOperation","_cacheIgnored","_microMemoizeOptionsIgnored","getIsEqual","getIsMatchingKey","getTransformKey","createRefreshableMoized","updateCacheForKey","refreshableMoized","_excluded","moize","passedOptions","moizeable","mergedOptions","curriedFn","curriedOptions","_mergedOptions","coalescedOptions","maxAgeOptions","statsOptions","argMatcher","keyMatcher","expireOptions","onExpire","updateExpire","maxArgs","transformArgs","_moize","mem","opts","isDeepEqual","pmem","rateLimit","interval","queue","isRunning","executeNext","shift","callFn","AbortError","pThrottle","limit","onDelay","currentTick","activeCount","windowedDelay","now","strictTicks","strictDelay","nextExecutionTime","getDelay","function_","throttled","arguments_","execute","delay","throttle","STATUS_ID_REGEXES","getStatusID","statusMatchID","denylistDomains","failedUnfurls","_unfurlMastodonLink","snapStates","states","RegExp","unfurledLinks","Promise","debug","remoteInstanceFetch","theURL","urlAfterHash","urlObj","hostname","masto2","mastoSearchFetch","results","then","theStatuses","handleFulfill","selfURL","instance2","saveStatus","handleCatch","finalPromise","unfurlMastodonLink","appVersion","prevLocation","currentLocation","statusThreadNumber","home","homeNew","homeLast","homeLastFetchTime","notifications","notificationsLast","notificationsNew","notificationsShowNew","notificationsLastFetchTime","reloadStatusPage","reloadGenericAccounts","counter","spoilers","spoilersMedia","scrollPositions","statusQuotes","statusFollowedTags","statusReply","routeNotification","composerState","showCompose","showSettings","showAccount","showAccounts","showDrafts","showMediaModal","showShortcutsSettings","showKeyboardShortcutsHelp","showGenericAccounts","showMediaAlt","showEmbedModal","showReportModal","shortcuts","settings","autoRefresh","shortcutsViewMode","shortcutsColumnsMode","boostsCarousel","contentTranslation","contentTranslationTargetLanguage","contentTranslationHideLanguages","contentTranslationAutoInline","shortcutSettingsCloudImportExport","mediaAltGenerator","composerGIFPicker","cloakMode","states$1","initStates","changes","join","statusKey","getStatus","statusID","skipThreading","skipUnfurling","oldStatus","_pinned","srKey","sKey","threadifyStatus","unfurlStatus","_threadifyStatus","propInstance","api","traverse","fetchIndex","inReplyToAccountId","inReplyToId","prevStatus","fetchStatus","fauxDiv","content","document","splice","Loader","abrupt","hidden","_jsx","class","shouldPolyfill_1","shouldPolyfill_2","shouldPolyfill","supportsIntlSegmenter","importIntlSegmenter","__vitePreload","catch","importCompose","preload","ComposeSuspense","Compose","setCompose","component","PHANPY_CLIENT_NAME","CLIENT_NAME","import","useTitle","title","setTitle","hasPaths","Array","matched","some"],"ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,27,28,29,31,32,33,37,41],"sources":["../../src/polyfills.js","../../node_modules/preact/dist/preact.module.js","../../node_modules/preact/hooks/dist/hooks.module.js","../../node_modules/preact/compat/dist/compat.module.js","../../node_modules/@remix-run/router/dist/router.js","../../node_modules/react-router/dist/index.js","../../node_modules/react-router-dom/dist/index.js","../../node_modules/proxy-compare/dist/index.modern.js","../../node_modules/valtio/esm/vanilla.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/valtio/esm/react.mjs","../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js","../../node_modules/ts-custom-error/dist/custom-error.mjs","../../node_modules/isomorphic-ws/browser.js","../../node_modules/events-to-async/module/events-to-async.js","../../node_modules/tslib/tslib.es6.js","../../node_modules/lower-case/dist.es2015/index.js","../../node_modules/no-case/dist.es2015/index.js","../../node_modules/pascal-case/dist.es2015/index.js","../../node_modules/camel-case/dist.es2015/index.js","../../node_modules/dot-case/dist.es2015/index.js","../../node_modules/snake-case/dist.es2015/index.js","../../node_modules/masto/dist/index.js","../../src/utils/store-utils.js","../../src/utils/store.js","../../src/utils/api.js","../../node_modules/fast-equals/dist/esm/index.mjs","../../node_modules/valtio/esm/vanilla/utils.mjs","../../node_modules/valtio/esm/react/utils.mjs","../../src/utils/isMastodonLinkMaybe.jsx","../../node_modules/micro-memoize/dist/micro-memoize.js","../../node_modules/moize/node_modules/fast-equals/dist/fast-equals.js","../../node_modules/moize/dist/moize.js","../../src/utils/mem.js","../../src/utils/pmem.js","../../src/utils/ratelimit.js","../../node_modules/p-throttle/index.js","../../src/utils/unfurl-link.jsx","../../src/utils/states.js","../../src/components/loader.jsx","../../node_modules/@formatjs/intl-segmenter/should-polyfill.js","../../src/components/compose-suspense.jsx","../../src/utils/useTitle.js"],"sourcesContent":["// AbortSignal.timeout polyfill\n// Temporary fix from https://github.com/mo/abortcontroller-polyfill/issues/73#issuecomment-1541180943\n// Incorrect implementation, but should be good enough for now\nif ('AbortSignal' in window) {\n AbortSignal.timeout =\n AbortSignal.timeout ||\n ((duration) => {\n const controller = new AbortController();\n setTimeout(() => controller.abort(), duration);\n return controller.signal;\n });\n}\n\n// URL.parse() polyfill\nif ('URL' in window && typeof URL.parse !== 'function') {\n URL.parse = function (url, base) {\n if (!url) return null;\n try {\n return base ? new URL(url, base) : new URL(url);\n } catch (e) {\n return null;\n }\n };\n}\n","var n,l,u,t,i,o,r,f,e,c,s,a,h={},p=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){var l=n.parentNode;l&&l.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)\"key\"==r?i=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function k(n){return n.children}function b(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return\"function\"==typeof n.type?x(n):null}function C(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,u,t,o,r,e,c,s;for(i.sort(f);n=i.shift();)n.__d&&(u=i.length,o=void 0,e=(r=(t=n).__v).__e,c=[],s=[],t.__P&&((o=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),O(t.__P,o,r,t.__n,t.__P.namespaceURI,32&r.__u?[e]:null,c,null==e?x(r):e,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,j(c,o,s),o.__e!=e&&C(o)),i.length>u&&i.sort(f));P.__r=0}function S(n,l,u,t,i,o,r,f,e,c,s){var a,v,y,d,w,_=t&&t.__k||p,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a<g;a++)null!=(y=u.__k[a])&&\"boolean\"!=typeof y&&\"function\"!=typeof y&&(v=-1===y.__i?h:_[y.__i]||h,y.__i=a,O(n,y,v,i,o,r,f,e,c,s),d=y.__e,y.ref&&v.ref!=y.ref&&(v.ref&&N(v.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),65536&y.__u||v.__k===y.__k?(e&&!e.isConnected&&(e=x(v)),e=I(y,e,n)):\"function\"==typeof y.type&&void 0!==y.__d?e=y.__d:d&&(e=d.nextSibling),y.__d=void 0,y.__u&=-196609);u.__d=e,u.__e=w}function $(n,l,u){var t,i,o,r,f,e=l.length,c=u.length,s=c,a=0;for(n.__k=[],t=0;t<e;t++)r=t+a,null!=(i=n.__k[t]=null==(i=l[t])||\"boolean\"==typeof i||\"function\"==typeof i?null:\"string\"==typeof i||\"number\"==typeof i||\"bigint\"==typeof i||i.constructor==String?g(null,i,null,null,null):y(i)?g(k,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,f=L(i,u,r,s),i.__i=f,o=null,-1!==f&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,\"function\"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f===r+1?a++:f>r?s>e-r?a+=f-r:a--:f<r?f==r-1&&(a=f-r):a=0,f!==t+a&&(i.__u|=65536))):(o=u[r])&&null==o.key&&o.__e&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=x(o)),V(o,o,!1),u[r]=null,s--);if(s)for(t=0;t<c;t++)null!=(o=u[t])&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=x(o)),V(o,o))}function I(n,l,u){var t,i;if(\"function\"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=I(t[i],l,u));return l}n.__e!=l&&(u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function H(n,l){return l=l||[],null==n||\"boolean\"==typeof n||(y(n)?n.some(function(n){H(n,l)}):l.push(n)),l}function L(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type&&0==(131072&e.__u))return u;if(t>(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f<l.length){if((e=l[f])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return f;f++}}return-1}function T(n,l,u){\"-\"===l[0]?n.setProperty(l,null==u?\"\":u):n[l]=null==u?\"\":\"number\"!=typeof u||v.test(l)?u:u+\"px\"}function A(n,l,u,t,i){var o;n:if(\"style\"===l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof t&&(n.style.cssText=t=\"\"),t)for(l in t)u&&l in u||T(n.style,l,\"\");if(u)for(l in u)t&&u[l]===t[l]||T(n.style,l,u[l])}else if(\"o\"===l[0]&&\"n\"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/i,\"$1\")),l=l.toLowerCase()in n||\"onFocusOut\"===l||\"onFocusIn\"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=e,n.addEventListener(l,o?s:c,o)):n.removeEventListener(l,o?s:c,o);else{if(\"http://www.w3.org/2000/svg\"==i)l=l.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(\"width\"!=l&&\"height\"!=l&&\"href\"!=l&&\"list\"!=l&&\"form\"!=l&&\"tabIndex\"!=l&&\"download\"!=l&&\"rowSpan\"!=l&&\"colSpan\"!=l&&\"role\"!=l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null==u||!1===u&&\"-\"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=e++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function O(n,u,t,i,o,r,f,e,c,s){var a,h,p,v,w,_,g,m,x,C,M,P,$,I,H,L=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[e=u.__e=t.__e]),(a=l.__b)&&a(u);n:if(\"function\"==typeof L)try{if(m=u.props,x=(a=L.contextType)&&i[a.__c],C=a?x?x.props.value:a.__:i,t.__c?g=(h=u.__c=t.__c).__=h.__E:(\"prototype\"in L&&L.prototype.render?u.__c=h=new L(m,C):(u.__c=h=new b(m,C),h.constructor=L,h.render=q),x&&x.sub(h),h.props=m,h.state||(h.state={}),h.context=C,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=L.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,L.getDerivedStateFromProps(m,h.__s))),v=h.props,w=h.state,h.__v=u,p)null==L.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==L.getDerivedStateFromProps&&m!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,C),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,C)||u.__v===t.__v)){for(u.__v!==t.__v&&(h.props=m,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u)}),M=0;M<h._sb.length;M++)h.__h.push(h._sb[M]);h._sb=[],h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,C),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,w,_)})}if(h.context=C,h.props=m,h.__P=n,h.__e=!1,P=l.__r,$=0,\"prototype\"in L&&L.prototype.render){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),I=0;I<h._sb.length;I++)h.__h.push(h._sb[I]);h._sb=[]}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++$<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(_=h.getSnapshotBeforeUpdate(v,w)),S(n,y(H=null!=a&&a.type===k&&null==a.key?a.props.children:a)?H:[H],u,t,i,o,r,f,e,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&f.push(h),g&&(h.__E=h.__=null)}catch(n){u.__v=null,c||null!=r?(u.__e=e,u.__u|=c?160:32,r[r.indexOf(e)]=null):(u.__e=t.__e,u.__k=t.__k),l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=z(t.__e,u,t,i,o,r,f,c,s);(a=l.diffed)&&a(u)}function j(n,u,t){u.__d=void 0;for(var i=0;i<t.length;i++)N(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function z(l,u,t,i,o,r,f,e,c){var s,a,p,v,d,_,g,m=t.props,k=u.props,b=u.type;if(\"svg\"===b?o=\"http://www.w3.org/2000/svg\":\"math\"===b?o=\"http://www.w3.org/1998/Math/MathML\":o||(o=\"http://www.w3.org/1999/xhtml\"),null!=r)for(s=0;s<r.length;s++)if((d=r[s])&&\"setAttribute\"in d==!!b&&(b?d.localName===b:3===d.nodeType)){l=d,r[s]=null;break}if(null==l){if(null===b)return document.createTextNode(k);l=document.createElementNS(o,b,k.is&&k),r=null,e=!1}if(null===b)m===k||e&&l.data===k||(l.data=k);else{if(r=r&&n.call(l.childNodes),m=t.props||h,!e&&null!=r)for(m={},s=0;s<l.attributes.length;s++)m[(d=l.attributes[s]).name]=d.value;for(s in m)if(d=m[s],\"children\"==s);else if(\"dangerouslySetInnerHTML\"==s)p=d;else if(\"key\"!==s&&!(s in k)){if(\"value\"==s&&\"defaultValue\"in k||\"checked\"==s&&\"defaultChecked\"in k)continue;A(l,s,null,d,o)}for(s in k)d=k[s],\"children\"==s?v=d:\"dangerouslySetInnerHTML\"==s?a=d:\"value\"==s?_=d:\"checked\"==s?g=d:\"key\"===s||e&&\"function\"!=typeof d||m[s]===d||A(l,s,d,m[s],o);if(a)e||p&&(a.__html===p.__html||a.__html===l.innerHTML)||(l.innerHTML=a.__html),u.__k=[];else if(p&&(l.innerHTML=\"\"),S(l,y(v)?v:[v],u,t,i,\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":o,r,f,r?r[0]:t.__k&&x(t,0),e,c),null!=r)for(s=r.length;s--;)null!=r[s]&&w(r[s]);e||(s=\"value\",void 0!==_&&(_!==l[s]||\"progress\"===b&&!_||\"option\"===b&&_!==m[s])&&A(l,s,_,m[s],o),s=\"checked\",void 0!==g&&g!==l[s]&&A(l,s,g,m[s],o))}return l}function N(n,u,t){try{\"function\"==typeof n?n(u):n.current=u}catch(n){l.__e(n,t)}}function V(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||N(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&V(i[o],u,t||\"function\"!=typeof n.type);t||null==n.__e||w(n.__e),n.__c=n.__=n.__e=n.__d=void 0}function q(n,l,u){return this.constructor(n,u)}function B(u,t,i){var o,r,f,e;l.__&&l.__(u,t),r=(o=\"function\"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],O(t,u=(!o&&i||t).__k=_(k,null,[u]),r||h,h,t.namespaceURI,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),j(f,u,e)}function D(n,l){B(n,l,D)}function E(l,u,t){var i,o,r,f,e=d({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)\"key\"==r?i=u[r]:\"ref\"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l=\"__cC\"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=p.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},b.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),\"function\"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},b.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},b.prototype.render=k,i=[],r=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,e=0,c=F(!1),s=F(!0),a=0;export{b as Component,k as Fragment,E as cloneElement,G as createContext,_ as createElement,m as createRef,_ as h,D as hydrate,t as isValidElement,l as options,B as render,H as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=[],e=n,a=e.__b,v=e.__r,l=e.diffed,m=e.__c,s=e.unmount,d=e.__;function h(n,t){e.__h&&e.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({__V:c}),u.__[n]}function p(n){return o=1,y(D,n)}function y(n,u,i){var o=h(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function _(n,u){var i=h(t++,3);!e.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function A(n,u){var i=h(t++,4);!e.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function F(n){return o=5,q(function(){return{current:n}},[])}function T(n,t,r){o=6,A(function(){return\"function\"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function q(n,r){var u=h(t++,7);return C(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function x(n,t){return o=8,q(function(){return n},t)}function P(n){var u=r.context[n.__c],i=h(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function V(n,t){e.useDebugValue&&e.useDebugValue(t?t(n):n)}function b(n){var u=h(t++,10),i=p();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=h(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function j(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],e.__e(t,n.__v)}}e.__b=function(n){r=null,a&&a(n)},e.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),d&&d(n,t)},e.__r=function(n){v&&v(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],t=0)),u=r},e.diffed=function(n){l&&l(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===e.requestAnimationFrame||((i=e.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c})),u=r=null},e.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],e.__e(r,n.__v)}}),m&&m(n,t)},e.unmount=function(n){s&&s(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&e.__e(t,r.__v))};var k=\"function\"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return\"function\"==typeof t?t(n):t}export{x as useCallback,P as useContext,V as useDebugValue,_ as useEffect,b as useErrorBoundary,g as useId,T as useImperativeHandle,A as useLayoutEffect,q as useMemo,y as useReducer,F as useRef,p as useState};\n//# sourceMappingURL=hooks.module.js.map\n","import{Component as n,createElement as t,options as e,toChildArray as r,Fragment as u,render as o,hydrate as i,createContext as l,createRef as c,cloneElement as f}from\"preact\";export{Component,Fragment,createContext,createElement,createRef}from\"preact\";import{useCallback as a,useContext as s,useDebugValue as h,useEffect as v,useId as d,useImperativeHandle as p,useLayoutEffect as m,useMemo as y,useReducer as _,useRef as b,useState as S}from\"preact/hooks\";export*from\"preact/hooks\";function g(n,t){for(var e in t)n[e]=t[e];return n}function E(n,t){for(var e in n)if(\"__source\"!==e&&!(e in t))return!0;for(var r in t)if(\"__source\"!==r&&n[r]!==t[r])return!0;return!1}function C(n,t){this.props=n,this.context=t}function x(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return!r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:E(this.props,n)}function u(e){return this.shouldComponentUpdate=r,t(n,e)}return u.displayName=\"Memo(\"+(n.displayName||n.name)+\")\",u.prototype.isReactComponent=!0,u.__f=!0,u}(C.prototype=new n).isPureReactComponent=!0,C.prototype.shouldComponentUpdate=function(n,t){return E(this.props,n)||E(this.state,t)};var R=e.__b;e.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n)};var w=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.forward_ref\")||3911;function k(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=w,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName=\"ForwardRef(\"+(n.displayName||n.name)+\")\",t}var I=function(n,t){return null==n?null:r(r(n).map(t))},N={map:I,forEach:I,count:function(n){return n?r(n).length:0},only:function(n){var t=r(n);if(1!==t.length)throw\"Children.only\";return t[0]},toArray:r},M=e.__e;e.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);M(n,t,e,r)};var T=e.unmount;function A(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){\"function\"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return A(n,t,e)})),n}function D(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return D(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n}function L(){this.__u=0,this.t=null,this.__b=null}function O(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function F(n){var e,r,u;function o(o){if(e||(e=n()).then(function(n){r=n.default||n},function(n){u=n}),u)throw u;if(!r)throw e;return t(r,o)}return o.displayName=\"Lazy\",o.__f=!0,o}function U(){this.u=null,this.o=null}e.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),T&&T(n)},(L.prototype=new n).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=O(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l())};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=D(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},L.prototype.componentWillUnmount=function(){this.t=[]},L.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement(\"div\"),o=this.__v.__k[0].__c;this.__v.__k[0]=A(this.__b,r,o.__O=o.__P)}this.__b=null}var i=e.__a&&t(u,null,n.fallback);return i&&(i.__u&=-33),[t(u,null,e.__a?null:n.children),i]};var V=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&(\"t\"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2]}};function W(n){return this.getChildContext=function(){return n.context},n.children}function P(n){var e=this,r=n.i;e.componentWillUnmount=function(){o(null,e.l),e.l=null,e.i=null},e.i&&e.i!==r&&e.componentWillUnmount(),e.l||(e.i=r,e.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(n){this.childNodes.push(n),e.i.appendChild(n)},insertBefore:function(n,t){this.childNodes.push(n),e.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n)}}),o(t(W,{context:e.context},n.__v),e.l)}function j(n,e){var r=t(P,{__v:n,i:e});return r.containerInfo=e,r}(U.prototype=new n).__a=function(n){var t=this,e=O(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),V(t,n,r)):u()};e?e(o):o()}},U.prototype.render=function(n){this.u=null,this.o=new Map;var t=r(n.children);n.revealOrder&&\"b\"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},U.prototype.componentDidUpdate=U.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){V(n,e,t)})};var z=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.element\")||60103,B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,H=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Z=/[A-Z0-9]/g,Y=\"undefined\"!=typeof document,$=function(n){return(\"undefined\"!=typeof Symbol&&\"symbol\"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};function q(n,t,e){return null==t.__k&&(t.textContent=\"\"),o(n,t),\"function\"==typeof e&&e(),n?n.__c:null}function G(n,t,e){return i(n,t),\"function\"==typeof e&&e(),n?n.__c:null}n.prototype.isReactComponent={},[\"componentWillMount\",\"componentWillReceiveProps\",\"componentWillUpdate\"].forEach(function(t){Object.defineProperty(n.prototype,t,{configurable:!0,get:function(){return this[\"UNSAFE_\"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var J=e.event;function K(){}function Q(){return this.cancelBubble}function X(){return this.defaultPrevented}e.event=function(n){return J&&(n=J(n)),n.persist=K,n.isPropagationStopped=Q,n.isDefaultPrevented=X,n.nativeEvent=n};var nn,tn={enumerable:!1,configurable:!0,get:function(){return this.class}},en=e.vnode;e.vnode=function(n){\"string\"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!(\"value\"===o&&\"defaultValue\"in t&&null==i||Y&&\"children\"===o&&\"noscript\"===e||\"class\"===o||\"className\"===o)){var l=o.toLowerCase();\"defaultValue\"===o&&\"value\"in t&&null==t.value?o=\"value\":\"download\"===o&&!0===i?i=\"\":\"translate\"===l&&\"no\"===i?i=!1:\"ondoubleclick\"===l?o=\"ondblclick\":\"onchange\"!==l||\"input\"!==e&&\"textarea\"!==e||$(t.type)?\"onfocus\"===l?o=\"onfocusin\":\"onblur\"===l?o=\"onfocusout\":H.test(o)?o=l:-1===e.indexOf(\"-\")&&B.test(o)?o=o.replace(Z,\"-$&\").toLowerCase():null===i&&(i=void 0):l=o=\"oninput\",\"oninput\"===l&&u[o=l]&&(o=\"oninputCapture\"),u[o]=i}}\"select\"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=r(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),\"select\"==e&&null!=u.defaultValue&&(u.value=r(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,\"className\",tn)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u}(n),n.$$typeof=z,en&&en(n)};var rn=e.__r;e.__r=function(n){rn&&rn(n),nn=n.__c};var un=e.diffed;e.diffed=function(n){un&&un(n);var t=n.props,e=n.__e;null!=e&&\"textarea\"===n.type&&\"value\"in t&&t.value!==e.value&&(e.value=null==t.value?\"\":t.value),nn=null};var on={ReactCurrentDispatcher:{current:{readContext:function(n){return nn.__n[n.__c].props.value},useCallback:a,useContext:s,useDebugValue:h,useDeferredValue:bn,useEffect:v,useId:d,useImperativeHandle:p,useInsertionEffect:gn,useLayoutEffect:m,useMemo:y,useReducer:_,useRef:b,useState:S,useSyncExternalStore:Cn,useTransition:Sn}}},ln=\"17.0.2\";function cn(n){return t.bind(null,n)}function fn(n){return!!n&&n.$$typeof===z}function an(n){return fn(n)&&n.type===u}function sn(n){return!!n&&!!n.displayName&&(\"string\"==typeof n.displayName||n.displayName instanceof String)&&n.displayName.startsWith(\"Memo(\")}function hn(n){return fn(n)?f.apply(null,arguments):n}function vn(n){return!!n.__k&&(o(null,n),!0)}function dn(n){return n&&(n.base||1===n.nodeType&&n)||null}var pn=function(n,t){return n(t)},mn=function(n,t){return n(t)},yn=u;function _n(n){n()}function bn(n){return n}function Sn(){return[!1,_n]}var gn=m,En=fn;function Cn(n,t){var e=t(),r=S({h:{__:e,v:t}}),u=r[0].h,o=r[1];return m(function(){u.__=e,u.v=t,xn(u)&&o({h:u})},[n,e,t]),v(function(){return xn(u)&&o({h:u}),n(function(){xn(u)&&o({h:u})})},[n]),e}function xn(n){var t,e,r=n.v,u=n.__;try{var o=r();return!((t=u)===(e=o)&&(0!==t||1/t==1/e)||t!=t&&e!=e)}catch(n){return!0}}var Rn={useState:S,useId:d,useReducer:_,useEffect:v,useLayoutEffect:m,useInsertionEffect:gn,useTransition:Sn,useDeferredValue:bn,useSyncExternalStore:Cn,startTransition:_n,useRef:b,useImperativeHandle:p,useMemo:y,useCallback:a,useContext:s,useDebugValue:h,version:\"17.0.2\",Children:N,render:q,hydrate:G,unmountComponentAtNode:vn,createPortal:j,createElement:t,createContext:l,createFactory:cn,cloneElement:hn,createRef:c,Fragment:u,isValidElement:fn,isElement:En,isFragment:an,isMemo:sn,findDOMNode:dn,Component:n,PureComponent:C,memo:x,forwardRef:k,flushSync:mn,unstable_batchedUpdates:pn,StrictMode:yn,Suspense:L,SuspenseList:U,lazy:F,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:on};export{N as Children,C as PureComponent,yn as StrictMode,L as Suspense,U as SuspenseList,on as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hn as cloneElement,cn as createFactory,j as createPortal,Rn as default,dn as findDOMNode,mn as flushSync,k as forwardRef,G as hydrate,En as isElement,an as isFragment,sn as isMemo,fn as isValidElement,F as lazy,x as memo,q as render,_n as startTransition,vn as unmountComponentAtNode,pn as unstable_batchedUpdates,bn as useDeferredValue,gn as useInsertionEffect,Cn as useSyncExternalStore,Sn as useTransition,ln as version};\n//# sourceMappingURL=compat.module.js.map\n","/**\n * @remix-run/router v1.2.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Actions represent the type of change to a location value.\n */\nvar Action;\n\n(function (Action) {\n /**\n * A POP indicates a change to an arbitrary index in the history stack, such\n * as a back or forward navigation. It does not describe the direction of the\n * navigation, only that the current index changed.\n *\n * Note: This is the default action for newly created history objects.\n */\n Action[\"Pop\"] = \"POP\";\n /**\n * A PUSH indicates a new entry being added to the history stack, such as when\n * a link is clicked and a new page loads. When this happens, all subsequent\n * entries in the stack are lost.\n */\n\n Action[\"Push\"] = \"PUSH\";\n /**\n * A REPLACE indicates the entry at the current index in the history stack\n * being replaced by a new one.\n */\n\n Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\n\nconst PopStateEventType = \"popstate\";\n/**\n * Memory history stores the current location in memory. It is designed for use\n * in stateful non-browser environments like tests and React Native.\n */\n\nfunction createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n let {\n initialEntries = [\"/\"],\n initialIndex,\n v5Compat = false\n } = options;\n let entries; // Declare so we can access from createMemoryLocation\n\n entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === \"string\" ? null : entry.state, index === 0 ? \"default\" : undefined));\n let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex);\n let action = Action.Pop;\n let listener = null;\n\n function clampIndex(n) {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n\n function getCurrentLocation() {\n return entries[index];\n }\n\n function createMemoryLocation(to, state, key) {\n if (state === void 0) {\n state = null;\n }\n\n let location = createLocation(entries ? getCurrentLocation().pathname : \"/\", to, state, key);\n warning$1(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in memory history: \" + JSON.stringify(to));\n return location;\n }\n\n let history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return getCurrentLocation();\n },\n\n createHref(to) {\n return typeof to === \"string\" ? to : createPath(to);\n },\n\n encodeLocation(to) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\"\n };\n },\n\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation\n });\n }\n },\n\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation\n });\n }\n },\n\n go(delta) {\n action = Action.Pop;\n index = clampIndex(index + delta);\n\n if (listener) {\n listener({\n action,\n location: getCurrentLocation()\n });\n }\n },\n\n listen(fn) {\n listener = fn;\n return () => {\n listener = null;\n };\n }\n\n };\n return history;\n}\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n function createBrowserLocation(window, globalHistory) {\n let {\n pathname,\n search,\n hash\n } = window.location;\n return createLocation(\"\", {\n pathname,\n search,\n hash\n }, // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n\n function createBrowserHref(window, to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);\n}\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n function createHashLocation(window, globalHistory) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = parsePath(window.location.hash.substr(1));\n return createLocation(\"\", {\n pathname,\n search,\n hash\n }, // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n\n function createHashHref(window, to) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n\n function validateHashLocation(location, to) {\n warning$1(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\");\n }\n\n return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options);\n}\nfunction invariant(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\nfunction warning$1(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\n * For browser-based histories, we combine the state and key into an object\n */\n\n\nfunction getHistoryState(location) {\n return {\n usr: location.state,\n key: location.key\n };\n}\n/**\n * Creates a Location object with a unique key from the given Path\n */\n\n\nfunction createLocation(current, to, state, key) {\n if (state === void 0) {\n state = null;\n }\n\n let location = _extends({\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\"\n }, typeof to === \"string\" ? parsePath(to) : to, {\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: to && to.key || key || createKey()\n });\n\n return location;\n}\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\n\nfunction createPath(_ref) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = _ref;\n if (search && search !== \"?\") pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\") pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\n\nfunction parsePath(path) {\n let parsedPath = {};\n\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n let searchIndex = path.indexOf(\"?\");\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\nfunction createClientSideURL(location) {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base = typeof window !== \"undefined\" && typeof window.location !== \"undefined\" && window.location.origin !== \"null\" ? window.location.origin : window.location.href;\n let href = typeof location === \"string\" ? location : createPath(location);\n invariant(base, \"No window.location.(origin|href) available to create URL for href: \" + href);\n return new URL(href, base);\n}\n\nfunction getUrlBasedHistory(getLocation, createHref, validateLocation, options) {\n if (options === void 0) {\n options = {};\n }\n\n let {\n window = document.defaultView,\n v5Compat = false\n } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener = null;\n\n function handlePop() {\n action = Action.Pop;\n\n if (listener) {\n listener({\n action,\n location: history.location\n });\n }\n }\n\n function push(to, state) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n let historyState = getHistoryState(location);\n let url = history.createHref(location); // try...catch because iOS limits us to 100 pushState calls :/\n\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location\n });\n }\n }\n\n function replace(to, state) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n let historyState = getHistoryState(location);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location\n });\n }\n }\n\n let history = {\n get action() {\n return action;\n },\n\n get location() {\n return getLocation(window, globalHistory);\n },\n\n listen(fn) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n\n createHref(to) {\n return createHref(window, to);\n },\n\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createClientSideURL(typeof to === \"string\" ? to : createPath(to));\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash\n };\n },\n\n push,\n replace,\n\n go(n) {\n return globalHistory.go(n);\n }\n\n };\n return history;\n} //#endregion\n\nvar ResultType;\n\n(function (ResultType) {\n ResultType[\"data\"] = \"data\";\n ResultType[\"deferred\"] = \"deferred\";\n ResultType[\"redirect\"] = \"redirect\";\n ResultType[\"error\"] = \"error\";\n})(ResultType || (ResultType = {}));\n\nfunction isIndexRoute(route) {\n return route.index === true;\n} // Walk the route tree generating unique IDs where necessary so we are working\n// solely with AgnosticDataRouteObject's within the Router\n\n\nfunction convertRoutesToDataRoutes(routes, parentPath, allIds) {\n if (parentPath === void 0) {\n parentPath = [];\n }\n\n if (allIds === void 0) {\n allIds = new Set();\n }\n\n return routes.map((route, index) => {\n let treePath = [...parentPath, index];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(route.index !== true || !route.children, \"Cannot specify children on an index route\");\n invariant(!allIds.has(id), \"Found a route id collision on id \\\"\" + id + \"\\\". Route \" + \"id's must be globally unique within Data Router usages\");\n allIds.add(id);\n\n if (isIndexRoute(route)) {\n let indexRoute = _extends({}, route, {\n id\n });\n\n return indexRoute;\n } else {\n let pathOrLayoutRoute = _extends({}, route, {\n id,\n children: route.children ? convertRoutesToDataRoutes(route.children, treePath, allIds) : undefined\n });\n\n return pathOrLayoutRoute;\n }\n });\n}\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/utils/match-routes\n */\n\nfunction matchRoutes(routes, locationArg, basename) {\n if (basename === void 0) {\n basename = \"/\";\n }\n\n let location = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n let matches = null;\n\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch(branches[i], // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n safelyDecodeURI(pathname));\n }\n\n return matches;\n}\n\nfunction flattenRoutes(routes, branches, parentsMeta, parentPath) {\n if (branches === void 0) {\n branches = [];\n }\n\n if (parentsMeta === void 0) {\n parentsMeta = [];\n }\n\n if (parentPath === void 0) {\n parentPath = \"\";\n }\n\n let flattenRoute = (route, index, relativePath) => {\n let meta = {\n relativePath: relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(meta.relativePath.startsWith(parentPath), \"Absolute route path \\\"\" + meta.relativePath + \"\\\" nested under path \" + (\"\\\"\" + parentPath + \"\\\" is not valid. An absolute child route path \") + \"must start with the combined path of all its parent routes.\");\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n\n if (route.children && route.children.length > 0) {\n invariant( // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true, \"Index routes must not have child routes. Please remove \" + (\"all child routes from route path \\\"\" + path + \"\\\".\"));\n flattenRoutes(route.children, branches, routesMeta, path);\n } // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n\n\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta\n });\n };\n\n routes.forEach((route, index) => {\n var _route$path;\n\n // coarse-grain check for optional params\n if (route.path === \"\" || !((_route$path = route.path) != null && _route$path.includes(\"?\"))) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n return branches;\n}\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\n\n\nfunction explodeOptionalSegments(path) {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n let [first, ...rest] = segments; // Optional path segments are denoted by a trailing `?`\n\n let isOptional = first.endsWith(\"?\"); // Compute the corresponding required segment: `foo?` -> `foo`\n\n let required = first.replace(/\\?$/, \"\");\n\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n let result = []; // All child paths with the prefix. Do this for all children before the\n // optional version for all children so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explodes _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n\n result.push(...restExploded.map(subpath => subpath === \"\" ? required : [required, subpath].join(\"/\"))); // Then if this is an optional value, add all child versions without\n\n if (isOptional) {\n result.push(...restExploded);\n } // for absolute paths, ensure `/` instead of empty segment\n\n\n return result.map(exploded => path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded);\n}\n\nfunction rankRouteBranches(branches) {\n branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first\n : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\n\nconst isSplat = s => s === \"*\";\n\nfunction computeScore(path, index) {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === \"\" ? emptySegmentValue : staticSegmentValue), initialScore);\n}\n\nfunction compareIndexes(a, b) {\n let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n return siblings ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch(branch, pathname) {\n let {\n routesMeta\n } = branch;\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches = [];\n\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname = matchedPathname === \"/\" ? pathname : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath({\n path: meta.relativePath,\n caseSensitive: meta.caseSensitive,\n end\n }, remainingPathname);\n if (!match) return null;\n Object.assign(matchedParams, match.params);\n let route = meta.route;\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),\n route\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/utils/generate-path\n */\n\n\nfunction generatePath(originalPath, params) {\n if (params === void 0) {\n params = {};\n }\n\n let path = originalPath;\n\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(false, \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n path = path.replace(/\\*$/, \"/*\");\n }\n\n return path.replace(/^:(\\w+)/g, (_, key) => {\n invariant(params[key] != null, \"Missing \\\":\" + key + \"\\\" param\");\n return params[key];\n }).replace(/\\/:(\\w+)/g, (_, key) => {\n invariant(params[key] != null, \"Missing \\\":\" + key + \"\\\" param\");\n return \"/\" + params[key];\n }).replace(/(\\/?)\\*/, (_, prefix, __, str) => {\n const star = \"*\";\n\n if (params[star] == null) {\n // If no splat was provided, trim the trailing slash _unless_ it's\n // the entire path\n return str === \"/*\" ? \"/\" : \"\";\n } // Apply the splat\n\n\n return \"\" + prefix + params[star];\n });\n}\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/utils/match-path\n */\n\nfunction matchPath(pattern, pathname) {\n if (typeof pattern === \"string\") {\n pattern = {\n path: pattern,\n caseSensitive: false,\n end: true\n };\n }\n\n let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);\n let match = pathname.match(matcher);\n if (!match) return null;\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params = paramNames.reduce((memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || \"\", paramName);\n return memo;\n }, {});\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern\n };\n}\n\nfunction compilePath(path, caseSensitive, end) {\n if (caseSensitive === void 0) {\n caseSensitive = false;\n }\n\n if (end === void 0) {\n end = true;\n }\n\n warning(path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"), \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n let paramNames = [];\n let regexpSource = \"^\" + path.replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:(\\w+)/g, (_, paramName) => {\n paramNames.push(paramName);\n return \"/([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource += path === \"*\" || path === \"/*\" ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else ;\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURI(value) {\n try {\n return decodeURI(value);\n } catch (error) {\n warning(false, \"The URL path \\\"\" + value + \"\\\" could not be decoded because it is is a \" + \"malformed URL segment. This is probably due to a bad percent \" + (\"encoding (\" + error + \").\"));\n return value;\n }\n}\n\nfunction safelyDecodeURIComponent(value, paramName) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(false, \"The value for the URL param \\\"\" + paramName + \"\\\" will not be decoded because\" + (\" the string \\\"\" + value + \"\\\" is a malformed URL segment. This is probably\") + (\" due to a bad percent encoding (\" + error + \").\"));\n return value;\n }\n}\n/**\n * @private\n */\n\n\nfunction stripBasename(pathname, basename) {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n } // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n\n\n let startIndex = basename.endsWith(\"/\") ? basename.length - 1 : basename.length;\n let nextChar = pathname.charAt(startIndex);\n\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(startIndex) || \"/\";\n}\n/**\n * @private\n */\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging React Router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/utils/resolve-path\n */\n\nfunction resolvePath(to, fromPathname) {\n if (fromPathname === void 0) {\n fromPathname = \"/\";\n }\n\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\"\n } = typeof to === \"string\" ? parsePath(to) : to;\n let pathname = toPathname ? toPathname.startsWith(\"/\") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash)\n };\n}\n\nfunction resolvePathname(relativePath, fromPathname) {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n relativeSegments.forEach(segment => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nfunction getInvalidPathError(char, field, dest, path) {\n return \"Cannot include a '\" + char + \"' character in a manually specified \" + (\"`to.\" + field + \"` field [\" + JSON.stringify(path) + \"]. Please separate it out to the \") + (\"`to.\" + dest + \"` field. Alternatively you may provide the full path as \") + \"a string in <Link to=\\\"...\\\"> and the router will parse it for you.\";\n}\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * <Route path=\"/\">\n * <Route path=\"accounts\" element={<Link to=\"..\"}>\n * </Route>\n *\n * <Route path=\"/\">\n * <Route path=\"accounts\">\n * <Route element={<AccountsLayout />}> // <-- Does not contribute\n * <Route index element={<Link to=\"..\"} /> // <-- Does not contribute\n * </Route\n * </Route>\n * </Route>\n */\n\n\nfunction getPathContributingMatches(matches) {\n return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);\n}\n/**\n * @private\n */\n\nfunction resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {\n if (isPathRelative === void 0) {\n isPathRelative = false;\n }\n\n let to;\n\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = _extends({}, toArg);\n invariant(!to.pathname || !to.pathname.includes(\"?\"), getInvalidPathError(\"?\", \"pathname\", \"search\", to));\n invariant(!to.pathname || !to.pathname.includes(\"#\"), getInvalidPathError(\"#\", \"pathname\", \"hash\", to));\n invariant(!to.search || !to.search.includes(\"#\"), getInvalidPathError(\"#\", \"search\", \"hash\", to));\n }\n\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n let from; // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `<Link to>` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n\n if (isPathRelative || toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\"); // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how <a href> works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n } // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n\n\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original \"to\" had one\n\n let hasExplicitTrailingSlash = toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\"); // Or if this was a link to the current path which has a trailing slash\n\n let hasCurrentTrailingSlash = (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n\n if (!path.pathname.endsWith(\"/\") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n/**\n * @private\n */\n\nfunction getToPathname(to) {\n // Empty strings should be treated the same as / paths\n return to === \"\" || to.pathname === \"\" ? \"/\" : typeof to === \"string\" ? parsePath(to).pathname : to.pathname;\n}\n/**\n * @private\n */\n\nconst joinPaths = paths => paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n/**\n * @private\n */\n\nconst normalizePathname = pathname => pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n/**\n * @private\n */\n\nconst normalizeSearch = search => !search || search === \"?\" ? \"\" : search.startsWith(\"?\") ? search : \"?\" + search;\n/**\n * @private\n */\n\nconst normalizeHash = hash => !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n */\n\nconst json = function json(data, init) {\n if (init === void 0) {\n init = {};\n }\n\n let responseInit = typeof init === \"number\" ? {\n status: init\n } : init;\n let headers = new Headers(responseInit.headers);\n\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n\n return new Response(JSON.stringify(data), _extends({}, responseInit, {\n headers\n }));\n};\nclass AbortedDeferredError extends Error {}\nclass DeferredData {\n constructor(data) {\n this.pendingKeys = new Set();\n this.subscriber = undefined;\n invariant(data && typeof data === \"object\" && !Array.isArray(data), \"defer() only accepts plain objects\"); // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n\n let reject;\n this.abortPromise = new Promise((_, r) => reject = r);\n this.controller = new AbortController();\n\n let onAbort = () => reject(new AbortedDeferredError(\"Deferred data aborted\"));\n\n this.unlistenAbortSignal = () => this.controller.signal.removeEventListener(\"abort\", onAbort);\n\n this.controller.signal.addEventListener(\"abort\", onAbort);\n this.data = Object.entries(data).reduce((acc, _ref) => {\n let [key, value] = _ref;\n return Object.assign(acc, {\n [key]: this.trackPromise(key, value)\n });\n }, {});\n }\n\n trackPromise(key, value) {\n if (!(value instanceof Promise)) {\n return value;\n }\n\n this.pendingKeys.add(key); // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n\n let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, null, data), error => this.onSettle(promise, key, error)); // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n\n promise.catch(() => {});\n Object.defineProperty(promise, \"_tracked\", {\n get: () => true\n });\n return promise;\n }\n\n onSettle(promise, key, error, data) {\n if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n return Promise.reject(error);\n }\n\n this.pendingKeys.delete(key);\n\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n\n const subscriber = this.subscriber;\n\n if (error) {\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n subscriber && subscriber(false);\n return Promise.reject(error);\n }\n\n Object.defineProperty(promise, \"_data\", {\n get: () => data\n });\n subscriber && subscriber(false);\n return data;\n }\n\n subscribe(fn) {\n this.subscriber = fn;\n }\n\n cancel() {\n this.controller.abort();\n this.pendingKeys.forEach((v, k) => this.pendingKeys.delete(k));\n let subscriber = this.subscriber;\n subscriber && subscriber(true);\n }\n\n async resolveData(signal) {\n let aborted = false;\n\n if (!this.done) {\n let onAbort = () => this.cancel();\n\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise(resolve => {\n this.subscribe(aborted => {\n signal.removeEventListener(\"abort\", onAbort);\n\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n\n return aborted;\n }\n\n get done() {\n return this.pendingKeys.size === 0;\n }\n\n get unwrappedData() {\n invariant(this.data !== null && this.done, \"Can only unwrap data on initialized and settled deferreds\");\n return Object.entries(this.data).reduce((acc, _ref2) => {\n let [key, value] = _ref2;\n return Object.assign(acc, {\n [key]: unwrapTrackedPromise(value)\n });\n }, {});\n }\n\n}\n\nfunction isTrackedPromise(value) {\n return value instanceof Promise && value._tracked === true;\n}\n\nfunction unwrapTrackedPromise(value) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n\n if (value._error) {\n throw value._error;\n }\n\n return value._data;\n}\n\nfunction defer(data) {\n return new DeferredData(data);\n}\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\n\nconst redirect = function redirect(url, init) {\n if (init === void 0) {\n init = 302;\n }\n\n let responseInit = init;\n\n if (typeof responseInit === \"number\") {\n responseInit = {\n status: responseInit\n };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n return new Response(null, _extends({}, responseInit, {\n headers\n }));\n};\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n */\n\nclass ErrorResponse {\n constructor(status, statusText, data, internal) {\n if (internal === void 0) {\n internal = false;\n }\n\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n\n}\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response throw from an action/loader\n */\n\nfunction isRouteErrorResponse(e) {\n return e instanceof ErrorResponse;\n}\n\nconst validMutationMethodsArr = [\"post\", \"put\", \"patch\", \"delete\"];\nconst validMutationMethods = new Set(validMutationMethodsArr);\nconst validRequestMethodsArr = [\"get\", ...validMutationMethodsArr];\nconst validRequestMethods = new Set(validRequestMethodsArr);\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\nconst IDLE_NAVIGATION = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n};\nconst IDLE_FETCHER = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n};\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\";\nconst isServer = !isBrowser; //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a router and listen to history POP navigations\n */\n\nfunction createRouter(init) {\n invariant(init.routes.length > 0, \"You must provide a non-empty routes array to createRouter\");\n let dataRoutes = convertRoutesToDataRoutes(init.routes); // Cleanup function for history\n\n let unlistenHistory = null; // Externally-provided functions to call on all state changes\n\n let subscribers = new Set(); // Externally-provided object to hold scroll restoration locations during routing\n\n let savedScrollPositions = null; // Externally-provided function to get scroll restoration keys\n\n let getScrollRestorationKey = null; // Externally-provided function to get current scroll position\n\n let getScrollPosition = null; // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from <ScrollRestoration /> until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n\n let initialScrollRestored = init.hydrationData != null;\n let initialMatches = matchRoutes(dataRoutes, init.history.location, init.basename);\n let initialErrors = null;\n\n if (initialMatches == null) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname\n });\n let {\n matches,\n route\n } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = {\n [route.id]: error\n };\n }\n\n let initialized = !initialMatches.some(m => m.route.loader) || init.hydrationData != null;\n let router;\n let state = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: init.hydrationData && init.hydrationData.loaderData || {},\n actionData: init.hydrationData && init.hydrationData.actionData || null,\n errors: init.hydrationData && init.hydrationData.errors || initialErrors,\n fetchers: new Map()\n }; // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n\n let pendingAction = Action.Pop; // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n\n let pendingPreventScrollReset = false; // AbortController for the active navigation\n\n let pendingNavigationController; // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n\n let isUninterruptedRevalidation = false; // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidate()\n // - X-Remix-Revalidate (from redirect)\n\n let isRevalidationRequired = false; // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n\n let cancelledDeferredRoutes = []; // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n\n let cancelledFetcherLoads = []; // AbortControllers for any in-flight fetchers\n\n let fetchControllers = new Map(); // Track loads based on the order in which they started\n\n let incrementingLoadId = 0; // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n\n let pendingNavigationLoadId = -1; // Fetchers that triggered data reloads as a result of their actions\n\n let fetchReloadIds = new Map(); // Fetchers that triggered redirect navigations from their actions\n\n let fetchRedirectIds = new Set(); // Most recent href/match for fetcher.load calls for fetchers\n\n let fetchLoadMatches = new Map(); // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n\n let activeDeferreds = new Map(); // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(_ref => {\n let {\n action: historyAction,\n location\n } = _ref;\n return startNavigation(historyAction, location);\n }); // Kick off initial data load if needed. Use Pop to avoid modifying history\n\n if (!state.initialized) {\n startNavigation(Action.Pop, state.location);\n }\n\n return router;\n } // Clean up a router and it's side effects\n\n\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n } // Subscribe to state updates for the router\n\n\n function subscribe(fn) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n } // Update our state and notify the calling context of the change\n\n\n function updateState(newState) {\n state = _extends({}, state, newState);\n subscribers.forEach(subscriber => subscriber(state));\n } // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n\n\n function completeNavigation(location, newState) {\n var _location$state;\n\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === \"loading\" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;\n let actionData;\n\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n } // Always preserve any existing loaderData from re-used routes\n\n\n let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData;\n updateState(_extends({}, newState, {\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n // Don't restore on submission navigations\n restoreScrollPosition: state.navigation.formData ? false : getSavedScrollPosition(location, newState.matches || state.matches),\n preventScrollReset: pendingPreventScrollReset\n }));\n\n if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === Action.Replace) {\n init.history.replace(location, location.state);\n } // Reset stateful navigation vars\n\n\n pendingAction = Action.Pop;\n pendingPreventScrollReset = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n cancelledFetcherLoads = [];\n } // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n\n\n async function navigate(to, opts) {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n\n let {\n path,\n submission,\n error\n } = normalizeNavigateOptions(to, opts);\n let location = createLocation(state.location, path, opts && opts.state); // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n\n location = _extends({}, location, init.history.encodeLocation(location));\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n let historyAction = Action.Push;\n\n if (userReplace === true) {\n historyAction = Action.Replace;\n } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = Action.Replace;\n }\n\n let preventScrollReset = opts && \"preventScrollReset\" in opts ? opts.preventScrollReset === true : undefined;\n return await startNavigation(historyAction, location, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace\n });\n } // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n\n\n function revalidate() {\n interruptActiveLoads();\n updateState({\n revalidation: \"loading\"\n }); // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n\n if (state.navigation.state === \"submitting\") {\n return;\n } // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n\n\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true\n });\n return;\n } // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n\n\n startNavigation(pendingAction || state.historyAction, state.navigation.location, {\n overrideNavigation: state.navigation\n });\n } // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n\n\n async function startNavigation(historyAction, location, opts) {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(dataRoutes, location, init.basename); // Short circuit with a 404 on the root error boundary if we match nothing\n\n if (!matches) {\n let error = getInternalRouterError(404, {\n pathname: location.pathname\n });\n let {\n matches: notFoundMatches,\n route\n } = getShortCircuitMatches(dataRoutes); // Cancel all pending deferred on 404s since we don't keep any routes\n\n cancelActiveDeferreds();\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error\n }\n });\n return;\n } // Short circuit if it's only a hash change\n\n\n if (isHashChangeOnly(state.location, location)) {\n completeNavigation(location, {\n matches\n });\n return;\n } // Create a controller/Request for this navigation\n\n\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(location, pendingNavigationController.signal, opts && opts.submission);\n let pendingActionData;\n let pendingError;\n\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingError = {\n [findNearestBoundary(matches).route.id]: opts.pendingError\n };\n } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {\n // Call action if we received an action submission\n let actionOutput = await handleAction(request, location, opts.submission, matches, {\n replace: opts.replace\n });\n\n if (actionOutput.shortCircuited) {\n return;\n }\n\n pendingActionData = actionOutput.pendingActionData;\n pendingError = actionOutput.pendingActionError;\n\n let navigation = _extends({\n state: \"loading\",\n location\n }, opts.submission);\n\n loadingNavigation = navigation; // Create a GET request for the loaders\n\n request = new Request(request.url, {\n signal: request.signal\n });\n } // Call loaders\n\n\n let {\n shortCircuited,\n loaderData,\n errors\n } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.replace, pendingActionData, pendingError);\n\n if (shortCircuited) {\n return;\n } // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n\n\n pendingNavigationController = null;\n completeNavigation(location, _extends({\n matches\n }, pendingActionData ? {\n actionData: pendingActionData\n } : {}, {\n loaderData,\n errors\n }));\n } // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n\n\n async function handleAction(request, location, submission, matches, opts) {\n interruptActiveLoads(); // Put us in a submitting state\n\n let navigation = _extends({\n state: \"submitting\",\n location\n }, submission);\n\n updateState({\n navigation\n }); // Call our action and get the result\n\n let result;\n let actionMatch = getTargetMatch(matches, location);\n\n if (!actionMatch.route.action) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id\n })\n };\n } else {\n result = await callLoaderOrAction(\"action\", request, actionMatch, matches, router.basename);\n\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n }\n }\n\n if (isRedirectResult(result)) {\n let replace;\n\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n replace = result.location === state.location.pathname + state.location.search;\n }\n\n await startRedirectNavigation(state, result, {\n submission,\n replace\n });\n return {\n shortCircuited: true\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); // By default, all submissions are REPLACE navigations, but if the\n // action threw an error that'll be rendered in an errorElement, we fall\n // back to PUSH so that the user can use the back button to get back to\n // the pre-submission form location to try again\n\n if ((opts && opts.replace) !== true) {\n pendingAction = Action.Push;\n }\n\n return {\n // Send back an empty object we can use to clear out any prior actionData\n pendingActionData: {},\n pendingActionError: {\n [boundaryMatch.route.id]: result.error\n }\n };\n }\n\n if (isDeferredResult(result)) {\n throw new Error(\"defer() is not supported in actions\");\n }\n\n return {\n pendingActionData: {\n [actionMatch.route.id]: result.data\n }\n };\n } // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n\n\n async function handleLoaders(request, location, matches, overrideNavigation, submission, replace, pendingActionData, pendingError) {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation = overrideNavigation;\n\n if (!loadingNavigation) {\n let navigation = _extends({\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n }, submission);\n\n loadingNavigation = navigation;\n } // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n\n\n let activeSubmission = submission ? submission : loadingNavigation.formMethod && loadingNavigation.formAction && loadingNavigation.formData && loadingNavigation.formEncType ? {\n formMethod: loadingNavigation.formMethod,\n formAction: loadingNavigation.formAction,\n formData: loadingNavigation.formData,\n formEncType: loadingNavigation.formEncType\n } : undefined;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(state, matches, activeSubmission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches); // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n\n cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); // Short circuit if we have no loaders to run\n\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n completeNavigation(location, _extends({\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingError || null\n }, pendingActionData ? {\n actionData: pendingActionData\n } : {}));\n return {\n shortCircuited: true\n };\n } // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n\n\n if (!isUninterruptedRevalidation) {\n revalidatingFetchers.forEach(_ref2 => {\n let [key] = _ref2;\n let fetcher = state.fetchers.get(key);\n let revalidatingFetcher = {\n state: \"loading\",\n data: fetcher && fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, revalidatingFetcher);\n });\n let actionData = pendingActionData || state.actionData;\n updateState(_extends({\n navigation: loadingNavigation\n }, actionData ? Object.keys(actionData).length === 0 ? {\n actionData: null\n } : {\n actionData\n } : {}, revalidatingFetchers.length > 0 ? {\n fetchers: new Map(state.fetchers)\n } : {}));\n }\n\n pendingNavigationLoadId = ++incrementingLoadId;\n revalidatingFetchers.forEach(_ref3 => {\n let [key] = _ref3;\n return fetchControllers.set(key, pendingNavigationController);\n });\n let {\n results,\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request);\n\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n } // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n\n\n revalidatingFetchers.forEach(_ref4 => {\n let [key] = _ref4;\n return fetchControllers.delete(key);\n }); // If any loaders returned a redirect Response, start a new REPLACE navigation\n\n let redirect = findRedirect(results);\n\n if (redirect) {\n await startRedirectNavigation(state, redirect, {\n replace\n });\n return {\n shortCircuited: true\n };\n } // Process and commit output from loaders\n\n\n let {\n loaderData,\n errors\n } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds); // Wire up subscribers to update loaderData as promises settle\n\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe(aborted => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n return _extends({\n loaderData,\n errors\n }, didAbortFetchLoads || revalidatingFetchers.length > 0 ? {\n fetchers: new Map(state.fetchers)\n } : {});\n }\n\n function getFetcher(key) {\n return state.fetchers.get(key) || IDLE_FETCHER;\n } // Trigger a fetcher load/submit for the given fetcher key\n\n\n function fetch(key, routeId, href, opts) {\n if (isServer) {\n throw new Error(\"router.fetch() was called during the server render, but it shouldn't be. \" + \"You are likely calling a useFetcher() method in the body of your component. \" + \"Try moving it to a useEffect or a callback.\");\n }\n\n if (fetchControllers.has(key)) abortFetcher(key);\n let matches = matchRoutes(dataRoutes, href, init.basename);\n\n if (!matches) {\n setFetcherError(key, routeId, getInternalRouterError(404, {\n pathname: href\n }));\n return;\n }\n\n let {\n path,\n submission\n } = normalizeNavigateOptions(href, opts, true);\n let match = getTargetMatch(matches, path);\n\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, submission);\n return;\n } // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n\n\n fetchLoadMatches.set(key, [path, match, matches]);\n handleFetcherLoader(key, routeId, path, match, matches, submission);\n } // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n\n\n async function handleFetcherAction(key, routeId, path, match, requestMatches, submission) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n\n if (!match.route.action) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId\n });\n setFetcherError(key, routeId, error);\n return;\n } // Put this fetcher into it's submitting state\n\n\n let existingFetcher = state.fetchers.get(key);\n\n let fetcher = _extends({\n state: \"submitting\"\n }, submission, {\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, fetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n }); // Call the action for the fetcher\n\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(path, abortController.signal, submission);\n fetchControllers.set(key, abortController);\n let actionResult = await callLoaderOrAction(\"action\", fetchRequest, match, requestMatches, router.basename);\n\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n return;\n }\n\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n fetchRedirectIds.add(key);\n\n let loadingFetcher = _extends({\n state: \"loading\"\n }, submission, {\n data: undefined,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadingFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n });\n return startRedirectNavigation(state, actionResult, {\n isFetchActionRedirect: true\n });\n } // Process any non-redirect errors thrown\n\n\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n\n if (isDeferredResult(actionResult)) {\n invariant(false, \"defer() is not supported in actions\");\n } // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n\n\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(nextLocation, abortController.signal);\n let matches = state.navigation.state !== \"idle\" ? matchRoutes(dataRoutes, state.navigation.location, init.basename) : state.matches;\n invariant(matches, \"Didn't find any matches after fetcher action\");\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n\n let loadFetcher = _extends({\n state: \"loading\",\n data: actionResult.data\n }, submission, {\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadFetcher);\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, {\n [match.route.id]: actionResult.data\n }, undefined, // No need to send through errors since we short circuit above\n fetchLoadMatches); // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n\n revalidatingFetchers.filter(_ref5 => {\n let [staleKey] = _ref5;\n return staleKey !== key;\n }).forEach(_ref6 => {\n let [staleKey] = _ref6;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher = {\n state: \"loading\",\n data: existingFetcher && existingFetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(staleKey, revalidatingFetcher);\n fetchControllers.set(staleKey, abortController);\n });\n updateState({\n fetchers: new Map(state.fetchers)\n });\n let {\n results,\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);\n\n if (abortController.signal.aborted) {\n return;\n }\n\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach(_ref7 => {\n let [staleKey] = _ref7;\n return fetchControllers.delete(staleKey);\n });\n let redirect = findRedirect(results);\n\n if (redirect) {\n return startRedirectNavigation(state, redirect);\n } // Process and commit output from loaders\n\n\n let {\n loaderData,\n errors\n } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds);\n let doneFetcher = {\n state: \"idle\",\n data: actionResult.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n let didAbortFetchLoads = abortStaleFetchLoads(loadId); // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n\n if (state.navigation.state === \"loading\" && loadId > pendingNavigationLoadId) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers)\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState(_extends({\n errors,\n loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors)\n }, didAbortFetchLoads ? {\n fetchers: new Map(state.fetchers)\n } : {}));\n isRevalidationRequired = false;\n }\n } // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n\n\n async function handleFetcherLoader(key, routeId, path, match, matches, submission) {\n let existingFetcher = state.fetchers.get(key); // Put this fetcher into it's loading state\n\n let loadingFetcher = _extends({\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n }, submission, {\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadingFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n }); // Call the loader for this fetcher route match\n\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(path, abortController.signal);\n fetchControllers.set(key, abortController);\n let result = await callLoaderOrAction(\"loader\", fetchRequest, match, matches, router.basename); // Deferred isn't supported or fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n\n if (isDeferredResult(result)) {\n result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result;\n } // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n\n\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n if (fetchRequest.signal.aborted) {\n return;\n } // If the loader threw a redirect Response, start a new REPLACE navigation\n\n\n if (isRedirectResult(result)) {\n await startRedirectNavigation(state, result);\n return;\n } // Process any non-redirect errors thrown\n\n\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n state.fetchers.delete(key); // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -\n // do we need to behave any differently with our non-redirect errors?\n // What if it was a non-redirect Response?\n\n updateState({\n fetchers: new Map(state.fetchers),\n errors: {\n [boundaryMatch.route.id]: result.error\n }\n });\n return;\n }\n\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\"); // Put the fetcher back into an idle state\n\n let doneFetcher = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n });\n }\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n\n\n async function startRedirectNavigation(state, redirect, _temp) {\n var _window;\n\n let {\n submission,\n replace,\n isFetchActionRedirect\n } = _temp === void 0 ? {} : _temp;\n\n if (redirect.revalidate) {\n isRevalidationRequired = true;\n }\n\n let redirectLocation = createLocation(state.location, redirect.location, // TODO: This can be removed once we get rid of useTransition in Remix v2\n _extends({\n _isRedirect: true\n }, isFetchActionRedirect ? {\n _isFetchActionRedirect: true\n } : {}));\n invariant(redirectLocation, \"Expected a location on the redirect navigation\"); // Check if this an external redirect that goes to a new origin\n\n if (typeof ((_window = window) == null ? void 0 : _window.location) !== \"undefined\") {\n let newOrigin = createClientSideURL(redirect.location).origin;\n\n if (window.location.origin !== newOrigin) {\n if (replace) {\n window.location.replace(redirect.location);\n } else {\n window.location.assign(redirect.location);\n }\n\n return;\n }\n } // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n\n\n pendingNavigationController = null;\n let redirectHistoryAction = replace === true ? Action.Replace : Action.Push; // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n\n let {\n formMethod,\n formAction,\n formEncType,\n formData\n } = state.navigation;\n\n if (!submission && formMethod && formAction && formData && formEncType) {\n submission = {\n formMethod,\n formAction,\n formEncType,\n formData\n };\n } // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n\n\n if (redirectPreserveMethodStatusCodes.has(redirect.status) && submission && isMutationMethod(submission.formMethod)) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: _extends({}, submission, {\n formAction: redirect.location\n })\n });\n } else {\n // Otherwise, we kick off a new loading navigation, preserving the\n // submission info for the duration of this navigation\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: {\n state: \"loading\",\n location: redirectLocation,\n formMethod: submission ? submission.formMethod : undefined,\n formAction: submission ? submission.formAction : undefined,\n formEncType: submission ? submission.formEncType : undefined,\n formData: submission ? submission.formData : undefined\n }\n });\n }\n }\n\n async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) {\n // Call all navigation loaders and revalidating fetcher loaders in parallel,\n // then slice off the results into separate arrays so we can handle them\n // accordingly\n let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction(\"loader\", request, match, matches, router.basename)), ...fetchersToLoad.map(_ref8 => {\n let [, href, match, fetchMatches] = _ref8;\n return callLoaderOrAction(\"loader\", createClientSideRequest(href, request.signal), match, fetchMatches, router.basename);\n })]);\n let loaderResults = results.slice(0, matchesToLoad.length);\n let fetcherResults = results.slice(matchesToLoad.length);\n await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, request.signal, false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map(_ref9 => {\n let [,, match] = _ref9;\n return match;\n }), fetcherResults, request.signal, true)]);\n return {\n results,\n loaderResults,\n fetcherResults\n };\n }\n\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true; // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n\n cancelledDeferredRoutes.push(...cancelActiveDeferreds()); // Abort in-flight fetcher loads\n\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.push(key);\n abortFetcher(key);\n }\n });\n }\n\n function setFetcherError(key, routeId, error) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error\n },\n fetchers: new Map(state.fetchers)\n });\n }\n\n function deleteFetcher(key) {\n if (fetchControllers.has(key)) abortFetcher(key);\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n state.fetchers.delete(key);\n }\n\n function abortFetcher(key) {\n let controller = fetchControllers.get(key);\n invariant(controller, \"Expected fetch controller: \" + key);\n controller.abort();\n fetchControllers.delete(key);\n }\n\n function markFetchersDone(keys) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher = {\n state: \"idle\",\n data: fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n function markFetchRedirectsDone() {\n let doneKeys = [];\n\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n }\n }\n\n markFetchersDone(doneKeys);\n }\n\n function abortStaleFetchLoads(landedId) {\n let yeetedKeys = [];\n\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n\n function cancelActiveDeferreds(predicate) {\n let cancelledRouteIds = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n } // Opt in to capturing and reporting scroll positions during navigations,\n // used by the <ScrollRestoration> component\n\n\n function enableScrollRestoration(positions, getPosition, getKey) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n\n getScrollRestorationKey = getKey || (location => location.key); // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered <ScrollRestoration/>\n // and therefore have no savedScrollPositions available\n\n\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n\n if (y != null) {\n updateState({\n restoreScrollPosition: y\n });\n }\n }\n\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n\n function saveScrollPosition(location, matches) {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n\n function getSavedScrollPosition(location, matches) {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n let y = savedScrollPositions[key];\n\n if (typeof y === \"number\") {\n return y;\n }\n }\n\n return null;\n }\n\n router = {\n get basename() {\n return init.basename;\n },\n\n get state() {\n return state;\n },\n\n get routes() {\n return dataRoutes;\n },\n\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: to => init.history.createHref(to),\n encodeLocation: to => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher,\n dispose,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds\n };\n return router;\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\n\nfunction createStaticHandler(routes, opts) {\n invariant(routes.length > 0, \"You must provide a non-empty routes array to createStaticHandler\");\n let dataRoutes = convertRoutesToDataRoutes(routes);\n let basename = (opts ? opts.basename : null) || \"/\";\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n */\n\n async function query(request, _temp2) {\n let {\n requestContext\n } = _temp2 === void 0 ? {} : _temp2;\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't\n\n if (!isValidMethod(method) && method !== \"head\") {\n let error = getInternalRouterError(405, {\n method\n });\n let {\n matches: methodNotAllowedMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {}\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, {\n pathname: location.pathname\n });\n let {\n matches: notFoundMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {}\n };\n }\n\n let result = await queryImpl(request, location, matches, requestContext);\n\n if (isResponse(result)) {\n return result;\n } // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n\n\n return _extends({\n location,\n basename\n }, result);\n }\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n */\n\n\n async function queryRoute(request, _temp3) {\n let {\n routeId,\n requestContext\n } = _temp3 === void 0 ? {} : _temp3;\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't\n\n if (!isValidMethod(method) && method !== \"head\") {\n throw getInternalRouterError(405, {\n method\n });\n } else if (!matches) {\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n\n let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location);\n\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n\n let result = await queryImpl(request, location, matches, requestContext, match);\n\n if (isResponse(result)) {\n return result;\n }\n\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n } // Pick off the right state value to return\n\n\n let routeData = [result.actionData, result.loaderData].find(v => v);\n return Object.values(routeData || {})[0];\n }\n\n async function queryImpl(request, location, matches, requestContext, routeMatch) {\n invariant(request.signal, \"query()/queryRoute() requests must contain an AbortController signal\");\n\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, routeMatch != null);\n return result;\n }\n\n let result = await loadRouteData(request, matches, requestContext, routeMatch);\n return isResponse(result) ? result : _extends({}, result, {\n actionData: null,\n actionHeaders: {}\n });\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction, we throw\n // it to bail out and then return or throw here based on whether the user\n // returned or threw\n if (isQueryRouteResponse(e)) {\n if (e.type === ResultType.error && !isRedirectResponse(e.response)) {\n throw e.response;\n }\n\n return e.response;\n } // Redirects are always returned since they don't propagate to catch\n // boundaries\n\n\n if (isRedirectResponse(e)) {\n return e;\n }\n\n throw e;\n }\n }\n\n async function submit(request, matches, actionMatch, requestContext, isRouteRequest) {\n let result;\n\n if (!actionMatch.route.action) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id\n });\n\n if (isRouteRequest) {\n throw error;\n }\n\n result = {\n type: ResultType.error,\n error\n };\n } else {\n result = await callLoaderOrAction(\"action\", request, actionMatch, matches, basename, true, isRouteRequest, requestContext);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(method + \"() call aborted\");\n }\n }\n\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.status,\n headers: {\n Location: result.location\n }\n });\n }\n\n if (isDeferredResult(result)) {\n throw new Error(\"defer() is not supported in actions\");\n }\n\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: {\n [actionMatch.route.id]: result.data\n },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {}\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(request, matches, requestContext, undefined, {\n [boundaryMatch.route.id]: result.error\n }); // action status codes take precedence over loader status codes\n\n return _extends({}, context, {\n statusCode: isRouteErrorResponse(result.error) ? result.error.status : 500,\n actionData: null,\n actionHeaders: _extends({}, result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {})\n });\n } // Create a GET request for the loaders\n\n\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal\n });\n let context = await loadRouteData(loaderRequest, matches, requestContext);\n return _extends({}, context, result.statusCode ? {\n statusCode: result.statusCode\n } : {}, {\n actionData: {\n [actionMatch.route.id]: result.data\n },\n actionHeaders: _extends({}, result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {})\n });\n }\n\n async function loadRouteData(request, matches, requestContext, routeMatch, pendingActionError) {\n let isRouteRequest = routeMatch != null; // Short circuit if we have no loaders to run (queryRoute())\n\n if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader)) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch == null ? void 0 : routeMatch.route.id\n });\n }\n\n let requestMatches = routeMatch ? [routeMatch] : getLoaderMatchesUntilBoundary(matches, Object.keys(pendingActionError || {})[0]);\n let matchesToLoad = requestMatches.filter(m => m.route.loader); // Short circuit if we have no loaders to run (query())\n\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce((acc, m) => Object.assign(acc, {\n [m.route.id]: null\n }), {}),\n errors: pendingActionError || null,\n statusCode: 200,\n loaderHeaders: {}\n };\n }\n\n let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction(\"loader\", request, match, matches, basename, true, isRouteRequest, requestContext))]);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(method + \"() call aborted\");\n }\n\n let executedLoaders = new Set();\n results.forEach((result, i) => {\n executedLoaders.add(matchesToLoad[i].route.id); // Can't do anything with these without the Remix side of things, so just\n // cancel them for now\n\n if (isDeferredResult(result)) {\n result.deferredData.cancel();\n }\n }); // Process and commit output from loaders\n\n let context = processRouteLoaderData(matches, matchesToLoad, results, pendingActionError); // Add a null for any non-loader matches for proper revalidation on the client\n\n matches.forEach(match => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n return _extends({}, context, {\n matches\n });\n }\n\n return {\n dataRoutes,\n query,\n queryRoute\n };\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\n\nfunction getStaticContextFromError(routes, context, error) {\n let newContext = _extends({}, context, {\n statusCode: 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error\n }\n });\n\n return newContext;\n}\n\nfunction isSubmissionNavigation(opts) {\n return opts != null && \"formData\" in opts;\n} // Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\n\n\nfunction normalizeNavigateOptions(to, opts, isFetcher) {\n if (isFetcher === void 0) {\n isFetcher = false;\n }\n\n let path = typeof to === \"string\" ? to : createPath(to); // Return location verbatim on non-submission navigations\n\n if (!opts || !isSubmissionNavigation(opts)) {\n return {\n path\n };\n }\n\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, {\n method: opts.formMethod\n })\n };\n } // Create a Submission on non-GET navigations\n\n\n let submission;\n\n if (opts.formData) {\n submission = {\n formMethod: opts.formMethod || \"get\",\n formAction: stripHashFromPath(path),\n formEncType: opts && opts.formEncType || \"application/x-www-form-urlencoded\",\n formData: opts.formData\n };\n\n if (isMutationMethod(submission.formMethod)) {\n return {\n path,\n submission\n };\n }\n } // Flatten submission onto URLSearchParams for GET submissions\n\n\n let parsedPath = parsePath(path);\n\n try {\n let searchParams = convertFormDataToSearchParams(opts.formData); // Since fetcher GET submissions only run a single loader (as opposed to\n // navigation GET submissions which run all loaders), we need to preserve\n // any incoming ?index params\n\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n\n parsedPath.search = \"?\" + searchParams;\n } catch (e) {\n return {\n path,\n error: getInternalRouterError(400)\n };\n }\n\n return {\n path: createPath(parsedPath),\n submission\n };\n} // Filter out all routes below any caught error as they aren't going to\n// render so we don't need to load them\n\n\nfunction getLoaderMatchesUntilBoundary(matches, boundaryId) {\n let boundaryMatches = matches;\n\n if (boundaryId) {\n let index = matches.findIndex(m => m.route.id === boundaryId);\n\n if (index >= 0) {\n boundaryMatches = matches.slice(0, index);\n }\n }\n\n return boundaryMatches;\n}\n\nfunction getMatchesToLoad(state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches) {\n let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : undefined; // Pick navigation matches that are net-new or qualify for revalidation\n\n let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;\n let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);\n let navigationMatches = boundaryMatches.filter((match, index) => match.route.loader != null && (isNewLoader(state.loaderData, state.matches[index], match) || // If this route had a pending deferred cancelled it must be revalidated\n cancelledDeferredRoutes.some(id => id === match.route.id) || shouldRevalidateLoader(state.location, state.matches[index], submission, location, match, isRevalidationRequired, actionResult))); // Pick fetcher.loads that need to be revalidated\n\n let revalidatingFetchers = [];\n fetchLoadMatches && fetchLoadMatches.forEach((_ref10, key) => {\n let [href, match, fetchMatches] = _ref10;\n\n // This fetcher was cancelled from a prior action submission - force reload\n if (cancelledFetcherLoads.includes(key)) {\n revalidatingFetchers.push([key, href, match, fetchMatches]);\n } else if (isRevalidationRequired) {\n let shouldRevalidate = shouldRevalidateLoader(href, match, submission, href, match, isRevalidationRequired, actionResult);\n\n if (shouldRevalidate) {\n revalidatingFetchers.push([key, href, match, fetchMatches]);\n }\n }\n });\n return [navigationMatches, revalidatingFetchers];\n}\n\nfunction isNewLoader(currentLoaderData, currentMatch, match) {\n let isNew = // [a] -> [a, b]\n !currentMatch || // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id; // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n\n let isMissingData = currentLoaderData[match.route.id] === undefined; // Always load if this is a net-new route or we don't yet have data\n\n return isNew || isMissingData;\n}\n\nfunction isNewRouteInstance(currentMatch, match) {\n let currentPath = currentMatch.route.path;\n return (// param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n currentPath && currentPath.endsWith(\"*\") && currentMatch.params[\"*\"] !== match.params[\"*\"]\n );\n}\n\nfunction shouldRevalidateLoader(currentLocation, currentMatch, submission, location, match, isRevalidationRequired, actionResult) {\n let currentUrl = createClientSideURL(currentLocation);\n let currentParams = currentMatch.params;\n let nextUrl = createClientSideURL(location);\n let nextParams = match.params; // This is the default implementation as to when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n // Note that fetchers always provide the same current/next locations so the\n // URL-based checks here don't apply to fetcher shouldRevalidate calls\n\n let defaultShouldRevalidate = isNewRouteInstance(currentMatch, match) || // Clicked the same link, resubmitted a GET form\n currentUrl.toString() === nextUrl.toString() || // Search params affect all loaders\n currentUrl.search !== nextUrl.search || // Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate\n isRevalidationRequired;\n\n if (match.route.shouldRevalidate) {\n let routeChoice = match.route.shouldRevalidate(_extends({\n currentUrl,\n currentParams,\n nextUrl,\n nextParams\n }, submission, {\n actionResult,\n defaultShouldRevalidate\n }));\n\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n\n return defaultShouldRevalidate;\n}\n\nasync function callLoaderOrAction(type, request, match, matches, basename, isStaticRequest, isRouteRequest, requestContext) {\n if (basename === void 0) {\n basename = \"/\";\n }\n\n if (isStaticRequest === void 0) {\n isStaticRequest = false;\n }\n\n if (isRouteRequest === void 0) {\n isRouteRequest = false;\n }\n\n let resultType;\n let result; // Setup a promise we can race against so that abort signals short circuit\n\n let reject;\n let abortPromise = new Promise((_, r) => reject = r);\n\n let onReject = () => reject();\n\n request.signal.addEventListener(\"abort\", onReject);\n\n try {\n let handler = match.route[type];\n invariant(handler, \"Could not find the \" + type + \" to run on the \\\"\" + match.route.id + \"\\\" route\");\n result = await Promise.race([handler({\n request,\n params: match.params,\n context: requestContext\n }), abortPromise]);\n invariant(result !== undefined, \"You defined \" + (type === \"action\" ? \"an action\" : \"a loader\") + \" for route \" + (\"\\\"\" + match.route.id + \"\\\" but didn't return anything from your `\" + type + \"` \") + \"function. Please return a value or `null`.\");\n } catch (e) {\n resultType = ResultType.error;\n result = e;\n } finally {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n\n if (isResponse(result)) {\n let status = result.status; // Process redirects\n\n if (redirectStatusCodes.has(status)) {\n let location = result.headers.get(\"Location\");\n invariant(location, \"Redirects returned/thrown from loaders/actions must have a Location header\");\n let isAbsolute = /^[a-z+]+:\\/\\//i.test(location) || location.startsWith(\"//\"); // Support relative routing in internal redirects\n\n if (!isAbsolute) {\n let activeMatches = matches.slice(0, matches.indexOf(match) + 1);\n let routePathnames = getPathContributingMatches(activeMatches).map(match => match.pathnameBase);\n let resolvedLocation = resolveTo(location, routePathnames, new URL(request.url).pathname);\n invariant(createPath(resolvedLocation), \"Unable to resolve redirect location: \" + location); // Prepend the basename to the redirect location if we have one\n\n if (basename) {\n let path = resolvedLocation.pathname;\n resolvedLocation.pathname = path === \"/\" ? basename : joinPaths([basename, path]);\n }\n\n location = createPath(resolvedLocation);\n } // Don't process redirects in the router during static requests requests.\n // Instead, throw the Response and let the server handle it with an HTTP\n // redirect. We also update the Location header in place in this flow so\n // basename and relative routing is taken into account\n\n\n if (isStaticRequest) {\n result.headers.set(\"Location\", location);\n throw result;\n }\n\n return {\n type: ResultType.redirect,\n status,\n location,\n revalidate: result.headers.get(\"X-Remix-Revalidate\") !== null\n };\n } // For SSR single-route requests, we want to hand Responses back directly\n // without unwrapping. We do this with the QueryRouteResponse wrapper\n // interface so we can know whether it was returned or thrown\n\n\n if (isRouteRequest) {\n // eslint-disable-next-line no-throw-literal\n throw {\n type: resultType || ResultType.data,\n response: result\n };\n }\n\n let data;\n let contentType = result.headers.get(\"Content-Type\"); // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n data = await result.json();\n } else {\n data = await result.text();\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: new ErrorResponse(status, result.statusText, data),\n headers: result.headers\n };\n }\n\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers\n };\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: result\n };\n }\n\n if (result instanceof DeferredData) {\n return {\n type: ResultType.deferred,\n deferredData: result\n };\n }\n\n return {\n type: ResultType.data,\n data: result\n };\n} // Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\n\n\nfunction createClientSideRequest(location, signal, submission) {\n let url = createClientSideURL(stripHashFromPath(location)).toString();\n let init = {\n signal\n };\n\n if (submission && isMutationMethod(submission.formMethod)) {\n let {\n formMethod,\n formEncType,\n formData\n } = submission;\n init.method = formMethod.toUpperCase();\n init.body = formEncType === \"application/x-www-form-urlencoded\" ? convertFormDataToSearchParams(formData) : formData;\n } // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n\n\n return new Request(url, init);\n}\n\nfunction convertFormDataToSearchParams(formData) {\n let searchParams = new URLSearchParams();\n\n for (let [key, value] of formData.entries()) {\n invariant(typeof value === \"string\", 'File inputs are not supported with encType \"application/x-www-form-urlencoded\", ' + 'please use \"multipart/form-data\" instead.');\n searchParams.append(key, value);\n }\n\n return searchParams;\n}\n\nfunction processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) {\n // Fill in loaderData/errors from our loaders\n let loaderData = {};\n let errors = null;\n let statusCode;\n let foundError = false;\n let loaderHeaders = {}; // Process loader results into state.loaderData/state.errors\n\n results.forEach((result, index) => {\n let id = matchesToLoad[index].route.id;\n invariant(!isRedirectResult(result), \"Cannot handle redirect results in processLoaderData\");\n\n if (isErrorResult(result)) {\n // Look upwards from the matched route for the closest ancestor\n // error boundary, defaulting to the root match\n let boundaryMatch = findNearestBoundary(matches, id);\n let error = result.error; // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n\n if (pendingError) {\n error = Object.values(pendingError)[0];\n pendingError = undefined;\n }\n\n errors = errors || {}; // Prefer higher error values if lower errors bubble to the same boundary\n\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n } // Clear our any prior loaderData for the throwing route\n\n\n loaderData[id] = undefined; // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;\n }\n\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else if (isDeferredResult(result)) {\n activeDeferreds && activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data; // TODO: Add statusCode/headers once we wire up streaming in Remix\n } else {\n loaderData[id] = result.data; // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n\n if (result.statusCode != null && result.statusCode !== 200 && !foundError) {\n statusCode = result.statusCode;\n }\n\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n }); // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n\n if (pendingError) {\n errors = pendingError;\n loaderData[Object.keys(pendingError)[0]] = undefined;\n }\n\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders\n };\n}\n\nfunction processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) {\n let {\n loaderData,\n errors\n } = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds); // Process results from our revalidating fetchers\n\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let [key,, match] = revalidatingFetchers[index];\n invariant(fetcherResults !== undefined && fetcherResults[index] !== undefined, \"Did not find corresponding fetcher result\");\n let result = fetcherResults[index]; // Process fetcher non-redirect errors\n\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match.route.id);\n\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = _extends({}, errors, {\n [boundaryMatch.route.id]: result.error\n });\n }\n\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n throw new Error(\"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n throw new Error(\"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n return {\n loaderData,\n errors\n };\n}\n\nfunction mergeLoaderData(loaderData, newLoaderData, matches, errors) {\n let mergedLoaderData = _extends({}, newLoaderData);\n\n for (let match of matches) {\n let id = match.route.id;\n\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n }\n } else if (loaderData[id] !== undefined) {\n mergedLoaderData[id] = loaderData[id];\n }\n\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n\n return mergedLoaderData;\n} // Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\n\n\nfunction findNearestBoundary(matches, routeId) {\n let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches];\n return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0];\n}\n\nfunction getShortCircuitMatches(routes) {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.find(r => r.index || !r.path || r.path === \"/\") || {\n id: \"__shim-error-route__\"\n };\n return {\n matches: [{\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route\n }],\n route\n };\n}\n\nfunction getInternalRouterError(status, _temp4) {\n let {\n pathname,\n routeId,\n method\n } = _temp4 === void 0 ? {} : _temp4;\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n\n if (status === 400) {\n statusText = \"Bad Request\";\n\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide a `loader` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else {\n errorMessage = \"Cannot submit binary form data using GET\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = \"Route \\\"\" + routeId + \"\\\" does not match URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = \"No route matches URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method.toUpperCase() + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide an `action` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else if (method) {\n errorMessage = \"Invalid request method \\\"\" + method.toUpperCase() + \"\\\"\";\n }\n }\n\n return new ErrorResponse(status || 500, statusText, new Error(errorMessage), true);\n} // Find any returned redirect errors, starting from the lowest match\n\n\nfunction findRedirect(results) {\n for (let i = results.length - 1; i >= 0; i--) {\n let result = results[i];\n\n if (isRedirectResult(result)) {\n return result;\n }\n }\n}\n\nfunction stripHashFromPath(path) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath(_extends({}, parsedPath, {\n hash: \"\"\n }));\n}\n\nfunction isHashChangeOnly(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash !== b.hash;\n}\n\nfunction isDeferredResult(result) {\n return result.type === ResultType.deferred;\n}\n\nfunction isErrorResult(result) {\n return result.type === ResultType.error;\n}\n\nfunction isRedirectResult(result) {\n return (result && result.type) === ResultType.redirect;\n}\n\nfunction isResponse(value) {\n return value != null && typeof value.status === \"number\" && typeof value.statusText === \"string\" && typeof value.headers === \"object\" && typeof value.body !== \"undefined\";\n}\n\nfunction isRedirectResponse(result) {\n if (!isResponse(result)) {\n return false;\n }\n\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\n\nfunction isQueryRouteResponse(obj) {\n return obj && isResponse(obj.response) && (obj.type === ResultType.data || ResultType.error);\n}\n\nfunction isValidMethod(method) {\n return validRequestMethods.has(method);\n}\n\nfunction isMutationMethod(method) {\n return validMutationMethods.has(method);\n}\n\nasync function resolveDeferredResults(currentMatches, matchesToLoad, results, signal, isFetcher, currentLoaderData) {\n for (let index = 0; index < results.length; index++) {\n let result = results[index];\n let match = matchesToLoad[index];\n let currentMatch = currentMatches.find(m => m.route.id === match.route.id);\n let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n\n if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n await resolveDeferredData(result, signal, isFetcher).then(result => {\n if (result) {\n results[index] = result || results[index];\n }\n });\n }\n }\n}\n\nasync function resolveDeferredData(result, signal, unwrap) {\n if (unwrap === void 0) {\n unwrap = false;\n }\n\n let aborted = await result.deferredData.resolveData(signal);\n\n if (aborted) {\n return;\n }\n\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e\n };\n }\n }\n\n return {\n type: ResultType.data,\n data: result.deferredData.data\n };\n}\n\nfunction hasNakedIndexQuery(search) {\n return new URLSearchParams(search).getAll(\"index\").some(v => v === \"\");\n} // Note: This should match the format exported by useMatches, so if you change\n// this please also change that :) Eventually we'll DRY this up\n\n\nfunction createUseMatchesMatch(match, loaderData) {\n let {\n route,\n pathname,\n params\n } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id],\n handle: route.handle\n };\n}\n\nfunction getTargetMatch(matches, location) {\n let search = typeof location === \"string\" ? parsePath(location).search : location.search;\n\n if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || \"\")) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n } // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n\n\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n} //#endregion\n\nexport { AbortedDeferredError, Action, ErrorResponse, IDLE_FETCHER, IDLE_NAVIGATION, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, createStaticHandler, defer, generatePath, getStaticContextFromError, getToPathname, invariant, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, resolvePath, resolveTo, stripBasename, warning };\n//# sourceMappingURL=router.js.map\n","/**\n * React Router v6.6.2\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { invariant, joinPaths, matchPath, UNSAFE_getPathContributingMatches, warning, resolveTo, parsePath, matchRoutes, Action, isRouteErrorResponse, createMemoryHistory, stripBasename, AbortedDeferredError, createRouter } from '@remix-run/router';\nexport { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from '@remix-run/router';\nimport * as React from 'react';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n\nfunction isPolyfill(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nconst is = typeof Object.is === \"function\" ? Object.is : isPolyfill; // Intentionally not using named imports because Rollup uses dynamic\n// dispatch for CommonJS interop named imports.\n\nconst {\n useState,\n useEffect,\n useLayoutEffect,\n useDebugValue\n} = React;\nlet didWarnOld18Alpha = false;\nlet didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works\n// because of a very particular set of implementation details and assumptions\n// -- change any one of them and it will break. The most important assumption\n// is that updates are always synchronous, because concurrent rendering is\n// only available in versions of React that also have a built-in\n// useSyncExternalStore API. And we only use this shim when the built-in API\n// does not exist.\n//\n// Do not assume that the clever hacks used by this hook also work in general.\n// The point of this shim is to replace the need for hacks by other libraries.\n\nfunction useSyncExternalStore$2(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n// React do not expose a way to check if we're hydrating. So users of the shim\n// will need to track that themselves and return the correct value\n// from `getSnapshot`.\ngetServerSnapshot) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!didWarnOld18Alpha) {\n if (\"startTransition\" in React) {\n didWarnOld18Alpha = true;\n console.error(\"You are using an outdated, pre-release alpha of React 18 that \" + \"does not support useSyncExternalStore. The \" + \"use-sync-external-store shim will not work correctly. Upgrade \" + \"to a newer pre-release.\");\n }\n }\n } // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n\n\n const value = getSnapshot();\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!didWarnUncachedGetSnapshot) {\n const cachedValue = getSnapshot();\n\n if (!is(value, cachedValue)) {\n console.error(\"The result of getSnapshot should be cached to avoid an infinite loop\");\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n\n\n const [{\n inst\n }, forceUpdate] = useState({\n inst: {\n value,\n getSnapshot\n }\n }); // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing check that\n // happens on subscribe.\n\n useLayoutEffect(() => {\n inst.value = value;\n inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, [subscribe, value, getSnapshot]);\n useEffect(() => {\n // Check for changes right before subscribing. Subsequent changes will be\n // detected in the subscription handler.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n }\n\n const handleStoreChange = () => {\n // TODO: Because there is no cross-renderer API for batching updates, it's\n // up to the consumer of this library to wrap their subscription event\n // with unstable_batchedUpdates. Should we try to detect when this isn't\n // the case and print a warning in development?\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange); // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [subscribe]);\n useDebugValue(value);\n return value;\n}\n\nfunction checkIfSnapshotChanged(inst) {\n const latestGetSnapshot = inst.getSnapshot;\n const prevValue = inst.value;\n\n try {\n const nextValue = latestGetSnapshot();\n return !is(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\nfunction useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {\n // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n // React do not expose a way to check if we're hydrating. So users of the shim\n // will need to track that themselves and return the correct value\n // from `getSnapshot`.\n return getSnapshot();\n}\n\n/**\n * Inlined into the react-router repo since use-sync-external-store does not\n * provide a UMD-compatible package, so we need this to be able to distribute\n * UMD react-router bundles\n */\nconst canUseDOM = !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nconst isServerEnvironment = !canUseDOM;\nconst shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2;\nconst useSyncExternalStore = \"useSyncExternalStore\" in React ? (module => module.useSyncExternalStore)(React) : shim;\n\nconst DataRouterContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterContext.displayName = \"DataRouter\";\n}\n\nconst DataRouterStateContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterStateContext.displayName = \"DataRouterState\";\n}\n\nconst AwaitContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n AwaitContext.displayName = \"Await\";\n}\n\nconst NavigationContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n NavigationContext.displayName = \"Navigation\";\n}\n\nconst LocationContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n LocationContext.displayName = \"Location\";\n}\n\nconst RouteContext = /*#__PURE__*/React.createContext({\n outlet: null,\n matches: []\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n RouteContext.displayName = \"Route\";\n}\n\nconst RouteErrorContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n RouteErrorContext.displayName = \"RouteError\";\n}\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/hooks/use-href\n */\n\nfunction useHref(to, _temp) {\n let {\n relative\n } = _temp === void 0 ? {} : _temp;\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useHref() may be used only in the context of a <Router> component.\") : invariant(false) : void 0;\n let {\n basename,\n navigator\n } = React.useContext(NavigationContext);\n let {\n hash,\n pathname,\n search\n } = useResolvedPath(to, {\n relative\n });\n let joinedPathname = pathname; // If we're operating within a basename, prepend it to the pathname prior\n // to creating the href. If this is a root navigation, then just use the raw\n // basename which allows the basename to have full control over the presence\n // of a trailing slash on root links\n\n if (basename !== \"/\") {\n joinedPathname = pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n\n return navigator.createHref({\n pathname: joinedPathname,\n search,\n hash\n });\n}\n/**\n * Returns true if this component is a descendant of a <Router>.\n *\n * @see https://reactrouter.com/hooks/use-in-router-context\n */\n\nfunction useInRouterContext() {\n return React.useContext(LocationContext) != null;\n}\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/hooks/use-location\n */\n\nfunction useLocation() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useLocation() may be used only in the context of a <Router> component.\") : invariant(false) : void 0;\n return React.useContext(LocationContext).location;\n}\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/hooks/use-navigation-type\n */\n\nfunction useNavigationType() {\n return React.useContext(LocationContext).navigationType;\n}\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * <NavLink>.\n *\n * @see https://reactrouter.com/hooks/use-match\n */\n\nfunction useMatch(pattern) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useMatch() may be used only in the context of a <Router> component.\") : invariant(false) : void 0;\n let {\n pathname\n } = useLocation();\n return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);\n}\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\n\n/**\n * Returns an imperative method for changing the location. Used by <Link>s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/hooks/use-navigate\n */\nfunction useNavigate() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useNavigate() may be used only in the context of a <Router> component.\") : invariant(false) : void 0;\n let {\n basename,\n navigator\n } = React.useContext(NavigationContext);\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));\n let activeRef = React.useRef(false);\n React.useEffect(() => {\n activeRef.current = true;\n });\n let navigate = React.useCallback(function (to, options) {\n if (options === void 0) {\n options = {};\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(activeRef.current, \"You should call navigate() in a React.useEffect(), not when \" + \"your component is first rendered.\") : void 0;\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n\n let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === \"path\"); // If we're operating within a basename, prepend it to the pathname prior\n // to handing off to history. If this is a root navigation, then we\n // navigate to the raw basename which allows the basename to have full\n // control over the presence of a trailing slash on root links\n\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);\n }, [basename, navigator, routePathnamesJson, locationPathname]);\n return navigate;\n}\nconst OutletContext = /*#__PURE__*/React.createContext(null);\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/hooks/use-outlet-context\n */\n\nfunction useOutletContext() {\n return React.useContext(OutletContext);\n}\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by <Outlet> to render child routes.\n *\n * @see https://reactrouter.com/hooks/use-outlet\n */\n\nfunction useOutlet(context) {\n let outlet = React.useContext(RouteContext).outlet;\n\n if (outlet) {\n return /*#__PURE__*/React.createElement(OutletContext.Provider, {\n value: context\n }, outlet);\n }\n\n return outlet;\n}\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/hooks/use-params\n */\n\nfunction useParams() {\n let {\n matches\n } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? routeMatch.params : {};\n}\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/hooks/use-resolved-path\n */\n\nfunction useResolvedPath(to, _temp2) {\n let {\n relative\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));\n return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === \"path\"), [to, routePathnamesJson, locationPathname, relative]);\n}\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an <Outlet> to render their child route's\n * element.\n *\n * @see https://reactrouter.com/hooks/use-routes\n */\n\nfunction useRoutes(routes, locationArg) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useRoutes() may be used only in the context of a <Router> component.\") : invariant(false) : void 0;\n let {\n navigator\n } = React.useContext(NavigationContext);\n let dataRouterStateContext = React.useContext(DataRouterStateContext);\n let {\n matches: parentMatches\n } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n\n if (process.env.NODE_ENV !== \"production\") {\n // You won't get a warning about 2 different <Routes> under a <Route>\n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // <Routes>\n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // <Route path=\"blog\" element={<Blog />} />\n // <Route path=\"blog/feed\" element={<BlogFeed />} />\n // </Routes>\n //\n // function Blog() {\n // return (\n // <Routes>\n // <Route path=\"post/:id\" element={<Post />} />\n // </Routes>\n // );\n // }\n let parentPath = parentRoute && parentRoute.path || \"\";\n warningOnce(parentPathname, !parentRoute || parentPath.endsWith(\"*\"), \"You rendered descendant <Routes> (or called `useRoutes()`) at \" + (\"\\\"\" + parentPathname + \"\\\" (under <Route path=\\\"\" + parentPath + \"\\\">) but the \") + \"parent route path has no trailing \\\"*\\\". This means if you navigate \" + \"deeper, the parent won't match anymore and therefore the child \" + \"routes will never render.\\n\\n\" + (\"Please change the parent <Route path=\\\"\" + parentPath + \"\\\"> to <Route \") + (\"path=\\\"\" + (parentPath === \"/\" ? \"*\" : parentPath + \"/*\") + \"\\\">.\"));\n }\n\n let locationFromContext = useLocation();\n let location;\n\n if (locationArg) {\n var _parsedLocationArg$pa;\n\n let parsedLocationArg = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n !(parentPathnameBase === \"/\" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, \" + \"the location pathname must begin with the portion of the URL pathname that was \" + (\"matched by all parent routes. The current pathname base is \\\"\" + parentPathnameBase + \"\\\" \") + (\"but pathname \\\"\" + parsedLocationArg.pathname + \"\\\" was given in the `location` prop.\")) : invariant(false) : void 0;\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n\n let pathname = location.pathname || \"/\";\n let remainingPathname = parentPathnameBase === \"/\" ? pathname : pathname.slice(parentPathnameBase.length) || \"/\";\n let matches = matchRoutes(routes, {\n pathname: remainingPathname\n });\n\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? warning(parentRoute || matches != null, \"No routes matched location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \") : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(matches == null || matches[matches.length - 1].route.element !== undefined, \"Matched leaf route at location \\\"\" + location.pathname + location.search + location.hash + \"\\\" does not have an element. \" + \"This means it will render an <Outlet /> with a null value by default resulting in an \\\"empty\\\" page.\") : void 0;\n }\n\n let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]),\n pathnameBase: match.pathnameBase === \"/\" ? parentPathnameBase : joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase])\n })), parentMatches, dataRouterStateContext || undefined); // When a user passes in a `locationArg`, the associated routes need to\n // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n // to use the scoped location instead of the global location.\n\n\n if (locationArg && renderedMatches) {\n return /*#__PURE__*/React.createElement(LocationContext.Provider, {\n value: {\n location: _extends({\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n state: null,\n key: \"default\"\n }, location),\n navigationType: Action.Pop\n }\n }, renderedMatches);\n }\n\n return renderedMatches;\n}\n\nfunction DefaultErrorElement() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error) ? error.status + \" \" + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);\n let stack = error instanceof Error ? error.stack : null;\n let lightgrey = \"rgba(200,200,200, 0.5)\";\n let preStyles = {\n padding: \"0.5rem\",\n backgroundColor: lightgrey\n };\n let codeStyles = {\n padding: \"2px 4px\",\n backgroundColor: lightgrey\n };\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"h2\", null, \"Unhandled Thrown Error!\"), /*#__PURE__*/React.createElement(\"h3\", {\n style: {\n fontStyle: \"italic\"\n }\n }, message), stack ? /*#__PURE__*/React.createElement(\"pre\", {\n style: preStyles\n }, stack) : null, /*#__PURE__*/React.createElement(\"p\", null, \"\\uD83D\\uDCBF Hey developer \\uD83D\\uDC4B\"), /*#__PURE__*/React.createElement(\"p\", null, \"You can provide a way better UX than this when your app throws errors by providing your own\\xA0\", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"errorElement\"), \" props on\\xA0\", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"<Route>\")));\n}\n\nclass RenderErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n location: props.location,\n error: props.error\n };\n }\n\n static getDerivedStateFromError(error) {\n return {\n error: error\n };\n }\n\n static getDerivedStateFromProps(props, state) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application, that will have no effect--the error page continues to display.\n // This gives us a mechanism to recover from the error when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (state.location !== props.location) {\n return {\n error: props.error,\n location: props.location\n };\n } // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n\n\n return {\n error: props.error || state.error,\n location: state.location\n };\n }\n\n componentDidCatch(error, errorInfo) {\n console.error(\"React Router caught the following error during render\", error, errorInfo);\n }\n\n render() {\n return this.state.error ? /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: this.props.routeContext\n }, /*#__PURE__*/React.createElement(RouteErrorContext.Provider, {\n value: this.state.error,\n children: this.props.component\n })) : this.props.children;\n }\n\n}\n\nfunction RenderedRoute(_ref) {\n let {\n routeContext,\n match,\n children\n } = _ref;\n let dataRouterContext = React.useContext(DataRouterContext); // Track how deep we got in our render pass to emulate SSR componentDidCatch\n // in a DataStaticRouter\n\n if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && match.route.errorElement) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n\n return /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: routeContext\n }, children);\n}\n\nfunction _renderMatches(matches, parentMatches, dataRouterState) {\n if (parentMatches === void 0) {\n parentMatches = [];\n }\n\n if (matches == null) {\n if (dataRouterState != null && dataRouterState.errors) {\n // Don't bail if we have data router errors so we can render them in the\n // boundary. Use the pre-matched (or shimmed) matches\n matches = dataRouterState.matches;\n } else {\n return null;\n }\n }\n\n let renderedMatches = matches; // If we have data errors, trim matches to the highest error boundary\n\n let errors = dataRouterState == null ? void 0 : dataRouterState.errors;\n\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));\n !(errorIndex >= 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not find a matching route for the current errors: \" + errors) : invariant(false) : void 0;\n renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));\n }\n\n return renderedMatches.reduceRight((outlet, match, index) => {\n let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null; // Only data routers handle errors\n\n let errorElement = dataRouterState ? match.route.errorElement || /*#__PURE__*/React.createElement(DefaultErrorElement, null) : null;\n let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n\n let getChildren = () => /*#__PURE__*/React.createElement(RenderedRoute, {\n match: match,\n routeContext: {\n outlet,\n matches\n }\n }, error ? errorElement : match.route.element !== undefined ? match.route.element : outlet); // Only wrap in an error boundary within data router usages when we have an\n // errorElement on this route. Otherwise let it bubble up to an ancestor\n // errorElement\n\n\n return dataRouterState && (match.route.errorElement || index === 0) ? /*#__PURE__*/React.createElement(RenderErrorBoundary, {\n location: dataRouterState.location,\n component: errorElement,\n error: error,\n children: getChildren(),\n routeContext: {\n outlet: null,\n matches\n }\n }) : getChildren();\n }, null);\n}\nvar DataRouterHook;\n\n(function (DataRouterHook) {\n DataRouterHook[\"UseRevalidator\"] = \"useRevalidator\";\n})(DataRouterHook || (DataRouterHook = {}));\n\nvar DataRouterStateHook;\n\n(function (DataRouterStateHook) {\n DataRouterStateHook[\"UseLoaderData\"] = \"useLoaderData\";\n DataRouterStateHook[\"UseActionData\"] = \"useActionData\";\n DataRouterStateHook[\"UseRouteError\"] = \"useRouteError\";\n DataRouterStateHook[\"UseNavigation\"] = \"useNavigation\";\n DataRouterStateHook[\"UseRouteLoaderData\"] = \"useRouteLoaderData\";\n DataRouterStateHook[\"UseMatches\"] = \"useMatches\";\n DataRouterStateHook[\"UseRevalidator\"] = \"useRevalidator\";\n})(DataRouterStateHook || (DataRouterStateHook = {}));\n\nfunction getDataRouterConsoleError(hookName) {\n return hookName + \" must be used within a data router. See https://reactrouter.com/routers/picking-a-router.\";\n}\n\nfunction useDataRouterContext(hookName) {\n let ctx = React.useContext(DataRouterContext);\n !ctx ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return ctx;\n}\n\nfunction useDataRouterState(hookName) {\n let state = React.useContext(DataRouterStateContext);\n !state ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return state;\n}\n\nfunction useRouteContext(hookName) {\n let route = React.useContext(RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return route;\n}\n\nfunction useCurrentRouteId(hookName) {\n let route = useRouteContext(hookName);\n let thisRoute = route.matches[route.matches.length - 1];\n !thisRoute.route.id ? process.env.NODE_ENV !== \"production\" ? invariant(false, hookName + \" can only be used on routes that contain a unique \\\"id\\\"\") : invariant(false) : void 0;\n return thisRoute.route.id;\n}\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\n\n\nfunction useNavigation() {\n let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n return state.navigation;\n}\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\n\nfunction useRevalidator() {\n let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n return {\n revalidate: dataRouterContext.router.revalidate,\n state: state.revalidation\n };\n}\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\n\nfunction useMatches() {\n let {\n matches,\n loaderData\n } = useDataRouterState(DataRouterStateHook.UseMatches);\n return React.useMemo(() => matches.map(match => {\n let {\n pathname,\n params\n } = match; // Note: This structure matches that created by createUseMatchesMatch\n // in the @remix-run/router , so if you change this please also change\n // that :) Eventually we'll DRY this up\n\n return {\n id: match.route.id,\n pathname,\n params,\n data: loaderData[match.route.id],\n handle: match.route.handle\n };\n }), [matches, loaderData]);\n}\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\n\nfunction useLoaderData() {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n\n if (state.errors && state.errors[routeId] != null) {\n console.error(\"You cannot `useLoaderData` in an errorElement (routeId: \" + routeId + \")\");\n return undefined;\n }\n\n return state.loaderData[routeId];\n}\n/**\n * Returns the loaderData for the given routeId\n */\n\nfunction useRouteLoaderData(routeId) {\n let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n return state.loaderData[routeId];\n}\n/**\n * Returns the action data for the nearest ancestor Route action\n */\n\nfunction useActionData() {\n let state = useDataRouterState(DataRouterStateHook.UseActionData);\n let route = React.useContext(RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"useActionData must be used inside a RouteContext\") : invariant(false) : void 0;\n return Object.values((state == null ? void 0 : state.actionData) || {})[0];\n}\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error. This is intended to be called from your\n * errorElement to display a proper error message.\n */\n\nfunction useRouteError() {\n var _state$errors;\n\n let error = React.useContext(RouteErrorContext);\n let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError); // If this was a render error, we put it in a RouteError context inside\n // of RenderErrorBoundary\n\n if (error) {\n return error;\n } // Otherwise look for errors from our data router state\n\n\n return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];\n}\n/**\n * Returns the happy-path data from the nearest ancestor <Await /> value\n */\n\nfunction useAsyncValue() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._data;\n}\n/**\n * Returns the error from the nearest ancestor <Await /> value\n */\n\nfunction useAsyncError() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._error;\n}\nconst alreadyWarned = {};\n\nfunction warningOnce(key, cond, message) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n process.env.NODE_ENV !== \"production\" ? warning(false, message) : void 0;\n }\n}\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n let {\n fallbackElement,\n router\n } = _ref;\n // Sync router state to our component state to force re-renders\n let state = useSyncExternalStore(router.subscribe, () => router.state, // We have to provide this so React@18 doesn't complain during hydration,\n // but we pass our serialized hydration data into the router so state here\n // is already synced with what the server saw\n () => router.state);\n let navigator = React.useMemo(() => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: n => router.navigate(n),\n push: (to, state, opts) => router.navigate(to, {\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n }),\n replace: (to, state, opts) => router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n })\n };\n }, [router]);\n let basename = router.basename || \"/\"; // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a <script> here\n // containing the hydrated server-side staticContext (from StaticRouterProvider).\n // useId relies on the component tree structure to generate deterministic id's\n // so we need to ensure it remains the same on the client even though\n // we don't need the <script> tag\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataRouterContext.Provider, {\n value: {\n router,\n navigator,\n static: false,\n // Do we need this?\n basename\n }\n }, /*#__PURE__*/React.createElement(DataRouterStateContext.Provider, {\n value: state\n }, /*#__PURE__*/React.createElement(Router, {\n basename: router.basename,\n location: router.state.location,\n navigationType: router.state.historyAction,\n navigator: navigator\n }, router.state.initialized ? /*#__PURE__*/React.createElement(Routes, null) : fallbackElement))), null);\n}\n\n/**\n * A <Router> that stores all entries in memory.\n *\n * @see https://reactrouter.com/router-components/memory-router\n */\nfunction MemoryRouter(_ref2) {\n let {\n basename,\n children,\n initialEntries,\n initialIndex\n } = _ref2;\n let historyRef = React.useRef();\n\n if (historyRef.current == null) {\n historyRef.current = createMemoryHistory({\n initialEntries,\n initialIndex,\n v5Compat: true\n });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location\n });\n React.useLayoutEffect(() => history.listen(setState), [history]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n });\n}\n\n/**\n * Changes the current location.\n *\n * Note: This API is mostly useful in React.Component subclasses that are not\n * able to use hooks. In functional components, we recommend you use the\n * `useNavigate` hook instead.\n *\n * @see https://reactrouter.com/components/navigate\n */\nfunction Navigate(_ref3) {\n let {\n to,\n replace,\n state,\n relative\n } = _ref3;\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of\n // the router loaded. We can help them understand how to avoid that.\n \"<Navigate> may be used only in the context of a <Router> component.\") : invariant(false) : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!React.useContext(NavigationContext).static, \"<Navigate> must not be used on the initial render in a <StaticRouter>. \" + \"This is a no-op, but you should modify your code so the <Navigate> is \" + \"only ever rendered in response to some user interaction or state change.\") : void 0;\n let dataRouterState = React.useContext(DataRouterStateContext);\n let navigate = useNavigate();\n React.useEffect(() => {\n // Avoid kicking off multiple navigations if we're in the middle of a\n // data-router navigation, since components get re-rendered when we enter\n // a submitting/loading state\n if (dataRouterState && dataRouterState.navigation.state !== \"idle\") {\n return;\n }\n\n navigate(to, {\n replace,\n state,\n relative\n });\n });\n return null;\n}\n\n/**\n * Renders the child route's element, if there is one.\n *\n * @see https://reactrouter.com/components/outlet\n */\nfunction Outlet(props) {\n return useOutlet(props.context);\n}\n\n/**\n * Declares an element that should be rendered at a certain URL path.\n *\n * @see https://reactrouter.com/components/route\n */\nfunction Route(_props) {\n process.env.NODE_ENV !== \"production\" ? invariant(false, \"A <Route> is only ever to be used as the child of <Routes> element, \" + \"never rendered directly. Please wrap your <Route> in a <Routes>.\") : invariant(false) ;\n}\n\n/**\n * Provides location context for the rest of the app.\n *\n * Note: You usually won't render a <Router> directly. Instead, you'll render a\n * router that is more specific to your environment such as a <BrowserRouter>\n * in web browsers or a <StaticRouter> for server rendering.\n *\n * @see https://reactrouter.com/router-components/router\n */\nfunction Router(_ref4) {\n let {\n basename: basenameProp = \"/\",\n children = null,\n location: locationProp,\n navigationType = Action.Pop,\n navigator,\n static: staticProp = false\n } = _ref4;\n !!useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"You cannot render a <Router> inside another <Router>.\" + \" You should never have more than one in your app.\") : invariant(false) : void 0; // Preserve trailing slashes on basename, so we can let the user control\n // the enforcement of trailing slashes throughout the app\n\n let basename = basenameProp.replace(/^\\/*/, \"/\");\n let navigationContext = React.useMemo(() => ({\n basename,\n navigator,\n static: staticProp\n }), [basename, navigator, staticProp]);\n\n if (typeof locationProp === \"string\") {\n locationProp = parsePath(locationProp);\n }\n\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n state = null,\n key = \"default\"\n } = locationProp;\n let location = React.useMemo(() => {\n let trailingPathname = stripBasename(pathname, basename);\n\n if (trailingPathname == null) {\n return null;\n }\n\n return {\n pathname: trailingPathname,\n search,\n hash,\n state,\n key\n };\n }, [basename, pathname, search, hash, state, key]);\n process.env.NODE_ENV !== \"production\" ? warning(location != null, \"<Router basename=\\\"\" + basename + \"\\\"> is not able to match the URL \" + (\"\\\"\" + pathname + search + hash + \"\\\" because it does not start with the \") + \"basename, so the <Router> won't render anything.\") : void 0;\n\n if (location == null) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(NavigationContext.Provider, {\n value: navigationContext\n }, /*#__PURE__*/React.createElement(LocationContext.Provider, {\n children: children,\n value: {\n location,\n navigationType\n }\n }));\n}\n\n/**\n * A container for a nested tree of <Route> elements that renders the branch\n * that best matches the current location.\n *\n * @see https://reactrouter.com/components/routes\n */\nfunction Routes(_ref5) {\n let {\n children,\n location\n } = _ref5;\n let dataRouterContext = React.useContext(DataRouterContext); // When in a DataRouterContext _without_ children, we use the router routes\n // directly. If we have children, then we're in a descendant tree and we\n // need to use child routes.\n\n let routes = dataRouterContext && !children ? dataRouterContext.router.routes : createRoutesFromChildren(children);\n return useRoutes(routes, location);\n}\n\n/**\n * Component to use for rendering lazily loaded data from returning defer()\n * in a loader function\n */\nfunction Await(_ref6) {\n let {\n children,\n errorElement,\n resolve\n } = _ref6;\n return /*#__PURE__*/React.createElement(AwaitErrorBoundary, {\n resolve: resolve,\n errorElement: errorElement\n }, /*#__PURE__*/React.createElement(ResolveAwait, null, children));\n}\nvar AwaitRenderStatus;\n\n(function (AwaitRenderStatus) {\n AwaitRenderStatus[AwaitRenderStatus[\"pending\"] = 0] = \"pending\";\n AwaitRenderStatus[AwaitRenderStatus[\"success\"] = 1] = \"success\";\n AwaitRenderStatus[AwaitRenderStatus[\"error\"] = 2] = \"error\";\n})(AwaitRenderStatus || (AwaitRenderStatus = {}));\n\nconst neverSettledPromise = new Promise(() => {});\n\nclass AwaitErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null\n };\n }\n\n static getDerivedStateFromError(error) {\n return {\n error\n };\n }\n\n componentDidCatch(error, errorInfo) {\n console.error(\"<Await> caught the following error during render\", error, errorInfo);\n }\n\n render() {\n let {\n children,\n errorElement,\n resolve\n } = this.props;\n let promise = null;\n let status = AwaitRenderStatus.pending;\n\n if (!(resolve instanceof Promise)) {\n // Didn't get a promise - provide as a resolved promise\n status = AwaitRenderStatus.success;\n promise = Promise.resolve();\n Object.defineProperty(promise, \"_tracked\", {\n get: () => true\n });\n Object.defineProperty(promise, \"_data\", {\n get: () => resolve\n });\n } else if (this.state.error) {\n // Caught a render error, provide it as a rejected promise\n status = AwaitRenderStatus.error;\n let renderError = this.state.error;\n promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings\n\n Object.defineProperty(promise, \"_tracked\", {\n get: () => true\n });\n Object.defineProperty(promise, \"_error\", {\n get: () => renderError\n });\n } else if (resolve._tracked) {\n // Already tracked promise - check contents\n promise = resolve;\n status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;\n } else {\n // Raw (untracked) promise - track it\n status = AwaitRenderStatus.pending;\n Object.defineProperty(resolve, \"_tracked\", {\n get: () => true\n });\n promise = resolve.then(data => Object.defineProperty(resolve, \"_data\", {\n get: () => data\n }), error => Object.defineProperty(resolve, \"_error\", {\n get: () => error\n }));\n }\n\n if (status === AwaitRenderStatus.error && promise._error instanceof AbortedDeferredError) {\n // Freeze the UI by throwing a never resolved promise\n throw neverSettledPromise;\n }\n\n if (status === AwaitRenderStatus.error && !errorElement) {\n // No errorElement, throw to the nearest route-level error boundary\n throw promise._error;\n }\n\n if (status === AwaitRenderStatus.error) {\n // Render via our errorElement\n return /*#__PURE__*/React.createElement(AwaitContext.Provider, {\n value: promise,\n children: errorElement\n });\n }\n\n if (status === AwaitRenderStatus.success) {\n // Render children with resolved value\n return /*#__PURE__*/React.createElement(AwaitContext.Provider, {\n value: promise,\n children: children\n });\n } // Throw to the suspense boundary\n\n\n throw promise;\n }\n\n}\n/**\n * @private\n * Indirection to leverage useAsyncValue for a render-prop API on <Await>\n */\n\n\nfunction ResolveAwait(_ref7) {\n let {\n children\n } = _ref7;\n let data = useAsyncValue();\n\n if (typeof children === \"function\") {\n return children(data);\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, children);\n} ///////////////////////////////////////////////////////////////////////////////\n// UTILS\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * Creates a route config from a React \"children\" object, which is usually\n * either a `<Route>` element or an array of them. Used internally by\n * `<Routes>` to create a route config from its children.\n *\n * @see https://reactrouter.com/utils/create-routes-from-children\n */\n\n\nfunction createRoutesFromChildren(children, parentPath) {\n if (parentPath === void 0) {\n parentPath = [];\n }\n\n let routes = [];\n React.Children.forEach(children, (element, index) => {\n if (! /*#__PURE__*/React.isValidElement(element)) {\n // Ignore non-elements. This allows people to more easily inline\n // conditionals in their route config.\n return;\n }\n\n if (element.type === React.Fragment) {\n // Transparently support React.Fragment and its children.\n routes.push.apply(routes, createRoutesFromChildren(element.props.children, parentPath));\n return;\n }\n\n !(element.type === Route) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"[\" + (typeof element.type === \"string\" ? element.type : element.type.name) + \"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>\") : invariant(false) : void 0;\n !(!element.props.index || !element.props.children) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"An index route cannot have child routes.\") : invariant(false) : void 0;\n let treePath = [...parentPath, index];\n let route = {\n id: element.props.id || treePath.join(\"-\"),\n caseSensitive: element.props.caseSensitive,\n element: element.props.element,\n index: element.props.index,\n path: element.props.path,\n loader: element.props.loader,\n action: element.props.action,\n errorElement: element.props.errorElement,\n hasErrorBoundary: element.props.errorElement != null,\n shouldRevalidate: element.props.shouldRevalidate,\n handle: element.props.handle\n };\n\n if (element.props.children) {\n route.children = createRoutesFromChildren(element.props.children, treePath);\n }\n\n routes.push(route);\n });\n return routes;\n}\n/**\n * Renders the result of `matchRoutes()` into a React element.\n */\n\nfunction renderMatches(matches) {\n return _renderMatches(matches);\n}\n/**\n * @private\n * Walk the route tree and add hasErrorBoundary if it's not provided, so that\n * users providing manual route arrays can just specify errorElement\n */\n\nfunction enhanceManualRouteObjects(routes) {\n return routes.map(route => {\n let routeClone = _extends({}, route);\n\n if (routeClone.hasErrorBoundary == null) {\n routeClone.hasErrorBoundary = routeClone.errorElement != null;\n }\n\n if (routeClone.children) {\n routeClone.children = enhanceManualRouteObjects(routeClone.children);\n }\n\n return routeClone;\n });\n}\n\nfunction createMemoryRouter(routes, opts) {\n return createRouter({\n basename: opts == null ? void 0 : opts.basename,\n history: createMemoryHistory({\n initialEntries: opts == null ? void 0 : opts.initialEntries,\n initialIndex: opts == null ? void 0 : opts.initialIndex\n }),\n hydrationData: opts == null ? void 0 : opts.hydrationData,\n routes: enhanceManualRouteObjects(routes)\n }).initialize();\n} ///////////////////////////////////////////////////////////////////////////////\n\nexport { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, enhanceManualRouteObjects as UNSAFE_enhanceManualRouteObjects, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };\n//# sourceMappingURL=index.js.map\n","/**\n * React Router DOM v6.6.2\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { UNSAFE_enhanceManualRouteObjects, Router, useHref, useResolvedPath, useLocation, UNSAFE_DataRouterStateContext, UNSAFE_NavigationContext, useNavigate, createPath, UNSAFE_RouteContext, useMatches, useNavigation, UNSAFE_DataRouterContext } from 'react-router';\nexport { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_enhanceManualRouteObjects, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, renderMatches, resolvePath, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes } from 'react-router';\nimport { createRouter, createBrowserHistory, createHashHistory, ErrorResponse, invariant, joinPaths } from '@remix-run/router';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nconst defaultMethod = \"get\";\nconst defaultEncType = \"application/x-www-form-urlencoded\";\nfunction isHtmlElement(object) {\n return object != null && typeof object.tagName === \"string\";\n}\nfunction isButtonElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\nfunction isFormElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\nfunction isInputElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\n\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nfunction shouldProcessLinkClick(event, target) {\n return event.button === 0 && ( // Ignore everything but left clicks\n !target || target === \"_self\") && // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n ;\n}\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\n\nfunction createSearchParams(init) {\n if (init === void 0) {\n init = \"\";\n }\n\n return new URLSearchParams(typeof init === \"string\" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);\n }, []));\n}\nfunction getSearchParamsForLocation(locationSearch, defaultSearchParams) {\n let searchParams = createSearchParams(locationSearch);\n\n for (let key of defaultSearchParams.keys()) {\n if (!searchParams.has(key)) {\n defaultSearchParams.getAll(key).forEach(value => {\n searchParams.append(key, value);\n });\n }\n }\n\n return searchParams;\n}\nfunction getFormSubmissionInfo(target, defaultAction, options) {\n let method;\n let action;\n let encType;\n let formData;\n\n if (isFormElement(target)) {\n let submissionTrigger = options.submissionTrigger;\n method = options.method || target.getAttribute(\"method\") || defaultMethod;\n action = options.action || target.getAttribute(\"action\") || defaultAction;\n encType = options.encType || target.getAttribute(\"enctype\") || defaultEncType;\n formData = new FormData(target);\n\n if (submissionTrigger && submissionTrigger.name) {\n formData.append(submissionTrigger.name, submissionTrigger.value);\n }\n } else if (isButtonElement(target) || isInputElement(target) && (target.type === \"submit\" || target.type === \"image\")) {\n let form = target.form;\n\n if (form == null) {\n throw new Error(\"Cannot submit a <button> or <input type=\\\"submit\\\"> without a <form>\");\n } // <button>/<input type=\"submit\"> may override attributes of <form>\n\n\n method = options.method || target.getAttribute(\"formmethod\") || form.getAttribute(\"method\") || defaultMethod;\n action = options.action || target.getAttribute(\"formaction\") || form.getAttribute(\"action\") || defaultAction;\n encType = options.encType || target.getAttribute(\"formenctype\") || form.getAttribute(\"enctype\") || defaultEncType;\n formData = new FormData(form); // Include name + value from a <button>, appending in case the button name\n // matches an existing input name\n\n if (target.name) {\n formData.append(target.name, target.value);\n }\n } else if (isHtmlElement(target)) {\n throw new Error(\"Cannot submit element that is not <form>, <button>, or \" + \"<input type=\\\"submit|image\\\">\");\n } else {\n method = options.method || defaultMethod;\n action = options.action || defaultAction;\n encType = options.encType || defaultEncType;\n\n if (target instanceof FormData) {\n formData = target;\n } else {\n formData = new FormData();\n\n if (target instanceof URLSearchParams) {\n for (let [name, value] of target) {\n formData.append(name, value);\n }\n } else if (target != null) {\n for (let name of Object.keys(target)) {\n formData.append(name, target[name]);\n }\n }\n }\n }\n\n let {\n protocol,\n host\n } = window.location;\n let url = new URL(action, protocol + \"//\" + host);\n return {\n url,\n method: method.toLowerCase(),\n encType,\n formData\n };\n}\n\nconst _excluded = [\"onClick\", \"relative\", \"reloadDocument\", \"replace\", \"state\", \"target\", \"to\", \"preventScrollReset\"],\n _excluded2 = [\"aria-current\", \"caseSensitive\", \"className\", \"end\", \"style\", \"to\", \"children\"],\n _excluded3 = [\"reloadDocument\", \"replace\", \"method\", \"action\", \"onSubmit\", \"fetcherKey\", \"routeId\", \"relative\"];\n//#region Routers\n////////////////////////////////////////////////////////////////////////////////\n\nfunction createBrowserRouter(routes, opts) {\n return createRouter({\n basename: opts == null ? void 0 : opts.basename,\n history: createBrowserHistory({\n window: opts == null ? void 0 : opts.window\n }),\n hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n routes: UNSAFE_enhanceManualRouteObjects(routes)\n }).initialize();\n}\nfunction createHashRouter(routes, opts) {\n return createRouter({\n basename: opts == null ? void 0 : opts.basename,\n history: createHashHistory({\n window: opts == null ? void 0 : opts.window\n }),\n hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n routes: UNSAFE_enhanceManualRouteObjects(routes)\n }).initialize();\n}\n\nfunction parseHydrationData() {\n var _window;\n\n let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;\n\n if (state && state.errors) {\n state = _extends({}, state, {\n errors: deserializeErrors(state.errors)\n });\n }\n\n return state;\n}\n\nfunction deserializeErrors(errors) {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized = {};\n\n for (let [key, val] of entries) {\n // Hey you! If you change this, please change the corresponding logic in\n // serializeErrors in react-router-dom/server.tsx :)\n if (val && val.__type === \"RouteErrorResponse\") {\n serialized[key] = new ErrorResponse(val.status, val.statusText, val.data, val.internal === true);\n } else if (val && val.__type === \"Error\") {\n let error = new Error(val.message); // Wipe away the client-side stack trace. Nothing to fill it in with\n // because we don't serialize SSR stack traces for security reasons\n\n error.stack = \"\";\n serialized[key] = error;\n } else {\n serialized[key] = val;\n }\n }\n\n return serialized;\n}\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\n\n\nfunction BrowserRouter(_ref) {\n let {\n basename,\n children,\n window\n } = _ref;\n let historyRef = React.useRef();\n\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({\n window,\n v5Compat: true\n });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location\n });\n React.useLayoutEffect(() => history.listen(setState), [history]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n });\n}\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\n\nfunction HashRouter(_ref2) {\n let {\n basename,\n children,\n window\n } = _ref2;\n let historyRef = React.useRef();\n\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({\n window,\n v5Compat: true\n });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location\n });\n React.useLayoutEffect(() => history.listen(setState), [history]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n });\n}\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\n\nfunction HistoryRouter(_ref3) {\n let {\n basename,\n children,\n history\n } = _ref3;\n const [state, setState] = React.useState({\n action: history.action,\n location: history.location\n });\n React.useLayoutEffect(() => history.listen(setState), [history]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history\n });\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\n/**\n * The public API for rendering a history-aware <a>.\n */\n\nconst Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref4, ref) {\n let {\n onClick,\n relative,\n reloadDocument,\n replace,\n state,\n target,\n to,\n preventScrollReset\n } = _ref4,\n rest = _objectWithoutPropertiesLoose(_ref4, _excluded);\n\n let href = useHref(to, {\n relative\n });\n let internalOnClick = useLinkClickHandler(to, {\n replace,\n state,\n target,\n preventScrollReset,\n relative\n });\n\n function handleClick(event) {\n if (onClick) onClick(event);\n\n if (!event.defaultPrevented) {\n internalOnClick(event);\n }\n }\n\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n React.createElement(\"a\", _extends({}, rest, {\n href: href,\n onClick: reloadDocument ? onClick : handleClick,\n ref: ref,\n target: target\n }))\n );\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n Link.displayName = \"Link\";\n}\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\n\n\nconst NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref5, ref) {\n let {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n children\n } = _ref5,\n rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);\n\n let path = useResolvedPath(to, {\n relative: rest.relative\n });\n let location = useLocation();\n let routerState = React.useContext(UNSAFE_DataRouterStateContext);\n let {\n navigator\n } = React.useContext(UNSAFE_NavigationContext);\n let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;\n let locationPathname = location.pathname;\n let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;\n\n if (!caseSensitive) {\n locationPathname = locationPathname.toLowerCase();\n nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;\n toPathname = toPathname.toLowerCase();\n }\n\n let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === \"/\";\n let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === \"/\");\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n let className;\n\n if (typeof classNameProp === \"function\") {\n className = classNameProp({\n isActive,\n isPending\n });\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for <NavLink />s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [classNameProp, isActive ? \"active\" : null, isPending ? \"pending\" : null].filter(Boolean).join(\" \");\n }\n\n let style = typeof styleProp === \"function\" ? styleProp({\n isActive,\n isPending\n }) : styleProp;\n return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {\n \"aria-current\": ariaCurrent,\n className: className,\n ref: ref,\n style: style,\n to: to\n }), typeof children === \"function\" ? children({\n isActive,\n isPending\n }) : children);\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n NavLink.displayName = \"NavLink\";\n}\n/**\n * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except\n * that the interaction with the server is with `fetch` instead of new document\n * requests, allowing components to add nicer UX to the page as the form is\n * submitted and returns with data.\n */\n\n\nconst Form = /*#__PURE__*/React.forwardRef((props, ref) => {\n return /*#__PURE__*/React.createElement(FormImpl, _extends({}, props, {\n ref: ref\n }));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n Form.displayName = \"Form\";\n}\n\nconst FormImpl = /*#__PURE__*/React.forwardRef((_ref6, forwardedRef) => {\n let {\n reloadDocument,\n replace,\n method = defaultMethod,\n action,\n onSubmit,\n fetcherKey,\n routeId,\n relative\n } = _ref6,\n props = _objectWithoutPropertiesLoose(_ref6, _excluded3);\n\n let submit = useSubmitImpl(fetcherKey, routeId);\n let formMethod = method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n let formAction = useFormAction(action, {\n relative\n });\n\n let submitHandler = event => {\n onSubmit && onSubmit(event);\n if (event.defaultPrevented) return;\n event.preventDefault();\n let submitter = event.nativeEvent.submitter;\n let submitMethod = (submitter == null ? void 0 : submitter.getAttribute(\"formmethod\")) || method;\n submit(submitter || event.currentTarget, {\n method: submitMethod,\n replace,\n relative\n });\n };\n\n return /*#__PURE__*/React.createElement(\"form\", _extends({\n ref: forwardedRef,\n method: formMethod,\n action: formAction,\n onSubmit: reloadDocument ? onSubmit : submitHandler\n }, props));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n FormImpl.displayName = \"FormImpl\";\n}\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n */\n\n\nfunction ScrollRestoration(_ref7) {\n let {\n getKey,\n storageKey\n } = _ref7;\n useScrollRestoration({\n getKey,\n storageKey\n });\n return null;\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n ScrollRestoration.displayName = \"ScrollRestoration\";\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Hooks\n////////////////////////////////////////////////////////////////////////////////\n\n\nvar DataRouterHook;\n\n(function (DataRouterHook) {\n DataRouterHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n DataRouterHook[\"UseSubmitImpl\"] = \"useSubmitImpl\";\n DataRouterHook[\"UseFetcher\"] = \"useFetcher\";\n})(DataRouterHook || (DataRouterHook = {}));\n\nvar DataRouterStateHook;\n\n(function (DataRouterStateHook) {\n DataRouterStateHook[\"UseFetchers\"] = \"useFetchers\";\n DataRouterStateHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n})(DataRouterStateHook || (DataRouterStateHook = {}));\n\nfunction getDataRouterConsoleError(hookName) {\n return hookName + \" must be used within a data router. See https://reactrouter.com/routers/picking-a-router.\";\n}\n\nfunction useDataRouterContext(hookName) {\n let ctx = React.useContext(UNSAFE_DataRouterContext);\n !ctx ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return ctx;\n}\n\nfunction useDataRouterState(hookName) {\n let state = React.useContext(UNSAFE_DataRouterStateContext);\n !state ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return state;\n}\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\n\n\nfunction useLinkClickHandler(to, _temp) {\n let {\n target,\n replace: replaceProp,\n state,\n preventScrollReset,\n relative\n } = _temp === void 0 ? {} : _temp;\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to, {\n relative\n });\n return React.useCallback(event => {\n if (shouldProcessLinkClick(event, target)) {\n event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of\n // a push, so do the same here unless the replace prop is explicitly set\n\n let replace = replaceProp !== undefined ? replaceProp : createPath(location) === createPath(path);\n navigate(to, {\n replace,\n state,\n preventScrollReset,\n relative\n });\n }\n }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);\n}\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\n\nfunction useSearchParams(defaultInit) {\n process.env.NODE_ENV !== \"production\" ? warning(typeof URLSearchParams !== \"undefined\", \"You cannot use the `useSearchParams` hook in a browser that does not \" + \"support the URLSearchParams API. If you need to support Internet \" + \"Explorer 11, we recommend you load a polyfill such as \" + \"https://github.com/ungap/url-search-params\\n\\n\" + \"If you're unsure how to load polyfills, we recommend you check out \" + \"https://polyfill.io/v3/ which provides some recommendations about how \" + \"to load polyfills only for users that need them, instead of for every \" + \"user.\") : void 0;\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n let location = useLocation();\n let searchParams = React.useMemo(() => getSearchParamsForLocation(location.search, defaultSearchParamsRef.current), [location.search]);\n let navigate = useNavigate();\n let setSearchParams = React.useCallback((nextInit, navigateOptions) => {\n const newSearchParams = createSearchParams(typeof nextInit === \"function\" ? nextInit(searchParams) : nextInit);\n navigate(\"?\" + newSearchParams, navigateOptions);\n }, [navigate, searchParams]);\n return [searchParams, setSearchParams];\n}\n/**\n * Returns a function that may be used to programmatically submit a form (or\n * some arbitrary data) to the server.\n */\n\nfunction useSubmit() {\n return useSubmitImpl();\n}\n\nfunction useSubmitImpl(fetcherKey, routeId) {\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseSubmitImpl);\n let defaultAction = useFormAction();\n return React.useCallback(function (target, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof document === \"undefined\") {\n throw new Error(\"You are calling submit during the server render. \" + \"Try calling submit within a `useEffect` or callback instead.\");\n }\n\n let {\n method,\n encType,\n formData,\n url\n } = getFormSubmissionInfo(target, defaultAction, options);\n let href = url.pathname + url.search;\n let opts = {\n replace: options.replace,\n formData,\n formMethod: method,\n formEncType: encType\n };\n\n if (fetcherKey) {\n !(routeId != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"No routeId available for useFetcher()\") : invariant(false) : void 0;\n router.fetch(fetcherKey, routeId, href, opts);\n } else {\n router.navigate(href, opts);\n }\n }, [defaultAction, router, fetcherKey, routeId]);\n}\n\nfunction useFormAction(action, _temp2) {\n let {\n relative\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let routeContext = React.useContext(UNSAFE_RouteContext);\n !routeContext ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"useFormAction must be used inside a RouteContext\") : invariant(false) : void 0;\n let [match] = routeContext.matches.slice(-1); // Shallow clone path so we can modify it below, otherwise we modify the\n // object referenced by useMemo inside useResolvedPath\n\n let path = _extends({}, useResolvedPath(action ? action : \".\", {\n relative\n })); // Previously we set the default action to \".\". The problem with this is that\n // `useResolvedPath(\".\")` excludes search params and the hash of the resolved\n // URL. This is the intended behavior of when \".\" is specifically provided as\n // the form action, but inconsistent w/ browsers when the action is omitted.\n // https://github.com/remix-run/remix/issues/927\n\n\n let location = useLocation();\n\n if (action == null) {\n // Safe to write to these directly here since if action was undefined, we\n // would have called useResolvedPath(\".\") which will never include a search\n // or hash\n path.search = location.search;\n path.hash = location.hash; // When grabbing search params from the URL, remove the automatically\n // inserted ?index param so we match the useResolvedPath search behavior\n // which would not include ?index\n\n if (match.route.index) {\n let params = new URLSearchParams(path.search);\n params.delete(\"index\");\n path.search = params.toString() ? \"?\" + params.toString() : \"\";\n }\n }\n\n if ((!action || action === \".\") && match.route.index) {\n path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n } // If we're operating within a basename, prepend it to the pathname prior\n // to creating the form action. If this is a root navigation, then just use\n // the raw basename which allows the basename to have full control over the\n // presence of a trailing slash on root actions\n\n\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n return createPath(path);\n}\n\nfunction createFetcherForm(fetcherKey, routeId) {\n let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => {\n return /*#__PURE__*/React.createElement(FormImpl, _extends({}, props, {\n ref: ref,\n fetcherKey: fetcherKey,\n routeId: routeId\n }));\n });\n\n if (process.env.NODE_ENV !== \"production\") {\n FetcherForm.displayName = \"fetcher.Form\";\n }\n\n return FetcherForm;\n}\n\nlet fetcherId = 0;\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n */\n\nfunction useFetcher() {\n var _route$matches;\n\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseFetcher);\n let route = React.useContext(UNSAFE_RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"useFetcher must be used inside a RouteContext\") : invariant(false) : void 0;\n let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id;\n !(routeId != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"useFetcher can only be used on routes that contain a unique \\\"id\\\"\") : invariant(false) : void 0;\n let [fetcherKey] = React.useState(() => String(++fetcherId));\n let [Form] = React.useState(() => {\n !routeId ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"No routeId available for fetcher.Form()\") : invariant(false) : void 0;\n return createFetcherForm(fetcherKey, routeId);\n });\n let [load] = React.useState(() => href => {\n !router ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"No router available for fetcher.load()\") : invariant(false) : void 0;\n !routeId ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"No routeId available for fetcher.load()\") : invariant(false) : void 0;\n router.fetch(fetcherKey, routeId, href);\n });\n let submit = useSubmitImpl(fetcherKey, routeId);\n let fetcher = router.getFetcher(fetcherKey);\n let fetcherWithComponents = React.useMemo(() => _extends({\n Form,\n submit,\n load\n }, fetcher), [fetcher, Form, submit, load]);\n React.useEffect(() => {\n // Is this busted when the React team gets real weird and calls effects\n // twice on mount? We really just need to garbage collect here when this\n // fetcher is no longer around.\n return () => {\n if (!router) {\n console.warn(\"No fetcher available to clean up from useFetcher()\");\n return;\n }\n\n router.deleteFetcher(fetcherKey);\n };\n }, [router, fetcherKey]);\n return fetcherWithComponents;\n}\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n */\n\nfunction useFetchers() {\n let state = useDataRouterState(DataRouterStateHook.UseFetchers);\n return [...state.fetchers.values()];\n}\nconst SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nlet savedScrollPositions = {};\n/**\n * When rendered inside a RouterProvider, will restore scroll positions on navigations\n */\n\nfunction useScrollRestoration(_temp3) {\n let {\n getKey,\n storageKey\n } = _temp3 === void 0 ? {} : _temp3;\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseScrollRestoration);\n let {\n restoreScrollPosition,\n preventScrollReset\n } = useDataRouterState(DataRouterStateHook.UseScrollRestoration);\n let location = useLocation();\n let matches = useMatches();\n let navigation = useNavigation(); // Trigger manual scroll restoration while we're active\n\n React.useEffect(() => {\n window.history.scrollRestoration = \"manual\";\n return () => {\n window.history.scrollRestoration = \"auto\";\n };\n }, []); // Save positions on unload\n\n useBeforeUnload(React.useCallback(() => {\n if (navigation.state === \"idle\") {\n let key = (getKey ? getKey(location, matches) : null) || location.key;\n savedScrollPositions[key] = window.scrollY;\n }\n\n sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));\n window.history.scrollRestoration = \"auto\";\n }, [storageKey, getKey, navigation.state, location, matches])); // Read in any saved scroll locations\n\n if (typeof document !== \"undefined\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n try {\n let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);\n\n if (sessionPositions) {\n savedScrollPositions = JSON.parse(sessionPositions);\n }\n } catch (e) {// no-op, use default empty object\n }\n }, [storageKey]); // Enable scroll restoration in the router\n // eslint-disable-next-line react-hooks/rules-of-hooks\n\n React.useLayoutEffect(() => {\n let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKey);\n return () => disableScrollRestoration && disableScrollRestoration();\n }, [router, getKey]); // Restore scrolling when state.restoreScrollPosition changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n\n React.useLayoutEffect(() => {\n // Explicit false means don't do anything (used for submissions)\n if (restoreScrollPosition === false) {\n return;\n } // been here before, scroll to it\n\n\n if (typeof restoreScrollPosition === \"number\") {\n window.scrollTo(0, restoreScrollPosition);\n return;\n } // try to scroll to the hash\n\n\n if (location.hash) {\n let el = document.getElementById(location.hash.slice(1));\n\n if (el) {\n el.scrollIntoView();\n return;\n }\n } // Opt out of scroll reset if this link requested it\n\n\n if (preventScrollReset === true) {\n return;\n } // otherwise go to the top on new locations\n\n\n window.scrollTo(0, 0);\n }, [location, restoreScrollPosition, preventScrollReset]);\n }\n}\n/**\n * Setup a callback to be fired on the window's `beforeunload` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\n\n\nfunction useBeforeUnload(callback) {\n React.useEffect(() => {\n window.addEventListener(\"beforeunload\", callback);\n return () => {\n window.removeEventListener(\"beforeunload\", callback);\n };\n }, [callback]);\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Utils\n////////////////////////////////////////////////////////////////////////////////\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging React Router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n} //#endregion\n\nexport { BrowserRouter, Form, HashRouter, Link, NavLink, ScrollRestoration, useScrollRestoration as UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createSearchParams, HistoryRouter as unstable_HistoryRouter, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSearchParams, useSubmit };\n//# sourceMappingURL=index.js.map\n","const e=Symbol(),t=Symbol(),r=\"a\",n=\"w\";let o=(e,t)=>new Proxy(e,t);const s=Object.getPrototypeOf,c=new WeakMap,l=e=>e&&(c.has(e)?c.get(e):s(e)===Object.prototype||s(e)===Array.prototype),f=e=>\"object\"==typeof e&&null!==e,i=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(e=>{e.configurable=!0}),Object.create(s(e),t)},u=e=>e[t]||e,a=(s,c,f,p)=>{if(!l(s))return s;let g=p&&p.get(s);if(!g){const e=u(s);g=(e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.configurable&&!e.writable))(e)?[e,i(e)]:[e],null==p||p.set(s,g)}const[y,h]=g;let w=f&&f.get(y);return w&&w[1].f===!!h||(w=((o,s)=>{const c={f:s};let l=!1;const f=(e,t)=>{if(!l){let s=c[r].get(o);if(s||(s={},c[r].set(o,s)),e===n)s[n]=!0;else{let r=s[e];r||(r=new Set,s[e]=r),r.add(t)}}},i={get:(e,n)=>n===t?o:(f(\"k\",n),a(Reflect.get(e,n),c[r],c.c,c.t)),has:(t,n)=>n===e?(l=!0,c[r].delete(o),!0):(f(\"h\",n),Reflect.has(t,n)),getOwnPropertyDescriptor:(e,t)=>(f(\"o\",t),Reflect.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(f(n),Reflect.ownKeys(e))};return s&&(i.set=i.deleteProperty=()=>!1),[i,c]})(y,!!h),w[1].p=o(h||y,w[0]),f&&f.set(y,w)),w[1][r]=c,w[1].c=f,w[1].t=p,w[1].p},p=(e,t,r,o,s=Object.is)=>{if(s(e,t))return!1;if(!f(e)||!f(t))return!0;const c=r.get(u(e));if(!c)return!0;if(o){const r=o.get(e);if(r&&r.n===t)return r.g;o.set(e,{n:t,g:!1})}let l=null;try{for(const r of c.h||[])if(l=Reflect.has(e,r)!==Reflect.has(t,r),l)return l;if(!0===c[n]){if(l=((e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((e,t)=>e!==n[t])})(e,t),l)return l}else for(const r of c.o||[])if(l=!!Reflect.getOwnPropertyDescriptor(e,r)!=!!Reflect.getOwnPropertyDescriptor(t,r),l)return l;for(const n of c.k||[])if(l=p(e[n],t[n],r,o,s),l)return l;return null===l&&(l=!0),l}finally{o&&o.set(e,{n:t,g:l})}},g=t=>!!l(t)&&e in t,y=e=>l(e)&&e[t]||null,h=(e,t=!0)=>{c.set(e,t)},w=(e,t,r)=>{const o=[],s=new WeakSet,c=(e,l)=>{if(s.has(e))return;f(e)&&s.add(e);const i=f(e)&&t.get(u(e));if(i){var a,p;if(null==(a=i.h)||a.forEach(e=>{const t=`:has(${String(e)})`;o.push(l?[...l,t]:[t])}),!0===i[n]){const e=\":ownKeys\";o.push(l?[...l,e]:[e])}else{var g;null==(g=i.o)||g.forEach(e=>{const t=`:hasOwn(${String(e)})`;o.push(l?[...l,t]:[t])})}null==(p=i.k)||p.forEach(t=>{r&&!(\"value\"in(Object.getOwnPropertyDescriptor(e,t)||{}))||c(e[t],l?[...l,t]:[t])})}else l&&o.push(l)};return c(e),o},O=e=>{o=e};export{w as affectedToPathList,a as createProxy,y as getUntracked,p as isChanged,h as markToTrack,O as replaceNewProxy,g as trackMemo};\n//# sourceMappingURL=index.modern.mjs.map\n","import { markToTrack, getUntracked } from 'proxy-compare';\n\nconst isObject = (x) => typeof x === \"object\" && x !== null;\nconst proxyStateMap = /* @__PURE__ */ new WeakMap();\nconst refSet = /* @__PURE__ */ new WeakSet();\nconst buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) => new Proxy(target, handler), canProxy = (x) => isObject(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer), defaultHandlePromise = (promise) => {\n switch (promise.status) {\n case \"fulfilled\":\n return promise.value;\n case \"rejected\":\n throw promise.reason;\n default:\n throw promise;\n }\n}, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version, handlePromise = defaultHandlePromise) => {\n const cache = snapCache.get(target);\n if ((cache == null ? void 0 : cache[0]) === version) {\n return cache[1];\n }\n const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));\n markToTrack(snap, true);\n snapCache.set(target, [version, snap]);\n Reflect.ownKeys(target).forEach((key) => {\n if (Object.getOwnPropertyDescriptor(snap, key)) {\n return;\n }\n const value = Reflect.get(target, key);\n const { enumerable } = Reflect.getOwnPropertyDescriptor(\n target,\n key\n );\n const desc = {\n value,\n enumerable,\n // This is intentional to avoid copying with proxy-compare.\n // It's still non-writable, so it avoids assigning a value.\n configurable: true\n };\n if (refSet.has(value)) {\n markToTrack(value, false);\n } else if (value instanceof Promise) {\n delete desc.value;\n desc.get = () => handlePromise(value);\n } else if (proxyStateMap.has(value)) {\n const [target2, ensureVersion] = proxyStateMap.get(\n value\n );\n desc.value = createSnapshot(\n target2,\n ensureVersion(),\n handlePromise\n );\n }\n Object.defineProperty(snap, key, desc);\n });\n return Object.preventExtensions(snap);\n}, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction = (initialObject) => {\n if (!isObject(initialObject)) {\n throw new Error(\"object required\");\n }\n const found = proxyCache.get(initialObject);\n if (found) {\n return found;\n }\n let version = versionHolder[0];\n const listeners = /* @__PURE__ */ new Set();\n const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {\n if (version !== nextVersion) {\n version = nextVersion;\n listeners.forEach((listener) => listener(op, nextVersion));\n }\n };\n let checkVersion = versionHolder[1];\n const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => {\n if (checkVersion !== nextCheckVersion && !listeners.size) {\n checkVersion = nextCheckVersion;\n propProxyStates.forEach(([propProxyState]) => {\n const propVersion = propProxyState[1](nextCheckVersion);\n if (propVersion > version) {\n version = propVersion;\n }\n });\n }\n return version;\n };\n const createPropListener = (prop) => (op, nextVersion) => {\n const newOp = [...op];\n newOp[1] = [prop, ...newOp[1]];\n notifyUpdate(newOp, nextVersion);\n };\n const propProxyStates = /* @__PURE__ */ new Map();\n const addPropListener = (prop, propProxyState) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && propProxyStates.has(prop)) {\n throw new Error(\"prop listener already exists\");\n }\n if (listeners.size) {\n const remove = propProxyState[3](createPropListener(prop));\n propProxyStates.set(prop, [propProxyState, remove]);\n } else {\n propProxyStates.set(prop, [propProxyState]);\n }\n };\n const removePropListener = (prop) => {\n var _a;\n const entry = propProxyStates.get(prop);\n if (entry) {\n propProxyStates.delete(prop);\n (_a = entry[1]) == null ? void 0 : _a.call(entry);\n }\n };\n const addListener = (listener) => {\n listeners.add(listener);\n if (listeners.size === 1) {\n propProxyStates.forEach(([propProxyState, prevRemove], prop) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && prevRemove) {\n throw new Error(\"remove already exists\");\n }\n const remove = propProxyState[3](createPropListener(prop));\n propProxyStates.set(prop, [propProxyState, remove]);\n });\n }\n const removeListener = () => {\n listeners.delete(listener);\n if (listeners.size === 0) {\n propProxyStates.forEach(([propProxyState, remove], prop) => {\n if (remove) {\n remove();\n propProxyStates.set(prop, [propProxyState]);\n }\n });\n }\n };\n return removeListener;\n };\n const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));\n const handler = {\n deleteProperty(target, prop) {\n const prevValue = Reflect.get(target, prop);\n removePropListener(prop);\n const deleted = Reflect.deleteProperty(target, prop);\n if (deleted) {\n notifyUpdate([\"delete\", [prop], prevValue]);\n }\n return deleted;\n },\n set(target, prop, value, receiver) {\n const hasPrevValue = Reflect.has(target, prop);\n const prevValue = Reflect.get(target, prop, receiver);\n if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {\n return true;\n }\n removePropListener(prop);\n if (isObject(value)) {\n value = getUntracked(value) || value;\n }\n let nextValue = value;\n if (value instanceof Promise) {\n value.then((v) => {\n value.status = \"fulfilled\";\n value.value = v;\n notifyUpdate([\"resolve\", [prop], v]);\n }).catch((e) => {\n value.status = \"rejected\";\n value.reason = e;\n notifyUpdate([\"reject\", [prop], e]);\n });\n } else {\n if (!proxyStateMap.has(value) && canProxy(value)) {\n nextValue = proxyFunction(value);\n }\n const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue);\n if (childProxyState) {\n addPropListener(prop, childProxyState);\n }\n }\n Reflect.set(target, prop, nextValue, receiver);\n notifyUpdate([\"set\", [prop], value, prevValue]);\n return true;\n }\n };\n const proxyObject = newProxy(baseObject, handler);\n proxyCache.set(initialObject, proxyObject);\n const proxyState = [\n baseObject,\n ensureVersion,\n createSnapshot,\n addListener\n ];\n proxyStateMap.set(proxyObject, proxyState);\n Reflect.ownKeys(initialObject).forEach((key) => {\n const desc = Object.getOwnPropertyDescriptor(\n initialObject,\n key\n );\n if (\"value\" in desc) {\n proxyObject[key] = initialObject[key];\n delete desc.value;\n delete desc.writable;\n }\n Object.defineProperty(baseObject, key, desc);\n });\n return proxyObject;\n}) => [\n // public functions\n proxyFunction,\n // shared state\n proxyStateMap,\n refSet,\n // internal things\n objectIs,\n newProxy,\n canProxy,\n defaultHandlePromise,\n snapCache,\n createSnapshot,\n proxyCache,\n versionHolder\n];\nconst [defaultProxyFunction] = buildProxyFunction();\nfunction proxy(initialObject = {}) {\n return defaultProxyFunction(initialObject);\n}\nfunction getVersion(proxyObject) {\n const proxyState = proxyStateMap.get(proxyObject);\n return proxyState == null ? void 0 : proxyState[1]();\n}\nfunction subscribe(proxyObject, callback, notifyInSync) {\n const proxyState = proxyStateMap.get(proxyObject);\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && !proxyState) {\n console.warn(\"Please use proxy object\");\n }\n let promise;\n const ops = [];\n const addListener = proxyState[3];\n let isListenerActive = false;\n const listener = (op) => {\n ops.push(op);\n if (notifyInSync) {\n callback(ops.splice(0));\n return;\n }\n if (!promise) {\n promise = Promise.resolve().then(() => {\n promise = void 0;\n if (isListenerActive) {\n callback(ops.splice(0));\n }\n });\n }\n };\n const removeListener = addListener(listener);\n isListenerActive = true;\n return () => {\n isListenerActive = false;\n removeListener();\n };\n}\nfunction snapshot(proxyObject, handlePromise) {\n const proxyState = proxyStateMap.get(proxyObject);\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && !proxyState) {\n console.warn(\"Please use proxy object\");\n }\n const [target, ensureVersion, createSnapshot] = proxyState;\n return createSnapshot(target, ensureVersion(), handlePromise);\n}\nfunction ref(obj) {\n refSet.add(obj);\n return obj;\n}\nconst unstable_buildProxyFunction = buildProxyFunction;\n\nexport { getVersion, proxy, ref, snapshot, subscribe, unstable_buildProxyFunction };\n","/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","import ReactExports, { useRef, useCallback, useEffect, useMemo, useDebugValue } from 'react';\nimport { isChanged, createProxy, affectedToPathList } from 'proxy-compare';\nimport useSyncExternalStoreExports from 'use-sync-external-store/shim/index.js';\nimport { subscribe, snapshot } from 'valtio/vanilla';\n\nconst { use } = ReactExports;\nconst { useSyncExternalStore } = useSyncExternalStoreExports;\nconst useAffectedDebugValue = (state, affected) => {\n const pathList = useRef();\n useEffect(() => {\n pathList.current = affectedToPathList(state, affected, true);\n });\n useDebugValue(pathList.current);\n};\nconst targetCache = /* @__PURE__ */ new WeakMap();\nfunction useSnapshot(proxyObject, options) {\n const notifyInSync = options == null ? void 0 : options.sync;\n const lastSnapshot = useRef();\n const lastAffected = useRef();\n let inRender = true;\n const currSnapshot = useSyncExternalStore(\n useCallback(\n (callback) => {\n const unsub = subscribe(proxyObject, callback, notifyInSync);\n callback();\n return unsub;\n },\n [proxyObject, notifyInSync]\n ),\n () => {\n const nextSnapshot = snapshot(proxyObject, use);\n try {\n if (!inRender && lastSnapshot.current && lastAffected.current && !isChanged(\n lastSnapshot.current,\n nextSnapshot,\n lastAffected.current,\n /* @__PURE__ */ new WeakMap()\n )) {\n return lastSnapshot.current;\n }\n } catch (e) {\n }\n return nextSnapshot;\n },\n () => snapshot(proxyObject, use)\n );\n inRender = false;\n const currAffected = /* @__PURE__ */ new WeakMap();\n useEffect(() => {\n lastSnapshot.current = currSnapshot;\n lastAffected.current = currAffected;\n });\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n useAffectedDebugValue(currSnapshot, currAffected);\n }\n const proxyCache = useMemo(() => /* @__PURE__ */ new WeakMap(), []);\n return createProxy(\n currSnapshot,\n currAffected,\n proxyCache,\n targetCache\n );\n}\n\nexport { useSnapshot };\n","import{options as r,Fragment as e}from\"preact\";export{Fragment}from\"preact\";var t=/[\"&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o=\"\",f=\"\";n<r.length;n++){switch(r.charCodeAt(n)){case 34:f=\""\";break;case 38:f=\"&\";break;case 60:f=\"<\";break;default:continue}n!==e&&(o+=r.slice(e,n)),o+=f,e=n+1}return n!==e&&(o+=r.slice(e,n)),o}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=0,i=Array.isArray;function u(e,t,n,o,i,u){t||(t={});var a,c,p=t;if(\"ref\"in p)for(c in p={},t)\"ref\"==c?a=t[c]:p[c]=t[c];var l={type:e,props:p,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--f,__i:-1,__u:0,__source:i,__self:u};if(\"function\"==typeof e&&(a=e.defaultProps))for(c in a)void 0===p[c]&&(p[c]=a[c]);return r.vnode&&r.vnode(l),l}function a(r){var t=u(e,{tpl:r,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t}var c={},p=/[A-Z]/g;function l(e,t){if(r.attr){var f=r.attr(e,t);if(\"string\"==typeof f)return f}if(\"ref\"===e||\"key\"===e)return\"\";if(\"style\"===e&&\"object\"==typeof t){var i=\"\";for(var u in t){var a=t[u];if(null!=a&&\"\"!==a){var l=\"-\"==u[0]?u:c[u]||(c[u]=u.replace(p,\"-$&\").toLowerCase()),_=\";\";\"number\"!=typeof a||l.startsWith(\"--\")||o.test(l)||(_=\"px;\"),i=i+l+\":\"+a+_}}return e+'=\"'+i+'\"'}return null==t||!1===t||\"function\"==typeof t||\"object\"==typeof t?\"\":!0===t?e:e+'=\"'+n(t)+'\"'}function _(r){if(null==r||\"boolean\"==typeof r||\"function\"==typeof r)return null;if(\"object\"==typeof r){if(void 0===r.constructor)return r;if(i(r)){for(var e=0;e<r.length;e++)r[e]=_(r[e]);return r}}return n(\"\"+r)}export{u as jsx,l as jsxAttr,u as jsxDEV,_ as jsxEscape,a as jsxTemplate,u as jsxs};\n//# sourceMappingURL=jsxRuntime.module.js.map\n","function fixProto(target, prototype) {\n var setPrototypeOf = Object.setPrototypeOf;\n setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;\n}\nfunction fixStack(target, fn) {\n if (fn === void 0) {\n fn = target.constructor;\n }\n\n var captureStackTrace = Error.captureStackTrace;\n captureStackTrace && captureStackTrace(target, fn);\n}\n\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar CustomError = function (_super) {\n __extends(CustomError, _super);\n\n function CustomError(message, options) {\n var _newTarget = this.constructor;\n\n var _this = _super.call(this, message, options) || this;\n\n Object.defineProperty(_this, 'name', {\n value: _newTarget.name,\n enumerable: false,\n configurable: true\n });\n fixProto(_this, _newTarget.prototype);\n fixStack(_this);\n return _this;\n }\n\n return CustomError;\n}(Error);\n\nvar __spreadArray = undefined && undefined.__spreadArray || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nfunction customErrorFactory(fn, parent) {\n if (parent === void 0) {\n parent = Error;\n }\n\n function CustomError() {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (!(this instanceof CustomError)) return new (CustomError.bind.apply(CustomError, __spreadArray([void 0], args, false)))();\n parent.apply(this, args);\n Object.defineProperty(this, 'name', {\n value: fn.name || parent.name,\n enumerable: false,\n configurable: true\n });\n fn.apply(this, args);\n fixStack(this, CustomError);\n }\n\n return Object.defineProperties(CustomError, {\n prototype: {\n value: Object.create(parent.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n configurable: true\n }\n })\n }\n });\n}\n\nexport { CustomError, customErrorFactory };\n//# sourceMappingURL=custom-error.mjs.map\n","// https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js\n\nvar ws = null\n\nif (typeof WebSocket !== 'undefined') {\n ws = WebSocket\n} else if (typeof MozWebSocket !== 'undefined') {\n ws = MozWebSocket\n} else if (typeof global !== 'undefined') {\n ws = global.WebSocket || global.MozWebSocket\n} else if (typeof window !== 'undefined') {\n ws = window.WebSocket || window.MozWebSocket\n} else if (typeof self !== 'undefined') {\n ws = self.WebSocket || self.MozWebSocket\n}\n\nexport default ws\n","function createDeferred() {\n let resolve;\n let reject;\n const promise = new Promise((...args) => ([resolve, reject] = args));\n return Object.freeze({\n resolve: resolve,\n reject: reject,\n promise\n });\n}\nexport function on(onHandler, options) {\n const comEvents = [];\n const unconsumedDeferred = [];\n const unHandle = onHandler((...args) => {\n const deferred = unconsumedDeferred.shift();\n if (deferred) {\n deferred.resolve({\n value: args,\n done: false\n });\n }\n else {\n comEvents.push(args);\n }\n });\n const abortSignal = options === null || options === void 0 ? void 0 : options.signal;\n let finished = false;\n let error = null;\n const onAbort = () => {\n error = new Error(\"Abort Error\");\n };\n const offListener = () => {\n unHandle === null || unHandle === void 0 ? void 0 : unHandle();\n abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener(\"abort\", onAbort);\n };\n abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener(\"abort\", onAbort, { once: true });\n return {\n async next() {\n const lastEvent = comEvents.shift();\n if (lastEvent) {\n return {\n value: lastEvent,\n done: false\n };\n }\n if (finished) {\n return {\n value: undefined,\n done: true\n };\n }\n if (error) {\n return Promise.reject(error);\n }\n const deferred = createDeferred();\n unconsumedDeferred.push(deferred);\n return deferred.promise;\n },\n async return() {\n finished = true;\n offListener();\n for (const deferred of unconsumedDeferred) {\n deferred.resolve({\n value: undefined,\n done: true\n });\n }\n return {\n value: undefined,\n done: true\n };\n },\n async throw(thrownError) {\n error = thrownError;\n offListener();\n return {\n value: undefined,\n done: true\n };\n },\n [Symbol.asyncIterator]() {\n return this;\n }\n };\n}\nexport function once(onHandler, options) {\n var _a;\n const unconsumedDeferred = createDeferred();\n const unEvent = onHandler((...args) => {\n unconsumedDeferred.resolve(args);\n });\n const onAbort = () => {\n unconsumedDeferred.reject(new Error(\"Abort Error\"));\n };\n const offListener = () => {\n var _a;\n unEvent === null || unEvent === void 0 ? void 0 : unEvent();\n (_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.removeEventListener(\"abort\", onAbort);\n };\n (_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.addEventListener(\"abort\", onAbort, { once: true });\n return unconsumedDeferred.promise.finally(() => {\n offListener();\n });\n}\n//# sourceMappingURL=events-to-async.js.map","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang)\n return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));\n return lowerCase(str);\n}\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str) {\n return str.toLowerCase();\n}\n//# sourceMappingURL=index.js.map","import { lowerCase } from \"lower-case\";\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nvar DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n// Remove all non-word characters.\nvar DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input, options) {\n if (options === void 0) { options = {}; }\n var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? \" \" : _d;\n var result = replace(replace(input, splitRegexp, \"$1\\0$2\"), stripRegexp, \"\\0\");\n var start = 0;\n var end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\")\n start++;\n while (result.charAt(end - 1) === \"\\0\")\n end--;\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nexport function pascalCaseTransform(input, index) {\n var firstChar = input.charAt(0);\n var lowerChars = input.substr(1).toLowerCase();\n if (index > 0 && firstChar >= \"0\" && firstChar <= \"9\") {\n return \"_\" + firstChar + lowerChars;\n }\n return \"\" + firstChar.toUpperCase() + lowerChars;\n}\nexport function pascalCaseTransformMerge(input) {\n return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\n}\nexport function pascalCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \"\", transform: pascalCaseTransform }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { pascalCase, pascalCaseTransform, pascalCaseTransformMerge, } from \"pascal-case\";\nexport function camelCaseTransform(input, index) {\n if (index === 0)\n return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\nexport function camelCaseTransformMerge(input, index) {\n if (index === 0)\n return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\nexport function camelCase(input, options) {\n if (options === void 0) { options = {}; }\n return pascalCase(input, __assign({ transform: camelCaseTransform }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nexport function dotCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \".\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { dotCase } from \"dot-case\";\nexport function snakeCase(input, options) {\n if (options === void 0) { options = {}; }\n return dotCase(input, __assign({ delimiter: \"_\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { CustomError } from 'ts-custom-error';\nimport WebSocket from 'isomorphic-ws';\nimport { on } from 'events-to-async';\nimport { snakeCase, camelCase } from 'change-case';\n\nclass MastoUnexpectedError extends CustomError {\n}\n\nclass MastoDeserializeError extends CustomError {\n constructor(message, contentType, data, options) {\n super(message, options);\n this.contentType = contentType;\n this.data = data;\n }\n}\n\nclass MastoHttpError extends CustomError {\n constructor(props, errorOptions) {\n super(props.message, errorOptions);\n this.statusCode = props.statusCode;\n this.message = props.message;\n this.description = props.description;\n this.additionalProperties = props.additionalProperties;\n this.details = props.details;\n }\n}\n\nclass MastoInvalidArgumentError extends CustomError {\n}\n\nclass MastoTimeoutError extends CustomError {\n}\n\nclass MastoWebSocketError extends CustomError {\n constructor(message, options) {\n super(message, options);\n this.message = message;\n }\n}\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nconst sleep = (ms) => new Promise((resolve) => setTimeout(() => resolve(), ms));\n\nconst isRecord = (x) => typeof x === \"object\" && x !== null && x.constructor.name === \"Object\";\n\nfunction noop() {\n //\n}\n\nclass ExponentialBackoffError extends CustomError {\n constructor(attempts, options) {\n super(`Maximum number of attempts reached: ${attempts}`, options);\n }\n}\n// https://en.wikipedia.org/wiki/Exponential_backoff\nclass ExponentialBackoff {\n constructor(props = {}) {\n this.props = props;\n this.attempts = 0;\n }\n sleep() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.attempts >= this.maxAttempts) {\n throw new ExponentialBackoffError(this.attempts);\n }\n yield sleep(this.timeout);\n this.attempts++;\n });\n }\n clear() {\n this.attempts = 0;\n }\n get factor() {\n var _a;\n return (_a = this.props.factor) !== null && _a !== void 0 ? _a : 1000;\n }\n get base() {\n var _a;\n return (_a = this.props.base) !== null && _a !== void 0 ? _a : 2;\n }\n get maxAttempts() {\n var _a;\n return (_a = this.props.maxAttempts) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY;\n }\n get timeout() {\n return this.factor * Math.pow(this.base, this.attempts);\n }\n}\n\n// https://github.com/tc39/proposal-promise-with-resolvers\nconst createPromiseWithResolvers = () => {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n};\n\nconst parseLinkHeader = (linkHeader) => {\n const links = new Map();\n for (const link of linkHeader.split(\",\")) {\n const match = link.match(/<([^>]+)>;\\s*rel=\"([^\"]+)\"/);\n if (match) {\n links.set(match[2], match[1]);\n }\n }\n return links;\n};\n\nclass PaginatorHttp {\n constructor(http, nextPath, nextParams, meta, direction = \"next\") {\n this.http = http;\n this.nextPath = nextPath;\n this.nextParams = nextParams;\n this.meta = meta;\n this.direction = direction;\n }\n next() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.nextPath == undefined) {\n return { done: true, value: undefined };\n }\n const response = yield this.http.request(Object.assign({ method: \"GET\", path: this.nextPath, search: this.nextParams }, this.meta));\n const nextUrl = this.getLink(response.headers.get(\"link\"));\n this.nextPath = nextUrl === null || nextUrl === void 0 ? void 0 : nextUrl.pathname;\n this.nextParams = nextUrl === null || nextUrl === void 0 ? void 0 : nextUrl.search.replace(/^\\?/, \"\");\n const data = (yield response.data);\n return {\n done: false,\n value: data,\n };\n });\n }\n return(value) {\n return __awaiter(this, void 0, void 0, function* () {\n this.clear();\n return {\n done: true,\n value: yield value,\n };\n });\n }\n throw(e) {\n return __awaiter(this, void 0, void 0, function* () {\n this.clear();\n throw e;\n });\n }\n then(onfulfilled = Promise.resolve.bind(Promise), onrejected = Promise.reject.bind(Promise)) {\n // we assume the first item won't be undefined\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.next().then((value) => onfulfilled(value.value), onrejected);\n }\n values() {\n return this[Symbol.asyncIterator]();\n }\n getDirection() {\n return this.direction;\n }\n setDirection(direction) {\n return new PaginatorHttp(this.http, this.nextPath, this.nextParams, this.meta, direction);\n }\n [Symbol.asyncIterator]() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return this;\n }\n getLink(value) {\n if (value == undefined) {\n return;\n }\n const parsed = parseLinkHeader(value).get(this.direction);\n if (parsed == undefined) {\n return;\n }\n return new URL(parsed);\n }\n clear() {\n this.nextPath = undefined;\n this.nextParams = undefined;\n }\n clone() {\n return new PaginatorHttp(this.http, this.nextPath, this.nextParams, this.meta, this.direction);\n }\n}\n\nclass HttpActionDispatcher {\n constructor(http, hook) {\n this.http = http;\n this.hook = hook;\n }\n dispatch(action) {\n if (this.hook != undefined) {\n action = this.hook.beforeDispatch(action);\n }\n let result = this.hook.dispatch(action);\n if (result !== false) {\n return result;\n }\n switch (action.type) {\n case \"fetch\": {\n result = this.http.get(action.path, action.data, action.meta);\n break;\n }\n case \"create\": {\n result = this.http.post(action.path, action.data, action.meta);\n break;\n }\n case \"update\": {\n result = this.http.put(action.path, action.data, action.meta);\n break;\n }\n case \"remove\": {\n result = this.http.delete(action.path, action.data, action.meta);\n break;\n }\n case \"list\": {\n result = new PaginatorHttp(this.http, action.path, action.data);\n break;\n }\n }\n /* eslint-disable unicorn/prefer-ternary, prettier/prettier */\n if (result instanceof Promise) {\n return result.then((result) => { var _a; return (_a = this.hook) === null || _a === void 0 ? void 0 : _a.afterDispatch(action, result); });\n }\n else {\n return this.hook.afterDispatch(action, result);\n }\n /* eslint-enable unicorn/prefer-ternary, prettier/prettier */\n }\n}\n\nfunction waitForOpen(ws) {\n if (ws.readyState === WebSocket.OPEN) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n const handleError = (error) => {\n reject(error);\n };\n const handleClose = () => {\n reject(new Error(\"WebSocket closed\"));\n };\n const handleOpen = () => {\n resolve();\n };\n ws.addEventListener(\"error\", handleError, { once: true });\n ws.addEventListener(\"close\", handleClose, { once: true });\n ws.addEventListener(\"open\", handleOpen, { once: true });\n });\n}\nfunction waitForClose(ws) {\n if (ws.readyState === WebSocket.CLOSED) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n const handleClose = () => {\n resolve();\n };\n ws.addEventListener(\"error\", handleClose, { once: true });\n ws.addEventListener(\"close\", handleClose, { once: true });\n });\n}\n\nclass WebSocketConnectorImpl {\n constructor(props, logger) {\n this.props = props;\n this.logger = logger;\n this.queue = [];\n this.closed = false;\n this.initialized = false;\n this.backoff = new ExponentialBackoff({\n maxAttempts: this.props.maxAttempts,\n });\n }\n canAcquire() {\n return !this.closed;\n }\n acquire() {\n return __awaiter(this, void 0, void 0, function* () {\n this.init();\n if (this.ws != undefined) {\n return this.ws;\n }\n const promiseWithResolvers = createPromiseWithResolvers();\n this.queue.push(promiseWithResolvers);\n return yield promiseWithResolvers.promise;\n });\n }\n close() {\n var _a;\n this.closed = true;\n (_a = this.ws) === null || _a === void 0 ? void 0 : _a.close();\n this.backoff.clear();\n for (const { reject } of this.queue) {\n reject(new MastoWebSocketError(\"WebSocket closed\"));\n }\n this.queue = [];\n }\n init() {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f;\n if (this.initialized) {\n return;\n }\n this.initialized = true;\n while (!this.closed) {\n (_a = this.ws) === null || _a === void 0 ? void 0 : _a.close();\n try {\n yield this.backoff.sleep();\n }\n catch (_g) {\n break;\n }\n try {\n (_b = this.logger) === null || _b === void 0 ? void 0 : _b.log(\"info\", \"Connecting to WebSocket...\");\n {\n const ctor = ((_c = this.props.implementation) !== null && _c !== void 0 ? _c : WebSocket);\n const ws = new ctor(...this.props.constructorParameters);\n yield waitForOpen(ws);\n this.ws = ws;\n }\n (_d = this.logger) === null || _d === void 0 ? void 0 : _d.log(\"info\", \"Connected to WebSocket\");\n for (const { resolve } of this.queue) {\n resolve(this.ws);\n }\n this.queue = [];\n yield waitForClose(this.ws);\n (_e = this.logger) === null || _e === void 0 ? void 0 : _e.log(\"info\", \"WebSocket closed\");\n this.backoff.clear();\n }\n catch (error) {\n (_f = this.logger) === null || _f === void 0 ? void 0 : _f.log(\"error\", \"WebSocket error:\", error);\n }\n }\n for (const { reject } of this.queue) {\n reject(new MastoWebSocketError(`Failed to connect to WebSocket after ${this.props.maxAttempts} attempts`));\n }\n this.queue = [];\n });\n }\n}\n\nfunction toAsyncIterable(ws) {\n return __asyncGenerator(this, arguments, function* toAsyncIterable_1() {\n var _a, e_1, _b, _c;\n const handleClose = (e) => __awaiter(this, void 0, void 0, function* () {\n /* istanbul ignore next */\n if (events.return == undefined) {\n throw new MastoUnexpectedError(\"events.return is undefined\");\n }\n yield events.return(e);\n });\n const handleError = (e) => __awaiter(this, void 0, void 0, function* () {\n /* istanbul ignore next */\n if (events.return == undefined) {\n throw new MastoUnexpectedError(\"events.return is undefined\");\n }\n yield events.return(e);\n });\n const events = on((handler) => {\n ws.addEventListener(\"message\", handler);\n ws.addEventListener(\"error\", handleError);\n ws.addEventListener(\"close\", handleClose);\n return () => {\n ws.removeEventListener(\"message\", handler);\n ws.removeEventListener(\"error\", handleError);\n ws.removeEventListener(\"close\", handleClose);\n };\n });\n try {\n for (var _d = true, events_1 = __asyncValues(events), events_1_1; events_1_1 = yield __await(events_1.next()), _a = events_1_1.done, !_a; _d = true) {\n _c = events_1_1.value;\n _d = false;\n const [event] = _c;\n yield yield __await(event);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = events_1.return)) yield __await(_b.call(events_1));\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n}\n\nclass WebSocketSubscription {\n constructor(connector, serializer, stream, logger, params) {\n this.connector = connector;\n this.serializer = serializer;\n this.stream = stream;\n this.logger = logger;\n this.params = params;\n }\n values() {\n return __asyncGenerator(this, arguments, function* values_1() {\n var _a, e_1, _b, _c;\n var _d, _e, _f;\n (_d = this.logger) === null || _d === void 0 ? void 0 : _d.log(\"info\", \"Subscribing to stream\", this.stream);\n while (this.connector.canAcquire()) {\n this.connection = yield __await(this.connector.acquire());\n const data = this.serializer.serialize(\"json\", Object.assign({ type: \"subscribe\", stream: this.stream }, this.params));\n (_e = this.logger) === null || _e === void 0 ? void 0 : _e.log(\"debug\", \"↑ WEBSOCKET\", data);\n this.connection.send(data);\n const messages = toAsyncIterable(this.connection);\n try {\n for (var _g = true, messages_1 = (e_1 = void 0, __asyncValues(messages)), messages_1_1; messages_1_1 = yield __await(messages_1.next()), _a = messages_1_1.done, !_a; _g = true) {\n _c = messages_1_1.value;\n _g = false;\n const message = _c;\n const event = yield __await(this.parseMessage(message.data));\n if (!this.test(event)) {\n continue;\n }\n (_f = this.logger) === null || _f === void 0 ? void 0 : _f.log(\"debug\", \"↓ WEBSOCKET\", event);\n yield yield __await(event);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_g && !_a && (_b = messages_1.return)) yield __await(_b.call(messages_1));\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n }\n unsubscribe() {\n if (this.connection == undefined) {\n return;\n }\n const data = this.serializer.serialize(\"json\", Object.assign({ type: \"unsubscribe\", stream: this.stream }, this.params));\n this.connection.send(data);\n }\n [Symbol.asyncIterator]() {\n return this.values();\n }\n /**\n * @experimental This is an experimental API.\n */\n [Symbol.dispose]() {\n this.unsubscribe();\n }\n test(event) {\n var _a;\n // subscribe(\"hashtag\", { tag: \"foo\" }) -> [\"hashtag\", \"foo\"]\n // subscribe(\"list\", { list: \"foo\" }) -> [\"list\", \"foo\"]\n const params = (_a = this.params) !== null && _a !== void 0 ? _a : {};\n const extra = Object.values(params);\n const stream = [this.stream, ...extra];\n return stream.every((s) => event.stream.includes(s));\n }\n parseMessage(rawEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = this.serializer.deserialize(\"json\", rawEvent);\n if (\"error\" in data) {\n throw new MastoUnexpectedError(data.error);\n }\n const payload = data.event === \"delete\" || data.payload == undefined\n ? data.payload\n : this.serializer.deserialize(\"json\", data.payload);\n return {\n stream: data.stream,\n event: data.event,\n payload: payload,\n };\n });\n }\n}\n\nclass WebSocketActionDispatcher {\n constructor(connector, serializer, logger) {\n this.connector = connector;\n this.serializer = serializer;\n this.logger = logger;\n }\n dispatch(action) {\n var _a;\n if (action.type === \"close\") {\n this.connector.close();\n return {};\n }\n if (action.type === \"prepare\") {\n return this.connector.acquire();\n }\n if (action.type !== \"subscribe\") {\n throw new MastoUnexpectedError(`Unknown action type ${action.type}`);\n }\n const data = (_a = action.data) !== null && _a !== void 0 ? _a : {};\n const stream = action.path.replace(/^\\//, \"\").replaceAll(\"/\", \":\");\n return new WebSocketSubscription(this.connector, this.serializer, stream, this.logger, Object.assign({}, data));\n }\n [Symbol.dispose]() {\n this.connector.close();\n }\n}\n\nconst createActionProxy = (actionDispatcher, options = {}) => {\n const { context = [], applicable = false } = options;\n let target = {};\n const handler = {\n get: get(actionDispatcher, context),\n };\n if (applicable) {\n target = noop;\n handler.apply = apply(actionDispatcher, context);\n }\n return new Proxy(target, handler);\n};\nconst SPECIAL_PROPERTIES = new Set([\n \"then\",\n \"catch\",\n \"finally\",\n \"inspect\",\n \"toString\",\n \"valueOf\",\n \"toJSON\",\n \"constructor\",\n \"prototype\",\n \"length\",\n \"name\",\n \"caller\",\n \"callee\",\n \"arguments\",\n \"bind\",\n \"apply\",\n \"call\",\n]);\nconst get = (actionDispatcher, context) => (_, property) => {\n if (typeof property === \"string\" && SPECIAL_PROPERTIES.has(property)) {\n return;\n }\n if (property === Symbol.dispose) {\n return actionDispatcher[Symbol.dispose];\n }\n if (typeof property === \"symbol\") {\n return;\n }\n if (property.startsWith(\"$\")) {\n return createActionProxy(actionDispatcher, {\n context: [...context, property],\n applicable: true,\n });\n }\n return createActionProxy(actionDispatcher, {\n context: [...context, snakeCase(property)],\n applicable: true,\n });\n};\nconst apply = (actionDispatcher, context) => (_1, _2, args) => {\n const action = context.pop();\n /* istanbul ignore next */\n if (action == undefined) {\n throw new Error(\"No action specified\");\n }\n if (action === \"$select\") {\n return createActionProxy(actionDispatcher, {\n context: [...context, ...args],\n applicable: true,\n });\n }\n const path = \"/\" + context.join(\"/\");\n const [data, meta] = args;\n return actionDispatcher.dispatch({\n type: action,\n path,\n data,\n meta: meta,\n });\n};\n\nfunction isHttpActionType(actionType) {\n return [\"fetch\", \"create\", \"update\", \"remove\", \"list\"].includes(actionType);\n}\nfunction toHttpActionType(action) {\n if (isHttpActionType(action)) {\n return action;\n }\n switch (action) {\n case \"lookup\":\n case \"verify_credentials\": {\n return \"fetch\";\n }\n case \"update_credentials\": {\n return \"update\";\n }\n default: {\n return \"create\";\n }\n }\n}\nfunction inferEncoding(action, path) {\n if ((action === \"create\" && path === \"/api/v1/accounts\") ||\n (action === \"update\" && path === \"/api/v1/accounts/update_credentials\") ||\n (action === \"create\" && path === \"/api/v1/email\") ||\n (action === \"create\" && path === \"/api/v1/featured_tag\") ||\n (action === \"create\" && path === \"/api/v1/media\") ||\n (action === \"create\" && path === \"/api/v2/media\")) {\n return \"multipart-form\";\n }\n return \"json\";\n}\nfunction waitForMediaAttachment(id, timeout, http) {\n return __awaiter(this, void 0, void 0, function* () {\n let media;\n const signal = AbortSignal.timeout(timeout);\n while (media == undefined) {\n if (signal.aborted) {\n throw new MastoTimeoutError(`Media processing timed out of ${timeout}ms`);\n }\n try {\n yield sleep(1000);\n const processing = yield http.get(`/api/v1/media/${id}`);\n if (processing.url != undefined) {\n media = processing;\n }\n }\n catch (error) {\n if (error instanceof MastoHttpError && error.statusCode === 404) {\n continue;\n }\n throw error;\n }\n }\n return media;\n });\n}\nclass HttpActionDispatcherHookMastodon {\n constructor(http, mediaTimeout = 1000 * 60) {\n this.http = http;\n this.mediaTimeout = mediaTimeout;\n }\n beforeDispatch(action) {\n const type = toHttpActionType(action.type);\n const path = isHttpActionType(action.type)\n ? action.path\n : action.path + \"/\" + snakeCase(action.type);\n const encoding = inferEncoding(type, path);\n const meta = Object.assign(Object.assign({}, action.meta), { encoding });\n return { type, path, data: action.data, meta };\n }\n dispatch(action) {\n if (action.type === \"update\" &&\n action.path === \"/api/v1/accounts/update_credentials\") {\n return this.http.patch(action.path, action.data, action.meta);\n }\n return false;\n }\n afterDispatch(action, result) {\n var _a;\n if (action.type === \"create\" && action.path === \"/api/v2/media\") {\n const media = result;\n if (isRecord(action.data) && ((_a = action.data) === null || _a === void 0 ? void 0 : _a.skipPolling) === true) {\n return media;\n }\n return waitForMediaAttachment(media.id, this.mediaTimeout, this.http);\n }\n return result;\n }\n}\n\nconst mergeAbortSignals = (signals) => {\n const abortController = new AbortController();\n for (const signal of signals) {\n signal.addEventListener(\"abort\", () => abortController.abort(), {\n once: true,\n });\n }\n return abortController.signal;\n};\n\nconst mergeHeadersInit = ([head, ...tail]) => {\n const headers = new Headers(head);\n for (const entry of tail) {\n for (const [key, value] of new Headers(entry).entries()) {\n headers.set(key, value);\n }\n }\n return headers;\n};\n\nclass HttpConfigImpl {\n constructor(props, serializer) {\n this.props = props;\n this.serializer = serializer;\n }\n mergeRequestInitWithDefaults(override = {}) {\n const requestInit = Object.assign({}, this.props.requestInit);\n // Merge\n {\n const { headers, signal } = override, rest = __rest(override, [\"headers\", \"signal\"]);\n Object.assign(requestInit, rest);\n requestInit.headers = this.mergeHeadersWithDefaults(headers);\n requestInit.signal = this.mergeAbortSignalWithDefaults(signal);\n }\n return requestInit;\n }\n resolvePath(path, params) {\n const url = new URL(path, this.props.url);\n if (typeof params === \"string\") {\n url.search = params;\n }\n else if (params != undefined) {\n url.search = this.serializer.serialize(\"querystring\", params);\n }\n return url;\n }\n mergeHeadersWithDefaults(override = {}) {\n var _a, _b;\n const headersInit = mergeHeadersInit([\n (_b = (_a = this.props.requestInit) === null || _a === void 0 ? void 0 : _a.headers) !== null && _b !== void 0 ? _b : {},\n override,\n ]);\n const headers = new Headers(headersInit);\n if (this.props.accessToken) {\n headers.set(\"Authorization\", `Bearer ${this.props.accessToken}`);\n }\n return new Headers(headers);\n }\n mergeAbortSignalWithDefaults(signal) {\n var _a;\n const signals = [];\n if (this.props.timeout != undefined) {\n signals.push(AbortSignal.timeout(this.props.timeout));\n }\n if ((_a = this.props.requestInit) === null || _a === void 0 ? void 0 : _a.signal) {\n signals.push(this.props.requestInit.signal);\n }\n if (signal != undefined) {\n signals.push(signal);\n }\n return signals.length === 1 ? signals[0] : mergeAbortSignals(signals);\n }\n}\n\nclass WebSocketConfigImpl {\n constructor(props, serializer) {\n this.props = props;\n this.serializer = serializer;\n }\n getProtocols(protocols = []) {\n if (this.props.useInsecureAccessToken ||\n this.props.accessToken == undefined) {\n return [...protocols];\n }\n return [this.props.accessToken, ...protocols];\n }\n resolvePath(path, params = {}) {\n const url = new URL(path, this.props.streamingApiUrl);\n if (this.props.useInsecureAccessToken) {\n params.accessToken = this.props.accessToken;\n }\n url.search = this.serializer.serialize(\"querystring\", params);\n return url;\n }\n getMaxAttempts() {\n if (this.props.retry === true || this.props.retry == undefined) {\n return Number.POSITIVE_INFINITY;\n }\n if (this.props.retry === false) {\n return 1;\n }\n return this.props.retry;\n }\n}\n\nclass BaseHttp {\n get(path, data, meta = {}) {\n return this.request(Object.assign({ method: \"GET\", path, search: data }, meta)).then((response) => response.data);\n }\n post(path, data, meta = {}) {\n return this.request(Object.assign({ method: \"POST\", path, body: data }, meta)).then((response) => response.data);\n }\n delete(path, data, meta = {}) {\n return this.request(Object.assign({ method: \"DELETE\", path, body: data }, meta)).then((response) => response.data);\n }\n put(path, data, meta = {}) {\n return this.request(Object.assign({ method: \"PUT\", path, body: data }, meta)).then((response) => response.data);\n }\n patch(path, data, meta = {}) {\n return this.request(Object.assign({ method: \"PATCH\", path, body: data }, meta)).then((response) => response.data);\n }\n}\n\nconst getEncoding = (headers) => {\n var _a;\n const contentType = (_a = headers.get(\"Content-Type\")) === null || _a === void 0 ? void 0 : _a.replace(/\\s*;.*$/, \"\");\n if (typeof contentType !== \"string\") {\n return;\n }\n switch (contentType) {\n case \"application/json\": {\n return \"json\";\n }\n case \"multipart/form-data\": {\n return \"multipart-form\";\n }\n default: {\n return;\n }\n }\n};\n\nclass HttpNativeImpl extends BaseHttp {\n constructor(serializer, config, logger) {\n super();\n this.serializer = serializer;\n this.config = config;\n this.logger = logger;\n }\n request(params) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e;\n const request = this.createRequest(params);\n try {\n (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log(\"info\", `↑ ${request.method} ${request.url}`);\n (_b = this.logger) === null || _b === void 0 ? void 0 : _b.log(\"debug\", \"\\tbody\", {\n encoding: params.encoding,\n body: params.body,\n });\n const response = yield fetch(request);\n if (!response.ok) {\n throw response;\n }\n const text = yield response.text();\n const encoding = getEncoding(response.headers);\n if (encoding == undefined) {\n throw new MastoUnexpectedError(\"The server returned data with an unknown encoding.\");\n }\n const data = this.serializer.deserialize(encoding, text);\n (_c = this.logger) === null || _c === void 0 ? void 0 : _c.log(\"info\", `↓ ${request.method} ${request.url}`);\n (_d = this.logger) === null || _d === void 0 ? void 0 : _d.log(\"debug\", \"\\tbody\", text);\n return {\n headers: response.headers,\n data,\n };\n }\n catch (error) {\n (_e = this.logger) === null || _e === void 0 ? void 0 : _e.log(\"debug\", `HTTP failed`, error);\n throw yield this.createError(error);\n }\n });\n }\n createRequest(params) {\n const { method, path, search, encoding = \"json\", requestInit = {}, } = params;\n const url = this.config.resolvePath(path, search);\n const body = this.serializer.serialize(encoding, params.body);\n const init = this.config.mergeRequestInitWithDefaults(requestInit);\n const request = new Request(url, Object.assign({ method,\n body }, init));\n if (typeof body === \"string\" && encoding === \"json\") {\n request.headers.set(\"Content-Type\", \"application/json\");\n }\n return request;\n }\n createError(error) {\n return __awaiter(this, void 0, void 0, function* () {\n if (error instanceof Response) {\n const encoding = getEncoding(error.headers);\n if (encoding == undefined) {\n throw new MastoUnexpectedError(\"The server returned data with an unknown encoding. The server may be down.\");\n }\n const data = this.serializer.deserialize(encoding, yield error.text());\n const { error: message, errorDescription, details } = data, additionalProperties = __rest(data, [\"error\", \"errorDescription\", \"details\"]);\n return new MastoHttpError({\n statusCode: error.status,\n message: message,\n description: errorDescription,\n details: details,\n additionalProperties,\n }, { cause: error });\n }\n // TODO: Remove this handling when `AbortSignal.any` is shipped\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (error != undefined && error.name === \"TimeoutError\") {\n return new MastoTimeoutError(`Request timed out`, { cause: error });\n }\n /* istanbul ignore next */\n return error;\n });\n }\n}\n\nclass LoggerConsoleImpl {\n constructor(level) {\n this.level = level;\n }\n log(type, message, meta) {\n if (!this.level.satisfies(type)) {\n return;\n }\n const args = meta == undefined ? [message] : [message, meta];\n switch (type) {\n case \"debug\": {\n console.debug(...args);\n return;\n }\n case \"info\": {\n console.info(...args);\n return;\n }\n case \"warn\": {\n console.warn(...args);\n return;\n }\n case \"error\": {\n console.error(...args);\n return;\n }\n }\n }\n}\n\n/* eslint-disable unicorn/prefer-math-trunc */\nconst LOG_TYPES = Object.freeze({\n DEBUG: 1 << 0,\n INFO: 1 << 1,\n WARN: 1 << 2,\n ERROR: 1 << 3,\n});\nclass LogLevel {\n constructor(level) {\n this.level = level;\n }\n satisfies(type) {\n switch (type) {\n case \"debug\": {\n return Boolean(this.level & LOG_TYPES.DEBUG);\n }\n case \"info\": {\n return Boolean(this.level & LOG_TYPES.INFO);\n }\n case \"warn\": {\n return Boolean(this.level & LOG_TYPES.WARN);\n }\n case \"error\": {\n return Boolean(this.level & LOG_TYPES.ERROR);\n }\n }\n }\n static from(type) {\n switch (type) {\n case \"debug\": {\n return new LogLevel(LOG_TYPES.DEBUG | LOG_TYPES.INFO | LOG_TYPES.WARN | LOG_TYPES.ERROR);\n }\n case \"info\": {\n return new LogLevel(LOG_TYPES.INFO | LOG_TYPES.WARN | LOG_TYPES.ERROR);\n }\n case \"warn\": {\n return new LogLevel(LOG_TYPES.WARN | LOG_TYPES.ERROR);\n }\n case \"error\": {\n return new LogLevel(LOG_TYPES.ERROR);\n }\n }\n }\n}\n\nconst createLogger = (type) => {\n const level = LogLevel.from(type !== null && type !== void 0 ? type : \"warn\");\n return new LoggerConsoleImpl(level);\n};\n\nconst ObjectFlattener = (keyMapper) => {\n const flatten = (object, parent = \"\") => {\n if (Array.isArray(object)) {\n return object.flatMap((value, i) => flatten(value, parent == \"\" ? i.toString() : keyMapper.onArray(parent, i)));\n }\n if (isRecord(object)) {\n return Object.entries(object).flatMap(([key, value]) => flatten(value, parent === \"\" ? key : keyMapper.onObject(parent, key)));\n }\n return [[parent, object]];\n };\n return flatten;\n};\nconst flattenForFormData = (object) => {\n const flatten = ObjectFlattener({\n onArray: (parent, index) => `${parent}[${index}]`,\n onObject: (parent, key) => `${parent}[${key}]`,\n });\n return Object.fromEntries(flatten(object));\n};\nconst flattenForRailsQueryString = (object) => {\n const flatten = ObjectFlattener({\n onArray: (parent) => `${parent}[]`,\n onObject: (parent, key) => `${parent}[${key}]`,\n });\n return flatten(object)\n .filter(([, v]) => v != undefined)\n .map(([k, v]) => `${k}=${encodeURIComponent(v)}`)\n .join(\"&\");\n};\n\nconst _transformKeys = (data, transform) => {\n if (Array.isArray(data)) {\n return data.map((value) => _transformKeys(value, transform));\n }\n if (isRecord(data)) {\n return Object.fromEntries(Object.entries(data).map(([key, value]) => [\n transform(key),\n _transformKeys(value, transform),\n ]));\n }\n return data;\n};\nconst transformKeys = (data, transform) => {\n const f = (key) => {\n // `PATCH /v1/preferences` uses `:` as a delimiter\n if (key.includes(\":\"))\n return key;\n // `PATCH /v2/filters` uses _destroy as a special key\n if (key.startsWith(\"_\"))\n return key;\n return transform(key);\n };\n return _transformKeys(data, f);\n};\n\nclass SerializerNativeImpl {\n serialize(type, rawData) {\n const data = transformKeys(rawData, snakeCase);\n switch (type) {\n case \"json\": {\n return JSON.stringify(data);\n }\n case \"multipart-form\": {\n const formData = new FormData();\n for (const [key, value] of Object.entries(flattenForFormData(data))) {\n formData.append(key, value);\n }\n return formData;\n }\n case \"querystring\": {\n return flattenForRailsQueryString(data);\n }\n default: {\n throw new MastoUnexpectedError(`Unknown content type ${type} to serialize.`);\n }\n }\n }\n deserialize(type, data) {\n switch (type) {\n case \"json\": {\n try {\n return transformKeys(JSON.parse(data), camelCase);\n }\n catch (_a) {\n throw new MastoDeserializeError(`Malformed JSON ${data} returned from the server.`, type, data);\n }\n }\n default: {\n throw new MastoDeserializeError(`Unknown content type ${type} returned from the server.`, type, data);\n }\n }\n }\n}\n\nconst createRestAPIClient = (props) => {\n const serializer = new SerializerNativeImpl();\n const config = new HttpConfigImpl(props, serializer);\n const logger = createLogger(props.log);\n const http = new HttpNativeImpl(serializer, config, logger);\n const hook = new HttpActionDispatcherHookMastodon(http);\n const actionDispatcher = new HttpActionDispatcher(http, hook);\n const actionProxy = createActionProxy(actionDispatcher, {\n context: [\"api\"],\n });\n return actionProxy;\n};\nconst createOAuthAPIClient = (props) => {\n const serializer = new SerializerNativeImpl();\n const config = new HttpConfigImpl(props, serializer);\n const logger = createLogger(props.log);\n const http = new HttpNativeImpl(serializer, config, logger);\n const hook = new HttpActionDispatcherHookMastodon(http);\n const actionDispatcher = new HttpActionDispatcher(http, hook);\n const actionProxy = createActionProxy(actionDispatcher, {\n context: [\"oauth\"],\n });\n return actionProxy;\n};\nfunction createStreamingAPIClient(props) {\n const serializer = new SerializerNativeImpl();\n const config = new WebSocketConfigImpl(props, serializer);\n const logger = createLogger(props.log);\n const connector = new WebSocketConnectorImpl({\n constructorParameters: [\n config.resolvePath(\"/api/v1/streaming\"),\n config.getProtocols(),\n ],\n implementation: props.implementation,\n maxAttempts: config.getMaxAttempts(),\n }, logger);\n const actionDispatcher = new WebSocketActionDispatcher(connector, serializer, logger);\n const actionProxy = createActionProxy(actionDispatcher);\n return actionProxy;\n}\n\nvar index$7 = /*#__PURE__*/Object.freeze({\n __proto__: null\n});\n\nvar index$6 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Admin: index$7\n});\n\nvar index$5 = /*#__PURE__*/Object.freeze({\n __proto__: null\n});\n\nvar index$4 = /*#__PURE__*/Object.freeze({\n __proto__: null\n});\n\nvar index$3 = /*#__PURE__*/Object.freeze({\n __proto__: null\n});\n\nvar index$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index$4,\n v2: index$3\n});\n\nvar index$1 = /*#__PURE__*/Object.freeze({\n __proto__: null\n});\n\nvar index = /*#__PURE__*/Object.freeze({\n __proto__: null\n});\n\nvar mastodon = /*#__PURE__*/Object.freeze({\n __proto__: null,\n oauth: index,\n rest: index$2,\n streaming: index$1,\n v1: index$6,\n v2: index$5\n});\n\nexport { MastoDeserializeError, MastoHttpError, MastoInvalidArgumentError, MastoTimeoutError, MastoUnexpectedError, MastoWebSocketError, createOAuthAPIClient, createRestAPIClient, createStreamingAPIClient, mastodon };\n","import store from './store';\n\nexport function getAccount(id) {\n const accounts = store.local.getJSON('accounts') || [];\n if (!id) return accounts[0];\n return accounts.find((a) => a.info.id === id) || accounts[0];\n}\n\nexport function getAccountByAccessToken(accessToken) {\n const accounts = store.local.getJSON('accounts') || [];\n return accounts.find((a) => a.accessToken === accessToken);\n}\n\nexport function getAccountByInstance(instance) {\n const accounts = store.local.getJSON('accounts') || [];\n return accounts.find((a) => a.instanceURL === instance);\n}\n\nconst standaloneMQ = window.matchMedia('(display-mode: standalone)');\n\nexport function getCurrentAccountID() {\n try {\n const id = store.session.get('currentAccount');\n if (id) return id;\n } catch (e) {}\n if (standaloneMQ.matches) {\n try {\n const id = store.local.get('currentAccount');\n if (id) return id;\n } catch (e) {}\n }\n return null;\n}\n\nexport function setCurrentAccountID(id) {\n try {\n store.session.set('currentAccount', id);\n } catch (e) {}\n if (standaloneMQ.matches) {\n try {\n store.local.set('currentAccount', id);\n } catch (e) {}\n }\n}\n\nexport function getCurrentAccount() {\n if (!window.__IGNORE_GET_ACCOUNT_ERROR__) {\n // Track down getCurrentAccount() calls before account-based states are initialized\n console.error('getCurrentAccount() called before states are initialized');\n if (import.meta.env.DEV) console.trace();\n }\n const currentAccount = getCurrentAccountID();\n const account = getAccount(currentAccount);\n return account;\n}\n\nexport function getCurrentAccountNS() {\n const account = getCurrentAccount();\n const {\n instanceURL,\n info: { id },\n } = account;\n return `${id}@${instanceURL}`;\n}\n\nexport function saveAccount(account) {\n const accounts = store.local.getJSON('accounts') || [];\n const acc = accounts.find((a) => a.info.id === account.info.id);\n if (acc) {\n acc.info = account.info;\n acc.instanceURL = account.instanceURL;\n acc.accessToken = account.accessToken;\n acc.vapidKey = account.vapidKey;\n } else {\n accounts.push(account);\n }\n store.local.setJSON('accounts', accounts);\n setCurrentAccountID(account.info.id);\n}\n\nexport function updateAccount(accountInfo) {\n // Only update if displayName or avatar or avatar_static is different\n const accounts = store.local.getJSON('accounts') || [];\n const acc = accounts.find((a) => a.info.id === accountInfo.id);\n if (acc) {\n if (\n acc.info.displayName !== accountInfo.displayName ||\n acc.info.avatar !== accountInfo.avatar ||\n acc.info.avatar_static !== accountInfo.avatar_static\n ) {\n acc.info = {\n ...acc.info,\n ...accountInfo,\n };\n store.local.setJSON('accounts', accounts);\n }\n }\n}\n\nlet currentInstance = null;\nexport function getCurrentInstance() {\n if (currentInstance) return currentInstance;\n try {\n const account = getCurrentAccount();\n const instances = store.local.getJSON('instances');\n const instance = account.instanceURL.toLowerCase();\n return (currentInstance = instances[instance]);\n } catch (e) {\n console.error(e);\n // alert(`Failed to load instance configuration. Please try again.\\n\\n${e}`);\n // Temporary fix for corrupted data\n // store.local.del('instances');\n // location.reload();\n return {};\n }\n}\n\n// Massage these instance configurations to match the Mastodon API\n// - Pleroma\nfunction getInstanceConfiguration(instance) {\n const {\n configuration,\n maxMediaAttachments,\n maxTootChars,\n pleroma,\n pollLimits,\n } = instance;\n\n const statuses = configuration?.statuses || {};\n if (maxMediaAttachments) {\n statuses.maxMediaAttachments ??= maxMediaAttachments;\n }\n if (maxTootChars) {\n statuses.maxCharacters ??= maxTootChars;\n }\n\n const polls = configuration?.polls || {};\n if (pollLimits) {\n polls.maxCharactersPerOption ??= pollLimits.maxOptionChars;\n polls.maxExpiration ??= pollLimits.maxExpiration;\n polls.maxOptions ??= pollLimits.maxOptions;\n polls.minExpiration ??= pollLimits.minExpiration;\n }\n\n return {\n ...configuration,\n statuses,\n polls,\n };\n}\n\nexport function getCurrentInstanceConfiguration() {\n const instance = getCurrentInstance();\n return getInstanceConfiguration(instance);\n}\n\nexport function isMediaFirstInstance() {\n const instance = getCurrentInstance();\n return /pixelfed/i.test(instance?.version);\n}\n","import { getCurrentAccountNS } from './store-utils';\n\nconst local = {\n get: (key) => {\n try {\n return localStorage.getItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n getJSON: (key) => {\n try {\n return JSON.parse(local.get(key));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n set: (key, value) => {\n try {\n return localStorage.setItem(key, value);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n setJSON: (key, value) => {\n try {\n return local.set(key, JSON.stringify(value));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n del: (key) => {\n try {\n return localStorage.removeItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n};\n\nconst session = {\n get: (key) => {\n try {\n return sessionStorage.getItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n getJSON: (key) => {\n try {\n return JSON.parse(session.get(key));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n set: (key, value) => {\n try {\n return sessionStorage.setItem(key, value);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n setJSON: (key, value) => {\n try {\n return session.set(key, JSON.stringify(value));\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n del: (key) => {\n try {\n return sessionStorage.removeItem(key);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n};\n\n// Store with account namespace (id@domain.tld) <- uses id, not username\nconst account = {\n get: (key) => {\n try {\n return local.getJSON(key)[getCurrentAccountNS()];\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n set: (key, value) => {\n try {\n const data = local.getJSON(key) || {};\n data[getCurrentAccountNS()] = value;\n return local.setJSON(key, data);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n del: (key) => {\n try {\n const data = local.getJSON(key) || {};\n delete data[getCurrentAccountNS()];\n return local.setJSON(key, data);\n } catch (e) {\n console.warn(e);\n return null;\n }\n },\n};\n\nexport default { local, session, account };\n","import { createRestAPIClient, createStreamingAPIClient } from 'masto';\n\nimport store from './store';\nimport {\n getAccount,\n getAccountByAccessToken,\n getAccountByInstance,\n getCurrentAccount,\n saveAccount,\n setCurrentAccountID,\n} from './store-utils';\n\n// Default *fallback* instance\nconst DEFAULT_INSTANCE = 'mastodon.social';\n\n// Per-instance masto instance\n// Useful when only one account is logged in\n// I'm not sure if I'll ever allow multiple logged-in accounts but oh well...\n// E.g. apis['mastodon.social']\nconst apis = {};\n\n// Per-account masto instance\n// Note: There can be many accounts per instance\n// Useful when multiple accounts are logged in or when certain actions require a specific account\n// Just in case if I need this one day.\n// E.g. accountApis['mastodon.social']['ACCESS_TOKEN']\nconst accountApis = {};\nwindow.__ACCOUNT_APIS__ = accountApis;\n\n// Current account masto instance\nlet currentAccountApi;\n\nexport function initClient({ instance, accessToken }) {\n if (/^https?:\\/\\//.test(instance)) {\n instance = instance\n .replace(/^https?:\\/\\//, '')\n .replace(/\\/+$/, '')\n .toLowerCase();\n }\n const url = instance ? `https://${instance}` : `https://${DEFAULT_INSTANCE}`;\n\n const masto = createRestAPIClient({\n url,\n accessToken, // Can be null\n timeout: 30_000, // Unfortunatly this is global instead of per-request\n });\n\n const client = {\n masto,\n instance,\n accessToken,\n };\n apis[instance] = client;\n if (!accountApis[instance]) accountApis[instance] = {};\n if (accessToken) accountApis[instance][accessToken] = client;\n\n return client;\n}\n\n// Get the instance information\n// The config is needed for composing\nexport async function initInstance(client, instance) {\n console.log('INIT INSTANCE', client, instance);\n const { masto, accessToken } = client;\n // Request v2, fallback to v1 if fail\n let info;\n try {\n info = await masto.v2.instance.fetch();\n } catch (e) {}\n if (!info) {\n try {\n info = await masto.v1.instance.fetch();\n } catch (e) {}\n }\n if (!info) return;\n console.log(info);\n const {\n // v1\n uri,\n urls: { streamingApi } = {},\n // v2\n domain,\n configuration: { urls: { streaming } = {} } = {},\n } = info;\n const instances = store.local.getJSON('instances') || {};\n if (uri || domain) {\n instances[\n (domain || uri)\n .replace(/^https?:\\/\\//, '')\n .replace(/\\/+$/, '')\n .toLowerCase()\n ] = info;\n }\n if (instance) {\n instances[instance.toLowerCase()] = info;\n }\n store.local.setJSON('instances', instances);\n // This is a weird place to put this but here's updating the masto instance with the streaming API URL set in the configuration\n // Reason: Streaming WebSocket URL may change, unlike the standard API REST URLs\n const supportsWebSocket = 'WebSocket' in window;\n if (supportsWebSocket && (streamingApi || streaming)) {\n console.log('🎏 Streaming API URL:', streaming || streamingApi);\n // masto.config.props.streamingApiUrl = streaming || streamingApi;\n // Legacy masto.ws\n const streamClient = createStreamingAPIClient({\n streamingApiUrl: streaming || streamingApi,\n accessToken,\n implementation: WebSocket,\n });\n client.streaming = streamClient;\n // masto.ws = streamClient;\n console.log('🎏 Streaming API client:', client);\n }\n}\n\n// Get the account information and store it\nexport async function initAccount(client, instance, accessToken, vapidKey) {\n const { masto } = client;\n const mastoAccount = await masto.v1.accounts.verifyCredentials();\n\n console.log('CURRENTACCOUNT SET', mastoAccount.id);\n setCurrentAccountID(mastoAccount.id);\n\n saveAccount({\n info: mastoAccount,\n instanceURL: instance.toLowerCase(),\n accessToken,\n vapidKey,\n });\n}\n\n// Get preferences\nexport async function initPreferences(client) {\n try {\n const { masto } = client;\n const preferences = await masto.v1.preferences.fetch();\n store.account.set('preferences', preferences);\n } catch (e) {\n // silently fail\n console.error(e);\n }\n}\n\n// Get the masto instance\n// If accountID is provided, get the masto instance for that account\nexport function api({ instance, accessToken, accountID, account } = {}) {\n // Always lowercase and trim the instance\n if (instance) {\n instance = instance.toLowerCase().trim();\n }\n\n // If instance and accessToken are provided, get the masto instance for that account\n if (instance && accessToken) {\n const client =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n }\n\n if (accessToken) {\n // If only accessToken is provided, get the masto instance for that accessToken\n console.log('X 1', accountApis);\n for (const instance in accountApis) {\n if (accountApis[instance][accessToken]) {\n console.log('X 2', accountApis, instance, accessToken);\n const client = accountApis[instance][accessToken];\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n } else {\n console.log('X 3', accountApis, instance, accessToken);\n const account = getAccountByAccessToken(accessToken);\n if (account) {\n const accessToken = account.accessToken;\n const instance = account.instanceURL.toLowerCase().trim();\n const client = initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n } else {\n throw new Error(`Access token not found`);\n }\n }\n }\n }\n\n // If account is provided, get the masto instance for that account\n if (account || accountID) {\n account = account || getAccount(accountID);\n if (account) {\n const accessToken = account.accessToken;\n const instance = account.instanceURL.toLowerCase().trim();\n const client =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n } else {\n throw new Error(`Account ${accountID} not found`);\n }\n }\n\n const currentAccount = getCurrentAccount();\n\n // If only instance is provided, get the masto instance for that instance\n if (instance) {\n if (currentAccountApi?.instance === instance) {\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance,\n };\n }\n\n if (currentAccount?.instanceURL === instance) {\n const { accessToken } = currentAccount;\n currentAccountApi =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance,\n };\n }\n\n const instanceAccount = getAccountByInstance(instance);\n if (instanceAccount) {\n const accessToken = instanceAccount.accessToken;\n const client =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: true,\n instance,\n };\n }\n\n const client = apis[instance] || initClient({ instance });\n const { masto, streaming, accessToken } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: !!accessToken,\n instance,\n };\n }\n\n // If no instance is provided, get the masto instance for the current account\n if (currentAccountApi) {\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance: currentAccountApi.instance,\n };\n }\n if (currentAccount) {\n const { accessToken, instanceURL: instance } = currentAccount;\n currentAccountApi =\n accountApis[instance]?.[accessToken] ||\n initClient({ instance, accessToken });\n return {\n masto: currentAccountApi.masto,\n streaming: currentAccountApi.streaming,\n client: currentAccountApi,\n authenticated: true,\n instance,\n };\n }\n\n // If no instance is provided and no account is logged in, get the masto instance for DEFAULT_INSTANCE\n const client =\n apis[DEFAULT_INSTANCE] || initClient({ instance: DEFAULT_INSTANCE });\n const { masto, streaming } = client;\n return {\n masto,\n streaming,\n client,\n authenticated: false,\n instance: DEFAULT_INSTANCE,\n };\n}\n\nwindow.__API__ = {\n currentAccountApi,\n apis,\n accountApis,\n};\n","var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/**\n * Combine two comparators into a single comparators.\n */\nfunction combineComparators(comparatorA, comparatorB) {\n return function isEqual(a, b, state) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nfunction createIsCircular(areItemsEqual) {\n return function isCircular(a, b, state) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n var cache = state.cache;\n var cachedA = cache.get(a);\n var cachedB = cache.get(b);\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n cache.set(a, b);\n cache.set(b, a);\n var result = areItemsEqual(a, b, state);\n cache.delete(a);\n cache.delete(b);\n return result;\n };\n}\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nfunction getStrictProperties(object) {\n return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));\n}\n/**\n * Whether the object contains the property passed as an own property.\n */\nvar hasOwn = Object.hasOwn ||\n (function (object, property) {\n return hasOwnProperty.call(object, property);\n });\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nfunction sameValueZeroEqual(a, b) {\n return a || b ? a === b : a === b || (a !== a && b !== b);\n}\n\nvar OWNER = '_owner';\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;\n/**\n * Whether the arrays are equal in value.\n */\nfunction areArraysEqual(a, b, state) {\n var index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the dates passed are equal in value.\n */\nfunction areDatesEqual(a, b) {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n/**\n * Whether the `Map`s are equal in value.\n */\nfunction areMapsEqual(a, b, state) {\n if (a.size !== b.size) {\n return false;\n }\n var matchedIndices = {};\n var aIterable = a.entries();\n var index = 0;\n var aResult;\n var bResult;\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n var bIterable = b.entries();\n var hasMatch = false;\n var matchIndex = 0;\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n var _a = aResult.value, aKey = _a[0], aValue = _a[1];\n var _b = bResult.value, bKey = _b[0], bValue = _b[1];\n if (!hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch =\n state.equals(aKey, bKey, index, matchIndex, a, b, state) &&\n state.equals(aValue, bValue, aKey, bKey, a, b, state))) {\n matchedIndices[matchIndex] = true;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n index++;\n }\n return true;\n}\n/**\n * Whether the objects are equal in value.\n */\nfunction areObjectsEqual(a, b, state) {\n var properties = keys(a);\n var index = properties.length;\n if (keys(b).length !== index) {\n return false;\n }\n var property;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof) {\n return false;\n }\n if (!hasOwn(b, property) ||\n !state.equals(a[property], b[property], property, property, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nfunction areObjectsEqualStrict(a, b, state) {\n var properties = getStrictProperties(a);\n var index = properties.length;\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n var property;\n var descriptorA;\n var descriptorB;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof) {\n return false;\n }\n if (!hasOwn(b, property)) {\n return false;\n }\n if (!state.equals(a[property], b[property], property, property, a, b, state)) {\n return false;\n }\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n if ((descriptorA || descriptorB) &&\n (!descriptorA ||\n !descriptorB ||\n descriptorA.configurable !== descriptorB.configurable ||\n descriptorA.enumerable !== descriptorB.enumerable ||\n descriptorA.writable !== descriptorB.writable)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nfunction arePrimitiveWrappersEqual(a, b) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n/**\n * Whether the regexps passed are equal in value.\n */\nfunction areRegExpsEqual(a, b) {\n return a.source === b.source && a.flags === b.flags;\n}\n/**\n * Whether the `Set`s are equal in value.\n */\nfunction areSetsEqual(a, b, state) {\n if (a.size !== b.size) {\n return false;\n }\n var matchedIndices = {};\n var aIterable = a.values();\n var aResult;\n var bResult;\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n var bIterable = b.values();\n var hasMatch = false;\n var matchIndex = 0;\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (!hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch = state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state))) {\n matchedIndices[matchIndex] = true;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the TypedArray instances are equal in value.\n */\nfunction areTypedArraysEqual(a, b) {\n var index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n return true;\n}\n\nvar ARGUMENTS_TAG = '[object Arguments]';\nvar BOOLEAN_TAG = '[object Boolean]';\nvar DATE_TAG = '[object Date]';\nvar MAP_TAG = '[object Map]';\nvar NUMBER_TAG = '[object Number]';\nvar OBJECT_TAG = '[object Object]';\nvar REG_EXP_TAG = '[object RegExp]';\nvar SET_TAG = '[object Set]';\nvar STRING_TAG = '[object String]';\nvar isArray = Array.isArray;\nvar isTypedArray = typeof ArrayBuffer === 'function' && ArrayBuffer.isView\n ? ArrayBuffer.isView\n : null;\nvar assign = Object.assign;\nvar getTag = Object.prototype.toString.call.bind(Object.prototype.toString);\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nfunction createEqualityComparator(_a) {\n var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areMapsEqual = _a.areMapsEqual, areObjectsEqual = _a.areObjectsEqual, arePrimitiveWrappersEqual = _a.arePrimitiveWrappersEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, areTypedArraysEqual = _a.areTypedArraysEqual;\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a, b, state) {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n // If the items are not non-nullish objects, then the only possibility\n // of them being equal but not strictly is if they are both `NaN`. Since\n // `NaN` is uniquely not equal to itself, we can use self-comparison of\n // both objects, which is faster than `isNaN()`.\n if (a == null ||\n b == null ||\n typeof a !== 'object' ||\n typeof b !== 'object') {\n return a !== a && b !== b;\n }\n var constructor = a.constructor;\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray != null && isTypedArray(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n var tag = getTag(a);\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return (typeof a.then !== 'function' &&\n typeof b.then !== 'function' &&\n areObjectsEqual(a, b, state));\n }\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n/**\n * Create the configuration object used for building comparators.\n */\nfunction createEqualityComparatorConfig(_a) {\n var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;\n var config = {\n areArraysEqual: strict\n ? areObjectsEqualStrict\n : areArraysEqual,\n areDatesEqual: areDatesEqual,\n areMapsEqual: strict\n ? combineComparators(areMapsEqual, areObjectsEqualStrict)\n : areMapsEqual,\n areObjectsEqual: strict\n ? areObjectsEqualStrict\n : areObjectsEqual,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,\n areRegExpsEqual: areRegExpsEqual,\n areSetsEqual: strict\n ? combineComparators(areSetsEqual, areObjectsEqualStrict)\n : areSetsEqual,\n areTypedArraysEqual: strict\n ? areObjectsEqualStrict\n : areTypedArraysEqual,\n };\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n if (circular) {\n var areArraysEqual$1 = createIsCircular(config.areArraysEqual);\n var areMapsEqual$1 = createIsCircular(config.areMapsEqual);\n var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);\n var areSetsEqual$1 = createIsCircular(config.areSetsEqual);\n config = assign({}, config, {\n areArraysEqual: areArraysEqual$1,\n areMapsEqual: areMapsEqual$1,\n areObjectsEqual: areObjectsEqual$1,\n areSetsEqual: areSetsEqual$1,\n });\n }\n return config;\n}\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nfunction createInternalEqualityComparator(compare) {\n return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {\n return compare(a, b, state);\n };\n}\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nfunction createIsEqual(_a) {\n var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;\n if (createState) {\n return function isEqual(a, b) {\n var _a = createState(), _b = _a.cache, cache = _b === void 0 ? circular ? new WeakMap() : undefined : _b, meta = _a.meta;\n return comparator(a, b, {\n cache: cache,\n equals: equals,\n meta: meta,\n strict: strict,\n });\n };\n }\n if (circular) {\n return function isEqual(a, b) {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals: equals,\n meta: undefined,\n strict: strict,\n });\n };\n }\n var state = {\n cache: undefined,\n equals: equals,\n meta: undefined,\n strict: strict,\n };\n return function isEqual(a, b) {\n return comparator(a, b, state);\n };\n}\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nvar deepEqual = createCustomEqual();\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nvar strictDeepEqual = createCustomEqual({ strict: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nvar circularDeepEqual = createCustomEqual({ circular: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nvar strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nvar shallowEqual = createCustomEqual({\n createInternalComparator: function () { return sameValueZeroEqual; },\n});\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nvar strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: function () { return sameValueZeroEqual; },\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nvar circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: function () { return sameValueZeroEqual; },\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nvar strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: function () { return sameValueZeroEqual; },\n strict: true,\n});\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nfunction createCustomEqual(options) {\n if (options === void 0) { options = {}; }\n var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;\n var config = createEqualityComparatorConfig(options);\n var comparator = createEqualityComparator(config);\n var equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n return createIsEqual({ circular: circular, comparator: comparator, createState: createState, equals: equals, strict: strict });\n}\n\nexport { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictShallowEqual };\n//# sourceMappingURL=index.mjs.map\n","import { subscribe, snapshot, proxy, ref, unstable_buildProxyFunction } from 'valtio/vanilla';\nimport { derive } from 'derive-valtio';\nexport { derive, underive, unstable_deriveSubscriptions } from 'derive-valtio';\n\nfunction subscribeKey(proxyObject, key, callback, notifyInSync) {\n let prevValue = proxyObject[key];\n return subscribe(\n proxyObject,\n () => {\n const nextValue = proxyObject[key];\n if (!Object.is(prevValue, nextValue)) {\n callback(prevValue = nextValue);\n }\n },\n notifyInSync\n );\n}\n\nlet currentCleanups;\nfunction watch(callback, options) {\n let alive = true;\n const cleanups = /* @__PURE__ */ new Set();\n const subscriptions = /* @__PURE__ */ new Map();\n const cleanup = () => {\n if (alive) {\n alive = false;\n cleanups.forEach((clean) => clean());\n cleanups.clear();\n subscriptions.forEach((unsubscribe) => unsubscribe());\n subscriptions.clear();\n }\n };\n const revalidate = async () => {\n if (!alive) {\n return;\n }\n cleanups.forEach((clean) => clean());\n cleanups.clear();\n const proxiesToSubscribe = /* @__PURE__ */ new Set();\n const parent = currentCleanups;\n currentCleanups = cleanups;\n try {\n const promiseOrPossibleCleanup = callback((proxyObject) => {\n proxiesToSubscribe.add(proxyObject);\n if (alive && !subscriptions.has(proxyObject)) {\n const unsubscribe = subscribe(proxyObject, revalidate, options == null ? void 0 : options.sync);\n subscriptions.set(proxyObject, unsubscribe);\n }\n return proxyObject;\n });\n const couldBeCleanup = promiseOrPossibleCleanup && promiseOrPossibleCleanup instanceof Promise ? await promiseOrPossibleCleanup : promiseOrPossibleCleanup;\n if (couldBeCleanup) {\n if (alive) {\n cleanups.add(couldBeCleanup);\n } else {\n cleanup();\n }\n }\n } finally {\n currentCleanups = parent;\n }\n subscriptions.forEach((unsubscribe, proxyObject) => {\n if (!proxiesToSubscribe.has(proxyObject)) {\n subscriptions.delete(proxyObject);\n unsubscribe();\n }\n });\n };\n if (currentCleanups) {\n currentCleanups.add(cleanup);\n }\n revalidate();\n return cleanup;\n}\n\nconst DEVTOOLS = Symbol();\nfunction devtools(proxyObject, options) {\n if (typeof options === \"string\") {\n console.warn(\n \"string name option is deprecated, use { name }. https://github.com/pmndrs/valtio/pull/400\"\n );\n options = { name: options };\n }\n const { enabled, name = \"\", ...rest } = options || {};\n let extension;\n try {\n extension = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extension) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && enabled) {\n console.warn(\"[Warning] Please install/enable Redux devtools extension\");\n }\n return;\n }\n let isTimeTraveling = false;\n const devtools2 = extension.connect({ name, ...rest });\n const unsub1 = subscribe(proxyObject, (ops) => {\n const action = ops.filter(([_, path]) => path[0] !== DEVTOOLS).map(([op, path]) => `${op}:${path.map(String).join(\".\")}`).join(\", \");\n if (!action) {\n return;\n }\n if (isTimeTraveling) {\n isTimeTraveling = false;\n } else {\n const snapWithoutDevtools = Object.assign({}, snapshot(proxyObject));\n delete snapWithoutDevtools[DEVTOOLS];\n devtools2.send(\n {\n type: action,\n updatedAt: (/* @__PURE__ */ new Date()).toLocaleString()\n },\n snapWithoutDevtools\n );\n }\n });\n const unsub2 = devtools2.subscribe((message) => {\n var _a, _b, _c, _d, _e, _f;\n if (message.type === \"ACTION\" && message.payload) {\n try {\n Object.assign(proxyObject, JSON.parse(message.payload));\n } catch (e) {\n console.error(\n \"please dispatch a serializable value that JSON.parse() and proxy() support\\n\",\n e\n );\n }\n }\n if (message.type === \"DISPATCH\" && message.state) {\n if (((_a = message.payload) == null ? void 0 : _a.type) === \"JUMP_TO_ACTION\" || ((_b = message.payload) == null ? void 0 : _b.type) === \"JUMP_TO_STATE\") {\n isTimeTraveling = true;\n const state = JSON.parse(message.state);\n Object.assign(proxyObject, state);\n }\n proxyObject[DEVTOOLS] = message;\n } else if (message.type === \"DISPATCH\" && ((_c = message.payload) == null ? void 0 : _c.type) === \"COMMIT\") {\n devtools2.init(snapshot(proxyObject));\n } else if (message.type === \"DISPATCH\" && ((_d = message.payload) == null ? void 0 : _d.type) === \"IMPORT_STATE\") {\n const actions = (_e = message.payload.nextLiftedState) == null ? void 0 : _e.actionsById;\n const computedStates = ((_f = message.payload.nextLiftedState) == null ? void 0 : _f.computedStates) || [];\n isTimeTraveling = true;\n computedStates.forEach(({ state }, index) => {\n const action = actions[index] || \"No action found\";\n Object.assign(proxyObject, state);\n if (index === 0) {\n devtools2.init(snapshot(proxyObject));\n } else {\n devtools2.send(action, snapshot(proxyObject));\n }\n });\n }\n });\n devtools2.init(snapshot(proxyObject));\n return () => {\n unsub1();\n unsub2 == null ? void 0 : unsub2();\n };\n}\n\nfunction addComputed_DEPRECATED(proxyObject, computedFns_FAKE, targetObject = proxyObject) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"addComputed is deprecated. Please consider using `derive`. Falling back to emulation with derive. https://github.com/pmndrs/valtio/pull/201\"\n );\n }\n const derivedFns = {};\n Object.keys(computedFns_FAKE).forEach((key) => {\n derivedFns[key] = (get) => computedFns_FAKE[key](get(proxyObject));\n });\n return derive(derivedFns, { proxy: targetObject });\n}\n\nfunction proxyWithComputed_DEPRECATED(initialObject, computedFns) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n 'proxyWithComputed is deprecated. Please follow \"Computed Properties\" guide in docs.'\n );\n }\n Object.keys(computedFns).forEach((key) => {\n if (Object.getOwnPropertyDescriptor(initialObject, key)) {\n throw new Error(\"object property already defined\");\n }\n const computedFn = computedFns[key];\n const { get, set } = typeof computedFn === \"function\" ? { get: computedFn } : computedFn;\n const desc = {};\n desc.get = () => get(snapshot(proxyObject));\n if (set) {\n desc.set = (newValue) => set(proxyObject, newValue);\n }\n Object.defineProperty(initialObject, key, desc);\n });\n const proxyObject = proxy(initialObject);\n return proxyObject;\n}\n\nconst isObject = (x) => typeof x === \"object\" && x !== null;\nlet refSet;\nconst deepClone = (obj) => {\n if (!refSet) {\n refSet = unstable_buildProxyFunction()[2];\n }\n if (!isObject(obj) || refSet.has(obj)) {\n return obj;\n }\n const baseObject = Array.isArray(obj) ? [] : Object.create(Object.getPrototypeOf(obj));\n Reflect.ownKeys(obj).forEach((key) => {\n baseObject[key] = deepClone(obj[key]);\n });\n return baseObject;\n};\nfunction proxyWithHistory_DEPRECATED(initialValue, skipSubscribe = false) {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n 'proxyWithHistory is deprecated. Please use the \"valtio-history\" package; refer to the docs'\n );\n }\n const proxyObject = proxy({\n value: initialValue,\n history: ref({\n wip: void 0,\n // to avoid infinite loop\n snapshots: [],\n index: -1\n }),\n clone: deepClone,\n canUndo: () => proxyObject.history.index > 0,\n undo: () => {\n if (proxyObject.canUndo()) {\n proxyObject.value = proxyObject.history.wip = proxyObject.clone(\n proxyObject.history.snapshots[--proxyObject.history.index]\n );\n }\n },\n canRedo: () => proxyObject.history.index < proxyObject.history.snapshots.length - 1,\n redo: () => {\n if (proxyObject.canRedo()) {\n proxyObject.value = proxyObject.history.wip = proxyObject.clone(\n proxyObject.history.snapshots[++proxyObject.history.index]\n );\n }\n },\n saveHistory: () => {\n proxyObject.history.snapshots.splice(proxyObject.history.index + 1);\n proxyObject.history.snapshots.push(snapshot(proxyObject).value);\n ++proxyObject.history.index;\n },\n subscribe: () => subscribe(proxyObject, (ops) => {\n if (ops.every(\n (op) => op[1][0] === \"value\" && (op[0] !== \"set\" || op[2] !== proxyObject.history.wip)\n )) {\n proxyObject.saveHistory();\n }\n })\n });\n proxyObject.saveHistory();\n if (!skipSubscribe) {\n proxyObject.subscribe();\n }\n return proxyObject;\n}\n\nfunction proxySet(initialValues) {\n const set = proxy({\n data: Array.from(new Set(initialValues)),\n has(value) {\n return this.data.indexOf(value) !== -1;\n },\n add(value) {\n let hasProxy = false;\n if (typeof value === \"object\" && value !== null) {\n hasProxy = this.data.indexOf(proxy(value)) !== -1;\n }\n if (this.data.indexOf(value) === -1 && !hasProxy) {\n this.data.push(value);\n }\n return this;\n },\n delete(value) {\n const index = this.data.indexOf(value);\n if (index === -1) {\n return false;\n }\n this.data.splice(index, 1);\n return true;\n },\n clear() {\n this.data.splice(0);\n },\n get size() {\n return this.data.length;\n },\n forEach(cb) {\n this.data.forEach((value) => {\n cb(value, value, this);\n });\n },\n get [Symbol.toStringTag]() {\n return \"Set\";\n },\n toJSON() {\n return new Set(this.data);\n },\n [Symbol.iterator]() {\n return this.data[Symbol.iterator]();\n },\n values() {\n return this.data.values();\n },\n keys() {\n return this.data.values();\n },\n entries() {\n return new Set(this.data).entries();\n }\n });\n Object.defineProperties(set, {\n data: {\n enumerable: false\n },\n size: {\n enumerable: false\n },\n toJSON: {\n enumerable: false\n }\n });\n Object.seal(set);\n return set;\n}\n\nfunction proxyMap(entries) {\n const map = proxy({\n data: Array.from(entries || []),\n has(key) {\n return this.data.some((p) => p[0] === key);\n },\n set(key, value) {\n const record = this.data.find((p) => p[0] === key);\n if (record) {\n record[1] = value;\n } else {\n this.data.push([key, value]);\n }\n return this;\n },\n get(key) {\n var _a;\n return (_a = this.data.find((p) => p[0] === key)) == null ? void 0 : _a[1];\n },\n delete(key) {\n const index = this.data.findIndex((p) => p[0] === key);\n if (index === -1) {\n return false;\n }\n this.data.splice(index, 1);\n return true;\n },\n clear() {\n this.data.splice(0);\n },\n get size() {\n return this.data.length;\n },\n toJSON() {\n return new Map(this.data);\n },\n forEach(cb) {\n this.data.forEach((p) => {\n cb(p[1], p[0], this);\n });\n },\n keys() {\n return this.data.map((p) => p[0]).values();\n },\n values() {\n return this.data.map((p) => p[1]).values();\n },\n entries() {\n return new Map(this.data).entries();\n },\n get [Symbol.toStringTag]() {\n return \"Map\";\n },\n [Symbol.iterator]() {\n return this.entries();\n }\n });\n Object.defineProperties(map, {\n data: {\n enumerable: false\n },\n size: {\n enumerable: false\n },\n toJSON: {\n enumerable: false\n }\n });\n Object.seal(map);\n return map;\n}\n\nexport { addComputed_DEPRECATED as addComputed, devtools, proxyMap, proxySet, proxyWithComputed_DEPRECATED as proxyWithComputed, proxyWithHistory_DEPRECATED as proxyWithHistory, subscribeKey, watch };\n","import { useLayoutEffect } from 'react';\nimport { useSnapshot } from 'valtio/react';\n\nconst DUMMY_SYMBOL = Symbol();\nfunction useProxy(proxy, options) {\n const snapshot = useSnapshot(proxy, options);\n snapshot[DUMMY_SYMBOL];\n let isRendering = true;\n useLayoutEffect(() => {\n isRendering = false;\n });\n return new Proxy(proxy, {\n get(target, prop) {\n return isRendering ? snapshot[prop] : target[prop];\n }\n });\n}\n\nexport { useProxy };\n","export default function isMastodonLinkMaybe(url) {\n try {\n const { pathname, hash } = URL.parse(url);\n return (\n /^\\/.*\\/\\d+$/i.test(pathname) ||\n /^\\/(@[^/]+|users\\/[^/]+)\\/(statuses|posts)\\/\\w+\\/?$/i.test(pathname) || // GoToSocial, Takahe\n /^\\/notes\\/[a-z0-9]+$/i.test(pathname) || // Misskey, Firefish\n /^\\/(notice|objects)\\/[a-z0-9-]+$/i.test(pathname) || // Pleroma\n /^\\/@[^/]+\\/post\\/[a-z0-9]+$/i.test(pathname) || // Threads\n /#\\/[^\\/]+\\.[^\\/]+\\/s\\/.+/i.test(hash) // Phanpy 🫣\n );\n } catch (e) {\n return false;\n }\n}\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global[\"micro-memoize\"] = factory());\n})(this, (function () { 'use strict';\n\n /**\n * @constant DEFAULT_OPTIONS_KEYS the default options keys\n */\n var DEFAULT_OPTIONS_KEYS = {\n isEqual: true,\n isMatchingKey: true,\n isPromise: true,\n maxSize: true,\n onCacheAdd: true,\n onCacheChange: true,\n onCacheHit: true,\n transformKey: true,\n };\n /**\n * @function slice\n *\n * @description\n * slice.call() pre-bound\n */\n var slice = Array.prototype.slice;\n /**\n * @function cloneArray\n *\n * @description\n * clone the array-like object and return the new array\n *\n * @param arrayLike the array-like object to clone\n * @returns the clone as an array\n */\n function cloneArray(arrayLike) {\n var length = arrayLike.length;\n if (!length) {\n return [];\n }\n if (length === 1) {\n return [arrayLike[0]];\n }\n if (length === 2) {\n return [arrayLike[0], arrayLike[1]];\n }\n if (length === 3) {\n return [arrayLike[0], arrayLike[1], arrayLike[2]];\n }\n return slice.call(arrayLike, 0);\n }\n /**\n * @function getCustomOptions\n *\n * @description\n * get the custom options on the object passed\n *\n * @param options the memoization options passed\n * @returns the custom options passed\n */\n function getCustomOptions(options) {\n var customOptions = {};\n /* eslint-disable no-restricted-syntax */\n for (var key in options) {\n if (!DEFAULT_OPTIONS_KEYS[key]) {\n customOptions[key] = options[key];\n }\n }\n /* eslint-enable */\n return customOptions;\n }\n /**\n * @function isMemoized\n *\n * @description\n * is the function passed already memoized\n *\n * @param fn the function to test\n * @returns is the function already memoized\n */\n function isMemoized(fn) {\n return typeof fn === 'function' && fn.isMemoized;\n }\n /**\n * @function isSameValueZero\n *\n * @description\n * are the objects equal based on SameValueZero equality\n *\n * @param object1 the first object to compare\n * @param object2 the second object to compare\n * @returns are the two objects equal\n */\n function isSameValueZero(object1, object2) {\n // eslint-disable-next-line no-self-compare\n return object1 === object2 || (object1 !== object1 && object2 !== object2);\n }\n /**\n * @function mergeOptions\n *\n * @description\n * merge the options into the target\n *\n * @param existingOptions the options provided\n * @param newOptions the options to include\n * @returns the merged options\n */\n function mergeOptions(existingOptions, newOptions) {\n var target = {};\n /* eslint-disable no-restricted-syntax */\n for (var key in existingOptions) {\n target[key] = existingOptions[key];\n }\n for (var key in newOptions) {\n target[key] = newOptions[key];\n }\n /* eslint-enable */\n return target;\n }\n\n // utils\n var Cache = /** @class */ (function () {\n function Cache(options) {\n this.keys = [];\n this.values = [];\n this.options = options;\n var isMatchingKeyFunction = typeof options.isMatchingKey === 'function';\n if (isMatchingKeyFunction) {\n this.getKeyIndex = this._getKeyIndexFromMatchingKey;\n }\n else if (options.maxSize > 1) {\n this.getKeyIndex = this._getKeyIndexForMany;\n }\n else {\n this.getKeyIndex = this._getKeyIndexForSingle;\n }\n this.canTransformKey = typeof options.transformKey === 'function';\n this.shouldCloneArguments = this.canTransformKey || isMatchingKeyFunction;\n this.shouldUpdateOnAdd = typeof options.onCacheAdd === 'function';\n this.shouldUpdateOnChange = typeof options.onCacheChange === 'function';\n this.shouldUpdateOnHit = typeof options.onCacheHit === 'function';\n }\n Object.defineProperty(Cache.prototype, \"size\", {\n /**\n * The number of cached [key,value] results.\n */\n get: function () {\n return this.keys.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Cache.prototype, \"snapshot\", {\n /**\n * A copy of the cache at a moment in time. This is useful\n * to compare changes over time, since the cache mutates\n * internally for performance reasons.\n */\n get: function () {\n return {\n keys: cloneArray(this.keys),\n size: this.size,\n values: cloneArray(this.values),\n };\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Gets the matching key index when a custom key matcher is used.\n */\n Cache.prototype._getKeyIndexFromMatchingKey = function (keyToMatch) {\n var _a = this.options, isMatchingKey = _a.isMatchingKey, maxSize = _a.maxSize;\n var keys = this.keys;\n var keysLength = keys.length;\n if (!keysLength) {\n return -1;\n }\n if (isMatchingKey(keys[0], keyToMatch)) {\n return 0;\n }\n if (maxSize > 1) {\n for (var index = 1; index < keysLength; index++) {\n if (isMatchingKey(keys[index], keyToMatch)) {\n return index;\n }\n }\n }\n return -1;\n };\n /**\n * Gets the matching key index when multiple keys are used.\n */\n Cache.prototype._getKeyIndexForMany = function (keyToMatch) {\n var isEqual = this.options.isEqual;\n var keys = this.keys;\n var keysLength = keys.length;\n if (!keysLength) {\n return -1;\n }\n if (keysLength === 1) {\n return this._getKeyIndexForSingle(keyToMatch);\n }\n var keyLength = keyToMatch.length;\n var existingKey;\n var argIndex;\n if (keyLength > 1) {\n for (var index = 0; index < keysLength; index++) {\n existingKey = keys[index];\n if (existingKey.length === keyLength) {\n argIndex = 0;\n for (; argIndex < keyLength; argIndex++) {\n if (!isEqual(existingKey[argIndex], keyToMatch[argIndex])) {\n break;\n }\n }\n if (argIndex === keyLength) {\n return index;\n }\n }\n }\n }\n else {\n for (var index = 0; index < keysLength; index++) {\n existingKey = keys[index];\n if (existingKey.length === keyLength &&\n isEqual(existingKey[0], keyToMatch[0])) {\n return index;\n }\n }\n }\n return -1;\n };\n /**\n * Gets the matching key index when a single key is used.\n */\n Cache.prototype._getKeyIndexForSingle = function (keyToMatch) {\n var keys = this.keys;\n if (!keys.length) {\n return -1;\n }\n var existingKey = keys[0];\n var length = existingKey.length;\n if (keyToMatch.length !== length) {\n return -1;\n }\n var isEqual = this.options.isEqual;\n if (length > 1) {\n for (var index = 0; index < length; index++) {\n if (!isEqual(existingKey[index], keyToMatch[index])) {\n return -1;\n }\n }\n return 0;\n }\n return isEqual(existingKey[0], keyToMatch[0]) ? 0 : -1;\n };\n /**\n * Order the array based on a Least-Recently-Used basis.\n */\n Cache.prototype.orderByLru = function (key, value, startingIndex) {\n var keys = this.keys;\n var values = this.values;\n var currentLength = keys.length;\n var index = startingIndex;\n while (index--) {\n keys[index + 1] = keys[index];\n values[index + 1] = values[index];\n }\n keys[0] = key;\n values[0] = value;\n var maxSize = this.options.maxSize;\n if (currentLength === maxSize && startingIndex === currentLength) {\n keys.pop();\n values.pop();\n }\n else if (startingIndex >= maxSize) {\n // eslint-disable-next-line no-multi-assign\n keys.length = values.length = maxSize;\n }\n };\n /**\n * Update the promise method to auto-remove from cache if rejected, and\n * if resolved then fire cache hit / changed.\n */\n Cache.prototype.updateAsyncCache = function (memoized) {\n var _this = this;\n var _a = this.options, onCacheChange = _a.onCacheChange, onCacheHit = _a.onCacheHit;\n var firstKey = this.keys[0];\n var firstValue = this.values[0];\n this.values[0] = firstValue.then(function (value) {\n if (_this.shouldUpdateOnHit) {\n onCacheHit(_this, _this.options, memoized);\n }\n if (_this.shouldUpdateOnChange) {\n onCacheChange(_this, _this.options, memoized);\n }\n return value;\n }, function (error) {\n var keyIndex = _this.getKeyIndex(firstKey);\n if (keyIndex !== -1) {\n _this.keys.splice(keyIndex, 1);\n _this.values.splice(keyIndex, 1);\n }\n throw error;\n });\n };\n return Cache;\n }());\n\n function createMemoizedFunction(fn, options) {\n if (options === void 0) { options = {}; }\n if (isMemoized(fn)) {\n return createMemoizedFunction(fn.fn, mergeOptions(fn.options, options));\n }\n if (typeof fn !== 'function') {\n throw new TypeError('You must pass a function to `memoize`.');\n }\n var _a = options.isEqual, isEqual = _a === void 0 ? isSameValueZero : _a, isMatchingKey = options.isMatchingKey, _b = options.isPromise, isPromise = _b === void 0 ? false : _b, _c = options.maxSize, maxSize = _c === void 0 ? 1 : _c, onCacheAdd = options.onCacheAdd, onCacheChange = options.onCacheChange, onCacheHit = options.onCacheHit, transformKey = options.transformKey;\n var normalizedOptions = mergeOptions({\n isEqual: isEqual,\n isMatchingKey: isMatchingKey,\n isPromise: isPromise,\n maxSize: maxSize,\n onCacheAdd: onCacheAdd,\n onCacheChange: onCacheChange,\n onCacheHit: onCacheHit,\n transformKey: transformKey,\n }, getCustomOptions(options));\n var cache = new Cache(normalizedOptions);\n var keys = cache.keys, values = cache.values, canTransformKey = cache.canTransformKey, shouldCloneArguments = cache.shouldCloneArguments, shouldUpdateOnAdd = cache.shouldUpdateOnAdd, shouldUpdateOnChange = cache.shouldUpdateOnChange, shouldUpdateOnHit = cache.shouldUpdateOnHit;\n var memoized = function () {\n var key = shouldCloneArguments\n ? cloneArray(arguments)\n : arguments;\n if (canTransformKey) {\n key = transformKey(key);\n }\n var keyIndex = keys.length ? cache.getKeyIndex(key) : -1;\n if (keyIndex !== -1) {\n if (shouldUpdateOnHit) {\n onCacheHit(cache, normalizedOptions, memoized);\n }\n if (keyIndex) {\n cache.orderByLru(keys[keyIndex], values[keyIndex], keyIndex);\n if (shouldUpdateOnChange) {\n onCacheChange(cache, normalizedOptions, memoized);\n }\n }\n }\n else {\n var newValue = fn.apply(this, arguments);\n var newKey = shouldCloneArguments\n ? key\n : cloneArray(arguments);\n cache.orderByLru(newKey, newValue, keys.length);\n if (isPromise) {\n cache.updateAsyncCache(memoized);\n }\n if (shouldUpdateOnAdd) {\n onCacheAdd(cache, normalizedOptions, memoized);\n }\n if (shouldUpdateOnChange) {\n onCacheChange(cache, normalizedOptions, memoized);\n }\n }\n return values[0];\n };\n memoized.cache = cache;\n memoized.fn = fn;\n memoized.isMemoized = true;\n memoized.options = normalizedOptions;\n return memoized;\n }\n\n return createMemoizedFunction;\n\n}));\n//# sourceMappingURL=micro-memoize.js.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global[\"fast-equals\"] = {}));\n})(this, (function (exports) { 'use strict';\n\n var HAS_WEAK_MAP_SUPPORT = typeof WeakMap === 'function';\r\n var keys = Object.keys;\r\n /**\r\n * are the values passed strictly equal or both NaN\r\n *\r\n * @param a the value to compare against\r\n * @param b the value to test\r\n * @returns are the values equal by the SameValueZero principle\r\n */\r\n function sameValueZeroEqual(a, b) {\r\n return a === b || (a !== a && b !== b);\r\n }\r\n /**\r\n * is the value a plain object\r\n *\r\n * @param value the value to test\r\n * @returns is the value a plain object\r\n */\r\n function isPlainObject(value) {\r\n return value.constructor === Object || value.constructor == null;\r\n }\r\n /**\r\n * is the value promise-like (meaning it is thenable)\r\n *\r\n * @param value the value to test\r\n * @returns is the value promise-like\r\n */\r\n function isPromiseLike(value) {\r\n return !!value && typeof value.then === 'function';\r\n }\r\n /**\r\n * is the value passed a react element\r\n *\r\n * @param value the value to test\r\n * @returns is the value a react element\r\n */\r\n function isReactElement(value) {\r\n return !!(value && value.$$typeof);\r\n }\r\n /**\r\n * in cases where WeakMap is not supported, creates a new custom\r\n * object that mimics the necessary API aspects for cache purposes\r\n *\r\n * @returns the new cache object\r\n */\r\n function getNewCacheFallback() {\r\n var entries = [];\r\n return {\r\n delete: function (key) {\r\n for (var index = 0; index < entries.length; ++index) {\r\n if (entries[index][0] === key) {\r\n entries.splice(index, 1);\r\n return;\r\n }\r\n }\r\n },\r\n get: function (key) {\r\n for (var index = 0; index < entries.length; ++index) {\r\n if (entries[index][0] === key) {\r\n return entries[index][1];\r\n }\r\n }\r\n },\r\n set: function (key, value) {\r\n for (var index = 0; index < entries.length; ++index) {\r\n if (entries[index][0] === key) {\r\n entries[index][1] = value;\r\n return;\r\n }\r\n }\r\n entries.push([key, value]);\r\n }\r\n };\r\n }\r\n /**\r\n * get a new cache object to prevent circular references\r\n *\r\n * @returns the new cache object\r\n */\r\n var getNewCache = (function (canUseWeakMap) {\r\n if (canUseWeakMap) {\r\n return function _getNewCache() {\r\n return new WeakMap();\r\n };\r\n }\r\n return getNewCacheFallback;\r\n })(HAS_WEAK_MAP_SUPPORT);\r\n /**\r\n * create a custom isEqual handler specific to circular objects\r\n *\r\n * @param [isEqual] the isEqual comparator to use instead of isDeepEqual\r\n * @returns the method to create the `isEqual` function\r\n */\r\n function createCircularEqualCreator(isEqual) {\r\n return function createCircularEqual(comparator) {\r\n var _comparator = isEqual || comparator;\r\n return function circularEqual(a, b, indexOrKeyA, indexOrKeyB, parentA, parentB, cache) {\r\n if (cache === void 0) { cache = getNewCache(); }\r\n var isCacheableA = !!a && typeof a === 'object';\r\n var isCacheableB = !!b && typeof b === 'object';\r\n if (isCacheableA !== isCacheableB) {\r\n return false;\r\n }\r\n if (!isCacheableA && !isCacheableB) {\r\n return _comparator(a, b, cache);\r\n }\r\n var cachedA = cache.get(a);\r\n if (cachedA && cache.get(b)) {\r\n return cachedA === b;\r\n }\r\n cache.set(a, b);\r\n cache.set(b, a);\r\n var result = _comparator(a, b, cache);\r\n cache.delete(a);\r\n cache.delete(b);\r\n return result;\r\n };\r\n };\r\n }\r\n /**\r\n * are the arrays equal in value\r\n *\r\n * @param a the array to test\r\n * @param b the array to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta object to pass through\r\n * @returns are the arrays equal\r\n */\r\n function areArraysEqual(a, b, isEqual, meta) {\r\n var index = a.length;\r\n if (b.length !== index) {\r\n return false;\r\n }\r\n while (index-- > 0) {\r\n if (!isEqual(a[index], b[index], index, index, a, b, meta)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * are the maps equal in value\r\n *\r\n * @param a the map to test\r\n * @param b the map to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta map to pass through\r\n * @returns are the maps equal\r\n */\r\n function areMapsEqual(a, b, isEqual, meta) {\r\n var isValueEqual = a.size === b.size;\r\n if (isValueEqual && a.size) {\r\n var matchedIndices_1 = {};\r\n var indexA_1 = 0;\r\n a.forEach(function (aValue, aKey) {\r\n if (isValueEqual) {\r\n var hasMatch_1 = false;\r\n var matchIndexB_1 = 0;\r\n b.forEach(function (bValue, bKey) {\r\n if (!hasMatch_1 && !matchedIndices_1[matchIndexB_1]) {\r\n hasMatch_1 =\r\n isEqual(aKey, bKey, indexA_1, matchIndexB_1, a, b, meta) &&\r\n isEqual(aValue, bValue, aKey, bKey, a, b, meta);\r\n if (hasMatch_1) {\r\n matchedIndices_1[matchIndexB_1] = true;\r\n }\r\n }\r\n matchIndexB_1++;\r\n });\r\n indexA_1++;\r\n isValueEqual = hasMatch_1;\r\n }\r\n });\r\n }\r\n return isValueEqual;\r\n }\r\n var OWNER = '_owner';\r\n var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Object.prototype.hasOwnProperty);\r\n /**\r\n * are the objects equal in value\r\n *\r\n * @param a the object to test\r\n * @param b the object to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta object to pass through\r\n * @returns are the objects equal\r\n */\r\n function areObjectsEqual(a, b, isEqual, meta) {\r\n var keysA = keys(a);\r\n var index = keysA.length;\r\n if (keys(b).length !== index) {\r\n return false;\r\n }\r\n if (index) {\r\n var key = void 0;\r\n while (index-- > 0) {\r\n key = keysA[index];\r\n if (key === OWNER) {\r\n var reactElementA = isReactElement(a);\r\n var reactElementB = isReactElement(b);\r\n if ((reactElementA || reactElementB) &&\r\n reactElementA !== reactElementB) {\r\n return false;\r\n }\r\n }\r\n if (!hasOwnProperty(b, key) ||\r\n !isEqual(a[key], b[key], key, key, a, b, meta)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * are the regExps equal in value\r\n *\r\n * @param a the regExp to test\r\n * @param b the regExp to test agains\r\n * @returns are the regExps equal\r\n */\r\n var areRegExpsEqual = (function () {\r\n if (/foo/g.flags === 'g') {\r\n return function areRegExpsEqual(a, b) {\r\n return a.source === b.source && a.flags === b.flags;\r\n };\r\n }\r\n return function areRegExpsEqualFallback(a, b) {\r\n return (a.source === b.source &&\r\n a.global === b.global &&\r\n a.ignoreCase === b.ignoreCase &&\r\n a.multiline === b.multiline &&\r\n a.unicode === b.unicode &&\r\n a.sticky === b.sticky &&\r\n a.lastIndex === b.lastIndex);\r\n };\r\n })();\r\n /**\r\n * are the sets equal in value\r\n *\r\n * @param a the set to test\r\n * @param b the set to test against\r\n * @param isEqual the comparator to determine equality\r\n * @param meta the meta set to pass through\r\n * @returns are the sets equal\r\n */\r\n function areSetsEqual(a, b, isEqual, meta) {\r\n var isValueEqual = a.size === b.size;\r\n if (isValueEqual && a.size) {\r\n var matchedIndices_2 = {};\r\n a.forEach(function (aValue, aKey) {\r\n if (isValueEqual) {\r\n var hasMatch_2 = false;\r\n var matchIndex_1 = 0;\r\n b.forEach(function (bValue, bKey) {\r\n if (!hasMatch_2 && !matchedIndices_2[matchIndex_1]) {\r\n hasMatch_2 = isEqual(aValue, bValue, aKey, bKey, a, b, meta);\r\n if (hasMatch_2) {\r\n matchedIndices_2[matchIndex_1] = true;\r\n }\r\n }\r\n matchIndex_1++;\r\n });\r\n isValueEqual = hasMatch_2;\r\n }\r\n });\r\n }\r\n return isValueEqual;\r\n }\n\n var HAS_MAP_SUPPORT = typeof Map === 'function';\r\n var HAS_SET_SUPPORT = typeof Set === 'function';\r\n var valueOf = Object.prototype.valueOf;\r\n function createComparator(createIsEqual) {\r\n var isEqual = \r\n /* eslint-disable no-use-before-define */\r\n typeof createIsEqual === 'function'\r\n ? createIsEqual(comparator)\r\n : function (a, b, indexOrKeyA, indexOrKeyB, parentA, parentB, meta) { return comparator(a, b, meta); };\r\n /* eslint-enable */\r\n /**\r\n * compare the value of the two objects and return true if they are equivalent in values\r\n *\r\n * @param a the value to test against\r\n * @param b the value to test\r\n * @param [meta] an optional meta object that is passed through to all equality test calls\r\n * @returns are a and b equivalent in value\r\n */\r\n function comparator(a, b, meta) {\r\n if (a === b) {\r\n return true;\r\n }\r\n if (a && b && typeof a === 'object' && typeof b === 'object') {\r\n if (isPlainObject(a) && isPlainObject(b)) {\r\n return areObjectsEqual(a, b, isEqual, meta);\r\n }\r\n var aShape = Array.isArray(a);\r\n var bShape = Array.isArray(b);\r\n if (aShape || bShape) {\r\n return aShape === bShape && areArraysEqual(a, b, isEqual, meta);\r\n }\r\n aShape = a instanceof Date;\r\n bShape = b instanceof Date;\r\n if (aShape || bShape) {\r\n return (aShape === bShape && sameValueZeroEqual(a.getTime(), b.getTime()));\r\n }\r\n aShape = a instanceof RegExp;\r\n bShape = b instanceof RegExp;\r\n if (aShape || bShape) {\r\n return aShape === bShape && areRegExpsEqual(a, b);\r\n }\r\n if (isPromiseLike(a) || isPromiseLike(b)) {\r\n return a === b;\r\n }\r\n if (HAS_MAP_SUPPORT) {\r\n aShape = a instanceof Map;\r\n bShape = b instanceof Map;\r\n if (aShape || bShape) {\r\n return aShape === bShape && areMapsEqual(a, b, isEqual, meta);\r\n }\r\n }\r\n if (HAS_SET_SUPPORT) {\r\n aShape = a instanceof Set;\r\n bShape = b instanceof Set;\r\n if (aShape || bShape) {\r\n return aShape === bShape && areSetsEqual(a, b, isEqual, meta);\r\n }\r\n }\r\n if (a.valueOf !== valueOf || b.valueOf !== valueOf) {\r\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\r\n }\r\n return areObjectsEqual(a, b, isEqual, meta);\r\n }\r\n return a !== a && b !== b;\r\n }\r\n return comparator;\r\n }\n\n var deepEqual = createComparator();\r\n var shallowEqual = createComparator(function () { return sameValueZeroEqual; });\r\n var circularDeepEqual = createComparator(createCircularEqualCreator());\r\n var circularShallowEqual = createComparator(createCircularEqualCreator(sameValueZeroEqual));\n\n exports.circularDeepEqual = circularDeepEqual;\n exports.circularShallowEqual = circularShallowEqual;\n exports.createCustomEqual = createComparator;\n exports.deepEqual = deepEqual;\n exports.sameValueZeroEqual = sameValueZeroEqual;\n exports.shallowEqual = shallowEqual;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n//# sourceMappingURL=fast-equals.js.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('micro-memoize'), require('fast-equals')) :\n typeof define === 'function' && define.amd ? define(['micro-memoize', 'fast-equals'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.moize = factory(global.memoize, global.fe));\n})(this, (function (memoize, fastEquals) { 'use strict';\n\n function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n }\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n }\n\n /**\n * @private\n *\n * @constant DEFAULT_OPTIONS\n */\n var DEFAULT_OPTIONS = {\n isDeepEqual: false,\n isPromise: false,\n isReact: false,\n isSerialized: false,\n isShallowEqual: false,\n matchesArg: undefined,\n matchesKey: undefined,\n maxAge: undefined,\n maxArgs: undefined,\n maxSize: 1,\n onExpire: undefined,\n profileName: undefined,\n serializer: undefined,\n updateCacheForKey: undefined,\n transformArgs: undefined,\n updateExpire: false\n };\n\n /**\n * @private\n *\n * @description\n * method to combine functions and return a single function that fires them all\n *\n * @param functions the functions to compose\n * @returns the composed function\n */\n function combine() {\n for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {\n functions[_key] = arguments[_key];\n }\n return functions.reduce(function (f, g) {\n if (typeof f === 'function') {\n return typeof g === 'function' ? function () {\n f.apply(this, arguments);\n g.apply(this, arguments);\n } : f;\n }\n if (typeof g === 'function') {\n return g;\n }\n });\n }\n\n /**\n * @private\n *\n * @description\n * method to compose functions and return a single function\n *\n * @param functions the functions to compose\n * @returns the composed function\n */\n function compose() {\n for (var _len2 = arguments.length, functions = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n functions[_key2] = arguments[_key2];\n }\n return functions.reduce(function (f, g) {\n if (typeof f === 'function') {\n return typeof g === 'function' ? function () {\n return f(g.apply(this, arguments));\n } : f;\n }\n if (typeof g === 'function') {\n return g;\n }\n });\n }\n\n /**\n * @private\n *\n * @description\n * find the index of the expiration based on the key\n *\n * @param expirations the list of expirations\n * @param key the key to match\n * @returns the index of the expiration\n */\n function findExpirationIndex(expirations, key) {\n for (var index = 0; index < expirations.length; index++) {\n if (expirations[index].key === key) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * @private\n *\n * @description\n * create function that finds the index of the key in the list of cache keys\n *\n * @param isEqual the function to test individual argument equality\n * @param isMatchingKey the function to test full key equality\n * @returns the function that finds the index of the key\n */\n function createFindKeyIndex(isEqual, isMatchingKey) {\n var areKeysEqual = typeof isMatchingKey === 'function' ? isMatchingKey : function (cacheKey, key) {\n for (var index = 0; index < key.length; index++) {\n if (!isEqual(cacheKey[index], key[index])) {\n return false;\n }\n }\n return true;\n };\n return function (keys, key) {\n for (var keysIndex = 0; keysIndex < keys.length; keysIndex++) {\n if (keys[keysIndex].length === key.length && areKeysEqual(keys[keysIndex], key)) {\n return keysIndex;\n }\n }\n return -1;\n };\n }\n /**\n * @private\n *\n * @description\n * merge two options objects, combining or composing functions as necessary\n *\n * @param originalOptions the options that already exist on the method\n * @param newOptions the new options to merge\n * @returns the merged options\n */\n function mergeOptions(originalOptions, newOptions) {\n if (!newOptions || newOptions === DEFAULT_OPTIONS) {\n return originalOptions;\n }\n return _extends({}, originalOptions, newOptions, {\n onCacheAdd: combine(originalOptions.onCacheAdd, newOptions.onCacheAdd),\n onCacheChange: combine(originalOptions.onCacheChange, newOptions.onCacheChange),\n onCacheHit: combine(originalOptions.onCacheHit, newOptions.onCacheHit),\n transformArgs: compose(originalOptions.transformArgs, newOptions.transformArgs)\n });\n }\n function isMoized(fn) {\n return typeof fn === 'function' && fn.isMoized;\n }\n function setName(fn, originalFunctionName, profileName) {\n try {\n var name = profileName || originalFunctionName || 'anonymous';\n Object.defineProperty(fn, 'name', {\n configurable: true,\n enumerable: false,\n value: \"moized(\" + name + \")\",\n writable: true\n });\n } catch (_unused) {\n // For engines where `function.name` is not configurable, do nothing.\n }\n }\n\n /**\n * @private\n *\n * @description\n * clear an active expiration and remove it from the list if applicable\n *\n * @param expirations the list of expirations\n * @param key the key to clear\n * @param shouldRemove should the expiration be removed from the list\n */\n function clearExpiration(expirations, key, shouldRemove) {\n var expirationIndex = findExpirationIndex(expirations, key);\n if (expirationIndex !== -1) {\n clearTimeout(expirations[expirationIndex].timeoutId);\n if (shouldRemove) {\n expirations.splice(expirationIndex, 1);\n }\n }\n }\n\n /**\n * @private\n *\n * @description\n * Create the timeout for the given expiration method. If the ability to `unref`\n * exists, then apply it to avoid process locks in NodeJS.\n *\n * @param expirationMethod the method to fire upon expiration\n * @param maxAge the time to expire after\n * @returns the timeout ID\n */\n function createTimeout(expirationMethod, maxAge) {\n var timeoutId = setTimeout(expirationMethod, maxAge);\n if (typeof timeoutId.unref === 'function') {\n timeoutId.unref();\n }\n return timeoutId;\n }\n\n /**\n * @private\n *\n * @description\n * create a function that, when an item is added to the cache, adds an expiration for it\n *\n * @param expirations the mutable expirations array\n * @param options the options passed on initialization\n * @param isEqual the function to check argument equality\n * @param isMatchingKey the function to check complete key equality\n * @returns the onCacheAdd function to handle expirations\n */\n function createOnCacheAddSetExpiration(expirations, options, isEqual, isMatchingKey) {\n var maxAge = options.maxAge;\n return function onCacheAdd(cache, moizedOptions, moized) {\n var key = cache.keys[0];\n if (findExpirationIndex(expirations, key) === -1) {\n var expirationMethod = function expirationMethod() {\n var findKeyIndex = createFindKeyIndex(isEqual, isMatchingKey);\n var keyIndex = findKeyIndex(cache.keys, key);\n var value = cache.values[keyIndex];\n if (~keyIndex) {\n cache.keys.splice(keyIndex, 1);\n cache.values.splice(keyIndex, 1);\n if (typeof options.onCacheChange === 'function') {\n options.onCacheChange(cache, moizedOptions, moized);\n }\n }\n clearExpiration(expirations, key, true);\n if (typeof options.onExpire === 'function' && options.onExpire(key) === false) {\n cache.keys.unshift(key);\n cache.values.unshift(value);\n onCacheAdd(cache, moizedOptions, moized);\n if (typeof options.onCacheChange === 'function') {\n options.onCacheChange(cache, moizedOptions, moized);\n }\n }\n };\n expirations.push({\n expirationMethod: expirationMethod,\n key: key,\n timeoutId: createTimeout(expirationMethod, maxAge)\n });\n }\n };\n }\n\n /**\n * @private\n *\n * @description\n * creates a function that, when a cache item is hit, reset the expiration\n *\n * @param expirations the mutable expirations array\n * @param options the options passed on initialization\n * @returns the onCacheAdd function to handle expirations\n */\n function createOnCacheHitResetExpiration(expirations, options) {\n return function onCacheHit(cache) {\n var key = cache.keys[0];\n var expirationIndex = findExpirationIndex(expirations, key);\n if (~expirationIndex) {\n clearExpiration(expirations, key, false);\n expirations[expirationIndex].timeoutId = createTimeout(expirations[expirationIndex].expirationMethod, options.maxAge);\n }\n };\n }\n\n /**\n * @private\n *\n * @description\n * get the micro-memoize options specific to the maxAge option\n *\n * @param expirations the expirations for the memoized function\n * @param options the options passed to the moizer\n * @param isEqual the function to test equality of the key on a per-argument basis\n * @param isMatchingKey the function to test equality of the whole key\n * @returns the object of options based on the entries passed\n */\n function getMaxAgeOptions(expirations, options, isEqual, isMatchingKey) {\n var onCacheAdd = typeof options.maxAge === 'number' && isFinite(options.maxAge) ? createOnCacheAddSetExpiration(expirations, options, isEqual, isMatchingKey) : undefined;\n return {\n onCacheAdd: onCacheAdd,\n onCacheHit: onCacheAdd && options.updateExpire ? createOnCacheHitResetExpiration(expirations, options) : undefined\n };\n }\n\n var statsCache = {\n anonymousProfileNameCounter: 1,\n isCollectingStats: false,\n profiles: {}\n };\n var hasWarningDisplayed = false;\n function clearStats(profileName) {\n if (profileName) {\n delete statsCache.profiles[profileName];\n } else {\n statsCache.profiles = {};\n }\n }\n\n /**\n * @private\n *\n * @description\n * activate stats collection\n *\n * @param isCollectingStats should stats be collected\n */\n function collectStats(isCollectingStats) {\n if (isCollectingStats === void 0) {\n isCollectingStats = true;\n }\n statsCache.isCollectingStats = isCollectingStats;\n }\n\n /**\n * @private\n *\n * @description\n * create a function that increments the number of calls for the specific profile\n */\n function createOnCacheAddIncrementCalls(options) {\n var profileName = options.profileName;\n return function () {\n if (profileName && !statsCache.profiles[profileName]) {\n statsCache.profiles[profileName] = {\n calls: 0,\n hits: 0\n };\n }\n statsCache.profiles[profileName].calls++;\n };\n }\n\n /**\n * @private\n *\n * @description\n * create a function that increments the number of calls and cache hits for the specific profile\n */\n function createOnCacheHitIncrementCallsAndHits(options) {\n return function () {\n var profiles = statsCache.profiles;\n var profileName = options.profileName;\n if (!profiles[profileName]) {\n profiles[profileName] = {\n calls: 0,\n hits: 0\n };\n }\n profiles[profileName].calls++;\n profiles[profileName].hits++;\n };\n }\n\n /**\n * @private\n *\n * @description\n * get the profileName for the function when one is not provided\n *\n * @param fn the function to be memoized\n * @returns the derived profileName for the function\n */\n function getDefaultProfileName(fn) {\n return fn.displayName || fn.name || \"Anonymous \" + statsCache.anonymousProfileNameCounter++;\n }\n\n /**\n * @private\n *\n * @description\n * get the usage percentage based on the number of hits and total calls\n *\n * @param calls the number of calls made\n * @param hits the number of cache hits when called\n * @returns the usage as a percentage string\n */\n function getUsagePercentage(calls, hits) {\n return calls ? (hits / calls * 100).toFixed(4) + \"%\" : '0.0000%';\n }\n\n /**\n * @private\n *\n * @description\n * get the statistics for a given method or all methods\n *\n * @param [profileName] the profileName to get the statistics for (get all when not provided)\n * @returns the object with stats information\n */\n function getStats(profileName) {\n if (!statsCache.isCollectingStats && !hasWarningDisplayed) {\n console.warn('Stats are not currently being collected, please run \"collectStats\" to enable them.'); // eslint-disable-line no-console\n\n hasWarningDisplayed = true;\n }\n var profiles = statsCache.profiles;\n if (profileName) {\n if (!profiles[profileName]) {\n return {\n calls: 0,\n hits: 0,\n usage: '0.0000%'\n };\n }\n var profile = profiles[profileName];\n return _extends({}, profile, {\n usage: getUsagePercentage(profile.calls, profile.hits)\n });\n }\n var completeStats = Object.keys(statsCache.profiles).reduce(function (completeProfiles, profileName) {\n completeProfiles.calls += profiles[profileName].calls;\n completeProfiles.hits += profiles[profileName].hits;\n return completeProfiles;\n }, {\n calls: 0,\n hits: 0\n });\n return _extends({}, completeStats, {\n profiles: Object.keys(profiles).reduce(function (computedProfiles, profileName) {\n computedProfiles[profileName] = getStats(profileName);\n return computedProfiles;\n }, {}),\n usage: getUsagePercentage(completeStats.calls, completeStats.hits)\n });\n }\n\n /**\n * @private\n *\n * @function getStatsOptions\n *\n * @description\n * get the options specific to storing statistics\n *\n * @param {Options} options the options passed to the moizer\n * @returns {Object} the options specific to keeping stats\n */\n function getStatsOptions(options) {\n return statsCache.isCollectingStats ? {\n onCacheAdd: createOnCacheAddIncrementCalls(options),\n onCacheHit: createOnCacheHitIncrementCallsAndHits(options)\n } : {};\n }\n\n var ALWAYS_SKIPPED_PROPERTIES = {\n arguments: true,\n callee: true,\n caller: true,\n constructor: true,\n length: true,\n name: true,\n prototype: true\n };\n\n /**\n * @private\n *\n * @description\n * copy the static properties from the original function to the moized\n * function\n *\n * @param originalFn the function copying from\n * @param newFn the function copying to\n * @param skippedProperties the list of skipped properties, if any\n */\n function copyStaticProperties(originalFn, newFn, skippedProperties) {\n if (skippedProperties === void 0) {\n skippedProperties = [];\n }\n Object.getOwnPropertyNames(originalFn).forEach(function (property) {\n if (!ALWAYS_SKIPPED_PROPERTIES[property] && skippedProperties.indexOf(property) === -1) {\n var descriptor = Object.getOwnPropertyDescriptor(originalFn, property);\n if (descriptor.get || descriptor.set) {\n Object.defineProperty(newFn, property, descriptor);\n } else {\n // @ts-expect-error - properites may not align\n newFn[property] = originalFn[property];\n }\n }\n });\n }\n\n /**\n * @private\n *\n * @description\n * add methods to the moized fuction object that allow extra features\n *\n * @param memoized the memoized function from micro-memoize\n */\n function addInstanceMethods(memoized, _ref) {\n var expirations = _ref.expirations;\n var options = memoized.options;\n var findKeyIndex = createFindKeyIndex(options.isEqual, options.isMatchingKey);\n var moized = memoized;\n moized.clear = function () {\n var onCacheChange = moized._microMemoizeOptions.onCacheChange,\n cache = moized.cache;\n cache.keys.length = 0;\n cache.values.length = 0;\n if (onCacheChange) {\n onCacheChange(cache, moized.options, moized);\n }\n return true;\n };\n moized.clearStats = function () {\n clearStats(moized.options.profileName);\n };\n moized.get = function (key) {\n var transformKey = moized._microMemoizeOptions.transformKey,\n cache = moized.cache;\n var cacheKey = transformKey ? transformKey(key) : key;\n var keyIndex = findKeyIndex(cache.keys, cacheKey);\n return keyIndex !== -1 ? moized.apply(this, key) : undefined;\n };\n moized.getStats = function () {\n return getStats(moized.options.profileName);\n };\n moized.has = function (key) {\n var transformKey = moized._microMemoizeOptions.transformKey;\n var cacheKey = transformKey ? transformKey(key) : key;\n return findKeyIndex(moized.cache.keys, cacheKey) !== -1;\n };\n moized.keys = function () {\n return moized.cacheSnapshot.keys;\n };\n moized.remove = function (key) {\n var _moized$_microMemoize = moized._microMemoizeOptions,\n onCacheChange = _moized$_microMemoize.onCacheChange,\n transformKey = _moized$_microMemoize.transformKey,\n cache = moized.cache;\n var keyIndex = findKeyIndex(cache.keys, transformKey ? transformKey(key) : key);\n if (keyIndex === -1) {\n return false;\n }\n var existingKey = cache.keys[keyIndex];\n cache.keys.splice(keyIndex, 1);\n cache.values.splice(keyIndex, 1);\n if (onCacheChange) {\n onCacheChange(cache, moized.options, moized);\n }\n clearExpiration(expirations, existingKey, true);\n return true;\n };\n moized.set = function (key, value) {\n var _microMemoizeOptions = moized._microMemoizeOptions,\n cache = moized.cache,\n options = moized.options;\n var onCacheAdd = _microMemoizeOptions.onCacheAdd,\n onCacheChange = _microMemoizeOptions.onCacheChange,\n transformKey = _microMemoizeOptions.transformKey;\n var cacheKey = transformKey ? transformKey(key) : key;\n var keyIndex = findKeyIndex(cache.keys, cacheKey);\n if (keyIndex === -1) {\n var cutoff = options.maxSize - 1;\n if (cache.size > cutoff) {\n cache.keys.length = cutoff;\n cache.values.length = cutoff;\n }\n cache.keys.unshift(cacheKey);\n cache.values.unshift(value);\n if (options.isPromise) {\n cache.updateAsyncCache(moized);\n }\n if (onCacheAdd) {\n onCacheAdd(cache, options, moized);\n }\n if (onCacheChange) {\n onCacheChange(cache, options, moized);\n }\n } else {\n var existingKey = cache.keys[keyIndex];\n cache.values[keyIndex] = value;\n if (keyIndex > 0) {\n cache.orderByLru(existingKey, value, keyIndex);\n }\n if (options.isPromise) {\n cache.updateAsyncCache(moized);\n }\n if (typeof onCacheChange === 'function') {\n onCacheChange(cache, options, moized);\n }\n }\n };\n moized.values = function () {\n return moized.cacheSnapshot.values;\n };\n }\n\n /**\n * @private\n *\n * @description\n * add propeties to the moized fuction object that surfaces extra information\n *\n * @param memoized the memoized function\n * @param expirations the list of expirations for cache items\n * @param options the options passed to the moizer\n * @param originalFunction the function that is being memoized\n */\n function addInstanceProperties(memoized, _ref2) {\n var expirations = _ref2.expirations,\n moizeOptions = _ref2.options,\n originalFunction = _ref2.originalFunction;\n var microMemoizeOptions = memoized.options;\n Object.defineProperties(memoized, {\n _microMemoizeOptions: {\n configurable: true,\n get: function get() {\n return microMemoizeOptions;\n }\n },\n cacheSnapshot: {\n configurable: true,\n get: function get() {\n var currentCache = memoized.cache;\n return {\n keys: currentCache.keys.slice(0),\n size: currentCache.size,\n values: currentCache.values.slice(0)\n };\n }\n },\n expirations: {\n configurable: true,\n get: function get() {\n return expirations;\n }\n },\n expirationsSnapshot: {\n configurable: true,\n get: function get() {\n return expirations.slice(0);\n }\n },\n isMoized: {\n configurable: true,\n get: function get() {\n return true;\n }\n },\n options: {\n configurable: true,\n get: function get() {\n return moizeOptions;\n }\n },\n originalFunction: {\n configurable: true,\n get: function get() {\n return originalFunction;\n }\n }\n });\n var moized = memoized;\n copyStaticProperties(originalFunction, moized);\n }\n\n /**\n * @private\n *\n * @description\n * add methods and properties to the memoized function for more features\n *\n * @param memoized the memoized function\n * @param configuration the configuration object for the instance\n * @returns the memoized function passed\n */\n function createMoizeInstance(memoized, configuration) {\n addInstanceMethods(memoized, configuration);\n addInstanceProperties(memoized, configuration);\n return memoized;\n }\n\n // This was stolen from React internals, which allows us to create React elements without needing\n // a dependency on the React library itself.\n var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for ? Symbol.for('react.element') : 0xeac7;\n\n /**\n * @private\n *\n * @description\n * Create a component that memoizes based on `props` and legacy `context`\n * on a per-instance basis. This requires creating a component class to\n * store the memoized function. The cost is quite low, and avoids the\n * need to have access to the React dependency by basically re-creating\n * the basic essentials for a component class and the results of the\n * `createElement` function.\n *\n * @param moizer the top-level moize method\n * @param fn the component to memoize\n * @param options the memoization options\n * @returns the memoized component\n */\n function createMoizedComponent(moizer, fn, options) {\n /**\n * This is a hack override setting the necessary options\n * for a React component to be memoized. In the main `moize`\n * method, if the `isReact` option is set it is short-circuited\n * to call this function, and these overrides allow the\n * necessary transformKey method to be derived.\n *\n * The order is based on:\n * 1) Set the necessary aspects of transformKey for React components.\n * 2) Allow setting of other options and overrides of those aspects\n * if desired (for example, `isDeepEqual` will use deep equality).\n * 3) Always set `isReact` to false to prevent infinite loop.\n */\n var reactMoizer = moizer(_extends({\n maxArgs: 2,\n isShallowEqual: true\n }, options, {\n isReact: false\n }));\n if (!fn.displayName) {\n // @ts-ignore - allow setting of displayName\n fn.displayName = fn.name || 'Component';\n }\n function Moized(props, context, updater) {\n this.props = props;\n this.context = context;\n this.updater = updater;\n this.MoizedComponent = reactMoizer(fn);\n }\n Moized.prototype.isReactComponent = {};\n Moized.prototype.render = function () {\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: this.MoizedComponent,\n props: this.props,\n ref: null,\n key: null,\n _owner: null\n };\n };\n copyStaticProperties(fn, Moized, ['contextType', 'contextTypes']);\n Moized.displayName = \"Moized(\" + (fn.displayName || fn.name || 'Component') + \")\";\n setName(Moized, fn.name, options.profileName);\n return Moized;\n }\n\n function createGetInitialArgs(size) {\n /**\n * @private\n *\n * @description\n * take the first N number of items from the array (faster than slice)\n *\n * @param args the args to take from\n * @returns the shortened list of args as an array\n */\n return function (args) {\n if (size >= args.length) {\n return args;\n }\n if (size === 0) {\n return [];\n }\n if (size === 1) {\n return [args[0]];\n }\n if (size === 2) {\n return [args[0], args[1]];\n }\n if (size === 3) {\n return [args[0], args[1], args[2]];\n }\n var clone = [];\n for (var index = 0; index < size; index++) {\n clone[index] = args[index];\n }\n return clone;\n };\n }\n\n /**\n * @function getCutoff\n *\n * @description\n * faster `Array.prototype.indexOf` implementation build for slicing / splicing\n *\n * @param array the array to match the value in\n * @param value the value to match\n * @returns the matching index, or -1\n */\n function getCutoff(array, value) {\n var length = array.length;\n for (var index = 0; index < length; ++index) {\n if (array[index] === value) {\n return index + 1;\n }\n }\n return 0;\n }\n\n /**\n * @private\n *\n * @description\n * custom replacer for the stringify function\n *\n * @returns if function then toString of it, else the value itself\n */\n function createDefaultReplacer() {\n var cache = [];\n var keys = [];\n return function defaultReplacer(key, value) {\n var type = typeof value;\n if (type === 'function' || type === 'symbol') {\n return value.toString();\n }\n if (typeof value === 'object') {\n if (cache.length) {\n var thisCutoff = getCutoff(cache, this);\n if (thisCutoff === 0) {\n cache[cache.length] = this;\n } else {\n cache.splice(thisCutoff);\n keys.splice(thisCutoff);\n }\n keys[keys.length] = key;\n var valueCutoff = getCutoff(cache, value);\n if (valueCutoff !== 0) {\n return \"[ref=\" + (keys.slice(0, valueCutoff).join('.') || '.') + \"]\";\n }\n } else {\n cache[0] = value;\n keys[0] = key;\n }\n return value;\n }\n return '' + value;\n };\n }\n\n /**\n * @private\n *\n * @description\n * get the stringified version of the argument passed\n *\n * @param arg argument to stringify\n * @returns the stringified argument\n */\n function getStringifiedArgument(arg) {\n var typeOfArg = typeof arg;\n return arg && (typeOfArg === 'object' || typeOfArg === 'function') ? JSON.stringify(arg, createDefaultReplacer()) : arg;\n }\n\n /**\n * @private\n *\n * @description\n * serialize the arguments passed\n *\n * @param options the options passed to the moizer\n * @param options.maxArgs the cap on the number of arguments used in serialization\n * @returns argument serialization method\n */\n function defaultArgumentSerializer(args) {\n var key = '|';\n for (var index = 0; index < args.length; index++) {\n key += getStringifiedArgument(args[index]) + '|';\n }\n return [key];\n }\n\n /**\n * @private\n *\n * @description\n * based on the options passed, either use the serializer passed or generate the internal one\n *\n * @param options the options passed to the moized function\n * @returns the function to use in serializing the arguments\n */\n function getSerializerFunction(options) {\n return typeof options.serializer === 'function' ? options.serializer : defaultArgumentSerializer;\n }\n\n /**\n * @private\n *\n * @description\n * are the serialized keys equal to one another\n *\n * @param cacheKey the cache key to compare\n * @param key the key to test\n * @returns are the keys equal\n */\n function getIsSerializedKeyEqual(cacheKey, key) {\n return cacheKey[0] === key[0];\n }\n\n function createOnCacheOperation(fn) {\n if (typeof fn === 'function') {\n return function (_cacheIgnored, _microMemoizeOptionsIgnored, memoized) {\n return fn(memoized.cache, memoized.options, memoized);\n };\n }\n }\n\n /**\n * @private\n *\n * @description\n * get the isEqual method passed to micro-memoize\n *\n * @param options the options passed to the moizer\n * @returns the isEqual method to apply\n */\n function getIsEqual(options) {\n return options.matchesArg || options.isDeepEqual && fastEquals.deepEqual || options.isShallowEqual && fastEquals.shallowEqual || fastEquals.sameValueZeroEqual;\n }\n\n /**\n * @private\n *\n * @description\n * get the isEqual method passed to micro-memoize\n *\n * @param options the options passed to the moizer\n * @returns the isEqual method to apply\n */\n function getIsMatchingKey(options) {\n return options.matchesKey || options.isSerialized && getIsSerializedKeyEqual || undefined;\n }\n\n /**\n * @private\n *\n * @description\n * get the function that will transform the key based on the arguments passed\n *\n * @param options the options passed to the moizer\n * @returns the function to transform the key with\n */\n function getTransformKey(options) {\n return compose(options.isSerialized && getSerializerFunction(options), typeof options.transformArgs === 'function' && options.transformArgs, typeof options.maxArgs === 'number' && createGetInitialArgs(options.maxArgs));\n }\n\n function createRefreshableMoized(moized) {\n var updateCacheForKey = moized.options.updateCacheForKey;\n\n /**\n * @private\n *\n * @description\n * Wrapper around already-`moize`d function which will intercept the memoization\n * and call the underlying function directly with the purpose of updating the cache\n * for the given key.\n *\n * Promise values use a tweak of the logic that exists at cache.updateAsyncCache, which\n * reverts to the original value if the promise is rejected and there was already a cached\n * value.\n */\n var refreshableMoized = function refreshableMoized() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (!updateCacheForKey(args)) {\n return moized.apply(this, args);\n }\n var result = moized.fn.apply(this, args);\n moized.set(args, result);\n return result;\n };\n copyStaticProperties(moized, refreshableMoized);\n return refreshableMoized;\n }\n\n var _excluded = [\"matchesArg\", \"isDeepEqual\", \"isPromise\", \"isReact\", \"isSerialized\", \"isShallowEqual\", \"matchesKey\", \"maxAge\", \"maxArgs\", \"maxSize\", \"onCacheAdd\", \"onCacheChange\", \"onCacheHit\", \"onExpire\", \"profileName\", \"serializer\", \"updateCacheForKey\", \"transformArgs\", \"updateExpire\"];\n /**\n * @module moize\n */\n /**\n * @description\n * memoize a function based its arguments passed, potentially improving runtime performance\n *\n * @example\n * import moize from 'moize';\n *\n * // standard implementation\n * const fn = (foo, bar) => `${foo} ${bar}`;\n * const memoizedFn = moize(fn);\n *\n * // implementation with options\n * const fn = async (id) => get(`http://foo.com/${id}`);\n * const memoizedFn = moize(fn, {isPromise: true, maxSize: 5});\n *\n * // implementation with convenience methods\n * const Foo = ({foo}) => <div>{foo}</div>;\n * const MemoizedFoo = moize.react(Foo);\n *\n * @param fn the function to memoized, or a list of options when currying\n * @param [options=DEFAULT_OPTIONS] the options to apply\n * @returns the memoized function\n */\n var moize = function moize(fn, passedOptions) {\n var options = passedOptions || DEFAULT_OPTIONS;\n if (isMoized(fn)) {\n var moizeable = fn.originalFunction;\n var mergedOptions = mergeOptions(fn.options, options);\n return moize(moizeable, mergedOptions);\n }\n if (typeof fn === 'object') {\n return function (curriedFn, curriedOptions) {\n if (typeof curriedFn === 'function') {\n var _mergedOptions = mergeOptions(fn, curriedOptions);\n return moize(curriedFn, _mergedOptions);\n }\n var mergedOptions = mergeOptions(fn, curriedFn);\n return moize(mergedOptions);\n };\n }\n if (options.isReact) {\n return createMoizedComponent(moize, fn, options);\n }\n var coalescedOptions = _extends({}, DEFAULT_OPTIONS, options, {\n maxAge: typeof options.maxAge === 'number' && options.maxAge >= 0 ? options.maxAge : DEFAULT_OPTIONS.maxAge,\n maxArgs: typeof options.maxArgs === 'number' && options.maxArgs >= 0 ? options.maxArgs : DEFAULT_OPTIONS.maxArgs,\n maxSize: typeof options.maxSize === 'number' && options.maxSize >= 0 ? options.maxSize : DEFAULT_OPTIONS.maxSize,\n profileName: options.profileName || getDefaultProfileName(fn)\n });\n var expirations = [];\n coalescedOptions.matchesArg;\n coalescedOptions.isDeepEqual;\n var isPromise = coalescedOptions.isPromise;\n coalescedOptions.isReact;\n coalescedOptions.isSerialized;\n coalescedOptions.isShallowEqual;\n coalescedOptions.matchesKey;\n coalescedOptions.maxAge;\n coalescedOptions.maxArgs;\n var maxSize = coalescedOptions.maxSize,\n onCacheAdd = coalescedOptions.onCacheAdd,\n onCacheChange = coalescedOptions.onCacheChange,\n onCacheHit = coalescedOptions.onCacheHit;\n coalescedOptions.onExpire;\n coalescedOptions.profileName;\n coalescedOptions.serializer;\n var updateCacheForKey = coalescedOptions.updateCacheForKey;\n coalescedOptions.transformArgs;\n coalescedOptions.updateExpire;\n var customOptions = _objectWithoutPropertiesLoose(coalescedOptions, _excluded);\n var isEqual = getIsEqual(coalescedOptions);\n var isMatchingKey = getIsMatchingKey(coalescedOptions);\n var maxAgeOptions = getMaxAgeOptions(expirations, coalescedOptions, isEqual, isMatchingKey);\n var statsOptions = getStatsOptions(coalescedOptions);\n var transformKey = getTransformKey(coalescedOptions);\n var microMemoizeOptions = _extends({}, customOptions, {\n isEqual: isEqual,\n isMatchingKey: isMatchingKey,\n isPromise: isPromise,\n maxSize: maxSize,\n onCacheAdd: createOnCacheOperation(combine(onCacheAdd, maxAgeOptions.onCacheAdd, statsOptions.onCacheAdd)),\n onCacheChange: createOnCacheOperation(onCacheChange),\n onCacheHit: createOnCacheOperation(combine(onCacheHit, maxAgeOptions.onCacheHit, statsOptions.onCacheHit)),\n transformKey: transformKey\n });\n var memoized = memoize(fn, microMemoizeOptions);\n var moized = createMoizeInstance(memoized, {\n expirations: expirations,\n options: coalescedOptions,\n originalFunction: fn\n });\n if (updateCacheForKey) {\n moized = createRefreshableMoized(moized);\n }\n setName(moized, fn.name, options.profileName);\n return moized;\n };\n\n /**\n * @function\n * @name clearStats\n * @memberof module:moize\n * @alias moize.clearStats\n *\n * @description\n * clear all existing stats stored\n */\n moize.clearStats = clearStats;\n\n /**\n * @function\n * @name collectStats\n * @memberof module:moize\n * @alias moize.collectStats\n *\n * @description\n * start collecting statistics\n */\n moize.collectStats = collectStats;\n\n /**\n * @function\n * @name compose\n * @memberof module:moize\n * @alias moize.compose\n *\n * @description\n * method to compose moized methods and return a single moized function\n *\n * @param moized the functions to compose\n * @returns the composed function\n */\n moize.compose = function () {\n return compose.apply(void 0, arguments) || moize;\n };\n\n /**\n * @function\n * @name deep\n * @memberof module:moize\n * @alias moize.deep\n *\n * @description\n * should deep equality check be used\n *\n * @returns the moizer function\n */\n moize.deep = moize({\n isDeepEqual: true\n });\n\n /**\n * @function\n * @name getStats\n * @memberof module:moize\n * @alias moize.getStats\n *\n * @description\n * get the statistics of a given profile, or overall usage\n *\n * @returns statistics for a given profile or overall usage\n */\n moize.getStats = getStats;\n\n /**\n * @function\n * @name infinite\n * @memberof module:moize\n * @alias moize.infinite\n *\n * @description\n * a moized method that will remove all limits from the cache size\n *\n * @returns the moizer function\n */\n moize.infinite = moize({\n maxSize: Infinity\n });\n\n /**\n * @function\n * @name isCollectingStats\n * @memberof module:moize\n * @alias moize.isCollectingStats\n *\n * @description\n * are stats being collected\n *\n * @returns are stats being collected\n */\n moize.isCollectingStats = function isCollectingStats() {\n return statsCache.isCollectingStats;\n };\n\n /**\n * @function\n * @name isMoized\n * @memberof module:moize\n * @alias moize.isMoized\n *\n * @description\n * is the fn passed a moized function\n *\n * @param fn the object to test\n * @returns is fn a moized function\n */\n moize.isMoized = function isMoized(fn) {\n return typeof fn === 'function' && !!fn.isMoized;\n };\n\n /**\n * @function\n * @name matchesArg\n * @memberof module:moize\n * @alias moize.matchesArg\n *\n * @description\n * a moized method where the arg matching method is the custom one passed\n *\n * @param keyMatcher the method to compare against those in cache\n * @returns the moizer function\n */\n moize.matchesArg = function (argMatcher) {\n return moize({\n matchesArg: argMatcher\n });\n };\n\n /**\n * @function\n * @name matchesKey\n * @memberof module:moize\n * @alias moize.matchesKey\n *\n * @description\n * a moized method where the key matching method is the custom one passed\n *\n * @param keyMatcher the method to compare against those in cache\n * @returns the moizer function\n */\n moize.matchesKey = function (keyMatcher) {\n return moize({\n matchesKey: keyMatcher\n });\n };\n function maxAge(maxAge, expireOptions) {\n if (expireOptions === true) {\n return moize({\n maxAge: maxAge,\n updateExpire: expireOptions\n });\n }\n if (typeof expireOptions === 'object') {\n var onExpire = expireOptions.onExpire,\n updateExpire = expireOptions.updateExpire;\n return moize({\n maxAge: maxAge,\n onExpire: onExpire,\n updateExpire: updateExpire\n });\n }\n if (typeof expireOptions === 'function') {\n return moize({\n maxAge: maxAge,\n onExpire: expireOptions,\n updateExpire: true\n });\n }\n return moize({\n maxAge: maxAge\n });\n }\n\n /**\n * @function\n * @name maxAge\n * @memberof module:moize\n * @alias moize.maxAge\n *\n * @description\n * a moized method where the age of the cache is limited to the number of milliseconds passed\n *\n * @param maxAge the TTL of the value in cache\n * @returns the moizer function\n */\n moize.maxAge = maxAge;\n\n /**\n * @function\n * @name maxArgs\n * @memberof module:moize\n * @alias moize.maxArgs\n *\n * @description\n * a moized method where the number of arguments used for determining cache is limited to the value passed\n *\n * @param maxArgs the number of args to base the key on\n * @returns the moizer function\n */\n moize.maxArgs = function maxArgs(maxArgs) {\n return moize({\n maxArgs: maxArgs\n });\n };\n\n /**\n * @function\n * @name maxSize\n * @memberof module:moize\n * @alias moize.maxSize\n *\n * @description\n * a moized method where the total size of the cache is limited to the value passed\n *\n * @param maxSize the maximum size of the cache\n * @returns the moizer function\n */\n moize.maxSize = function maxSize(maxSize) {\n return moize({\n maxSize: maxSize\n });\n };\n\n /**\n * @function\n * @name profile\n * @memberof module:moize\n * @alias moize.profile\n *\n * @description\n * a moized method with a profile name\n *\n * @returns the moizer function\n */\n moize.profile = function (profileName) {\n return moize({\n profileName: profileName\n });\n };\n\n /**\n * @function\n * @name promise\n * @memberof module:moize\n * @alias moize.promise\n *\n * @description\n * a moized method specific to caching resolved promise / async values\n *\n * @returns the moizer function\n */\n moize.promise = moize({\n isPromise: true,\n updateExpire: true\n });\n\n /**\n * @function\n * @name react\n * @memberof module:moize\n * @alias moize.react\n *\n * @description\n * a moized method specific to caching React element values\n *\n * @returns the moizer function\n */\n moize.react = moize({\n isReact: true\n });\n\n /**\n * @function\n * @name serialize\n * @memberof module:moize\n * @alias moize.serialize\n *\n * @description\n * a moized method that will serialize the arguments passed to use as the cache key\n *\n * @returns the moizer function\n */\n moize.serialize = moize({\n isSerialized: true\n });\n\n /**\n * @function\n * @name serializeWith\n * @memberof module:moize\n * @alias moize.serializeWith\n *\n * @description\n * a moized method that will serialize the arguments passed to use as the cache key\n * based on the serializer passed\n *\n * @returns the moizer function\n */\n moize.serializeWith = function (serializer) {\n return moize({\n isSerialized: true,\n serializer: serializer\n });\n };\n\n /**\n * @function\n * @name shallow\n * @memberof module:moize\n * @alias moize.shallow\n *\n * @description\n * should shallow equality check be used\n *\n * @returns the moizer function\n */\n moize.shallow = moize({\n isShallowEqual: true\n });\n\n /**\n * @function\n * @name transformArgs\n * @memberof module:moize\n * @alias moize.transformArgs\n *\n * @description\n * transform the args to allow for specific cache key comparison\n *\n * @param transformArgs the args transformer\n * @returns the moizer function\n */\n moize.transformArgs = function (transformArgs) {\n return moize({\n transformArgs: transformArgs\n });\n };\n\n /**\n * @function\n * @name updateCacheForKey\n * @memberof module:moize\n * @alias moize.updateCacheForKey\n *\n * @description\n * update the cache for a given key when the method passed returns truthy\n *\n * @param updateCacheForKey the method to determine when to update cache\n * @returns the moizer function\n */\n moize.updateCacheForKey = function (updateCacheForKey) {\n return moize({\n updateCacheForKey: updateCacheForKey\n });\n };\n\n // Add self-referring `default` property for edge-case cross-compatibility of mixed ESM/CommonJS usage.\n // This property is frozen and non-enumerable to avoid visibility on iteration or accidental overrides.\n Object.defineProperty(moize, 'default', {\n configurable: false,\n enumerable: false,\n value: moize,\n writable: false\n });\n\n return moize;\n\n}));\n//# sourceMappingURL=moize.js.map\n","import moize from 'moize';\n\nwindow._moize = moize;\n\nexport default function mem(fn, opts = {}) {\n return moize(fn, { ...opts, maxSize: 50, isDeepEqual: true });\n}\n","import mem from './mem';\n\nexport default function pmem(fn, opts = {}) {\n return mem(fn, { isPromise: true, ...opts });\n}\n","// Rate limit repeated function calls and queue them to set interval\nexport default function rateLimit(fn, interval) {\n let queue = [];\n let isRunning = false;\n\n function executeNext() {\n if (queue.length === 0) {\n isRunning = false;\n return;\n }\n\n const nextFn = queue.shift();\n nextFn();\n setTimeout(executeNext, interval);\n }\n\n return function (...args) {\n const callFn = () => fn.apply(this, args);\n queue.push(callFn);\n\n if (!isRunning) {\n isRunning = true;\n setTimeout(executeNext, interval);\n }\n };\n}\n","export class AbortError extends Error {\n\tconstructor() {\n\t\tsuper('Throttled function aborted');\n\t\tthis.name = 'AbortError';\n\t}\n}\n\nexport default function pThrottle({limit, interval, strict, onDelay}) {\n\tif (!Number.isFinite(limit)) {\n\t\tthrow new TypeError('Expected `limit` to be a finite number');\n\t}\n\n\tif (!Number.isFinite(interval)) {\n\t\tthrow new TypeError('Expected `interval` to be a finite number');\n\t}\n\n\tconst queue = new Map();\n\n\tlet currentTick = 0;\n\tlet activeCount = 0;\n\n\tfunction windowedDelay() {\n\t\tconst now = Date.now();\n\n\t\tif ((now - currentTick) > interval) {\n\t\t\tactiveCount = 1;\n\t\t\tcurrentTick = now;\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (activeCount < limit) {\n\t\t\tactiveCount++;\n\t\t} else {\n\t\t\tcurrentTick += interval;\n\t\t\tactiveCount = 1;\n\t\t}\n\n\t\treturn currentTick - now;\n\t}\n\n\tconst strictTicks = [];\n\n\tfunction strictDelay() {\n\t\tconst now = Date.now();\n\n\t\t// Clear the queue if there's a significant delay since the last execution\n\t\tif (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {\n\t\t\tstrictTicks.length = 0;\n\t\t}\n\n\t\t// If the queue is not full, add the current time and execute immediately\n\t\tif (strictTicks.length < limit) {\n\t\t\tstrictTicks.push(now);\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Calculate the next execution time based on the first item in the queue\n\t\tconst nextExecutionTime = strictTicks[0] + interval;\n\n\t\t// Shift the queue and add the new execution time\n\t\tstrictTicks.shift();\n\t\tstrictTicks.push(nextExecutionTime);\n\n\t\t// Calculate the delay for the current execution\n\t\treturn Math.max(0, nextExecutionTime - now);\n\t}\n\n\tconst getDelay = strict ? strictDelay : windowedDelay;\n\n\treturn function_ => {\n\t\tconst throttled = function (...arguments_) {\n\t\t\tif (!throttled.isEnabled) {\n\t\t\t\treturn (async () => function_.apply(this, arguments_))();\n\t\t\t}\n\n\t\t\tlet timeoutId;\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tconst execute = () => {\n\t\t\t\t\tresolve(function_.apply(this, arguments_));\n\t\t\t\t\tqueue.delete(timeoutId);\n\t\t\t\t};\n\n\t\t\t\tconst delay = getDelay();\n\t\t\t\tif (delay > 0) {\n\t\t\t\t\ttimeoutId = setTimeout(execute, delay);\n\t\t\t\t\tqueue.set(timeoutId, reject);\n\t\t\t\t\tonDelay?.();\n\t\t\t\t} else {\n\t\t\t\t\texecute();\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tthrottled.abort = () => {\n\t\t\tfor (const timeout of queue.keys()) {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t\tqueue.get(timeout)(new AbortError());\n\t\t\t}\n\n\t\t\tqueue.clear();\n\t\t\tstrictTicks.splice(0, strictTicks.length);\n\t\t};\n\n\t\tthrottled.isEnabled = true;\n\n\t\tObject.defineProperty(throttled, 'queueSize', {\n\t\t\tget() {\n\t\t\t\treturn queue.size;\n\t\t\t},\n\t\t});\n\n\t\treturn throttled;\n\t};\n}\n","import pThrottle from 'p-throttle';\nimport { snapshot } from 'valtio/vanilla';\n\nimport { api } from './api';\nimport states, { saveStatus } from './states';\n\nexport const throttle = pThrottle({\n limit: 1,\n interval: 1000,\n});\n\nconst STATUS_ID_REGEXES = [\n /\\/@[^@\\/]+@?[^\\/]+?\\/(\\d+)$/i, // Mastodon\n /\\/notice\\/(\\w+)$/i, // Pleroma\n];\nfunction getStatusID(path) {\n for (let i = 0; i < STATUS_ID_REGEXES.length; i++) {\n const statusMatchID = path.match(STATUS_ID_REGEXES[i])?.[1];\n if (statusMatchID) {\n return statusMatchID;\n }\n }\n return null;\n}\n\nconst denylistDomains = /(twitter|github)\\.com/i;\nconst failedUnfurls = {};\nfunction _unfurlMastodonLink(instance, url) {\n const snapStates = snapshot(states);\n if (denylistDomains.test(url)) {\n return;\n }\n if (failedUnfurls[url]) {\n return;\n }\n const instanceRegex = new RegExp(instance + '/');\n if (instanceRegex.test(snapStates.unfurledLinks[url]?.url)) {\n return Promise.resolve(snapStates.unfurledLinks[url]);\n }\n console.debug('🦦 Unfurling URL', url);\n\n let remoteInstanceFetch;\n let theURL = url;\n\n // https://elk.zone/domain.com/@stest/123 -> https://domain.com/@stest/123\n if (/\\/\\/elk\\.[^\\/]+\\/[^\\/]+\\.[^\\/]+/i.test(theURL)) {\n theURL = theURL.replace(/elk\\.[^\\/]+\\//i, '');\n }\n\n // https://trunks.social/status/domain.com/@stest/123 -> https://domain.com/@stest/123\n if (/\\/\\/trunks\\.[^\\/]+\\/status\\/[^\\/]+\\.[^\\/]+/i.test(theURL)) {\n theURL = theURL.replace(/trunks\\.[^\\/]+\\/status\\//i, '');\n }\n\n // https://phanpy.social/#/domain.com/s/123 -> https://domain.com/statuses/123\n if (/\\/#\\/[^\\/]+\\.[^\\/]+\\/s\\/.+/i.test(theURL)) {\n const urlAfterHash = theURL.split('/#/')[1];\n const finalURL = urlAfterHash.replace(/\\/s\\//i, '/@fakeUsername/');\n theURL = `https://${finalURL}`;\n }\n\n const urlObj = URL.parse(theURL);\n if (!urlObj) return;\n const domain = urlObj.hostname;\n const path = urlObj.pathname;\n // Regex /:username/:id, where username = @username or @username@domain, id = post ID\n let statusMatchID = getStatusID(path);\n\n if (statusMatchID) {\n const id = statusMatchID;\n const { masto } = api({ instance: domain });\n remoteInstanceFetch = masto.v1.statuses\n .$select(id)\n .fetch()\n .then((status) => {\n if (status?.id) {\n return {\n status,\n instance: domain,\n };\n } else {\n throw new Error('No results');\n }\n });\n }\n\n const { masto } = api({ instance });\n const mastoSearchFetch = masto.v2.search\n .fetch({\n q: theURL,\n type: 'statuses',\n resolve: true,\n limit: 1,\n })\n .then((results) => {\n const { statuses } = results;\n if (statuses.length > 0) {\n // Filter out statuses that has content that contains the URL, in-case-sensitive\n const theStatuses = statuses.filter(\n (status) =>\n !status.content?.toLowerCase().includes(theURL.toLowerCase()),\n );\n\n if (theStatuses.length === 1) {\n return {\n status: theStatuses[0],\n instance,\n };\n }\n // If there are multiple statuses, give up, something is wrong\n }\n throw new Error('No results');\n });\n\n function handleFulfill(result) {\n const { status, instance } = result;\n const { id } = status;\n const selfURL = `/${instance}/s/${id}`;\n console.debug('🦦 Unfurled URL', url, id, selfURL);\n const data = {\n id,\n instance,\n url: selfURL,\n };\n states.unfurledLinks[url] = data;\n saveStatus(status, instance, {\n skipThreading: true,\n });\n return data;\n }\n function handleCatch(e) {\n failedUnfurls[url] = true;\n }\n\n if (remoteInstanceFetch) {\n // return Promise.any([remoteInstanceFetch, mastoSearchFetch])\n // .then(handleFulfill)\n // .catch(handleCatch);\n // If mastoSearchFetch is fulfilled within 3s, return it, else return remoteInstanceFetch\n const finalPromise = Promise.race([\n mastoSearchFetch,\n new Promise((resolve, reject) => setTimeout(reject, 3000)),\n ]).catch(() => {\n // If remoteInstanceFetch is fullfilled, return it, else return mastoSearchFetch\n return remoteInstanceFetch.catch(() => mastoSearchFetch);\n });\n return finalPromise.then(handleFulfill).catch(handleCatch);\n } else {\n return mastoSearchFetch.then(handleFulfill).catch(handleCatch);\n }\n}\n\nconst unfurlMastodonLink = throttle(_unfurlMastodonLink);\nexport default unfurlMastodonLink;\n","import { deepEqual } from 'fast-equals';\nimport { proxy, subscribe } from 'valtio';\nimport { subscribeKey } from 'valtio/utils';\n\nimport { api } from './api';\nimport isMastodonLinkMaybe from './isMastodonLinkMaybe';\nimport pmem from './pmem';\nimport rateLimit from './ratelimit';\nimport store from './store';\nimport unfurlMastodonLink from './unfurl-link';\n\nconst states = proxy({\n appVersion: {},\n // history: [],\n prevLocation: null,\n currentLocation: null,\n statuses: {},\n statusThreadNumber: {},\n home: [],\n // specialHome: [],\n homeNew: [],\n homeLast: null, // Last item in 'home' list\n homeLastFetchTime: null,\n notifications: [],\n notificationsLast: null, // Last read notification\n notificationsNew: [],\n notificationsShowNew: false,\n notificationsLastFetchTime: null,\n reloadStatusPage: 0,\n reloadGenericAccounts: {\n id: null,\n counter: 0,\n },\n spoilers: {},\n spoilersMedia: {},\n scrollPositions: {},\n unfurledLinks: {},\n statusQuotes: {},\n statusFollowedTags: {},\n statusReply: {},\n accounts: {},\n routeNotification: null,\n composerState: {},\n // Modals\n showCompose: false,\n showSettings: false,\n showAccount: false,\n showAccounts: false,\n showDrafts: false,\n showMediaModal: false,\n showShortcutsSettings: false,\n showKeyboardShortcutsHelp: false,\n showGenericAccounts: false,\n showMediaAlt: false,\n showEmbedModal: false,\n showReportModal: false,\n // Shortcuts\n shortcuts: [],\n // Settings\n settings: {\n autoRefresh: false,\n shortcutsViewMode: null,\n shortcutsColumnsMode: false,\n boostsCarousel: true,\n contentTranslation: true,\n contentTranslationTargetLanguage: null,\n contentTranslationHideLanguages: [],\n contentTranslationAutoInline: false,\n shortcutSettingsCloudImportExport: false,\n mediaAltGenerator: false,\n composerGIFPicker: false,\n cloakMode: false,\n },\n});\n\nexport default states;\n\nexport function initStates() {\n // init all account based states\n // all keys that uses store.account.get() should be initialized here\n states.notificationsLast = store.account.get('notificationsLast') || null;\n states.shortcuts = store.account.get('shortcuts') ?? [];\n states.settings.autoRefresh =\n store.account.get('settings-autoRefresh') ?? false;\n states.settings.shortcutsViewMode =\n store.account.get('settings-shortcutsViewMode') ?? null;\n if (store.account.get('settings-shortcutsColumnsMode')) {\n states.settings.shortcutsColumnsMode = true;\n }\n states.settings.boostsCarousel =\n store.account.get('settings-boostsCarousel') ?? true;\n states.settings.contentTranslation =\n store.account.get('settings-contentTranslation') ?? true;\n states.settings.contentTranslationTargetLanguage =\n store.account.get('settings-contentTranslationTargetLanguage') || null;\n states.settings.contentTranslationHideLanguages =\n store.account.get('settings-contentTranslationHideLanguages') || [];\n states.settings.contentTranslationAutoInline =\n store.account.get('settings-contentTranslationAutoInline') ?? false;\n states.settings.shortcutSettingsCloudImportExport =\n store.account.get('settings-shortcutSettingsCloudImportExport') ?? false;\n states.settings.mediaAltGenerator =\n store.account.get('settings-mediaAltGenerator') ?? false;\n states.settings.composerGIFPicker =\n store.account.get('settings-composerGIFPicker') ?? false;\n states.settings.cloakMode = store.account.get('settings-cloakMode') ?? false;\n}\n\nsubscribeKey(states, 'notificationsLast', (v) => {\n console.log('CHANGE', v);\n store.account.set('notificationsLast', states.notificationsLast);\n});\nsubscribe(states, (changes) => {\n console.debug('STATES change', changes);\n for (const [action, path, value, prevValue] of changes) {\n if (path.join('.') === 'settings.autoRefresh') {\n store.account.set('settings-autoRefresh', !!value);\n }\n if (path.join('.') === 'settings.boostsCarousel') {\n store.account.set('settings-boostsCarousel', !!value);\n }\n if (path.join('.') === 'settings.shortcutsViewMode') {\n store.account.set('settings-shortcutsViewMode', value);\n }\n if (path.join('.') === 'settings.contentTranslation') {\n store.account.set('settings-contentTranslation', !!value);\n }\n if (path.join('.') === 'settings.contentTranslationAutoInline') {\n store.account.set('settings-contentTranslationAutoInline', !!value);\n }\n if (path.join('.') === 'settings.shortcutSettingsCloudImportExport') {\n store.account.set('settings-shortcutSettingsCloudImportExport', !!value);\n }\n if (path.join('.') === 'settings.contentTranslationTargetLanguage') {\n console.log('SET', value);\n store.account.set('settings-contentTranslationTargetLanguage', value);\n }\n if (/^settings\\.contentTranslationHideLanguages/i.test(path.join('.'))) {\n store.account.set(\n 'settings-contentTranslationHideLanguages',\n states.settings.contentTranslationHideLanguages,\n );\n }\n if (path.join('.') === 'settings.mediaAltGenerator') {\n store.account.set('settings-mediaAltGenerator', !!value);\n }\n if (path.join('.') === 'settings.composerGIFPicker') {\n store.account.set('settings-composerGIFPicker', !!value);\n }\n if (path?.[0] === 'shortcuts') {\n store.account.set('shortcuts', states.shortcuts);\n }\n if (path.join('.') === 'settings.cloakMode') {\n store.account.set('settings-cloakMode', !!value);\n }\n }\n});\n\nexport function hideAllModals() {\n states.showCompose = false;\n states.showSettings = false;\n states.showAccount = false;\n states.showAccounts = false;\n states.showDrafts = false;\n states.showMediaModal = false;\n states.showShortcutsSettings = false;\n states.showKeyboardShortcutsHelp = false;\n states.showGenericAccounts = false;\n states.showMediaAlt = false;\n states.showEmbedModal = false;\n}\n\nexport function statusKey(id, instance) {\n if (!id) return;\n return instance ? `${instance}/${id}` : id;\n}\n\nexport function getStatus(statusID, instance) {\n if (instance) {\n const key = statusKey(statusID, instance);\n return states.statuses[key];\n }\n return states.statuses[statusID];\n}\n\nexport function saveStatus(status, instance, opts) {\n if (typeof instance === 'object') {\n opts = instance;\n instance = null;\n }\n const {\n override = true,\n skipThreading = false,\n skipUnfurling = false,\n } = opts || {};\n if (!status) return;\n const oldStatus = getStatus(status.id, instance);\n if (!override && oldStatus) return;\n if (deepEqual(status, oldStatus)) return;\n queueMicrotask(() => {\n const key = statusKey(status.id, instance);\n if (oldStatus?._pinned) status._pinned = oldStatus._pinned;\n // if (oldStatus?._filtered) status._filtered = oldStatus._filtered;\n states.statuses[key] = status;\n if (status.reblog?.id) {\n const srKey = statusKey(status.reblog.id, instance);\n states.statuses[srKey] = status.reblog;\n }\n if (status.quote?.id) {\n const sKey = statusKey(status.quote.id, instance);\n states.statuses[sKey] = status.quote;\n states.statusQuotes[key] = [\n {\n id: status.quote.id,\n instance,\n },\n ];\n }\n });\n\n // THREAD TRAVERSER\n if (!skipThreading) {\n queueMicrotask(() => {\n threadifyStatus(status.reblog || status, instance);\n });\n }\n\n // UNFURLER\n if (!skipUnfurling) {\n queueMicrotask(() => {\n unfurlStatus(status.reblog || status, instance);\n });\n }\n}\n\nfunction _threadifyStatus(status, propInstance) {\n const { masto, instance } = api({ instance: propInstance });\n // Return all statuses in the thread, via inReplyToId, if inReplyToAccountId === account.id\n let fetchIndex = 0;\n async function traverse(status, index = 0) {\n const { inReplyToId, inReplyToAccountId } = status;\n if (!inReplyToId || inReplyToAccountId !== status.account.id) {\n return [status];\n }\n if (inReplyToId && inReplyToAccountId !== status.account.id) {\n throw 'Not a thread';\n // Possibly thread of replies by multiple people?\n }\n const key = statusKey(inReplyToId, instance);\n let prevStatus = states.statuses[key];\n if (!prevStatus) {\n if (fetchIndex++ > 3) throw 'Too many fetches for thread'; // Some people revive old threads\n await new Promise((r) => setTimeout(r, 500 * fetchIndex)); // Be nice to rate limits\n // prevStatus = await masto.v1.statuses.$.select(inReplyToId).fetch();\n prevStatus = await fetchStatus(inReplyToId, masto);\n saveStatus(prevStatus, instance, { skipThreading: true });\n }\n // Prepend so that first status in thread will be index 0\n return [...(await traverse(prevStatus, ++index)), status];\n }\n return traverse(status)\n .then((statuses) => {\n if (statuses.length > 1) {\n console.debug('THREAD', statuses);\n statuses.forEach((status, index) => {\n const key = statusKey(status.id, instance);\n states.statusThreadNumber[key] = index + 1;\n });\n }\n })\n .catch((e) => {\n console.error(e, status);\n });\n}\nexport const threadifyStatus = rateLimit(_threadifyStatus, 100);\n\nconst fauxDiv = document.createElement('div');\nexport function unfurlStatus(status, instance) {\n const { instance: currentInstance } = api();\n const content = status?.content;\n const hasLink = /<a/i.test(content);\n if (hasLink) {\n const sKey = statusKey(status?.id, instance);\n fauxDiv.innerHTML = content;\n const links = fauxDiv.querySelectorAll(\n 'a[href]:not(.u-url):not(.mention):not(.hashtag)',\n );\n [...links]\n .filter((a) => {\n const url = a.href;\n const isPostItself = url === status.url || url === status.uri;\n return !isPostItself && isMastodonLinkMaybe(url);\n })\n .forEach((a, i) => {\n unfurlMastodonLink(currentInstance, a.href).then((result) => {\n if (!result) return;\n if (!sKey) return;\n if (!Array.isArray(states.statusQuotes[sKey])) {\n states.statusQuotes[sKey] = [];\n }\n if (!states.statusQuotes[sKey][i]) {\n states.statusQuotes[sKey].splice(i, 0, result);\n }\n });\n });\n }\n}\n\nconst fetchStatus = pmem((statusID, masto) => {\n return masto.v1.statuses.$select(statusID).fetch();\n});\n","import './loader.css';\n\nfunction Loader({ abrupt, hidden, ...props }) {\n return (\n <span\n {...props}\n class={`loader-container ${abrupt ? 'abrupt' : ''} ${\n hidden ? 'hidden' : ''\n }`}\n >\n <span class=\"loader\" />\n </span>\n );\n}\n\nexport default Loader;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shouldPolyfill = void 0;\nfunction shouldPolyfill() {\n return !Intl.Segmenter;\n}\nexports.shouldPolyfill = shouldPolyfill;\n","import { shouldPolyfill } from '@formatjs/intl-segmenter/should-polyfill';\nimport { useEffect, useState } from 'preact/hooks';\n\nimport Loader from './loader';\n\nconst supportsIntlSegmenter = !shouldPolyfill();\n\nfunction importIntlSegmenter() {\n if (!supportsIntlSegmenter) {\n return import('@formatjs/intl-segmenter/polyfill-force').catch(() => {});\n }\n}\n\nfunction importCompose() {\n return import('./compose');\n}\n\nexport async function preload() {\n try {\n await importIntlSegmenter();\n importCompose();\n } catch (e) {\n console.error(e);\n }\n}\n\nexport default function ComposeSuspense(props) {\n const [Compose, setCompose] = useState(null);\n\n useEffect(() => {\n (async () => {\n try {\n if (supportsIntlSegmenter) {\n const component = await importCompose();\n setCompose(component);\n } else {\n await importIntlSegmenter();\n const component = await importCompose();\n setCompose(component);\n }\n } catch (e) {\n console.error(e);\n }\n })();\n }, []);\n\n return Compose?.default ? <Compose.default {...props} /> : <Loader />;\n}\n","import { useLayoutEffect } from 'preact/hooks';\nimport { matchPath } from 'react-router-dom';\nimport { subscribeKey } from 'valtio/utils';\n\nimport states from './states';\n\nconst { PHANPY_CLIENT_NAME: CLIENT_NAME } = import.meta.env;\n\nexport default function useTitle(title, path) {\n function setTitle() {\n const { currentLocation } = states;\n const hasPaths = Array.isArray(path);\n let paths = hasPaths ? path : [];\n // Workaround for matchPath not working for optional path segments\n // https://github.com/remix-run/react-router/discussions/9862\n if (!hasPaths && /:?\\w+\\?/.test(path)) {\n paths.push(path.replace(/(:\\w+)\\?/g, '$1'));\n paths.push(path.replace(/\\/?:\\w+\\?/g, ''));\n }\n let matched = false;\n if (paths.length) {\n matched = paths.some((p) => matchPath(p, currentLocation));\n } else if (path) {\n matched = matchPath(path, currentLocation);\n }\n console.debug('setTitle', { title, path, currentLocation, paths, matched });\n if (matched) {\n document.title = title ? `${title} / ${CLIENT_NAME}` : CLIENT_NAME;\n }\n }\n\n useLayoutEffect(() => {\n const unsub = subscribeKey(states, 'currentLocation', setTitle);\n setTitle();\n return unsub;\n }, [title, path]);\n}\n"],"file":"assets/useTitle-KMkGka9H.js"} |