utxo-lib 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -123,7 +123,7 @@ function getPsbtInputScriptType(input) {
123
123
  const isP2pk = (script) => {
124
124
  try {
125
125
  const chunks = bitcoinjs_lib_1.script.decompile(script);
126
- return (chunks?.length === 2 &&
126
+ return ((chunks === null || chunks === void 0 ? void 0 : chunks.length) === 2 &&
127
127
  Buffer.isBuffer(chunks[0]) &&
128
128
  bitcoinjs_lib_1.script.isCanonicalPubKey(chunks[0]) &&
129
129
  chunks[1] === index_1.opcodes.OP_CHECKSIG);
@@ -175,7 +175,7 @@ function parseTaprootKeyPathSignatures(input) {
175
175
  : { signatures: [signatures[0]], participantPublicKeys: [participantPublicKeys[0]] };
176
176
  }
177
177
  function parsePartialOrTapScriptSignatures(sig) {
178
- if (!sig?.length) {
178
+ if (!(sig === null || sig === void 0 ? void 0 : sig.length)) {
179
179
  return { signatures: undefined };
180
180
  }
181
181
  if (sig.length > 2) {
@@ -192,6 +192,7 @@ function parseSignatures(input, scriptType) {
192
192
  : parsePartialOrTapScriptSignatures(input.partialSig);
193
193
  }
194
194
  function parseScript(input, scriptType) {
195
+ var _a;
195
196
  let pubScript;
196
197
  if (scriptType === 'p2sh' || scriptType === 'p2shP2pk') {
197
198
  pubScript = input.redeemScript;
@@ -203,7 +204,7 @@ function parseScript(input, scriptType) {
203
204
  pubScript = input.tapLeafScript ? input.tapLeafScript[0].script : undefined;
204
205
  }
205
206
  else if (scriptType === 'taprootKeyPathSpend') {
206
- if (input.witnessUtxo?.script) {
207
+ if ((_a = input.witnessUtxo) === null || _a === void 0 ? void 0 : _a.script) {
207
208
  pubScript = input.witnessUtxo.script;
208
209
  }
209
210
  else if (input.tapInternalKey && input.tapMerkleRoot) {
@@ -284,6 +285,7 @@ exports.parsePsbtInput = parsePsbtInput;
284
285
  * unsigned(0), half-signed(1) or fully-signed(2)
285
286
  */
286
287
  function getStrictSignatureCount(input) {
288
+ var _a, _b;
287
289
  const calculateSignatureCount = (signatures) => {
288
290
  const count = signatures ? signatures.filter((s) => !parseInput_1.isPlaceholderSignature(s)).length : 0;
289
291
  if (count === 0 || count === 1 || count === 2) {
@@ -292,7 +294,7 @@ function getStrictSignatureCount(input) {
292
294
  throw new Error('invalid signature count');
293
295
  };
294
296
  if ('hash' in input) {
295
- if (input.script?.length || input.witness?.length) {
297
+ if (((_a = input.script) === null || _a === void 0 ? void 0 : _a.length) || ((_b = input.witness) === null || _b === void 0 ? void 0 : _b.length)) {
296
298
  const parsedInput = parseInput_1.parseSignatureScript(input);
297
299
  return parsedInput.scriptType === 'taprootKeyPathSpend' ? 2 : calculateSignatureCount(parsedInput.signatures);
298
300
  }
@@ -390,9 +392,10 @@ function extractP2msOnlyHalfSignedTx(psbt) {
390
392
  return ['p2sh', 'p2shP2wsh', 'p2wsh'].includes(parsed.scriptType);
391
393
  }
392
394
  psbt.data.inputs.forEach((input, i) => {
395
+ var _a, _b;
393
396
  const parsed = parsePsbtInput(input);
394
397
  assert(isP2msParsedPsbtInput(parsed), `unsupported script type ${parsed.scriptType}`);
395
- assert(input.partialSig?.length === 1, `unexpected signature count ${input.partialSig?.length}`);
398
+ assert(((_a = input.partialSig) === null || _a === void 0 ? void 0 : _a.length) === 1, `unexpected signature count ${(_b = input.partialSig) === null || _b === void 0 ? void 0 : _b.length}`);
396
399
  const [partialSig] = input.partialSig;
397
400
  assert(input.sighashType !== undefined && input.sighashType === bitcoinjs_lib_1.script.signature.decode(partialSig.signature).hashType, 'signature sighash does not match input sighash type');
398
401
  // type casting is to address the invalid type checking in payments.p2ms
@@ -402,10 +405,10 @@ function extractP2msOnlyHalfSignedTx(psbt) {
402
405
  const payment = index_1.payments.p2ms({ output: parsed.pubScript, signatures }, { validate: false, allowIncomplete: true });
403
406
  const p2wsh = isP2WSH ? index_1.payments.p2wsh({ redeem: payment }) : undefined;
404
407
  const p2sh = isP2SH ? index_1.payments.p2sh({ redeem: p2wsh || payment }) : undefined;
405
- if (p2sh?.input) {
408
+ if (p2sh === null || p2sh === void 0 ? void 0 : p2sh.input) {
406
409
  tx.setInputScript(i, p2sh.input);
407
410
  }
408
- if (p2wsh?.witness) {
411
+ if (p2wsh === null || p2wsh === void 0 ? void 0 : p2wsh.witness) {
409
412
  tx.setWitness(i, p2wsh.witness);
410
413
  }
411
414
  });
@@ -444,4 +447,4 @@ function deleteWitnessUtxoForNonSegwitInputs(psbt) {
444
447
  });
445
448
  }
446
449
  exports.deleteWitnessUtxoForNonSegwitInputs = deleteWitnessUtxoForNonSegwitInputs;
447
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUHNidC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iaXRnby93YWxsZXQvUHNidC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpQ0FBaUM7QUFHakMsZ0RBQXFEO0FBRXJELHVDQUF1QztBQUN2QywwQ0FBdUM7QUFDdkMsd0RBQXFEO0FBQ3JELG9EQUE2RztBQUM3Ryw2Q0FBaUU7QUFDakUsd0NBQW9EO0FBQ3BELGdEQUEyRDtBQUMzRCx1Q0FBMkQ7QUFFM0QsOENBY3VCO0FBQ3ZCLHNDQUF1RDtBQUN2RCxvQ0FBMkM7QUFDM0MsMkNBQTBEO0FBQzFELGlEQUEyRTtBQUMzRSx1Q0FBZ0Q7QUFDaEQsMENBQStFO0FBcUUvRSxTQUFTLGlCQUFpQixDQUFDLE1BQWMsRUFBRSxVQUE2QjtJQUN0RSxNQUFNLGdCQUFnQixHQUFHLCtCQUFrQixDQUFDLE1BQU0sRUFBRSx3QkFBd0IsQ0FBQyxDQUFDLFVBQVUsQ0FBQztJQUN6RixNQUFNLGFBQWEsR0FBRyxnQkFBZ0IsQ0FBQyxHQUFHLENBQUMsQ0FBQyxTQUFTLEVBQUUsRUFBRTtRQUN2RCxNQUFNLEtBQUssR0FBRyxVQUFVLENBQUMsVUF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gdHgub3V0c1t0eElucHV0c1tpXS5pbmRleF07XG4gICAgfVxuICAgIGRlbGV0ZSBuZXdQc2J0LmRhdGEuaW5wdXRzW2ldLm5vbldpdG5lc3NVdHhvO1xuICB9KTtcblxuICByZXR1cm4gbmV3UHNidDtcbn1cblxuLyoqXG4gKiBEZWxldGVzIHdpdG5lc3NVdHhvIGZvciBub24tc2Vnd2l0IGlucHV0cyB0byBtYWtlIHRoZSBQU0JUIEJJUC0xNzQgY29tcGxpYW50LlxuICovXG5leHBvcnQgZnVuY3Rpb24gZGVsZXRlV2l0bmVzc1V0eG9Gb3JOb25TZWd3aXRJbnB1dHMocHNidDogVXR4b1BzYnQpOiB2b2lkIHtcbiAgcHNidC5kYXRhLmlucHV0cy5mb3JFYWNoKChpbnB1dCwgaSkgPT4ge1xuICAgIGNvbnN0IHNjcmlwdFR5cGUgPSBnZXRQc2J0SW5wdXRTY3JpcHRUeXBlKGlucHV0KTtcbiAgICBpZiAoc2NyaXB0VHlwZSA9PT0gJ3Ayc2gnIHx8IHNjcmlwdFR5cGUgPT09ICdwMnNoUDJwaycpIHtcbiAgICAgIGRlbGV0ZSBpbnB1dC53aXRuZXNzVXR4bztcbiAgICB9XG4gIH0pO1xufVxuIl19
@@ -35,6 +35,7 @@ exports.signInputWithUnspent = signInputWithUnspent;
35
35
  * @return triple of booleans indicating a valid signature for each pubkey
36
36
  */
37
37
  function verifySignatureWithUnspent(tx, inputIndex, unspents, walletKeys) {
38
+ var _a, _b;
38
39
  if (tx.ins.length !== unspents.length) {
39
40
  throw new Error(`input length must match unspents length`);
40
41
  }
@@ -44,7 +45,7 @@ function verifySignatureWithUnspent(tx, inputIndex, unspents, walletKeys) {
44
45
  throw new Error(`no input at index ${inputIndex}`);
45
46
  }
46
47
  const unspent = unspents[inputIndex];
47
- if (!isWalletUnspent(unspent) || (!input.script?.length && !input.witness?.length)) {
48
+ if (!isWalletUnspent(unspent) || (!((_a = input.script) === null || _a === void 0 ? void 0 : _a.length) && !((_b = input.witness) === null || _b === void 0 ? void 0 : _b.length))) {
48
49
  return [false, false, false];
49
50
  }
50
51
  const parsedInput = parseInput_1.parseSignatureScript(input);
@@ -255,4 +256,4 @@ network = psbt.network) {
255
256
  updateWalletUnspentForPsbt(psbt, psbt.inputCount - 1, u, rootWalletKeys, signer, cosigner);
256
257
  }
257
258
  exports.addWalletUnspentToPsbt = addWalletUnspentToPsbt;
258
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVW5zcGVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iaXRnby93YWxsZXQvVW5zcGVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2QkFBc0Q7QUFFdEQsb0RBTzBCO0FBQzFCLDJDQUErQztBQUMvQyw0Q0FLc0I7QUFLdEIsd0NBUW9CO0FBQ3BCLHFDQUErQztBQUUvQyxzQ0FBeUQ7QUFDekQsZ0RBQTZEO0FBQzdELDhDQUFxRDtBQUNyRCxnREFBcUQ7QUFDckQsMENBQWlGO0FBYWpGLFNBQWdCLGVBQWUsQ0FBa0MsQ0FBbUI7SUFDbEYsT0FBUSxDQUE0QixDQUFDLEtBQUssS0FBSyxTQUFTLENBQUM7QUFDM0QsQ0FBQztBQUZELDBDQUVDO0FBRUQsU0FBZ0Isb0JBQW9CLENBQ2xDLFNBQTBDLEVBQzFDLFVBQWtCLEVBQ2xCLE9BQStCLEVBQy9CLGFBQWtEO0lBRWxELE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxHQUFHLGFBQWEsQ0FBQyxzQkFBc0IsQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUM1RyxNQUFNLFVBQVUsR0FBRyxrQ0FBa0IsQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFD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FmVmVyc2lvbiwgbGVhZkhhc2ggfSA9IGNyZWF0ZVNwZW5kU2NyaXB0UDJ0ckZuKHdhbGxldEtleXMucHVibGljS2V5cywgW1xuICAgICAgd2FsbGV0S2V5c1tzaWduZXJdLnB1YmxpY0tleSxcbiAgICAgIHdhbGxldEtleXNbY29zaWduZXJdLnB1YmxpY0tleSxcbiAgICBdKTtcbiAgICBpZiAoIWlucHV0LnRhcExlYWZTY3JpcHQpIHtcbiAgICAgIHBzYnQudXBkYXRlSW5wdXQoaW5wdXRJbmRleCwge1xuICAgICAgICB0YXBMZWFmU2NyaXB0OiBbeyBjb250cm9sQmxvY2ssIHNjcmlwdDogd2l0bmVzc1NjcmlwdCwgbGVhZlZlcnNpb24gfV0sXG4gICAgICB9KTtcbiAgICB9XG4gICAgaWYgKCFpbnB1dC50YXBCaXAzMkRlcml2YXRpb24pIHtcbiAgICAgIHBzYnQudXBkYXRlSW5wdXQoaW5wdXRJbmRleCwge1xuICAgICAgICB0YXBCaXAzMkRlcml2YXRpb246IFtzaWduZXIsIGNvc2lnbmVyXS5tYXAoKGtleSkgPT4gKHtcbiAgICAgICAgICBsZWFmSGFzaGVzOiBbbGVhZkhhc2hdLFxuICAgICAgICAgIHB1YmtleTogdG9YT25seVB1YmxpY0tleSh3YWxsZXRLZXlzW2tleV0ucHVibGljS2V5KSxcbiAgICAgICAgICBwYXRoOiByb290V2FsbGV0S2V5cy5nZXREZXJpdmF0aW9uUGF0aChyb290V2FsbGV0S2V5c1trZXldLCB1LmNoYWluLCB1LmluZGV4KSxcbiAgICAgICAgICBtYXN0ZXJGaW5nZXJwcmludDogcm9vdFdhbGxldEtleXNba2V5XS5maW5nZXJwcmludCxcbiAgICAgICAgfSkpLFxuICAgICAgfSk7XG4gICAgfVxuICB9IGVsc2UgaWYgKHNjcmlwdFR5cGUgPT09ICdwMnRyTXVzaWcyJykge1xuICAgIGNvbnN0IHtcbiAgICAgIGludGVybmFsUHVia2V5OiB0YXBJbnRlcm5hbEtle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ICB0YXBNZXJrbGVSb290OiB0YXB0cmVlUm9vdCxcbiAgICAgIH0pO1xuICAgIH1cblxuICAgIGlmICghaW5wdXQudGFwQmlwMzJEZXJpdmF0aW9uKSB7XG4gICAgICBwc2J0LnVwZGF0ZUlucHV0KGlucHV0SW5kZXgsIHtcbiAgICAgICAgdGFwQmlwMzJEZXJpdmF0aW9uOiBbc2lnbmVyLCBjb3NpZ25lcl0ubWFwKChrZXkpID0+ICh7XG4gICAgICAgICAgbGVhZkhhc2hlczogW10sXG4gICAgICAgICAgcHVia2V5OiB0b1hPbmx5UHVibGljS2V5KHdhbGxldEtleXNba2V5XS5wdWJsaWNLZXkpLFxuICAgICAgICAgIHBhdGg6IHJvb3RXYWxsZXRLZXlzLmdldERlcml2YXRpb25QYXRoKHJvb3RXYWxsZXRLZXlzW2tleV0sIHUuY2hhaW4sIHUuaW5kZXgpLFxuICAgICAgICAgIG1hc3RlckZpbmdlcnByaW50OiByb290V2FsbGV0S2V5c1trZXldLmZpbmdlcnByaW50LFxuICAgICAgICB9KSksXG4gICAgICB9KTtcbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgaWYgKCFpbnB1dC5iaXAzMkRlcml2YXRpb24pIHtcbiAgICAgIHBzYnQudXBkYXRlSW5wdXQoaW5wdXRJbmRleCwge1xuICAgICAgICBiaXAzMkRlcml2YXRpb246IFswLCAxLCAyXS5tYXAoKGlkeCkgPT4gKHtcbiAgICAgICAgICBwdWJrZXk6IHdhbGxldEtleXMudHJpcGxlW2lkeF0ucHVibGljS2V5LFxuICAgICAgICAgIHBhdGg6IHdhbGxldEtleXMucGF0aHNbaWR4XSxcbiAgICAgICAgICBtYXN0ZXJGaW5nZXJwcmludDogcm9vdFdhbGxldEtleXMudHJpcGxlW2lkeF0uZmluZ2VycHJpbnQsXG4gICAgICAgIH0pKSxcbiAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbnN0IHsgd2l0bmVzc1NjcmlwdCwgcmVkZWVtU2NyaXB0IH0gPSB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Y3JpcHQpIHtcbiAgICAgIHBzYnQudXBkYXRlSW5wdXQoaW5wdXRJbmRleCwge1xuICAgICAgICB0YXBMZWFmU2NyaXB0OiBbeyBjb250cm9sQmxvY2ssIHNjcmlwdDogd2l0bmVzc1NjcmlwdCwgbGVhZlZlcnNpb24gfV0sXG4gICAgICB9KTtcbiAgICB9XG4gICAgaWYgKCFpbnB1dC50YXBCaXAzMkRlcml2YXRpb24pIHtcbiAgICAgIHBzYnQudXBkYXRlSW5wdXQoaW5wdXRJbmRleCwge1xuICAgICAgICB0YXBCaXAzMkRlcml2YXRpb246IFtzaWduZXIsIGNvc2lnbmVyXS5tYXAoKGtleSkgPT4gKHtcbiAgICAgICAgICBsZWFmSGFzaGVzOiBbbGVhZkhhc2hdLFxuICAgICAgICAgIHB1YmtleTogdG9YT25seVB1YmxpY0tleSh3YWxsZXRLZXlzW2tleV0ucHVibGljS2V5KSxcbiAgICAgICAgICBwYXRoOiByb290V2FsbGV0S2V5cy5nZXREZXJpdmF0aW9uUGF0aChyb290V2FsbGV0S2V5c1trZXldLCB1LmNoYWluLCB1LmluZGV4KSxcbiAgICAgICAgICBtYXN0ZXJGaW5nZXJwcmludDogcm9vdFdhbGxldEtleXNba2V5XS5maW5nZXJwcmludCxcbiAgICAgICAgfSkpLFxuICAgICAgfSk7XG4gICAgfVxuICB9IGVsc2UgaWYgKHNjcmlwdFR5cGUgPT09ICdwMnRyTXVzaWcyJykge1xuICAgIGNvbnN0IHtcbiAgICAgIGludGVybmFsUHVia2V5OiB0YXBJbnRlcm5hbEtleSxcbiAgICAgIG91dHB1dFB1YmtleTogdGFwT3V0cHV0S2V5LFxuICAgICAgdGFwdHJlZVJvb3QsXG4gICAgfSA9IGNyZWF0ZUtleVBhdGhQMnRyTXVzaWcyKHdhbGxldEtleXMucHVibGljS2V5cyk7XG5cbiAgICBpZiAoXG4gICAgICBwc2J0LmdldFByb3ByaWV0YXJ5S2V5VmFscyhpbnB1dEluZGV4LCB7XG4gICAgICAgI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iAocmVkZWVtU2NyaXB0ICYmICFpbnB1dC5yZWRlZW1TY3JpcHQpIHtcbiAgICAgIHBzYnQudXBkYXRlSW5wdXQoaW5wdXRJbmRleCwgeyByZWRlZW1TY3JpcHQgfSk7XG4gICAgfVxuICB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBhZGRXYWxsZXRVbnNwZW50VG9Qc2J0KFxuICBwc2J0OiBVdHhvUHNidCxcbiAgdTogV2FsbGV0VW5zcGVudDxiaWdpbnQ+LFxuICByb290V2FsbGV0S2V5czogUm9vdFdhbGxldEtleXMsXG4gIHNpZ25lcjogS2V5TmFtZSxcbiAgY29zaWduZXI6IEtleU5hbWUsXG4gIC8qKlxuICAgKiBAZGVwcmVjYXRlZFxuICAgKi9cbiAgbmV0d29yazogTmV0d29yayA9IHBzYnQubmV0d29ya1xuKTogdm9pZCB7XG4gIGlmIChwc2J0Lm5ldHdvcmsgIT09IG5ldHdvcmspIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoJ3BzYnQgbmV0d29yayBkb2VzIG5vdCBtYXRjaCBuZXR3b3JrJyk7XG4gIH1cbiAgYWRkVW5zcGVudFRvUHNidChwc2J0LCB1LmlkKTtcbiAgdXBkYXRlV2FsbGV0VW5zcGVudEZvclBzYnQocHNidCwgcHNidC5pbnB1dENvdW50IC0gMSwgdSwgcm9vdFdhbGxldEtleXMsIHNpZ25lciwgY29zaWduZXIpO1xufVxuIl19
@@ -18,7 +18,7 @@ export declare const chainCodesP2shP2wsh: readonly [10, 11];
18
18
  export declare const chainCodesP2wsh: readonly [20, 21];
19
19
  export declare const chainCodesP2tr: readonly [30, 31];
20
20
  export declare const chainCodesP2trMusig2: readonly [40, 41];
21
- export declare const chainCodes: (0 | 30 | 1 | 31 | 10 | 11 | 20 | 21 | 40 | 41)[];
21
+ export declare const chainCodes: (0 | 1 | 10 | 11 | 20 | 21 | 30 | 31 | 40 | 41)[];
22
22
  export declare type ChainCode = (typeof chainCodes)[number];
23
23
  export declare function isChainCode(n: unknown): n is ChainCode;
24
24
  /**
@@ -30,10 +30,11 @@ class ZcashPsbt extends UtxoPsbt_1.UtxoPsbt {
30
30
  * @param opts options
31
31
  */
32
32
  static fromBuffer(buffer, opts) {
33
+ var _a;
33
34
  const psbt = super.fromBuffer(buffer, opts);
34
35
  // Read `consensusBranchId` from the global-map
35
36
  let consensusBranchId = undefined;
36
- psbt.data.globalMap.unknownKeyVals?.forEach(({ key, value }, i) => {
37
+ (_a = psbt.data.globalMap.unknownKeyVals) === null || _a === void 0 ? void 0 : _a.forEach(({ key, value }, i) => {
37
38
  if (key.equals(CONSENSUS_BRANCH_ID_KEY)) {
38
39
  consensusBranchId = value.readUint32LE();
39
40
  }
@@ -134,4 +135,4 @@ class ZcashPsbt extends UtxoPsbt_1.UtxoPsbt {
134
135
  }
135
136
  }
136
137
  exports.ZcashPsbt = ZcashPsbt;
137
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiWmNhc2hQc2J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JpdGdvL3pjYXNoL1pjYXNoUHNidC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQ0FBaUQ7QUFDakQseURBSTRCO0FBQzVCLDhCQUEwRDtBQUMxRCxtQ0FBMEM7QUFDMUMsaURBQWlEO0FBRWpELDBDQUFzRztBQUN0RyxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFFdkMsTUFBTSx1QkFBdUIsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDO0lBQzVDLE1BQU0sQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDO0lBQ2YsTUFBTSxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUM7SUFDZixNQUFNLENBQUMsSUFBSSxDQUFDLHNDQUEyQixDQUFDO0lBQ3hDLE1BQU0sQ0FBQ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