vue-layout-gitcode 1.12.43 → 1.12.45

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.
@@ -10424,52 +10424,6 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
10424
10424
  };
10425
10425
  }
10426
10426
  });
10427
- const FIRST_NAMESPACE_KEY = "parent_org_path";
10428
- const useBreadcrumb = () => {
10429
- const router2 = useRouter();
10430
- if (!router2) {
10431
- return computed(() => []);
10432
- }
10433
- const repoInfo = inject(
10434
- "repoInfo",
10435
- computed(() => ({}))
10436
- );
10437
- const breadcrumb = computed(() => {
10438
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
10439
- const isSubOrg = !!((_b = (_a = router2 == null ? void 0 : router2.currentRoute) == null ? void 0 : _a.value) == null ? void 0 : _b.params[FIRST_NAMESPACE_KEY]);
10440
- const full_name = ((_d = (_c = repoInfo.value) == null ? void 0 : _c.namespace) == null ? void 0 : _d.full_name) || "";
10441
- const name = ((_f = (_e = repoInfo.value) == null ? void 0 : _e.namespace) == null ? void 0 : _f.name) || "";
10442
- const orgName = isSubOrg ? full_name : name;
10443
- const repoName = ((_g = repoInfo.value) == null ? void 0 : _g.name) || "";
10444
- const breadcrumbList = [
10445
- {
10446
- label: orgName,
10447
- path: ""
10448
- },
10449
- {
10450
- label: repoName,
10451
- path: ""
10452
- }
10453
- ];
10454
- const params = cloneDeep((_i = (_h = router2.currentRoute) == null ? void 0 : _h.value) == null ? void 0 : _i.params);
10455
- if (isSubOrg) {
10456
- params.namespace = params[FIRST_NAMESPACE_KEY];
10457
- delete params[FIRST_NAMESPACE_KEY];
10458
- }
10459
- breadcrumbList[0].path = router2.resolve({
10460
- name: "homepage",
10461
- params
10462
- }).path;
10463
- breadcrumbList[breadcrumbList.length - 1].path = router2.resolve({
10464
- name: "repoDashboard",
10465
- params: {
10466
- ...(_k = (_j = router2.currentRoute) == null ? void 0 : _j.value) == null ? void 0 : _k.params
10467
- }
10468
- }).path;
10469
- return breadcrumbList;
10470
- });
10471
- return breadcrumb;
10472
- };
10473
10427
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
10474
10428
  function getDefaultExportFromCjs(x) {
10475
10429
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -10498,1134 +10452,66 @@ function getAugmentedNamespace(n) {
10498
10452
  });
10499
10453
  return a;
10500
10454
  }
10501
- var relativeTime$1 = { exports: {} };
10502
- (function(module, exports) {
10503
- !function(r, e) {
10504
- module.exports = e();
10505
- }(commonjsGlobal, function() {
10506
- return function(r, e, t2) {
10507
- r = r || {};
10508
- var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
10509
- function i(r2, e2, t3, o2) {
10510
- return n.fromToBase(r2, e2, t3, o2);
10455
+ var aes = { exports: {} };
10456
+ function commonjsRequire(path) {
10457
+ throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
10458
+ }
10459
+ var core = { exports: {} };
10460
+ const __viteBrowserExternal = {};
10461
+ const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10462
+ __proto__: null,
10463
+ default: __viteBrowserExternal
10464
+ }, Symbol.toStringTag, { value: "Module" }));
10465
+ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
10466
+ var hasRequiredCore;
10467
+ function requireCore() {
10468
+ if (hasRequiredCore) return core.exports;
10469
+ hasRequiredCore = 1;
10470
+ (function(module, exports) {
10471
+ (function(root, factory) {
10472
+ {
10473
+ module.exports = factory();
10511
10474
  }
10512
- t2.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
10513
- for (var f, a, s, l = i2.$locale().relativeTime || o, h2 = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h2.length, c = 0; c < m; c += 1) {
10514
- var y = h2[c];
10515
- y.d && (f = d2 ? t2(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
10516
- var p = (r.rounding || Math.round)(Math.abs(f));
10517
- if (s = f > 0, p <= y.r || !y.r) {
10518
- p <= 1 && c > 0 && (y = h2[c - 1]);
10519
- var v = l[y.l];
10520
- u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
10521
- break;
10522
- }
10475
+ })(commonjsGlobal, function() {
10476
+ var CryptoJS = CryptoJS || function(Math2, undefined$1) {
10477
+ var crypto;
10478
+ if (typeof window !== "undefined" && window.crypto) {
10479
+ crypto = window.crypto;
10523
10480
  }
10524
- if (n2) return a;
10525
- var M = s ? l.future : l.past;
10526
- return "function" == typeof M ? M(a) : M.replace("%s", a);
10527
- }, n.to = function(r2, e2) {
10528
- return i(r2, e2, this, true);
10529
- }, n.from = function(r2, e2) {
10530
- return i(r2, e2, this);
10531
- };
10532
- var d = function(r2) {
10533
- return r2.$u ? t2.utc() : t2();
10534
- };
10535
- n.toNow = function(r2) {
10536
- return this.to(d(this), r2);
10537
- }, n.fromNow = function(r2) {
10538
- return this.from(d(this), r2);
10539
- };
10540
- };
10541
- });
10542
- })(relativeTime$1);
10543
- var relativeTimeExports = relativeTime$1.exports;
10544
- const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
10545
- var zhCn = { exports: {} };
10546
- (function(module, exports) {
10547
- !function(e, _) {
10548
- module.exports = _(dayjs);
10549
- }(commonjsGlobal, function(e) {
10550
- function _(e2) {
10551
- return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
10552
- }
10553
- var t2 = _(e), d = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e2, _2) {
10554
- return "W" === _2 ? e2 + "周" : e2 + "日";
10555
- }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e2, _2) {
10556
- var t3 = 100 * e2 + _2;
10557
- return t3 < 600 ? "凌晨" : t3 < 900 ? "早上" : t3 < 1100 ? "上午" : t3 < 1300 ? "中午" : t3 < 1800 ? "下午" : "晚上";
10558
- } };
10559
- return t2.default.locale(d, null, true), d;
10560
- });
10561
- })(zhCn);
10562
- var zhCnExports = zhCn.exports;
10563
- const locale = /* @__PURE__ */ getDefaultExportFromCjs(zhCnExports);
10564
- var timezone = { exports: {} };
10565
- (function(module, exports) {
10566
- !function(t2, e) {
10567
- module.exports = e();
10568
- }(commonjsGlobal, function() {
10569
- var t2 = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
10570
- return function(n, i, o) {
10571
- var r, a = function(t3, n2, i2) {
10572
- void 0 === i2 && (i2 = {});
10573
- var o2 = new Date(t3), r2 = function(t4, n3) {
10574
- void 0 === n3 && (n3 = {});
10575
- var i3 = n3.timeZoneName || "short", o3 = t4 + "|" + i3, r3 = e[o3];
10576
- return r3 || (r3 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t4, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o3] = r3), r3;
10577
- }(n2, i2);
10578
- return r2.formatToParts(o2);
10579
- }, u = function(e2, n2) {
10580
- for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
10581
- var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t2[s2];
10582
- c >= 0 && (r2[c] = parseInt(m, 10));
10481
+ if (typeof self !== "undefined" && self.crypto) {
10482
+ crypto = self.crypto;
10583
10483
  }
10584
- var d = r2[3], l = 24 === d ? 0 : d, h2 = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", v = +e2;
10585
- return (o.utc(h2).valueOf() - (v -= v % 1e3)) / 6e4;
10586
- }, f = i.prototype;
10587
- f.tz = function(t3, e2) {
10588
- void 0 === t3 && (t3 = r);
10589
- var n2, i2 = this.utcOffset(), a2 = this.toDate(), u2 = a2.toLocaleString("en-US", { timeZone: t3 }), f2 = Math.round((a2 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a2.getTimezoneOffset() / 15) - f2;
10590
- if (!Number(s2)) n2 = this.utcOffset(0, e2);
10591
- else if (n2 = o(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
10592
- var m = n2.utcOffset();
10593
- n2 = n2.add(i2 - m, "minute");
10484
+ if (typeof globalThis !== "undefined" && globalThis.crypto) {
10485
+ crypto = globalThis.crypto;
10594
10486
  }
10595
- return n2.$x.$timezone = t3, n2;
10596
- }, f.offsetName = function(t3) {
10597
- var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t3 }).find(function(t4) {
10598
- return "timezonename" === t4.type.toLowerCase();
10599
- });
10600
- return n2 && n2.value;
10601
- };
10602
- var s = f.startOf;
10603
- f.startOf = function(t3, e2) {
10604
- if (!this.$x || !this.$x.$timezone) return s.call(this, t3, e2);
10605
- var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
10606
- return s.call(n2, t3, e2).tz(this.$x.$timezone, true);
10607
- }, o.tz = function(t3, e2, n2) {
10608
- var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
10609
- if ("string" != typeof t3) return o(t3).tz(a2);
10610
- var s2 = function(t4, e3, n3) {
10611
- var i3 = t4 - 60 * e3 * 1e3, o2 = u(i3, n3);
10612
- if (e3 === o2) return [i3, e3];
10613
- var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
10614
- return o2 === r2 ? [i3, o2] : [t4 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
10615
- }(o.utc(t3, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
10616
- return d.$x.$timezone = a2, d;
10617
- }, o.tz.guess = function() {
10618
- return Intl.DateTimeFormat().resolvedOptions().timeZone;
10619
- }, o.tz.setDefault = function(t3) {
10620
- r = t3;
10621
- };
10622
- };
10623
- });
10624
- })(timezone);
10625
- var timezoneExports = timezone.exports;
10626
- const tz = /* @__PURE__ */ getDefaultExportFromCjs(timezoneExports);
10627
- var utc$1 = { exports: {} };
10628
- (function(module, exports) {
10629
- !function(t2, i) {
10630
- module.exports = i();
10631
- }(commonjsGlobal, function() {
10632
- var t2 = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
10633
- return function(s, f, n) {
10634
- var u = f.prototype;
10635
- n.utc = function(t3) {
10636
- var i2 = { date: t3, utc: true, args: arguments };
10637
- return new f(i2);
10638
- }, u.utc = function(i2) {
10639
- var e2 = n(this.toDate(), { locale: this.$L, utc: true });
10640
- return i2 ? e2.add(this.utcOffset(), t2) : e2;
10641
- }, u.local = function() {
10642
- return n(this.toDate(), { locale: this.$L, utc: false });
10643
- };
10644
- var o = u.parse;
10645
- u.parse = function(t3) {
10646
- t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), o.call(this, t3);
10647
- };
10648
- var r = u.init;
10649
- u.init = function() {
10650
- if (this.$u) {
10651
- var t3 = this.$d;
10652
- this.$y = t3.getUTCFullYear(), this.$M = t3.getUTCMonth(), this.$D = t3.getUTCDate(), this.$W = t3.getUTCDay(), this.$H = t3.getUTCHours(), this.$m = t3.getUTCMinutes(), this.$s = t3.getUTCSeconds(), this.$ms = t3.getUTCMilliseconds();
10653
- } else r.call(this);
10654
- };
10655
- var a = u.utcOffset;
10656
- u.utcOffset = function(s2, f2) {
10657
- var n2 = this.$utils().u;
10658
- if (n2(s2)) return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
10659
- if ("string" == typeof s2 && (s2 = function(t3) {
10660
- void 0 === t3 && (t3 = "");
10661
- var s3 = t3.match(i);
10662
- if (!s3) return null;
10663
- var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
10664
- return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
10665
- }(s2), null === s2)) return this;
10666
- var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2, o2 = this;
10667
- if (f2) return o2.$offset = u2, o2.$u = 0 === s2, o2;
10668
- if (0 !== s2) {
10669
- var r2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
10670
- (o2 = this.local().add(u2 + r2, t2)).$offset = u2, o2.$x.$localOffset = r2;
10671
- } else o2 = this.utc();
10672
- return o2;
10673
- };
10674
- var h2 = u.format;
10675
- u.format = function(t3) {
10676
- var i2 = t3 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
10677
- return h2.call(this, i2);
10678
- }, u.valueOf = function() {
10679
- var t3 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
10680
- return this.$d.valueOf() - 6e4 * t3;
10681
- }, u.isUTC = function() {
10682
- return !!this.$u;
10683
- }, u.toISOString = function() {
10684
- return this.toDate().toISOString();
10685
- }, u.toString = function() {
10686
- return this.toDate().toUTCString();
10687
- };
10688
- var l = u.toDate;
10689
- u.toDate = function(t3) {
10690
- return "s" === t3 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
10691
- };
10692
- var c = u.diff;
10693
- u.diff = function(t3, i2, e2) {
10694
- if (t3 && this.$u === t3.$u) return c.call(this, t3, i2, e2);
10695
- var s2 = this.local(), f2 = n(t3).local();
10696
- return c.call(s2, f2, i2, e2);
10697
- };
10698
- };
10699
- });
10700
- })(utc$1);
10701
- var utcExports = utc$1.exports;
10702
- const utc = /* @__PURE__ */ getDefaultExportFromCjs(utcExports);
10703
- dayjs.locale(locale);
10704
- dayjs.extend(relativeTime);
10705
- dayjs.extend(tz);
10706
- dayjs.extend(utc);
10707
- dayjs.tz.setDefault("Asia/Shanghai");
10708
- const useTimeFormat = () => {
10709
- const formatTimeFromNow = (time) => {
10710
- if (!time) return "-";
10711
- const targetDate = isDate$1(time) ? time : new Date(time);
10712
- return formatTimeDifference(targetDate);
10713
- };
10714
- const formatTime = (time, format2) => {
10715
- if (!time) return "-";
10716
- return dayjs(time).format(format2);
10717
- };
10718
- return {
10719
- formatTimeFromNow,
10720
- formatTime
10721
- };
10722
- };
10723
- const _hoisted_1$F = {
10724
- key: 0,
10725
- class: "org-layout-toolbar"
10726
- };
10727
- const _hoisted_2$v = { class: "org-layout-toolbar-title ellipsis-two-line" };
10728
- const _hoisted_3$u = { class: "header-custom-btn-label" };
10729
- const _hoisted_4$n = { class: "g-repo-breadcrumb-custom" };
10730
- const _hoisted_5$i = {
10731
- key: 1,
10732
- class: "header-custom-mirrors-avatar"
10733
- };
10734
- const _hoisted_6$g = {
10735
- key: 0,
10736
- src: _imports_0,
10737
- alt: "mirrors-avatar-phone",
10738
- class: "header-custom-mirrors-img"
10739
- };
10740
- const _hoisted_7$d = {
10741
- key: 1,
10742
- src: "https://cdn-static.gitcode.com/static/images/mirrors-avata_20250411.gif",
10743
- alt: "mirrors-avatar",
10744
- class: "header-custom-mirrors-img-tall"
10745
- };
10746
- const _hoisted_8$b = { class: "g-repo-breadcrumb-container" };
10747
- const _hoisted_9$a = {
10748
- key: 0,
10749
- class: "header-custom-breadcrumb-row"
10750
- };
10751
- const _hoisted_10$9 = ["title"];
10752
- const _hoisted_11$7 = ["title"];
10753
- const _hoisted_12$7 = {
10754
- key: 0,
10755
- class: "header-custom-tag-mb"
10756
- };
10757
- const _hoisted_13$4 = {
10758
- key: 1,
10759
- class: "header-custom-tag-mb"
10760
- };
10761
- const _hoisted_14$2 = {
10762
- key: 2,
10763
- class: "header-custom-tag-mb"
10764
- };
10765
- const _hoisted_15$2 = {
10766
- key: 3,
10767
- class: "header-custom-tag-mb"
10768
- };
10769
- const _hoisted_16$2 = { class: "header-custom-topic-label" };
10770
- const _hoisted_17$2 = {
10771
- key: 5,
10772
- class: "topic-tag font-color-t2 gh_mirros_tag"
10773
- };
10774
- const _hoisted_18$2 = { class: "header-custom-topic-label" };
10775
- const _hoisted_19$2 = { class: "header-custom-skeleton" };
10776
- const _hoisted_20$2 = {
10777
- key: 2,
10778
- class: "user-layout-toolbar"
10779
- };
10780
- const _hoisted_21$2 = { class: "user-layout-toolbar-title ellipsis-two-line" };
10781
- const _hoisted_22$2 = { class: "header-custom-btn-label" };
10782
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
10783
- __name: "HeaderCustom",
10784
- props: {
10785
- scene: { default: SceneValue.home },
10786
- isLogin: { type: Boolean, default: false },
10787
- errorCode: { default: 0 },
10788
- orgProps: { default: () => ({}) },
10789
- repoProps: { default: () => ({}) },
10790
- userProps: { default: () => ({}) }
10791
- },
10792
- emits: ["followDevCommunity", "followUser"],
10793
- setup(__props, { emit: __emit }) {
10794
- const { t: t2 } = i18n.global;
10795
- const layoutConfig2 = useLayoutConfig();
10796
- const breadcrumb = useBreadcrumb();
10797
- console.log("breadcrumb", breadcrumb);
10798
- const breadcrumbRef = ref(null);
10799
- const breadcrumbTextRef = ref(null);
10800
- const breadcrumbNextRef = ref(null);
10801
- const breadcrumbNextTextRef = ref(null);
10802
- const { formatTimeFromNow } = useTimeFormat();
10803
- const props = __props;
10804
- const repoInfo = inject("repoInfo", computed(() => void 0));
10805
- console.log("repoInfo", repoInfo);
10806
- const orgInfo = inject("orgInfo", computed(() => void 0));
10807
- const otherUserInfo = inject("otherUserInfo", computed(() => void 0));
10808
- const emits = __emit;
10809
- const handleOrgFollow = (val) => {
10810
- if (props.scene !== SceneValue.org) return;
10811
- if (!props.isLogin) {
10812
- emitEvent("login", { triggerType: "关注组织", loginTriggerSource: "toolbar_org_follow" });
10813
- return;
10814
- }
10815
- emits("followDevCommunity", !val);
10816
- };
10817
- const topicTag = computed(() => {
10818
- var _a, _b;
10819
- if (props.scene !== SceneValue.repo) return false;
10820
- let repoType = 1;
10821
- repoType = Number((_a = repoInfo.value) == null ? void 0 : _a.repo_type) - 1;
10822
- if ((_b = props.repoProps) == null ? void 0 : _b.isSpaces) {
10823
- repoType = 2;
10824
- }
10825
- if (repoType < 0) {
10826
- return false;
10827
- }
10828
- const name = ["模型", "数据集", "Space"];
10829
- const icon = ["gt-line-Models", "gt-line-Datasets", "gt-line-space"];
10830
- const linkName = ["models", "datasets", "spaces"];
10831
- const linkUrl = ["/models", "/datasets", "/space"];
10832
- const suffix = ["Model", "Datasets", "Space"];
10833
- const obj = {
10834
- name: name[repoType],
10835
- icon: icon[repoType],
10836
- linkName: linkName[repoType],
10837
- linkUrl: linkUrl[repoType],
10838
- suffix: suffix[repoType]
10839
- };
10840
- return obj;
10841
- });
10842
- const isOrg = computed(() => {
10843
- var _a, _b;
10844
- if (props.scene === SceneValue.repo) {
10845
- return ((_b = (_a = repoInfo.value) == null ? void 0 : _a.namespace) == null ? void 0 : _b.kind) === "group";
10846
- }
10847
- return false;
10848
- });
10849
- const toAiHub = () => {
10850
- if (props.scene !== SceneValue.repo) return;
10851
- if (!topicTag.value) return;
10852
- const aiUrl = `${layoutConfig2.VITE_AI_HOST}${topicTag.value.linkUrl}`;
10853
- if (typeof window !== "undefined" && window.location) {
10854
- window.location.href = aiUrl;
10855
- }
10856
- };
10857
- const showTimeTopic = computed(() => {
10858
- var _a, _b;
10859
- if (props.scene !== SceneValue.repo) return false;
10860
- if (!((_a = repoInfo.value) == null ? void 0 : _a.last_repository_updated_at)) {
10861
- return false;
10862
- }
10863
- try {
10864
- return (/* @__PURE__ */ new Date()).getTime() - new Date((_b = repoInfo.value) == null ? void 0 : _b.last_repository_updated_at).getTime() < 7 * 24 * 60 * 60 * 1e3;
10865
- } catch (error) {
10866
- return false;
10867
- }
10868
- });
10869
- const formatTime = computed(() => {
10870
- var _a;
10871
- return formatTimeFromNow(((_a = repoInfo.value) == null ? void 0 : _a.last_repository_updated_at) || "");
10872
- });
10873
- const handleFollowUser = () => {
10874
- if (props.scene !== SceneValue.user) return;
10875
- emits("followUser");
10876
- };
10877
- const handleBreadcrumbCopy = (e) => {
10878
- const container = document.querySelector(".g-repo-breadcrumb-custom");
10879
- if (!container) return;
10880
- const selection = window.getSelection();
10881
- if (!selection || !selection.rangeCount) return;
10882
- const range = selection.getRangeAt(0);
10883
- const selectedText = selection.toString().trim();
10884
- const isSelectionInContainer = container.contains(range.startContainer) && container.contains(range.endContainer);
10885
- if (isSelectionInContainer && selectedText) {
10886
- e.preventDefault();
10887
- if (e.clipboardData) {
10888
- e.clipboardData.setData("text/plain", selectedText.replace(/\s+/g, ""));
10487
+ if (!crypto && typeof window !== "undefined" && window.msCrypto) {
10488
+ crypto = window.msCrypto;
10889
10489
  }
10890
- }
10891
- };
10892
- onMounted(() => {
10893
- document.addEventListener("copy", handleBreadcrumbCopy);
10894
- });
10895
- onUnmounted(() => {
10896
- document.removeEventListener("copy", handleBreadcrumbCopy);
10897
- });
10898
- return (_ctx, _cache) => {
10899
- var _a, _b, _c;
10900
- return _ctx.scene === unref(SceneValue).org && !_ctx.errorCode ? (openBlock(), createElementBlock("div", _hoisted_1$F, [
10901
- createVNode(GLink, {
10902
- href: ((_a = _ctx.orgProps) == null ? void 0 : _a.orgHomepageUrl) || "",
10903
- class: "header-custom-link"
10904
- }, {
10905
- default: withCtx(() => {
10906
- var _a2, _b2, _c2;
10907
- return [
10908
- createVNode(_sfc_main$N, {
10909
- class: "g-border",
10910
- src: ((_a2 = unref(orgInfo)) == null ? void 0 : _a2.avatar) || "",
10911
- name: ((_b2 = unref(orgInfo)) == null ? void 0 : _b2.name) || "",
10912
- width: 28,
10913
- height: 28,
10914
- is_round: false
10915
- }, null, 8, ["src", "name"]),
10916
- createElementVNode("div", _hoisted_2$v, toDisplayString$1((_c2 = unref(orgInfo)) == null ? void 0 : _c2.name), 1)
10917
- ];
10918
- }),
10919
- _: 1
10920
- }, 8, ["href"]),
10921
- createVNode(unref(Button), {
10922
- onClick: _cache[0] || (_cache[0] = ($event) => {
10923
- var _a2;
10924
- return handleOrgFollow((_a2 = _ctx.orgProps) == null ? void 0 : _a2.isOrgFollow);
10925
- }),
10926
- class: "org-layout-toolbar-follow"
10927
- }, {
10928
- default: withCtx(() => {
10929
- var _a2;
10930
- return [
10931
- createElementVNode("span", _hoisted_3$u, toDisplayString$1(((_a2 = _ctx.orgProps) == null ? void 0 : _a2.isOrgFollow) ? unref(t2)("gitCodeLayout.home.alreadyFollowed") : unref(t2)("gitCodeLayout.home.focusOn")), 1)
10932
- ];
10933
- }),
10934
- _: 1
10935
- })
10936
- ])) : _ctx.scene === unref(SceneValue).repo && !_ctx.errorCode ? (openBlock(), createBlock(unref(Skeleton), {
10937
- key: 1,
10938
- loading: (_b = _ctx.repoProps) == null ? void 0 : _b.repoNameLoading,
10939
- rows: 1
10940
- }, {
10941
- placeholder: withCtx(() => [
10942
- createElementVNode("div", _hoisted_19$2, [
10943
- createVNode(unref(SkeletonItem), {
10944
- round: "",
10945
- style: { "width": "30px", "height": "30px" }
10946
- }),
10947
- createVNode(unref(SkeletonItem), { style: { "margin-left": "12px", "width": "80px", "height": "24px" } })
10948
- ])
10949
- ]),
10950
- default: withCtx(() => {
10951
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
10952
- return [
10953
- createElementVNode("h2", _hoisted_4$n, [
10954
- createVNode(GLink, {
10955
- href: (_a2 = unref(breadcrumb)[0]) == null ? void 0 : _a2.path,
10956
- class: "header-custom-avatar-link"
10957
- }, {
10958
- default: withCtx(() => {
10959
- var _a3, _b3, _c3, _d2;
10960
- return [
10961
- !((_a3 = _ctx.repoProps) == null ? void 0 : _a3.isGhMirrors) ? (openBlock(), createBlock(_sfc_main$N, {
10962
- key: 0,
10963
- class: normalizeClass({ "g-border": isOrg.value }),
10964
- src: ((_c3 = (_b3 = unref(repoInfo)) == null ? void 0 : _b3.namespace) == null ? void 0 : _c3.avatar_url) || "",
10965
- name: ((_d2 = unref(repoInfo)) == null ? void 0 : _d2.name) || "",
10966
- width: 28,
10967
- height: 28,
10968
- is_round: !isOrg.value
10969
- }, null, 8, ["class", "src", "name", "is_round"])) : (openBlock(), createElementBlock("div", _hoisted_5$i, [
10970
- unref(isPhone)() ? (openBlock(), createElementBlock("img", _hoisted_6$g)) : (openBlock(), createElementBlock("img", _hoisted_7$d))
10971
- ]))
10972
- ];
10973
- }),
10974
- _: 1
10975
- }, 8, ["href"]),
10976
- createElementVNode("div", _hoisted_8$b, [
10977
- !((_b2 = _ctx.repoProps) == null ? void 0 : _b2.isGhMirrors) ? (openBlock(), createElementBlock("div", {
10978
- key: 0,
10979
- ref_key: "breadcrumbRef",
10980
- ref: breadcrumbRef,
10981
- class: "g-repo-layout-breadcrumb"
10982
- }, [
10983
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(breadcrumb), (item, index2) => {
10984
- return openBlock(), createElementBlock(Fragment, {
10985
- key: item.path
10986
- }, [
10987
- index2 !== unref(breadcrumb).length - 1 ? (openBlock(), createElementBlock("span", _hoisted_9$a, [
10988
- createVNode(GLink, {
10989
- class: "linkTx",
10990
- href: item.path
10991
- }, {
10992
- default: withCtx(() => [
10993
- createElementVNode("span", {
10994
- ref_for: true,
10995
- ref_key: "breadcrumbTextRef",
10996
- ref: breadcrumbTextRef,
10997
- title: item.label,
10998
- class: normalizeClass(["linkTx", index2 === unref(breadcrumb).length - 1 ? "header-custom-bold" : ""])
10999
- }, toDisplayString$1(item.label), 11, _hoisted_10$9)
11000
- ]),
11001
- _: 2
11002
- }, 1032, ["href"]),
11003
- _cache[1] || (_cache[1] = createElementVNode("span", { class: "breadcrumb-splitter font-color-t1" }, " / ", -1))
11004
- ])) : createCommentVNode("", true)
11005
- ], 64);
11006
- }), 128))
11007
- ], 512)) : createCommentVNode("", true),
11008
- unref(breadcrumb)[unref(breadcrumb).length - 1] ? (openBlock(), createElementBlock("div", {
11009
- key: 1,
11010
- ref_key: "breadcrumbNextRef",
11011
- ref: breadcrumbNextRef,
11012
- class: normalizeClass(["g-repo-layout-breadcrumb-next", [((_c2 = _ctx.repoProps) == null ? void 0 : _c2.isGhMirrors) ? "g-repo-layout-breadcrumb-next--full" : "g-repo-layout-breadcrumb-next--limit"]])
11013
- }, [
11014
- createVNode(GLink, {
11015
- class: "linkTx",
11016
- href: (_d = unref(breadcrumb)[unref(breadcrumb).length - 1]) == null ? void 0 : _d.path
11017
- }, {
11018
- default: withCtx(() => [
11019
- createElementVNode("span", {
11020
- ref_key: "breadcrumbNextTextRef",
11021
- ref: breadcrumbNextTextRef,
11022
- title: unref(breadcrumb)[unref(breadcrumb).length - 1].label,
11023
- class: "linkTx header-custom-bold"
11024
- }, toDisplayString$1(unref(breadcrumb)[unref(breadcrumb).length - 1].label), 9, _hoisted_11$7)
11025
- ]),
11026
- _: 1
11027
- }, 8, ["href"]),
11028
- unref(isGstarRepo)((_e = unref(repoInfo)) == null ? void 0 : _e.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_12$7, [
11029
- createVNode(_sfc_main$M, {
11030
- origin: "repo",
11031
- icon: "",
11032
- type: "gstar",
11033
- message: `G-Star ${unref(t2)("gitCodeLayout.GStar.project.graduation")}`
11034
- }, {
11035
- default: withCtx(() => _cache[2] || (_cache[2] = [
11036
- createTextVNode("G-Star ")
11037
- ])),
11038
- _: 1
11039
- }, 8, ["message"])
11040
- ])) : unref(isIncubationRepo)((_f = unref(repoInfo)) == null ? void 0 : _f.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_13$4, [
11041
- createVNode(_sfc_main$M, {
11042
- origin: "repo",
11043
- icon: "",
11044
- type: "incubation",
11045
- message: `G-Star ${unref(t2)("gitCodeLayout.GStar.project.incubation")}`
11046
- }, {
11047
- default: withCtx(() => _cache[3] || (_cache[3] = [
11048
- createTextVNode(" G-Star ")
11049
- ])),
11050
- _: 1
11051
- }, 8, ["message"])
11052
- ])) : createCommentVNode("", true),
11053
- unref(isTrustedRepo)((_g = unref(repoInfo)) == null ? void 0 : _g.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_14$2, [
11054
- createVNode(_sfc_main$M, {
11055
- trusted: "",
11056
- message: unref(t2)("gitCodeLayout.trusted.title"),
11057
- icon: "",
11058
- type: "trusted",
11059
- href: "/trusted"
11060
- }, null, 8, ["message"])
11061
- ])) : createCommentVNode("", true),
11062
- ((_h = _ctx.repoProps) == null ? void 0 : _h.isPrivate) ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
11063
- createVNode(GIcon, {
11064
- size: "16px",
11065
- class: "header-custom-lock-icon",
11066
- name: "gt-line-lock"
11067
- })
11068
- ])) : createCommentVNode("", true),
11069
- topicTag.value ? (openBlock(), createElementBlock("div", {
11070
- key: 4,
11071
- class: "topic-tag font-color-t2",
11072
- onClick: toAiHub
11073
- }, [
11074
- createVNode(GIcon, {
11075
- name: (_i = topicTag.value) == null ? void 0 : _i.icon,
11076
- color: "var(--devui-shape-icon-fill)",
11077
- class: "header-custom-topic-icon"
11078
- }, null, 8, ["name"]),
11079
- createElementVNode("span", _hoisted_16$2, toDisplayString$1((_j = topicTag.value) == null ? void 0 : _j.suffix), 1)
11080
- ])) : createCommentVNode("", true),
11081
- ((_k = _ctx.repoProps) == null ? void 0 : _k.isGhMirrors) && showTimeTopic.value && !unref(isPhone)() ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
11082
- createVNode(GIcon, {
11083
- name: "gt-line-time",
11084
- color: "var(--devui-shape-icon-fill)",
11085
- class: "header-custom-topic-icon"
11086
- }),
11087
- createElementVNode("span", _hoisted_18$2, toDisplayString$1(formatTime.value) + toDisplayString$1(unref(t2)("gitCodeLayout.repo.code.syncText")), 1)
11088
- ])) : createCommentVNode("", true)
11089
- ], 2)) : createCommentVNode("", true)
11090
- ])
11091
- ])
11092
- ];
11093
- }),
11094
- _: 1
11095
- }, 8, ["loading"])) : _ctx.scene === unref(SceneValue).user && ((_c = _ctx.userProps) == null ? void 0 : _c.isOtherUser) ? (openBlock(), createElementBlock("div", _hoisted_20$2, [
11096
- createVNode(GLink, {
11097
- to: { name: "homepage" },
11098
- class: "header-custom-link"
11099
- }, {
11100
- default: withCtx(() => {
11101
- var _a2, _b2, _c2, _d, _e;
11102
- return [
11103
- createVNode(_sfc_main$N, {
11104
- src: (_a2 = unref(otherUserInfo)) == null ? void 0 : _a2.avatarUrl,
11105
- name: ((_b2 = unref(otherUserInfo)) == null ? void 0 : _b2.name) || ((_c2 = unref(otherUserInfo)) == null ? void 0 : _c2.nickname),
11106
- width: 28,
11107
- height: 28
11108
- }, null, 8, ["src", "name"]),
11109
- createElementVNode("div", _hoisted_21$2, toDisplayString$1(((_d = unref(otherUserInfo)) == null ? void 0 : _d.name) || ((_e = unref(otherUserInfo)) == null ? void 0 : _e.nickname)), 1)
11110
- ];
11111
- }),
11112
- _: 1
11113
- }),
11114
- createVNode(unref(Button), {
11115
- onClick: handleFollowUser,
11116
- class: "user-layout-toolbar-follow"
11117
- }, {
11118
- default: withCtx(() => {
11119
- var _a2;
11120
- return [
11121
- createElementVNode("span", _hoisted_22$2, toDisplayString$1(((_a2 = unref(otherUserInfo)) == null ? void 0 : _a2.isFollow) ? unref(t2)("gitCodeLayout.org.following") : unref(t2)("gitCodeLayout.common.topic.attention")), 1)
11122
- ];
11123
- }),
11124
- _: 1
11125
- })
11126
- ])) : createCommentVNode("", true);
11127
- };
11128
- }
11129
- });
11130
- const HeaderCustom = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-vue-layout-gitcode"]]);
11131
- const _hoisted_1$E = ["src"];
11132
- const _sfc_main$K = /* @__PURE__ */ defineComponent({
11133
- ...{ name: "OperationEntry" },
11134
- __name: "OperationEntry",
11135
- setup(__props) {
11136
- const request = inject("request");
11137
- const API = asideRequest(request);
11138
- const headerEntryConfig = ref({
11139
- img_light: "",
11140
- img_dark: "",
11141
- url: ""
11142
- });
11143
- const handleClick = () => {
11144
- var _a;
11145
- window.open(`${transformUrl((_a = headerEntryConfig.value) == null ? void 0 : _a.url)}`, "_blank");
11146
- };
11147
- const img = computed(() => {
11148
- const { img_light, img_dark } = headerEntryConfig.value;
11149
- return (currentTheme.value === ThemeType.BLACK ? img_dark : img_light) || img_light;
11150
- });
11151
- const getHeaderEntryConfig = async () => {
11152
- var _a;
11153
- try {
11154
- const res = await API.getHeaderEntryConfig();
11155
- const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || {};
11156
- headerEntryConfig.value = {
11157
- img_light: data.img_light,
11158
- img_dark: data.img_dark,
11159
- url: data.url
11160
- };
11161
- } catch (error) {
11162
- console.error(error);
11163
- }
11164
- };
11165
- getHeaderEntryConfig();
11166
- return (_ctx, _cache) => {
11167
- return img.value && headerEntryConfig.value.url ? (openBlock(), createElementBlock("div", {
11168
- key: 0,
11169
- class: "operation-entry",
11170
- onClick: handleClick
11171
- }, [
11172
- createElementVNode("img", {
11173
- class: "operation-entry__img",
11174
- src: img.value,
11175
- alt: "operation-entry"
11176
- }, null, 8, _hoisted_1$E)
11177
- ])) : createCommentVNode("", true);
11178
- };
11179
- }
11180
- });
11181
- const OperationEntry = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-vue-layout-gitcode"]]);
11182
- const _hoisted_1$D = ["src"];
11183
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
11184
- __name: "ClaimPower",
11185
- props: {
11186
- config: {}
11187
- },
11188
- setup(__props) {
11189
- const props = __props;
11190
- const visible = computed(() => {
11191
- return props.config.visible;
11192
- });
11193
- const handleClick = () => {
11194
- console.log("handleClick");
11195
- window.open(props.config.jump_url, "_blank");
11196
- };
11197
- return (_ctx, _cache) => {
11198
- return visible.value ? (openBlock(), createElementBlock("div", {
11199
- key: 0,
11200
- class: "computing-power",
11201
- onClick: handleClick
11202
- }, [
11203
- createElementVNode("img", {
11204
- src: _ctx.config.logo_url,
11205
- alt: "claim power"
11206
- }, null, 8, _hoisted_1$D)
11207
- ])) : createCommentVNode("", true);
11208
- };
11209
- }
11210
- });
11211
- const ClaimPower = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-vue-layout-gitcode"]]);
11212
- const DEFAULT_APPLICATION_HOST = "https://gitcode.com";
11213
- function normalizeApplicationHost(host) {
11214
- return (host || DEFAULT_APPLICATION_HOST).replace(/\/+$/, "");
11215
- }
11216
- function getRoutePart(href, baseUrl) {
11217
- try {
11218
- const url = new URL(href || "/", `${baseUrl}/`);
11219
- return `${url.pathname || "/"}${url.search}${url.hash}`;
11220
- } catch {
11221
- const value = href.trim();
11222
- return value.startsWith("/") ? value : `/${value}`;
11223
- }
11224
- }
11225
- function toApplicationUrl(applicationHost, href) {
11226
- const host = normalizeApplicationHost(applicationHost);
11227
- return `${host}${getRoutePart(href, host)}`;
11228
- }
11229
- function toApplicationRoute(applicationHost, href) {
11230
- try {
11231
- const url = new URL(toApplicationUrl(applicationHost, href));
11232
- return `${url.pathname || "/"}${url.search}${url.hash}`;
11233
- } catch {
11234
- return null;
11235
- }
11236
- }
11237
- const HEADER_CREATE_MENU_PATHS = [
11238
- "/create?position=nav_top",
11239
- "/create/migrate?type=3",
11240
- "/models/create",
11241
- "/datasets/create",
11242
- "/space/create",
11243
- "/collections/create",
11244
- "/org/create"
11245
- ];
11246
- const HEADER_CREATE_ENTERPRISE_PATH = "/enterprises/new";
11247
- const _hoisted_1$C = { class: "g-header-create dashboard-create-menu" };
11248
- const _hoisted_2$u = ["title", "aria-label", "aria-expanded"];
11249
- const _hoisted_3$t = { class: "dashboard-create-menu__trigger-text" };
11250
- const _hoisted_4$m = ["aria-label"];
11251
- const _hoisted_5$h = {
11252
- key: 0,
11253
- class: "dashboard-create-menu__divider",
11254
- role: "separator"
11255
- };
11256
- const _hoisted_6$f = ["href", "onClick", "onKeydown"];
11257
- const _hoisted_7$c = { class: "dashboard-create-menu__title-row" };
11258
- const _hoisted_8$a = { class: "dashboard-create-menu__title" };
11259
- const _hoisted_9$9 = {
11260
- key: 0,
11261
- class: "dashboard-create-menu__desc"
11262
- };
11263
- const menuId = "gitcode-header-create-menu";
11264
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
11265
- ...{
11266
- name: "HeaderCreateMenu"
11267
- },
11268
- __name: "index",
11269
- props: {
11270
- dropdownVisible: { type: Boolean, default: false },
11271
- isCreateOrg: { type: Boolean, default: true },
11272
- isCreateEnterprise: { type: Boolean, default: true },
11273
- items: { default: void 0 },
11274
- onNavigate: { type: Function, default: void 0 }
11275
- },
11276
- emits: ["update:dropdownVisible", "navigate"],
11277
- setup(__props, { emit: __emit }) {
11278
- const props = __props;
11279
- const emit = __emit;
11280
- const { t: t2 } = i18n.global;
11281
- const layoutConfig2 = useLayoutConfig();
11282
- const route = useRoute();
11283
- const router2 = useRouter();
11284
- const triggerRef = ref(null);
11285
- const menuRef = ref(null);
11286
- const menuOpen = ref(false);
11287
- const defaultMenuItems = computed(() => {
11288
- const [repoPath, importPath, modelPath, datasetPath, spacePath, collectionPath, orgPath] = HEADER_CREATE_MENU_PATHS;
11289
- return [
11290
- {
11291
- key: "repo",
11292
- icon: "gt-a-Property1default",
11293
- label: t2("gitCodeLayout.header.createMenuRepository"),
11294
- href: toApplicationUrl(layoutConfig2.VITE_HOST, repoPath)
11295
- },
11296
- {
11297
- key: "import-repository",
11298
- icon: "gt-a-plane-fileinport",
11299
- label: t2("gitCodeLayout.header.createMenuImportRepository"),
11300
- href: toApplicationUrl(layoutConfig2.VITE_HOST, importPath)
11301
- },
11302
- {
11303
- key: "model",
11304
- icon: "gt-plane-Models",
11305
- label: t2("gitCodeLayout.header.createMenuModel"),
11306
- href: toApplicationUrl(layoutConfig2.VITE_HOST, modelPath)
11307
- },
11308
- {
11309
- key: "dataset",
11310
- icon: "gt-plane-Datasets",
11311
- label: t2("gitCodeLayout.header.createMenuDataset"),
11312
- href: toApplicationUrl(layoutConfig2.VITE_HOST, datasetPath)
11313
- },
11314
- {
11315
- key: "space",
11316
- icon: "gt-plane-Space",
11317
- label: t2("gitCodeLayout.header.createMenuSpace"),
11318
- href: toApplicationUrl(layoutConfig2.VITE_HOST, spacePath)
11319
- },
11320
- {
11321
- key: "collection",
11322
- icon: "gt-a-dashujuyufenxishuxing1guan",
11323
- label: t2("gitCodeLayout.header.createMenuCollection"),
11324
- href: toApplicationUrl(layoutConfig2.VITE_HOST, collectionPath)
11325
- },
11326
- {
11327
- key: "organization",
11328
- icon: "gt-plane-organization",
11329
- label: t2("gitCodeLayout.header.createMenuOrganization"),
11330
- href: toApplicationUrl(layoutConfig2.VITE_HOST, orgPath),
11331
- dividerBefore: true
11332
- }
11333
- ];
11334
- });
11335
- const enterpriseMenuItem = {
11336
- key: "enterprise",
11337
- icon: "gt-a-plane-enterprise",
11338
- label: t2("gitCodeLayout.header.createMenuEnterprise"),
11339
- href: toApplicationUrl(layoutConfig2.VITE_HOST, HEADER_CREATE_ENTERPRISE_PATH),
11340
- useHref: true
11341
- };
11342
- const menuItems = computed(() => {
11343
- const baseItems = props.items || defaultMenuItems.value;
11344
- const items = props.isCreateOrg ? baseItems : baseItems.filter((item) => item.key !== "organization");
11345
- return props.isCreateEnterprise ? [...items, enterpriseMenuItem] : items;
11346
- });
11347
- function getMenuItems() {
11348
- var _a;
11349
- return Array.from(((_a = menuRef.value) == null ? void 0 : _a.querySelectorAll('[role="menuitem"]')) || []);
11350
- }
11351
- function focusMenuItem(index2) {
11352
- void nextTick(() => {
11353
- var _a;
11354
- const items = getMenuItems();
11355
- if (!items.length) return;
11356
- const safeIndex = Math.min(Math.max(index2, 0), items.length - 1);
11357
- (_a = items[safeIndex]) == null ? void 0 : _a.focus();
11358
- });
11359
- }
11360
- function closeMenu(restoreFocus = false) {
11361
- if (!menuOpen.value) return;
11362
- menuOpen.value = false;
11363
- emit("update:dropdownVisible", false);
11364
- if (restoreFocus) {
11365
- void nextTick(() => {
11366
- var _a;
11367
- return (_a = triggerRef.value) == null ? void 0 : _a.focus();
11368
- });
11369
- }
11370
- }
11371
- const handleToggle = (value) => {
11372
- if (menuOpen.value === value) return;
11373
- menuOpen.value = value;
11374
- emit("update:dropdownVisible", value);
11375
- };
11376
- function onTriggerKeydown(event) {
11377
- if (event.key === "ArrowDown") {
11378
- event.preventDefault();
11379
- menuOpen.value = true;
11380
- emit("update:dropdownVisible", true);
11381
- focusMenuItem(0);
11382
- } else if (event.key === "ArrowUp") {
11383
- event.preventDefault();
11384
- menuOpen.value = true;
11385
- emit("update:dropdownVisible", true);
11386
- focusMenuItem(menuItems.value.length - 1);
11387
- } else if (event.key === "Escape") {
11388
- event.preventDefault();
11389
- closeMenu(true);
11390
- }
11391
- }
11392
- function onMenuItemKeydown(event, index2) {
11393
- if (event.key === "ArrowDown") {
11394
- event.preventDefault();
11395
- focusMenuItem((index2 + 1) % menuItems.value.length);
11396
- } else if (event.key === "ArrowUp") {
11397
- event.preventDefault();
11398
- focusMenuItem((index2 - 1 + menuItems.value.length) % menuItems.value.length);
11399
- } else if (event.key === "Home") {
11400
- event.preventDefault();
11401
- focusMenuItem(0);
11402
- } else if (event.key === "End") {
11403
- event.preventDefault();
11404
- focusMenuItem(menuItems.value.length - 1);
11405
- } else if (event.key === "Escape") {
11406
- event.preventDefault();
11407
- closeMenu(true);
11408
- } else if (event.key === " ") {
11409
- event.preventDefault();
11410
- if (event.currentTarget instanceof HTMLElement) event.currentTarget.click();
11411
- }
11412
- }
11413
- function stripRouterBase(route2) {
11414
- const base = router2.options.history.base;
11415
- if (!base || base === "/") return route2;
11416
- if (route2 === base) return "/";
11417
- return route2.startsWith(`${base}/`) ? route2.slice(base.length) : route2;
11418
- }
11419
- function navigateTo(href) {
11420
- const applicationHref = toApplicationUrl(layoutConfig2.VITE_HOST, href);
11421
- const applicationRoute = toApplicationRoute(layoutConfig2.VITE_HOST, href);
11422
- if (!applicationRoute) return;
11423
- if (typeof window !== "undefined") {
11424
- const applicationUrl = new URL(applicationHref);
11425
- if (applicationUrl.origin !== window.location.origin) {
11426
- window.location.href = applicationHref;
11427
- return;
11428
- }
11429
- } else {
11430
- void router2.push(stripRouterBase(applicationRoute));
11431
- return;
11432
- }
11433
- void router2.push(stripRouterBase(applicationRoute));
11434
- }
11435
- async function selectCreateItem(item) {
11436
- closeMenu();
11437
- emit("navigate", item);
11438
- if (item.useHref) {
11439
- if (typeof window !== "undefined") {
11440
- window.location.href = toApplicationUrl(layoutConfig2.VITE_HOST, item.href);
11441
- }
11442
- return;
11443
- }
11444
- if (props.onNavigate) {
11445
- await props.onNavigate(item);
11446
- return;
11447
- }
11448
- navigateTo(item.href);
11449
- }
11450
- watch(
11451
- () => props.dropdownVisible,
11452
- (visible) => {
11453
- menuOpen.value = visible;
11454
- },
11455
- { immediate: true }
11456
- );
11457
- watch(
11458
- () => route == null ? void 0 : route.fullPath,
11459
- () => closeMenu()
11460
- );
11461
- return (_ctx, _cache) => {
11462
- return openBlock(), createElementBlock("div", _hoisted_1$C, [
11463
- createVNode(unref(Dropdown), {
11464
- position: ["bottom-end", "bottom-start"],
11465
- "destroy-on-hide": false,
11466
- trigger: "hover",
11467
- offset: { mainAxis: 4, crossAxis: 0 },
11468
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
11469
- }, ["stop"])),
11470
- "overlay-class": "dashboard-create-dropdown",
11471
- visible: menuOpen.value,
11472
- onToggle: handleToggle
11473
- }, {
11474
- menu: withCtx(() => [
11475
- createElementVNode("div", {
11476
- id: menuId,
11477
- ref_key: "menuRef",
11478
- ref: menuRef,
11479
- class: "dashboard-create-menu__panel",
11480
- role: "menu",
11481
- "aria-label": unref(t2)("gitCodeLayout.header.create")
11482
- }, [
11483
- (openBlock(true), createElementBlock(Fragment, null, renderList(menuItems.value, (item, index2) => {
11484
- return openBlock(), createElementBlock(Fragment, {
11485
- key: item.key
11486
- }, [
11487
- item.dividerBefore ? (openBlock(), createElementBlock("div", _hoisted_5$h)) : createCommentVNode("", true),
11488
- createElementVNode("a", {
11489
- href: unref(toApplicationUrl)(unref(layoutConfig2).VITE_HOST, item.href),
11490
- class: normalizeClass(["dashboard-create-menu__item", { "dashboard-create-menu__item--with-desc": Boolean(item.desc) }]),
11491
- role: "menuitem",
11492
- tabindex: "-1",
11493
- onClick: withModifiers(($event) => selectCreateItem(item), ["prevent"]),
11494
- onKeydown: ($event) => onMenuItemKeydown($event, index2)
11495
- }, [
11496
- createElementVNode("div", _hoisted_7$c, [
11497
- createVNode(GIcon, {
11498
- name: item.icon,
11499
- size: "16px",
11500
- color: "currentColor",
11501
- class: "dashboard-create-menu__icon",
11502
- "aria-hidden": "true"
11503
- }, null, 8, ["name"]),
11504
- createElementVNode("span", _hoisted_8$a, toDisplayString$1(item.label), 1)
11505
- ]),
11506
- item.desc ? (openBlock(), createElementBlock("div", _hoisted_9$9, toDisplayString$1(item.desc), 1)) : createCommentVNode("", true)
11507
- ], 42, _hoisted_6$f)
11508
- ], 64);
11509
- }), 128))
11510
- ], 8, _hoisted_4$m)
11511
- ]),
11512
- default: withCtx(() => [
11513
- createElementVNode("button", {
11514
- id: "guide-step3",
11515
- ref_key: "triggerRef",
11516
- ref: triggerRef,
11517
- type: "button",
11518
- class: "dashboard-create-menu__trigger dashboard-create-menu__trigger--header",
11519
- title: unref(t2)("gitCodeLayout.header.create"),
11520
- "aria-label": unref(t2)("gitCodeLayout.header.create"),
11521
- "aria-expanded": menuOpen.value,
11522
- "aria-controls": menuId,
11523
- "aria-haspopup": "menu",
11524
- onKeydown: onTriggerKeydown
11525
- }, [
11526
- createVNode(GIcon, {
11527
- name: "gt-add",
11528
- size: "16px",
11529
- color: "var(--theme-light-text)",
11530
- class: "dashboard-create-menu__trigger-icon",
11531
- "aria-hidden": "true"
11532
- }),
11533
- createElementVNode("span", _hoisted_3$t, toDisplayString$1(unref(t2)("gitCodeLayout.header.create")), 1)
11534
- ], 40, _hoisted_2$u)
11535
- ]),
11536
- _: 1
11537
- }, 8, ["visible"])
11538
- ]);
11539
- };
11540
- }
11541
- });
11542
- const HeaderCreateMenu = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-vue-layout-gitcode"]]);
11543
- const _sfc_main$H = /* @__PURE__ */ defineComponent({
11544
- ...{
11545
- name: "DocumentCenter"
11546
- },
11547
- __name: "DocumentCenter",
11548
- props: {
11549
- whiteColor: { type: Boolean, default: false }
11550
- },
11551
- setup(__props) {
11552
- const { t: t2 } = i18n.global;
11553
- return (_ctx, _cache) => {
11554
- return openBlock(), createBlock(GLink, {
11555
- variant: "text",
11556
- class: normalizeClass(["g-toolbar-docs", _ctx.whiteColor ? "white" : "black"]),
11557
- href: unref(currentHelpDocsAiCommunityUrl)(),
11558
- target: "_blank"
11559
- }, {
11560
- default: withCtx(() => [
11561
- createTextVNode(toDisplayString$1(unref(t2)("gitCodeLayout.header.aihub.documentCenter")), 1)
11562
- ]),
11563
- _: 1
11564
- }, 8, ["class", "href"]);
11565
- };
11566
- }
11567
- });
11568
- const DocumentCenter = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-vue-layout-gitcode"]]);
11569
- var aes = { exports: {} };
11570
- function commonjsRequire(path) {
11571
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
11572
- }
11573
- var core = { exports: {} };
11574
- const __viteBrowserExternal = {};
11575
- const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11576
- __proto__: null,
11577
- default: __viteBrowserExternal
11578
- }, Symbol.toStringTag, { value: "Module" }));
11579
- const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
11580
- var hasRequiredCore;
11581
- function requireCore() {
11582
- if (hasRequiredCore) return core.exports;
11583
- hasRequiredCore = 1;
11584
- (function(module, exports) {
11585
- (function(root, factory) {
11586
- {
11587
- module.exports = factory();
11588
- }
11589
- })(commonjsGlobal, function() {
11590
- var CryptoJS = CryptoJS || function(Math2, undefined$1) {
11591
- var crypto;
11592
- if (typeof window !== "undefined" && window.crypto) {
11593
- crypto = window.crypto;
11594
- }
11595
- if (typeof self !== "undefined" && self.crypto) {
11596
- crypto = self.crypto;
11597
- }
11598
- if (typeof globalThis !== "undefined" && globalThis.crypto) {
11599
- crypto = globalThis.crypto;
11600
- }
11601
- if (!crypto && typeof window !== "undefined" && window.msCrypto) {
11602
- crypto = window.msCrypto;
11603
- }
11604
- if (!crypto && typeof commonjsGlobal !== "undefined" && commonjsGlobal.crypto) {
11605
- crypto = commonjsGlobal.crypto;
11606
- }
11607
- if (!crypto && typeof commonjsRequire === "function") {
11608
- try {
11609
- crypto = require$$0;
11610
- } catch (err) {
11611
- }
11612
- }
11613
- var cryptoSecureRandomInt = function() {
11614
- if (crypto) {
11615
- if (typeof crypto.getRandomValues === "function") {
11616
- try {
11617
- return crypto.getRandomValues(new Uint32Array(1))[0];
11618
- } catch (err) {
11619
- }
11620
- }
11621
- if (typeof crypto.randomBytes === "function") {
11622
- try {
11623
- return crypto.randomBytes(4).readInt32LE();
11624
- } catch (err) {
11625
- }
11626
- }
11627
- }
11628
- throw new Error("Native crypto module could not be used to get secure random number.");
10490
+ if (!crypto && typeof commonjsGlobal !== "undefined" && commonjsGlobal.crypto) {
10491
+ crypto = commonjsGlobal.crypto;
10492
+ }
10493
+ if (!crypto && typeof commonjsRequire === "function") {
10494
+ try {
10495
+ crypto = require$$0;
10496
+ } catch (err) {
10497
+ }
10498
+ }
10499
+ var cryptoSecureRandomInt = function() {
10500
+ if (crypto) {
10501
+ if (typeof crypto.getRandomValues === "function") {
10502
+ try {
10503
+ return crypto.getRandomValues(new Uint32Array(1))[0];
10504
+ } catch (err) {
10505
+ }
10506
+ }
10507
+ if (typeof crypto.randomBytes === "function") {
10508
+ try {
10509
+ return crypto.randomBytes(4).readInt32LE();
10510
+ } catch (err) {
10511
+ }
10512
+ }
10513
+ }
10514
+ throw new Error("Native crypto module could not be used to get secure random number.");
11629
10515
  };
11630
10516
  var create2 = Object.create || /* @__PURE__ */ function() {
11631
10517
  function F() {
@@ -13999,32 +12885,1229 @@ function headRequest(request) {
13999
12885
  "X-Source": getLoginTriggerSource()
14000
12886
  }
14001
12887
  })
14002
- );
14003
- },
14004
- getProjectIssuePrInfo() {
14005
- return reqCatchV2(
14006
- () => request({
14007
- url: "/api/v2/projects/profile/project_issue_pr_info",
14008
- method: "get"
12888
+ );
12889
+ },
12890
+ getProjectIssuePrInfo() {
12891
+ return reqCatchV2(
12892
+ () => request({
12893
+ url: "/api/v2/projects/profile/project_issue_pr_info",
12894
+ method: "get"
12895
+ })
12896
+ );
12897
+ },
12898
+ // 获取主题菜单
12899
+ getThemeConfigList() {
12900
+ return reqCatch(() => request({
12901
+ url: `/aihub/api/v1/theme/label/config/list`,
12902
+ method: "get"
12903
+ }));
12904
+ },
12905
+ // 获取今日技术历史
12906
+ getTodayTechHistory() {
12907
+ return reqCatch(() => request({
12908
+ url: `/uc/api/v1/operation/tech-history`,
12909
+ method: "get"
12910
+ }));
12911
+ },
12912
+ // 查询是否是组织归属企业的企业成员
12913
+ getMemberByEnterprise(params) {
12914
+ return reqCatch(() => request({
12915
+ url: `/api/v2/ac/auth/enterprises/${params.enterpriseId}`,
12916
+ method: "get"
12917
+ }, {
12918
+ customError: true
12919
+ }));
12920
+ }
12921
+ };
12922
+ }
12923
+ const FIRST_NAMESPACE_KEY = "parent_org_path";
12924
+ const useBreadcrumb = () => {
12925
+ const router2 = useRouter();
12926
+ if (!router2) {
12927
+ return computed(() => []);
12928
+ }
12929
+ const repoInfo = inject(
12930
+ "repoInfo",
12931
+ computed(() => ({}))
12932
+ );
12933
+ const breadcrumb = computed(() => {
12934
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
12935
+ const isSubOrg = !!((_b = (_a = router2 == null ? void 0 : router2.currentRoute) == null ? void 0 : _a.value) == null ? void 0 : _b.params[FIRST_NAMESPACE_KEY]);
12936
+ const full_name = ((_d = (_c = repoInfo.value) == null ? void 0 : _c.namespace) == null ? void 0 : _d.full_name) || "";
12937
+ const name = ((_f = (_e = repoInfo.value) == null ? void 0 : _e.namespace) == null ? void 0 : _f.name) || "";
12938
+ const orgName = isSubOrg ? full_name : name;
12939
+ const repoName = ((_g = repoInfo.value) == null ? void 0 : _g.name) || "";
12940
+ const breadcrumbList = [
12941
+ {
12942
+ label: orgName,
12943
+ path: ""
12944
+ },
12945
+ {
12946
+ label: repoName,
12947
+ path: ""
12948
+ }
12949
+ ];
12950
+ const params = cloneDeep((_i = (_h = router2.currentRoute) == null ? void 0 : _h.value) == null ? void 0 : _i.params);
12951
+ if (isSubOrg) {
12952
+ params.namespace = params[FIRST_NAMESPACE_KEY];
12953
+ delete params[FIRST_NAMESPACE_KEY];
12954
+ }
12955
+ breadcrumbList[0].path = router2.resolve({
12956
+ name: "homepage",
12957
+ params
12958
+ }).path;
12959
+ breadcrumbList[breadcrumbList.length - 1].path = router2.resolve({
12960
+ name: "repoDashboard",
12961
+ params: {
12962
+ ...(_k = (_j = router2.currentRoute) == null ? void 0 : _j.value) == null ? void 0 : _k.params
12963
+ }
12964
+ }).path;
12965
+ return breadcrumbList;
12966
+ });
12967
+ return breadcrumb;
12968
+ };
12969
+ var relativeTime$1 = { exports: {} };
12970
+ (function(module, exports) {
12971
+ !function(r, e) {
12972
+ module.exports = e();
12973
+ }(commonjsGlobal, function() {
12974
+ return function(r, e, t2) {
12975
+ r = r || {};
12976
+ var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
12977
+ function i(r2, e2, t3, o2) {
12978
+ return n.fromToBase(r2, e2, t3, o2);
12979
+ }
12980
+ t2.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
12981
+ for (var f, a, s, l = i2.$locale().relativeTime || o, h2 = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h2.length, c = 0; c < m; c += 1) {
12982
+ var y = h2[c];
12983
+ y.d && (f = d2 ? t2(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
12984
+ var p = (r.rounding || Math.round)(Math.abs(f));
12985
+ if (s = f > 0, p <= y.r || !y.r) {
12986
+ p <= 1 && c > 0 && (y = h2[c - 1]);
12987
+ var v = l[y.l];
12988
+ u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
12989
+ break;
12990
+ }
12991
+ }
12992
+ if (n2) return a;
12993
+ var M = s ? l.future : l.past;
12994
+ return "function" == typeof M ? M(a) : M.replace("%s", a);
12995
+ }, n.to = function(r2, e2) {
12996
+ return i(r2, e2, this, true);
12997
+ }, n.from = function(r2, e2) {
12998
+ return i(r2, e2, this);
12999
+ };
13000
+ var d = function(r2) {
13001
+ return r2.$u ? t2.utc() : t2();
13002
+ };
13003
+ n.toNow = function(r2) {
13004
+ return this.to(d(this), r2);
13005
+ }, n.fromNow = function(r2) {
13006
+ return this.from(d(this), r2);
13007
+ };
13008
+ };
13009
+ });
13010
+ })(relativeTime$1);
13011
+ var relativeTimeExports = relativeTime$1.exports;
13012
+ const relativeTime = /* @__PURE__ */ getDefaultExportFromCjs(relativeTimeExports);
13013
+ var zhCn = { exports: {} };
13014
+ (function(module, exports) {
13015
+ !function(e, _) {
13016
+ module.exports = _(dayjs);
13017
+ }(commonjsGlobal, function(e) {
13018
+ function _(e2) {
13019
+ return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
13020
+ }
13021
+ var t2 = _(e), d = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e2, _2) {
13022
+ return "W" === _2 ? e2 + "周" : e2 + "日";
13023
+ }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e2, _2) {
13024
+ var t3 = 100 * e2 + _2;
13025
+ return t3 < 600 ? "凌晨" : t3 < 900 ? "早上" : t3 < 1100 ? "上午" : t3 < 1300 ? "中午" : t3 < 1800 ? "下午" : "晚上";
13026
+ } };
13027
+ return t2.default.locale(d, null, true), d;
13028
+ });
13029
+ })(zhCn);
13030
+ var zhCnExports = zhCn.exports;
13031
+ const locale = /* @__PURE__ */ getDefaultExportFromCjs(zhCnExports);
13032
+ var timezone = { exports: {} };
13033
+ (function(module, exports) {
13034
+ !function(t2, e) {
13035
+ module.exports = e();
13036
+ }(commonjsGlobal, function() {
13037
+ var t2 = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
13038
+ return function(n, i, o) {
13039
+ var r, a = function(t3, n2, i2) {
13040
+ void 0 === i2 && (i2 = {});
13041
+ var o2 = new Date(t3), r2 = function(t4, n3) {
13042
+ void 0 === n3 && (n3 = {});
13043
+ var i3 = n3.timeZoneName || "short", o3 = t4 + "|" + i3, r3 = e[o3];
13044
+ return r3 || (r3 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t4, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o3] = r3), r3;
13045
+ }(n2, i2);
13046
+ return r2.formatToParts(o2);
13047
+ }, u = function(e2, n2) {
13048
+ for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
13049
+ var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t2[s2];
13050
+ c >= 0 && (r2[c] = parseInt(m, 10));
13051
+ }
13052
+ var d = r2[3], l = 24 === d ? 0 : d, h2 = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", v = +e2;
13053
+ return (o.utc(h2).valueOf() - (v -= v % 1e3)) / 6e4;
13054
+ }, f = i.prototype;
13055
+ f.tz = function(t3, e2) {
13056
+ void 0 === t3 && (t3 = r);
13057
+ var n2, i2 = this.utcOffset(), a2 = this.toDate(), u2 = a2.toLocaleString("en-US", { timeZone: t3 }), f2 = Math.round((a2 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a2.getTimezoneOffset() / 15) - f2;
13058
+ if (!Number(s2)) n2 = this.utcOffset(0, e2);
13059
+ else if (n2 = o(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
13060
+ var m = n2.utcOffset();
13061
+ n2 = n2.add(i2 - m, "minute");
13062
+ }
13063
+ return n2.$x.$timezone = t3, n2;
13064
+ }, f.offsetName = function(t3) {
13065
+ var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t3 }).find(function(t4) {
13066
+ return "timezonename" === t4.type.toLowerCase();
13067
+ });
13068
+ return n2 && n2.value;
13069
+ };
13070
+ var s = f.startOf;
13071
+ f.startOf = function(t3, e2) {
13072
+ if (!this.$x || !this.$x.$timezone) return s.call(this, t3, e2);
13073
+ var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
13074
+ return s.call(n2, t3, e2).tz(this.$x.$timezone, true);
13075
+ }, o.tz = function(t3, e2, n2) {
13076
+ var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
13077
+ if ("string" != typeof t3) return o(t3).tz(a2);
13078
+ var s2 = function(t4, e3, n3) {
13079
+ var i3 = t4 - 60 * e3 * 1e3, o2 = u(i3, n3);
13080
+ if (e3 === o2) return [i3, e3];
13081
+ var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
13082
+ return o2 === r2 ? [i3, o2] : [t4 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
13083
+ }(o.utc(t3, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
13084
+ return d.$x.$timezone = a2, d;
13085
+ }, o.tz.guess = function() {
13086
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
13087
+ }, o.tz.setDefault = function(t3) {
13088
+ r = t3;
13089
+ };
13090
+ };
13091
+ });
13092
+ })(timezone);
13093
+ var timezoneExports = timezone.exports;
13094
+ const tz = /* @__PURE__ */ getDefaultExportFromCjs(timezoneExports);
13095
+ var utc$1 = { exports: {} };
13096
+ (function(module, exports) {
13097
+ !function(t2, i) {
13098
+ module.exports = i();
13099
+ }(commonjsGlobal, function() {
13100
+ var t2 = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
13101
+ return function(s, f, n) {
13102
+ var u = f.prototype;
13103
+ n.utc = function(t3) {
13104
+ var i2 = { date: t3, utc: true, args: arguments };
13105
+ return new f(i2);
13106
+ }, u.utc = function(i2) {
13107
+ var e2 = n(this.toDate(), { locale: this.$L, utc: true });
13108
+ return i2 ? e2.add(this.utcOffset(), t2) : e2;
13109
+ }, u.local = function() {
13110
+ return n(this.toDate(), { locale: this.$L, utc: false });
13111
+ };
13112
+ var o = u.parse;
13113
+ u.parse = function(t3) {
13114
+ t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), o.call(this, t3);
13115
+ };
13116
+ var r = u.init;
13117
+ u.init = function() {
13118
+ if (this.$u) {
13119
+ var t3 = this.$d;
13120
+ this.$y = t3.getUTCFullYear(), this.$M = t3.getUTCMonth(), this.$D = t3.getUTCDate(), this.$W = t3.getUTCDay(), this.$H = t3.getUTCHours(), this.$m = t3.getUTCMinutes(), this.$s = t3.getUTCSeconds(), this.$ms = t3.getUTCMilliseconds();
13121
+ } else r.call(this);
13122
+ };
13123
+ var a = u.utcOffset;
13124
+ u.utcOffset = function(s2, f2) {
13125
+ var n2 = this.$utils().u;
13126
+ if (n2(s2)) return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
13127
+ if ("string" == typeof s2 && (s2 = function(t3) {
13128
+ void 0 === t3 && (t3 = "");
13129
+ var s3 = t3.match(i);
13130
+ if (!s3) return null;
13131
+ var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
13132
+ return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
13133
+ }(s2), null === s2)) return this;
13134
+ var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2, o2 = this;
13135
+ if (f2) return o2.$offset = u2, o2.$u = 0 === s2, o2;
13136
+ if (0 !== s2) {
13137
+ var r2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
13138
+ (o2 = this.local().add(u2 + r2, t2)).$offset = u2, o2.$x.$localOffset = r2;
13139
+ } else o2 = this.utc();
13140
+ return o2;
13141
+ };
13142
+ var h2 = u.format;
13143
+ u.format = function(t3) {
13144
+ var i2 = t3 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
13145
+ return h2.call(this, i2);
13146
+ }, u.valueOf = function() {
13147
+ var t3 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
13148
+ return this.$d.valueOf() - 6e4 * t3;
13149
+ }, u.isUTC = function() {
13150
+ return !!this.$u;
13151
+ }, u.toISOString = function() {
13152
+ return this.toDate().toISOString();
13153
+ }, u.toString = function() {
13154
+ return this.toDate().toUTCString();
13155
+ };
13156
+ var l = u.toDate;
13157
+ u.toDate = function(t3) {
13158
+ return "s" === t3 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
13159
+ };
13160
+ var c = u.diff;
13161
+ u.diff = function(t3, i2, e2) {
13162
+ if (t3 && this.$u === t3.$u) return c.call(this, t3, i2, e2);
13163
+ var s2 = this.local(), f2 = n(t3).local();
13164
+ return c.call(s2, f2, i2, e2);
13165
+ };
13166
+ };
13167
+ });
13168
+ })(utc$1);
13169
+ var utcExports = utc$1.exports;
13170
+ const utc = /* @__PURE__ */ getDefaultExportFromCjs(utcExports);
13171
+ dayjs.locale(locale);
13172
+ dayjs.extend(relativeTime);
13173
+ dayjs.extend(tz);
13174
+ dayjs.extend(utc);
13175
+ dayjs.tz.setDefault("Asia/Shanghai");
13176
+ const useTimeFormat = () => {
13177
+ const formatTimeFromNow = (time) => {
13178
+ if (!time) return "-";
13179
+ const targetDate = isDate$1(time) ? time : new Date(time);
13180
+ return formatTimeDifference(targetDate);
13181
+ };
13182
+ const formatTime = (time, format2) => {
13183
+ if (!time) return "-";
13184
+ return dayjs(time).format(format2);
13185
+ };
13186
+ return {
13187
+ formatTimeFromNow,
13188
+ formatTime
13189
+ };
13190
+ };
13191
+ const _hoisted_1$F = {
13192
+ key: 0,
13193
+ class: "org-layout-toolbar"
13194
+ };
13195
+ const _hoisted_2$v = { class: "org-layout-toolbar-title ellipsis-two-line" };
13196
+ const _hoisted_3$u = { class: "org-layout-toolbar-name" };
13197
+ const _hoisted_4$n = { class: "header-custom-btn-label" };
13198
+ const _hoisted_5$i = { class: "g-repo-breadcrumb-custom" };
13199
+ const _hoisted_6$g = {
13200
+ key: 1,
13201
+ class: "header-custom-mirrors-avatar"
13202
+ };
13203
+ const _hoisted_7$d = {
13204
+ key: 0,
13205
+ src: _imports_0,
13206
+ alt: "mirrors-avatar-phone",
13207
+ class: "header-custom-mirrors-img"
13208
+ };
13209
+ const _hoisted_8$b = {
13210
+ key: 1,
13211
+ src: "https://cdn-static.gitcode.com/static/images/mirrors-avata_20250411.gif",
13212
+ alt: "mirrors-avatar",
13213
+ class: "header-custom-mirrors-img-tall"
13214
+ };
13215
+ const _hoisted_9$a = { class: "g-repo-breadcrumb-container" };
13216
+ const _hoisted_10$9 = {
13217
+ key: 0,
13218
+ class: "header-custom-breadcrumb-row"
13219
+ };
13220
+ const _hoisted_11$7 = ["title"];
13221
+ const _hoisted_12$7 = ["title"];
13222
+ const _hoisted_13$4 = {
13223
+ key: 0,
13224
+ class: "header-custom-tag-mb"
13225
+ };
13226
+ const _hoisted_14$2 = {
13227
+ key: 1,
13228
+ class: "header-custom-tag-mb"
13229
+ };
13230
+ const _hoisted_15$2 = {
13231
+ key: 3,
13232
+ class: "header-custom-tag-mb"
13233
+ };
13234
+ const _hoisted_16$2 = {
13235
+ key: 4,
13236
+ class: "header-custom-tag-mb"
13237
+ };
13238
+ const _hoisted_17$2 = { class: "header-custom-topic-label" };
13239
+ const _hoisted_18$2 = {
13240
+ key: 6,
13241
+ class: "topic-tag font-color-t2 gh_mirros_tag"
13242
+ };
13243
+ const _hoisted_19$2 = { class: "header-custom-topic-label" };
13244
+ const _hoisted_20$2 = { class: "header-custom-skeleton" };
13245
+ const _hoisted_21$2 = {
13246
+ key: 2,
13247
+ class: "user-layout-toolbar"
13248
+ };
13249
+ const _hoisted_22$2 = { class: "user-layout-toolbar-title ellipsis-two-line" };
13250
+ const _hoisted_23$2 = { class: "header-custom-btn-label" };
13251
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
13252
+ __name: "HeaderCustom",
13253
+ props: {
13254
+ scene: { default: SceneValue.home },
13255
+ isLogin: { type: Boolean, default: false },
13256
+ errorCode: { default: 0 },
13257
+ orgProps: { default: () => ({}) },
13258
+ repoProps: { default: () => ({}) },
13259
+ userProps: { default: () => ({}) }
13260
+ },
13261
+ emits: ["followDevCommunity", "followUser"],
13262
+ setup(__props, { emit: __emit }) {
13263
+ const { t: t2 } = i18n.global;
13264
+ const layoutConfig2 = useLayoutConfig();
13265
+ const breadcrumb = useBreadcrumb();
13266
+ console.log("breadcrumb", breadcrumb);
13267
+ const breadcrumbRef = ref(null);
13268
+ const breadcrumbTextRef = ref(null);
13269
+ const breadcrumbNextRef = ref(null);
13270
+ const breadcrumbNextTextRef = ref(null);
13271
+ const { formatTimeFromNow } = useTimeFormat();
13272
+ const props = __props;
13273
+ const repoInfo = inject("repoInfo", computed(() => void 0));
13274
+ console.log("repoInfo", repoInfo);
13275
+ const orgInfo = inject("orgInfo", computed(() => void 0));
13276
+ const otherUserInfo = inject("otherUserInfo", computed(() => void 0));
13277
+ const API = headRequest(inject("request", proxyService));
13278
+ const emits = __emit;
13279
+ const handleOrgFollow = (val) => {
13280
+ if (props.scene !== SceneValue.org) return;
13281
+ if (!props.isLogin) {
13282
+ emitEvent("login", { triggerType: "关注组织", loginTriggerSource: "toolbar_org_follow" });
13283
+ return;
13284
+ }
13285
+ emits("followDevCommunity", !val);
13286
+ };
13287
+ const topicTag = computed(() => {
13288
+ var _a, _b;
13289
+ if (props.scene !== SceneValue.repo) return false;
13290
+ let repoType = 1;
13291
+ repoType = Number((_a = repoInfo.value) == null ? void 0 : _a.repo_type) - 1;
13292
+ if ((_b = props.repoProps) == null ? void 0 : _b.isSpaces) {
13293
+ repoType = 2;
13294
+ }
13295
+ if (repoType < 0) {
13296
+ return false;
13297
+ }
13298
+ const name = ["模型", "数据集", "Space"];
13299
+ const icon = ["gt-line-Models", "gt-line-Datasets", "gt-line-space"];
13300
+ const linkName = ["models", "datasets", "spaces"];
13301
+ const linkUrl = ["/models", "/datasets", "/space"];
13302
+ const suffix = ["Model", "Datasets", "Space"];
13303
+ const obj = {
13304
+ name: name[repoType],
13305
+ icon: icon[repoType],
13306
+ linkName: linkName[repoType],
13307
+ linkUrl: linkUrl[repoType],
13308
+ suffix: suffix[repoType]
13309
+ };
13310
+ return obj;
13311
+ });
13312
+ const isOrg = computed(() => {
13313
+ var _a, _b;
13314
+ if (props.scene === SceneValue.repo) {
13315
+ return ((_b = (_a = repoInfo.value) == null ? void 0 : _a.namespace) == null ? void 0 : _b.kind) === "group";
13316
+ }
13317
+ return false;
13318
+ });
13319
+ const orgEnterpriseId = computed(() => {
13320
+ var _a, _b;
13321
+ return (_b = (_a = orgInfo.value) == null ? void 0 : _a.enterprise) == null ? void 0 : _b.id;
13322
+ });
13323
+ const repoEnterpriseId = computed(() => {
13324
+ var _a, _b;
13325
+ return (_b = (_a = repoInfo.value) == null ? void 0 : _a.enterprise) == null ? void 0 : _b.id;
13326
+ });
13327
+ const orgEnterpriseName = computed(() => {
13328
+ var _a, _b;
13329
+ return ((_b = (_a = orgInfo.value) == null ? void 0 : _a.enterprise) == null ? void 0 : _b.name) || "";
13330
+ });
13331
+ const repoEnterpriseName = computed(() => {
13332
+ var _a, _b;
13333
+ return ((_b = (_a = repoInfo.value) == null ? void 0 : _a.enterprise) == null ? void 0 : _b.name) || "";
13334
+ });
13335
+ const enterpriseMemberCache = /* @__PURE__ */ new Map();
13336
+ const pendingEnterpriseMemberReqs = /* @__PURE__ */ new Map();
13337
+ const fetchIsEnterpriseMember = (enterpriseId) => {
13338
+ const cached = enterpriseMemberCache.get(enterpriseId);
13339
+ if (cached !== void 0) {
13340
+ return Promise.resolve(cached);
13341
+ }
13342
+ const pending = pendingEnterpriseMemberReqs.get(enterpriseId);
13343
+ if (pending) {
13344
+ return pending;
13345
+ }
13346
+ const req = (async () => {
13347
+ var _a, _b;
13348
+ const res = await API.getMemberByEnterprise({ enterpriseId });
13349
+ const data = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data;
13350
+ const level = ((_b = data == null ? void 0 : data.role_info) == null ? void 0 : _b.access_level) || 0;
13351
+ const isMember = level > 10;
13352
+ enterpriseMemberCache.set(enterpriseId, isMember);
13353
+ pendingEnterpriseMemberReqs.delete(enterpriseId);
13354
+ return isMember;
13355
+ })();
13356
+ pendingEnterpriseMemberReqs.set(enterpriseId, req);
13357
+ return req;
13358
+ };
13359
+ const handleEnterpriseClick = async (enterpriseId, enterpriseName) => {
13360
+ if (!enterpriseId) return;
13361
+ const isMember = await fetchIsEnterpriseMember(String(enterpriseId));
13362
+ if (!isMember || !enterpriseName) return;
13363
+ if (typeof window !== "undefined" && window.location) {
13364
+ window.location.href = `${window.location.origin}/enterprises/${enterpriseName}`;
13365
+ }
13366
+ };
13367
+ const toAiHub = () => {
13368
+ if (props.scene !== SceneValue.repo) return;
13369
+ if (!topicTag.value) return;
13370
+ const aiUrl = `${layoutConfig2.VITE_AI_HOST}${topicTag.value.linkUrl}`;
13371
+ if (typeof window !== "undefined" && window.location) {
13372
+ window.location.href = aiUrl;
13373
+ }
13374
+ };
13375
+ const showTimeTopic = computed(() => {
13376
+ var _a, _b;
13377
+ if (props.scene !== SceneValue.repo) return false;
13378
+ if (!((_a = repoInfo.value) == null ? void 0 : _a.last_repository_updated_at)) {
13379
+ return false;
13380
+ }
13381
+ try {
13382
+ return (/* @__PURE__ */ new Date()).getTime() - new Date((_b = repoInfo.value) == null ? void 0 : _b.last_repository_updated_at).getTime() < 7 * 24 * 60 * 60 * 1e3;
13383
+ } catch (error) {
13384
+ return false;
13385
+ }
13386
+ });
13387
+ const formatTime = computed(() => {
13388
+ var _a;
13389
+ return formatTimeFromNow(((_a = repoInfo.value) == null ? void 0 : _a.last_repository_updated_at) || "");
13390
+ });
13391
+ const handleFollowUser = () => {
13392
+ if (props.scene !== SceneValue.user) return;
13393
+ emits("followUser");
13394
+ };
13395
+ const handleBreadcrumbCopy = (e) => {
13396
+ const container = document.querySelector(".g-repo-breadcrumb-custom");
13397
+ if (!container) return;
13398
+ const selection = window.getSelection();
13399
+ if (!selection || !selection.rangeCount) return;
13400
+ const range = selection.getRangeAt(0);
13401
+ const selectedText = selection.toString().trim();
13402
+ const isSelectionInContainer = container.contains(range.startContainer) && container.contains(range.endContainer);
13403
+ if (isSelectionInContainer && selectedText) {
13404
+ e.preventDefault();
13405
+ if (e.clipboardData) {
13406
+ e.clipboardData.setData("text/plain", selectedText.replace(/\s+/g, ""));
13407
+ }
13408
+ }
13409
+ };
13410
+ onMounted(() => {
13411
+ document.addEventListener("copy", handleBreadcrumbCopy);
13412
+ });
13413
+ onUnmounted(() => {
13414
+ document.removeEventListener("copy", handleBreadcrumbCopy);
13415
+ });
13416
+ return (_ctx, _cache) => {
13417
+ var _a, _b, _c;
13418
+ return _ctx.scene === unref(SceneValue).org && !_ctx.errorCode ? (openBlock(), createElementBlock("div", _hoisted_1$F, [
13419
+ createVNode(GLink, {
13420
+ href: ((_a = _ctx.orgProps) == null ? void 0 : _a.orgHomepageUrl) || "",
13421
+ class: "header-custom-link"
13422
+ }, {
13423
+ default: withCtx(() => {
13424
+ var _a2, _b2, _c2;
13425
+ return [
13426
+ createVNode(_sfc_main$N, {
13427
+ class: "g-border",
13428
+ src: ((_a2 = unref(orgInfo)) == null ? void 0 : _a2.avatar) || "",
13429
+ name: ((_b2 = unref(orgInfo)) == null ? void 0 : _b2.name) || "",
13430
+ width: 28,
13431
+ height: 28,
13432
+ is_round: false
13433
+ }, null, 8, ["src", "name"]),
13434
+ createElementVNode("div", _hoisted_2$v, [
13435
+ createElementVNode("span", _hoisted_3$u, toDisplayString$1((_c2 = unref(orgInfo)) == null ? void 0 : _c2.name), 1),
13436
+ orgEnterpriseId.value ? (openBlock(), createElementBlock("span", {
13437
+ key: 0,
13438
+ class: "header-custom-enterprise-btn org-layout-toolbar-enterprise",
13439
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => handleEnterpriseClick(orgEnterpriseId.value, orgEnterpriseName.value), ["stop", "prevent"]))
13440
+ }, [
13441
+ createVNode(GIcon, {
13442
+ name: "gt-enterprise",
13443
+ size: "16px",
13444
+ class: "header-custom-enterprise-icon"
13445
+ })
13446
+ ])) : createCommentVNode("", true)
13447
+ ])
13448
+ ];
13449
+ }),
13450
+ _: 1
13451
+ }, 8, ["href"]),
13452
+ createVNode(unref(Button), {
13453
+ onClick: _cache[1] || (_cache[1] = ($event) => {
13454
+ var _a2;
13455
+ return handleOrgFollow((_a2 = _ctx.orgProps) == null ? void 0 : _a2.isOrgFollow);
13456
+ }),
13457
+ class: "org-layout-toolbar-follow"
13458
+ }, {
13459
+ default: withCtx(() => {
13460
+ var _a2;
13461
+ return [
13462
+ createElementVNode("span", _hoisted_4$n, toDisplayString$1(((_a2 = _ctx.orgProps) == null ? void 0 : _a2.isOrgFollow) ? unref(t2)("gitCodeLayout.home.alreadyFollowed") : unref(t2)("gitCodeLayout.home.focusOn")), 1)
13463
+ ];
13464
+ }),
13465
+ _: 1
13466
+ })
13467
+ ])) : _ctx.scene === unref(SceneValue).repo && !_ctx.errorCode ? (openBlock(), createBlock(unref(Skeleton), {
13468
+ key: 1,
13469
+ loading: (_b = _ctx.repoProps) == null ? void 0 : _b.repoNameLoading,
13470
+ rows: 1
13471
+ }, {
13472
+ placeholder: withCtx(() => [
13473
+ createElementVNode("div", _hoisted_20$2, [
13474
+ createVNode(unref(SkeletonItem), {
13475
+ round: "",
13476
+ style: { "width": "30px", "height": "30px" }
13477
+ }),
13478
+ createVNode(unref(SkeletonItem), { style: { "margin-left": "12px", "width": "80px", "height": "24px" } })
13479
+ ])
13480
+ ]),
13481
+ default: withCtx(() => {
13482
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
13483
+ return [
13484
+ createElementVNode("h2", _hoisted_5$i, [
13485
+ createVNode(GLink, {
13486
+ href: (_a2 = unref(breadcrumb)[0]) == null ? void 0 : _a2.path,
13487
+ class: "header-custom-avatar-link"
13488
+ }, {
13489
+ default: withCtx(() => {
13490
+ var _a3, _b3, _c3, _d2;
13491
+ return [
13492
+ !((_a3 = _ctx.repoProps) == null ? void 0 : _a3.isGhMirrors) ? (openBlock(), createBlock(_sfc_main$N, {
13493
+ key: 0,
13494
+ class: normalizeClass({ "g-border": isOrg.value }),
13495
+ src: ((_c3 = (_b3 = unref(repoInfo)) == null ? void 0 : _b3.namespace) == null ? void 0 : _c3.avatar_url) || "",
13496
+ name: ((_d2 = unref(repoInfo)) == null ? void 0 : _d2.name) || "",
13497
+ width: 28,
13498
+ height: 28,
13499
+ is_round: !isOrg.value
13500
+ }, null, 8, ["class", "src", "name", "is_round"])) : (openBlock(), createElementBlock("div", _hoisted_6$g, [
13501
+ unref(isPhone)() ? (openBlock(), createElementBlock("img", _hoisted_7$d)) : (openBlock(), createElementBlock("img", _hoisted_8$b))
13502
+ ]))
13503
+ ];
13504
+ }),
13505
+ _: 1
13506
+ }, 8, ["href"]),
13507
+ createElementVNode("div", _hoisted_9$a, [
13508
+ !((_b2 = _ctx.repoProps) == null ? void 0 : _b2.isGhMirrors) ? (openBlock(), createElementBlock("div", {
13509
+ key: 0,
13510
+ ref_key: "breadcrumbRef",
13511
+ ref: breadcrumbRef,
13512
+ class: "g-repo-layout-breadcrumb"
13513
+ }, [
13514
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(breadcrumb), (item, index2) => {
13515
+ return openBlock(), createElementBlock(Fragment, {
13516
+ key: item.path
13517
+ }, [
13518
+ index2 !== unref(breadcrumb).length - 1 ? (openBlock(), createElementBlock("span", _hoisted_10$9, [
13519
+ createVNode(GLink, {
13520
+ class: "linkTx",
13521
+ href: item.path
13522
+ }, {
13523
+ default: withCtx(() => [
13524
+ createElementVNode("span", {
13525
+ ref_for: true,
13526
+ ref_key: "breadcrumbTextRef",
13527
+ ref: breadcrumbTextRef,
13528
+ title: item.label,
13529
+ class: normalizeClass(["linkTx", index2 === unref(breadcrumb).length - 1 ? "header-custom-bold" : ""])
13530
+ }, toDisplayString$1(item.label), 11, _hoisted_11$7)
13531
+ ]),
13532
+ _: 2
13533
+ }, 1032, ["href"]),
13534
+ _cache[3] || (_cache[3] = createElementVNode("span", { class: "breadcrumb-splitter font-color-t1" }, " / ", -1))
13535
+ ])) : createCommentVNode("", true)
13536
+ ], 64);
13537
+ }), 128))
13538
+ ], 512)) : createCommentVNode("", true),
13539
+ unref(breadcrumb)[unref(breadcrumb).length - 1] ? (openBlock(), createElementBlock("div", {
13540
+ key: 1,
13541
+ ref_key: "breadcrumbNextRef",
13542
+ ref: breadcrumbNextRef,
13543
+ class: normalizeClass(["g-repo-layout-breadcrumb-next", [((_c2 = _ctx.repoProps) == null ? void 0 : _c2.isGhMirrors) ? "g-repo-layout-breadcrumb-next--full" : "g-repo-layout-breadcrumb-next--limit"]])
13544
+ }, [
13545
+ createVNode(GLink, {
13546
+ class: "linkTx",
13547
+ href: (_d = unref(breadcrumb)[unref(breadcrumb).length - 1]) == null ? void 0 : _d.path
13548
+ }, {
13549
+ default: withCtx(() => [
13550
+ createElementVNode("span", {
13551
+ ref_key: "breadcrumbNextTextRef",
13552
+ ref: breadcrumbNextTextRef,
13553
+ title: unref(breadcrumb)[unref(breadcrumb).length - 1].label,
13554
+ class: "linkTx header-custom-bold"
13555
+ }, toDisplayString$1(unref(breadcrumb)[unref(breadcrumb).length - 1].label), 9, _hoisted_12$7)
13556
+ ]),
13557
+ _: 1
13558
+ }, 8, ["href"]),
13559
+ unref(isGstarRepo)((_e = unref(repoInfo)) == null ? void 0 : _e.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_13$4, [
13560
+ createVNode(_sfc_main$M, {
13561
+ origin: "repo",
13562
+ icon: "",
13563
+ type: "gstar",
13564
+ message: `G-Star ${unref(t2)("gitCodeLayout.GStar.project.graduation")}`
13565
+ }, {
13566
+ default: withCtx(() => _cache[4] || (_cache[4] = [
13567
+ createTextVNode("G-Star ")
13568
+ ])),
13569
+ _: 1
13570
+ }, 8, ["message"])
13571
+ ])) : unref(isIncubationRepo)((_f = unref(repoInfo)) == null ? void 0 : _f.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_14$2, [
13572
+ createVNode(_sfc_main$M, {
13573
+ origin: "repo",
13574
+ icon: "",
13575
+ type: "incubation",
13576
+ message: `G-Star ${unref(t2)("gitCodeLayout.GStar.project.incubation")}`
13577
+ }, {
13578
+ default: withCtx(() => _cache[5] || (_cache[5] = [
13579
+ createTextVNode(" G-Star ")
13580
+ ])),
13581
+ _: 1
13582
+ }, 8, ["message"])
13583
+ ])) : createCommentVNode("", true),
13584
+ repoEnterpriseId.value ? (openBlock(), createElementBlock("div", {
13585
+ key: 2,
13586
+ class: "header-custom-tag-mb header-custom-enterprise-btn",
13587
+ onClick: _cache[2] || (_cache[2] = ($event) => handleEnterpriseClick(repoEnterpriseId.value, repoEnterpriseName.value))
13588
+ }, [
13589
+ createVNode(GIcon, {
13590
+ name: "gt-enterprise",
13591
+ size: "16px",
13592
+ class: "header-custom-enterprise-icon"
13593
+ })
13594
+ ])) : createCommentVNode("", true),
13595
+ unref(isTrustedRepo)((_g = unref(repoInfo)) == null ? void 0 : _g.topic_names) ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
13596
+ createVNode(_sfc_main$M, {
13597
+ trusted: "",
13598
+ message: unref(t2)("gitCodeLayout.trusted.title"),
13599
+ icon: "",
13600
+ type: "trusted",
13601
+ href: "/trusted"
13602
+ }, null, 8, ["message"])
13603
+ ])) : createCommentVNode("", true),
13604
+ ((_h = _ctx.repoProps) == null ? void 0 : _h.isPrivate) ? (openBlock(), createElementBlock("div", _hoisted_16$2, [
13605
+ createVNode(GIcon, {
13606
+ size: "16px",
13607
+ class: "header-custom-lock-icon",
13608
+ name: "gt-line-lock"
13609
+ })
13610
+ ])) : createCommentVNode("", true),
13611
+ topicTag.value ? (openBlock(), createElementBlock("div", {
13612
+ key: 5,
13613
+ class: "topic-tag font-color-t2",
13614
+ onClick: toAiHub
13615
+ }, [
13616
+ createVNode(GIcon, {
13617
+ name: (_i = topicTag.value) == null ? void 0 : _i.icon,
13618
+ color: "var(--devui-shape-icon-fill)",
13619
+ class: "header-custom-topic-icon"
13620
+ }, null, 8, ["name"]),
13621
+ createElementVNode("span", _hoisted_17$2, toDisplayString$1((_j = topicTag.value) == null ? void 0 : _j.suffix), 1)
13622
+ ])) : createCommentVNode("", true),
13623
+ ((_k = _ctx.repoProps) == null ? void 0 : _k.isGhMirrors) && showTimeTopic.value && !unref(isPhone)() ? (openBlock(), createElementBlock("div", _hoisted_18$2, [
13624
+ createVNode(GIcon, {
13625
+ name: "gt-line-time",
13626
+ color: "var(--devui-shape-icon-fill)",
13627
+ class: "header-custom-topic-icon"
13628
+ }),
13629
+ createElementVNode("span", _hoisted_19$2, toDisplayString$1(formatTime.value) + toDisplayString$1(unref(t2)("gitCodeLayout.repo.code.syncText")), 1)
13630
+ ])) : createCommentVNode("", true)
13631
+ ], 2)) : createCommentVNode("", true)
13632
+ ])
13633
+ ])
13634
+ ];
13635
+ }),
13636
+ _: 1
13637
+ }, 8, ["loading"])) : _ctx.scene === unref(SceneValue).user && ((_c = _ctx.userProps) == null ? void 0 : _c.isOtherUser) ? (openBlock(), createElementBlock("div", _hoisted_21$2, [
13638
+ createVNode(GLink, {
13639
+ to: { name: "homepage" },
13640
+ class: "header-custom-link"
13641
+ }, {
13642
+ default: withCtx(() => {
13643
+ var _a2, _b2, _c2, _d, _e;
13644
+ return [
13645
+ createVNode(_sfc_main$N, {
13646
+ src: (_a2 = unref(otherUserInfo)) == null ? void 0 : _a2.avatarUrl,
13647
+ name: ((_b2 = unref(otherUserInfo)) == null ? void 0 : _b2.name) || ((_c2 = unref(otherUserInfo)) == null ? void 0 : _c2.nickname),
13648
+ width: 28,
13649
+ height: 28
13650
+ }, null, 8, ["src", "name"]),
13651
+ createElementVNode("div", _hoisted_22$2, toDisplayString$1(((_d = unref(otherUserInfo)) == null ? void 0 : _d.name) || ((_e = unref(otherUserInfo)) == null ? void 0 : _e.nickname)), 1)
13652
+ ];
13653
+ }),
13654
+ _: 1
13655
+ }),
13656
+ createVNode(unref(Button), {
13657
+ onClick: handleFollowUser,
13658
+ class: "user-layout-toolbar-follow"
13659
+ }, {
13660
+ default: withCtx(() => {
13661
+ var _a2;
13662
+ return [
13663
+ createElementVNode("span", _hoisted_23$2, toDisplayString$1(((_a2 = unref(otherUserInfo)) == null ? void 0 : _a2.isFollow) ? unref(t2)("gitCodeLayout.org.following") : unref(t2)("gitCodeLayout.common.topic.attention")), 1)
13664
+ ];
13665
+ }),
13666
+ _: 1
14009
13667
  })
14010
- );
14011
- },
14012
- // 获取主题菜单
14013
- getThemeConfigList() {
14014
- return reqCatch(() => request({
14015
- url: `/aihub/api/v1/theme/label/config/list`,
14016
- method: "get"
14017
- }));
14018
- },
14019
- // 获取今日技术历史
14020
- getTodayTechHistory() {
14021
- return reqCatch(() => request({
14022
- url: `/uc/api/v1/operation/tech-history`,
14023
- method: "get"
14024
- }));
13668
+ ])) : createCommentVNode("", true);
13669
+ };
13670
+ }
13671
+ });
13672
+ const HeaderCustom = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-vue-layout-gitcode"]]);
13673
+ const _hoisted_1$E = ["src"];
13674
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
13675
+ ...{ name: "OperationEntry" },
13676
+ __name: "OperationEntry",
13677
+ setup(__props) {
13678
+ const request = inject("request");
13679
+ const API = asideRequest(request);
13680
+ const headerEntryConfig = ref({
13681
+ img_light: "",
13682
+ img_dark: "",
13683
+ url: ""
13684
+ });
13685
+ const handleClick = () => {
13686
+ var _a;
13687
+ window.open(`${transformUrl((_a = headerEntryConfig.value) == null ? void 0 : _a.url)}`, "_blank");
13688
+ };
13689
+ const img = computed(() => {
13690
+ const { img_light, img_dark } = headerEntryConfig.value;
13691
+ return (currentTheme.value === ThemeType.BLACK ? img_dark : img_light) || img_light;
13692
+ });
13693
+ const getHeaderEntryConfig = async () => {
13694
+ var _a;
13695
+ try {
13696
+ const res = await API.getHeaderEntryConfig();
13697
+ const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || {};
13698
+ headerEntryConfig.value = {
13699
+ img_light: data.img_light,
13700
+ img_dark: data.img_dark,
13701
+ url: data.url
13702
+ };
13703
+ } catch (error) {
13704
+ console.error(error);
13705
+ }
13706
+ };
13707
+ getHeaderEntryConfig();
13708
+ return (_ctx, _cache) => {
13709
+ return img.value && headerEntryConfig.value.url ? (openBlock(), createElementBlock("div", {
13710
+ key: 0,
13711
+ class: "operation-entry",
13712
+ onClick: handleClick
13713
+ }, [
13714
+ createElementVNode("img", {
13715
+ class: "operation-entry__img",
13716
+ src: img.value,
13717
+ alt: "operation-entry"
13718
+ }, null, 8, _hoisted_1$E)
13719
+ ])) : createCommentVNode("", true);
13720
+ };
13721
+ }
13722
+ });
13723
+ const OperationEntry = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-vue-layout-gitcode"]]);
13724
+ const _hoisted_1$D = ["src"];
13725
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
13726
+ __name: "ClaimPower",
13727
+ props: {
13728
+ config: {}
13729
+ },
13730
+ setup(__props) {
13731
+ const props = __props;
13732
+ const visible = computed(() => {
13733
+ return props.config.visible;
13734
+ });
13735
+ const handleClick = () => {
13736
+ console.log("handleClick");
13737
+ window.open(props.config.jump_url, "_blank");
13738
+ };
13739
+ return (_ctx, _cache) => {
13740
+ return visible.value ? (openBlock(), createElementBlock("div", {
13741
+ key: 0,
13742
+ class: "computing-power",
13743
+ onClick: handleClick
13744
+ }, [
13745
+ createElementVNode("img", {
13746
+ src: _ctx.config.logo_url,
13747
+ alt: "claim power"
13748
+ }, null, 8, _hoisted_1$D)
13749
+ ])) : createCommentVNode("", true);
13750
+ };
13751
+ }
13752
+ });
13753
+ const ClaimPower = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-vue-layout-gitcode"]]);
13754
+ const DEFAULT_APPLICATION_HOST = "https://gitcode.com";
13755
+ function normalizeApplicationHost(host) {
13756
+ return (host || DEFAULT_APPLICATION_HOST).replace(/\/+$/, "");
13757
+ }
13758
+ function getRoutePart(href, baseUrl) {
13759
+ try {
13760
+ const url = new URL(href || "/", `${baseUrl}/`);
13761
+ return `${url.pathname || "/"}${url.search}${url.hash}`;
13762
+ } catch {
13763
+ const value = href.trim();
13764
+ return value.startsWith("/") ? value : `/${value}`;
13765
+ }
13766
+ }
13767
+ function toApplicationUrl(applicationHost, href) {
13768
+ const host = normalizeApplicationHost(applicationHost);
13769
+ return `${host}${getRoutePart(href, host)}`;
13770
+ }
13771
+ function toApplicationRoute(applicationHost, href) {
13772
+ try {
13773
+ const url = new URL(toApplicationUrl(applicationHost, href));
13774
+ return `${url.pathname || "/"}${url.search}${url.hash}`;
13775
+ } catch {
13776
+ return null;
13777
+ }
13778
+ }
13779
+ const HEADER_CREATE_MENU_PATHS = [
13780
+ "/create?position=nav_top",
13781
+ "/create/migrate?type=3",
13782
+ "/models/create",
13783
+ "/datasets/create",
13784
+ "/space/create",
13785
+ "/collections/create",
13786
+ "/org/create"
13787
+ ];
13788
+ const HEADER_CREATE_ENTERPRISE_PATH = "/enterprises/new";
13789
+ const _hoisted_1$C = { class: "g-header-create dashboard-create-menu" };
13790
+ const _hoisted_2$u = ["title", "aria-label", "aria-expanded"];
13791
+ const _hoisted_3$t = { class: "dashboard-create-menu__trigger-text" };
13792
+ const _hoisted_4$m = ["aria-label"];
13793
+ const _hoisted_5$h = {
13794
+ key: 0,
13795
+ class: "dashboard-create-menu__divider",
13796
+ role: "separator"
13797
+ };
13798
+ const _hoisted_6$f = ["href", "onClick", "onKeydown"];
13799
+ const _hoisted_7$c = { class: "dashboard-create-menu__title-row" };
13800
+ const _hoisted_8$a = { class: "dashboard-create-menu__title" };
13801
+ const _hoisted_9$9 = {
13802
+ key: 0,
13803
+ class: "dashboard-create-menu__desc"
13804
+ };
13805
+ const menuId = "gitcode-header-create-menu";
13806
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
13807
+ ...{
13808
+ name: "HeaderCreateMenu"
13809
+ },
13810
+ __name: "index",
13811
+ props: {
13812
+ dropdownVisible: { type: Boolean, default: false },
13813
+ isCreateOrg: { type: Boolean, default: true },
13814
+ isCreateEnterprise: { type: Boolean, default: true },
13815
+ items: { default: void 0 },
13816
+ onNavigate: { type: Function, default: void 0 }
13817
+ },
13818
+ emits: ["update:dropdownVisible", "navigate"],
13819
+ setup(__props, { emit: __emit }) {
13820
+ const props = __props;
13821
+ const emit = __emit;
13822
+ const { t: t2 } = i18n.global;
13823
+ const layoutConfig2 = useLayoutConfig();
13824
+ const route = useRoute();
13825
+ const router2 = useRouter();
13826
+ const triggerRef = ref(null);
13827
+ const menuRef = ref(null);
13828
+ const menuOpen = ref(false);
13829
+ const defaultMenuItems = computed(() => {
13830
+ const [repoPath, importPath, modelPath, datasetPath, spacePath, collectionPath, orgPath] = HEADER_CREATE_MENU_PATHS;
13831
+ return [
13832
+ {
13833
+ key: "repo",
13834
+ icon: "gt-a-Property1default",
13835
+ label: t2("gitCodeLayout.header.createMenuRepository"),
13836
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, repoPath)
13837
+ },
13838
+ {
13839
+ key: "import-repository",
13840
+ icon: "gt-a-plane-fileinport",
13841
+ label: t2("gitCodeLayout.header.createMenuImportRepository"),
13842
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, importPath)
13843
+ },
13844
+ {
13845
+ key: "model",
13846
+ icon: "gt-plane-Models",
13847
+ label: t2("gitCodeLayout.header.createMenuModel"),
13848
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, modelPath)
13849
+ },
13850
+ {
13851
+ key: "dataset",
13852
+ icon: "gt-plane-Datasets",
13853
+ label: t2("gitCodeLayout.header.createMenuDataset"),
13854
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, datasetPath)
13855
+ },
13856
+ {
13857
+ key: "space",
13858
+ icon: "gt-plane-Space",
13859
+ label: t2("gitCodeLayout.header.createMenuSpace"),
13860
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, spacePath)
13861
+ },
13862
+ {
13863
+ key: "collection",
13864
+ icon: "gt-a-dashujuyufenxishuxing1guan",
13865
+ label: t2("gitCodeLayout.header.createMenuCollection"),
13866
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, collectionPath)
13867
+ },
13868
+ {
13869
+ key: "organization",
13870
+ icon: "gt-plane-organization",
13871
+ label: t2("gitCodeLayout.header.createMenuOrganization"),
13872
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, orgPath),
13873
+ dividerBefore: true
13874
+ }
13875
+ ];
13876
+ });
13877
+ const enterpriseMenuItem = {
13878
+ key: "enterprise",
13879
+ icon: "gt-a-plane-enterprise",
13880
+ label: t2("gitCodeLayout.header.createMenuEnterprise"),
13881
+ href: toApplicationUrl(layoutConfig2.VITE_HOST, HEADER_CREATE_ENTERPRISE_PATH),
13882
+ useHref: true
13883
+ };
13884
+ const menuItems = computed(() => {
13885
+ const baseItems = props.items || defaultMenuItems.value;
13886
+ const items = props.isCreateOrg ? baseItems : baseItems.filter((item) => item.key !== "organization");
13887
+ return props.isCreateEnterprise ? [...items, enterpriseMenuItem] : items;
13888
+ });
13889
+ function getMenuItems() {
13890
+ var _a;
13891
+ return Array.from(((_a = menuRef.value) == null ? void 0 : _a.querySelectorAll('[role="menuitem"]')) || []);
14025
13892
  }
14026
- };
14027
- }
13893
+ function focusMenuItem(index2) {
13894
+ void nextTick(() => {
13895
+ var _a;
13896
+ const items = getMenuItems();
13897
+ if (!items.length) return;
13898
+ const safeIndex = Math.min(Math.max(index2, 0), items.length - 1);
13899
+ (_a = items[safeIndex]) == null ? void 0 : _a.focus();
13900
+ });
13901
+ }
13902
+ function closeMenu(restoreFocus = false) {
13903
+ if (!menuOpen.value) return;
13904
+ menuOpen.value = false;
13905
+ emit("update:dropdownVisible", false);
13906
+ if (restoreFocus) {
13907
+ void nextTick(() => {
13908
+ var _a;
13909
+ return (_a = triggerRef.value) == null ? void 0 : _a.focus();
13910
+ });
13911
+ }
13912
+ }
13913
+ const handleToggle = (value) => {
13914
+ if (menuOpen.value === value) return;
13915
+ menuOpen.value = value;
13916
+ emit("update:dropdownVisible", value);
13917
+ };
13918
+ function onTriggerKeydown(event) {
13919
+ if (event.key === "ArrowDown") {
13920
+ event.preventDefault();
13921
+ menuOpen.value = true;
13922
+ emit("update:dropdownVisible", true);
13923
+ focusMenuItem(0);
13924
+ } else if (event.key === "ArrowUp") {
13925
+ event.preventDefault();
13926
+ menuOpen.value = true;
13927
+ emit("update:dropdownVisible", true);
13928
+ focusMenuItem(menuItems.value.length - 1);
13929
+ } else if (event.key === "Escape") {
13930
+ event.preventDefault();
13931
+ closeMenu(true);
13932
+ }
13933
+ }
13934
+ function onMenuItemKeydown(event, index2) {
13935
+ if (event.key === "ArrowDown") {
13936
+ event.preventDefault();
13937
+ focusMenuItem((index2 + 1) % menuItems.value.length);
13938
+ } else if (event.key === "ArrowUp") {
13939
+ event.preventDefault();
13940
+ focusMenuItem((index2 - 1 + menuItems.value.length) % menuItems.value.length);
13941
+ } else if (event.key === "Home") {
13942
+ event.preventDefault();
13943
+ focusMenuItem(0);
13944
+ } else if (event.key === "End") {
13945
+ event.preventDefault();
13946
+ focusMenuItem(menuItems.value.length - 1);
13947
+ } else if (event.key === "Escape") {
13948
+ event.preventDefault();
13949
+ closeMenu(true);
13950
+ } else if (event.key === " ") {
13951
+ event.preventDefault();
13952
+ if (event.currentTarget instanceof HTMLElement) event.currentTarget.click();
13953
+ }
13954
+ }
13955
+ function stripRouterBase(route2) {
13956
+ const base = router2.options.history.base;
13957
+ if (!base || base === "/") return route2;
13958
+ if (route2 === base) return "/";
13959
+ return route2.startsWith(`${base}/`) ? route2.slice(base.length) : route2;
13960
+ }
13961
+ function navigateTo(href) {
13962
+ const applicationHref = toApplicationUrl(layoutConfig2.VITE_HOST, href);
13963
+ const applicationRoute = toApplicationRoute(layoutConfig2.VITE_HOST, href);
13964
+ if (!applicationRoute) return;
13965
+ if (typeof window !== "undefined") {
13966
+ const applicationUrl = new URL(applicationHref);
13967
+ if (applicationUrl.origin !== window.location.origin) {
13968
+ window.location.href = applicationHref;
13969
+ return;
13970
+ }
13971
+ } else {
13972
+ void router2.push(stripRouterBase(applicationRoute));
13973
+ return;
13974
+ }
13975
+ void router2.push(stripRouterBase(applicationRoute));
13976
+ }
13977
+ async function selectCreateItem(item) {
13978
+ closeMenu();
13979
+ emit("navigate", item);
13980
+ if (item.useHref) {
13981
+ if (typeof window !== "undefined") {
13982
+ window.location.href = toApplicationUrl(layoutConfig2.VITE_HOST, item.href);
13983
+ }
13984
+ return;
13985
+ }
13986
+ if (props.onNavigate) {
13987
+ await props.onNavigate(item);
13988
+ return;
13989
+ }
13990
+ navigateTo(item.href);
13991
+ }
13992
+ watch(
13993
+ () => props.dropdownVisible,
13994
+ (visible) => {
13995
+ menuOpen.value = visible;
13996
+ },
13997
+ { immediate: true }
13998
+ );
13999
+ watch(
14000
+ () => route == null ? void 0 : route.fullPath,
14001
+ () => closeMenu()
14002
+ );
14003
+ return (_ctx, _cache) => {
14004
+ return openBlock(), createElementBlock("div", _hoisted_1$C, [
14005
+ createVNode(unref(Dropdown), {
14006
+ position: ["bottom-end", "bottom-start"],
14007
+ "destroy-on-hide": false,
14008
+ trigger: "hover",
14009
+ offset: { mainAxis: 4, crossAxis: 0 },
14010
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
14011
+ }, ["stop"])),
14012
+ "overlay-class": "dashboard-create-dropdown",
14013
+ visible: menuOpen.value,
14014
+ onToggle: handleToggle
14015
+ }, {
14016
+ menu: withCtx(() => [
14017
+ createElementVNode("div", {
14018
+ id: menuId,
14019
+ ref_key: "menuRef",
14020
+ ref: menuRef,
14021
+ class: "dashboard-create-menu__panel",
14022
+ role: "menu",
14023
+ "aria-label": unref(t2)("gitCodeLayout.header.create")
14024
+ }, [
14025
+ (openBlock(true), createElementBlock(Fragment, null, renderList(menuItems.value, (item, index2) => {
14026
+ return openBlock(), createElementBlock(Fragment, {
14027
+ key: item.key
14028
+ }, [
14029
+ item.dividerBefore ? (openBlock(), createElementBlock("div", _hoisted_5$h)) : createCommentVNode("", true),
14030
+ createElementVNode("a", {
14031
+ href: unref(toApplicationUrl)(unref(layoutConfig2).VITE_HOST, item.href),
14032
+ class: normalizeClass(["dashboard-create-menu__item", { "dashboard-create-menu__item--with-desc": Boolean(item.desc) }]),
14033
+ role: "menuitem",
14034
+ tabindex: "-1",
14035
+ onClick: withModifiers(($event) => selectCreateItem(item), ["prevent"]),
14036
+ onKeydown: ($event) => onMenuItemKeydown($event, index2)
14037
+ }, [
14038
+ createElementVNode("div", _hoisted_7$c, [
14039
+ createVNode(GIcon, {
14040
+ name: item.icon,
14041
+ size: "16px",
14042
+ color: "currentColor",
14043
+ class: "dashboard-create-menu__icon",
14044
+ "aria-hidden": "true"
14045
+ }, null, 8, ["name"]),
14046
+ createElementVNode("span", _hoisted_8$a, toDisplayString$1(item.label), 1)
14047
+ ]),
14048
+ item.desc ? (openBlock(), createElementBlock("div", _hoisted_9$9, toDisplayString$1(item.desc), 1)) : createCommentVNode("", true)
14049
+ ], 42, _hoisted_6$f)
14050
+ ], 64);
14051
+ }), 128))
14052
+ ], 8, _hoisted_4$m)
14053
+ ]),
14054
+ default: withCtx(() => [
14055
+ createElementVNode("button", {
14056
+ id: "guide-step3",
14057
+ ref_key: "triggerRef",
14058
+ ref: triggerRef,
14059
+ type: "button",
14060
+ class: "dashboard-create-menu__trigger dashboard-create-menu__trigger--header",
14061
+ title: unref(t2)("gitCodeLayout.header.create"),
14062
+ "aria-label": unref(t2)("gitCodeLayout.header.create"),
14063
+ "aria-expanded": menuOpen.value,
14064
+ "aria-controls": menuId,
14065
+ "aria-haspopup": "menu",
14066
+ onKeydown: onTriggerKeydown
14067
+ }, [
14068
+ createVNode(GIcon, {
14069
+ name: "gt-add",
14070
+ size: "16px",
14071
+ color: "var(--theme-light-text)",
14072
+ class: "dashboard-create-menu__trigger-icon",
14073
+ "aria-hidden": "true"
14074
+ }),
14075
+ createElementVNode("span", _hoisted_3$t, toDisplayString$1(unref(t2)("gitCodeLayout.header.create")), 1)
14076
+ ], 40, _hoisted_2$u)
14077
+ ]),
14078
+ _: 1
14079
+ }, 8, ["visible"])
14080
+ ]);
14081
+ };
14082
+ }
14083
+ });
14084
+ const HeaderCreateMenu = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-vue-layout-gitcode"]]);
14085
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
14086
+ ...{
14087
+ name: "DocumentCenter"
14088
+ },
14089
+ __name: "DocumentCenter",
14090
+ props: {
14091
+ whiteColor: { type: Boolean, default: false }
14092
+ },
14093
+ setup(__props) {
14094
+ const { t: t2 } = i18n.global;
14095
+ return (_ctx, _cache) => {
14096
+ return openBlock(), createBlock(GLink, {
14097
+ variant: "text",
14098
+ class: normalizeClass(["g-toolbar-docs", _ctx.whiteColor ? "white" : "black"]),
14099
+ href: unref(currentHelpDocsAiCommunityUrl)(),
14100
+ target: "_blank"
14101
+ }, {
14102
+ default: withCtx(() => [
14103
+ createTextVNode(toDisplayString$1(unref(t2)("gitCodeLayout.header.aihub.documentCenter")), 1)
14104
+ ]),
14105
+ _: 1
14106
+ }, 8, ["class", "href"]);
14107
+ };
14108
+ }
14109
+ });
14110
+ const DocumentCenter = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-vue-layout-gitcode"]]);
14028
14111
  const _hoisted_1$B = {
14029
14112
  key: 1,
14030
14113
  class: "g-text-all"
@@ -15965,12 +16048,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
15965
16048
  setup(__props) {
15966
16049
  const layoutConfig2 = useLayoutConfig();
15967
16050
  const { t: $t } = i18n.global;
15968
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-BDfWWYdS.js"));
15969
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-Dtq1lZtD.js"));
15970
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch--EPVZ8UD.js"));
15971
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-Bp2vb2Gp.js"));
15972
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-DN89AUVU.js"));
15973
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-BAs64Djc.js"));
16051
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-BWgYkutQ.js"));
16052
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-Bue3puQ9.js"));
16053
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-B-aOzEWA.js"));
16054
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-Df0MQwp7.js"));
16055
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-NBZTpiza.js"));
16056
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-B0kWk7LT.js"));
15974
16057
  const props = __props;
15975
16058
  const repoInfo = inject("repoInfo", computed(() => void 0));
15976
16059
  const orgInfo = inject("orgInfo", computed(() => void 0));
@@ -17361,7 +17444,7 @@ const vElementExposure = {
17361
17444
  beforeUnmount() {
17362
17445
  }
17363
17446
  };
17364
- const NoticeModal = defineAsyncComponent(() => import("./notice-BbWimNkY.js"));
17447
+ const NoticeModal = defineAsyncComponent(() => import("./notice-BBT58A2W.js"));
17365
17448
  function clearNotice() {
17366
17449
  if (localStorage$2.getItem("validator_email")) {
17367
17450
  localStorage$2.removeItem("validator_email");
@@ -19811,9 +19894,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
19811
19894
  const layoutConfig2 = useLayoutConfig();
19812
19895
  const { t: t2 } = i18n.global;
19813
19896
  const route = useRoute();
19814
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-LyTNWx6g.js"));
19815
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-TWYG6_TF.js"));
19816
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-B98docAF.js"));
19897
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-SfuInJ1G.js"));
19898
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-Cl-jQE6q.js"));
19899
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-ywyUGGqm.js"));
19817
19900
  const props = __props;
19818
19901
  const useReport2 = inject("useReport");
19819
19902
  const userInfo = inject("userInfo");
@@ -20899,7 +20982,14 @@ const repoInfoData = {
20899
20982
  "fork_network_projects": null,
20900
20983
  "secure_issue_assignees": null,
20901
20984
  "forked_by_secure_issue": null,
20902
- "enterprise": null,
20985
+ "enterprise": {
20986
+ "name": "hello-worldsss",
20987
+ "avatar": null,
20988
+ "id": 1,
20989
+ "creator_id": 303745,
20990
+ "created_at": null,
20991
+ "updated_at": null
20992
+ },
20903
20993
  "template": false,
20904
20994
  "module_setting": {
20905
20995
  "repo_id": 686859,
@@ -21005,7 +21095,18 @@ const repoInfoData = {
21005
21095
  ],
21006
21096
  "gc_allow": null
21007
21097
  },
21008
- "topic_names": null,
21098
+ // namespace 区域标签的展示条件(判定见 src/utils/index.ts),topic_id 需命中对应配置:
21099
+ // - G-Star(毕业): VITE_GSTAR_TOPIC,本地 dev 为 6653f80e91a72b11f2478e99
21100
+ // - G-Star(孵化): type 为 0 且 name 含「孵化项目」或命中 VITE_INCUBATION_TOPIC,本地 dev 为 6653f7a191a72b11f2478e93
21101
+ // - 可信开源: VITE_TRUSTED_TOPIC,本地 dev 为 6715c49554670a12f26fb08d
21102
+ "topic_names": [
21103
+ {
21104
+ "topic_id": "6653f80e91a72b11f2478e99",
21105
+ "id": "6653f80e91a72b11f2478e99",
21106
+ "name": "G-Star",
21107
+ "type": 0
21108
+ }
21109
+ ],
21009
21110
  "is_recommend": null,
21010
21111
  "deploy_info": "",
21011
21112
  "deploy_allow": false,
@@ -21448,8 +21549,8 @@ const headerCustomPropsData = {
21448
21549
  },
21449
21550
  repoProps: {
21450
21551
  repoNameLoading: false,
21451
- isGhMirrors: true,
21452
- isPrivate: false,
21552
+ isGhMirrors: false,
21553
+ isPrivate: true,
21453
21554
  isSpaces: false
21454
21555
  },
21455
21556
  userProps: {
@@ -26266,7 +26367,7 @@ const _SlidCaptchaManager = class _SlidCaptchaManager {
26266
26367
  __publicField(_SlidCaptchaManager, "instance");
26267
26368
  let SlidCaptchaManager = _SlidCaptchaManager;
26268
26369
  const slidCaptchaManager = SlidCaptchaManager.getInstance();
26269
- const SlidCaptcha = defineAsyncComponent(() => import("./index-B6TVo4B7.js"));
26370
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-B42Bonoc.js"));
26270
26371
  const useSlidCaptcha = () => {
26271
26372
  const { mount, unMount, isMounted } = usePopup("slid-captcha-popup");
26272
26373
  const open = (config) => {
@@ -26296,7 +26397,7 @@ const useSlidCaptcha = () => {
26296
26397
  close
26297
26398
  };
26298
26399
  };
26299
- const YunpianCaptcha = defineAsyncComponent(() => import("./index-BGrjmLwV.js"));
26400
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-DJnaTbtP.js"));
26300
26401
  const useYunpianCaptcha = () => {
26301
26402
  const { mount, unMount } = usePopup("yunpian-captcha-popup");
26302
26403
  const open = (config) => {
@@ -29395,28 +29496,28 @@ export {
29395
29496
  HEADER_CREATE_MENU_PATHS as a8,
29396
29497
  index as a9,
29397
29498
  REPO_EVENT as b,
29398
- REPO_TYPE as c,
29499
+ useLayoutConfig as c,
29399
29500
  transferNumber as d,
29400
- extractRepoInfoWithURL as e,
29401
- useRequestReport as f,
29402
- useTimeFormat as g,
29501
+ useRequestReport as e,
29502
+ useTimeFormat as f,
29503
+ useCookie as g,
29403
29504
  headRequest as h,
29404
29505
  isPhone as i,
29405
- useCookie as j,
29406
- usePageResize as k,
29506
+ usePageResize as j,
29507
+ isGstarRepo as k,
29407
29508
  localStorage$2 as l,
29408
- isGstarRepo as m,
29509
+ _sfc_main$M as m,
29409
29510
  normalizeSearchHistoryEntry as n,
29410
- _sfc_main$M as o,
29411
- isIncubationRepo as p,
29412
- highlightWords as q,
29511
+ isIncubationRepo as o,
29512
+ highlightWords as p,
29513
+ _frEventTrack as q,
29413
29514
  reqCatch as r,
29414
29515
  setLoginTriggerSource as s,
29415
29516
  transformUrl as t,
29416
29517
  useModel as u,
29417
29518
  vElementExposure as v,
29418
- _frEventTrack as w,
29419
- LANG_KEY as x,
29420
- slidCaptchaManager as y,
29421
- useLayoutConfig as z
29519
+ REPO_TYPE as w,
29520
+ extractRepoInfoWithURL as x,
29521
+ LANG_KEY as y,
29522
+ slidCaptchaManager as z
29422
29523
  };