/****************************************************************************
 ** @license
 ** This demo file is part of yFiles for HTML 3.1.0.2+demo4.
 ** Copyright (c) 2026 by yWorks GmbH, Vor dem Kreuzberg 28,
 ** 72070 Tuebingen, Germany. All rights reserved.
 **
 ** yFiles demo files exhibit yFiles for HTML functionalities. Any redistribution
 ** of demo files in source code or binary form, with or without
 ** modification, is not permitted.
 **
 ** Owners of a valid software license for a yFiles for HTML version that this
 ** demo is shipped with are allowed to use the demo source code as basis
 ** for their own yFiles for HTML powered applications. Use of such programs is
 ** governed by the rights and conditions as set out in the yFiles for HTML
 ** license agreement.
 **
 ** THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
 ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
 ** NO EVENT SHALL yWorks BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 **
 ***************************************************************************/
/****************************************************************************
 ** @license
 ** This demo file is part of yFiles for HTML 3.1.0.2+demo4.
 ** Copyright (c) 2026 by yWorks GmbH, Vor dem Kreuzberg 28,
 ** 72070 Tuebingen, Germany. All rights reserved.
 **
 ** yFiles demo files exhibit yFiles for HTML functionalities. Any redistribution
 ** of demo files in source code or binary form, with or without
 ** modification, is not permitted.
 **
 ** Owners of a valid software license for a yFiles for HTML version that this
 ** demo is shipped with are allowed to use the demo source code as basis
 ** for their own yFiles for HTML powered applications. Use of such programs is
 ** governed by the rights and conditions as set out in the yFiles for HTML
 ** license agreement.
 **
 ** THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
 ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
 ** NO EVENT SHALL yWorks BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 **
 ***************************************************************************/
/* poppins-devanagari-600-normal */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./poppins-devanagari-600-normal-STEjXBNN.woff2) format('woff2'), url(./poppins-devanagari-600-normal-ClASKHrr.woff) format('woff');
  unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09;
}

/* poppins-latin-ext-600-normal */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./poppins-latin-ext-600-normal-CAhIAdZj.woff2) format('woff2'), url(./poppins-latin-ext-600-normal-Df5ffKXP.woff) format('woff');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* poppins-latin-600-normal */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./poppins-latin-600-normal-zEkxB9Mr.woff2) format('woff2'), url(./poppins-latin-600-normal-BJdTmd5m.woff) format('woff');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* poppins-devanagari-400-normal */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./poppins-devanagari-400-normal-CJDn6rn8.woff2) format('woff2'), url(./poppins-devanagari-400-normal-CqVvlrh5.woff) format('woff');
  unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09;
}

/* poppins-latin-ext-400-normal */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./poppins-latin-ext-400-normal-by3JarPu.woff2) format('woff2'), url(./poppins-latin-ext-400-normal-DaBSavcJ.woff) format('woff');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* poppins-latin-400-normal */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./poppins-latin-400-normal-cpxAROuN.woff2) format('woff2'), url(./poppins-latin-400-normal-BOb3E3N0.woff) format('woff');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* material-symbols-outlined-latin-300-normal */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url(./material-symbols-outlined-latin-300-normal-CWqEDh7P.woff2) format('woff2'), url(./material-symbols-outlined-latin-300-normal-UcP-3lp0.woff) format('woff');
}

/* Layout of the page: header, main area */

:root {
  --text-color: #2a3e50;
  --panel-bg-color: #e8edf2;
  --text-accent-color: #00adcc;

  --size-h1: 2rem;
  --size-h2: 1.5rem;
  --size-h3: 1.2rem;

  --gap: 8px;
  --border-radius: 12px;
  --description-width: 300px;
}

html,
body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  box-sizing: border-box;
}

.demo-app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.demo-header {
  flex: 0 0 70px;
  height: 70px;
}

.demo-main {
  flex: 1 1 auto;
  min-height: 0; /* allows scrolling content inside the remaining space */
  overflow: auto;
  padding: 0 var(--gap) var(--gap);
}

/* Layout of the main area: component-panel, interaction-panel, description-panel */

.demo-main {
  display: flex;
  gap: var(--gap);
  align-items: stretch;

  > * {
    min-width: 0;
    position: relative;
  }
}

/* The graph component gets all remaining space */
.demo-main__component-panel {
  flex: 1 1 0;
}

/* These panels have a fixed width */
.demo-main__description-panel,
.demo-main__interaction-panel {
  flex: 0 0 var(--description-width);
}

/* Theme: colors, font, etc.*/

body {
  color: var(--text-color);
  background-color: var(--panel-bg-color);
  font-family: 'poppins', sans-serif;
}

button {
  color: inherit;
  font-family: inherit;
}

.demo-main__description-panel,
.demo-main__interaction-panel {
  background-color: #ffffff;
  font-weight: 400;
  font-size: 0.875rem;

  border-radius: var(--border-radius);
  padding: var(--border-radius);
  overflow: auto;

  h1,
  h2,
  h3 {
    margin: 1.25em 0 0.5em 0;
    line-height: 130%;
    hyphens: auto;
  }

  :first-child,
  h1 {
    margin-top: 0;
  }

  /* Additional small heading above the h1 */
  .subheading {
    font-size: 1rem;
    color: color-mix(in oklch, var(--text-color) 60%, white);
    font-weight: 700;
  }

  a {
    color: var(--text-color);
    &:hover {
      text-decoration-thickness: 2px;
    }
  }

  ul {
    padding-inline-start: 1.5em;
  }

  li + li {
    margin-top: 0.5em;
  }
}

.demo-main__component-panel {
  border-radius: var(--border-radius);
  background-color: #ffffff;
}

.demo-main__description-panel {
  h1 {
    color: var(--text-accent-color);
    font-size: var(--size-h1);
    font-weight: 600;
  }

  h2 {
    font-size: var(--size-h2);
  }

  h3 {
    font-size: var(--size-h3);
  }
}

.demo-main__interaction-panel {
  h2 {
    color: var(--text-accent-color);
    font-size: var(--size-h2);
    font-weight: 600;
  }
}

/* Header */

.demo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 0 92px;

  font-weight: 400;

  a {
    text-decoration: none;
    color: inherit;
  }

  .y-logo {
    width: 12em;
    height: 100%;
    margin: 4px 4px 4px 16px;
    mask: url('./ylogo-large-Bw46093E.svg') no-repeat center;
    background-color: var(--text-color);
  }

  .breadcrumb-wrapper {
    font-size: 1.125em;
  }
}

/* Misc */

.material-symbols-outlined {
  font-variation-settings: 'GRAD' 30;
  font-family: 'Material Symbols Outlined', sans-serif;
  font-weight: 270;
  font-optical-sizing: auto;
  font-style: normal;
  font-size: 1.5em;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
}
/****************************************************************************
 ** @license
 ** This demo file is part of yFiles for HTML 3.1.0.2+demo4.
 ** Copyright (c) 2026 by yWorks GmbH, Vor dem Kreuzberg 28,
 ** 72070 Tuebingen, Germany. All rights reserved.
 **
 ** yFiles demo files exhibit yFiles for HTML functionalities. Any redistribution
 ** of demo files in source code or binary form, with or without
 ** modification, is not permitted.
 **
 ** Owners of a valid software license for a yFiles for HTML version that this
 ** demo is shipped with are allowed to use the demo source code as basis
 ** for their own yFiles for HTML powered applications. Use of such programs is
 ** governed by the rights and conditions as set out in the yFiles for HTML
 ** license agreement.
 **
 ** THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
 ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
 ** NO EVENT SHALL yWorks BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 **
 ***************************************************************************/
.component-toolbar {
  --toolbar-color: #2a3e50;
  --toolbar-bg: #f2f5f8;
  --toolbar-hover: #aec3d5;
  --toolbar-height: 44px;
  --toolbar-font-size: 14px;
  --toolbar-padding: 4px;

  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);

  height: var(--toolbar-height);
  box-sizing: border-box;
  padding: var(--toolbar-padding) 6px;
  z-index: 2;

  font-size: var(--toolbar-font-size);
  display: flex;
  gap: calc(0.5 * var(--toolbar-padding));
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;

  color: var(--toolbar-color);
  background: var(--toolbar-bg);

  box-shadow:
    0 5px 20px rgba(0, 0, 0, 0.1),
    0 3px 10px rgba(0, 0, 0, 0.1),
    0 1px 5px rgba(0, 0, 0, 0.15);

  border-radius: 999px;
  user-select: none;

  button,
  .input {
    display: inline-flex;
    align-items: center;
    gap: var(--toolbar-padding);

    border: none;
    border-radius: 99px;
    background-color: transparent;

    &,
    label,
    input[type='checkbox'] {
      cursor: pointer;
    }

    &:hover {
      background-color: var(--toolbar-hover);
    }
  }

  button,
  input,
  select {
    font-family: 'poppins', sans-serif;

    &.material-symbols-outlined {
      font-family: 'Material Symbols Outlined', sans-serif;
    }
  }

  button {
    height: 100%;
    aspect-ratio: 1;

    &.labeled {
      width: fit-content;
      height: calc(var(--toolbar-height) - 3 * var(--toolbar-padding));
      aspect-ratio: unset;
      background-position: 50% 50%;

      &:active {
        background-color: #0000001f;
      }
    }
  }

  .input {
    height: calc(var(--toolbar-height) - 3 * var(--toolbar-padding));
    padding-inline: 8px;
  }

  input[type='text'] {
    width: 15ex;

    border: none;
    border-bottom: 1px solid var(--toolbar-color);
    border-radius: 4px 4px 0 0;
    outline: 0;

    background-color: unset;
  }

  .separator {
    width: 1px;
    height: 1.75rem;
    margin-inline: calc(0.5 * var(--toolbar-padding));
    background: var(--toolbar-color);
  }
}
/****************************************************************************
 ** @license
 ** This demo file is part of yFiles for HTML 3.1.0.2+demo4.
 ** Copyright (c) 2026 by yWorks GmbH, Vor dem Kreuzberg 28,
 ** 72070 Tuebingen, Germany. All rights reserved.
 **
 ** yFiles demo files exhibit yFiles for HTML functionalities. Any redistribution
 ** of demo files in source code or binary form, with or without
 ** modification, is not permitted.
 **
 ** Owners of a valid software license for a yFiles for HTML version that this
 ** demo is shipped with are allowed to use the demo source code as basis
 ** for their own yFiles for HTML powered applications. Use of such programs is
 ** governed by the rights and conditions as set out in the yFiles for HTML
 ** license agreement.
 **
 ** THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
 ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
 ** NO EVENT SHALL yWorks BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 **
 ***************************************************************************/
:root[data-theme='light'] {
  .editor-panel {
    --switch-bg-color: #0004;
    --switch-bg-color-hover: #aec3d5;
  }
}

:root[data-theme='dark'] {
  .editor-panel {
    --switch-bg-color: #fff4;
    --switch-bg-color-hover: #aec3d5;
  }
}

.editor-panel {
  --editor-bg-color: #ffffff;

  --apply-color-accent: #00adcc;
  --apply-color-hover: #ffffff;
  --slider-bg-color: #ffffff;

  --editor-font-size: 13px;
  --editor-border: 1px solid #ddd;

  --error-text-color: #ffffff;
  --error-bg-color: #f44336;

  display: flex;
  flex-direction: column;

  box-sizing: border-box;

  .heading-row {
    margin: 2ex 0 1ex;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    &:first-child {
      margin-block-start: 0;
    }

    h2 {
      margin: 0;
    }
  }

  .editorText {
    font-family: 'Consolas', 'Courier New', Courier, mono, serif;
    font-size: var(--editor-font-size);
  }

  #templateEditorContainer {
    flex: 0 1 70%;
    min-height: 0;
  }

  #tagEditorContainer {
    flex: 0 1 fit-content;
    min-height: 0;
  }

  .cm-editor {
    height: 100% !important;
    background-color: var(--editor-bg-color);
    border: var(--editor-border);
  }

  .error {
    display: none;
    color: var(--error-text-color);
    font-size: 1rem;
    font-weight: bold;
    vertical-align: baseline;
    text-align: center;
    height: 0;
    margin-left: 1rex;
    transition:
      height 0.3s ease,
      display 0.3s ease allow-discrete;

    &.open-error {
      display: flex;
      height: 1.5rem;
      background-color: var(--error-bg-color);
      padding: 2px 4px;
    }
  }

  @starting-style {
    .error.open-error {
      height: 0;
    }
  }

  #template-text-area-error {
    bottom: 250px;
  }

  #tag-text-area-error {
    bottom: 15px;
  }

  .apply-button {
    margin: 1ex 0 1ex 0;
    padding: 4px 8px;

    color: var(--apply-color-accent);
    background-color: transparent;
    border: 1px solid var(--apply-color-accent);
    border-radius: 99px;
    cursor: pointer;

    &:hover {
      color: var(--apply-color-hover);
      background-color: var(--apply-color-accent);
    }

    &:disabled {
      color: var(--apply-color-hover);
      background-color: #a0a0a0;
      border-color: #a0a0a0;
    }
  }
}

/*
 Displays labels to the left and right of the .switch.
 To make it possible to toggle the switch on the label texts, make this element the <label>.
 */
.labeled-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

/*
 An iOS-style switch based on an invisible checkbox.
 For user interaction to work, either this element or .labeled-switch must be a <label>.
 */
.switch {
  position: relative;
  display: block;
  height: 1.25em;
  aspect-ratio: 2;

  box-sizing: border-box;
  padding: 3px;
  container-type: size;

  background-color: var(--switch-bg-color);
  border-radius: 99px;
  transition: 0.4s;
  user-select: none;
  cursor: pointer;

  /* Hide the checkbox and move it out of the way */
  input {
    position: absolute;
    width: 0;
    height: 0;
  }

  &:before {
    display: block;
    height: 100%;
    aspect-ratio: 1;
    content: '';
    background-color: var(--slider-bg-color);
    transition: 0.4s;
    border-radius: 99px;
  }

  &:hover {
    background-color: var(--switch-bg-color-hover);
  }

  &:has(input:checked):before {
    transform: translateX(calc(100cqw - 100%));
  }
}

/* Demo-specific adjustments */

/* The editor panel should be wider than the description */
.demo-main__interaction-panel {
  flex: 1 1 0;
}

#graphComponent {
  width: 100%;
  height: 100%;
}
