/** @license MIT | @cube-dev/ui-kit v0.127.0 | Cube Dev Team */
import { _PrismCode } from "../PrismCode/PrismCode.js";
import { jsx } from "react/jsx-runtime";
import { diffLines } from "diff";

//#region src/components/content/PrismDiffCode/PrismDiffCode.tsx
function PrismDiffCode({ original, modified, ...props }) {
	return /* @__PURE__ */ jsx(_PrismCode, {
		code: diffLines(original, modified).map((part) => {
			const value = part.value.trimEnd();
			if (part.added) return value.split("\n").map((val) => {
				return val ? `+${val}` : "";
			}).join("\n");
			if (part.removed) return value.split("\n").map((val) => {
				return val ? `-${val}` : "";
			}).join("\n");
			return value.split("\n").map((val) => {
				return val ? ` ${val}` : "";
			}).join("\n");
		}).join("\n"),
		...props
	});
}

//#endregion
export { PrismDiffCode };
//# sourceMappingURL=PrismDiffCode.js.map