-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.es.js.map
1 lines (1 loc) · 111 KB
/
index.es.js.map
1
{"version":3,"file":"index.es.js","sources":["src/parser.js","src/util.js","src/render.js","src/index.js"],"sourcesContent":["import karas from 'karas';\n\nconst { inject, math } = karas;\n\nfunction parseAndLoadTex(tex, cb, props = {}) {\n let src = props.imagePath || tex.imagePath;\n let texHash = {};\n inject.measureImg(src, function() {\n tex.SubTexture.forEach(item => {\n let { name, x, y, width, height, frameX = 0, frameY = 0, frameWidth = width, frameHeight = height } = item;\n texHash[name] = {\n name,\n x,\n y,\n width,\n height,\n frameX,\n frameY,\n frameWidth,\n frameHeight,\n source: inject.IMG[src].source,\n };\n });\n cb(texHash);\n });\n}\n\nfunction parseSke(ske, texHash, props = {}) {\n let {\n frameRate: globalFrameRate,\n armature,\n } = ske;\n let currentArmature = armature[0];\n if(props.armature) {\n for(let i = 0, len = armature.length; i < len; i++) {\n let item = armature[i];\n if(item.name === props.armature) {\n currentArmature = item;\n break;\n }\n }\n if(!currentArmature) {\n throw new Error('Can not find armature: ' + props.armature);\n }\n }\n if(!currentArmature) {\n console.warn('No armature data');\n return;\n }\n let {\n name,\n bone,\n slot,\n skin,\n frameRate,\n animation,\n defaultActions,\n canvas,\n } = currentArmature;\n let boneHash = parseBone(bone);\n let slotHash = parseSlot(slot);\n let skinHash = parseSkin(skin, texHash, props);\n let animationHash = parseAnimation(animation, frameRate || globalFrameRate || 60, boneHash);\n return {\n name,\n bone,\n boneHash,\n slot,\n slotHash,\n skin: skin[0].slot,\n skinHash,\n animationHash,\n defaultActions,\n canvas,\n };\n}\n\nfunction parseSlot(data) {\n let hash = {};\n data.forEach(item => {\n hash[item.name] = item;\n });\n return hash;\n}\n\nfunction parseBone(data) {\n let hash = {};\n // bone数据形成tree结构,符合dom格式,第一个一定是root\n let root = data[0];\n root.children = [];\n hash[root.name] = root;\n data.forEach((item, i) => {\n let { name, parent, transform = {} } = item;\n if(parent) {\n hash[parent].children.push(item);\n }\n hash[name] = item;\n item.children = [];\n item.index = i;\n // 静态变换样式,可能某个骨骼没动画\n let matrix = math.matrix.identity();\n if(transform.x || transform.y) {\n let m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, transform.x || 0, transform.y || 0, 0, 1];\n matrix = math.matrix.multiply(matrix, m);\n }\n if(transform.skX) {\n let d = math.geom.d2r(transform.skX);\n let sin = Math.sin(d);\n let cos = Math.cos(d);\n let m = [cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = math.matrix.multiply(matrix, m);\n }\n if(transform.scX !== undefined || transform.scY !== undefined) {\n let m = [transform.scX === undefined ? 1 : transform.scX, 0, 0, 0, 0, transform.scY === undefined ? 1 : transform.scY, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = karas.math.matrix.multiply(matrix, m);\n }\n item.matrix = matrix;\n });\n return hash;\n}\n\nfunction parseSkin(data, texHash, props) {\n let hash = {};\n data[0].slot.forEach(item => {\n let { name: slotName, display } = item;\n hash[slotName] = item;\n display.forEach(item => {\n let { type, name, path } = item;\n // mesh网格分析三角形\n if(type === 'mesh') {\n let { vertices, triangles, uvs, weights, bonePose } = item;\n let weightHash;\n let bonePoseHash;\n // 有权重则绑定骨骼,坐标系为世界;\n // 没有权重时,完全属于父骨骼,类似普通贴图行为\n if(weights) {\n // 权重格式化hash\n weightHash = {};\n for(let i = 0, len = weights.length, verticesIndex = 0; i < len; i++) {\n let num = weights[i];\n let list = [];\n for(let j = i + 1; j < i + 1 + num * 2; j += 2) {\n let index = weights[j];\n let value = weights[j + 1];\n list.push({\n index,\n value,\n });\n }\n weightHash[verticesIndex++] = list;\n i += num * 2;\n }\n // 骨骼初始pose格式化和世界坐标\n bonePoseHash = {};\n for(let i = 0, len = bonePose.length; i < len; i += 7) {\n let index = bonePose[i];\n let m = bonePose.slice(i + 1, i + 7);\n let matrix = [m[0], m[1], 0, 0, m[2], m[3], 0, 0, 0, 0, 1, 0, m[4], m[5], 0, 1];\n let coords = math.matrix.calPoint([0, 0], matrix);\n bonePoseHash[index] = {\n coords,\n pose: matrix,\n };\n }\n }\n // 顶点格式化,相对于骨骼点的x/y位移差值\n let verticesList = item.verticesList = [];\n for(let i = 0, len = vertices.length; i < len; i += 2) {\n let index = i >> 1;\n let x = vertices[i];\n let y = vertices[i + 1];\n let res = {\n index,\n x,\n y,\n };\n verticesList.push(res);\n // 有添加绑定骨骼才有权重\n if(weightHash) {\n res.weightList = [];\n let weight = weightHash[index];\n weight.forEach(item => {\n let { index, value } = item;\n let { coords, pose } = bonePoseHash[index];\n // 先求骨头的角度,逆向选择至水平后,平移x/y的差值\n let [x0, y0] = math.matrix.calPoint([0, 0], pose);\n let [x1, y1] = math.matrix.calPoint([1, 0], pose);\n let dx = x1 - x0;\n let dy = y1 - y0;\n let theta;\n // 4个象限分开判断\n if(dx >= 0 && dy >= 0) {\n theta = -Math.atan(Math.abs(dy / dx));\n }\n else if(dx < 0 && dy >= 0) {\n theta = -Math.PI + Math.atan(Math.abs(dy / dx));\n }\n else if(dx < 0 && dy < 0) {\n theta = Math.PI - Math.atan(Math.abs(dy / dx));\n }\n else {\n theta = Math.atan(Math.abs(dy / dx));\n }\n let rotate = [Math.cos(theta), Math.sin(theta), 0, 0, -Math.sin(theta), Math.cos(theta), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n let translate = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x - coords[0], y - coords[1], 0, 1];\n let matrix = math.matrix.multiply(rotate, translate);\n res.weightList.push({\n index,\n value,\n matrix,\n });\n });\n }\n }\n // 三角形,切割图片坐标\n let tex = texHash[path || name];\n let { width, height } = tex;\n let triangleList = item.triangleList = [];\n for(let i = 0, len = triangles.length; i < len; i += 3) {\n let i1 = triangles[i];\n let i2 = triangles[i + 1];\n let i3 = triangles[i + 2];\n // uv坐标\n let p1x = uvs[i1 * 2];\n let p1y = uvs[i1 * 2 + 1];\n let p2x = uvs[i2 * 2];\n let p2y = uvs[i2 * 2 + 1];\n let p3x = uvs[i3 * 2];\n let p3y = uvs[i3 * 2 + 1];\n // uv贴图坐标根据尺寸映射真实坐标\n let x1 = p1x * width;\n let y1 = p1y * height;\n let x2 = p2x * width;\n let y2 = p2y * height;\n let x3 = p3x * width;\n let y3 = p3y * height;\n // 从内心往外扩展约0.25px,可参数指定\n let [x0, y0] = math.geom.triangleIncentre(x1, y1, x2, y2, x3, y3);\n let px = parseFloat(props.enlarge);\n if(isNaN(px)) {\n px = 0.25;\n }\n // 单独为slot配置的扩展参数\n if(props.enlargeSlot && props.enlargeSlot.hasOwnProperty(slotName)) {\n let n = parseFloat(props.enlargeSlot[slotName]);\n if(isNaN(n)) {\n n = 0.25;\n }\n px = n;\n }\n let scale = px ? triangleScale(x0, y0, x1, y1, x2, y2, x3, y3, px) : 1;\n // 以内心为transformOrigin\n let m = math.matrix.identity();\n m[12] = -x0;\n m[13] = -y0;\n // 缩放\n let t = math.matrix.identity();\n t[0] = t[5] = scale;\n m = math.matrix.multiply(t, m);\n // 移动回去\n t[12] = x0;\n t[13] = y0;\n m = math.matrix.multiply(t, m);\n // 获取扩展后的三角形顶点坐标\n let [sx1, sy1] = math.matrix.calPoint([x1, y1], m);\n let [sx2, sy2] = math.matrix.calPoint([x2, y2], m);\n let [sx3, sy3] = math.matrix.calPoint([x3, y3], m);\n // 三角形所在矩形距离左上角原点的坐标,以此做img切割最小尺寸化,以及变换原点计算\n // let [ox, oy, ow, oh] = triangleOriginCoords(sx1, sy1, sx2, sy2, sx3, sy3);\n triangleList.push({\n index: Math.round(i / 3),\n indexList: [i1, i2, i3],\n // ox,\n // oy,\n // ow,\n // oh,\n // points: [\n // [p1x, p1y],\n // [p2x, p2y],\n // [p3x, p3y]\n // ],\n coords: [\n [x1, y1],\n [x2, y2],\n [x3, y3]\n ],\n scale,\n scaleCoords: [\n [sx1, sy1],\n [sx2, sy2],\n [sx3, sy3]\n ],\n width,\n height,\n });\n }\n }\n });\n });\n return hash;\n}\n\n/**\n * 将三角形从内心缩放指定像素\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n * @param px 缩放多少像素,可正负\n * @returns {number} 缩放倍数\n */\nfunction triangleScale(x0, y0, x1, y1, x2, y2, x3, y3, px = 0) {\n // 内心到任意一边的距离\n let a = y2 - y1;\n let b = x1 - x2;\n let c = x2 * y1 - x1 * y2;\n let d = Math.abs(a * x0 + b * y0 + c) / Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n return (d + px) / d;\n}\n\n/**\n * 获取三角形所在最小矩形的原点坐标、尺寸\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleOriginCoords(x1, y1, x2, y2, x3, y3) {\n let xMin = x1;\n let yMin = y1;\n let xMax = x1;\n let yMax = y1;\n xMin = Math.min(xMin, x2);\n xMin = Math.min(xMin, x3);\n yMin = Math.min(yMin, y2);\n yMin = Math.min(yMin, y3);\n xMax = Math.max(xMax, x2);\n xMax = Math.max(xMax, x3);\n yMax = Math.max(yMax, y2);\n yMax = Math.max(yMax, y3);\n return [xMin, yMin, xMax - xMin, yMax - yMin];\n}\n\nfunction parseAnimation(data, frameRate, boneHash) {\n let hash = {};\n data.forEach(item => {\n let { duration, playTimes, name, bone = [], slot = [], ffd = [] } = item;\n hash[name] = item;\n item.options = {\n duration: 1000 * duration / frameRate,\n iterations: playTimes === 0 ? Infinity : playTimes,\n fill: 'forwards',\n };\n // 骨骼动画列表\n item.boneAnimationList = bone.map(item => {\n let { name, translateFrame, rotateFrame, scaleFrame } = item;\n let { transform: originTransform = {} } = boneHash[name];\n let res = {\n name,\n list: [],\n };\n if(translateFrame) {\n let offsetSum = 0;\n let last;\n let value = translateFrame.map(frame => {\n let { duration: d = 1 } = frame;\n let easingFn = getEasing(frame);\n let offset = offsetSum / duration;\n offsetSum += d;\n let { x = 0, y = 0 } = originTransform;\n let res = {\n type: 0,\n translateX: (frame.x || 0) + x,\n translateY: (frame.y || 0) + y,\n offset,\n easingFn,\n };\n if(last) {\n last.dx = res.translateX - last.translateX;\n last.dy = res.translateY - last.translateY;\n }\n last = res;\n return res;\n });\n res.list.push(value);\n }\n if(rotateFrame) {\n let offsetSum = 0;\n let last;\n let value = rotateFrame.map(frame => {\n let { duration: d = 1 } = frame;\n let easingFn = getEasing(frame);\n let offset = offsetSum / duration;\n offsetSum += d;\n let { skX = 0 } = originTransform;\n let res = {\n type: 1,\n rotateZ: (frame.rotate || 0) + skX,\n offset,\n easingFn,\n };\n if(last) {\n last.dz = res.rotateZ - last.rotateZ;\n }\n last = res;\n return res;\n });\n res.list.push(value);\n }\n if(scaleFrame) {\n let offsetSum = 0;\n let last;\n let value = scaleFrame.map(frame => {\n let { duration: d = 1 } = frame;\n let easingFn = getEasing(frame);\n let offset = offsetSum / duration;\n offsetSum += d;\n let { scX = 1, scY = 1 } = originTransform;\n let res = {\n type: 2,\n scaleX: (frame.x === undefined ? 1 : frame.x) * scX,\n scaleY: (frame.y === undefined ? 1 : frame.y) * scY,\n offset,\n easingFn,\n };\n if(last) {\n last.dx = res.scaleX - last.scaleX;\n last.dy = res.scaleY - last.scaleY;\n }\n last = res;\n return res;\n });\n res.list.push(value);\n }\n return res;\n });\n // 插槽动画列表\n item.slotAnimationList = slot.map(item => {\n let { displayFrame, colorFrame } = item;\n if(displayFrame) {\n let offsetSum = 0;\n displayFrame.forEach(frame => {\n let { duration: d = 1 } = frame;\n let offset = offsetSum / duration;\n offsetSum += d;\n frame.offset = offset;\n });\n }\n if(colorFrame) {\n let offsetSum = 0;\n let last;\n colorFrame.forEach(frame => {\n let { duration: d = 1 } = frame;\n frame.easingFn = getEasing(frame);\n let offset = offsetSum / duration;\n offsetSum += d;\n frame.offset = offset;\n // 没有value就用默认值\n if(!frame.value) {\n frame.value = {\n aM: 100,\n };\n }\n if(frame.value.aM === undefined) {\n frame.value.aM = 100;\n }\n if(last) {\n last.da = frame.value.aM - last.value.aM;\n }\n last = frame;\n });\n }\n return item;\n });\n // 自由变形列表\n let ffdAnimationHash = item.ffdAnimationHash = {};\n item.ffdAnimationList = ffd.map(item => {\n let { name, slot, frame } = item;\n // db限制了不能出现在名字里\n ffdAnimationHash[slot + '>' + name] = item;\n if(frame) {\n let offsetSum = 0;\n let last;\n frame.forEach(frame => {\n let { vertices, duration: d = 1, offset: os } = frame;\n frame.easingFn = getEasing(frame);\n if(vertices) {\n for(let i = 0; i < os; i++) {\n vertices.unshift(0);\n }\n }\n let offset = offsetSum / duration;\n offsetSum += d;\n frame.offset = offset;\n // 顶点变形数据vertices都是偏移量,无偏移为空\n if(last) {\n let verticesLast = last.vertices;\n if(verticesLast && vertices) {\n last.dv = [];\n for(let i = 0, len = Math.max(verticesLast.length, vertices.length); i < len; i++) {\n last.dv.push((vertices[i] || 0) - (verticesLast[i] || 0));\n }\n }\n else if(verticesLast) {\n last.dv = last.vertices.map(n => -n);\n }\n else if(vertices) {\n last.dv = vertices;\n }\n }\n last = frame;\n });\n }\n return item;\n });\n });\n return hash;\n}\n\nfunction getEasing(frame) {\n let curve = frame.curve;\n if(curve && curve[0] !== 1 && curve[1] !== 1 && curve[2] !== 0 && curve[3] !== 0) {\n return karas.animate.easing.cubicBezier(curve[0], curve[1], curve[2], curve[3]);\n }\n}\n\nexport default {\n parseAndLoadTex,\n parseSke,\n};\n","import karas from 'karas';\n\nconst { math } = karas;\n\n/**\n * 根据动画时间状态修改骨骼当前matrix\n * @param animationList 动画列表\n * @param offset 当前时间偏移量\n * @param boneHash 骨骼hash\n */\nfunction animateBoneMatrix(animationList, offset, boneHash) {\n animationList.forEach(item => {\n let { name, list } = item;\n let bone = boneHash[name];\n // 先以静态变换样式为基础\n let { transform = {} } = bone;\n let res = {};\n res.translateX = transform.x || 0;\n res.translateY = transform.y || 0;\n res.rotateZ = transform.skX || 0;\n res.scaleX = transform.scX === undefined ? 1 : transform.scX;\n res.scaleY = transform.scY === undefined ? 1 : transform.scY;\n // 再assign动画中的变换样式\n list.forEach(frames => {\n let len = frames.length;\n if(!len) {\n return;\n }\n let type = frames[0].type;\n let i = binarySearch(0, len - 1, offset, frames);\n let current = frames[i];\n let easingFn = current.easingFn;\n // 是否最后一帧\n if(i === len - 1) {\n if(type === 0) {\n res.translateX = current.translateX;\n res.translateY = current.translateY;\n }\n else if(type === 1) {\n res.rotateZ = current.rotateZ;\n }\n else if(type === 2) {\n res.scaleX = current.scaleX;\n res.scaleY = current.scaleY;\n }\n }\n else {\n let next = frames[i + 1];\n let total = next.offset - current.offset;\n let percent = (offset - current.offset) / total;\n if(easingFn) {\n percent = easingFn(percent);\n }\n if(type === 0) {\n res.translateX = current.translateX + current.dx * percent;\n res.translateY = current.translateY + current.dy * percent;\n }\n else if(type === 1) {\n res.rotateZ = current.rotateZ + current.dz * percent;\n }\n else if(type === 2) {\n res.scaleX = current.scaleX + current.dx * percent;\n res.scaleY = current.scaleY + current.dy * percent;\n }\n }\n });\n let matrix = math.matrix.identity();\n if(res.translateX || res.translateY) {\n let m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, res.translateX || 0, res.translateY || 0, 0, 1];\n matrix = math.matrix.multiply(matrix, m);\n }\n if(res.rotateZ) {\n let d = math.geom.d2r(res.rotateZ);\n let sin = Math.sin(d);\n let cos = Math.cos(d);\n let m = [cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = math.matrix.multiply(matrix, m);\n }\n if(res.scaleX !== undefined || res.scaleY !== undefined) {\n let m = [res.scaleX === undefined ? 1 : res.scaleX, 0, 0, 0, 0, res.scaleY === undefined ? 1 : res.scaleY, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = math.matrix.multiply(matrix, m);\n }\n bone.matrixA = matrix;\n });\n}\n\n/**\n * 二分查找根据时间轴帧序列和当前百分比获得当前帧\n * @param i\n * @param j\n * @param offset\n * @param frames\n * @returns {frame}\n */\nfunction binarySearch(i, j, offset, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame.offset > offset) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame.offset === offset) {\n return middle;\n }\n else if(frame.offset > offset) {\n return binarySearch(i, Math.max(middle - 1, i), offset, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, offset, frames);\n }\n }\n}\n\n/**\n * 递归遍历骨骼,根据父子属性合并生成骨骼相对于舞台的最终currentMatrix\n * @param root 根骨骼\n */\nfunction mergeBoneMatrix(root) {\n root.currentMatrix = root.matrixA || root.matrix;\n root.children.forEach(item => {\n mergeChildBoneMatrix(item, root.currentMatrix);\n });\n}\n\nfunction mergeChildBoneMatrix(bone, parentMatrix) {\n bone.currentMatrix = math.matrix.multiply(parentMatrix, bone.matrixA || bone.matrix);\n bone.children.forEach(item => {\n mergeChildBoneMatrix(item, bone.currentMatrix);\n });\n}\n\n/**\n * 根据当前动画时间执行slot的动画,确定显示slot下的皮肤索引和透明度\n * @param slotAnimationList\n * @param offset\n * @param slotHash\n */\nfunction animateSlot(slotAnimationList, offset, slotHash) {\n slotAnimationList.forEach(item => {\n let { name, displayFrame, colorFrame } = item;\n let slot = slotHash[name];\n if(displayFrame) {\n if(displayFrame.length) {\n let i = binarySearch(0, displayFrame.length - 1, offset, displayFrame);\n let { value = 0 } = displayFrame[i];\n slot.displayIndexA = value;\n }\n }\n if(colorFrame) {\n let len = colorFrame.length;\n if(len) {\n let i = binarySearch(0, len - 1, offset, colorFrame);\n let current = colorFrame[i];\n let easingFn = current.easing;\n // 是否最后一帧\n if(i === len - 1) {\n slot.colorA = current.value;\n }\n else {\n let next = colorFrame[i + 1];\n let total = next.offset - current.offset;\n let percent = (offset - current.offset) / total;\n if(easingFn) {\n percent = easingFn(percent);\n }\n slot.colorA = {\n aM: current.value.aM + current.da * percent,\n };\n }\n }\n }\n });\n}\n\n/**\n * 根据当前骨骼状态计算slot中显示对象变换matrix\n * @param offset\n * @param slot\n * @param skinHash\n * @param bone\n * @param boneHash\n * @param texHash\n * @param ffdAnimationHash\n */\nfunction calSlot(offset, slot, skinHash, bone, boneHash, texHash, ffdAnimationHash) {\n slot.forEach(item => {\n let { name, parent, displayIndex = 0, displayIndexA = displayIndex } = item;\n // 插槽隐藏不显示\n if(displayIndexA < 0) {\n return;\n }\n let skin = skinHash[name];\n let displayTarget = skin.display[displayIndexA];\n // 网格类型\n if(displayTarget.type === 'mesh') {\n let { verticesList, triangleList } = displayTarget;\n // 先进行顶点变换\n verticesList.forEach(item => {\n let { weightList } = item;\n // 有绑定骨骼的mesh,计算权重\n if(weightList) {\n let m = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n weightList.forEach(weight => {\n let { index, value, matrix } = weight;\n let boneMatrix = bone[index].currentMatrix;\n let offset = karas.math.matrix.multiply(boneMatrix, matrix);\n for(let i = 0; i < 16; i++) {\n m[i] += offset[i] * value;\n }\n });\n item.matrix = m;\n }\n // 没有绑定认为直属父骨骼\n else {\n let parentBoneMatrix = boneHash[parent].currentMatrix;\n let offsetMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, item.x, item.y, 0, 1];\n let m = karas.math.matrix.multiply(parentBoneMatrix, offsetMatrix);\n item.matrix = m;\n }\n // 每次先清空ffd自由变换的数据\n item.matrixF = null;\n });\n // 如果有ffd自定义顶点变换,计算偏移量matrix\n let ffd = ffdAnimationHash[name + '>' + (displayTarget.path || displayTarget.name)];\n if(ffd) {\n let { frame } = ffd;\n if(frame) {\n let len = frame.length;\n let i = binarySearch(0, len - 1, offset, frame);\n let current = frame[i];\n let easingFn = current.easingFn;\n // 是否最后一帧\n if(i === len - 1) {\n let { vertices } = current;\n if(vertices) {\n for(let i = 0, len = vertices.length; i < len - 1; i += 2) {\n let x = vertices[i];\n let y = vertices[i + 1];\n if(x === 0 && y === 0) {\n continue;\n }\n let index = i >> 1;\n let target = verticesList[index];\n let m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, 0, 1];\n target.matrixF = math.matrix.multiply(target.matrix, m);\n }\n }\n }\n else {\n let next = frame[i + 1];\n let total = next.offset - current.offset;\n let percent = (offset - current.offset) / total;\n if(easingFn) {\n percent = easingFn(percent);\n }\n let { vertices, dv } = current;\n if(vertices || dv) {\n let len = 0;\n if(vertices) {\n len = vertices.length;\n }\n if(dv) {\n len = Math.max(len, dv.length);\n }\n for(let i = 0; i < len - 1; i += 2) {\n let x, y;\n if(vertices) {\n x = vertices[i] || 0;\n y = vertices[i + 1] || 0;\n }\n else {\n x = y = 0;\n }\n if(dv) {\n x += (dv[i] || 0) * percent;\n y += (dv[i + 1] || 0) * percent;\n }\n if(x === 0 && y === 0) {\n continue;\n }\n let index = i >> 1;\n let target = verticesList[index];\n let m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, 0, 1];\n target.matrixF = math.matrix.multiply(target.matrix, m);\n }\n }\n }\n }\n }\n // 三角形根据顶点坐标变化计算仿射变换matrix\n triangleList.forEach(item => {\n let { indexList, coords } = item;\n let source = coords[0].concat(coords[1]).concat(coords[2]);\n let target = [];\n indexList.forEach(i => {\n let vertices = verticesList[i];\n let coords = math.matrix.calPoint([0, 0], vertices.matrixF || vertices.matrix);\n target = target.concat(coords.slice(0, 2));\n });\n // 先交换确保3个点顺序\n let [source1, target1] = math.tar.exchangeOrder(source, target);\n let matrix = math.tar.transform(source1, target1);\n item.matrix = matrix;\n });\n }\n // 默认图片类型\n else {\n let { transform = {} } = displayTarget;\n let tex = texHash[displayTarget.path || displayTarget.name];\n let parentBoneMatrix = boneHash[parent].currentMatrix;\n let matrix = math.matrix.identity();\n // 图片本身形变,因中心点在图片本身中心,所以无论是否有translate都要平移\n let t = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, (transform.x || 0) - tex.frameWidth * 0.5, (transform.y || 0) - tex.frameHeight * 0.5, 0, 1];\n matrix = math.matrix.multiply(matrix, t);\n // 可选旋转\n if(transform.skX) {\n let d = math.geom.d2r(transform.skX);\n let sin = Math.sin(d);\n let cos = Math.cos(d);\n let t = [cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = math.matrix.multiply(matrix, t);\n }\n // 可选缩放\n if(transform.scX !== undefined || transform.scY !== undefined) {\n let t = [transform.scX === undefined ? 1 : transform.scX, 0, 0, 0, 0, transform.scY === undefined ? 1 : transform.scY, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = math.matrix.multiply(matrix, t);\n }\n // tfo为图片中心,可合并\n t = math.matrix.identity();\n t[12] = tex.frameWidth * 0.5;\n t[13] = tex.frameHeight * 0.5;\n matrix = math.matrix.multiply(t, matrix);\n t = math.matrix.identity();\n t[12] = -tex.frameWidth * 0.5;\n t[13] = -tex.frameHeight * 0.5;\n matrix = math.matrix.multiply(matrix, t);\n matrix = math.matrix.multiply(parentBoneMatrix, matrix);\n displayTarget.matrix = matrix;\n }\n });\n}\n\nfunction clearAnimation(bone, slot) {\n bone.forEach(item => {\n delete item.matrixA;\n });\n slot.forEach(item => {\n delete item.displayIndexA;\n delete item.colorA;\n });\n}\n\nexport default {\n animateBoneMatrix,\n mergeBoneMatrix,\n animateSlot,\n calSlot,\n clearAnimation,\n};\n","import karas from 'karas';\n\nconst { math } = karas;\n\nfunction canvasBone(ctx, matrixEvent, bone, dx, dy) {\n let { length, children, currentMatrix } = bone;\n let m = math.matrix.multiply(matrixEvent, currentMatrix);\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n ctx.beginPath();\n ctx.strokeStyle = '#000';\n ctx.lineWidth = 1;\n ctx.arc(dx, dy, 5, 0, Math.PI * 2);\n ctx.moveTo(dx, dy);\n ctx.lineTo((length || 5) + dx, dy);\n ctx.closePath();\n ctx.stroke();\n children.forEach(item => {\n canvasBone(ctx, matrixEvent, item, dx, dy);\n });\n}\n\nfunction canvasSlot(ctx, matrixEvent, slot, skinHash, texHash, dx, dy) {\n slot.forEach(item => {\n let { name, displayIndex = 0, displayIndexA = displayIndex, blendMode, color = {}, colorA = color } = item;\n // 插槽隐藏不显示\n if(displayIndexA < 0) {\n return;\n }\n // 叠加模式\n if(blendMode === 'add') {\n ctx.globalCompositeOperation = 'lighter';\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n let { aM = 100 } = colorA;\n let opacity = ctx.globalAlpha;\n // 透明度\n ctx.globalAlpha *= aM / 100;\n let skin = skinHash[name];\n let displayTarget = skin.display[displayIndexA];\n let tex = texHash[displayTarget.path || displayTarget.name];\n // 网格类型\n if(displayTarget.type === 'mesh') {\n let { triangleList } = displayTarget;\n triangleList.forEach(item => {\n let { matrix, scaleCoords } = item;\n matrix = math.matrix.multiply(matrixEvent, matrix);\n // clip绘制\n ctx.save();\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.beginPath();\n ctx.moveTo(scaleCoords[0][0] + dx, scaleCoords[0][1] + dy);\n ctx.lineTo(scaleCoords[1][0] + dx, scaleCoords[1][1] + dy);\n ctx.lineTo(scaleCoords[2][0] + dx, scaleCoords[2][1] + dy);\n ctx.closePath();\n ctx.clip();\n ctx.drawImage(tex.source, -tex.x - tex.frameX + dx, -tex.y - tex.frameY + dy);\n ctx.restore();\n });\n }\n // 默认图片类型\n else {\n let { matrix } = displayTarget;\n if(matrix[0] === 0 || matrix[5] === 0) {\n return;\n }\n matrix = math.matrix.multiply(matrixEvent, matrix);\n // clip绘制\n ctx.save();\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.beginPath();\n ctx.moveTo(-tex.frameX + dx, -tex.frameY + dy);\n ctx.lineTo(-tex.frameX + tex.width + dx, -tex.frameY + dy);\n ctx.lineTo(-tex.frameX + tex.width + dx, -tex.frameY + tex.height + dy);\n ctx.lineTo(-tex.frameX + dx, -tex.frameY + tex.height + dy);\n ctx.closePath();\n ctx.clip();\n ctx.drawImage(tex.source, -tex.x - tex.frameX + dx, -tex.y - tex.frameY + dy);\n ctx.restore();\n }\n // 恢复模式\n if(blendMode) {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = opacity;\n });\n}\n\nfunction canvasTriangle(ctx, matrixEvent, slot, skinHash, texHash, dx, dy) {\n slot.forEach(item => {\n let { name, displayIndex = 0, displayIndexA = displayIndex } = item;\n // 插槽隐藏不显示\n if(displayIndexA < 0) {\n return;\n }\n let skin = skinHash[name];\n let displayTarget = skin.display[displayIndexA];\n let tex = texHash[displayTarget.path || displayTarget.name];\n // 网格类型\n if(displayTarget.type === 'mesh') {\n let { verticesList, triangleList } = displayTarget;\n triangleList.forEach(item => {\n let { matrix, scaleCoords } = item;\n matrix = math.matrix.multiply(matrixEvent, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.strokeStyle = '#39F';\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(scaleCoords[0][0] + dx, scaleCoords[0][1] + dy);\n ctx.lineTo(scaleCoords[1][0] + dx, scaleCoords[1][1] + dy);\n ctx.lineTo(scaleCoords[2][0] + dx, scaleCoords[2][1] + dy);\n ctx.closePath();\n ctx.stroke();\n });\n verticesList.forEach(item => {\n let { matrix, matrixF } = item;\n matrix = math.matrix.multiply(matrixEvent, matrixF || matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.fillStyle = '#0D6';\n ctx.beginPath();\n ctx.arc(dx, dy, 4, 0, Math.PI * 2);\n ctx.closePath();\n ctx.fill();\n });\n }\n // 默认图片类型\n else {\n let { matrix } = displayTarget;\n matrix = math.matrix.multiply(matrixEvent, matrix);\n ctx.save();\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.strokeStyle = '#F90';\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(dx, dy);\n ctx.lineTo(tex.frameWidth + dx, dy);\n ctx.lineTo(tex.frameWidth + dx, tex.frameHeight + dy);\n ctx.lineTo(dx, tex.frameHeight + dy);\n ctx.closePath();\n ctx.stroke();\n ctx.strokeStyle = 'rgba(172, 0, 172, 0.5)';\n ctx.beginPath();\n ctx.moveTo(-tex.frameX + dx, -tex.frameY + dy);\n ctx.lineTo(-tex.frameX + tex.width + dx, -tex.frameY + dy);\n ctx.lineTo(-tex.frameX + tex.width + dx, -tex.frameY + tex.height + dy);\n ctx.lineTo(-tex.frameX + dx, -tex.frameY + tex.height + dy);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n }\n });\n}\n\nexport default {\n canvasSlot,\n canvasTriangle,\n canvasBone,\n};\n","import karas from 'karas';\nimport parser from './parser';\nimport util from './util';\nimport render from './render';\nimport { version } from '../package.json';\n\nlet uuid = 0;\n\nconst SHARE_CACHE = {};\nconst { STYLE_KEY: {\n DISPLAY,\n VISIBILITY,\n OPACITY,\n MARGIN_LEFT,\n PADDING_LEFT,\n BORDER_LEFT_WIDTH,\n MARGIN_TOP,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n WIDTH,\n HEIGHT,\n} } = karas.enums;\n\nclass Dragonbones extends karas.Component {\n componentDidMount() {\n this.init();\n }\n\n shouldComponentUpdate(nextProps) {\n let props = this.props;\n if(nextProps !== props) {\n if(nextProps.ske !== props.ske\n || nextProps.tex !== props.tex\n || nextProps.enlarge !== props.enlarge\n || nextProps.enlargeSlot !== props.enlargeSlot\n && !karas.util.equal(nextProps.enlargeSlot, props.enlargeSlot)) {\n this.init();\n }\n else {\n if(nextProps.armature !== props.armature) {\n this.armature(nextProps.armature, props);\n }\n else {\n if(nextProps.action !== props.action) {\n this.action(nextProps.action);\n }\n if(nextProps.imagePath !== props.imagePath) {\n this.changeImage(nextProps.imagePath);\n }\n if(nextProps.playbackRate !== props.playbackRate && this.animation) {\n this.animation.playbackRate = nextProps.playbackRate;\n }\n if(nextProps.fps !== props.fps && this.animation) {\n this.animation.fps = nextProps.fps;\n }\n }\n }\n }\n return false;\n }\n\n init() {\n let props = this.props;\n let { ske, tex } = props;\n let total = 0;\n if(karas.util.isString(ske)) {\n total++;\n props.loadJson(ske, (res) => {\n total--;\n ske = res;\n this.build(total, ske, tex);\n });\n }\n if(karas.util.isString(tex)) {\n total++;\n props.loadJson(tex, (res) => {\n total--;\n tex = res;\n this.build(total, ske, tex);\n });\n }\n this.build(total, ske, tex);\n }\n\n build(count, ske, tex) {\n if(count !== 0) {\n return;\n }\n let props = this.props;\n this.staticCacheFlag = !!props.staticCache;\n this.staticCacheHash = {};\n ske.uuid = ske.uuid || ++uuid;\n if(ske.version !== '5.5') {\n throw new Error('The version' + ske.version + ' does not match 5.5');\n }\n this.ske = karas.util.clone(ske);\n this.tex = karas.util.clone(tex);\n parser.parseAndLoadTex(this.tex, (texHash) => {\n this.texHash = texHash;\n this.armature(props.armature, props);\n }, props);\n }\n\n armature(name, options = {}) {\n let op = karas.util.extend({}, options);\n op.armature = name;\n let {\n name: n,\n bone,\n boneHash,\n slot,\n slotHash,\n skin,\n skinHash,\n animationHash,\n defaultActions,\n canvas,\n } = parser.parseSke(this.ske, this.texHash, op);\n this.armatureName = n;\n this.bone = bone;\n this.boneHash = boneHash;\n this.slot = slot;\n this.slotHash = slotHash;\n this.skin = skin;\n this.skinHash = skinHash;\n this.animationHash = animationHash;\n this.canvas = canvas;\n\n let defaultAction;\n if(options.action && animationHash[options.action]) {\n let key = options.pause ? 'gotoAndStop' : 'gotoAndPlay';\n defaultAction = {\n [key]: options.action,\n };\n }\n // 不存在或没有指定使用ske文件的第一个\n else if(defaultActions && defaultActions.length) {\n defaultAction = defaultActions[0];\n }\n if(defaultAction) {\n let a = this.action(defaultAction.gotoAndPlay || defaultAction.gotoAndStop);\n if(options.pause || defaultAction.gotoAndStop) {\n a.gotoAndStop(0);\n }\n return a;\n }\n else {\n console.warn('No action data');\n }\n }\n\n action(name) {\n this.actionName = name;\n let animation = this.animationHash[name];\n if(!animation) {\n throw new Error('Can not find animation: ' + name);\n }\n // 清除上次动画的影响\n if(this.animation) {\n util.clearAnimation(this.bone, this.slot);\n }\n let { boneAnimationList, slotAnimationList, ffdAnimationHash, options } = animation;\n if(!karas.util.isNil(this.props.playbackRate)) {\n options.playbackRate = this.props.playbackRate;\n }\n if(!karas.util.isNil(this.props.fps)) {\n options.fps = this.props.fps;\n }\n // 隐藏节点模拟一段不展示的动画,带动每次渲染\n let fake = this.ref.fake;\n fake.clearAnimate();\n let a = this.animation = fake.animate([\n {\n backgroundColor: '#000',\n },\n {\n backgroundColor: '#FFF',\n },\n ], options);\n // 劫持隐藏节点渲染,因本身display:none可以不执行原本逻辑,计算并渲染骨骼动画\n let self = this;\n let computedStyle = self.shadowRoot.computedStyle;\n let root = self.root;\n let width = root.width;\n let height = root.height;\n fake.render = function(renderMode, ctx, dx = 0, dy = 0) {\n if(computedStyle[DISPLAY] === 'none'\n || computedStyle[VISIBILITY] === 'hidden'\n || computedStyle[OPACITY] === 0) {\n return;\n }\n // 开启了静态帧优化优先使用缓存\n let offScreen;\n let sourceCtx;\n let staticKey;\n if(self.staticCacheFlag) {\n offScreen = karas.inject.getCacheCanvas(width, height);\n sourceCtx = ctx;\n ctx = offScreen.ctx;\n let frame = Math.floor(a.currentTime * (self.fps || 60) / 1000);\n // ske文件uuid + 骨架名 + 动画名 + 帧数\n staticKey = self.ske.uuid + '>' + self.armatureName + '>' + self.actionName + '>' + frame;\n let ca = self.staticCacheHash[staticKey];\n if(ca) {\n ctx.putImageData(ca, 0, 0);\n offScreen.draw(ctx);\n sourceCtx.drawImage(offScreen.canvas, 0, 0);\n ctx.clearRect(0, 0, width, height);\n return;\n }\n }\n let { bone, slot, boneHash, slotHash, skinHash, texHash } = self;\n // 动态情况缓存当前帧,为多个实例节省计算\n let dynamicKey = self.ske.uuid + '>' + self.armatureName + '>' + self.actionName;\n let dynamicCache = SHARE_CACHE[dynamicKey];\n if(self.props.share && dynamicCache && dynamicCache.currentTime === a.currentTime) {\n bone = dynamicCache.bone;\n slot = dynamicCache.slot;\n skinHash = dynamicCache.skinHash;\n }\n else {\n let offset = Math.min(1, a.currentTime / a.duration);\n util.animateBoneMatrix(boneAnimationList, offset, boneHash);\n util.mergeBoneMatrix(bone[0]);\n util.animateSlot(slotAnimationList, offset, slotHash);\n util.calSlot(offset, slot, skinHash, bone, boneHash, texHash, ffdAnimationHash);\n SHARE_CACHE[dynamicKey] = {\n bone,\n slot,\n skinHash,\n currentTime: a.currentTime,\n };\n }\n if(renderMode === karas.mode.CANVAS) {\n let { matrixEvent } = self.shadowRoot;\n // 先在dom中居中\n let left = computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT] + computedStyle[WIDTH] * 0.5;\n let top = computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP] + computedStyle[HEIGHT] * 0.5;\n let t = karas.math.matrix.identity();\n t[12] = left;\n t[13] = top;\n // 画布居中\n if(self.canvas) {\n let dx = self.canvas.x || 0;\n let dy = self.canvas.y || 0;\n t[12] -= dx * 0.5;\n t[13] -= dy * 0.5;\n // 适配尺寸\n if(self.props.fitSize) {\n let sx = computedStyle.width / self.canvas.width;\n let sy = computedStyle.height / self.canvas.height;\n t[0] = sx;\n t[5] = sy;\n }\n }\n matrixEvent = karas.math.matrix.multiply(matrixEvent, t);\n render.canvasSlot(ctx, matrixEvent, slot, skinHash, texHash, dx, dy);\n // debug模式\n if(self.props.debug) {\n render.canvasTriangle(ctx, matrixEvent, slot, skinHash, texHash, dx, dy);\n render.canvasBone(ctx, matrixEvent, bone[0], dx, dy);\n }\n else {\n if(self.props.debugBone) {\n render.canvasBone(ctx, matrixEvent, bone[0], dx, dy);\n }\n if(self.props.debugSlot) {\n render.canvasTriangle(ctx, matrixEvent, slot, skinHash, texHash, dx, dy);\n }\n }\n // 静态帧优化将离屏内容绘入\n if(self.staticCacheFlag) {\n offScreen.draw(ctx);\n sourceCtx.drawImage(offScreen.canvas, 0, 0);\n self.staticCacheHash[staticKey] = ctx.getImageData(0, 0, width, height);\n ctx.clearRect(0, 0, width, height);\n }\n }\n };\n return a;\n }\n\n changeImage(src) {\n if(src) {\n let tex = this.tex;\n tex.imagePath = src;\n let texHash = this.texHash;\n karas.inject.measureImg(src, function() {\n tex.SubTexture.forEach(item => {\n let { name } = item;\n texHash[name].source = karas.inject.IMG[src].source;\n });\n });\n }\n }\n\n setStaticCache(flag) {\n this.staticCacheFlag = !!flag;\n }\n\n cleanStaticCache() {\n this.staticCacheHash = {};\n }\n\n render() {\n return <div>\n <$polyline ref=\"fake\"/>\n </div>;\n }\n}\n\nDragonbones.version = version;\n\nexport default Dragonbones;\n"],"names":["inject","karas","math","parseAndLoadTex","tex","cb","props","src","imagePath","texHash","measureImg","SubTexture","forEach","item","name","x","y","width","height","frameX","frameY","frameWidth","frameHeight","source","IMG","parseSke","ske","globalFrameRate","frameRate","armature","currentArmature","i","len","length","Error","console","warn","bone","slot","skin","animation","defaultActions","canvas","boneHash","parseBone","slotHash","parseSlot","skinHash","parseSkin","animationHash","parseAnimation","data","hash","root","children","parent","transform","push","index","matrix","identity","m","multiply","skX","d","geom","d2r","sin","Math","cos","scX","undefined","scY","slotName","display","type","path","vertices","triangles","uvs","weights","bonePose","weightHash","bonePoseHash","verticesIndex","num","list","j","value","slice","coords","calPoint","pose","verticesList","res","weightList","weight","x0","y0","x1","y1","dx","dy","theta","atan","abs","PI","rotate","translate","triangleList","i1","i2","i3","p1x","p1y","p2x","p2y","p3x","p3y","x2","y2","x3","y3","triangleIncentre","px","parseFloat","enlarge","isNaN","enlargeSlot","hasOwnProperty","n","scale","triangleScale","t","sx1","sy1","sx2","sy2","sx3","sy3","round","indexList","scaleCoords","a","b","c","sqrt","pow","duration","playTimes","ffd","options","iterations","Infinity","fill","boneAnimationList","map","translateFrame","rotateFrame","scaleFrame","originTransform","offsetSum","last","frame","easingFn","getEasing","offset","translateX","translateY","rotateZ","dz","scaleX","scaleY","slotAnimationList","displayFrame","colorFrame","aM","da","ffdAnimationHash","ffdAnimationList","os","unshift","verticesLast","dv","max","curve","animate","easing","cubicBezier","animateBoneMatrix","animationList","frames","binarySearch","current","next","total","percent","matrixA","middle","min","mergeBoneMatrix","currentMatrix","mergeChildBoneMatrix","parentMatrix","animateSlot","displayIndexA","colorA","calSlot","displayIndex","displayTarget","boneMatrix","parentBoneMatrix","offsetMatrix","matrixF","target","concat","tar","exchangeOrder","source1","target1","clearAnimation","canvasBone","ctx","matrixEvent","setTransform","beginPath","strokeStyle","lineWidth","arc","moveTo","lineTo","closePath","stroke","canvasSlot","blendMode","color","globalCompositeOperation","opacity","globalAlpha","save","clip","drawImage","restore","canvasTriangle","fillStyle","uuid","SHARE_CACHE","enums","STYLE_KEY","DISPLAY","VISIBILITY","OPACITY","MARGIN_LEFT","PADDING_LEFT","BORDER_LEFT_WIDTH","MARGIN_TOP","PADDING_TOP","BORDER_TOP_WIDTH","WIDTH","HEIGHT","Dragonbones","init","nextProps","util","equal","action","changeImage","playbackRate","fps","isString","loadJson","build","count","staticCacheFlag","staticCache","staticCacheHash","version","clone","parser","op","extend","armatureName","defaultAction","key","pause","gotoAndPlay","gotoAndStop","actionName","isNil","fake","ref","clearAnimate","backgroundColor","self","computedStyle","shadowRoot","render","renderMode","offScreen","sourceCtx","staticKey","getCacheCanvas","floor","currentTime","ca","putImageData","draw","clearRect","dynamicKey","dynamicCache","share","mode","CANVAS","left","top","fitSize","sx","sy","debug","debugBone","debugSlot","getImageData","flag","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAQA,MAAR,GAAyBC,KAAzB,CAAQD,MAAR;AAAA,IAAgBE,MAAhB,GAAyBD,KAAzB,CAAgBC,IAAhB,CAAA;;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