@driveflux/pdf 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/.eslintrc +3 -0
  2. package/.swcrc +14 -0
  3. package/.turbo/turbo-build.log +6 -0
  4. package/CHANGELOG.md +69 -0
  5. package/dist/__mocks__/subscription.d.ts +3 -0
  6. package/dist/__mocks__/subscription.d.ts.map +1 -0
  7. package/dist/__mocks__/subscription.js +1069 -0
  8. package/dist/cjs/__mocks__/subscription.js +1079 -0
  9. package/dist/cjs/components/FluxLogo.js +76 -0
  10. package/dist/cjs/components/StandardPage.js +129 -0
  11. package/dist/cjs/debug.js +202 -0
  12. package/dist/cjs/index.js +20 -0
  13. package/dist/cjs/package.json +3 -0
  14. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +95 -0
  15. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +110 -0
  16. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +35 -0
  17. package/dist/cjs/templates/SubscriptionAgreement/Details.js +161 -0
  18. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +68 -0
  19. package/dist/cjs/templates/SubscriptionAgreement/Header.js +61 -0
  20. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +39 -0
  21. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +48 -0
  22. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +72 -0
  23. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +108 -0
  24. package/dist/cjs/templates/SubscriptionAgreement/index.js +276 -0
  25. package/dist/cjs/templates/SubscriptionAgreement/translations.js +666 -0
  26. package/dist/cjs/templates/SubscriptionAgreement/utils.js +14 -0
  27. package/dist/cjs/templates/index.js +18 -0
  28. package/dist/cjs/theme/colors.js +147 -0
  29. package/dist/cjs/theme/index.js +18 -0
  30. package/dist/cjs/types.js +4 -0
  31. package/dist/cjs/utils.js +165 -0
  32. package/dist/cjs/watch.js +20 -0
  33. package/dist/components/FluxLogo.d.ts +3 -0
  34. package/dist/components/FluxLogo.d.ts.map +1 -0
  35. package/dist/components/FluxLogo.js +66 -0
  36. package/dist/components/StandardPage.d.ts +6 -0
  37. package/dist/components/StandardPage.d.ts.map +1 -0
  38. package/dist/components/StandardPage.js +114 -0
  39. package/dist/debug.d.ts +2 -0
  40. package/dist/debug.d.ts.map +1 -0
  41. package/dist/debug.js +198 -0
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +3 -0
  45. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +10 -0
  46. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +1 -0
  47. package/dist/templates/SubscriptionAgreement/Confirmation.js +80 -0
  48. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +12 -0
  49. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +1 -0
  50. package/dist/templates/SubscriptionAgreement/CoverPage.js +95 -0
  51. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts +7 -0
  52. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts.map +1 -0
  53. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +25 -0
  54. package/dist/templates/SubscriptionAgreement/Details.d.ts +10 -0
  55. package/dist/templates/SubscriptionAgreement/Details.d.ts.map +1 -0
  56. package/dist/templates/SubscriptionAgreement/Details.js +146 -0
  57. package/dist/templates/SubscriptionAgreement/Footer.d.ts +10 -0
  58. package/dist/templates/SubscriptionAgreement/Footer.d.ts.map +1 -0
  59. package/dist/templates/SubscriptionAgreement/Footer.js +58 -0
  60. package/dist/templates/SubscriptionAgreement/Header.d.ts +10 -0
  61. package/dist/templates/SubscriptionAgreement/Header.d.ts.map +1 -0
  62. package/dist/templates/SubscriptionAgreement/Header.js +46 -0
  63. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts +8 -0
  64. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts.map +1 -0
  65. package/dist/templates/SubscriptionAgreement/LabelValue.js +29 -0
  66. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts +10 -0
  67. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts.map +1 -0
  68. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +33 -0
  69. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +8 -0
  70. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +1 -0
  71. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +57 -0
  72. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts +12 -0
  73. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +1 -0
  74. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +98 -0
  75. package/dist/templates/SubscriptionAgreement/index.d.ts +14 -0
  76. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -0
  77. package/dist/templates/SubscriptionAgreement/index.js +261 -0
  78. package/dist/templates/SubscriptionAgreement/translations.d.ts +72 -0
  79. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -0
  80. package/dist/templates/SubscriptionAgreement/translations.js +656 -0
  81. package/dist/templates/SubscriptionAgreement/utils.d.ts +3 -0
  82. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -0
  83. package/dist/templates/SubscriptionAgreement/utils.js +4 -0
  84. package/dist/templates/index.d.ts +2 -0
  85. package/dist/templates/index.d.ts.map +1 -0
  86. package/dist/templates/index.js +1 -0
  87. package/dist/theme/colors.d.ts +148 -0
  88. package/dist/theme/colors.d.ts.map +1 -0
  89. package/dist/theme/colors.js +137 -0
  90. package/dist/theme/index.d.ts +2 -0
  91. package/dist/theme/index.d.ts.map +1 -0
  92. package/dist/theme/index.js +1 -0
  93. package/dist/types.d.ts +2 -0
  94. package/dist/types.d.ts.map +1 -0
  95. package/dist/types.js +1 -0
  96. package/dist/utils.d.ts +4 -0
  97. package/dist/utils.d.ts.map +1 -0
  98. package/dist/utils.js +150 -0
  99. package/dist/watch.d.ts +2 -0
  100. package/dist/watch.d.ts.map +1 -0
  101. package/dist/watch.js +11 -0
  102. package/index.cjs +1 -0
  103. package/index.d.ts +1 -0
  104. package/package.json +43 -0
  105. package/src/__mocks__/subscription.ts +803 -0
  106. package/src/components/FluxLogo.tsx +52 -0
  107. package/src/components/StandardPage.tsx +32 -0
  108. package/src/debug.ts +36 -0
  109. package/src/index.ts +3 -0
  110. package/src/templates/SubscriptionAgreement/Confirmation.tsx +49 -0
  111. package/src/templates/SubscriptionAgreement/CoverPage.tsx +52 -0
  112. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +25 -0
  113. package/src/templates/SubscriptionAgreement/Details.tsx +127 -0
  114. package/src/templates/SubscriptionAgreement/Footer.tsx +37 -0
  115. package/src/templates/SubscriptionAgreement/Header.tsx +37 -0
  116. package/src/templates/SubscriptionAgreement/LabelValue.tsx +19 -0
  117. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +24 -0
  118. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +30 -0
  119. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +44 -0
  120. package/src/templates/SubscriptionAgreement/index.tsx +66 -0
  121. package/src/templates/SubscriptionAgreement/translations.ts +664 -0
  122. package/src/templates/SubscriptionAgreement/utils.ts +7 -0
  123. package/src/templates/index.ts +1 -0
  124. package/src/theme/colors.ts +180 -0
  125. package/src/theme/index.ts +1 -0
  126. package/src/types.ts +1 -0
  127. package/src/utils.ts +10 -0
  128. package/src/watch.ts +16 -0
  129. package/tsconfig.json +13 -0
  130. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ var _jsxruntime = require("react/jsx-runtime");
12
+ var _renderer = require("@react-pdf/renderer");
13
+ var FluxLogo = function() {
14
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.Svg, {
15
+ width: "92",
16
+ height: "29",
17
+ viewBox: "0 0 92 29",
18
+ fill: "none",
19
+ children: [
20
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.G, {
21
+ clipPath: "url(#clip0_664_102105)",
22
+ children: [
23
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
24
+ d: "M23.6621 6.12305H35.6903V8.00999H25.5568V13.5529H33.805V15.434H25.5568V22.8638H23.6715L23.6621 6.12305Z",
25
+ fill: "black"
26
+ }),
27
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
28
+ d: "M40.9981 6.12305H42.8834V20.9827H52.3039V22.8697H40.9922L40.9981 6.12305Z",
29
+ fill: "black"
30
+ }),
31
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
32
+ d: "M57.6172 15.6002V6.12305H59.5025V15.4811C59.5025 19.0946 61.4149 21.129 64.6187 21.129C67.7035 21.129 69.6642 19.2621 69.6642 15.6002V6.12305H71.5495V15.4552C71.5495 20.3376 68.751 22.8744 64.5669 22.8744C60.4381 22.8756 57.6172 20.3388 57.6172 15.6002Z",
33
+ fill: "black"
34
+ }),
35
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
36
+ d: "M83.2965 14.3324L77.1033 6.12305H79.3338L84.4736 12.9632L89.5663 6.12305H91.7674L85.5742 14.3077L92.0054 22.8756H89.7525L84.4006 15.6722L79.0451 22.8756H76.8594L83.2965 14.3324Z",
37
+ fill: "black"
38
+ }),
39
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
40
+ opacity: "0.3",
41
+ d: "M3.05934 17.5614C2.45475 17.5598 1.86415 17.3792 1.36192 17.0423C0.859683 16.7054 0.468271 16.2273 0.23697 15.6682C0.00566877 15.1091 -0.0551799 14.494 0.0620863 13.9004C0.179353 13.3068 0.469491 12.7611 0.895964 12.3322L12.3256 0.892604C12.909 0.364801 13.6728 0.0817665 14.459 0.102098C15.2452 0.12243 15.9934 0.444573 16.5488 1.00183C17.1042 1.55908 17.4243 2.30877 17.4426 3.09567C17.461 3.88257 17.1764 4.64641 16.6476 5.22904L5.218 16.6686C4.93441 16.9521 4.59781 17.1768 4.22742 17.33C3.85703 17.4832 3.46011 17.5618 3.05934 17.5614Z",
42
+ fill: "#50C8E8"
43
+ }),
44
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
45
+ opacity: "0.3",
46
+ d: "M8.77458 23.28C8.16964 23.2788 7.57859 23.0985 7.07593 22.7616C6.57326 22.4248 6.18149 21.9465 5.94999 21.3871C5.7185 20.8277 5.65764 20.2123 5.7751 19.6183C5.89256 19.0244 6.18308 18.4786 6.61002 18.0496L12.3213 12.3334C12.6004 12.027 12.9387 11.7804 13.3158 11.6086C13.6928 11.4368 14.1008 11.3433 14.5149 11.3338C14.9291 11.3243 15.3409 11.399 15.7254 11.5533C16.1099 11.7076 16.4592 11.9384 16.752 12.2317C17.0449 12.525 17.2753 12.8746 17.4293 13.2596C17.5832 13.6445 17.6576 14.0567 17.6479 14.4712C17.6382 14.8858 17.5446 15.294 17.3727 15.6713C17.2008 16.0486 16.9543 16.3871 16.648 16.6663L10.9368 22.3837C10.653 22.6681 10.3159 22.8936 9.94489 23.0474C9.57386 23.2013 9.17617 23.2803 8.77458 23.28Z",
47
+ fill: "#50C8E8"
48
+ }),
49
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
50
+ d: "M14.4866 29.0001C16.176 29.0001 17.5455 27.6294 17.5455 25.9385C17.5455 24.2477 16.176 22.877 14.4866 22.877C12.7972 22.877 11.4277 24.2477 11.4277 25.9385C11.4277 27.6294 12.7972 29.0001 14.4866 29.0001Z",
51
+ fill: "#50C8E8"
52
+ }),
53
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
54
+ d: "M14.4866 6.12314C16.176 6.12314 17.5455 4.75243 17.5455 3.06157C17.5455 1.37071 16.176 0 14.4866 0C12.7972 0 11.4277 1.37071 11.4277 3.06157C11.4277 4.75243 12.7972 6.12314 14.4866 6.12314Z",
55
+ fill: "#50C8E8"
56
+ }),
57
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Path, {
58
+ d: "M14.4866 17.5616C16.176 17.5616 17.5455 16.1909 17.5455 14.5C17.5455 12.8092 16.176 11.4385 14.4866 11.4385C12.7972 11.4385 11.4277 12.8092 11.4277 14.5C11.4277 16.1909 12.7972 17.5616 14.4866 17.5616Z",
59
+ fill: "#50C8E8"
60
+ })
61
+ ]
62
+ }),
63
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Defs, {
64
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)("clipPath", {
65
+ id: "clip0_664_102105",
66
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Rect, {
67
+ width: "92",
68
+ height: "29",
69
+ fill: "white"
70
+ })
71
+ })
72
+ })
73
+ ]
74
+ });
75
+ };
76
+ var _default = FluxLogo;
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ var _jsxruntime = require("react/jsx-runtime");
12
+ var _renderer = require("@react-pdf/renderer");
13
+ var _react = /*#__PURE__*/ _interop_require_default(require("react"));
14
+ function _define_property(obj, key, value) {
15
+ if (key in obj) {
16
+ Object.defineProperty(obj, key, {
17
+ value: value,
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true
21
+ });
22
+ } else {
23
+ obj[key] = value;
24
+ }
25
+ return obj;
26
+ }
27
+ function _interop_require_default(obj) {
28
+ return obj && obj.__esModule ? obj : {
29
+ default: obj
30
+ };
31
+ }
32
+ function _object_spread(target) {
33
+ for(var i = 1; i < arguments.length; i++){
34
+ var source = arguments[i] != null ? arguments[i] : {};
35
+ var ownKeys = Object.keys(source);
36
+ if (typeof Object.getOwnPropertySymbols === "function") {
37
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
38
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
39
+ }));
40
+ }
41
+ ownKeys.forEach(function(key) {
42
+ _define_property(target, key, source[key]);
43
+ });
44
+ }
45
+ return target;
46
+ }
47
+ function ownKeys(object, enumerableOnly) {
48
+ var keys = Object.keys(object);
49
+ if (Object.getOwnPropertySymbols) {
50
+ var symbols = Object.getOwnPropertySymbols(object);
51
+ if (enumerableOnly) {
52
+ symbols = symbols.filter(function(sym) {
53
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
54
+ });
55
+ }
56
+ keys.push.apply(keys, symbols);
57
+ }
58
+ return keys;
59
+ }
60
+ function _object_spread_props(target, source) {
61
+ source = source != null ? source : {};
62
+ if (Object.getOwnPropertyDescriptors) {
63
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
64
+ } else {
65
+ ownKeys(Object(source)).forEach(function(key) {
66
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
67
+ });
68
+ }
69
+ return target;
70
+ }
71
+ function _object_without_properties(source, excluded) {
72
+ if (source == null) return {};
73
+ var target = _object_without_properties_loose(source, excluded);
74
+ var key, i;
75
+ if (Object.getOwnPropertySymbols) {
76
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
77
+ for(i = 0; i < sourceSymbolKeys.length; i++){
78
+ key = sourceSymbolKeys[i];
79
+ if (excluded.indexOf(key) >= 0) continue;
80
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
81
+ target[key] = source[key];
82
+ }
83
+ }
84
+ return target;
85
+ }
86
+ function _object_without_properties_loose(source, excluded) {
87
+ if (source == null) return {};
88
+ var target = {};
89
+ var sourceKeys = Object.keys(source);
90
+ var key, i;
91
+ for(i = 0; i < sourceKeys.length; i++){
92
+ key = sourceKeys[i];
93
+ if (excluded.indexOf(key) >= 0) continue;
94
+ target[key] = source[key];
95
+ }
96
+ return target;
97
+ }
98
+ _renderer.Font.register({
99
+ family: 'Figtree',
100
+ fonts: [
101
+ {
102
+ src: 'https://fonts.gstatic.com/s/figtree/v5/_Xmz-HUzqDCFdgfMsYiV_F7wfS-Bs_chQF5ewkEU4HTy.ttf',
103
+ fontWeight: 'normal'
104
+ },
105
+ {
106
+ src: 'https://fonts.gstatic.com/s/figtree/v5/_Xmz-HUzqDCFdgfMsYiV_F7wfS-Bs_eYR15ewkEU4HTy.ttf',
107
+ fontWeight: 'bold'
108
+ }
109
+ ]
110
+ });
111
+ _renderer.Font.register({
112
+ family: 'Allura',
113
+ src: 'https://fonts.gstatic.com/s/allura/v21/9oRPNYsQpS4zjuAPjAIXPtrrGA.ttf'
114
+ });
115
+ var StandardDocument = function(_param) {
116
+ var children = _param.children, style = _param.style, props = _object_without_properties(_param, [
117
+ "children",
118
+ "style"
119
+ ]);
120
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Page, _object_spread_props(_object_spread({
121
+ style: _object_spread({
122
+ fontFamily: 'Figtree',
123
+ fontStyle: 'normal'
124
+ }, style)
125
+ }, props), {
126
+ children: children
127
+ }));
128
+ };
129
+ var _default = StandardDocument;
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ var _env = require("@driveflux/env");
6
+ var _subscription = require("./__mocks__/subscription.js");
7
+ var _index = require("./templates/SubscriptionAgreement/index.js");
8
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
9
+ try {
10
+ var info = gen[key](arg);
11
+ var value = info.value;
12
+ } catch (error) {
13
+ reject(error);
14
+ return;
15
+ }
16
+ if (info.done) {
17
+ resolve(value);
18
+ } else {
19
+ Promise.resolve(value).then(_next, _throw);
20
+ }
21
+ }
22
+ function _async_to_generator(fn) {
23
+ return function() {
24
+ var self = this, args = arguments;
25
+ return new Promise(function(resolve, reject) {
26
+ var gen = fn.apply(self, args);
27
+ function _next(value) {
28
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
29
+ }
30
+ function _throw(err) {
31
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
32
+ }
33
+ _next(undefined);
34
+ });
35
+ };
36
+ }
37
+ function _ts_generator(thisArg, body) {
38
+ var f, y, t, g, _ = {
39
+ label: 0,
40
+ sent: function() {
41
+ if (t[0] & 1) throw t[1];
42
+ return t[1];
43
+ },
44
+ trys: [],
45
+ ops: []
46
+ };
47
+ return g = {
48
+ next: verb(0),
49
+ "throw": verb(1),
50
+ "return": verb(2)
51
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
52
+ return this;
53
+ }), g;
54
+ function verb(n) {
55
+ return function(v) {
56
+ return step([
57
+ n,
58
+ v
59
+ ]);
60
+ };
61
+ }
62
+ function step(op) {
63
+ if (f) throw new TypeError("Generator is already executing.");
64
+ while(_)try {
65
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
66
+ if (y = 0, t) op = [
67
+ op[0] & 2,
68
+ t.value
69
+ ];
70
+ switch(op[0]){
71
+ case 0:
72
+ case 1:
73
+ t = op;
74
+ break;
75
+ case 4:
76
+ _.label++;
77
+ return {
78
+ value: op[1],
79
+ done: false
80
+ };
81
+ case 5:
82
+ _.label++;
83
+ y = op[1];
84
+ op = [
85
+ 0
86
+ ];
87
+ continue;
88
+ case 7:
89
+ op = _.ops.pop();
90
+ _.trys.pop();
91
+ continue;
92
+ default:
93
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
94
+ _ = 0;
95
+ continue;
96
+ }
97
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
98
+ _.label = op[1];
99
+ break;
100
+ }
101
+ if (op[0] === 6 && _.label < t[1]) {
102
+ _.label = t[1];
103
+ t = op;
104
+ break;
105
+ }
106
+ if (t && _.label < t[2]) {
107
+ _.label = t[2];
108
+ _.ops.push(op);
109
+ break;
110
+ }
111
+ if (t[2]) _.ops.pop();
112
+ _.trys.pop();
113
+ continue;
114
+ }
115
+ op = body.call(thisArg, _);
116
+ } catch (e) {
117
+ op = [
118
+ 6,
119
+ e
120
+ ];
121
+ y = 0;
122
+ } finally{
123
+ f = t = 0;
124
+ }
125
+ if (op[0] & 5) throw op[1];
126
+ return {
127
+ value: op[0] ? op[1] : void 0,
128
+ done: true
129
+ };
130
+ }
131
+ }
132
+ var debugSubscriptionAgreement = function() {
133
+ var _ref = _async_to_generator(function() {
134
+ return _ts_generator(this, function(_state) {
135
+ switch(_state.label){
136
+ case 0:
137
+ if (!_subscription.subscription) {
138
+ console.error('no such subscription');
139
+ return [
140
+ 2
141
+ ];
142
+ }
143
+ return [
144
+ 4,
145
+ (0, _index.generateSubscriptionAgreementPdf)({
146
+ subscription: _subscription.subscription
147
+ }, "".concat(process.cwd(), "/output/subscription-agreement.pdf"))
148
+ ];
149
+ case 1:
150
+ _state.sent();
151
+ return [
152
+ 2
153
+ ];
154
+ }
155
+ });
156
+ });
157
+ return function debugSubscriptionAgreement() {
158
+ return _ref.apply(this, arguments);
159
+ };
160
+ }();
161
+ //! put all the debugging functions here
162
+ var debugCases = [
163
+ debugSubscriptionAgreement()
164
+ ];
165
+ var debug = function() {
166
+ var _ref = _async_to_generator(function() {
167
+ var results;
168
+ return _ts_generator(this, function(_state) {
169
+ switch(_state.label){
170
+ case 0:
171
+ (0, _env.loadAllEnv)();
172
+ return [
173
+ 4,
174
+ Promise.allSettled(debugCases)
175
+ ];
176
+ case 1:
177
+ results = _state.sent();
178
+ if (results.some(function(res) {
179
+ return res.status === 'rejected';
180
+ })) {
181
+ results.forEach(function(res, i) {
182
+ if (res.status === 'rejected') {
183
+ console.error("debug no ".concat(i + 1, " error:"), res.reason);
184
+ }
185
+ });
186
+ return [
187
+ 2
188
+ ];
189
+ }
190
+ console.log('Generated all PDFs successfully!');
191
+ console.log("You can view them in the 'output' folder!");
192
+ return [
193
+ 2
194
+ ];
195
+ }
196
+ });
197
+ });
198
+ return function debug() {
199
+ return _ref.apply(this, arguments);
200
+ };
201
+ }();
202
+ debug();
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./templates/index.js"), exports);
6
+ _export_star(require("./types.js"), exports);
7
+ _export_star(require("./utils.js"), exports);
8
+ function _export_star(from, to) {
9
+ Object.keys(from).forEach(function(k) {
10
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
11
+ Object.defineProperty(to, k, {
12
+ enumerable: true,
13
+ get: function() {
14
+ return from[k];
15
+ }
16
+ });
17
+ }
18
+ });
19
+ return from;
20
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ var _jsxruntime = require("react/jsx-runtime");
12
+ var _user = require("@driveflux/db/models/user");
13
+ var _renderer = require("@react-pdf/renderer");
14
+ var _datefns = require("date-fns");
15
+ var _index = require("../../theme/index.js");
16
+ var _LabelValue = /*#__PURE__*/ _interop_require_default(require("./LabelValue.js"));
17
+ function _interop_require_default(obj) {
18
+ return obj && obj.__esModule ? obj : {
19
+ default: obj
20
+ };
21
+ }
22
+ var Confirmation = function(param) {
23
+ var tConfirmation = param.tConfirmation, subscription = param.subscription;
24
+ var _subscription_signature, _subscription_user_identification;
25
+ if (!((_subscription_signature = subscription.signature) === null || _subscription_signature === void 0 ? void 0 : _subscription_signature.signature)) {
26
+ throw new Error('Missing signature');
27
+ }
28
+ var border = "1px solid ".concat(_index.colors.primary2);
29
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
30
+ style: {
31
+ borderLeft: border,
32
+ borderRight: border,
33
+ borderBottom: border
34
+ },
35
+ children: [
36
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.View, {
37
+ style: {
38
+ backgroundColor: _index.colors.primary1,
39
+ borderTop: border,
40
+ padding: 8
41
+ },
42
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
43
+ style: {
44
+ fontWeight: 'bold',
45
+ textTransform: 'uppercase',
46
+ letterSpacing: 1
47
+ },
48
+ children: tConfirmation.title
49
+ })
50
+ }),
51
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
52
+ style: {
53
+ padding: 8,
54
+ paddingBottom: 16,
55
+ rowGap: 8,
56
+ borderTop: border
57
+ },
58
+ children: [
59
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
60
+ children: tConfirmation.agreementText(subscription.businessId ? 'business' : 'member')
61
+ }),
62
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.View, {
63
+ style: {
64
+ height: 160,
65
+ alignItems: 'flex-start'
66
+ },
67
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Image, {
68
+ src: subscription.signature.signature
69
+ })
70
+ }),
71
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
72
+ style: {
73
+ rowGap: 8
74
+ },
75
+ children: [
76
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
77
+ label: tConfirmation.name,
78
+ value: (0, _user.userName)(subscription.user)
79
+ }),
80
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
81
+ label: tConfirmation.idOrPassportNo,
82
+ value: (_subscription_user_identification = subscription.user.identification) === null || _subscription_user_identification === void 0 ? void 0 : _subscription_user_identification.number
83
+ }),
84
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
85
+ label: tConfirmation.date,
86
+ value: subscription.signature.signedAt ? (0, _datefns.format)(subscription.signature.signedAt, 'dd-MM-yyyy hh:mm a') : undefined
87
+ })
88
+ ]
89
+ })
90
+ ]
91
+ })
92
+ ]
93
+ });
94
+ };
95
+ var _default = Confirmation;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ var _jsxruntime = require("react/jsx-runtime");
12
+ var _user = require("@driveflux/db/models/user");
13
+ var _renderer = require("@react-pdf/renderer");
14
+ var _datefns = require("date-fns");
15
+ var _colors = require("../../theme/colors.js");
16
+ var _CoverPageSection = /*#__PURE__*/ _interop_require_default(require("./CoverPageSection.js"));
17
+ var _LabelValue = /*#__PURE__*/ _interop_require_default(require("./LabelValue.js"));
18
+ function _interop_require_default(obj) {
19
+ return obj && obj.__esModule ? obj : {
20
+ default: obj
21
+ };
22
+ }
23
+ var CoverPage = function(param) {
24
+ var tTitle = param.tTitle, tCover = param.tCover, signedAt = param.signedAt, user = param.user;
25
+ var _user_identification;
26
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
27
+ style: {
28
+ flex: 1,
29
+ paddingVertical: 80,
30
+ justifyContent: 'space-between'
31
+ },
32
+ children: [
33
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
34
+ style: {
35
+ fontWeight: 'bold',
36
+ fontSize: 40,
37
+ textTransform: 'uppercase',
38
+ flex: 1
39
+ },
40
+ children: tTitle
41
+ }),
42
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
43
+ style: {
44
+ padding: 16,
45
+ rowGap: 32,
46
+ border: "1px solid ".concat(_colors.colors.primary2),
47
+ fontSize: 10
48
+ },
49
+ children: [
50
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_CoverPageSection.default, {
51
+ title: tCover.effectiveDate,
52
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
53
+ style: {
54
+ flexDirection: 'row',
55
+ columnGap: 4
56
+ },
57
+ children: [
58
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
59
+ style: {
60
+ textDecoration: 'underline'
61
+ },
62
+ children: (0, _datefns.format)(signedAt, 'do')
63
+ }),
64
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
65
+ children: tCover.of
66
+ }),
67
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
68
+ style: {
69
+ textDecoration: 'underline'
70
+ },
71
+ children: (0, _datefns.format)(signedAt, 'MMM')
72
+ }),
73
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
74
+ children: (0, _datefns.format)(signedAt, 'yyyy')
75
+ })
76
+ ]
77
+ })
78
+ }),
79
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_CoverPageSection.default, {
80
+ title: tCover.agreementBetween,
81
+ children: [
82
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
83
+ label: tCover.name,
84
+ value: (0, _user.userName)(user)
85
+ }),
86
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_LabelValue.default, {
87
+ label: tCover.idOrPassportNo,
88
+ value: (_user_identification = user.identification) === null || _user_identification === void 0 ? void 0 : _user_identification.number
89
+ })
90
+ ]
91
+ }),
92
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
93
+ style: {
94
+ fontSize: 8,
95
+ fontWeight: 'bold',
96
+ color: _colors.colors.primary3,
97
+ textTransform: 'uppercase',
98
+ letterSpacing: 1
99
+ },
100
+ children: tCover.and
101
+ }),
102
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
103
+ children: "FLUX Sdn Bhd (1264766-H)"
104
+ })
105
+ ]
106
+ })
107
+ ]
108
+ });
109
+ };
110
+ var _default = CoverPage;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ var _jsxruntime = require("react/jsx-runtime");
12
+ var _renderer = require("@react-pdf/renderer");
13
+ var _colors = require("../../theme/colors.js");
14
+ var CoverPageSection = function(param) {
15
+ var title = param.title, children = param.children;
16
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.View, {
17
+ style: {
18
+ rowGap: 16
19
+ },
20
+ children: [
21
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_renderer.Text, {
22
+ style: {
23
+ fontSize: 8,
24
+ fontWeight: 'bold',
25
+ color: _colors.colors.primary3,
26
+ textTransform: 'uppercase',
27
+ letterSpacing: 1
28
+ },
29
+ children: "".concat(title, ":")
30
+ }),
31
+ children
32
+ ]
33
+ });
34
+ };
35
+ var _default = CoverPageSection;