@flamingo-stack/openframe-frontend-core 0.0.816 → 0.0.818
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/build/export-map.json +1 -1
- package/dist/{case-study-card-NLT2JVI7.cjs → case-study-card-IZBMHA6R.cjs} +3 -3
- package/dist/{chunk-VDXI26G7.cjs → chunk-4XASD2TL.cjs} +81 -78
- package/dist/{chunk-5TUR7O7H.cjs → chunk-5AIOYEXW.cjs} +90 -90
- package/dist/{chunk-RYJJHSHV.cjs → chunk-5VRSUEC5.cjs} +23 -23
- package/dist/{chunk-633NTKO2.cjs → chunk-6QT5K5I5.cjs} +31 -53
- package/dist/{chunk-CNTBGJA7.cjs → chunk-A34UNP5V.cjs} +65 -1
- package/dist/{chunk-3ELDGEM2.cjs → chunk-AE22KOW3.cjs} +87 -84
- package/dist/{chunk-EJCUAADF.cjs → chunk-BD42NMCT.cjs} +4 -4
- package/dist/{chunk-7NYWHEQM.cjs → chunk-DGAX5WG2.cjs} +15 -15
- package/dist/{chunk-L7W4455K.cjs → chunk-DL4HWYIB.cjs} +3 -3
- package/dist/chunk-DVHSYPDB.cjs +471 -0
- package/dist/{chunk-GAR2IIU6.cjs → chunk-IM366HS6.cjs} +105 -157
- package/dist/{chunk-7ERD34HQ.cjs → chunk-IQCHV7Z2.cjs} +571 -823
- package/dist/{chunk-3E4FIJAM.cjs → chunk-JTBJB4JF.cjs} +15 -15
- package/dist/{chunk-PAI4A3UM.cjs → chunk-K5IICQNF.cjs} +61 -54
- package/dist/{chunk-JOKOQOLJ.cjs → chunk-LUID2IB3.cjs} +2 -2
- package/dist/{chunk-JOOZTRXQ.cjs → chunk-NEXMK6OP.cjs} +4 -4
- package/dist/{chunk-4PMD3JUC.cjs → chunk-NPNZAAOB.cjs} +2 -2
- package/dist/{chunk-JH65CEO4.cjs → chunk-NWIEZUM7.cjs} +36 -36
- package/dist/{chunk-HM7VCQSX.cjs → chunk-SBFBNOKU.cjs} +4 -4
- package/dist/{chunk-7O7EX7HQ.cjs → chunk-T266OITJ.cjs} +28 -20
- package/dist/{chunk-SWBLTIN4.cjs → chunk-U2THWP25.cjs} +54 -52
- package/dist/{chunk-F4ZJRMMM.cjs → chunk-UDLDXVY4.cjs} +8 -8
- package/dist/{chunk-Y6MJMPHV.cjs → chunk-UEULXVW2.cjs} +32 -84
- package/dist/{chunk-O6VWD2SB.cjs → chunk-VGZXB3SY.cjs} +3 -3
- package/dist/{chunk-ZAWHRYJZ.cjs → chunk-VRXDTRIY.cjs} +45 -45
- package/dist/{chunk-EB7YAUER.cjs → chunk-YHPUD4PM.cjs} +19 -19
- package/dist/{chunk-FUEK43FL.cjs → chunk-YMPPE322.cjs} +206 -200
- package/dist/{chunk-IKB6AZPV.cjs → chunk-ZECG6GU5.cjs} +2 -2
- package/dist/{chunk-53JJLHJM.cjs → chunk-ZWAVMZIF.cjs} +20 -20
- package/dist/{cloud-tenants-SRTX2FZC.cjs → cloud-tenants-V6EV4OGK.cjs} +11 -11
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/announcement-bar.js +5 -5
- package/dist/components/case-studies/index.cjs +26 -26
- package/dist/components/chat/chat-markdown-link.d.ts +15 -0
- package/dist/components/chat/chat-markdown-link.d.ts.map +1 -0
- package/dist/components/chat/chat-markdown-link.js +22 -0
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-enhanced.js +3 -9
- package/dist/components/chat/embeddable-chat.d.ts +4 -8
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +31 -125
- package/dist/components/chat/entity-cards/chat-card-disclosure.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/chat-card-disclosure.js +8 -11
- package/dist/components/chat/entity-cards/dispatch.d.ts +8 -15
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.js +22 -40
- package/dist/components/chat/entity-cards/github-activity-card.d.ts +1 -1
- package/dist/components/chat/entity-cards/use-entity-card-link.d.ts +3 -2
- package/dist/components/chat/entity-cards/use-entity-card-link.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/use-entity-card-link.js +6 -4
- package/dist/components/chat/index.cjs +28 -21
- package/dist/components/chat/index.d.ts +2 -2
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +4 -3
- package/dist/components/chat/{inline-app-link-chip.d.ts → inline-chip.d.ts} +1 -14
- package/dist/components/chat/inline-chip.d.ts.map +1 -0
- package/dist/components/chat/inline-chip.js +27 -0
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts +45 -11
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts.map +1 -1
- package/dist/components/chat/nav-link-anchor-via-runtime.js +32 -24
- package/dist/components/chat/source-action-button.d.ts +12 -3
- package/dist/components/chat/source-action-button.d.ts.map +1 -1
- package/dist/components/chat/source-action-button.js +41 -26
- package/dist/components/chat/types/component.types.d.ts +1 -1
- package/dist/components/chat/types/entities/data-room-doc.d.ts +0 -12
- package/dist/components/chat/types/entities/data-room-doc.d.ts.map +1 -1
- package/dist/components/chat/types/message.types.d.ts +1 -1
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-nav-resolution.d.ts +1 -6
- package/dist/components/chat/utils/chat-nav-resolution.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-nav-resolution.js +2 -3
- package/dist/components/chat/utils/decide-new-tab.d.ts +0 -3
- package/dist/components/chat/utils/decide-new-tab.d.ts.map +1 -1
- package/dist/components/chat/utils/decide-new-tab.js +0 -1
- package/dist/components/chat/utils/execute-navigation.d.ts +36 -34
- package/dist/components/chat/utils/execute-navigation.d.ts.map +1 -1
- package/dist/components/chat/utils/execute-navigation.js +23 -19
- package/dist/components/chat/utils/index.d.ts +5 -5
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/index.js +14 -6
- package/dist/components/chat/utils/nav-anchor-props.d.ts +35 -8
- package/dist/components/chat/utils/nav-anchor-props.d.ts.map +1 -1
- package/dist/components/chat/utils/nav-anchor-props.js +14 -5
- package/dist/components/chat/utils/new-tab-rel.d.ts +15 -0
- package/dist/components/chat/utils/new-tab-rel.d.ts.map +1 -0
- package/dist/components/chat/utils/new-tab-rel.js +25 -0
- package/dist/components/chat/utils/source-row-cta.d.ts +9 -48
- package/dist/components/chat/utils/source-row-cta.d.ts.map +1 -1
- package/dist/components/chat/utils/source-row-cta.js +7 -32
- package/dist/components/contact/index.cjs +12 -12
- package/dist/components/docs/index.cjs +15 -15
- package/dist/components/embeds/index.cjs +12 -12
- package/dist/components/faq/index.cjs +13 -13
- package/dist/components/features/devices/devices-table-columns.d.ts.map +1 -1
- package/dist/components/features/devices/devices-table-columns.js +4 -1
- package/dist/components/features/index.cjs +11 -11
- package/dist/components/help-center-pages/index.cjs +105 -105
- package/dist/components/index.cjs +91 -83
- package/dist/components/meeting-scheduler/index.cjs +50 -50
- package/dist/components/navigation/app-header.d.ts +1 -4
- package/dist/components/navigation/app-header.d.ts.map +1 -1
- package/dist/components/navigation/app-header.js +0 -2
- package/dist/components/navigation/index.cjs +14 -14
- package/dist/components/navigation/ticket-alerts-button.d.ts +1 -4
- package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -1
- package/dist/components/navigation/ticket-alerts-button.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +14 -14
- package/dist/components/product-demo/index.cjs +20 -20
- package/dist/components/related-content/card-registry.d.ts +1 -1
- package/dist/components/related-content/index.cjs +7 -7
- package/dist/components/related-content/related-content-section.d.ts +3 -3
- package/dist/components/related-content/related-content-section.d.ts.map +1 -1
- package/dist/components/related-content/related-content-section.js +5 -3
- package/dist/components/shared/doc-search/resolve-search-result-action.d.ts +10 -3
- package/dist/components/shared/doc-search/resolve-search-result-action.d.ts.map +1 -1
- package/dist/components/shared/doc-search/resolve-search-result-action.js +8 -17
- package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
- package/dist/components/shared/doc-search/use-doc-search.js +15 -27
- package/dist/components/shared/product-release/product-release-card.d.ts +2 -2
- package/dist/components/shared/product-release/product-releases-view.d.ts.map +1 -1
- package/dist/components/shared/product-release/product-releases-view.js +1 -3
- package/dist/components/tickets/index.cjs +18 -18
- package/dist/components/tickets/ticket-detail-drawer.d.ts.map +1 -1
- package/dist/components/tickets/ticket-detail-drawer.js +6 -3
- package/dist/components/tickets/types.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/hover-dropdown.d.ts +2 -2
- package/dist/components/ui/index.cjs +31 -23
- package/dist/components/ui/service-card.d.ts.map +1 -1
- package/dist/components/ui/service-card.js +4 -1
- package/dist/components/vendor-display-button.d.ts.map +1 -1
- package/dist/components/vendor-display-button.js +4 -1
- package/dist/contexts/chat-runtime-context.d.ts +14 -25
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/{devices-DL4YU64N.cjs → devices-6KZAJAAS.cjs} +12 -12
- package/dist/{embeddable-chat-YRKMPFDY.cjs → embeddable-chat-5IHA5SUZ.cjs} +95 -193
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/use-contact-submission.d.ts.map +1 -1
- package/dist/hooks/use-contact-submission.js +11 -8
- package/dist/index.cjs +40 -34
- package/dist/{knowledge-VQW5JL2Z.cjs → knowledge-I7FDQQYJ.cjs} +12 -12
- package/dist/{logs-IY3WBLMW.cjs → logs-Q7PAVJUG.cjs} +19 -19
- package/dist/{policies-IXWTWMJO.cjs → policies-C3DW5CHS.cjs} +15 -15
- package/dist/{scripts-D5CLO5EG.cjs → scripts-BET663HD.cjs} +16 -16
- package/dist/{software-update-ULNP6CKJ.cjs → software-update-W7ZQXEPK.cjs} +14 -14
- package/dist/utils/index.cjs +116 -89
- package/dist/utils/open-in-new-tab.d.ts +2 -1
- package/dist/utils/open-in-new-tab.d.ts.map +1 -1
- package/dist/utils/open-in-new-tab.js +2 -1
- package/dist/utils/scroll-into-view.d.ts +1 -1
- package/dist/utils/source-grouping.d.ts +2 -2
- package/eslint-config/base.js +11 -0
- package/eslint-config/navigation.js +142 -0
- package/package.json +1 -1
- package/src/components/announcement-bar.tsx +8 -6
- package/src/components/chat/chat-markdown-link.tsx +42 -0
- package/src/components/chat/chat-message-enhanced.tsx +10 -36
- package/src/components/chat/embeddable-chat.tsx +66 -173
- package/src/components/chat/entity-cards/chat-card-disclosure.tsx +9 -13
- package/src/components/chat/entity-cards/data-room-doc-card.tsx +1 -1
- package/src/components/chat/entity-cards/dispatch.tsx +51 -66
- package/src/components/chat/entity-cards/github-activity-card.tsx +1 -1
- package/src/components/chat/entity-cards/use-entity-card-link.ts +11 -16
- package/src/components/chat/index.ts +3 -1
- package/src/components/chat/{inline-app-link-chip.tsx → inline-chip.tsx} +1 -27
- package/src/components/chat/nav-link-anchor-via-runtime.tsx +73 -33
- package/src/components/chat/source-action-button.tsx +57 -33
- package/src/components/chat/types/component.types.ts +1 -1
- package/src/components/chat/types/entities/data-room-doc.ts +0 -12
- package/src/components/chat/types/message.types.ts +1 -1
- package/src/components/chat/utils/chat-nav-resolution.ts +3 -8
- package/src/components/chat/utils/decide-new-tab.ts +0 -3
- package/src/components/chat/utils/execute-navigation.ts +58 -58
- package/src/components/chat/utils/index.ts +13 -6
- package/src/components/chat/utils/nav-anchor-props.ts +56 -9
- package/src/components/chat/utils/new-tab-rel.ts +39 -0
- package/src/components/chat/utils/source-row-cta.ts +21 -102
- package/src/components/features/devices/devices-table-columns.tsx +4 -1
- package/src/components/navigation/app-header.tsx +0 -5
- package/src/components/navigation/ticket-alerts-button.tsx +7 -8
- package/src/components/related-content/card-registry.tsx +1 -1
- package/src/components/related-content/related-content-section.tsx +10 -10
- package/src/components/shared/doc-search/resolve-search-result-action.ts +19 -33
- package/src/components/shared/doc-search/use-doc-search.ts +21 -44
- package/src/components/shared/product-release/product-release-card.tsx +4 -4
- package/src/components/shared/product-release/product-releases-view.tsx +2 -5
- package/src/components/tickets/ticket-detail-drawer.tsx +7 -4
- package/src/components/tickets/types.ts +1 -1
- package/src/components/ui/button/button.tsx +2 -2
- package/src/components/ui/hover-dropdown.tsx +2 -2
- package/src/components/ui/service-card.tsx +4 -1
- package/src/components/vendor-display-button.tsx +5 -2
- package/src/contexts/chat-runtime-context.tsx +18 -23
- package/src/hooks/use-contact-submission.ts +13 -8
- package/src/utils/index.ts +1 -1
- package/src/utils/open-in-new-tab.ts +4 -2
- package/src/utils/scroll-into-view.ts +1 -1
- package/src/utils/source-grouping.ts +2 -2
- package/dist/chunk-RD66AGUI.cjs +0 -156
- package/dist/components/chat/inline-app-link-chip.d.ts.map +0 -1
- package/dist/components/chat/inline-app-link-chip.js +0 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4XASD2TLcjs = require('./chunk-4XASD2TL.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkZRDVFADQcjs = require('./chunk-ZRDVFADQ.cjs');
|
|
@@ -14,7 +14,7 @@ var _chunkZRDVFADQcjs = require('./chunk-ZRDVFADQ.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkA34UNP5Vcjs = require('./chunk-A34UNP5V.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -230,7 +230,7 @@ function useSectionNavigation(sections, options) {
|
|
|
230
230
|
if (!targetElement) return;
|
|
231
231
|
isScrollingFromClick.current = true;
|
|
232
232
|
setActiveSection(sectionId);
|
|
233
|
-
|
|
233
|
+
_chunkA34UNP5Vcjs.scrollElementIntoView.call(void 0, targetElement, { headerOffset: offset });
|
|
234
234
|
setTimeout(() => {
|
|
235
235
|
isScrollingFromClick.current = false;
|
|
236
236
|
}, 500);
|
|
@@ -283,13 +283,13 @@ var SCROLL_OFFSET = 100;
|
|
|
283
283
|
var ID_SEPARATOR = "\n";
|
|
284
284
|
var LINE_TOLERANCE_PX = 1;
|
|
285
285
|
function currentHashId() {
|
|
286
|
-
return
|
|
286
|
+
return _chunkA34UNP5Vcjs.normalizeHashFragment.call(void 0, window.location.hash).slice(1);
|
|
287
287
|
}
|
|
288
288
|
function activeChildAnchor(section) {
|
|
289
|
-
return _nullishCoalesce(_optionalChain([section, 'access', _10 => _10.querySelector, 'call', _11 => _11(`[${
|
|
289
|
+
return _nullishCoalesce(_optionalChain([section, 'access', _10 => _10.querySelector, 'call', _11 => _11(`[${_chunkA34UNP5Vcjs.ACTIVE_ANCHOR_ATTRIBUTE}][id]`), 'optionalAccess', _12 => _12.id]), () => ( null));
|
|
290
290
|
}
|
|
291
291
|
function hashIsWithin(section) {
|
|
292
|
-
return section.contains(
|
|
292
|
+
return section.contains(_chunkA34UNP5Vcjs.getHashTargetElement.call(void 0, currentHashId()));
|
|
293
293
|
}
|
|
294
294
|
function hashForSection(sectionId) {
|
|
295
295
|
const section = document.getElementById(sectionId);
|
|
@@ -297,7 +297,7 @@ function hashForSection(sectionId) {
|
|
|
297
297
|
return _nullishCoalesce(activeChildAnchor(section), () => ( (hashIsWithin(section) ? currentHashId() : sectionId)));
|
|
298
298
|
}
|
|
299
299
|
function resolveScroller(firstSection) {
|
|
300
|
-
const container = firstSection ?
|
|
300
|
+
const container = firstSection ? _chunkA34UNP5Vcjs.getScrollableAncestor.call(void 0, firstSection) : null;
|
|
301
301
|
if (container) {
|
|
302
302
|
return {
|
|
303
303
|
target: container,
|
|
@@ -327,8 +327,8 @@ function useScrollSpy(sections, options = {}) {
|
|
|
327
327
|
if (!targetElement) return;
|
|
328
328
|
isScrollingFromClick.current = true;
|
|
329
329
|
setActiveSection(sectionId);
|
|
330
|
-
if (syncHash)
|
|
331
|
-
|
|
330
|
+
if (syncHash) _chunkA34UNP5Vcjs.replaceLocationHash.call(void 0, _nullishCoalesce(activeChildAnchor(targetElement), () => ( sectionId)));
|
|
331
|
+
_chunkA34UNP5Vcjs.scrollElementIntoView.call(void 0, targetElement, { headerOffset });
|
|
332
332
|
setTimeout(() => {
|
|
333
333
|
isScrollingFromClick.current = false;
|
|
334
334
|
}, 800);
|
|
@@ -344,7 +344,7 @@ function useScrollSpy(sections, options = {}) {
|
|
|
344
344
|
const scrollTop = scroller.scrollTop();
|
|
345
345
|
const viewportTop = scroller.viewportTop();
|
|
346
346
|
const sectionTop = (element) => element.getBoundingClientRect().top - viewportTop + scrollTop;
|
|
347
|
-
const reached = (element) => scrollTop + Math.max(headerOffset,
|
|
347
|
+
const reached = (element) => scrollTop + Math.max(headerOffset, _chunkA34UNP5Vcjs.declaredScrollMarginTop.call(void 0, element)) + LINE_TOLERANCE_PX >= sectionTop(element);
|
|
348
348
|
const first = document.getElementById(_nullishCoalesce(sectionIds[0], () => ( "")));
|
|
349
349
|
let currentSection = _nullishCoalesce(sectionIds[0], () => ( ""));
|
|
350
350
|
const scrollHeight = scroller.scrollHeight();
|
|
@@ -367,16 +367,16 @@ function useScrollSpy(sections, options = {}) {
|
|
|
367
367
|
setActiveSection((prev) => prev !== active ? active : prev);
|
|
368
368
|
if (!syncHash) return;
|
|
369
369
|
if (fromScroll) {
|
|
370
|
-
|
|
370
|
+
_chunkA34UNP5Vcjs.replaceLocationHash.call(void 0, isAboveFirst ? null : hashForSection(currentSection));
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
if (restoredChecked.current || !
|
|
374
|
-
const target =
|
|
373
|
+
if (restoredChecked.current || !_chunkA34UNP5Vcjs.isScrollSyncedHash.call(void 0, )) return;
|
|
374
|
+
const target = _chunkA34UNP5Vcjs.getHashTargetElement.call(void 0, currentHashId());
|
|
375
375
|
const tracked = sectionIds.some((id) => _nullishCoalesce(_optionalChain([document, 'access', _17 => _17.getElementById, 'call', _18 => _18(id), 'optionalAccess', _19 => _19.contains, 'call', _20 => _20(target)]), () => ( false)));
|
|
376
376
|
if (!target || !tracked) return;
|
|
377
377
|
restoredChecked.current = true;
|
|
378
378
|
const section = isAboveFirst ? null : document.getElementById(currentSection);
|
|
379
|
-
if (!_optionalChain([section, 'optionalAccess', _21 => _21.contains, 'call', _22 => _22(target)]))
|
|
379
|
+
if (!_optionalChain([section, 'optionalAccess', _21 => _21.contains, 'call', _22 => _22(target)])) _chunkA34UNP5Vcjs.scrollElementIntoView.call(void 0, target, { headerOffset, behavior: "instant" });
|
|
380
380
|
};
|
|
381
381
|
let scrollTimer;
|
|
382
382
|
const throttledScroll = () => {
|
|
@@ -396,7 +396,7 @@ function useScrollSpy(sections, options = {}) {
|
|
|
396
396
|
// src/components/navigation/multi-level-navigation.tsx
|
|
397
397
|
var _lucidereact = require('lucide-react');
|
|
398
398
|
|
|
399
|
-
var DEFAULT_FOLDER_INDEX_FILE2 =
|
|
399
|
+
var DEFAULT_FOLDER_INDEX_FILE2 = _chunk4XASD2TLcjs.DEFAULT_FOLDER_INDEX_FILE;
|
|
400
400
|
var NAV_LIST_CLASS = "space-y-2";
|
|
401
401
|
var NAV_ITEM_CLASS = "space-y-1";
|
|
402
402
|
var NAV_ROW_FRAME_CLASS = "relative w-full rounded-lg border transition-all duration-150";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkYMPPE322cjs = require('./chunk-YMPPE322.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkCKR42OBKcjs = require('./chunk-CKR42OBK.cjs');
|
|
@@ -48,7 +48,7 @@ function GoogleSheetsViewer({ externalUrl, fileName, height }) {
|
|
|
48
48
|
] });
|
|
49
49
|
}
|
|
50
50
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
51
|
-
|
|
51
|
+
_chunkYMPPE322cjs.EmbedViewerFrame,
|
|
52
52
|
{
|
|
53
53
|
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkCKR42OBKcjs.GoogleSheetsIcon, { className: "h-5 w-5 shrink-0" }),
|
|
54
54
|
title: displayName,
|
|
@@ -83,7 +83,7 @@ function PdfViewer({ src, fileName, onPreview, onDownload, height }) {
|
|
|
83
83
|
] });
|
|
84
84
|
}
|
|
85
85
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
86
|
-
|
|
86
|
+
_chunkYMPPE322cjs.EmbedViewerFrame,
|
|
87
87
|
{
|
|
88
88
|
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkM7ZSKWT3cjs.AdobePdfIcon, { className: "h-5 w-5 shrink-0" }),
|
|
89
89
|
title: displayName,
|
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkQOAA7ZHBcjs = require('./chunk-QOAA7ZHB.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk3V5JWG27cjs = require('./chunk-3V5JWG27.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkUJ7AXHRZcjs = require('./chunk-UJ7AXHRZ.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunk63A4GZMBcjs = require('./chunk-63A4GZMB.cjs');
|
|
14
|
+
|
|
15
|
+
// src/hooks/ui/use-image-edge-color.ts
|
|
16
|
+
var _react = require('react');
|
|
17
|
+
var EDGE_SAMPLE_WIDTH = _chunkQOAA7ZHBcjs.IMAGE_FIXED_WIDTHS[2];
|
|
18
|
+
function extractEdgeColor(img) {
|
|
19
|
+
const canvas = document.createElement("canvas");
|
|
20
|
+
const ctx = canvas.getContext("2d");
|
|
21
|
+
if (!ctx) return "#000000";
|
|
22
|
+
const maxSize = EDGE_SAMPLE_WIDTH;
|
|
23
|
+
const scale = Math.min(maxSize / img.naturalWidth, maxSize / img.naturalHeight);
|
|
24
|
+
const w = Math.round(img.naturalWidth * scale);
|
|
25
|
+
const h = Math.round(img.naturalHeight * scale);
|
|
26
|
+
canvas.width = w;
|
|
27
|
+
canvas.height = h;
|
|
28
|
+
ctx.drawImage(img, 0, 0, w, h);
|
|
29
|
+
const data = ctx.getImageData(0, 0, w, h).data;
|
|
30
|
+
const edgeW = Math.max(2, Math.round(w * 0.15));
|
|
31
|
+
const edgeH = Math.max(2, Math.round(h * 0.15));
|
|
32
|
+
const bucketSize = 32;
|
|
33
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
34
|
+
for (let y = 0; y < h; y++) {
|
|
35
|
+
for (let x = 0; x < w; x++) {
|
|
36
|
+
const isEdge = x < edgeW || x >= w - edgeW || y < edgeH || y >= h - edgeH;
|
|
37
|
+
if (!isEdge) continue;
|
|
38
|
+
const i = (y * w + x) * 4;
|
|
39
|
+
const a = data[i + 3];
|
|
40
|
+
if (a < 128) continue;
|
|
41
|
+
const r2 = data[i];
|
|
42
|
+
const g2 = data[i + 1];
|
|
43
|
+
const b2 = data[i + 2];
|
|
44
|
+
const br = Math.floor(r2 / bucketSize) * bucketSize;
|
|
45
|
+
const bg = Math.floor(g2 / bucketSize) * bucketSize;
|
|
46
|
+
const bb = Math.floor(b2 / bucketSize) * bucketSize;
|
|
47
|
+
const key = `${br},${bg},${bb}`;
|
|
48
|
+
const existing = buckets.get(key);
|
|
49
|
+
if (existing) {
|
|
50
|
+
existing.r += r2;
|
|
51
|
+
existing.g += g2;
|
|
52
|
+
existing.b += b2;
|
|
53
|
+
existing.count++;
|
|
54
|
+
} else {
|
|
55
|
+
buckets.set(key, { r: r2, g: g2, b: b2, count: 1 });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (buckets.size === 0) return "#000000";
|
|
60
|
+
let bestBucket = null;
|
|
61
|
+
for (const bucket of buckets.values()) {
|
|
62
|
+
if (!bestBucket || bucket.count > bestBucket.count) {
|
|
63
|
+
bestBucket = bucket;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (!bestBucket || bestBucket.count === 0) return "#000000";
|
|
67
|
+
const r = Math.round(bestBucket.r / bestBucket.count);
|
|
68
|
+
const g = Math.round(bestBucket.g / bestBucket.count);
|
|
69
|
+
const b = Math.round(bestBucket.b / bestBucket.count);
|
|
70
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
71
|
+
}
|
|
72
|
+
function useImageEdgeColor(givenUrl, fallback = "#000000") {
|
|
73
|
+
const imageUrl = _chunk63A4GZMBcjs.useLoadingScope.call(void 0, ) ? null : givenUrl;
|
|
74
|
+
const [color, setColor] = _react.useState.call(void 0, fallback);
|
|
75
|
+
const [resetFor, setResetFor] = _react.useState.call(void 0, { imageUrl, fallback });
|
|
76
|
+
if (resetFor.imageUrl !== imageUrl || resetFor.fallback !== fallback) {
|
|
77
|
+
setResetFor({ imageUrl, fallback });
|
|
78
|
+
if (!imageUrl) setColor(fallback);
|
|
79
|
+
}
|
|
80
|
+
_react.useEffect.call(void 0, () => {
|
|
81
|
+
if (!imageUrl) return void 0;
|
|
82
|
+
let cancelled = false;
|
|
83
|
+
const img = new Image();
|
|
84
|
+
img.crossOrigin = "anonymous";
|
|
85
|
+
img.onload = () => {
|
|
86
|
+
if (cancelled) return;
|
|
87
|
+
try {
|
|
88
|
+
setColor(extractEdgeColor(img));
|
|
89
|
+
} catch (e2) {
|
|
90
|
+
setColor(fallback);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const sampleUrl = _chunk3V5JWG27cjs.resizedImageUrl.call(void 0, imageUrl, EDGE_SAMPLE_WIDTH);
|
|
94
|
+
let triedOriginal = sampleUrl === imageUrl;
|
|
95
|
+
img.onerror = () => {
|
|
96
|
+
if (cancelled) return;
|
|
97
|
+
if (!triedOriginal) {
|
|
98
|
+
triedOriginal = true;
|
|
99
|
+
img.src = imageUrl;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
setColor(fallback);
|
|
103
|
+
};
|
|
104
|
+
img.src = sampleUrl;
|
|
105
|
+
return () => {
|
|
106
|
+
cancelled = true;
|
|
107
|
+
};
|
|
108
|
+
}, [imageUrl, fallback]);
|
|
109
|
+
return color;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/platform-domains.ts
|
|
113
|
+
var PLATFORM_DOMAINS = [
|
|
114
|
+
{ key: "marketing-hub", defaultUrl: "https://marketing-hub.flamingo.so", envVar: "NEXT_PUBLIC_MARKETING_HUB_URL" },
|
|
115
|
+
{ key: "company-hub", defaultUrl: "https://company-hub.flamingo.so", envVar: "NEXT_PUBLIC_COMPANY_HUB_URL" },
|
|
116
|
+
{ key: "product-hub", defaultUrl: "https://product-hub.flamingo.so", envVar: "NEXT_PUBLIC_PRODUCT_HUB_URL" },
|
|
117
|
+
{ key: "revenue-hub", defaultUrl: "https://revenue-hub.flamingo.so", envVar: "NEXT_PUBLIC_REVENUE_HUB_URL" },
|
|
118
|
+
{ key: "people-hub", defaultUrl: "https://people-hub.flamingo.so", envVar: "NEXT_PUBLIC_PEOPLE_HUB_URL" },
|
|
119
|
+
{ key: "coding-hub", defaultUrl: "https://coding-hub.flamingo.so", envVar: "NEXT_PUBLIC_CODING_HUB_URL" },
|
|
120
|
+
{ key: "openmsp", defaultUrl: "https://www.openmsp.ai", envVar: "NEXT_PUBLIC_OPENMSP_URL" },
|
|
121
|
+
// ORDERING INVARIANT (first-wins, load-bearing): `flamingo` MUST precede `universal`.
|
|
122
|
+
// Both resolve to www.flamingo.run; the reverse index is first-wins → flamingo claims the shared host,
|
|
123
|
+
// universal contributes no unique host. `flamingo.cx` is the company's older domain: it maps to flamingo.
|
|
124
|
+
// ⚠️ DO NOT REORDER — enforced by the module-load self-check at the bottom of this file.
|
|
125
|
+
{
|
|
126
|
+
key: "flamingo",
|
|
127
|
+
defaultUrl: "https://www.flamingo.run",
|
|
128
|
+
envVar: "NEXT_PUBLIC_FLAMINGO_URL",
|
|
129
|
+
aliasHostnames: ["flamingo.cx", "www.flamingo.cx"]
|
|
130
|
+
},
|
|
131
|
+
{ key: "tmcg", defaultUrl: "https://www.tmcg.miami", envVar: "NEXT_PUBLIC_TMCG_URL" },
|
|
132
|
+
{ key: "mlg", defaultUrl: "https://www.mlg.soccer", envVar: "NEXT_PUBLIC_MLG_URL" },
|
|
133
|
+
{
|
|
134
|
+
key: "openframe",
|
|
135
|
+
defaultUrl: "https://openframe.ai",
|
|
136
|
+
envVar: "NEXT_PUBLIC_OPENFRAME_URL",
|
|
137
|
+
aliasHostnames: ["openframe.ai", "www.openframe.ai", "hub.openframe.ai"]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: "openframe-dashboard",
|
|
141
|
+
defaultUrl: "https://openframe.ai",
|
|
142
|
+
envVar: "NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL",
|
|
143
|
+
pseudo: true
|
|
144
|
+
},
|
|
145
|
+
{ key: "universal", defaultUrl: "https://www.flamingo.run", envVar: "NEXT_PUBLIC_FLAMINGO_URL" }
|
|
146
|
+
];
|
|
147
|
+
var ENV_OVERRIDES = {
|
|
148
|
+
NEXT_PUBLIC_MARKETING_HUB_URL: process.env.NEXT_PUBLIC_MARKETING_HUB_URL,
|
|
149
|
+
NEXT_PUBLIC_COMPANY_HUB_URL: process.env.NEXT_PUBLIC_COMPANY_HUB_URL,
|
|
150
|
+
NEXT_PUBLIC_PRODUCT_HUB_URL: process.env.NEXT_PUBLIC_PRODUCT_HUB_URL,
|
|
151
|
+
NEXT_PUBLIC_REVENUE_HUB_URL: process.env.NEXT_PUBLIC_REVENUE_HUB_URL,
|
|
152
|
+
NEXT_PUBLIC_PEOPLE_HUB_URL: process.env.NEXT_PUBLIC_PEOPLE_HUB_URL,
|
|
153
|
+
NEXT_PUBLIC_CODING_HUB_URL: process.env.NEXT_PUBLIC_CODING_HUB_URL,
|
|
154
|
+
NEXT_PUBLIC_OPENMSP_URL: process.env.NEXT_PUBLIC_OPENMSP_URL,
|
|
155
|
+
NEXT_PUBLIC_FLAMINGO_URL: process.env.NEXT_PUBLIC_FLAMINGO_URL,
|
|
156
|
+
NEXT_PUBLIC_TMCG_URL: process.env.NEXT_PUBLIC_TMCG_URL,
|
|
157
|
+
NEXT_PUBLIC_MLG_URL: process.env.NEXT_PUBLIC_MLG_URL,
|
|
158
|
+
NEXT_PUBLIC_OPENFRAME_URL: process.env.NEXT_PUBLIC_OPENFRAME_URL,
|
|
159
|
+
NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL: process.env.NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL
|
|
160
|
+
};
|
|
161
|
+
function byKey(key) {
|
|
162
|
+
return PLATFORM_DOMAINS.find((e) => e.key === key);
|
|
163
|
+
}
|
|
164
|
+
function envOverrideFor(key) {
|
|
165
|
+
const envVar = _optionalChain([byKey, 'call', _ => _(key), 'optionalAccess', _2 => _2.envVar]);
|
|
166
|
+
if (!envVar) return null;
|
|
167
|
+
return ENV_OVERRIDES[envVar] || null;
|
|
168
|
+
}
|
|
169
|
+
function ensureScheme(url) {
|
|
170
|
+
const trimmed = url.trim();
|
|
171
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed)) return trimmed;
|
|
172
|
+
return `https://${trimmed.replace(/^\/+/, "")}`;
|
|
173
|
+
}
|
|
174
|
+
function getPlatformProductionUrl(platform) {
|
|
175
|
+
const resolved = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(envOverrideFor(platform), () => ( _optionalChain([byKey, 'call', _3 => _3(platform), 'optionalAccess', _4 => _4.defaultUrl]))), () => ( envOverrideFor("flamingo"))), () => ( "https://www.flamingo.run"));
|
|
176
|
+
return ensureScheme(resolved);
|
|
177
|
+
}
|
|
178
|
+
function getPlatformUrl(platform, options = {}) {
|
|
179
|
+
const url = options.environment !== "production" && process.env.NODE_ENV !== "production" ? process.env.NEXT_PUBLIC_DEV_URL || "http://localhost:3000" : getPlatformProductionUrl(platform);
|
|
180
|
+
return url.replace(/\/+$/, "");
|
|
181
|
+
}
|
|
182
|
+
function getDeploymentUrl(options) {
|
|
183
|
+
if (typeof window !== "undefined") return window.location.origin;
|
|
184
|
+
const configured = _optionalChain([options, 'access', _5 => _5.configuredUrl, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]);
|
|
185
|
+
if (configured) return ensureScheme(configured).replace(/\/+$/, "");
|
|
186
|
+
if (process.env.VERCEL_ENV === "preview" && process.env.VERCEL_URL) {
|
|
187
|
+
return ensureScheme(process.env.VERCEL_URL).replace(/\/+$/, "");
|
|
188
|
+
}
|
|
189
|
+
if (process.env.VERCEL_ENV === "production" || process.env.NODE_ENV === "production") {
|
|
190
|
+
return getPlatformUrl(options.platform, { environment: "production" });
|
|
191
|
+
}
|
|
192
|
+
return (process.env.NEXT_PUBLIC_DEV_URL || `http://localhost:${_nullishCoalesce(process.env.PORT, () => ( 3e3))}`).replace(/\/+$/, "");
|
|
193
|
+
}
|
|
194
|
+
var LOCAL_HOSTNAME = /^(localhost|127(?:\.\d{1,3}){3}|0\.0\.0\.0|\[::1\])$/i;
|
|
195
|
+
function isLocalUrl(url) {
|
|
196
|
+
try {
|
|
197
|
+
return LOCAL_HOSTNAME.test(new URL(url).hostname);
|
|
198
|
+
} catch (e3) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function getRequestOrigin(headers, options) {
|
|
203
|
+
const host = headers.get("host");
|
|
204
|
+
if (!host) return getDeploymentUrl(options);
|
|
205
|
+
const local = LOCAL_HOSTNAME.test(host.replace(/:\d+$/, ""));
|
|
206
|
+
const proto = _optionalChain([headers, 'access', _8 => _8.get, 'call', _9 => _9("x-forwarded-proto"), 'optionalAccess', _10 => _10.split, 'call', _11 => _11(","), 'access', _12 => _12[0], 'access', _13 => _13.trim, 'call', _14 => _14()]) || (local ? "http" : "https");
|
|
207
|
+
return `${proto}://${host}`;
|
|
208
|
+
}
|
|
209
|
+
function resolveRedirectTarget(origin, target) {
|
|
210
|
+
const url = new URL(target, origin);
|
|
211
|
+
if (!/^https?:\/\//i.test(target) && url.origin !== new URL(origin).origin) {
|
|
212
|
+
throw new Error(`resolveRedirectTarget: "${target}" is not a same-origin path`);
|
|
213
|
+
}
|
|
214
|
+
return url;
|
|
215
|
+
}
|
|
216
|
+
function hostOf(value) {
|
|
217
|
+
if (!value) return null;
|
|
218
|
+
try {
|
|
219
|
+
return new URL(value).hostname.toLowerCase();
|
|
220
|
+
} catch (e4) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function expandWwwApex(host) {
|
|
225
|
+
if (host.startsWith("www.")) return [host, host.slice(4)];
|
|
226
|
+
if (host.split(".").length === 2) return [host, `www.${host}`];
|
|
227
|
+
return [host];
|
|
228
|
+
}
|
|
229
|
+
function toRegistrableBaseDomain(host) {
|
|
230
|
+
const parts = host.split(".");
|
|
231
|
+
if (parts.length >= 2) return parts.slice(-2).join(".");
|
|
232
|
+
return void 0;
|
|
233
|
+
}
|
|
234
|
+
function aliasHostsOf(key) {
|
|
235
|
+
return _nullishCoalesce(_optionalChain([byKey, 'call', _15 => _15(key), 'optionalAccess', _16 => _16.aliasHostnames]), () => ( []));
|
|
236
|
+
}
|
|
237
|
+
function hostsForEntry(entry, opts) {
|
|
238
|
+
const resolved = hostOf(getPlatformProductionUrl(entry.key));
|
|
239
|
+
const hosts = resolved ? expandWwwApex(resolved) : [];
|
|
240
|
+
if (opts.includeAliases) hosts.push(...aliasHostsOf(entry.key));
|
|
241
|
+
return hosts;
|
|
242
|
+
}
|
|
243
|
+
function getPlatformByHostname(hostname) {
|
|
244
|
+
const host = hostname.toLowerCase();
|
|
245
|
+
for (const entry of PLATFORM_DOMAINS) {
|
|
246
|
+
if (entry.pseudo) continue;
|
|
247
|
+
if (hostsForEntry(entry, { includeAliases: true }).includes(host)) return entry.key;
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
function isPreviewHost(hostname) {
|
|
252
|
+
return hostname.endsWith(".vercel.app");
|
|
253
|
+
}
|
|
254
|
+
function getAllPlatformBaseDomains() {
|
|
255
|
+
if (typeof window === "undefined") return [];
|
|
256
|
+
const hostname = window.location.hostname;
|
|
257
|
+
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("127.")) {
|
|
258
|
+
return [];
|
|
259
|
+
}
|
|
260
|
+
const previewEnv = process.env.VERCEL_ENV === "preview" || process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" || isPreviewHost(hostname);
|
|
261
|
+
if (previewEnv) {
|
|
262
|
+
return [".vercel.app", "vercel.app"];
|
|
263
|
+
}
|
|
264
|
+
const baseDomains = /* @__PURE__ */ new Set();
|
|
265
|
+
for (const entry of PLATFORM_DOMAINS) {
|
|
266
|
+
if (entry.pseudo) continue;
|
|
267
|
+
const host = hostOf(getPlatformProductionUrl(entry.key));
|
|
268
|
+
if (!host) continue;
|
|
269
|
+
const base = toRegistrableBaseDomain(host);
|
|
270
|
+
if (base) {
|
|
271
|
+
baseDomains.add(`.${base}`);
|
|
272
|
+
baseDomains.add(base);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return Array.from(baseDomains);
|
|
276
|
+
}
|
|
277
|
+
var _orderIdx = (k) => PLATFORM_DOMAINS.findIndex((e) => e.key === k);
|
|
278
|
+
if (_orderIdx("flamingo") > _orderIdx("universal") || getPlatformByHostname("flamingo.cx") !== "flamingo" || getPlatformByHostname("hub.openframe.ai") !== "openframe") {
|
|
279
|
+
console.error(
|
|
280
|
+
"[platform-domains] \u26A0\uFE0F PLATFORM_DOMAINS ordering invariant violated \u2014 `flamingo` must precede `universal`, and the openframe and flamingo.cx aliases must be intact. Do not reorder the table."
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// src/components/chat/utils/new-tab-rel.ts
|
|
285
|
+
function isRelativeHref(href) {
|
|
286
|
+
return !/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(href);
|
|
287
|
+
}
|
|
288
|
+
function isOwnSiteHref(href) {
|
|
289
|
+
if (!href) return false;
|
|
290
|
+
if (href.startsWith("/") && !href.startsWith("//")) return true;
|
|
291
|
+
try {
|
|
292
|
+
const url = new URL(href);
|
|
293
|
+
return isLocalUrl(url.href) || getPlatformByHostname(url.hostname) !== null;
|
|
294
|
+
} catch (e5) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function newTabRel(href, targetPlatform) {
|
|
299
|
+
return targetPlatform || isOwnSiteHref(href) ? "noopener" : "noopener noreferrer";
|
|
300
|
+
}
|
|
301
|
+
function newTabFeatures(href, targetPlatform) {
|
|
302
|
+
return newTabRel(href, targetPlatform).replace(" ", ",");
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// src/components/chat/utils/chat-nav-resolution.ts
|
|
306
|
+
function isModifierClick(e) {
|
|
307
|
+
return e.button !== 0 || !!e.metaKey || !!e.ctrlKey || !!e.shiftKey || !!e.altKey;
|
|
308
|
+
}
|
|
309
|
+
function stripSameOriginToPath(href) {
|
|
310
|
+
if (!href.startsWith("http")) return href;
|
|
311
|
+
try {
|
|
312
|
+
const u = new URL(href);
|
|
313
|
+
return u.pathname + u.search + u.hash;
|
|
314
|
+
} catch (e6) {
|
|
315
|
+
return href;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function resolveHrefForRuntime(href, runtime) {
|
|
319
|
+
if (runtime.navigation.mode !== "embed") return href;
|
|
320
|
+
if (href.startsWith("http")) return href;
|
|
321
|
+
if (href.startsWith("//")) return href;
|
|
322
|
+
const origin = runtime.navigation.defaultContentOrigin;
|
|
323
|
+
if (!origin) return href;
|
|
324
|
+
return origin.replace(/\/+$/, "") + (href.startsWith("/") ? href : "/" + href);
|
|
325
|
+
}
|
|
326
|
+
function resolveExternalNavigation(args) {
|
|
327
|
+
let abs = args.href;
|
|
328
|
+
if (abs.startsWith("//")) abs = window.location.protocol + abs;
|
|
329
|
+
if (!abs.startsWith("http")) {
|
|
330
|
+
if (args.runtime.navigation.defaultContentOrigin) {
|
|
331
|
+
let origin = args.runtime.navigation.defaultContentOrigin;
|
|
332
|
+
while (origin.endsWith("/")) origin = origin.slice(0, -1);
|
|
333
|
+
abs = origin + (abs.startsWith("/") ? abs : "/" + abs);
|
|
334
|
+
} else if (args.runtime.navigation.mode === "embed" && process.env.NODE_ENV !== "production") {
|
|
335
|
+
console.warn(
|
|
336
|
+
"[chat-nav-resolution] relative href in embed mode with no defaultContentOrigin set on runtime.navigation \u2014 link will resolve against the embedder origin.",
|
|
337
|
+
{ href: abs, targetPlatform: args.targetPlatform }
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const open = () => {
|
|
342
|
+
if (args.runtime.navigation.openExternal) {
|
|
343
|
+
args.runtime.navigation.openExternal(abs);
|
|
344
|
+
} else {
|
|
345
|
+
window.open(abs, "_blank", newTabFeatures(abs, args.targetPlatform));
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
return { href: abs, open };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// src/components/chat/utils/is-cross-origin-url.ts
|
|
352
|
+
function isCrossOriginUrl(url) {
|
|
353
|
+
if (!url) return false;
|
|
354
|
+
if (url.startsWith("#") || url.startsWith("?")) return false;
|
|
355
|
+
if (url.startsWith("/") && !url.startsWith("//")) return false;
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// src/components/chat/utils/decide-new-tab.ts
|
|
360
|
+
function decideNewTab(input) {
|
|
361
|
+
const { href, targetPlatform, openIn, alwaysNewTab, runtimeMode, currentSource } = input;
|
|
362
|
+
if (runtimeMode === "embed") return true;
|
|
363
|
+
if (openIn === "new-tab") return true;
|
|
364
|
+
if (alwaysNewTab === true) return true;
|
|
365
|
+
if (openIn === "same-tab") return false;
|
|
366
|
+
if (targetPlatform !== void 0 && targetPlatform !== null && currentSource) {
|
|
367
|
+
return targetPlatform !== currentSource;
|
|
368
|
+
}
|
|
369
|
+
if (!href) return false;
|
|
370
|
+
return isCrossOriginUrl(href);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// src/components/chat/utils/nav-anchor-props.ts
|
|
374
|
+
function isSameOriginAbsoluteHref(href) {
|
|
375
|
+
if (typeof window === "undefined") return false;
|
|
376
|
+
if (!/^https?:\/\//i.test(href)) return false;
|
|
377
|
+
try {
|
|
378
|
+
return new URL(href).origin === new URL(window.location.href).origin;
|
|
379
|
+
} catch (e7) {
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
function computeIsNewTab(runtime, href, targetPlatform) {
|
|
384
|
+
if (!href) return false;
|
|
385
|
+
if (runtime.navigation.mode === "embed") return !isSameOriginAbsoluteHref(href);
|
|
386
|
+
return _nullishCoalesce(_optionalChain([runtime, 'access', _17 => _17.navigation, 'access', _18 => _18.decideNewTab, 'optionalCall', _19 => _19({ href, targetPlatform })]), () => ( decideNewTab({
|
|
387
|
+
href,
|
|
388
|
+
targetPlatform,
|
|
389
|
+
currentSource: _nullishCoalesce(runtime.source, () => ( ""))
|
|
390
|
+
})));
|
|
391
|
+
}
|
|
392
|
+
function navLinkTarget(runtime, href, targetPlatform, { hostRoute = false, openIn } = {}) {
|
|
393
|
+
if (!runtime) return { href, isNewTab: decideNewTab({ href, openIn, currentSource: "" }) };
|
|
394
|
+
if (hostRoute && isRelativeHref(href)) return { href, isNewTab: openIn === "new-tab" };
|
|
395
|
+
const resolved = resolveHrefForRuntime(href, runtime);
|
|
396
|
+
const isNewTab = runtime.navigation.mode !== "embed" && openIn ? openIn === "new-tab" : computeIsNewTab(runtime, resolved, _nullishCoalesce(targetPlatform, () => ( null)));
|
|
397
|
+
return { href: resolved, isNewTab };
|
|
398
|
+
}
|
|
399
|
+
function newTabAnchorAttrs(isNewTab, href, targetPlatform) {
|
|
400
|
+
return isNewTab ? { target: "_blank", rel: newTabRel(href, targetPlatform) } : {};
|
|
401
|
+
}
|
|
402
|
+
function buildAnchorProps(href, isNewTab, targetPlatform) {
|
|
403
|
+
return href ? { href, ...newTabAnchorAttrs(isNewTab, href, targetPlatform) } : void 0;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// src/utils/og-placeholder.ts
|
|
407
|
+
var DEFAULT_OG_PLACEHOLDER_PATH = "/api/og-placeholder";
|
|
408
|
+
function resolveOgPlaceholderBase(endpoints) {
|
|
409
|
+
if (_optionalChain([endpoints, 'optionalAccess', _20 => _20.ogPlaceholderUrl])) return endpoints.ogPlaceholderUrl;
|
|
410
|
+
const imageProxy = _optionalChain([endpoints, 'optionalAccess', _21 => _21.imageProxyUrlPrefix]);
|
|
411
|
+
if (imageProxy) {
|
|
412
|
+
const derived = imageProxy.replace(/\/image-proxy(?=$|[?/])/, "/og-placeholder");
|
|
413
|
+
if (derived !== imageProxy) return derived;
|
|
414
|
+
}
|
|
415
|
+
return DEFAULT_OG_PLACEHOLDER_PATH;
|
|
416
|
+
}
|
|
417
|
+
function buildOgPlaceholderUrl(endpoints, title, options = {}) {
|
|
418
|
+
const base = resolveOgPlaceholderBase(endpoints);
|
|
419
|
+
const qIndex = base.indexOf("?");
|
|
420
|
+
const path = qIndex === -1 ? base : base.slice(0, qIndex);
|
|
421
|
+
const params = new URLSearchParams(qIndex === -1 ? "" : base.slice(qIndex + 1));
|
|
422
|
+
params.set("title", title);
|
|
423
|
+
if (options.site) params.set("site", options.site);
|
|
424
|
+
const width = _nullishCoalesce(options.width, () => ( (options.aspect === "square" ? 1024 : void 0)));
|
|
425
|
+
const height = _nullishCoalesce(options.height, () => ( (options.aspect === "square" ? 1024 : void 0)));
|
|
426
|
+
if (Number.isFinite(width)) params.set("w", String(width));
|
|
427
|
+
if (Number.isFinite(height)) params.set("h", String(height));
|
|
428
|
+
return `${path}?${params.toString()}`;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// src/hooks/use-og-placeholder-url.ts
|
|
432
|
+
|
|
433
|
+
function useOgPlaceholderUrl({
|
|
434
|
+
title,
|
|
435
|
+
siteName = "",
|
|
436
|
+
aspect = "wide",
|
|
437
|
+
enabled = true
|
|
438
|
+
}) {
|
|
439
|
+
const endpoints = _optionalChain([_chunkUJ7AXHRZcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _22 => _22.endpoints]);
|
|
440
|
+
return _react.useMemo.call(void 0, () => {
|
|
441
|
+
if (!enabled || !title) return null;
|
|
442
|
+
return buildOgPlaceholderUrl(endpoints, title, { site: siteName || void 0, aspect });
|
|
443
|
+
}, [endpoints, title, siteName, aspect, enabled]);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
exports.useImageEdgeColor = useImageEdgeColor; exports.byKey = byKey; exports.getPlatformProductionUrl = getPlatformProductionUrl; exports.getPlatformUrl = getPlatformUrl; exports.getDeploymentUrl = getDeploymentUrl; exports.isLocalUrl = isLocalUrl; exports.getRequestOrigin = getRequestOrigin; exports.resolveRedirectTarget = resolveRedirectTarget; exports.getAllPlatformBaseDomains = getAllPlatformBaseDomains; exports.isRelativeHref = isRelativeHref; exports.newTabRel = newTabRel; exports.newTabFeatures = newTabFeatures; exports.isModifierClick = isModifierClick; exports.stripSameOriginToPath = stripSameOriginToPath; exports.resolveExternalNavigation = resolveExternalNavigation; exports.isCrossOriginUrl = isCrossOriginUrl; exports.decideNewTab = decideNewTab; exports.isSameOriginAbsoluteHref = isSameOriginAbsoluteHref; exports.computeIsNewTab = computeIsNewTab; exports.navLinkTarget = navLinkTarget; exports.newTabAnchorAttrs = newTabAnchorAttrs; exports.buildAnchorProps = buildAnchorProps; exports.buildOgPlaceholderUrl = buildOgPlaceholderUrl; exports.useOgPlaceholderUrl = useOgPlaceholderUrl;
|