<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:editor="http://vscxml.com/editor" version="1.0" datamodel="ecmascript" initial="idle" name="DeepHistoryDemo">
  <datamodel>
    <data id="suspendCount" expr="0"/>
  </datamodel>
  <state id="idle" editor:x="50" editor:y="50" editor:width="120" editor:height="80" editor:label="idle" editor:color="#ffffff" editor:zIndex="0">
    <onentry>
      <log label="App" expr="'Application idle. Send \&quot;start\&quot; to begin.'"/>
    </onentry>
    <transition target="editor" event="start" editor:id="t_01KEFQX2HEP43WE297ZK4FB4EP"/>
  </state>
  <state id="editor" initial="document" editor:x="320" editor:y="50" editor:width="1261" editor:height="455.53086419753083" editor:label="editor" editor:color="#e0f2fe" editor:zIndex="335">
    <onentry>
      <log label="App" expr="'Editor active'"/>
    </onentry>
    <transition target="suspended" event="suspend" editor:waypoints="249,422.44513031550065;249,465.53086419753083" editor:labelAnchor="1,-48,-11.890260631001297" editor:id="t_01KEFQX2HF7X6M5Y31XEF9V6S4">
      <assign location="suspendCount" expr="suspendCount + 1"/>
      <log label="App" expr="'Suspended (count: ' + suspendCount + ')'"/>
    </transition>
    <transition target="settings" event="settings" editor:id="t_01KEFQX2HFT3ZMNYM7T16GF30K"/>
    <state id="document" initial="editing" editor:x="200" editor:y="30" editor:width="797" editor:height="383" editor:label="document" editor:color="#e0f2fe" editor:zIndex="336">
      <onentry>
        <log label="Editor" expr="'Document view active'"/>
      </onentry>
      <transition target="preview" event="preview" editor:waypoints="1495,345" editor:id="t_01KEFQX2HFVRHD09AF5BK6NBF6"/>
      <state id="editing" initial="insert" editor:x="30" editor:y="30" editor:width="728" editor:height="200" editor:label="editing" editor:color="#e0f2fe" editor:zIndex="337">
        <onentry>
          <log label="Editor" expr="'Editing mode'"/>
        </onentry>
        <state id="insert" editor:x="30" editor:y="30" editor:width="120" editor:height="80" editor:label="insert" editor:color="#ffffff" editor:zIndex="338">
          <onentry>
            <log label="Mode" expr="'INSERT mode - type to insert text'"/>
          </onentry>
          <transition target="command" event="escape" editor:waypoints="779,194" editor:id="t_01KEFQX2HFFJAAX18DC91K4HY2"/>
        </state>
        <state id="command" editor:x="308.5" editor:y="30" editor:width="120" editor:height="80" editor:label="command" editor:color="#ffffff" editor:zIndex="339">
          <onentry>
            <log label="Mode" expr="'COMMAND mode - use commands'"/>
          </onentry>
          <transition target="insert" event="i" editor:waypoints="778,160" editor:id="t_01KEFQX2HFQJXTYCV4BA22CMTE"/>
          <transition target="visual" event="v" editor:waypoints="1052,196" editor:id="t_01KEFQX2HFVAQAFF2NBWYXNMAJ"/>
        </state>
        <state id="visual" editor:x="583" editor:y="30" editor:width="120" editor:height="80" editor:label="visual" editor:color="#ffffff" editor:zIndex="340">
          <onentry>
            <log label="Mode" expr="'VISUAL mode - select text'"/>
          </onentry>
          <transition target="command" event="escape" editor:waypoints="1053,160" editor:id="t_01KEFQX2HF9DHMA41GYHA48GGK"/>
        </state>
      </state>
    </state>
    <state id="preview" editor:x="1115" editor:y="39" editor:width="120" editor:height="80" editor:label="preview" editor:color="#ffffff" editor:zIndex="341">
      <onentry>
        <log label="Editor" expr="'Preview mode - read only'"/>
      </onentry>
      <transition target="document" event="edit" editor:id="t_01KEFQX2HFCCK69THBQ5Q3NWBE"/>
    </state>
    <state id="settings" editor:x="30" editor:y="30" editor:width="120" editor:height="80" editor:label="settings" editor:color="#ffffff" editor:zIndex="342">
      <onentry>
        <log label="Editor" expr="'Settings panel'"/>
      </onentry>
      <transition target="document" event="close" editor:id="t_01KEFQX2HFJ6SVK1R4642DBGCK"/>
    </state>
    <history id="editor_deep_history" type="deep" editor:x="30" editor:y="160" editor:width="50" editor:height="50" editor:label="H*" editor:color="#ffffff" editor:zIndex="343"><transition target="document" editor:waypoints="450.5,235" editor:labelAnchor="0,30.5,-13" editor:id="t_01KEFQX2HFYDACFRMGJ25B25C6"/></history>
    <history id="editor_shallow_history" type="shallow" editor:x="30" editor:y="260" editor:width="50" editor:height="50" editor:label="H" editor:color="#ffffff" editor:zIndex="344"><transition target="document" editor:waypoints="464,335" editor:labelAnchor="0,16,-15" editor:id="t_01KEFQX2HFR1QCTZV2MD84QDT7"/></history>
  </state>
  <state id="suspended" editor:x="50" editor:y="425.53086419753083" editor:width="120" editor:height="80" editor:label="suspended" editor:color="#ffffff" editor:zIndex="330">
    <onentry>
      <log label="App" expr="'Application suspended. Send \&quot;resume_deep\&quot; or \&quot;resume_shallow\&quot;'"/>
    </onentry>
    <transition target="editor_deep_history" event="resume_deep" editor:waypoints="122,235;269,235" editor:id="t_01KEFQX2HF5RCJZYFWX0H7A5CN">
      <log label="App" expr="'Resuming with DEEP history (full state restored)'"/>
    </transition>
    <transition target="editor_shallow_history" event="resume_shallow" editor:waypoints="148,335;269,335" editor:id="t_01KEFQX2HFH0EWG2TVCFKM8QTM">
      <log label="App" expr="'Resuming with SHALLOW history (only direct child restored)'"/>
    </transition>
    <transition target="idle" event="quit" editor:waypoints="91,318.7654320987654" editor:labelAnchor="0,20,-170" editor:id="t_01KEFQX2HF14XXXH2YP1G9DJ25"/>
  </state>
</scxml>