@axelor/aos-mobile-message 8.4.0

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 (118) hide show
  1. package/README.md +42 -0
  2. package/lib/api/index.d.ts +1 -0
  3. package/lib/api/index.js +19 -0
  4. package/lib/api/index.js.map +1 -0
  5. package/lib/api/mail-message-api.d.ts +53 -0
  6. package/lib/api/mail-message-api.js +133 -0
  7. package/lib/api/mail-message-api.js.map +1 -0
  8. package/lib/components/atoms/AuthorText/AuthorText.d.ts +8 -0
  9. package/lib/components/atoms/AuthorText/AuthorText.js +41 -0
  10. package/lib/components/atoms/AuthorText/AuthorText.js.map +1 -0
  11. package/lib/components/atoms/Avatar/Avatar.d.ts +9 -0
  12. package/lib/components/atoms/Avatar/Avatar.js +49 -0
  13. package/lib/components/atoms/Avatar/Avatar.js.map +1 -0
  14. package/lib/components/atoms/ExpandableText/ExpandableText.d.ts +7 -0
  15. package/lib/components/atoms/ExpandableText/ExpandableText.js +68 -0
  16. package/lib/components/atoms/ExpandableText/ExpandableText.js.map +1 -0
  17. package/lib/components/atoms/MessageBox/MessageBox.d.ts +12 -0
  18. package/lib/components/atoms/MessageBox/MessageBox.js +63 -0
  19. package/lib/components/atoms/MessageBox/MessageBox.js.map +1 -0
  20. package/lib/components/atoms/MessageFlags/MessageFlags.d.ts +9 -0
  21. package/lib/components/atoms/MessageFlags/MessageFlags.js +74 -0
  22. package/lib/components/atoms/MessageFlags/MessageFlags.js.map +1 -0
  23. package/lib/components/atoms/TrackItem/TrackItem.d.ts +10 -0
  24. package/lib/components/atoms/TrackItem/TrackItem.js +59 -0
  25. package/lib/components/atoms/TrackItem/TrackItem.js.map +1 -0
  26. package/lib/components/atoms/index.d.ts +6 -0
  27. package/lib/components/atoms/index.js +24 -0
  28. package/lib/components/atoms/index.js.map +1 -0
  29. package/lib/components/index.d.ts +4 -0
  30. package/lib/components/index.js +22 -0
  31. package/lib/components/index.js.map +1 -0
  32. package/lib/components/molecules/CommentCard/CommentCard.d.ts +14 -0
  33. package/lib/components/molecules/CommentCard/CommentCard.js +60 -0
  34. package/lib/components/molecules/CommentCard/CommentCard.js.map +1 -0
  35. package/lib/components/molecules/NotificationCard/NotificationCard.d.ts +19 -0
  36. package/lib/components/molecules/NotificationCard/NotificationCard.js +59 -0
  37. package/lib/components/molecules/NotificationCard/NotificationCard.js.map +1 -0
  38. package/lib/components/molecules/SendMessageBox/SendMessageBox.d.ts +13 -0
  39. package/lib/components/molecules/SendMessageBox/SendMessageBox.js +62 -0
  40. package/lib/components/molecules/SendMessageBox/SendMessageBox.js.map +1 -0
  41. package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.d.ts +3 -0
  42. package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.js +47 -0
  43. package/lib/components/molecules/UnsubscribeIcon/UnsubscribeIcon.js.map +1 -0
  44. package/lib/components/molecules/index.d.ts +4 -0
  45. package/lib/components/molecules/index.js +22 -0
  46. package/lib/components/molecules/index.js.map +1 -0
  47. package/lib/components/organisms/MailMessageCard/MailMessageCard.d.ts +22 -0
  48. package/lib/components/organisms/MailMessageCard/MailMessageCard.js +148 -0
  49. package/lib/components/organisms/MailMessageCard/MailMessageCard.js.map +1 -0
  50. package/lib/components/organisms/index.d.ts +1 -0
  51. package/lib/components/organisms/index.js +19 -0
  52. package/lib/components/organisms/index.js.map +1 -0
  53. package/lib/components/templates/MailMessageView/MailMessageView.d.ts +9 -0
  54. package/lib/components/templates/MailMessageView/MailMessageView.js +69 -0
  55. package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -0
  56. package/lib/components/templates/index.d.ts +1 -0
  57. package/lib/components/templates/index.js +19 -0
  58. package/lib/components/templates/index.js.map +1 -0
  59. package/lib/features/asyncFunctions-index.d.ts +1 -0
  60. package/lib/features/asyncFunctions-index.js +19 -0
  61. package/lib/features/asyncFunctions-index.js.map +1 -0
  62. package/lib/features/index.d.ts +1 -0
  63. package/lib/features/index.js +19 -0
  64. package/lib/features/index.js.map +1 -0
  65. package/lib/features/mailMessageSlice.d.ts +110 -0
  66. package/lib/features/mailMessageSlice.js +180 -0
  67. package/lib/features/mailMessageSlice.js.map +1 -0
  68. package/lib/hooks/index.d.ts +1 -0
  69. package/lib/hooks/index.js +19 -0
  70. package/lib/hooks/index.js.map +1 -0
  71. package/lib/hooks/use-is-subscribed.d.ts +1 -0
  72. package/lib/hooks/use-is-subscribed.js +25 -0
  73. package/lib/hooks/use-is-subscribed.js.map +1 -0
  74. package/lib/hooks/use-message-header-actions.d.ts +1 -0
  75. package/lib/hooks/use-message-header-actions.js +162 -0
  76. package/lib/hooks/use-message-header-actions.js.map +1 -0
  77. package/lib/i18n/en.json +32 -0
  78. package/lib/i18n/fr.json +32 -0
  79. package/lib/index.d.ts +8 -0
  80. package/lib/index.js +48 -0
  81. package/lib/index.js.map +1 -0
  82. package/lib/screens/InboxScreen.d.ts +3 -0
  83. package/lib/screens/InboxScreen.js +35 -0
  84. package/lib/screens/InboxScreen.js.map +1 -0
  85. package/lib/screens/MailMessageAttachedFilesScreen.d.ts +5 -0
  86. package/lib/screens/MailMessageAttachedFilesScreen.js +37 -0
  87. package/lib/screens/MailMessageAttachedFilesScreen.js.map +1 -0
  88. package/lib/screens/MailMessageLinkFilesScreen.d.ts +5 -0
  89. package/lib/screens/MailMessageLinkFilesScreen.js +88 -0
  90. package/lib/screens/MailMessageLinkFilesScreen.js.map +1 -0
  91. package/lib/screens/MailMessageScreen.d.ts +5 -0
  92. package/lib/screens/MailMessageScreen.js +32 -0
  93. package/lib/screens/MailMessageScreen.js.map +1 -0
  94. package/lib/screens/index.d.ts +43 -0
  95. package/lib/screens/index.js +53 -0
  96. package/lib/screens/index.js.map +1 -0
  97. package/lib/types/inbox-type.d.ts +5 -0
  98. package/lib/types/inbox-type.js +24 -0
  99. package/lib/types/inbox-type.js.map +1 -0
  100. package/lib/types/index.d.ts +3 -0
  101. package/lib/types/index.js +21 -0
  102. package/lib/types/index.js.map +1 -0
  103. package/lib/types/mail-message-notification-type.d.ts +13 -0
  104. package/lib/types/mail-message-notification-type.js +48 -0
  105. package/lib/types/mail-message-notification-type.js.map +1 -0
  106. package/lib/types/mail-message-type.d.ts +17 -0
  107. package/lib/types/mail-message-type.js +55 -0
  108. package/lib/types/mail-message-type.js.map +1 -0
  109. package/lib/utils/date.d.ts +2 -0
  110. package/lib/utils/date.js +24 -0
  111. package/lib/utils/date.js.map +1 -0
  112. package/lib/utils/index.d.ts +2 -0
  113. package/lib/utils/index.js +20 -0
  114. package/lib/utils/index.js.map +1 -0
  115. package/lib/utils/mailMessagesGenericAction.d.ts +24 -0
  116. package/lib/utils/mailMessagesGenericAction.js +53 -0
  117. package/lib/utils/mailMessagesGenericAction.js.map +1 -0
  118. package/package.json +48 -0
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: Message
3
+ tags: Readme
4
+ ---
5
+
6
+ <h1 align="center">@axelor/aos-mobile-message</h1>
7
+
8
+ <div align="center">
9
+ <img src="https://i.imgur.com/KJAAFlT.png" width="30%"/>
10
+ </div>
11
+
12
+ ## Presentation
13
+
14
+ This package was developed for the [Axelor Open Mobile](https://github.com/axelor/axelor-mobile) application.
15
+
16
+ The purpose of this package is to link with the messages management of the [Axelor Open Suite (AOS)](https://github.com/axelor/axelor-open-suite) ERP. It provides a simplified version of a number of processes available on the webapp. This package is compatible with AOS from version 8.4.0.
17
+
18
+ ## Usage
19
+
20
+ Install the library :
21
+
22
+ ```bash
23
+ yarn add @axelor/aos-mobile-message
24
+ ```
25
+
26
+ To add this package in your application, you need to add it in the _modules_ props of the component `Application` from @axelor/aos-mobile-core package.
27
+
28
+ ```typescript
29
+ import React from 'react';
30
+ import {Application} from '@axelor/aos-mobile-core';
31
+ import {MessageModule} from '@axelor/aos-mobile-message';
32
+
33
+ const App = () => {
34
+ return <Application modules={[MessageModule]} mainMenu="auth_menu_user" />;
35
+ };
36
+
37
+ export default App;
38
+ ```
39
+
40
+ ## Developpment
41
+
42
+ This package is developed as part of the Axelor Open Mobile application. To contribute, please go to the [Github project](https://github.com/axelor/axelor-mobile) and follow the guidelines. You will also find an installation guide to help you configure your environment.
@@ -0,0 +1 @@
1
+ export { countUnreadMessages as countUnreadMessagesApi, fetchInboxMessages as fetchInboxMessagesApi, fetchMailMessages as fetchMailMessagesApi, fetchModelSubscribers as fetchModelSubscribersApi, fetchReplies as fetchRepliesApi, getAllUnreadFlagsOfMailMessage as getAllUnreadFlagsOfMailMessageApi, modifyMailMessagesFlags as modifyMailMessagesFlagsApi, postMailMessageComment as postMailMessageCommentApi, readAllMailMessages as readAllMailMessagesApi, subscribeRequest as subscribeRequestApi, unsubscribeRequest as unsubscribeRequestApi, } from './mail-message-api';
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { countUnreadMessages as countUnreadMessagesApi, fetchInboxMessages as fetchInboxMessagesApi, fetchMailMessages as fetchMailMessagesApi, fetchModelSubscribers as fetchModelSubscribersApi, fetchReplies as fetchRepliesApi, getAllUnreadFlagsOfMailMessage as getAllUnreadFlagsOfMailMessageApi, modifyMailMessagesFlags as modifyMailMessagesFlagsApi, postMailMessageComment as postMailMessageCommentApi, readAllMailMessages as readAllMailMessagesApi, subscribeRequest as subscribeRequestApi, unsubscribeRequest as unsubscribeRequestApi, } from './mail-message-api';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,mBAAmB,IAAI,sBAAsB,EAC7C,kBAAkB,IAAI,qBAAqB,EAC3C,iBAAiB,IAAI,oBAAoB,EACzC,qBAAqB,IAAI,wBAAwB,EACjD,YAAY,IAAI,eAAe,EAC/B,8BAA8B,IAAI,iCAAiC,EACnE,uBAAuB,IAAI,0BAA0B,EACrD,sBAAsB,IAAI,yBAAyB,EACnD,mBAAmB,IAAI,sBAAsB,EAC7C,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,qBAAqB,GAC5C,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { InboxFolder } from '../types';
2
+ interface fetchMailMessageProps {
3
+ model: string;
4
+ modelId: number;
5
+ date?: string;
6
+ limit?: number;
7
+ page?: number;
8
+ }
9
+ export declare function fetchMailMessages({ model, modelId, date, limit, page, }: fetchMailMessageProps): Promise<any>;
10
+ interface postMailMessageCommentProps {
11
+ model: string;
12
+ modelId: number;
13
+ comment: string;
14
+ parentId?: number;
15
+ files?: [];
16
+ }
17
+ export declare function postMailMessageComment({ model, modelId, comment, parentId, files, }: postMailMessageCommentProps): Promise<void>;
18
+ export declare function fetchModelSubscribers({ model, modelId, }: {
19
+ model: string;
20
+ modelId: number;
21
+ }): Promise<any>;
22
+ export declare function subscribeRequest({ model, modelId, }: {
23
+ model: string;
24
+ modelId: number;
25
+ }): Promise<any>;
26
+ export declare function unsubscribeRequest({ model, modelId, }: {
27
+ model: string;
28
+ modelId: number;
29
+ }): Promise<any>;
30
+ export declare function countUnreadMessages({ model, modelId, }: {
31
+ model: string;
32
+ modelId: number;
33
+ }): Promise<any>;
34
+ export declare function getAllUnreadFlagsOfMailMessage({ model, modelId, }: {
35
+ model: string;
36
+ modelId: number;
37
+ }): Promise<any>;
38
+ export declare function readAllMailMessages({ model, modelId, }: {
39
+ model: string;
40
+ modelId: number;
41
+ }): Promise<any>;
42
+ export declare function modifyMailMessagesFlags({ mailMessagesFlags, }: {
43
+ mailMessagesFlags: any[];
44
+ }): Promise<any>;
45
+ export declare function fetchInboxMessages({ folder, limit, page, }: {
46
+ folder?: InboxFolder;
47
+ limit?: number;
48
+ page: number;
49
+ }): Promise<any>;
50
+ export declare function fetchReplies({ messageId }: {
51
+ messageId: number;
52
+ }): Promise<any>;
53
+ export {};
@@ -0,0 +1,133 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { axiosApiProvider, createStandardSearch, formatRequestBody, getActionApi, RouterProvider, } from '@axelor/aos-mobile-core';
19
+ import { InboxFolder } from '../types';
20
+ const createUnreadMessagesCriteria = ({ model, modelId }) => {
21
+ return [
22
+ { fieldName: 'relatedModel', operator: '=', value: model },
23
+ { fieldName: 'relatedId', operator: '=', value: modelId },
24
+ { fieldName: 'flags.isRead', operator: '=', value: false },
25
+ ];
26
+ };
27
+ const createUnreadFlagsCriteria = ({ model, modelId }) => {
28
+ return [
29
+ { fieldName: 'message.relatedModel', operator: '=', value: model },
30
+ { fieldName: 'message.relatedId', operator: '=', value: modelId },
31
+ { fieldName: 'isRead', operator: '=', value: false },
32
+ ];
33
+ };
34
+ export async function fetchMailMessages({ model, modelId, date, limit = 10, page, }) {
35
+ const route = await RouterProvider.get('MailMessages');
36
+ const res = await axiosApiProvider.get({
37
+ url: `${route}?relatedId=${modelId}&relatedModel=${model}&limit=${limit}&offset=${limit * page}`,
38
+ });
39
+ if (date != null) {
40
+ const filteredMessages = [];
41
+ for (const message of res?.data?.data) {
42
+ if (new Date(message.$eventTime) > new Date(date)) {
43
+ filteredMessages.push(message);
44
+ }
45
+ else {
46
+ break;
47
+ }
48
+ }
49
+ res.data.data = filteredMessages;
50
+ }
51
+ return res;
52
+ }
53
+ export async function postMailMessageComment({ model, modelId, comment, parentId, files = [], }) {
54
+ const body = { body: `${comment}`, type: 'comment', files };
55
+ if (parentId != null) {
56
+ body.parent = { id: parentId };
57
+ }
58
+ const { matchers } = formatRequestBody(body, 'data');
59
+ return getActionApi().send({
60
+ url: `/ws/rest/${model}/${modelId}/message`,
61
+ method: 'post',
62
+ body: { data: body },
63
+ description: 'post mail message comment',
64
+ matchers: {
65
+ modelName: 'com.axelor.mail.db.MailMessage',
66
+ id: Date.now(),
67
+ fields: matchers,
68
+ },
69
+ });
70
+ }
71
+ export async function fetchModelSubscribers({ model, modelId, }) {
72
+ return axiosApiProvider.get({ url: `/ws/rest/${model}/${modelId}/followers` });
73
+ }
74
+ export async function subscribeRequest({ model, modelId, }) {
75
+ return axiosApiProvider.post({
76
+ url: `/ws/rest/${model}/${modelId}/follow`,
77
+ data: {},
78
+ });
79
+ }
80
+ export async function unsubscribeRequest({ model, modelId, }) {
81
+ return axiosApiProvider.post({
82
+ url: `/ws/rest/${model}/${modelId}/unfollow`,
83
+ data: {},
84
+ });
85
+ }
86
+ export async function countUnreadMessages({ model, modelId, }) {
87
+ return createStandardSearch({
88
+ model: 'com.axelor.mail.db.MailMessage',
89
+ criteria: createUnreadMessagesCriteria({ model, modelId }),
90
+ fieldKey: 'message_mailMessage',
91
+ page: 0,
92
+ numberElementsByPage: null,
93
+ provider: 'model',
94
+ });
95
+ }
96
+ export async function getAllUnreadFlagsOfMailMessage({ model, modelId, }) {
97
+ return createStandardSearch({
98
+ model: 'com.axelor.mail.db.MailFlags',
99
+ criteria: createUnreadFlagsCriteria({ model, modelId }),
100
+ fieldKey: 'message_mailFlags',
101
+ page: 0,
102
+ numberElementsByPage: null,
103
+ provider: 'model',
104
+ });
105
+ }
106
+ export async function readAllMailMessages({ model, modelId, }) {
107
+ return getAllUnreadFlagsOfMailMessage({ model, modelId }).then(res => {
108
+ return modifyMailMessagesFlags({ mailMessagesFlags: res?.data?.data });
109
+ });
110
+ }
111
+ export async function modifyMailMessagesFlags({ mailMessagesFlags, }) {
112
+ if (!Array.isArray(mailMessagesFlags) || mailMessagesFlags?.length === 0) {
113
+ return null;
114
+ }
115
+ return axiosApiProvider.post({
116
+ url: '/ws/rest/com.axelor.mail.db.MailFlags',
117
+ data: {
118
+ records: mailMessagesFlags.map(item => ({
119
+ ...item,
120
+ isRead: item?.isRead ?? true,
121
+ })),
122
+ },
123
+ });
124
+ }
125
+ export async function fetchInboxMessages({ folder = InboxFolder.Inbox, limit = 10, page, }) {
126
+ return axiosApiProvider.get({
127
+ url: `/ws/messages?folder=${folder}&limit=${limit}&offset=${limit * page}`,
128
+ });
129
+ }
130
+ export async function fetchReplies({ messageId }) {
131
+ return axiosApiProvider.get({ url: `/ws/messages/${messageId}/replies` });
132
+ }
133
+ //# sourceMappingURL=mail-message-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mail-message-api.js","sourceRoot":"","sources":["../../src/api/mail-message-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EAEpB,iBAAiB,EACjB,YAAY,EACZ,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,MAAM,4BAA4B,GAAG,CAAC,EAAC,KAAK,EAAE,OAAO,EAAC,EAAc,EAAE;IACpE,OAAO;QACL,EAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE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AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,EAC5C,iBAAiB,GAGlB;IACC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,iBAAiB,EAAE,MAAM,KAAK,CAAC,EAAE;QACxE,OAAO,IAAI,CAAC;KACb;IAED,OAAO,gBAAgB,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,uCAAuC;QAC5C,IAAI,EAAE;YACJ,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACtC,GAAG,IAAI;gBACP,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,IAAI;aAC7B,CAAC,CAAC;SACJ;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,MAAM,GAAG,WAAW,CAAC,KAAK,EAC1B,KAAK,GAAG,EAAE,EACV,IAAI,GAKL;IACC,OAAO,gBAAgB,CAAC,GAAG,CAAC;QAC1B,GAAG,EAAE,uBAAuB,MAAM,UAAU,KAAK,WAAW,KAAK,GAAG,IAAI,EAAE;KAC3E,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAC,SAAS,EAAsB;IACjE,OAAO,gBAAgB,CAAC,GAAG,CAAC,EAAC,GAAG,EAAE,gBAAgB,SAAS,UAAU,EAAC,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface AuthorTextProps {
3
+ author: string;
4
+ eventText: string;
5
+ eventTime: string;
6
+ }
7
+ declare const AuthorText: ({ author, eventText, eventTime }: AuthorTextProps) => React.JSX.Element;
8
+ export default AuthorText;
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React from 'react';
19
+ import { StyleSheet } from 'react-native';
20
+ import { getFromNowDate, useSelector } from '@axelor/aos-mobile-core';
21
+ import { Text } from '@axelor/aos-mobile-ui';
22
+ const AuthorText = ({ author, eventText, eventTime }) => {
23
+ const { user } = useSelector(state => state.user);
24
+ return (<Text style={styles.author} fontSize={12}>
25
+ <Text writingType="important" fontSize={12}>
26
+ {author}{' '}
27
+ </Text>
28
+ {eventText}
29
+ {' - '}
30
+ <Text writingType="details" fontSize={12}>
31
+ {getFromNowDate(eventTime, user?.localization?.language?.code)}
32
+ </Text>
33
+ </Text>);
34
+ };
35
+ const styles = StyleSheet.create({
36
+ author: {
37
+ paddingLeft: 10,
38
+ },
39
+ });
40
+ export default AuthorText;
41
+ //# sourceMappingURL=AuthorText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorText.js","sourceRoot":"","sources":["../../../../src/components/atoms/AuthorText/AuthorText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAQ3C,MAAM,UAAU,GAAG,CAAC,EAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAkB,EAAE,EAAE;IACrE,MAAM,EAAC,IAAI,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhD,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CACvC;MAAA,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CACzC;QAAA,CAAC,MAAM,CAAC,CAAC,GAAG,CACd;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,SAAS,CACV;MAAA,CAAC,KAAK,CACN;MAAA,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CACvC;QAAA,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC,CAChE;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,WAAW,EAAE,EAAE;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare const AVATAR_SIZE: number;
3
+ export declare const AVATAR_PADDING = 10;
4
+ interface AvatarProps {
5
+ style?: any;
6
+ avatar: string;
7
+ }
8
+ declare const Avatar: ({ style, avatar }: AvatarProps) => React.JSX.Element;
9
+ export default Avatar;
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useMemo } from 'react';
19
+ import { Dimensions, StyleSheet, View } from 'react-native';
20
+ import { useSelector } from '@axelor/aos-mobile-core';
21
+ import { Image, useThemeColor } from '@axelor/aos-mobile-ui';
22
+ export const AVATAR_SIZE = Dimensions.get('window').width * 0.12;
23
+ export const AVATAR_PADDING = 10;
24
+ const Avatar = ({ style, avatar }) => {
25
+ const Colors = useThemeColor();
26
+ const { baseUrl } = useSelector(state => state.auth);
27
+ const styles = useMemo(() => getStyles(Colors), [Colors]);
28
+ return (<View style={[styles.avatarContainer, style]}>
29
+ <Image generalStyle={styles.avatar} defaultIconSize={25} resizeMode="contain" source={{ uri: baseUrl + avatar }}/>
30
+ </View>);
31
+ };
32
+ const getStyles = (Colors) => StyleSheet.create({
33
+ avatarContainer: {
34
+ padding: AVATAR_PADDING,
35
+ alignItems: 'center',
36
+ justifyContent: 'flex-start',
37
+ },
38
+ avatar: {
39
+ alignSelf: 'center',
40
+ justifyContent: 'center',
41
+ alignItems: 'center',
42
+ backgroundColor: Colors.backgroundColor,
43
+ borderRadius: AVATAR_SIZE / 2,
44
+ width: AVATAR_SIZE,
45
+ height: AVATAR_SIZE,
46
+ },
47
+ });
48
+ export default Avatar;
49
+ //# sourceMappingURL=Avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../../src/components/atoms/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,WAAW,EAAC,MAAM,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eAAe;QACvC,YAAY,EAAE,WAAW,GAAG,CAAC;QAC7B,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,WAAW;KACpB;CACF,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface ExpandableTextProps {
3
+ style?: any;
4
+ value: string;
5
+ }
6
+ declare const ExpandableText: ({ style, value }: ExpandableTextProps) => React.JSX.Element;
7
+ export default ExpandableText;
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useMemo, useState } from 'react';
19
+ import { StyleSheet, TouchableOpacity, View } from 'react-native';
20
+ import { isHtml } from '@axelor/aos-mobile-core';
21
+ import { HtmlInput, Icon, Text, useThemeColor } from '@axelor/aos-mobile-ui';
22
+ const MAX_TEXT_LINES = 5;
23
+ const MAX_HEIGHT = 150;
24
+ const ExpandableText = ({ style, value }) => {
25
+ const Colors = useThemeColor();
26
+ const [more, setMore] = useState(false);
27
+ const [numOfLines, setNumOfLines] = useState(MAX_TEXT_LINES);
28
+ const [htmlContentHeight, setHtmlContentHeight] = useState();
29
+ const handleTextLayout = useCallback(event => {
30
+ setNumOfLines(event.nativeEvent.lines.length);
31
+ }, []);
32
+ const handleHtmlContainerLayout = useCallback((height) => {
33
+ setHtmlContentHeight(_current => (_current != null ? _current : height));
34
+ }, []);
35
+ const styles = useMemo(() => getStyles(htmlContentHeight, more), [htmlContentHeight, more]);
36
+ return (<TouchableOpacity onPress={() => setMore(_current => !_current)} disabled={numOfLines < MAX_TEXT_LINES} activeOpacity={0.9} style={style}>
37
+ {isHtml(value) ? (<View style={styles.htmlContainer}>
38
+ <HtmlInput defaultInput={value} readonly={true} onHeightChange={handleHtmlContainerLayout}/>
39
+ </View>) : (<Text numberOfLines={more ? numOfLines : MAX_TEXT_LINES} style={styles.text} onTextLayout={handleTextLayout}>
40
+ {value}
41
+ </Text>)}
42
+ {(numOfLines > MAX_TEXT_LINES ||
43
+ (htmlContentHeight && htmlContentHeight > MAX_HEIGHT)) && (<Icon name={more ? 'chevron-up' : 'chevron-down'} color={Colors.primaryColor.background} style={styles.moreIcon}/>)}
44
+ </TouchableOpacity>);
45
+ };
46
+ const getStyles = (htmlContentHeight, more) => StyleSheet.create({
47
+ htmlContainer: {
48
+ width: '100%',
49
+ overflow: 'hidden',
50
+ height: htmlContentHeight &&
51
+ (htmlContentHeight > MAX_HEIGHT
52
+ ? more
53
+ ? htmlContentHeight
54
+ : MAX_HEIGHT
55
+ : htmlContentHeight),
56
+ },
57
+ moreIcon: {
58
+ alignSelf: 'center',
59
+ },
60
+ text: {
61
+ width: '100%',
62
+ fontSize: 14,
63
+ textAlign: 'justify',
64
+ marginVertical: 5,
65
+ },
66
+ });
67
+ export default ExpandableText;
68
+ //# sourceMappingURL=ExpandableText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandableText.js","sourceRoot":"","sources":["../../../../src/components/atoms/ExpandableText/ExpandableText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EAAC,MAAM,EAAC,MAAM,yBA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B;YACjB,CAAC,iBAAiB,GAAG,UAAU;gBAC7B,CAAC,CAAC,IAAI;oBACJ,CAAC,CAAC,iBAAiB;oBACnB,CAAC,CAAC,UAAU;gBACd,CAAC,CAAC,iBAAiB,CAAC;KACzB;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,SAAS;QACpB,cAAc,EAAE,CAAC;KAClB;CACF,CAAC,CAAC;AAEL,eAAe,cAAc,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ interface MessageBoxProps {
3
+ placeholder?: string;
4
+ disabled?: boolean;
5
+ value?: string;
6
+ onChange: (value: string) => void;
7
+ onSend?: () => void;
8
+ onLinkFiles?: () => void;
9
+ numberLinkedFiles?: number;
10
+ }
11
+ declare const MessageBox: ({ placeholder, disabled, value, onChange, onSend, onLinkFiles, numberLinkedFiles, }: MessageBoxProps) => React.JSX.Element;
12
+ export default MessageBox;
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useMemo } from 'react';
19
+ import { StyleSheet, View } from 'react-native';
20
+ import { getCommonStyles, HtmlInput, Icon, NumberBubble, useThemeColor, } from '@axelor/aos-mobile-ui';
21
+ const MessageBox = ({ placeholder, disabled, value, onChange, onSend, onLinkFiles, numberLinkedFiles, }) => {
22
+ const Colors = useThemeColor();
23
+ const commonStyles = useMemo(() => getCommonStyles(Colors), [Colors]);
24
+ return (<View style={styles.container}>
25
+ <HtmlInput defaultInput={value} onChange={onChange} placeholder={placeholder} containerStyle={[commonStyles.filter, styles.htlmInput]} styleToolbar={styles.htmlToolBar}/>
26
+ <View style={styles.iconsContainer}>
27
+ {onSend && (<Icon style={[commonStyles.filter, styles.action]} name="send-fill" color={disabled && Colors.secondaryColor.background_light} size={24} touchable={!disabled} onPress={onSend}/>)}
28
+ {onLinkFiles && (<View style={[commonStyles.filter, styles.action]}>
29
+ <Icon name="paperclip" size={24} touchable onPress={onLinkFiles}/>
30
+ {numberLinkedFiles > 0 && (<NumberBubble style={styles.number} number={numberLinkedFiles} color={Colors.primaryColor} isNeutralBackground size={18}/>)}
31
+ </View>)}
32
+ </View>
33
+ </View>);
34
+ };
35
+ const styles = StyleSheet.create({
36
+ container: {
37
+ flexDirection: 'row',
38
+ paddingHorizontal: 5,
39
+ gap: 5,
40
+ },
41
+ htlmInput: {
42
+ paddingHorizontal: 0,
43
+ paddingTop: 10,
44
+ },
45
+ htmlToolBar: {
46
+ backgroundColor: null,
47
+ marginLeft: -5,
48
+ },
49
+ iconsContainer: {
50
+ width: '10%',
51
+ },
52
+ action: {
53
+ flex: 1,
54
+ justifyContent: 'center',
55
+ },
56
+ number: {
57
+ position: 'absolute',
58
+ top: 2,
59
+ right: 2,
60
+ },
61
+ });
62
+ export default MessageBox;
63
+ //# sourceMappingURL=MessageBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageBox.js","sourceRoot":"","sources":["../../../../src/components/atoms/MessageBox/MessageBox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,E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MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAChD;YAAA,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,EAChE;YAAA,CAAC,iBAAiB,GAAG,CAAC,IAAI,CACxB,CAAC,YAAY,CACX,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACrB,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAC1B,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAC3B,mBAAmB,CACnB,IAAI,CAAC,CAAC,EAAE,CAAC,EACT,CACH,CACH;UAAA,EAAE,IAAI,CAAC,CACR,CACH;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,CAAC;QACpB,GAAG,EAAE,CAAC;KACP;IACD,SAAS,EAAE;QACT,iBAAiB,EAAE,CAAC;QACpB,UAAU,EAAE,EAAE;KACf;IACD,WAAW,EAAE;QACX,eAAe,EAAE,IAAI;QACrB,UAAU,EAAE,CAAC,CAAC;KACf;IACD,cAAc,EAAE;QACd,KAAK,EAAE,KAAK;KACb;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;KACT;CACF,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface MessageFlagsProps {
3
+ flags: any;
4
+ model: string;
5
+ modelId: number;
6
+ isInbox?: boolean;
7
+ }
8
+ declare const MessageFlags: ({ flags, model, modelId, isInbox, }: MessageFlagsProps) => React.JSX.Element;
9
+ export default MessageFlags;
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useCallback, useMemo } from 'react';
19
+ import { Dimensions, StyleSheet } from 'react-native';
20
+ import { useDispatch, useSelector, useTranslator } from '@axelor/aos-mobile-core';
21
+ import { DropdownMenu, DropdownMenuItem } from '@axelor/aos-mobile-ui';
22
+ import { modifyMailMessagesFlags } from '../../../features/mailMessageSlice';
23
+ const MessageFlags = ({ flags, model, modelId, isInbox = false, }) => {
24
+ const I18n = useTranslator();
25
+ const dispatch = useDispatch();
26
+ const { inboxFolder } = useSelector(state => state.mailMessages);
27
+ const menuItemList = useMemo(() => [
28
+ {
29
+ flag: 'isRead',
30
+ confirmIcon: 'check-lg',
31
+ cancelIcon: 'x-lg',
32
+ confirmKey: 'Message_MarkAsRead',
33
+ cancelKey: 'Message_MarkAsUnread',
34
+ },
35
+ {
36
+ flag: 'isStarred',
37
+ confirmIcon: 'star-fill',
38
+ cancelIcon: 'star',
39
+ confirmKey: 'Message_MarkAsImportant',
40
+ cancelKey: 'Message_MarkAsNotImportant',
41
+ },
42
+ {
43
+ flag: 'isArchived',
44
+ confirmIcon: 'archive-fill',
45
+ cancelIcon: 'archive',
46
+ confirmKey: 'Message_MarkAsArchived',
47
+ cancelKey: 'Message_MarkAsNotArchived',
48
+ },
49
+ ], []);
50
+ const handleModifyMailMessageFlags = useCallback((key, value) => {
51
+ dispatch(modifyMailMessagesFlags({
52
+ mailMessagesFlags: [{ ...flags, [key]: value }],
53
+ model,
54
+ modelId,
55
+ isInbox,
56
+ inboxFolder,
57
+ }));
58
+ }, [dispatch, flags, inboxFolder, isInbox, model, modelId]);
59
+ return (<DropdownMenu style={styles.container} styleMenu={styles.menuContainer}>
60
+ {menuItemList.map((menuItem, index) => (<DropdownMenuItem style={styles.itemContainer} styleText={styles.itemText} numberOfLines={1} icon={flags?.[menuItem.flag] ? menuItem.cancelIcon : menuItem.confirmIcon} placeholder={I18n.t(flags?.[menuItem.flag] ? menuItem.cancelKey : menuItem.confirmKey)} onPress={() => handleModifyMailMessageFlags(menuItem.flag, !flags?.[menuItem.flag])} key={index}/>))}
61
+ </DropdownMenu>);
62
+ };
63
+ const styles = StyleSheet.create({
64
+ container: { zIndex: 15 },
65
+ menuContainer: {
66
+ width: Dimensions.get('window').width * 0.8,
67
+ top: -15,
68
+ right: 30,
69
+ },
70
+ itemContainer: { marginVertical: 0 },
71
+ itemText: { fontSize: 16 },
72
+ });
73
+ export default MessageFlags;
74
+ //# sourceMappingURL=MessageFlags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageFlags.js","sourceRoot":"","sources":["../../../../src/components/atoms/MessageFlags/MessageFlags.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAS3E,MAAM,YAAY,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