@arcblock/nft-template 1.30.24 → 1.30.26
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/esm/index.d.mts +73 -0
- package/{lib/index.js → esm/index.mjs} +67 -58
- package/lib/_virtual/rolldown_runtime.cjs +29 -0
- package/lib/index.cjs +224 -0
- package/lib/index.d.cts +73 -0
- package/package.json +32 -11
- package/lib/index.d.ts +0 -26
package/esm/index.d.mts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
interface AssetRecipient {
|
|
3
|
+
attributes?: {
|
|
4
|
+
name?: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
interface CertAssetPayload {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
reason: string;
|
|
13
|
+
logoUrl?: string;
|
|
14
|
+
recipient: AssetRecipient | null;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
interface TicketAssetPayload extends CertAssetPayload {
|
|
18
|
+
location?: string;
|
|
19
|
+
}
|
|
20
|
+
interface InsertTextParams {
|
|
21
|
+
x: number | string;
|
|
22
|
+
y: number | string;
|
|
23
|
+
size: number | string;
|
|
24
|
+
anchor: string;
|
|
25
|
+
color: string;
|
|
26
|
+
text: string;
|
|
27
|
+
}
|
|
28
|
+
declare function createCertSvg({
|
|
29
|
+
data
|
|
30
|
+
}: {
|
|
31
|
+
data: CertAssetPayload;
|
|
32
|
+
}): string;
|
|
33
|
+
declare function createTicketSvg({
|
|
34
|
+
data
|
|
35
|
+
}: {
|
|
36
|
+
data: TicketAssetPayload;
|
|
37
|
+
}): string;
|
|
38
|
+
declare const createSvgDisplay: (svg: string, text: string) => string;
|
|
39
|
+
/**
|
|
40
|
+
* inset a text in svg
|
|
41
|
+
* @param {object} param
|
|
42
|
+
* @param {int} param.x position.x of the text
|
|
43
|
+
* @param {int} param.y position.y of the text
|
|
44
|
+
* @param {int} param.size font size of the text
|
|
45
|
+
* @param {string} param.anchor Text alignment: left right middle
|
|
46
|
+
* @param {string} param.color color of text
|
|
47
|
+
* @param {string} param.text text
|
|
48
|
+
*/
|
|
49
|
+
declare const insertText: ({
|
|
50
|
+
x,
|
|
51
|
+
y,
|
|
52
|
+
size,
|
|
53
|
+
anchor,
|
|
54
|
+
color,
|
|
55
|
+
text
|
|
56
|
+
}: InsertTextParams) => string;
|
|
57
|
+
declare const createZippedSvgDisplay: (svg: string | Uint8Array) => string;
|
|
58
|
+
declare const _default: {
|
|
59
|
+
createCertSvg: typeof createCertSvg;
|
|
60
|
+
createTicketSvg: typeof createTicketSvg;
|
|
61
|
+
createZippedSvgDisplay: (svg: string | Uint8Array) => string;
|
|
62
|
+
insertText: ({
|
|
63
|
+
x,
|
|
64
|
+
y,
|
|
65
|
+
size,
|
|
66
|
+
anchor,
|
|
67
|
+
color,
|
|
68
|
+
text
|
|
69
|
+
}: InsertTextParams) => string;
|
|
70
|
+
createSvgDisplay: (svg: string, text: string) => string;
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { AssetRecipient, CertAssetPayload, InsertTextParams, TicketAssetPayload, createCertSvg, createSvgDisplay, createTicketSvg, createZippedSvgDisplay, _default as default, insertText };
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
+
import { toBase64 } from "@ocap/util";
|
|
2
|
+
import pako from "pako";
|
|
3
|
+
|
|
4
|
+
//#region src/index.ts
|
|
1
5
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @param {string} params.data.name - certificate name
|
|
11
|
-
* @param {string} params.data.description - certificate description
|
|
12
|
-
* @param {string} params.data.reason - certificate reason
|
|
13
|
-
* @param {string} params.data.logoUrl - certificate logo
|
|
14
|
-
* @param {AssetRecipient} params.data.recipient - certificate recipient
|
|
15
|
-
*/
|
|
6
|
+
* @fileOverview Utility functions to create NFT svg
|
|
7
|
+
*
|
|
8
|
+
* @module @arcblock/nft-template
|
|
9
|
+
*/
|
|
10
|
+
function escapeHtml(value) {
|
|
11
|
+
if (value === void 0 || value === null) return "";
|
|
12
|
+
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
13
|
+
}
|
|
16
14
|
function createCertSvg({ data }) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
[
|
|
16
|
+
"name",
|
|
17
|
+
"description",
|
|
18
|
+
"reason",
|
|
19
|
+
"recipient"
|
|
20
|
+
].forEach((x) => {
|
|
21
|
+
if (!data[x]) throw new Error(`Missing required field ${x} when creating cert display`);
|
|
22
|
+
});
|
|
23
|
+
const safeName = escapeHtml(data.name);
|
|
24
|
+
return `<svg width="100%" height="100%" viewBox="0 0 374 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
24
25
|
<desc>
|
|
25
|
-
${
|
|
26
|
+
${safeName}
|
|
26
27
|
</desc>
|
|
27
28
|
<rect rx="4" ry="4" width="374" height="130" stroke="none" fill="#2f3036"/>
|
|
28
29
|
<text x="187" y="25" text-anchor="middle" font-size="12" fill="white" >
|
|
@@ -33,12 +34,12 @@ function createCertSvg({ data }) {
|
|
|
33
34
|
</text>
|
|
34
35
|
<foreignObject x="10" y="68" width="354" height="20">
|
|
35
36
|
<div style="color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;text-align:center;font-size:16px;font-weight:bold;">
|
|
36
|
-
${data.recipient
|
|
37
|
+
${escapeHtml(data.recipient?.attributes?.name)}
|
|
37
38
|
</div>
|
|
38
39
|
</foreignObject>
|
|
39
40
|
<foreignObject x="60" y="98" width="254" height="15">
|
|
40
41
|
<div style="color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;text-align:center;font-size:12px;">
|
|
41
|
-
${
|
|
42
|
+
${safeName}
|
|
42
43
|
</div>
|
|
43
44
|
</foreignObject>
|
|
44
45
|
<svg x="20" y="95" width="28" height="20" viewBox="0 0 28 20">
|
|
@@ -90,16 +91,19 @@ function createCertSvg({ data }) {
|
|
|
90
91
|
</svg>
|
|
91
92
|
`;
|
|
92
93
|
}
|
|
93
|
-
|
|
94
94
|
function createTicketSvg({ data }) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
[
|
|
96
|
+
"name",
|
|
97
|
+
"description",
|
|
98
|
+
"reason",
|
|
99
|
+
"recipient"
|
|
100
|
+
].forEach((x) => {
|
|
101
|
+
if (!data[x]) throw new Error(`Missing required field ${x} when creating cert display`);
|
|
102
|
+
});
|
|
103
|
+
const safeLogoUrl = escapeHtml(data.logoUrl);
|
|
104
|
+
const safeLocation = escapeHtml(data.location);
|
|
105
|
+
const safeName = escapeHtml(data.name);
|
|
106
|
+
return `<svg width="100%" height="100%" viewBox="0 0 374 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
103
107
|
<defs>
|
|
104
108
|
<path d="M65,0 C65,2.76142375 67.2385763,5 70,5 C72.7614237,5 75,2.76142375 75,0 L362,0 C368.627417,-1.21743675e-15 374,5.372583 374,12 L374,118 C374,124.627417 368.627417,130 362,130 L75,130 L75,130 C75,127.238576 72.7614237,125 70,125 C67.2385763,125 65,127.238576 65,130 L12,130 C5.372583,130 8.11624501e-16,124.627417 0,118 L0,12 C9.64732338e-16,5.372583 5.372583,1.21743675e-15 12,0 L65,0 L65,0 Z M70,117.5 C69.7238576,117.5 69.5,117.723858 69.5,118 L69.5,120 C69.5,120.276142 69.7238576,120.5 70,120.5 C70.2761424,120.5 70.5,120.276142 70.5,120 L70.5,118 C70.5,117.723858 70.2761424,117.5 70,117.5 Z M70,111.5 C69.7238576,111.5 69.5,111.723858 69.5,112 L69.5,114 C69.5,114.276142 69.7238576,114.5 70,114.5 C70.2761424,114.5 70.5,114.276142 70.5,114 L70.5,112 C70.5,111.723858 70.2761424,111.5 70,111.5 Z M70,105.5 C69.7238576,105.5 69.5,105.723858 69.5,106 L69.5,108 C69.5,108.276142 69.7238576,108.5 70,108.5 C70.2761424,108.5 70.5,108.276142 70.5,108 L70.5,106 C70.5,105.723858 70.2761424,105.5 70,105.5 Z M70,99.5 C69.7238576,99.5 69.5,99.7238576 69.5,100 L69.5,102 C69.5,102.276142 69.7238576,102.5 70,102.5 C70.2761424,102.5 70.5,102.276142 70.5,102 L70.5,100 C70.5,99.7238576 70.2761424,99.5 70,99.5 Z M70,93.5 C69.7238576,93.5 69.5,93.7238576 69.5,94 L69.5,96 C69.5,96.2761424 69.7238576,96.5 70,96.5 C70.2761424,96.5 70.5,96.2761424 70.5,96 L70.5,94 C70.5,93.7238576 70.2761424,93.5 70,93.5 Z M70,87.5 C69.7238576,87.5 69.5,87.7238576 69.5,88 L69.5,90 C69.5,90.2761424 69.7238576,90.5 70,90.5 C70.2761424,90.5 70.5,90.2761424 70.5,90 L70.5,88 C70.5,87.7238576 70.2761424,87.5 70,87.5 Z M70,81.5 C69.7238576,81.5 69.5,81.7238576 69.5,82 L69.5,84 C69.5,84.2761424 69.7238576,84.5 70,84.5 C70.2761424,84.5 70.5,84.2761424 70.5,84 L70.5,82 C70.5,81.7238576 70.2761424,81.5 70,81.5 Z M70,75.5 C69.7238576,75.5 69.5,75.7238576 69.5,76 L69.5,78 C69.5,78.2761424 69.7238576,78.5 70,78.5 C70.2761424,78.5 70.5,78.2761424 70.5,78 L70.5,76 C70.5,75.7238576 70.2761424,75.5 70,75.5 Z M70,69.5 C69.7238576,69.5 69.5,69.7238576 69.5,70 L69.5,72 C69.5,72.2761424 69.7238576,72.5 70,72.5 C70.2761424,72.5 70.5,72.2761424 70.5,72 L70.5,70 C70.5,69.7238576 70.2761424,69.5 70,69.5 Z M70,63.5 C69.7238576,63.5 69.5,63.7238576 69.5,64 L69.5,66 C69.5,66.2761424 69.7238576,66.5 70,66.5 C70.2761424,66.5 70.5,66.2761424 70.5,66 L70.5,64 C70.5,63.7238576 70.2761424,63.5 70,63.5 Z M70,57.5 C69.7238576,57.5 69.5,57.7238576 69.5,58 L69.5,60 C69.5,60.2761424 69.7238576,60.5 70,60.5 C70.2761424,60.5 70.5,60.2761424 70.5,60 L70.5,58 C70.5,57.7238576 70.2761424,57.5 70,57.5 Z M70,51.5 C69.7238576,51.5 69.5,51.7238576 69.5,52 L69.5,54 C69.5,54.2761424 69.7238576,54.5 70,54.5 C70.2761424,54.5 70.5,54.2761424 70.5,54 L70.5,52 C70.5,51.7238576 70.2761424,51.5 70,51.5 Z M70,45.5 C69.7238576,45.5 69.5,45.7238576 69.5,46 L69.5,48 C69.5,48.2761424 69.7238576,48.5 70,48.5 C70.2761424,48.5 70.5,48.2761424 70.5,48 L70.5,46 C70.5,45.7238576 70.2761424,45.5 70,45.5 Z M70,39.5 C69.7238576,39.5 69.5,39.7238576 69.5,40 L69.5,42 C69.5,42.2761424 69.7238576,42.5 70,42.5 C70.2761424,42.5 70.5,42.2761424 70.5,42 L70.5,40 C70.5,39.7238576 70.2761424,39.5 70,39.5 Z M70,33.5 C69.7238576,33.5 69.5,33.7238576 69.5,34 L69.5,36 C69.5,36.2761424 69.7238576,36.5 70,36.5 C70.2761424,36.5 70.5,36.2761424 70.5,36 L70.5,34 C70.5,33.7238576 70.2761424,33.5 70,33.5 Z M70,27.5 C69.7238576,27.5 69.5,27.7238576 69.5,28 L69.5,30 C69.5,30.2761424 69.7238576,30.5 70,30.5 C70.2761424,30.5 70.5,30.2761424 70.5,30 L70.5,28 C70.5,27.7238576 70.2761424,27.5 70,27.5 Z M70,21.5 C69.7238576,21.5 69.5,21.7238576 69.5,22 L69.5,24 C69.5,24.2761424 69.7238576,24.5 70,24.5 C70.2761424,24.5 70.5,24.2761424 70.5,24 L70.5,22 C70.5,21.7238576 70.2761424,21.5 70,21.5 Z M70,15.5 C69.7238576,15.5 69.5,15.7238576 69.5,16 L69.5,18 C69.5,18.2761424 69.7238576,18.5 70,18.5 C70.2761424,18.5 70.5,18.2761424 70.5,18 L70.5,16 C70.5,15.7238576 70.2761424,15.5 70,15.5 Z M70,9.5 C69.7238576,9.5 69.5,9.72385763 69.5,10 L69.5,12 C69.5,12.2761424 69.7238576,12.5 70,12.5 C70.2761424,12.5 70.5,12.2761424 70.5,12 L70.5,10 C70.5,9.72385763 70.2761424,9.5 70,9.5 Z" id="path-1"></path>
|
|
105
109
|
</defs>
|
|
@@ -115,11 +119,11 @@ function createTicketSvg({ data }) {
|
|
|
115
119
|
</g>
|
|
116
120
|
</g>
|
|
117
121
|
<foreignObject x="20" y="10" width="30" height="30">
|
|
118
|
-
${
|
|
122
|
+
${`<img src="${safeLogoUrl}" style="width:30px;height:30px;object-fit:cover;border-radius:50%;background-color:#ffffff;" />`}
|
|
119
123
|
</foreignObject>
|
|
120
124
|
<foreignObject x="90" y="10" width="264" height="20">
|
|
121
125
|
<div style="color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;text-align:right;font-size:14px;">
|
|
122
|
-
${
|
|
126
|
+
${safeLocation}
|
|
123
127
|
</div>
|
|
124
128
|
</foreignObject>
|
|
125
129
|
<foreignObject x="90" y="60" width="264" height="54">
|
|
@@ -145,7 +149,7 @@ function createTicketSvg({ data }) {
|
|
|
145
149
|
vertical-align: bottom;
|
|
146
150
|
"
|
|
147
151
|
>
|
|
148
|
-
${
|
|
152
|
+
${safeName}
|
|
149
153
|
</div>
|
|
150
154
|
</div>
|
|
151
155
|
</foreignObject>
|
|
@@ -170,7 +174,6 @@ function createTicketSvg({ data }) {
|
|
|
170
174
|
</svg>
|
|
171
175
|
`;
|
|
172
176
|
}
|
|
173
|
-
|
|
174
177
|
const createSvgDisplay = (svg, text) => `<svg
|
|
175
178
|
width="374px"
|
|
176
179
|
height="130px"
|
|
@@ -180,28 +183,34 @@ const createSvgDisplay = (svg, text) => `<svg
|
|
|
180
183
|
xmlnsXlink="http://www.w3.org/1999/xlink">
|
|
181
184
|
<desc>Created with arcblock.io</desc>
|
|
182
185
|
${svg}
|
|
183
|
-
${insertText({
|
|
186
|
+
${insertText({
|
|
187
|
+
x: 50,
|
|
188
|
+
y: 100,
|
|
189
|
+
size: 20,
|
|
190
|
+
anchor: "left",
|
|
191
|
+
color: "black",
|
|
192
|
+
text
|
|
193
|
+
})}
|
|
184
194
|
</svg>`;
|
|
185
|
-
|
|
186
195
|
/**
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const insertText = ({ x, y, size, anchor, color, text }) =>
|
|
197
|
-
`<text x="${x}" y="${y}" font-size="${size}' text-anchor="${anchor}" fill="${color}" >${text} </text>`;
|
|
198
|
-
|
|
196
|
+
* inset a text in svg
|
|
197
|
+
* @param {object} param
|
|
198
|
+
* @param {int} param.x position.x of the text
|
|
199
|
+
* @param {int} param.y position.y of the text
|
|
200
|
+
* @param {int} param.size font size of the text
|
|
201
|
+
* @param {string} param.anchor Text alignment: left right middle
|
|
202
|
+
* @param {string} param.color color of text
|
|
203
|
+
* @param {string} param.text text
|
|
204
|
+
*/
|
|
205
|
+
const insertText = ({ x, y, size, anchor, color, text }) => `<text x="${escapeHtml(x)}" y="${escapeHtml(y)}" font-size="${escapeHtml(size)}' text-anchor="${escapeHtml(anchor)}" fill="${escapeHtml(color)}" >${escapeHtml(text)} </text>`;
|
|
199
206
|
const createZippedSvgDisplay = (svg) => toBase64(pako.gzip(svg));
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
createSvgDisplay,
|
|
207
|
+
var src_default = {
|
|
208
|
+
createCertSvg,
|
|
209
|
+
createTicketSvg,
|
|
210
|
+
createZippedSvgDisplay,
|
|
211
|
+
insertText,
|
|
212
|
+
createSvgDisplay
|
|
207
213
|
};
|
|
214
|
+
|
|
215
|
+
//#endregion
|
|
216
|
+
export { createCertSvg, createSvgDisplay, createTicketSvg, createZippedSvgDisplay, src_default as default, insertText };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/lib/index.cjs
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
let _ocap_util = require("@ocap/util");
|
|
4
|
+
let pako = require("pako");
|
|
5
|
+
pako = require_rolldown_runtime.__toESM(pako);
|
|
6
|
+
|
|
7
|
+
//#region src/index.ts
|
|
8
|
+
/**
|
|
9
|
+
* @fileOverview Utility functions to create NFT svg
|
|
10
|
+
*
|
|
11
|
+
* @module @arcblock/nft-template
|
|
12
|
+
*/
|
|
13
|
+
function escapeHtml(value) {
|
|
14
|
+
if (value === void 0 || value === null) return "";
|
|
15
|
+
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
16
|
+
}
|
|
17
|
+
function createCertSvg({ data }) {
|
|
18
|
+
[
|
|
19
|
+
"name",
|
|
20
|
+
"description",
|
|
21
|
+
"reason",
|
|
22
|
+
"recipient"
|
|
23
|
+
].forEach((x) => {
|
|
24
|
+
if (!data[x]) throw new Error(`Missing required field ${x} when creating cert display`);
|
|
25
|
+
});
|
|
26
|
+
const safeName = escapeHtml(data.name);
|
|
27
|
+
return `<svg width="100%" height="100%" viewBox="0 0 374 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
28
|
+
<desc>
|
|
29
|
+
${safeName}
|
|
30
|
+
</desc>
|
|
31
|
+
<rect rx="4" ry="4" width="374" height="130" stroke="none" fill="#2f3036"/>
|
|
32
|
+
<text x="187" y="25" text-anchor="middle" font-size="12" fill="white" >
|
|
33
|
+
CERTIFICATE OF EXCELLENCE
|
|
34
|
+
</text>
|
|
35
|
+
<text x="187" y="55" text-anchor="middle" font-size="8" fill="white" >
|
|
36
|
+
Awarded to
|
|
37
|
+
</text>
|
|
38
|
+
<foreignObject x="10" y="68" width="354" height="20">
|
|
39
|
+
<div style="color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;text-align:center;font-size:16px;font-weight:bold;">
|
|
40
|
+
${escapeHtml(data.recipient?.attributes?.name)}
|
|
41
|
+
</div>
|
|
42
|
+
</foreignObject>
|
|
43
|
+
<foreignObject x="60" y="98" width="254" height="15">
|
|
44
|
+
<div style="color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;text-align:center;font-size:12px;">
|
|
45
|
+
${safeName}
|
|
46
|
+
</div>
|
|
47
|
+
</foreignObject>
|
|
48
|
+
<svg x="20" y="95" width="28" height="20" viewBox="0 0 28 20">
|
|
49
|
+
<defs>
|
|
50
|
+
<linearGradient x1="0%" y1="24.4897959%" x2="100%" y2="75.5102041%" id="linearGradient-1">
|
|
51
|
+
<stop stop-color="#A07244" offset="0%"></stop>
|
|
52
|
+
<stop stop-color="#FFDF93" offset="37.2703795%"></stop>
|
|
53
|
+
<stop stop-color="#BB8C4C" offset="100%"></stop>
|
|
54
|
+
</linearGradient>
|
|
55
|
+
</defs>
|
|
56
|
+
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
57
|
+
<g id="Card/Certificate" transform="translate(-20.000000, -90.000000)" fill="url(#linearGradient-1)">
|
|
58
|
+
<path d="M44,90 C46.209139,90 48,91.790861 48,94 L48,106 C48,108.209139 46.209139,110 44,110 L24,110 C21.790861,110 20,108.209139 20,106 L20,94 C20,91.790861 21.790861,90 24,90 L44,90 Z M43.609375,92 L24.390625,92 C23.7343717,92 23.1744815,92.2291644 22.7109375,92.6875 C22.2473935,93.1458356 22.0104167,93.7031217 22,94.359375 L22,94.359375 L22.984375,94.359375 C22.984375,93.9739564 23.1223945,93.6432305 23.3984375,93.3671875 C23.6744805,93.0911445 24.0052064,92.953125 24.390625,92.953125 L24.390625,92.953125 L43.59375,92.953125 L43.7712059,92.9615752 C44.0881707,92.9953759 44.3649542,93.1305792 44.6015625,93.3671875 C44.8776055,93.6432305 45.015625,93.9739564 45.015625,94.359375 L45.015625,94.359375 L45.015625,103.5625 L22,103.5625 L22,105.65625 C22.0104167,106.312503 22.2473935,106.867185 22.7109375,107.320312 C23.1744815,107.77344 23.7343717,108 24.390625,108 L24.390625,108 L43.59375,108 L43.8245571,107.991512 C44.3888589,107.946245 44.8770234,107.719909 45.2890625,107.3125 C45.7526065,106.854164 45.9895833,106.296878 46,105.640625 L46,105.640625 L46,94.359375 C45.9895833,93.7031217 45.7526065,93.1458356 45.2890625,92.6875 C44.8255185,92.2291644 44.2656283,92 43.609375,92 L43.609375,92 Z M37.109375,104 L38.609375,107.359375 L37.765625,107.34375 L37.46875,106.625 L36.125,106.625 L35.84375,107.34375 L35.015625,107.34375 L36.5,104 L37.109375,104 Z M39.171875,104 L40.578125,104.001953 L40.6875,104.007812 L40.921875,104.03125 L40.890625,104.03125 C40.9739588,104.041667 41.0494788,104.057292 41.1171875,104.078125 C41.1848962,104.098958 41.2499997,104.125 41.3125,104.15625 L41.3125,104.15625 L41.296875,104.15625 C41.3593753,104.1875 41.4140623,104.223958 41.4609375,104.265625 C41.5078127,104.307292 41.5520831,104.354166 41.59375,104.40625 C41.6250002,104.46875 41.6510416,104.533854 41.671875,104.601562 C41.6927084,104.669271 41.703125,104.739583 41.703125,104.8125 L41.703125,104.8125 L41.6987848,104.956597 C41.6929977,105.009838 41.6814237,105.060764 41.6640625,105.109375 C41.6380207,105.182292 41.5989586,105.25 41.546875,105.3125 L41.546875,105.3125 L41.5625,105.3125 C41.4999997,105.375 41.432292,105.429687 41.359375,105.476562 C41.286458,105.523438 41.2083338,105.557292 41.125,105.578125 L41.125,105.578125 L41.109375,105.578125 C41.171875,105.588542 41.2291664,105.601562 41.28125,105.617188 C41.3333336,105.632813 41.3802081,105.651042 41.421875,105.671875 C41.4635419,105.692708 41.5052081,105.71875 41.546875,105.75 C41.5885419,105.78125 41.6249998,105.8125 41.65625,105.84375 C41.6875002,105.875 41.7161457,105.911458 41.7421875,105.953125 C41.7682293,105.994792 41.7916666,106.041666 41.8125,106.09375 L41.8125,106.09375 L41.84375,106.234375 C41.8541667,106.286459 41.859375,106.338541 41.859375,106.390625 L41.859375,106.390625 L41.8515625,106.560547 L41.828125,106.664062 C41.8072916,106.731771 41.7812502,106.796875 41.75,106.859375 L41.75,106.859375 L41.765625,106.859375 C41.7239581,106.911459 41.6770836,106.960937 41.625,107.007812 L41.625,107.007812 L41.46875,107.140625 C41.4062497,107.171875 41.3411462,107.200521 41.2734375,107.226562 C41.2057288,107.252604 41.135417,107.276042 41.0625,107.296875 L41.0625,107.296875 L41.046875,107.296875 L40.8359375,107.328125 C40.7578121,107.338542 40.682292,107.34375 40.609375,107.34375 L40.609375,107.34375 L39.171875,107.34375 L39.171875,104 Z M45.015625,104 L45.03125,104.625 L44.046875,104.625 L44.046875,107.34375 L43.28125,107.34375 L43.28125,104.640625 L42.3125,104.640625 L42.3125,104 L45.015625,104 Z M40.703125,105.96875 L39.921875,105.96875 L39.921875,106.734375 L40.78125,106.734375 L40.8671875,106.703125 C40.8932293,106.692708 40.921875,106.677083 40.953125,106.65625 L40.953125,106.65625 L40.984375,106.636719 L41.015625,106.609375 C41.0364584,106.588542 41.0520833,106.567708 41.0625,106.546875 L41.0625,106.546875 L41.0625,106.53125 C41.0833334,106.510417 41.0963541,106.486979 41.1015625,106.460938 C41.1067709,106.434896 41.109375,106.40625 41.109375,106.375 L41.109375,106.375 L41.1054688,106.287109 L41.09375,106.242188 L41.0253907,106.113281 L40.9921875,106.078125 L40.90625,106.015625 L40.890625,106.015625 L40.8046875,105.984375 C40.768229,105.973958 40.7343752,105.96875 40.703125,105.96875 L40.703125,105.96875 Z M36.78125,104.953125 L36.375,106 L37.203125,106 L36.78125,104.953125 Z M40.640625,104.625 L39.921875,104.625 L39.921875,105.328125 L40.484375,105.328125 C40.5156252,105.328125 40.5468748,105.325521 40.578125,105.320312 L40.625,105.314453 L40.671875,105.3125 C40.6927084,105.302083 40.7187498,105.291667 40.75,105.28125 L40.75,105.28125 L40.828125,105.25 L40.8828125,105.195312 C40.8984376,105.179687 40.9114583,105.15625 40.921875,105.125 C40.9427084,105.104167 40.9557291,105.080729 40.9609375,105.054688 C40.9661459,105.028646 40.96875,105 40.96875,104.96875 L40.96875,104.96875 L40.9609375,104.859375 C40.9557291,104.828125 40.9427084,104.802083 40.921875,104.78125 L40.921875,104.78125 L40.9023438,104.751953 L40.875,104.726562 C40.8541666,104.710937 40.8333334,104.697917 40.8125,104.6875 L40.8125,104.6875 L40.796875,104.6875 C40.7760416,104.666667 40.7526043,104.651042 40.7265625,104.640625 C40.7005207,104.630208 40.6718752,104.625 40.640625,104.625 L40.640625,104.625 Z M39.921875,100.890625 C39.8072911,100.890625 39.7005213,100.911458 39.6015625,100.953125 C39.5026037,100.994792 39.4114588,101.046875 39.328125,101.109375 C39.255208,101.182292 39.1953127,101.268229 39.1484375,101.367188 C39.1015623,101.466146 39.078125,101.572916 39.078125,101.6875 C39.078125,101.739584 39.0859374,101.789062 39.1015625,101.835938 L39.1015625,101.835938 L39.15625,101.984375 C39.1770834,102.026042 39.2031248,102.067708 39.234375,102.109375 C39.2656252,102.151042 39.2968748,102.1875 39.328125,102.21875 C39.3697919,102.260417 39.4114581,102.294271 39.453125,102.320312 C39.4947919,102.346354 39.5416664,102.369792 39.59375,102.390625 L39.59375,102.390625 L39.578125,102.390625 C39.6302086,102.411458 39.6848955,102.427083 39.7421875,102.4375 C39.7994795,102.447917 39.8541664,102.453125 39.90625,102.453125 L39.90625,102.453125 L40.0338543,102.446181 C40.1067709,102.436921 40.1762149,102.418403 40.2421875,102.390625 C40.3411463,102.348958 40.427083,102.291667 40.5,102.21875 L40.5,102.21875 L40.576389,102.150174 C40.6226853,102.100405 40.6597221,102.042535 40.6875,101.976562 C40.7291669,101.877604 40.7552083,101.776042 40.765625,101.671875 L40.765625,101.671875 L40.7578126,101.553819 C40.7473959,101.48669 40.7265627,101.421875 40.6953125,101.359375 C40.6484373,101.265625 40.5833338,101.182292 40.5,101.109375 C40.427083,101.046875 40.3411463,100.994792 40.2421875,100.953125 C40.1432287,100.911458 40.0364589,100.890625 39.921875,100.890625 Z M24.9375,95.15625 L22,95.15625 L22,102.390625 L24.75,102.390625 C25,102.390625 25.2395822,102.372396 25.46875,102.335938 C25.6979178,102.299479 25.9166656,102.244792 26.125,102.171875 L26.125,102.171875 L26.140625,102.171875 C26.3697928,102.098958 26.5885406,102.005209 26.796875,101.890625 C27.0052094,101.776041 27.1979158,101.651042 27.375,101.515625 L27.375,101.515625 L27.390625,101.5 C27.7760436,101.197915 28.0859363,100.817711 28.3203125,100.359375 C28.5546887,99.9010394 28.671875,99.4062527 28.671875,98.875 L28.671875,98.875 L28.671875,98.6875 C28.671875,98.4062486 28.6458336,98.1380221 28.59375,97.8828125 C28.5416664,97.6276029 28.4635422,97.3906261 28.359375,97.171875 L28.359375,97.171875 L28.34375,97.15625 C28.2499995,96.9374989 28.1328132,96.7343759 27.9921875,96.546875 C27.8515618,96.3593741 27.6979175,96.1927091 27.53125,96.046875 C27.3541658,95.9010409 27.1666677,95.7708339 26.96875,95.65625 C26.7708323,95.5416661 26.5572928,95.447917 26.328125,95.375 L26.328125,95.375 L26.359375,95.375 C26.1302072,95.302083 25.8984387,95.247396 25.6640625,95.2109375 C25.4296863,95.174479 25.1875013,95.15625 24.9375,95.15625 L24.9375,95.15625 Z M30.703125,95.15625 L29.375,95.15625 L29.375,102.390625 L30.703125,102.390625 L30.703125,95.15625 Z M34.703125,95.15625 L31.78125,95.15625 L31.78125,102.390625 L34.53125,102.390625 C34.78125,102.390625 35.0208322,102.372396 35.25,102.335938 C35.4791678,102.299479 35.6927073,102.244792 35.890625,102.171875 L35.890625,102.171875 L35.921875,102.171875 C36.1510428,102.098958 36.3697906,102.005209 36.578125,101.890625 C36.7864594,101.776041 36.9791658,101.651042 37.15625,101.515625 L37.15625,101.515625 L37.171875,101.5 C37.3593759,101.354166 37.5286451,101.187501 37.6796875,101 C37.8307299,100.812499 37.9687494,100.609376 38.09375,100.390625 L38.09375,100.390625 L38.078125,100.40625 C38.1927089,100.177082 38.2838538,99.932293 38.3515625,99.671875 C38.4192712,99.411457 38.453125,99.1406264 38.453125,98.859375 L38.453125,98.859375 L38.453125,98.6875 C38.453125,98.4062486 38.4244795,98.1380221 38.3671875,97.8828125 C38.3098955,97.6276029 38.2343755,97.3906261 38.140625,97.171875 L38.140625,97.171875 L38.125,97.15625 C38.0312495,96.9374989 37.9140632,96.7343759 37.7734375,96.546875 C37.6328118,96.3593741 37.4739592,96.1927091 37.296875,96.046875 L37.296875,96.046875 L37.3125,96.046875 C37.1354158,95.9010409 36.9479177,95.7708339 36.75,95.65625 C36.5520823,95.5416661 36.3385428,95.447917 36.109375,95.375 L36.109375,95.375 L36.140625,95.375 C35.9114572,95.302083 35.6770845,95.247396 35.4375,95.2109375 C35.1979155,95.174479 34.9531262,95.15625 34.703125,95.15625 L34.703125,95.15625 Z M24.5,96.3125 L24.8125,96.3203125 L25.09375,96.34375 C25.2812509,96.3645834 25.4583325,96.3958331 25.625,96.4375 L25.625,96.4375 L25.640625,96.453125 C25.7968758,96.4947919 25.9479159,96.552083 26.09375,96.625 C26.2395841,96.697917 26.3749994,96.7864578 26.5,96.890625 L26.5,96.890625 L26.515625,96.890625 C26.6302089,96.9843755 26.7369787,97.0937494 26.8359375,97.21875 C26.9348963,97.3437506 27.0156247,97.4843742 27.078125,97.640625 L27.078125,97.640625 L27.078125,97.625 C27.151042,97.7812508 27.205729,97.9479158 27.2421875,98.125 C27.278646,98.3020842 27.296875,98.4895823 27.296875,98.6875 L27.296875,98.6875 L27.296875,98.84375 C27.296875,99.0312509 27.2760419,99.2135408 27.234375,99.390625 C27.1927081,99.5677092 27.135417,99.7343742 27.0625,99.890625 L27.0625,99.890625 L27.0625,99.90625 C26.9791662,100.052084 26.8854172,100.187499 26.78125,100.3125 C26.6770828,100.437501 26.5572923,100.552083 26.421875,100.65625 L26.421875,100.65625 L26.421875,100.640625 C26.2864577,100.744792 26.1380216,100.833333 25.9765625,100.90625 C25.8151034,100.979167 25.6458342,101.041666 25.46875,101.09375 L25.46875,101.09375 L25.5,101.09375 C25.3020823,101.135417 25.1041677,101.169271 24.90625,101.195312 C24.7083323,101.221354 24.5104177,101.234375 24.3125,101.234375 L24.3125,101.234375 L23.328125,101.234375 L23.328125,96.3125 L24.5,96.3125 Z M34.296875,96.3125 L34.5078127,96.3159722 C34.6362848,96.3206018 34.7612841,96.329861 34.8828125,96.34375 C35.0651051,96.3645834 35.2395825,96.3958331 35.40625,96.4375 L35.40625,96.4375 L35.421875,96.453125 C35.5885425,96.4947919 35.7447909,96.552083 35.890625,96.625 C36.0364591,96.697917 36.1718744,96.7864578 36.296875,96.890625 C36.4218756,96.9843755 36.5312495,97.0937494 36.625,97.21875 C36.7187505,97.3437506 36.7968747,97.4843742 36.859375,97.640625 L36.859375,97.640625 L36.859375,97.625 C36.9218753,97.7812508 36.9739581,97.9505199 37.015625,98.1328125 C37.0572919,98.3151051 37.078125,98.4999991 37.078125,98.6875 L37.078125,98.6875 L37.078125,98.828125 C37.078125,99.0260427 37.0572919,99.2135408 37.015625,99.390625 C36.9739581,99.5677092 36.9114588,99.7343742 36.828125,99.890625 L36.828125,99.890625 L36.828125,99.90625 C36.755208,100.052084 36.664063,100.187499 36.5546875,100.3125 C36.445312,100.437501 36.3281256,100.552083 36.203125,100.65625 L36.203125,100.65625 L36.203125,100.640625 C36.0677077,100.744792 35.9192716,100.833333 35.7578125,100.90625 C35.5963534,100.979167 35.4218759,101.041666 35.234375,101.09375 L35.234375,101.09375 L35.28125,101.09375 C35.0833323,101.135417 34.8854177,101.169271 34.6875,101.195312 C34.4895823,101.221354 34.2864594,101.234375 34.078125,101.234375 L34.078125,101.234375 L33.109375,101.234375 L33.109375,96.3125 L34.296875,96.3125 Z M39.9375,97.40625 L39.7942707,97.4140624 C39.7213541,97.4244791 39.6519101,97.4453123 39.5859375,97.4765625 C39.4869787,97.5234377 39.401042,97.583333 39.328125,97.65625 C39.255208,97.7187503 39.1953127,97.7994787 39.1484375,97.8984375 C39.1015623,97.9973963 39.078125,98.1041661 39.078125,98.21875 C39.078125,98.2812503 39.0859374,98.3359373 39.1015625,98.3828125 C39.1171876,98.4296877 39.1354166,98.4739581 39.15625,98.515625 L39.15625,98.515625 L39.15625,98.53125 C39.1770834,98.5729169 39.2031248,98.6145831 39.234375,98.65625 C39.2656252,98.6979169 39.3020831,98.7343748 39.34375,98.765625 L39.34375,98.765625 L39.3964843,98.8105469 L39.4609375,98.8515625 C39.5078127,98.8776043 39.5572914,98.9010416 39.609375,98.921875 L39.609375,98.921875 L39.59375,98.921875 C39.6458336,98.9427084 39.6979164,98.9583333 39.75,98.96875 C39.8020836,98.9791667 39.8593747,98.984375 39.921875,98.984375 L39.921875,98.984375 L40.0494793,98.9774306 C40.1223959,98.9681714 40.1918399,98.9496529 40.2578125,98.921875 C40.3567713,98.8802081 40.442708,98.822917 40.515625,98.75 C40.588542,98.6874997 40.6484373,98.6067713 40.6953125,98.5078125 C40.7421877,98.4088537 40.765625,98.3020839 40.765625,98.1875 C40.765625,98.0729161 40.7421877,97.9687505 40.6953125,97.875 C40.6484373,97.7812495 40.5833338,97.7031253 40.5,97.640625 L40.5,97.640625 L40.422743,97.5729166 C40.368345,97.5312499 40.3081601,97.4965279 40.2421875,97.46875 C40.1432287,97.4270831 40.0416672,97.40625 39.9375,97.40625 L39.9375,97.40625 Z" id="DID-Icon"></path>
|
|
59
|
+
</g>
|
|
60
|
+
</g>
|
|
61
|
+
</svg>
|
|
62
|
+
<svg x="3" y="3" width="368" height="124" fill="none">
|
|
63
|
+
<defs>
|
|
64
|
+
<linearGradient x1="0%" y1="93.7397076%" x2="100%" y2="93.7397076%" id="linearGradient-1">
|
|
65
|
+
<stop stop-color="#6A5A53" offset="0%"></stop>
|
|
66
|
+
<stop stop-color="#A59D8B" offset="22.7961858%"></stop>
|
|
67
|
+
<stop stop-color="#877B6D" offset="49.3379967%"></stop>
|
|
68
|
+
<stop stop-color="#ADA593" offset="74.6107939%"></stop>
|
|
69
|
+
<stop stop-color="#6A5A53" offset="100%"></stop>
|
|
70
|
+
</linearGradient>
|
|
71
|
+
</defs>
|
|
72
|
+
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linejoin="round">
|
|
73
|
+
<g id="Card/Certificate" transform="translate(-3.000000, -3.000000)" stroke="url(#linearGradient-1)">
|
|
74
|
+
<path d="M363,4 C363,7.86599325 366.134007,11 370,11 L370,119 L370,119 C366.134007,119 363,122.134007 363,126 L11,126 L11,126 C11,122.134007 7.86599325,119 4,119 L4,11 L4,11 C7.86599325,11 11,7.86599325 11,4 L363,4 L363,4 Z" id="decor-line"></path>
|
|
75
|
+
</g>
|
|
76
|
+
</g>
|
|
77
|
+
</svg>
|
|
78
|
+
<svg x="146" y="32" width="82" height="1">
|
|
79
|
+
<defs>
|
|
80
|
+
<linearGradient x1="0%" y1="0%" x2="100%" y2="0%" id="linearGradient-1">
|
|
81
|
+
<stop stop-color="#AF957E" offset="0%"></stop>
|
|
82
|
+
<stop stop-color="#A8A08E" offset="28.1540329%"></stop>
|
|
83
|
+
<stop stop-color="#80756B" offset="53.5684122%"></stop>
|
|
84
|
+
<stop stop-color="#A59D8B" offset="77.9798353%"></stop>
|
|
85
|
+
<stop stop-color="#AA907B" offset="100%"></stop>
|
|
86
|
+
</linearGradient>
|
|
87
|
+
</defs>
|
|
88
|
+
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
|
|
89
|
+
<g id="Card/Certificate" transform="translate(-146.000000, -32.000000)" stroke="url(#linearGradient-1)">
|
|
90
|
+
<line x1="146" y1="32" x2="228" y2="33" id="line"></line>
|
|
91
|
+
</g>
|
|
92
|
+
</g>
|
|
93
|
+
</svg>
|
|
94
|
+
</svg>
|
|
95
|
+
`;
|
|
96
|
+
}
|
|
97
|
+
function createTicketSvg({ data }) {
|
|
98
|
+
[
|
|
99
|
+
"name",
|
|
100
|
+
"description",
|
|
101
|
+
"reason",
|
|
102
|
+
"recipient"
|
|
103
|
+
].forEach((x) => {
|
|
104
|
+
if (!data[x]) throw new Error(`Missing required field ${x} when creating cert display`);
|
|
105
|
+
});
|
|
106
|
+
const safeLogoUrl = escapeHtml(data.logoUrl);
|
|
107
|
+
const safeLocation = escapeHtml(data.location);
|
|
108
|
+
const safeName = escapeHtml(data.name);
|
|
109
|
+
return `<svg width="100%" height="100%" viewBox="0 0 374 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
110
|
+
<defs>
|
|
111
|
+
<path d="M65,0 C65,2.76142375 67.2385763,5 70,5 C72.7614237,5 75,2.76142375 75,0 L362,0 C368.627417,-1.21743675e-15 374,5.372583 374,12 L374,118 C374,124.627417 368.627417,130 362,130 L75,130 L75,130 C75,127.238576 72.7614237,125 70,125 C67.2385763,125 65,127.238576 65,130 L12,130 C5.372583,130 8.11624501e-16,124.627417 0,118 L0,12 C9.64732338e-16,5.372583 5.372583,1.21743675e-15 12,0 L65,0 L65,0 Z M70,117.5 C69.7238576,117.5 69.5,117.723858 69.5,118 L69.5,120 C69.5,120.276142 69.7238576,120.5 70,120.5 C70.2761424,120.5 70.5,120.276142 70.5,120 L70.5,118 C70.5,117.723858 70.2761424,117.5 70,117.5 Z M70,111.5 C69.7238576,111.5 69.5,111.723858 69.5,112 L69.5,114 C69.5,114.276142 69.7238576,114.5 70,114.5 C70.2761424,114.5 70.5,114.276142 70.5,114 L70.5,112 C70.5,111.723858 70.2761424,111.5 70,111.5 Z M70,105.5 C69.7238576,105.5 69.5,105.723858 69.5,106 L69.5,108 C69.5,108.276142 69.7238576,108.5 70,108.5 C70.2761424,108.5 70.5,108.276142 70.5,108 L70.5,106 C70.5,105.723858 70.2761424,105.5 70,105.5 Z M70,99.5 C69.7238576,99.5 69.5,99.7238576 69.5,100 L69.5,102 C69.5,102.276142 69.7238576,102.5 70,102.5 C70.2761424,102.5 70.5,102.276142 70.5,102 L70.5,100 C70.5,99.7238576 70.2761424,99.5 70,99.5 Z M70,93.5 C69.7238576,93.5 69.5,93.7238576 69.5,94 L69.5,96 C69.5,96.2761424 69.7238576,96.5 70,96.5 C70.2761424,96.5 70.5,96.2761424 70.5,96 L70.5,94 C70.5,93.7238576 70.2761424,93.5 70,93.5 Z M70,87.5 C69.7238576,87.5 69.5,87.7238576 69.5,88 L69.5,90 C69.5,90.2761424 69.7238576,90.5 70,90.5 C70.2761424,90.5 70.5,90.2761424 70.5,90 L70.5,88 C70.5,87.7238576 70.2761424,87.5 70,87.5 Z M70,81.5 C69.7238576,81.5 69.5,81.7238576 69.5,82 L69.5,84 C69.5,84.2761424 69.7238576,84.5 70,84.5 C70.2761424,84.5 70.5,84.2761424 70.5,84 L70.5,82 C70.5,81.7238576 70.2761424,81.5 70,81.5 Z M70,75.5 C69.7238576,75.5 69.5,75.7238576 69.5,76 L69.5,78 C69.5,78.2761424 69.7238576,78.5 70,78.5 C70.2761424,78.5 70.5,78.2761424 70.5,78 L70.5,76 C70.5,75.7238576 70.2761424,75.5 70,75.5 Z M70,69.5 C69.7238576,69.5 69.5,69.7238576 69.5,70 L69.5,72 C69.5,72.2761424 69.7238576,72.5 70,72.5 C70.2761424,72.5 70.5,72.2761424 70.5,72 L70.5,70 C70.5,69.7238576 70.2761424,69.5 70,69.5 Z M70,63.5 C69.7238576,63.5 69.5,63.7238576 69.5,64 L69.5,66 C69.5,66.2761424 69.7238576,66.5 70,66.5 C70.2761424,66.5 70.5,66.2761424 70.5,66 L70.5,64 C70.5,63.7238576 70.2761424,63.5 70,63.5 Z M70,57.5 C69.7238576,57.5 69.5,57.7238576 69.5,58 L69.5,60 C69.5,60.2761424 69.7238576,60.5 70,60.5 C70.2761424,60.5 70.5,60.2761424 70.5,60 L70.5,58 C70.5,57.7238576 70.2761424,57.5 70,57.5 Z M70,51.5 C69.7238576,51.5 69.5,51.7238576 69.5,52 L69.5,54 C69.5,54.2761424 69.7238576,54.5 70,54.5 C70.2761424,54.5 70.5,54.2761424 70.5,54 L70.5,52 C70.5,51.7238576 70.2761424,51.5 70,51.5 Z M70,45.5 C69.7238576,45.5 69.5,45.7238576 69.5,46 L69.5,48 C69.5,48.2761424 69.7238576,48.5 70,48.5 C70.2761424,48.5 70.5,48.2761424 70.5,48 L70.5,46 C70.5,45.7238576 70.2761424,45.5 70,45.5 Z M70,39.5 C69.7238576,39.5 69.5,39.7238576 69.5,40 L69.5,42 C69.5,42.2761424 69.7238576,42.5 70,42.5 C70.2761424,42.5 70.5,42.2761424 70.5,42 L70.5,40 C70.5,39.7238576 70.2761424,39.5 70,39.5 Z M70,33.5 C69.7238576,33.5 69.5,33.7238576 69.5,34 L69.5,36 C69.5,36.2761424 69.7238576,36.5 70,36.5 C70.2761424,36.5 70.5,36.2761424 70.5,36 L70.5,34 C70.5,33.7238576 70.2761424,33.5 70,33.5 Z M70,27.5 C69.7238576,27.5 69.5,27.7238576 69.5,28 L69.5,30 C69.5,30.2761424 69.7238576,30.5 70,30.5 C70.2761424,30.5 70.5,30.2761424 70.5,30 L70.5,28 C70.5,27.7238576 70.2761424,27.5 70,27.5 Z M70,21.5 C69.7238576,21.5 69.5,21.7238576 69.5,22 L69.5,24 C69.5,24.2761424 69.7238576,24.5 70,24.5 C70.2761424,24.5 70.5,24.2761424 70.5,24 L70.5,22 C70.5,21.7238576 70.2761424,21.5 70,21.5 Z M70,15.5 C69.7238576,15.5 69.5,15.7238576 69.5,16 L69.5,18 C69.5,18.2761424 69.7238576,18.5 70,18.5 C70.2761424,18.5 70.5,18.2761424 70.5,18 L70.5,16 C70.5,15.7238576 70.2761424,15.5 70,15.5 Z M70,9.5 C69.7238576,9.5 69.5,9.72385763 69.5,10 L69.5,12 C69.5,12.2761424 69.7238576,12.5 70,12.5 C70.2761424,12.5 70.5,12.2761424 70.5,12 L70.5,10 C70.5,9.72385763 70.2761424,9.5 70,9.5 Z" id="path-1"></path>
|
|
112
|
+
</defs>
|
|
113
|
+
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
114
|
+
<g id="Card/Ticket">
|
|
115
|
+
<mask id="mask-2" fill="white">
|
|
116
|
+
<use xlink:href="#path-1"></use>
|
|
117
|
+
</mask>
|
|
118
|
+
<g id="Combined-Shape">
|
|
119
|
+
<use fill="#ffffff" xlink:href="#path-1"></use>
|
|
120
|
+
<use fill="#2F3036" xlink:href="#path-1"></use>
|
|
121
|
+
</g>
|
|
122
|
+
</g>
|
|
123
|
+
</g>
|
|
124
|
+
<foreignObject x="20" y="10" width="30" height="30">
|
|
125
|
+
${`<img src="${safeLogoUrl}" style="width:30px;height:30px;object-fit:cover;border-radius:50%;background-color:#ffffff;" />`}
|
|
126
|
+
</foreignObject>
|
|
127
|
+
<foreignObject x="90" y="10" width="264" height="20">
|
|
128
|
+
<div style="color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;text-align:right;font-size:14px;">
|
|
129
|
+
${safeLocation}
|
|
130
|
+
</div>
|
|
131
|
+
</foreignObject>
|
|
132
|
+
<foreignObject x="90" y="60" width="264" height="54">
|
|
133
|
+
<div
|
|
134
|
+
style="
|
|
135
|
+
height: 54px;
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
justify-content: flex-end;
|
|
139
|
+
"
|
|
140
|
+
>
|
|
141
|
+
<div
|
|
142
|
+
style="
|
|
143
|
+
color: #ffffff;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
text-overflow: ellipsis;
|
|
146
|
+
display: -webkit-box;
|
|
147
|
+
-webkit-line-clamp: 2;
|
|
148
|
+
-webkit-box-orient: vertical;
|
|
149
|
+
text-align: right;
|
|
150
|
+
font-size: 20px;
|
|
151
|
+
font-weight: bold;
|
|
152
|
+
vertical-align: bottom;
|
|
153
|
+
"
|
|
154
|
+
>
|
|
155
|
+
${safeName}
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</foreignObject>
|
|
159
|
+
<svg x="20" y="95" width="28" height="20">
|
|
160
|
+
<defs>
|
|
161
|
+
<linearGradient x1="0%" y1="24.4897959%" x2="100%" y2="75.5102041%" id="linearGradient-1">
|
|
162
|
+
<stop stop-color="#CDCDCD" offset="0%"></stop>
|
|
163
|
+
<stop stop-color="#FFFFFF" offset="38.0214719%"></stop>
|
|
164
|
+
<stop stop-color="#CDCDCD" offset="100%"></stop>
|
|
165
|
+
</linearGradient>
|
|
166
|
+
<path d="M44,90 C46.209139,90 48,91.790861 48,94 L48,106 C48,108.209139 46.209139,110 44,110 L24,110 C21.790861,110 20,108.209139 20,106 L20,94 C20,91.790861 21.790861,90 24,90 L44,90 Z M43.609375,92 L24.390625,92 C23.7343717,92 23.1744815,92.2291644 22.7109375,92.6875 C22.2473935,93.1458356 22.0104167,93.7031217 22,94.359375 L22,94.359375 L22.984375,94.359375 C22.984375,93.9739564 23.1223945,93.6432305 23.3984375,93.3671875 C23.6744805,93.0911445 24.0052064,92.953125 24.390625,92.953125 L24.390625,92.953125 L43.59375,92.953125 L43.7712059,92.9615752 C44.0881707,92.9953759 44.3649542,93.1305792 44.6015625,93.3671875 C44.8776055,93.6432305 45.015625,93.9739564 45.015625,94.359375 L45.015625,94.359375 L45.015625,103.5625 L22,103.5625 L22,105.65625 C22.0104167,106.312503 22.2473935,106.867185 22.7109375,107.320312 C23.1744815,107.77344 23.7343717,108 24.390625,108 L24.390625,108 L43.59375,108 L43.8245571,107.991512 C44.3888589,107.946245 44.8770234,107.719909 45.2890625,107.3125 C45.7526065,106.854164 45.9895833,106.296878 46,105.640625 L46,105.640625 L46,94.359375 C45.9895833,93.7031217 45.7526065,93.1458356 45.2890625,92.6875 C44.8255185,92.2291644 44.2656283,92 43.609375,92 L43.609375,92 Z M37.109375,104 L38.609375,107.359375 L37.765625,107.34375 L37.46875,106.625 L36.125,106.625 L35.84375,107.34375 L35.015625,107.34375 L36.5,104 L37.109375,104 Z M39.171875,104 L40.578125,104.001953 L40.6875,104.007812 L40.921875,104.03125 L40.890625,104.03125 C40.9739588,104.041667 41.0494788,104.057292 41.1171875,104.078125 C41.1848962,104.098958 41.2499997,104.125 41.3125,104.15625 L41.3125,104.15625 L41.296875,104.15625 C41.3593753,104.1875 41.4140623,104.223958 41.4609375,104.265625 C41.5078127,104.307292 41.5520831,104.354166 41.59375,104.40625 C41.6250002,104.46875 41.6510416,104.533854 41.671875,104.601562 C41.6927084,104.669271 41.703125,104.739583 41.703125,104.8125 L41.703125,104.8125 L41.6987848,104.956597 C41.6929977,105.009838 41.6814237,105.060764 41.6640625,105.109375 C41.6380207,105.182292 41.5989586,105.25 41.546875,105.3125 L41.546875,105.3125 L41.5625,105.3125 C41.4999997,105.375 41.432292,105.429687 41.359375,105.476562 C41.286458,105.523438 41.2083338,105.557292 41.125,105.578125 L41.125,105.578125 L41.109375,105.578125 C41.171875,105.588542 41.2291664,105.601562 41.28125,105.617188 C41.3333336,105.632813 41.3802081,105.651042 41.421875,105.671875 C41.4635419,105.692708 41.5052081,105.71875 41.546875,105.75 C41.5885419,105.78125 41.6249998,105.8125 41.65625,105.84375 C41.6875002,105.875 41.7161457,105.911458 41.7421875,105.953125 C41.7682293,105.994792 41.7916666,106.041666 41.8125,106.09375 L41.8125,106.09375 L41.84375,106.234375 C41.8541667,106.286459 41.859375,106.338541 41.859375,106.390625 L41.859375,106.390625 L41.8515625,106.560547 L41.828125,106.664062 C41.8072916,106.731771 41.7812502,106.796875 41.75,106.859375 L41.75,106.859375 L41.765625,106.859375 C41.7239581,106.911459 41.6770836,106.960937 41.625,107.007812 L41.625,107.007812 L41.46875,107.140625 C41.4062497,107.171875 41.3411462,107.200521 41.2734375,107.226562 C41.2057288,107.252604 41.135417,107.276042 41.0625,107.296875 L41.0625,107.296875 L41.046875,107.296875 L40.8359375,107.328125 C40.7578121,107.338542 40.682292,107.34375 40.609375,107.34375 L40.609375,107.34375 L39.171875,107.34375 L39.171875,104 Z M45.015625,104 L45.03125,104.625 L44.046875,104.625 L44.046875,107.34375 L43.28125,107.34375 L43.28125,104.640625 L42.3125,104.640625 L42.3125,104 L45.015625,104 Z M40.703125,105.96875 L39.921875,105.96875 L39.921875,106.734375 L40.78125,106.734375 L40.8671875,106.703125 C40.8932293,106.692708 40.921875,106.677083 40.953125,106.65625 L40.953125,106.65625 L40.984375,106.636719 L41.015625,106.609375 C41.0364584,106.588542 41.0520833,106.567708 41.0625,106.546875 L41.0625,106.546875 L41.0625,106.53125 C41.0833334,106.510417 41.0963541,106.486979 41.1015625,106.460938 C41.1067709,106.434896 41.109375,106.40625 41.109375,106.375 L41.109375,106.375 L41.1054688,106.287109 L41.09375,106.242188 L41.0253907,106.113281 L40.9921875,106.078125 L40.90625,106.015625 L40.890625,106.015625 L40.8046875,105.984375 C40.768229,105.973958 40.7343752,105.96875 40.703125,105.96875 L40.703125,105.96875 Z M36.78125,104.953125 L36.375,106 L37.203125,106 L36.78125,104.953125 Z M40.640625,104.625 L39.921875,104.625 L39.921875,105.328125 L40.484375,105.328125 C40.5156252,105.328125 40.5468748,105.325521 40.578125,105.320312 L40.625,105.314453 L40.671875,105.3125 C40.6927084,105.302083 40.7187498,105.291667 40.75,105.28125 L40.75,105.28125 L40.828125,105.25 L40.8828125,105.195312 C40.8984376,105.179687 40.9114583,105.15625 40.921875,105.125 C40.9427084,105.104167 40.9557291,105.080729 40.9609375,105.054688 C40.9661459,105.028646 40.96875,105 40.96875,104.96875 L40.96875,104.96875 L40.9609375,104.859375 C40.9557291,104.828125 40.9427084,104.802083 40.921875,104.78125 L40.921875,104.78125 L40.9023438,104.751953 L40.875,104.726562 C40.8541666,104.710937 40.8333334,104.697917 40.8125,104.6875 L40.8125,104.6875 L40.796875,104.6875 C40.7760416,104.666667 40.7526043,104.651042 40.7265625,104.640625 C40.7005207,104.630208 40.6718752,104.625 40.640625,104.625 L40.640625,104.625 Z M39.921875,100.890625 C39.8072911,100.890625 39.7005213,100.911458 39.6015625,100.953125 C39.5026037,100.994792 39.4114588,101.046875 39.328125,101.109375 C39.255208,101.182292 39.1953127,101.268229 39.1484375,101.367188 C39.1015623,101.466146 39.078125,101.572916 39.078125,101.6875 C39.078125,101.739584 39.0859374,101.789062 39.1015625,101.835938 L39.1015625,101.835938 L39.15625,101.984375 C39.1770834,102.026042 39.2031248,102.067708 39.234375,102.109375 C39.2656252,102.151042 39.2968748,102.1875 39.328125,102.21875 C39.3697919,102.260417 39.4114581,102.294271 39.453125,102.320312 C39.4947919,102.346354 39.5416664,102.369792 39.59375,102.390625 L39.59375,102.390625 L39.578125,102.390625 C39.6302086,102.411458 39.6848955,102.427083 39.7421875,102.4375 C39.7994795,102.447917 39.8541664,102.453125 39.90625,102.453125 L39.90625,102.453125 L40.0338543,102.446181 C40.1067709,102.436921 40.1762149,102.418403 40.2421875,102.390625 C40.3411463,102.348958 40.427083,102.291667 40.5,102.21875 L40.5,102.21875 L40.576389,102.150174 C40.6226853,102.100405 40.6597221,102.042535 40.6875,101.976562 C40.7291669,101.877604 40.7552083,101.776042 40.765625,101.671875 L40.765625,101.671875 L40.7578126,101.553819 C40.7473959,101.48669 40.7265627,101.421875 40.6953125,101.359375 C40.6484373,101.265625 40.5833338,101.182292 40.5,101.109375 C40.427083,101.046875 40.3411463,100.994792 40.2421875,100.953125 C40.1432287,100.911458 40.0364589,100.890625 39.921875,100.890625 Z M24.9375,95.15625 L22,95.15625 L22,102.390625 L24.75,102.390625 C25,102.390625 25.2395822,102.372396 25.46875,102.335938 C25.6979178,102.299479 25.9166656,102.244792 26.125,102.171875 L26.125,102.171875 L26.140625,102.171875 C26.3697928,102.098958 26.5885406,102.005209 26.796875,101.890625 C27.0052094,101.776041 27.1979158,101.651042 27.375,101.515625 L27.375,101.515625 L27.390625,101.5 C27.7760436,101.197915 28.0859363,100.817711 28.3203125,100.359375 C28.5546887,99.9010394 28.671875,99.4062527 28.671875,98.875 L28.671875,98.875 L28.671875,98.6875 C28.671875,98.4062486 28.6458336,98.1380221 28.59375,97.8828125 C28.5416664,97.6276029 28.4635422,97.3906261 28.359375,97.171875 L28.359375,97.171875 L28.34375,97.15625 C28.2499995,96.9374989 28.1328132,96.7343759 27.9921875,96.546875 C27.8515618,96.3593741 27.6979175,96.1927091 27.53125,96.046875 C27.3541658,95.9010409 27.1666677,95.7708339 26.96875,95.65625 C26.7708323,95.5416661 26.5572928,95.447917 26.328125,95.375 L26.328125,95.375 L26.359375,95.375 C26.1302072,95.302083 25.8984387,95.247396 25.6640625,95.2109375 C25.4296863,95.174479 25.1875013,95.15625 24.9375,95.15625 L24.9375,95.15625 Z M30.703125,95.15625 L29.375,95.15625 L29.375,102.390625 L30.703125,102.390625 L30.703125,95.15625 Z M34.703125,95.15625 L31.78125,95.15625 L31.78125,102.390625 L34.53125,102.390625 C34.78125,102.390625 35.0208322,102.372396 35.25,102.335938 C35.4791678,102.299479 35.6927073,102.244792 35.890625,102.171875 L35.890625,102.171875 L35.921875,102.171875 C36.1510428,102.098958 36.3697906,102.005209 36.578125,101.890625 C36.7864594,101.776041 36.9791658,101.651042 37.15625,101.515625 L37.15625,101.515625 L37.171875,101.5 C37.3593759,101.354166 37.5286451,101.187501 37.6796875,101 C37.8307299,100.812499 37.9687494,100.609376 38.09375,100.390625 L38.09375,100.390625 L38.078125,100.40625 C38.1927089,100.177082 38.2838538,99.932293 38.3515625,99.671875 C38.4192712,99.411457 38.453125,99.1406264 38.453125,98.859375 L38.453125,98.859375 L38.453125,98.6875 C38.453125,98.4062486 38.4244795,98.1380221 38.3671875,97.8828125 C38.3098955,97.6276029 38.2343755,97.3906261 38.140625,97.171875 L38.140625,97.171875 L38.125,97.15625 C38.0312495,96.9374989 37.9140632,96.7343759 37.7734375,96.546875 C37.6328118,96.3593741 37.4739592,96.1927091 37.296875,96.046875 L37.296875,96.046875 L37.3125,96.046875 C37.1354158,95.9010409 36.9479177,95.7708339 36.75,95.65625 C36.5520823,95.5416661 36.3385428,95.447917 36.109375,95.375 L36.109375,95.375 L36.140625,95.375 C35.9114572,95.302083 35.6770845,95.247396 35.4375,95.2109375 C35.1979155,95.174479 34.9531262,95.15625 34.703125,95.15625 L34.703125,95.15625 Z M24.5,96.3125 L24.8125,96.3203125 L25.09375,96.34375 C25.2812509,96.3645834 25.4583325,96.3958331 25.625,96.4375 L25.625,96.4375 L25.640625,96.453125 C25.7968758,96.4947919 25.9479159,96.552083 26.09375,96.625 C26.2395841,96.697917 26.3749994,96.7864578 26.5,96.890625 L26.5,96.890625 L26.515625,96.890625 C26.6302089,96.9843755 26.7369787,97.0937494 26.8359375,97.21875 C26.9348963,97.3437506 27.0156247,97.4843742 27.078125,97.640625 L27.078125,97.640625 L27.078125,97.625 C27.151042,97.7812508 27.205729,97.9479158 27.2421875,98.125 C27.278646,98.3020842 27.296875,98.4895823 27.296875,98.6875 L27.296875,98.6875 L27.296875,98.84375 C27.296875,99.0312509 27.2760419,99.2135408 27.234375,99.390625 C27.1927081,99.5677092 27.135417,99.7343742 27.0625,99.890625 L27.0625,99.890625 L27.0625,99.90625 C26.9791662,100.052084 26.8854172,100.187499 26.78125,100.3125 C26.6770828,100.437501 26.5572923,100.552083 26.421875,100.65625 L26.421875,100.65625 L26.421875,100.640625 C26.2864577,100.744792 26.1380216,100.833333 25.9765625,100.90625 C25.8151034,100.979167 25.6458342,101.041666 25.46875,101.09375 L25.46875,101.09375 L25.5,101.09375 C25.3020823,101.135417 25.1041677,101.169271 24.90625,101.195312 C24.7083323,101.221354 24.5104177,101.234375 24.3125,101.234375 L24.3125,101.234375 L23.328125,101.234375 L23.328125,96.3125 L24.5,96.3125 Z M34.296875,96.3125 L34.5078127,96.3159722 C34.6362848,96.3206018 34.7612841,96.329861 34.8828125,96.34375 C35.0651051,96.3645834 35.2395825,96.3958331 35.40625,96.4375 L35.40625,96.4375 L35.421875,96.453125 C35.5885425,96.4947919 35.7447909,96.552083 35.890625,96.625 C36.0364591,96.697917 36.1718744,96.7864578 36.296875,96.890625 C36.4218756,96.9843755 36.5312495,97.0937494 36.625,97.21875 C36.7187505,97.3437506 36.7968747,97.4843742 36.859375,97.640625 L36.859375,97.640625 L36.859375,97.625 C36.9218753,97.7812508 36.9739581,97.9505199 37.015625,98.1328125 C37.0572919,98.3151051 37.078125,98.4999991 37.078125,98.6875 L37.078125,98.6875 L37.078125,98.828125 C37.078125,99.0260427 37.0572919,99.2135408 37.015625,99.390625 C36.9739581,99.5677092 36.9114588,99.7343742 36.828125,99.890625 L36.828125,99.890625 L36.828125,99.90625 C36.755208,100.052084 36.664063,100.187499 36.5546875,100.3125 C36.445312,100.437501 36.3281256,100.552083 36.203125,100.65625 L36.203125,100.65625 L36.203125,100.640625 C36.0677077,100.744792 35.9192716,100.833333 35.7578125,100.90625 C35.5963534,100.979167 35.4218759,101.041666 35.234375,101.09375 L35.234375,101.09375 L35.28125,101.09375 C35.0833323,101.135417 34.8854177,101.169271 34.6875,101.195312 C34.4895823,101.221354 34.2864594,101.234375 34.078125,101.234375 L34.078125,101.234375 L33.109375,101.234375 L33.109375,96.3125 L34.296875,96.3125 Z M39.9375,97.40625 L39.7942707,97.4140624 C39.7213541,97.4244791 39.6519101,97.4453123 39.5859375,97.4765625 C39.4869787,97.5234377 39.401042,97.583333 39.328125,97.65625 C39.255208,97.7187503 39.1953127,97.7994787 39.1484375,97.8984375 C39.1015623,97.9973963 39.078125,98.1041661 39.078125,98.21875 C39.078125,98.2812503 39.0859374,98.3359373 39.1015625,98.3828125 C39.1171876,98.4296877 39.1354166,98.4739581 39.15625,98.515625 L39.15625,98.515625 L39.15625,98.53125 C39.1770834,98.5729169 39.2031248,98.6145831 39.234375,98.65625 C39.2656252,98.6979169 39.3020831,98.7343748 39.34375,98.765625 L39.34375,98.765625 L39.3964843,98.8105469 L39.4609375,98.8515625 C39.5078127,98.8776043 39.5572914,98.9010416 39.609375,98.921875 L39.609375,98.921875 L39.59375,98.921875 C39.6458336,98.9427084 39.6979164,98.9583333 39.75,98.96875 C39.8020836,98.9791667 39.8593747,98.984375 39.921875,98.984375 L39.921875,98.984375 L40.0494793,98.9774306 C40.1223959,98.9681714 40.1918399,98.9496529 40.2578125,98.921875 C40.3567713,98.8802081 40.442708,98.822917 40.515625,98.75 C40.588542,98.6874997 40.6484373,98.6067713 40.6953125,98.5078125 C40.7421877,98.4088537 40.765625,98.3020839 40.765625,98.1875 C40.765625,98.0729161 40.7421877,97.9687505 40.6953125,97.875 C40.6484373,97.7812495 40.5833338,97.7031253 40.5,97.640625 L40.5,97.640625 L40.422743,97.5729166 C40.368345,97.5312499 40.3081601,97.4965279 40.2421875,97.46875 C40.1432287,97.4270831 40.0416672,97.40625 39.9375,97.40625 L39.9375,97.40625 Z" id="path-2"></path>
|
|
167
|
+
</defs>
|
|
168
|
+
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
169
|
+
<g id="Card/Account/Application" transform="translate(-20.000000, -90.000000)">
|
|
170
|
+
<g id="DID-Icon">
|
|
171
|
+
<use fill="#FFFFFF" xlink:href="#path-2"></use>
|
|
172
|
+
<use fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
|
|
173
|
+
</g>
|
|
174
|
+
</g>
|
|
175
|
+
</g>
|
|
176
|
+
</svg>
|
|
177
|
+
</svg>
|
|
178
|
+
`;
|
|
179
|
+
}
|
|
180
|
+
const createSvgDisplay = (svg, text) => `<svg
|
|
181
|
+
width="374px"
|
|
182
|
+
height="130px"
|
|
183
|
+
viewBox="0 0 374 130"
|
|
184
|
+
version="1.1"
|
|
185
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
186
|
+
xmlnsXlink="http://www.w3.org/1999/xlink">
|
|
187
|
+
<desc>Created with arcblock.io</desc>
|
|
188
|
+
${svg}
|
|
189
|
+
${insertText({
|
|
190
|
+
x: 50,
|
|
191
|
+
y: 100,
|
|
192
|
+
size: 20,
|
|
193
|
+
anchor: "left",
|
|
194
|
+
color: "black",
|
|
195
|
+
text
|
|
196
|
+
})}
|
|
197
|
+
</svg>`;
|
|
198
|
+
/**
|
|
199
|
+
* inset a text in svg
|
|
200
|
+
* @param {object} param
|
|
201
|
+
* @param {int} param.x position.x of the text
|
|
202
|
+
* @param {int} param.y position.y of the text
|
|
203
|
+
* @param {int} param.size font size of the text
|
|
204
|
+
* @param {string} param.anchor Text alignment: left right middle
|
|
205
|
+
* @param {string} param.color color of text
|
|
206
|
+
* @param {string} param.text text
|
|
207
|
+
*/
|
|
208
|
+
const insertText = ({ x, y, size, anchor, color, text }) => `<text x="${escapeHtml(x)}" y="${escapeHtml(y)}" font-size="${escapeHtml(size)}' text-anchor="${escapeHtml(anchor)}" fill="${escapeHtml(color)}" >${escapeHtml(text)} </text>`;
|
|
209
|
+
const createZippedSvgDisplay = (svg) => (0, _ocap_util.toBase64)(pako.default.gzip(svg));
|
|
210
|
+
var src_default = {
|
|
211
|
+
createCertSvg,
|
|
212
|
+
createTicketSvg,
|
|
213
|
+
createZippedSvgDisplay,
|
|
214
|
+
insertText,
|
|
215
|
+
createSvgDisplay
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
//#endregion
|
|
219
|
+
exports.createCertSvg = createCertSvg;
|
|
220
|
+
exports.createSvgDisplay = createSvgDisplay;
|
|
221
|
+
exports.createTicketSvg = createTicketSvg;
|
|
222
|
+
exports.createZippedSvgDisplay = createZippedSvgDisplay;
|
|
223
|
+
exports.default = src_default;
|
|
224
|
+
exports.insertText = insertText;
|
package/lib/index.d.cts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
interface AssetRecipient {
|
|
3
|
+
attributes?: {
|
|
4
|
+
name?: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
interface CertAssetPayload {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
reason: string;
|
|
13
|
+
logoUrl?: string;
|
|
14
|
+
recipient: AssetRecipient | null;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
interface TicketAssetPayload extends CertAssetPayload {
|
|
18
|
+
location?: string;
|
|
19
|
+
}
|
|
20
|
+
interface InsertTextParams {
|
|
21
|
+
x: number | string;
|
|
22
|
+
y: number | string;
|
|
23
|
+
size: number | string;
|
|
24
|
+
anchor: string;
|
|
25
|
+
color: string;
|
|
26
|
+
text: string;
|
|
27
|
+
}
|
|
28
|
+
declare function createCertSvg({
|
|
29
|
+
data
|
|
30
|
+
}: {
|
|
31
|
+
data: CertAssetPayload;
|
|
32
|
+
}): string;
|
|
33
|
+
declare function createTicketSvg({
|
|
34
|
+
data
|
|
35
|
+
}: {
|
|
36
|
+
data: TicketAssetPayload;
|
|
37
|
+
}): string;
|
|
38
|
+
declare const createSvgDisplay: (svg: string, text: string) => string;
|
|
39
|
+
/**
|
|
40
|
+
* inset a text in svg
|
|
41
|
+
* @param {object} param
|
|
42
|
+
* @param {int} param.x position.x of the text
|
|
43
|
+
* @param {int} param.y position.y of the text
|
|
44
|
+
* @param {int} param.size font size of the text
|
|
45
|
+
* @param {string} param.anchor Text alignment: left right middle
|
|
46
|
+
* @param {string} param.color color of text
|
|
47
|
+
* @param {string} param.text text
|
|
48
|
+
*/
|
|
49
|
+
declare const insertText: ({
|
|
50
|
+
x,
|
|
51
|
+
y,
|
|
52
|
+
size,
|
|
53
|
+
anchor,
|
|
54
|
+
color,
|
|
55
|
+
text
|
|
56
|
+
}: InsertTextParams) => string;
|
|
57
|
+
declare const createZippedSvgDisplay: (svg: string | Uint8Array) => string;
|
|
58
|
+
declare const _default: {
|
|
59
|
+
createCertSvg: typeof createCertSvg;
|
|
60
|
+
createTicketSvg: typeof createTicketSvg;
|
|
61
|
+
createZippedSvgDisplay: (svg: string | Uint8Array) => string;
|
|
62
|
+
insertText: ({
|
|
63
|
+
x,
|
|
64
|
+
y,
|
|
65
|
+
size,
|
|
66
|
+
anchor,
|
|
67
|
+
color,
|
|
68
|
+
text
|
|
69
|
+
}: InsertTextParams) => string;
|
|
70
|
+
createSvgDisplay: (svg: string, text: string) => string;
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { AssetRecipient, CertAssetPayload, InsertTextParams, TicketAssetPayload, createCertSvg, createSvgDisplay, createTicketSvg, createZippedSvgDisplay, _default as default, insertText };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/nft-template",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.26",
|
|
4
4
|
"description": "Javascript lib to work with ArcBlock NFT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arcblock",
|
|
@@ -21,31 +21,52 @@
|
|
|
21
21
|
],
|
|
22
22
|
"homepage": "https://github.com/ArcBlock/blockchain/tree/master/asset/template",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
|
-
"
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./lib/index.cjs",
|
|
26
|
+
"module": "./esm/index.mjs",
|
|
27
|
+
"types": "./esm/index.d.mts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./esm/index.d.mts",
|
|
31
|
+
"import": "./esm/index.mjs",
|
|
32
|
+
"default": "./lib/index.cjs"
|
|
33
|
+
},
|
|
34
|
+
"./lib/*.js": {
|
|
35
|
+
"types": "./esm/*.d.mts",
|
|
36
|
+
"import": "./esm/*.mjs",
|
|
37
|
+
"default": "./lib/*.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./lib/*": {
|
|
40
|
+
"types": "./esm/*.d.mts",
|
|
41
|
+
"import": "./esm/*.mjs",
|
|
42
|
+
"default": "./lib/*.cjs"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
25
45
|
"files": [
|
|
26
|
-
"lib"
|
|
46
|
+
"lib",
|
|
47
|
+
"esm"
|
|
27
48
|
],
|
|
28
|
-
"devDependencies": {
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/pako": "^2.0.3"
|
|
51
|
+
},
|
|
29
52
|
"repository": {
|
|
30
53
|
"type": "git",
|
|
31
54
|
"url": "git+https://github.com/ArcBlock/blockchain.git"
|
|
32
55
|
},
|
|
33
56
|
"scripts": {
|
|
57
|
+
"build": "tsdown",
|
|
58
|
+
"prebuild": "rm -rf lib esm",
|
|
34
59
|
"lint": "biome check",
|
|
35
60
|
"lint:fix": "biome check --write",
|
|
36
|
-
"docs": "bun run gen-dts && bun run gen-docs && bun run cleanup-docs && bun run format-docs",
|
|
37
|
-
"cleanup-docs": "node ../../scripts/cleanup-docs.js docs/README.md $npm_package_name",
|
|
38
|
-
"gen-docs": "jsdoc2md lib/index.js > docs/README.md",
|
|
39
|
-
"gen-dts": "j2d lib/index.js",
|
|
40
|
-
"format-docs": "remark . -o",
|
|
41
61
|
"test": "bun test",
|
|
42
|
-
"coverage": "npm run test -- --coverage"
|
|
62
|
+
"coverage": "npm run test -- --coverage",
|
|
63
|
+
"clean": "rm -rf lib esm"
|
|
43
64
|
},
|
|
44
65
|
"bugs": {
|
|
45
66
|
"url": "https://github.com/ArcBlock/blockchain/issues"
|
|
46
67
|
},
|
|
47
68
|
"dependencies": {
|
|
48
|
-
"@ocap/util": "1.30.
|
|
69
|
+
"@ocap/util": "1.30.26",
|
|
49
70
|
"pako": "^1.0.11"
|
|
50
71
|
},
|
|
51
72
|
"gitHead": "554c17ccece77a1abc528348bee7f9e75865d918"
|
package/lib/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Generate by [js2dts@0.3.3](https://github.com/whxaxes/js2dts#readme)
|
|
2
|
-
|
|
3
|
-
declare function createCertSvg(T100: _Lib.T101): string;
|
|
4
|
-
declare function createTicketSvg(T102: _Lib.T101): string;
|
|
5
|
-
declare const _Lib: _Lib.T105;
|
|
6
|
-
declare namespace _Lib {
|
|
7
|
-
export interface T101 {
|
|
8
|
-
data: any;
|
|
9
|
-
}
|
|
10
|
-
export interface T104 {
|
|
11
|
-
x: any;
|
|
12
|
-
y: any;
|
|
13
|
-
size: any;
|
|
14
|
-
anchor: string;
|
|
15
|
-
color: string;
|
|
16
|
-
text: string;
|
|
17
|
-
}
|
|
18
|
-
export interface T105 {
|
|
19
|
-
createCertSvg: typeof createCertSvg;
|
|
20
|
-
createTicketSvg: typeof createTicketSvg;
|
|
21
|
-
createZippedSvgDisplay: (svg: any) => string;
|
|
22
|
-
insertText: (T103: _Lib.T104) => string;
|
|
23
|
-
createSvgDisplay: (svg: any, text: any) => string;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export = _Lib;
|