express-sweet-generator 1.0.0 → 1.0.3

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/README.md +16 -43
  3. package/bin/express-sweet-cli.js +220 -214
  4. package/package.json +1 -1
  5. package/templates/{.env → cjs/.env} +0 -0
  6. package/templates/{app.js → cjs/app.js} +0 -0
  7. package/templates/{bin → cjs/bin}/www.ejs +0 -0
  8. package/templates/{config → cjs/config}/authentication.js +1 -1
  9. package/templates/{config → cjs/config}/config.js +0 -0
  10. package/templates/{config → cjs/config}/database.js +6 -12
  11. package/templates/{config → cjs/config}/view.js +0 -0
  12. package/templates/{ecosystem.config.js.ejs → cjs/ecosystem.config.js.ejs} +5 -1
  13. package/templates/{models → cjs/models}/BookModel.js +0 -0
  14. package/templates/{models → cjs/models}/CommentModel.js +0 -0
  15. package/templates/{models → cjs/models}/ProfileModel.js +0 -0
  16. package/templates/{models → cjs/models}/UserModel.js +0 -0
  17. package/templates/{nginx.sample.conf.ejs → cjs/nginx.sample.conf.ejs} +0 -0
  18. package/templates/{package.json.ejs → cjs/package.json.ejs} +2 -7
  19. package/templates/{views/partials/.gitkeep → cjs/public/assets/home.css} +0 -0
  20. package/templates/cjs/public/assets/home.js +0 -0
  21. package/templates/{public/assets/styles → cjs/public/assets}/login.css +0 -2
  22. package/templates/{public/assets/scripts → cjs/public/assets}/login.js +0 -3
  23. package/templates/{public/assets/images → cjs/public/assets}/logo.svg +0 -0
  24. package/templates/cjs/public/assets/user.css +0 -0
  25. package/templates/{public/assets/scripts → cjs/public/assets}/user.js +0 -3
  26. package/templates/cjs/public/assets/users.css +0 -0
  27. package/templates/{public/assets/scripts → cjs/public/assets}/users.js +11 -9
  28. package/templates/{public → cjs/public}/favicon.ico +0 -0
  29. package/templates/{public → cjs/public}/rekognition-test-image/add-face-to-collection.jpg +0 -0
  30. package/templates/{public → cjs/public}/rekognition-test-image/compare-faces-source.jpg +0 -0
  31. package/templates/{public → cjs/public}/rekognition-test-image/compare-faces-target.jpg +0 -0
  32. package/templates/{public → cjs/public}/rekognition-test-image/detect-faces.jpg +0 -0
  33. package/templates/{routes → cjs/routes}/api/users.js +7 -33
  34. package/templates/{routes → cjs/routes}/home.js +0 -3
  35. package/templates/{routes → cjs/routes}/login.js +0 -3
  36. package/templates/{routes → cjs/routes}/users.js +3 -9
  37. package/templates/{views → cjs/views}/error.hbs +1 -2
  38. package/templates/cjs/views/home.hbs +5 -0
  39. package/templates/{views → cjs/views}/layout/default.hbs +13 -18
  40. package/templates/cjs/views/login.hbs +16 -0
  41. package/templates/cjs/views/partials/.gitkeep +0 -0
  42. package/templates/cjs/views/user.hbs +35 -0
  43. package/templates/cjs/views/users.hbs +18 -0
  44. package/templates/esm/.env +1 -0
  45. package/templates/esm/app.js +10 -0
  46. package/templates/esm/bin/www.ejs +67 -0
  47. package/templates/esm/config/authentication.js +81 -0
  48. package/templates/esm/config/config.js +78 -0
  49. package/templates/esm/config/database.js +35 -0
  50. package/templates/esm/config/view.js +36 -0
  51. package/templates/esm/ecosystem.config.js.ejs +35 -0
  52. package/templates/esm/models/BookModel.js +30 -0
  53. package/templates/esm/models/CommentModel.js +30 -0
  54. package/templates/esm/models/ProfileModel.js +49 -0
  55. package/templates/esm/models/UserModel.js +113 -0
  56. package/templates/esm/nginx.sample.conf.ejs +48 -0
  57. package/templates/esm/package.json.ejs +21 -0
  58. package/templates/esm/public/assets/home.css +0 -0
  59. package/templates/esm/public/assets/home.js +0 -0
  60. package/templates/esm/public/assets/login.css +16 -0
  61. package/templates/esm/public/assets/login.js +29 -0
  62. package/templates/{public/assets/images/logo-dark.svg → esm/public/assets/logo.svg} +2 -2
  63. package/templates/esm/public/assets/user.css +0 -0
  64. package/templates/esm/public/assets/user.js +50 -0
  65. package/templates/esm/public/assets/users.css +0 -0
  66. package/templates/esm/public/assets/users.js +85 -0
  67. package/templates/esm/public/favicon.ico +0 -0
  68. package/templates/esm/public/rekognition-test-image/add-face-to-collection.jpg +0 -0
  69. package/templates/esm/public/rekognition-test-image/compare-faces-source.jpg +0 -0
  70. package/templates/esm/public/rekognition-test-image/compare-faces-target.jpg +0 -0
  71. package/templates/esm/public/rekognition-test-image/detect-faces.jpg +0 -0
  72. package/templates/esm/routes/api/users.js +98 -0
  73. package/templates/esm/routes/home.js +8 -0
  74. package/templates/esm/routes/login.js +8 -0
  75. package/templates/esm/routes/users.js +31 -0
  76. package/templates/esm/views/error.hbs +4 -0
  77. package/templates/esm/views/home.hbs +5 -0
  78. package/templates/esm/views/layout/default.hbs +57 -0
  79. package/templates/esm/views/login.hbs +16 -0
  80. package/templates/esm/views/partials/.gitkeep +0 -0
  81. package/templates/esm/views/user.hbs +35 -0
  82. package/templates/esm/views/users.hbs +18 -0
  83. package/templates/public/assets/scripts/docs.js +0 -1
  84. package/templates/public/assets/scripts/home.js +0 -3
  85. package/templates/public/assets/styles/docs.css +0 -2200
  86. package/templates/public/assets/styles/home.css +0 -1
  87. package/templates/public/assets/styles/user.css +0 -1
  88. package/templates/public/assets/styles/users.css +0 -1
  89. package/templates/views/home.hbs +0 -11
  90. package/templates/views/login.hbs +0 -27
  91. package/templates/views/user.hbs +0 -42
  92. package/templates/views/users.hbs +0 -30
@@ -0,0 +1,78 @@
1
+ import path from 'path';
2
+
3
+ /**
4
+ * Express Sweet basic configuration interface.
5
+ */
6
+ export default {
7
+ /**
8
+ * Environment variable file (.env) path, defaults to none (undefined).
9
+ * @type {string}
10
+ */
11
+ env_path: '.env',
12
+
13
+ /**
14
+ * CORS permission, defaults to invalid (false).
15
+ * @type {{enabled: boolean}}
16
+ */
17
+ cors_enabled: true,
18
+
19
+ /**
20
+ * Maximum body size you can request, defaults to `100kb`.
21
+ * @type {string|number}
22
+ */
23
+ max_body_size: '100kb',
24
+
25
+ /**
26
+ * Absolute path to the router directory, defaults to `<application root directory>/routes`.
27
+ * @type {string}
28
+ */
29
+ router_dir: path.join(process.cwd(), 'routes'),
30
+
31
+ /**
32
+ * The endpoint to run when the root URL is requested, defaults to none (undefined).
33
+ * @type {string}
34
+ */
35
+ default_router: '/home',
36
+
37
+ /**
38
+ * This is a hook that rewrites the base URL.
39
+ * If you want to rewrite the app.locals.baseUrl property and the view's baseUrl variable, use this hook to return a new base URL.
40
+ * The default value is the referrer's origin (eg https://example.com).
41
+ *
42
+ * @example
43
+ * rewrite_base_url: baseUrl => {
44
+ * return `${baseUrl}/admin`;
45
+ * }
46
+ *
47
+ * @type {(baseUrl: string): string}
48
+ */
49
+ rewrite_base_url: baseUrl => {
50
+ return baseUrl;
51
+ },
52
+
53
+ /**
54
+ * This is a hook for error handling.
55
+ * For example, you can use it when you want to send an external notification of the error received by this hook.
56
+ *
57
+ * @example
58
+ * error_handler: async err => {
59
+ * // Notify system administrator of error.
60
+ * return new Promise((resolve, reject) => {
61
+ * const sendmail = require('sendmail')();
62
+ * sendmail({
63
+ * from: 'no-reply@example.com',
64
+ * to: 'administrator@example.com',
65
+ * subject: 'Error occurred',
66
+ * text: err.message
67
+ * }, err => {
68
+ * err ? reject(err) : resolve();
69
+ * });
70
+ * });
71
+ * }
72
+ *
73
+ * @type {(err: any): void|Promise<void>}
74
+ */
75
+ error_handler: err => {
76
+ console.error(`An error has occurred. Error message: ${err.message}`);
77
+ }
78
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Database configuration.
3
+ */
4
+ export default {
5
+ development: {
6
+ username: 'root',
7
+ password: 'password',
8
+ database: 'mydb',
9
+ host: 'localhost',
10
+ port: undefined,
11
+ dialect: 'mariadb',
12
+ timezone: '+09:00',
13
+ logging: false
14
+ },
15
+ test: {
16
+ username: 'root',
17
+ password: 'password',
18
+ database: 'mydb',
19
+ host: 'localhost',
20
+ port: undefined,
21
+ dialect: 'mariadb',
22
+ timezone: '+09:00',
23
+ logging: false
24
+ },
25
+ production: {
26
+ username: 'root',
27
+ password: 'password',
28
+ database: 'mydb',
29
+ host: 'localhost',
30
+ port: undefined,
31
+ dialect: 'mariadb',
32
+ timezone: '+09:00',
33
+ logging: false
34
+ }
35
+ }
@@ -0,0 +1,36 @@
1
+ import path from 'path';
2
+
3
+ /**
4
+ * View's configuration interface.
5
+ */
6
+ export default {
7
+ /**
8
+ * Absolute path to the directory where the view files are located, defaults to `<application root directory>/views`.
9
+ * @type {string}
10
+ */
11
+ views_dir: path.join(process.cwd(), 'views'),
12
+
13
+ /**
14
+ * Path to partials templates, one or several directories, defaults to `<application root directory>/views/partials`.
15
+ * @type {string|string[]}
16
+ */
17
+ partials_dir: path.join(process.cwd(), 'views/partials'),
18
+
19
+ /**
20
+ * Path to layout templates, defaults to `<application root directory>/views/layout`.
21
+ * @type {string}
22
+ */
23
+ layouts_dir: path.join(process.cwd(), 'views/layout'),
24
+
25
+ /**
26
+ * Absolute path to default layout template. defaults to `<application root directory>/views/layout/default.hbs`.
27
+ * @type {string}
28
+ */
29
+ default_layout: path.join(process.cwd(), 'views/layout/default.hbs'),
30
+
31
+ /**
32
+ * Extension for templates & partials, defaults to `.hbs`,
33
+ * @type {string}
34
+ */
35
+ extension: '.hbs'
36
+ }
@@ -0,0 +1,35 @@
1
+ const PORT = <%- port %>;
2
+
3
+ module.exports = {
4
+ apps : [
5
+ {
6
+ name: '<%- name %>',
7
+ script: 'bin/www',
8
+ node_args: '-r esm',
9
+ exec_mode: 'cluster_mode',
10
+ watch: '.',
11
+ watch_delay: 3000,
12
+ ignore_watch : [
13
+ 'node_modules',
14
+ 'public',
15
+ 'views'
16
+ ],
17
+ watch_options: {
18
+ followSymlinks: false,
19
+ usePolling: true
20
+ },
21
+ env: {
22
+ NODE_ENV: 'development',
23
+ PORT
24
+ },
25
+ env_test: {
26
+ NODE_ENV: 'test',
27
+ PORT
28
+ },
29
+ env_production: {
30
+ NODE_ENV: 'production',
31
+ PORT
32
+ }
33
+ }
34
+ ]
35
+ };
@@ -0,0 +1,30 @@
1
+ import * as sweet from 'express-sweet';
2
+
3
+ /**
4
+ * Book model.
5
+ */
6
+ export default class extends sweet.database.Model {
7
+ /**
8
+ * The name of the table that the model accesses.
9
+ */
10
+ static get table() {
11
+ return 'book';
12
+ }
13
+
14
+ /**
15
+ * List of columns in the table accessed by this model.
16
+ */
17
+ static get attributes() {
18
+ return {
19
+ id: {
20
+ type: this.DataTypes.INTEGER,
21
+ primaryKey: true,
22
+ autoIncrement: true
23
+ },
24
+ userId: this.DataTypes.INTEGER,
25
+ title: this.DataTypes.STRING,
26
+ created: this.DataTypes.DATE,
27
+ modified: this.DataTypes.DATE
28
+ };
29
+ }
30
+ }
@@ -0,0 +1,30 @@
1
+ import * as sweet from 'express-sweet';
2
+
3
+ /**
4
+ * Comment model.
5
+ */
6
+ export default class extends sweet.database.Model {
7
+ /**
8
+ * The name of the table that the model accesses.
9
+ */
10
+ static get table() {
11
+ return 'comment';
12
+ }
13
+
14
+ /**
15
+ * List of columns in the table accessed by this model.
16
+ */
17
+ static get attributes() {
18
+ return {
19
+ id: {
20
+ type: this.DataTypes.INTEGER,
21
+ primaryKey: true,
22
+ autoIncrement: true
23
+ },
24
+ userId: this.DataTypes.INTEGER,
25
+ text: this.DataTypes.STRING,
26
+ created: this.DataTypes.DATE,
27
+ modified: this.DataTypes.DATE
28
+ };
29
+ }
30
+ }
@@ -0,0 +1,49 @@
1
+ import * as sweet from 'express-sweet';
2
+ import UserModel from './UserModel';
3
+
4
+ /**
5
+ * Profile model.
6
+ */
7
+ export default class extends sweet.database.Model {
8
+ /**
9
+ * The name of the table that the model accesses.
10
+ */
11
+ static get table() {
12
+ return 'profile';
13
+ }
14
+
15
+ /**
16
+ * List of columns in the table accessed by this model.
17
+ */
18
+ static get attributes() {
19
+ return {
20
+ id: {
21
+ type: this.DataTypes.INTEGER,
22
+ primaryKey: true,
23
+ autoIncrement: true
24
+ },
25
+ userId: this.DataTypes.INTEGER,
26
+ address: this.DataTypes.STRING,
27
+ tel: this.DataTypes.STRING,
28
+ created: this.DataTypes.DATE,
29
+ modified: this.DataTypes.DATE
30
+ };
31
+ }
32
+
33
+ /**
34
+ * Associate the model.
35
+ * Define associations with other models such as "hasOne", "hasMany", "belongsTo", "belongsToMany".
36
+ * If you omit the alias (as) option, the associated name will be hasOne, singular for belongsTo, and plural for hasMany.
37
+ * This method is called automatically from within the "express-sweet.mount" method, so you don't have to run it yourself.
38
+ *
39
+ * @see https://sequelize.org/master/manual/assocs.html
40
+ */
41
+ static association() {
42
+ // Profile belongs to one user.
43
+ this.belongsTo(UserModel, {
44
+ foreignKey: 'userId', // profile.userId,
45
+ targetKey: 'id', // user.id
46
+ as: 'user'
47
+ });
48
+ }
49
+ }
@@ -0,0 +1,113 @@
1
+ import * as sweet from 'express-sweet';
2
+ import ProfileModel from './ProfileModel';
3
+ import CommentModel from './CommentModel';
4
+ import BookModel from './BookModel';
5
+
6
+ /**
7
+ * User model.
8
+ */
9
+ export default class extends sweet.database.Model {
10
+ /**
11
+ * The name of the table that the model accesses.
12
+ */
13
+ static get table() {
14
+ return 'user';
15
+ }
16
+
17
+ /**
18
+ * List of columns in the table accessed by this model.
19
+ */
20
+ static get attributes() {
21
+ return {
22
+ id: {
23
+ type: this.DataTypes.INTEGER,
24
+ primaryKey: true,
25
+ autoIncrement: true
26
+ },
27
+ email: this.DataTypes.STRING,
28
+ password: this.DataTypes.STRING,
29
+ name: this.DataTypes.STRING,
30
+ created: this.DataTypes.DATE,
31
+ modified: this.DataTypes.DATE
32
+ };
33
+ }
34
+
35
+ /**
36
+ * Associate the model.
37
+ * Define associations with other models such as "hasOne", "hasMany", "belongsTo", "belongsToMany".
38
+ * If you omit the alias (as) option, the associated name will be hasOne, singular for belongsTo, and plural for hasMany.
39
+ * This method is called automatically from within the "express-sweet.mount" method, so you don't have to run it yourself.
40
+ *
41
+ * @see https://sequelize.org/master/manual/assocs.html
42
+ */
43
+ static association() {
44
+ // User has one profile.
45
+ this.hasOne(ProfileModel, {
46
+ foreignKey: 'userId', // profile.userId
47
+ sourceKey: 'id', // user.id
48
+ as: 'profile'
49
+ });
50
+
51
+ // User has many comments.
52
+ this.hasMany(CommentModel, {
53
+ foreignKey: 'userId', // comment.userId
54
+ sourceKey: 'id', // user.id
55
+ as: 'comments'
56
+ });
57
+
58
+ // Users have many books, and books belong to many users.
59
+ this.hasMany(BookModel, {
60
+ foreignKey: 'userId', // book.userId
61
+ sourceKey: 'id', // user.id
62
+ as: 'books'
63
+ });
64
+ }
65
+
66
+ /**
67
+ * Returns page data.
68
+ */
69
+ static async paginate(options) {
70
+ // Initialize options.
71
+ options = Object.assign({
72
+ offset: 0,
73
+ limit: 30,
74
+ search: undefined,
75
+ order: undefined,
76
+ dir: undefined
77
+ }, options);
78
+
79
+ // Get total unconditional record count.
80
+ const recordsTotal = await this.count();
81
+
82
+ // Filtering options.
83
+ let where = undefined;
84
+ if (options.search != null && options.search.length)
85
+ where = {
86
+ [this.Op.or]: [
87
+ {id: {[this.Op.like]: `%${options.search}%`}},
88
+ {email: {[this.Op.like]: `%${options.search}%`}},
89
+ {name: {[this.Op.like]: `%${options.search}%`}},
90
+ {modified: {[this.Op.like]: `%${options.search}%`}}
91
+ ]
92
+ };
93
+
94
+ // Sort options.
95
+ let order = undefined;
96
+ if (options.order != null && options.order.length)
97
+ order = [[options.order, options.dir || 'ASC']];
98
+
99
+ // Get page data.
100
+ let data = await this.findAll({
101
+ attributes: ['id', 'email', 'name', 'modified'],
102
+ where,
103
+ order,
104
+ offset: parseInt(options.offset, 10),
105
+ limit: parseInt(options.limit, 10),
106
+ raw: true
107
+ });
108
+
109
+ // Get the total record count that matches the condition.
110
+ let recordsFiltered = await this.count({where});
111
+ return {recordsTotal, recordsFiltered, data};
112
+ }
113
+ }
@@ -0,0 +1,48 @@
1
+ upstream <%- name %>-upstream {
2
+ # ip_hash;
3
+ server 127.0.0.1:<%- port %>;
4
+ # keepalive 64;
5
+ }
6
+
7
+ server {
8
+ listen 80;
9
+ server_name <your host name>;
10
+ charset UTF-8;
11
+ access_log /var/log/nginx/<%- name %>.access.log main;
12
+ error_log /var/log/nginx/<%- name %>.error.log warn;
13
+
14
+ # Hide PHP version and web server software name
15
+ server_tokens off;
16
+
17
+ # Proxy to nodejs app
18
+ location / {
19
+ #proxy_set_header X-Forwarded-Proto https;
20
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
21
+ proxy_set_header X-Real-IP $remote_addr;
22
+ proxy_set_header Host $http_host;
23
+
24
+ # Buffering
25
+ client_max_body_size 100m;
26
+ client_body_buffer_size 100m;
27
+ proxy_buffers 8 10m;
28
+ proxy_buffer_size 10m;
29
+ proxy_busy_buffers_size 10m;
30
+
31
+ # Disable caching
32
+ set $do_not_cache 1;
33
+ proxy_no_cache $do_not_cache;
34
+ proxy_cache_bypass $do_not_cache;
35
+ sendfile off;
36
+
37
+ # Enable WebSockets
38
+ proxy_http_version 1.1;
39
+ proxy_set_header Upgrade $http_upgrade;
40
+ proxy_set_header Connection "upgrade";
41
+
42
+ # Send a request to an Express application
43
+ proxy_redirect off;
44
+ proxy_read_timeout 1m;
45
+ proxy_connect_timeout 1m;
46
+ proxy_pass http://<%- name %>-upstream;
47
+ }
48
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "<%- name %>",
3
+ "version": "1.0.0",
4
+ "scripts": {
5
+ "start": "node -r esm ./bin/www",
6
+ "//start": "pm2 start ecosystem.config.js",
7
+ "//restart": "pm2 restart ecosystem.config.js",
8
+ "//stop": "pm2 stop ecosystem.config.js"
9
+ },
10
+ "dependencies": {
11
+ "aws-sdk": "^2.888.0",
12
+ "debug": "~2.6.9",
13
+ "esm": "^3.2.25",
14
+ "express": "~4.16.1",
15
+ "express-sweet": "~1",
16
+ "http-errors": "~1.6.3",
17
+ "passport": "^0.4.1",
18
+ "passport-local": "^1.0.0",
19
+ "sequelize": "^5.22.4"
20
+ }
21
+ }
File without changes
File without changes
@@ -0,0 +1,16 @@
1
+ html, body {
2
+ height: 100%;
3
+ }
4
+
5
+ body {
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ padding-top: 40px;
10
+ padding-bottom: 40px;
11
+ }
12
+
13
+ .login-form {
14
+ max-width: 330px;
15
+ padding: 15px;
16
+ }
@@ -0,0 +1,29 @@
1
+ // Form validation.
2
+ $('#form').validate({
3
+ validClass: 'is-valid',
4
+ errorClass: 'is-invalid',
5
+ errorElement: "div",
6
+ errorPlacement: (error, element) => {
7
+ $(element).after($(error).addClass('invalid-feedback'));
8
+ },
9
+ submitHandler: async (form, event) => {
10
+ try {
11
+ event.preventDefault();
12
+
13
+ // Send an authentication request.
14
+ const res = await fetch('/api/users/login', {method: 'POST', body: new FormData(form)});
15
+
16
+ // Authentication result.
17
+ const isAuthenticated = await res.json();
18
+
19
+ // If login fails.
20
+ if (!isAuthenticated)
21
+ return void alert('The user name or password is incorrect.');
22
+
23
+ // After logging in successfully, you will be taken to the top page.
24
+ location.href = '/';
25
+ } catch(e) {
26
+ alert('An unexpected error has occurred.');
27
+ }
28
+ }
29
+ });
@@ -5,8 +5,8 @@
5
5
  <path d="m471.05,51.611c-1.244,0 -2.454,0.257 -3.525,0.863l-33.888,19.57c-2.193,1.264 -3.526,3.65 -3.526,6.189l0,39.069c0,2.537 1.333,4.92 3.526,6.187l8.85,5.109c4.3,2.119 5.885,2.086 7.842,2.086c6.366,0 10.001,-3.863 10.001,-10.576l0,-38.566c0,-0.545 -0.472,-0.935 -1.007,-0.935l-4.245,0c-0.544,0 -1.007,0.39 -1.007,0.935l0,38.566c0,2.975 -3.1,5.968 -8.13,3.453l-9.21,-5.396c-0.326,-0.177 -0.576,-0.49 -0.576,-0.863l0,-39.07c0,-0.37 0.247,-0.747 0.576,-0.935l33.816,-19.497a0.998,0.998 0 0 1 1.007,0l33.817,19.498c0.322,0.194 0.576,0.553 0.576,0.936l0,39.069c0,0.373 -0.188,0.755 -0.504,0.935l-33.889,19.498c-0.29,0.173 -0.69,0.173 -1.007,0l-8.706,-5.18a0.905,0.905 0 0 0 -0.863,0c-2.403,1.362 -2.855,1.52 -5.109,2.302c-0.555,0.194 -1.398,0.495 0.288,1.44l11.368,6.69a6.995,6.995 0 0 0 3.526,0.936a6.949,6.949 0 0 0 3.525,-0.935l33.889,-19.499c2.193,-1.275 3.525,-3.65 3.525,-6.187l0,-39.07c0,-2.538 -1.332,-4.92 -3.525,-6.187l-33.889,-19.57c-1.062,-0.607 -2.28,-0.864 -3.525,-0.864l-0.001,-0.001z" id="svg_2"/>
6
6
  <path d="m480.116,79.528c-9.65,0 -15.397,4.107 -15.397,10.937c0,7.408 5.704,9.444 14.966,10.36c11.08,1.085 11.943,2.712 11.943,4.893c0,3.783 -3.016,5.396 -10.144,5.396c-8.957,0 -10.925,-2.236 -11.584,-6.691c-0.078,-0.478 -0.447,-0.864 -0.936,-0.864l-4.389,0c-0.54,0 -1.007,0.466 -1.007,1.008c0,5.703 3.102,12.447 17.916,12.447c10.723,0 16.908,-4.209 16.908,-11.584c0,-7.31 -4.996,-9.273 -15.398,-10.648c-10.51,-1.391 -11.512,-2.072 -11.512,-4.533c0,-2.032 0.85,-4.75 8.634,-4.75c6.954,0 9.524,1.5 10.577,6.189c0.092,0.44 0.48,0.791 0.935,0.791l4.39,0c0.27,0 0.532,-0.166 0.719,-0.36c0.184,-0.207 0.314,-0.44 0.288,-0.719c-0.68,-8.074 -6.064,-11.872 -16.909,-11.872z" id="svg_3"/>
7
7
  </g>
8
- <path d="m271.821,0.383a2.181,2.181 0 0 0 -1.08,0.287a2.18,2.18 0 0 0 -1.079,1.871l0,55.042c0,0.54 -0.251,1.024 -0.719,1.295a1.501,1.501 0 0 1 -1.511,0l-8.994,-5.18a4.31,4.31 0 0 0 -4.317,0l-35.903,20.721c-1.342,0.775 -2.158,2.264 -2.158,3.814l0,41.443c0,1.548 0.817,2.966 2.158,3.741l35.903,20.722a4.3,4.3 0 0 0 4.317,0l35.903,-20.722a4.308,4.308 0 0 0 2.159,-3.741l0,-103.32a4.386,4.386 0 0 0 -2.23,-3.814l-21.37,-11.944c-0.335,-0.187 -0.707,-0.22 -1.079,-0.215zm-230.96,51.732c-0.684,0.027 -1.328,0.147 -1.942,0.503l-35.904,20.722a4.3,4.3 0 0 0 -2.158,3.741l0.072,55.619c0,0.773 0.399,1.492 1.079,1.87a2.096,2.096 0 0 0 2.159,0l21.297,-12.231c1.349,-0.802 2.23,-2.196 2.23,-3.742l0,-25.974c0,-1.55 0.815,-2.972 2.159,-3.742l9.065,-5.252a4.251,4.251 0 0 1 2.159,-0.576c0.74,0 1.5,0.185 2.158,0.576l9.066,5.252a4.296,4.296 0 0 1 2.159,3.742l0,25.973c0,1.546 0.89,2.95 2.23,3.742l21.297,12.232a2.096,2.096 0 0 0 2.159,0a2.164,2.164 0 0 0 1.08,-1.871l0.07,-55.618a4.28,4.28 0 0 0 -2.158,-3.741l-35.903,-20.722c-0.607,-0.356 -1.253,-0.475 -1.942,-0.503l-0.432,0zm322.624,0.503c-0.75,0 -1.485,0.19 -2.158,0.576l-35.903,20.722a4.306,4.306 0 0 0 -2.159,3.741l0,41.443c0,1.559 0.878,2.971 2.23,3.742l35.616,20.29c1.315,0.75 2.921,0.807 4.245,0.07l21.585,-12.015c0.685,-0.38 1.148,-1.09 1.151,-1.87a2.126,2.126 0 0 0 -1.079,-1.871l-36.119,-20.722c-0.676,-0.386 -1.151,-1.167 -1.151,-1.943l0,-12.95c0,-0.775 0.48,-1.485 1.151,-1.871l11.224,-6.476a2.155,2.155 0 0 1 2.159,0l11.223,6.476a2.152,2.152 0 0 1 1.08,1.87l0,10.217a2.15,2.15 0 0 0 1.079,1.87c0.673,0.389 1.487,0.39 2.158,0l21.514,-12.517a4.325,4.325 0 0 0 2.159,-3.742l0,-10c0,-1.545 -0.82,-2.966 -2.159,-3.742l-35.687,-20.722a4.279,4.279 0 0 0 -2.159,-0.575l0,-0.001zm-107.35,30.939c0.188,0 0.408,0.046 0.576,0.143l12.304,7.123c0.334,0.193 0.576,0.55 0.576,0.935l0,14.246c0,0.387 -0.24,0.743 -0.576,0.936l-12.304,7.123a1.088,1.088 0 0 1 -1.079,0l-12.303,-7.123c-0.335,-0.194 -0.576,-0.549 -0.576,-0.936l0,-14.246c0,-0.386 0.242,-0.74 0.576,-0.935l12.303,-7.122a0.948,0.948 0 0 1 0.504,-0.143l0,-0.001l-0.001,0z" fill="#fff" id="svg_4"/>
8
+ <path d="m271.821,0.383a2.181,2.181 0 0 0 -1.08,0.287a2.18,2.18 0 0 0 -1.079,1.871l0,55.042c0,0.54 -0.251,1.024 -0.719,1.295a1.501,1.501 0 0 1 -1.511,0l-8.994,-5.18a4.31,4.31 0 0 0 -4.317,0l-35.903,20.721c-1.342,0.775 -2.158,2.264 -2.158,3.814l0,41.443c0,1.548 0.817,2.966 2.158,3.741l35.903,20.722a4.3,4.3 0 0 0 4.317,0l35.903,-20.722a4.308,4.308 0 0 0 2.159,-3.741l0,-103.32a4.386,4.386 0 0 0 -2.23,-3.814l-21.37,-11.944c-0.335,-0.187 -0.707,-0.22 -1.079,-0.215zm-230.96,51.732c-0.684,0.027 -1.328,0.147 -1.942,0.503l-35.904,20.722a4.3,4.3 0 0 0 -2.158,3.741l0.072,55.619c0,0.773 0.399,1.492 1.079,1.87a2.096,2.096 0 0 0 2.159,0l21.297,-12.231c1.349,-0.802 2.23,-2.196 2.23,-3.742l0,-25.974c0,-1.55 0.815,-2.972 2.159,-3.742l9.065,-5.252a4.251,4.251 0 0 1 2.159,-0.576c0.74,0 1.5,0.185 2.158,0.576l9.066,5.252a4.296,4.296 0 0 1 2.159,3.742l0,25.973c0,1.546 0.89,2.95 2.23,3.742l21.297,12.232a2.096,2.096 0 0 0 2.159,0a2.164,2.164 0 0 0 1.08,-1.871l0.07,-55.618a4.28,4.28 0 0 0 -2.158,-3.741l-35.903,-20.722c-0.607,-0.356 -1.253,-0.475 -1.942,-0.503l-0.432,0zm322.624,0.503c-0.75,0 -1.485,0.19 -2.158,0.576l-35.903,20.722a4.306,4.306 0 0 0 -2.159,3.741l0,41.443c0,1.559 0.878,2.971 2.23,3.742l35.616,20.29c1.315,0.75 2.921,0.807 4.245,0.07l21.585,-12.015c0.685,-0.38 1.148,-1.09 1.151,-1.87a2.126,2.126 0 0 0 -1.079,-1.871l-36.119,-20.722c-0.676,-0.386 -1.151,-1.167 -1.151,-1.943l0,-12.95c0,-0.775 0.48,-1.485 1.151,-1.871l11.224,-6.476a2.155,2.155 0 0 1 2.159,0l11.223,6.476a2.152,2.152 0 0 1 1.08,1.87l0,10.217a2.15,2.15 0 0 0 1.079,1.87c0.673,0.389 1.487,0.39 2.158,0l21.514,-12.517a4.325,4.325 0 0 0 2.159,-3.742l0,-10c0,-1.545 -0.82,-2.966 -2.159,-3.742l-35.687,-20.722a4.279,4.279 0 0 0 -2.159,-0.575l0,-0.001zm-107.35,30.939c0.188,0 0.408,0.046 0.576,0.143l12.304,7.123c0.334,0.193 0.576,0.55 0.576,0.935l0,14.246c0,0.387 -0.24,0.743 -0.576,0.936l-12.304,7.123a1.088,1.088 0 0 1 -1.079,0l-12.303,-7.123c-0.335,-0.194 -0.576,-0.549 -0.576,-0.936l0,-14.246c0,-0.386 0.242,-0.74 0.576,-0.935l12.303,-7.122a0.948,0.948 0 0 1 0.504,-0.143l0,-0.001l-0.001,0z" fill="#404137" id="svg_4"/>
9
9
  <path d="m148.714,52.402c-0.748,0 -1.488,0.19 -2.158,0.576l-35.903,20.65c-1.343,0.773 -2.159,2.265 -2.159,3.813l0,41.443c0,1.55 0.817,2.966 2.159,3.742l35.903,20.721a4.297,4.297 0 0 0 4.317,0l35.903,-20.721a4.308,4.308 0 0 0 2.158,-3.742l0,-41.443c0,-1.55 -0.816,-3.04 -2.158,-3.813l-35.903,-20.65a4.297,4.297 0 0 0 -2.159,-0.576zm214.699,36.983c-0.143,0 -0.302,0 -0.431,0.072l-6.907,4.029a0.84,0.84 0 0 0 -0.432,0.72l0,7.914c0,0.298 0.172,0.571 0.432,0.72l6.907,3.957c0.259,0.15 0.535,0.15 0.791,0l6.907,-3.958a0.846,0.846 0 0 0 0.432,-0.719l0,-7.915a0.846,0.846 0 0 0 -0.432,-0.719l-6.907,-4.03c-0.128,-0.075 -0.216,-0.07 -0.36,-0.07l0,-0.001z" fill="#83CD29" id="svg_5"/>
10
- <path d="m3.332,260.629l0,-56.981l71.144,0l0,-3.333l-71.144,0l0,-51.983l75.642,0l0,-3.332l-78.974,0l0,118.961l79.64,0l0,-3.332l-76.307,0l-0.001,0zm140.455,-82.307l-29.49,38.821l-28.825,-38.82l-4.332,0l31.157,41.32l-34.157,44.317l3.999,0l32.156,-41.82l32.323,41.82l4.165,0l-34.322,-44.319l31.323,-41.32l-3.998,0l0.001,0.001zm16.994,114.963l0,-53.315l0.333,0c2,7.775 5.943,14.023 11.83,18.744c5.887,4.72 13.384,7.081 22.492,7.081c5.887,0 11.108,-1.194 15.662,-3.582s8.358,-5.637 11.413,-9.747c3.054,-4.11 5.387,-8.886 6.998,-14.329c1.61,-5.442 2.416,-11.163 2.416,-17.16c0,-6.443 -0.834,-12.386 -2.5,-17.828c-1.666,-5.443 -4.082,-10.164 -7.247,-14.162c-3.166,-3.999 -6.998,-7.11 -11.497,-9.33c-4.498,-2.222 -9.58,-3.333 -15.245,-3.333c-4.332,0 -8.358,0.639 -12.079,1.916c-3.721,1.278 -7.025,3.082 -9.913,5.415a36.674,36.674 0 0 0 -7.498,8.247c-2.11,3.166 -3.721,6.637 -4.832,10.414l-0.333,0l0,-23.994l-3.332,0l0,114.963l3.332,0zm34.655,-30.657c-10.44,0 -18.827,-3.582 -25.158,-10.746c-6.331,-7.164 -9.497,-17.467 -9.497,-30.907c0,-5.554 0.778,-10.83 2.333,-15.828c1.555,-4.998 3.804,-9.386 6.747,-13.162c2.944,-3.777 6.582,-6.776 10.913,-8.997c4.332,-2.222 9.22,-3.333 14.662,-3.333c5.554,0 10.414,1.111 14.579,3.333c4.165,2.221 7.609,5.248 10.33,9.08s4.776,8.22 6.165,13.162c1.388,4.943 2.082,10.191 2.082,15.745c0,4.999 -0.638,9.97 -1.916,14.912c-1.277,4.943 -3.249,9.386 -5.915,13.33c-2.665,3.942 -6.08,7.163 -10.246,9.663c-4.166,2.499 -9.192,3.748 -15.079,3.748zm54.816,1.333l0,-48.484c0,-4.665 0.666,-9.22 2,-13.662c1.332,-4.443 3.387,-8.359 6.164,-11.746c2.777,-3.388 6.303,-6.054 10.58,-7.998c4.276,-1.944 9.358,-2.749 15.245,-2.416l0,-3.332c-5.11,-0.11 -9.58,0.444 -13.412,1.666c-3.833,1.222 -7.137,2.888 -9.914,4.999c-2.777,2.11 -4.998,4.581 -6.664,7.414a33.15,33.15 0 0 0 -3.666,9.08l-0.333,0l0,-21.16l-3.332,0l0,85.64l3.332,0l0,-0.001zm38.154,-42.153l71.643,0c0.223,-5.887 -0.36,-11.551 -1.749,-16.994c-1.388,-5.443 -3.61,-10.275 -6.664,-14.495c-3.055,-4.221 -6.998,-7.609 -11.83,-10.164c-4.832,-2.555 -10.58,-3.832 -17.244,-3.832c-4.777,0 -9.442,1 -13.996,3c-4.554,1.999 -8.553,4.914 -11.996,8.746c-3.443,3.832 -6.22,8.525 -8.33,14.08c-2.11,5.553 -3.166,11.884 -3.166,18.993c0,6.331 0.722,12.246 2.166,17.744c1.444,5.498 3.665,10.275 6.664,14.329c3,4.054 6.86,7.192 11.58,9.413c4.72,2.222 10.413,3.277 17.078,3.166c9.774,0 17.994,-2.75 24.658,-8.247c6.665,-5.499 10.608,-13.246 11.83,-23.243l-3.332,0c-1.444,9.442 -5.138,16.523 -11.08,21.243c-5.943,4.721 -13.412,7.081 -22.41,7.081c-6.109,0 -11.274,-1.055 -15.495,-3.165c-4.22,-2.11 -7.664,-4.999 -10.33,-8.664c-2.665,-3.666 -4.637,-7.97 -5.914,-12.913c-1.278,-4.942 -1.972,-10.302 -2.083,-16.078zm68.311,-3.332l-68.31,0c0.332,-5.998 1.443,-11.385 3.331,-16.161c1.889,-4.777 4.36,-8.859 7.415,-12.246c3.054,-3.388 6.609,-5.97 10.663,-7.748c4.054,-1.777 8.414,-2.666 13.079,-2.666c5.554,0 10.44,1.028 14.662,3.083c4.22,2.055 7.747,4.86 10.58,8.414c2.832,3.554 4.97,7.692 6.414,12.412c1.444,4.721 2.166,9.692 2.166,14.912zm72.477,-14.828l3.332,0c0,-9.553 -2.777,-16.495 -8.33,-20.827c-5.555,-4.332 -13.108,-6.498 -22.66,-6.498c-5.332,0 -9.83,0.667 -13.496,2c-3.665,1.332 -6.664,3.054 -8.997,5.164c-2.332,2.11 -3.998,4.443 -4.998,6.998c-1,2.555 -1.5,4.999 -1.5,7.331c0,4.665 0.833,8.386 2.5,11.163c1.666,2.777 4.276,4.943 7.83,6.498c2.444,1.11 5.22,2.11 8.331,3c3.11,0.888 6.72,1.832 10.83,2.831c3.665,0.89 7.275,1.778 10.83,2.666c3.554,0.889 6.692,2.083 9.413,3.582c2.722,1.5 4.943,3.416 6.665,5.749c1.721,2.332 2.582,5.387 2.582,9.163c0,3.666 -0.86,6.776 -2.582,9.33a20.815,20.815 0 0 1 -6.581,6.249c-2.666,1.61 -5.638,2.776 -8.914,3.498c-3.277,0.722 -6.47,1.083 -9.58,1.083c-10.108,0 -17.856,-2.249 -23.243,-6.747c-5.387,-4.499 -8.08,-11.58 -8.08,-21.244l-3.333,0c0,10.775 2.916,18.661 8.747,23.66c5.832,4.998 14.468,7.497 25.909,7.497c3.665,0 7.358,-0.417 11.08,-1.25c3.72,-0.833 7.053,-2.193 9.996,-4.082a22.592,22.592 0 0 0 7.164,-7.33c1.833,-3 2.75,-6.665 2.75,-10.997c0,-4.11 -0.806,-7.442 -2.416,-9.997c-1.611,-2.554 -3.721,-4.665 -6.332,-6.331c-2.61,-1.666 -5.553,-2.971 -8.83,-3.915a516.08,516.08 0 0 0 -9.914,-2.75a1726.675,1726.675 0 0 0 -12.246,-3.165c-3.498,-0.889 -6.747,-1.944 -9.746,-3.166c-2.888,-1.222 -5.193,-2.971 -6.915,-5.248c-1.722,-2.277 -2.582,-5.526 -2.582,-9.747c0,-0.777 0.222,-2.166 0.666,-4.165c0.444,-2 1.5,-4.027 3.166,-6.082c1.666,-2.054 4.22,-3.887 7.664,-5.498c3.443,-1.61 8.164,-2.416 14.162,-2.416c4.11,0 7.858,0.445 11.246,1.333c3.388,0.889 6.304,2.305 8.747,4.249c2.444,1.944 4.332,4.415 5.665,7.414c1.333,3 2,6.665 2,10.997zm77.141,0l3.332,0c0,-9.553 -2.776,-16.495 -8.33,-20.827c-5.554,-4.332 -13.107,-6.498 -22.66,-6.498c-5.331,0 -9.83,0.667 -13.495,2c-3.666,1.332 -6.665,3.054 -8.997,5.164c-2.333,2.11 -3.999,4.443 -4.999,6.998c-1,2.555 -1.499,4.999 -1.499,7.331c0,4.665 0.833,8.386 2.5,11.163c1.665,2.777 4.276,4.943 7.83,6.498c2.444,1.11 5.22,2.11 8.33,3c3.11,0.888 6.72,1.832 10.83,2.831c3.666,0.89 7.276,1.778 10.83,2.666c3.555,0.889 6.692,2.083 9.414,3.582c2.721,1.5 4.943,3.416 6.664,5.749c1.722,2.332 2.583,5.387 2.583,9.163c0,3.666 -0.861,6.776 -2.583,9.33a20.815,20.815 0 0 1 -6.58,6.249c-2.667,1.61 -5.638,2.776 -8.915,3.498c-3.276,0.722 -6.47,1.083 -9.58,1.083c-10.108,0 -17.855,-2.249 -23.242,-6.747c-5.388,-4.499 -8.081,-11.58 -8.081,-21.244l-3.332,0c0,10.775 2.915,18.661 8.747,23.66c5.831,4.998 14.467,7.497 25.908,7.497c3.666,0 7.359,-0.417 11.08,-1.25c3.72,-0.833 7.053,-2.193 9.997,-4.082a22.592,22.592 0 0 0 7.164,-7.33c1.833,-3 2.749,-6.665 2.749,-10.997c0,-4.11 -0.805,-7.442 -2.416,-9.997c-1.61,-2.554 -3.72,-4.665 -6.331,-6.331c-2.61,-1.666 -5.554,-2.971 -8.83,-3.915a516.071,516.071 0 0 0 -9.914,-2.75a1726.65,1726.65 0 0 0 -12.246,-3.165c-3.499,-0.889 -6.748,-1.944 -9.747,-3.166c-2.888,-1.222 -5.193,-2.971 -6.914,-5.248c-1.722,-2.277 -2.583,-5.526 -2.583,-9.747c0,-0.777 0.222,-2.166 0.667,-4.165c0.444,-2 1.5,-4.027 3.165,-6.082c1.666,-2.054 4.221,-3.887 7.664,-5.498c3.444,-1.61 8.164,-2.416 14.163,-2.416c4.11,0 7.858,0.445 11.246,1.333c3.388,0.889 6.303,2.305 8.747,4.249c2.444,1.944 4.332,4.415 5.665,7.414c1.333,3 2,6.665 2,10.997l-0.001,0z" fill="#fff" id="svg_6"/>
10
+ <path d="m3.332,260.629l0,-56.981l71.144,0l0,-3.333l-71.144,0l0,-51.983l75.642,0l0,-3.332l-78.974,0l0,118.961l79.64,0l0,-3.332l-76.307,0l-0.001,0zm140.455,-82.307l-29.49,38.821l-28.825,-38.82l-4.332,0l31.157,41.32l-34.157,44.317l3.999,0l32.156,-41.82l32.323,41.82l4.165,0l-34.322,-44.319l31.323,-41.32l-3.998,0l0.001,0.001zm16.994,114.963l0,-53.315l0.333,0c2,7.775 5.943,14.023 11.83,18.744c5.887,4.72 13.384,7.081 22.492,7.081c5.887,0 11.108,-1.194 15.662,-3.582s8.358,-5.637 11.413,-9.747c3.054,-4.11 5.387,-8.886 6.998,-14.329c1.61,-5.442 2.416,-11.163 2.416,-17.16c0,-6.443 -0.834,-12.386 -2.5,-17.828c-1.666,-5.443 -4.082,-10.164 -7.247,-14.162c-3.166,-3.999 -6.998,-7.11 -11.497,-9.33c-4.498,-2.222 -9.58,-3.333 -15.245,-3.333c-4.332,0 -8.358,0.639 -12.079,1.916c-3.721,1.278 -7.025,3.082 -9.913,5.415a36.674,36.674 0 0 0 -7.498,8.247c-2.11,3.166 -3.721,6.637 -4.832,10.414l-0.333,0l0,-23.994l-3.332,0l0,114.963l3.332,0zm34.655,-30.657c-10.44,0 -18.827,-3.582 -25.158,-10.746c-6.331,-7.164 -9.497,-17.467 -9.497,-30.907c0,-5.554 0.778,-10.83 2.333,-15.828c1.555,-4.998 3.804,-9.386 6.747,-13.162c2.944,-3.777 6.582,-6.776 10.913,-8.997c4.332,-2.222 9.22,-3.333 14.662,-3.333c5.554,0 10.414,1.111 14.579,3.333c4.165,2.221 7.609,5.248 10.33,9.08s4.776,8.22 6.165,13.162c1.388,4.943 2.082,10.191 2.082,15.745c0,4.999 -0.638,9.97 -1.916,14.912c-1.277,4.943 -3.249,9.386 -5.915,13.33c-2.665,3.942 -6.08,7.163 -10.246,9.663c-4.166,2.499 -9.192,3.748 -15.079,3.748zm54.816,1.333l0,-48.484c0,-4.665 0.666,-9.22 2,-13.662c1.332,-4.443 3.387,-8.359 6.164,-11.746c2.777,-3.388 6.303,-6.054 10.58,-7.998c4.276,-1.944 9.358,-2.749 15.245,-2.416l0,-3.332c-5.11,-0.11 -9.58,0.444 -13.412,1.666c-3.833,1.222 -7.137,2.888 -9.914,4.999c-2.777,2.11 -4.998,4.581 -6.664,7.414a33.15,33.15 0 0 0 -3.666,9.08l-0.333,0l0,-21.16l-3.332,0l0,85.64l3.332,0l0,-0.001zm38.154,-42.153l71.643,0c0.223,-5.887 -0.36,-11.551 -1.749,-16.994c-1.388,-5.443 -3.61,-10.275 -6.664,-14.495c-3.055,-4.221 -6.998,-7.609 -11.83,-10.164c-4.832,-2.555 -10.58,-3.832 -17.244,-3.832c-4.777,0 -9.442,1 -13.996,3c-4.554,1.999 -8.553,4.914 -11.996,8.746c-3.443,3.832 -6.22,8.525 -8.33,14.08c-2.11,5.553 -3.166,11.884 -3.166,18.993c0,6.331 0.722,12.246 2.166,17.744c1.444,5.498 3.665,10.275 6.664,14.329c3,4.054 6.86,7.192 11.58,9.413c4.72,2.222 10.413,3.277 17.078,3.166c9.774,0 17.994,-2.75 24.658,-8.247c6.665,-5.499 10.608,-13.246 11.83,-23.243l-3.332,0c-1.444,9.442 -5.138,16.523 -11.08,21.243c-5.943,4.721 -13.412,7.081 -22.41,7.081c-6.109,0 -11.274,-1.055 -15.495,-3.165c-4.22,-2.11 -7.664,-4.999 -10.33,-8.664c-2.665,-3.666 -4.637,-7.97 -5.914,-12.913c-1.278,-4.942 -1.972,-10.302 -2.083,-16.078zm68.311,-3.332l-68.31,0c0.332,-5.998 1.443,-11.385 3.331,-16.161c1.889,-4.777 4.36,-8.859 7.415,-12.246c3.054,-3.388 6.609,-5.97 10.663,-7.748c4.054,-1.777 8.414,-2.666 13.079,-2.666c5.554,0 10.44,1.028 14.662,3.083c4.22,2.055 7.747,4.86 10.58,8.414c2.832,3.554 4.97,7.692 6.414,12.412c1.444,4.721 2.166,9.692 2.166,14.912zm72.477,-14.828l3.332,0c0,-9.553 -2.777,-16.495 -8.33,-20.827c-5.555,-4.332 -13.108,-6.498 -22.66,-6.498c-5.332,0 -9.83,0.667 -13.496,2c-3.665,1.332 -6.664,3.054 -8.997,5.164c-2.332,2.11 -3.998,4.443 -4.998,6.998c-1,2.555 -1.5,4.999 -1.5,7.331c0,4.665 0.833,8.386 2.5,11.163c1.666,2.777 4.276,4.943 7.83,6.498c2.444,1.11 5.22,2.11 8.331,3c3.11,0.888 6.72,1.832 10.83,2.831c3.665,0.89 7.275,1.778 10.83,2.666c3.554,0.889 6.692,2.083 9.413,3.582c2.722,1.5 4.943,3.416 6.665,5.749c1.721,2.332 2.582,5.387 2.582,9.163c0,3.666 -0.86,6.776 -2.582,9.33a20.815,20.815 0 0 1 -6.581,6.249c-2.666,1.61 -5.638,2.776 -8.914,3.498c-3.277,0.722 -6.47,1.083 -9.58,1.083c-10.108,0 -17.856,-2.249 -23.243,-6.747c-5.387,-4.499 -8.08,-11.58 -8.08,-21.244l-3.333,0c0,10.775 2.916,18.661 8.747,23.66c5.832,4.998 14.468,7.497 25.909,7.497c3.665,0 7.358,-0.417 11.08,-1.25c3.72,-0.833 7.053,-2.193 9.996,-4.082a22.592,22.592 0 0 0 7.164,-7.33c1.833,-3 2.75,-6.665 2.75,-10.997c0,-4.11 -0.806,-7.442 -2.416,-9.997c-1.611,-2.554 -3.721,-4.665 -6.332,-6.331c-2.61,-1.666 -5.553,-2.971 -8.83,-3.915a516.08,516.08 0 0 0 -9.914,-2.75a1726.675,1726.675 0 0 0 -12.246,-3.165c-3.498,-0.889 -6.747,-1.944 -9.746,-3.166c-2.888,-1.222 -5.193,-2.971 -6.915,-5.248c-1.722,-2.277 -2.582,-5.526 -2.582,-9.747c0,-0.777 0.222,-2.166 0.666,-4.165c0.444,-2 1.5,-4.027 3.166,-6.082c1.666,-2.054 4.22,-3.887 7.664,-5.498c3.443,-1.61 8.164,-2.416 14.162,-2.416c4.11,0 7.858,0.445 11.246,1.333c3.388,0.889 6.304,2.305 8.747,4.249c2.444,1.944 4.332,4.415 5.665,7.414c1.333,3 2,6.665 2,10.997zm77.141,0l3.332,0c0,-9.553 -2.776,-16.495 -8.33,-20.827c-5.554,-4.332 -13.107,-6.498 -22.66,-6.498c-5.331,0 -9.83,0.667 -13.495,2c-3.666,1.332 -6.665,3.054 -8.997,5.164c-2.333,2.11 -3.999,4.443 -4.999,6.998c-1,2.555 -1.499,4.999 -1.499,7.331c0,4.665 0.833,8.386 2.5,11.163c1.665,2.777 4.276,4.943 7.83,6.498c2.444,1.11 5.22,2.11 8.33,3c3.11,0.888 6.72,1.832 10.83,2.831c3.666,0.89 7.276,1.778 10.83,2.666c3.555,0.889 6.692,2.083 9.414,3.582c2.721,1.5 4.943,3.416 6.664,5.749c1.722,2.332 2.583,5.387 2.583,9.163c0,3.666 -0.861,6.776 -2.583,9.33a20.815,20.815 0 0 1 -6.58,6.249c-2.667,1.61 -5.638,2.776 -8.915,3.498c-3.276,0.722 -6.47,1.083 -9.58,1.083c-10.108,0 -17.855,-2.249 -23.242,-6.747c-5.388,-4.499 -8.081,-11.58 -8.081,-21.244l-3.332,0c0,10.775 2.915,18.661 8.747,23.66c5.831,4.998 14.467,7.497 25.908,7.497c3.666,0 7.359,-0.417 11.08,-1.25c3.72,-0.833 7.053,-2.193 9.997,-4.082a22.592,22.592 0 0 0 7.164,-7.33c1.833,-3 2.749,-6.665 2.749,-10.997c0,-4.11 -0.805,-7.442 -2.416,-9.997c-1.61,-2.554 -3.72,-4.665 -6.331,-6.331c-2.61,-1.666 -5.554,-2.971 -8.83,-3.915a516.071,516.071 0 0 0 -9.914,-2.75a1726.65,1726.65 0 0 0 -12.246,-3.165c-3.499,-0.889 -6.748,-1.944 -9.747,-3.166c-2.888,-1.222 -5.193,-2.971 -6.914,-5.248c-1.722,-2.277 -2.583,-5.526 -2.583,-9.747c0,-0.777 0.222,-2.166 0.667,-4.165c0.444,-2 1.5,-4.027 3.165,-6.082c1.666,-2.054 4.221,-3.887 7.664,-5.498c3.444,-1.61 8.164,-2.416 14.163,-2.416c4.11,0 7.858,0.445 11.246,1.333c3.388,0.889 6.303,2.305 8.747,4.249c2.444,1.944 4.332,4.415 5.665,7.414c1.333,3 2,6.665 2,10.997l-0.001,0z" fill="#222" id="svg_6"/>
11
11
  </g>
12
12
  </svg>
File without changes
@@ -0,0 +1,50 @@
1
+ // Edit flag. If it is 1, edit the user, if it is 0, add the user.
2
+ const edit = $('#edit').val() == 1;
3
+
4
+ // In the case of editing, the update target user ID is obtained.
5
+ const id = edit ? $('#id').val() : undefined;
6
+
7
+ // Form validation.
8
+ $('#form').validate({
9
+ validClass: 'is-valid',
10
+ errorClass: 'is-invalid',
11
+ errorElement: "div",
12
+ errorPlacement: (error, element) => {
13
+ $(element).after($(error).addClass('invalid-feedback'));
14
+ },
15
+ submitHandler: async (form, event) => {
16
+ try {
17
+ event.preventDefault();
18
+
19
+ // Submit a user add or update request.
20
+ let res;
21
+ if (edit) {
22
+ res = await $.ajax({
23
+ type: 'PUT',
24
+ url: `/api/users/${id}`,
25
+ data: new FormData(form),
26
+ contentType: false,
27
+ processData: false
28
+ });
29
+ } else {
30
+ res = await $.ajax({
31
+ type: 'POST',
32
+ url: '/api/users',
33
+ data: new FormData(form),
34
+ contentType: false,
35
+ processData: false
36
+ });
37
+ }
38
+
39
+ // In case of error.
40
+ if (res.error)
41
+ return void alert(res.error);
42
+
43
+ // If the user addition/update is successful, move to the user list page.
44
+ alert('Saved the user.');
45
+ location.href = `${globalThis.baseUrl}/users`;
46
+ } catch(e) {
47
+ alert('An unexpected error has occurred.');
48
+ }
49
+ }
50
+ });
File without changes