"use strict";
/* Socket Lib - Built with esbuild */
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var shimmer_keyframes_exports = {};
__export(shimmer_keyframes_exports, {
  toShimmerKeyframes: () => toShimmerKeyframes
});
module.exports = __toCommonJS(shimmer_keyframes_exports);
var import_shimmer = require("./shimmer");
function toShimmerKeyframes(spec, textLength, frames) {
  const tracks = [];
  for (let i = 0; i < textLength; i++) {
    tracks.push({ times: [], values: [] });
  }
  for (let f = 0; f < frames; f++) {
    const t = f / frames;
    const colors = (0, import_shimmer.frameColors)(spec, textLength, f);
    for (let i = 0; i < textLength; i++) {
      const c = colors[i];
      const v = `rgb(${c[0]},${c[1]},${c[2]})`;
      const track = tracks[i];
      if (track.values[track.values.length - 1] !== v) {
        track.times.push(t);
        track.values.push(v);
      }
    }
  }
  for (let i = 0; i < textLength; i++) {
    const track = tracks[i];
    track.times.push(1);
    track.values.push(track.values[0] ?? "rgb(0,0,0)");
  }
  return tracks;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  toShimmerKeyframes
});
