@hortiview/modulebase 0.0.1-7.1-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +8 -0
  2. package/dist/ModuleCore-YCIFN_02.js +14973 -0
  3. package/dist/QueryClientProvider-Beog9TR7.js +437 -0
  4. package/dist/_baseGet-C6jMXSsQ.js +805 -0
  5. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  6. package/dist/api-s6E2GJtu.js +458 -0
  7. package/dist/assets/ModuleCore.css +1 -0
  8. package/dist/chunk-IR6S3I6Y-BmDdD3SP.js +8162 -0
  9. package/dist/components/ModuleBase.js +30 -0
  10. package/dist/components/ModuleCore.js +10 -0
  11. package/dist/constants.js +34 -0
  12. package/dist/hooks/useBreadcrumbTranslation.js +23 -0
  13. package/dist/hooks/useCustom.js +19 -0
  14. package/dist/hooks/useCustomMutation.js +23 -0
  15. package/dist/hooks/useEntity.js +57 -0
  16. package/dist/hooks/useOffline.js +45 -0
  17. package/dist/hooks/useOption.js +25 -0
  18. package/dist/hooks/useServiceBus.js +25 -0
  19. package/dist/hooks/useSignalRMessages.js +13 -0
  20. package/dist/hooks/useStores.js +14 -0
  21. package/dist/isRestoring-CLuxJVSA.js +281 -0
  22. package/dist/lib/components/ModuleBase.d.ts +36 -0
  23. package/dist/lib/components/ModuleCore.d.ts +32 -0
  24. package/dist/lib/constants.d.ts +25 -0
  25. package/dist/lib/hooks/useBreadcrumbTranslation.d.ts +1 -0
  26. package/dist/lib/hooks/useCustom.d.ts +8 -0
  27. package/dist/lib/hooks/useCustomMutation.d.ts +9 -0
  28. package/dist/lib/hooks/useEntity.d.ts +162 -0
  29. package/dist/lib/hooks/useOffline.d.ts +15 -0
  30. package/dist/lib/hooks/useOption.d.ts +17 -0
  31. package/dist/lib/hooks/useServiceBus.d.ts +19 -0
  32. package/dist/lib/hooks/useSignalRMessages.d.ts +6 -0
  33. package/dist/lib/hooks/useStores.d.ts +37 -0
  34. package/dist/lib/main.d.ts +27 -0
  35. package/dist/lib/module-router.d.ts +7 -0
  36. package/dist/lib/provider/SignalR/SignalRProvider.d.ts +13 -0
  37. package/dist/lib/provider/SignalR/signalR.d.ts +53 -0
  38. package/dist/lib/stores/BasePropsStore.d.ts +6 -0
  39. package/dist/lib/stores/EnvironmentStore.d.ts +8 -0
  40. package/dist/lib/types/ActionStorage.d.ts +12 -0
  41. package/dist/lib/types/AppInsights.d.ts +12 -0
  42. package/dist/lib/types/BaseProps.d.ts +49 -0
  43. package/dist/lib/types/CommonOptions.d.ts +61 -0
  44. package/dist/lib/types/Deprecated.d.ts +99 -0
  45. package/dist/lib/types/Entities.d.ts +22 -0
  46. package/dist/lib/types/Environment.d.ts +18 -0
  47. package/dist/lib/types/EnvironmentVariable.d.ts +6 -0
  48. package/dist/lib/types/ModuleApi.d.ts +163 -0
  49. package/dist/lib/types/Requests.d.ts +44 -0
  50. package/dist/lib/types/ServiceBus.d.ts +17 -0
  51. package/dist/lib/types/SystemMessage.d.ts +14 -0
  52. package/dist/lib/utils/api.d.ts +20 -0
  53. package/dist/lib/utils/baseFetches.d.ts +19 -0
  54. package/dist/lib/utils/fetches.d.ts +43 -0
  55. package/dist/lib/utils/helper.d.ts +29 -0
  56. package/dist/main.js +218 -0
  57. package/dist/module-router.js +129 -0
  58. package/dist/mutation-DSKlaYzY.js +192 -0
  59. package/dist/omit-C9Qe80rl.js +835 -0
  60. package/dist/provider/SignalR/SignalRProvider.js +6408 -0
  61. package/dist/provider/SignalR/signalR.js +11 -0
  62. package/dist/react-QiIgv49H.js +27 -0
  63. package/dist/stores/BasePropsStore.js +7 -0
  64. package/dist/stores/EnvironmentStore.js +15 -0
  65. package/dist/types/ActionStorage.js +4 -0
  66. package/dist/types/AppInsights.js +1 -0
  67. package/dist/types/BaseProps.js +1 -0
  68. package/dist/types/CommonOptions.js +4 -0
  69. package/dist/types/Deprecated.js +1 -0
  70. package/dist/types/Entities.js +25 -0
  71. package/dist/types/Environment.js +1 -0
  72. package/dist/types/EnvironmentVariable.js +1 -0
  73. package/dist/types/ModuleApi.js +1 -0
  74. package/dist/types/Requests.js +1 -0
  75. package/dist/types/ServiceBus.js +1 -0
  76. package/dist/types/SystemMessage.js +1 -0
  77. package/dist/useMutation-zu8uxBak.js +97 -0
  78. package/dist/useQuery-Bj9k9zik.js +395 -0
  79. package/dist/utils/api.js +9 -0
  80. package/dist/utils/baseFetches.js +19 -0
  81. package/dist/utils/fetches.js +22 -0
  82. package/dist/utils/helper.js +55 -0
  83. package/dist/utils-DxRR_XLb.js +9 -0
  84. package/dist/vite-env.d.js +1 -0
  85. package/package.json +60 -0
@@ -0,0 +1,22 @@
1
+ import { Block, BlockPlantLayout, Farm, FarmAlertRule, FarmOrganization, Field, IrrigationStation, Season } from '../types/ModuleApi';
2
+ export type HortiviewDataAreaGroup = 'FarmOrganization' | 'FarmMember';
3
+ export type ModuleDataAreaGroup = 'ModuleDepended';
4
+ export type FarmOrganizationEntities = 'farms' | 'fields' | 'zones' | 'irrigation_stations' | 'farm_organizations' | 'alert_rules';
5
+ export type FarmMemberEntities = 'farm_members';
6
+ export type ModuleDependendEntities = 'Season' | 'BlockPlantLayout' | (string & {});
7
+ export type HortiviewDataAreaEntity<T extends HortiviewDataAreaGroup | ModuleDataAreaGroup> = T extends 'FarmOrganization' ? FarmOrganizationEntities : T extends 'FarmMember' ? FarmMemberEntities : T extends 'ModuleDepended' ? ModuleDependendEntities : never;
8
+ export type ResultMap<T extends FarmMemberEntities | FarmOrganizationEntities | ModuleDependendEntities> = T extends 'zones' ? Block : T extends 'fields' ? Field : T extends 'farms' ? Farm : T extends 'irrigation_stations' ? IrrigationStation : T extends 'farm_organizations' ? FarmOrganization : T extends 'alert_rules' ? FarmAlertRule : T extends 'Season' ? Season : T extends 'BlockPlantLayout' ? BlockPlantLayout : unknown;
9
+ export declare const FarmOrgEntitiesTypeResultMap: Record<FarmOrganizationEntities, string>;
10
+ export declare const FarmMemberEntitiesTypeResultMap: Record<FarmMemberEntities, string>;
11
+ export declare const ModuleDependedEntityTypeResultMap: Record<ModuleDependendEntities, string>;
12
+ export declare const AllEntitiesTypeResultMap: {
13
+ Season: string;
14
+ BlockPlantLayout: string;
15
+ farm_members: string;
16
+ farms: string;
17
+ fields: string;
18
+ zones: string;
19
+ irrigation_stations: string;
20
+ farm_organizations: string;
21
+ alert_rules: string;
22
+ };
@@ -0,0 +1,18 @@
1
+ export interface HortiViewEnvironments {
2
+ COMMON_API: string;
3
+ MODULE_AUTH_API: string;
4
+ API_PREFIX: string;
5
+ ENVIRONMENT: string;
6
+ REQ_VERSION: string;
7
+ [customkey: string]: string;
8
+ }
9
+ export interface CustomWindow extends Window {
10
+ __env__?: HortiViewEnvironments;
11
+ }
12
+ export type Environments = 'SDC-DEV' | 'SDC-TEST' | 'SDC-DEMO' | 'BAYER-TES' | 'BAYER-DEM' | 'BAYER-STAG' | 'BAYER-PROD';
13
+ export type EnvConfig = {
14
+ [key in Environments]?: CustomEnv;
15
+ };
16
+ export type CustomEnv = {
17
+ [key: string]: string;
18
+ };
@@ -0,0 +1,6 @@
1
+ export type EnvironmentVariable = {
2
+ id?: string;
3
+ key: string;
4
+ value: string;
5
+ appEnvironmentId: string | null;
6
+ };
@@ -0,0 +1,163 @@
1
+ export type RegisterOption = {
2
+ moduleId: string;
3
+ registeredEntityName: string;
4
+ id: string;
5
+ };
6
+ export interface ModuleEntity {
7
+ season: Season | undefined;
8
+ blockPlantLayout: BlockPlantLayout | undefined;
9
+ }
10
+ /**
11
+ * the basic interface for the module apis farm organization entities
12
+ */
13
+ export interface FarmOrgEntity {
14
+ block: Block | undefined;
15
+ farm: Farm | undefined;
16
+ field: Field | undefined;
17
+ farmOrg: {
18
+ id: string;
19
+ } | undefined;
20
+ irrigationStation: {
21
+ id: string;
22
+ } | undefined;
23
+ farmAlertRule: {
24
+ id: string;
25
+ } | undefined;
26
+ id: string;
27
+ }
28
+ export interface FarmOrganization {
29
+ parentOrganizationId: string | null;
30
+ organizationName: string;
31
+ legalForm: string | null;
32
+ primaryContactId: string;
33
+ secondaryContactId: string | null;
34
+ creatorId: string;
35
+ addressId: string;
36
+ ownerId: string;
37
+ description: string | null;
38
+ address: Address;
39
+ id: string;
40
+ }
41
+ export type Block = {
42
+ id: string;
43
+ fieldId: string;
44
+ blockName?: string;
45
+ shortName?: string;
46
+ area?: number;
47
+ fieldPercentage?: number;
48
+ description?: string;
49
+ length?: number;
50
+ width?: number;
51
+ rows?: number;
52
+ /** Stringyfied Position, only used in BE */
53
+ location?: string;
54
+ /**Position will be transformed from the Location string, only internally used*/
55
+ position?: {
56
+ row: number;
57
+ column: number;
58
+ };
59
+ };
60
+ /**
61
+ * farm dto (only necessary fields - for now)
62
+ */
63
+ export interface Farm {
64
+ id: string;
65
+ farmName: string;
66
+ description: string;
67
+ fields: Field[];
68
+ longitude: number;
69
+ latitude: number;
70
+ organizationId: string;
71
+ location: string;
72
+ primaryContactId: string;
73
+ secondaryContactId: string;
74
+ address: Address;
75
+ }
76
+ export interface Field {
77
+ farmId: string;
78
+ name: string;
79
+ description: string;
80
+ fieldTechnologyTypeId: string;
81
+ fieldCoverageTypeId: string;
82
+ fieldShadingTypeId: string;
83
+ fieldSowingTypeId: string;
84
+ fieldSubstrateTypeId: string;
85
+ length: number | null;
86
+ width: number | null;
87
+ rows: number | null;
88
+ location: string;
89
+ area: number;
90
+ tag: string | null;
91
+ fieldTypeId: string;
92
+ id: string;
93
+ }
94
+ export interface Season {
95
+ id: string;
96
+ cropSeasonName: string;
97
+ startDate: Date;
98
+ plantingDate: Date | null;
99
+ cropId: string;
100
+ cropTypeId: string;
101
+ cropVarietyId: string;
102
+ rootstockId: string;
103
+ farmId: string;
104
+ fieldId: string;
105
+ seasonStateId?: string;
106
+ }
107
+ export interface BlockPlantLayout {
108
+ id: string;
109
+ blockId: string;
110
+ arrangementType: string | null;
111
+ offsetPlants: number;
112
+ offsetPlantsUnit: string;
113
+ rowLength: number;
114
+ rowLengthUnit: string;
115
+ offsetRows: number;
116
+ offsetRowsUnit: string;
117
+ numberOfRows: number;
118
+ numberOfPlants: number;
119
+ }
120
+ export interface IrrigationStation {
121
+ irrigationStationName: string;
122
+ farmId: string;
123
+ totalArea: number;
124
+ totalAreaUnit: string;
125
+ flow: number;
126
+ flowUnit: string;
127
+ irrigationZoneFields: IrrigationZoneField[];
128
+ id: string;
129
+ }
130
+ export interface FarmAlertRule {
131
+ farmOrganizationId: string;
132
+ moduleId: string;
133
+ farmId: string;
134
+ description: string;
135
+ descriptionTranslationsAsJson: string;
136
+ raisesNotification: boolean;
137
+ ruleAsJson: string;
138
+ recipients: string[];
139
+ id: string;
140
+ }
141
+ interface IrrigationZoneField {
142
+ fieldId: string;
143
+ irrigationZoneFieldBlocks: IrrigationZoneFieldBlock[];
144
+ id: string;
145
+ }
146
+ interface IrrigationZoneFieldBlock {
147
+ blockId: string;
148
+ id: string;
149
+ }
150
+ interface Address {
151
+ addressLine1: string;
152
+ addressLine2: string | null;
153
+ addressLine3: string | null;
154
+ directions: string | null;
155
+ city: string;
156
+ postalCode: string;
157
+ state: string;
158
+ countryId: string;
159
+ longitude: number;
160
+ latitude: number;
161
+ id: string;
162
+ }
163
+ export {};
@@ -0,0 +1,44 @@
1
+ import { Expand, Filter, Select } from 'odata-query';
2
+ export type RequestConfig = {
3
+ redirect: 'follow';
4
+ credentials: 'omit';
5
+ headers: RequestHeader;
6
+ method: httpMethod;
7
+ body?: string | FormData;
8
+ };
9
+ export type RequestHeader = Headers & {
10
+ 'Content-Type'?: 'application/json';
11
+ orgId?: string;
12
+ Authorization?: string;
13
+ Permission?: string;
14
+ 'Api-Version'?: '1.0' | '2.0';
15
+ languageId?: string;
16
+ };
17
+ export type InternalError = {
18
+ status: number;
19
+ title: string;
20
+ detail: string;
21
+ stack?: string;
22
+ };
23
+ export type Query = {
24
+ filter?: Filter<unknown>;
25
+ orderBy?: string[];
26
+ expand?: string | string[] | Expand<unknown>;
27
+ select?: Select<unknown>;
28
+ count?: boolean | Filter<unknown>;
29
+ pagination?: Pagination;
30
+ top?: number;
31
+ skip?: number;
32
+ overwrite?: string;
33
+ };
34
+ export type Pagination = {
35
+ top?: number;
36
+ skip?: number;
37
+ pageSize?: number;
38
+ };
39
+ export type BaseResponse<T> = T | T[] | {
40
+ value: T | T[];
41
+ } | {
42
+ items: T | T[];
43
+ };
44
+ export type httpMethod = 'POST' | 'PATCH' | 'DELETE' | 'PUT' | 'GET';
@@ -0,0 +1,17 @@
1
+ export type AlertServiceBusMessage = {
2
+ farmOrganizationId: string;
3
+ alertRulesDefinitionId: string;
4
+ farmId: string;
5
+ fieldId: string;
6
+ blockId: string;
7
+ /**
8
+ * needs to be an ID that can be received from the common data/api
9
+ */
10
+ criteriaId: string;
11
+ moduleId: string;
12
+ description: string;
13
+ };
14
+ export type ServiceBusMessage = AlertServiceBusMessage & {
15
+ deviceId: '62ac8dbc-45bc-407d-9fb4-8efe9747abe0';
16
+ scope: 'FarmOrgMembers';
17
+ };
@@ -0,0 +1,14 @@
1
+ export type SystemMessage = {
2
+ id: string;
3
+ title: string;
4
+ description: string | JSX.Element;
5
+ timeStamp: string | Date;
6
+ isRead: boolean;
7
+ isSnoozed: boolean;
8
+ icon?: {
9
+ name: string;
10
+ danger?: boolean;
11
+ };
12
+ link?: string;
13
+ action?: () => void;
14
+ };
@@ -0,0 +1,20 @@
1
+ import { BaseResponse, httpMethod, Query, RequestConfig } from '../types/Requests';
2
+ export declare const getConfig: (token?: string, organizationId?: string, languageId?: string, method?: httpMethod, customHeaders?: Headers) => RequestConfig;
3
+ /**
4
+ * a fetch function to handle requests and returns the response. if the response is unauthorized, it tries to refresh the token and retries the request
5
+ * @param url - the complete url build by {@link prependBaseUrl}
6
+ * @param config - the request config including auth headers
7
+ * @param throwFullMessage - if the full error message should be thrown or only the message behind the status code
8
+ * @param withResponseHandling - if the response should be handled by the {@link handleResponse} method or not ("hide" the error)
9
+ * @param tries - the number of retries, default is 1
10
+ * @returns
11
+ */
12
+ export declare const fetchWithErrorHandling: <T>(url: string, config: RequestConfig, tries?: number, withResponseHandling?: boolean) => Promise<BaseResponse<T>>;
13
+ export declare const handleResponse: (response: Response) => Promise<any>;
14
+ /**
15
+ * a helper function to format the query string
16
+ * @param query - the query object to format
17
+ * @param withApiVersion - if the api version should be added to the query string
18
+ * @returns
19
+ */
20
+ export declare const formatQuery: (query?: Query, withApiVersion?: boolean) => string;
@@ -0,0 +1,19 @@
1
+ import { BaseResponse, httpMethod, Query } from '../types/Requests';
2
+ /**
3
+ * a fetch function to handle CUD requests and returns the response.
4
+ * @param url endpoint to fetch (CUD) data from
5
+ * @param data data to send
6
+ * @param method method to use (POST, PUT, DELETE, PATCH)
7
+ * @param customToken token to use (default is the modulePermissionToken)
8
+ * @param headers (optional) custom headers to use
9
+ * @returns Promise<BaseResponse<R>> response from the fetch
10
+ */
11
+ export declare const baseMutation: <T, R>(url: string, data: T, method: Omit<httpMethod, "GET">, customToken?: string, headers?: Headers, noAuth?: boolean) => Promise<BaseResponse<R>>;
12
+ /**
13
+ * a fetch function to handle GET requests and returns the response.
14
+ * @param url url to GET data from
15
+ * @param query query to use for the GET request
16
+ * @param customToken token to use (default is the modulePermissionToken)
17
+ * @returns Promise<BaseResponse<T>> response from the fetch
18
+ */
19
+ export declare const baseFetch: <T>(url: string, query: Query, customToken?: string, noAuth?: boolean) => Promise<BaseResponse<T>>;
@@ -0,0 +1,43 @@
1
+ import { httpMethod } from '../types/Requests';
2
+ export declare const mutateOnCustomApi: <T, R>(endpoint: string, data: T, method?: Omit<httpMethod, "GET">, token?: string, headers?: Headers, noAuth?: boolean) => Promise<import('../main').BaseResponse<R>>;
3
+ /**
4
+ * a fetch function to get a certain farmorganization entity from the moduleApi (will be used in useEntity)
5
+ * @param moduleId moduleID to get the entity from
6
+ * @param entityId entityID of the entity to get
7
+ * @returns entity to get
8
+ */
9
+ export declare const getFarmOrgEntities: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
10
+ /**
11
+ * a fetch function to get a certain MODULEDEPENDED entity from the moduleApi (will be used in useEntity)
12
+ * @param moduleId moduleID to get the entity from
13
+ * @param entityId entityID of the entity to get
14
+ * @returns entity to get
15
+ */
16
+ export declare const getModuleDependedEntities: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
17
+ /**
18
+ * a fetch function to get a certain MODULEDEPENDED entity from the moduleApi (will be used in useEntity)
19
+ * the data will be returned in a raw format
20
+ * @param moduleId
21
+ * @param entityId
22
+ * @returns
23
+ */
24
+ export declare const getModuleDependedEntitiesRaw: <T>(moduleId: string, entityId: string) => Promise<import('../main').BaseResponse<T>>;
25
+ /**
26
+ * a fetch function to handle GET requests and returns the response.
27
+ * @param endpoint custom endpoint to GET data from
28
+ * @param token token to use (default is the modulePermissionToken)
29
+ * @returns Promise<BaseResponse<T>> response from the fetch
30
+ */
31
+ export declare const fetchFromCustomApi: <T>(endpoint: string, token?: string, noAuth?: boolean) => Promise<import('../main').BaseResponse<T>>;
32
+ /**
33
+ * a fetch function to handle GET requests and returns the response.
34
+ * @param endpoint endpoint of moduleApi to fetch data from
35
+ * @returns Promise<BaseResponse<T>> response from the fetch
36
+ */
37
+ export declare const fetchFromModuleApi: <T>(endpoint: string) => Promise<import('../main').BaseResponse<T>>;
38
+ /**
39
+ * a fetch function to handle GET requests and returns the response.
40
+ * @param endpoint endpoint of commonApi to fetch data from
41
+ * @returns Promise<BaseResponse<T>> response from the fetch
42
+ */
43
+ export declare const fetchFromCommonApi: <T>(endpoint: string) => Promise<import('../main').BaseResponse<T>>;
@@ -0,0 +1,29 @@
1
+ import { BaseProps } from '../main';
2
+ import { EnvConfig, Environments, HortiViewEnvironments } from '../types/Environment';
3
+ import { BaseResponse } from '../types/Requests';
4
+ /**
5
+ * Validates the props and checks if the required props are set
6
+ * @param props props to be validated
7
+ * @param requiredProps props that will be validated/checked if they exist
8
+ */
9
+ export declare const arePropsValid: (props: BaseProps) => boolean;
10
+ /**
11
+ * Checks if a prop exists and throws an error if it does not
12
+ * @param prop prop to be checked
13
+ * @param props props to be checked against
14
+ */
15
+ export declare const checkIfPropExists: (prop: keyof BaseProps, props: BaseProps) => boolean;
16
+ /**
17
+ * check if hortiview return the __env__ object correctly
18
+ * @returns the environment variables from the window object
19
+ */
20
+ export declare const getEnvironmentVariables: () => HortiViewEnvironments | undefined;
21
+ export declare const checkVersion: (environmentVariables?: HortiViewEnvironments) => string | null;
22
+ /**
23
+ * a universal selector that can be used for all fetches
24
+ * @param data - the data to select from
25
+ * @returns
26
+ */
27
+ export declare const universalSelector: <T>(data: BaseResponse<T>) => T | T[];
28
+ export declare const checkConfig: <T extends EnvConfig>(config: T & Record<Exclude<keyof T, Environments>, never>) => T;
29
+ export declare const getModuleQueryKey: (queryKey: (string | undefined)[]) => (string | undefined)[];
package/dist/main.js ADDED
@@ -0,0 +1,218 @@
1
+ import { ModuleBase as A } from "./components/ModuleBase.js";
2
+ import { i as f, h as m, b as l } from "./ModuleCore-YCIFN_02.js";
3
+ import { M as C, Q as U } from "./ModuleCore-YCIFN_02.js";
4
+ import { useBreadcrumbTranslation as M } from "./hooks/useBreadcrumbTranslation.js";
5
+ import { useOffline as k } from "./hooks/useOffline.js";
6
+ import { useSignalRMessages as L } from "./hooks/useSignalRMessages.js";
7
+ import { useNavigate as B } from "./module-router.js";
8
+ import { useBaseProps as H, useConfig as Q } from "./hooks/useStores.js";
9
+ import { useCustom as T } from "./hooks/useCustom.js";
10
+ import { useCustomMutation as K } from "./hooks/useCustomMutation.js";
11
+ import { useEntity as G } from "./hooks/useEntity.js";
12
+ import { useOption as j } from "./hooks/useOption.js";
13
+ import { useNotification as J, useServiceBus as X } from "./hooks/useServiceBus.js";
14
+ import { mutateOnCustomApi as Z } from "./utils/fetches.js";
15
+ import { arePropsValid as ee, checkConfig as ae, checkIfPropExists as se, checkVersion as te, getEnvironmentVariables as re, getModuleQueryKey as oe, universalSelector as ie } from "./utils/helper.js";
16
+ import { Q as g, a as d } from "./useQuery-Bj9k9zik.js";
17
+ import { u as ne } from "./useQuery-Bj9k9zik.js";
18
+ import { u as he } from "./useMutation-zu8uxBak.js";
19
+ import { u as Se } from "./QueryClientProvider-Beog9TR7.js";
20
+ import { A as me, B as le, F as ge, H as de, I as Ee, a as Pe, b as pe, L as Ne, c as Fe, M as xe, d as ve, N as Ae, e as _e, f as Ce, O as Ue, P as ye, R as Me, g as be, h as ke, i as Oe, S as Le, j as we, k as Be, l as De, m as He, D as Qe, n as Ie, E as Te, o as Ve, p as Ke, q as ze, r as Ge, s as We, t as je, u as qe, v as Je, V as Xe, w as Ye, x as Ze, y as $e, z as ea, C as aa, G as sa, J as ta, K as ra, Q as oa, T as ia, U as ua, W as na, X as ca, Y as ha, Z as fa, _ as Sa, $ as Ra, a0 as ma, a1 as la, a2 as ga, a3 as da, a4 as Ea, a5 as Pa, a6 as pa, a7 as Na, a8 as Fa, a9 as xa, aa as va, ab as Aa, ac as _a, ad as Ca, ae as Ua, af as ya, ag as Ma, ah as ba, ai as ka, aj as Oa, ak as La, al as wa, am as Ba, an as Da, ao as Ha, ap as Qa, aq as Ia, ar as Ta, as as Va, at as Ka, au as za, av as Ga, aw as Wa, ax as ja, ay as qa, az as Ja, aA as Xa, aB as Ya, aC as Za, aD as $a, aE as es, aF as as, aG as ss, aH as ts, aI as rs, aJ as os, aK as is, aL as us, aM as ns, aN as cs, aO as hs, aP as fs, aQ as Ss, aR as Rs, aS as ms, aT as ls } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
21
+ var E = class extends g {
22
+ constructor(e, a) {
23
+ super(e, a);
24
+ }
25
+ bindMethods() {
26
+ super.bindMethods(), this.fetchNextPage = this.fetchNextPage.bind(this), this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
27
+ }
28
+ setOptions(e, a) {
29
+ super.setOptions(
30
+ {
31
+ ...e,
32
+ behavior: f()
33
+ },
34
+ a
35
+ );
36
+ }
37
+ getOptimisticResult(e) {
38
+ return e.behavior = f(), super.getOptimisticResult(e);
39
+ }
40
+ fetchNextPage(e) {
41
+ return this.fetch({
42
+ ...e,
43
+ meta: {
44
+ fetchMore: { direction: "forward" }
45
+ }
46
+ });
47
+ }
48
+ fetchPreviousPage(e) {
49
+ return this.fetch({
50
+ ...e,
51
+ meta: {
52
+ fetchMore: { direction: "backward" }
53
+ }
54
+ });
55
+ }
56
+ createResult(e, a) {
57
+ const { state: t } = e, r = super.createResult(e, a), { isFetching: o, isRefetching: S, isError: i, isRefetchError: R } = r, s = t.fetchMeta?.fetchMore?.direction, u = i && s === "forward", n = o && s === "forward", c = i && s === "backward", h = o && s === "backward";
58
+ return {
59
+ ...r,
60
+ fetchNextPage: this.fetchNextPage,
61
+ fetchPreviousPage: this.fetchPreviousPage,
62
+ hasNextPage: m(a, t.data),
63
+ hasPreviousPage: l(a, t.data),
64
+ isFetchNextPageError: u,
65
+ isFetchingNextPage: n,
66
+ isFetchPreviousPageError: c,
67
+ isFetchingPreviousPage: h,
68
+ isRefetchError: R && !u && !c,
69
+ isRefetching: S && !n && !h
70
+ };
71
+ }
72
+ };
73
+ function F(e, a) {
74
+ return d(
75
+ e,
76
+ E,
77
+ a
78
+ );
79
+ }
80
+ export {
81
+ me as Await,
82
+ le as BrowserRouter,
83
+ ge as Form,
84
+ de as HashRouter,
85
+ Ee as IDLE_BLOCKER,
86
+ Pe as IDLE_FETCHER,
87
+ pe as IDLE_NAVIGATION,
88
+ Ne as Link,
89
+ Fe as Links,
90
+ xe as MemoryRouter,
91
+ ve as Meta,
92
+ A as ModuleBase,
93
+ C as ModuleCore,
94
+ Ae as NavLink,
95
+ _e as Navigate,
96
+ Ce as NavigationType,
97
+ Ue as Outlet,
98
+ ye as PrefetchPageLinks,
99
+ U as QueryClient,
100
+ Me as Route,
101
+ be as Router,
102
+ ke as RouterProvider,
103
+ Oe as Routes,
104
+ Le as Scripts,
105
+ we as ScrollRestoration,
106
+ Be as ServerRouter,
107
+ De as StaticRouter,
108
+ He as StaticRouterProvider,
109
+ Qe as UNSAFE_DataRouterContext,
110
+ Ie as UNSAFE_DataRouterStateContext,
111
+ Te as UNSAFE_ErrorResponseImpl,
112
+ Ve as UNSAFE_FetchersContext,
113
+ Ke as UNSAFE_FrameworkContext,
114
+ ze as UNSAFE_LocationContext,
115
+ Ge as UNSAFE_NavigationContext,
116
+ We as UNSAFE_RemixErrorBoundary,
117
+ je as UNSAFE_RouteContext,
118
+ qe as UNSAFE_ServerMode,
119
+ Je as UNSAFE_SingleFetchRedirectSymbol,
120
+ Xe as UNSAFE_ViewTransitionContext,
121
+ Ye as UNSAFE_createBrowserHistory,
122
+ Ze as UNSAFE_createClientRoutes,
123
+ $e as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
124
+ ea as UNSAFE_createRouter,
125
+ aa as UNSAFE_decodeViaTurboStream,
126
+ sa as UNSAFE_deserializeErrors,
127
+ ta as UNSAFE_getPatchRoutesOnNavigationFunction,
128
+ ra as UNSAFE_getSingleFetchDataStrategy,
129
+ oa as UNSAFE_invariant,
130
+ ia as UNSAFE_mapRouteProperties,
131
+ ua as UNSAFE_shouldHydrateRouteLoader,
132
+ na as UNSAFE_useFogOFWarDiscovery,
133
+ ca as UNSAFE_useScrollRestoration,
134
+ ee as arePropsValid,
135
+ ae as checkConfig,
136
+ se as checkIfPropExists,
137
+ te as checkVersion,
138
+ ha as createBrowserRouter,
139
+ fa as createCookie,
140
+ Sa as createCookieSessionStorage,
141
+ Ra as createHashRouter,
142
+ ma as createMemoryRouter,
143
+ la as createMemorySessionStorage,
144
+ ga as createPath,
145
+ da as createRequestHandler,
146
+ Ea as createRoutesFromChildren,
147
+ Pa as createRoutesFromElements,
148
+ pa as createRoutesStub,
149
+ Na as createSearchParams,
150
+ Fa as createSession,
151
+ xa as createSessionStorage,
152
+ va as createStaticHandler,
153
+ Aa as createStaticRouter,
154
+ _a as data,
155
+ Ca as generatePath,
156
+ re as getEnvironmentVariables,
157
+ oe as getModuleQueryKey,
158
+ Ua as isCookie,
159
+ ya as isRouteErrorResponse,
160
+ Ma as isSession,
161
+ ba as matchPath,
162
+ ka as matchRoutes,
163
+ Z as mutateOnCustomApi,
164
+ Oa as parsePath,
165
+ La as redirect,
166
+ wa as redirectDocument,
167
+ Ba as renderMatches,
168
+ Da as replace,
169
+ Ha as resolvePath,
170
+ ie as universalSelector,
171
+ Qa as unstable_HistoryRouter,
172
+ Ia as unstable_setDevServerHooks,
173
+ Ta as unstable_usePrompt,
174
+ Va as useActionData,
175
+ Ka as useAsyncError,
176
+ za as useAsyncValue,
177
+ H as useBaseProps,
178
+ Ga as useBeforeUnload,
179
+ Wa as useBlocker,
180
+ M as useBreadcrumbTranslation,
181
+ Q as useConfig,
182
+ T as useCustom,
183
+ K as useCustomMutation,
184
+ G as useEntity,
185
+ ja as useFetcher,
186
+ qa as useFetchers,
187
+ Ja as useFormAction,
188
+ Xa as useHref,
189
+ Ya as useInRouterContext,
190
+ F as useInfiniteQuery,
191
+ Za as useLinkClickHandler,
192
+ $a as useLoaderData,
193
+ es as useLocation,
194
+ as as useMatch,
195
+ ss as useMatches,
196
+ he as useMutation,
197
+ B as useNavigate,
198
+ ts as useNavigation,
199
+ rs as useNavigationType,
200
+ J as useNotification,
201
+ k as useOffline,
202
+ j as useOption,
203
+ os as useOutlet,
204
+ is as useOutletContext,
205
+ us as useParams,
206
+ ne as useQuery,
207
+ Se as useQueryClient,
208
+ ns as useResolvedPath,
209
+ cs as useRevalidator,
210
+ hs as useRouteError,
211
+ fs as useRouteLoaderData,
212
+ Ss as useRoutes,
213
+ Rs as useSearchParams,
214
+ X as useServiceBus,
215
+ L as useSignalRMessages,
216
+ ms as useSubmit,
217
+ ls as useViewTransitionState
218
+ };