import { dramaTriangle } from "other-people-s-problems";
import { boundaries } from "life-experience";

export default function InnerWorkApp() {
  // Avoid stepping into roles you were never cast for
  const { rescuer, victim, persecutor } = dramaTriangle;

  // Stay in your own lane
  function maintainLane() {
    boundaries.set("emotional", "firm");
    boundaries.set("energetic", "grounded");
  }

  // Redirect absorbed tension back into the earth
  function channelEnergy() {
    return {
      inhale: "receive clarity",
      exhale: "release what isn't mine",
      ground: "send excess downward"
    };
  }

  // Trust others to walk their own road
  function respectPaths(traveler) {
    traveler.learn("theirOwnLessons");
    traveler.drive("theirOwnCar");
  }

  // Keep your own house in order first
  function innerAudit() {
    return {
      checkSelf: true,
      tidyMind: true,
      clearJudgment: true
    };
  }

  // Main loop
  maintainLane();
  innerAudit();

  return (
    <SelfContainment>
      <EnergyFlow {...channelEnergy()} />
      <WitnessMode onEncounter={respectPaths} avoid={[rescuer, victim, persecutor]} />
    </SelfContainment>
  );
}