aibox-custom-component-packages 0.0.7 → 0.0.8

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 (182) hide show
  1. package/es/AddOrEditSupplierDialog.mjs +309 -259
  2. package/es/ApplicationTypeTag.mjs +14 -14
  3. package/es/AuthSection.mjs +11 -11
  4. package/es/AutoShowTooltip.mjs +1 -1
  5. package/es/AvailableRangePreview.mjs +1 -1
  6. package/es/AvailableRangeSetting.mjs +9 -5
  7. package/es/CodeView.mjs +1 -1
  8. package/es/CommonTagsList.mjs +5 -5
  9. package/es/CreateMcpForm.mjs +13 -12
  10. package/es/CustomSidebar.mjs +159 -154
  11. package/es/CustomTitle.mjs +1 -1
  12. package/es/CustomToggle.mjs +131 -77
  13. package/es/DocSyncSelect.mjs +2661 -0
  14. package/es/FileDisplay.mjs +2 -4
  15. package/es/FilePreview.mjs +16 -16
  16. package/es/FileUploader.mjs +71 -74
  17. package/es/Logo.mjs +72 -0
  18. package/es/McpFormDialog.mjs +1 -1
  19. package/es/McpParamsSet.mjs +34 -34
  20. package/es/MdEditor.mjs +2 -2
  21. package/es/PageContainer.mjs +438 -216
  22. package/es/ParameterTable.mjs +23 -21
  23. package/es/PublishRecord.mjs +58 -57
  24. package/es/RadioGroup.mjs +1 -1
  25. package/es/SourcePublish.mjs +95 -93
  26. package/es/Table.mjs +2 -2
  27. package/es/assets/AddOrEditSupplierDialog.css +1 -1
  28. package/es/assets/AiboxTable.css +1 -1
  29. package/es/assets/ApplicationTypeTag.css +1 -1
  30. package/es/assets/AuthSection.css +1 -1
  31. package/es/assets/AutoShowTooltip.css +1 -1
  32. package/es/assets/CommonTagsList.css +1 -1
  33. package/es/assets/CreateMcpForm.css +1 -1
  34. package/es/assets/CustomSidebar.css +1 -1
  35. package/es/assets/CustomToggle.css +1 -1
  36. package/es/assets/DocSyncSelect.css +1 -0
  37. package/es/assets/FilePreview.css +1 -1
  38. package/es/assets/Logo.css +1 -0
  39. package/es/assets/McpParamsSet.css +1 -1
  40. package/es/assets/MdEditor.css +1 -1
  41. package/es/assets/PageContainer.css +1 -1
  42. package/es/assets/ParameterTable.css +1 -1
  43. package/es/assets/PublishRecord.css +1 -1
  44. package/es/assets/RadioGroup.css +1 -1
  45. package/es/assets/SourcePublish.css +1 -1
  46. package/es/assets/index.css +1 -1
  47. package/es/assets/index2.css +1 -1
  48. package/es/assets/index3.css +1 -1
  49. package/es/assets/index4.css +1 -1
  50. package/es/assets/layout.css +1 -1
  51. package/es/chunks/{BackBar.B5Er8ZdJ.js → AiboxTable.CF4T_OCu.js} +122 -122
  52. package/es/chunks/enums.WrpwbF4w.js +14 -0
  53. package/es/chunks/index.BDd6hHiU.js +172 -0
  54. package/es/chunks/{index.CLyfh6p1.js → index.CF_YHLP5.js} +16 -16
  55. package/es/chunks/index.DdD1VsH1.js +396 -0
  56. package/es/chunks/index.Dx-mCS4E.js +1298 -0
  57. package/es/chunks/layout.CygCXa6s.js +26 -0
  58. package/es/chunks/{usePreview.C36fNlVd.js → usePreview.BHvXwaNi.js} +82 -78
  59. package/es/index.mjs +409 -325
  60. package/index.css +1 -1
  61. package/lib/AddOrEditSupplierDialog.js +1 -1
  62. package/lib/ApplicationTypeTag.js +1 -1
  63. package/lib/AuthSection.js +1 -1
  64. package/lib/AutoShowTooltip.js +1 -1
  65. package/lib/AvailableRangePreview.js +1 -1
  66. package/lib/AvailableRangeSetting.js +1 -1
  67. package/lib/CodeView.js +1 -1
  68. package/lib/CommonTagsList.js +1 -1
  69. package/lib/CreateMcpForm.js +1 -1
  70. package/lib/CustomSidebar.js +1 -1
  71. package/lib/CustomTitle.js +1 -1
  72. package/lib/CustomToggle.js +1 -1
  73. package/lib/DocSyncSelect.js +2 -0
  74. package/lib/FileDisplay.js +1 -1
  75. package/lib/FilePreview.js +1 -1
  76. package/lib/FileUploader.js +1 -1
  77. package/lib/Logo.js +1 -0
  78. package/lib/McpFormDialog.js +1 -1
  79. package/lib/McpParamsSet.js +1 -1
  80. package/lib/MdEditor.js +1 -1
  81. package/lib/PageContainer.js +1 -1
  82. package/lib/ParameterTable.js +1 -1
  83. package/lib/PublishRecord.js +2 -2
  84. package/lib/RadioGroup.js +1 -1
  85. package/lib/SourcePublish.js +1 -1
  86. package/lib/Table.js +1 -1
  87. package/lib/assets/AddOrEditSupplierDialog.css +1 -1
  88. package/lib/assets/AiboxTable.css +1 -1
  89. package/lib/assets/ApplicationTypeTag.css +1 -1
  90. package/lib/assets/AuthSection.css +1 -1
  91. package/lib/assets/AutoShowTooltip.css +1 -1
  92. package/lib/assets/CommonTagsList.css +1 -1
  93. package/lib/assets/CreateMcpForm.css +1 -1
  94. package/lib/assets/CustomSidebar.css +1 -1
  95. package/lib/assets/CustomToggle.css +1 -1
  96. package/lib/assets/DocSyncSelect.css +1 -0
  97. package/lib/assets/FilePreview.css +1 -1
  98. package/lib/assets/Logo.css +1 -0
  99. package/lib/assets/McpParamsSet.css +1 -1
  100. package/lib/assets/MdEditor.css +1 -1
  101. package/lib/assets/PageContainer.css +1 -1
  102. package/lib/assets/ParameterTable.css +1 -1
  103. package/lib/assets/PublishRecord.css +1 -1
  104. package/lib/assets/RadioGroup.css +1 -1
  105. package/lib/assets/SourcePublish.css +1 -1
  106. package/lib/assets/index.css +1 -1
  107. package/lib/assets/index2.css +1 -1
  108. package/lib/assets/index3.css +1 -1
  109. package/lib/assets/index4.css +1 -1
  110. package/lib/assets/layout.css +1 -1
  111. package/lib/chunks/AiboxTable.CJOPGJtU.js +1 -0
  112. package/lib/chunks/enums.DpU2er5r.js +1 -0
  113. package/lib/chunks/index.BNivYbtq.js +1 -0
  114. package/lib/chunks/{index.DME62Yfo.js → index.B_keI1Aq.js} +1 -1
  115. package/lib/chunks/index.C7aZx6RG.js +6 -0
  116. package/lib/chunks/index.CJFk1R2u.js +59 -0
  117. package/lib/chunks/layout.DbBSbLgm.js +1 -0
  118. package/lib/chunks/usePreview.BojIDW7Z.js +1 -0
  119. package/lib/index.js +2 -1
  120. package/package.json +2 -2
  121. package/es/ExampleComponent.mjs +0 -35
  122. package/es/assets/BackBar.css +0 -1
  123. package/es/assets/ExampleComponent.css +0 -1
  124. package/es/chunks/BackBar.Bc2NIuzk.js +0 -645
  125. package/es/chunks/BackBar.Cv1wxUcM.js +0 -645
  126. package/es/chunks/BackBar.DJV4JaUM.js +0 -645
  127. package/es/chunks/config.8htFF04x.js +0 -325
  128. package/es/chunks/config.BPp4hMBq.js +0 -325
  129. package/es/chunks/config.BU21Gda2.js +0 -49
  130. package/es/chunks/config.BzCGum_W.js +0 -49
  131. package/es/chunks/config.CFWGjEdA.js +0 -49
  132. package/es/chunks/config.CfWAdyUH.js +0 -325
  133. package/es/chunks/config.DTMcCH58.js +0 -325
  134. package/es/chunks/config.DqhQdkz7.js +0 -325
  135. package/es/chunks/enums.CfSBDD6u.js +0 -83
  136. package/es/chunks/enums.DuBbLcd-.js +0 -83
  137. package/es/chunks/i18n.DmqkiK-h.js +0 -444
  138. package/es/chunks/i18n.Vhq-tZPw.js +0 -94
  139. package/es/chunks/i18n.ro9yz7rE.js +0 -94
  140. package/es/chunks/index.BSA3IKSF.js +0 -111
  141. package/es/chunks/index.CgbxJCEU.js +0 -265
  142. package/es/chunks/index.CuDwuRO7.js +0 -265
  143. package/es/chunks/index.DB0ayMv8.js +0 -257
  144. package/es/chunks/index.DWR4lc30.js +0 -203
  145. package/es/chunks/index.GuEzdh6b.js +0 -257
  146. package/es/chunks/index.aMb6IVQD.js +0 -257
  147. package/es/chunks/index.ml5i7aB5.js +0 -257
  148. package/es/chunks/index.s-YxIOfq.js +0 -301
  149. package/es/chunks/index.uOZzvHrF.js +0 -135
  150. package/es/chunks/publish.BCb7nCo9.js +0 -50
  151. package/es/chunks/publish.D6friivo.js +0 -50
  152. package/es/chunks/publish.Dqzn7qEl.js +0 -50
  153. package/es/i18n.mjs +0 -17
  154. package/lib/ExampleComponent.js +0 -1
  155. package/lib/assets/BackBar.css +0 -1
  156. package/lib/assets/ExampleComponent.css +0 -1
  157. package/lib/chunks/BackBar.C8Xrc6qW.js +0 -1
  158. package/lib/chunks/BackBar.CZsNxoX1.js +0 -1
  159. package/lib/chunks/BackBar.s5_vN6jt.js +0 -1
  160. package/lib/chunks/config.B0XKkp1w.js +0 -1
  161. package/lib/chunks/config.BCAuBVxV.js +0 -1
  162. package/lib/chunks/config.Bs7sh3aP.js +0 -1
  163. package/lib/chunks/config.C1w4hgfw.js +0 -1
  164. package/lib/chunks/config.ClERt2RF.js +0 -1
  165. package/lib/chunks/enums.Dmq4PdUc.js +0 -1
  166. package/lib/chunks/i18n.CL5L6nx6.js +0 -1
  167. package/lib/chunks/i18n.aAXi5igh.js +0 -1
  168. package/lib/chunks/index.BNqTEn3K.js +0 -1
  169. package/lib/chunks/index.BZcSlgOO.js +0 -1
  170. package/lib/chunks/index.Bk-RwmaH.js +0 -1
  171. package/lib/chunks/index.BsN4urmi.js +0 -1
  172. package/lib/chunks/index.D7wBInWr.js +0 -1
  173. package/lib/chunks/index.DWohILMv.js +0 -1
  174. package/lib/chunks/index.LK2ulXTE.js +0 -1
  175. package/lib/chunks/index.qDAoOzk9.js +0 -1
  176. package/lib/chunks/index.s8vGOJKG.js +0 -1
  177. package/lib/chunks/publish.Bw1acrSu.js +0 -1
  178. package/lib/chunks/publish.CA1uSVnm.js +0 -1
  179. package/lib/chunks/usePreview.E5SeS2uw.js +0 -1
  180. package/lib/i18n.js +0 -1
  181. /package/es/assets/{index6.css → legacy.css} +0 -0
  182. /package/lib/assets/{index6.css → legacy.css} +0 -0
@@ -0,0 +1,2661 @@
1
+ import { w as Ve } from "./chunks/index.bCzIhWFw.js";
2
+ import { createBlock as U, createCommentVNode as G, unref as $, openBlock as T, withCtx as W, createElementBlock as P, Fragment as de, ref as B, computed as K, createElementVNode as j, createVNode as H, renderList as je, normalizeClass as ue, toDisplayString as te, withModifiers as et, useAttrs as tt, watch as Z, nextTick as ie, onMounted as Ie, mergeProps as De, renderSlot as J, h as me, pushScopeId as it, popScopeId as st, withScopeId as lt, markRaw as nt, shallowReactive as rt, resolveComponent as we, resolveDirective as ot, withDirectives as at, resolveDynamicComponent as Ae, normalizeStyle as He, toHandlers as ct, normalizeProps as dt, guardReactiveProps as ut, onUnmounted as ht } from "vue";
3
+ import { ElIcon as ve, ElAutoResizer as ft, ElTreeV2 as pt, ElCheckbox as mt, ElInput as vt, ElSegmented as yt } from "element-plus";
4
+ import { FeishuLocalUploadXlsx as gt, FeishuLocalUploadDoc as bt, FeishuLocalUploadPdf as St, FeishuLocalUploadPpt as Tt, FeishuLocalUploadTxt as _t, FeishuLocalUploadImg as zt, IconFeishuExcel as kt, IconFeishuMulitTable as $t, IconFeishuDoc as It, IconFeishuKnowledge as Dt, IconDelete as wt, CaretRight as xt, Empty as Ct, Seach as Nt } from "color-message-aibox-vue";
5
+ import { IconEmpty as xe } from "color-star-custom-components";
6
+ import { _ as ae } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
7
+ import Lt from "mitt";
8
+ import { u as Ot } from "./chunks/i18n.k9Q_HVMs.js";
9
+ import './assets/DocSyncSelect.css';const ne = {
10
+ label: "name",
11
+ children: "children",
12
+ value: "id"
13
+ }, oe = {
14
+ FRONTEND: "frontend",
15
+ BACKEND: "backend"
16
+ }, Ue = [
17
+ "sheet",
18
+ "bitable",
19
+ "doc",
20
+ "docx",
21
+ "wiki",
22
+ "pdf",
23
+ "pptx",
24
+ "ppt",
25
+ "xlsx",
26
+ "xls",
27
+ "txt",
28
+ "png",
29
+ "jpg",
30
+ "jpeg"
31
+ ], At = 34, le = {
32
+ MY_FILES: "myFiles",
33
+ FEISHU_KNOWLEDGE: "feishuKnowledge"
34
+ }, ye = /* @__PURE__ */ Object.assign({
35
+ name: "FileTypeIcon"
36
+ }, {
37
+ __name: "FileTypeIcon",
38
+ props: {
39
+ // 文件类型
40
+ fileType: {
41
+ type: String,
42
+ required: !1,
43
+ default: ""
44
+ },
45
+ //本地上传类型
46
+ isLocalFileType: {
47
+ type: Boolean,
48
+ required: !1,
49
+ default: !1
50
+ },
51
+ // 图标大小
52
+ size: {
53
+ type: Number,
54
+ default: 32
55
+ }
56
+ },
57
+ setup(e) {
58
+ return (i, t) => e.fileType && $(Ue).includes(e.fileType) ? (T(), U($(ve), {
59
+ key: 0,
60
+ size: e.size
61
+ }, {
62
+ default: W(() => [
63
+ e.isLocalFileType ? (T(), P(de, { key: 0 }, [
64
+ ["xlsx", "xls"].includes(e.fileType) ? (T(), U($(gt), { key: 0 })) : ["doc", "docx"].includes(e.fileType) ? (T(), U($(bt), { key: 1 })) : ["pdf"].includes(e.fileType) ? (T(), U($(St), { key: 2 })) : ["pptx", "ppt"].includes(e.fileType) ? (T(), U($(Tt), { key: 3 })) : ["txt"].includes(e.fileType) ? (T(), U($(_t), { key: 4 })) : ["png", "jpg", "jpeg"].includes(e.fileType) ? (T(), U($(zt), { key: 5 })) : G("", !0)
65
+ ], 64)) : (T(), P(de, { key: 1 }, [
66
+ ["sheet"].includes(e.fileType) ? (T(), U($(kt), { key: 0 })) : ["bitable"].includes(e.fileType) ? (T(), U($($t), { key: 1 })) : ["doc", "docx"].includes(e.fileType) ? (T(), U($(It), { key: 2 })) : ["wiki"].includes(e.fileType) ? (T(), U($(Dt), { key: 3 })) : G("", !0)
67
+ ], 64))
68
+ ]),
69
+ _: 1
70
+ }, 8, ["size"])) : G("", !0);
71
+ }
72
+ }), Et = { class: "right-wrap" }, Mt = { class: "content" }, Rt = {
73
+ key: 0,
74
+ class: "empty-state"
75
+ }, Pt = {
76
+ key: 1,
77
+ class: "selected-list"
78
+ }, Ft = ["onClick"], Vt = { class: "item-content" }, jt = { class: "item-main" }, Ht = { class: "doc-icon" }, Ut = { class: "doc-info" }, Bt = { class: "doc-name" }, Kt = {
79
+ key: 0,
80
+ class: "doc-suffix"
81
+ }, Wt = ["onClick"], qt = /* @__PURE__ */ Object.assign({
82
+ name: "RightLayout"
83
+ }, {
84
+ __name: "RightLayout",
85
+ props: {
86
+ // 已选择的文档列表
87
+ selectedDocuments: {
88
+ type: Array,
89
+ default: () => []
90
+ },
91
+ // 树配置
92
+ treeProps: {
93
+ type: Object,
94
+ default: () => ne
95
+ }
96
+ },
97
+ emits: ["delete-node"],
98
+ setup(e, { emit: i }) {
99
+ const t = e, s = i, l = B(-1), r = K(() => t.selectedDocuments.filter((n) => Ue.includes(n.type))), a = (n) => {
100
+ l.value = l.value === n ? -1 : n;
101
+ }, o = (n) => {
102
+ s("delete-node", n), l.value = -1;
103
+ };
104
+ return (n, c) => (T(), P("div", Et, [
105
+ j("div", Mt, [
106
+ r.value.length === 0 ? (T(), P("div", Rt, [
107
+ H($(xe))
108
+ ])) : (T(), P("div", Pt, [
109
+ (T(!0), P(de, null, je(r.value, (d, p) => (T(), P("div", {
110
+ key: d[e.treeProps.value],
111
+ class: ue(["selected-item", { "is-selected": l.value === p }]),
112
+ onClick: (I) => a(p)
113
+ }, [
114
+ j("div", Vt, [
115
+ j("div", jt, [
116
+ j("div", Ht, [
117
+ H(ye, {
118
+ "file-type": d.type,
119
+ size: 26,
120
+ isLocalFileType: d?.isLocalFileType
121
+ }, null, 8, ["file-type", "isLocalFileType"])
122
+ ]),
123
+ j("div", Ut, [
124
+ j("div", Bt, te(d[e.treeProps.label]), 1),
125
+ d.suffix ? (T(), P("div", Kt, te(d.suffix), 1)) : G("", !0)
126
+ ])
127
+ ]),
128
+ j("div", {
129
+ class: "flex items-center",
130
+ onClick: et((I) => o(d), ["stop"])
131
+ }, [
132
+ H($(ve), {
133
+ size: 14,
134
+ color: "var(--neutral-color-5)"
135
+ }, {
136
+ default: W(() => [
137
+ H($(wt))
138
+ ]),
139
+ _: 1
140
+ })
141
+ ], 8, Wt)
142
+ ])
143
+ ], 10, Ft))), 128))
144
+ ]))
145
+ ])
146
+ ]));
147
+ }
148
+ }), Yt = /* @__PURE__ */ ae(qt, [["__scopeId", "data-v-6736cdb6"]]);
149
+ function Xt(e) {
150
+ return {
151
+ name: "element-tree-line",
152
+ props: {
153
+ node: {
154
+ type: Object,
155
+ required: !0
156
+ },
157
+ data: {
158
+ type: Object
159
+ },
160
+ treeData: {
161
+ type: Array
162
+ },
163
+ indent: {
164
+ type: Number,
165
+ default() {
166
+ return 16;
167
+ }
168
+ },
169
+ showLabelLine: {
170
+ type: Boolean,
171
+ default: !0
172
+ }
173
+ },
174
+ render(i) {
175
+ const t = e || i, s = this.getScopedSlot("default"), l = this.getScopedSlot("node-label"), r = this.getScopedSlot("after-node-label"), a = s ? this.getScopedSlotValue(s, {
176
+ node: this.node,
177
+ data: this.data
178
+ }) : [
179
+ l ? this.getScopedSlotValue(l, {
180
+ node: this.node,
181
+ data: this.data
182
+ }) : t(
183
+ "span",
184
+ { class: "element-tree-node-label" },
185
+ this.node.label
186
+ ),
187
+ this.showLabelLine ? t("span", {
188
+ class: "element-tree-node-label-line"
189
+ }) : null,
190
+ this.getScopedSlotValue(r, {
191
+ node: this.node,
192
+ data: this.data
193
+ })
194
+ ], o = [];
195
+ let n = this.node;
196
+ for (; n; ) {
197
+ let d = n.parent;
198
+ if (n.level === 1 && !n.parent) {
199
+ if (!this.treeData || !Array.isArray(this.treeData))
200
+ throw Error(
201
+ "if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data."
202
+ );
203
+ d = {
204
+ children: Array.isArray(this.treeData) ? this.treeData.map((p) => ({ ...p, key: p.id })) : [],
205
+ level: 0,
206
+ key: "node-0",
207
+ parent: null
208
+ };
209
+ }
210
+ if (d) {
211
+ const p = (d.children || d.childNodes).findIndex(
212
+ (I) => (I.key || I.id) === (n.key || n.id)
213
+ );
214
+ o.unshift(
215
+ p === (d.children || d.childNodes).length - 1
216
+ );
217
+ }
218
+ n = d;
219
+ }
220
+ const c = [];
221
+ for (let d = 0; d < this.node.level; d++)
222
+ o[d] && this.node.level - 1 !== d || c.push(
223
+ t("span", {
224
+ class: {
225
+ "element-tree-node-line-ver": !0,
226
+ "last-node-isLeaf-line": o[d] && this.node.level - 1 === d
227
+ },
228
+ style: { left: this.indent * d + "px" }
229
+ })
230
+ );
231
+ return t(
232
+ "span",
233
+ {
234
+ class: "element-tree-node-label-wrapper"
235
+ },
236
+ [a].concat(c).concat([
237
+ t("span", {
238
+ class: "element-tree-node-line-hor",
239
+ style: {
240
+ width: (this.node.isLeaf ? 24 : 8) + "px",
241
+ left: (this.node.level - 1) * this.indent + "px"
242
+ }
243
+ })
244
+ ])
245
+ );
246
+ },
247
+ methods: {
248
+ getScopedSlot(i) {
249
+ if (!i)
250
+ return null;
251
+ const t = i.split("||");
252
+ let s = null;
253
+ for (let l = 0; l < t.length; l++) {
254
+ const r = t[l], a = (this.$slots || {})[r];
255
+ if (a) {
256
+ s = a;
257
+ break;
258
+ }
259
+ if (s = (this.$scopedSlots || {})[r], s)
260
+ break;
261
+ }
262
+ return s;
263
+ },
264
+ getScopedSlotValue(i, t, s = null) {
265
+ return typeof i == "function" ? i(t) || s : i || s;
266
+ }
267
+ }
268
+ };
269
+ }
270
+ function Ce(e) {
271
+ const i = Xt(e);
272
+ return e && (i.methods.getScopedSlot = function(s) {
273
+ if (!s)
274
+ return null;
275
+ const l = s.split("||");
276
+ let r = null;
277
+ for (let a = 0; a < l.length; a++) {
278
+ const o = l[a], n = (this.$slots || {})[o];
279
+ if (n) {
280
+ r = n;
281
+ break;
282
+ }
283
+ }
284
+ return r;
285
+ }), i;
286
+ }
287
+ Ce();
288
+ var he = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
289
+ function Gt(e) {
290
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
291
+ }
292
+ var be, Ee;
293
+ function Zt() {
294
+ if (Ee) return be;
295
+ Ee = 1;
296
+ var e = "Expected a function", i = NaN, t = "[object Symbol]", s = /^\s+|\s+$/g, l = /^[-+]0x[0-9a-f]+$/i, r = /^0b[01]+$/i, a = /^0o[0-7]+$/i, o = parseInt, n = typeof he == "object" && he && he.Object === Object && he, c = typeof self == "object" && self && self.Object === Object && self, d = n || c || Function("return this")(), p = Object.prototype, I = p.toString, m = Math.max, _ = Math.min, h = function() {
297
+ return d.Date.now();
298
+ };
299
+ function v(g, M, f) {
300
+ var D, C, y, O, x, E, q = 0, ee = !1, F = !1, Q = !0;
301
+ if (typeof g != "function")
302
+ throw new TypeError(e);
303
+ M = S(M) || 0, A(f) && (ee = !!f.leading, F = "maxWait" in f, y = F ? m(S(f.maxWait) || 0, M) : y, Q = "trailing" in f ? !!f.trailing : Q);
304
+ function z(V) {
305
+ var X = D, ce = C;
306
+ return D = C = void 0, q = V, O = g.apply(ce, X), O;
307
+ }
308
+ function u(V) {
309
+ return q = V, x = setTimeout(L, M), ee ? z(V) : O;
310
+ }
311
+ function b(V) {
312
+ var X = V - E, ce = V - q, Oe = M - X;
313
+ return F ? _(Oe, y - ce) : Oe;
314
+ }
315
+ function k(V) {
316
+ var X = V - E, ce = V - q;
317
+ return E === void 0 || X >= M || X < 0 || F && ce >= y;
318
+ }
319
+ function L() {
320
+ var V = h();
321
+ if (k(V))
322
+ return R(V);
323
+ x = setTimeout(L, b(V));
324
+ }
325
+ function R(V) {
326
+ return x = void 0, Q && D ? z(V) : (D = C = void 0, O);
327
+ }
328
+ function Y() {
329
+ x !== void 0 && clearTimeout(x), q = 0, D = E = C = x = void 0;
330
+ }
331
+ function re() {
332
+ return x === void 0 ? O : R(h());
333
+ }
334
+ function se() {
335
+ var V = h(), X = k(V);
336
+ if (D = arguments, C = this, E = V, X) {
337
+ if (x === void 0)
338
+ return u(E);
339
+ if (F)
340
+ return x = setTimeout(L, M), z(E);
341
+ }
342
+ return x === void 0 && (x = setTimeout(L, M)), O;
343
+ }
344
+ return se.cancel = Y, se.flush = re, se;
345
+ }
346
+ function A(g) {
347
+ var M = typeof g;
348
+ return !!g && (M == "object" || M == "function");
349
+ }
350
+ function w(g) {
351
+ return !!g && typeof g == "object";
352
+ }
353
+ function N(g) {
354
+ return typeof g == "symbol" || w(g) && I.call(g) == t;
355
+ }
356
+ function S(g) {
357
+ if (typeof g == "number")
358
+ return g;
359
+ if (N(g))
360
+ return i;
361
+ if (A(g)) {
362
+ var M = typeof g.valueOf == "function" ? g.valueOf() : g;
363
+ g = A(M) ? M + "" : M;
364
+ }
365
+ if (typeof g != "string")
366
+ return g === 0 ? g : +g;
367
+ g = g.replace(s, "");
368
+ var f = r.test(g);
369
+ return f || a.test(g) ? o(g.slice(2), f ? 2 : 8) : l.test(g) ? i : +g;
370
+ }
371
+ return be = v, be;
372
+ }
373
+ var Jt = Zt();
374
+ const Qt = /* @__PURE__ */ Gt(Jt), Be = (e) => e && Array.isArray(e) && e.length === 1 && e[0] && typeof e[0] == "object" && e[0].falseChild === !0, ei = (e) => !e || !e.children ? !0 : !Be(e.children), ti = (e, i = 800) => Qt((t) => {
375
+ e("search", { keyword: t });
376
+ }, i), Ke = (e, i, t) => !e || !Array.isArray(e) ? [] : e.reduce((s, l) => {
377
+ const r = l[t.label]?.toLowerCase().includes(i.toLowerCase()), a = l.suffix?.toLowerCase().includes(i.toLowerCase());
378
+ if (r || a)
379
+ s.push({ ...l });
380
+ else if (l[t.children]) {
381
+ const o = Ke(l[t.children], i, t);
382
+ o.length > 0 && s.push({
383
+ ...l,
384
+ [t.children]: o
385
+ });
386
+ }
387
+ return s;
388
+ }, []), Te = (e, i) => {
389
+ let t = [];
390
+ if (!e) return t;
391
+ const s = e[i.children];
392
+ if (s && Array.isArray(s))
393
+ for (const l of s)
394
+ t.push(l), t = t.concat(Te(l, i));
395
+ return t;
396
+ }, ii = (e, i, t = !1) => {
397
+ let s = 0;
398
+ function l(r) {
399
+ for (const a of r) {
400
+ const o = a[i.children] && a[i.children].length > 0;
401
+ t ? s++ : o || s++, o && l(a[i.children]);
402
+ }
403
+ }
404
+ return l(e), s;
405
+ }, si = (e, i, t) => {
406
+ const s = /* @__PURE__ */ new Map();
407
+ function l(r, a = []) {
408
+ for (const o of r) {
409
+ const n = [...a, o];
410
+ o.children && o.children.length > 0 ? l(o.children, n) : i.includes(o[t]) && a.forEach((c) => {
411
+ s.has(c[t]) || s.set(c[t], { ...c });
412
+ });
413
+ }
414
+ }
415
+ return l(e), Array.from(s.values());
416
+ }, li = (e, i) => {
417
+ const t = i?.value || "id", s = i?.children || "children", l = /* @__PURE__ */ new Set(), r = (a) => {
418
+ if (Array.isArray(a))
419
+ for (const o of a) {
420
+ o && o[t] != null && l.add(o[t]);
421
+ const n = o?.[s];
422
+ n && Array.isArray(n) && n.length > 0 && r(n);
423
+ }
424
+ };
425
+ return r(e), l;
426
+ }, Me = ({
427
+ tabKey: e,
428
+ currentSelectedDocs: i,
429
+ hasSelectToRightDocList: t,
430
+ treeData: s,
431
+ treeProps: l
432
+ }) => {
433
+ const r = Array.isArray(t) ? t : [], a = l?.value, o = (s && Array.isArray(s[e]) ? s[e] : []) || [], n = li(o, l), c = r.filter((d) => !n.has(d?.[a]));
434
+ return [...i, ...c];
435
+ }, ni = (e, i, t) => {
436
+ if (!Array.isArray(e) || i == null)
437
+ return null;
438
+ const s = t?.value || "id", l = t?.children || "children", r = (a) => {
439
+ for (const o of a) {
440
+ if (o && o[s] === i)
441
+ return o;
442
+ const n = o?.[l];
443
+ if (Array.isArray(n) && n.length > 0) {
444
+ const c = r(n);
445
+ if (c)
446
+ return c;
447
+ }
448
+ }
449
+ return null;
450
+ };
451
+ return r(e);
452
+ }, We = (e, i) => {
453
+ if (!e) return !1;
454
+ const t = i?.children || "children";
455
+ if (Be(e[t]))
456
+ return !0;
457
+ const s = e[t];
458
+ if (s && Array.isArray(s)) {
459
+ for (const l of s)
460
+ if (We(l, i))
461
+ return !0;
462
+ }
463
+ return !1;
464
+ }, Re = (e, i) => e === le.MY_FILES ? i?.myFilesHasMore || !1 : e === le.FEISHU_KNOWLEDGE && i?.feishuKnowledgeHasMore || !1, ri = { class: "w-full h-full flex flex-col overflow-hidden" }, oi = /* @__PURE__ */ Object.assign({
465
+ name: "TreeSelectLayout"
466
+ }, {
467
+ __name: "TreeSelectLayout",
468
+ props: {
469
+ // 初始值
470
+ modelValue: {
471
+ type: Object,
472
+ default: () => []
473
+ },
474
+ // 树形节点对象结构
475
+ treeProps: {
476
+ type: Object,
477
+ default: () => ne
478
+ },
479
+ // 接口配置
480
+ apiConfig: {
481
+ type: Function
482
+ },
483
+ // 懒加载函数
484
+ loadNode: {
485
+ type: Function
486
+ },
487
+ // 请求参数
488
+ reqParams: {
489
+ type: Object,
490
+ default: () => ({})
491
+ },
492
+ // 是否在组件挂载时自动加载数据
493
+ autoLoad: {
494
+ type: Boolean,
495
+ default: !0
496
+ },
497
+ // 是否多选
498
+ isMultiple: {
499
+ type: Boolean,
500
+ default: !0
501
+ },
502
+ // 是否有过滤
503
+ hasFilter: {
504
+ type: Boolean,
505
+ default: !1
506
+ },
507
+ treeList: {
508
+ type: Array,
509
+ default: () => []
510
+ },
511
+ // 是否有线条样式
512
+ hasTreeLine: {
513
+ type: Boolean,
514
+ default: !0
515
+ },
516
+ // 选中的节点是否包含父节点
517
+ includeParentSelected: {
518
+ type: Boolean,
519
+ default: !1
520
+ },
521
+ // 文本配置
522
+ textConfig: {
523
+ type: Object,
524
+ default: () => ({
525
+ searchPlaceholder: ""
526
+ })
527
+ },
528
+ getTabSelectedDocuments: {
529
+ type: Function,
530
+ default: () => () => []
531
+ }
532
+ },
533
+ emits: ["handleCheck", "initFinish", "node-expand"],
534
+ setup(e, { expose: i, emit: t }) {
535
+ const s = Ce(me), l = e, r = t, a = tt(), o = () => me(xt, {
536
+ style: { color: "var(--text-color-2)", fontSize: "16px" }
537
+ }), n = l.isMultiple ? 20 : 10, c = l.isMultiple ? 15 : 11, d = B([]), p = B(null), I = B(null), m = K(() => l.treeProps.value), _ = K(() => l.treeProps.label), h = K(() => l.treeProps.children), v = B(!1), A = K(() => !l.isMultiple && v.value), w = K(() => typeof l.apiConfig == "function"), N = () => {
538
+ let z = p.value?.getCheckedNodes(), u = z.map((k) => k[m.value]), b = [];
539
+ return l.includeParentSelected && (b = si(
540
+ d.value,
541
+ u,
542
+ m.value
543
+ )), {
544
+ selectedNodeValues: u,
545
+ // 选中节点的值的集合
546
+ selectedNodes: z,
547
+ // 选中节点的集合
548
+ selectedParentNodes: b
549
+ // 选中节点的所有父节点
550
+ };
551
+ }, S = (z, u) => {
552
+ C(z, u);
553
+ }, g = (z) => {
554
+ r("node-expand", z);
555
+ }, M = (z, u) => {
556
+ l.isMultiple || (v.value = !0, I.value = u.key, r("handleCheck", {
557
+ selectedValue: [I.value],
558
+ // 选中节点的值
559
+ selectedNode: [u.data]
560
+ // // 选中节点
561
+ }));
562
+ };
563
+ B("");
564
+ const f = (z, u) => u[_.value].includes(z), D = K(() => ii(
565
+ d.value,
566
+ l.treeProps,
567
+ l.includeParentSelected
568
+ ));
569
+ function C(z = null, u = null) {
570
+ const { selectedNodeValues: b, selectedNodes: k, selectedParentNodes: L } = N();
571
+ let R = null;
572
+ if (z && u) {
573
+ const Y = z[m.value];
574
+ R = u.checkedKeys.includes(Y);
575
+ }
576
+ r("handleCheck", {
577
+ selectedValue: b,
578
+ // 选中节点的值的集合
579
+ selectedNode: k,
580
+ // 选中节点的集合
581
+ selectedParentNodes: L,
582
+ checkedNode: z,
583
+ // 当前勾选的节点
584
+ isChecked: R
585
+ // 是否勾选
586
+ });
587
+ }
588
+ const y = (z, u) => {
589
+ p.value?.setChecked(z, u), C();
590
+ }, O = () => {
591
+ a["default-checked-keys"] && ie(() => {
592
+ C();
593
+ });
594
+ }, x = (z) => {
595
+ p.value && (!z || z.length === 0 ? p.value?.setCheckedKeys([]) : p.value?.setCheckedKeys(z));
596
+ }, E = (z, u) => {
597
+ const b = (k) => {
598
+ for (let L = 0; L < k.length; L++) {
599
+ const R = k[L];
600
+ if (R[m.value] === z) {
601
+ const Y = q(u);
602
+ return R[h.value] = Y, R.isLeaf = !u || u.length === 0, console.log("节点更新后:", {
603
+ nodeKey: z,
604
+ childrenLength: Y.length,
605
+ isLeaf: R.isLeaf
606
+ }), d.value = [...d.value], !0;
607
+ }
608
+ if (R[h.value] && R[h.value].length > 0 && b(R[h.value]))
609
+ return !0;
610
+ }
611
+ return !1;
612
+ };
613
+ b(d.value);
614
+ }, q = (z) => z?.map((u) => ({
615
+ ...u,
616
+ [h.value]: u[h.value]?.length ? q(u[h.value]) : void 0
617
+ })), ee = async () => {
618
+ w.value ? l.apiConfig(l.reqParams)?.then((z) => {
619
+ d.value = q(
620
+ z?.data?.orgOptionSoList || z?.data || []
621
+ ), O(), Q(l.modelValue), r("initFinish", d.value);
622
+ }) : F();
623
+ }, F = () => {
624
+ d.value = q(l.treeList || []), d.value.length && (O(), Q(l.modelValue));
625
+ }, Q = (z) => {
626
+ const u = z && z.length && z.map((b) => b[l.treeProps.value]);
627
+ ie(() => {
628
+ p.value?.setCheckedKeys(u);
629
+ });
630
+ };
631
+ return Z(
632
+ () => l.treeList,
633
+ () => {
634
+ F();
635
+ },
636
+ { deep: !0 }
637
+ ), Z(
638
+ () => l.modelValue,
639
+ (z) => {
640
+ ie(() => {
641
+ Q(z);
642
+ });
643
+ },
644
+ { deep: !0 }
645
+ ), Ie(() => {
646
+ ee();
647
+ }), i({
648
+ allNodeNumbers: D,
649
+ loadData: ee,
650
+ setNodeCheckStatus: y,
651
+ updateNodeChildren: E,
652
+ syncSelectedNodes: x
653
+ // 新增
654
+ }), (z, u) => (T(), P("div", ri, [
655
+ j("div", {
656
+ class: ue([e.hasFilter ? "pd-l-8 pd-r-8" : "", "flex-1 overflow-hidden"])
657
+ }, [
658
+ H($(ft), null, {
659
+ default: W(({ width: b, height: k }) => [
660
+ H($(pt), De({
661
+ ref_key: "treeRef",
662
+ ref: p,
663
+ height: k,
664
+ width: b,
665
+ "check-strictly": !0,
666
+ data: d.value,
667
+ props: e.treeProps,
668
+ "node-key": m.value,
669
+ "show-checkbox": !0,
670
+ "item-size": $(At),
671
+ indent: $(n),
672
+ "highlight-current": A.value,
673
+ icon: o,
674
+ "filter-method": f,
675
+ lazy: "",
676
+ load: e.loadNode
677
+ }, $(a), {
678
+ onNodeClick: M,
679
+ onCheck: S,
680
+ onNodeExpand: g,
681
+ class: ["hide-false-child-checkbox"]
682
+ }), {
683
+ default: W(({ node: L }) => [
684
+ j("div", {
685
+ class: ue(["tree-node-content", { "false-child-node": L.data?.falseChild }])
686
+ }, [
687
+ J(z.$slots, "node", {
688
+ node: L,
689
+ data: L.data
690
+ }, () => [
691
+ e.hasTreeLine ? (T(), U($(s), {
692
+ key: 0,
693
+ node: L,
694
+ treeData: d.value,
695
+ showLabelLine: !1,
696
+ indent: $(c)
697
+ }, null, 8, ["node", "treeData", "indent"])) : G("", !0),
698
+ j("span", null, te(L.data[_.value]), 1)
699
+ ], !0)
700
+ ], 2)
701
+ ]),
702
+ empty: W(() => [
703
+ H($(xe))
704
+ ]),
705
+ _: 3
706
+ }, 16, ["height", "width", "data", "props", "node-key", "item-size", "indent", "highlight-current", "load"])
707
+ ]),
708
+ _: 3
709
+ })
710
+ ], 2)
711
+ ]));
712
+ }
713
+ }), ai = /* @__PURE__ */ ae(oi, [["__scopeId", "data-v-258f00ca"]]);
714
+ function ci() {
715
+ var e = window.navigator.userAgent, i = e.indexOf("MSIE ");
716
+ if (i > 0)
717
+ return parseInt(e.substring(i + 5, e.indexOf(".", i)), 10);
718
+ var t = e.indexOf("Trident/");
719
+ if (t > 0) {
720
+ var s = e.indexOf("rv:");
721
+ return parseInt(e.substring(s + 3, e.indexOf(".", s)), 10);
722
+ }
723
+ var l = e.indexOf("Edge/");
724
+ return l > 0 ? parseInt(e.substring(l + 5, e.indexOf(".", l)), 10) : -1;
725
+ }
726
+ let fe;
727
+ function _e() {
728
+ _e.init || (_e.init = !0, fe = ci() !== -1);
729
+ }
730
+ var ge = {
731
+ name: "ResizeObserver",
732
+ props: {
733
+ emitOnMount: {
734
+ type: Boolean,
735
+ default: !1
736
+ },
737
+ ignoreWidth: {
738
+ type: Boolean,
739
+ default: !1
740
+ },
741
+ ignoreHeight: {
742
+ type: Boolean,
743
+ default: !1
744
+ }
745
+ },
746
+ emits: [
747
+ "notify"
748
+ ],
749
+ mounted() {
750
+ _e(), ie(() => {
751
+ this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitOnMount && this.emitSize();
752
+ });
753
+ const e = document.createElement("object");
754
+ this._resizeObject = e, e.setAttribute("aria-hidden", "true"), e.setAttribute("tabindex", -1), e.onload = this.addResizeHandlers, e.type = "text/html", fe && this.$el.appendChild(e), e.data = "about:blank", fe || this.$el.appendChild(e);
755
+ },
756
+ beforeUnmount() {
757
+ this.removeResizeHandlers();
758
+ },
759
+ methods: {
760
+ compareAndNotify() {
761
+ (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) && (this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitSize());
762
+ },
763
+ emitSize() {
764
+ this.$emit("notify", {
765
+ width: this._w,
766
+ height: this._h
767
+ });
768
+ },
769
+ addResizeHandlers() {
770
+ this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify), this.compareAndNotify();
771
+ },
772
+ removeResizeHandlers() {
773
+ this._resizeObject && this._resizeObject.onload && (!fe && this._resizeObject.contentDocument && this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify), this.$el.removeChild(this._resizeObject), this._resizeObject.onload = null, this._resizeObject = null);
774
+ }
775
+ }
776
+ };
777
+ const di = /* @__PURE__ */ lt("data-v-b329ee4c");
778
+ it("data-v-b329ee4c");
779
+ const ui = {
780
+ class: "resize-observer",
781
+ tabindex: "-1"
782
+ };
783
+ st();
784
+ const hi = /* @__PURE__ */ di((e, i, t, s, l, r) => (T(), U("div", ui)));
785
+ ge.render = hi;
786
+ ge.__scopeId = "data-v-b329ee4c";
787
+ ge.__file = "src/components/ResizeObserver.vue";
788
+ function pe(e) {
789
+ "@babel/helpers - typeof";
790
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? pe = function(i) {
791
+ return typeof i;
792
+ } : pe = function(i) {
793
+ return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
794
+ }, pe(e);
795
+ }
796
+ function fi(e, i) {
797
+ if (!(e instanceof i))
798
+ throw new TypeError("Cannot call a class as a function");
799
+ }
800
+ function pi(e, i) {
801
+ for (var t = 0; t < i.length; t++) {
802
+ var s = i[t];
803
+ s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(e, s.key, s);
804
+ }
805
+ }
806
+ function mi(e, i, t) {
807
+ return i && pi(e.prototype, i), e;
808
+ }
809
+ function Pe(e) {
810
+ return vi(e) || yi(e) || gi(e) || bi();
811
+ }
812
+ function vi(e) {
813
+ if (Array.isArray(e)) return ze(e);
814
+ }
815
+ function yi(e) {
816
+ if (typeof Symbol < "u" && Symbol.iterator in Object(e)) return Array.from(e);
817
+ }
818
+ function gi(e, i) {
819
+ if (e) {
820
+ if (typeof e == "string") return ze(e, i);
821
+ var t = Object.prototype.toString.call(e).slice(8, -1);
822
+ if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set") return Array.from(e);
823
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return ze(e, i);
824
+ }
825
+ }
826
+ function ze(e, i) {
827
+ (i == null || i > e.length) && (i = e.length);
828
+ for (var t = 0, s = new Array(i); t < i; t++) s[t] = e[t];
829
+ return s;
830
+ }
831
+ function bi() {
832
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
833
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
834
+ }
835
+ function Si(e) {
836
+ var i;
837
+ return typeof e == "function" ? i = {
838
+ callback: e
839
+ } : i = e, i;
840
+ }
841
+ function Ti(e, i) {
842
+ var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s, l, r, a = function(n) {
843
+ for (var c = arguments.length, d = new Array(c > 1 ? c - 1 : 0), p = 1; p < c; p++)
844
+ d[p - 1] = arguments[p];
845
+ if (r = d, !(s && n === l)) {
846
+ var I = t.leading;
847
+ typeof I == "function" && (I = I(n, l)), (!s || n !== l) && I && e.apply(void 0, [n].concat(Pe(r))), l = n, clearTimeout(s), s = setTimeout(function() {
848
+ e.apply(void 0, [n].concat(Pe(r))), s = 0;
849
+ }, i);
850
+ }
851
+ };
852
+ return a._clear = function() {
853
+ clearTimeout(s), s = null;
854
+ }, a;
855
+ }
856
+ function qe(e, i) {
857
+ if (e === i) return !0;
858
+ if (pe(e) === "object") {
859
+ for (var t in e)
860
+ if (!qe(e[t], i[t]))
861
+ return !1;
862
+ return !0;
863
+ }
864
+ return !1;
865
+ }
866
+ var _i = /* @__PURE__ */ (function() {
867
+ function e(i, t, s) {
868
+ fi(this, e), this.el = i, this.observer = null, this.frozen = !1, this.createObserver(t, s);
869
+ }
870
+ return mi(e, [{
871
+ key: "createObserver",
872
+ value: function(t, s) {
873
+ var l = this;
874
+ if (this.observer && this.destroyObserver(), !this.frozen) {
875
+ if (this.options = Si(t), this.callback = function(o, n) {
876
+ l.options.callback(o, n), o && l.options.once && (l.frozen = !0, l.destroyObserver());
877
+ }, this.callback && this.options.throttle) {
878
+ var r = this.options.throttleOptions || {}, a = r.leading;
879
+ this.callback = Ti(this.callback, this.options.throttle, {
880
+ leading: function(n) {
881
+ return a === "both" || a === "visible" && n || a === "hidden" && !n;
882
+ }
883
+ });
884
+ }
885
+ this.oldResult = void 0, this.observer = new IntersectionObserver(function(o) {
886
+ var n = o[0];
887
+ if (o.length > 1) {
888
+ var c = o.find(function(p) {
889
+ return p.isIntersecting;
890
+ });
891
+ c && (n = c);
892
+ }
893
+ if (l.callback) {
894
+ var d = n.isIntersecting && n.intersectionRatio >= l.threshold;
895
+ if (d === l.oldResult) return;
896
+ l.oldResult = d, l.callback(d, n);
897
+ }
898
+ }, this.options.intersection), ie(function() {
899
+ l.observer && l.observer.observe(l.el);
900
+ });
901
+ }
902
+ }
903
+ }, {
904
+ key: "destroyObserver",
905
+ value: function() {
906
+ this.observer && (this.observer.disconnect(), this.observer = null), this.callback && this.callback._clear && (this.callback._clear(), this.callback = null);
907
+ }
908
+ }, {
909
+ key: "threshold",
910
+ get: function() {
911
+ return this.options.intersection && typeof this.options.intersection.threshold == "number" ? this.options.intersection.threshold : 0;
912
+ }
913
+ }]), e;
914
+ })();
915
+ function Ye(e, i, t) {
916
+ var s = i.value;
917
+ if (s)
918
+ if (typeof IntersectionObserver > "u")
919
+ console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");
920
+ else {
921
+ var l = new _i(e, s, t);
922
+ e._vue_visibilityState = l;
923
+ }
924
+ }
925
+ function zi(e, i, t) {
926
+ var s = i.value, l = i.oldValue;
927
+ if (!qe(s, l)) {
928
+ var r = e._vue_visibilityState;
929
+ if (!s) {
930
+ Xe(e);
931
+ return;
932
+ }
933
+ r ? r.createObserver(s, t) : Ye(e, {
934
+ value: s
935
+ }, t);
936
+ }
937
+ }
938
+ function Xe(e) {
939
+ var i = e._vue_visibilityState;
940
+ i && (i.destroyObserver(), delete e._vue_visibilityState);
941
+ }
942
+ var ki = {
943
+ beforeMount: Ye,
944
+ updated: zi,
945
+ unmounted: Xe
946
+ }, $i = {
947
+ itemsLimit: 1e3
948
+ }, Ii = /(auto|scroll)/;
949
+ function Ge(e, i) {
950
+ return e.parentNode === null ? i : Ge(e.parentNode, i.concat([e]));
951
+ }
952
+ var Se = function(i, t) {
953
+ return getComputedStyle(i, null).getPropertyValue(t);
954
+ }, Di = function(i) {
955
+ return Se(i, "overflow") + Se(i, "overflow-y") + Se(i, "overflow-x");
956
+ }, wi = function(i) {
957
+ return Ii.test(Di(i));
958
+ };
959
+ function Fe(e) {
960
+ if (e instanceof HTMLElement || e instanceof SVGElement) {
961
+ for (var i = Ge(e.parentNode, []), t = 0; t < i.length; t += 1)
962
+ if (wi(i[t]))
963
+ return i[t];
964
+ return document.scrollingElement || document.documentElement;
965
+ }
966
+ }
967
+ function ke(e) {
968
+ "@babel/helpers - typeof";
969
+ return ke = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
970
+ return typeof i;
971
+ } : function(i) {
972
+ return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
973
+ }, ke(e);
974
+ }
975
+ var Ze = {
976
+ items: {
977
+ type: Array,
978
+ required: !0
979
+ },
980
+ keyField: {
981
+ type: String,
982
+ default: "id"
983
+ },
984
+ direction: {
985
+ type: String,
986
+ default: "vertical",
987
+ validator: function(i) {
988
+ return ["vertical", "horizontal"].includes(i);
989
+ }
990
+ },
991
+ listTag: {
992
+ type: String,
993
+ default: "div"
994
+ },
995
+ itemTag: {
996
+ type: String,
997
+ default: "div"
998
+ }
999
+ };
1000
+ function Je() {
1001
+ return this.items.length && ke(this.items[0]) !== "object";
1002
+ }
1003
+ var $e = !1;
1004
+ if (typeof window < "u") {
1005
+ $e = !1;
1006
+ try {
1007
+ var xi = Object.defineProperty({}, "passive", {
1008
+ get: function() {
1009
+ $e = !0;
1010
+ }
1011
+ });
1012
+ window.addEventListener("test", null, xi);
1013
+ } catch {
1014
+ }
1015
+ }
1016
+ let Ci = 0;
1017
+ var Ne = {
1018
+ name: "RecycleScroller",
1019
+ components: {
1020
+ ResizeObserver: ge
1021
+ },
1022
+ directives: {
1023
+ ObserveVisibility: ki
1024
+ },
1025
+ props: {
1026
+ ...Ze,
1027
+ itemSize: {
1028
+ type: Number,
1029
+ default: null
1030
+ },
1031
+ gridItems: {
1032
+ type: Number,
1033
+ default: void 0
1034
+ },
1035
+ itemSecondarySize: {
1036
+ type: Number,
1037
+ default: void 0
1038
+ },
1039
+ minItemSize: {
1040
+ type: [Number, String],
1041
+ default: null
1042
+ },
1043
+ sizeField: {
1044
+ type: String,
1045
+ default: "size"
1046
+ },
1047
+ typeField: {
1048
+ type: String,
1049
+ default: "type"
1050
+ },
1051
+ buffer: {
1052
+ type: Number,
1053
+ default: 200
1054
+ },
1055
+ pageMode: {
1056
+ type: Boolean,
1057
+ default: !1
1058
+ },
1059
+ prerender: {
1060
+ type: Number,
1061
+ default: 0
1062
+ },
1063
+ emitUpdate: {
1064
+ type: Boolean,
1065
+ default: !1
1066
+ },
1067
+ updateInterval: {
1068
+ type: Number,
1069
+ default: 0
1070
+ },
1071
+ skipHover: {
1072
+ type: Boolean,
1073
+ default: !1
1074
+ },
1075
+ listTag: {
1076
+ type: String,
1077
+ default: "div"
1078
+ },
1079
+ itemTag: {
1080
+ type: String,
1081
+ default: "div"
1082
+ },
1083
+ listClass: {
1084
+ type: [String, Object, Array],
1085
+ default: ""
1086
+ },
1087
+ itemClass: {
1088
+ type: [String, Object, Array],
1089
+ default: ""
1090
+ }
1091
+ },
1092
+ emits: [
1093
+ "resize",
1094
+ "visible",
1095
+ "hidden",
1096
+ "update",
1097
+ "scroll-start",
1098
+ "scroll-end"
1099
+ ],
1100
+ data() {
1101
+ return {
1102
+ pool: [],
1103
+ totalSize: 0,
1104
+ ready: !1,
1105
+ hoverKey: null
1106
+ };
1107
+ },
1108
+ computed: {
1109
+ sizes() {
1110
+ if (this.itemSize === null) {
1111
+ const e = {
1112
+ "-1": { accumulator: 0 }
1113
+ }, i = this.items, t = this.sizeField, s = this.minItemSize;
1114
+ let l = 1e4, r = 0, a;
1115
+ for (let o = 0, n = i.length; o < n; o++)
1116
+ a = i[o][t] || s, a < l && (l = a), r += a, e[o] = { accumulator: r, size: a };
1117
+ return this.$_computedMinItemSize = l, e;
1118
+ }
1119
+ return [];
1120
+ },
1121
+ simpleArray: Je,
1122
+ itemIndexByKey() {
1123
+ const { keyField: e, items: i } = this, t = {};
1124
+ for (let s = 0, l = i.length; s < l; s++)
1125
+ t[i[s][e]] = s;
1126
+ return t;
1127
+ }
1128
+ },
1129
+ watch: {
1130
+ items() {
1131
+ this.updateVisibleItems(!0);
1132
+ },
1133
+ pageMode() {
1134
+ this.applyPageMode(), this.updateVisibleItems(!1);
1135
+ },
1136
+ sizes: {
1137
+ handler() {
1138
+ this.updateVisibleItems(!1);
1139
+ },
1140
+ deep: !0
1141
+ },
1142
+ gridItems() {
1143
+ this.updateVisibleItems(!0);
1144
+ },
1145
+ itemSecondarySize() {
1146
+ this.updateVisibleItems(!0);
1147
+ }
1148
+ },
1149
+ created() {
1150
+ this.$_startIndex = 0, this.$_endIndex = 0, this.$_views = /* @__PURE__ */ new Map(), this.$_unusedViews = /* @__PURE__ */ new Map(), this.$_scrollDirty = !1, this.$_lastUpdateScrollPosition = 0, this.prerender && (this.$_prerender = !0, this.updateVisibleItems(!1)), this.gridItems && !this.itemSize && console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems");
1151
+ },
1152
+ mounted() {
1153
+ this.applyPageMode(), this.$nextTick(() => {
1154
+ this.$_prerender = !1, this.updateVisibleItems(!0), this.ready = !0;
1155
+ });
1156
+ },
1157
+ activated() {
1158
+ const e = this.$_lastUpdateScrollPosition;
1159
+ typeof e == "number" && this.$nextTick(() => {
1160
+ this.scrollToPosition(e);
1161
+ });
1162
+ },
1163
+ beforeUnmount() {
1164
+ this.removeListeners();
1165
+ },
1166
+ methods: {
1167
+ addView(e, i, t, s, l) {
1168
+ const r = nt({
1169
+ id: Ci++,
1170
+ index: i,
1171
+ used: !0,
1172
+ key: s,
1173
+ type: l
1174
+ }), a = rt({
1175
+ item: t,
1176
+ position: 0,
1177
+ nr: r
1178
+ });
1179
+ return e.push(a), a;
1180
+ },
1181
+ unuseView(e, i = !1) {
1182
+ const t = this.$_unusedViews, s = e.nr.type;
1183
+ let l = t.get(s);
1184
+ l || (l = [], t.set(s, l)), l.push(e), i || (e.nr.used = !1, e.position = -9999);
1185
+ },
1186
+ handleResize() {
1187
+ this.$emit("resize"), this.ready && this.updateVisibleItems(!1);
1188
+ },
1189
+ handleScroll(e) {
1190
+ if (!this.$_scrollDirty) {
1191
+ if (this.$_scrollDirty = !0, this.$_updateTimeout) return;
1192
+ const i = () => requestAnimationFrame(() => {
1193
+ this.$_scrollDirty = !1;
1194
+ const { continuous: t } = this.updateVisibleItems(!1, !0);
1195
+ t || (clearTimeout(this.$_refreshTimout), this.$_refreshTimout = setTimeout(this.handleScroll, this.updateInterval + 100));
1196
+ });
1197
+ i(), this.updateInterval && (this.$_updateTimeout = setTimeout(() => {
1198
+ this.$_updateTimeout = 0, this.$_scrollDirty && i();
1199
+ }, this.updateInterval));
1200
+ }
1201
+ },
1202
+ handleVisibilityChange(e, i) {
1203
+ this.ready && (e || i.boundingClientRect.width !== 0 || i.boundingClientRect.height !== 0 ? (this.$emit("visible"), requestAnimationFrame(() => {
1204
+ this.updateVisibleItems(!1);
1205
+ })) : this.$emit("hidden"));
1206
+ },
1207
+ updateVisibleItems(e, i = !1) {
1208
+ const t = this.itemSize, s = this.gridItems || 1, l = this.itemSecondarySize || t, r = this.$_computedMinItemSize, a = this.typeField, o = this.simpleArray ? null : this.keyField, n = this.items, c = n.length, d = this.sizes, p = this.$_views, I = this.$_unusedViews, m = this.pool, _ = this.itemIndexByKey;
1209
+ let h, v, A, w, N;
1210
+ if (!c)
1211
+ h = v = w = N = A = 0;
1212
+ else if (this.$_prerender)
1213
+ h = w = 0, v = N = Math.min(this.prerender, n.length), A = null;
1214
+ else {
1215
+ const y = this.getScroll();
1216
+ if (i) {
1217
+ let E = y.start - this.$_lastUpdateScrollPosition;
1218
+ if (E < 0 && (E = -E), t === null && E < r || E < t)
1219
+ return {
1220
+ continuous: !0
1221
+ };
1222
+ }
1223
+ this.$_lastUpdateScrollPosition = y.start;
1224
+ const O = this.buffer;
1225
+ y.start -= O, y.end += O;
1226
+ let x = 0;
1227
+ if (this.$refs.before && (x = this.$refs.before.scrollHeight, y.start -= x), this.$refs.after) {
1228
+ const E = this.$refs.after.scrollHeight;
1229
+ y.end += E;
1230
+ }
1231
+ if (t === null) {
1232
+ let E, q = 0, ee = c - 1, F = ~~(c / 2), Q;
1233
+ do
1234
+ Q = F, E = d[F].accumulator, E < y.start ? q = F : F < c - 1 && d[F + 1].accumulator > y.start && (ee = F), F = ~~((q + ee) / 2);
1235
+ while (F !== Q);
1236
+ for (F < 0 && (F = 0), h = F, A = d[c - 1].accumulator, v = F; v < c && d[v].accumulator < y.end; v++) ;
1237
+ for (v === -1 ? v = n.length - 1 : (v++, v > c && (v = c)), w = h; w < c && x + d[w].accumulator < y.start; w++) ;
1238
+ for (N = w; N < c && x + d[N].accumulator < y.end; N++) ;
1239
+ } else {
1240
+ h = ~~(y.start / t * s);
1241
+ const E = h % s;
1242
+ h -= E, v = Math.ceil(y.end / t * s), w = Math.max(0, Math.floor((y.start - x) / t * s)), N = Math.floor((y.end - x) / t * s), h < 0 && (h = 0), v > c && (v = c), w < 0 && (w = 0), N > c && (N = c), A = Math.ceil(c / s) * t;
1243
+ }
1244
+ }
1245
+ v - h > $i.itemsLimit && this.itemsLimitError(), this.totalSize = A;
1246
+ let S;
1247
+ const g = h <= this.$_endIndex && v >= this.$_startIndex;
1248
+ if (g)
1249
+ for (let y = 0, O = m.length; y < O; y++)
1250
+ S = m[y], S.nr.used && (e && (S.nr.index = _[S.item[o]]), (S.nr.index == null || S.nr.index < h || S.nr.index >= v) && this.unuseView(S));
1251
+ const M = g ? null : /* @__PURE__ */ new Map();
1252
+ let f, D, C;
1253
+ for (let y = h; y < v; y++) {
1254
+ f = n[y];
1255
+ const O = o ? f[o] : f;
1256
+ if (O == null)
1257
+ throw new Error(`Key is ${O} on item (keyField is '${o}')`);
1258
+ if (S = p.get(O), !t && !d[y].size) {
1259
+ S && this.unuseView(S);
1260
+ continue;
1261
+ }
1262
+ D = f[a];
1263
+ let x = I.get(D), E = !1;
1264
+ if (!S)
1265
+ g ? x && x.length ? S = x.pop() : S = this.addView(m, y, f, O, D) : (C = M.get(D) || 0, (!x || C >= x.length) && (S = this.addView(m, y, f, O, D), this.unuseView(S, !0), x = I.get(D)), S = x[C], M.set(D, C + 1)), p.delete(S.nr.key), S.nr.used = !0, S.nr.index = y, S.nr.key = O, S.nr.type = D, p.set(O, S), E = !0;
1266
+ else if (!S.nr.used && (S.nr.used = !0, E = !0, x)) {
1267
+ const q = x.indexOf(S);
1268
+ q !== -1 && x.splice(q, 1);
1269
+ }
1270
+ S.item = f, E && (y === n.length - 1 && this.$emit("scroll-end"), y === 0 && this.$emit("scroll-start")), t === null ? (S.position = d[y - 1].accumulator, S.offset = 0) : (S.position = Math.floor(y / s) * t, S.offset = y % s * l);
1271
+ }
1272
+ return this.$_startIndex = h, this.$_endIndex = v, this.emitUpdate && this.$emit("update", h, v, w, N), clearTimeout(this.$_sortTimer), this.$_sortTimer = setTimeout(this.sortViews, this.updateInterval + 300), {
1273
+ continuous: g
1274
+ };
1275
+ },
1276
+ getListenerTarget() {
1277
+ let e = Fe(this.$el);
1278
+ return window.document && (e === window.document.documentElement || e === window.document.body) && (e = window), e;
1279
+ },
1280
+ getScroll() {
1281
+ const { $el: e, direction: i } = this, t = i === "vertical";
1282
+ let s;
1283
+ if (this.pageMode) {
1284
+ const l = e.getBoundingClientRect(), r = t ? l.height : l.width;
1285
+ let a = -(t ? l.top : l.left), o = t ? window.innerHeight : window.innerWidth;
1286
+ a < 0 && (o += a, a = 0), a + o > r && (o = r - a), s = {
1287
+ start: a,
1288
+ end: a + o
1289
+ };
1290
+ } else t ? s = {
1291
+ start: e.scrollTop,
1292
+ end: e.scrollTop + e.clientHeight
1293
+ } : s = {
1294
+ start: e.scrollLeft,
1295
+ end: e.scrollLeft + e.clientWidth
1296
+ };
1297
+ return s;
1298
+ },
1299
+ applyPageMode() {
1300
+ this.pageMode ? this.addListeners() : this.removeListeners();
1301
+ },
1302
+ addListeners() {
1303
+ this.listenerTarget = this.getListenerTarget(), this.listenerTarget.addEventListener("scroll", this.handleScroll, $e ? {
1304
+ passive: !0
1305
+ } : !1), this.listenerTarget.addEventListener("resize", this.handleResize);
1306
+ },
1307
+ removeListeners() {
1308
+ this.listenerTarget && (this.listenerTarget.removeEventListener("scroll", this.handleScroll), this.listenerTarget.removeEventListener("resize", this.handleResize), this.listenerTarget = null);
1309
+ },
1310
+ scrollToItem(e) {
1311
+ let i;
1312
+ const t = this.gridItems || 1;
1313
+ this.itemSize === null ? i = e > 0 ? this.sizes[e - 1].accumulator : 0 : i = Math.floor(e / t) * this.itemSize, this.scrollToPosition(i);
1314
+ },
1315
+ scrollToPosition(e) {
1316
+ const i = this.direction === "vertical" ? { scroll: "scrollTop", start: "top" } : { scroll: "scrollLeft", start: "left" };
1317
+ let t, s, l;
1318
+ if (this.pageMode) {
1319
+ const r = Fe(this.$el), a = r.tagName === "HTML" ? 0 : r[i.scroll], o = r.getBoundingClientRect(), c = this.$el.getBoundingClientRect()[i.start] - o[i.start];
1320
+ t = r, s = i.scroll, l = e + a + c;
1321
+ } else
1322
+ t = this.$el, s = i.scroll, l = e;
1323
+ t[s] = l;
1324
+ },
1325
+ itemsLimitError() {
1326
+ throw setTimeout(() => {
1327
+ console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.", "Scroller:", this.$el), console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.");
1328
+ }), new Error("Rendered items limit reached");
1329
+ },
1330
+ sortViews() {
1331
+ this.pool.sort((e, i) => e.nr.index - i.nr.index);
1332
+ }
1333
+ }
1334
+ };
1335
+ const Ni = {
1336
+ key: 0,
1337
+ ref: "before",
1338
+ class: "vue-recycle-scroller__slot"
1339
+ }, Li = {
1340
+ key: 1,
1341
+ ref: "after",
1342
+ class: "vue-recycle-scroller__slot"
1343
+ };
1344
+ function Oi(e, i, t, s, l, r) {
1345
+ const a = we("ResizeObserver"), o = ot("observe-visibility");
1346
+ return at((T(), P(
1347
+ "div",
1348
+ {
1349
+ class: ue(["vue-recycle-scroller", {
1350
+ ready: l.ready,
1351
+ "page-mode": t.pageMode,
1352
+ [`direction-${e.direction}`]: !0
1353
+ }]),
1354
+ onScrollPassive: i[0] || (i[0] = (...n) => r.handleScroll && r.handleScroll(...n))
1355
+ },
1356
+ [
1357
+ e.$slots.before ? (T(), P(
1358
+ "div",
1359
+ Ni,
1360
+ [
1361
+ J(e.$slots, "before")
1362
+ ],
1363
+ 512
1364
+ /* NEED_PATCH */
1365
+ )) : G("v-if", !0),
1366
+ (T(), U(Ae(t.listTag), {
1367
+ ref: "wrapper",
1368
+ style: He({ [e.direction === "vertical" ? "minHeight" : "minWidth"]: l.totalSize + "px" }),
1369
+ class: ue(["vue-recycle-scroller__item-wrapper", t.listClass])
1370
+ }, {
1371
+ default: W(() => [
1372
+ (T(!0), P(
1373
+ de,
1374
+ null,
1375
+ je(l.pool, (n) => (T(), U(Ae(t.itemTag), De({
1376
+ key: n.nr.id,
1377
+ style: l.ready ? {
1378
+ transform: `translate${e.direction === "vertical" ? "Y" : "X"}(${n.position}px) translate${e.direction === "vertical" ? "X" : "Y"}(${n.offset}px)`,
1379
+ width: t.gridItems ? `${e.direction === "vertical" && t.itemSecondarySize || t.itemSize}px` : void 0,
1380
+ height: t.gridItems ? `${e.direction === "horizontal" && t.itemSecondarySize || t.itemSize}px` : void 0
1381
+ } : null,
1382
+ class: ["vue-recycle-scroller__item-view", [
1383
+ t.itemClass,
1384
+ {
1385
+ hover: !t.skipHover && l.hoverKey === n.nr.key
1386
+ }
1387
+ ]]
1388
+ }, ct(t.skipHover ? {} : {
1389
+ mouseenter: () => {
1390
+ l.hoverKey = n.nr.key;
1391
+ },
1392
+ mouseleave: () => {
1393
+ l.hoverKey = null;
1394
+ }
1395
+ })), {
1396
+ default: W(() => [
1397
+ J(e.$slots, "default", {
1398
+ item: n.item,
1399
+ index: n.nr.index,
1400
+ active: n.nr.used
1401
+ })
1402
+ ]),
1403
+ _: 2
1404
+ /* DYNAMIC */
1405
+ }, 1040, ["style", "class"]))),
1406
+ 128
1407
+ /* KEYED_FRAGMENT */
1408
+ )),
1409
+ J(e.$slots, "empty")
1410
+ ]),
1411
+ _: 3
1412
+ /* FORWARDED */
1413
+ }, 8, ["style", "class"])),
1414
+ e.$slots.after ? (T(), P(
1415
+ "div",
1416
+ Li,
1417
+ [
1418
+ J(e.$slots, "after")
1419
+ ],
1420
+ 512
1421
+ /* NEED_PATCH */
1422
+ )) : G("v-if", !0),
1423
+ H(a, { onNotify: r.handleResize }, null, 8, ["onNotify"])
1424
+ ],
1425
+ 34
1426
+ /* CLASS, HYDRATE_EVENTS */
1427
+ )), [
1428
+ [o, r.handleVisibilityChange]
1429
+ ]);
1430
+ }
1431
+ Ne.render = Oi;
1432
+ Ne.__file = "src/components/RecycleScroller.vue";
1433
+ var Le = {
1434
+ name: "DynamicScroller",
1435
+ components: {
1436
+ RecycleScroller: Ne
1437
+ },
1438
+ provide() {
1439
+ return typeof ResizeObserver < "u" && (this.$_resizeObserver = new ResizeObserver((e) => {
1440
+ requestAnimationFrame(() => {
1441
+ if (Array.isArray(e)) {
1442
+ for (const i of e)
1443
+ if (i.target && i.target.$_vs_onResize) {
1444
+ let t, s;
1445
+ if (i.borderBoxSize) {
1446
+ const l = i.borderBoxSize[0];
1447
+ t = l.inlineSize, s = l.blockSize;
1448
+ } else
1449
+ t = i.contentRect.width, s = i.contentRect.height;
1450
+ i.target.$_vs_onResize(i.target.$_vs_id, t, s);
1451
+ }
1452
+ }
1453
+ });
1454
+ })), {
1455
+ vscrollData: this.vscrollData,
1456
+ vscrollParent: this,
1457
+ vscrollResizeObserver: this.$_resizeObserver
1458
+ };
1459
+ },
1460
+ inheritAttrs: !1,
1461
+ props: {
1462
+ ...Ze,
1463
+ minItemSize: {
1464
+ type: [Number, String],
1465
+ required: !0
1466
+ }
1467
+ },
1468
+ emits: [
1469
+ "resize",
1470
+ "visible"
1471
+ ],
1472
+ data() {
1473
+ return {
1474
+ vscrollData: {
1475
+ active: !0,
1476
+ sizes: {},
1477
+ keyField: this.keyField,
1478
+ simpleArray: !1
1479
+ }
1480
+ };
1481
+ },
1482
+ computed: {
1483
+ simpleArray: Je,
1484
+ itemsWithSize() {
1485
+ const e = [], { items: i, keyField: t, simpleArray: s } = this, l = this.vscrollData.sizes, r = i.length;
1486
+ for (let a = 0; a < r; a++) {
1487
+ const o = i[a], n = s ? a : o[t];
1488
+ let c = l[n];
1489
+ typeof c > "u" && !this.$_undefinedMap[n] && (c = 0), e.push({
1490
+ item: o,
1491
+ id: n,
1492
+ size: c
1493
+ });
1494
+ }
1495
+ return e;
1496
+ }
1497
+ },
1498
+ watch: {
1499
+ items() {
1500
+ this.forceUpdate();
1501
+ },
1502
+ simpleArray: {
1503
+ handler(e) {
1504
+ this.vscrollData.simpleArray = e;
1505
+ },
1506
+ immediate: !0
1507
+ },
1508
+ direction(e) {
1509
+ this.forceUpdate(!0);
1510
+ },
1511
+ itemsWithSize(e, i) {
1512
+ const t = this.$el.scrollTop;
1513
+ let s = 0, l = 0;
1514
+ const r = Math.min(e.length, i.length);
1515
+ for (let o = 0; o < r && !(s >= t); o++)
1516
+ s += i[o].size || this.minItemSize, l += e[o].size || this.minItemSize;
1517
+ const a = l - s;
1518
+ a !== 0 && (this.$el.scrollTop += a);
1519
+ }
1520
+ },
1521
+ beforeCreate() {
1522
+ this.$_updates = [], this.$_undefinedSizes = 0, this.$_undefinedMap = {}, this.$_events = Lt();
1523
+ },
1524
+ activated() {
1525
+ this.vscrollData.active = !0;
1526
+ },
1527
+ deactivated() {
1528
+ this.vscrollData.active = !1;
1529
+ },
1530
+ unmounted() {
1531
+ this.$_events.all.clear();
1532
+ },
1533
+ methods: {
1534
+ onScrollerResize() {
1535
+ this.$refs.scroller && this.forceUpdate(), this.$emit("resize");
1536
+ },
1537
+ onScrollerVisible() {
1538
+ this.$_events.emit("vscroll:update", { force: !1 }), this.$emit("visible");
1539
+ },
1540
+ forceUpdate(e = !1) {
1541
+ (e || this.simpleArray) && (this.vscrollData.sizes = {}), this.$_events.emit("vscroll:update", { force: !0 });
1542
+ },
1543
+ scrollToItem(e) {
1544
+ const i = this.$refs.scroller;
1545
+ i && i.scrollToItem(e);
1546
+ },
1547
+ getItemSize(e, i = void 0) {
1548
+ const t = this.simpleArray ? i ?? this.items.indexOf(e) : e[this.keyField];
1549
+ return this.vscrollData.sizes[t] || 0;
1550
+ },
1551
+ scrollToBottom() {
1552
+ if (this.$_scrollingToBottom) return;
1553
+ this.$_scrollingToBottom = !0;
1554
+ const e = this.$el;
1555
+ this.$nextTick(() => {
1556
+ e.scrollTop = e.scrollHeight + 5e3;
1557
+ const i = () => {
1558
+ e.scrollTop = e.scrollHeight + 5e3, requestAnimationFrame(() => {
1559
+ e.scrollTop = e.scrollHeight + 5e3, this.$_undefinedSizes === 0 ? this.$_scrollingToBottom = !1 : requestAnimationFrame(i);
1560
+ });
1561
+ };
1562
+ requestAnimationFrame(i);
1563
+ });
1564
+ }
1565
+ }
1566
+ };
1567
+ function Ai(e, i, t, s, l, r) {
1568
+ const a = we("RecycleScroller");
1569
+ return T(), U(a, De({
1570
+ ref: "scroller",
1571
+ items: r.itemsWithSize,
1572
+ "min-item-size": t.minItemSize,
1573
+ direction: e.direction,
1574
+ "key-field": "id",
1575
+ "list-tag": e.listTag,
1576
+ "item-tag": e.itemTag
1577
+ }, e.$attrs, {
1578
+ onResize: r.onScrollerResize,
1579
+ onVisible: r.onScrollerVisible
1580
+ }), {
1581
+ default: W(({ item: o, index: n, active: c }) => [
1582
+ J(e.$slots, "default", dt(ut({
1583
+ item: o.item,
1584
+ index: n,
1585
+ active: c,
1586
+ itemWithSize: o
1587
+ })))
1588
+ ]),
1589
+ before: W(() => [
1590
+ J(e.$slots, "before")
1591
+ ]),
1592
+ after: W(() => [
1593
+ J(e.$slots, "after")
1594
+ ]),
1595
+ empty: W(() => [
1596
+ J(e.$slots, "empty")
1597
+ ]),
1598
+ _: 3
1599
+ /* FORWARDED */
1600
+ }, 16, ["items", "min-item-size", "direction", "list-tag", "item-tag", "onResize", "onVisible"]);
1601
+ }
1602
+ Le.render = Ai;
1603
+ Le.__file = "src/components/DynamicScroller.vue";
1604
+ var Qe = {
1605
+ name: "DynamicScrollerItem",
1606
+ inject: [
1607
+ "vscrollData",
1608
+ "vscrollParent",
1609
+ "vscrollResizeObserver"
1610
+ ],
1611
+ props: {
1612
+ // eslint-disable-next-line vue/require-prop-types
1613
+ item: {
1614
+ required: !0
1615
+ },
1616
+ watchData: {
1617
+ type: Boolean,
1618
+ default: !1
1619
+ },
1620
+ /**
1621
+ * Indicates if the view is actively used to display an item.
1622
+ */
1623
+ active: {
1624
+ type: Boolean,
1625
+ required: !0
1626
+ },
1627
+ index: {
1628
+ type: Number,
1629
+ default: void 0
1630
+ },
1631
+ sizeDependencies: {
1632
+ type: [Array, Object],
1633
+ default: null
1634
+ },
1635
+ emitResize: {
1636
+ type: Boolean,
1637
+ default: !1
1638
+ },
1639
+ tag: {
1640
+ type: String,
1641
+ default: "div"
1642
+ }
1643
+ },
1644
+ emits: [
1645
+ "resize"
1646
+ ],
1647
+ computed: {
1648
+ id() {
1649
+ if (this.vscrollData.simpleArray) return this.index;
1650
+ if (this.vscrollData.keyField in this.item) return this.item[this.vscrollData.keyField];
1651
+ throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`);
1652
+ },
1653
+ size() {
1654
+ return this.vscrollData.sizes[this.id] || 0;
1655
+ },
1656
+ finalActive() {
1657
+ return this.active && this.vscrollData.active;
1658
+ }
1659
+ },
1660
+ watch: {
1661
+ watchData: "updateWatchData",
1662
+ id(e, i) {
1663
+ if (this.$el.$_vs_id = this.id, this.size || this.onDataUpdate(), this.$_sizeObserved) {
1664
+ const t = this.vscrollData.sizes[i], s = this.vscrollData.sizes[e];
1665
+ t != null && t !== s && this.applySize(t);
1666
+ }
1667
+ },
1668
+ finalActive(e) {
1669
+ this.size || (e ? this.vscrollParent.$_undefinedMap[this.id] || (this.vscrollParent.$_undefinedSizes++, this.vscrollParent.$_undefinedMap[this.id] = !0) : this.vscrollParent.$_undefinedMap[this.id] && (this.vscrollParent.$_undefinedSizes--, this.vscrollParent.$_undefinedMap[this.id] = !1)), this.vscrollResizeObserver ? e ? this.observeSize() : this.unobserveSize() : e && this.$_pendingVScrollUpdate === this.id && this.updateSize();
1670
+ }
1671
+ },
1672
+ created() {
1673
+ if (!this.$isServer && (this.$_forceNextVScrollUpdate = null, this.updateWatchData(), !this.vscrollResizeObserver)) {
1674
+ for (const e in this.sizeDependencies)
1675
+ this.$watch(() => this.sizeDependencies[e], this.onDataUpdate);
1676
+ this.vscrollParent.$_events.on("vscroll:update", this.onVscrollUpdate);
1677
+ }
1678
+ },
1679
+ mounted() {
1680
+ this.finalActive && (this.updateSize(), this.observeSize());
1681
+ },
1682
+ beforeUnmount() {
1683
+ this.vscrollParent.$_events.off("vscroll:update", this.onVscrollUpdate), this.unobserveSize();
1684
+ },
1685
+ methods: {
1686
+ updateSize() {
1687
+ this.finalActive ? this.$_pendingSizeUpdate !== this.id && (this.$_pendingSizeUpdate = this.id, this.$_forceNextVScrollUpdate = null, this.$_pendingVScrollUpdate = null, this.computeSize(this.id)) : this.$_forceNextVScrollUpdate = this.id;
1688
+ },
1689
+ updateWatchData() {
1690
+ this.watchData && !this.vscrollResizeObserver ? this.$_watchData = this.$watch("item", () => {
1691
+ this.onDataUpdate();
1692
+ }, {
1693
+ deep: !0
1694
+ }) : this.$_watchData && (this.$_watchData(), this.$_watchData = null);
1695
+ },
1696
+ onVscrollUpdate({ force: e }) {
1697
+ !this.finalActive && e && (this.$_pendingVScrollUpdate = this.id), (this.$_forceNextVScrollUpdate === this.id || e || !this.size) && this.updateSize();
1698
+ },
1699
+ onDataUpdate() {
1700
+ this.updateSize();
1701
+ },
1702
+ computeSize(e) {
1703
+ this.$nextTick(() => {
1704
+ if (this.id === e) {
1705
+ const i = this.$el.offsetWidth, t = this.$el.offsetHeight;
1706
+ this.applyWidthHeight(i, t);
1707
+ }
1708
+ this.$_pendingSizeUpdate = null;
1709
+ });
1710
+ },
1711
+ applyWidthHeight(e, i) {
1712
+ const t = ~~(this.vscrollParent.direction === "vertical" ? i : e);
1713
+ t && this.size !== t && this.applySize(t);
1714
+ },
1715
+ applySize(e) {
1716
+ this.vscrollParent.$_undefinedMap[this.id] && (this.vscrollParent.$_undefinedSizes--, this.vscrollParent.$_undefinedMap[this.id] = void 0), this.vscrollData.sizes[this.id] = e, this.emitResize && this.$emit("resize", this.id);
1717
+ },
1718
+ observeSize() {
1719
+ this.vscrollResizeObserver && (this.$_sizeObserved || (this.vscrollResizeObserver.observe(this.$el), this.$el.$_vs_id = this.id, this.$el.$_vs_onResize = this.onResize, this.$_sizeObserved = !0));
1720
+ },
1721
+ unobserveSize() {
1722
+ this.vscrollResizeObserver && this.$_sizeObserved && (this.vscrollResizeObserver.unobserve(this.$el), this.$el.$_vs_onResize = void 0, this.$_sizeObserved = !1);
1723
+ },
1724
+ onResize(e, i, t) {
1725
+ this.id === e && this.applyWidthHeight(i, t);
1726
+ }
1727
+ },
1728
+ render() {
1729
+ return me(this.tag, this.$slots.default());
1730
+ }
1731
+ };
1732
+ Qe.__file = "src/components/DynamicScrollerItem.vue";
1733
+ const Ei = {
1734
+ key: 0,
1735
+ class: "loading-indicator"
1736
+ }, Mi = { class: "loading-text" }, Ri = {
1737
+ key: 1,
1738
+ class: "no-more-tip"
1739
+ }, Pi = {
1740
+ key: 1,
1741
+ class: "empty-state"
1742
+ }, Fi = { class: "empty-text" }, Vi = {
1743
+ __name: "ScrollList",
1744
+ props: {
1745
+ // 数据源
1746
+ items: {
1747
+ type: Array,
1748
+ default: () => []
1749
+ },
1750
+ // 是否正在加载
1751
+ loading: {
1752
+ type: Boolean,
1753
+ default: !1
1754
+ },
1755
+ // 是否还有更多数据
1756
+ hasMore: {
1757
+ type: Boolean,
1758
+ default: !0
1759
+ },
1760
+ // 加载提示文本
1761
+ loadingText: {
1762
+ type: String,
1763
+ default: "加载中..."
1764
+ },
1765
+ // 没有更多数据提示文本
1766
+ noMoreText: {
1767
+ type: String,
1768
+ default: "没有更多了"
1769
+ },
1770
+ // 空状态文本
1771
+ emptyText: {
1772
+ type: String,
1773
+ default: "暂无数据"
1774
+ },
1775
+ // 容器高度
1776
+ height: {
1777
+ type: String,
1778
+ default: "auto"
1779
+ },
1780
+ // 最小项目高度(用于虚拟滚动计算,单位:px)
1781
+ minItemSize: {
1782
+ type: Number,
1783
+ default: 60
1784
+ },
1785
+ // 缓冲区大小(渲染可见区域之外的额外项目数)
1786
+ buffer: {
1787
+ type: Number,
1788
+ default: 200
1789
+ },
1790
+ // 触发加载更多的距离阈值(像素)
1791
+ threshold: {
1792
+ type: Number,
1793
+ default: 100
1794
+ },
1795
+ // 用于标识每个 item 的字段名
1796
+ keyField: {
1797
+ type: String,
1798
+ default: "id"
1799
+ }
1800
+ },
1801
+ emits: ["load-more", "scroll"],
1802
+ setup(e, { expose: i, emit: t }) {
1803
+ const s = e, l = t, r = B(null), a = B(null), o = B(!1);
1804
+ let n = null;
1805
+ const c = K(() => ({
1806
+ height: s.height
1807
+ })), d = () => {
1808
+ console.log("loadMore triggered----", o.value || !s.hasMore || s.loading), !(o.value || !s.hasMore || s.loading) && (o.value = !0, l("load-more"));
1809
+ }, p = () => {
1810
+ o.value = !1, I();
1811
+ }, I = () => {
1812
+ r.value && r.value.scrollToPosition(0);
1813
+ }, m = () => {
1814
+ if (r.value) {
1815
+ const w = r.value.$el;
1816
+ w && (w.scrollTop = w.scrollHeight);
1817
+ }
1818
+ }, _ = (w) => {
1819
+ r.value && r.value.scrollToItem(w);
1820
+ }, h = () => {
1821
+ if (!a.value || !r.value) return;
1822
+ const w = r.value.$el;
1823
+ if (!w) return;
1824
+ const N = {
1825
+ root: w,
1826
+ rootMargin: `${s.threshold}px`,
1827
+ threshold: 0.1
1828
+ };
1829
+ n = new IntersectionObserver((S) => {
1830
+ S.forEach((g) => {
1831
+ console.log(
1832
+ "Setting up Intersection Observer-----",
1833
+ g.isIntersecting,
1834
+ s.hasMore,
1835
+ !o.value,
1836
+ !s.loading
1837
+ ), g.isIntersecting && s.hasMore && !o.value && !s.loading && d();
1838
+ });
1839
+ }, N), n.observe(a.value);
1840
+ }, v = () => {
1841
+ n && (n.disconnect(), n = null);
1842
+ }, A = (w) => {
1843
+ const N = w.target;
1844
+ l("scroll", {
1845
+ scrollTop: N.scrollTop,
1846
+ scrollHeight: N.scrollHeight,
1847
+ clientHeight: N.clientHeight
1848
+ });
1849
+ };
1850
+ return Z(
1851
+ () => s.loading,
1852
+ (w) => {
1853
+ w || (o.value = !1);
1854
+ }
1855
+ ), Z(
1856
+ () => s.items.length,
1857
+ async () => {
1858
+ await ie(), v(), s.hasMore && h();
1859
+ }
1860
+ ), Ie(async () => {
1861
+ await ie(), s.hasMore && h();
1862
+ }), ht(() => {
1863
+ v();
1864
+ }), i({
1865
+ reset: p,
1866
+ scrollToTop: I,
1867
+ scrollToBottom: m,
1868
+ scrollToItem: _,
1869
+ loadMore: d
1870
+ }), (w, N) => {
1871
+ const S = we("Loading");
1872
+ return T(), P("div", {
1873
+ class: "scroll-list",
1874
+ style: He(c.value)
1875
+ }, [
1876
+ e.items.length > 0 ? (T(), U($(Le), {
1877
+ key: 0,
1878
+ ref_key: "scrollerRef",
1879
+ ref: r,
1880
+ items: e.items,
1881
+ "min-item-size": e.minItemSize,
1882
+ buffer: e.buffer,
1883
+ "key-field": e.keyField,
1884
+ class: "scroller",
1885
+ onScroll: A
1886
+ }, {
1887
+ default: W(({ item: g, index: M, active: f }) => [
1888
+ H($(Qe), {
1889
+ item: g,
1890
+ active: f,
1891
+ "data-index": M,
1892
+ "size-dependencies": [g]
1893
+ }, {
1894
+ default: W(() => [
1895
+ J(w.$slots, "default", {
1896
+ item: g,
1897
+ index: M,
1898
+ active: f
1899
+ }, void 0, !0)
1900
+ ]),
1901
+ _: 2
1902
+ }, 1032, ["item", "active", "data-index", "size-dependencies"])
1903
+ ]),
1904
+ after: W(() => [
1905
+ e.hasMore ? (T(), P("div", {
1906
+ key: 0,
1907
+ ref_key: "loadMoreTriggerRef",
1908
+ ref: a,
1909
+ class: "load-more-trigger"
1910
+ }, [
1911
+ o.value ? (T(), P("div", Ei, [
1912
+ H($(ve), { class: "is-loading" }, {
1913
+ default: W(() => [
1914
+ H(S)
1915
+ ]),
1916
+ _: 1
1917
+ }),
1918
+ j("span", Mi, te(e.loadingText), 1)
1919
+ ])) : G("", !0)
1920
+ ], 512)) : G("", !0),
1921
+ !e.hasMore && e.items.length > 0 ? (T(), P("div", Ri, te(e.noMoreText), 1)) : G("", !0)
1922
+ ]),
1923
+ _: 3
1924
+ }, 8, ["items", "min-item-size", "buffer", "key-field"])) : G("", !0),
1925
+ e.items.length === 0 && !o.value ? (T(), P("div", Pi, [
1926
+ J(w.$slots, "empty", {}, () => [
1927
+ H($(ve), {
1928
+ class: "empty-icon",
1929
+ size: 80
1930
+ }, {
1931
+ default: W(() => [
1932
+ H($(Ct))
1933
+ ]),
1934
+ _: 1
1935
+ }),
1936
+ j("div", Fi, te(e.emptyText), 1)
1937
+ ], !0)
1938
+ ])) : G("", !0)
1939
+ ], 4);
1940
+ };
1941
+ }
1942
+ }, ji = /* @__PURE__ */ ae(Vi, [["__scopeId", "data-v-37e01654"]]), Hi = { class: "search-wrap" }, Ui = { class: "list-item" }, Bi = ["onClick"], Ki = { class: "node-info" }, Wi = { class: "node-label" }, qi = {
1943
+ key: 0,
1944
+ class: "node-suffix"
1945
+ }, Yi = {
1946
+ __name: "index",
1947
+ props: {
1948
+ items: {
1949
+ type: Array,
1950
+ default: () => []
1951
+ },
1952
+ loading: {
1953
+ type: Boolean,
1954
+ default: !1
1955
+ },
1956
+ hasMore: {
1957
+ type: Boolean,
1958
+ default: !1
1959
+ },
1960
+ height: {
1961
+ type: String,
1962
+ default: "100%"
1963
+ },
1964
+ minItemSize: {
1965
+ type: Number,
1966
+ default: 50
1967
+ },
1968
+ buffer: {
1969
+ type: Number,
1970
+ default: 100
1971
+ },
1972
+ treeProps: {
1973
+ type: Object,
1974
+ default: () => ({
1975
+ label: "label",
1976
+ value: "value"
1977
+ })
1978
+ },
1979
+ // 已选择的文档(当前 tab 的选择)
1980
+ selectedDocuments: {
1981
+ type: Array,
1982
+ default: () => []
1983
+ }
1984
+ },
1985
+ emits: ["load-more", "item-check"],
1986
+ setup(e, { emit: i }) {
1987
+ const { t } = Ot(), s = e, l = K(() => s.items.map((n) => {
1988
+ const c = (s.selectedDocuments || []).some(
1989
+ (d) => d.id === n.id
1990
+ );
1991
+ return {
1992
+ ...n,
1993
+ isSelected: c
1994
+ };
1995
+ })), r = i, a = (n, c) => {
1996
+ r("item-check", n, c);
1997
+ }, o = () => {
1998
+ r("load-more");
1999
+ };
2000
+ return (n, c) => (T(), P("div", Hi, [
2001
+ H(ji, {
2002
+ items: l.value,
2003
+ loading: e.loading,
2004
+ "key-field": "id",
2005
+ "has-more": e.hasMore,
2006
+ "loading-text": $(t)("FEISHU_SEARCH_TEXT.LOADING_TEXT"),
2007
+ "no-more-text": $(t)("FEISHU_SEARCH_TEXT.NO_MORE_TEXT"),
2008
+ "empty-text": $(t)("FEISHU_SEARCH_TEXT.EMPTY_TEXT"),
2009
+ height: e.height,
2010
+ "min-item-size": e.minItemSize,
2011
+ buffer: e.buffer,
2012
+ onLoadMore: o
2013
+ }, {
2014
+ default: W(({ item: d }) => [
2015
+ j("div", Ui, [
2016
+ J(n.$slots, "default", { item: d }, () => [
2017
+ j("div", {
2018
+ class: "search-item",
2019
+ onClick: () => a(d, !d.isSelected)
2020
+ }, [
2021
+ H($(mt), {
2022
+ "model-value": d.isSelected
2023
+ }, null, 8, ["model-value"]),
2024
+ H(ye, {
2025
+ "file-type": d.type,
2026
+ size: 26,
2027
+ isLocalFileType: n.data?.isLocalFileType
2028
+ }, null, 8, ["file-type", "isLocalFileType"]),
2029
+ j("div", Ki, [
2030
+ j("span", Wi, te(d[e.treeProps.label]), 1),
2031
+ d.suffix ? (T(), P("span", qi, te(d.suffix), 1)) : G("", !0)
2032
+ ])
2033
+ ], 8, Bi)
2034
+ ], !0)
2035
+ ])
2036
+ ]),
2037
+ _: 3
2038
+ }, 8, ["items", "loading", "has-more", "loading-text", "no-more-text", "empty-text", "height", "min-item-size", "buffer"])
2039
+ ]));
2040
+ }
2041
+ }, Xi = /* @__PURE__ */ ae(Yi, [["__scopeId", "data-v-9b7f5847"]]), Gi = { class: "left-wrap" }, Zi = { class: "content" }, Ji = { class: "input-wrap" }, Qi = { class: "tree-container" }, es = { class: "tree-node-content" }, ts = { class: "node-info" }, is = { class: "node-label" }, ss = {
2042
+ key: 0,
2043
+ class: "node-suffix"
2044
+ }, ls = 15, ns = /* @__PURE__ */ Object.assign({
2045
+ name: "LeftLayout"
2046
+ }, {
2047
+ __name: "LeftLayout",
2048
+ props: {
2049
+ // 文件夹选项卡配置
2050
+ tabs: {
2051
+ type: Array,
2052
+ default: () => []
2053
+ },
2054
+ // 文档树数据
2055
+ treeData: {
2056
+ type: Object,
2057
+ default: () => ({})
2058
+ },
2059
+ // 树配置
2060
+ treeProps: {
2061
+ type: Object,
2062
+ default: () => ne
2063
+ },
2064
+ // 已选择的文档(当前 tab 的选择)
2065
+ selectedDocuments: {
2066
+ type: Array,
2067
+ default: () => []
2068
+ },
2069
+ // 当前激活的 tab
2070
+ currentTab: {
2071
+ type: String,
2072
+ default: ""
2073
+ },
2074
+ // 搜索类型:'frontend' 前端搜索 | 'backend' 后端搜索
2075
+ searchType: {
2076
+ type: String,
2077
+ default: oe.FRONTEND,
2078
+ validator: (e) => Object.values(oe).includes(e)
2079
+ },
2080
+ // 文本配置
2081
+ textConfig: {
2082
+ type: Object,
2083
+ default: () => ({
2084
+ searchPlaceholder: ""
2085
+ })
2086
+ },
2087
+ getTabSelectedDocuments: {
2088
+ type: Function,
2089
+ default: () => () => []
2090
+ },
2091
+ responseSearchHook: {
2092
+ type: Object,
2093
+ default: () => {
2094
+ }
2095
+ }
2096
+ },
2097
+ emits: [
2098
+ "node-check",
2099
+ "tab-change",
2100
+ "search",
2101
+ "node-expand",
2102
+ "load-more",
2103
+ "node-check-search"
2104
+ ],
2105
+ setup(e, { expose: i, emit: t }) {
2106
+ const s = e, l = t, r = Ce(me), a = B(), o = B(""), n = B(s.currentTab || s.tabs[0]?.value || le.MY_FILES), c = B([]), d = B(!1), p = B(!1), I = K(() => s.tabs.map((f) => ({
2107
+ label: f.label,
2108
+ value: f.value
2109
+ }))), m = K(() => s.treeData[n.value] || []);
2110
+ Z(
2111
+ () => s.responseSearchHook,
2112
+ (f, D) => {
2113
+ p.value = Re(s.currentTab, f), d.value = !1;
2114
+ },
2115
+ { deep: !0, immediate: !0 }
2116
+ );
2117
+ const _ = ti(l, 800), h = K(() => {
2118
+ if (s.searchType === oe.BACKEND)
2119
+ return m.value;
2120
+ const f = o.value?.trim();
2121
+ return f ? Ke(m.value, f, s.treeProps) : m.value;
2122
+ }), v = (f) => s.getTabSelectedDocuments(n.value).some((C) => C[s.treeProps.value] === f), A = K(() => {
2123
+ if (!o.value?.trim()) return [];
2124
+ const f = (D, C = 0) => {
2125
+ let y = [];
2126
+ return D.forEach((O) => {
2127
+ y.push({
2128
+ ...O,
2129
+ level: C,
2130
+ isSelected: v(O[s.treeProps.value])
2131
+ }), O[s.treeProps.children] && O[s.treeProps.children].length > 0 && (y = y.concat(f(O[s.treeProps.children], C + 1)));
2132
+ }), y;
2133
+ };
2134
+ return f(h.value);
2135
+ }), w = (f) => {
2136
+ l("node-check", f);
2137
+ }, N = (f, D) => {
2138
+ const C = {
2139
+ selectedNode: s.getTabSelectedDocuments(n.value),
2140
+ checkedNode: f,
2141
+ isChecked: D
2142
+ };
2143
+ l("node-check-search", C);
2144
+ };
2145
+ Z(n, (f) => {
2146
+ p.value = Re(f, s.responseSearchHook), l("tab-change", f);
2147
+ }), Z(
2148
+ () => s.treeData,
2149
+ () => {
2150
+ d.value = !1, a.value && a.value.syncSelectedNodes && ie(() => {
2151
+ const f = (s.selectedDocuments || []).map((D) => D[s.treeProps.value]);
2152
+ a.value.syncSelectedNodes(f);
2153
+ });
2154
+ },
2155
+ { deep: !0 }
2156
+ );
2157
+ const S = (f) => {
2158
+ ei(f) || l("node-expand", {
2159
+ node: f,
2160
+ tabKey: n.value
2161
+ });
2162
+ }, g = () => {
2163
+ d.value = !0, l("load-more");
2164
+ }, M = (f, D) => {
2165
+ a.value && a.value?.updateNodeChildren && a.value.updateNodeChildren(f, D);
2166
+ };
2167
+ return Z(o, (f) => {
2168
+ s.searchType === oe.BACKEND ? (f && f.trim() && (d.value = !0), _(f || "")) : d.value = !1;
2169
+ }), Z(
2170
+ () => s.currentTab,
2171
+ (f) => {
2172
+ f && f !== n.value && (n.value = f);
2173
+ },
2174
+ { immediate: !0 }
2175
+ ), Z(
2176
+ () => s.selectedDocuments,
2177
+ (f) => {
2178
+ c.value = f || [];
2179
+ },
2180
+ { immediate: !0, deep: !0 }
2181
+ ), i({
2182
+ setNodeCheckStatus: (f, D) => {
2183
+ a.value?.setNodeCheckStatus(f, D);
2184
+ },
2185
+ updateNodeChildren: M,
2186
+ syncSelectedNodes: (f) => {
2187
+ a.value?.syncSelectedNodes(f);
2188
+ }
2189
+ }), (f, D) => (T(), P("div", Gi, [
2190
+ j("div", Zi, [
2191
+ j("div", Ji, [
2192
+ H($(vt), {
2193
+ modelValue: o.value,
2194
+ "onUpdate:modelValue": D[0] || (D[0] = (C) => o.value = C),
2195
+ placeholder: s.textConfig.searchPlaceholder,
2196
+ "prefix-icon": $(Nt),
2197
+ clearable: ""
2198
+ }, null, 8, ["modelValue", "placeholder", "prefix-icon"])
2199
+ ]),
2200
+ H($(yt), {
2201
+ modelValue: n.value,
2202
+ "onUpdate:modelValue": D[1] || (D[1] = (C) => n.value = C),
2203
+ options: I.value
2204
+ }, null, 8, ["modelValue", "options"]),
2205
+ j("div", Qi, [
2206
+ !h.value || h.value.length === 0 ? (T(), U($(xe), { key: 0 })) : (T(), P(de, { key: 1 }, [
2207
+ o.value.trim() !== "" ? (T(), U(Xi, {
2208
+ key: 0,
2209
+ items: A.value,
2210
+ loading: d.value,
2211
+ "has-more": p.value,
2212
+ "min-item-size": 50,
2213
+ buffer: 100,
2214
+ "tree-props": e.treeProps,
2215
+ "selected-documents": e.selectedDocuments,
2216
+ onItemCheck: N,
2217
+ onLoadMore: g
2218
+ }, null, 8, ["items", "loading", "has-more", "tree-props", "selected-documents"])) : (T(), U(ai, {
2219
+ key: 1,
2220
+ modelValue: c.value,
2221
+ "onUpdate:modelValue": D[2] || (D[2] = (C) => c.value = C),
2222
+ ref_key: "treeSelectRef",
2223
+ ref: a,
2224
+ "tree-list": h.value,
2225
+ "tree-props": e.treeProps,
2226
+ "filter-keyword": o.value,
2227
+ itemSize: 50,
2228
+ hasTreeLine: !0,
2229
+ "text-config": e.textConfig,
2230
+ includeParentSelected: !0,
2231
+ onHandleCheck: w,
2232
+ onNodeExpand: S,
2233
+ getTabSelectedDocuments: e.getTabSelectedDocuments
2234
+ }, {
2235
+ node: W(({ node: C, data: y }) => [
2236
+ J(f.$slots, "node", {
2237
+ node: C,
2238
+ data: y
2239
+ }, () => [
2240
+ H($(r), {
2241
+ node: C,
2242
+ treeData: h.value,
2243
+ showLabelLine: !0,
2244
+ indent: ls
2245
+ }, {
2246
+ default: W(() => [
2247
+ j("div", es, [
2248
+ H(ye, {
2249
+ "file-type": y.type,
2250
+ size: 26,
2251
+ isLocalFileType: y?.isLocalFileType
2252
+ }, null, 8, ["file-type", "isLocalFileType"]),
2253
+ j("div", ts, [
2254
+ j("span", is, te(y[e.treeProps.label]), 1),
2255
+ y.suffix ? (T(), P("span", ss, te(y.suffix), 1)) : G("", !0)
2256
+ ])
2257
+ ])
2258
+ ]),
2259
+ _: 2
2260
+ }, 1032, ["node", "treeData"])
2261
+ ], !0)
2262
+ ]),
2263
+ _: 3
2264
+ }, 8, ["modelValue", "tree-list", "tree-props", "filter-keyword", "text-config", "getTabSelectedDocuments"]))
2265
+ ], 64))
2266
+ ])
2267
+ ])
2268
+ ]));
2269
+ }
2270
+ }), rs = /* @__PURE__ */ ae(ns, [["__scopeId", "data-v-6bf8c501"]]);
2271
+ function os(e = {}) {
2272
+ const { valueKey: i = "id" } = e, t = B(/* @__PURE__ */ new Map()), s = K(() => {
2273
+ const m = [], _ = /* @__PURE__ */ new Set();
2274
+ return t.value.forEach((h) => {
2275
+ h.forEach((v) => {
2276
+ const A = v[i];
2277
+ _.has(A) || (m.push(v), _.add(A));
2278
+ });
2279
+ }), m;
2280
+ });
2281
+ return {
2282
+ // 状态
2283
+ allSelectedDocuments: s,
2284
+ selectionMap: t,
2285
+ // 方法
2286
+ getTabSelectedDocuments: (m) => {
2287
+ const _ = t.value.get(m);
2288
+ return _ ? Array.from(_.values()) : [];
2289
+ },
2290
+ updateTabSelection: (m, _ = []) => {
2291
+ t.value.has(m) || t.value.set(m, /* @__PURE__ */ new Map());
2292
+ const h = /* @__PURE__ */ new Map();
2293
+ _.forEach((v) => {
2294
+ v && v[i] != null && h.set(v[i], v);
2295
+ }), t.value.set(m, h), t.value = new Map(t.value);
2296
+ },
2297
+ removeDocument: (m) => {
2298
+ const _ = m[i];
2299
+ let h = null;
2300
+ return t.value.forEach((v, A) => {
2301
+ v.has(_) && (v.delete(_), h = A);
2302
+ }), h && (t.value = new Map(t.value)), h;
2303
+ },
2304
+ toggleDocument: (m, _, h) => {
2305
+ t.value.has(m) || t.value.set(m, /* @__PURE__ */ new Map());
2306
+ const v = t.value.get(m), A = _[i];
2307
+ h ? v.set(A, _) : v.delete(A), t.value = new Map(t.value);
2308
+ },
2309
+ clearTabSelection: (m) => {
2310
+ t.value.has(m) && (t.value.get(m).clear(), t.value = new Map(t.value));
2311
+ },
2312
+ clearAllSelection: () => {
2313
+ t.value.clear(), t.value = new Map(t.value);
2314
+ },
2315
+ isDocumentSelected: (m, _) => {
2316
+ const h = t.value.get(m);
2317
+ return h ? h.has(_) : !1;
2318
+ },
2319
+ setAllDocuments: (m = [], _ = "") => {
2320
+ t.value.clear(), m.forEach((h) => {
2321
+ const v = h.tabKey || _;
2322
+ if (!v) return;
2323
+ t.value.has(v) || t.value.set(v, /* @__PURE__ */ new Map()), t.value.get(v).set(h[i], h);
2324
+ }), t.value = new Map(t.value);
2325
+ },
2326
+ getStatistics: () => {
2327
+ const m = {
2328
+ total: s.value.length,
2329
+ byTab: {}
2330
+ };
2331
+ return t.value.forEach((_, h) => {
2332
+ m.byTab[h] = _.size;
2333
+ }), m;
2334
+ }
2335
+ };
2336
+ }
2337
+ function as(e = {}) {
2338
+ const { valueKey: i = ne.value, childrenKey: t = ne.children } = e, s = B(/* @__PURE__ */ new Map()), l = B({}), r = K(() => {
2339
+ const p = {};
2340
+ return s.value.forEach((I, m) => {
2341
+ p[m] = I;
2342
+ }), p;
2343
+ });
2344
+ return {
2345
+ // 状态
2346
+ allTabDocList: s,
2347
+ allTabTreeDataObject: r,
2348
+ responseSearchHook: l,
2349
+ // 方法
2350
+ setAllTabsTreeData: (p = {}) => {
2351
+ const I = /* @__PURE__ */ new Map();
2352
+ p && typeof p == "object" && Object.keys(p).forEach((m) => {
2353
+ const _ = Array.isArray(p[m]) ? p[m] : [];
2354
+ I.set(m, _);
2355
+ }), s.value = I;
2356
+ },
2357
+ getTabTreeData: (p) => s.value.get(p) || [],
2358
+ setTabTreeData: (p, I = []) => {
2359
+ const m = new Map(s.value);
2360
+ m.set(p, Array.isArray(I) ? I : []), s.value = m;
2361
+ },
2362
+ updateNodeChildren: (p, I, m = []) => {
2363
+ const _ = s.value.get(p);
2364
+ if (!_ || !Array.isArray(_)) return;
2365
+ const h = (w) => w.map((N) => {
2366
+ if (N[i] === I)
2367
+ return {
2368
+ ...N,
2369
+ [t]: m
2370
+ };
2371
+ const S = N[t];
2372
+ return Array.isArray(S) && S.length > 0 ? {
2373
+ ...N,
2374
+ [t]: h(S)
2375
+ } : N;
2376
+ }), v = h(_), A = new Map(s.value);
2377
+ A.set(p, v), s.value = A;
2378
+ },
2379
+ setResponseSearchHook: (p) => {
2380
+ l.value = p;
2381
+ }
2382
+ };
2383
+ }
2384
+ const cs = { class: "doc-sync-select" }, ds = /* @__PURE__ */ Object.assign({
2385
+ name: "DocSyncSelect"
2386
+ }, {
2387
+ __name: "layout",
2388
+ props: {
2389
+ // 选中的文档列表
2390
+ modelValue: {
2391
+ type: Array,
2392
+ default: () => []
2393
+ },
2394
+ // 文档树数据(业务端传入)
2395
+ treeData: {
2396
+ type: Object,
2397
+ default: () => ({})
2398
+ },
2399
+ // 树数据更新元数据,用于智能响应不同类型的更新操作
2400
+ updateMeta: {
2401
+ type: Object,
2402
+ default: () => ({ updateId: "", operation: null, context: {} })
2403
+ },
2404
+ // 树配置
2405
+ treeProps: {
2406
+ type: Object,
2407
+ default: () => ne
2408
+ },
2409
+ // 文件夹选项卡配置
2410
+ tabs: {
2411
+ type: Array,
2412
+ default: () => []
2413
+ },
2414
+ // 搜索类型:'frontend' 前端搜索 | 'backend' 后端搜索
2415
+ searchType: {
2416
+ type: String,
2417
+ default: oe.FRONTEND,
2418
+ validator: (e) => Object.values(oe).includes(e)
2419
+ },
2420
+ // 文本配置(用于配置组件中的中文文本)
2421
+ textConfig: {
2422
+ type: Object,
2423
+ default: () => ({
2424
+ searchPlaceholder: ""
2425
+ })
2426
+ }
2427
+ },
2428
+ emits: [
2429
+ "update:modelValue",
2430
+ "change",
2431
+ "search",
2432
+ "load-node",
2433
+ "recursive-load",
2434
+ "load-more"
2435
+ ],
2436
+ setup(e, { expose: i, emit: t }) {
2437
+ const s = e, l = t, r = K(() => ({ ...ne, ...s.treeProps })), a = K(() => r.value.value), o = K(() => r.value.children), n = B(), c = B(s.tabs[0]?.value || ""), {
2438
+ allSelectedDocuments: d,
2439
+ getTabSelectedDocuments: p,
2440
+ updateTabSelection: I,
2441
+ removeDocument: m,
2442
+ setAllDocuments: _
2443
+ } = os({ valueKey: r.value.value }), h = (u = d.value) => {
2444
+ l("update:modelValue", u), l("change", u);
2445
+ }, {
2446
+ allTabTreeDataObject: v,
2447
+ setAllTabsTreeData: A,
2448
+ updateNodeChildren: w,
2449
+ responseSearchHook: N,
2450
+ setResponseSearchHook: S
2451
+ } = as({
2452
+ valueKey: a.value,
2453
+ childrenKey: o.value
2454
+ });
2455
+ Z(
2456
+ () => s.treeData,
2457
+ (u) => {
2458
+ A(u || {});
2459
+ },
2460
+ { deep: !0, immediate: !0 }
2461
+ ), Z(
2462
+ () => s.updateMeta,
2463
+ (u, b) => {
2464
+ if (!u || !u.updateId || u.updateId === (b?.updateId || ""))
2465
+ return;
2466
+ const { operation: k, context: L } = u;
2467
+ switch (k) {
2468
+ case "node-children-update":
2469
+ q(L);
2470
+ break;
2471
+ case "recursive-load":
2472
+ ee(L);
2473
+ break;
2474
+ case "search":
2475
+ case "load-more":
2476
+ F(L);
2477
+ break;
2478
+ }
2479
+ },
2480
+ { deep: !0, immediate: !1 }
2481
+ );
2482
+ const g = K(() => p(c.value)), M = (u) => {
2483
+ c.value = u;
2484
+ const b = p(u);
2485
+ n.value && n.value.syncSelectedNodes && ie(() => {
2486
+ const k = b.map((L) => L[r.value.value]);
2487
+ n.value.syncSelectedNodes(k);
2488
+ });
2489
+ }, f = (u, b, k) => {
2490
+ ie(() => {
2491
+ const L = b || [], Y = [...Te(u, r.value), u, ...L];
2492
+ I(k, Y), h();
2493
+ });
2494
+ }, D = (u) => {
2495
+ let { selectedNode: b, checkedNode: k, isChecked: L } = u;
2496
+ const R = p(c.value);
2497
+ if (b = Me({
2498
+ tabKey: c.value,
2499
+ currentSelectedDocs: [k],
2500
+ // 使用与左侧展示一致的树数据源,避免因懒加载/局部更新与原始props不一致
2501
+ treeData: v.value,
2502
+ treeProps: r.value,
2503
+ hasSelectToRightDocList: R
2504
+ }), !L) {
2505
+ I(
2506
+ c.value,
2507
+ R.filter((Y) => Y.id !== k.id)
2508
+ ), h();
2509
+ return;
2510
+ }
2511
+ I(c.value, [...R, ...b]), h();
2512
+ }, C = (u) => {
2513
+ let { selectedNode: b, checkedNode: k, isChecked: L } = u;
2514
+ const R = p(c.value);
2515
+ if (b = Me({
2516
+ tabKey: c.value,
2517
+ currentSelectedDocs: b,
2518
+ // 使用与左侧展示一致的树数据源,避免因懒加载/局部更新与原始props不一致
2519
+ treeData: v.value,
2520
+ treeProps: r.value,
2521
+ hasSelectToRightDocList: R
2522
+ }), !k?.hasChildren) {
2523
+ I(c.value, b), h();
2524
+ return;
2525
+ }
2526
+ if (!L) {
2527
+ const Y = Te(k, r.value), re = /* @__PURE__ */ new Set([
2528
+ k[a.value],
2529
+ ...Y.map((X) => X[a.value])
2530
+ ]), V = p(c.value).filter((X) => !re.has(X[a.value]));
2531
+ I(c.value, V), re.forEach((X) => {
2532
+ n.value?.setNodeCheckStatus && n.value.setNodeCheckStatus(X, !1);
2533
+ }), h();
2534
+ return;
2535
+ }
2536
+ if (L && k && We(k, r.value)) {
2537
+ x(k);
2538
+ return;
2539
+ } else
2540
+ f(k, b || [], c.value);
2541
+ }, y = (u) => {
2542
+ const b = r.value.value;
2543
+ m(u) === c.value && n.value && n.value.setNodeCheckStatus && n.value.setNodeCheckStatus(u[b], !1), h();
2544
+ }, O = ({ node: u, tabKey: b }) => {
2545
+ let k = {};
2546
+ b === le.FEISHU_KNOWLEDGE ? k = {
2547
+ spaceId: u?.spaceId,
2548
+ parentNodeToken: u?.nodeToken
2549
+ } : b === le.MY_FILES && (k = {
2550
+ folderToken: u?.folderToken
2551
+ }), l("load-node", {
2552
+ nodeKey: u[r.value?.value],
2553
+ nodeData: u,
2554
+ tabKey: b,
2555
+ requestParams: k
2556
+ });
2557
+ }, x = (u) => {
2558
+ let b = {};
2559
+ c.value === le.FEISHU_KNOWLEDGE ? b = {
2560
+ spaceId: u?.spaceId,
2561
+ parentNodeToken: u?.nodeToken,
2562
+ recursive: !0
2563
+ } : c.value === le.MY_FILES && (b = {
2564
+ folderToken: u?.folderToken,
2565
+ recursive: !0
2566
+ }), l("recursive-load", {
2567
+ nodeKey: u[r.value?.value],
2568
+ nodeData: u,
2569
+ // 传递完整节点对象
2570
+ tabKey: c.value,
2571
+ requestParams: b
2572
+ });
2573
+ }, E = (u, b) => {
2574
+ n.value && n.value.updateNodeChildren && n.value.updateNodeChildren(u, b), c.value && w(c.value, u, b);
2575
+ }, q = (u) => {
2576
+ const { nodeKey: b, newChildren: k } = u;
2577
+ n.value?.updateNodeChildren && n.value.updateNodeChildren(b, k);
2578
+ }, ee = (u) => {
2579
+ const { nodeKey: b, tabKey: k, newChildren: L, originalNode: R, nodeData: Y, error: re } = u;
2580
+ if (re)
2581
+ return;
2582
+ const se = ni(
2583
+ s.treeData[k] || [],
2584
+ R?.id || b,
2585
+ r.value
2586
+ );
2587
+ if (!se)
2588
+ return;
2589
+ const V = p(k || c.value);
2590
+ f(se, V, k || c.value);
2591
+ }, F = (u) => {
2592
+ const { responseSearch: b } = u;
2593
+ S(b);
2594
+ }, Q = ({ keyword: u }) => {
2595
+ l("search", { keyword: u });
2596
+ }, z = () => {
2597
+ l("load-more", c.value);
2598
+ };
2599
+ return Ie(() => {
2600
+ s.modelValue && s.modelValue.length > 0 && _(s.modelValue, c.value);
2601
+ }), Z(
2602
+ () => s.modelValue,
2603
+ (u, b) => {
2604
+ if (!u || u.length === 0) {
2605
+ b && b.length > 0 && _([]);
2606
+ return;
2607
+ }
2608
+ const k = d.value;
2609
+ k.length === u.length && u.every(
2610
+ (R) => k.some(
2611
+ (Y) => Y[r.value.value] === R[r.value.value]
2612
+ )
2613
+ ) || _(u, c.value);
2614
+ },
2615
+ { deep: !0 }
2616
+ ), i({
2617
+ // 清空选择
2618
+ clearSelection: () => {
2619
+ _([]), h([]);
2620
+ },
2621
+ // 获取选中项
2622
+ getSelectedDocuments: () => d.value,
2623
+ // 设置选中项
2624
+ setSelectedDocuments: (u) => {
2625
+ _(u, c.value), h();
2626
+ },
2627
+ // 更新节点children
2628
+ updateNodeChildren: E
2629
+ }), (u, b) => (T(), P("div", cs, [
2630
+ H(rs, {
2631
+ tabs: e.tabs,
2632
+ "tree-data": $(v),
2633
+ "tree-props": r.value,
2634
+ "selected-documents": g.value,
2635
+ "current-tab": c.value,
2636
+ "search-type": e.searchType,
2637
+ "text-config": e.textConfig,
2638
+ "response-search-hook": $(N),
2639
+ ref_key: "leftLayoutRef",
2640
+ ref: n,
2641
+ onNodeCheck: C,
2642
+ onNodeCheckSearch: D,
2643
+ onTabChange: M,
2644
+ onSearch: Q,
2645
+ onNodeExpand: O,
2646
+ onLoadMore: z,
2647
+ getTabSelectedDocuments: $(p)
2648
+ }, null, 8, ["tabs", "tree-data", "tree-props", "selected-documents", "current-tab", "search-type", "text-config", "response-search-hook", "getTabSelectedDocuments"]),
2649
+ H(Yt, {
2650
+ "selected-documents": $(d),
2651
+ "tree-props": r.value,
2652
+ onDeleteNode: y
2653
+ }, null, 8, ["selected-documents", "tree-props"])
2654
+ ]));
2655
+ }
2656
+ }), us = /* @__PURE__ */ ae(ds, [["__scopeId", "data-v-c45c2d8e"]]), Ss = Ve(us), Ts = Ve(ye);
2657
+ export {
2658
+ Ss as DocSyncSelect,
2659
+ Ts as FileTypeIcon,
2660
+ Ss as default
2661
+ };