1 line
36 KiB
Plaintext
1 line
36 KiB
Plaintext
{"version":3,"file":"GraphicsGeometry.mjs","sources":["../src/GraphicsGeometry.ts"],"sourcesContent":["import {\n BaseTexture,\n BatchDrawCall,\n BatchGeometry,\n BatchTextureArray,\n Color,\n DRAW_MODES,\n Point,\n WRAP_MODES\n} from '@pixi/core';\nimport { Bounds } from '@pixi/display';\nimport { GraphicsData } from './GraphicsData';\nimport {\n BATCH_POOL, BatchPart, buildLine,\n buildPoly,\n DRAW_CALL_POOL,\n FILL_COMMANDS\n} from './utils';\n\nimport type { IPointData, IShape, Matrix, Texture } from '@pixi/core';\nimport type { FillStyle } from './styles/FillStyle';\nimport type { LineStyle } from './styles/LineStyle';\n\nconst tmpPoint = new Point();\n\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive\n * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.\n * @memberof PIXI\n */\nexport class GraphicsGeometry extends BatchGeometry\n{\n /** The maximum number of points to consider an object \"batchable\", able to be batched by the renderer's batch system. */\n public static BATCHABLE_SIZE = 100;\n\n /** Minimal distance between points that are considered different. Affects line tesselation. */\n public closePointEps = 1e-4;\n\n /** Padding to add to the bounds. */\n public boundsPadding = 0;\n\n uvsFloat32: Float32Array = null;\n indicesUint16: Uint16Array | Uint32Array = null;\n batchable = false;\n\n /** An array of points to draw, 2 numbers per point */\n points: number[] = [];\n\n /** The collection of colors */\n colors: number[] = [];\n\n /** The UVs collection */\n uvs: number[] = [];\n\n /** The indices of the vertices */\n indices: number[] = [];\n\n /** Reference to the texture IDs. */\n textureIds: number[] = [];\n\n /**\n * The collection of drawn shapes.\n * @member {PIXI.GraphicsData[]}\n */\n graphicsData: Array<GraphicsData> = [];\n\n /**\n * List of current draw calls drived from the batches.\n * @member {PIXI.BatchDrawCall[]}\n */\n drawCalls: Array<BatchDrawCall> = [];\n\n /** Batches need to regenerated if the geometry is updated. */\n batchDirty = -1;\n\n /**\n * Intermediate abstract format sent to batch system.\n * Can be converted to drawCalls or to batchable objects.\n * @member {PIXI.graphicsUtils.BatchPart[]}\n */\n batches: Array<BatchPart> = [];\n\n /** Used to detect if the graphics object has changed. */\n protected dirty = 0;\n\n /** Used to check if the cache is dirty. */\n protected cacheDirty = -1;\n\n /** Used to detect if we cleared the graphicsData. */\n protected clearDirty = 0;\n\n /** Index of the last batched shape in the stack of calls. */\n protected shapeIndex = 0;\n\n /** Cached bounds. */\n protected _bounds: Bounds = new Bounds();\n\n /** The bounds dirty flag. */\n protected boundsDirty = -1;\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor()\n {\n super();\n }\n\n /**\n * Get the current bounds of the graphic geometry.\n *\n * Since 6.5.0, bounds of the graphics geometry are calculated based on the vertices of generated geometry.\n * Since shapes or strokes with full transparency (`alpha: 0`) will not generate geometry, they are not considered\n * when calculating bounds for the graphics geometry. See PR [#8343]{@link https://github.com/pixijs/pixijs/pull/8343}\n * and issue [#8623]{@link https://github.com/pixijs/pixijs/pull/8623}.\n * @readonly\n */\n public get bounds(): Bounds\n {\n this.updateBatches();\n\n if (this.boundsDirty !== this.dirty)\n {\n this.boundsDirty = this.dirty;\n this.calculateBounds();\n }\n\n return this._bounds;\n }\n\n /** Call if you changed graphicsData manually. Empties all batch buffers. */\n protected invalidate(): void\n {\n this.boundsDirty = -1;\n this.dirty++;\n this.batchDirty++;\n this.shapeIndex = 0;\n\n this.points.length = 0;\n this.colors.length = 0;\n this.uvs.length = 0;\n this.indices.length = 0;\n this.textureIds.length = 0;\n\n for (let i = 0; i < this.drawCalls.length; i++)\n {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n\n this.drawCalls.length = 0;\n\n for (let i = 0; i < this.batches.length; i++)\n {\n const batchPart = this.batches[i];\n\n batchPart.reset();\n BATCH_POOL.push(batchPart);\n }\n\n this.batches.length = 0;\n }\n\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n * @returns - This GraphicsGeometry object. Good for chaining method calls\n */\n public clear(): GraphicsGeometry\n {\n if (this.graphicsData.length > 0)\n {\n this.invalidate();\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n\n return this;\n }\n\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param fillStyle - Defines style of the fill.\n * @param lineStyle - Defines style of the lines.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n public drawShape(\n shape: IShape,\n fillStyle: FillStyle = null,\n lineStyle: LineStyle = null,\n matrix: Matrix = null): GraphicsGeometry\n {\n const data = new GraphicsData(shape, fillStyle, lineStyle, matrix);\n\n this.graphicsData.push(data);\n this.dirty++;\n\n return this;\n }\n\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n public drawHole(shape: IShape, matrix: Matrix = null): GraphicsGeometry\n {\n if (!this.graphicsData.length)\n {\n return null;\n }\n\n const data = new GraphicsData(shape, null, null, matrix);\n\n const lastShape = this.graphicsData[this.graphicsData.length - 1];\n\n data.lineStyle = lastShape.lineStyle;\n\n lastShape.holes.push(data);\n\n this.dirty++;\n\n return this;\n }\n\n /** Destroys the GraphicsGeometry object. */\n public destroy(): void\n {\n super.destroy();\n\n // destroy each of the GraphicsData objects\n for (let i = 0; i < this.graphicsData.length; ++i)\n {\n this.graphicsData[i].destroy();\n }\n\n this.points.length = 0;\n this.points = null;\n this.colors.length = 0;\n this.colors = null;\n this.uvs.length = 0;\n this.uvs = null;\n this.indices.length = 0;\n this.indices = null;\n this.indexBuffer.destroy();\n this.indexBuffer = null;\n this.graphicsData.length = 0;\n this.graphicsData = null;\n this.drawCalls.length = 0;\n this.drawCalls = null;\n this.batches.length = 0;\n this.batches = null;\n this._bounds = null;\n }\n\n /**\n * Check to see if a point is contained within this geometry.\n * @param point - Point to check if it's contained.\n * @returns {boolean} `true` if the point is contained within geometry.\n */\n public containsPoint(point: IPointData): boolean\n {\n const graphicsData = this.graphicsData;\n\n for (let i = 0; i < graphicsData.length; ++i)\n {\n const data = graphicsData[i];\n\n if (!data.fillStyle.visible)\n {\n continue;\n }\n\n // only deal with fills..\n if (data.shape)\n {\n if (data.matrix)\n {\n data.matrix.applyInverse(point, tmpPoint);\n }\n else\n {\n tmpPoint.copyFrom(point);\n }\n\n if (data.shape.contains(tmpPoint.x, tmpPoint.y))\n {\n let hitHole = false;\n\n if (data.holes)\n {\n for (let i = 0; i < data.holes.length; i++)\n {\n const hole = data.holes[i];\n\n if (hole.shape.contains(tmpPoint.x, tmpPoint.y))\n {\n hitHole = true;\n break;\n }\n }\n }\n\n if (!hitHole)\n {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Generates intermediate batch data. Either gets converted to drawCalls\n * or used to convert to batch objects directly by the Graphics object.\n */\n updateBatches(): void\n {\n if (!this.graphicsData.length)\n {\n this.batchable = true;\n\n return;\n }\n\n if (!this.validateBatching())\n {\n return;\n }\n\n this.cacheDirty = this.dirty;\n\n const uvs = this.uvs;\n const graphicsData = this.graphicsData;\n\n let batchPart: BatchPart = null;\n\n let currentStyle = null;\n\n if (this.batches.length > 0)\n {\n batchPart = this.batches[this.batches.length - 1];\n currentStyle = batchPart.style;\n }\n\n for (let i = this.shapeIndex; i < graphicsData.length; i++)\n {\n this.shapeIndex++;\n\n const data = graphicsData[i];\n const fillStyle = data.fillStyle;\n const lineStyle = data.lineStyle;\n const command = FILL_COMMANDS[data.type];\n\n // build out the shapes points..\n command.build(data);\n\n if (data.matrix)\n {\n this.transformPoints(data.points, data.matrix);\n }\n\n if (fillStyle.visible || lineStyle.visible)\n {\n this.processHoles(data.holes);\n }\n\n for (let j = 0; j < 2; j++)\n {\n const style = (j === 0) ? fillStyle : lineStyle;\n\n if (!style.visible) continue;\n\n const nextTexture = style.texture.baseTexture;\n const index = this.indices.length;\n const attribIndex = this.points.length / 2;\n\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n\n if (j === 0)\n {\n this.processFill(data);\n }\n else\n {\n this.processLine(data);\n }\n\n const size = (this.points.length / 2) - attribIndex;\n\n if (size === 0) continue;\n // close batch if style is different\n if (batchPart && !this._compareStyles(currentStyle, style))\n {\n batchPart.end(index, attribIndex);\n batchPart = null;\n }\n // spawn new batch if its first batch or previous was closed\n if (!batchPart)\n {\n batchPart = BATCH_POOL.pop() || new BatchPart();\n batchPart.begin(style, index, attribIndex);\n this.batches.push(batchPart);\n currentStyle = style;\n }\n\n this.addUvs(this.points, uvs, style.texture, attribIndex, size, style.matrix);\n }\n }\n\n const index = this.indices.length;\n const attrib = this.points.length / 2;\n\n if (batchPart)\n {\n batchPart.end(index, attrib);\n }\n\n if (this.batches.length === 0)\n {\n // there are no visible styles in GraphicsData\n // its possible that someone wants Graphics just for the bounds\n this.batchable = true;\n\n return;\n }\n\n const need32 = attrib > 0xffff;\n\n // prevent allocation when length is same as buffer\n if (this.indicesUint16 && this.indices.length === this.indicesUint16.length\n && need32 === (this.indicesUint16.BYTES_PER_ELEMENT > 2))\n {\n this.indicesUint16.set(this.indices);\n }\n else\n {\n this.indicesUint16 = need32 ? new Uint32Array(this.indices) : new Uint16Array(this.indices);\n }\n\n // TODO make this a const..\n this.batchable = this.isBatchable();\n\n if (this.batchable)\n {\n this.packBatches();\n }\n else\n {\n this.buildDrawCalls();\n }\n }\n\n /**\n * Affinity check\n * @param styleA\n * @param styleB\n */\n protected _compareStyles(styleA: FillStyle | LineStyle, styleB: FillStyle | LineStyle): boolean\n {\n if (!styleA || !styleB)\n {\n return false;\n }\n\n if (styleA.texture.baseTexture !== styleB.texture.baseTexture)\n {\n return false;\n }\n\n if (styleA.color + styleA.alpha !== styleB.color + styleB.alpha)\n {\n return false;\n }\n\n if (!!(styleA as LineStyle).native !== !!(styleB as LineStyle).native)\n {\n return false;\n }\n\n return true;\n }\n\n /** Test geometry for batching process. */\n protected validateBatching(): boolean\n {\n if (this.dirty === this.cacheDirty || !this.graphicsData.length)\n {\n return false;\n }\n\n for (let i = 0, l = this.graphicsData.length; i < l; i++)\n {\n const data = this.graphicsData[i];\n const fill = data.fillStyle;\n const line = data.lineStyle;\n\n if (fill && !fill.texture.baseTexture.valid) return false;\n if (line && !line.texture.baseTexture.valid) return false;\n }\n\n return true;\n }\n\n /** Offset the indices so that it works with the batcher. */\n protected packBatches(): void\n {\n this.batchDirty++;\n this.uvsFloat32 = new Float32Array(this.uvs);\n\n const batches = this.batches;\n\n for (let i = 0, l = batches.length; i < l; i++)\n {\n const batch = batches[i];\n\n for (let j = 0; j < batch.size; j++)\n {\n const index = batch.start + j;\n\n this.indicesUint16[index] = this.indicesUint16[index] - batch.attribStart;\n }\n }\n }\n\n /**\n * Checks to see if this graphics geometry can be batched.\n * Currently it needs to be small enough and not contain any native lines.\n */\n protected isBatchable(): boolean\n {\n // prevent heavy mesh batching\n if (this.points.length > 0xffff * 2)\n {\n return false;\n }\n\n const batches = this.batches;\n\n for (let i = 0; i < batches.length; i++)\n {\n if ((batches[i].style as LineStyle).native)\n {\n return false;\n }\n }\n\n return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);\n }\n\n /** Converts intermediate batches data to drawCalls. */\n protected buildDrawCalls(): void\n {\n let TICK = ++BaseTexture._globalBatch;\n\n for (let i = 0; i < this.drawCalls.length; i++)\n {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n\n this.drawCalls.length = 0;\n\n const colors = this.colors;\n const textureIds = this.textureIds;\n\n let currentGroup: BatchDrawCall = DRAW_CALL_POOL.pop();\n\n if (!currentGroup)\n {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n currentGroup.texArray.count = 0;\n currentGroup.start = 0;\n currentGroup.size = 0;\n currentGroup.type = DRAW_MODES.TRIANGLES;\n\n let textureCount = 0;\n let currentTexture = null;\n let textureId = 0;\n let native = false;\n let drawMode = DRAW_MODES.TRIANGLES;\n\n let index = 0;\n\n this.drawCalls.push(currentGroup);\n\n // TODO - this can be simplified\n for (let i = 0; i < this.batches.length; i++)\n {\n const data = this.batches[i];\n\n // TODO add some full on MAX_TEXTURE CODE..\n const maxTextures = 8;\n\n // Forced cast for checking `native` without errors\n const style = data.style as LineStyle;\n\n const nextTexture = style.texture.baseTexture;\n\n if (native !== !!style.native)\n {\n native = !!style.native;\n drawMode = native ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES;\n\n // force the batch to break!\n currentTexture = null;\n textureCount = maxTextures;\n TICK++;\n }\n\n if (currentTexture !== nextTexture)\n {\n currentTexture = nextTexture;\n\n if (nextTexture._batchEnabled !== TICK)\n {\n if (textureCount === maxTextures)\n {\n TICK++;\n\n textureCount = 0;\n\n if (currentGroup.size > 0)\n {\n currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup)\n {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n this.drawCalls.push(currentGroup);\n }\n\n currentGroup.start = index;\n currentGroup.size = 0;\n currentGroup.texArray.count = 0;\n currentGroup.type = drawMode;\n }\n\n // TODO add this to the render part..\n // Hack! Because texture has protected `touched`\n nextTexture.touched = 1;// touch;\n\n nextTexture._batchEnabled = TICK;\n nextTexture._batchLocation = textureCount;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n\n currentGroup.texArray.elements[currentGroup.texArray.count++] = nextTexture;\n textureCount++;\n }\n }\n\n currentGroup.size += data.size;\n index += data.size;\n\n textureId = nextTexture._batchLocation;\n\n this.addColors(colors, style.color, style.alpha, data.attribSize, data.attribStart);\n this.addTextureIds(textureIds, textureId, data.attribSize, data.attribStart);\n }\n\n BaseTexture._globalBatch = TICK;\n\n // upload..\n // merge for now!\n this.packAttributes();\n }\n\n /** Packs attributes to single buffer. */\n protected packAttributes(): void\n {\n const verts = this.points;\n const uvs = this.uvs;\n const colors = this.colors;\n const textureIds = this.textureIds;\n\n // verts are 2 positions.. so we * by 3 as there are 6 properties.. then 4 cos its bytes\n const glPoints = new ArrayBuffer(verts.length * 3 * 4);\n const f32 = new Float32Array(glPoints);\n const u32 = new Uint32Array(glPoints);\n\n let p = 0;\n\n for (let i = 0; i < verts.length / 2; i++)\n {\n f32[p++] = verts[i * 2];\n f32[p++] = verts[(i * 2) + 1];\n\n f32[p++] = uvs[i * 2];\n f32[p++] = uvs[(i * 2) + 1];\n\n u32[p++] = colors[i];\n\n f32[p++] = textureIds[i];\n }\n\n this._buffer.update(glPoints);\n this._indexBuffer.update(this.indicesUint16);\n }\n\n /**\n * Process fill part of Graphics.\n * @param data\n */\n protected processFill(data: GraphicsData): void\n {\n if (data.holes.length)\n {\n buildPoly.triangulate(data, this);\n }\n else\n {\n const command = FILL_COMMANDS[data.type];\n\n command.triangulate(data, this);\n }\n }\n\n /**\n * Process line part of Graphics.\n * @param data\n */\n protected processLine(data: GraphicsData): void\n {\n buildLine(data, this);\n\n for (let i = 0; i < data.holes.length; i++)\n {\n buildLine(data.holes[i], this);\n }\n }\n\n /**\n * Process the holes data.\n * @param holes\n */\n protected processHoles(holes: Array<GraphicsData>): void\n {\n for (let i = 0; i < holes.length; i++)\n {\n const hole = holes[i];\n const command = FILL_COMMANDS[hole.type];\n\n command.build(hole);\n\n if (hole.matrix)\n {\n this.transformPoints(hole.points, hole.matrix);\n }\n }\n }\n\n /** Update the local bounds of the object. Expensive to use performance-wise. */\n protected calculateBounds(): void\n {\n const bounds = this._bounds;\n\n bounds.clear();\n bounds.addVertexData((this.points as any), 0, this.points.length);\n bounds.pad(this.boundsPadding, this.boundsPadding);\n }\n\n /**\n * Transform points using matrix.\n * @param points - Points to transform\n * @param matrix - Transform matrix\n */\n protected transformPoints(points: Array<number>, matrix: Matrix): void\n {\n for (let i = 0; i < points.length / 2; i++)\n {\n const x = points[(i * 2)];\n const y = points[(i * 2) + 1];\n\n points[(i * 2)] = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n points[(i * 2) + 1] = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n }\n }\n\n /**\n * Add colors.\n * @param colors - List of colors to add to\n * @param color - Color to add\n * @param alpha - Alpha to use\n * @param size - Number of colors to add\n * @param offset\n */\n protected addColors(\n colors: Array<number>,\n color: number,\n alpha: number,\n size: number,\n offset = 0): void\n {\n const bgr = Color.shared\n .setValue(color)\n .toLittleEndianNumber();\n\n const result = Color.shared\n .setValue(bgr)\n .toPremultiplied(alpha);\n\n colors.length = Math.max(colors.length, offset + size);\n\n for (let i = 0; i < size; i++)\n {\n colors[offset + i] = result;\n }\n }\n\n /**\n * Add texture id that the shader/fragment wants to use.\n * @param textureIds\n * @param id\n * @param size\n * @param offset\n */\n protected addTextureIds(\n textureIds: Array<number>,\n id: number,\n size: number,\n offset = 0): void\n {\n textureIds.length = Math.max(textureIds.length, offset + size);\n\n for (let i = 0; i < size; i++)\n {\n textureIds[offset + i] = id;\n }\n }\n\n /**\n * Generates the UVs for a shape.\n * @param verts - Vertices\n * @param uvs - UVs\n * @param texture - Reference to Texture\n * @param start - Index buffer start index.\n * @param size - The size/length for index buffer.\n * @param matrix - Optional transform for all points.\n */\n protected addUvs(\n verts: Array<number>,\n uvs: Array<number>,\n texture: Texture,\n start: number,\n size: number,\n matrix: Matrix = null): void\n {\n let index = 0;\n const uvsStart = uvs.length;\n const frame = texture.frame;\n\n while (index < size)\n {\n let x = verts[(start + index) * 2];\n let y = verts[((start + index) * 2) + 1];\n\n if (matrix)\n {\n const nx = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n\n y = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n x = nx;\n }\n\n index++;\n\n uvs.push(x / frame.width, y / frame.height);\n }\n\n const baseTexture = texture.baseTexture;\n\n if (frame.width < baseTexture.width\n || frame.height < baseTexture.height)\n {\n this.adjustUvs(uvs, texture, uvsStart, size);\n }\n }\n\n /**\n * Modify uvs array according to position of texture region\n * Does not work with rotated or trimmed textures\n * @param uvs - array\n * @param texture - region\n * @param start - starting index for uvs\n * @param size - how many points to adjust\n */\n protected adjustUvs(uvs: Array<number>, texture: Texture, start: number, size: number): void\n {\n const baseTexture = texture.baseTexture;\n const eps = 1e-6;\n const finish = start + (size * 2);\n const frame = texture.frame;\n const scaleX = frame.width / baseTexture.width;\n const scaleY = frame.height / baseTexture.height;\n let offsetX = frame.x / frame.width;\n let offsetY = frame.y / frame.height;\n let minX = Math.floor(uvs[start] + eps);\n let minY = Math.floor(uvs[start + 1] + eps);\n\n for (let i = start + 2; i < finish; i += 2)\n {\n minX = Math.min(minX, Math.floor(uvs[i] + eps));\n minY = Math.min(minY, Math.floor(uvs[i + 1] + eps));\n }\n offsetX -= minX;\n offsetY -= minY;\n for (let i = start; i < finish; i += 2)\n {\n uvs[i] = (uvs[i] + offsetX) * scaleX;\n uvs[i + 1] = (uvs[i + 1] + offsetY) * scaleY;\n }\n }\n}\n"],"names":["_GraphicsGeometry","i","index"],"mappings":";;;;;;;AAuBA,MAAM,WAAW,IAAI,SAUR,oBAAN,MAAMA,2BAAyB,cACtC;AAAA;AAAA,EAsEI,cACA;AACU,aAnEV,KAAO,gBAAgB,MAGvB,KAAO,gBAAgB,GAEI,KAAA,aAAA,MACgB,KAAA,gBAAA,MAC/B,KAAA,YAAA,IAGZ,KAAA,SAAmB,IAGnB,KAAA,SAAmB,IAGnB,KAAA,MAAgB,IAGhB,KAAA,UAAoB,IAGpB,KAAA,aAAuB,IAMvB,KAAA,eAAoC,IAMpC,KAAA,YAAkC,IAGrB,KAAA,aAAA,IAOb,KAAA,UAA4B,IAG5B,KAAU,QAAQ,GAGlB,KAAU,aAAa,IAGv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