@kbapp/media-fusion-tracker 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +225 -0
- package/dist/es/helpers/filter-undefined-properties.js +12 -0
- package/dist/es/index.js +8 -0
- package/dist/es/media-fusion-tracker.js +35 -0
- package/dist/es/models/DocActionEvent.js +27 -0
- package/dist/es/models/DocVisitEvent.js +27 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/_virtual/_commonjsHelpers.js +8 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/_virtual/index.js +7 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/_virtual/index2.js +4 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/gsido-tracker.js +86 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/helpers/filter-undefined-properties.js +12 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/helpers/load-script.js +11 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/helpers/object-to-map.js +9 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/lib/gsido-proxy.js +79 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/models/DocActionEvent.js +27 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/models/DocVisitEvent.js +27 -0
- package/dist/es/node_modules/@kbapp/gsido-tracker/dist/es/node_modules/lodash.clonedeep/index.js +452 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/_virtual/_commonjsHelpers.js +8 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/_virtual/dayjs.min.js +4 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/core/tmuyun-sdk-report.js +15 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/core/tmuyun-sdk.js +36 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/index.js +38 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/models/TmuyunDocModel.js +99 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/models/TmuyunDocType.js +16 -0
- package/dist/es/node_modules/@kbapp/tmuyun-tracker/dist/es/node_modules/dayjs/dayjs.min.js +282 -0
- package/dist/types/__tests__/index.test.d.ts +1 -0
- package/dist/types/helpers/filter-undefined-properties.d.ts +8 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/media-fusion-tracker.d.ts +50 -0
- package/dist/types/models/DocActionEvent.d.ts +66 -0
- package/dist/types/models/DocVisitEvent.d.ts +75 -0
- package/dist/umd/index.js +1 -0
- package/examples/index.html +241 -0
- package/package.json +47 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { commonjsGlobal as Q, getDefaultExportFromCjs as R } from "../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as V } from "../../_virtual/dayjs.min.js";
|
|
3
|
+
(function(q, K) {
|
|
4
|
+
(function(j, Y) {
|
|
5
|
+
q.exports = Y();
|
|
6
|
+
})(Q, function() {
|
|
7
|
+
var j = 1e3, Y = 6e4, N = 36e5, A = "millisecond", S = "second", w = "minute", O = "hour", M = "day", H = "week", m = "month", U = "quarter", v = "year", b = "date", J = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, E = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, G = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(i) {
|
|
8
|
+
var r = ["th", "st", "nd", "rd"], t = i % 100;
|
|
9
|
+
return "[" + i + (r[(t - 20) % 10] || r[t] || r[0]) + "]";
|
|
10
|
+
} }, I = function(i, r, t) {
|
|
11
|
+
var n = String(i);
|
|
12
|
+
return !n || n.length >= r ? i : "" + Array(r + 1 - n.length).join(t) + i;
|
|
13
|
+
}, P = { s: I, z: function(i) {
|
|
14
|
+
var r = -i.utcOffset(), t = Math.abs(r), n = Math.floor(t / 60), e = t % 60;
|
|
15
|
+
return (r <= 0 ? "+" : "-") + I(n, 2, "0") + ":" + I(e, 2, "0");
|
|
16
|
+
}, m: function i(r, t) {
|
|
17
|
+
if (r.date() < t.date()) return -i(t, r);
|
|
18
|
+
var n = 12 * (t.year() - r.year()) + (t.month() - r.month()), e = r.clone().add(n, m), s = t - e < 0, a = r.clone().add(n + (s ? -1 : 1), m);
|
|
19
|
+
return +(-(n + (t - e) / (s ? e - a : a - e)) || 0);
|
|
20
|
+
}, a: function(i) {
|
|
21
|
+
return i < 0 ? Math.ceil(i) || 0 : Math.floor(i);
|
|
22
|
+
}, p: function(i) {
|
|
23
|
+
return { M: m, y: v, w: H, d: M, D: b, h: O, m: w, s: S, ms: A, Q: U }[i] || String(i || "").toLowerCase().replace(/s$/, "");
|
|
24
|
+
}, u: function(i) {
|
|
25
|
+
return i === void 0;
|
|
26
|
+
} }, k = "en", D = {};
|
|
27
|
+
D[k] = G;
|
|
28
|
+
var Z = "$isDayjsObject", F = function(i) {
|
|
29
|
+
return i instanceof C || !(!i || !i[Z]);
|
|
30
|
+
}, W = function i(r, t, n) {
|
|
31
|
+
var e;
|
|
32
|
+
if (!r) return k;
|
|
33
|
+
if (typeof r == "string") {
|
|
34
|
+
var s = r.toLowerCase();
|
|
35
|
+
D[s] && (e = s), t && (D[s] = t, e = s);
|
|
36
|
+
var a = r.split("-");
|
|
37
|
+
if (!e && a.length > 1) return i(a[0]);
|
|
38
|
+
} else {
|
|
39
|
+
var o = r.name;
|
|
40
|
+
D[o] = r, e = o;
|
|
41
|
+
}
|
|
42
|
+
return !n && e && (k = e), e || !n && k;
|
|
43
|
+
}, f = function(i, r) {
|
|
44
|
+
if (F(i)) return i.clone();
|
|
45
|
+
var t = typeof r == "object" ? r : {};
|
|
46
|
+
return t.date = i, t.args = arguments, new C(t);
|
|
47
|
+
}, u = P;
|
|
48
|
+
u.l = W, u.i = F, u.w = function(i, r) {
|
|
49
|
+
return f(i, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset });
|
|
50
|
+
};
|
|
51
|
+
var C = (function() {
|
|
52
|
+
function i(t) {
|
|
53
|
+
this.$L = W(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[Z] = !0;
|
|
54
|
+
}
|
|
55
|
+
var r = i.prototype;
|
|
56
|
+
return r.parse = function(t) {
|
|
57
|
+
this.$d = (function(n) {
|
|
58
|
+
var e = n.date, s = n.utc;
|
|
59
|
+
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
60
|
+
if (u.u(e)) return /* @__PURE__ */ new Date();
|
|
61
|
+
if (e instanceof Date) return new Date(e);
|
|
62
|
+
if (typeof e == "string" && !/Z$/i.test(e)) {
|
|
63
|
+
var a = e.match(B);
|
|
64
|
+
if (a) {
|
|
65
|
+
var o = a[2] - 1 || 0, c = (a[7] || "0").substring(0, 3);
|
|
66
|
+
return s ? new Date(Date.UTC(a[1], o, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, c)) : new Date(a[1], o, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, c);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return new Date(e);
|
|
70
|
+
})(t), this.init();
|
|
71
|
+
}, r.init = function() {
|
|
72
|
+
var t = this.$d;
|
|
73
|
+
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
74
|
+
}, r.$utils = function() {
|
|
75
|
+
return u;
|
|
76
|
+
}, r.isValid = function() {
|
|
77
|
+
return this.$d.toString() !== J;
|
|
78
|
+
}, r.isSame = function(t, n) {
|
|
79
|
+
var e = f(t);
|
|
80
|
+
return this.startOf(n) <= e && e <= this.endOf(n);
|
|
81
|
+
}, r.isAfter = function(t, n) {
|
|
82
|
+
return f(t) < this.startOf(n);
|
|
83
|
+
}, r.isBefore = function(t, n) {
|
|
84
|
+
return this.endOf(n) < f(t);
|
|
85
|
+
}, r.$g = function(t, n, e) {
|
|
86
|
+
return u.u(t) ? this[n] : this.set(e, t);
|
|
87
|
+
}, r.unix = function() {
|
|
88
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
89
|
+
}, r.valueOf = function() {
|
|
90
|
+
return this.$d.getTime();
|
|
91
|
+
}, r.startOf = function(t, n) {
|
|
92
|
+
var e = this, s = !!u.u(n) || n, a = u.p(t), o = function(p, l) {
|
|
93
|
+
var y = u.w(e.$u ? Date.UTC(e.$y, l, p) : new Date(e.$y, l, p), e);
|
|
94
|
+
return s ? y : y.endOf(M);
|
|
95
|
+
}, c = function(p, l) {
|
|
96
|
+
return u.w(e.toDate()[p].apply(e.toDate("s"), (s ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(l)), e);
|
|
97
|
+
}, h = this.$W, d = this.$M, $ = this.$D, _ = "set" + (this.$u ? "UTC" : "");
|
|
98
|
+
switch (a) {
|
|
99
|
+
case v:
|
|
100
|
+
return s ? o(1, 0) : o(31, 11);
|
|
101
|
+
case m:
|
|
102
|
+
return s ? o(1, d) : o(0, d + 1);
|
|
103
|
+
case H:
|
|
104
|
+
var g = this.$locale().weekStart || 0, T = (h < g ? h + 7 : h) - g;
|
|
105
|
+
return o(s ? $ - T : $ + (6 - T), d);
|
|
106
|
+
case M:
|
|
107
|
+
case b:
|
|
108
|
+
return c(_ + "Hours", 0);
|
|
109
|
+
case O:
|
|
110
|
+
return c(_ + "Minutes", 1);
|
|
111
|
+
case w:
|
|
112
|
+
return c(_ + "Seconds", 2);
|
|
113
|
+
case S:
|
|
114
|
+
return c(_ + "Milliseconds", 3);
|
|
115
|
+
default:
|
|
116
|
+
return this.clone();
|
|
117
|
+
}
|
|
118
|
+
}, r.endOf = function(t) {
|
|
119
|
+
return this.startOf(t, !1);
|
|
120
|
+
}, r.$set = function(t, n) {
|
|
121
|
+
var e, s = u.p(t), a = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[M] = a + "Date", e[b] = a + "Date", e[m] = a + "Month", e[v] = a + "FullYear", e[O] = a + "Hours", e[w] = a + "Minutes", e[S] = a + "Seconds", e[A] = a + "Milliseconds", e)[s], c = s === M ? this.$D + (n - this.$W) : n;
|
|
122
|
+
if (s === m || s === v) {
|
|
123
|
+
var h = this.clone().set(b, 1);
|
|
124
|
+
h.$d[o](c), h.init(), this.$d = h.set(b, Math.min(this.$D, h.daysInMonth())).$d;
|
|
125
|
+
} else o && this.$d[o](c);
|
|
126
|
+
return this.init(), this;
|
|
127
|
+
}, r.set = function(t, n) {
|
|
128
|
+
return this.clone().$set(t, n);
|
|
129
|
+
}, r.get = function(t) {
|
|
130
|
+
return this[u.p(t)]();
|
|
131
|
+
}, r.add = function(t, n) {
|
|
132
|
+
var e, s = this;
|
|
133
|
+
t = Number(t);
|
|
134
|
+
var a = u.p(n), o = function(d) {
|
|
135
|
+
var $ = f(s);
|
|
136
|
+
return u.w($.date($.date() + Math.round(d * t)), s);
|
|
137
|
+
};
|
|
138
|
+
if (a === m) return this.set(m, this.$M + t);
|
|
139
|
+
if (a === v) return this.set(v, this.$y + t);
|
|
140
|
+
if (a === M) return o(1);
|
|
141
|
+
if (a === H) return o(7);
|
|
142
|
+
var c = (e = {}, e[w] = Y, e[O] = N, e[S] = j, e)[a] || 1, h = this.$d.getTime() + t * c;
|
|
143
|
+
return u.w(h, this);
|
|
144
|
+
}, r.subtract = function(t, n) {
|
|
145
|
+
return this.add(-1 * t, n);
|
|
146
|
+
}, r.format = function(t) {
|
|
147
|
+
var n = this, e = this.$locale();
|
|
148
|
+
if (!this.isValid()) return e.invalidDate || J;
|
|
149
|
+
var s = t || "YYYY-MM-DDTHH:mm:ssZ", a = u.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, $ = e.months, _ = e.meridiem, g = function(l, y, x, L) {
|
|
150
|
+
return l && (l[y] || l(n, s)) || x[y].slice(0, L);
|
|
151
|
+
}, T = function(l) {
|
|
152
|
+
return u.s(o % 12 || 12, l, "0");
|
|
153
|
+
}, p = _ || function(l, y, x) {
|
|
154
|
+
var L = l < 12 ? "AM" : "PM";
|
|
155
|
+
return x ? L.toLowerCase() : L;
|
|
156
|
+
};
|
|
157
|
+
return s.replace(E, function(l, y) {
|
|
158
|
+
return y || (function(x) {
|
|
159
|
+
switch (x) {
|
|
160
|
+
case "YY":
|
|
161
|
+
return String(n.$y).slice(-2);
|
|
162
|
+
case "YYYY":
|
|
163
|
+
return u.s(n.$y, 4, "0");
|
|
164
|
+
case "M":
|
|
165
|
+
return h + 1;
|
|
166
|
+
case "MM":
|
|
167
|
+
return u.s(h + 1, 2, "0");
|
|
168
|
+
case "MMM":
|
|
169
|
+
return g(e.monthsShort, h, $, 3);
|
|
170
|
+
case "MMMM":
|
|
171
|
+
return g($, h);
|
|
172
|
+
case "D":
|
|
173
|
+
return n.$D;
|
|
174
|
+
case "DD":
|
|
175
|
+
return u.s(n.$D, 2, "0");
|
|
176
|
+
case "d":
|
|
177
|
+
return String(n.$W);
|
|
178
|
+
case "dd":
|
|
179
|
+
return g(e.weekdaysMin, n.$W, d, 2);
|
|
180
|
+
case "ddd":
|
|
181
|
+
return g(e.weekdaysShort, n.$W, d, 3);
|
|
182
|
+
case "dddd":
|
|
183
|
+
return d[n.$W];
|
|
184
|
+
case "H":
|
|
185
|
+
return String(o);
|
|
186
|
+
case "HH":
|
|
187
|
+
return u.s(o, 2, "0");
|
|
188
|
+
case "h":
|
|
189
|
+
return T(1);
|
|
190
|
+
case "hh":
|
|
191
|
+
return T(2);
|
|
192
|
+
case "a":
|
|
193
|
+
return p(o, c, !0);
|
|
194
|
+
case "A":
|
|
195
|
+
return p(o, c, !1);
|
|
196
|
+
case "m":
|
|
197
|
+
return String(c);
|
|
198
|
+
case "mm":
|
|
199
|
+
return u.s(c, 2, "0");
|
|
200
|
+
case "s":
|
|
201
|
+
return String(n.$s);
|
|
202
|
+
case "ss":
|
|
203
|
+
return u.s(n.$s, 2, "0");
|
|
204
|
+
case "SSS":
|
|
205
|
+
return u.s(n.$ms, 3, "0");
|
|
206
|
+
case "Z":
|
|
207
|
+
return a;
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
})(l) || a.replace(":", "");
|
|
211
|
+
});
|
|
212
|
+
}, r.utcOffset = function() {
|
|
213
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
214
|
+
}, r.diff = function(t, n, e) {
|
|
215
|
+
var s, a = this, o = u.p(n), c = f(t), h = (c.utcOffset() - this.utcOffset()) * Y, d = this - c, $ = function() {
|
|
216
|
+
return u.m(a, c);
|
|
217
|
+
};
|
|
218
|
+
switch (o) {
|
|
219
|
+
case v:
|
|
220
|
+
s = $() / 12;
|
|
221
|
+
break;
|
|
222
|
+
case m:
|
|
223
|
+
s = $();
|
|
224
|
+
break;
|
|
225
|
+
case U:
|
|
226
|
+
s = $() / 3;
|
|
227
|
+
break;
|
|
228
|
+
case H:
|
|
229
|
+
s = (d - h) / 6048e5;
|
|
230
|
+
break;
|
|
231
|
+
case M:
|
|
232
|
+
s = (d - h) / 864e5;
|
|
233
|
+
break;
|
|
234
|
+
case O:
|
|
235
|
+
s = d / N;
|
|
236
|
+
break;
|
|
237
|
+
case w:
|
|
238
|
+
s = d / Y;
|
|
239
|
+
break;
|
|
240
|
+
case S:
|
|
241
|
+
s = d / j;
|
|
242
|
+
break;
|
|
243
|
+
default:
|
|
244
|
+
s = d;
|
|
245
|
+
}
|
|
246
|
+
return e ? s : u.a(s);
|
|
247
|
+
}, r.daysInMonth = function() {
|
|
248
|
+
return this.endOf(m).$D;
|
|
249
|
+
}, r.$locale = function() {
|
|
250
|
+
return D[this.$L];
|
|
251
|
+
}, r.locale = function(t, n) {
|
|
252
|
+
if (!t) return this.$L;
|
|
253
|
+
var e = this.clone(), s = W(t, n, !0);
|
|
254
|
+
return s && (e.$L = s), e;
|
|
255
|
+
}, r.clone = function() {
|
|
256
|
+
return u.w(this.$d, this);
|
|
257
|
+
}, r.toDate = function() {
|
|
258
|
+
return new Date(this.valueOf());
|
|
259
|
+
}, r.toJSON = function() {
|
|
260
|
+
return this.isValid() ? this.toISOString() : null;
|
|
261
|
+
}, r.toISOString = function() {
|
|
262
|
+
return this.$d.toISOString();
|
|
263
|
+
}, r.toString = function() {
|
|
264
|
+
return this.$d.toUTCString();
|
|
265
|
+
}, i;
|
|
266
|
+
})(), z = C.prototype;
|
|
267
|
+
return f.prototype = z, [["$ms", A], ["$s", S], ["$m", w], ["$H", O], ["$W", M], ["$M", m], ["$y", v], ["$D", b]].forEach(function(i) {
|
|
268
|
+
z[i[1]] = function(r) {
|
|
269
|
+
return this.$g(r, i[0], i[1]);
|
|
270
|
+
};
|
|
271
|
+
}), f.extend = function(i, r) {
|
|
272
|
+
return i.$i || (i(r, C, f), i.$i = !0), f;
|
|
273
|
+
}, f.locale = W, f.isDayjs = F, f.unix = function(i) {
|
|
274
|
+
return f(1e3 * i);
|
|
275
|
+
}, f.en = D[k], f.Ls = D, f.p = {}, f;
|
|
276
|
+
});
|
|
277
|
+
})(V);
|
|
278
|
+
var X = V.exports;
|
|
279
|
+
const rt = /* @__PURE__ */ R(X);
|
|
280
|
+
export {
|
|
281
|
+
rt as default
|
|
282
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 过滤对象第一层中值为 undefined 的属性(不处理嵌套对象)
|
|
3
|
+
* @param obj 待过滤的对象(仅支持纯对象,不支持数组/非对象类型)
|
|
4
|
+
* @returns 过滤后的新对象(自动剔除值为 undefined 的属性)
|
|
5
|
+
*/
|
|
6
|
+
export declare function filterUndefinedProperties<T extends Record<string, any>>(obj: T): Pick<T, {
|
|
7
|
+
[K in keyof T]: T[K] extends undefined ? never : K;
|
|
8
|
+
}[keyof T]>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TmuyunTracker } from '@kbapp/tmuyun-tracker';
|
|
2
|
+
import { GsidoTracker, DocVisitEvent, DocActionEvent } from '@kbapp/gsido-tracker';
|
|
3
|
+
/**
|
|
4
|
+
* @description 开吧埋点核心工具类(融合 Gsido 和天目云)
|
|
5
|
+
* @class MediaFusionTracker
|
|
6
|
+
* @example
|
|
7
|
+
* import { MediaFusionTracker } from '@kbapp/media-fusion-tracker';
|
|
8
|
+
*
|
|
9
|
+
* const kbTracker = new MediaFusionTracker({
|
|
10
|
+
* sdkUrl: 'https://page.kaiba315.com.cn/js/gsido-h5-min-1.0.7.1_final.js',
|
|
11
|
+
* appid: '由开吧分配',
|
|
12
|
+
* enableLog: false, // 开发环境可设为 true,开启埋点日志输出
|
|
13
|
+
* });
|
|
14
|
+
*/
|
|
15
|
+
export declare class MediaFusionTracker {
|
|
16
|
+
tmuyunTracker: TmuyunTracker;
|
|
17
|
+
gsidoTracker: GsidoTracker;
|
|
18
|
+
constructor(params: {
|
|
19
|
+
/** 由于埋点sdk过大, 所以通过sdkUrl动态加载 */
|
|
20
|
+
sdkUrl: string;
|
|
21
|
+
/** 埋点应用id, 由开吧分配 */
|
|
22
|
+
appid: string;
|
|
23
|
+
/** 开启日志 */
|
|
24
|
+
enableLog?: boolean;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @description 设置上报的公共属性
|
|
29
|
+
*/
|
|
30
|
+
setReportGlobalAttrs: (attrs?: {}) => void;
|
|
31
|
+
/**
|
|
32
|
+
* 事件上报
|
|
33
|
+
*/
|
|
34
|
+
report: (params: {
|
|
35
|
+
name: string;
|
|
36
|
+
params: Record<string, any>;
|
|
37
|
+
}) => void;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @description 上报 稿件浏览事件
|
|
41
|
+
*/
|
|
42
|
+
reportDocVisit: (params: Omit<DocVisitEvent, "docId"> & {
|
|
43
|
+
pubTime: number | string;
|
|
44
|
+
}) => void;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @description 上报 稿件动作事件
|
|
48
|
+
*/
|
|
49
|
+
reportDocAction: (params: Omit<DocActionEvent, "docId">) => void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @description 稿件动作 开吧意义上的第二类埋点
|
|
4
|
+
*/
|
|
5
|
+
export declare class DocActionEvent {
|
|
6
|
+
/**
|
|
7
|
+
* 动作标识. 以下为保留关键字, 语义相同的动作请复用如下定义:
|
|
8
|
+
* 点赞: like
|
|
9
|
+
* 分享: share
|
|
10
|
+
* 评论: reply
|
|
11
|
+
* 评论的评论: reply_r
|
|
12
|
+
* 评论的点赞: reply_l
|
|
13
|
+
* 投票: vote
|
|
14
|
+
* 签到: sign
|
|
15
|
+
* 购买: buy
|
|
16
|
+
* 打赏: reward
|
|
17
|
+
*
|
|
18
|
+
* 动作语义不符合如上定义时, 请自行定义动作标识.
|
|
19
|
+
*/
|
|
20
|
+
act: string;
|
|
21
|
+
/** 业务类型. {@link KbModule}. 非空. */
|
|
22
|
+
biz: string;
|
|
23
|
+
/** 业务单元. 用以保持稿件定义的同构性: 同一个业务单元下的 ref 含义和层级结构总是一致的. 可为空. */
|
|
24
|
+
unit?: string;
|
|
25
|
+
/** 对象标识1. 非空. */
|
|
26
|
+
ref1: string;
|
|
27
|
+
/** 对象标识2. 可为空. */
|
|
28
|
+
ref2?: string;
|
|
29
|
+
/** 对象标识3. 可为空. */
|
|
30
|
+
ref3?: string;
|
|
31
|
+
/** 站点 ID. 可为空. */
|
|
32
|
+
sid?: number;
|
|
33
|
+
/** 稿件标识, 拼接非空字段得到: biz-unit-ref1-ref2-ref3-siteId */
|
|
34
|
+
docId: string;
|
|
35
|
+
/**
|
|
36
|
+
* 稿件标题. 非空.
|
|
37
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
38
|
+
*/
|
|
39
|
+
title: string;
|
|
40
|
+
/**
|
|
41
|
+
* 所属单位. 可为空.
|
|
42
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
43
|
+
*/
|
|
44
|
+
channel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 所属部门. 部门是单位的下属组织. 可为空.
|
|
47
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
48
|
+
*/
|
|
49
|
+
depart?: string;
|
|
50
|
+
/**
|
|
51
|
+
* 所属统计模块. 统计模块规定了稿件的各统计计数的汇总单元. 可为空.
|
|
52
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
53
|
+
*/
|
|
54
|
+
modules?: string[];
|
|
55
|
+
constructor(params: Omit<DocActionEvent, 'docId'>);
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @description 生成稿件标识
|
|
59
|
+
*/
|
|
60
|
+
static generateDocId(params: DocActionEvent): string;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @description 生成稿件数据(自动生成docId)
|
|
64
|
+
*/
|
|
65
|
+
static createDocTrackEvent(params: Omit<DocActionEvent, 'docId'>): Pick<DocActionEvent, "docId" | "biz" | "unit" | "ref1" | "ref2" | "ref3" | "sid" | "title" | "channel" | "depart" | "modules" | "act" | undefined>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @description 稿件浏览 开吧意义上的第一类埋点
|
|
4
|
+
*/
|
|
5
|
+
export declare class DocVisitEvent {
|
|
6
|
+
/**
|
|
7
|
+
* 访问来源, {@link Doc#getDocId()} 上级页面的稿件标识. 可为空.
|
|
8
|
+
*/
|
|
9
|
+
referer?: string;
|
|
10
|
+
/** 分享人的用用户id, 分享出去的链接自动追加 suid=xxx */
|
|
11
|
+
suid?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 业务类型. {@link KbModule}. 非空.
|
|
14
|
+
*/
|
|
15
|
+
biz: string;
|
|
16
|
+
/**
|
|
17
|
+
* 业务单元. 用以保持稿件定义的同构性: 同一个业务单元下的 ref 含义和层级结构总是一致的. 可为空.
|
|
18
|
+
*/
|
|
19
|
+
unit?: string;
|
|
20
|
+
/**
|
|
21
|
+
* 对象标识1. 非空.
|
|
22
|
+
*/
|
|
23
|
+
ref1: string;
|
|
24
|
+
/**
|
|
25
|
+
* 对象标识2. 可为空.
|
|
26
|
+
*/
|
|
27
|
+
ref2?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 对象标识3. 可为空.
|
|
30
|
+
*/
|
|
31
|
+
ref3?: string;
|
|
32
|
+
/**
|
|
33
|
+
* 站点 ID. 可为空.
|
|
34
|
+
*/
|
|
35
|
+
sid?: number;
|
|
36
|
+
/** 稿件标识, 拼接非空字段得到: biz-unit-ref1-ref2-ref3-siteId, 可通过 createDocTrackEvent 自动生成 */
|
|
37
|
+
docId: string;
|
|
38
|
+
/**
|
|
39
|
+
* 稿件标题. 非空.
|
|
40
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
41
|
+
*/
|
|
42
|
+
title: string;
|
|
43
|
+
/**
|
|
44
|
+
* 所属单位. 可为空.
|
|
45
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
46
|
+
*/
|
|
47
|
+
channel?: string;
|
|
48
|
+
/**
|
|
49
|
+
* 所属部门. 部门是单位的下属组织. 可为空.
|
|
50
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
51
|
+
*/
|
|
52
|
+
depart?: string;
|
|
53
|
+
/**
|
|
54
|
+
* 所属统计模块. 统计模块规定了稿件的各统计计数的汇总单元. 可为空.
|
|
55
|
+
* 此为冗余字段, 以便在分析平台查询. 考核统计场景下应使用维表.
|
|
56
|
+
*/
|
|
57
|
+
modules?: string[];
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* 稿件递送时间
|
|
61
|
+
* 2026.7.3新增,其实不应该放在这个位置,但是为了之前让第三方不需要改动太大
|
|
62
|
+
* */
|
|
63
|
+
pubTime?: string | number;
|
|
64
|
+
constructor(params: Omit<DocVisitEvent, 'docId'>);
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @description 生成稿件标识
|
|
68
|
+
*/
|
|
69
|
+
static generateDocId(params: DocVisitEvent): string;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @description 生成稿件数据(自动生成docId)
|
|
73
|
+
*/
|
|
74
|
+
static createDocTrackEvent(params: Omit<DocVisitEvent, 'docId'>): Pick<DocVisitEvent, "docId" | "referer" | "suid" | "biz" | "unit" | "ref1" | "ref2" | "ref3" | "sid" | "title" | "channel" | "depart" | "modules" | "pubTime" | undefined>;
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(G,V){typeof exports=="object"&&typeof module!="undefined"?V(exports,require("@kbapp/js-bridge")):typeof define=="function"&&define.amd?define(["exports","@kbapp/js-bridge"],V):(G=typeof globalThis!="undefined"?globalThis:G||self,V(G.kbMediaFusionTracker={},G.kbBridge))})(this,(function(G,V){"use strict";var $t=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ot(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Be={exports:{}};(function(a,t){(function(n,c){a.exports=c()})($t,function(){var n=1e3,c=6e4,y=36e5,_="millisecond",A="second",T="minute",$="hour",D="day",R="week",k="month",J="quarter",Y="year",W="date",he="Invalid Date",$e=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ie=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Oe={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var l=["th","st","nd","rd"],o=h%100;return"["+h+(l[(o-20)%10]||l[o]||l[0])+"]"}},oe=function(h,l,o){var f=String(h);return!f||f.length>=l?h:""+Array(l+1-f.length).join(o)+h},pe={s:oe,z:function(h){var l=-h.utcOffset(),o=Math.abs(l),f=Math.floor(o/60),s=o%60;return(l<=0?"+":"-")+oe(f,2,"0")+":"+oe(s,2,"0")},m:function h(l,o){if(l.date()<o.date())return-h(o,l);var f=12*(o.year()-l.year())+(o.month()-l.month()),s=l.clone().add(f,k),b=o-s<0,u=l.clone().add(f+(b?-1:1),k);return+(-(f+(o-s)/(b?s-u:u-s))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:k,y:Y,w:R,d:D,D:W,h:$,m:T,s:A,ms:_,Q:J}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},F="en",x={};x[F]=Oe;var be="$isDayjsObject",ae=function(h){return h instanceof Q||!(!h||!h[be])},Z=function h(l,o,f){var s;if(!l)return F;if(typeof l=="string"){var b=l.toLowerCase();x[b]&&(s=b),o&&(x[b]=o,s=b);var u=l.split("-");if(!s&&u.length>1)return h(u[0])}else{var g=l.name;x[g]=l,s=g}return!f&&s&&(F=s),s||!f&&F},N=function(h,l){if(ae(h))return h.clone();var o=typeof l=="object"?l:{};return o.date=h,o.args=arguments,new Q(o)},v=pe;v.l=Z,v.i=ae,v.w=function(h,l){return N(h,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var Q=(function(){function h(o){this.$L=Z(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[be]=!0}var l=h.prototype;return l.parse=function(o){this.$d=(function(f){var s=f.date,b=f.utc;if(s===null)return new Date(NaN);if(v.u(s))return new Date;if(s instanceof Date)return new Date(s);if(typeof s=="string"&&!/Z$/i.test(s)){var u=s.match($e);if(u){var g=u[2]-1||0,O=(u[7]||"0").substring(0,3);return b?new Date(Date.UTC(u[1],g,u[3]||1,u[4]||0,u[5]||0,u[6]||0,O)):new Date(u[1],g,u[3]||1,u[4]||0,u[5]||0,u[6]||0,O)}}return new Date(s)})(o),this.init()},l.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},l.$utils=function(){return v},l.isValid=function(){return this.$d.toString()!==he},l.isSame=function(o,f){var s=N(o);return this.startOf(f)<=s&&s<=this.endOf(f)},l.isAfter=function(o,f){return N(o)<this.startOf(f)},l.isBefore=function(o,f){return this.endOf(f)<N(o)},l.$g=function(o,f,s){return v.u(o)?this[f]:this.set(s,o)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(o,f){var s=this,b=!!v.u(f)||f,u=v.p(o),g=function(z,j){var C=v.w(s.$u?Date.UTC(s.$y,j,z):new Date(s.$y,j,z),s);return b?C:C.endOf(D)},O=function(z,j){return v.w(s.toDate()[z].apply(s.toDate("s"),(b?[0,0,0,0]:[23,59,59,999]).slice(j)),s)},m=this.$W,E=this.$M,S=this.$D,K="set"+(this.$u?"UTC":"");switch(u){case Y:return b?g(1,0):g(31,11);case k:return b?g(1,E):g(0,E+1);case R:var U=this.$locale().weekStart||0,X=(m<U?m+7:m)-U;return g(b?S-X:S+(6-X),E);case D:case W:return O(K+"Hours",0);case $:return O(K+"Minutes",1);case T:return O(K+"Seconds",2);case A:return O(K+"Milliseconds",3);default:return this.clone()}},l.endOf=function(o){return this.startOf(o,!1)},l.$set=function(o,f){var s,b=v.p(o),u="set"+(this.$u?"UTC":""),g=(s={},s[D]=u+"Date",s[W]=u+"Date",s[k]=u+"Month",s[Y]=u+"FullYear",s[$]=u+"Hours",s[T]=u+"Minutes",s[A]=u+"Seconds",s[_]=u+"Milliseconds",s)[b],O=b===D?this.$D+(f-this.$W):f;if(b===k||b===Y){var m=this.clone().set(W,1);m.$d[g](O),m.init(),this.$d=m.set(W,Math.min(this.$D,m.daysInMonth())).$d}else g&&this.$d[g](O);return this.init(),this},l.set=function(o,f){return this.clone().$set(o,f)},l.get=function(o){return this[v.p(o)]()},l.add=function(o,f){var s,b=this;o=Number(o);var u=v.p(f),g=function(E){var S=N(b);return v.w(S.date(S.date()+Math.round(E*o)),b)};if(u===k)return this.set(k,this.$M+o);if(u===Y)return this.set(Y,this.$y+o);if(u===D)return g(1);if(u===R)return g(7);var O=(s={},s[T]=c,s[$]=y,s[A]=n,s)[u]||1,m=this.$d.getTime()+o*O;return v.w(m,this)},l.subtract=function(o,f){return this.add(-1*o,f)},l.format=function(o){var f=this,s=this.$locale();if(!this.isValid())return s.invalidDate||he;var b=o||"YYYY-MM-DDTHH:mm:ssZ",u=v.z(this),g=this.$H,O=this.$m,m=this.$M,E=s.weekdays,S=s.months,K=s.meridiem,U=function(j,C,ee,se){return j&&(j[C]||j(f,b))||ee[C].slice(0,se)},X=function(j){return v.s(g%12||12,j,"0")},z=K||function(j,C,ee){var se=j<12?"AM":"PM";return ee?se.toLowerCase():se};return b.replace(ie,function(j,C){return C||(function(ee){switch(ee){case"YY":return String(f.$y).slice(-2);case"YYYY":return v.s(f.$y,4,"0");case"M":return m+1;case"MM":return v.s(m+1,2,"0");case"MMM":return U(s.monthsShort,m,S,3);case"MMMM":return U(S,m);case"D":return f.$D;case"DD":return v.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return U(s.weekdaysMin,f.$W,E,2);case"ddd":return U(s.weekdaysShort,f.$W,E,3);case"dddd":return E[f.$W];case"H":return String(g);case"HH":return v.s(g,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return z(g,O,!0);case"A":return z(g,O,!1);case"m":return String(O);case"mm":return v.s(O,2,"0");case"s":return String(f.$s);case"ss":return v.s(f.$s,2,"0");case"SSS":return v.s(f.$ms,3,"0");case"Z":return u}return null})(j)||u.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(o,f,s){var b,u=this,g=v.p(f),O=N(o),m=(O.utcOffset()-this.utcOffset())*c,E=this-O,S=function(){return v.m(u,O)};switch(g){case Y:b=S()/12;break;case k:b=S();break;case J:b=S()/3;break;case R:b=(E-m)/6048e5;break;case D:b=(E-m)/864e5;break;case $:b=E/y;break;case T:b=E/c;break;case A:b=E/n;break;default:b=E}return s?b:v.a(b)},l.daysInMonth=function(){return this.endOf(k).$D},l.$locale=function(){return x[this.$L]},l.locale=function(o,f){if(!o)return this.$L;var s=this.clone(),b=Z(o,f,!0);return b&&(s.$L=b),s},l.clone=function(){return v.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},h})(),ye=Q.prototype;return N.prototype=ye,[["$ms",_],["$s",A],["$m",T],["$H",$],["$W",D],["$M",k],["$y",Y],["$D",W]].forEach(function(h){ye[h[1]]=function(l){return this.$g(l,h[0],h[1])}}),N.extend=function(h,l){return h.$i||(h(l,Q,N),h.$i=!0),N},N.locale=Z,N.isDayjs=ae,N.unix=function(h){return N(1e3*h)},N.en=x[F],N.Ls=x,N.p={},N})})(Be);var Nt=Be.exports;const Fe=Ot(Nt),je="GetuiDataSDK";(function(a){var t=window,n=a.name;t.GetuiData=n,t[n]=t[n]||function(T){return function(){(t[n]._q=t[n]._q||[]).push([T,arguments])}};for(var c=["init","track","autoTrack"],y=0;y<c.length;y++)t[n][c[y]]=t[n].call(null,c[y]);var _=document.createElement("script");_.type="text/javascript",_.async=!0,_.src=a.sdk_url;var A=document.getElementsByTagName("script")[0];t[n].customPara=a,A.parentNode.insertBefore(_,A)})({sdk_url:"https://cdn-getuigw.getui.com/iopsdk/getuidata.min.js",name:je,appId:"NFkk0GStpm6zYTajGbOoUC",server_url:"https://bggt.tmuyun.com/iop-ps/sdk/data.gif",show_log:!1}),window[je].autoTrack();const At=new Proxy({},{get:function(a,t,n){const c=window[je]||window.GetuiData;return c?typeof c[t]=="function"?c[t].bind(c):c[t]:function(){console.error("sdk未初始化")}}});var It=Object.defineProperty,Ke=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,qe=(a,t,n)=>t in a?It(a,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[t]=n,Mt=(a,t)=>{for(var n in t||(t={}))Et.call(t,n)&&qe(a,n,t[n]);if(Ke)for(var n of Ke(t))Dt.call(t,n)&&qe(a,n,t[n]);return a};function jt(a){At.track("newsInfoPv",Mt({},a))}const I=class{constructor(t){this.value=t.value,this.label=t.label}static values(){return[this.NEWS,this.IMAGE,this.TOPIC,this.LINK,this.ACTIVITY,this.VIDEO,this.LIVE,this.WORD,this.AUDIO]}static getDocTypeByValue(t){return this.values().find(n=>n.value===t)}};I.NEWS=new I({value:1,label:"新闻稿"}),I.IMAGE=new I({value:2,label:"图集稿"}),I.TOPIC=new I({value:3,label:"专题稿"}),I.LINK=new I({value:4,label:"链接稿"}),I.ACTIVITY=new I({value:5,label:"活动稿"}),I.VIDEO=new I({value:7,label:"视频稿"}),I.LIVE=new I({value:8,label:"直播稿"}),I.WORD=new I({value:9,label:"广电文稿"}),I.AUDIO=new I({value:12,label:"音频稿"});let w=I;const p=class{constructor(t){this.editionNumber=t.editionNumber,this.editionName=t.editionName,this.docType=t.docType}};p.NEWS=new p({editionNumber:"news",editionName:"新闻资讯",docType:w.NEWS.label}),p.NEWS_NEO=new p({editionNumber:"news_neo",editionName:"新版资讯",docType:w.NEWS.label}),p.PROGRAM=new p({editionNumber:"program",editionName:"电台广播",docType:w.NEWS.label}),p.HOT_TOPIC=new p({editionNumber:"hot_topic",editionName:"热门专题",docType:w.NEWS.label}),p.VIDEO_LIVE=new p({editionNumber:"video_live",editionName:"视频直播",docType:w.NEWS.label}),p.HOOLO=new p({editionNumber:"hoolo",editionName:"精彩⽂⼴",docType:w.NEWS.label}),p.ACTIVITY=new p({editionNumber:"activity",editionName:"⽤户活动",docType:w.ACTIVITY.label}),p.CIRCLE=new p({editionNumber:"circle",editionName:"圈子话题",docType:w.NEWS.label}),p.EXT=new p({editionNumber:"ext",editionName:"精彩杭州",docType:w.NEWS.label}),p.REVEAL_NODE=new p({editionNumber:"reveal_node",editionName:"爆料台",docType:w.NEWS.label}),p.REVEAL_MAIN=new p({editionNumber:"reveal_main",editionName:"爆料台",docType:w.NEWS.label}),p.ACT_MIX=new p({editionNumber:"act_mix",editionName:"活动菜单",docType:w.ACTIVITY.label}),p.APP_MAIN_PAGE=new p({editionNumber:"app_main_page",editionName:"app主页",docType:w.TOPIC.label}),p.AUDIO_LIVE=new p({editionNumber:"audio_live",editionName:"广播页面",docType:w.LIVE.label}),p.NEWS_NEO_GROUP_TOPIC=new p({editionNumber:"group_topic",editionName:"资讯专题",docType:w.TOPIC.label}),p.MALL=new p({editionNumber:"mall",editionName:"商城",docType:w.ACTIVITY.label}),p.MINI_THEATRE=new p({editionNumber:"mini_theatre",editionName:"微短剧",docType:w.VIDEO.label}),p.PLAYBACK=new p({editionNumber:"playback",editionName:"节目回放",docType:w.AUDIO.label}),p.NEWS_NEO_PROGRAMME=new p({editionNumber:"programme",editionName:"栏目主页",docType:w.LIVE.label}),p.WORK_ORDER=new p({editionNumber:"work_order",editionName:"工单",docType:w.ACTIVITY.label}),p.ACTIVITY_HUB=new p({editionNumber:"activity_hub",editionName:"临时活动",docType:w.ACTIVITY.label}),p.ART_MAP=new p({editionNumber:"art_map",editionName:"艺术地图",docType:w.ACTIVITY.label}),p.ENROLL=new p({editionNumber:"enroll",editionName:"报名征集",docType:w.TOPIC.label});var St=Object.defineProperty,Je=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,Ze=(a,t,n)=>t in a?St(a,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[t]=n,Lt=(a,t)=>{for(var n in t||(t={}))kt.call(t,n)&&Ze(a,n,t[n]);if(Je)for(var n of Je(t))Pt.call(t,n)&&Ze(a,n,t[n]);return a};class xt{constructor(t){this.report=n=>{var c,y,_,A;if(!n.docId||!n.title)throw new Error("tmuyunTracker.report docId 和 title 是必填项");const T=(D,R=36)=>D==null?void 0:D.slice(0,R),$={NewsArticleID:n.docId,SelfNewsArticleID:n.docId,NewsArticleTitle:T(n.title)||"",NewsEditionNumber:(c=n.tmuyunModel)==null?void 0:c.editionNumber,NewsEditionName:(y=n.tmuyunModel)==null?void 0:y.editionName,NewsArticleType:(_=n.tmuyunModel)==null?void 0:_.docType,NewsArticleSource:T(n.source),NewsArticleAuthor:T(n.author),NewsArticlePubtime:n.pubTime?Fe(n.pubTime).format("YYYY-MM-DD HH:mm:ss"):Fe().startOf("day").format("YYYY-MM-DD HH:mm:ss")};jt($),this.enableLog&&console.log("[天目云] 端外浏览点",Lt({},$)),(A=this==null?void 0:this.onAfterTracker)==null||A.call(this,{originTrackParams:n,tmuyunTrackParams:$})},this.enableLog=(t==null?void 0:t.enableLog)||!1,this.onAfterTracker=t==null?void 0:t.onAfterTracker}}function Se(a){const t=[];return Object.keys(a).forEach(n=>{t.push([n,a[n]])}),new Map(t)}const Yt=a=>window[a.key]?window[a.key]:new Promise((t,n)=>{const c=window.document.createElement("script");c.setAttribute("src",a.src),c.async=!0,c.onload=()=>{t(window[a.key])},c.onerror=y=>{n(y)},window.document.head.appendChild(c)});var ke=(a,t,n)=>new Promise((c,y)=>{var _=$=>{try{T(n.next($))}catch(D){y(D)}},A=$=>{try{T(n.throw($))}catch(D){y(D)}},T=$=>$.done?c($.value):Promise.resolve($.value).then(_,A);T((n=n.apply(a,t)).next())});const Ct=a=>{let t;const n=a.sdkURL,c=a.gsAppid;function y(){return ke(this,null,function*(){return n?t||(t=new Promise((_,A)=>ke(null,null,function*(){try{yield Yt({src:n,key:"GsIdo"}),_(window.GsIdo)}catch(T){t=void 0,A(T)}}))):Promise.reject(new Error("GsIdo SDK 地址未配置,请先在构造函数中传入 sdkURL"))})}return{load:y,init:(()=>{let _;return()=>_||(_=new Promise((A,T)=>ke(null,null,function*(){try{return yield y(),yield window.GsIdo.init({gsAppid:c}),A(window.GsIdo)}catch($){T($),_=void 0}})))})()}};class Vt{constructor(t){this.loader=Ct(t)}getGsido(){return window.GsIdo}init(){return this.loader.init()}setDebugEnable(...t){return this.callMethod("setDebugEnable",...t)}onEvent(...t){return this.callMethod("onEvent",...t)}onBeginEvent(...t){return this.callMethod("onBeginEvent",...t)}onEndEvent(...t){return this.callMethod("onEndEvent",...t)}callMethod(t,...n){return this.loader.init().then(c=>{const y=c[t];if(typeof y!="function")throw new Error(`${String(t)} 不是 GsIdo 的有效方法`);return y(...n)})}}var me=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Rt(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var fe={exports:{}};fe.exports;var Qe;function Wt(){return Qe||(Qe=1,(function(a,t){var n=200,c="__lodash_hash_undefined__",y=9007199254740991,_="[object Arguments]",A="[object Array]",T="[object Boolean]",$="[object Date]",D="[object Error]",R="[object Function]",k="[object GeneratorFunction]",J="[object Map]",Y="[object Number]",W="[object Object]",he="[object Promise]",$e="[object RegExp]",ie="[object Set]",Oe="[object String]",oe="[object Symbol]",pe="[object WeakMap]",F="[object ArrayBuffer]",x="[object DataView]",be="[object Float32Array]",ae="[object Float64Array]",Z="[object Int8Array]",N="[object Int16Array]",v="[object Int32Array]",Q="[object Uint8Array]",ye="[object Uint8ClampedArray]",h="[object Uint16Array]",l="[object Uint32Array]",o=/[\\^$.*+?()[\]{}|]/g,f=/\w*$/,s=/^\[object .+?Constructor\]$/,b=/^(?:0|[1-9]\d*)$/,u={};u[_]=u[A]=u[F]=u[x]=u[T]=u[$]=u[be]=u[ae]=u[Z]=u[N]=u[v]=u[J]=u[Y]=u[W]=u[$e]=u[ie]=u[Oe]=u[oe]=u[Q]=u[ye]=u[h]=u[l]=!0,u[D]=u[R]=u[pe]=!1;var g=typeof me=="object"&&me&&me.Object===Object&&me,O=typeof self=="object"&&self&&self.Object===Object&&self,m=g||O||Function("return this")(),E=t&&!t.nodeType&&t,S=E&&!0&&a&&!a.nodeType&&a,K=S&&S.exports===E;function U(e,r){return e.set(r[0],r[1]),e}function X(e,r){return e.add(r),e}function z(e,r){for(var i=-1,d=e?e.length:0;++i<d&&r(e[i],i,e)!==!1;);return e}function j(e,r){for(var i=-1,d=r.length,M=e.length;++i<d;)e[M+i]=r[i];return e}function C(e,r,i,d){for(var M=-1,P=e?e.length:0;++M<P;)i=r(i,e[M],M,e);return i}function ee(e,r){for(var i=-1,d=Array(e);++i<e;)d[i]=r(i);return d}function se(e,r){return e==null?void 0:e[r]}function tt(e){var r=!1;if(e!=null&&typeof e.toString!="function")try{r=!!(e+"")}catch(i){}return r}function rt(e){var r=-1,i=Array(e.size);return e.forEach(function(d,M){i[++r]=[M,d]}),i}function Pe(e,r){return function(i){return e(r(i))}}function nt(e){var r=-1,i=Array(e.size);return e.forEach(function(d){i[++r]=d}),i}var Ft=Array.prototype,Kt=Function.prototype,Ne=Object.prototype,Le=m["__core-js_shared__"],it=(function(){var e=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),ot=Kt.toString,q=Ne.hasOwnProperty,Ae=Ne.toString,qt=RegExp("^"+ot.call(q).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),at=K?m.Buffer:void 0,st=m.Symbol,ut=m.Uint8Array,Jt=Pe(Object.getPrototypeOf,Object),Zt=Object.create,Qt=Ne.propertyIsEnumerable,Xt=Ft.splice,ct=Object.getOwnPropertySymbols,er=at?at.isBuffer:void 0,tr=Pe(Object.keys,Object),xe=le(m,"DataView"),ve=le(m,"Map"),Ye=le(m,"Promise"),Ce=le(m,"Set"),Ve=le(m,"WeakMap"),ge=le(Object,"create"),rr=ne(xe),nr=ne(ve),ir=ne(Ye),or=ne(Ce),ar=ne(Ve),lt=st?st.prototype:void 0,dt=lt?lt.valueOf:void 0;function te(e){var r=-1,i=e?e.length:0;for(this.clear();++r<i;){var d=e[r];this.set(d[0],d[1])}}function sr(){this.__data__=ge?ge(null):{}}function ur(e){return this.has(e)&&delete this.__data__[e]}function cr(e){var r=this.__data__;if(ge){var i=r[e];return i===c?void 0:i}return q.call(r,e)?r[e]:void 0}function lr(e){var r=this.__data__;return ge?r[e]!==void 0:q.call(r,e)}function dr(e,r){var i=this.__data__;return i[e]=ge&&r===void 0?c:r,this}te.prototype.clear=sr,te.prototype.delete=ur,te.prototype.get=cr,te.prototype.has=lr,te.prototype.set=dr;function H(e){var r=-1,i=e?e.length:0;for(this.clear();++r<i;){var d=e[r];this.set(d[0],d[1])}}function fr(){this.__data__=[]}function hr(e){var r=this.__data__,i=Ie(r,e);if(i<0)return!1;var d=r.length-1;return i==d?r.pop():Xt.call(r,i,1),!0}function pr(e){var r=this.__data__,i=Ie(r,e);return i<0?void 0:r[i][1]}function br(e){return Ie(this.__data__,e)>-1}function yr(e,r){var i=this.__data__,d=Ie(i,e);return d<0?i.push([e,r]):i[d][1]=r,this}H.prototype.clear=fr,H.prototype.delete=hr,H.prototype.get=pr,H.prototype.has=br,H.prototype.set=yr;function ue(e){var r=-1,i=e?e.length:0;for(this.clear();++r<i;){var d=e[r];this.set(d[0],d[1])}}function vr(){this.__data__={hash:new te,map:new(ve||H),string:new te}}function gr(e){return Ee(this,e).delete(e)}function mr(e){return Ee(this,e).get(e)}function wr(e){return Ee(this,e).has(e)}function _r(e,r){return Ee(this,e).set(e,r),this}ue.prototype.clear=vr,ue.prototype.delete=gr,ue.prototype.get=mr,ue.prototype.has=wr,ue.prototype.set=_r;function ce(e){this.__data__=new H(e)}function Tr(){this.__data__=new H}function $r(e){return this.__data__.delete(e)}function Or(e){return this.__data__.get(e)}function Nr(e){return this.__data__.has(e)}function Ar(e,r){var i=this.__data__;if(i instanceof H){var d=i.__data__;if(!ve||d.length<n-1)return d.push([e,r]),this;i=this.__data__=new ue(d)}return i.set(e,r),this}ce.prototype.clear=Tr,ce.prototype.delete=$r,ce.prototype.get=Or,ce.prototype.has=Nr,ce.prototype.set=Ar;function Ir(e,r){var i=Ge(e)||Zr(e)?ee(e.length,String):[],d=i.length,M=!!d;for(var P in e)q.call(e,P)&&!(M&&(P=="length"||Fr(P,d)))&&i.push(P);return i}function ft(e,r,i){var d=e[r];(!(q.call(e,r)&&yt(d,i))||i===void 0&&!(r in e))&&(e[r]=i)}function Ie(e,r){for(var i=e.length;i--;)if(yt(e[i][0],r))return i;return-1}function Er(e,r){return e&&ht(r,Ue(r),e)}function Re(e,r,i,d,M,P,B){var L;if(d&&(L=P?d(e,M,P,B):d(e)),L!==void 0)return L;if(!De(e))return e;var mt=Ge(e);if(mt){if(L=zr(e),!r)return Wr(e,L)}else{var de=re(e),wt=de==R||de==k;if(Xr(e))return Pr(e,r);if(de==W||de==_||wt&&!P){if(tt(e))return P?e:{};if(L=Hr(wt?{}:e),!r)return Gr(e,Er(L,e))}else{if(!u[de])return P?e:{};L=Br(e,de,Re,r)}}B||(B=new ce);var _t=B.get(e);if(_t)return _t;if(B.set(e,L),!mt)var Tt=i?Ur(e):Ue(e);return z(Tt||e,function(ze,Me){Tt&&(Me=ze,ze=e[Me]),ft(L,Me,Re(ze,r,i,d,Me,e,B))}),L}function Dr(e){return De(e)?Zt(e):{}}function Mr(e,r,i){var d=r(e);return Ge(e)?d:j(d,i(e))}function jr(e){return Ae.call(e)}function Sr(e){if(!De(e)||qr(e))return!1;var r=gt(e)||tt(e)?qt:s;return r.test(ne(e))}function kr(e){if(!bt(e))return tr(e);var r=[];for(var i in Object(e))q.call(e,i)&&i!="constructor"&&r.push(i);return r}function Pr(e,r){if(r)return e.slice();var i=new e.constructor(e.length);return e.copy(i),i}function We(e){var r=new e.constructor(e.byteLength);return new ut(r).set(new ut(e)),r}function Lr(e,r){var i=r?We(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}function xr(e,r,i){var d=r?i(rt(e),!0):rt(e);return C(d,U,new e.constructor)}function Yr(e){var r=new e.constructor(e.source,f.exec(e));return r.lastIndex=e.lastIndex,r}function Cr(e,r,i){var d=r?i(nt(e),!0):nt(e);return C(d,X,new e.constructor)}function Vr(e){return dt?Object(dt.call(e)):{}}function Rr(e,r){var i=r?We(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function Wr(e,r){var i=-1,d=e.length;for(r||(r=Array(d));++i<d;)r[i]=e[i];return r}function ht(e,r,i,d){i||(i={});for(var M=-1,P=r.length;++M<P;){var B=r[M],L=void 0;ft(i,B,L===void 0?e[B]:L)}return i}function Gr(e,r){return ht(e,pt(e),r)}function Ur(e){return Mr(e,Ue,pt)}function Ee(e,r){var i=e.__data__;return Kr(r)?i[typeof r=="string"?"string":"hash"]:i.map}function le(e,r){var i=se(e,r);return Sr(i)?i:void 0}var pt=ct?Pe(ct,Object):rn,re=jr;(xe&&re(new xe(new ArrayBuffer(1)))!=x||ve&&re(new ve)!=J||Ye&&re(Ye.resolve())!=he||Ce&&re(new Ce)!=ie||Ve&&re(new Ve)!=pe)&&(re=function(e){var r=Ae.call(e),i=r==W?e.constructor:void 0,d=i?ne(i):void 0;if(d)switch(d){case rr:return x;case nr:return J;case ir:return he;case or:return ie;case ar:return pe}return r});function zr(e){var r=e.length,i=e.constructor(r);return r&&typeof e[0]=="string"&&q.call(e,"index")&&(i.index=e.index,i.input=e.input),i}function Hr(e){return typeof e.constructor=="function"&&!bt(e)?Dr(Jt(e)):{}}function Br(e,r,i,d){var M=e.constructor;switch(r){case F:return We(e);case T:case $:return new M(+e);case x:return Lr(e,d);case be:case ae:case Z:case N:case v:case Q:case ye:case h:case l:return Rr(e,d);case J:return xr(e,d,i);case Y:case Oe:return new M(e);case $e:return Yr(e);case ie:return Cr(e,d,i);case oe:return Vr(e)}}function Fr(e,r){return r=r==null?y:r,!!r&&(typeof e=="number"||b.test(e))&&e>-1&&e%1==0&&e<r}function Kr(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function qr(e){return!!it&&it in e}function bt(e){var r=e&&e.constructor,i=typeof r=="function"&&r.prototype||Ne;return e===i}function ne(e){if(e!=null){try{return ot.call(e)}catch(r){}try{return e+""}catch(r){}}return""}function Jr(e){return Re(e,!0,!0)}function yt(e,r){return e===r||e!==e&&r!==r}function Zr(e){return Qr(e)&&q.call(e,"callee")&&(!Qt.call(e,"callee")||Ae.call(e)==_)}var Ge=Array.isArray;function vt(e){return e!=null&&en(e.length)&&!gt(e)}function Qr(e){return tn(e)&&vt(e)}var Xr=er||nn;function gt(e){var r=De(e)?Ae.call(e):"";return r==R||r==k}function en(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=y}function De(e){var r=typeof e;return!!e&&(r=="object"||r=="function")}function tn(e){return!!e&&typeof e=="object"}function Ue(e){return vt(e)?Ir(e):kr(e)}function rn(){return[]}function nn(){return!1}a.exports=Jr})(fe,fe.exports)),fe.exports}var Gt=Wt();const Ut=Rt(Gt);class zt{constructor(t){this.globalAttrs=[],this.enableLog=t.enableLog||!1,this.debugger=t.debugger||!1,this.gsidoProxy=new Vt({sdkURL:t.sdkUrl,gsAppid:t.appid}),this.gsidoProxy.init(),this.gsidoProxy.setDebugEnable(this.debugger)}log(...t){this.enableLog&&console.log(...t)}getReportDataMergeGlobalAttrs(t){const n={},c=Ut(Object.assign.apply(null,[{},...this.globalAttrs,t]));return Object.keys(c).forEach(y=>{if(typeof c[y]=="number")return n[y]=c[y];c[y]&&(n[y]=String(c[y]))}),n}getGsido(){return this.gsidoProxy.getGsido()}setReportGlobalAttrs(t={}){this.globalAttrs.push(t)}report(t){return V.IS_KB_APP_ENV?((n,c)=>{this.log("[个推] app.桥接.埋点",{name:n,params:c}),V.reportDAEvent({eventName:n,eventParams:c})})(t.name,this.getReportDataMergeGlobalAttrs(t.params)):((n,c)=>{this.log("[个推] js.埋点",{name:n,params:c}),this.gsidoProxy.onEvent({id:n,attrs:Se(c)})})(t.name,this.getReportDataMergeGlobalAttrs(t.params))}reportBeginEvent(t){return V.IS_KB_APP_ENV?((n,c)=>{this.log("[个推] app.桥接.begin埋点",{name:n,params:c}),V.reportDAEvent({eventName:n,eventParams:c,eventType:"Begin"})})(t.name,this.getReportDataMergeGlobalAttrs(t.params)):((n,c)=>{this.log("[个推] js.begin埋点",{name:n,params:c}),this.gsidoProxy.onBeginEvent({id:n,attrs:Se(c)})})(t.name,this.getReportDataMergeGlobalAttrs(t.params))}reportEndEvent(t){return V.IS_KB_APP_ENV?((n,c)=>{this.log("[个推] app.桥接.end埋点",{name:n,params:c}),V.reportDAEvent({eventName:n,eventParams:c,eventType:"End"})})(t.name,this.getReportDataMergeGlobalAttrs(t.params)):((n,c)=>{this.log("[个推] js.end埋点",{name:n,params:c}),this.gsidoProxy.onEndEvent({id:n,attrs:Se(c)})})(t.name,this.getReportDataMergeGlobalAttrs(t.params))}}function Xe(a){if(typeof a!="object"||a===null||Array.isArray(a))return{};const t={};return Object.keys(a).forEach(n=>{const c=a[n];c!==void 0&&(t[n]=c)}),t}let Ht=class He{constructor(t){this.act=t.act,this.biz=t.biz,this.unit=t.unit,this.ref1=t.ref1,this.ref2=t.ref2,this.ref3=t.ref3,this.sid=t.sid,this.title=t.title,this.channel=t.channel,this.depart=t.depart,this.modules=t.modules,Object.defineProperty(this,"docId",{enumerable:!0,configurable:!1,get:()=>He.generateDocId(this)})}static generateDocId(t){return[t.biz,t.unit,t.ref1,t.ref2,t.ref3,t.sid].filter(n=>!!n).join("-")}static createDocTrackEvent(t){return Xe(new He(t))}};class we{constructor(t){this.referer=t.referer,this.suid=t.suid,this.biz=t.biz,this.unit=t.unit,this.ref1=t.ref1,this.ref2=t.ref2,this.ref3=t.ref3,this.sid=t.sid,this.title=t.title,this.channel=t.channel,this.depart=t.depart,this.modules=t.modules,Object.defineProperty(this,"docId",{enumerable:!0,configurable:!1,get:()=>we.generateDocId(this)})}static generateDocId(t){return[t.biz,t.unit,t.ref1,t.ref2,t.ref3,t.sid].filter(n=>!!n).join("-")}static createDocTrackEvent(t){return Xe(new we(t))}}class Bt{constructor(t){this.setReportGlobalAttrs=(n={})=>{this.gsidoTracker.setReportGlobalAttrs(n)},this.report=n=>{this.gsidoTracker.report(n),n.name==="DocVisitEvent"&&this.tmuyunTracker.report({docId:n.params.docId,title:n.params.title,pubTime:n.params.pubTime})},this.reportDocVisit=n=>{const c=we.createDocTrackEvent(n);this.gsidoTracker.report({name:"DocVisitEvent",params:c}),this.tmuyunTracker.report({docId:c.docId,title:c.title,pubTime:n.pubTime})},this.reportDocAction=n=>{this.gsidoTracker.report({name:"DocActionEvent",params:Ht.createDocTrackEvent(n)})},this.gsidoTracker=new zt({enableLog:t.enableLog,sdkUrl:t.sdkUrl,appid:t.appid}),this.tmuyunTracker=new xt({enableLog:t.enableLog})}}function et(a){if(typeof a!="object"||a===null||Array.isArray(a))return{};const t={};return Object.keys(a).forEach(n=>{const c=a[n];c!==void 0&&(t[n]=c)}),t}class _e{constructor(t){this.act=t.act,this.biz=t.biz,this.unit=t.unit,this.ref1=t.ref1,this.ref2=t.ref2,this.ref3=t.ref3,this.sid=t.sid,this.title=t.title,this.channel=t.channel,this.depart=t.depart,this.modules=t.modules,Object.defineProperty(this,"docId",{enumerable:!0,configurable:!1,get:()=>_e.generateDocId(this)})}static generateDocId(t){return[t.biz,t.unit,t.ref1,t.ref2,t.ref3,t.sid].filter(n=>!!n).join("-")}static createDocTrackEvent(t){return et(new _e(t))}}class Te{constructor(t){this.referer=t.referer,this.suid=t.suid,this.biz=t.biz,this.unit=t.unit,this.ref1=t.ref1,this.ref2=t.ref2,this.ref3=t.ref3,this.sid=t.sid,this.title=t.title,this.channel=t.channel,this.depart=t.depart,this.modules=t.modules,this.pubTime=t.pubTime,Object.defineProperty(this,"docId",{enumerable:!0,configurable:!1,get:()=>Te.generateDocId(this)})}static generateDocId(t){return[t.biz,t.unit,t.ref1,t.ref2,t.ref3,t.sid].filter(n=>!!n).join("-")}static createDocTrackEvent(t){return et(new Te(t))}}G.DocActionEvent=_e,G.DocVisitEvent=Te,G.MediaFusionTracker=Bt,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})}));
|