@superinterface/react 3.9.0 → 3.9.2
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.
- package/dist/cloud.cjs +613 -0
- package/dist/cloud.cjs.map +1 -0
- package/dist/cloud.d.cts +13 -0
- package/dist/cloud.d.ts +13 -0
- package/dist/cloud.js +543 -0
- package/dist/cloud.js.map +1 -0
- package/dist/index-CmzywRJS.d.cts +19 -0
- package/dist/index-CmzywRJS.d.ts +19 -0
- package/dist/index.cjs +34 -399
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -22
- package/dist/index.d.ts +4 -22
- package/dist/index.js +26 -387
- package/dist/index.js.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/cloud.cjs
ADDED
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _iterable_to_array_limit(arr, i) {
|
|
11
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
|
+
if (_i == null) return;
|
|
13
|
+
var _arr = [];
|
|
14
|
+
var _n = true;
|
|
15
|
+
var _d = false;
|
|
16
|
+
var _s, _e;
|
|
17
|
+
try {
|
|
18
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
19
|
+
_arr.push(_s.value);
|
|
20
|
+
if (i && _arr.length === i) break;
|
|
21
|
+
}
|
|
22
|
+
} catch (err) {
|
|
23
|
+
_d = true;
|
|
24
|
+
_e = err;
|
|
25
|
+
} finally{
|
|
26
|
+
try {
|
|
27
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
28
|
+
} finally{
|
|
29
|
+
if (_d) throw _e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return _arr;
|
|
33
|
+
}
|
|
34
|
+
function _non_iterable_rest() {
|
|
35
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
36
|
+
}
|
|
37
|
+
function _sliced_to_array(arr, i) {
|
|
38
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
39
|
+
}
|
|
40
|
+
function _type_of(obj) {
|
|
41
|
+
"@swc/helpers - typeof";
|
|
42
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
43
|
+
}
|
|
44
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
45
|
+
if (!o) return;
|
|
46
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
47
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
48
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
49
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
50
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
51
|
+
}
|
|
52
|
+
var __create = Object.create;
|
|
53
|
+
var __defProp = Object.defineProperty;
|
|
54
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
55
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
56
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
57
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
58
|
+
var __export = function(target, all) {
|
|
59
|
+
for(var name in all)__defProp(target, name, {
|
|
60
|
+
get: all[name],
|
|
61
|
+
enumerable: true
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
var __copyProps = function(to, from, except, desc) {
|
|
65
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
66
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
67
|
+
try {
|
|
68
|
+
var _loop = function() {
|
|
69
|
+
var key2 = _step.value;
|
|
70
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except) __defProp(to, key2, {
|
|
71
|
+
get: function() {
|
|
72
|
+
return from[key2];
|
|
73
|
+
},
|
|
74
|
+
enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
78
|
+
} catch (err) {
|
|
79
|
+
_didIteratorError = true;
|
|
80
|
+
_iteratorError = err;
|
|
81
|
+
} finally{
|
|
82
|
+
try {
|
|
83
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
84
|
+
_iterator.return();
|
|
85
|
+
}
|
|
86
|
+
} finally{
|
|
87
|
+
if (_didIteratorError) {
|
|
88
|
+
throw _iteratorError;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return to;
|
|
94
|
+
};
|
|
95
|
+
var __toESM = function(mod, isNodeMode, target) {
|
|
96
|
+
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
97
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
98
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
99
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
100
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
101
|
+
value: mod,
|
|
102
|
+
enumerable: true
|
|
103
|
+
}) : target, mod);
|
|
104
|
+
};
|
|
105
|
+
var __toCommonJS = function(mod) {
|
|
106
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
107
|
+
value: true
|
|
108
|
+
}), mod);
|
|
109
|
+
};
|
|
110
|
+
// src/cloud.ts
|
|
111
|
+
var cloud_exports = {};
|
|
112
|
+
__export(cloud_exports, {
|
|
113
|
+
SourceAnnotation: function() {
|
|
114
|
+
return SourceAnnotation;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
module.exports = __toCommonJS(cloud_exports);
|
|
118
|
+
// src/components/annotations/SourceAnnotation/index.tsx
|
|
119
|
+
var import_react_compiler_runtime4 = require("react-compiler-runtime");
|
|
120
|
+
// src/components/annotations/FilePathAnnotation.tsx
|
|
121
|
+
var import_react_compiler_runtime = require("react-compiler-runtime");
|
|
122
|
+
// src/hooks/core/useSuperinterfaceContext/index.ts
|
|
123
|
+
var import_react2 = require("react");
|
|
124
|
+
// src/contexts/core/SuperinterfaceContext/index.tsx
|
|
125
|
+
var import_react = require("react");
|
|
126
|
+
// src/lib/superinterfaceCloud/baseUrl.ts
|
|
127
|
+
var baseUrl = "https://superinterface.ai/api/cloud";
|
|
128
|
+
// src/lib/threadIdStorage/cookieOptions/get.ts
|
|
129
|
+
var import_js_cookie = __toESM(require("js-cookie"), 1);
|
|
130
|
+
// src/lib/threadIdStorage/key.ts
|
|
131
|
+
var key = function(_ref) {
|
|
132
|
+
var assistantId = _ref.assistantId;
|
|
133
|
+
return "superinterface-".concat(assistantId, "-threadId");
|
|
134
|
+
};
|
|
135
|
+
// src/lib/threadIdStorage/cookieOptions/get.ts
|
|
136
|
+
var get = function(_ref) {
|
|
137
|
+
var _Cookies$get;
|
|
138
|
+
var assistantId = _ref.assistantId;
|
|
139
|
+
return (_Cookies$get = import_js_cookie.default.get(key({
|
|
140
|
+
assistantId: assistantId
|
|
141
|
+
}))) !== null && _Cookies$get !== void 0 ? _Cookies$get : null;
|
|
142
|
+
};
|
|
143
|
+
// src/lib/threadIdStorage/cookieOptions/set.ts
|
|
144
|
+
var import_js_cookie2 = __toESM(require("js-cookie"), 1);
|
|
145
|
+
var set = function(_ref) {
|
|
146
|
+
var assistantId = _ref.assistantId, threadId = _ref.threadId;
|
|
147
|
+
return import_js_cookie2.default.set(key({
|
|
148
|
+
assistantId: assistantId
|
|
149
|
+
}), threadId);
|
|
150
|
+
};
|
|
151
|
+
// src/lib/threadIdStorage/cookieOptions/remove.ts
|
|
152
|
+
var import_js_cookie3 = __toESM(require("js-cookie"), 1);
|
|
153
|
+
var remove = function(_ref) {
|
|
154
|
+
var assistantId = _ref.assistantId;
|
|
155
|
+
return import_js_cookie3.default.remove(key({
|
|
156
|
+
assistantId: assistantId
|
|
157
|
+
}));
|
|
158
|
+
};
|
|
159
|
+
// src/lib/threadIdStorage/cookieOptions/index.ts
|
|
160
|
+
var cookieOptions = {
|
|
161
|
+
get: get,
|
|
162
|
+
set: set,
|
|
163
|
+
remove: remove
|
|
164
|
+
};
|
|
165
|
+
// src/lib/threadIdStorage/localStorageOptions/get.ts
|
|
166
|
+
var get2 = function(_ref) {
|
|
167
|
+
var assistantId = _ref.assistantId;
|
|
168
|
+
return window.localStorage.getItem(key({
|
|
169
|
+
assistantId: assistantId
|
|
170
|
+
}));
|
|
171
|
+
};
|
|
172
|
+
// src/lib/threadIdStorage/localStorageOptions/set.ts
|
|
173
|
+
var set2 = function(_ref) {
|
|
174
|
+
var assistantId = _ref.assistantId, threadId = _ref.threadId;
|
|
175
|
+
return window.localStorage.setItem(key({
|
|
176
|
+
assistantId: assistantId
|
|
177
|
+
}), threadId);
|
|
178
|
+
};
|
|
179
|
+
// src/lib/threadIdStorage/localStorageOptions/remove.ts
|
|
180
|
+
var remove2 = function(_ref) {
|
|
181
|
+
var assistantId = _ref.assistantId;
|
|
182
|
+
return window.localStorage.removeItem(key({
|
|
183
|
+
assistantId: assistantId
|
|
184
|
+
}));
|
|
185
|
+
};
|
|
186
|
+
// src/lib/threadIdStorage/localStorageOptions/index.ts
|
|
187
|
+
var localStorageOptions = {
|
|
188
|
+
get: get2,
|
|
189
|
+
set: set2,
|
|
190
|
+
remove: remove2
|
|
191
|
+
};
|
|
192
|
+
// src/lib/iframes/isIframe.ts
|
|
193
|
+
var isIframe = function() {
|
|
194
|
+
if (typeof window === "undefined") return false;
|
|
195
|
+
return window.self !== window.top;
|
|
196
|
+
};
|
|
197
|
+
// src/contexts/core/SuperinterfaceContext/index.tsx
|
|
198
|
+
var SuperinterfaceContext = /* @__PURE__ */ (0, import_react.createContext)({
|
|
199
|
+
baseUrl: baseUrl,
|
|
200
|
+
variables: {},
|
|
201
|
+
defaultOptions: {
|
|
202
|
+
queries: {},
|
|
203
|
+
mutations: {}
|
|
204
|
+
},
|
|
205
|
+
threadIdStorageOptions: isIframe() ? localStorageOptions : cookieOptions,
|
|
206
|
+
createMessageAbortControllerRef: {
|
|
207
|
+
current: null
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
// src/hooks/core/useSuperinterfaceContext/index.ts
|
|
211
|
+
var useSuperinterfaceContext = function() {
|
|
212
|
+
return (0, import_react2.useContext)(SuperinterfaceContext);
|
|
213
|
+
};
|
|
214
|
+
// src/contexts/markdown/MarkdownContext/lib/components/Link.tsx
|
|
215
|
+
var import_themes = require("@radix-ui/themes");
|
|
216
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
217
|
+
var Link = function(_ref) {
|
|
218
|
+
var children = _ref.children, href = _ref.href, download = _ref.download, _ref_target = _ref.target, target = _ref_target === void 0 ? "_blank" : _ref_target;
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Link, {
|
|
220
|
+
href: href,
|
|
221
|
+
target: target,
|
|
222
|
+
download: download,
|
|
223
|
+
children: children
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
// src/components/annotations/FilePathAnnotation.tsx
|
|
227
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
228
|
+
var FilePathAnnotation = function(t0) {
|
|
229
|
+
var $ = (0, import_react_compiler_runtime.c)(3);
|
|
230
|
+
var annotation = t0.annotation, children = t0.children;
|
|
231
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
232
|
+
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
233
|
+
var t1 = "".concat(superinterfaceContext.baseUrl, "/files/").concat(annotation.file_path.file_id, "/contents?").concat(nextSearchParams);
|
|
234
|
+
var t2;
|
|
235
|
+
if ($[0] !== children || $[1] !== t1) {
|
|
236
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Link, {
|
|
237
|
+
href: t1,
|
|
238
|
+
target: "_self",
|
|
239
|
+
download: true,
|
|
240
|
+
children: children
|
|
241
|
+
});
|
|
242
|
+
$[0] = children;
|
|
243
|
+
$[1] = t1;
|
|
244
|
+
$[2] = t2;
|
|
245
|
+
} else {
|
|
246
|
+
t2 = $[2];
|
|
247
|
+
}
|
|
248
|
+
return t2;
|
|
249
|
+
};
|
|
250
|
+
// src/components/annotations/SourceAnnotation/FileCitation/index.tsx
|
|
251
|
+
var import_react_compiler_runtime3 = require("react-compiler-runtime");
|
|
252
|
+
var import_react4 = require("react");
|
|
253
|
+
var import_react_icons2 = require("@radix-ui/react-icons");
|
|
254
|
+
var import_themes4 = require("@radix-ui/themes");
|
|
255
|
+
// src/components/annotations/SourceAnnotation/FileCitation/Content/index.tsx
|
|
256
|
+
var import_react_compiler_runtime2 = require("react-compiler-runtime");
|
|
257
|
+
var import_themes3 = require("@radix-ui/themes");
|
|
258
|
+
var import_react3 = require("@pdfslick/react");
|
|
259
|
+
var import_pdf_viewer = require("@pdfslick/react/dist/pdf_viewer.css");
|
|
260
|
+
// src/components/annotations/SourceAnnotation/FileCitation/Content/Navigation.tsx
|
|
261
|
+
var import_themes2 = require("@radix-ui/themes");
|
|
262
|
+
var import_react_icons = require("@radix-ui/react-icons");
|
|
263
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
264
|
+
var Navigation = function(_ref) {
|
|
265
|
+
var usePDFSlickStore = _ref.usePDFSlickStore;
|
|
266
|
+
var pdfSlick = usePDFSlickStore(function(s) {
|
|
267
|
+
return s.pdfSlick;
|
|
268
|
+
});
|
|
269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes2.Flex, {
|
|
270
|
+
justify: "center",
|
|
271
|
+
position: "absolute",
|
|
272
|
+
bottom: "var(--space-2)",
|
|
273
|
+
left: "0",
|
|
274
|
+
right: "0",
|
|
275
|
+
style: {
|
|
276
|
+
zIndex: 99999
|
|
277
|
+
},
|
|
278
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes2.Card, {
|
|
279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_themes2.Flex, {
|
|
280
|
+
gap: "2",
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes2.IconButton, {
|
|
283
|
+
variant: "soft",
|
|
284
|
+
onClick: function() {
|
|
285
|
+
var _pdfSlick$viewer;
|
|
286
|
+
return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer = pdfSlick.viewer) === null || _pdfSlick$viewer === void 0 ? void 0 : _pdfSlick$viewer.decreaseScale();
|
|
287
|
+
},
|
|
288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_icons.ZoomOutIcon, {})
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes2.IconButton, {
|
|
291
|
+
variant: "soft",
|
|
292
|
+
onClick: function() {
|
|
293
|
+
var _pdfSlick$viewer2;
|
|
294
|
+
return pdfSlick === null || pdfSlick === void 0 || (_pdfSlick$viewer2 = pdfSlick.viewer) === null || _pdfSlick$viewer2 === void 0 ? void 0 : _pdfSlick$viewer2.increaseScale();
|
|
295
|
+
},
|
|
296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_icons.ZoomInIcon, {})
|
|
297
|
+
})
|
|
298
|
+
]
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
// src/components/annotations/SourceAnnotation/FileCitation/Content/index.tsx
|
|
304
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
305
|
+
function ownKeys(e, r) {
|
|
306
|
+
var t = Object.keys(e);
|
|
307
|
+
if (Object.getOwnPropertySymbols) {
|
|
308
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
309
|
+
r && (o = o.filter(function(r2) {
|
|
310
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
311
|
+
})), t.push.apply(t, o);
|
|
312
|
+
}
|
|
313
|
+
return t;
|
|
314
|
+
}
|
|
315
|
+
function _objectSpread(e) {
|
|
316
|
+
for(var r = 1; r < arguments.length; r++){
|
|
317
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
318
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
319
|
+
_defineProperty(e, r2, t[r2]);
|
|
320
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
321
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
return e;
|
|
325
|
+
}
|
|
326
|
+
function _defineProperty(e, r, t) {
|
|
327
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
328
|
+
value: t,
|
|
329
|
+
enumerable: true,
|
|
330
|
+
configurable: true,
|
|
331
|
+
writable: true
|
|
332
|
+
}) : e[r] = t, e;
|
|
333
|
+
}
|
|
334
|
+
function _toPropertyKey(t) {
|
|
335
|
+
var i = _toPrimitive(t, "string");
|
|
336
|
+
return "symbol" == (typeof i === "undefined" ? "undefined" : _type_of(i)) ? i : i + "";
|
|
337
|
+
}
|
|
338
|
+
function _toPrimitive(t, r) {
|
|
339
|
+
if ("object" != (typeof t === "undefined" ? "undefined" : _type_of(t)) || !t) return t;
|
|
340
|
+
var e = t[Symbol.toPrimitive];
|
|
341
|
+
if (void 0 !== e) {
|
|
342
|
+
var i = e.call(t, r || "default");
|
|
343
|
+
if ("object" != (typeof i === "undefined" ? "undefined" : _type_of(i))) return i;
|
|
344
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
345
|
+
}
|
|
346
|
+
return ("string" === r ? String : Number)(t);
|
|
347
|
+
}
|
|
348
|
+
var Content = function(t0) {
|
|
349
|
+
var $ = (0, import_react_compiler_runtime2.c)(14);
|
|
350
|
+
var fileId = t0.fileId;
|
|
351
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
352
|
+
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
353
|
+
var t1;
|
|
354
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
355
|
+
t1 = {
|
|
356
|
+
scaleValue: "page-width",
|
|
357
|
+
removePageBorders: true
|
|
358
|
+
};
|
|
359
|
+
$[0] = t1;
|
|
360
|
+
} else {
|
|
361
|
+
t1 = $[0];
|
|
362
|
+
}
|
|
363
|
+
var _ref = (0, import_react3.usePDFSlick)("".concat(superinterfaceContext.baseUrl, "/api/cloud/files/").concat(fileId, "/contents?").concat(nextSearchParams), t1), viewerRef = _ref.viewerRef, usePDFSlickStore = _ref.usePDFSlickStore, PDFSlickViewer = _ref.PDFSlickViewer;
|
|
364
|
+
var t2;
|
|
365
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
366
|
+
t2 = {
|
|
367
|
+
display: "flex",
|
|
368
|
+
flexGrow: "1"
|
|
369
|
+
};
|
|
370
|
+
$[1] = t2;
|
|
371
|
+
} else {
|
|
372
|
+
t2 = $[1];
|
|
373
|
+
}
|
|
374
|
+
var t3;
|
|
375
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
376
|
+
t3 = {
|
|
377
|
+
display: "flex",
|
|
378
|
+
flexGrow: "1"
|
|
379
|
+
};
|
|
380
|
+
$[2] = t3;
|
|
381
|
+
} else {
|
|
382
|
+
t3 = $[2];
|
|
383
|
+
}
|
|
384
|
+
var t4;
|
|
385
|
+
if ($[3] !== usePDFSlickStore || $[4] !== viewerRef) {
|
|
386
|
+
t4 = {
|
|
387
|
+
viewerRef: viewerRef,
|
|
388
|
+
usePDFSlickStore: usePDFSlickStore
|
|
389
|
+
};
|
|
390
|
+
$[3] = usePDFSlickStore;
|
|
391
|
+
$[4] = viewerRef;
|
|
392
|
+
$[5] = t4;
|
|
393
|
+
} else {
|
|
394
|
+
t4 = $[5];
|
|
395
|
+
}
|
|
396
|
+
var t5;
|
|
397
|
+
if ($[6] !== PDFSlickViewer || $[7] !== t4) {
|
|
398
|
+
t5 = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PDFSlickViewer, _objectSpread({}, t4));
|
|
399
|
+
$[6] = PDFSlickViewer;
|
|
400
|
+
$[7] = t4;
|
|
401
|
+
$[8] = t5;
|
|
402
|
+
} else {
|
|
403
|
+
t5 = $[8];
|
|
404
|
+
}
|
|
405
|
+
var t6;
|
|
406
|
+
if ($[9] !== usePDFSlickStore) {
|
|
407
|
+
t6 = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Navigation, {
|
|
408
|
+
usePDFSlickStore: usePDFSlickStore
|
|
409
|
+
});
|
|
410
|
+
$[9] = usePDFSlickStore;
|
|
411
|
+
$[10] = t6;
|
|
412
|
+
} else {
|
|
413
|
+
t6 = $[10];
|
|
414
|
+
}
|
|
415
|
+
var t7;
|
|
416
|
+
if ($[11] !== t5 || $[12] !== t6) {
|
|
417
|
+
t7 = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_themes3.Flex, {
|
|
418
|
+
direction: "column",
|
|
419
|
+
flexGrow: "1",
|
|
420
|
+
gap: "3",
|
|
421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_themes3.Card, {
|
|
422
|
+
style: t2,
|
|
423
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_themes3.Inset, {
|
|
424
|
+
clip: "padding-box",
|
|
425
|
+
style: t3,
|
|
426
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_themes3.Flex, {
|
|
427
|
+
flexGrow: "1",
|
|
428
|
+
position: "relative",
|
|
429
|
+
children: [
|
|
430
|
+
t5,
|
|
431
|
+
t6
|
|
432
|
+
]
|
|
433
|
+
})
|
|
434
|
+
})
|
|
435
|
+
})
|
|
436
|
+
});
|
|
437
|
+
$[11] = t5;
|
|
438
|
+
$[12] = t6;
|
|
439
|
+
$[13] = t7;
|
|
440
|
+
} else {
|
|
441
|
+
t7 = $[13];
|
|
442
|
+
}
|
|
443
|
+
return t7;
|
|
444
|
+
};
|
|
445
|
+
// src/components/annotations/SourceAnnotation/FileCitation/index.tsx
|
|
446
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
447
|
+
var FileCitation = function(t0) {
|
|
448
|
+
var $ = (0, import_react_compiler_runtime3.c)(18);
|
|
449
|
+
var annotation = t0.annotation;
|
|
450
|
+
var _ref = _sliced_to_array((0, import_react4.useState)(null), 2), activeFileId = _ref[0], setActiveFileId = _ref[1];
|
|
451
|
+
var t1;
|
|
452
|
+
if ($[0] !== annotation.file_citation.file_id) {
|
|
453
|
+
t1 = function() {
|
|
454
|
+
setActiveFileId(annotation.file_citation.file_id);
|
|
455
|
+
};
|
|
456
|
+
$[0] = annotation.file_citation.file_id;
|
|
457
|
+
$[1] = t1;
|
|
458
|
+
} else {
|
|
459
|
+
t1 = $[1];
|
|
460
|
+
}
|
|
461
|
+
var t2;
|
|
462
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
463
|
+
t2 = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_icons2.QuoteIcon, {});
|
|
464
|
+
$[2] = t2;
|
|
465
|
+
} else {
|
|
466
|
+
t2 = $[2];
|
|
467
|
+
}
|
|
468
|
+
var t3;
|
|
469
|
+
if ($[3] !== t1) {
|
|
470
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_themes4.IconButton, {
|
|
471
|
+
variant: "soft",
|
|
472
|
+
color: "gray",
|
|
473
|
+
size: "1",
|
|
474
|
+
onClick: t1,
|
|
475
|
+
children: t2
|
|
476
|
+
});
|
|
477
|
+
$[3] = t1;
|
|
478
|
+
$[4] = t3;
|
|
479
|
+
} else {
|
|
480
|
+
t3 = $[4];
|
|
481
|
+
}
|
|
482
|
+
var t4 = !!activeFileId;
|
|
483
|
+
var t5;
|
|
484
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
485
|
+
t5 = function(open) {
|
|
486
|
+
if (!open) {
|
|
487
|
+
setActiveFileId(null);
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
$[5] = t5;
|
|
491
|
+
} else {
|
|
492
|
+
t5 = $[5];
|
|
493
|
+
}
|
|
494
|
+
var t6;
|
|
495
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
496
|
+
t6 = {
|
|
497
|
+
display: "flex",
|
|
498
|
+
flexDirection: "column"
|
|
499
|
+
};
|
|
500
|
+
$[6] = t6;
|
|
501
|
+
} else {
|
|
502
|
+
t6 = $[6];
|
|
503
|
+
}
|
|
504
|
+
var t7;
|
|
505
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
506
|
+
t7 = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_themes4.VisuallyHidden, {
|
|
507
|
+
asChild: true,
|
|
508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_themes4.Dialog.Title, {
|
|
509
|
+
children: "Source"
|
|
510
|
+
})
|
|
511
|
+
});
|
|
512
|
+
$[7] = t7;
|
|
513
|
+
} else {
|
|
514
|
+
t7 = $[7];
|
|
515
|
+
}
|
|
516
|
+
var t8;
|
|
517
|
+
if ($[8] !== activeFileId) {
|
|
518
|
+
t8 = activeFileId && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Content, {
|
|
519
|
+
fileId: activeFileId
|
|
520
|
+
});
|
|
521
|
+
$[8] = activeFileId;
|
|
522
|
+
$[9] = t8;
|
|
523
|
+
} else {
|
|
524
|
+
t8 = $[9];
|
|
525
|
+
}
|
|
526
|
+
var t9;
|
|
527
|
+
if ($[10] !== t8) {
|
|
528
|
+
t9 = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_themes4.Dialog.Content, {
|
|
529
|
+
width: "1000px",
|
|
530
|
+
height: "90vh",
|
|
531
|
+
maxWidth: "calc(100vw - 2 * var(--space-4))",
|
|
532
|
+
"aria-describedby": void 0,
|
|
533
|
+
style: t6,
|
|
534
|
+
children: [
|
|
535
|
+
t7,
|
|
536
|
+
t8
|
|
537
|
+
]
|
|
538
|
+
});
|
|
539
|
+
$[10] = t8;
|
|
540
|
+
$[11] = t9;
|
|
541
|
+
} else {
|
|
542
|
+
t9 = $[11];
|
|
543
|
+
}
|
|
544
|
+
var t10;
|
|
545
|
+
if ($[12] !== t4 || $[13] !== t9) {
|
|
546
|
+
t10 = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_themes4.Dialog.Root, {
|
|
547
|
+
open: t4,
|
|
548
|
+
onOpenChange: t5,
|
|
549
|
+
children: t9
|
|
550
|
+
});
|
|
551
|
+
$[12] = t4;
|
|
552
|
+
$[13] = t9;
|
|
553
|
+
$[14] = t10;
|
|
554
|
+
} else {
|
|
555
|
+
t10 = $[14];
|
|
556
|
+
}
|
|
557
|
+
var t11;
|
|
558
|
+
if ($[15] !== t10 || $[16] !== t3) {
|
|
559
|
+
t11 = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, {
|
|
560
|
+
children: [
|
|
561
|
+
t3,
|
|
562
|
+
t10
|
|
563
|
+
]
|
|
564
|
+
});
|
|
565
|
+
$[15] = t10;
|
|
566
|
+
$[16] = t3;
|
|
567
|
+
$[17] = t11;
|
|
568
|
+
} else {
|
|
569
|
+
t11 = $[17];
|
|
570
|
+
}
|
|
571
|
+
return t11;
|
|
572
|
+
};
|
|
573
|
+
// src/components/annotations/SourceAnnotation/index.tsx
|
|
574
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
575
|
+
var SourceAnnotation = function(t0) {
|
|
576
|
+
var $ = (0, import_react_compiler_runtime4.c)(5);
|
|
577
|
+
var annotation = t0.annotation, children = t0.children;
|
|
578
|
+
if (annotation.type === "file_citation") {
|
|
579
|
+
var t1;
|
|
580
|
+
if ($[0] !== annotation) {
|
|
581
|
+
t1 = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FileCitation, {
|
|
582
|
+
annotation: annotation
|
|
583
|
+
});
|
|
584
|
+
$[0] = annotation;
|
|
585
|
+
$[1] = t1;
|
|
586
|
+
} else {
|
|
587
|
+
t1 = $[1];
|
|
588
|
+
}
|
|
589
|
+
return t1;
|
|
590
|
+
} else {
|
|
591
|
+
if (annotation.type === "file_path") {
|
|
592
|
+
var _t;
|
|
593
|
+
if ($[2] !== annotation || $[3] !== children) {
|
|
594
|
+
_t = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FilePathAnnotation, {
|
|
595
|
+
annotation: annotation,
|
|
596
|
+
children: children
|
|
597
|
+
});
|
|
598
|
+
$[2] = annotation;
|
|
599
|
+
$[3] = children;
|
|
600
|
+
$[4] = _t;
|
|
601
|
+
} else {
|
|
602
|
+
_t = $[4];
|
|
603
|
+
}
|
|
604
|
+
return _t;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return null;
|
|
608
|
+
};
|
|
609
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
610
|
+
0 && (module.exports = {
|
|
611
|
+
SourceAnnotation: SourceAnnotation
|
|
612
|
+
});
|
|
613
|
+
//# sourceMappingURL=cloud.cjs.map
|