@wecom/wecom-openclaw-cli 1.0.15 → 1.0.17

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 (212) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +8 -0
  2. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/dist/_virtual/alignment-pattern.js +6 -0
  4. package/dist/_virtual/alignment-pattern.js.map +1 -0
  5. package/dist/_virtual/bitmapper.js +6 -0
  6. package/dist/_virtual/bitmapper.js.map +1 -0
  7. package/dist/_virtual/browser.js +6 -0
  8. package/dist/_virtual/browser.js.map +1 -0
  9. package/dist/_virtual/canvas.js +6 -0
  10. package/dist/_virtual/canvas.js.map +1 -0
  11. package/dist/_virtual/chunkstream.js +6 -0
  12. package/dist/_virtual/chunkstream.js.map +1 -0
  13. package/dist/_virtual/crc.js +6 -0
  14. package/dist/_virtual/crc.js.map +1 -0
  15. package/dist/_virtual/dijkstra.js +6 -0
  16. package/dist/_virtual/dijkstra.js.map +1 -0
  17. package/dist/_virtual/error-correction-code.js +6 -0
  18. package/dist/_virtual/error-correction-code.js.map +1 -0
  19. package/dist/_virtual/error-correction-level.js +6 -0
  20. package/dist/_virtual/error-correction-level.js.map +1 -0
  21. package/dist/_virtual/filter-parse-async.js +6 -0
  22. package/dist/_virtual/filter-parse-async.js.map +1 -0
  23. package/dist/_virtual/filter-parse-sync.js +6 -0
  24. package/dist/_virtual/filter-parse-sync.js.map +1 -0
  25. package/dist/_virtual/filter-parse.js +6 -0
  26. package/dist/_virtual/filter-parse.js.map +1 -0
  27. package/dist/_virtual/finder-pattern.js +6 -0
  28. package/dist/_virtual/finder-pattern.js.map +1 -0
  29. package/dist/_virtual/format-info.js +6 -0
  30. package/dist/_virtual/format-info.js.map +1 -0
  31. package/dist/_virtual/galois-field.js +6 -0
  32. package/dist/_virtual/galois-field.js.map +1 -0
  33. package/dist/_virtual/index.js +10 -0
  34. package/dist/_virtual/index.js.map +1 -0
  35. package/dist/_virtual/interlace.js +6 -0
  36. package/dist/_virtual/interlace.js.map +1 -0
  37. package/dist/_virtual/mask-pattern.js +6 -0
  38. package/dist/_virtual/mask-pattern.js.map +1 -0
  39. package/dist/_virtual/mode.js +6 -0
  40. package/dist/_virtual/mode.js.map +1 -0
  41. package/dist/_virtual/packer-async.js +6 -0
  42. package/dist/_virtual/packer-async.js.map +1 -0
  43. package/dist/_virtual/packer.js +6 -0
  44. package/dist/_virtual/packer.js.map +1 -0
  45. package/dist/_virtual/parser-async.js +6 -0
  46. package/dist/_virtual/parser-async.js.map +1 -0
  47. package/dist/_virtual/parser.js +6 -0
  48. package/dist/_virtual/parser.js.map +1 -0
  49. package/dist/_virtual/png-sync.js +6 -0
  50. package/dist/_virtual/png-sync.js.map +1 -0
  51. package/dist/_virtual/png.js +6 -0
  52. package/dist/_virtual/png.js.map +1 -0
  53. package/dist/_virtual/png2.js +6 -0
  54. package/dist/_virtual/png2.js.map +1 -0
  55. package/dist/_virtual/polynomial.js +6 -0
  56. package/dist/_virtual/polynomial.js.map +1 -0
  57. package/dist/_virtual/qrcode.js +6 -0
  58. package/dist/_virtual/qrcode.js.map +1 -0
  59. package/dist/_virtual/regex.js +6 -0
  60. package/dist/_virtual/regex.js.map +1 -0
  61. package/dist/_virtual/segments.js +6 -0
  62. package/dist/_virtual/segments.js.map +1 -0
  63. package/dist/_virtual/server.js +6 -0
  64. package/dist/_virtual/server.js.map +1 -0
  65. package/dist/_virtual/svg-tag.js +6 -0
  66. package/dist/_virtual/svg-tag.js.map +1 -0
  67. package/dist/_virtual/svg.js +6 -0
  68. package/dist/_virtual/svg.js.map +1 -0
  69. package/dist/_virtual/sync-inflate.js +6 -0
  70. package/dist/_virtual/sync-inflate.js.map +1 -0
  71. package/dist/_virtual/sync-reader.js +6 -0
  72. package/dist/_virtual/sync-reader.js.map +1 -0
  73. package/dist/_virtual/terminal-small.js +6 -0
  74. package/dist/_virtual/terminal-small.js.map +1 -0
  75. package/dist/_virtual/terminal.js +6 -0
  76. package/dist/_virtual/terminal.js.map +1 -0
  77. package/dist/_virtual/terminal2.js +6 -0
  78. package/dist/_virtual/terminal2.js.map +1 -0
  79. package/dist/_virtual/utf8.js +6 -0
  80. package/dist/_virtual/utf8.js.map +1 -0
  81. package/dist/_virtual/utils.js +6 -0
  82. package/dist/_virtual/utils.js.map +1 -0
  83. package/dist/_virtual/utils2.js +6 -0
  84. package/dist/_virtual/utils2.js.map +1 -0
  85. package/dist/_virtual/version-check.js +6 -0
  86. package/dist/_virtual/version-check.js.map +1 -0
  87. package/dist/_virtual/version.js +6 -0
  88. package/dist/_virtual/version.js.map +1 -0
  89. package/dist/node_modules/dijkstrajs/dijkstra.js +179 -0
  90. package/dist/node_modules/dijkstrajs/dijkstra.js.map +1 -0
  91. package/dist/node_modules/pngjs/lib/bitmapper.js +281 -0
  92. package/dist/node_modules/pngjs/lib/bitmapper.js.map +1 -0
  93. package/dist/node_modules/pngjs/lib/bitpacker.js +172 -0
  94. package/dist/node_modules/pngjs/lib/bitpacker.js.map +1 -0
  95. package/dist/node_modules/pngjs/lib/chunkstream.js +204 -0
  96. package/dist/node_modules/pngjs/lib/chunkstream.js.map +1 -0
  97. package/dist/node_modules/pngjs/lib/constants.js +44 -0
  98. package/dist/node_modules/pngjs/lib/constants.js.map +1 -0
  99. package/dist/node_modules/pngjs/lib/crc.js +53 -0
  100. package/dist/node_modules/pngjs/lib/crc.js.map +1 -0
  101. package/dist/node_modules/pngjs/lib/filter-pack.js +185 -0
  102. package/dist/node_modules/pngjs/lib/filter-pack.js.map +1 -0
  103. package/dist/node_modules/pngjs/lib/filter-parse-async.js +40 -0
  104. package/dist/node_modules/pngjs/lib/filter-parse-async.js.map +1 -0
  105. package/dist/node_modules/pngjs/lib/filter-parse-sync.js +36 -0
  106. package/dist/node_modules/pngjs/lib/filter-parse-sync.js.map +1 -0
  107. package/dist/node_modules/pngjs/lib/filter-parse.js +192 -0
  108. package/dist/node_modules/pngjs/lib/filter-parse.js.map +1 -0
  109. package/dist/node_modules/pngjs/lib/format-normaliser.js +105 -0
  110. package/dist/node_modules/pngjs/lib/format-normaliser.js.map +1 -0
  111. package/dist/node_modules/pngjs/lib/interlace.js +108 -0
  112. package/dist/node_modules/pngjs/lib/interlace.js.map +1 -0
  113. package/dist/node_modules/pngjs/lib/packer-async.js +67 -0
  114. package/dist/node_modules/pngjs/lib/packer-async.js.map +1 -0
  115. package/dist/node_modules/pngjs/lib/packer-sync.js +72 -0
  116. package/dist/node_modules/pngjs/lib/packer-sync.js.map +1 -0
  117. package/dist/node_modules/pngjs/lib/packer.js +147 -0
  118. package/dist/node_modules/pngjs/lib/packer.js.map +1 -0
  119. package/dist/node_modules/pngjs/lib/paeth-predictor.js +28 -0
  120. package/dist/node_modules/pngjs/lib/paeth-predictor.js.map +1 -0
  121. package/dist/node_modules/pngjs/lib/parser-async.js +185 -0
  122. package/dist/node_modules/pngjs/lib/parser-async.js.map +1 -0
  123. package/dist/node_modules/pngjs/lib/parser-sync.js +128 -0
  124. package/dist/node_modules/pngjs/lib/parser-sync.js.map +1 -0
  125. package/dist/node_modules/pngjs/lib/parser.js +305 -0
  126. package/dist/node_modules/pngjs/lib/parser.js.map +1 -0
  127. package/dist/node_modules/pngjs/lib/png-sync.js +27 -0
  128. package/dist/node_modules/pngjs/lib/png-sync.js.map +1 -0
  129. package/dist/node_modules/pngjs/lib/png.js +212 -0
  130. package/dist/node_modules/pngjs/lib/png.js.map +1 -0
  131. package/dist/node_modules/pngjs/lib/sync-inflate.js +184 -0
  132. package/dist/node_modules/pngjs/lib/sync-inflate.js.map +1 -0
  133. package/dist/node_modules/pngjs/lib/sync-reader.js +58 -0
  134. package/dist/node_modules/pngjs/lib/sync-reader.js.map +1 -0
  135. package/dist/node_modules/qrcode/lib/browser.js +93 -0
  136. package/dist/node_modules/qrcode/lib/browser.js.map +1 -0
  137. package/dist/node_modules/qrcode/lib/can-promise.js +20 -0
  138. package/dist/node_modules/qrcode/lib/can-promise.js.map +1 -0
  139. package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +100 -0
  140. package/dist/node_modules/qrcode/lib/core/alignment-pattern.js.map +1 -0
  141. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +74 -0
  142. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js.map +1 -0
  143. package/dist/node_modules/qrcode/lib/core/bit-buffer.js +50 -0
  144. package/dist/node_modules/qrcode/lib/core/bit-buffer.js.map +1 -0
  145. package/dist/node_modules/qrcode/lib/core/bit-matrix.js +79 -0
  146. package/dist/node_modules/qrcode/lib/core/bit-matrix.js.map +1 -0
  147. package/dist/node_modules/qrcode/lib/core/byte-data.js +45 -0
  148. package/dist/node_modules/qrcode/lib/core/byte-data.js.map +1 -0
  149. package/dist/node_modules/qrcode/lib/core/error-correction-code.js +150 -0
  150. package/dist/node_modules/qrcode/lib/core/error-correction-code.js.map +1 -0
  151. package/dist/node_modules/qrcode/lib/core/error-correction-level.js +66 -0
  152. package/dist/node_modules/qrcode/lib/core/error-correction-level.js.map +1 -0
  153. package/dist/node_modules/qrcode/lib/core/finder-pattern.js +37 -0
  154. package/dist/node_modules/qrcode/lib/core/finder-pattern.js.map +1 -0
  155. package/dist/node_modules/qrcode/lib/core/format-info.js +44 -0
  156. package/dist/node_modules/qrcode/lib/core/format-info.js.map +1 -0
  157. package/dist/node_modules/qrcode/lib/core/galois-field.js +83 -0
  158. package/dist/node_modules/qrcode/lib/core/galois-field.js.map +1 -0
  159. package/dist/node_modules/qrcode/lib/core/kanji-data.js +70 -0
  160. package/dist/node_modules/qrcode/lib/core/kanji-data.js.map +1 -0
  161. package/dist/node_modules/qrcode/lib/core/mask-pattern.js +251 -0
  162. package/dist/node_modules/qrcode/lib/core/mask-pattern.js.map +1 -0
  163. package/dist/node_modules/qrcode/lib/core/mode.js +185 -0
  164. package/dist/node_modules/qrcode/lib/core/mode.js.map +1 -0
  165. package/dist/node_modules/qrcode/lib/core/numeric-data.js +58 -0
  166. package/dist/node_modules/qrcode/lib/core/numeric-data.js.map +1 -0
  167. package/dist/node_modules/qrcode/lib/core/polynomial.js +79 -0
  168. package/dist/node_modules/qrcode/lib/core/polynomial.js.map +1 -0
  169. package/dist/node_modules/qrcode/lib/core/qrcode.js +522 -0
  170. package/dist/node_modules/qrcode/lib/core/qrcode.js.map +1 -0
  171. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +71 -0
  172. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +1 -0
  173. package/dist/node_modules/qrcode/lib/core/regex.js +45 -0
  174. package/dist/node_modules/qrcode/lib/core/regex.js.map +1 -0
  175. package/dist/node_modules/qrcode/lib/core/segments.js +354 -0
  176. package/dist/node_modules/qrcode/lib/core/segments.js.map +1 -0
  177. package/dist/node_modules/qrcode/lib/core/utils.js +77 -0
  178. package/dist/node_modules/qrcode/lib/core/utils.js.map +1 -0
  179. package/dist/node_modules/qrcode/lib/core/version-check.js +24 -0
  180. package/dist/node_modules/qrcode/lib/core/version-check.js.map +1 -0
  181. package/dist/node_modules/qrcode/lib/core/version.js +184 -0
  182. package/dist/node_modules/qrcode/lib/core/version.js.map +1 -0
  183. package/dist/node_modules/qrcode/lib/index.js +27 -0
  184. package/dist/node_modules/qrcode/lib/index.js.map +1 -0
  185. package/dist/node_modules/qrcode/lib/renderer/canvas.js +80 -0
  186. package/dist/node_modules/qrcode/lib/renderer/canvas.js.map +1 -0
  187. package/dist/node_modules/qrcode/lib/renderer/png.js +97 -0
  188. package/dist/node_modules/qrcode/lib/renderer/png.js.map +1 -0
  189. package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +96 -0
  190. package/dist/node_modules/qrcode/lib/renderer/svg-tag.js.map +1 -0
  191. package/dist/node_modules/qrcode/lib/renderer/svg.js +37 -0
  192. package/dist/node_modules/qrcode/lib/renderer/svg.js.map +1 -0
  193. package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +99 -0
  194. package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js.map +1 -0
  195. package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js +63 -0
  196. package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js.map +1 -0
  197. package/dist/node_modules/qrcode/lib/renderer/terminal.js +25 -0
  198. package/dist/node_modules/qrcode/lib/renderer/terminal.js.map +1 -0
  199. package/dist/node_modules/qrcode/lib/renderer/utf8.js +89 -0
  200. package/dist/node_modules/qrcode/lib/renderer/utf8.js.map +1 -0
  201. package/dist/node_modules/qrcode/lib/renderer/utils.js +115 -0
  202. package/dist/node_modules/qrcode/lib/renderer/utils.js.map +1 -0
  203. package/dist/node_modules/qrcode/lib/server.js +159 -0
  204. package/dist/node_modules/qrcode/lib/server.js.map +1 -0
  205. package/dist/package.json.js +3 -2
  206. package/dist/package.json.js.map +1 -1
  207. package/dist/utils/config.js +2 -2
  208. package/dist/utils/config.js.map +1 -1
  209. package/dist/utils/qrcode.d.ts.map +1 -1
  210. package/dist/utils/qrcode.js +5 -9
  211. package/dist/utils/qrcode.js.map +1 -1
  212. package/package.json +3 -2
@@ -0,0 +1,305 @@
1
+ 'use strict';
2
+
3
+ var parser = require('../../../_virtual/parser.js');
4
+ var constants = require('./constants.js');
5
+ var crc = require('./crc.js');
6
+
7
+ var hasRequiredParser;
8
+
9
+ function requireParser () {
10
+ if (hasRequiredParser) return parser.__module.exports;
11
+ hasRequiredParser = 1;
12
+
13
+ let constants$1 = constants.__require();
14
+ let CrcCalculator = crc.__require();
15
+
16
+ let Parser = (parser.__module.exports = function (options, dependencies) {
17
+ this._options = options;
18
+ options.checkCRC = options.checkCRC !== false;
19
+
20
+ this._hasIHDR = false;
21
+ this._hasIEND = false;
22
+ this._emittedHeadersFinished = false;
23
+
24
+ // input flags/metadata
25
+ this._palette = [];
26
+ this._colorType = 0;
27
+
28
+ this._chunks = {};
29
+ this._chunks[constants$1.TYPE_IHDR] = this._handleIHDR.bind(this);
30
+ this._chunks[constants$1.TYPE_IEND] = this._handleIEND.bind(this);
31
+ this._chunks[constants$1.TYPE_IDAT] = this._handleIDAT.bind(this);
32
+ this._chunks[constants$1.TYPE_PLTE] = this._handlePLTE.bind(this);
33
+ this._chunks[constants$1.TYPE_tRNS] = this._handleTRNS.bind(this);
34
+ this._chunks[constants$1.TYPE_gAMA] = this._handleGAMA.bind(this);
35
+
36
+ this.read = dependencies.read;
37
+ this.error = dependencies.error;
38
+ this.metadata = dependencies.metadata;
39
+ this.gamma = dependencies.gamma;
40
+ this.transColor = dependencies.transColor;
41
+ this.palette = dependencies.palette;
42
+ this.parsed = dependencies.parsed;
43
+ this.inflateData = dependencies.inflateData;
44
+ this.finished = dependencies.finished;
45
+ this.simpleTransparency = dependencies.simpleTransparency;
46
+ this.headersFinished = dependencies.headersFinished || function () {};
47
+ });
48
+
49
+ Parser.prototype.start = function () {
50
+ this.read(constants$1.PNG_SIGNATURE.length, this._parseSignature.bind(this));
51
+ };
52
+
53
+ Parser.prototype._parseSignature = function (data) {
54
+ let signature = constants$1.PNG_SIGNATURE;
55
+
56
+ for (let i = 0; i < signature.length; i++) {
57
+ if (data[i] !== signature[i]) {
58
+ this.error(new Error("Invalid file signature"));
59
+ return;
60
+ }
61
+ }
62
+ this.read(8, this._parseChunkBegin.bind(this));
63
+ };
64
+
65
+ Parser.prototype._parseChunkBegin = function (data) {
66
+ // chunk content length
67
+ let length = data.readUInt32BE(0);
68
+
69
+ // chunk type
70
+ let type = data.readUInt32BE(4);
71
+ let name = "";
72
+ for (let i = 4; i < 8; i++) {
73
+ name += String.fromCharCode(data[i]);
74
+ }
75
+
76
+ //console.log('chunk ', name, length);
77
+
78
+ // chunk flags
79
+ let ancillary = Boolean(data[4] & 0x20); // or critical
80
+ // priv = Boolean(data[5] & 0x20), // or public
81
+ // safeToCopy = Boolean(data[7] & 0x20); // or unsafe
82
+
83
+ if (!this._hasIHDR && type !== constants$1.TYPE_IHDR) {
84
+ this.error(new Error("Expected IHDR on beggining"));
85
+ return;
86
+ }
87
+
88
+ this._crc = new CrcCalculator();
89
+ this._crc.write(Buffer.from(name));
90
+
91
+ if (this._chunks[type]) {
92
+ return this._chunks[type](length);
93
+ }
94
+
95
+ if (!ancillary) {
96
+ this.error(new Error("Unsupported critical chunk type " + name));
97
+ return;
98
+ }
99
+
100
+ this.read(length + 4, this._skipChunk.bind(this));
101
+ };
102
+
103
+ Parser.prototype._skipChunk = function (/*data*/) {
104
+ this.read(8, this._parseChunkBegin.bind(this));
105
+ };
106
+
107
+ Parser.prototype._handleChunkEnd = function () {
108
+ this.read(4, this._parseChunkEnd.bind(this));
109
+ };
110
+
111
+ Parser.prototype._parseChunkEnd = function (data) {
112
+ let fileCrc = data.readInt32BE(0);
113
+ let calcCrc = this._crc.crc32();
114
+
115
+ // check CRC
116
+ if (this._options.checkCRC && calcCrc !== fileCrc) {
117
+ this.error(new Error("Crc error - " + fileCrc + " - " + calcCrc));
118
+ return;
119
+ }
120
+
121
+ if (!this._hasIEND) {
122
+ this.read(8, this._parseChunkBegin.bind(this));
123
+ }
124
+ };
125
+
126
+ Parser.prototype._handleIHDR = function (length) {
127
+ this.read(length, this._parseIHDR.bind(this));
128
+ };
129
+ Parser.prototype._parseIHDR = function (data) {
130
+ this._crc.write(data);
131
+
132
+ let width = data.readUInt32BE(0);
133
+ let height = data.readUInt32BE(4);
134
+ let depth = data[8];
135
+ let colorType = data[9]; // bits: 1 palette, 2 color, 4 alpha
136
+ let compr = data[10];
137
+ let filter = data[11];
138
+ let interlace = data[12];
139
+
140
+ // console.log(' width', width, 'height', height,
141
+ // 'depth', depth, 'colorType', colorType,
142
+ // 'compr', compr, 'filter', filter, 'interlace', interlace
143
+ // );
144
+
145
+ if (
146
+ depth !== 8 &&
147
+ depth !== 4 &&
148
+ depth !== 2 &&
149
+ depth !== 1 &&
150
+ depth !== 16
151
+ ) {
152
+ this.error(new Error("Unsupported bit depth " + depth));
153
+ return;
154
+ }
155
+ if (!(colorType in constants$1.COLORTYPE_TO_BPP_MAP)) {
156
+ this.error(new Error("Unsupported color type"));
157
+ return;
158
+ }
159
+ if (compr !== 0) {
160
+ this.error(new Error("Unsupported compression method"));
161
+ return;
162
+ }
163
+ if (filter !== 0) {
164
+ this.error(new Error("Unsupported filter method"));
165
+ return;
166
+ }
167
+ if (interlace !== 0 && interlace !== 1) {
168
+ this.error(new Error("Unsupported interlace method"));
169
+ return;
170
+ }
171
+
172
+ this._colorType = colorType;
173
+
174
+ let bpp = constants$1.COLORTYPE_TO_BPP_MAP[this._colorType];
175
+
176
+ this._hasIHDR = true;
177
+
178
+ this.metadata({
179
+ width: width,
180
+ height: height,
181
+ depth: depth,
182
+ interlace: Boolean(interlace),
183
+ palette: Boolean(colorType & constants$1.COLORTYPE_PALETTE),
184
+ color: Boolean(colorType & constants$1.COLORTYPE_COLOR),
185
+ alpha: Boolean(colorType & constants$1.COLORTYPE_ALPHA),
186
+ bpp: bpp,
187
+ colorType: colorType,
188
+ });
189
+
190
+ this._handleChunkEnd();
191
+ };
192
+
193
+ Parser.prototype._handlePLTE = function (length) {
194
+ this.read(length, this._parsePLTE.bind(this));
195
+ };
196
+ Parser.prototype._parsePLTE = function (data) {
197
+ this._crc.write(data);
198
+
199
+ let entries = Math.floor(data.length / 3);
200
+ // console.log('Palette:', entries);
201
+
202
+ for (let i = 0; i < entries; i++) {
203
+ this._palette.push([data[i * 3], data[i * 3 + 1], data[i * 3 + 2], 0xff]);
204
+ }
205
+
206
+ this.palette(this._palette);
207
+
208
+ this._handleChunkEnd();
209
+ };
210
+
211
+ Parser.prototype._handleTRNS = function (length) {
212
+ this.simpleTransparency();
213
+ this.read(length, this._parseTRNS.bind(this));
214
+ };
215
+ Parser.prototype._parseTRNS = function (data) {
216
+ this._crc.write(data);
217
+
218
+ // palette
219
+ if (this._colorType === constants$1.COLORTYPE_PALETTE_COLOR) {
220
+ if (this._palette.length === 0) {
221
+ this.error(new Error("Transparency chunk must be after palette"));
222
+ return;
223
+ }
224
+ if (data.length > this._palette.length) {
225
+ this.error(new Error("More transparent colors than palette size"));
226
+ return;
227
+ }
228
+ for (let i = 0; i < data.length; i++) {
229
+ this._palette[i][3] = data[i];
230
+ }
231
+ this.palette(this._palette);
232
+ }
233
+
234
+ // for colorType 0 (grayscale) and 2 (rgb)
235
+ // there might be one gray/color defined as transparent
236
+ if (this._colorType === constants$1.COLORTYPE_GRAYSCALE) {
237
+ // grey, 2 bytes
238
+ this.transColor([data.readUInt16BE(0)]);
239
+ }
240
+ if (this._colorType === constants$1.COLORTYPE_COLOR) {
241
+ this.transColor([
242
+ data.readUInt16BE(0),
243
+ data.readUInt16BE(2),
244
+ data.readUInt16BE(4),
245
+ ]);
246
+ }
247
+
248
+ this._handleChunkEnd();
249
+ };
250
+
251
+ Parser.prototype._handleGAMA = function (length) {
252
+ this.read(length, this._parseGAMA.bind(this));
253
+ };
254
+ Parser.prototype._parseGAMA = function (data) {
255
+ this._crc.write(data);
256
+ this.gamma(data.readUInt32BE(0) / constants$1.GAMMA_DIVISION);
257
+
258
+ this._handleChunkEnd();
259
+ };
260
+
261
+ Parser.prototype._handleIDAT = function (length) {
262
+ if (!this._emittedHeadersFinished) {
263
+ this._emittedHeadersFinished = true;
264
+ this.headersFinished();
265
+ }
266
+ this.read(-length, this._parseIDAT.bind(this, length));
267
+ };
268
+ Parser.prototype._parseIDAT = function (length, data) {
269
+ this._crc.write(data);
270
+
271
+ if (
272
+ this._colorType === constants$1.COLORTYPE_PALETTE_COLOR &&
273
+ this._palette.length === 0
274
+ ) {
275
+ throw new Error("Expected palette not found");
276
+ }
277
+
278
+ this.inflateData(data);
279
+ let leftOverLength = length - data.length;
280
+
281
+ if (leftOverLength > 0) {
282
+ this._handleIDAT(leftOverLength);
283
+ } else {
284
+ this._handleChunkEnd();
285
+ }
286
+ };
287
+
288
+ Parser.prototype._handleIEND = function (length) {
289
+ this.read(length, this._parseIEND.bind(this));
290
+ };
291
+ Parser.prototype._parseIEND = function (data) {
292
+ this._crc.write(data);
293
+
294
+ this._hasIEND = true;
295
+ this._handleChunkEnd();
296
+
297
+ if (this.finished) {
298
+ this.finished();
299
+ }
300
+ };
301
+ return parser.__module.exports;
302
+ }
303
+
304
+ exports.__require = requireParser;
305
+ //# sourceMappingURL=parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.js","sources":["../../../../node_modules/pngjs/lib/parser.js"],"sourcesContent":["\"use strict\";\n\nlet constants = require(\"./constants\");\nlet CrcCalculator = require(\"./crc\");\n\nlet Parser = (module.exports = function (options, dependencies) {\n this._options = options;\n options.checkCRC = options.checkCRC !== false;\n\n this._hasIHDR = false;\n this._hasIEND = false;\n this._emittedHeadersFinished = false;\n\n // input flags/metadata\n this._palette = [];\n this._colorType = 0;\n\n this._chunks = {};\n this._chunks[constants.TYPE_IHDR] = this._handleIHDR.bind(this);\n this._chunks[constants.TYPE_IEND] = this._handleIEND.bind(this);\n this._chunks[constants.TYPE_IDAT] = this._handleIDAT.bind(this);\n this._chunks[constants.TYPE_PLTE] = this._handlePLTE.bind(this);\n this._chunks[constants.TYPE_tRNS] = this._handleTRNS.bind(this);\n this._chunks[constants.TYPE_gAMA] = this._handleGAMA.bind(this);\n\n this.read = dependencies.read;\n this.error = dependencies.error;\n this.metadata = dependencies.metadata;\n this.gamma = dependencies.gamma;\n this.transColor = dependencies.transColor;\n this.palette = dependencies.palette;\n this.parsed = dependencies.parsed;\n this.inflateData = dependencies.inflateData;\n this.finished = dependencies.finished;\n this.simpleTransparency = dependencies.simpleTransparency;\n this.headersFinished = dependencies.headersFinished || function () {};\n});\n\nParser.prototype.start = function () {\n this.read(constants.PNG_SIGNATURE.length, this._parseSignature.bind(this));\n};\n\nParser.prototype._parseSignature = function (data) {\n let signature = constants.PNG_SIGNATURE;\n\n for (let i = 0; i < signature.length; i++) {\n if (data[i] !== signature[i]) {\n this.error(new Error(\"Invalid file signature\"));\n return;\n }\n }\n this.read(8, this._parseChunkBegin.bind(this));\n};\n\nParser.prototype._parseChunkBegin = function (data) {\n // chunk content length\n let length = data.readUInt32BE(0);\n\n // chunk type\n let type = data.readUInt32BE(4);\n let name = \"\";\n for (let i = 4; i < 8; i++) {\n name += String.fromCharCode(data[i]);\n }\n\n //console.log('chunk ', name, length);\n\n // chunk flags\n let ancillary = Boolean(data[4] & 0x20); // or critical\n // priv = Boolean(data[5] & 0x20), // or public\n // safeToCopy = Boolean(data[7] & 0x20); // or unsafe\n\n if (!this._hasIHDR && type !== constants.TYPE_IHDR) {\n this.error(new Error(\"Expected IHDR on beggining\"));\n return;\n }\n\n this._crc = new CrcCalculator();\n this._crc.write(Buffer.from(name));\n\n if (this._chunks[type]) {\n return this._chunks[type](length);\n }\n\n if (!ancillary) {\n this.error(new Error(\"Unsupported critical chunk type \" + name));\n return;\n }\n\n this.read(length + 4, this._skipChunk.bind(this));\n};\n\nParser.prototype._skipChunk = function (/*data*/) {\n this.read(8, this._parseChunkBegin.bind(this));\n};\n\nParser.prototype._handleChunkEnd = function () {\n this.read(4, this._parseChunkEnd.bind(this));\n};\n\nParser.prototype._parseChunkEnd = function (data) {\n let fileCrc = data.readInt32BE(0);\n let calcCrc = this._crc.crc32();\n\n // check CRC\n if (this._options.checkCRC && calcCrc !== fileCrc) {\n this.error(new Error(\"Crc error - \" + fileCrc + \" - \" + calcCrc));\n return;\n }\n\n if (!this._hasIEND) {\n this.read(8, this._parseChunkBegin.bind(this));\n }\n};\n\nParser.prototype._handleIHDR = function (length) {\n this.read(length, this._parseIHDR.bind(this));\n};\nParser.prototype._parseIHDR = function (data) {\n this._crc.write(data);\n\n let width = data.readUInt32BE(0);\n let height = data.readUInt32BE(4);\n let depth = data[8];\n let colorType = data[9]; // bits: 1 palette, 2 color, 4 alpha\n let compr = data[10];\n let filter = data[11];\n let interlace = data[12];\n\n // console.log(' width', width, 'height', height,\n // 'depth', depth, 'colorType', colorType,\n // 'compr', compr, 'filter', filter, 'interlace', interlace\n // );\n\n if (\n depth !== 8 &&\n depth !== 4 &&\n depth !== 2 &&\n depth !== 1 &&\n depth !== 16\n ) {\n this.error(new Error(\"Unsupported bit depth \" + depth));\n return;\n }\n if (!(colorType in constants.COLORTYPE_TO_BPP_MAP)) {\n this.error(new Error(\"Unsupported color type\"));\n return;\n }\n if (compr !== 0) {\n this.error(new Error(\"Unsupported compression method\"));\n return;\n }\n if (filter !== 0) {\n this.error(new Error(\"Unsupported filter method\"));\n return;\n }\n if (interlace !== 0 && interlace !== 1) {\n this.error(new Error(\"Unsupported interlace method\"));\n return;\n }\n\n this._colorType = colorType;\n\n let bpp = constants.COLORTYPE_TO_BPP_MAP[this._colorType];\n\n this._hasIHDR = true;\n\n this.metadata({\n width: width,\n height: height,\n depth: depth,\n interlace: Boolean(interlace),\n palette: Boolean(colorType & constants.COLORTYPE_PALETTE),\n color: Boolean(colorType & constants.COLORTYPE_COLOR),\n alpha: Boolean(colorType & constants.COLORTYPE_ALPHA),\n bpp: bpp,\n colorType: colorType,\n });\n\n this._handleChunkEnd();\n};\n\nParser.prototype._handlePLTE = function (length) {\n this.read(length, this._parsePLTE.bind(this));\n};\nParser.prototype._parsePLTE = function (data) {\n this._crc.write(data);\n\n let entries = Math.floor(data.length / 3);\n // console.log('Palette:', entries);\n\n for (let i = 0; i < entries; i++) {\n this._palette.push([data[i * 3], data[i * 3 + 1], data[i * 3 + 2], 0xff]);\n }\n\n this.palette(this._palette);\n\n this._handleChunkEnd();\n};\n\nParser.prototype._handleTRNS = function (length) {\n this.simpleTransparency();\n this.read(length, this._parseTRNS.bind(this));\n};\nParser.prototype._parseTRNS = function (data) {\n this._crc.write(data);\n\n // palette\n if (this._colorType === constants.COLORTYPE_PALETTE_COLOR) {\n if (this._palette.length === 0) {\n this.error(new Error(\"Transparency chunk must be after palette\"));\n return;\n }\n if (data.length > this._palette.length) {\n this.error(new Error(\"More transparent colors than palette size\"));\n return;\n }\n for (let i = 0; i < data.length; i++) {\n this._palette[i][3] = data[i];\n }\n this.palette(this._palette);\n }\n\n // for colorType 0 (grayscale) and 2 (rgb)\n // there might be one gray/color defined as transparent\n if (this._colorType === constants.COLORTYPE_GRAYSCALE) {\n // grey, 2 bytes\n this.transColor([data.readUInt16BE(0)]);\n }\n if (this._colorType === constants.COLORTYPE_COLOR) {\n this.transColor([\n data.readUInt16BE(0),\n data.readUInt16BE(2),\n data.readUInt16BE(4),\n ]);\n }\n\n this._handleChunkEnd();\n};\n\nParser.prototype._handleGAMA = function (length) {\n this.read(length, this._parseGAMA.bind(this));\n};\nParser.prototype._parseGAMA = function (data) {\n this._crc.write(data);\n this.gamma(data.readUInt32BE(0) / constants.GAMMA_DIVISION);\n\n this._handleChunkEnd();\n};\n\nParser.prototype._handleIDAT = function (length) {\n if (!this._emittedHeadersFinished) {\n this._emittedHeadersFinished = true;\n this.headersFinished();\n }\n this.read(-length, this._parseIDAT.bind(this, length));\n};\nParser.prototype._parseIDAT = function (length, data) {\n this._crc.write(data);\n\n if (\n this._colorType === constants.COLORTYPE_PALETTE_COLOR &&\n this._palette.length === 0\n ) {\n throw new Error(\"Expected palette not found\");\n }\n\n this.inflateData(data);\n let leftOverLength = length - data.length;\n\n if (leftOverLength > 0) {\n this._handleIDAT(leftOverLength);\n } else {\n this._handleChunkEnd();\n }\n};\n\nParser.prototype._handleIEND = function (length) {\n this.read(length, this._parseIEND.bind(this));\n};\nParser.prototype._parseIEND = function (data) {\n this._crc.write(data);\n\n this._hasIEND = true;\n this._handleChunkEnd();\n\n if (this.finished) {\n this.finished();\n }\n};\n"],"names":["constants","require$$0","require$$1","parserModule"],"mappings":";;;;;;;;;;;;CAEA,IAAIA,WAAS,GAAGC,mBAAA,EAAsB;CACtC,IAAI,aAAa,GAAGC,aAAA,EAAgB;;CAEpC,IAAI,MAAM,IAAIC,eAAA,CAAA,OAAc,GAAG,UAAU,OAAO,EAAE,YAAY,EAAE;AAChE,GAAE,IAAI,CAAC,QAAQ,GAAG,OAAO;GACvB,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,KAAK;;AAE/C,GAAE,IAAI,CAAC,QAAQ,GAAG,KAAK;AACvB,GAA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CAAC,uBAAuB;AACzD,KAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK;KACzB;AACJ,KAAI,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC;AACjD,GAAA;;AAEA,GAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;AACxB,GAAE,IAAI,cAAc,GAAG,MAAM,GAAG,IAAI,CAAC,MAAM;;AAE3C,GAAE,IAAI,cAAc,GAAG,CAAC,EAAE;AAC1B,KAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;AACpC,GAAA,CAAG,MAAM;KACL,IAAI,CAAC,eAAe,EAAE;AAC1B,GAAA;CACA,CAAC;;AAED,CAAA,MAAM,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,MAAM,EAAE;AACjD,GAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAC/C,CAAC;AACD,CAAA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,UAAU,IAAI,EAAE;AAC9C,GAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;;AAEvB,GAAE,IAAI,CAAC,QAAQ,GAAG,IAAI;GACpB,IAAI,CAAC,eAAe,EAAE;;AAExB,GAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;KACjB,IAAI,CAAC,QAAQ,EAAE;AACnB,GAAA;CACA,CAAC;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var pngSync = require('../../../_virtual/png-sync.js');
4
+ var parserSync = require('./parser-sync.js');
5
+ var packerSync = require('./packer-sync.js');
6
+
7
+ var hasRequiredPngSync;
8
+
9
+ function requirePngSync () {
10
+ if (hasRequiredPngSync) return pngSync.__exports;
11
+ hasRequiredPngSync = 1;
12
+
13
+ let parse = parserSync.__require();
14
+ let pack = packerSync.__require();
15
+
16
+ pngSync.__exports.read = function (buffer, options) {
17
+ return parse(buffer, options || {});
18
+ };
19
+
20
+ pngSync.__exports.write = function (png, options) {
21
+ return pack(png, options);
22
+ };
23
+ return pngSync.__exports;
24
+ }
25
+
26
+ exports.__require = requirePngSync;
27
+ //# sourceMappingURL=png-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"png-sync.js","sources":["../../../../node_modules/pngjs/lib/png-sync.js"],"sourcesContent":["\"use strict\";\n\nlet parse = require(\"./parser-sync\");\nlet pack = require(\"./packer-sync\");\n\nexports.read = function (buffer, options) {\n return parse(buffer, options || {});\n};\n\nexports.write = function (png, options) {\n return pack(png, options);\n};\n"],"names":["require$$0","require$$1","pngSync"],"mappings":";;;;;;;;;;;;CAEA,IAAI,KAAK,GAAGA,oBAAA,EAAwB;CACpC,IAAI,IAAI,GAAGC,oBAAA,EAAwB;;AAEnC,CAAAC,iBAAA,CAAA,IAAY,GAAG,UAAU,MAAM,EAAE,OAAO,EAAE;GACxC,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;CACrC,CAAC;;AAED,CAAAA,iBAAA,CAAA,KAAa,GAAG,UAAU,GAAG,EAAE,OAAO,EAAE;AACxC,GAAE,OAAO,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC;CAC3B,CAAC;;;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,212 @@
1
+ 'use strict';
2
+
3
+ var png = require('../../../_virtual/png2.js');
4
+ var require$$0 = require('util');
5
+ var require$$1 = require('stream');
6
+ var parserAsync = require('./parser-async.js');
7
+ var packerAsync = require('./packer-async.js');
8
+ var pngSync = require('./png-sync.js');
9
+
10
+ var hasRequiredPng;
11
+
12
+ function requirePng () {
13
+ if (hasRequiredPng) return png.__exports;
14
+ hasRequiredPng = 1;
15
+
16
+ let util = require$$0;
17
+ let Stream = require$$1;
18
+ let Parser = parserAsync.__require();
19
+ let Packer = packerAsync.__require();
20
+ let PNGSync = pngSync.__require();
21
+
22
+ let PNG = (png.__exports.PNG = function (options) {
23
+ Stream.call(this);
24
+
25
+ options = options || {}; // eslint-disable-line no-param-reassign
26
+
27
+ // coerce pixel dimensions to integers (also coerces undefined -> 0):
28
+ this.width = options.width | 0;
29
+ this.height = options.height | 0;
30
+
31
+ this.data =
32
+ this.width > 0 && this.height > 0
33
+ ? Buffer.alloc(4 * this.width * this.height)
34
+ : null;
35
+
36
+ if (options.fill && this.data) {
37
+ this.data.fill(0);
38
+ }
39
+
40
+ this.gamma = 0;
41
+ this.readable = this.writable = true;
42
+
43
+ this._parser = new Parser(options);
44
+
45
+ this._parser.on("error", this.emit.bind(this, "error"));
46
+ this._parser.on("close", this._handleClose.bind(this));
47
+ this._parser.on("metadata", this._metadata.bind(this));
48
+ this._parser.on("gamma", this._gamma.bind(this));
49
+ this._parser.on(
50
+ "parsed",
51
+ function (data) {
52
+ this.data = data;
53
+ this.emit("parsed", data);
54
+ }.bind(this)
55
+ );
56
+
57
+ this._packer = new Packer(options);
58
+ this._packer.on("data", this.emit.bind(this, "data"));
59
+ this._packer.on("end", this.emit.bind(this, "end"));
60
+ this._parser.on("close", this._handleClose.bind(this));
61
+ this._packer.on("error", this.emit.bind(this, "error"));
62
+ });
63
+ util.inherits(PNG, Stream);
64
+
65
+ PNG.sync = PNGSync;
66
+
67
+ PNG.prototype.pack = function () {
68
+ if (!this.data || !this.data.length) {
69
+ this.emit("error", "No data provided");
70
+ return this;
71
+ }
72
+
73
+ process.nextTick(
74
+ function () {
75
+ this._packer.pack(this.data, this.width, this.height, this.gamma);
76
+ }.bind(this)
77
+ );
78
+
79
+ return this;
80
+ };
81
+
82
+ PNG.prototype.parse = function (data, callback) {
83
+ if (callback) {
84
+ let onParsed, onError;
85
+
86
+ onParsed = function (parsedData) {
87
+ this.removeListener("error", onError);
88
+
89
+ this.data = parsedData;
90
+ callback(null, this);
91
+ }.bind(this);
92
+
93
+ onError = function (err) {
94
+ this.removeListener("parsed", onParsed);
95
+
96
+ callback(err, null);
97
+ }.bind(this);
98
+
99
+ this.once("parsed", onParsed);
100
+ this.once("error", onError);
101
+ }
102
+
103
+ this.end(data);
104
+ return this;
105
+ };
106
+
107
+ PNG.prototype.write = function (data) {
108
+ this._parser.write(data);
109
+ return true;
110
+ };
111
+
112
+ PNG.prototype.end = function (data) {
113
+ this._parser.end(data);
114
+ };
115
+
116
+ PNG.prototype._metadata = function (metadata) {
117
+ this.width = metadata.width;
118
+ this.height = metadata.height;
119
+
120
+ this.emit("metadata", metadata);
121
+ };
122
+
123
+ PNG.prototype._gamma = function (gamma) {
124
+ this.gamma = gamma;
125
+ };
126
+
127
+ PNG.prototype._handleClose = function () {
128
+ if (!this._parser.writable && !this._packer.readable) {
129
+ this.emit("close");
130
+ }
131
+ };
132
+
133
+ PNG.bitblt = function (src, dst, srcX, srcY, width, height, deltaX, deltaY) {
134
+ // eslint-disable-line max-params
135
+ // coerce pixel dimensions to integers (also coerces undefined -> 0):
136
+ /* eslint-disable no-param-reassign */
137
+ srcX |= 0;
138
+ srcY |= 0;
139
+ width |= 0;
140
+ height |= 0;
141
+ deltaX |= 0;
142
+ deltaY |= 0;
143
+ /* eslint-enable no-param-reassign */
144
+
145
+ if (
146
+ srcX > src.width ||
147
+ srcY > src.height ||
148
+ srcX + width > src.width ||
149
+ srcY + height > src.height
150
+ ) {
151
+ throw new Error("bitblt reading outside image");
152
+ }
153
+
154
+ if (
155
+ deltaX > dst.width ||
156
+ deltaY > dst.height ||
157
+ deltaX + width > dst.width ||
158
+ deltaY + height > dst.height
159
+ ) {
160
+ throw new Error("bitblt writing outside image");
161
+ }
162
+
163
+ for (let y = 0; y < height; y++) {
164
+ src.data.copy(
165
+ dst.data,
166
+ ((deltaY + y) * dst.width + deltaX) << 2,
167
+ ((srcY + y) * src.width + srcX) << 2,
168
+ ((srcY + y) * src.width + srcX + width) << 2
169
+ );
170
+ }
171
+ };
172
+
173
+ PNG.prototype.bitblt = function (
174
+ dst,
175
+ srcX,
176
+ srcY,
177
+ width,
178
+ height,
179
+ deltaX,
180
+ deltaY
181
+ ) {
182
+ // eslint-disable-line max-params
183
+
184
+ PNG.bitblt(this, dst, srcX, srcY, width, height, deltaX, deltaY);
185
+ return this;
186
+ };
187
+
188
+ PNG.adjustGamma = function (src) {
189
+ if (src.gamma) {
190
+ for (let y = 0; y < src.height; y++) {
191
+ for (let x = 0; x < src.width; x++) {
192
+ let idx = (src.width * y + x) << 2;
193
+
194
+ for (let i = 0; i < 3; i++) {
195
+ let sample = src.data[idx + i] / 255;
196
+ sample = Math.pow(sample, 1 / 2.2 / src.gamma);
197
+ src.data[idx + i] = Math.round(sample * 255);
198
+ }
199
+ }
200
+ }
201
+ src.gamma = 0;
202
+ }
203
+ };
204
+
205
+ PNG.prototype.adjustGamma = function () {
206
+ PNG.adjustGamma(this);
207
+ };
208
+ return png.__exports;
209
+ }
210
+
211
+ exports.__require = requirePng;
212
+ //# sourceMappingURL=png.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"png.js","sources":["../../../../node_modules/pngjs/lib/png.js"],"sourcesContent":["\"use strict\";\n\nlet util = require(\"util\");\nlet Stream = require(\"stream\");\nlet Parser = require(\"./parser-async\");\nlet Packer = require(\"./packer-async\");\nlet PNGSync = require(\"./png-sync\");\n\nlet PNG = (exports.PNG = function (options) {\n Stream.call(this);\n\n options = options || {}; // eslint-disable-line no-param-reassign\n\n // coerce pixel dimensions to integers (also coerces undefined -> 0):\n this.width = options.width | 0;\n this.height = options.height | 0;\n\n this.data =\n this.width > 0 && this.height > 0\n ? Buffer.alloc(4 * this.width * this.height)\n : null;\n\n if (options.fill && this.data) {\n this.data.fill(0);\n }\n\n this.gamma = 0;\n this.readable = this.writable = true;\n\n this._parser = new Parser(options);\n\n this._parser.on(\"error\", this.emit.bind(this, \"error\"));\n this._parser.on(\"close\", this._handleClose.bind(this));\n this._parser.on(\"metadata\", this._metadata.bind(this));\n this._parser.on(\"gamma\", this._gamma.bind(this));\n this._parser.on(\n \"parsed\",\n function (data) {\n this.data = data;\n this.emit(\"parsed\", data);\n }.bind(this)\n );\n\n this._packer = new Packer(options);\n this._packer.on(\"data\", this.emit.bind(this, \"data\"));\n this._packer.on(\"end\", this.emit.bind(this, \"end\"));\n this._parser.on(\"close\", this._handleClose.bind(this));\n this._packer.on(\"error\", this.emit.bind(this, \"error\"));\n});\nutil.inherits(PNG, Stream);\n\nPNG.sync = PNGSync;\n\nPNG.prototype.pack = function () {\n if (!this.data || !this.data.length) {\n this.emit(\"error\", \"No data provided\");\n return this;\n }\n\n process.nextTick(\n function () {\n this._packer.pack(this.data, this.width, this.height, this.gamma);\n }.bind(this)\n );\n\n return this;\n};\n\nPNG.prototype.parse = function (data, callback) {\n if (callback) {\n let onParsed, onError;\n\n onParsed = function (parsedData) {\n this.removeListener(\"error\", onError);\n\n this.data = parsedData;\n callback(null, this);\n }.bind(this);\n\n onError = function (err) {\n this.removeListener(\"parsed\", onParsed);\n\n callback(err, null);\n }.bind(this);\n\n this.once(\"parsed\", onParsed);\n this.once(\"error\", onError);\n }\n\n this.end(data);\n return this;\n};\n\nPNG.prototype.write = function (data) {\n this._parser.write(data);\n return true;\n};\n\nPNG.prototype.end = function (data) {\n this._parser.end(data);\n};\n\nPNG.prototype._metadata = function (metadata) {\n this.width = metadata.width;\n this.height = metadata.height;\n\n this.emit(\"metadata\", metadata);\n};\n\nPNG.prototype._gamma = function (gamma) {\n this.gamma = gamma;\n};\n\nPNG.prototype._handleClose = function () {\n if (!this._parser.writable && !this._packer.readable) {\n this.emit(\"close\");\n }\n};\n\nPNG.bitblt = function (src, dst, srcX, srcY, width, height, deltaX, deltaY) {\n // eslint-disable-line max-params\n // coerce pixel dimensions to integers (also coerces undefined -> 0):\n /* eslint-disable no-param-reassign */\n srcX |= 0;\n srcY |= 0;\n width |= 0;\n height |= 0;\n deltaX |= 0;\n deltaY |= 0;\n /* eslint-enable no-param-reassign */\n\n if (\n srcX > src.width ||\n srcY > src.height ||\n srcX + width > src.width ||\n srcY + height > src.height\n ) {\n throw new Error(\"bitblt reading outside image\");\n }\n\n if (\n deltaX > dst.width ||\n deltaY > dst.height ||\n deltaX + width > dst.width ||\n deltaY + height > dst.height\n ) {\n throw new Error(\"bitblt writing outside image\");\n }\n\n for (let y = 0; y < height; y++) {\n src.data.copy(\n dst.data,\n ((deltaY + y) * dst.width + deltaX) << 2,\n ((srcY + y) * src.width + srcX) << 2,\n ((srcY + y) * src.width + srcX + width) << 2\n );\n }\n};\n\nPNG.prototype.bitblt = function (\n dst,\n srcX,\n srcY,\n width,\n height,\n deltaX,\n deltaY\n) {\n // eslint-disable-line max-params\n\n PNG.bitblt(this, dst, srcX, srcY, width, height, deltaX, deltaY);\n return this;\n};\n\nPNG.adjustGamma = function (src) {\n if (src.gamma) {\n for (let y = 0; y < src.height; y++) {\n for (let x = 0; x < src.width; x++) {\n let idx = (src.width * y + x) << 2;\n\n for (let i = 0; i < 3; i++) {\n let sample = src.data[idx + i] / 255;\n sample = Math.pow(sample, 1 / 2.2 / src.gamma);\n src.data[idx + i] = Math.round(sample * 255);\n }\n }\n }\n src.gamma = 0;\n }\n};\n\nPNG.prototype.adjustGamma = function () {\n PNG.adjustGamma(this);\n};\n"],"names":["require$$2","require$$3","require$$4","png"],"mappings":";;;;;;;;;;;;;;;CAEA,IAAI,IAAI,GAAG,UAAe;CAC1B,IAAI,MAAM,GAAG,UAAiB;CAC9B,IAAI,MAAM,GAAGA,qBAAA,EAAyB;CACtC,IAAI,MAAM,GAAGC,qBAAA,EAAyB;CACtC,IAAI,OAAO,GAAGC,iBAAA,EAAqB;;AAEnC,CAAA,IAAI,GAAG,IAAIC,aAAA,CAAA,GAAW,GAAG,UAAU,OAAO,EAAE;AAC5C,GAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;;AAEnB,GAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;;AAE1B;GACE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC;GAC9B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,C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