chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,434 @@
|
||||
/**
|
||||
* Academy embed widget SDK — floating chat launcher.
|
||||
*
|
||||
* Programmatic:
|
||||
* Academy.init({ channel, token, position, primaryColor, title, baseUrl })
|
||||
* Academy.open() | close() | toggle() | destroy()
|
||||
* Academy.on('ready', fn) | off('ready', fn)
|
||||
*
|
||||
* Host context & actions (postMessage to iframe):
|
||||
* Academy.setContext({ userId, page, ... })
|
||||
* Inject visitor/page context merged into each chat query.
|
||||
* Academy.openWithQuery('How do I reset my password?')
|
||||
* Opens the panel (if closed) and sends the query when the iframe is ready.
|
||||
* Academy.setLocale('en-US')
|
||||
* Switch embed UI language (zh-CN | zh-TW | en-US | ko-KR | ja-JP | ru-RU).
|
||||
*
|
||||
* Secure mode (recommended): instead of `token`, pass `tokenEndpoint` — a URL on
|
||||
* your own backend that returns { token: "ems_...", expiresIn: 1800 }. Your
|
||||
* backend mints that short-lived session token by exchanging the publish token
|
||||
* (kept server-side) against POST /api/v1/embed/:channel/exchange. The publish
|
||||
* token then never reaches the browser; the widget auto-refreshes before expiry.
|
||||
*
|
||||
* Legacy script-tag auto-init via data-* attributes on the script element
|
||||
* (data-channel + data-token, or data-channel + data-token-endpoint).
|
||||
*/
|
||||
(function (global) {
|
||||
'use strict';
|
||||
|
||||
var HOST_SOURCE = 'academy-host';
|
||||
var EMBED_SOURCE = 'academy-embed';
|
||||
var POSITIONS = ['bottom-right', 'bottom-left', 'top-right', 'top-left'];
|
||||
var DEFAULT_POSITION = 'bottom-right';
|
||||
var DEFAULT_COLOR = '#07C05F';
|
||||
var DEFAULT_TITLE = 'AI Assistant';
|
||||
var DEFAULT_WIDTH = 400;
|
||||
var DEFAULT_HEIGHT = 600;
|
||||
|
||||
var instance = null;
|
||||
var listeners = {};
|
||||
|
||||
function normalizePosition(pos) {
|
||||
if (!pos || POSITIONS.indexOf(pos) < 0) return DEFAULT_POSITION;
|
||||
return pos;
|
||||
}
|
||||
|
||||
function positionStyles(position, kind) {
|
||||
var isLeft = position.indexOf('left') >= 0;
|
||||
var isTop = position.indexOf('top') >= 0;
|
||||
var horizontal = isLeft ? 'left:24px' : 'right:24px';
|
||||
if (kind === 'launcher') {
|
||||
return horizontal + ';' + (isTop ? 'top:24px' : 'bottom:24px');
|
||||
}
|
||||
return horizontal + ';' + (isTop ? 'top:88px' : 'bottom:88px');
|
||||
}
|
||||
|
||||
function emit(event, payload) {
|
||||
var handlers = listeners[event];
|
||||
if (!handlers) return;
|
||||
handlers.slice().forEach(function (fn) {
|
||||
try { fn(payload); } catch (e) { console.error('[Academy]', e); }
|
||||
});
|
||||
}
|
||||
|
||||
function createWidget(opts) {
|
||||
var channelId = opts.channel || opts.channelId;
|
||||
// Insecure mode: a long-lived publish token is embedded in the page.
|
||||
var staticToken = opts.token;
|
||||
// Secure mode: the page never holds the publish token. Instead it points at
|
||||
// an endpoint on the integrator's own backend that mints a short-lived
|
||||
// session token (by server-side exchange of the publish token). The widget
|
||||
// fetches a fresh token here and refreshes it before expiry.
|
||||
var tokenEndpoint = opts.tokenEndpoint || opts.token_endpoint || '';
|
||||
if (!channelId || (!staticToken && !tokenEndpoint)) {
|
||||
console.warn('[Academy] channel and (token or tokenEndpoint) are required');
|
||||
return null;
|
||||
}
|
||||
|
||||
var currentToken = staticToken || '';
|
||||
var tokenInFlight = null;
|
||||
var refreshTimer = null;
|
||||
|
||||
function scheduleRefresh(expiresInSec) {
|
||||
if (!tokenEndpoint) return;
|
||||
if (refreshTimer) clearTimeout(refreshTimer);
|
||||
var ttl = Number(expiresInSec) > 0 ? Number(expiresInSec) : 1800;
|
||||
// Refresh at ~80% of the lifetime, never sooner than 30s.
|
||||
var delayMs = Math.max(Math.floor(ttl * 0.8), 30) * 1000;
|
||||
refreshTimer = setTimeout(function () {
|
||||
loadToken(true).then(function (tok) {
|
||||
if (tok) provideToken();
|
||||
}).catch(function () { /* keep last token; next interaction retries */ });
|
||||
}, delayMs);
|
||||
}
|
||||
|
||||
// Returns a Promise resolving to a usable token. In static mode this is the
|
||||
// embedded publish token. In secure mode it fetches from tokenEndpoint.
|
||||
function loadToken(force) {
|
||||
if (staticToken) return Promise.resolve(staticToken);
|
||||
if (currentToken && !force) return Promise.resolve(currentToken);
|
||||
if (tokenInFlight) return tokenInFlight;
|
||||
tokenInFlight = fetch(tokenEndpoint, {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
headers: { Accept: 'application/json' },
|
||||
})
|
||||
.then(function (res) {
|
||||
if (!res.ok) throw new Error('token endpoint HTTP ' + res.status);
|
||||
return res.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
var d = data || {};
|
||||
var inner = d.data || d;
|
||||
var tok = inner.token || inner.session_token || '';
|
||||
var expiresIn = inner.expiresIn || inner.expires_in || 0;
|
||||
if (!tok) throw new Error('token endpoint returned no token');
|
||||
currentToken = tok;
|
||||
scheduleRefresh(expiresIn);
|
||||
return tok;
|
||||
})
|
||||
.catch(function (e) {
|
||||
console.error('[Academy] failed to load token', e);
|
||||
throw e;
|
||||
})
|
||||
.then(function (tok) { tokenInFlight = null; return tok; }, function (e) { tokenInFlight = null; throw e; });
|
||||
return tokenInFlight;
|
||||
}
|
||||
|
||||
var position = normalizePosition(opts.position);
|
||||
var primaryColor = opts.primaryColor || opts.primary_color || DEFAULT_COLOR;
|
||||
var title = opts.title || DEFAULT_TITLE;
|
||||
var baseUrl = (opts.baseUrl || opts.base || '').replace(/\/$/, '');
|
||||
if (!baseUrl) {
|
||||
var script = document.currentScript;
|
||||
if (script && script.src) {
|
||||
baseUrl = script.src.replace(/\/academy-widget\.js.*$/, '');
|
||||
} else {
|
||||
baseUrl = global.location ? global.location.origin : '';
|
||||
}
|
||||
}
|
||||
|
||||
var panelWidth = Number(opts.width) > 0 ? Number(opts.width) : DEFAULT_WIDTH;
|
||||
var panelHeight = Number(opts.height) > 0 ? Number(opts.height) : DEFAULT_HEIGHT;
|
||||
var embedUrl = baseUrl + '/embed/' + encodeURIComponent(channelId);
|
||||
var embedOrigin = baseUrl;
|
||||
try {
|
||||
// Derive the exact origin (scheme + host + port) rather than trusting the
|
||||
// raw baseUrl string, so postMessage origin checks are precise.
|
||||
embedOrigin = new URL(embedUrl, global.location ? global.location.href : undefined).origin;
|
||||
} catch (e) {
|
||||
embedOrigin = baseUrl;
|
||||
}
|
||||
var destroyed = false;
|
||||
var panelOpen = false;
|
||||
var iframeReady = false;
|
||||
var iframeOrigin = '';
|
||||
|
||||
var launcher = document.createElement('button');
|
||||
launcher.type = 'button';
|
||||
launcher.setAttribute('aria-label', title);
|
||||
launcher.textContent = '💬';
|
||||
launcher.style.cssText = [
|
||||
'position:fixed',
|
||||
'z-index:2147483000',
|
||||
'width:56px',
|
||||
'height:56px',
|
||||
'border-radius:50%',
|
||||
'border:none',
|
||||
'cursor:pointer',
|
||||
'font-size:24px',
|
||||
'box-shadow:0 4px 16px rgba(0,0,0,.18)',
|
||||
'background:' + primaryColor,
|
||||
'color:#fff',
|
||||
'opacity:0.92',
|
||||
'transition:opacity .2s',
|
||||
positionStyles(position, 'launcher'),
|
||||
].join(';');
|
||||
|
||||
var panel = document.createElement('div');
|
||||
panel.style.cssText = [
|
||||
'position:fixed',
|
||||
'z-index:2147482999',
|
||||
'width:' + panelWidth + 'px',
|
||||
'max-width:calc(100vw - 32px)',
|
||||
'height:' + panelHeight + 'px',
|
||||
'max-height:calc(100vh - 100px)',
|
||||
'border-radius:12px',
|
||||
'overflow:hidden',
|
||||
'box-shadow:0 8px 32px rgba(0,0,0,.2)',
|
||||
'display:none',
|
||||
'background:#fff',
|
||||
positionStyles(position, 'panel'),
|
||||
].join(';');
|
||||
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.src = embedUrl;
|
||||
iframe.style.cssText = 'width:100%;height:100%;border:none';
|
||||
iframe.setAttribute('allow', 'clipboard-write');
|
||||
var hostOrigin = '';
|
||||
try {
|
||||
hostOrigin = global.location ? global.location.origin : '';
|
||||
} catch (e) { hostOrigin = ''; }
|
||||
var crossOriginEmbed = hostOrigin && embedOrigin && hostOrigin !== embedOrigin;
|
||||
var sandboxAttr = String(opts.sandbox || opts.sandboxMode || '').trim();
|
||||
if (!sandboxAttr && opts.scriptEl) {
|
||||
sandboxAttr = String(opts.scriptEl.getAttribute('data-sandbox') || '').trim();
|
||||
}
|
||||
if (sandboxAttr === 'true' || sandboxAttr === '1') {
|
||||
sandboxAttr = 'allow-scripts allow-forms allow-popups allow-modals allow-same-origin';
|
||||
}
|
||||
if (!sandboxAttr && crossOriginEmbed) {
|
||||
sandboxAttr = 'allow-scripts allow-forms allow-popups allow-modals allow-same-origin';
|
||||
}
|
||||
if (sandboxAttr && sandboxAttr !== 'false' && sandboxAttr !== '0') {
|
||||
iframe.setAttribute('sandbox', sandboxAttr);
|
||||
}
|
||||
iframe.setAttribute('title', title);
|
||||
panel.appendChild(iframe);
|
||||
|
||||
function isTrustedOrigin(origin) {
|
||||
if (!origin || origin === 'null') return false;
|
||||
return origin === embedOrigin;
|
||||
}
|
||||
|
||||
function postToIframe(message) {
|
||||
if (!iframe.contentWindow) return;
|
||||
// Always target the known embed origin; never fall back to '*' so the
|
||||
// publish token can't leak to an unexpected document.
|
||||
iframe.contentWindow.postMessage(message, embedOrigin || '/');
|
||||
}
|
||||
|
||||
function provideToken() {
|
||||
loadToken(false).then(function (tok) {
|
||||
if (!tok) return;
|
||||
postToIframe({
|
||||
source: HOST_SOURCE,
|
||||
type: 'provide_token',
|
||||
token: tok,
|
||||
channel_id: channelId,
|
||||
});
|
||||
}).catch(function () { /* already logged; iframe stays awaiting */ });
|
||||
}
|
||||
|
||||
function postHostPayload(type, payload) {
|
||||
if (!iframe.contentWindow) {
|
||||
console.warn('[Academy] iframe not ready');
|
||||
return false;
|
||||
}
|
||||
postToIframe({ source: HOST_SOURCE, type: type, payload: payload || {} });
|
||||
return true;
|
||||
}
|
||||
|
||||
function whenIframeReady(fn, attempt) {
|
||||
var tries = attempt || 0;
|
||||
if (iframeReady && iframe.contentWindow) {
|
||||
fn();
|
||||
return;
|
||||
}
|
||||
if (tries >= 20) {
|
||||
console.warn('[Academy] iframe not ready');
|
||||
return;
|
||||
}
|
||||
setTimeout(function () { whenIframeReady(fn, tries + 1); }, 100);
|
||||
}
|
||||
|
||||
function setContext(ctx) {
|
||||
if (!ctx || typeof ctx !== 'object') {
|
||||
console.warn('[Academy] setContext expects an object');
|
||||
return;
|
||||
}
|
||||
postHostPayload('set_context', ctx);
|
||||
}
|
||||
|
||||
function openWithQuery(query) {
|
||||
var text = String(query || '').trim();
|
||||
if (!text) {
|
||||
console.warn('[Academy] openWithQuery requires a non-empty query');
|
||||
return;
|
||||
}
|
||||
setOpen(true);
|
||||
whenIframeReady(function () {
|
||||
postHostPayload('open_with_query', { query: text });
|
||||
});
|
||||
}
|
||||
|
||||
function setLocale(locale) {
|
||||
var loc = String(locale || '').trim();
|
||||
if (!loc) {
|
||||
console.warn('[Academy] setLocale requires a locale string');
|
||||
return;
|
||||
}
|
||||
postHostPayload('set_locale', { locale: loc });
|
||||
}
|
||||
|
||||
function onMessage(e) {
|
||||
// Only trust messages coming from our own iframe window and origin.
|
||||
if (e.source !== iframe.contentWindow) return;
|
||||
if (!isTrustedOrigin(e.origin)) return;
|
||||
if (!e.data || e.data.source !== EMBED_SOURCE) return;
|
||||
if (e.data.channel_id && e.data.channel_id !== channelId) return;
|
||||
|
||||
if (!iframeOrigin) {
|
||||
iframeOrigin = e.origin;
|
||||
}
|
||||
|
||||
switch (e.data.type) {
|
||||
case 'bootstrap_request':
|
||||
provideToken();
|
||||
break;
|
||||
case 'ready':
|
||||
iframeReady = true;
|
||||
launcher.style.opacity = '1';
|
||||
emit('ready', { channelId: channelId });
|
||||
break;
|
||||
case 'message_sent':
|
||||
emit('message_sent', {
|
||||
channelId: channelId,
|
||||
sessionId: e.data.session_id,
|
||||
query: e.data.query,
|
||||
});
|
||||
break;
|
||||
case 'message_received':
|
||||
emit('message_received', {
|
||||
channelId: channelId,
|
||||
sessionId: e.data.session_id,
|
||||
content: e.data.content,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function setOpen(next) {
|
||||
panelOpen = !!next;
|
||||
panel.style.display = panelOpen ? 'block' : 'none';
|
||||
launcher.textContent = panelOpen ? '✕' : '💬';
|
||||
if (panelOpen) {
|
||||
emit('open', { channelId: channelId });
|
||||
} else {
|
||||
emit('close', { channelId: channelId });
|
||||
}
|
||||
}
|
||||
|
||||
function open() { setOpen(true); }
|
||||
function close() { setOpen(false); }
|
||||
function toggle() { setOpen(!panelOpen); }
|
||||
|
||||
function destroy() {
|
||||
if (destroyed) return;
|
||||
destroyed = true;
|
||||
if (refreshTimer) clearTimeout(refreshTimer);
|
||||
global.removeEventListener('message', onMessage);
|
||||
if (launcher.parentNode) launcher.parentNode.removeChild(launcher);
|
||||
if (panel.parentNode) panel.parentNode.removeChild(panel);
|
||||
listeners = {};
|
||||
if (instance === api) instance = null;
|
||||
}
|
||||
|
||||
launcher.addEventListener('click', toggle);
|
||||
iframe.addEventListener('load', function () {
|
||||
// The embed page lives at embedOrigin; we cannot (and need not) read the
|
||||
// cross-origin contentWindow.location. Just (re)provide the token.
|
||||
iframeOrigin = embedOrigin;
|
||||
provideToken();
|
||||
});
|
||||
|
||||
document.body.appendChild(launcher);
|
||||
document.body.appendChild(panel);
|
||||
global.addEventListener('message', onMessage);
|
||||
|
||||
return {
|
||||
open: open,
|
||||
close: close,
|
||||
toggle: toggle,
|
||||
destroy: destroy,
|
||||
isOpen: function () { return panelOpen; },
|
||||
isReady: function () { return iframeReady; },
|
||||
setContext: setContext,
|
||||
openWithQuery: openWithQuery,
|
||||
setLocale: setLocale,
|
||||
};
|
||||
}
|
||||
|
||||
var api = {
|
||||
init: function (opts) {
|
||||
if (instance) instance.destroy();
|
||||
instance = createWidget(opts || {});
|
||||
return instance;
|
||||
},
|
||||
open: function () { if (instance) instance.open(); },
|
||||
close: function () { if (instance) instance.close(); },
|
||||
toggle: function () { if (instance) instance.toggle(); },
|
||||
destroy: function () { if (instance) instance.destroy(); },
|
||||
on: function (event, handler) {
|
||||
if (!handler || typeof handler !== 'function') return;
|
||||
if (!listeners[event]) listeners[event] = [];
|
||||
listeners[event].push(handler);
|
||||
},
|
||||
off: function (event, handler) {
|
||||
if (!listeners[event]) return;
|
||||
if (!handler) {
|
||||
delete listeners[event];
|
||||
return;
|
||||
}
|
||||
listeners[event] = listeners[event].filter(function (fn) { return fn !== handler; });
|
||||
},
|
||||
setContext: function (ctx) { if (instance) instance.setContext(ctx); },
|
||||
openWithQuery: function (query) { if (instance) instance.openWithQuery(query); },
|
||||
setLocale: function (locale) { if (instance) instance.setLocale(locale); },
|
||||
};
|
||||
|
||||
global.Academy = api;
|
||||
|
||||
var legacyScript = document.currentScript;
|
||||
if (legacyScript) {
|
||||
var legacyChannel = legacyScript.getAttribute('data-channel');
|
||||
var legacyToken = legacyScript.getAttribute('data-token');
|
||||
var legacyTokenEndpoint = legacyScript.getAttribute('data-token-endpoint');
|
||||
if (legacyChannel && (legacyToken || legacyTokenEndpoint)) {
|
||||
api.init({
|
||||
channel: legacyChannel,
|
||||
token: legacyToken,
|
||||
tokenEndpoint: legacyTokenEndpoint,
|
||||
scriptEl: legacyScript,
|
||||
position: legacyScript.getAttribute('data-position'),
|
||||
primaryColor: legacyScript.getAttribute('data-primary-color'),
|
||||
title: legacyScript.getAttribute('data-title'),
|
||||
baseUrl: legacyScript.getAttribute('data-base-url'),
|
||||
width: legacyScript.getAttribute('data-width'),
|
||||
height: legacyScript.getAttribute('data-height'),
|
||||
});
|
||||
}
|
||||
}
|
||||
})(typeof window !== 'undefined' ? window : this);
|
||||
@@ -0,0 +1,9 @@
|
||||
// 运行时配置(本地开发默认值,Docker 环境会被 entrypoint 脚本覆盖)
|
||||
window.__RUNTIME_CONFIG__ = {
|
||||
MAX_FILE_SIZE_MB: 50,
|
||||
MAX_SKILL_BUNDLE_SIZE_MB: 256,
|
||||
// Optional: serve embed on a dedicated origin, e.g. 'https://embed.example.com'
|
||||
EMBED_BASE_URL: '',
|
||||
// Optional: default UI locale for first-time visitors (zh-CN | zh-TW | en-US | ru-RU | ko-KR | ja-JP)
|
||||
DEFAULT_LOCALE: '',
|
||||
};
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
@@ -0,0 +1,11 @@
|
||||
// This file is generated automatically by `useSvgSpriteTemplate.ts`. DO NOT EDIT IT.
|
||||
(function () {
|
||||
var svgCode = '<?xml version="1.0" encoding="utf-8"?><svg style="position:absolute; width:0; height:0; visibility:hidden" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol fill="none" viewBox="0 0 24 24" id="t-icon-ability-open" xmlns="http://www.w3.org/2000/svg"><path d="M5 19c0-.4-.156-.762-.41-1.031L11.48 5.908a1.497 1.497 0 0 0 1.038 0l6.892 12.06c-.255.27-.41.633-.41 1.032H5Z" fill="transparent"/><path d="M5 19a1.5 1.5 0 1 1-.41-1.031M5 19c0-.4-.156-.762-.41-1.031M5 19h14m0 0a1.5 1.5 0 1 0 .41-1.031M19 19c0-.4.156-.762.41-1.031m-14.82 0L11.48 5.908m0 0a1.497 1.497 0 0 0 1.038 0m-1.038 0a1.5 1.5 0 1 1 1.038 0m0 0 6.892 12.06" stroke="currentColor" stroke-width="2" stroke-linecap="square"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-abstract" xmlns="http://www.w3.org/2000/svg"><path d="M21 3v11h-6l-3 3-3-3H3V3h18Z" fill="transparent"/><path d="M17 9H7M3 21h18m0-18v11h-6l-3 3-3-3H3V3h18Z" stroke="currentColor" stroke-width="2" stroke-linecap="square"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-abstract-filled" xmlns="http://www.w3.org/2000/svg"><path d="M22 15h-6.586L12 18.414 8.586 15H2V2h20v13ZM6 8v2h12V8H6ZM22 20v2H2v-2h20Z" fill="currentColor"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-accessibility" xmlns="http://www.w3.org/2000/svg"><g fill="transparent"><path d="M12 5.5A2.25 2.25 0 1 0 12 1a2.25 2.25 0 0 0 0 4.5ZM3.25 9.625C3.25 8.728 3.978 8 4.875 8h14.25a1.625 1.625 0 1 1 0 3.25H15.25l2.094 9.425A1.5 1.5 0 0 1 15.88 22.5H14.5l-2-7.25h-1l-2 7.25H8.12a1.5 1.5 0 0 1-1.464-1.825L8.75 11.25H4.875A1.625 1.625 0 0 1 3.25 9.625Z"/></g><g stroke="currentColor" stroke-width="2" stroke-linecap="square"><path d="M12 5.5A2.25 2.25 0 1 0 12 1a2.25 2.25 0 0 0 0 4.5ZM3.25 9.625C3.25 8.728 3.978 8 4.875 8h14.25a1.625 1.625 0 1 1 0 3.25H15.25l2.094 9.425A1.5 1.5 0 0 1 15.88 22.5H14.5l-2-7.25h-1l-2 7.25H8.12a1.5 1.5 0 0 1-1.464-1.825L8.75 11.25H4.875A1.625 1.625 0 0 1 3.25 9.625Z"/></g></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-accessibility-filled" xmlns="http://www.w3.org/2000/svg"><path d="M12 4.5A2.25 2.25 0 1 0 12 0a2.25 2.25 0 0 0 0 4.5ZM21.75 7V5.5H2.25V7l6.5 1.75L9 12 4.75 22.75l1.5.75 5.745-9h.01l5.745 9 1.5-.75L15 12l.25-3.25L21.75 7Z" fill="currentColor"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-activity" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-width="2" stroke-linecap="square"><path d="M21 12h-3l-2.5 4-6-8L6 12H3"/><path d="M3 3v18h18V3H3Z"/></g></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-activity-filled" xmlns="http://www.w3.org/2000/svg"><path d="M2 2h20v9h-4.554l-2.021 3.233-5.865-7.82L5.546 11H2V2Z" fill="currentColor"/><path d="M2 13v9h20v-9h-3.446l-2.979 4.767-6.135-8.18L6.454 13H2Z" fill="currentColor"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-add" xmlns="http://www.w3.org/2000/svg"><path d="M12 5v14m7-7H5" stroke="currentColor" stroke-width="2" stroke-linecap="square"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-add-and-subtract" xmlns="http://www.w3.org/2000/svg"><g stroke="currentColor" stroke-width="2" stroke-linecap="square"><path d="M4 10h16m-8-8v16M4 21h16"/></g></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-add-circle" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" transform="rotate(180 12 12)" fill="transparent" r="10"/><circle cx="12" cy="12" transform="rotate(180 12 12)" stroke="currentColor" stroke-width="2" r="10"/><path d="M16.5 12H12m0 0H7.5m4.5 0V7.5m0 4.5v4.5" stroke="currentColor" stroke-width="2" stroke-linecap="square"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-add-circle-filled" xmlns="http://www.w3.org/2000/svg"><path d="M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1Zm1 12v4.5h-2V13H6.5v-2H11V6.5h2V11h4.5v2H13Z" fill="currentColor"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-add-rectangle" xmlns="http://www.w3.org/2000/svg"><path d="M21 3H3v18h18V3Z" fill="transparent"/><path d="M21 3H3v18h18V3ZM12 7.5V12m0 0v4.5m0-4.5h4.5M12 12H7.5" stroke="currentColor" stroke-width="2" stroke-linecap="square"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-add-rectangle-filled" xmlns="http://www.w3.org/2000/svg"><path d="M2 2h20v20H2V2Zm11 4.5h-2V11H6.5v2H11v4.5h2V13h4.5v-2H13V6.5Z" fill="currentColor"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-address-book" xmlns="http://www.w3.org/2000/svg"><path d="M20.5 2.5h-14a3 3 0 0 0-3 3v13a3 3 0 0 1 3-3h14v-13Z" fill="transparent"/><path d="M11 3h5v6l-2.5-1.5L11 9V3Z" fill="transparent"/><path d="M11 3h5v6l-2.5-1.5L11 9V3Z" stroke="currentColor" stroke-width="2" stroke-linecap="square"/><path d="M20.5 21.5h-14a3 3 0 1 1 0-6h14v6Zm0 0v-19h-14a3 3 0 0 0-3 3v12" stroke="currentColor" stroke-width="2" stroke-linecap="square"/></symbol><symbol fill="none" viewBox="0 0 24 24" id="t-icon-address-book-filled" xmlns="http://www.w3.org/2000/sv
Line truncated
|
||||
if (document.body) {
|
||||
document.body.insertAdjacentHTML('afterbegin', svgCode);
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.body.insertAdjacentHTML('afterbegin', svgCode);
|
||||
});
|
||||
}
|
||||
}());
|
||||
Reference in new issue
Block a user