UNPKG

@data-structure-algebra/doubly-linked-list

Version:
1 lines 26.6 kB
{"version":3,"file":"index.cjs","sources":["../src/Node.js","../src/_concat.js","../src/_erase.js","../src/_push.js","../src/_extend.js","../src/_insertBetween.js","../src/_iter.js","../src/_iter_fast.js","../src/_last.js","../src/_len.js","../src/_pop.js","../src/_split.js","../src/_rotate_to.js","../src/_rotate_left.js","../src/_rotate_left_modulo.js","../src/_rotate_left_unknown_length.js","../src/_rotate_right.js","../src/_rotate_right_modulo.js","../src/_rotate_right_unknown_length.js","../src/_shift.js","../src/_unshift.js","../src/iter.js","../src/rotate_right.js","../src/rotate_left.js","../src/values.js","../src/_insertAfter.js","../src/_insertBefore.js","../src/_remove.js","../src/concat.js","../src/empty.js","../src/from.js","../src/last.js","../src/len.js","../src/pop.js","../src/push.js","../src/shift.js","../src/split.js","../src/unshift.js"],"sourcesContent":["/**\n * Base node class.\n *\n * @class\n * @param {any} value The value to hold.\n * @param {Node|null} prev The value to hold.\n * @param {Node|null} next The value to hold.\n */\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport default function Node(value, prev, next) {\n\t/** @member {any} The value/key held by this node. */\n\tthis.value = value;\n\t/** @member {Node|null} Pointer to previous (left) sibling */\n\tthis.prev = prev;\n\t/** @member {Node|null} Pointer to next (right) sibling */\n\tthis.next = next;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Concatenate two input lists.\n *\n * @param {Node} z Last node of first input list.\n * @param {Node} y First node of second input list.\n */\nexport default function _concat(z, y) {\n\tassert(z instanceof Node);\n\tassert(y instanceof Node);\n\tz.next = y;\n\ty.prev = z;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _concat from './_concat.js';\n\n/**\n * Erase range [x, y) from list. Range cannot be empty.\n *\n * @param {Node} x Inclusive beginning of range to erase.\n * @param {Node} y Exclusive end of range to erase.\n */\nexport default function _erase(x, y) {\n\tassert(x instanceof Node);\n\t_concat(x.prev, y);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Push value to list.\n *\n * @param {Node} z Last node of first input list (can be null).\n * @param {any} value Value to push.\n * @return {Node} The node at the front of the list (new node if empty, input\n * node otherwise).\n */\nexport default function _push(z, value) {\n\tassert(z instanceof Node);\n\tassert(z.next === null);\n\tconst y = new Node(value, z, null);\n\tz.next = y;\n\treturn y;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _push from './_push.js';\n\n/**\n * Extend a list with an iterable.\n *\n * @param {Node} z The last node of the list to extend.\n * @param {Iterable} iterable The input iterable.\n * @return {Node} Last node of the extended list.\n */\nexport default function _extend(z, iterable) {\n\tassert(z instanceof Node);\n\tlet y = z;\n\n\tfor (const value of iterable) {\n\t\ty = _push(y, value);\n\t}\n\n\treturn y;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * _insertBetween.\n *\n * @param {Node} x\n * @param {Node} y\n * @param {any} value\n */\nexport default function _insertBetween(x, y, value) {\n\tassert(x instanceof Node);\n\tassert(y instanceof Node);\n\tconst z = new Node(value, x, y);\n\tx.next = z;\n\ty.prev = z;\n\treturn z;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Generator of nodes in list in order. You are allowed to edit the current\n * node.\n *\n * /!\\ Modifying the next pointer of the current node will NOT change which\n * node comes next in the iteration.\n *\n * @param {Node} first First node of the list.\n * @return {IterableIterator<Node>} Yields nodes of a list in order.\n */\nexport default function* _iter(first) {\n\tassert(first instanceof Node);\n\tlet next = first;\n\n\tdo {\n\t\tconst x = next;\n\t\tnext = x.next; // Compute next before yielding.\n\t\tyield x; // Necessary ?\n\t} while (next !== null);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Generator of nodes in list in order. The list cannot be empty. You should\n * not modify the current node's next pointer unless you know what you are\n * doing.\n *\n * /!\\ Modifying the next pointer of the current node will change which node\n * comes next in the iteration.\n *\n * @param {Node} first First node of the list.\n * @return {IterableIterator<Node>} Yields nodes of a list in order.\n */\nexport default function* _iter_fast(first) {\n\tassert(first instanceof Node);\n\tlet next = first;\n\n\tdo {\n\t\tyield next;\n\t\tnext = next.next;\n\t} while (next !== null);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Returns the last node of a list. The list cannot be empty.\n *\n * @param {Node} first First node of the list.\n * @return {Node} Last node of the list.\n */\nexport default function _last(first) {\n\tassert(first instanceof Node);\n\tlet next = first;\n\n\twhile (next.next !== null) {\n\t\tnext = next.next;\n\t}\n\n\treturn next;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Compute the length of a non-empty list.\n *\n * @param {Node} x First node of the input list.\n * @return {number} The length of the input list.\n */\n// eslint-disable-next-line unicorn/prevent-abbreviations\nexport default function _len(x) {\n\tassert(x instanceof Node);\n\tlet n = 1;\n\tlet y = x.next;\n\twhile (y !== null) {\n\t\t++n;\n\t\ty = y.next;\n\t}\n\n\treturn n;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Removes last {@link Node} from a non-empty list.\n *\n * @param {Node} x Last node (not null). Cannot be the first node.\n * @return {Node} Last node of new list (not null).\n */\nexport default function _pop(x) {\n\tassert(x instanceof Node);\n\tassert(x.next === null);\n\tconst prev = x.prev; // eslint-disable-line unicorn/prevent-abbreviations\n\tassert(prev !== null);\n\tprev.next = null;\n\treturn prev;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Split a list at {@link Node} x.\n *\n * /!\\ The node to split at cannot be the first of the list.\n *\n * @param {Node} x Node to split at.\n */\nexport default function _split(x) {\n\tassert(x instanceof Node);\n\tassert(x.prev instanceof Node);\n\tx.prev.next = null;\n\tx.prev = null;\n}\n","import _split from './_split.js';\nimport _concat from './_concat.js';\n\nexport default function _rotate_to(x, y, z) {\n\t_split(y);\n\t_concat(z, x);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _rotate_to from './_rotate_to.js';\n\n/**\n * Rotate list to the left k steps. The parameter k must be positive and\n * smaller than the length of the list.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} k MUST be positive and smaller than the length of the list.\n * @return {[Node, Node]} The new first and last nodes.\n */\nexport default function _rotate_left(x, z, k) {\n\tassert(Number.isInteger(k));\n\tassert(k > 0);\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tassert(z instanceof Node);\n\tassert(z.next === null);\n\tassert(x !== z);\n\tlet y = z;\n\twhile (--k) {\n\t\ty = y.prev;\n\t\tassert(y instanceof Node);\n\t}\n\n\tconst w = y.prev;\n\t_rotate_to(x, y, z);\n\treturn [y, w];\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _rotate_left from './_rotate_left.js';\n\n/**\n * Rotate non-empty list to the left n steps. The parameter n must be positive.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} n List length, MUST be positive.\n * @param {number} k MUST be positive.\n * @return {[Node, Node]} The new first and last nodes.\n */\nexport default function _rotate_left_modulo(x, z, n, k) {\n\tassert(Number.isInteger(n));\n\tassert(n > 0);\n\tassert(Number.isInteger(k));\n\tassert(k > 0);\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tassert(z instanceof Node);\n\tassert(z.next === null);\n\tassert(x !== z);\n\tconst m = k % n;\n\treturn m === 0 ? [x, z] : _rotate_left(x, z, m);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _rotate_to from './_rotate_to.js';\nimport _rotate_left_modulo from './_rotate_left_modulo.js';\n\n/**\n * Rotate list to the right n steps. The parameter n must be positive.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} k MUST be positive.\n * @return {[Node, Node]} The new first and last nodes.\n */\nexport default function _rotate_left_unknown_length(x, z, k) {\n\tassert(Number.isInteger(k));\n\tassert(k > 0);\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tassert(z instanceof Node);\n\tassert(z.next === null);\n\tassert(x !== z);\n\tlet y = z;\n\tlet l = k;\n\twhile (--l) {\n\t\tif (y === x) {\n\t\t\treturn _rotate_left_modulo(x, z, k - l, k);\n\t\t}\n\n\t\ty = y.prev;\n\t}\n\n\tconst w = y.prev;\n\t_rotate_to(x, y, z);\n\treturn [y, w];\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _rotate_to from './_rotate_to.js';\n\n/**\n * Rotate list to the right k steps. The parameter k must be positive and\n * smaller than the length of the list.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} k MUST be positive and smaller than the length of the list.\n * @return {[Node, Node]} The new first and last nodes.\n */\nexport default function _rotate_right(x, z, k) {\n\tassert(Number.isInteger(k));\n\tassert(k > 0);\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tassert(z instanceof Node);\n\tassert(z.next === null);\n\tassert(x !== z);\n\tlet y = x;\n\tdo {\n\t\ty = y.next;\n\t\tassert(y instanceof Node);\n\t} while (--k);\n\n\tconst w = y.prev;\n\t_rotate_to(x, y, z);\n\treturn [y, w];\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _rotate_right from './_rotate_right.js';\n\n/**\n * Rotate non-empty list to the right n steps. The parameter n must be positive.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} n List length, MUST be positive.\n * @param {number} k MUST be positive.\n * @return {[Node, Node]} The new first and last nodes.\n */\nexport default function _rotate_right_modulo(x, z, n, k) {\n\tassert(Number.isInteger(n));\n\tassert(n > 0);\n\tassert(Number.isInteger(k));\n\tassert(k > 0);\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tassert(z instanceof Node);\n\tassert(z.next === null);\n\tassert(x !== z);\n\tconst m = k % n;\n\treturn m === 0 ? [x, z] : _rotate_right(x, z, m);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _rotate_to from './_rotate_to.js';\nimport _rotate_right_modulo from './_rotate_right_modulo.js';\n\n/**\n * Rotate list to the right n steps. The parameter n must be positive.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} k MUST be positive.\n * @return {[Node, Node]} The new first and last nodes.\n */\nexport default function _rotate_right_unknown_length(x, z, k) {\n\tassert(Number.isInteger(k));\n\tassert(k > 0);\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tassert(z instanceof Node);\n\tassert(z.next === null);\n\tassert(x !== z);\n\tlet y = x;\n\tlet l = k;\n\tdo {\n\t\tif (y === z) {\n\t\t\treturn _rotate_right_modulo(x, z, k - l + 1, k);\n\t\t}\n\n\t\ty = y.next;\n\t} while (--l);\n\n\tconst w = y.prev;\n\t_rotate_to(x, y, z);\n\treturn [y, w];\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Removes first {@link Node} from a non-empty list.\n *\n * @param {Node} x First node (not null). Cannot be the last node.\n * @return {Node} New list (not null).\n */\nexport default function _shift(x) {\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tconst next = x.next;\n\tassert(next !== null);\n\tnext.prev = null;\n\treturn next;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\n\n/**\n * Unshift value to list.\n *\n * @param {Node} x First node of first input list (can be null).\n * @param {any} value Value to unshift.\n * @return {Node} The node at the front of the list (hence, the new node).\n */\nexport default function _unshift(x, value) {\n\tassert(x instanceof Node);\n\tassert(x.prev === null);\n\tconst y = new Node(value, null, x);\n\tx.prev = y;\n\treturn y;\n}\n","import assert from 'assert';\nimport _iter from './_iter.js';\nimport Node from './Node.js';\n\n/**\n * Generator of nodes in list in order.\n *\n * @param {Node} first First node of the list (can be null).\n * @return {IterableIterator<Node>}\n */\nexport default function* iter(first) {\n\tassert(first === null || first instanceof Node);\n\tif (first !== null) yield* _iter(first);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _rotate_left_unknown_length from './_rotate_left_unknown_length.js';\nimport _rotate_right_unknown_length from './_rotate_right_unknown_length.js';\n\n/**\n * Do nothing if x is empty or n is zero.\n * Rotate right n steps if n is positive.\n * Rotate left n steps if n is negative.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} n\n * @return {[Node, Node]} The new first and last node.\n */\nexport default function rotate_right(x, z, n) {\n\tassert(Number.isInteger(n));\n\tif (x === z) {\n\t\t// NOTE This takes care of x === null => z === null.\n\t\treturn [x, z];\n\t}\n\n\tassert(x instanceof Node);\n\tassert(z instanceof Node);\n\treturn n === 0\n\t\t? [x, z]\n\t\t: n > 0\n\t\t? _rotate_right_unknown_length(x, z, n)\n\t\t: _rotate_left_unknown_length(x, z, -n);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport rotate_right from './rotate_right.js';\n\n/**\n * Do nothing if x is empty or n is zero.\n * Rotate left n steps if n is positive.\n * Rotate right n steps if n is negative.\n *\n * @param {Node} x The current first node.\n * @param {Node} z The current last node.\n * @param {number} n\n * @return {[Node, Node]} The new first and last node.\n */\nconst rotate_left = (x, z, n) => {\n\tassert(Number.isInteger(n));\n\tassert(x === null || x instanceof Node);\n\tassert(z === null || z instanceof Node);\n\treturn rotate_right(x, z, -n);\n};\n\nexport default rotate_left;\n","import assert from 'assert';\nimport _iter_fast from './_iter_fast.js';\nimport Node from './Node.js';\n\n/**\n * Generator of nodes in list in order.\n *\n * @param {Node} first First node of the list (can be null).\n * @return {IterableIterator<any>}\n */\nexport default function* values(first) {\n\tassert(first === null || first instanceof Node);\n\tif (first !== null) {\n\t\tfor (const x of _iter_fast(first)) yield x.value;\n\t}\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _insertBetween from './_insertBetween.js';\n\n/**\n * _insertAfter.\n *\n * @param {Node} x\n * @param {any} value\n */\nexport default function _insertAfter(x, value) {\n\tassert(x instanceof Node);\n\treturn _insertBetween(x, x.next, value);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _insertBetween from './_insertBetween.js';\n\n/**\n * _insertBefore.\n *\n * @param {Node} x\n * @param {any} value\n */\nexport default function _insertBefore(x, value) {\n\tassert(x instanceof Node);\n\treturn _insertBetween(x.prev, x, value);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _erase from './_erase.js';\n\n/**\n * Removes input {@link Node} from its list. Cannot be first or last, use\n * _shift or _pop instead.\n *\n * /!\\ Pointers in the extracted node are left unchanged.\n * /!\\ <code>x</code> will have dangling pointers after removal if not single element.\n *\n * @param {Node} x Node to remove.\n */\nexport default function _remove(x) {\n\tassert(x instanceof Node);\n\t_erase(x, x.next);\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _concat from './_concat.js';\n\n/**\n * Concatenate two input lists.\n *\n * @param {Node} x First node of first input list (can be null).\n * @param {Node} z Last node of first input list (can be null).\n * @param {Node} y First node of second input list (can be null).\n * @return {Node} First node of the output list (or null if empty).\n */\nexport default function concat(x, z, y) {\n\tif (x === null) {\n\t\tassert(z === null);\n\t\treturn y;\n\t}\n\n\tassert(x instanceof Node);\n\tassert(z instanceof Node);\n\tif (y === null) return x;\n\tassert(y instanceof Node);\n\t_concat(z, y);\n\treturn x;\n}\n","/**\n * Return an empty list.\n *\n * @return {Node} The empty list.\n */\nexport default function empty() {\n\treturn null;\n}\n","import Node from './Node.js';\nimport _extend from './_extend.js';\n\n/**\n * Creates a list from an input iterable.\n *\n * @param {Iterable} iterable The input iterable.\n * @return {Node} First node of the newly created list (or null if empty list).\n */\nexport default function from(iterable) {\n\tconst it = iterable[Symbol.iterator]();\n\tconst event = it.next();\n\n\tif (event.done) return null;\n\n\tconst first = new Node(event.value, null, null);\n\t_extend(first, it);\n\treturn first;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _last from './_last.js';\n\n/**\n * Returns the last node of a list.\n *\n * @param {Node} first First node of the list.\n * @return {Node} Last node of the list.\n */\nexport default function last(first) {\n\tassert(first === null || first instanceof Node);\n\treturn first === null ? null : _last(first);\n}\n","import assert from 'assert';\nimport _len from './_len.js';\nimport Node from './Node.js';\n\n/**\n * Compute the length of a list (can be empty).\n *\n * @param {Node} x First node of the input list (can be null).\n * @return {number} The length of the input list.\n */\n// eslint-disable-next-line unicorn/prevent-abbreviations\nconst len = (x) => {\n\tassert(x === null || x instanceof Node);\n\treturn x === null ? 0 : _len(x);\n};\n\nexport default len;\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _pop from './_pop.js';\n\n/**\n * Removes last {@link Node} from a list. Throws if input list is empty.\n *\n * @param {Node} x Last node.\n * @return {[Node, Node]} Last node of new list (possibly null) and removed node.\n */\nexport default function pop(x) {\n\tif (x === null) throw new Error('input list is empty');\n\tassert(x instanceof Node);\n\treturn [x.prev === null ? null : _pop(x), x];\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _push from './_push.js';\n\n/**\n * Push value to list.\n *\n * @param {Node} x First node of first input list (can be null).\n * @param {Node} z Last node of first input list (can be null).\n * @param {any} value Value to push.\n * @return {Node} The node at the front of the list (new node if empty, input\n * node otherwise).\n */\nexport default function push(x, z, value) {\n\tif (x === null) return new Node(value, null, null);\n\tassert(x instanceof Node);\n\t_push(z, value);\n\treturn x;\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _shift from './_shift.js';\n\n/**\n * Removes first {@link Node} from a list. Throws if input list is empty.\n *\n * @param {Node} x First node .\n * @return {[Node, Node]} New list (possibly null) and removed node.\n */\nexport default function shift(x) {\n\tif (x === null) throw new Error('input list is empty');\n\tassert(x instanceof Node);\n\treturn [x.next === null ? null : _shift(x), x];\n}\n","import assert from 'assert';\nimport Node from './Node.js';\nimport _split from './_split.js';\n\n/**\n * Split a list at a {@link Node}.\n *\n * @param {Node} x First node of the list.\n * @param {Node} z Node to split at.\n */\nexport default function split(x, z) {\n\tif (x === z) {\n\t\treturn [null, x];\n\t}\n\n\tassert(x instanceof Node);\n\tif (z === null) {\n\t\treturn [x, null];\n\t}\n\n\tassert(z instanceof Node);\n\t_split(z);\n\treturn [x, z];\n}\n","import Node from './Node.js';\nimport _unshift from './_unshift.js';\n\n/**\n * Unshift value to list.\n *\n * @param {Node} x First node of first input list (can be null).\n * @param {any} value Value to unshift.\n * @return {Node} The node at the front of the list (hence, the new node).\n */\nexport default function unshift(x, value) {\n\tif (x === null) return new Node(value, null, null);\n\treturn _unshift(x, value);\n}\n"],"names":["Node","value","prev","next","this","_concat","z","y","_erase","x","_push","iterable","_iterator","s","_step","n","done","err","e","f","_iter","first","_context","stop","_marked","_iter_fast","_regeneratorRuntime","wrap","_last","_len","_pop","_split","_rotate_to","_rotate_left","k","w","_rotate_left_modulo","m","_rotate_left_unknown_length","l","_rotate_right","_rotate_right_modulo","_rotate_right_unknown_length","_shift","_unshift","iter","rotate_right","values","_createForOfIteratorHelper","t0","finish","_insertAfter","_insertBetween","_insertBefore","empty","from","it","Symbol","iterator","event","_extend","Error","split"],"mappings":"AASe,SAAaA,EAACC,EAAOC,EAAMC,GAEzCC,KAAKH,MAAQA,EAEbG,KAAKF,KAAOA,EAEZE,KAAKD,KAAOA,CACb,CCPwBE,SAAAA,EAAQC,EAAGC,GAGlCD,EAAEH,KAAOI,EACTA,EAAEL,KAAOI,CACV,CCJwBE,SAAAA,EAAOC,EAAGF,GAEjCF,EAAQI,EAAEP,KAAMK,EACjB,y7OCFwBG,SAAAA,EAAMJ,EAAGL,GAGhC,MAAOM,EAAG,IAAIP,EAAKC,EAAOK,EAAG,MAE7B,OADAA,EAAEH,KAAOI,EAEVA,CAAA,CCNe,WAAiBD,EAAGK,GAElC,IAAIJ,EAAID,EAAE,MAEUK,EAAAA,EAAAA,OAApB,IAA8BC,EAAAC,MAAAC,EAAAF,EAAAG,KAAAC,MAC7BT,EAAIG,EAAMH,EAAVA,EAAAA,MACA,CAAA,MAAAU,GAAAL,EAAAM,EAAAD,EAAA,CAAA,QAAAL,EAAAO,GAAA,CAED,OACDZ,CAAA,CCVe,WAAwBE,EAAGF,EAAGN,GAG5C,MAAMK,EAAI,IAAIN,EAAKC,EAAOQ,EAAGF,GAG7B,OAFAE,EAAEN,KAAOG,EACTC,EAAEL,KAAOI,EAEVA,CAAA,CCJyBc,IAAAA,eAAAA,IAAAA,KAAAA,GAAAA,SAAAA,EAAMC,GAE1BlB,IAAAA,EA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