pxengine 0.1.46 → 0.1.48
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/index.cjs +2221 -436
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -8
- package/dist/index.d.ts +68 -8
- package/dist/index.mjs +2322 -540
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +251 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -122,6 +122,7 @@ __export(index_exports, {
|
|
|
122
122
|
CountrySelectEdit: () => CountrySelectEdit,
|
|
123
123
|
CreatorActionHeader: () => CreatorActionHeader,
|
|
124
124
|
CreatorCompactView: () => CreatorCompactView,
|
|
125
|
+
CreatorExpandedPanel: () => CreatorExpandedPanel,
|
|
125
126
|
CreatorGridCard: () => CreatorGridCard,
|
|
126
127
|
CreatorImageList: () => CreatorImageList,
|
|
127
128
|
CreatorProfileSummary: () => CreatorProfileSummary,
|
|
@@ -307,6 +308,8 @@ __export(index_exports, {
|
|
|
307
308
|
VideoAtom: () => VideoAtom,
|
|
308
309
|
WorkflowVisualizer: () => WorkflowVisualizer,
|
|
309
310
|
cn: () => cn,
|
|
311
|
+
defaultFetchSelections: () => defaultFetchSelections,
|
|
312
|
+
defaultPersistSelection: () => defaultPersistSelection,
|
|
310
313
|
generateFieldsFromData: () => generateFieldsFromData,
|
|
311
314
|
generateFieldsFromPropDefinitions: () => generateFieldsFromPropDefinitions,
|
|
312
315
|
useCreatorWidgetPolling: () => useCreatorWidgetPolling
|
|
@@ -314,7 +317,7 @@ __export(index_exports, {
|
|
|
314
317
|
module.exports = __toCommonJS(index_exports);
|
|
315
318
|
|
|
316
319
|
// src/render/PXEngineRenderer.tsx
|
|
317
|
-
var
|
|
320
|
+
var import_react79 = __toESM(require("react"), 1);
|
|
318
321
|
|
|
319
322
|
// src/atoms/index.ts
|
|
320
323
|
var atoms_exports = {};
|
|
@@ -33598,6 +33601,7 @@ __export(molecules_exports, {
|
|
|
33598
33601
|
CountrySelectEdit: () => CountrySelectEdit,
|
|
33599
33602
|
CreatorActionHeader: () => CreatorActionHeader,
|
|
33600
33603
|
CreatorCompactView: () => CreatorCompactView,
|
|
33604
|
+
CreatorExpandedPanel: () => CreatorExpandedPanel,
|
|
33601
33605
|
CreatorGridCard: () => CreatorGridCard,
|
|
33602
33606
|
CreatorImageList: () => CreatorImageList,
|
|
33603
33607
|
CreatorProfileSummary: () => CreatorProfileSummary,
|
|
@@ -33633,6 +33637,8 @@ __export(molecules_exports, {
|
|
|
33633
33637
|
TopPostsGrid: () => TopPostsGrid,
|
|
33634
33638
|
UIComponentSelector: () => UIComponentSelector,
|
|
33635
33639
|
WorkflowVisualizer: () => WorkflowVisualizer,
|
|
33640
|
+
defaultFetchSelections: () => defaultFetchSelections,
|
|
33641
|
+
defaultPersistSelection: () => defaultPersistSelection,
|
|
33636
33642
|
useCreatorWidgetPolling: () => useCreatorWidgetPolling
|
|
33637
33643
|
});
|
|
33638
33644
|
|
|
@@ -35705,12 +35711,16 @@ var CampaignSeedCard = import_react60.default.memo(
|
|
|
35705
35711
|
fields: providedFields,
|
|
35706
35712
|
data,
|
|
35707
35713
|
onAction,
|
|
35714
|
+
sendMessage,
|
|
35708
35715
|
...formCardProps
|
|
35709
35716
|
}) => {
|
|
35710
35717
|
const fields = (0, import_react60.useMemo)(() => {
|
|
35711
35718
|
return providedFields || buildCampaignSeedFields(data);
|
|
35712
35719
|
}, [providedFields, data]);
|
|
35713
35720
|
const handleProceed = () => {
|
|
35721
|
+
if (sendMessage) {
|
|
35722
|
+
sendMessage("Continue to concepts");
|
|
35723
|
+
}
|
|
35714
35724
|
onAction?.({
|
|
35715
35725
|
type: "brief_confirmation",
|
|
35716
35726
|
value: "Continue to concepts",
|
|
@@ -35867,6 +35877,7 @@ var SearchSpecCard = import_react61.default.memo(
|
|
|
35867
35877
|
data,
|
|
35868
35878
|
specData,
|
|
35869
35879
|
onAction,
|
|
35880
|
+
sendMessage,
|
|
35870
35881
|
...formCardProps
|
|
35871
35882
|
}) => {
|
|
35872
35883
|
const resolvedData = data || specData;
|
|
@@ -35874,6 +35885,9 @@ var SearchSpecCard = import_react61.default.memo(
|
|
|
35874
35885
|
return providedFields || buildSearchSpecFields(resolvedData ?? {});
|
|
35875
35886
|
}, [providedFields, resolvedData]);
|
|
35876
35887
|
const handleProceed = () => {
|
|
35888
|
+
if (sendMessage) {
|
|
35889
|
+
sendMessage("Continue with search");
|
|
35890
|
+
}
|
|
35877
35891
|
onAction?.({
|
|
35878
35892
|
type: "search_spec_confirmation",
|
|
35879
35893
|
value: "Continue with search",
|
|
@@ -35904,6 +35918,41 @@ SearchSpecCard.displayName = "SearchSpecCard";
|
|
|
35904
35918
|
|
|
35905
35919
|
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35906
35920
|
var import_react62 = __toESM(require("react"), 1);
|
|
35921
|
+
|
|
35922
|
+
// src/molecules/creator-discovery/MCQCard/defaultFetchers.ts
|
|
35923
|
+
async function defaultFetchSelections(sessionId) {
|
|
35924
|
+
try {
|
|
35925
|
+
const res = await fetch(
|
|
35926
|
+
`/api/agents-proxy/custom-agents/sessions/${sessionId}/mcq-selections/get`,
|
|
35927
|
+
{
|
|
35928
|
+
method: "POST",
|
|
35929
|
+
headers: { "Content-Type": "application/json" },
|
|
35930
|
+
body: "{}"
|
|
35931
|
+
}
|
|
35932
|
+
);
|
|
35933
|
+
if (!res.ok) return {};
|
|
35934
|
+
const data = await res.json();
|
|
35935
|
+
return data.selections || {};
|
|
35936
|
+
} catch {
|
|
35937
|
+
return {};
|
|
35938
|
+
}
|
|
35939
|
+
}
|
|
35940
|
+
async function defaultPersistSelection(sessionId, questionKey, value) {
|
|
35941
|
+
try {
|
|
35942
|
+
await fetch(
|
|
35943
|
+
`/api/agents-proxy/custom-agents/sessions/${sessionId}/mcq-selections`,
|
|
35944
|
+
{
|
|
35945
|
+
method: "PATCH",
|
|
35946
|
+
headers: { "Content-Type": "application/json" },
|
|
35947
|
+
body: JSON.stringify({ question_key: questionKey, value })
|
|
35948
|
+
}
|
|
35949
|
+
);
|
|
35950
|
+
} catch (err) {
|
|
35951
|
+
console.warn("[MCQ persist failed]", err);
|
|
35952
|
+
}
|
|
35953
|
+
}
|
|
35954
|
+
|
|
35955
|
+
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35907
35956
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
35908
35957
|
var MCQCard = import_react62.default.memo(
|
|
35909
35958
|
({
|
|
@@ -35916,22 +35965,39 @@ var MCQCard = import_react62.default.memo(
|
|
|
35916
35965
|
isLatestMessage = true,
|
|
35917
35966
|
isLoading = false,
|
|
35918
35967
|
className,
|
|
35919
|
-
// selectionStatus,
|
|
35920
35968
|
onAction,
|
|
35921
35969
|
disabled = false,
|
|
35922
|
-
disableContinueInDiscovery
|
|
35923
|
-
//
|
|
35970
|
+
disableContinueInDiscovery,
|
|
35971
|
+
// Self-contained props
|
|
35972
|
+
sessionId,
|
|
35973
|
+
sendMessage,
|
|
35974
|
+
fetchSelections = defaultFetchSelections,
|
|
35975
|
+
persistSelection = defaultPersistSelection
|
|
35924
35976
|
}) => {
|
|
35925
35977
|
const [selectedOption, setSelectedOption] = import_react62.default.useState(
|
|
35926
35978
|
propsSelectedOption
|
|
35927
35979
|
);
|
|
35928
35980
|
const [isProceeded, setIsProceeded] = import_react62.default.useState(false);
|
|
35981
|
+
const fetchedSessionRef = import_react62.default.useRef("");
|
|
35929
35982
|
import_react62.default.useEffect(() => {
|
|
35930
35983
|
if (propsSelectedOption) {
|
|
35931
35984
|
setSelectedOption(propsSelectedOption);
|
|
35932
35985
|
setIsProceeded(true);
|
|
35933
35986
|
}
|
|
35934
35987
|
}, [propsSelectedOption]);
|
|
35988
|
+
import_react62.default.useEffect(() => {
|
|
35989
|
+
if (!sessionId || fetchedSessionRef.current === sessionId) return;
|
|
35990
|
+
if (propsSelectedOption) return;
|
|
35991
|
+
fetchedSessionRef.current = sessionId;
|
|
35992
|
+
const questionKey = question || "unknown";
|
|
35993
|
+
fetchSelections(sessionId).then((selections) => {
|
|
35994
|
+
const stored = selections[questionKey];
|
|
35995
|
+
if (stored) {
|
|
35996
|
+
setSelectedOption(stored);
|
|
35997
|
+
setIsProceeded(true);
|
|
35998
|
+
}
|
|
35999
|
+
});
|
|
36000
|
+
}, [sessionId, question, propsSelectedOption, fetchSelections]);
|
|
35935
36001
|
const isDiscovery = disableContinueInDiscovery !== void 0 ? disableContinueInDiscovery : typeof window !== "undefined" && window.location.pathname.includes("creator-discovery");
|
|
35936
36002
|
const handleOptionClick = (key, e) => {
|
|
35937
36003
|
e.preventDefault();
|
|
@@ -35946,12 +36012,20 @@ var MCQCard = import_react62.default.memo(
|
|
|
35946
36012
|
e.stopPropagation();
|
|
35947
36013
|
if ((selectedOption || recommended) && !disabled && !isProceeded) {
|
|
35948
36014
|
const result = selectedOption || recommended || "";
|
|
36015
|
+
const label = options && options[result] || result;
|
|
35949
36016
|
setIsProceeded(true);
|
|
36017
|
+
if (sessionId) {
|
|
36018
|
+
const questionKey = question || "unknown";
|
|
36019
|
+
persistSelection(sessionId, questionKey, result);
|
|
36020
|
+
}
|
|
36021
|
+
if (sendMessage) {
|
|
36022
|
+
sendMessage(`Selected: ${label}`);
|
|
36023
|
+
}
|
|
35950
36024
|
onProceed?.(result);
|
|
35951
36025
|
onAction?.({
|
|
35952
36026
|
type: "mcq_selection",
|
|
35953
36027
|
value: result,
|
|
35954
|
-
label
|
|
36028
|
+
label
|
|
35955
36029
|
});
|
|
35956
36030
|
}
|
|
35957
36031
|
};
|
|
@@ -36956,7 +37030,7 @@ var CampaignConceptCard = import_react64.default.memo(
|
|
|
36956
37030
|
CampaignConceptCard.displayName = "CampaignConceptCard";
|
|
36957
37031
|
|
|
36958
37032
|
// src/molecules/creator-discovery/CreatorWidget/CreatorWidget.tsx
|
|
36959
|
-
var
|
|
37033
|
+
var import_react72 = require("react");
|
|
36960
37034
|
|
|
36961
37035
|
// src/molecules/creator-discovery/CreatorWidget/CreatorImageList.tsx
|
|
36962
37036
|
var import_react65 = require("react");
|
|
@@ -37214,8 +37288,1679 @@ function CreatorCompactView({
|
|
|
37214
37288
|
] }) });
|
|
37215
37289
|
}
|
|
37216
37290
|
|
|
37217
|
-
// src/molecules/creator-discovery/CreatorWidget/
|
|
37291
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
|
|
37292
|
+
var import_react70 = require("react");
|
|
37293
|
+
var import_react_dom2 = __toESM(require("react-dom"), 1);
|
|
37294
|
+
var import_framer_motion5 = require("framer-motion");
|
|
37295
|
+
|
|
37296
|
+
// src/molecules/creator-discovery/CreatorWidget/defaultFetchers.ts
|
|
37297
|
+
async function defaultFetchVersions(params) {
|
|
37298
|
+
const versionParam = params.version ? `&version=${params.version}` : "";
|
|
37299
|
+
const res = await fetch(
|
|
37300
|
+
`/api/get-creator-versions?sessionId=${params.sessionId}${versionParam}&validated=${params.validated}`
|
|
37301
|
+
);
|
|
37302
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37303
|
+
return res.json();
|
|
37304
|
+
}
|
|
37305
|
+
async function defaultFetchStatus(params) {
|
|
37306
|
+
const res = await fetch(
|
|
37307
|
+
`/api/get-creator-detail-status?session_id=${params.sessionId}&version_no=${params.versionNo}`
|
|
37308
|
+
);
|
|
37309
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37310
|
+
return res.json();
|
|
37311
|
+
}
|
|
37312
|
+
async function defaultFetchCreatorDetails(params) {
|
|
37313
|
+
const res = await fetch("/api/get-creator-details-by-id", {
|
|
37314
|
+
method: "POST",
|
|
37315
|
+
headers: { "Content-Type": "application/json" },
|
|
37316
|
+
body: JSON.stringify({
|
|
37317
|
+
creator_ids: params.creatorIds,
|
|
37318
|
+
session_id: params.sessionId,
|
|
37319
|
+
version_no: params.versionNo
|
|
37320
|
+
})
|
|
37321
|
+
});
|
|
37322
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37323
|
+
return res.json();
|
|
37324
|
+
}
|
|
37325
|
+
|
|
37326
|
+
// src/molecules/creator-discovery/CreatorWidget/countries.ts
|
|
37327
|
+
var countries2 = [
|
|
37328
|
+
{ code: "AF", name: "Afghanistan", flag: "\u{1F1E6}\u{1F1EB}" },
|
|
37329
|
+
{ code: "AL", name: "Albania", flag: "\u{1F1E6}\u{1F1F1}" },
|
|
37330
|
+
{ code: "DZ", name: "Algeria", flag: "\u{1F1E9}\u{1F1FF}" },
|
|
37331
|
+
{ code: "AD", name: "Andorra", flag: "\u{1F1E6}\u{1F1E9}" },
|
|
37332
|
+
{ code: "AO", name: "Angola", flag: "\u{1F1E6}\u{1F1F4}" },
|
|
37333
|
+
{ code: "AG", name: "Antigua and Barbuda", flag: "\u{1F1E6}\u{1F1EC}" },
|
|
37334
|
+
{ code: "AR", name: "Argentina", flag: "\u{1F1E6}\u{1F1F7}" },
|
|
37335
|
+
{ code: "AM", name: "Armenia", flag: "\u{1F1E6}\u{1F1F2}" },
|
|
37336
|
+
{ code: "AU", name: "Australia", flag: "\u{1F1E6}\u{1F1FA}" },
|
|
37337
|
+
{ code: "AT", name: "Austria", flag: "\u{1F1E6}\u{1F1F9}" },
|
|
37338
|
+
{ code: "AZ", name: "Azerbaijan", flag: "\u{1F1E6}\u{1F1FF}" },
|
|
37339
|
+
{ code: "BS", name: "Bahamas", flag: "\u{1F1E7}\u{1F1F8}" },
|
|
37340
|
+
{ code: "BH", name: "Bahrain", flag: "\u{1F1E7}\u{1F1ED}" },
|
|
37341
|
+
{ code: "BD", name: "Bangladesh", flag: "\u{1F1E7}\u{1F1E9}" },
|
|
37342
|
+
{ code: "BB", name: "Barbados", flag: "\u{1F1E7}\u{1F1E7}" },
|
|
37343
|
+
{ code: "BY", name: "Belarus", flag: "\u{1F1E7}\u{1F1FE}" },
|
|
37344
|
+
{ code: "BE", name: "Belgium", flag: "\u{1F1E7}\u{1F1EA}" },
|
|
37345
|
+
{ code: "BZ", name: "Belize", flag: "\u{1F1E7}\u{1F1FF}" },
|
|
37346
|
+
{ code: "BJ", name: "Benin", flag: "\u{1F1E7}\u{1F1EF}" },
|
|
37347
|
+
{ code: "BT", name: "Bhutan", flag: "\u{1F1E7}\u{1F1F9}" },
|
|
37348
|
+
{ code: "BO", name: "Bolivia", flag: "\u{1F1E7}\u{1F1F4}" },
|
|
37349
|
+
{ code: "BA", name: "Bosnia and Herzegovina", flag: "\u{1F1E7}\u{1F1E6}" },
|
|
37350
|
+
{ code: "BW", name: "Botswana", flag: "\u{1F1E7}\u{1F1FC}" },
|
|
37351
|
+
{ code: "BR", name: "Brazil", flag: "\u{1F1E7}\u{1F1F7}" },
|
|
37352
|
+
{ code: "BN", name: "Brunei", flag: "\u{1F1E7}\u{1F1F3}" },
|
|
37353
|
+
{ code: "BG", name: "Bulgaria", flag: "\u{1F1E7}\u{1F1EC}" },
|
|
37354
|
+
{ code: "BF", name: "Burkina Faso", flag: "\u{1F1E7}\u{1F1EB}" },
|
|
37355
|
+
{ code: "BI", name: "Burundi", flag: "\u{1F1E7}\u{1F1EE}" },
|
|
37356
|
+
{ code: "CV", name: "Cabo Verde", flag: "\u{1F1E8}\u{1F1FB}" },
|
|
37357
|
+
{ code: "KH", name: "Cambodia", flag: "\u{1F1F0}\u{1F1ED}" },
|
|
37358
|
+
{ code: "CM", name: "Cameroon", flag: "\u{1F1E8}\u{1F1F2}" },
|
|
37359
|
+
{ code: "CA", name: "Canada", flag: "\u{1F1E8}\u{1F1E6}" },
|
|
37360
|
+
{ code: "CF", name: "Central African Republic", flag: "\u{1F1E8}\u{1F1EB}" },
|
|
37361
|
+
{ code: "TD", name: "Chad", flag: "\u{1F1F9}\u{1F1E9}" },
|
|
37362
|
+
{ code: "CL", name: "Chile", flag: "\u{1F1E8}\u{1F1F1}" },
|
|
37363
|
+
{ code: "CN", name: "China", flag: "\u{1F1E8}\u{1F1F3}" },
|
|
37364
|
+
{ code: "CO", name: "Colombia", flag: "\u{1F1E8}\u{1F1F4}" },
|
|
37365
|
+
{ code: "KM", name: "Comoros", flag: "\u{1F1F0}\u{1F1F2}" },
|
|
37366
|
+
{ code: "CG", name: "Congo", flag: "\u{1F1E8}\u{1F1EC}" },
|
|
37367
|
+
{ code: "CD", name: "Democratic Republic of the Congo", flag: "\u{1F1E8}\u{1F1E9}" },
|
|
37368
|
+
{ code: "CR", name: "Costa Rica", flag: "\u{1F1E8}\u{1F1F7}" },
|
|
37369
|
+
{ code: "HR", name: "Croatia", flag: "\u{1F1ED}\u{1F1F7}" },
|
|
37370
|
+
{ code: "CU", name: "Cuba", flag: "\u{1F1E8}\u{1F1FA}" },
|
|
37371
|
+
{ code: "CY", name: "Cyprus", flag: "\u{1F1E8}\u{1F1FE}" },
|
|
37372
|
+
{ code: "CZ", name: "Czech Republic", flag: "\u{1F1E8}\u{1F1FF}" },
|
|
37373
|
+
{ code: "CI", name: "Ivory Coast", flag: "\u{1F1E8}\u{1F1EE}" },
|
|
37374
|
+
{ code: "DK", name: "Denmark", flag: "\u{1F1E9}\u{1F1F0}" },
|
|
37375
|
+
{ code: "DJ", name: "Djibouti", flag: "\u{1F1E9}\u{1F1EF}" },
|
|
37376
|
+
{ code: "DM", name: "Dominica", flag: "\u{1F1E9}\u{1F1F2}" },
|
|
37377
|
+
{ code: "DO", name: "Dominican Republic", flag: "\u{1F1E9}\u{1F1F4}" },
|
|
37378
|
+
{ code: "EC", name: "Ecuador", flag: "\u{1F1EA}\u{1F1E8}" },
|
|
37379
|
+
{ code: "EG", name: "Egypt", flag: "\u{1F1EA}\u{1F1EC}" },
|
|
37380
|
+
{ code: "SV", name: "El Salvador", flag: "\u{1F1F8}\u{1F1FB}" },
|
|
37381
|
+
{ code: "GQ", name: "Equatorial Guinea", flag: "\u{1F1EC}\u{1F1F6}" },
|
|
37382
|
+
{ code: "ER", name: "Eritrea", flag: "\u{1F1EA}\u{1F1F7}" },
|
|
37383
|
+
{ code: "EE", name: "Estonia", flag: "\u{1F1EA}\u{1F1EA}" },
|
|
37384
|
+
{ code: "SZ", name: "Eswatini", flag: "\u{1F1F8}\u{1F1FF}" },
|
|
37385
|
+
{ code: "ET", name: "Ethiopia", flag: "\u{1F1EA}\u{1F1F9}" },
|
|
37386
|
+
{ code: "FJ", name: "Fiji", flag: "\u{1F1EB}\u{1F1EF}" },
|
|
37387
|
+
{ code: "FI", name: "Finland", flag: "\u{1F1EB}\u{1F1EE}" },
|
|
37388
|
+
{ code: "FR", name: "France", flag: "\u{1F1EB}\u{1F1F7}" },
|
|
37389
|
+
{ code: "GA", name: "Gabon", flag: "\u{1F1EC}\u{1F1E6}" },
|
|
37390
|
+
{ code: "GM", name: "Gambia", flag: "\u{1F1EC}\u{1F1F2}" },
|
|
37391
|
+
{ code: "GE", name: "Georgia", flag: "\u{1F1EC}\u{1F1EA}" },
|
|
37392
|
+
{ code: "DE", name: "Germany", flag: "\u{1F1E9}\u{1F1EA}" },
|
|
37393
|
+
{ code: "GH", name: "Ghana", flag: "\u{1F1EC}\u{1F1ED}" },
|
|
37394
|
+
{ code: "GR", name: "Greece", flag: "\u{1F1EC}\u{1F1F7}" },
|
|
37395
|
+
{ code: "GD", name: "Grenada", flag: "\u{1F1EC}\u{1F1E9}" },
|
|
37396
|
+
{ code: "GT", name: "Guatemala", flag: "\u{1F1EC}\u{1F1F9}" },
|
|
37397
|
+
{ code: "GN", name: "Guinea", flag: "\u{1F1EC}\u{1F1F3}" },
|
|
37398
|
+
{ code: "GW", name: "Guinea-Bissau", flag: "\u{1F1EC}\u{1F1FC}" },
|
|
37399
|
+
{ code: "GY", name: "Guyana", flag: "\u{1F1EC}\u{1F1FE}" },
|
|
37400
|
+
{ code: "HT", name: "Haiti", flag: "\u{1F1ED}\u{1F1F9}" },
|
|
37401
|
+
{ code: "HN", name: "Honduras", flag: "\u{1F1ED}\u{1F1F3}" },
|
|
37402
|
+
{ code: "HU", name: "Hungary", flag: "\u{1F1ED}\u{1F1FA}" },
|
|
37403
|
+
{ code: "HK", name: "Hong Kong", flag: "\u{1F1ED}\u{1F1F0}" },
|
|
37404
|
+
{ code: "IS", name: "Iceland", flag: "\u{1F1EE}\u{1F1F8}" },
|
|
37405
|
+
{ code: "IN", name: "India", flag: "\u{1F1EE}\u{1F1F3}" },
|
|
37406
|
+
{ code: "ID", name: "Indonesia", flag: "\u{1F1EE}\u{1F1E9}" },
|
|
37407
|
+
{ code: "IR", name: "Iran", flag: "\u{1F1EE}\u{1F1F7}" },
|
|
37408
|
+
{ code: "IQ", name: "Iraq", flag: "\u{1F1EE}\u{1F1F6}" },
|
|
37409
|
+
{ code: "IE", name: "Ireland", flag: "\u{1F1EE}\u{1F1EA}" },
|
|
37410
|
+
{ code: "IL", name: "Israel", flag: "\u{1F1EE}\u{1F1F1}" },
|
|
37411
|
+
{ code: "IT", name: "Italy", flag: "\u{1F1EE}\u{1F1F9}" },
|
|
37412
|
+
{ code: "JM", name: "Jamaica", flag: "\u{1F1EF}\u{1F1F2}" },
|
|
37413
|
+
{ code: "JP", name: "Japan", flag: "\u{1F1EF}\u{1F1F5}" },
|
|
37414
|
+
{ code: "JO", name: "Jordan", flag: "\u{1F1EF}\u{1F1F4}" },
|
|
37415
|
+
{ code: "KZ", name: "Kazakhstan", flag: "\u{1F1F0}\u{1F1FF}" },
|
|
37416
|
+
{ code: "KE", name: "Kenya", flag: "\u{1F1F0}\u{1F1EA}" },
|
|
37417
|
+
{ code: "KI", name: "Kiribati", flag: "\u{1F1F0}\u{1F1EE}" },
|
|
37418
|
+
{ code: "KP", name: "North Korea", flag: "\u{1F1F0}\u{1F1F5}" },
|
|
37419
|
+
{ code: "KR", name: "South Korea", flag: "\u{1F1F0}\u{1F1F7}" },
|
|
37420
|
+
{ code: "KW", name: "Kuwait", flag: "\u{1F1F0}\u{1F1FC}" },
|
|
37421
|
+
{ code: "KG", name: "Kyrgyzstan", flag: "\u{1F1F0}\u{1F1EC}" },
|
|
37422
|
+
{ code: "LA", name: "Laos", flag: "\u{1F1F1}\u{1F1E6}" },
|
|
37423
|
+
{ code: "LV", name: "Latvia", flag: "\u{1F1F1}\u{1F1FB}" },
|
|
37424
|
+
{ code: "LB", name: "Lebanon", flag: "\u{1F1F1}\u{1F1E7}" },
|
|
37425
|
+
{ code: "LS", name: "Lesotho", flag: "\u{1F1F1}\u{1F1F8}" },
|
|
37426
|
+
{ code: "LR", name: "Liberia", flag: "\u{1F1F1}\u{1F1F7}" },
|
|
37427
|
+
{ code: "LY", name: "Libya", flag: "\u{1F1F1}\u{1F1FE}" },
|
|
37428
|
+
{ code: "LI", name: "Liechtenstein", flag: "\u{1F1F1}\u{1F1EE}" },
|
|
37429
|
+
{ code: "LT", name: "Lithuania", flag: "\u{1F1F1}\u{1F1F9}" },
|
|
37430
|
+
{ code: "LU", name: "Luxembourg", flag: "\u{1F1F1}\u{1F1FA}" },
|
|
37431
|
+
{ code: "MG", name: "Madagascar", flag: "\u{1F1F2}\u{1F1EC}" },
|
|
37432
|
+
{ code: "MW", name: "Malawi", flag: "\u{1F1F2}\u{1F1FC}" },
|
|
37433
|
+
{ code: "MY", name: "Malaysia", flag: "\u{1F1F2}\u{1F1FE}" },
|
|
37434
|
+
{ code: "MV", name: "Maldives", flag: "\u{1F1F2}\u{1F1FB}" },
|
|
37435
|
+
{ code: "ML", name: "Mali", flag: "\u{1F1F2}\u{1F1F1}" },
|
|
37436
|
+
{ code: "MT", name: "Malta", flag: "\u{1F1F2}\u{1F1F9}" },
|
|
37437
|
+
{ code: "MH", name: "Marshall Islands", flag: "\u{1F1F2}\u{1F1ED}" },
|
|
37438
|
+
{ code: "MR", name: "Mauritania", flag: "\u{1F1F2}\u{1F1F7}" },
|
|
37439
|
+
{ code: "MU", name: "Mauritius", flag: "\u{1F1F2}\u{1F1FA}" },
|
|
37440
|
+
{ code: "MX", name: "Mexico", flag: "\u{1F1F2}\u{1F1FD}" },
|
|
37441
|
+
{ code: "FM", name: "Micronesia", flag: "\u{1F1EB}\u{1F1F2}" },
|
|
37442
|
+
{ code: "MD", name: "Moldova", flag: "\u{1F1F2}\u{1F1E9}" },
|
|
37443
|
+
{ code: "MC", name: "Monaco", flag: "\u{1F1F2}\u{1F1E8}" },
|
|
37444
|
+
{ code: "MN", name: "Mongolia", flag: "\u{1F1F2}\u{1F1F3}" },
|
|
37445
|
+
{ code: "ME", name: "Montenegro", flag: "\u{1F1F2}\u{1F1EA}" },
|
|
37446
|
+
{ code: "MA", name: "Morocco", flag: "\u{1F1F2}\u{1F1E6}" },
|
|
37447
|
+
{ code: "MZ", name: "Mozambique", flag: "\u{1F1F2}\u{1F1FF}" },
|
|
37448
|
+
{ code: "MM", name: "Myanmar", flag: "\u{1F1F2}\u{1F1F2}" },
|
|
37449
|
+
{ code: "NA", name: "Namibia", flag: "\u{1F1F3}\u{1F1E6}" },
|
|
37450
|
+
{ code: "NR", name: "Nauru", flag: "\u{1F1F3}\u{1F1F7}" },
|
|
37451
|
+
{ code: "NP", name: "Nepal", flag: "\u{1F1F3}\u{1F1F5}" },
|
|
37452
|
+
{ code: "NL", name: "Netherlands", flag: "\u{1F1F3}\u{1F1F1}" },
|
|
37453
|
+
{ code: "NZ", name: "New Zealand", flag: "\u{1F1F3}\u{1F1FF}" },
|
|
37454
|
+
{ code: "NI", name: "Nicaragua", flag: "\u{1F1F3}\u{1F1EE}" },
|
|
37455
|
+
{ code: "NE", name: "Niger", flag: "\u{1F1F3}\u{1F1EA}" },
|
|
37456
|
+
{ code: "NG", name: "Nigeria", flag: "\u{1F1F3}\u{1F1EC}" },
|
|
37457
|
+
{ code: "MK", name: "North Macedonia", flag: "\u{1F1F2}\u{1F1F0}" },
|
|
37458
|
+
{ code: "NO", name: "Norway", flag: "\u{1F1F3}\u{1F1F4}" },
|
|
37459
|
+
{ code: "OM", name: "Oman", flag: "\u{1F1F4}\u{1F1F2}" },
|
|
37460
|
+
{ code: "PK", name: "Pakistan", flag: "\u{1F1F5}\u{1F1F0}" },
|
|
37461
|
+
{ code: "PW", name: "Palau", flag: "\u{1F1F5}\u{1F1FC}" },
|
|
37462
|
+
{ code: "PS", name: "Palestine", flag: "\u{1F1F5}\u{1F1F8}" },
|
|
37463
|
+
{ code: "PA", name: "Panama", flag: "\u{1F1F5}\u{1F1E6}" },
|
|
37464
|
+
{ code: "PG", name: "Papua New Guinea", flag: "\u{1F1F5}\u{1F1EC}" },
|
|
37465
|
+
{ code: "PY", name: "Paraguay", flag: "\u{1F1F5}\u{1F1FE}" },
|
|
37466
|
+
{ code: "PE", name: "Peru", flag: "\u{1F1F5}\u{1F1EA}" },
|
|
37467
|
+
{ code: "PH", name: "Philippines", flag: "\u{1F1F5}\u{1F1ED}" },
|
|
37468
|
+
{ code: "PL", name: "Poland", flag: "\u{1F1F5}\u{1F1F1}" },
|
|
37469
|
+
{ code: "PT", name: "Portugal", flag: "\u{1F1F5}\u{1F1F9}" },
|
|
37470
|
+
{ code: "QA", name: "Qatar", flag: "\u{1F1F6}\u{1F1E6}" },
|
|
37471
|
+
{ code: "RO", name: "Romania", flag: "\u{1F1F7}\u{1F1F4}" },
|
|
37472
|
+
{ code: "RU", name: "Russia", flag: "\u{1F1F7}\u{1F1FA}" },
|
|
37473
|
+
{ code: "RW", name: "Rwanda", flag: "\u{1F1F7}\u{1F1FC}" },
|
|
37474
|
+
{ code: "KN", name: "Saint Kitts and Nevis", flag: "\u{1F1F0}\u{1F1F3}" },
|
|
37475
|
+
{ code: "LC", name: "Saint Lucia", flag: "\u{1F1F1}\u{1F1E8}" },
|
|
37476
|
+
{ code: "VC", name: "Saint Vincent and the Grenadines", flag: "\u{1F1FB}\u{1F1E8}" },
|
|
37477
|
+
{ code: "WS", name: "Samoa", flag: "\u{1F1FC}\u{1F1F8}" },
|
|
37478
|
+
{ code: "SM", name: "San Marino", flag: "\u{1F1F8}\u{1F1F2}" },
|
|
37479
|
+
{ code: "ST", name: "Sao Tome and Principe", flag: "\u{1F1F8}\u{1F1F9}" },
|
|
37480
|
+
{ code: "SA", name: "Saudi Arabia", flag: "\u{1F1F8}\u{1F1E6}" },
|
|
37481
|
+
{ code: "SN", name: "Senegal", flag: "\u{1F1F8}\u{1F1F3}" },
|
|
37482
|
+
{ code: "RS", name: "Serbia", flag: "\u{1F1F7}\u{1F1F8}" },
|
|
37483
|
+
{ code: "SC", name: "Seychelles", flag: "\u{1F1F8}\u{1F1E8}" },
|
|
37484
|
+
{ code: "SL", name: "Sierra Leone", flag: "\u{1F1F8}\u{1F1F1}" },
|
|
37485
|
+
{ code: "SG", name: "Singapore", flag: "\u{1F1F8}\u{1F1EC}" },
|
|
37486
|
+
{ code: "SK", name: "Slovakia", flag: "\u{1F1F8}\u{1F1F0}" },
|
|
37487
|
+
{ code: "SI", name: "Slovenia", flag: "\u{1F1F8}\u{1F1EE}" },
|
|
37488
|
+
{ code: "SB", name: "Solomon Islands", flag: "\u{1F1F8}\u{1F1E7}" },
|
|
37489
|
+
{ code: "SO", name: "Somalia", flag: "\u{1F1F8}\u{1F1F4}" },
|
|
37490
|
+
{ code: "ZA", name: "South Africa", flag: "\u{1F1FF}\u{1F1E6}" },
|
|
37491
|
+
{ code: "SS", name: "South Sudan", flag: "\u{1F1F8}\u{1F1F8}" },
|
|
37492
|
+
{ code: "ES", name: "Spain", flag: "\u{1F1EA}\u{1F1F8}" },
|
|
37493
|
+
{ code: "LK", name: "Sri Lanka", flag: "\u{1F1F1}\u{1F1F0}" },
|
|
37494
|
+
{ code: "SD", name: "Sudan", flag: "\u{1F1F8}\u{1F1E9}" },
|
|
37495
|
+
{ code: "SR", name: "Suriname", flag: "\u{1F1F8}\u{1F1F7}" },
|
|
37496
|
+
{ code: "SE", name: "Sweden", flag: "\u{1F1F8}\u{1F1EA}" },
|
|
37497
|
+
{ code: "CH", name: "Switzerland", flag: "\u{1F1E8}\u{1F1ED}" },
|
|
37498
|
+
{ code: "SY", name: "Syria", flag: "\u{1F1F8}\u{1F1FE}" },
|
|
37499
|
+
{ code: "TW", name: "Taiwan", flag: "\u{1F1F9}\u{1F1FC}" },
|
|
37500
|
+
{ code: "TJ", name: "Tajikistan", flag: "\u{1F1F9}\u{1F1EF}" },
|
|
37501
|
+
{ code: "TZ", name: "Tanzania", flag: "\u{1F1F9}\u{1F1FF}" },
|
|
37502
|
+
{ code: "TH", name: "Thailand", flag: "\u{1F1F9}\u{1F1ED}" },
|
|
37503
|
+
{ code: "TL", name: "Timor-Leste", flag: "\u{1F1F9}\u{1F1F1}" },
|
|
37504
|
+
{ code: "TG", name: "Togo", flag: "\u{1F1F9}\u{1F1EC}" },
|
|
37505
|
+
{ code: "TO", name: "Tonga", flag: "\u{1F1F9}\u{1F1F4}" },
|
|
37506
|
+
{ code: "TT", name: "Trinidad and Tobago", flag: "\u{1F1F9}\u{1F1F9}" },
|
|
37507
|
+
{ code: "TN", name: "Tunisia", flag: "\u{1F1F9}\u{1F1F3}" },
|
|
37508
|
+
{ code: "TR", name: "Turkey", flag: "\u{1F1F9}\u{1F1F7}" },
|
|
37509
|
+
{ code: "TM", name: "Turkmenistan", flag: "\u{1F1F9}\u{1F1F2}" },
|
|
37510
|
+
{ code: "TV", name: "Tuvalu", flag: "\u{1F1F9}\u{1F1FB}" },
|
|
37511
|
+
{ code: "UG", name: "Uganda", flag: "\u{1F1FA}\u{1F1EC}" },
|
|
37512
|
+
{ code: "UA", name: "Ukraine", flag: "\u{1F1FA}\u{1F1E6}" },
|
|
37513
|
+
{ code: "AE", name: "United Arab Emirates", flag: "\u{1F1E6}\u{1F1EA}" },
|
|
37514
|
+
{ code: "GB", name: "United Kingdom", flag: "\u{1F1EC}\u{1F1E7}" },
|
|
37515
|
+
{ code: "US", name: "United States", flag: "\u{1F1FA}\u{1F1F8}" },
|
|
37516
|
+
{ code: "UY", name: "Uruguay", flag: "\u{1F1FA}\u{1F1FE}" },
|
|
37517
|
+
{ code: "UZ", name: "Uzbekistan", flag: "\u{1F1FA}\u{1F1FF}" },
|
|
37518
|
+
{ code: "VU", name: "Vanuatu", flag: "\u{1F1FB}\u{1F1FA}" },
|
|
37519
|
+
{ code: "VA", name: "Vatican City", flag: "\u{1F1FB}\u{1F1E6}" },
|
|
37520
|
+
{ code: "VE", name: "Venezuela", flag: "\u{1F1FB}\u{1F1EA}" },
|
|
37521
|
+
{ code: "VN", name: "Vietnam", flag: "\u{1F1FB}\u{1F1F3}" },
|
|
37522
|
+
{ code: "YE", name: "Yemen", flag: "\u{1F1FE}\u{1F1EA}" },
|
|
37523
|
+
{ code: "ZM", name: "Zambia", flag: "\u{1F1FF}\u{1F1F2}" },
|
|
37524
|
+
{ code: "ZW", name: "Zimbabwe", flag: "\u{1F1FF}\u{1F1FC}" }
|
|
37525
|
+
];
|
|
37526
|
+
var codeToMeta = Object.fromEntries(countries2.map((c) => [c.code, { name: c.name, flag: c.flag }]));
|
|
37527
|
+
var nameToCode = Object.fromEntries(countries2.map((c) => [c.name, c.code]));
|
|
37528
|
+
var normalizeToIso2 = (input) => {
|
|
37529
|
+
if (!input) return "US";
|
|
37530
|
+
const trimmed = String(input).trim();
|
|
37531
|
+
const upper = trimmed.toUpperCase();
|
|
37532
|
+
if (upper.length === 2 && codeToMeta[upper]) return upper;
|
|
37533
|
+
const fromName = nameToCode[trimmed];
|
|
37534
|
+
if (fromName) return fromName;
|
|
37535
|
+
return "US";
|
|
37536
|
+
};
|
|
37537
|
+
|
|
37538
|
+
// src/molecules/creator-discovery/CreatorWidget/EngagedAudienceDemographics.tsx
|
|
37539
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
37540
|
+
function EngagedAudienceDemographics({
|
|
37541
|
+
audienceDemographics
|
|
37542
|
+
}) {
|
|
37543
|
+
if (!audienceDemographics) return null;
|
|
37544
|
+
const hasCities = audienceDemographics?.cities && Object.keys(audienceDemographics.cities).length > 0;
|
|
37545
|
+
const hasCountries = audienceDemographics?.countries && Object.keys(audienceDemographics.countries).length > 0;
|
|
37546
|
+
const hasAges = audienceDemographics?.ages && Object.keys(audienceDemographics.ages).length > 0;
|
|
37547
|
+
const hasGenders = audienceDemographics?.genders && Object.keys(audienceDemographics.genders).length > 0;
|
|
37548
|
+
if (!hasCities && !hasCountries && !hasAges && !hasGenders) {
|
|
37549
|
+
return null;
|
|
37550
|
+
}
|
|
37551
|
+
const columns = [];
|
|
37552
|
+
if (hasCities) columns.push("1fr");
|
|
37553
|
+
if (hasCountries) columns.push("1fr");
|
|
37554
|
+
if (hasAges) columns.push("1fr");
|
|
37555
|
+
if (hasGenders) columns.push("0.4fr");
|
|
37556
|
+
const gridTemplate = columns.join(" ");
|
|
37557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
37558
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "text-purpleText text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "ENGAGED AUDIENCE" }) }),
|
|
37559
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37560
|
+
"div",
|
|
37561
|
+
{
|
|
37562
|
+
className: "flex flex-col sm:col-span-3 sm:grid gap-6",
|
|
37563
|
+
style: { gridTemplateColumns: gridTemplate },
|
|
37564
|
+
children: [
|
|
37565
|
+
hasCities && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
|
|
37566
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h4", { className: "text-xs text-gray700 mb-3", children: "Cities" }),
|
|
37567
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.cities || {}).map(
|
|
37568
|
+
([code, value]) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37569
|
+
"div",
|
|
37570
|
+
{
|
|
37571
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37572
|
+
children: [
|
|
37573
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "w-[90px]", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex gap-1 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { children: code.split(",")[0] }) }) }),
|
|
37574
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
37575
|
+
"div",
|
|
37576
|
+
{
|
|
37577
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37578
|
+
style: { width: `${value}%` }
|
|
37579
|
+
}
|
|
37580
|
+
) }),
|
|
37581
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "w-10 text-right font-medium", children: [
|
|
37582
|
+
value,
|
|
37583
|
+
"%"
|
|
37584
|
+
] })
|
|
37585
|
+
]
|
|
37586
|
+
},
|
|
37587
|
+
code
|
|
37588
|
+
)
|
|
37589
|
+
) })
|
|
37590
|
+
] }),
|
|
37591
|
+
hasCountries && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
|
|
37592
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h4", { className: "text-xs text-gray700 mb-3", children: "Countries" }),
|
|
37593
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.countries || {}).map(
|
|
37594
|
+
([code, value]) => {
|
|
37595
|
+
const iso2 = normalizeToIso2(code);
|
|
37596
|
+
const meta = codeToMeta[iso2];
|
|
37597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37598
|
+
"div",
|
|
37599
|
+
{
|
|
37600
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37601
|
+
children: [
|
|
37602
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "w-10", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex gap-1 items-center", children: [
|
|
37603
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "text-base", children: meta?.flag }),
|
|
37604
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { children: code })
|
|
37605
|
+
] }) }),
|
|
37606
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
37607
|
+
"div",
|
|
37608
|
+
{
|
|
37609
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37610
|
+
style: { width: `${value}%` }
|
|
37611
|
+
}
|
|
37612
|
+
) }),
|
|
37613
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "w-10 text-right font-medium", children: [
|
|
37614
|
+
value,
|
|
37615
|
+
"%"
|
|
37616
|
+
] })
|
|
37617
|
+
]
|
|
37618
|
+
},
|
|
37619
|
+
code
|
|
37620
|
+
);
|
|
37621
|
+
}
|
|
37622
|
+
) })
|
|
37623
|
+
] }),
|
|
37624
|
+
hasAges && /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
|
|
37625
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h4", { className: "text-xs text-gray700 mb-3", children: "Ages" }),
|
|
37626
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col gap-3", children: Object.entries(audienceDemographics?.ages || {}).map(
|
|
37627
|
+
([ageRange, value]) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37628
|
+
"div",
|
|
37629
|
+
{
|
|
37630
|
+
className: "flex items-center gap-3 text-sm text-gray700",
|
|
37631
|
+
children: [
|
|
37632
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "w-12", children: ageRange }),
|
|
37633
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex-1 bg-gray200 h-[6px] rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
37634
|
+
"div",
|
|
37635
|
+
{
|
|
37636
|
+
className: "h-[6px] bg-purple100 rounded-full",
|
|
37637
|
+
style: { width: `${value}%` }
|
|
37638
|
+
}
|
|
37639
|
+
) }),
|
|
37640
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "w-10 text-right font-medium", children: [
|
|
37641
|
+
value,
|
|
37642
|
+
"%"
|
|
37643
|
+
] })
|
|
37644
|
+
]
|
|
37645
|
+
},
|
|
37646
|
+
ageRange
|
|
37647
|
+
)
|
|
37648
|
+
) })
|
|
37649
|
+
] }),
|
|
37650
|
+
hasGenders && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex flex-col justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "flex sm:flex-col gap-3", children: Object.entries(audienceDemographics?.genders || {}).map(
|
|
37651
|
+
([gender, value]) => /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
37652
|
+
"div",
|
|
37653
|
+
{
|
|
37654
|
+
className: "flex flex-col justify-center text-sm",
|
|
37655
|
+
children: [
|
|
37656
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
37657
|
+
gender === "female" ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Venus, { className: "text-red-500", strokeWidth: 3 }) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Mars, { className: "text-blue-500", strokeWidth: 3 }),
|
|
37658
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { className: "capitalize text-gray800 text-xl", children: [
|
|
37659
|
+
value,
|
|
37660
|
+
"%"
|
|
37661
|
+
] })
|
|
37662
|
+
] }),
|
|
37663
|
+
/* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { className: "text-lg text-gray700", children: gender.charAt(0).toUpperCase() + gender.slice(1) })
|
|
37664
|
+
]
|
|
37665
|
+
},
|
|
37666
|
+
gender
|
|
37667
|
+
)
|
|
37668
|
+
) }) })
|
|
37669
|
+
]
|
|
37670
|
+
}
|
|
37671
|
+
)
|
|
37672
|
+
] });
|
|
37673
|
+
}
|
|
37674
|
+
|
|
37675
|
+
// src/molecules/creator-discovery/CreatorWidget/PlatformIcons.tsx
|
|
37676
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
37677
|
+
function InstagramIcon({ className }) {
|
|
37678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
37679
|
+
"svg",
|
|
37680
|
+
{
|
|
37681
|
+
className,
|
|
37682
|
+
viewBox: "0 0 24 24",
|
|
37683
|
+
fill: "currentColor",
|
|
37684
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" })
|
|
37686
|
+
}
|
|
37687
|
+
);
|
|
37688
|
+
}
|
|
37689
|
+
function YouTubeIcon({ className }) {
|
|
37690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
37691
|
+
"svg",
|
|
37692
|
+
{
|
|
37693
|
+
className,
|
|
37694
|
+
viewBox: "0 0 24 24",
|
|
37695
|
+
fill: "currentColor",
|
|
37696
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37697
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("path", { d: "M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" })
|
|
37698
|
+
}
|
|
37699
|
+
);
|
|
37700
|
+
}
|
|
37701
|
+
function TikTokIcon3({ className }) {
|
|
37702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
37703
|
+
"svg",
|
|
37704
|
+
{
|
|
37705
|
+
className,
|
|
37706
|
+
viewBox: "0 0 24 24",
|
|
37707
|
+
fill: "currentColor",
|
|
37708
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("path", { d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" })
|
|
37710
|
+
}
|
|
37711
|
+
);
|
|
37712
|
+
}
|
|
37713
|
+
function getPlatformIcon(platform) {
|
|
37714
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37715
|
+
if (key === "instagram") return InstagramIcon;
|
|
37716
|
+
if (key === "tiktok") return TikTokIcon3;
|
|
37717
|
+
if (key === "youtube") return YouTubeIcon;
|
|
37718
|
+
return InstagramIcon;
|
|
37719
|
+
}
|
|
37720
|
+
function getPlatformName(platform) {
|
|
37721
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37722
|
+
if (key === "instagram") return "Instagram";
|
|
37723
|
+
if (key === "tiktok") return "TikTok";
|
|
37724
|
+
if (key === "youtube") return "YouTube";
|
|
37725
|
+
return platform;
|
|
37726
|
+
}
|
|
37727
|
+
function getPlatformBgColor(platform) {
|
|
37728
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37729
|
+
if (key === "instagram") return "#C4338680";
|
|
37730
|
+
if (key === "tiktok") return "#EBEBEB40";
|
|
37731
|
+
if (key === "youtube") return "#ff000080";
|
|
37732
|
+
return "#ccc";
|
|
37733
|
+
}
|
|
37734
|
+
function getPlatformIconColor(platform) {
|
|
37735
|
+
const key = platform.toLowerCase().replace(/metrics$/i, "");
|
|
37736
|
+
if (key === "instagram") return "text-[#7b1551]";
|
|
37737
|
+
if (key === "tiktok") return "text-pink-500";
|
|
37738
|
+
if (key === "youtube") return "text-red-600";
|
|
37739
|
+
return "text-primary";
|
|
37740
|
+
}
|
|
37741
|
+
|
|
37742
|
+
// src/molecules/creator-discovery/CreatorWidget/PostCard.tsx
|
|
37218
37743
|
var import_react67 = require("react");
|
|
37744
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
37745
|
+
var formatFollowerCount = (count) => {
|
|
37746
|
+
if (count >= 1e6) {
|
|
37747
|
+
const millions = count / 1e6;
|
|
37748
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
37749
|
+
} else if (count >= 1e4) {
|
|
37750
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
37751
|
+
} else if (count >= 1e3) {
|
|
37752
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
37753
|
+
}
|
|
37754
|
+
return Math.floor(count).toString();
|
|
37755
|
+
};
|
|
37756
|
+
function PostCard({ post, platformUsername }) {
|
|
37757
|
+
const [expanded, setExpanded] = (0, import_react67.useState)(false);
|
|
37758
|
+
const [errored, setErrored] = (0, import_react67.useState)(false);
|
|
37759
|
+
const thumbnail = post.thumbnail_url || post.thumbnail || post.image || "";
|
|
37760
|
+
const likes = post.engagement?.likes ?? post.likes ?? null;
|
|
37761
|
+
const comments = post.engagement?.comments ?? post.comments ?? null;
|
|
37762
|
+
const views = post.engagement?.views ?? post.engagement?.plays ?? post.views ?? post.plays ?? null;
|
|
37763
|
+
const impressions = post.impressions ?? null;
|
|
37764
|
+
const reach = post.reach ?? null;
|
|
37765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
37766
|
+
"div",
|
|
37767
|
+
{
|
|
37768
|
+
className: "rounded-xl overflow-hidden border border-gray500 bg-transparent shadow-sm cursor-pointer",
|
|
37769
|
+
onClick: (e) => {
|
|
37770
|
+
e.stopPropagation();
|
|
37771
|
+
window.open(post.url, "_blank", "noopener,noreferrer");
|
|
37772
|
+
},
|
|
37773
|
+
children: [
|
|
37774
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "w-full aspect-square relative bg-gray25", children: thumbnail && !errored ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37775
|
+
"img",
|
|
37776
|
+
{
|
|
37777
|
+
src: thumbnail,
|
|
37778
|
+
alt: post.title || "post",
|
|
37779
|
+
className: "w-full h-full object-cover",
|
|
37780
|
+
onError: () => setErrored(true)
|
|
37781
|
+
}
|
|
37782
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "w-full h-full flex items-center justify-center text-gray500 text-sm", children: "No preview" }) }),
|
|
37783
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "p-3", children: [
|
|
37784
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-4 text-sm text-gray600 mb-2", children: [
|
|
37785
|
+
likes !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
37786
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { children: formatFollowerCount(likes) }),
|
|
37787
|
+
" ",
|
|
37788
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Heart, { size: 14 })
|
|
37789
|
+
] }),
|
|
37790
|
+
comments !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
37791
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { children: formatFollowerCount(comments) }),
|
|
37792
|
+
" ",
|
|
37793
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(MessageCircle, { size: 14 })
|
|
37794
|
+
] }),
|
|
37795
|
+
views !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
37796
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { children: formatFollowerCount(views) }),
|
|
37797
|
+
" ",
|
|
37798
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Eye, { size: 14 })
|
|
37799
|
+
] })
|
|
37800
|
+
] }),
|
|
37801
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "flex gap-4 text-sm text-gray800 mb-2", children: [
|
|
37802
|
+
impressions !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { children: [
|
|
37803
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "text-gray500 font-bold", children: formatFollowerCount(impressions) }),
|
|
37804
|
+
" ",
|
|
37805
|
+
"est.Impressions"
|
|
37806
|
+
] }),
|
|
37807
|
+
reach !== null && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { children: [
|
|
37808
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { className: "text-gray500 font-bold", children: formatFollowerCount(reach) }),
|
|
37809
|
+
" ",
|
|
37810
|
+
"est.Reach"
|
|
37811
|
+
] })
|
|
37812
|
+
] }),
|
|
37813
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "text-sm mb-1", children: [
|
|
37814
|
+
platformUsername && /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { className: "text-md font-semibold text-gray500", children: [
|
|
37815
|
+
"@",
|
|
37816
|
+
platformUsername
|
|
37817
|
+
] }),
|
|
37818
|
+
["instagram", "tiktok"].includes(
|
|
37819
|
+
post.platform?.toLowerCase() || ""
|
|
37820
|
+
) ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_jsx_runtime128.Fragment, { children: (() => {
|
|
37821
|
+
const text = post.title || post.description || "";
|
|
37822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
37823
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37824
|
+
"div",
|
|
37825
|
+
{
|
|
37826
|
+
className: `text-gray900 font-light mt-2 text-sm ${!expanded ? "line-clamp-3" : ""}`,
|
|
37827
|
+
children: text
|
|
37828
|
+
}
|
|
37829
|
+
),
|
|
37830
|
+
text.length > 100 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37831
|
+
"button",
|
|
37832
|
+
{
|
|
37833
|
+
onClick: (e) => {
|
|
37834
|
+
e.stopPropagation();
|
|
37835
|
+
setExpanded((s) => !s);
|
|
37836
|
+
},
|
|
37837
|
+
className: "text-xs text-purpleText mt-2",
|
|
37838
|
+
children: expanded ? "Show less" : "Show more"
|
|
37839
|
+
}
|
|
37840
|
+
)
|
|
37841
|
+
] });
|
|
37842
|
+
})() }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
|
|
37843
|
+
post.title && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "text-gray900 font-light", children: post.title }),
|
|
37844
|
+
post.description && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37845
|
+
"div",
|
|
37846
|
+
{
|
|
37847
|
+
className: "mt-2 text-sm text-gray900 overflow-hidden font-light",
|
|
37848
|
+
style: { maxHeight: expanded ? void 0 : 200 },
|
|
37849
|
+
children: post.description
|
|
37850
|
+
}
|
|
37851
|
+
),
|
|
37852
|
+
post.description && post.description.length > 200 && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
37853
|
+
"button",
|
|
37854
|
+
{
|
|
37855
|
+
onClick: (e) => {
|
|
37856
|
+
e.stopPropagation();
|
|
37857
|
+
setExpanded((s) => !s);
|
|
37858
|
+
},
|
|
37859
|
+
className: "text-xs text-purpleText mt-2",
|
|
37860
|
+
children: expanded ? "Show less" : "Show more"
|
|
37861
|
+
}
|
|
37862
|
+
)
|
|
37863
|
+
] })
|
|
37864
|
+
] })
|
|
37865
|
+
] })
|
|
37866
|
+
]
|
|
37867
|
+
}
|
|
37868
|
+
);
|
|
37869
|
+
}
|
|
37870
|
+
|
|
37871
|
+
// src/molecules/creator-discovery/CreatorWidget/PlatformPostsSection.tsx
|
|
37872
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
37873
|
+
var formatFollowerCount2 = (count) => {
|
|
37874
|
+
if (count >= 1e6) {
|
|
37875
|
+
const millions = count / 1e6;
|
|
37876
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
37877
|
+
} else if (count >= 1e4) {
|
|
37878
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
37879
|
+
} else if (count >= 1e3) {
|
|
37880
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
37881
|
+
}
|
|
37882
|
+
return Math.floor(count).toString();
|
|
37883
|
+
};
|
|
37884
|
+
function filterPostsByPlatform(posts, platform) {
|
|
37885
|
+
const postsArr = (posts ?? []).slice();
|
|
37886
|
+
const shortKey = platform.replace(/Metrics$/i, "").toLowerCase();
|
|
37887
|
+
return postsArr.filter((p) => (p.platform || "").toLowerCase() === shortKey).slice(0, 3);
|
|
37888
|
+
}
|
|
37889
|
+
function PlatformMetricsBanner({
|
|
37890
|
+
platform,
|
|
37891
|
+
metrics
|
|
37892
|
+
}) {
|
|
37893
|
+
const platformName = getPlatformName(platform);
|
|
37894
|
+
const bgColor = getPlatformBgColor(platform);
|
|
37895
|
+
const IconComponent = getPlatformIcon(platform);
|
|
37896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
37897
|
+
"div",
|
|
37898
|
+
{
|
|
37899
|
+
className: "\n flex overflow-x-auto gap-6 rounded-l-xl py-4 px-4 shadow-sm\n md:grid md:grid-cols-[0.5fr_1fr_1fr_1fr_1fr] md:items-center md:gap-0 md:px-0 md:ml-8\n ",
|
|
37900
|
+
style: { backgroundColor: bgColor },
|
|
37901
|
+
children: [
|
|
37902
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-center min-w-[90px] md:min-w-0", children: [
|
|
37903
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(IconComponent, { className: "w-5 h-5 md:w-6 md:h-6 text-gray900" }),
|
|
37904
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-lg md:text-xl font-bold text-gray900", children: platform === "youtubeMetrics" ? formatFollowerCount2(metrics.subscribers || 0) : formatFollowerCount2(metrics.followers || 0) })
|
|
37905
|
+
] }),
|
|
37906
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[130px] md:min-w-0", children: [
|
|
37907
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
37908
|
+
"span",
|
|
37909
|
+
{
|
|
37910
|
+
className: "text-base md:text-lg dark:text-white max-w-[90%] truncate cursor-default",
|
|
37911
|
+
title: `@${platform === "youtubeMetrics" ? metrics.channelName : metrics.username}`,
|
|
37912
|
+
children: [
|
|
37913
|
+
"@",
|
|
37914
|
+
platform === "youtubeMetrics" ? metrics.channelName : metrics.username
|
|
37915
|
+
]
|
|
37916
|
+
}
|
|
37917
|
+
),
|
|
37918
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs md:text-sm text-gray900 opacity-90", children: platformName })
|
|
37919
|
+
] }),
|
|
37920
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37921
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("span", { className: "text-sm md:text-md font-semibold text-gray900", children: [
|
|
37922
|
+
(metrics.engagementRate * 100).toFixed(2),
|
|
37923
|
+
"%"
|
|
37924
|
+
] }),
|
|
37925
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs text-gray900 opacity-80", children: "Engagement Rate" })
|
|
37926
|
+
] }),
|
|
37927
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37928
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-sm md:text-md font-semibold text-gray900", children: Math.round(metrics.avgLikes)?.toLocaleString() }),
|
|
37929
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs text-gray900 opacity-80", children: "Avg Likes" })
|
|
37930
|
+
] }),
|
|
37931
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "flex flex-col items-start min-w-[100px] md:min-w-0", children: [
|
|
37932
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-sm md:text-md font-semibold text-gray900", children: Math.round(metrics.avgComments)?.toLocaleString() }),
|
|
37933
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { className: "text-xs text-gray900 opacity-80", children: "Avg Comments" })
|
|
37934
|
+
] })
|
|
37935
|
+
]
|
|
37936
|
+
}
|
|
37937
|
+
);
|
|
37938
|
+
}
|
|
37939
|
+
function PlatformPostsSection({
|
|
37940
|
+
platformMetrics,
|
|
37941
|
+
posts = []
|
|
37942
|
+
}) {
|
|
37943
|
+
if (!platformMetrics) return null;
|
|
37944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "flex flex-col gap-8", children: Object.entries(platformMetrics || {}).map(
|
|
37945
|
+
([platform, metrics]) => {
|
|
37946
|
+
if (!metrics) return null;
|
|
37947
|
+
if (metrics.followers === 0 && metrics.subscribers === 0)
|
|
37948
|
+
return null;
|
|
37949
|
+
const platformPosts = filterPostsByPlatform(posts, platform);
|
|
37950
|
+
const platformUsername = metrics.username ?? metrics.channelName ?? "";
|
|
37951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "w-full flex flex-col gap-8", children: [
|
|
37952
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(PlatformMetricsBanner, { platform, metrics }),
|
|
37953
|
+
platformPosts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "pr-6 sm:ml-8 sm:pr-7", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: platformPosts.map((post, idx) => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
37954
|
+
PostCard,
|
|
37955
|
+
{
|
|
37956
|
+
post,
|
|
37957
|
+
platformUsername
|
|
37958
|
+
},
|
|
37959
|
+
post.post_id ?? post.url ?? idx
|
|
37960
|
+
)) }) })
|
|
37961
|
+
] }, platform);
|
|
37962
|
+
}
|
|
37963
|
+
) }) });
|
|
37964
|
+
}
|
|
37965
|
+
|
|
37966
|
+
// src/molecules/creator-discovery/CreatorWidget/BrandCollaborationsList.tsx
|
|
37967
|
+
var import_react68 = require("react");
|
|
37968
|
+
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
37969
|
+
var import_framer_motion3 = require("framer-motion");
|
|
37970
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
37971
|
+
var getSentimentRank = (score) => {
|
|
37972
|
+
if (score >= 80) {
|
|
37973
|
+
return {
|
|
37974
|
+
rank: "STRONG FIT",
|
|
37975
|
+
bgColor: "bg-greenBackground",
|
|
37976
|
+
textColor: "text-greenText",
|
|
37977
|
+
scoreColor: "text-[#499C54]"
|
|
37978
|
+
};
|
|
37979
|
+
} else if (score >= 50) {
|
|
37980
|
+
return {
|
|
37981
|
+
rank: "MODERATE FIT",
|
|
37982
|
+
bgColor: "bg-orangeBackground",
|
|
37983
|
+
textColor: "text-orangeText",
|
|
37984
|
+
scoreColor: "text-[#B3512F]"
|
|
37985
|
+
};
|
|
37986
|
+
} else if (score >= 0) {
|
|
37987
|
+
return {
|
|
37988
|
+
rank: "POOR FIT",
|
|
37989
|
+
bgColor: "bg-redBackground",
|
|
37990
|
+
textColor: "text-redText",
|
|
37991
|
+
scoreColor: "text-[#BE2C35]"
|
|
37992
|
+
};
|
|
37993
|
+
}
|
|
37994
|
+
return {
|
|
37995
|
+
rank: "Unranked",
|
|
37996
|
+
bgColor: "bg-gray500",
|
|
37997
|
+
textColor: "text-gray200",
|
|
37998
|
+
scoreColor: "text-gray500"
|
|
37999
|
+
};
|
|
38000
|
+
};
|
|
38001
|
+
function BrandMentionDetails({
|
|
38002
|
+
open,
|
|
38003
|
+
onClose,
|
|
38004
|
+
brandBreakdown,
|
|
38005
|
+
selectedBrand
|
|
38006
|
+
}) {
|
|
38007
|
+
const brandStats = brandBreakdown?.insights?.brandBreakdown?.find(
|
|
38008
|
+
(b) => b.brand.toLowerCase() === selectedBrand?.toLowerCase()
|
|
38009
|
+
);
|
|
38010
|
+
const brandMentions = brandBreakdown?.mentions?.filter(
|
|
38011
|
+
(m) => m.normalizedBrand?.toLowerCase() === selectedBrand?.toLowerCase() || m.brand?.toLowerCase() === selectedBrand?.toLowerCase()
|
|
38012
|
+
) || [];
|
|
38013
|
+
if (typeof window === "undefined") return null;
|
|
38014
|
+
return import_react_dom.default.createPortal(
|
|
38015
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_framer_motion3.AnimatePresence, { mode: "sync", children: open && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
38016
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38017
|
+
import_framer_motion3.motion.div,
|
|
38018
|
+
{
|
|
38019
|
+
initial: { opacity: 0 },
|
|
38020
|
+
animate: { opacity: 1 },
|
|
38021
|
+
exit: { opacity: 0 },
|
|
38022
|
+
transition: { duration: 0.2 },
|
|
38023
|
+
className: "fixed inset-0 bg-black bg-opacity-50 z-[80]",
|
|
38024
|
+
onClick: (e) => {
|
|
38025
|
+
e.stopPropagation();
|
|
38026
|
+
onClose();
|
|
38027
|
+
}
|
|
38028
|
+
},
|
|
38029
|
+
"brand-overlay"
|
|
38030
|
+
),
|
|
38031
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38032
|
+
import_framer_motion3.motion.div,
|
|
38033
|
+
{
|
|
38034
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
38035
|
+
animate: { opacity: 1, scale: 1 },
|
|
38036
|
+
exit: { opacity: 0, scale: 0.95 },
|
|
38037
|
+
transition: { duration: 0.2 },
|
|
38038
|
+
className: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[90] w-full max-w-lg bg-background rounded-xl border border-gray300 shadow-2xl",
|
|
38039
|
+
onClick: (e) => e.stopPropagation(),
|
|
38040
|
+
children: [
|
|
38041
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex justify-between items-center p-4 border-b border-gray300", children: [
|
|
38042
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("h3", { className: "text-lg font-bold text-gray900", children: [
|
|
38043
|
+
"Brand Mention Details: ",
|
|
38044
|
+
selectedBrand
|
|
38045
|
+
] }),
|
|
38046
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38047
|
+
"button",
|
|
38048
|
+
{
|
|
38049
|
+
onClick: onClose,
|
|
38050
|
+
className: "p-1 rounded-full hover:bg-gray200 transition-colors",
|
|
38051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(X, { className: "w-4 h-4" })
|
|
38052
|
+
}
|
|
38053
|
+
)
|
|
38054
|
+
] }),
|
|
38055
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-6 max-h-[70vh] overflow-y-auto p-4", children: [
|
|
38056
|
+
brandStats && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-gray25 border-2 border-gray200 rounded-xl p-4", children: [
|
|
38057
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("h3", { className: "text-lg font-bold text-gray900 mb-4", children: "Overview" }),
|
|
38058
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
38059
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38060
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Total Mentions" }),
|
|
38061
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-2xl font-bold text-gray900", children: brandStats.mentions })
|
|
38062
|
+
] }),
|
|
38063
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38064
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Posts Count" }),
|
|
38065
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-2xl font-bold text-gray900", children: brandStats.postCount })
|
|
38066
|
+
] }),
|
|
38067
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38068
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Avg Engagement" }),
|
|
38069
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "text-2xl font-bold text-gray900", children: [
|
|
38070
|
+
brandStats.averageEngagementRate?.toFixed(2),
|
|
38071
|
+
"%"
|
|
38072
|
+
] })
|
|
38073
|
+
] }),
|
|
38074
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3", children: [
|
|
38075
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600", children: "Effectiveness" }),
|
|
38076
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38077
|
+
"div",
|
|
38078
|
+
{
|
|
38079
|
+
className: `text-2xl font-bold ${getSentimentRank(brandStats.effectivenessPercent).scoreColor}`,
|
|
38080
|
+
children: [
|
|
38081
|
+
brandStats.effectivenessPercent,
|
|
38082
|
+
"%"
|
|
38083
|
+
]
|
|
38084
|
+
}
|
|
38085
|
+
)
|
|
38086
|
+
] })
|
|
38087
|
+
] }),
|
|
38088
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "mt-3 flex gap-2 flex-wrap", children: brandStats.collaborationTypes?.map(
|
|
38089
|
+
(type, idx) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38090
|
+
"span",
|
|
38091
|
+
{
|
|
38092
|
+
className: "px-3 py-1 rounded-md text-xs font-medium bg-[#1D4324] text-[#72E285]",
|
|
38093
|
+
children: type
|
|
38094
|
+
},
|
|
38095
|
+
idx
|
|
38096
|
+
)
|
|
38097
|
+
) })
|
|
38098
|
+
] }),
|
|
38099
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38100
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("h3", { className: "text-lg font-bold text-gray900 mb-3", children: [
|
|
38101
|
+
"Individual Mentions (",
|
|
38102
|
+
brandMentions.length,
|
|
38103
|
+
")"
|
|
38104
|
+
] }),
|
|
38105
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex flex-col gap-3", children: brandMentions.map((mention, index) => {
|
|
38106
|
+
const IconComponent = getPlatformIcon(mention?.platform);
|
|
38107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38108
|
+
"div",
|
|
38109
|
+
{
|
|
38110
|
+
className: "bg-gray50 border-2 border-gray200 rounded-xl p-4 hover:border-purple100 transition-colors",
|
|
38111
|
+
children: [
|
|
38112
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
38113
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
38114
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(IconComponent, { className: "w-5 h-5 text-gray900" }),
|
|
38115
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-sm font-medium text-gray700 capitalize", children: mention.platform })
|
|
38116
|
+
] }),
|
|
38117
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
38118
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "px-2 py-1 rounded-md text-xs font-medium bg-[#1D4324] text-[#72E285]", children: mention.collaborationType }),
|
|
38119
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "text-xs text-gray600", children: [
|
|
38120
|
+
Math.round(mention.confidence * 100),
|
|
38121
|
+
"% confidence"
|
|
38122
|
+
] })
|
|
38123
|
+
] })
|
|
38124
|
+
] }),
|
|
38125
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "mb-2", children: [
|
|
38126
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "text-xs text-gray500", children: [
|
|
38127
|
+
"Post ID:",
|
|
38128
|
+
" "
|
|
38129
|
+
] }),
|
|
38130
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-xs font-mono text-gray700", children: mention.post_id })
|
|
38131
|
+
] }),
|
|
38132
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "bg-background rounded-lg p-3 border border-gray300", children: [
|
|
38133
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-xs text-gray600 mb-1", children: "Evidence:" }),
|
|
38134
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("p", { className: "text-sm text-gray800 italic", children: [
|
|
38135
|
+
"\u201C",
|
|
38136
|
+
mention.evidence,
|
|
38137
|
+
"\u201D"
|
|
38138
|
+
] })
|
|
38139
|
+
] }),
|
|
38140
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "mt-2 text-xs text-gray500", children: [
|
|
38141
|
+
"Source:",
|
|
38142
|
+
" ",
|
|
38143
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "font-medium", children: mention.source }),
|
|
38144
|
+
mention.handle && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("span", { className: "ml-2", children: [
|
|
38145
|
+
"Handle:",
|
|
38146
|
+
" ",
|
|
38147
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "font-medium", children: mention.handle })
|
|
38148
|
+
] })
|
|
38149
|
+
] })
|
|
38150
|
+
]
|
|
38151
|
+
},
|
|
38152
|
+
index
|
|
38153
|
+
);
|
|
38154
|
+
}) })
|
|
38155
|
+
] }),
|
|
38156
|
+
brandMentions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-center py-8 text-gray500", children: "No mentions found for this brand" })
|
|
38157
|
+
] })
|
|
38158
|
+
]
|
|
38159
|
+
},
|
|
38160
|
+
"brand-modal"
|
|
38161
|
+
)
|
|
38162
|
+
] }) }),
|
|
38163
|
+
document.body
|
|
38164
|
+
);
|
|
38165
|
+
}
|
|
38166
|
+
function BrandCollaborationsList({
|
|
38167
|
+
brandBreakdown
|
|
38168
|
+
}) {
|
|
38169
|
+
const [openDetails, setOpenDetails] = (0, import_react68.useState)(false);
|
|
38170
|
+
const [selectedBrand, setSelectedBrand] = (0, import_react68.useState)("");
|
|
38171
|
+
if (!brandBreakdown?.insights?.brandBreakdown || brandBreakdown.insights.brandBreakdown.length === 0) {
|
|
38172
|
+
return null;
|
|
38173
|
+
}
|
|
38174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
|
|
38175
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38176
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-purpleText text-xs mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "BRAND MENTIONS" }) }),
|
|
38177
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "flex flex-col gap-2 max-h-[220px] overflow-y-auto", children: brandBreakdown.insights.brandBreakdown.map(
|
|
38178
|
+
(item, index) => /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
38179
|
+
"div",
|
|
38180
|
+
{
|
|
38181
|
+
className: "flex gap-4 bg-gray50 border-2 border-gray25 rounded-xl px-3 py-3 shadow-sm cursor-pointer hover:border-purple100 transition-colors",
|
|
38182
|
+
onClick: (e) => {
|
|
38183
|
+
e.stopPropagation();
|
|
38184
|
+
setSelectedBrand(item?.brand);
|
|
38185
|
+
setOpenDetails(true);
|
|
38186
|
+
},
|
|
38187
|
+
children: [
|
|
38188
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "w-10 h-10 rounded-full bg-gray200 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-sm font-bold text-gray700", children: item.brand?.charAt(0)?.toUpperCase() || "?" }) }),
|
|
38189
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
38190
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "text-gray900 text-sm", children: item.brand }),
|
|
38191
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { className: "flex gap-2 text-xs text-gray600", children: [
|
|
38192
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38193
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "text-gray900", children: item?.mentions }),
|
|
38194
|
+
" ",
|
|
38195
|
+
"Mention"
|
|
38196
|
+
] }),
|
|
38197
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
|
|
38198
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38199
|
+
"span",
|
|
38200
|
+
{
|
|
38201
|
+
className: `${getSentimentRank(item.effectivenessPercent).scoreColor} font-bold`,
|
|
38202
|
+
children: item.effectivenessPercent ? `${item.effectivenessPercent}%` : "N/A"
|
|
38203
|
+
}
|
|
38204
|
+
),
|
|
38205
|
+
" ",
|
|
38206
|
+
"Effectiveness"
|
|
38207
|
+
] })
|
|
38208
|
+
] })
|
|
38209
|
+
] })
|
|
38210
|
+
]
|
|
38211
|
+
},
|
|
38212
|
+
index
|
|
38213
|
+
)
|
|
38214
|
+
) })
|
|
38215
|
+
] }),
|
|
38216
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
38217
|
+
BrandMentionDetails,
|
|
38218
|
+
{
|
|
38219
|
+
open: openDetails,
|
|
38220
|
+
onClose: () => setOpenDetails(false),
|
|
38221
|
+
brandBreakdown,
|
|
38222
|
+
selectedBrand
|
|
38223
|
+
}
|
|
38224
|
+
)
|
|
38225
|
+
] });
|
|
38226
|
+
}
|
|
38227
|
+
|
|
38228
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorGridView.tsx
|
|
38229
|
+
var import_react69 = require("react");
|
|
38230
|
+
var import_framer_motion4 = require("framer-motion");
|
|
38231
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
38232
|
+
var formatFollowerCount3 = (count) => {
|
|
38233
|
+
if (count >= 1e6) {
|
|
38234
|
+
const millions = count / 1e6;
|
|
38235
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
38236
|
+
} else if (count >= 1e4) {
|
|
38237
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
38238
|
+
} else if (count >= 1e3) {
|
|
38239
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
38240
|
+
}
|
|
38241
|
+
return Math.floor(count).toString();
|
|
38242
|
+
};
|
|
38243
|
+
var getSentimentRank2 = (score) => {
|
|
38244
|
+
if (score >= 80) {
|
|
38245
|
+
return {
|
|
38246
|
+
bgColor: "bg-greenBackground",
|
|
38247
|
+
textColor: "text-greenText",
|
|
38248
|
+
scoreColor: "text-[#499C54]"
|
|
38249
|
+
};
|
|
38250
|
+
} else if (score >= 50) {
|
|
38251
|
+
return {
|
|
38252
|
+
bgColor: "bg-orangeBackground",
|
|
38253
|
+
textColor: "text-orangeText",
|
|
38254
|
+
scoreColor: "text-[#B3512F]"
|
|
38255
|
+
};
|
|
38256
|
+
} else if (score >= 0) {
|
|
38257
|
+
return {
|
|
38258
|
+
bgColor: "bg-redBackground",
|
|
38259
|
+
textColor: "text-redText",
|
|
38260
|
+
scoreColor: "text-[#BE2C35]"
|
|
38261
|
+
};
|
|
38262
|
+
}
|
|
38263
|
+
return {
|
|
38264
|
+
bgColor: "bg-gray500",
|
|
38265
|
+
textColor: "text-gray200",
|
|
38266
|
+
scoreColor: "text-gray200"
|
|
38267
|
+
};
|
|
38268
|
+
};
|
|
38269
|
+
var itemsExplanation = [
|
|
38270
|
+
{ key: "contentRelevance", label: "Content Relevance" },
|
|
38271
|
+
{ key: "audienceMatch", label: "Audience Match" },
|
|
38272
|
+
{ key: "authorityExpertise", label: "Expertise" },
|
|
38273
|
+
{ key: "contentQuality", label: "Content Quality" },
|
|
38274
|
+
{ key: "authenticity", label: "Authenticity" },
|
|
38275
|
+
{ key: "brandSafety", label: "Brand Safety" }
|
|
38276
|
+
];
|
|
38277
|
+
function CreatorGridViewCard({ creator }) {
|
|
38278
|
+
const [isExpanded, setIsExpanded] = (0, import_react69.useState)(false);
|
|
38279
|
+
const [showFullDescription, setShowFullDescription] = (0, import_react69.useState)(false);
|
|
38280
|
+
const [isDescriptionOverflowing, setIsDescriptionOverflowing] = (0, import_react69.useState)(false);
|
|
38281
|
+
const descriptionRef = (0, import_react69.useRef)(null);
|
|
38282
|
+
const cardRef = (0, import_react69.useRef)(null);
|
|
38283
|
+
const checkDescriptionOverflow = (0, import_react69.useCallback)(() => {
|
|
38284
|
+
const el = descriptionRef.current;
|
|
38285
|
+
if (!el) return;
|
|
38286
|
+
setIsDescriptionOverflowing(el.scrollHeight > el.clientHeight + 1);
|
|
38287
|
+
}, []);
|
|
38288
|
+
(0, import_react69.useEffect)(() => {
|
|
38289
|
+
checkDescriptionOverflow();
|
|
38290
|
+
}, [checkDescriptionOverflow, isExpanded, showFullDescription]);
|
|
38291
|
+
(0, import_react69.useEffect)(() => {
|
|
38292
|
+
const onResize = () => checkDescriptionOverflow();
|
|
38293
|
+
window.addEventListener("resize", onResize);
|
|
38294
|
+
return () => window.removeEventListener("resize", onResize);
|
|
38295
|
+
}, [checkDescriptionOverflow]);
|
|
38296
|
+
const platformStats = (0, import_react69.useMemo)(() => {
|
|
38297
|
+
return [
|
|
38298
|
+
{
|
|
38299
|
+
platform: "instagram",
|
|
38300
|
+
icon: InstagramIcon,
|
|
38301
|
+
followers: creator.metrics?.instagram?.followers || 0,
|
|
38302
|
+
engagement: creator.metrics?.instagram?.engagement || 0
|
|
38303
|
+
},
|
|
38304
|
+
{
|
|
38305
|
+
platform: "youtube",
|
|
38306
|
+
icon: YouTubeIcon,
|
|
38307
|
+
followers: creator.metrics?.youtube?.followers || 0,
|
|
38308
|
+
engagement: creator.metrics?.youtube?.engagement || 0
|
|
38309
|
+
},
|
|
38310
|
+
{
|
|
38311
|
+
platform: "tiktok",
|
|
38312
|
+
icon: TikTokIcon3,
|
|
38313
|
+
followers: creator.metrics?.tiktok?.followers || 0,
|
|
38314
|
+
engagement: creator.metrics?.tiktok?.engagement || 0
|
|
38315
|
+
}
|
|
38316
|
+
];
|
|
38317
|
+
}, [creator]);
|
|
38318
|
+
const toggleExpanded = () => {
|
|
38319
|
+
const willExpand = !isExpanded;
|
|
38320
|
+
setIsExpanded(willExpand);
|
|
38321
|
+
setTimeout(() => {
|
|
38322
|
+
if (cardRef.current) {
|
|
38323
|
+
cardRef.current.scrollIntoView({
|
|
38324
|
+
behavior: "smooth",
|
|
38325
|
+
block: willExpand ? "center" : "nearest"
|
|
38326
|
+
});
|
|
38327
|
+
}
|
|
38328
|
+
}, 100);
|
|
38329
|
+
};
|
|
38330
|
+
const iso2 = normalizeToIso2(creator.country);
|
|
38331
|
+
const meta = codeToMeta[iso2];
|
|
38332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38333
|
+
import_framer_motion4.motion.div,
|
|
38334
|
+
{
|
|
38335
|
+
ref: cardRef,
|
|
38336
|
+
layout: "position",
|
|
38337
|
+
initial: { opacity: 0, y: 10 },
|
|
38338
|
+
animate: { opacity: 1, y: 0 },
|
|
38339
|
+
transition: { duration: 0.3 },
|
|
38340
|
+
className: `bg-paperBackground dark:bg-gray50 rounded-[10px] border border-gray300 hover:border-purple100 shadow-sm cursor-pointer transition-all duration-300 ease-in-out ${isExpanded ? "col-span-full border-purple100" : ""}`,
|
|
38341
|
+
style: isExpanded ? { gridColumn: "1 / -1" } : {},
|
|
38342
|
+
onClick: toggleExpanded,
|
|
38343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex", children: [
|
|
38344
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: `${isExpanded ? "w-1/3" : "w-full"}`, children: [
|
|
38345
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "relative w-full aspect-square mb-2", children: [
|
|
38346
|
+
creator.profile_pic ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38347
|
+
"img",
|
|
38348
|
+
{
|
|
38349
|
+
src: creator.profile_pic,
|
|
38350
|
+
alt: creator.name,
|
|
38351
|
+
className: "w-full h-full object-cover bg-primary/10",
|
|
38352
|
+
style: { borderRadius: "10px 10px 0 0" }
|
|
38353
|
+
}
|
|
38354
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38355
|
+
"div",
|
|
38356
|
+
{
|
|
38357
|
+
className: "w-full h-full bg-primary/10 flex items-center justify-center",
|
|
38358
|
+
style: { borderRadius: "10px 10px 0 0" },
|
|
38359
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-2xl text-primary", children: creator.name?.charAt(0) || "?" })
|
|
38360
|
+
}
|
|
38361
|
+
),
|
|
38362
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38363
|
+
"div",
|
|
38364
|
+
{
|
|
38365
|
+
className: `absolute bottom-2 right-2 ${getSentimentRank2(creator.sentiment?.matchScore || 0).bgColor} ${getSentimentRank2(creator.sentiment?.matchScore || 0).textColor} px-2 py-1 rounded-md text-md font-medium`,
|
|
38366
|
+
children: creator.sentiment ? `${creator.sentiment?.matchScore?.toFixed(1)}%` : "N/A"
|
|
38367
|
+
}
|
|
38368
|
+
)
|
|
38369
|
+
] }),
|
|
38370
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "px-3 pb-1", children: [
|
|
38371
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { children: [
|
|
38372
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38373
|
+
"h3",
|
|
38374
|
+
{
|
|
38375
|
+
className: `${isExpanded ? "text-md" : "text-sm"} font-normal text-gray900 mb-1 line-clamp-2 text-start`,
|
|
38376
|
+
children: creator.name || "Unnamed"
|
|
38377
|
+
}
|
|
38378
|
+
),
|
|
38379
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38380
|
+
"div",
|
|
38381
|
+
{
|
|
38382
|
+
className: `${isExpanded ? "text-sm" : "text-xs"} text-gray700 mb-1 text-start flex items-center gap-1`,
|
|
38383
|
+
children: [
|
|
38384
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-base", children: meta?.flag }),
|
|
38385
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { children: meta?.name || creator.country || "Unknown" })
|
|
38386
|
+
]
|
|
38387
|
+
}
|
|
38388
|
+
),
|
|
38389
|
+
isExpanded && creator?.sentiment?.detailedScores && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "mt-2 w-[150px] flex gap-2", children: Object.entries(creator.sentiment.detailedScores).map(
|
|
38390
|
+
([key, value]) => {
|
|
38391
|
+
const itemRank = getSentimentRank2(value);
|
|
38392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38393
|
+
"div",
|
|
38394
|
+
{
|
|
38395
|
+
className: "flex flex-col items-center w-[100px]",
|
|
38396
|
+
children: [
|
|
38397
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38398
|
+
"span",
|
|
38399
|
+
{
|
|
38400
|
+
className: `text-[14px] font-bold ${itemRank.scoreColor}`,
|
|
38401
|
+
children: [
|
|
38402
|
+
value,
|
|
38403
|
+
"%"
|
|
38404
|
+
]
|
|
38405
|
+
}
|
|
38406
|
+
),
|
|
38407
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex items-center justify-center gap-1 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-xs dark:text-gray500 text-center px-1", children: itemsExplanation.find(
|
|
38408
|
+
(item) => item.key === key
|
|
38409
|
+
)?.label }) })
|
|
38410
|
+
]
|
|
38411
|
+
},
|
|
38412
|
+
key
|
|
38413
|
+
);
|
|
38414
|
+
}
|
|
38415
|
+
) }) })
|
|
38416
|
+
] }),
|
|
38417
|
+
!isExpanded && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex gap-2 justify-between", children: platformStats.map(
|
|
38418
|
+
({ platform, icon: Icon3, followers }) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38419
|
+
"div",
|
|
38420
|
+
{
|
|
38421
|
+
className: "flex flex-col items-center gap-1",
|
|
38422
|
+
title: `${formatFollowerCount3(followers)} followers`,
|
|
38423
|
+
children: [
|
|
38424
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38425
|
+
Icon3,
|
|
38426
|
+
{
|
|
38427
|
+
className: `w-5 h-5 ${getPlatformIconColor(platform)}`
|
|
38428
|
+
}
|
|
38429
|
+
),
|
|
38430
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-xs dark:text-gray500", children: followers > 0 && formatFollowerCount3(followers) })
|
|
38431
|
+
]
|
|
38432
|
+
},
|
|
38433
|
+
platform
|
|
38434
|
+
)
|
|
38435
|
+
) })
|
|
38436
|
+
] })
|
|
38437
|
+
] }),
|
|
38438
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex-1 border-l border-gray300 p-6 overflow-hidden transition-all duration-300 ease-in-out", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "space-y-4", children: [
|
|
38439
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { children: [
|
|
38440
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38441
|
+
"div",
|
|
38442
|
+
{
|
|
38443
|
+
ref: descriptionRef,
|
|
38444
|
+
className: `${showFullDescription ? "" : "max-h-[80px] overflow-hidden"} relative`,
|
|
38445
|
+
children: [
|
|
38446
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "text-sm text-gray700 leading-relaxed", children: creator.description || "No description provided." }),
|
|
38447
|
+
!showFullDescription && isDescriptionOverflowing && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 h-10 bg-gradient-to-t from-gray25 to-transparent" })
|
|
38448
|
+
]
|
|
38449
|
+
}
|
|
38450
|
+
),
|
|
38451
|
+
(isDescriptionOverflowing || showFullDescription) && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38452
|
+
"button",
|
|
38453
|
+
{
|
|
38454
|
+
onClick: (e) => {
|
|
38455
|
+
e.stopPropagation();
|
|
38456
|
+
setShowFullDescription((v) => !v);
|
|
38457
|
+
},
|
|
38458
|
+
className: "mt-1 px-3 py-1 rounded border border-gray300 text-sm text-gray700 hover:text-gray900",
|
|
38459
|
+
children: showFullDescription ? "Show less" : "Show more"
|
|
38460
|
+
}
|
|
38461
|
+
)
|
|
38462
|
+
] }),
|
|
38463
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex gap-6 justify-start items-center", children: platformStats.map(
|
|
38464
|
+
({ platform, icon: Icon3, followers, engagement }) => /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
38465
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
38466
|
+
"div",
|
|
38467
|
+
{
|
|
38468
|
+
className: "flex items-center gap-1",
|
|
38469
|
+
title: `${formatFollowerCount3(followers)} followers`,
|
|
38470
|
+
children: [
|
|
38471
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38472
|
+
Icon3,
|
|
38473
|
+
{
|
|
38474
|
+
className: `w-5 h-5 ${getPlatformIconColor(platform)}`
|
|
38475
|
+
}
|
|
38476
|
+
),
|
|
38477
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { className: "text-xs dark:text-gray500", children: followers > 0 ? formatFollowerCount3(followers) : "0" })
|
|
38478
|
+
]
|
|
38479
|
+
}
|
|
38480
|
+
),
|
|
38481
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
38482
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ChartColumn, { className: "w-5 h-5 dark:text-gray500" }),
|
|
38483
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("span", { className: "text-sm dark:text-gray500 w-[40px]", children: [
|
|
38484
|
+
(engagement * 100).toFixed(1),
|
|
38485
|
+
"%"
|
|
38486
|
+
] })
|
|
38487
|
+
] })
|
|
38488
|
+
] }, platform)
|
|
38489
|
+
) }),
|
|
38490
|
+
creator.posts?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "w-full overflow-hidden", children: [
|
|
38491
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("h3", { className: "mb-2 text-sm font-medium text-gray900", children: "Recent Posts" }),
|
|
38492
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "flex gap-3 overflow-x-auto", children: creator.posts.filter(
|
|
38493
|
+
(post) => post.thumbnail || post.thumbnail_url
|
|
38494
|
+
).slice(0, 8).map((post, idx) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38495
|
+
"a",
|
|
38496
|
+
{
|
|
38497
|
+
href: post.url || "#",
|
|
38498
|
+
target: "_blank",
|
|
38499
|
+
rel: "noopener noreferrer",
|
|
38500
|
+
className: "block flex-shrink-0",
|
|
38501
|
+
onClick: (e) => e.stopPropagation(),
|
|
38502
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
38503
|
+
"img",
|
|
38504
|
+
{
|
|
38505
|
+
src: post.thumbnail_url || post.thumbnail,
|
|
38506
|
+
alt: post.title || `Post ${idx + 1}`,
|
|
38507
|
+
className: "rounded-md object-cover w-[120px] h-[120px]"
|
|
38508
|
+
}
|
|
38509
|
+
)
|
|
38510
|
+
},
|
|
38511
|
+
idx
|
|
38512
|
+
)) })
|
|
38513
|
+
] }),
|
|
38514
|
+
creator?.sentiment?.aiReasoning && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "text-gray700 max-h-[200px] overflow-auto", children: [
|
|
38515
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("h4", { className: "font-semibold text-sm", children: "AI Analysis" }),
|
|
38516
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "text-sm", children: creator.sentiment.aiReasoning })
|
|
38517
|
+
] })
|
|
38518
|
+
] }) })
|
|
38519
|
+
] })
|
|
38520
|
+
}
|
|
38521
|
+
);
|
|
38522
|
+
}
|
|
38523
|
+
function CreatorGridView({
|
|
38524
|
+
creatorData
|
|
38525
|
+
}) {
|
|
38526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 [&>*]:transition-all [&>*]:duration-300 auto-rows-min relative grid-flow-dense", children: creatorData.map((creator) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(CreatorGridViewCard, { creator }, creator._id)) });
|
|
38527
|
+
}
|
|
38528
|
+
|
|
38529
|
+
// src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
|
|
38530
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
38531
|
+
var formatFollowerCount4 = (count) => {
|
|
38532
|
+
if (count >= 1e6) {
|
|
38533
|
+
const millions = count / 1e6;
|
|
38534
|
+
return `${millions % 1 === 0 ? Math.floor(millions) : millions.toFixed(1)}M`;
|
|
38535
|
+
} else if (count >= 1e4) {
|
|
38536
|
+
return `${Math.floor(count / 1e3)}k`;
|
|
38537
|
+
} else if (count >= 1e3) {
|
|
38538
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
38539
|
+
}
|
|
38540
|
+
return Math.floor(count).toString();
|
|
38541
|
+
};
|
|
38542
|
+
var getSentimentRank3 = (score) => {
|
|
38543
|
+
if (score >= 80) {
|
|
38544
|
+
return {
|
|
38545
|
+
rank: "STRONG FIT",
|
|
38546
|
+
bgColor: "bg-greenBackground",
|
|
38547
|
+
textColor: "text-greenText",
|
|
38548
|
+
scoreColor: "text-[#499C54]"
|
|
38549
|
+
};
|
|
38550
|
+
} else if (score >= 50) {
|
|
38551
|
+
return {
|
|
38552
|
+
rank: "MODERATE FIT",
|
|
38553
|
+
bgColor: "bg-orangeBackground",
|
|
38554
|
+
textColor: "text-orangeText",
|
|
38555
|
+
scoreColor: "text-[#B3512F]"
|
|
38556
|
+
};
|
|
38557
|
+
} else if (score >= 0) {
|
|
38558
|
+
return {
|
|
38559
|
+
rank: "POOR FIT",
|
|
38560
|
+
bgColor: "bg-redBackground",
|
|
38561
|
+
textColor: "text-redText",
|
|
38562
|
+
scoreColor: "text-[#BE2C35]"
|
|
38563
|
+
};
|
|
38564
|
+
}
|
|
38565
|
+
return {
|
|
38566
|
+
rank: "Unranked",
|
|
38567
|
+
bgColor: "bg-gray500",
|
|
38568
|
+
textColor: "text-gray200",
|
|
38569
|
+
scoreColor: "text-gray500"
|
|
38570
|
+
};
|
|
38571
|
+
};
|
|
38572
|
+
function formatCreator(raw) {
|
|
38573
|
+
return {
|
|
38574
|
+
_id: raw.creator_id || raw.profile?.upfluenceId,
|
|
38575
|
+
name: raw.profile?.name || "",
|
|
38576
|
+
description: raw.profile?.description || "",
|
|
38577
|
+
isVerified: raw.profile?.isVerified || false,
|
|
38578
|
+
country: raw.profile?.country || "",
|
|
38579
|
+
profile_pic: raw.profile?.profilePicture || "",
|
|
38580
|
+
platforms: raw.profile?.platforms,
|
|
38581
|
+
platformMetrics: raw.platformMetrics || {},
|
|
38582
|
+
metrics: {
|
|
38583
|
+
instagram: {
|
|
38584
|
+
engagement: raw.platformMetrics?.instagramMetrics?.engagementRate || 0,
|
|
38585
|
+
followers: raw.platformMetrics?.instagramMetrics?.followers || 0,
|
|
38586
|
+
avgLikes: raw.platformMetrics?.instagramMetrics?.avgLikes || 0,
|
|
38587
|
+
avgComments: raw.platformMetrics?.instagramMetrics?.avgComments || 0
|
|
38588
|
+
},
|
|
38589
|
+
youtube: {
|
|
38590
|
+
engagement: raw.platformMetrics?.youtubeMetrics?.engagementRate || 0,
|
|
38591
|
+
followers: raw.platformMetrics?.youtubeMetrics?.subscribers || 0,
|
|
38592
|
+
avgLikes: raw.platformMetrics?.youtubeMetrics?.avgLikes || 0,
|
|
38593
|
+
avgComments: raw.platformMetrics?.youtubeMetrics?.avgComments || 0
|
|
38594
|
+
},
|
|
38595
|
+
tiktok: {
|
|
38596
|
+
engagement: raw.platformMetrics?.tiktokMetrics?.engagementRate || 0,
|
|
38597
|
+
followers: raw.platformMetrics?.tiktokMetrics?.followers || 0,
|
|
38598
|
+
avgLikes: raw.platformMetrics?.tiktokMetrics?.avgLikes || 0,
|
|
38599
|
+
avgComments: raw.platformMetrics?.tiktokMetrics?.avgComments || 0
|
|
38600
|
+
}
|
|
38601
|
+
},
|
|
38602
|
+
posts: raw.posts || [],
|
|
38603
|
+
sentiment: raw.sentiment || null,
|
|
38604
|
+
audienceDemographics: raw.audienceDemographics || null,
|
|
38605
|
+
brandCollaborations: raw.brandCollaborations || null,
|
|
38606
|
+
profile: raw.profile || {}
|
|
38607
|
+
};
|
|
38608
|
+
}
|
|
38609
|
+
var truncateName2 = (name, maxLen) => {
|
|
38610
|
+
if (!name) return "";
|
|
38611
|
+
return name.length > maxLen ? name.slice(0, maxLen) + "..." : name;
|
|
38612
|
+
};
|
|
38613
|
+
function SearchSpecDisplay({ spec }) {
|
|
38614
|
+
if (!spec) return null;
|
|
38615
|
+
const priorityOneBundles = Array.isArray(spec?.keyword_bundles) ? spec.keyword_bundles.filter((b) => b?.priority !== void 0 ? b.priority === 1 : true).flatMap((b) => b?.keywords || []) : [];
|
|
38616
|
+
const textClass = "text-sm text-white dark:text-gray900";
|
|
38617
|
+
const paddingClass = "px-4 py-1";
|
|
38618
|
+
const roundedClass = "rounded-lg";
|
|
38619
|
+
const tagClass = `${textClass} ${paddingClass} bg-[#85888f] dark:bg-[rgba(249,249,249,0.2)] ${roundedClass} border border-[#85888f] dark:border-gray800 font-medium`;
|
|
38620
|
+
const items = [
|
|
38621
|
+
{
|
|
38622
|
+
key: "platforms",
|
|
38623
|
+
title: "Platforms",
|
|
38624
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-wrap gap-2", children: (spec.platforms || []).filter((p) => ["instagram", "youtube", "tiktok"].includes(p.toLowerCase())).map((p, idx) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: `${tagClass} flex items-center justify-center`, children: p.charAt(0).toUpperCase() + p.slice(1).toLowerCase() }, idx)) })
|
|
38625
|
+
},
|
|
38626
|
+
{
|
|
38627
|
+
key: "follower_range",
|
|
38628
|
+
title: "Follower Range",
|
|
38629
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: `inline-block ${tagClass} font-grotesk`, children: [
|
|
38630
|
+
formatFollowerCount4(spec?.follower_range?.min ?? 0),
|
|
38631
|
+
" -",
|
|
38632
|
+
" ",
|
|
38633
|
+
formatFollowerCount4(spec?.follower_range?.max ?? 0)
|
|
38634
|
+
] })
|
|
38635
|
+
},
|
|
38636
|
+
{
|
|
38637
|
+
key: "geography",
|
|
38638
|
+
title: "Geography",
|
|
38639
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: `inline-block ${tagClass} font-grotesk`, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38640
|
+
"div",
|
|
38641
|
+
{
|
|
38642
|
+
className: "max-w-[200px] overflow-x-auto whitespace-nowrap",
|
|
38643
|
+
style: { scrollbarWidth: "none", textOverflow: "ellipsis", overflow: "hidden" },
|
|
38644
|
+
onMouseEnter: (e) => {
|
|
38645
|
+
e.currentTarget.style.textOverflow = "clip";
|
|
38646
|
+
e.currentTarget.style.overflow = "auto";
|
|
38647
|
+
},
|
|
38648
|
+
onMouseLeave: (e) => {
|
|
38649
|
+
e.currentTarget.style.textOverflow = "ellipsis";
|
|
38650
|
+
e.currentTarget.style.overflow = "hidden";
|
|
38651
|
+
e.currentTarget.scrollLeft = 0;
|
|
38652
|
+
},
|
|
38653
|
+
children: (spec.geography || []).map((g, idx) => /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { children: [
|
|
38654
|
+
g,
|
|
38655
|
+
idx < spec.geography.length - 1 ? ", " : ""
|
|
38656
|
+
] }, idx))
|
|
38657
|
+
}
|
|
38658
|
+
) })
|
|
38659
|
+
},
|
|
38660
|
+
{
|
|
38661
|
+
key: "keyword_bundles",
|
|
38662
|
+
title: "Keyword",
|
|
38663
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex gap-2 font-grotesk font-medium max-w-[500px] overflow-x-auto whitespace-nowrap", style: { scrollbarWidth: "none" }, children: priorityOneBundles.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: `${textClass} text-white/70`, children: "No priority 1 keywords" }) : priorityOneBundles.map((kw, idx) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: tagClass, children: kw }, idx)) })
|
|
38664
|
+
}
|
|
38665
|
+
];
|
|
38666
|
+
const itemsToShow = ["platforms", "follower_range", "geography", "keyword_bundles"];
|
|
38667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex gap-4 pr-[30px] overflow-x-auto", style: { scrollbarWidth: "none" }, children: items.filter(({ key }) => itemsToShow.includes(key) && spec?.[key] !== void 0 && spec?.[key] !== null).map(({ key, title, content }) => /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex-none p-5 bg-paperBackground rounded-lg", children: [
|
|
38668
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-purpleText text-sm mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: title.toUpperCase() }) }),
|
|
38669
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: `flex text-gray900 ${textClass}`, children: content })
|
|
38670
|
+
] }, key)) }) });
|
|
38671
|
+
}
|
|
38672
|
+
function SentimentScoreRank({
|
|
38673
|
+
score,
|
|
38674
|
+
isValidationComplete,
|
|
38675
|
+
showMinialView = false
|
|
38676
|
+
}) {
|
|
38677
|
+
const sentimentScoreRank = getSentimentRank3(score);
|
|
38678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: `flex flex-col justify-end ${showMinialView ? "w-[120px]" : "w-[150px]"} text-sm`, children: [
|
|
38679
|
+
score !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex justify-center items-center mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38680
|
+
"span",
|
|
38681
|
+
{
|
|
38682
|
+
className: `${isValidationComplete ? sentimentScoreRank.bgColor : "bg-gray500"} ${isValidationComplete ? sentimentScoreRank.textColor : "text-gray200"} text-center rounded-md ${showMinialView ? "text-xs px-[6px] py-[2px]" : "text-sm px-2 py-[2px]"}`,
|
|
38683
|
+
children: isValidationComplete ? sentimentScoreRank.rank : "Unranked"
|
|
38684
|
+
}
|
|
38685
|
+
) }),
|
|
38686
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: `flex justify-center ${showMinialView ? "text-[24px]" : "text-[28px]"} font-bold mb-3 ${sentimentScoreRank.scoreColor}`, children: isValidationComplete ? score >= 0 ? `${score}%` : "0%" : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex items-center justify-center py-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-6 h-6 border-2 border-purple100 border-t-transparent rounded-full animate-spin" }) }) }),
|
|
38687
|
+
!showMinialView && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-gray600 dark:text-gray500 text-center", children: "Match Score" })
|
|
38688
|
+
] }) });
|
|
38689
|
+
}
|
|
38690
|
+
function BrandMentionPerformance({ creator }) {
|
|
38691
|
+
const insights = creator?.brandCollaborations?.insights;
|
|
38692
|
+
if (!insights) return null;
|
|
38693
|
+
const isValid2 = (val) => val !== null && val !== void 0 && val !== 0 && val !== "0" && val !== "" && !Number.isNaN(val);
|
|
38694
|
+
if (!isValid2(insights.averageBrandEngagementRate) && !isValid2(insights.effectivenessPercent) && !isValid2(insights.saturationRate)) {
|
|
38695
|
+
return null;
|
|
38696
|
+
}
|
|
38697
|
+
const metrics = [
|
|
38698
|
+
{ title: "Avg engagement rate", subtitle: "on brand mention", value: `${insights?.averageBrandEngagementRate || 0} %` },
|
|
38699
|
+
{ title: "Effectiveness", subtitle: "compared to all posts", value: `${insights?.effectivenessPercent || 0} %` },
|
|
38700
|
+
{ title: "Saturation Rate", subtitle: "on brand mention", value: `${insights?.saturationRate || 0} %` }
|
|
38701
|
+
];
|
|
38702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { children: [
|
|
38703
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-purpleText text-xs mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: "BRAND MENTION PERFORMANCE" }) }),
|
|
38704
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-col gap-3", children: metrics.map((item) => /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex justify-between items-center text-gray700 text-sm", children: [
|
|
38705
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
38706
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h5", { children: item.title }),
|
|
38707
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-xs", children: item.subtitle })
|
|
38708
|
+
] }),
|
|
38709
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-purpleText text-lg", children: item.value })
|
|
38710
|
+
] }, item.title)) })
|
|
38711
|
+
] });
|
|
38712
|
+
}
|
|
38713
|
+
function CreatorFitSummary({ creator, showBrandPerformance }) {
|
|
38714
|
+
const hasDeepAnalysis = creator?.sentiment?.deepAnalysis?.deepAnalysis;
|
|
38715
|
+
const title = hasDeepAnalysis ? "CREATOR DEEP ANALYSIS" : "CREATOR FIT SUMMARY";
|
|
38716
|
+
const content = hasDeepAnalysis ? creator.sentiment.deepAnalysis.deepAnalysis : creator?.sentiment?.aiReasoning || "No data available.";
|
|
38717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: showBrandPerformance ? "col-span-1" : "col-span-2", children: [
|
|
38718
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-purpleText text-xs mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "rounded-md bg-purple200 px-2 py-[4px] font-sans", children: title }) }),
|
|
38719
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "max-h-[140px] overflow-y-auto slim-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-gray700 text-sm", children: content }) })
|
|
38720
|
+
] });
|
|
38721
|
+
}
|
|
38722
|
+
function ProfileSection({ creator, isValidationComplete }) {
|
|
38723
|
+
const username = creator.platformMetrics?.instagramMetrics?.username ? `@${creator.platformMetrics.instagramMetrics.username}` : creator.platformMetrics?.youtubeMetrics?.channelName ? `@${creator.platformMetrics.youtubeMetrics.channelName}` : creator.platformMetrics?.tiktokMetrics?.username ? `@${creator.platformMetrics.tiktokMetrics.username}` : "";
|
|
38724
|
+
const iso2 = normalizeToIso2(creator.country);
|
|
38725
|
+
const meta = codeToMeta[iso2];
|
|
38726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex items-start gap-1 md:gap-6", children: [
|
|
38727
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col items-center gap-6", children: [
|
|
38728
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-[5rem] h-[5rem] rounded-[10px] bg-primary/10 flex items-center justify-center flex-shrink-0 relative overflow-hidden", children: creator.profile_pic ? /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
|
|
38729
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38730
|
+
"img",
|
|
38731
|
+
{
|
|
38732
|
+
src: creator.profile_pic,
|
|
38733
|
+
alt: creator.name,
|
|
38734
|
+
className: "object-cover w-[5rem] h-[5rem] rounded-[15px]"
|
|
38735
|
+
}
|
|
38736
|
+
),
|
|
38737
|
+
creator?.profile?.isVerified && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38738
|
+
BadgeCheck,
|
|
38739
|
+
{
|
|
38740
|
+
size: 35,
|
|
38741
|
+
className: "absolute -top-2 -right-2 text-blue-500 drop-shadow-sm fill-blue-300"
|
|
38742
|
+
}
|
|
38743
|
+
)
|
|
38744
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "text-2xl text-primary", children: creator.name?.charAt(0) || "?" }) }),
|
|
38745
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "block sm:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SentimentScoreRank, { score: creator?.sentiment?.matchScore || -1, isValidationComplete, showMinialView: true }) })
|
|
38746
|
+
] }),
|
|
38747
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col gap-3 truncate", children: [
|
|
38748
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h4", { className: "text-lg text-gray900 max-w-[150px]", title: creator.name, children: truncateName2(creator.name, 100) }) }),
|
|
38749
|
+
username && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-xs text-gray700", children: username }),
|
|
38750
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "text-sm text-gray700 flex items-center gap-2", children: [
|
|
38751
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { className: "text-base", children: meta?.flag }),
|
|
38752
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: meta?.name || creator.country || "Unknown" })
|
|
38753
|
+
] }),
|
|
38754
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "text-xs text-gray700 text-wrap", children: truncateName2(creator.description, 100) })
|
|
38755
|
+
] })
|
|
38756
|
+
] });
|
|
38757
|
+
}
|
|
38758
|
+
function CreatorCardExpandedSection({
|
|
38759
|
+
creator
|
|
38760
|
+
}) {
|
|
38761
|
+
const hasBrandBreakdown = creator?.brandCollaborations?.insights?.brandBreakdown && creator?.sentiment?.deepAnalysis;
|
|
38762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
38763
|
+
import_framer_motion5.motion.div,
|
|
38764
|
+
{
|
|
38765
|
+
initial: { y: 20, opacity: 0 },
|
|
38766
|
+
animate: { y: 0, opacity: 1 },
|
|
38767
|
+
transition: { duration: 0.3, delay: 0.1 },
|
|
38768
|
+
className: "md:mt-6 space-y-5",
|
|
38769
|
+
children: [
|
|
38770
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "md:grid md:grid-cols-[1.3fr_1fr_2fr_120px] gap-8 py-4 pr-7", children: [
|
|
38771
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "col-span-4 sm:col-span-1", children: hasBrandBreakdown ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38772
|
+
BrandCollaborationsList,
|
|
38773
|
+
{
|
|
38774
|
+
brandBreakdown: creator?.brandCollaborations
|
|
38775
|
+
}
|
|
38776
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "hidden sm:block" }) }),
|
|
38777
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "col-span-4 sm:col-span-3", children: creator?.audienceDemographics ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38778
|
+
EngagedAudienceDemographics,
|
|
38779
|
+
{
|
|
38780
|
+
audienceDemographics: creator.audienceDemographics
|
|
38781
|
+
}
|
|
38782
|
+
) : null })
|
|
38783
|
+
] }),
|
|
38784
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38785
|
+
PlatformPostsSection,
|
|
38786
|
+
{
|
|
38787
|
+
platformMetrics: creator.platformMetrics,
|
|
38788
|
+
posts: creator.posts ?? creator.post
|
|
38789
|
+
}
|
|
38790
|
+
)
|
|
38791
|
+
]
|
|
38792
|
+
}
|
|
38793
|
+
);
|
|
38794
|
+
}
|
|
38795
|
+
function CreatorCard({
|
|
38796
|
+
creator,
|
|
38797
|
+
isValidationComplete
|
|
38798
|
+
}) {
|
|
38799
|
+
const [detailsExpanded, setDetailsExpanded] = (0, import_react70.useState)(false);
|
|
38800
|
+
const hasValidBrandMention = (() => {
|
|
38801
|
+
const insights = creator?.brandCollaborations?.insights;
|
|
38802
|
+
if (!insights) return false;
|
|
38803
|
+
const isValid2 = (val) => val !== null && val !== void 0 && val !== 0 && val !== "0" && val !== "" && !Number.isNaN(val);
|
|
38804
|
+
return isValid2(insights.averageBrandEngagementRate) || isValid2(insights.effectivenessPercent) || isValid2(insights.saturationRate);
|
|
38805
|
+
})();
|
|
38806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
38807
|
+
import_framer_motion5.motion.div,
|
|
38808
|
+
{
|
|
38809
|
+
layout: true,
|
|
38810
|
+
initial: { opacity: 0, y: 20 },
|
|
38811
|
+
animate: { opacity: 1, y: 0 },
|
|
38812
|
+
exit: { opacity: 0, y: -20 },
|
|
38813
|
+
transition: { duration: 0.4, ease: [0.22, 1, 0.36, 1] },
|
|
38814
|
+
className: `flex flex-col bg-paperBackground rounded-[25px] py-5 pl-7 border-2 shadow-sm cursor-pointer transition-all ${detailsExpanded ? "border-purple100" : "border-gray300"}`,
|
|
38815
|
+
onClick: () => setDetailsExpanded((prev) => !prev),
|
|
38816
|
+
children: [
|
|
38817
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col gap-4 sm:grid sm:grid-cols-[1.3fr_1fr_2fr_120px] gap-8 items-start w-full pr-7", children: [
|
|
38818
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(ProfileSection, { creator, isValidationComplete }),
|
|
38819
|
+
hasValidBrandMention && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(BrandMentionPerformance, { creator }),
|
|
38820
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorFitSummary, { creator, showBrandPerformance: hasValidBrandMention }),
|
|
38821
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SentimentScoreRank, { score: creator?.sentiment?.matchScore || -1, isValidationComplete }) })
|
|
38822
|
+
] }),
|
|
38823
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_framer_motion5.AnimatePresence, { children: detailsExpanded && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38824
|
+
import_framer_motion5.motion.div,
|
|
38825
|
+
{
|
|
38826
|
+
initial: { height: 0, opacity: 0 },
|
|
38827
|
+
animate: { height: "auto", opacity: 1, transition: { height: { duration: 0.4, ease: [0.04, 0.62, 0.23, 0.98] }, opacity: { duration: 0.3, delay: 0.1 } } },
|
|
38828
|
+
exit: { height: 0, opacity: 0, transition: { height: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] }, opacity: { duration: 0.2 } } },
|
|
38829
|
+
className: "overflow-hidden mt-4",
|
|
38830
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorCardExpandedSection, { creator })
|
|
38831
|
+
}
|
|
38832
|
+
) })
|
|
38833
|
+
]
|
|
38834
|
+
}
|
|
38835
|
+
);
|
|
38836
|
+
}
|
|
38837
|
+
function CreatorDisplay({
|
|
38838
|
+
creators,
|
|
38839
|
+
isValidationComplete
|
|
38840
|
+
}) {
|
|
38841
|
+
const [viewMode, setViewMode] = (0, import_react70.useState)("list");
|
|
38842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "px-4", children: [
|
|
38843
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex justify-end items-center my-3 gap-1", children: [
|
|
38844
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("span", { className: "text-xs text-gray600 mr-2", children: [
|
|
38845
|
+
creators.length,
|
|
38846
|
+
" creators"
|
|
38847
|
+
] }),
|
|
38848
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38849
|
+
"button",
|
|
38850
|
+
{
|
|
38851
|
+
className: `h-7 w-7 flex items-center justify-center rounded ${viewMode === "list" ? "bg-gray200" : ""}`,
|
|
38852
|
+
onClick: () => setViewMode("list"),
|
|
38853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38854
|
+
AlignJustify,
|
|
38855
|
+
{
|
|
38856
|
+
className: `h-5 w-5 ${viewMode === "list" ? "text-gray900 dark:text-white" : "text-gray500"}`
|
|
38857
|
+
}
|
|
38858
|
+
)
|
|
38859
|
+
}
|
|
38860
|
+
),
|
|
38861
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38862
|
+
"button",
|
|
38863
|
+
{
|
|
38864
|
+
className: `h-7 w-7 flex items-center justify-center rounded ${viewMode === "grid" ? "bg-gray200" : ""}`,
|
|
38865
|
+
onClick: () => setViewMode("grid"),
|
|
38866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38867
|
+
LayoutGrid,
|
|
38868
|
+
{
|
|
38869
|
+
className: `h-5 w-5 ${viewMode === "grid" ? "text-gray900 dark:text-white" : "text-gray500"}`
|
|
38870
|
+
}
|
|
38871
|
+
)
|
|
38872
|
+
}
|
|
38873
|
+
)
|
|
38874
|
+
] }),
|
|
38875
|
+
creators.length > 0 ? viewMode === "list" ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "space-y-4", children: creators.map((creator) => /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorCard, { creator, isValidationComplete }, creator._id)) }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorGridView, { creatorData: creators }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "text-center py-8 bg-gray100 rounded-lg border border-gray300", children: [
|
|
38876
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(Users, { className: "w-6 h-6 text-primary" }) }),
|
|
38877
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h3", { className: "text-base font-medium text-gray900", children: "No creators found" }),
|
|
38878
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "mt-1 text-sm text-gray600", children: "Try adjusting your search criteria" })
|
|
38879
|
+
] })
|
|
38880
|
+
] });
|
|
38881
|
+
}
|
|
38882
|
+
function CreatorExpandedPanel({
|
|
38883
|
+
isOpen,
|
|
38884
|
+
onClose,
|
|
38885
|
+
sessionId,
|
|
38886
|
+
creatorIds,
|
|
38887
|
+
version,
|
|
38888
|
+
searchSpec,
|
|
38889
|
+
fetchCreatorDetails
|
|
38890
|
+
}) {
|
|
38891
|
+
const [creators, setCreators] = (0, import_react70.useState)([]);
|
|
38892
|
+
const [loading, setLoading] = (0, import_react70.useState)(false);
|
|
38893
|
+
const fetcher = fetchCreatorDetails ?? defaultFetchCreatorDetails;
|
|
38894
|
+
const loadCreators = (0, import_react70.useCallback)(async () => {
|
|
38895
|
+
if (!creatorIds.length) return;
|
|
38896
|
+
setLoading(true);
|
|
38897
|
+
try {
|
|
38898
|
+
const data = await fetcher({ creatorIds, sessionId, versionNo: version });
|
|
38899
|
+
setCreators((data.creatorData || []).map(formatCreator));
|
|
38900
|
+
} catch (err) {
|
|
38901
|
+
console.error("Failed to fetch creator details:", err);
|
|
38902
|
+
} finally {
|
|
38903
|
+
setLoading(false);
|
|
38904
|
+
}
|
|
38905
|
+
}, [creatorIds, sessionId, version, fetcher]);
|
|
38906
|
+
(0, import_react70.useEffect)(() => {
|
|
38907
|
+
if (isOpen && creatorIds.length > 0) {
|
|
38908
|
+
loadCreators();
|
|
38909
|
+
}
|
|
38910
|
+
}, [isOpen, loadCreators]);
|
|
38911
|
+
if (typeof window === "undefined") return null;
|
|
38912
|
+
return import_react_dom2.default.createPortal(
|
|
38913
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_framer_motion5.AnimatePresence, { mode: "sync", children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
|
|
38914
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38915
|
+
import_framer_motion5.motion.div,
|
|
38916
|
+
{
|
|
38917
|
+
initial: { opacity: 0 },
|
|
38918
|
+
animate: { opacity: 1 },
|
|
38919
|
+
exit: { opacity: 0, display: "none" },
|
|
38920
|
+
transition: { duration: 0.3 },
|
|
38921
|
+
className: "fixed inset-0 bg-black bg-opacity-50 z-[60]",
|
|
38922
|
+
onClick: (e) => {
|
|
38923
|
+
e.stopPropagation();
|
|
38924
|
+
onClose();
|
|
38925
|
+
}
|
|
38926
|
+
},
|
|
38927
|
+
"overlay"
|
|
38928
|
+
),
|
|
38929
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
38930
|
+
import_framer_motion5.motion.div,
|
|
38931
|
+
{
|
|
38932
|
+
initial: { x: "100%" },
|
|
38933
|
+
animate: { x: 0 },
|
|
38934
|
+
exit: { x: "100%" },
|
|
38935
|
+
transition: { type: "spring", damping: 30, stiffness: 400 },
|
|
38936
|
+
className: "fixed top-0 right-0 h-full w-full max-w-7xl bg-background dark:bg-gray25 z-[70] shadow-2xl overflow-y-auto border border-gray300",
|
|
38937
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "py-4 font-noto", children: [
|
|
38938
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex justify-between items-center w-full mb-4 pl-2", children: [
|
|
38939
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("button", { onClick: onClose, className: "p-2 rounded-full transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(X, { className: "w-5 h-5" }) }),
|
|
38940
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex-1 flex flex-col w-[80%]", children: [
|
|
38941
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "flex flex-col md:flex-row justify-between gap-2 md:gap-0 md:items-center pr-16", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col", children: [
|
|
38942
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-fit rounded-md bg-purple200 px-2 py-[4px] mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h4", { className: "text-xs font-medium text-purpleText", children: "VERIFIED SEARCH RESULTS" }) }),
|
|
38943
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("h2", { className: "text-xl font-bold mb-1", children: "Creators Search Results" })
|
|
38944
|
+
] }) }),
|
|
38945
|
+
searchSpec && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SearchSpecDisplay, { spec: searchSpec })
|
|
38946
|
+
] })
|
|
38947
|
+
] }),
|
|
38948
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "border-b border-gray300" }),
|
|
38949
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 gap-3", children: [
|
|
38950
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("div", { className: "w-8 h-8 border-3 border-purple100 border-t-transparent rounded-full animate-spin" }),
|
|
38951
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "text-sm text-gray600", children: "Fetching Creators" })
|
|
38952
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(CreatorDisplay, { creators, isValidationComplete: version !== void 0 })
|
|
38953
|
+
] })
|
|
38954
|
+
},
|
|
38955
|
+
"creator-panel"
|
|
38956
|
+
)
|
|
38957
|
+
] }) }),
|
|
38958
|
+
document.body
|
|
38959
|
+
);
|
|
38960
|
+
}
|
|
38961
|
+
|
|
38962
|
+
// src/molecules/creator-discovery/CreatorWidget/useCreatorWidgetPolling.ts
|
|
38963
|
+
var import_react71 = require("react");
|
|
37219
38964
|
var DEFAULT_POLLING_CONFIG = {
|
|
37220
38965
|
pollInterval: 5e3,
|
|
37221
38966
|
maxDuration: 15 * 60 * 1e3,
|
|
@@ -37225,27 +38970,29 @@ var DEFAULT_POLLING_CONFIG = {
|
|
|
37225
38970
|
function useCreatorWidgetPolling({
|
|
37226
38971
|
sessionId,
|
|
37227
38972
|
currentVersion,
|
|
37228
|
-
fetchVersions,
|
|
37229
|
-
fetchStatus,
|
|
38973
|
+
fetchVersions: fetchVersionsProp,
|
|
38974
|
+
fetchStatus: fetchStatusProp,
|
|
37230
38975
|
pollingConfig,
|
|
37231
38976
|
onStatusChange
|
|
37232
38977
|
}) {
|
|
37233
|
-
const
|
|
38978
|
+
const fetchVersions = fetchVersionsProp ?? defaultFetchVersions;
|
|
38979
|
+
const fetchStatus = fetchStatusProp ?? defaultFetchStatus;
|
|
38980
|
+
const config = (0, import_react71.useMemo)(
|
|
37234
38981
|
() => ({ ...DEFAULT_POLLING_CONFIG, ...pollingConfig }),
|
|
37235
38982
|
[pollingConfig]
|
|
37236
38983
|
);
|
|
37237
|
-
const [versionData, setVersionData] = (0,
|
|
37238
|
-
const [totalVersions, setTotalVersions] = (0,
|
|
37239
|
-
const [selectedVersion, setSelectedVersion] = (0,
|
|
37240
|
-
const [isLoadingVersion, setIsLoadingVersion] = (0,
|
|
37241
|
-
const [isValidationComplete, setIsValidationComplete] = (0,
|
|
37242
|
-
const [versionStatus, setVersionStatus] = (0,
|
|
37243
|
-
const [statusDetails, setStatusDetails] = (0,
|
|
37244
|
-
const [timeDisplay, setTimeDisplay] = (0,
|
|
37245
|
-
const [loadingStatus, setLoadingStatus] = (0,
|
|
37246
|
-
const remainingTimeRef = (0,
|
|
38984
|
+
const [versionData, setVersionData] = (0, import_react71.useState)(null);
|
|
38985
|
+
const [totalVersions, setTotalVersions] = (0, import_react71.useState)(0);
|
|
38986
|
+
const [selectedVersion, setSelectedVersion] = (0, import_react71.useState)();
|
|
38987
|
+
const [isLoadingVersion, setIsLoadingVersion] = (0, import_react71.useState)(false);
|
|
38988
|
+
const [isValidationComplete, setIsValidationComplete] = (0, import_react71.useState)(false);
|
|
38989
|
+
const [versionStatus, setVersionStatus] = (0, import_react71.useState)("checking");
|
|
38990
|
+
const [statusDetails, setStatusDetails] = (0, import_react71.useState)();
|
|
38991
|
+
const [timeDisplay, setTimeDisplay] = (0, import_react71.useState)("");
|
|
38992
|
+
const [loadingStatus, setLoadingStatus] = (0, import_react71.useState)(true);
|
|
38993
|
+
const remainingTimeRef = (0, import_react71.useRef)(0);
|
|
37247
38994
|
const requestedVersion = selectedVersion ?? currentVersion ?? versionData?.currentVersion;
|
|
37248
|
-
const fetchVersionData = (0,
|
|
38995
|
+
const fetchVersionData = (0, import_react71.useCallback)(async () => {
|
|
37249
38996
|
if (!sessionId) return;
|
|
37250
38997
|
if (!versionData) setIsLoadingVersion(true);
|
|
37251
38998
|
try {
|
|
@@ -37266,17 +39013,17 @@ function useCreatorWidgetPolling({
|
|
|
37266
39013
|
setIsLoadingVersion(false);
|
|
37267
39014
|
}
|
|
37268
39015
|
}, [sessionId, requestedVersion, isValidationComplete, fetchVersions, versionData]);
|
|
37269
|
-
(0,
|
|
39016
|
+
(0, import_react71.useEffect)(() => {
|
|
37270
39017
|
fetchVersionData();
|
|
37271
39018
|
}, [sessionId, requestedVersion, isValidationComplete]);
|
|
37272
|
-
(0,
|
|
39019
|
+
(0, import_react71.useEffect)(() => {
|
|
37273
39020
|
if (totalVersions > 0 || !sessionId) return;
|
|
37274
39021
|
const interval = setInterval(() => {
|
|
37275
39022
|
if (totalVersions === 0) fetchVersionData();
|
|
37276
39023
|
}, config.pollInterval);
|
|
37277
39024
|
return () => clearInterval(interval);
|
|
37278
39025
|
}, [totalVersions, sessionId, fetchVersionData, config.pollInterval]);
|
|
37279
|
-
(0,
|
|
39026
|
+
(0, import_react71.useEffect)(() => {
|
|
37280
39027
|
if (!selectedVersion && !requestedVersion) return;
|
|
37281
39028
|
const activeVersion = selectedVersion ?? requestedVersion;
|
|
37282
39029
|
let isMounted = true;
|
|
@@ -37359,7 +39106,7 @@ function useCreatorWidgetPolling({
|
|
|
37359
39106
|
stopPolling();
|
|
37360
39107
|
};
|
|
37361
39108
|
}, [selectedVersion, requestedVersion, sessionId]);
|
|
37362
|
-
const versionNumbers = (0,
|
|
39109
|
+
const versionNumbers = (0, import_react71.useMemo)(() => {
|
|
37363
39110
|
if (!totalVersions) return [];
|
|
37364
39111
|
return Array.from({ length: totalVersions }, (_, i) => i + 1);
|
|
37365
39112
|
}, [totalVersions]);
|
|
@@ -37386,18 +39133,20 @@ function useCreatorWidgetPolling({
|
|
|
37386
39133
|
}
|
|
37387
39134
|
|
|
37388
39135
|
// src/molecules/creator-discovery/CreatorWidget/CreatorWidget.tsx
|
|
37389
|
-
var
|
|
39136
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
37390
39137
|
function CreatorWidgetInner({
|
|
37391
39138
|
sessionId,
|
|
37392
39139
|
currentVersion,
|
|
37393
39140
|
isAgentOutput = false,
|
|
37394
39141
|
fetchVersions,
|
|
37395
39142
|
fetchStatus,
|
|
39143
|
+
fetchCreatorDetails,
|
|
37396
39144
|
pollingConfig,
|
|
37397
39145
|
onStatusChange,
|
|
37398
39146
|
onAction,
|
|
37399
39147
|
className
|
|
37400
39148
|
}) {
|
|
39149
|
+
const [isExpanded, setIsExpanded] = (0, import_react72.useState)(false);
|
|
37401
39150
|
const {
|
|
37402
39151
|
versionNumbers,
|
|
37403
39152
|
selectedVersion,
|
|
@@ -37418,11 +39167,12 @@ function CreatorWidgetInner({
|
|
|
37418
39167
|
pollingConfig,
|
|
37419
39168
|
onStatusChange
|
|
37420
39169
|
});
|
|
37421
|
-
const handleVersionSelect = (0,
|
|
39170
|
+
const handleVersionSelect = (0, import_react72.useCallback)(
|
|
37422
39171
|
(version) => setSelectedVersion(version),
|
|
37423
39172
|
[setSelectedVersion]
|
|
37424
39173
|
);
|
|
37425
|
-
const handleViewCreators = (0,
|
|
39174
|
+
const handleViewCreators = (0, import_react72.useCallback)(() => {
|
|
39175
|
+
setIsExpanded(true);
|
|
37426
39176
|
onAction?.({
|
|
37427
39177
|
type: "view-creators",
|
|
37428
39178
|
sessionId,
|
|
@@ -37431,30 +39181,41 @@ function CreatorWidgetInner({
|
|
|
37431
39181
|
searchSpec
|
|
37432
39182
|
});
|
|
37433
39183
|
}, [onAction, sessionId, creatorIds, selectedVersion, searchSpec]);
|
|
37434
|
-
|
|
37435
|
-
|
|
37436
|
-
|
|
37437
|
-
|
|
37438
|
-
|
|
37439
|
-
|
|
37440
|
-
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
|
|
37447
|
-
|
|
37448
|
-
|
|
37449
|
-
|
|
37450
|
-
|
|
37451
|
-
|
|
37452
|
-
|
|
39184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className, children: [
|
|
39185
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
39186
|
+
CreatorCompactView,
|
|
39187
|
+
{
|
|
39188
|
+
versions: versionNumbers,
|
|
39189
|
+
selectedVersion,
|
|
39190
|
+
creatorImages,
|
|
39191
|
+
creatorLength,
|
|
39192
|
+
isAgentOutput,
|
|
39193
|
+
onVersionSelect: handleVersionSelect,
|
|
39194
|
+
onViewCreators: handleViewCreators,
|
|
39195
|
+
versionStatus,
|
|
39196
|
+
statusDetails,
|
|
39197
|
+
timeDisplay,
|
|
39198
|
+
isLoading
|
|
39199
|
+
}
|
|
39200
|
+
),
|
|
39201
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
39202
|
+
CreatorExpandedPanel,
|
|
39203
|
+
{
|
|
39204
|
+
isOpen: isExpanded,
|
|
39205
|
+
onClose: () => setIsExpanded(false),
|
|
39206
|
+
sessionId,
|
|
39207
|
+
creatorIds,
|
|
39208
|
+
version: selectedVersion,
|
|
39209
|
+
searchSpec,
|
|
39210
|
+
fetchCreatorDetails
|
|
39211
|
+
}
|
|
39212
|
+
)
|
|
39213
|
+
] });
|
|
37453
39214
|
}
|
|
37454
|
-
var CreatorWidget = (0,
|
|
39215
|
+
var CreatorWidget = (0, import_react72.memo)(CreatorWidgetInner);
|
|
37455
39216
|
|
|
37456
39217
|
// src/molecules/workstream-builder/ToolListCard/ToolListCard.tsx
|
|
37457
|
-
var
|
|
39218
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
37458
39219
|
var FONT_STYLE = {
|
|
37459
39220
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37460
39221
|
};
|
|
@@ -37525,7 +39286,7 @@ var ToolListCard = ({
|
|
|
37525
39286
|
grouped[cat].push(tool);
|
|
37526
39287
|
}
|
|
37527
39288
|
const categories = Object.keys(grouped);
|
|
37528
|
-
return /* @__PURE__ */ (0,
|
|
39289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
37529
39290
|
"div",
|
|
37530
39291
|
{
|
|
37531
39292
|
className: cn(
|
|
@@ -37534,34 +39295,34 @@ var ToolListCard = ({
|
|
|
37534
39295
|
),
|
|
37535
39296
|
style: FONT_STYLE,
|
|
37536
39297
|
children: [
|
|
37537
|
-
/* @__PURE__ */ (0,
|
|
37538
|
-
/* @__PURE__ */ (0,
|
|
37539
|
-
/* @__PURE__ */ (0,
|
|
37540
|
-
/* @__PURE__ */ (0,
|
|
39298
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03] flex items-center gap-2.5", children: [
|
|
39299
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Wrench, { className: "w-3.5 h-3.5 text-interactive" }) }),
|
|
39300
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: "Available Tools" }),
|
|
39301
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "ml-auto text-[11px] font-medium text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.06] px-2 py-0.5 rounded-full", children: tools.length })
|
|
37541
39302
|
] }),
|
|
37542
|
-
/* @__PURE__ */ (0,
|
|
39303
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "divide-y divide-[var(--border-color)]", children: categories.map((cat) => {
|
|
37543
39304
|
const CatIcon = resolveCategoryIcon(cat);
|
|
37544
39305
|
const headerBg = CATEGORY_HEADER_BG[cat.toLowerCase()] || CATEGORY_HEADER_BG.general;
|
|
37545
|
-
return /* @__PURE__ */ (0,
|
|
37546
|
-
/* @__PURE__ */ (0,
|
|
37547
|
-
/* @__PURE__ */ (0,
|
|
37548
|
-
/* @__PURE__ */ (0,
|
|
37549
|
-
/* @__PURE__ */ (0,
|
|
39306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "px-4 py-3", children: [
|
|
39307
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: cn("flex items-center gap-2 mb-2.5 -mx-4 px-4 py-1.5", headerBg), children: [
|
|
39308
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(CatIcon, { className: "w-3.5 h-3.5 text-interactive/70" }),
|
|
39309
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-[11px] font-semibold text-[var(--foreground)]/50 uppercase tracking-wider", children: cat }),
|
|
39310
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-[10px] text-[var(--foreground)]/30", children: grouped[cat].length })
|
|
37550
39311
|
] }),
|
|
37551
|
-
/* @__PURE__ */ (0,
|
|
39312
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "space-y-1.5", children: grouped[cat].map((tool) => {
|
|
37552
39313
|
const ToolIcon = resolveIcon(tool);
|
|
37553
|
-
return /* @__PURE__ */ (0,
|
|
39314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
|
|
37554
39315
|
"div",
|
|
37555
39316
|
{
|
|
37556
39317
|
className: "group flex items-start gap-3 px-3 py-2 rounded-lg hover:bg-[var(--foreground)]/[0.03] transition-colors",
|
|
37557
39318
|
children: [
|
|
37558
|
-
/* @__PURE__ */ (0,
|
|
37559
|
-
/* @__PURE__ */ (0,
|
|
37560
|
-
/* @__PURE__ */ (0,
|
|
37561
|
-
tool.display_name && tool.display_name !== tool.name && /* @__PURE__ */ (0,
|
|
37562
|
-
/* @__PURE__ */ (0,
|
|
39319
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "shrink-0 mt-0.5 w-5 h-5 rounded flex items-center justify-center bg-interactive/[0.08]", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(ToolIcon, { className: "w-3 h-3 text-interactive/60" }) }),
|
|
39320
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39321
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
39322
|
+
tool.display_name && tool.display_name !== tool.name && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-[13px] font-medium text-[var(--foreground)] truncate max-w-full", children: tool.display_name }),
|
|
39323
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "text-[11px] font-mono px-1.5 py-0.5 rounded bg-[var(--foreground)]/[0.06] text-[var(--foreground)]/50 border border-[var(--foreground)]/[0.06] truncate", children: tool.name })
|
|
37563
39324
|
] }),
|
|
37564
|
-
tool.description && /* @__PURE__ */ (0,
|
|
39325
|
+
tool.description && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("p", { className: "text-xs text-[var(--foreground)]/50 leading-relaxed mt-0.5 break-words whitespace-normal", children: tool.description })
|
|
37565
39326
|
] })
|
|
37566
39327
|
]
|
|
37567
39328
|
},
|
|
@@ -37576,8 +39337,8 @@ var ToolListCard = ({
|
|
|
37576
39337
|
};
|
|
37577
39338
|
|
|
37578
39339
|
// src/molecules/workstream-builder/AgentCard/AgentCard.tsx
|
|
37579
|
-
var
|
|
37580
|
-
var
|
|
39340
|
+
var import_react73 = require("react");
|
|
39341
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
37581
39342
|
var FONT_STYLE2 = {
|
|
37582
39343
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37583
39344
|
};
|
|
@@ -37588,15 +39349,15 @@ var AgentCard = ({
|
|
|
37588
39349
|
onSave,
|
|
37589
39350
|
className
|
|
37590
39351
|
}) => {
|
|
37591
|
-
const [isEditing, setIsEditing] = (0,
|
|
37592
|
-
const [isSaving, setIsSaving] = (0,
|
|
37593
|
-
const [editState, setEditState] = (0,
|
|
39352
|
+
const [isEditing, setIsEditing] = (0, import_react73.useState)(false);
|
|
39353
|
+
const [isSaving, setIsSaving] = (0, import_react73.useState)(false);
|
|
39354
|
+
const [editState, setEditState] = (0, import_react73.useState)({
|
|
37594
39355
|
display_name: agent.display_name,
|
|
37595
39356
|
description: agent.description,
|
|
37596
39357
|
image: agent.image || ""
|
|
37597
39358
|
});
|
|
37598
39359
|
const avatarUrl = agent.image || `https://api.dicebear.com/7.x/avataaars/svg?seed=${agent.name}`;
|
|
37599
|
-
const handleEdit = (0,
|
|
39360
|
+
const handleEdit = (0, import_react73.useCallback)(() => {
|
|
37600
39361
|
setEditState({
|
|
37601
39362
|
display_name: agent.display_name,
|
|
37602
39363
|
description: agent.description,
|
|
@@ -37604,10 +39365,10 @@ var AgentCard = ({
|
|
|
37604
39365
|
});
|
|
37605
39366
|
setIsEditing(true);
|
|
37606
39367
|
}, [agent]);
|
|
37607
|
-
const handleCancel = (0,
|
|
39368
|
+
const handleCancel = (0, import_react73.useCallback)(() => {
|
|
37608
39369
|
setIsEditing(false);
|
|
37609
39370
|
}, []);
|
|
37610
|
-
const handleSave = (0,
|
|
39371
|
+
const handleSave = (0, import_react73.useCallback)(async () => {
|
|
37611
39372
|
if (!onSave) return;
|
|
37612
39373
|
const updates = {};
|
|
37613
39374
|
if (editState.display_name !== agent.display_name)
|
|
@@ -37631,7 +39392,7 @@ var AgentCard = ({
|
|
|
37631
39392
|
}
|
|
37632
39393
|
}, [onSave, agent, editState]);
|
|
37633
39394
|
if (compact) {
|
|
37634
|
-
return /* @__PURE__ */ (0,
|
|
39395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37635
39396
|
"div",
|
|
37636
39397
|
{
|
|
37637
39398
|
className: cn(
|
|
@@ -37640,14 +39401,14 @@ var AgentCard = ({
|
|
|
37640
39401
|
),
|
|
37641
39402
|
style: FONT_STYLE2,
|
|
37642
39403
|
children: [
|
|
37643
|
-
/* @__PURE__ */ (0,
|
|
37644
|
-
/* @__PURE__ */ (0,
|
|
37645
|
-
/* @__PURE__ */ (0,
|
|
39404
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(Avatar, { className: "h-8 w-8 shrink-0", children: [
|
|
39405
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarImage, { src: avatarUrl, alt: agent.display_name }),
|
|
39406
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarFallback, { className: "bg-interactive/10 text-interactive text-xs font-bold", children: agent.display_name.charAt(0) })
|
|
37646
39407
|
] }),
|
|
37647
|
-
/* @__PURE__ */ (0,
|
|
37648
|
-
/* @__PURE__ */ (0,
|
|
37649
|
-
/* @__PURE__ */ (0,
|
|
37650
|
-
/* @__PURE__ */ (0,
|
|
39408
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39409
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
39410
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-[var(--foreground)] text-sm font-semibold truncate", children: agent.display_name }),
|
|
39411
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37651
39412
|
"span",
|
|
37652
39413
|
{
|
|
37653
39414
|
className: cn(
|
|
@@ -37655,7 +39416,7 @@ var AgentCard = ({
|
|
|
37655
39416
|
agent.enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37656
39417
|
),
|
|
37657
39418
|
children: [
|
|
37658
|
-
/* @__PURE__ */ (0,
|
|
39419
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: cn(
|
|
37659
39420
|
"w-1.5 h-1.5 rounded-full",
|
|
37660
39421
|
agent.enabled ? "bg-emerald-500" : "bg-red-500"
|
|
37661
39422
|
) }),
|
|
@@ -37664,13 +39425,13 @@ var AgentCard = ({
|
|
|
37664
39425
|
}
|
|
37665
39426
|
)
|
|
37666
39427
|
] }),
|
|
37667
|
-
/* @__PURE__ */ (0,
|
|
39428
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-[var(--foreground)]/50 text-xs truncate", children: agent.description })
|
|
37668
39429
|
] })
|
|
37669
39430
|
]
|
|
37670
39431
|
}
|
|
37671
39432
|
);
|
|
37672
39433
|
}
|
|
37673
|
-
return /* @__PURE__ */ (0,
|
|
39434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37674
39435
|
"div",
|
|
37675
39436
|
{
|
|
37676
39437
|
className: cn(
|
|
@@ -37679,14 +39440,14 @@ var AgentCard = ({
|
|
|
37679
39440
|
),
|
|
37680
39441
|
style: FONT_STYLE2,
|
|
37681
39442
|
children: [
|
|
37682
|
-
/* @__PURE__ */ (0,
|
|
37683
|
-
/* @__PURE__ */ (0,
|
|
37684
|
-
/* @__PURE__ */ (0,
|
|
37685
|
-
/* @__PURE__ */ (0,
|
|
39443
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-start gap-4 px-5 py-4 bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: [
|
|
39444
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(Avatar, { className: "h-12 w-12 shrink-0 border-2 border-interactive/20", children: [
|
|
39445
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarImage, { src: isEditing && editState.image ? editState.image : avatarUrl, alt: agent.display_name }),
|
|
39446
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(AvatarFallback, { className: "bg-interactive/10 text-interactive text-lg font-bold", children: agent.display_name.charAt(0) })
|
|
37686
39447
|
] }),
|
|
37687
|
-
/* @__PURE__ */ (0,
|
|
37688
|
-
/* @__PURE__ */ (0,
|
|
37689
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
39448
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39449
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
39450
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37690
39451
|
"input",
|
|
37691
39452
|
{
|
|
37692
39453
|
type: "text",
|
|
@@ -37696,9 +39457,9 @@ var AgentCard = ({
|
|
|
37696
39457
|
className: "flex-1 bg-transparent border-b border-interactive/30 text-sm font-semibold text-foreground outline-none focus:border-interactive transition-all",
|
|
37697
39458
|
placeholder: "Agent name"
|
|
37698
39459
|
}
|
|
37699
|
-
) : /* @__PURE__ */ (0,
|
|
37700
|
-
/* @__PURE__ */ (0,
|
|
37701
|
-
/* @__PURE__ */ (0,
|
|
39460
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)] truncate", children: agent.display_name }),
|
|
39461
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-[11px] font-mono text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.05] px-1.5 py-0.5 rounded", children: agent.name }),
|
|
39462
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
|
|
37702
39463
|
"span",
|
|
37703
39464
|
{
|
|
37704
39465
|
className: cn(
|
|
@@ -37706,7 +39467,7 @@ var AgentCard = ({
|
|
|
37706
39467
|
agent.enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37707
39468
|
),
|
|
37708
39469
|
children: [
|
|
37709
|
-
/* @__PURE__ */ (0,
|
|
39470
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: cn(
|
|
37710
39471
|
"w-1.5 h-1.5 rounded-full",
|
|
37711
39472
|
agent.enabled ? "bg-emerald-500" : "bg-red-500"
|
|
37712
39473
|
) }),
|
|
@@ -37715,7 +39476,7 @@ var AgentCard = ({
|
|
|
37715
39476
|
}
|
|
37716
39477
|
)
|
|
37717
39478
|
] }),
|
|
37718
|
-
/* @__PURE__ */ (0,
|
|
39479
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "mt-1", children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37719
39480
|
"textarea",
|
|
37720
39481
|
{
|
|
37721
39482
|
value: editState.description,
|
|
@@ -37725,10 +39486,10 @@ var AgentCard = ({
|
|
|
37725
39486
|
rows: 2,
|
|
37726
39487
|
placeholder: "Describe this agent..."
|
|
37727
39488
|
}
|
|
37728
|
-
) : /* @__PURE__ */ (0,
|
|
37729
|
-
isEditing && /* @__PURE__ */ (0,
|
|
37730
|
-
/* @__PURE__ */ (0,
|
|
37731
|
-
/* @__PURE__ */ (0,
|
|
39489
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("p", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed whitespace-normal", children: agent.description }) }),
|
|
39490
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
39491
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-[10px] text-[var(--foreground)]/30 uppercase font-semibold", children: "Avatar:" }),
|
|
39492
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37732
39493
|
"input",
|
|
37733
39494
|
{
|
|
37734
39495
|
type: "text",
|
|
@@ -37741,8 +39502,8 @@ var AgentCard = ({
|
|
|
37741
39502
|
)
|
|
37742
39503
|
] })
|
|
37743
39504
|
] }),
|
|
37744
|
-
editable && onSave && /* @__PURE__ */ (0,
|
|
37745
|
-
/* @__PURE__ */ (0,
|
|
39505
|
+
editable && onSave && /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex items-center gap-1.5 shrink-0", children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
39506
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37746
39507
|
"button",
|
|
37747
39508
|
{
|
|
37748
39509
|
onClick: handleCancel,
|
|
@@ -37751,7 +39512,7 @@ var AgentCard = ({
|
|
|
37751
39512
|
children: "Cancel"
|
|
37752
39513
|
}
|
|
37753
39514
|
),
|
|
37754
|
-
/* @__PURE__ */ (0,
|
|
39515
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37755
39516
|
"button",
|
|
37756
39517
|
{
|
|
37757
39518
|
onClick: handleSave,
|
|
@@ -37760,7 +39521,7 @@ var AgentCard = ({
|
|
|
37760
39521
|
children: isSaving ? "Saving..." : "Save"
|
|
37761
39522
|
}
|
|
37762
39523
|
)
|
|
37763
|
-
] }) : /* @__PURE__ */ (0,
|
|
39524
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37764
39525
|
"button",
|
|
37765
39526
|
{
|
|
37766
39527
|
onClick: handleEdit,
|
|
@@ -37769,18 +39530,18 @@ var AgentCard = ({
|
|
|
37769
39530
|
}
|
|
37770
39531
|
) })
|
|
37771
39532
|
] }),
|
|
37772
|
-
/* @__PURE__ */ (0,
|
|
39533
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex flex-wrap items-center gap-3 px-5 pb-3 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("span", { className: "text-[var(--foreground)]/40", children: [
|
|
37773
39534
|
"Model:",
|
|
37774
39535
|
" ",
|
|
37775
|
-
/* @__PURE__ */ (0,
|
|
39536
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "font-mono text-[var(--foreground)]/70", children: agent.model })
|
|
37776
39537
|
] }) }),
|
|
37777
|
-
agent.tools && agent.tools.length > 0 && /* @__PURE__ */ (0,
|
|
37778
|
-
/* @__PURE__ */ (0,
|
|
39538
|
+
agent.tools && agent.tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("div", { className: "border-t border-[var(--border-color)] px-5 py-3", children: [
|
|
39539
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsxs)("p", { className: "text-[11px] font-semibold text-[var(--foreground)]/40 uppercase tracking-wide mb-2", children: [
|
|
37779
39540
|
"Tools (",
|
|
37780
39541
|
agent.tools.length,
|
|
37781
39542
|
")"
|
|
37782
39543
|
] }),
|
|
37783
|
-
/* @__PURE__ */ (0,
|
|
39544
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { className: "flex flex-wrap gap-1.5", children: agent.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
37784
39545
|
"span",
|
|
37785
39546
|
{
|
|
37786
39547
|
className: "text-[11px] px-2 py-0.5 rounded-md bg-interactive/10 text-interactive font-mono border border-interactive/20",
|
|
@@ -37795,7 +39556,7 @@ var AgentCard = ({
|
|
|
37795
39556
|
};
|
|
37796
39557
|
|
|
37797
39558
|
// src/molecules/workstream-builder/AgentDataTable/AgentDataTable.tsx
|
|
37798
|
-
var
|
|
39559
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
37799
39560
|
var FONT_STYLE3 = {
|
|
37800
39561
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37801
39562
|
};
|
|
@@ -37806,7 +39567,7 @@ var AgentDataTable = ({
|
|
|
37806
39567
|
}) => {
|
|
37807
39568
|
const renderCell = (value) => {
|
|
37808
39569
|
if (typeof value === "boolean") {
|
|
37809
|
-
return /* @__PURE__ */ (0,
|
|
39570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
37810
39571
|
"span",
|
|
37811
39572
|
{
|
|
37812
39573
|
className: cn(
|
|
@@ -37814,18 +39575,18 @@ var AgentDataTable = ({
|
|
|
37814
39575
|
value ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
37815
39576
|
),
|
|
37816
39577
|
children: [
|
|
37817
|
-
value ? /* @__PURE__ */ (0,
|
|
37818
|
-
/* @__PURE__ */ (0,
|
|
37819
|
-
/* @__PURE__ */ (0,
|
|
39578
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
39579
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
39580
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
37820
39581
|
] }),
|
|
37821
39582
|
value ? "Yes" : "No"
|
|
37822
39583
|
]
|
|
37823
39584
|
}
|
|
37824
39585
|
);
|
|
37825
39586
|
}
|
|
37826
|
-
return /* @__PURE__ */ (0,
|
|
39587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { className: "text-[var(--foreground)]", children: String(value) });
|
|
37827
39588
|
};
|
|
37828
|
-
return /* @__PURE__ */ (0,
|
|
39589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37829
39590
|
"div",
|
|
37830
39591
|
{
|
|
37831
39592
|
className: cn(
|
|
@@ -37833,8 +39594,8 @@ var AgentDataTable = ({
|
|
|
37833
39594
|
className
|
|
37834
39595
|
),
|
|
37835
39596
|
style: FONT_STYLE3,
|
|
37836
|
-
children: /* @__PURE__ */ (0,
|
|
37837
|
-
/* @__PURE__ */ (0,
|
|
39597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("table", { className: "w-full text-xs", children: [
|
|
39598
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("tr", { className: "border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03]", children: headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37838
39599
|
"th",
|
|
37839
39600
|
{
|
|
37840
39601
|
className: "text-left px-4 py-2.5 text-[11px] font-semibold text-[var(--foreground)]/60 uppercase tracking-wide whitespace-nowrap",
|
|
@@ -37842,14 +39603,14 @@ var AgentDataTable = ({
|
|
|
37842
39603
|
},
|
|
37843
39604
|
header
|
|
37844
39605
|
)) }) }),
|
|
37845
|
-
/* @__PURE__ */ (0,
|
|
39606
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)("tbody", { children: rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37846
39607
|
"tr",
|
|
37847
39608
|
{
|
|
37848
39609
|
className: cn(
|
|
37849
39610
|
"border-b border-[var(--border-color)] last:border-b-0 hover:bg-[var(--foreground)]/[0.03] transition-colors",
|
|
37850
39611
|
rowIdx % 2 === 1 && "bg-[var(--foreground)]/[0.015]"
|
|
37851
39612
|
),
|
|
37852
|
-
children: row.map((cell, cellIdx) => /* @__PURE__ */ (0,
|
|
39613
|
+
children: row.map((cell, cellIdx) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
37853
39614
|
"td",
|
|
37854
39615
|
{
|
|
37855
39616
|
className: "px-4 py-2.5 text-xs whitespace-nowrap",
|
|
@@ -37866,8 +39627,8 @@ var AgentDataTable = ({
|
|
|
37866
39627
|
};
|
|
37867
39628
|
|
|
37868
39629
|
// src/molecules/workstream-builder/WorkflowVisualizer/WorkflowVisualizer.tsx
|
|
37869
|
-
var
|
|
37870
|
-
var
|
|
39630
|
+
var import_react74 = require("react");
|
|
39631
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
37871
39632
|
var FONT_STYLE4 = {
|
|
37872
39633
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37873
39634
|
};
|
|
@@ -37875,10 +39636,10 @@ var WorkflowVisualizer = ({
|
|
|
37875
39636
|
steps,
|
|
37876
39637
|
className
|
|
37877
39638
|
}) => {
|
|
37878
|
-
const [expandedStep, setExpandedStep] = (0,
|
|
39639
|
+
const [expandedStep, setExpandedStep] = (0, import_react74.useState)(
|
|
37879
39640
|
steps[0]?.id || null
|
|
37880
39641
|
);
|
|
37881
|
-
return /* @__PURE__ */ (0,
|
|
39642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37882
39643
|
"div",
|
|
37883
39644
|
{
|
|
37884
39645
|
className: cn(
|
|
@@ -37887,8 +39648,8 @@ var WorkflowVisualizer = ({
|
|
|
37887
39648
|
),
|
|
37888
39649
|
style: FONT_STYLE4,
|
|
37889
39650
|
children: [
|
|
37890
|
-
/* @__PURE__ */ (0,
|
|
37891
|
-
/* @__PURE__ */ (0,
|
|
39651
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03] flex items-center gap-2.5", children: [
|
|
39652
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
37892
39653
|
"svg",
|
|
37893
39654
|
{
|
|
37894
39655
|
width: "14",
|
|
@@ -37900,24 +39661,24 @@ var WorkflowVisualizer = ({
|
|
|
37900
39661
|
className: "text-interactive",
|
|
37901
39662
|
strokeLinecap: "round",
|
|
37902
39663
|
strokeLinejoin: "round",
|
|
37903
|
-
children: /* @__PURE__ */ (0,
|
|
39664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("polyline", { points: "22 12 18 12 15 21 9 3 6 12 2 12" })
|
|
37904
39665
|
}
|
|
37905
39666
|
) }),
|
|
37906
|
-
/* @__PURE__ */ (0,
|
|
37907
|
-
/* @__PURE__ */ (0,
|
|
39667
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: "Workflow" }),
|
|
39668
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("span", { className: "ml-auto text-[11px] font-medium text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.06] px-2 py-0.5 rounded-full", children: [
|
|
37908
39669
|
steps.length,
|
|
37909
39670
|
" steps"
|
|
37910
39671
|
] })
|
|
37911
39672
|
] }),
|
|
37912
|
-
/* @__PURE__ */ (0,
|
|
39673
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "px-4 py-3", children: steps.map((step, idx) => {
|
|
37913
39674
|
const isLast = idx === steps.length - 1;
|
|
37914
39675
|
const isExpanded = expandedStep === step.id;
|
|
37915
|
-
return /* @__PURE__ */ (0,
|
|
37916
|
-
/* @__PURE__ */ (0,
|
|
37917
|
-
/* @__PURE__ */ (0,
|
|
37918
|
-
!isLast && /* @__PURE__ */ (0,
|
|
39676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex gap-3", children: [
|
|
39677
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex flex-col items-center shrink-0", children: [
|
|
39678
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "w-7 h-7 rounded-full bg-interactive/10 border-2 border-interactive/30 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[10px] font-bold text-interactive", children: idx + 1 }) }),
|
|
39679
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "w-0.5 flex-1 min-h-[16px] bg-interactive/15" })
|
|
37919
39680
|
] }),
|
|
37920
|
-
/* @__PURE__ */ (0,
|
|
39681
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37921
39682
|
"div",
|
|
37922
39683
|
{
|
|
37923
39684
|
className: cn(
|
|
@@ -37925,14 +39686,14 @@ var WorkflowVisualizer = ({
|
|
|
37925
39686
|
isExpanded ? "bg-[var(--foreground)]/[0.02] shadow-sm" : "hover:bg-[var(--foreground)]/[0.02] hover:shadow-sm hover:-translate-y-0.5"
|
|
37926
39687
|
),
|
|
37927
39688
|
children: [
|
|
37928
|
-
/* @__PURE__ */ (0,
|
|
39689
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37929
39690
|
"button",
|
|
37930
39691
|
{
|
|
37931
39692
|
onClick: () => setExpandedStep(isExpanded ? null : step.id),
|
|
37932
39693
|
className: "w-full text-left px-3 py-2.5 flex items-center gap-2 whitespace-normal",
|
|
37933
39694
|
children: [
|
|
37934
|
-
/* @__PURE__ */ (0,
|
|
37935
|
-
/* @__PURE__ */ (0,
|
|
39695
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[13px] font-medium text-[var(--foreground)]", children: step.name }) }),
|
|
39696
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
37936
39697
|
"svg",
|
|
37937
39698
|
{
|
|
37938
39699
|
width: "12",
|
|
@@ -37945,28 +39706,28 @@ var WorkflowVisualizer = ({
|
|
|
37945
39706
|
"shrink-0 text-[var(--foreground)]/30 transition-transform",
|
|
37946
39707
|
isExpanded && "rotate-180"
|
|
37947
39708
|
),
|
|
37948
|
-
children: /* @__PURE__ */ (0,
|
|
39709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
37949
39710
|
}
|
|
37950
39711
|
)
|
|
37951
39712
|
]
|
|
37952
39713
|
}
|
|
37953
39714
|
),
|
|
37954
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
37955
|
-
step.description && /* @__PURE__ */ (0,
|
|
37956
|
-
step.sub_steps && step.sub_steps.length > 0 && /* @__PURE__ */ (0,
|
|
39715
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "px-3 pb-3 space-y-2.5", children: [
|
|
39716
|
+
step.description && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("p", { className: "text-xs text-[var(--foreground)]/50 leading-relaxed whitespace-normal", children: step.description }),
|
|
39717
|
+
step.sub_steps && step.sub_steps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "space-y-1", children: step.sub_steps.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(
|
|
37957
39718
|
"div",
|
|
37958
39719
|
{
|
|
37959
39720
|
className: "flex items-start gap-2 text-xs",
|
|
37960
39721
|
children: [
|
|
37961
|
-
/* @__PURE__ */ (0,
|
|
37962
|
-
/* @__PURE__ */ (0,
|
|
39722
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 mt-0.5 w-1.5 h-1.5 rounded-full bg-interactive/40" }),
|
|
39723
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[var(--foreground)]/60", children: sub.action })
|
|
37963
39724
|
]
|
|
37964
39725
|
},
|
|
37965
39726
|
sub.id
|
|
37966
39727
|
)) }),
|
|
37967
|
-
step.tools && step.tools.length > 0 && /* @__PURE__ */ (0,
|
|
37968
|
-
/* @__PURE__ */ (0,
|
|
37969
|
-
step.tools.map((tool) => /* @__PURE__ */ (0,
|
|
39728
|
+
step.tools && step.tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
|
|
39729
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[10px] text-[var(--foreground)]/30 uppercase font-semibold tracking-wider", children: "Tools:" }),
|
|
39730
|
+
step.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
37970
39731
|
"span",
|
|
37971
39732
|
{
|
|
37972
39733
|
className: "text-[10px] font-mono px-1.5 py-0.5 rounded bg-interactive/[0.08] text-interactive/70 border border-interactive/10",
|
|
@@ -37975,9 +39736,9 @@ var WorkflowVisualizer = ({
|
|
|
37975
39736
|
tool
|
|
37976
39737
|
))
|
|
37977
39738
|
] }),
|
|
37978
|
-
step.on_failure && /* @__PURE__ */ (0,
|
|
37979
|
-
/* @__PURE__ */ (0,
|
|
37980
|
-
/* @__PURE__ */ (0,
|
|
39739
|
+
step.on_failure && /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "flex items-start gap-2 text-xs bg-[var(--redBackground,_#ef4444)]/[0.06] border border-[var(--redText,_#ef4444)]/10 rounded-md px-2.5 py-2 whitespace-normal", children: [
|
|
39740
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "shrink-0 text-[10px] font-semibold text-[var(--redText,_#ef4444)]/70 uppercase tracking-wider mt-px", children: "On failure:" }),
|
|
39741
|
+
/* @__PURE__ */ (0, import_jsx_runtime137.jsx)("span", { className: "text-[var(--foreground)]/50", children: step.on_failure })
|
|
37981
39742
|
] })
|
|
37982
39743
|
] })
|
|
37983
39744
|
]
|
|
@@ -37991,8 +39752,8 @@ var WorkflowVisualizer = ({
|
|
|
37991
39752
|
};
|
|
37992
39753
|
|
|
37993
39754
|
// src/molecules/workstream-builder/InstructionPreview/InstructionPreview.tsx
|
|
37994
|
-
var
|
|
37995
|
-
var
|
|
39755
|
+
var import_react75 = require("react");
|
|
39756
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
37996
39757
|
var FONT_STYLE5 = {
|
|
37997
39758
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
37998
39759
|
};
|
|
@@ -38004,12 +39765,12 @@ var InstructionPreview = ({
|
|
|
38004
39765
|
tools,
|
|
38005
39766
|
className
|
|
38006
39767
|
}) => {
|
|
38007
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
38008
|
-
const [copied, setCopied] = (0,
|
|
39768
|
+
const [isExpanded, setIsExpanded] = (0, import_react75.useState)(false);
|
|
39769
|
+
const [copied, setCopied] = (0, import_react75.useState)(false);
|
|
38009
39770
|
const previewLength = 300;
|
|
38010
39771
|
const isLong = instruction.length > previewLength;
|
|
38011
39772
|
const displayText = isExpanded || !isLong ? instruction : instruction.slice(0, previewLength) + "...";
|
|
38012
|
-
const handleCopy = (0,
|
|
39773
|
+
const handleCopy = (0, import_react75.useCallback)(async () => {
|
|
38013
39774
|
try {
|
|
38014
39775
|
await navigator.clipboard.writeText(instruction);
|
|
38015
39776
|
setCopied(true);
|
|
@@ -38027,7 +39788,7 @@ var InstructionPreview = ({
|
|
|
38027
39788
|
setTimeout(() => setCopied(false), 2e3);
|
|
38028
39789
|
}
|
|
38029
39790
|
}, [instruction]);
|
|
38030
|
-
return /* @__PURE__ */ (0,
|
|
39791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
38031
39792
|
"div",
|
|
38032
39793
|
{
|
|
38033
39794
|
className: cn(
|
|
@@ -38036,8 +39797,8 @@ var InstructionPreview = ({
|
|
|
38036
39797
|
),
|
|
38037
39798
|
style: FONT_STYLE5,
|
|
38038
39799
|
children: [
|
|
38039
|
-
/* @__PURE__ */ (0,
|
|
38040
|
-
/* @__PURE__ */ (0,
|
|
39800
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.03]", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
39801
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "w-6 h-6 rounded-md bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
38041
39802
|
"svg",
|
|
38042
39803
|
{
|
|
38043
39804
|
width: "14",
|
|
@@ -38050,24 +39811,24 @@ var InstructionPreview = ({
|
|
|
38050
39811
|
strokeLinecap: "round",
|
|
38051
39812
|
strokeLinejoin: "round",
|
|
38052
39813
|
children: [
|
|
38053
|
-
/* @__PURE__ */ (0,
|
|
38054
|
-
/* @__PURE__ */ (0,
|
|
38055
|
-
/* @__PURE__ */ (0,
|
|
38056
|
-
/* @__PURE__ */ (0,
|
|
38057
|
-
/* @__PURE__ */ (0,
|
|
39814
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
39815
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("polyline", { points: "14 2 14 8 20 8" }),
|
|
39816
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
39817
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
39818
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("polyline", { points: "10 9 9 9 8 9" })
|
|
38058
39819
|
]
|
|
38059
39820
|
}
|
|
38060
39821
|
) }),
|
|
38061
|
-
/* @__PURE__ */ (0,
|
|
38062
|
-
/* @__PURE__ */ (0,
|
|
38063
|
-
description && /* @__PURE__ */ (0,
|
|
39822
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39823
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)]", children: agent_name }),
|
|
39824
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[11px] text-[var(--foreground)]/40 mt-0.5 whitespace-normal", children: description })
|
|
38064
39825
|
] })
|
|
38065
39826
|
] }) }),
|
|
38066
|
-
/* @__PURE__ */ (0,
|
|
38067
|
-
/* @__PURE__ */ (0,
|
|
38068
|
-
/* @__PURE__ */ (0,
|
|
38069
|
-
/* @__PURE__ */ (0,
|
|
38070
|
-
/* @__PURE__ */ (0,
|
|
39827
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "px-4 py-3 space-y-3", children: [
|
|
39828
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { children: [
|
|
39829
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
39830
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider", children: "Instruction" }),
|
|
39831
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
38071
39832
|
"button",
|
|
38072
39833
|
{
|
|
38073
39834
|
onClick: handleCopy,
|
|
@@ -38076,14 +39837,14 @@ var InstructionPreview = ({
|
|
|
38076
39837
|
}
|
|
38077
39838
|
)
|
|
38078
39839
|
] }),
|
|
38079
|
-
/* @__PURE__ */ (0,
|
|
38080
|
-
isLong && /* @__PURE__ */ (0,
|
|
39840
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed whitespace-pre-wrap font-mono bg-[var(--foreground)]/[0.02] border border-[var(--border-color)] rounded-lg p-3", children: displayText }),
|
|
39841
|
+
isLong && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(
|
|
38081
39842
|
"button",
|
|
38082
39843
|
{
|
|
38083
39844
|
onClick: () => setIsExpanded(!isExpanded),
|
|
38084
39845
|
className: "inline-flex items-center gap-1 text-[11px] text-interactive hover:underline mt-1",
|
|
38085
39846
|
children: [
|
|
38086
|
-
/* @__PURE__ */ (0,
|
|
39847
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
38087
39848
|
"svg",
|
|
38088
39849
|
{
|
|
38089
39850
|
width: "12",
|
|
@@ -38093,7 +39854,7 @@ var InstructionPreview = ({
|
|
|
38093
39854
|
stroke: "currentColor",
|
|
38094
39855
|
strokeWidth: "2",
|
|
38095
39856
|
className: cn("transition-transform", isExpanded && "rotate-180"),
|
|
38096
|
-
children: /* @__PURE__ */ (0,
|
|
39857
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
38097
39858
|
}
|
|
38098
39859
|
),
|
|
38099
39860
|
isExpanded ? "Show less" : "Show full instruction"
|
|
@@ -38101,16 +39862,16 @@ var InstructionPreview = ({
|
|
|
38101
39862
|
}
|
|
38102
39863
|
)
|
|
38103
39864
|
] }),
|
|
38104
|
-
workflow_summary && workflow_summary.length > 0 && /* @__PURE__ */ (0,
|
|
38105
|
-
/* @__PURE__ */ (0,
|
|
38106
|
-
/* @__PURE__ */ (0,
|
|
38107
|
-
/* @__PURE__ */ (0,
|
|
38108
|
-
/* @__PURE__ */ (0,
|
|
39865
|
+
workflow_summary && workflow_summary.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { children: [
|
|
39866
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider mb-1.5", children: "Workflow" }),
|
|
39867
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "space-y-1", children: workflow_summary.map((step, idx) => /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex items-start gap-2 text-xs", children: [
|
|
39868
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "shrink-0 w-5 h-5 rounded-full bg-interactive/10 flex items-center justify-center text-[10px] font-bold text-interactive", children: idx + 1 }),
|
|
39869
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "text-[var(--foreground)]/50 mt-0.5", children: step })
|
|
38109
39870
|
] }, idx)) })
|
|
38110
39871
|
] }),
|
|
38111
|
-
tools && tools.length > 0 && /* @__PURE__ */ (0,
|
|
38112
|
-
/* @__PURE__ */ (0,
|
|
38113
|
-
/* @__PURE__ */ (0,
|
|
39872
|
+
tools && tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { children: [
|
|
39873
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/30 uppercase tracking-wider mb-1.5", children: "Tools" }),
|
|
39874
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "flex flex-wrap gap-1.5", children: tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
38114
39875
|
"span",
|
|
38115
39876
|
{
|
|
38116
39877
|
className: "text-[10px] font-mono px-2 py-0.5 rounded bg-interactive/[0.08] text-interactive/70 border border-interactive/10",
|
|
@@ -38126,8 +39887,8 @@ var InstructionPreview = ({
|
|
|
38126
39887
|
};
|
|
38127
39888
|
|
|
38128
39889
|
// src/molecules/workstream-builder/UIComponentSelector/UIComponentSelector.tsx
|
|
38129
|
-
var
|
|
38130
|
-
var
|
|
39890
|
+
var import_react76 = require("react");
|
|
39891
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
38131
39892
|
var FONT_STYLE6 = {
|
|
38132
39893
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38133
39894
|
};
|
|
@@ -38138,11 +39899,11 @@ function UIComponentSelector({
|
|
|
38138
39899
|
className,
|
|
38139
39900
|
isLatestMessage = true
|
|
38140
39901
|
}) {
|
|
38141
|
-
const [selected, setSelected] = (0,
|
|
39902
|
+
const [selected, setSelected] = (0, import_react76.useState)(() => {
|
|
38142
39903
|
const recommended = components.filter((c) => c.recommended).map((c) => c.name);
|
|
38143
39904
|
return new Set(recommended);
|
|
38144
39905
|
});
|
|
38145
|
-
const [submitted, setSubmitted] = (0,
|
|
39906
|
+
const [submitted, setSubmitted] = (0, import_react76.useState)(false);
|
|
38146
39907
|
const grouped = components.reduce(
|
|
38147
39908
|
(acc, comp) => {
|
|
38148
39909
|
const cat = comp.category || "Other";
|
|
@@ -38166,43 +39927,63 @@ function UIComponentSelector({
|
|
|
38166
39927
|
onSelect?.(Array.from(selected));
|
|
38167
39928
|
};
|
|
38168
39929
|
const categoryOrder = Object.keys(grouped).sort();
|
|
38169
|
-
return /* @__PURE__ */ (0,
|
|
39930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
38170
39931
|
"div",
|
|
38171
39932
|
{
|
|
38172
39933
|
className: cn(
|
|
38173
|
-
"rounded-xl border border-
|
|
39934
|
+
"my-3 rounded-xl border border-border bg-card overflow-hidden shadow-sm",
|
|
38174
39935
|
className
|
|
38175
39936
|
),
|
|
38176
39937
|
style: FONT_STYLE6,
|
|
38177
39938
|
children: [
|
|
38178
|
-
/* @__PURE__ */ (0,
|
|
38179
|
-
/* @__PURE__ */ (0,
|
|
38180
|
-
|
|
38181
|
-
|
|
38182
|
-
|
|
38183
|
-
|
|
38184
|
-
|
|
39939
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
39940
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
39941
|
+
"svg",
|
|
39942
|
+
{
|
|
39943
|
+
width: "12",
|
|
39944
|
+
height: "12",
|
|
39945
|
+
viewBox: "0 0 24 24",
|
|
39946
|
+
fill: "none",
|
|
39947
|
+
stroke: "currentColor",
|
|
39948
|
+
strokeWidth: "2",
|
|
39949
|
+
className: "text-interactive",
|
|
39950
|
+
children: [
|
|
39951
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
39952
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
39953
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "3", y: "14", width: "7", height: "7" }),
|
|
39954
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("rect", { x: "14", y: "14", width: "7", height: "7" })
|
|
39955
|
+
]
|
|
39956
|
+
}
|
|
39957
|
+
) }),
|
|
39958
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { children: [
|
|
39959
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("h3", { className: "text-xs font-semibold text-foreground", children: "Select UI Components" }),
|
|
39960
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: "Choose which visual components this agent can use in its responses." })
|
|
39961
|
+
] })
|
|
39962
|
+
] }) }),
|
|
39963
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "px-4 py-3 space-y-4", children: categoryOrder.map((category) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { children: [
|
|
39964
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("h4", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-2", children: category }),
|
|
39965
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "space-y-1.5", children: grouped[category].map((comp) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
38185
39966
|
"label",
|
|
38186
39967
|
{
|
|
38187
39968
|
className: cn(
|
|
38188
|
-
"flex items-start gap-3 px-3 py-2 rounded-lg cursor-pointer transition-
|
|
38189
|
-
submitted || !isLatestMessage ? "cursor-default opacity-
|
|
39969
|
+
"flex items-start gap-3 px-3 py-2 rounded-lg cursor-pointer transition-all",
|
|
39970
|
+
submitted || !isLatestMessage ? "cursor-default opacity-60" : "hover:bg-muted/80",
|
|
38190
39971
|
selected.has(comp.name) && !submitted && "bg-interactive/5 border border-interactive/20",
|
|
38191
39972
|
selected.has(comp.name) && submitted && "bg-interactive/5"
|
|
38192
39973
|
),
|
|
38193
39974
|
children: [
|
|
38194
|
-
/* @__PURE__ */ (0,
|
|
39975
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38195
39976
|
"div",
|
|
38196
39977
|
{
|
|
38197
39978
|
className: cn(
|
|
38198
39979
|
"mt-0.5 w-4 h-4 rounded border flex items-center justify-center shrink-0 transition-colors",
|
|
38199
|
-
selected.has(comp.name) ? "bg-interactive border-interactive" : "border-
|
|
39980
|
+
selected.has(comp.name) ? "bg-interactive border-interactive" : "border-muted-foreground/30"
|
|
38200
39981
|
),
|
|
38201
39982
|
onClick: (e) => {
|
|
38202
39983
|
e.preventDefault();
|
|
38203
39984
|
toggle(comp.name);
|
|
38204
39985
|
},
|
|
38205
|
-
children: selected.has(comp.name) && /* @__PURE__ */ (0,
|
|
39986
|
+
children: selected.has(comp.name) && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38206
39987
|
"svg",
|
|
38207
39988
|
{
|
|
38208
39989
|
width: "10",
|
|
@@ -38211,12 +39992,12 @@ function UIComponentSelector({
|
|
|
38211
39992
|
fill: "none",
|
|
38212
39993
|
stroke: "white",
|
|
38213
39994
|
strokeWidth: "3",
|
|
38214
|
-
children: /* @__PURE__ */ (0,
|
|
39995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
38215
39996
|
}
|
|
38216
39997
|
)
|
|
38217
39998
|
}
|
|
38218
39999
|
),
|
|
38219
|
-
/* @__PURE__ */ (0,
|
|
40000
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38220
40001
|
"input",
|
|
38221
40002
|
{
|
|
38222
40003
|
type: "checkbox",
|
|
@@ -38226,11 +40007,11 @@ function UIComponentSelector({
|
|
|
38226
40007
|
className: "sr-only"
|
|
38227
40008
|
}
|
|
38228
40009
|
),
|
|
38229
|
-
/* @__PURE__ */ (0,
|
|
38230
|
-
/* @__PURE__ */ (0,
|
|
38231
|
-
/* @__PURE__ */ (0,
|
|
38232
|
-
comp.recommended && /* @__PURE__ */ (0,
|
|
38233
|
-
onPreview && /* @__PURE__ */ (0,
|
|
40010
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
40011
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
40012
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: "text-sm font-medium text-foreground", children: comp.display_name }),
|
|
40013
|
+
comp.recommended && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: "px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider rounded-full bg-emerald-500/10 text-emerald-600 border border-emerald-500/20", children: "Recommended" }),
|
|
40014
|
+
onPreview && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38234
40015
|
"button",
|
|
38235
40016
|
{
|
|
38236
40017
|
type: "button",
|
|
@@ -38239,9 +40020,9 @@ function UIComponentSelector({
|
|
|
38239
40020
|
e.stopPropagation();
|
|
38240
40021
|
onPreview(comp.name);
|
|
38241
40022
|
},
|
|
38242
|
-
className: "shrink-0 p-0.5 rounded hover:bg-
|
|
40023
|
+
className: "shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
|
|
38243
40024
|
title: `Preview ${comp.display_name}`,
|
|
38244
|
-
children: /* @__PURE__ */ (0,
|
|
40025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
|
|
38245
40026
|
"svg",
|
|
38246
40027
|
{
|
|
38247
40028
|
width: "14",
|
|
@@ -38252,30 +40033,30 @@ function UIComponentSelector({
|
|
|
38252
40033
|
strokeWidth: "2",
|
|
38253
40034
|
strokeLinecap: "round",
|
|
38254
40035
|
strokeLinejoin: "round",
|
|
38255
|
-
className: "text-
|
|
40036
|
+
className: "text-muted-foreground hover:text-interactive",
|
|
38256
40037
|
children: [
|
|
38257
|
-
/* @__PURE__ */ (0,
|
|
38258
|
-
/* @__PURE__ */ (0,
|
|
38259
|
-
/* @__PURE__ */ (0,
|
|
40038
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
40039
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
40040
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
38260
40041
|
]
|
|
38261
40042
|
}
|
|
38262
40043
|
)
|
|
38263
40044
|
}
|
|
38264
40045
|
)
|
|
38265
40046
|
] }),
|
|
38266
|
-
/* @__PURE__ */ (0,
|
|
40047
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: "ml-0 text-xs text-muted-foreground", children: comp.description })
|
|
38267
40048
|
] })
|
|
38268
40049
|
]
|
|
38269
40050
|
},
|
|
38270
40051
|
comp.name
|
|
38271
40052
|
)) })
|
|
38272
40053
|
] }, category)) }),
|
|
38273
|
-
!submitted && isLatestMessage && /* @__PURE__ */ (0,
|
|
38274
|
-
/* @__PURE__ */ (0,
|
|
40054
|
+
!submitted && isLatestMessage && /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "px-4 py-3 border-t border-border/60 flex items-center justify-between bg-muted/30", children: [
|
|
40055
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
38275
40056
|
selected.size,
|
|
38276
40057
|
" selected"
|
|
38277
40058
|
] }),
|
|
38278
|
-
/* @__PURE__ */ (0,
|
|
40059
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
38279
40060
|
"button",
|
|
38280
40061
|
{
|
|
38281
40062
|
onClick: handleContinue,
|
|
@@ -38283,14 +40064,15 @@ function UIComponentSelector({
|
|
|
38283
40064
|
children: "Continue"
|
|
38284
40065
|
}
|
|
38285
40066
|
)
|
|
38286
|
-
] })
|
|
40067
|
+
] }),
|
|
40068
|
+
submitted && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "px-4 pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
|
|
38287
40069
|
]
|
|
38288
40070
|
}
|
|
38289
40071
|
);
|
|
38290
40072
|
}
|
|
38291
40073
|
|
|
38292
40074
|
// src/molecules/workstream-builder/MultiAgentCard/MultiAgentCard.tsx
|
|
38293
|
-
var
|
|
40075
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
38294
40076
|
var FONT_STYLE7 = {
|
|
38295
40077
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38296
40078
|
};
|
|
@@ -38303,7 +40085,7 @@ var MultiAgentCard = ({
|
|
|
38303
40085
|
className
|
|
38304
40086
|
}) => {
|
|
38305
40087
|
const avatarUrl = `https://api.dicebear.com/7.x/avataaars/svg?seed=${name}`;
|
|
38306
|
-
return /* @__PURE__ */ (0,
|
|
40088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
38307
40089
|
"div",
|
|
38308
40090
|
{
|
|
38309
40091
|
className: cn(
|
|
@@ -38312,14 +40094,14 @@ var MultiAgentCard = ({
|
|
|
38312
40094
|
),
|
|
38313
40095
|
style: FONT_STYLE7,
|
|
38314
40096
|
children: [
|
|
38315
|
-
/* @__PURE__ */ (0,
|
|
38316
|
-
/* @__PURE__ */ (0,
|
|
38317
|
-
/* @__PURE__ */ (0,
|
|
38318
|
-
/* @__PURE__ */ (0,
|
|
38319
|
-
/* @__PURE__ */ (0,
|
|
38320
|
-
/* @__PURE__ */ (0,
|
|
38321
|
-
/* @__PURE__ */ (0,
|
|
38322
|
-
/* @__PURE__ */ (0,
|
|
40097
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-start gap-4 px-5 py-4 bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: [
|
|
40098
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "h-12 w-12 shrink-0 rounded-full border-2 border-interactive/20 overflow-hidden bg-interactive/10 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("img", { src: avatarUrl, alt: display_name, className: "h-full w-full" }) }),
|
|
40099
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
40100
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40101
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("h4", { className: "text-sm font-semibold text-[var(--foreground)] truncate", children: display_name }),
|
|
40102
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "text-[11px] font-mono text-[var(--foreground)]/40 bg-[var(--foreground)]/[0.05] px-1.5 py-0.5 rounded", children: name }),
|
|
40103
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "text-[10px] px-2 py-0.5 rounded-full font-medium bg-interactive/10 text-interactive", children: "Multi-Agent" }),
|
|
40104
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
38323
40105
|
"span",
|
|
38324
40106
|
{
|
|
38325
40107
|
className: cn(
|
|
@@ -38327,7 +40109,7 @@ var MultiAgentCard = ({
|
|
|
38327
40109
|
enabled ? "bg-emerald-500/10 text-emerald-600" : "bg-red-500/10 text-red-500"
|
|
38328
40110
|
),
|
|
38329
40111
|
children: [
|
|
38330
|
-
/* @__PURE__ */ (0,
|
|
40112
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: cn(
|
|
38331
40113
|
"w-1.5 h-1.5 rounded-full",
|
|
38332
40114
|
enabled ? "bg-emerald-500" : "bg-red-500"
|
|
38333
40115
|
) }),
|
|
@@ -38336,18 +40118,18 @@ var MultiAgentCard = ({
|
|
|
38336
40118
|
}
|
|
38337
40119
|
)
|
|
38338
40120
|
] }),
|
|
38339
|
-
/* @__PURE__ */ (0,
|
|
40121
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "text-xs text-[var(--foreground)]/60 leading-relaxed mt-1 whitespace-normal", style: { textWrap: "auto" }, children: description })
|
|
38340
40122
|
] })
|
|
38341
40123
|
] }),
|
|
38342
|
-
stages.length > 0 && /* @__PURE__ */ (0,
|
|
38343
|
-
/* @__PURE__ */ (0,
|
|
40124
|
+
stages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "border-t border-[var(--border-color)] px-5 py-4", children: [
|
|
40125
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("p", { className: "text-[11px] font-semibold text-[var(--foreground)]/40 uppercase tracking-wide mb-3", children: [
|
|
38344
40126
|
"Stages (",
|
|
38345
40127
|
stages.length,
|
|
38346
40128
|
")"
|
|
38347
40129
|
] }),
|
|
38348
|
-
/* @__PURE__ */ (0,
|
|
38349
|
-
/* @__PURE__ */ (0,
|
|
38350
|
-
/* @__PURE__ */ (0,
|
|
40130
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "flex flex-col gap-0", children: stages.map((stage, idx) => /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-stretch", children: [
|
|
40131
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex flex-col items-center mr-3 w-5", children: [
|
|
40132
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
38351
40133
|
"div",
|
|
38352
40134
|
{
|
|
38353
40135
|
className: cn(
|
|
@@ -38357,20 +40139,20 @@ var MultiAgentCard = ({
|
|
|
38357
40139
|
children: idx + 1
|
|
38358
40140
|
}
|
|
38359
40141
|
),
|
|
38360
|
-
idx < stages.length - 1 && /* @__PURE__ */ (0,
|
|
40142
|
+
idx < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "w-px flex-1 min-h-[16px] border-l border-dashed border-interactive/30" })
|
|
38361
40143
|
] }),
|
|
38362
|
-
/* @__PURE__ */ (0,
|
|
38363
|
-
/* @__PURE__ */ (0,
|
|
38364
|
-
/* @__PURE__ */ (0,
|
|
38365
|
-
/* @__PURE__ */ (0,
|
|
40144
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex-1 mb-2 p-3 rounded-lg border border-[var(--border-color)] bg-[var(--foreground)]/[0.02]", children: [
|
|
40145
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40146
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "text-xs font-semibold text-[var(--foreground)]", children: stage.name }),
|
|
40147
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "text-[10px] font-mono text-[var(--foreground)]/30 bg-[var(--foreground)]/[0.04] px-1.5 py-0.5 rounded", children: stage.agent_name })
|
|
38366
40148
|
] }),
|
|
38367
|
-
/* @__PURE__ */ (0,
|
|
38368
|
-
stage.tools && stage.tools.length > 0 && /* @__PURE__ */ (0,
|
|
40149
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-center gap-3 mt-1.5 text-[10px] text-[var(--foreground)]/50", children: [
|
|
40150
|
+
stage.tools && stage.tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("span", { children: [
|
|
38369
40151
|
stage.tools.length,
|
|
38370
40152
|
" tool",
|
|
38371
40153
|
stage.tools.length !== 1 ? "s" : ""
|
|
38372
40154
|
] }),
|
|
38373
|
-
stage.ui_components && stage.ui_components.length > 0 && /* @__PURE__ */ (0,
|
|
40155
|
+
stage.ui_components && stage.ui_components.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("span", { children: [
|
|
38374
40156
|
stage.ui_components.length,
|
|
38375
40157
|
" component",
|
|
38376
40158
|
stage.ui_components.length !== 1 ? "s" : ""
|
|
@@ -38385,7 +40167,7 @@ var MultiAgentCard = ({
|
|
|
38385
40167
|
};
|
|
38386
40168
|
|
|
38387
40169
|
// src/molecules/workstream-builder/MultiAgentPlan/MultiAgentPlan.tsx
|
|
38388
|
-
var
|
|
40170
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
38389
40171
|
var FONT_STYLE8 = {
|
|
38390
40172
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38391
40173
|
};
|
|
@@ -38393,7 +40175,7 @@ var MultiAgentPlan = ({
|
|
|
38393
40175
|
stages = [],
|
|
38394
40176
|
className
|
|
38395
40177
|
}) => {
|
|
38396
|
-
return /* @__PURE__ */ (0,
|
|
40178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
|
|
38397
40179
|
"div",
|
|
38398
40180
|
{
|
|
38399
40181
|
className: cn(
|
|
@@ -38402,8 +40184,8 @@ var MultiAgentPlan = ({
|
|
|
38402
40184
|
),
|
|
38403
40185
|
style: FONT_STYLE8,
|
|
38404
40186
|
children: [
|
|
38405
|
-
/* @__PURE__ */ (0,
|
|
38406
|
-
/* @__PURE__ */ (0,
|
|
40187
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-gradient-to-r from-[var(--foreground)]/[0.02] to-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40188
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "w-4 h-4 rounded bg-violet-500/20 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
38407
40189
|
"svg",
|
|
38408
40190
|
{
|
|
38409
40191
|
width: "10",
|
|
@@ -38413,20 +40195,20 @@ var MultiAgentPlan = ({
|
|
|
38413
40195
|
stroke: "currentColor",
|
|
38414
40196
|
strokeWidth: "2",
|
|
38415
40197
|
className: "text-violet-600",
|
|
38416
|
-
children: /* @__PURE__ */ (0,
|
|
40198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("path", { d: "M16 3h5v5M4 20L21 3M21 16v5h-5M15 15l6 6M4 4l5 5" })
|
|
38417
40199
|
}
|
|
38418
40200
|
) }),
|
|
38419
|
-
/* @__PURE__ */ (0,
|
|
38420
|
-
/* @__PURE__ */ (0,
|
|
40201
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("span", { className: "text-xs font-semibold text-[var(--foreground)]", children: "Proposed Multi-Agent Workflow" }),
|
|
40202
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("span", { className: "text-[10px] px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 font-medium", children: "Draft" })
|
|
38421
40203
|
] }) }),
|
|
38422
|
-
/* @__PURE__ */ (0,
|
|
38423
|
-
/* @__PURE__ */ (0,
|
|
38424
|
-
/* @__PURE__ */ (0,
|
|
38425
|
-
idx < stages.length - 1 && /* @__PURE__ */ (0,
|
|
40204
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "flex flex-col gap-0", children: stages.map((stage, idx) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex items-stretch min-w-0", children: [
|
|
40205
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex flex-col items-center mr-3 w-6", children: [
|
|
40206
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 bg-interactive/10 text-interactive border border-interactive/30", children: idx + 1 }),
|
|
40207
|
+
idx < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "w-px flex-1 min-h-[12px] border-l border-dashed border-interactive/30" })
|
|
38426
40208
|
] }),
|
|
38427
|
-
/* @__PURE__ */ (0,
|
|
38428
|
-
/* @__PURE__ */ (0,
|
|
38429
|
-
stage.description && /* @__PURE__ */ (0,
|
|
40209
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "flex-1 mb-2 pb-2 min-w-0", children: [
|
|
40210
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("p", { className: "text-xs font-semibold text-foreground", children: stage.name }),
|
|
40211
|
+
stage.description && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
38430
40212
|
"p",
|
|
38431
40213
|
{
|
|
38432
40214
|
className: "text-[11px] text-foreground/50 mt-0.5 whitespace-normal",
|
|
@@ -38434,7 +40216,7 @@ var MultiAgentPlan = ({
|
|
|
38434
40216
|
children: stage.description
|
|
38435
40217
|
}
|
|
38436
40218
|
),
|
|
38437
|
-
stage.proposed_tools && stage.proposed_tools.length > 0 && /* @__PURE__ */ (0,
|
|
40219
|
+
stage.proposed_tools && stage.proposed_tools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "flex flex-wrap gap-1 mt-1.5", children: stage.proposed_tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
38438
40220
|
"span",
|
|
38439
40221
|
{
|
|
38440
40222
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-interactive/10 text-interactive font-mono",
|
|
@@ -38450,8 +40232,8 @@ var MultiAgentPlan = ({
|
|
|
38450
40232
|
};
|
|
38451
40233
|
|
|
38452
40234
|
// src/molecules/workstream-builder/MultiAgentUISelector/MultiAgentUISelector.tsx
|
|
38453
|
-
var
|
|
38454
|
-
var
|
|
40235
|
+
var import_react77 = require("react");
|
|
40236
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
38455
40237
|
var FONT_STYLE9 = {
|
|
38456
40238
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38457
40239
|
};
|
|
@@ -38463,8 +40245,8 @@ var MultiAgentUISelector = ({
|
|
|
38463
40245
|
className,
|
|
38464
40246
|
isLatestMessage = true
|
|
38465
40247
|
}) => {
|
|
38466
|
-
const [activeStageId, setActiveStageId] = (0,
|
|
38467
|
-
const [selections, setSelections] = (0,
|
|
40248
|
+
const [activeStageId, setActiveStageId] = (0, import_react77.useState)(stages[0]?.id || "");
|
|
40249
|
+
const [selections, setSelections] = (0, import_react77.useState)(
|
|
38468
40250
|
() => {
|
|
38469
40251
|
const init = {};
|
|
38470
40252
|
const recommendedNames = components.filter((c) => c.recommended).map((c) => c.name);
|
|
@@ -38475,14 +40257,14 @@ var MultiAgentUISelector = ({
|
|
|
38475
40257
|
return init;
|
|
38476
40258
|
}
|
|
38477
40259
|
);
|
|
38478
|
-
const [submitted, setSubmitted] = (0,
|
|
40260
|
+
const [submitted, setSubmitted] = (0, import_react77.useState)(false);
|
|
38479
40261
|
const grouped = components.reduce((acc, comp) => {
|
|
38480
40262
|
const cat = comp.category || "Other";
|
|
38481
40263
|
if (!acc[cat]) acc[cat] = [];
|
|
38482
40264
|
acc[cat].push(comp);
|
|
38483
40265
|
return acc;
|
|
38484
40266
|
}, {});
|
|
38485
|
-
const toggleComponent = (0,
|
|
40267
|
+
const toggleComponent = (0, import_react77.useCallback)(
|
|
38486
40268
|
(stageId, compName) => {
|
|
38487
40269
|
if (submitted || !isLatestMessage) return;
|
|
38488
40270
|
setSelections((prev) => {
|
|
@@ -38499,7 +40281,7 @@ var MultiAgentUISelector = ({
|
|
|
38499
40281
|
},
|
|
38500
40282
|
[submitted]
|
|
38501
40283
|
);
|
|
38502
|
-
const selectAll = (0,
|
|
40284
|
+
const selectAll = (0, import_react77.useCallback)(
|
|
38503
40285
|
(stageId) => {
|
|
38504
40286
|
if (submitted || !isLatestMessage) return;
|
|
38505
40287
|
setSelections((prev) => {
|
|
@@ -38510,7 +40292,7 @@ var MultiAgentUISelector = ({
|
|
|
38510
40292
|
},
|
|
38511
40293
|
[submitted, isLatestMessage, components]
|
|
38512
40294
|
);
|
|
38513
|
-
const clearAll = (0,
|
|
40295
|
+
const clearAll = (0, import_react77.useCallback)(
|
|
38514
40296
|
(stageId) => {
|
|
38515
40297
|
if (submitted || !isLatestMessage) return;
|
|
38516
40298
|
setSelections((prev) => {
|
|
@@ -38521,7 +40303,7 @@ var MultiAgentUISelector = ({
|
|
|
38521
40303
|
},
|
|
38522
40304
|
[submitted, isLatestMessage]
|
|
38523
40305
|
);
|
|
38524
|
-
const handleContinue = (0,
|
|
40306
|
+
const handleContinue = (0, import_react77.useCallback)(() => {
|
|
38525
40307
|
setSubmitted(true);
|
|
38526
40308
|
if (onSelect) {
|
|
38527
40309
|
const result = {};
|
|
@@ -38532,59 +40314,59 @@ var MultiAgentUISelector = ({
|
|
|
38532
40314
|
}
|
|
38533
40315
|
}, [onSelect, selections]);
|
|
38534
40316
|
const activeStage = stages.find((s) => s.id === activeStageId);
|
|
38535
|
-
return /* @__PURE__ */ (0,
|
|
40317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38536
40318
|
"div",
|
|
38537
40319
|
{
|
|
38538
40320
|
className: cn(
|
|
38539
|
-
"
|
|
40321
|
+
"my-3 rounded-xl border border-border bg-card overflow-hidden shadow-sm",
|
|
38540
40322
|
className
|
|
38541
40323
|
),
|
|
38542
40324
|
style: FONT_STYLE9,
|
|
38543
40325
|
children: [
|
|
38544
|
-
/* @__PURE__ */ (0,
|
|
38545
|
-
/* @__PURE__ */ (0,
|
|
40326
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40327
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38546
40328
|
"svg",
|
|
38547
40329
|
{
|
|
38548
|
-
width: "
|
|
38549
|
-
height: "
|
|
40330
|
+
width: "12",
|
|
40331
|
+
height: "12",
|
|
38550
40332
|
viewBox: "0 0 24 24",
|
|
38551
40333
|
fill: "none",
|
|
38552
40334
|
stroke: "currentColor",
|
|
38553
40335
|
strokeWidth: "2",
|
|
38554
40336
|
className: "text-interactive",
|
|
38555
40337
|
children: [
|
|
38556
|
-
/* @__PURE__ */ (0,
|
|
38557
|
-
/* @__PURE__ */ (0,
|
|
38558
|
-
/* @__PURE__ */ (0,
|
|
38559
|
-
/* @__PURE__ */ (0,
|
|
40338
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "3", y: "3", width: "7", height: "7" }),
|
|
40339
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "14", y: "3", width: "7", height: "7" }),
|
|
40340
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "3", y: "14", width: "7", height: "7" }),
|
|
40341
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("rect", { x: "14", y: "14", width: "7", height: "7" })
|
|
38560
40342
|
]
|
|
38561
40343
|
}
|
|
38562
40344
|
) }),
|
|
38563
|
-
/* @__PURE__ */ (0,
|
|
40345
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "text-xs font-semibold text-foreground", children: "UI Components per Stage" })
|
|
38564
40346
|
] }) }),
|
|
38565
|
-
/* @__PURE__ */ (0,
|
|
40347
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "flex gap-1 border-b border-border/60 px-4 py-2 bg-muted/20", children: stages.map((stage) => /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38566
40348
|
"button",
|
|
38567
40349
|
{
|
|
38568
40350
|
onClick: () => setActiveStageId(stage.id),
|
|
38569
40351
|
className: cn(
|
|
38570
40352
|
"px-3 py-1.5 text-[11px] font-medium rounded-full transition-colors",
|
|
38571
|
-
activeStageId === stage.id ? "bg-interactive text-white" : "text-
|
|
40353
|
+
activeStageId === stage.id ? "bg-interactive text-white" : "text-muted-foreground hover:text-foreground hover:bg-muted"
|
|
38572
40354
|
),
|
|
38573
40355
|
children: stage.name
|
|
38574
40356
|
},
|
|
38575
40357
|
stage.id
|
|
38576
40358
|
)) }),
|
|
38577
|
-
/* @__PURE__ */ (0,
|
|
38578
|
-
activeStage && /* @__PURE__ */ (0,
|
|
38579
|
-
/* @__PURE__ */ (0,
|
|
40359
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "px-4 py-3", children: [
|
|
40360
|
+
activeStage && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
40361
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("p", { className: "text-[10px] text-muted-foreground", children: [
|
|
38580
40362
|
"Select components for ",
|
|
38581
|
-
/* @__PURE__ */ (0,
|
|
40363
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("strong", { className: "text-foreground", children: activeStage.name }),
|
|
38582
40364
|
" (",
|
|
38583
40365
|
activeStage.agent_name,
|
|
38584
40366
|
")"
|
|
38585
40367
|
] }),
|
|
38586
|
-
!submitted && isLatestMessage && /* @__PURE__ */ (0,
|
|
38587
|
-
/* @__PURE__ */ (0,
|
|
40368
|
+
!submitted && isLatestMessage && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40369
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38588
40370
|
"button",
|
|
38589
40371
|
{
|
|
38590
40372
|
onClick: () => selectAll(activeStageId),
|
|
@@ -38592,22 +40374,22 @@ var MultiAgentUISelector = ({
|
|
|
38592
40374
|
children: "Select All"
|
|
38593
40375
|
}
|
|
38594
40376
|
),
|
|
38595
|
-
/* @__PURE__ */ (0,
|
|
38596
|
-
/* @__PURE__ */ (0,
|
|
40377
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "text-muted-foreground/40", children: "|" }),
|
|
40378
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38597
40379
|
"button",
|
|
38598
40380
|
{
|
|
38599
40381
|
onClick: () => clearAll(activeStageId),
|
|
38600
|
-
className: "text-[10px] text-
|
|
40382
|
+
className: "text-[10px] text-muted-foreground hover:text-foreground font-medium",
|
|
38601
40383
|
children: "Clear"
|
|
38602
40384
|
}
|
|
38603
40385
|
)
|
|
38604
40386
|
] })
|
|
38605
40387
|
] }),
|
|
38606
|
-
Object.entries(grouped).map(([category, comps]) => /* @__PURE__ */ (0,
|
|
38607
|
-
/* @__PURE__ */ (0,
|
|
38608
|
-
/* @__PURE__ */ (0,
|
|
40388
|
+
Object.entries(grouped).map(([category, comps]) => /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "mb-3", children: [
|
|
40389
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5", children: category }),
|
|
40390
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "grid grid-cols-2 gap-1.5", children: comps.map((comp) => {
|
|
38609
40391
|
const isSelected = selections[activeStageId]?.has(comp.name) || false;
|
|
38610
|
-
return /* @__PURE__ */ (0,
|
|
40392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38611
40393
|
"div",
|
|
38612
40394
|
{
|
|
38613
40395
|
role: "button",
|
|
@@ -38621,19 +40403,19 @@ var MultiAgentUISelector = ({
|
|
|
38621
40403
|
},
|
|
38622
40404
|
className: cn(
|
|
38623
40405
|
"text-left p-2.5 rounded-lg border text-[11px] transition-all overflow-hidden cursor-pointer",
|
|
38624
|
-
isSelected ? "border-interactive bg-interactive/5" : "border-
|
|
40406
|
+
isSelected ? "border-interactive bg-interactive/5" : "border-border hover:border-interactive/50",
|
|
38625
40407
|
(submitted || !isLatestMessage) && "opacity-60 cursor-default"
|
|
38626
40408
|
),
|
|
38627
40409
|
children: [
|
|
38628
|
-
/* @__PURE__ */ (0,
|
|
38629
|
-
/* @__PURE__ */ (0,
|
|
40410
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
40411
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38630
40412
|
"div",
|
|
38631
40413
|
{
|
|
38632
40414
|
className: cn(
|
|
38633
40415
|
"w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0",
|
|
38634
|
-
isSelected ? "bg-interactive border-interactive" : "border-
|
|
40416
|
+
isSelected ? "bg-interactive border-interactive" : "border-muted-foreground/30"
|
|
38635
40417
|
),
|
|
38636
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
40418
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38637
40419
|
"svg",
|
|
38638
40420
|
{
|
|
38639
40421
|
width: "8",
|
|
@@ -38642,14 +40424,14 @@ var MultiAgentUISelector = ({
|
|
|
38642
40424
|
fill: "none",
|
|
38643
40425
|
stroke: "white",
|
|
38644
40426
|
strokeWidth: "3",
|
|
38645
|
-
children: /* @__PURE__ */ (0,
|
|
40427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
38646
40428
|
}
|
|
38647
40429
|
)
|
|
38648
40430
|
}
|
|
38649
40431
|
),
|
|
38650
|
-
/* @__PURE__ */ (0,
|
|
38651
|
-
comp.recommended && /* @__PURE__ */ (0,
|
|
38652
|
-
onPreview && /* @__PURE__ */ (0,
|
|
40432
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "font-medium text-foreground", children: comp.display_name }),
|
|
40433
|
+
comp.recommended && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "px-1 py-px text-[8px] font-semibold uppercase tracking-wider rounded-full bg-emerald-500/10 text-emerald-600 border border-emerald-500/20 leading-tight", children: "Rec" }),
|
|
40434
|
+
onPreview && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38653
40435
|
"button",
|
|
38654
40436
|
{
|
|
38655
40437
|
type: "button",
|
|
@@ -38657,9 +40439,9 @@ var MultiAgentUISelector = ({
|
|
|
38657
40439
|
e.stopPropagation();
|
|
38658
40440
|
onPreview(comp.name);
|
|
38659
40441
|
},
|
|
38660
|
-
className: "ml-auto shrink-0 p-0.5 rounded hover:bg-
|
|
40442
|
+
className: "ml-auto shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
|
|
38661
40443
|
title: `Preview ${comp.display_name}`,
|
|
38662
|
-
children: /* @__PURE__ */ (0,
|
|
40444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)(
|
|
38663
40445
|
"svg",
|
|
38664
40446
|
{
|
|
38665
40447
|
width: "14",
|
|
@@ -38670,18 +40452,18 @@ var MultiAgentUISelector = ({
|
|
|
38670
40452
|
strokeWidth: "2",
|
|
38671
40453
|
strokeLinecap: "round",
|
|
38672
40454
|
strokeLinejoin: "round",
|
|
38673
|
-
className: "text-
|
|
40455
|
+
className: "text-muted-foreground hover:text-primary",
|
|
38674
40456
|
children: [
|
|
38675
|
-
/* @__PURE__ */ (0,
|
|
38676
|
-
/* @__PURE__ */ (0,
|
|
38677
|
-
/* @__PURE__ */ (0,
|
|
40457
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
40458
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
40459
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
38678
40460
|
]
|
|
38679
40461
|
}
|
|
38680
40462
|
)
|
|
38681
40463
|
}
|
|
38682
40464
|
)
|
|
38683
40465
|
] }),
|
|
38684
|
-
/* @__PURE__ */ (0,
|
|
40466
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "text-[10px] text-muted-foreground mt-0.5 ml-5 whitespace-normal", children: comp.description })
|
|
38685
40467
|
]
|
|
38686
40468
|
},
|
|
38687
40469
|
comp.name
|
|
@@ -38689,7 +40471,7 @@ var MultiAgentUISelector = ({
|
|
|
38689
40471
|
}) })
|
|
38690
40472
|
] }, category))
|
|
38691
40473
|
] }),
|
|
38692
|
-
!submitted && isLatestMessage && /* @__PURE__ */ (0,
|
|
40474
|
+
!submitted && isLatestMessage && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "px-4 py-3 border-t border-border/60 bg-muted/30", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
38693
40475
|
"button",
|
|
38694
40476
|
{
|
|
38695
40477
|
onClick: handleContinue,
|
|
@@ -38697,14 +40479,14 @@ var MultiAgentUISelector = ({
|
|
|
38697
40479
|
children: "Continue"
|
|
38698
40480
|
}
|
|
38699
40481
|
) }),
|
|
38700
|
-
submitted && /* @__PURE__ */ (0,
|
|
40482
|
+
submitted && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "px-4 pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
|
|
38701
40483
|
]
|
|
38702
40484
|
}
|
|
38703
40485
|
);
|
|
38704
40486
|
};
|
|
38705
40487
|
|
|
38706
40488
|
// src/molecules/workstream-builder/StageIndicator/StageIndicator.tsx
|
|
38707
|
-
var
|
|
40489
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
38708
40490
|
var FONT_STYLE10 = {
|
|
38709
40491
|
fontFamily: "Inter, system-ui, sans-serif"
|
|
38710
40492
|
};
|
|
@@ -38713,7 +40495,7 @@ var StageIndicator = ({
|
|
|
38713
40495
|
agent_name,
|
|
38714
40496
|
className
|
|
38715
40497
|
}) => {
|
|
38716
|
-
return /* @__PURE__ */ (0,
|
|
40498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)(
|
|
38717
40499
|
"div",
|
|
38718
40500
|
{
|
|
38719
40501
|
className: cn(
|
|
@@ -38722,12 +40504,12 @@ var StageIndicator = ({
|
|
|
38722
40504
|
),
|
|
38723
40505
|
style: { ...FONT_STYLE10, animation: "fadeIn 0.3s ease-out" },
|
|
38724
40506
|
children: [
|
|
38725
|
-
/* @__PURE__ */ (0,
|
|
38726
|
-
/* @__PURE__ */ (0,
|
|
38727
|
-
/* @__PURE__ */ (0,
|
|
38728
|
-
/* @__PURE__ */ (0,
|
|
40507
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "flex-1 h-px bg-[var(--border-color)]" }),
|
|
40508
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "flex items-center gap-1.5 px-3 py-1 rounded-full bg-violet-500/10 border border-violet-500/20", children: [
|
|
40509
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "w-1.5 h-1.5 rounded-full bg-violet-500 animate-pulse" }),
|
|
40510
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: "text-[10px] font-medium text-violet-600", children: stage_name || agent_name })
|
|
38729
40511
|
] }),
|
|
38730
|
-
/* @__PURE__ */ (0,
|
|
40512
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "flex-1 h-px bg-[var(--border-color)]" })
|
|
38731
40513
|
]
|
|
38732
40514
|
}
|
|
38733
40515
|
);
|
|
@@ -39025,7 +40807,7 @@ __export(ui_exports, {
|
|
|
39025
40807
|
// src/components/ui/button-group.tsx
|
|
39026
40808
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
39027
40809
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
39028
|
-
var
|
|
40810
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
39029
40811
|
var buttonGroupVariants = (0, import_class_variance_authority8.cva)(
|
|
39030
40812
|
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
39031
40813
|
{
|
|
@@ -39045,7 +40827,7 @@ function ButtonGroup({
|
|
|
39045
40827
|
orientation,
|
|
39046
40828
|
...props
|
|
39047
40829
|
}) {
|
|
39048
|
-
return /* @__PURE__ */ (0,
|
|
40830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
39049
40831
|
"div",
|
|
39050
40832
|
{
|
|
39051
40833
|
role: "group",
|
|
@@ -39062,7 +40844,7 @@ function ButtonGroupText({
|
|
|
39062
40844
|
...props
|
|
39063
40845
|
}) {
|
|
39064
40846
|
const Comp = asChild ? import_react_slot4.Slot : "div";
|
|
39065
|
-
return /* @__PURE__ */ (0,
|
|
40847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
39066
40848
|
Comp,
|
|
39067
40849
|
{
|
|
39068
40850
|
className: cn(
|
|
@@ -39078,7 +40860,7 @@ function ButtonGroupSeparator({
|
|
|
39078
40860
|
orientation = "vertical",
|
|
39079
40861
|
...props
|
|
39080
40862
|
}) {
|
|
39081
|
-
return /* @__PURE__ */ (0,
|
|
40863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
|
|
39082
40864
|
Separator2,
|
|
39083
40865
|
{
|
|
39084
40866
|
"data-slot": "button-group-separator",
|
|
@@ -39094,9 +40876,9 @@ function ButtonGroupSeparator({
|
|
|
39094
40876
|
|
|
39095
40877
|
// src/components/ui/empty.tsx
|
|
39096
40878
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
39097
|
-
var
|
|
40879
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
39098
40880
|
function Empty({ className, ...props }) {
|
|
39099
|
-
return /* @__PURE__ */ (0,
|
|
40881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39100
40882
|
"div",
|
|
39101
40883
|
{
|
|
39102
40884
|
"data-slot": "empty",
|
|
@@ -39109,7 +40891,7 @@ function Empty({ className, ...props }) {
|
|
|
39109
40891
|
);
|
|
39110
40892
|
}
|
|
39111
40893
|
function EmptyHeader({ className, ...props }) {
|
|
39112
|
-
return /* @__PURE__ */ (0,
|
|
40894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39113
40895
|
"div",
|
|
39114
40896
|
{
|
|
39115
40897
|
"data-slot": "empty-header",
|
|
@@ -39140,7 +40922,7 @@ function EmptyMedia({
|
|
|
39140
40922
|
variant = "default",
|
|
39141
40923
|
...props
|
|
39142
40924
|
}) {
|
|
39143
|
-
return /* @__PURE__ */ (0,
|
|
40925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39144
40926
|
"div",
|
|
39145
40927
|
{
|
|
39146
40928
|
"data-slot": "empty-icon",
|
|
@@ -39151,7 +40933,7 @@ function EmptyMedia({
|
|
|
39151
40933
|
);
|
|
39152
40934
|
}
|
|
39153
40935
|
function EmptyTitle({ className, ...props }) {
|
|
39154
|
-
return /* @__PURE__ */ (0,
|
|
40936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39155
40937
|
"div",
|
|
39156
40938
|
{
|
|
39157
40939
|
"data-slot": "empty-title",
|
|
@@ -39161,7 +40943,7 @@ function EmptyTitle({ className, ...props }) {
|
|
|
39161
40943
|
);
|
|
39162
40944
|
}
|
|
39163
40945
|
function EmptyDescription({ className, ...props }) {
|
|
39164
|
-
return /* @__PURE__ */ (0,
|
|
40946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39165
40947
|
"div",
|
|
39166
40948
|
{
|
|
39167
40949
|
"data-slot": "empty-description",
|
|
@@ -39174,7 +40956,7 @@ function EmptyDescription({ className, ...props }) {
|
|
|
39174
40956
|
);
|
|
39175
40957
|
}
|
|
39176
40958
|
function EmptyContent({ className, ...props }) {
|
|
39177
|
-
return /* @__PURE__ */ (0,
|
|
40959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
39178
40960
|
"div",
|
|
39179
40961
|
{
|
|
39180
40962
|
"data-slot": "empty-content",
|
|
@@ -39188,11 +40970,11 @@ function EmptyContent({ className, ...props }) {
|
|
|
39188
40970
|
}
|
|
39189
40971
|
|
|
39190
40972
|
// src/components/ui/field.tsx
|
|
39191
|
-
var
|
|
40973
|
+
var import_react78 = require("react");
|
|
39192
40974
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
39193
|
-
var
|
|
40975
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
39194
40976
|
function FieldSet({ className, ...props }) {
|
|
39195
|
-
return /* @__PURE__ */ (0,
|
|
40977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39196
40978
|
"fieldset",
|
|
39197
40979
|
{
|
|
39198
40980
|
"data-slot": "field-set",
|
|
@@ -39210,7 +40992,7 @@ function FieldLegend({
|
|
|
39210
40992
|
variant = "legend",
|
|
39211
40993
|
...props
|
|
39212
40994
|
}) {
|
|
39213
|
-
return /* @__PURE__ */ (0,
|
|
40995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39214
40996
|
"legend",
|
|
39215
40997
|
{
|
|
39216
40998
|
"data-slot": "field-legend",
|
|
@@ -39226,7 +41008,7 @@ function FieldLegend({
|
|
|
39226
41008
|
);
|
|
39227
41009
|
}
|
|
39228
41010
|
function FieldGroup({ className, ...props }) {
|
|
39229
|
-
return /* @__PURE__ */ (0,
|
|
41011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39230
41012
|
"div",
|
|
39231
41013
|
{
|
|
39232
41014
|
"data-slot": "field-group",
|
|
@@ -39266,7 +41048,7 @@ function Field({
|
|
|
39266
41048
|
orientation = "vertical",
|
|
39267
41049
|
...props
|
|
39268
41050
|
}) {
|
|
39269
|
-
return /* @__PURE__ */ (0,
|
|
41051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39270
41052
|
"div",
|
|
39271
41053
|
{
|
|
39272
41054
|
role: "group",
|
|
@@ -39278,7 +41060,7 @@ function Field({
|
|
|
39278
41060
|
);
|
|
39279
41061
|
}
|
|
39280
41062
|
function FieldContent({ className, ...props }) {
|
|
39281
|
-
return /* @__PURE__ */ (0,
|
|
41063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39282
41064
|
"div",
|
|
39283
41065
|
{
|
|
39284
41066
|
"data-slot": "field-content",
|
|
@@ -39294,7 +41076,7 @@ function FieldLabel({
|
|
|
39294
41076
|
className,
|
|
39295
41077
|
...props
|
|
39296
41078
|
}) {
|
|
39297
|
-
return /* @__PURE__ */ (0,
|
|
41079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39298
41080
|
Label,
|
|
39299
41081
|
{
|
|
39300
41082
|
"data-slot": "field-label",
|
|
@@ -39309,7 +41091,7 @@ function FieldLabel({
|
|
|
39309
41091
|
);
|
|
39310
41092
|
}
|
|
39311
41093
|
function FieldTitle({ className, ...props }) {
|
|
39312
|
-
return /* @__PURE__ */ (0,
|
|
41094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39313
41095
|
"div",
|
|
39314
41096
|
{
|
|
39315
41097
|
"data-slot": "field-label",
|
|
@@ -39322,7 +41104,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
39322
41104
|
);
|
|
39323
41105
|
}
|
|
39324
41106
|
function FieldDescription({ className, ...props }) {
|
|
39325
|
-
return /* @__PURE__ */ (0,
|
|
41107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39326
41108
|
"p",
|
|
39327
41109
|
{
|
|
39328
41110
|
"data-slot": "field-description",
|
|
@@ -39341,7 +41123,7 @@ function FieldSeparator({
|
|
|
39341
41123
|
className,
|
|
39342
41124
|
...props
|
|
39343
41125
|
}) {
|
|
39344
|
-
return /* @__PURE__ */ (0,
|
|
41126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(
|
|
39345
41127
|
"div",
|
|
39346
41128
|
{
|
|
39347
41129
|
"data-slot": "field-separator",
|
|
@@ -39352,8 +41134,8 @@ function FieldSeparator({
|
|
|
39352
41134
|
),
|
|
39353
41135
|
...props,
|
|
39354
41136
|
children: [
|
|
39355
|
-
/* @__PURE__ */ (0,
|
|
39356
|
-
children && /* @__PURE__ */ (0,
|
|
41137
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
41138
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39357
41139
|
"span",
|
|
39358
41140
|
{
|
|
39359
41141
|
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
@@ -39371,7 +41153,7 @@ function FieldError({
|
|
|
39371
41153
|
errors,
|
|
39372
41154
|
...props
|
|
39373
41155
|
}) {
|
|
39374
|
-
const content = (0,
|
|
41156
|
+
const content = (0, import_react78.useMemo)(() => {
|
|
39375
41157
|
if (children) {
|
|
39376
41158
|
return children;
|
|
39377
41159
|
}
|
|
@@ -39381,14 +41163,14 @@ function FieldError({
|
|
|
39381
41163
|
if (errors?.length === 1 && errors[0]?.message) {
|
|
39382
41164
|
return errors[0].message;
|
|
39383
41165
|
}
|
|
39384
|
-
return /* @__PURE__ */ (0,
|
|
39385
|
-
(error, index) => error?.message && /* @__PURE__ */ (0,
|
|
41166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
41167
|
+
(error, index) => error?.message && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("li", { children: error.message }, index)
|
|
39386
41168
|
) });
|
|
39387
41169
|
}, [children, errors]);
|
|
39388
41170
|
if (!content) {
|
|
39389
41171
|
return null;
|
|
39390
41172
|
}
|
|
39391
|
-
return /* @__PURE__ */ (0,
|
|
41173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
39392
41174
|
"div",
|
|
39393
41175
|
{
|
|
39394
41176
|
role: "alert",
|
|
@@ -39402,9 +41184,9 @@ function FieldError({
|
|
|
39402
41184
|
|
|
39403
41185
|
// src/components/ui/input-group.tsx
|
|
39404
41186
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
39405
|
-
var
|
|
41187
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
39406
41188
|
function InputGroup({ className, ...props }) {
|
|
39407
|
-
return /* @__PURE__ */ (0,
|
|
41189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39408
41190
|
"div",
|
|
39409
41191
|
{
|
|
39410
41192
|
"data-slot": "input-group",
|
|
@@ -39448,7 +41230,7 @@ function InputGroupAddon({
|
|
|
39448
41230
|
align = "inline-start",
|
|
39449
41231
|
...props
|
|
39450
41232
|
}) {
|
|
39451
|
-
return /* @__PURE__ */ (0,
|
|
41233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39452
41234
|
"div",
|
|
39453
41235
|
{
|
|
39454
41236
|
role: "group",
|
|
@@ -39488,7 +41270,7 @@ function InputGroupButton({
|
|
|
39488
41270
|
size = "xs",
|
|
39489
41271
|
...props
|
|
39490
41272
|
}) {
|
|
39491
|
-
return /* @__PURE__ */ (0,
|
|
41273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39492
41274
|
Button,
|
|
39493
41275
|
{
|
|
39494
41276
|
type,
|
|
@@ -39500,7 +41282,7 @@ function InputGroupButton({
|
|
|
39500
41282
|
);
|
|
39501
41283
|
}
|
|
39502
41284
|
function InputGroupText({ className, ...props }) {
|
|
39503
|
-
return /* @__PURE__ */ (0,
|
|
41285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39504
41286
|
"span",
|
|
39505
41287
|
{
|
|
39506
41288
|
className: cn(
|
|
@@ -39515,7 +41297,7 @@ function InputGroupInput({
|
|
|
39515
41297
|
className,
|
|
39516
41298
|
...props
|
|
39517
41299
|
}) {
|
|
39518
|
-
return /* @__PURE__ */ (0,
|
|
41300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39519
41301
|
Input,
|
|
39520
41302
|
{
|
|
39521
41303
|
"data-slot": "input-group-control",
|
|
@@ -39531,7 +41313,7 @@ function InputGroupTextarea({
|
|
|
39531
41313
|
className,
|
|
39532
41314
|
...props
|
|
39533
41315
|
}) {
|
|
39534
|
-
return /* @__PURE__ */ (0,
|
|
41316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39535
41317
|
Textarea,
|
|
39536
41318
|
{
|
|
39537
41319
|
"data-slot": "input-group-control",
|
|
@@ -39547,9 +41329,9 @@ function InputGroupTextarea({
|
|
|
39547
41329
|
// src/components/ui/item.tsx
|
|
39548
41330
|
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
39549
41331
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
39550
|
-
var
|
|
41332
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
39551
41333
|
function ItemGroup({ className, ...props }) {
|
|
39552
|
-
return /* @__PURE__ */ (0,
|
|
41334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39553
41335
|
"div",
|
|
39554
41336
|
{
|
|
39555
41337
|
role: "list",
|
|
@@ -39563,7 +41345,7 @@ function ItemSeparator({
|
|
|
39563
41345
|
className,
|
|
39564
41346
|
...props
|
|
39565
41347
|
}) {
|
|
39566
|
-
return /* @__PURE__ */ (0,
|
|
41348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39567
41349
|
Separator2,
|
|
39568
41350
|
{
|
|
39569
41351
|
"data-slot": "item-separator",
|
|
@@ -39601,7 +41383,7 @@ function Item8({
|
|
|
39601
41383
|
...props
|
|
39602
41384
|
}) {
|
|
39603
41385
|
const Comp = asChild ? import_react_slot5.Slot : "div";
|
|
39604
|
-
return /* @__PURE__ */ (0,
|
|
41386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39605
41387
|
Comp,
|
|
39606
41388
|
{
|
|
39607
41389
|
"data-slot": "item",
|
|
@@ -39632,7 +41414,7 @@ function ItemMedia({
|
|
|
39632
41414
|
variant = "default",
|
|
39633
41415
|
...props
|
|
39634
41416
|
}) {
|
|
39635
|
-
return /* @__PURE__ */ (0,
|
|
41417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39636
41418
|
"div",
|
|
39637
41419
|
{
|
|
39638
41420
|
"data-slot": "item-media",
|
|
@@ -39643,7 +41425,7 @@ function ItemMedia({
|
|
|
39643
41425
|
);
|
|
39644
41426
|
}
|
|
39645
41427
|
function ItemContent({ className, ...props }) {
|
|
39646
|
-
return /* @__PURE__ */ (0,
|
|
41428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39647
41429
|
"div",
|
|
39648
41430
|
{
|
|
39649
41431
|
"data-slot": "item-content",
|
|
@@ -39656,7 +41438,7 @@ function ItemContent({ className, ...props }) {
|
|
|
39656
41438
|
);
|
|
39657
41439
|
}
|
|
39658
41440
|
function ItemTitle({ className, ...props }) {
|
|
39659
|
-
return /* @__PURE__ */ (0,
|
|
41441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39660
41442
|
"div",
|
|
39661
41443
|
{
|
|
39662
41444
|
"data-slot": "item-title",
|
|
@@ -39669,7 +41451,7 @@ function ItemTitle({ className, ...props }) {
|
|
|
39669
41451
|
);
|
|
39670
41452
|
}
|
|
39671
41453
|
function ItemDescription({ className, ...props }) {
|
|
39672
|
-
return /* @__PURE__ */ (0,
|
|
41454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39673
41455
|
"p",
|
|
39674
41456
|
{
|
|
39675
41457
|
"data-slot": "item-description",
|
|
@@ -39683,7 +41465,7 @@ function ItemDescription({ className, ...props }) {
|
|
|
39683
41465
|
);
|
|
39684
41466
|
}
|
|
39685
41467
|
function ItemActions({ className, ...props }) {
|
|
39686
|
-
return /* @__PURE__ */ (0,
|
|
41468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39687
41469
|
"div",
|
|
39688
41470
|
{
|
|
39689
41471
|
"data-slot": "item-actions",
|
|
@@ -39693,7 +41475,7 @@ function ItemActions({ className, ...props }) {
|
|
|
39693
41475
|
);
|
|
39694
41476
|
}
|
|
39695
41477
|
function ItemHeader({ className, ...props }) {
|
|
39696
|
-
return /* @__PURE__ */ (0,
|
|
41478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39697
41479
|
"div",
|
|
39698
41480
|
{
|
|
39699
41481
|
"data-slot": "item-header",
|
|
@@ -39706,7 +41488,7 @@ function ItemHeader({ className, ...props }) {
|
|
|
39706
41488
|
);
|
|
39707
41489
|
}
|
|
39708
41490
|
function ItemFooter({ className, ...props }) {
|
|
39709
|
-
return /* @__PURE__ */ (0,
|
|
41491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
39710
41492
|
"div",
|
|
39711
41493
|
{
|
|
39712
41494
|
"data-slot": "item-footer",
|
|
@@ -39720,9 +41502,9 @@ function ItemFooter({ className, ...props }) {
|
|
|
39720
41502
|
}
|
|
39721
41503
|
|
|
39722
41504
|
// src/components/ui/kbd.tsx
|
|
39723
|
-
var
|
|
41505
|
+
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
39724
41506
|
function Kbd({ className, ...props }) {
|
|
39725
|
-
return /* @__PURE__ */ (0,
|
|
41507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
39726
41508
|
"kbd",
|
|
39727
41509
|
{
|
|
39728
41510
|
"data-slot": "kbd",
|
|
@@ -39737,7 +41519,7 @@ function Kbd({ className, ...props }) {
|
|
|
39737
41519
|
);
|
|
39738
41520
|
}
|
|
39739
41521
|
function KbdGroup({ className, ...props }) {
|
|
39740
|
-
return /* @__PURE__ */ (0,
|
|
41522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
|
|
39741
41523
|
"kbd",
|
|
39742
41524
|
{
|
|
39743
41525
|
"data-slot": "kbd-group",
|
|
@@ -39770,7 +41552,7 @@ function useIsMobile() {
|
|
|
39770
41552
|
}
|
|
39771
41553
|
|
|
39772
41554
|
// src/components/ui/sidebar.tsx
|
|
39773
|
-
var
|
|
41555
|
+
var import_jsx_runtime150 = require("react/jsx-runtime");
|
|
39774
41556
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
39775
41557
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
39776
41558
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -39837,7 +41619,7 @@ var SidebarProvider = React100.forwardRef(
|
|
|
39837
41619
|
}),
|
|
39838
41620
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
39839
41621
|
);
|
|
39840
|
-
return /* @__PURE__ */ (0,
|
|
41622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39841
41623
|
"div",
|
|
39842
41624
|
{
|
|
39843
41625
|
style: {
|
|
@@ -39868,7 +41650,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39868
41650
|
}, ref) => {
|
|
39869
41651
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
39870
41652
|
if (collapsible === "none") {
|
|
39871
|
-
return /* @__PURE__ */ (0,
|
|
41653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39872
41654
|
"div",
|
|
39873
41655
|
{
|
|
39874
41656
|
className: cn(
|
|
@@ -39882,7 +41664,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39882
41664
|
);
|
|
39883
41665
|
}
|
|
39884
41666
|
if (isMobile) {
|
|
39885
|
-
return /* @__PURE__ */ (0,
|
|
41667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Sheet2, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
39886
41668
|
SheetContent,
|
|
39887
41669
|
{
|
|
39888
41670
|
"data-sidebar": "sidebar",
|
|
@@ -39893,16 +41675,16 @@ var Sidebar = React100.forwardRef(
|
|
|
39893
41675
|
},
|
|
39894
41676
|
side,
|
|
39895
41677
|
children: [
|
|
39896
|
-
/* @__PURE__ */ (0,
|
|
39897
|
-
/* @__PURE__ */ (0,
|
|
39898
|
-
/* @__PURE__ */ (0,
|
|
41678
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(SheetHeader, { className: "sr-only", children: [
|
|
41679
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(SheetTitle, { children: "Sidebar" }),
|
|
41680
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
39899
41681
|
] }),
|
|
39900
|
-
/* @__PURE__ */ (0,
|
|
41682
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
39901
41683
|
]
|
|
39902
41684
|
}
|
|
39903
41685
|
) });
|
|
39904
41686
|
}
|
|
39905
|
-
return /* @__PURE__ */ (0,
|
|
41687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
39906
41688
|
"div",
|
|
39907
41689
|
{
|
|
39908
41690
|
ref,
|
|
@@ -39912,7 +41694,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39912
41694
|
"data-variant": variant,
|
|
39913
41695
|
"data-side": side,
|
|
39914
41696
|
children: [
|
|
39915
|
-
/* @__PURE__ */ (0,
|
|
41697
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39916
41698
|
"div",
|
|
39917
41699
|
{
|
|
39918
41700
|
className: cn(
|
|
@@ -39923,7 +41705,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39923
41705
|
)
|
|
39924
41706
|
}
|
|
39925
41707
|
),
|
|
39926
|
-
/* @__PURE__ */ (0,
|
|
41708
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39927
41709
|
"div",
|
|
39928
41710
|
{
|
|
39929
41711
|
className: cn(
|
|
@@ -39934,7 +41716,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39934
41716
|
className
|
|
39935
41717
|
),
|
|
39936
41718
|
...props,
|
|
39937
|
-
children: /* @__PURE__ */ (0,
|
|
41719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39938
41720
|
"div",
|
|
39939
41721
|
{
|
|
39940
41722
|
"data-sidebar": "sidebar",
|
|
@@ -39952,7 +41734,7 @@ var Sidebar = React100.forwardRef(
|
|
|
39952
41734
|
Sidebar.displayName = "Sidebar";
|
|
39953
41735
|
var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
39954
41736
|
const { toggleSidebar } = useSidebar();
|
|
39955
|
-
return /* @__PURE__ */ (0,
|
|
41737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
39956
41738
|
Button,
|
|
39957
41739
|
{
|
|
39958
41740
|
ref,
|
|
@@ -39966,8 +41748,8 @@ var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
39966
41748
|
},
|
|
39967
41749
|
...props,
|
|
39968
41750
|
children: [
|
|
39969
|
-
/* @__PURE__ */ (0,
|
|
39970
|
-
/* @__PURE__ */ (0,
|
|
41751
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(PanelLeft, {}),
|
|
41752
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
39971
41753
|
]
|
|
39972
41754
|
}
|
|
39973
41755
|
);
|
|
@@ -39975,7 +41757,7 @@ var SidebarTrigger = React100.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
39975
41757
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
39976
41758
|
var SidebarRail = React100.forwardRef(({ className, ...props }, ref) => {
|
|
39977
41759
|
const { toggleSidebar } = useSidebar();
|
|
39978
|
-
return /* @__PURE__ */ (0,
|
|
41760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
39979
41761
|
"button",
|
|
39980
41762
|
{
|
|
39981
41763
|
ref,
|
|
@@ -39999,7 +41781,7 @@ var SidebarRail = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
39999
41781
|
});
|
|
40000
41782
|
SidebarRail.displayName = "SidebarRail";
|
|
40001
41783
|
var SidebarInset = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40002
|
-
return /* @__PURE__ */ (0,
|
|
41784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40003
41785
|
"main",
|
|
40004
41786
|
{
|
|
40005
41787
|
ref,
|
|
@@ -40014,7 +41796,7 @@ var SidebarInset = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40014
41796
|
});
|
|
40015
41797
|
SidebarInset.displayName = "SidebarInset";
|
|
40016
41798
|
var SidebarInput = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40017
|
-
return /* @__PURE__ */ (0,
|
|
41799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40018
41800
|
Input,
|
|
40019
41801
|
{
|
|
40020
41802
|
ref,
|
|
@@ -40029,7 +41811,7 @@ var SidebarInput = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40029
41811
|
});
|
|
40030
41812
|
SidebarInput.displayName = "SidebarInput";
|
|
40031
41813
|
var SidebarHeader = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40032
|
-
return /* @__PURE__ */ (0,
|
|
41814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40033
41815
|
"div",
|
|
40034
41816
|
{
|
|
40035
41817
|
ref,
|
|
@@ -40041,7 +41823,7 @@ var SidebarHeader = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40041
41823
|
});
|
|
40042
41824
|
SidebarHeader.displayName = "SidebarHeader";
|
|
40043
41825
|
var SidebarFooter = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40044
|
-
return /* @__PURE__ */ (0,
|
|
41826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40045
41827
|
"div",
|
|
40046
41828
|
{
|
|
40047
41829
|
ref,
|
|
@@ -40053,7 +41835,7 @@ var SidebarFooter = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40053
41835
|
});
|
|
40054
41836
|
SidebarFooter.displayName = "SidebarFooter";
|
|
40055
41837
|
var SidebarSeparator = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40056
|
-
return /* @__PURE__ */ (0,
|
|
41838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40057
41839
|
Separator2,
|
|
40058
41840
|
{
|
|
40059
41841
|
ref,
|
|
@@ -40065,7 +41847,7 @@ var SidebarSeparator = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40065
41847
|
});
|
|
40066
41848
|
SidebarSeparator.displayName = "SidebarSeparator";
|
|
40067
41849
|
var SidebarContent = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40068
|
-
return /* @__PURE__ */ (0,
|
|
41850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40069
41851
|
"div",
|
|
40070
41852
|
{
|
|
40071
41853
|
ref,
|
|
@@ -40080,7 +41862,7 @@ var SidebarContent = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40080
41862
|
});
|
|
40081
41863
|
SidebarContent.displayName = "SidebarContent";
|
|
40082
41864
|
var SidebarGroup = React100.forwardRef(({ className, ...props }, ref) => {
|
|
40083
|
-
return /* @__PURE__ */ (0,
|
|
41865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40084
41866
|
"div",
|
|
40085
41867
|
{
|
|
40086
41868
|
ref,
|
|
@@ -40093,7 +41875,7 @@ var SidebarGroup = React100.forwardRef(({ className, ...props }, ref) => {
|
|
|
40093
41875
|
SidebarGroup.displayName = "SidebarGroup";
|
|
40094
41876
|
var SidebarGroupLabel = React100.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
40095
41877
|
const Comp = asChild ? import_react_slot6.Slot : "div";
|
|
40096
|
-
return /* @__PURE__ */ (0,
|
|
41878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40097
41879
|
Comp,
|
|
40098
41880
|
{
|
|
40099
41881
|
ref,
|
|
@@ -40110,7 +41892,7 @@ var SidebarGroupLabel = React100.forwardRef(({ className, asChild = false, ...pr
|
|
|
40110
41892
|
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
40111
41893
|
var SidebarGroupAction = React100.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
40112
41894
|
const Comp = asChild ? import_react_slot6.Slot : "button";
|
|
40113
|
-
return /* @__PURE__ */ (0,
|
|
41895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40114
41896
|
Comp,
|
|
40115
41897
|
{
|
|
40116
41898
|
ref,
|
|
@@ -40127,7 +41909,7 @@ var SidebarGroupAction = React100.forwardRef(({ className, asChild = false, ...p
|
|
|
40127
41909
|
);
|
|
40128
41910
|
});
|
|
40129
41911
|
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
40130
|
-
var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
41912
|
+
var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40131
41913
|
"div",
|
|
40132
41914
|
{
|
|
40133
41915
|
ref,
|
|
@@ -40137,7 +41919,7 @@ var SidebarGroupContent = React100.forwardRef(({ className, ...props }, ref) =>
|
|
|
40137
41919
|
}
|
|
40138
41920
|
));
|
|
40139
41921
|
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
40140
|
-
var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
41922
|
+
var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40141
41923
|
"ul",
|
|
40142
41924
|
{
|
|
40143
41925
|
ref,
|
|
@@ -40147,7 +41929,7 @@ var SidebarMenu = React100.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
40147
41929
|
}
|
|
40148
41930
|
));
|
|
40149
41931
|
SidebarMenu.displayName = "SidebarMenu";
|
|
40150
|
-
var SidebarMenuItem = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
41932
|
+
var SidebarMenuItem = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40151
41933
|
"li",
|
|
40152
41934
|
{
|
|
40153
41935
|
ref,
|
|
@@ -40189,7 +41971,7 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
40189
41971
|
}, ref) => {
|
|
40190
41972
|
const Comp = asChild ? import_react_slot6.Slot : "button";
|
|
40191
41973
|
const { isMobile, state } = useSidebar();
|
|
40192
|
-
const button = /* @__PURE__ */ (0,
|
|
41974
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40193
41975
|
Comp,
|
|
40194
41976
|
{
|
|
40195
41977
|
ref,
|
|
@@ -40208,9 +41990,9 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
40208
41990
|
children: tooltip
|
|
40209
41991
|
};
|
|
40210
41992
|
}
|
|
40211
|
-
return /* @__PURE__ */ (0,
|
|
40212
|
-
/* @__PURE__ */ (0,
|
|
40213
|
-
/* @__PURE__ */ (0,
|
|
41993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(Tooltip, { children: [
|
|
41994
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
41995
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40214
41996
|
TooltipContent,
|
|
40215
41997
|
{
|
|
40216
41998
|
side: "right",
|
|
@@ -40225,7 +42007,7 @@ var SidebarMenuButton = React100.forwardRef(
|
|
|
40225
42007
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
40226
42008
|
var SidebarMenuAction = React100.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
40227
42009
|
const Comp = asChild ? import_react_slot6.Slot : "button";
|
|
40228
|
-
return /* @__PURE__ */ (0,
|
|
42010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40229
42011
|
Comp,
|
|
40230
42012
|
{
|
|
40231
42013
|
ref,
|
|
@@ -40246,7 +42028,7 @@ var SidebarMenuAction = React100.forwardRef(({ className, asChild = false, showO
|
|
|
40246
42028
|
);
|
|
40247
42029
|
});
|
|
40248
42030
|
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
40249
|
-
var SidebarMenuBadge = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
42031
|
+
var SidebarMenuBadge = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40250
42032
|
"div",
|
|
40251
42033
|
{
|
|
40252
42034
|
ref,
|
|
@@ -40268,7 +42050,7 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40268
42050
|
const width = React100.useMemo(() => {
|
|
40269
42051
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
40270
42052
|
}, []);
|
|
40271
|
-
return /* @__PURE__ */ (0,
|
|
42053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
40272
42054
|
"div",
|
|
40273
42055
|
{
|
|
40274
42056
|
ref,
|
|
@@ -40276,14 +42058,14 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40276
42058
|
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
40277
42059
|
...props,
|
|
40278
42060
|
children: [
|
|
40279
|
-
showIcon && /* @__PURE__ */ (0,
|
|
42061
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40280
42062
|
Skeleton,
|
|
40281
42063
|
{
|
|
40282
42064
|
className: "size-4 rounded-md",
|
|
40283
42065
|
"data-sidebar": "menu-skeleton-icon"
|
|
40284
42066
|
}
|
|
40285
42067
|
),
|
|
40286
|
-
/* @__PURE__ */ (0,
|
|
42068
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40287
42069
|
Skeleton,
|
|
40288
42070
|
{
|
|
40289
42071
|
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
@@ -40298,7 +42080,7 @@ var SidebarMenuSkeleton = React100.forwardRef(({ className, showIcon = false, ..
|
|
|
40298
42080
|
);
|
|
40299
42081
|
});
|
|
40300
42082
|
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
40301
|
-
var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
42083
|
+
var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40302
42084
|
"ul",
|
|
40303
42085
|
{
|
|
40304
42086
|
ref,
|
|
@@ -40312,11 +42094,11 @@ var SidebarMenuSub = React100.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
40312
42094
|
}
|
|
40313
42095
|
));
|
|
40314
42096
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
40315
|
-
var SidebarMenuSubItem = React100.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0,
|
|
42097
|
+
var SidebarMenuSubItem = React100.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("li", { ref, ...props }));
|
|
40316
42098
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
40317
42099
|
var SidebarMenuSubButton = React100.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
40318
42100
|
const Comp = asChild ? import_react_slot6.Slot : "a";
|
|
40319
|
-
return /* @__PURE__ */ (0,
|
|
42101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
40320
42102
|
Comp,
|
|
40321
42103
|
{
|
|
40322
42104
|
ref,
|
|
@@ -40340,20 +42122,20 @@ SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
|
40340
42122
|
// src/components/ui/sonner.tsx
|
|
40341
42123
|
var import_next_themes = require("next-themes");
|
|
40342
42124
|
var import_sonner = require("sonner");
|
|
40343
|
-
var
|
|
42125
|
+
var import_jsx_runtime151 = require("react/jsx-runtime");
|
|
40344
42126
|
var Toaster = ({ ...props }) => {
|
|
40345
42127
|
const { theme = "system" } = (0, import_next_themes.useTheme)();
|
|
40346
|
-
return /* @__PURE__ */ (0,
|
|
42128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
40347
42129
|
import_sonner.Toaster,
|
|
40348
42130
|
{
|
|
40349
42131
|
theme,
|
|
40350
42132
|
className: "toaster group",
|
|
40351
42133
|
icons: {
|
|
40352
|
-
success: /* @__PURE__ */ (0,
|
|
40353
|
-
info: /* @__PURE__ */ (0,
|
|
40354
|
-
warning: /* @__PURE__ */ (0,
|
|
40355
|
-
error: /* @__PURE__ */ (0,
|
|
40356
|
-
loading: /* @__PURE__ */ (0,
|
|
42134
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(CircleCheck, { className: "h-4 w-4" }),
|
|
42135
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Info, { className: "h-4 w-4" }),
|
|
42136
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(TriangleAlert, { className: "h-4 w-4" }),
|
|
42137
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(OctagonX, { className: "h-4 w-4" }),
|
|
42138
|
+
loading: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(LoaderCircle, { className: "h-4 w-4 animate-spin" })
|
|
40357
42139
|
},
|
|
40358
42140
|
toastOptions: {
|
|
40359
42141
|
classNames: {
|
|
@@ -40371,24 +42153,24 @@ var Toaster = ({ ...props }) => {
|
|
|
40371
42153
|
// src/components/ui/toggle-group.tsx
|
|
40372
42154
|
var React101 = __toESM(require("react"), 1);
|
|
40373
42155
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
40374
|
-
var
|
|
42156
|
+
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
40375
42157
|
var ToggleGroupContext = React101.createContext({
|
|
40376
42158
|
size: "default",
|
|
40377
42159
|
variant: "default"
|
|
40378
42160
|
});
|
|
40379
|
-
var ToggleGroup = React101.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
42161
|
+
var ToggleGroup = React101.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
40380
42162
|
ToggleGroupPrimitive.Root,
|
|
40381
42163
|
{
|
|
40382
42164
|
ref,
|
|
40383
42165
|
className: cn("flex items-center justify-center gap-1", className),
|
|
40384
42166
|
...props,
|
|
40385
|
-
children: /* @__PURE__ */ (0,
|
|
42167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
40386
42168
|
}
|
|
40387
42169
|
));
|
|
40388
42170
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
40389
42171
|
var ToggleGroupItem = React101.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
40390
42172
|
const context = React101.useContext(ToggleGroupContext);
|
|
40391
|
-
return /* @__PURE__ */ (0,
|
|
42173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
40392
42174
|
ToggleGroupPrimitive.Item,
|
|
40393
42175
|
{
|
|
40394
42176
|
ref,
|
|
@@ -40407,7 +42189,7 @@ var ToggleGroupItem = React101.forwardRef(({ className, children, variant, size,
|
|
|
40407
42189
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
40408
42190
|
|
|
40409
42191
|
// src/render/PXEngineRenderer.tsx
|
|
40410
|
-
var
|
|
42192
|
+
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
40411
42193
|
var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
|
|
40412
42194
|
// Form components - require FormField + FormItem context
|
|
40413
42195
|
"FormLabel",
|
|
@@ -40499,24 +42281,24 @@ var COMPONENT_SUGGESTIONS = {
|
|
|
40499
42281
|
};
|
|
40500
42282
|
var renderContextDependentError = (componentName, normalizedName, key) => {
|
|
40501
42283
|
const suggestion = COMPONENT_SUGGESTIONS[normalizedName] || `${componentName}Atom (if available)`;
|
|
40502
|
-
return /* @__PURE__ */ (0,
|
|
42284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(
|
|
40503
42285
|
"div",
|
|
40504
42286
|
{
|
|
40505
42287
|
className: "p-4 border-2 border-amber-500/50 rounded-lg bg-amber-50/80 space-y-2 my-2",
|
|
40506
42288
|
children: [
|
|
40507
|
-
/* @__PURE__ */ (0,
|
|
40508
|
-
/* @__PURE__ */ (0,
|
|
40509
|
-
/* @__PURE__ */ (0,
|
|
40510
|
-
/* @__PURE__ */ (0,
|
|
42289
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
42290
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: "text-amber-600 font-bold text-lg", children: "\u26A0\uFE0F" }),
|
|
42291
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex-1", children: [
|
|
42292
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("p", { className: "text-sm font-semibold text-amber-900", children: [
|
|
40511
42293
|
"Invalid Component: ",
|
|
40512
42294
|
componentName
|
|
40513
42295
|
] }),
|
|
40514
|
-
/* @__PURE__ */ (0,
|
|
42296
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs text-amber-700 mt-1", children: "This component requires React Context and cannot be rendered directly in schemas." })
|
|
40515
42297
|
] })
|
|
40516
42298
|
] }),
|
|
40517
|
-
/* @__PURE__ */ (0,
|
|
40518
|
-
/* @__PURE__ */ (0,
|
|
40519
|
-
/* @__PURE__ */ (0,
|
|
42299
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "bg-white/60 p-3 rounded border border-amber-200", children: [
|
|
42300
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs font-semibold text-gray-700 mb-1.5", children: "\u2713 Use instead:" }),
|
|
42301
|
+
/* @__PURE__ */ (0, import_jsx_runtime153.jsx)("code", { className: "text-xs text-blue-700 bg-blue-50 px-2 py-1 rounded", children: suggestion })
|
|
40520
42302
|
] })
|
|
40521
42303
|
]
|
|
40522
42304
|
},
|
|
@@ -40596,7 +42378,7 @@ var PXEngineRenderer = ({
|
|
|
40596
42378
|
if (typeof component === "string" || typeof component === "number") {
|
|
40597
42379
|
return component;
|
|
40598
42380
|
}
|
|
40599
|
-
if (
|
|
42381
|
+
if (import_react79.default.isValidElement(component)) {
|
|
40600
42382
|
return component;
|
|
40601
42383
|
}
|
|
40602
42384
|
if (!component || typeof component !== "object") return null;
|
|
@@ -40675,7 +42457,7 @@ var PXEngineRenderer = ({
|
|
|
40675
42457
|
const isAtomWithRenderProp = ATOMS_WITH_RENDER.has(atomName);
|
|
40676
42458
|
const finalStyle = { ...dynamicStyle, ...finalProps.style || {} };
|
|
40677
42459
|
if (isAtomWithRenderProp) {
|
|
40678
|
-
return /* @__PURE__ */ (0,
|
|
42460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
40679
42461
|
TargetComponent,
|
|
40680
42462
|
{
|
|
40681
42463
|
...finalProps,
|
|
@@ -40687,7 +42469,7 @@ var PXEngineRenderer = ({
|
|
|
40687
42469
|
uniqueKey
|
|
40688
42470
|
);
|
|
40689
42471
|
} else {
|
|
40690
|
-
return /* @__PURE__ */ (0,
|
|
42472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
40691
42473
|
TargetComponent,
|
|
40692
42474
|
{
|
|
40693
42475
|
...finalProps,
|
|
@@ -40699,7 +42481,7 @@ var PXEngineRenderer = ({
|
|
|
40699
42481
|
);
|
|
40700
42482
|
}
|
|
40701
42483
|
};
|
|
40702
|
-
return /* @__PURE__ */ (0,
|
|
42484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) });
|
|
40703
42485
|
};
|
|
40704
42486
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40705
42487
|
0 && (module.exports = {
|
|
@@ -40795,6 +42577,7 @@ var PXEngineRenderer = ({
|
|
|
40795
42577
|
CountrySelectEdit,
|
|
40796
42578
|
CreatorActionHeader,
|
|
40797
42579
|
CreatorCompactView,
|
|
42580
|
+
CreatorExpandedPanel,
|
|
40798
42581
|
CreatorGridCard,
|
|
40799
42582
|
CreatorImageList,
|
|
40800
42583
|
CreatorProfileSummary,
|
|
@@ -40980,6 +42763,8 @@ var PXEngineRenderer = ({
|
|
|
40980
42763
|
VideoAtom,
|
|
40981
42764
|
WorkflowVisualizer,
|
|
40982
42765
|
cn,
|
|
42766
|
+
defaultFetchSelections,
|
|
42767
|
+
defaultPersistSelection,
|
|
40983
42768
|
generateFieldsFromData,
|
|
40984
42769
|
generateFieldsFromPropDefinitions,
|
|
40985
42770
|
useCreatorWidgetPolling
|