// Copyright 2014-2025 Jesper Larsson
//
// This file is part of Klipspringer, <https://klipspringer.avadeaux.net/>
//
// Klipspringer is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// Klipspringer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with Klipspringer. If
// not, see <https://www.gnu.org/licenses/>.

const bbor = '<rect x="1" y="1" width="48" height="48" fill="transparent" stroke-width="1" rx="10" ry="10" />';
const bpaths = {
    // CD player buttons, width 50.
    stop: bbor+'<path stroke="none" d="M 15 15 h 20 v 20 h -20 z" />',
    play: bbor+'<path stroke="none" d="M 18 15 l 16 10 l -16 10 z" />',
    pause: bbor+'<path stroke="none" d="M 17 15 h 6 v 20 h -6 z M 33 15 h -6 v 20 h 6 z" />',
    rew: bbor+'<path stroke="none" d="M 12 25 l 12 -10 v 20 z M 24 25 l 12 -10 v 20 z" />',
    ffd: bbor+'<path stroke="none" d="M 38 25 l -12 -10 v 20 z M 26 25 l -12 -10 v 20 z" />',
    xrew: bbor+'<path stroke="none" d="M 6 25 l 12 -10 v 20 z M 18 25 l 12 -10 v 20 z M 30 25 l 12 -10 v 20 z" />',
    xffd: bbor+'<path stroke="none" d="M 44 25 l -12 -10 v 20 z M 32 25 l -12 -10 v 20 z M 20 25 l -12 -10 v 20 z" />',
    prev: bbor+'<path stroke="none" d="M 17 15 h 4 v 20 h -4 z M 21 25 l 12 -10 v 20 z" />',
    next: bbor+'<path stroke="none" d="M 33 15 h -4 v 20 h 4 z M 29 25 l -12 -10 v 20 z" />',
    rec: bbor+'<circle stroke="red" fill="red" cx="25" cy="25" r="11" />',
    home: '<path fill="transparent" stroke-width="1.5" stroke-linejoin="round"\n'
        + 'd="M 14 35 v -14 l 11 -9 l 11 9 v 14 h -8 v -7 a 1.5 1.5 0 0 0 -1.5 -1.5 h -3 a 1.5 1.5 0 0 0 -1.5 1.5 v 7 z" />',
    phones: '<g transform="translate(5 5) scale(0.1 0.1)">'
        +'     <path stroke="none" fill="transparent" d="M59,350 A190,185 0 1 1 341,350 z" />'
        +'     <path id="left-headphone" fill="black"'
        +'           d="M59,189 L77,181 C107,168 114,202 124,259 C135,320 139,350 106,350 L87,349'
        +'              M82,349 L50,349 C32,302 22,251 22,201 L54,191'
        +'              M200,17 C150,17 68,37 26,130 L31,133 C26,141 23,152 21,159 L16,158 C2,196 5,248 23,296 L37,302 C24,258 19,199 34,162 L30,161 C32,153 35,145 39,137 L42,138 C74,76 145,41 200,42" />'
        +'     <use href="#left-headphone" transform="translate(400 0) scale(-1 1)" />'
        +'</g>',
    speakers: '<g fill="transparent">'
        +'       <rect x="0" y="8" width="50" height="34" rx="8" stroke="none" />'
        +'       <g id="left-speaker">'
        +'         <rect x="0" y="8" width="23" height="34" rx="8" stroke-width="1.5" />'
        +'         <circle cx="11.5" cy="31" r="6" stroke-width="4" />'
        +'         <circle cx="11.5" cy="31" fill="black" stroke="none" r="3" />'
        +'         <circle cx="11.5" cy="17" r="4" stroke-width="3" />'
        +'         <circle cx="11.5" cy="17" fill="black" stroke="none" r="1.5" />'
        +'       </g>'
        +'       <use href="#left-speaker" x="27" />'
        +'     </g>',

    // Track buttons, width 32
    playtrack: '<path stroke="black" stroke-width="3" stroke-linejoin="round" d="M 9 6 l 15 9 l -15 9 z" />',
    download: '<path stroke="black" fill="transparent" stroke-width="3" stroke-linejoin="round" stroke-linecap="round"'
        +     '      d="M 2 23 v 5 h 28 v -5 M 11 17 l 5 5 l 5 -5 M 16 20 v -16" />',
    remove: '<g stroke="black" fill="transparent" stroke-width="3" stroke-linejoin="round" stroke-linecap="round">'
        +   '    <path d="M 8 13 v 12 a 8 3 0 0 0 16 0 v -12 m 1.5 -4.5 h -19 z" />'
        +   '    <path stroke-width="2" d="M 12 7.5 v -4.5 h 8 v 4.5" /> '
        +   '</g>'
}

const svgButtons = (rows, bw, marg) => {
    const maxCols = rows.map(a => a.length).reduce((l, m) => Math.max(l, m));
    const width = maxCols*bw + (maxCols+1)*marg;
    const height = rows.length*bw + (rows.length+1)*marg;

    let svg = '<svg xmlns="http://www.w3.org/2000/svg" width="'+width+'" height="'+height+'">\n';
    let y = marg;
    for (const r of rows) {
        let x = marg + (r[0] !== 'home' ? (width - (r.length*bw + (r.length+1)*marg))/2 : 0);
        for (const b of r) {
            svg += '<g transform="translate('+x+', '+y+')" stroke="black" id="b:'+b+'" class="click-choose">\n'+bpaths[b]+'</g>\n';
            x += bw+marg;
        }
        y += bw+marg;
    }
    svg += '</svg>\n'

    return svg;
}

export const serverButtons = svgButtons([['prev', 'next'], ['stop', 'pause', 'play'], ['xrew', 'rew', 'ffd', 'xffd'], ['home', 'phones']], 50, 8);
export const clientButtons = svgButtons([['prev', 'pause', 'play', 'next'], ['xrew', 'rew', 'ffd', 'xffd'], ['home', 'speakers']], 50, 8);
export const deviceButtons = svgButtons([['rec', 'stop'], ['home']], 50, 8);
export const webPlayButtons = svgButtons([['play', 'prev', 'next'], ['pause', 'rew', 'ffd' ]], 50, 8);
export const webRecButtons = svgButtons([['rec', 'stop']], 50, 16);
export const recordingButtons = svgButtons([['download', 'playtrack']], 30, 12);

// Parameters to logo computation.

const barw = 180;
const barh = 600;
const triw = 360;

const r = 60;

// Computation of the K.

const trih2 = barh/2;
const h0 = Math.sqrt(trih2*trih2 + triw*triw);

const beta = Math.atan2(triw, trih2)/2;
const k1 = r/Math.tan(beta);
const k2 = trih2 * (1 - k1/h0);
const k3 = k2*triw/trih2;

const alpha = Math.atan2(trih2, triw);
const k4 = r*triw/trih2;
const cosa = Math.cos(alpha);
const k5 = k4*cosa;
const k6 = k4*Math.sqrt(1 - cosa*cosa);

const pointy = barh/2;

const f = new Intl.NumberFormat(undefined, { useGrouping: false, maximumFractionDigits: 1 });

const kS =
      '<rect x="0" y="0" width="'+f.format(barw)+'" height="'+f.format(barh)+'" rx="'+f.format(r)+'" ry="'+f.format(r)+'" />\n'+
      '<path d="M '+f.format(barw+k5)+' '+f.format(pointy+k6)+'\n'+
      '         A '+f.format(r)+' '+f.format(r)+' 0 0 1 '+f.format(barw+k5)+' '+f.format(pointy-k6)+'\n'+
      '         L '+f.format(barw+k3)+' '+f.format(pointy-k2)+'\n'+
      '         A '+f.format(r)+' '+f.format(r)+' 0 0 1 '+f.format(barw+triw)+' '+f.format(k1)+'\n'+
      '         L '+f.format(barw+triw)+' '+f.format(barh-k1)+'\n'+
      '         A '+f.format(r)+' '+f.format(r)+' 0 0 1 '+f.format(barw+k3)+' '+f.format(pointy+k2)+'\n'+
      '         z" />\n'+
      '<path d="M -419.917 -2975.118\n'+
      '         c 20.0038 156.532 39.2584 316.582 57.7496 479.893\n'+
      '         c 18.4987 163.378 36.4123 331.682 58.9513 472.63\n'+
      '         c 34.6299 216.558 80.5557 357.449 124.7341 272.025\n'+
      '         c 17.2817 -33.416 32.5916 -102.446 42.0999 -203.632\n'+
      '         c 20.2501 -215.5 9.843 -488.191 -5.9927 -729\n'+
      '         c -17.6555 -268.482 -40.6209 -548.175 -26.8135 -821.723\n'+
      '         c 17.3713 -344.156 77.27167 -456.391 134.68141 -441.805\n'+
      '         c 46.04245 11.697 91.32769 81.251 136.22229 155.768\n'+
      '         c 121.322 201.372 241.2992 440.281 359.5374 715.943"\n'+
      '      fill="none"\n'+
      '      stroke="#c318b3"\n'+
      '      stroke-width="60"\n'+
      '      stroke-linecap="round"\n'+
      '      transform="matrix(-0.6512 0.60644 -0.09768 -0.09096635 3.12161 23.037615)" />\n';
const logo =
      '<g transform="matrix(0.3125 0 0 0.3125 43.625 22.25)">\n'+
      kS+
      '</g>\n'+

      // Text converted to path: inkscape --export-type=svg --export-plain-svg --export-text-to-path
      // '  <text text-anchor="middle"\n'+
      // '        x="128" y="235"\n'+
      // '        font-family="Bembo Std" font-size="17"\n'+
      // '        stroke="none" fill="#5e5e5e">K L I P S P R I N G E R</text>\n';

      ' <path d="m 52.0271,235 h -4.98877 v -0.32373 q 0.589356,-0.0166 0.84668,-0.12451 0.265625,-0.10791 0.265625,-0.34864 0,-0.24072 -0.448242,-0.81347 -0.439942,-0.57276 -1.643555,-1.77637 -1.020996,-1.02099 -1.494141,-1.30322 -0.464843,-0.28223 -1.020996,-0.22412 v 3.1792 q 0,0.80517 0.282227,1.1123 0.282226,0.29883 1.070801,0.29883 H 45.12085 V 235 h -4.656739 v -0.32373 h 0.307129 q 0.788574,0 1.070801,-0.28223 0.290527,-0.28222 0.290527,-0.95459 v -7.4624 q 0,-0.73047 -0.315429,-0.97949 -0.31543,-0.24902 -1.045899,-0.24902 h -0.307129 v -0.32374 h 4.590332 v 0.32374 h -0.157714 q -0.763672,0 -1.0625,0.29052 -0.290528,0.29053 -0.290528,1.0542 v 3.66895 q 0.498047,-0.0498 0.929688,-0.29883 0.43164,-0.24902 0.971191,-0.78858 0.987793,-0.98779 1.676758,-1.98388 0.688965,-0.9961 0.688965,-1.41113 0,-0.29883 -0.249024,-0.41504 -0.249023,-0.11621 -0.929687,-0.11621 v -0.32374 h 4.474121 v 0.32374 q -0.896484,0.008 -1.37793,0.16601 -0.481445,0.14941 -0.863281,0.53125 -0.157715,0.15772 -0.664063,0.91309 -0.506347,0.75537 -1.220214,1.62695 -0.713868,0.87158 -1.502442,1.46924 0.224121,0.0332 0.498047,0.25732 0.282227,0.21582 0.863281,0.79688 1.045899,1.0459 2.100098,2.29931 1.0625,1.24512 1.195312,1.37793 0.240723,0.24073 0.664063,0.36524 0.42334,0.12451 1.228516,0.12451 z'+
      ' M 65.972412,232.51807 64.660889,235 h -7.595215 v -0.32373 h 0.564453 q 0.597656,0 0.830078,-0.24072 0.240723,-0.24073 0.240723,-0.87989 v -7.5288 q 0,-0.70557 -0.282227,-0.9878 -0.282226,-0.29052 -1.0625,-0.29052 h -0.240722 v -0.32374 h 5.013671 v 0.32374 h -0.630859 q -0.863281,0 -1.128906,0.20751 -0.257324,0.19922 -0.257324,0.9629 v 7.83593 q 0,0.34033 0.149414,0.48975 0.157714,0.14111 0.522949,0.14111 h 2.506836 q 0.307129,0 0.539551,-0.0581 0.232421,-0.0664 0.406738,-0.15772 0.182617,-0.0996 0.42334,-0.36523 0.249023,-0.27393 0.43164,-0.51465 0.190918,-0.24072 0.572754,-0.77197 z'+
      ' m 9.753418,2.1582 V 235 h -4.133789 v -0.32373 q 0.788574,-0.0332 1.029297,-0.31543 0.249023,-0.29053 0.249023,-1.14551 v -7.23828 q 0,-0.68066 -0.273925,-0.92969 -0.273926,-0.25732 -1.004395,-0.29882 v -0.32374 h 4.133789 v 0.32374 q -0.830078,0 -1.137207,0.27392 -0.307129,0.27393 -0.307129,1.104 v 7.20508 q 0,0.77198 0.290527,1.0625 0.290528,0.28223 1.153809,0.28223 z'+
      ' m 8.881836,-4.2832 v 2.97168 q 0,0.73046 0.282227,1.02099 0.282226,0.29053 1.0708,0.29053 h 0.564453 V 235 h -4.706542 v -0.32373 h 0.232421 q 0.672364,0 0.904786,-0.19922 0.240722,-0.19922 0.240722,-0.78857 v -8.03516 q 0,-0.48145 -0.182617,-0.68896 -0.182617,-0.21582 -0.622559,-0.21582 h -0.846679 v -0.32374 q 0.224121,-0.008 0.96289,-0.0415 0.747071,-0.0415 1.178711,-0.0581 1.245117,-0.0498 2.108399,-0.0498 1.020996,0 1.80957,0.19092 0.796875,0.19092 1.261719,0.48974 0.473144,0.29053 0.771972,0.70557 0.307129,0.40674 0.41504,0.79688 0.10791,0.39013 0.10791,0.82177 0,1.49414 -1.112305,2.37403 -1.112305,0.87158 -2.996582,0.87158 -0.771973,0 -1.444336,-0.13281 z'+
      ' m 0,-5.72754 v 5.40381 q 0.597656,0.13281 0.913086,0.13281 1.369629,0 2.208008,-0.83008 0.838379,-0.83838 0.838379,-2.1416 0,-2.63135 -2.789063,-2.63135 -0.763672,0 -1.17041,0.0664 z'+
      ' m 11.637695,7.75293 h 0.323731 q 0.265625,1.1123 1.054199,1.75146 0.796875,0.63916 1.817871,0.63916 0.597658,0 1.112308,-0.20752 0.52295,-0.21582 0.87988,-0.68066 0.35693,-0.47315 0.35693,-1.11231 0,-0.49804 -0.30713,-0.95459 -0.29882,-0.45654 -0.78027,-0.82177 -0.48144,-0.37354 -1.062499,-0.73877 -0.581055,-0.37354 -1.16211,-0.75537 -0.581054,-0.39014 -1.0625,-0.80518 -0.481445,-0.41504 -0.788574,-0.95459 -0.298828,-0.53955 -0.298828,-1.14551 0,-1.0625 0.863281,-1.75976 0.863282,-0.70557 2.166504,-0.70557 0.614258,0 1.062496,0.10791 0.44825,0.10791 0.73047,0.21582 0.29053,0.10791 0.51465,0.10791 0.17432,0 0.30713,-0.17432 h 0.27393 l 0.29052,2.15821 h -0.29052 q -0.35694,-0.91309 -1.11231,-1.45264 -0.74707,-0.54785 -1.626952,-0.54785 -0.846679,0 -1.377929,0.43994 -0.52295,0.43994 -0.52295,1.15381 0,0.43164 0.232422,0.83008 0.232422,0.39844 0.614258,0.71386 0.390137,0.31543 0.879883,0.65577 0.489746,0.33203 0.996098,0.63086 0.51464,0.29052 1.00439,0.66406 0.48975,0.37353 0.87158,0.75537 0.39014,0.37353 0.62256,0.87988 0.23242,0.50635 0.23242,1.0625 0,1.25342 -0.98779,2.0835 -0.97949,0.82178 -2.473633,0.82178 -0.556152,0 -1.444336,-0.23243 -0.888184,-0.23242 -0.921387,-0.23242 -0.21582,0 -0.340332,0.19092 h -0.290527 z'+
      ' m 15.705079,-2.02539 v 2.97168 q 0,0.73046 0.28223,1.02099 0.28222,0.29053 1.0708,0.29053 h 0.56445 V 235 h -4.70654 v -0.32373 h 0.23242 q 0.67236,0 0.90478,-0.19922 0.24073,-0.19922 0.24073,-0.78857 v -8.03516 q 0,-0.48145 -0.18262,-0.68896 -0.18262,-0.21582 -0.62256,-0.21582 h -0.84668 v -0.32374 q 0.22412,-0.008 0.96289,-0.0415 0.74707,-0.0415 1.17871,-0.0581 1.24512,-0.0498 2.1084,-0.0498 1.021,0 1.80957,0.19092 0.79688,0.19092 1.26172,0.48974 0.47314,0.29053 0.77197,0.70557 0.30713,0.40674 0.41504,0.79688 0.10791,0.39013 0.10791,0.82177 0,1.49414 -1.1123,2.37403 -1.11231,0.87158 -2.99658,0.87158 -0.77198,0 -1.44434,-0.13281 z'+
      ' m 0,-5.72754 v 5.40381 q 0.59766,0.13281 0.91309,0.13281 1.36962,0 2.208,-0.83008 0.83838,-0.83838 0.83838,-2.1416 0,-2.63135 -2.78906,-2.63135 -0.76367,0 -1.17041,0.0664 z'+
      ' m 14.27734,5.86035 v 2.87207 q 0,0.73877 0.30713,1.01269 0.30713,0.26563 1.0459,0.26563 h 0.39014 V 235 h -4.80616 v -0.32373 h 0.29053 q 0.77197,0 1.0625,-0.29053 0.29883,-0.29053 0.29883,-1.1206 v -7.15528 q 0,-0.78857 -0.27393,-1.0708 -0.26562,-0.29052 -1.00439,-0.29052 h -0.37354 v -0.32374 q 0.0498,0 2.14161,-0.0996 1.04589,-0.0498 2.1416,-0.0498 2.26611,0 3.41162,0.83008 1.14551,0.82178 1.14551,2.1914 0,0.9629 -0.61426,1.70997 -0.60596,0.73877 -1.65186,1.04589 0.78028,0.60596 1.94239,1.76807 l 1.34472,1.34473 q 0.79688,0.79687 1.59375,1.22851 0.80518,0.43164 1.75147,0.48975 v 0.30713 q -0.88819,0.0415 -1.56055,-0.0249 -0.66406,-0.0664 -1.12891,-0.18262 -0.46484,-0.12451 -0.92968,-0.42334 -0.46485,-0.29883 -0.78858,-0.58106 -0.31543,-0.28222 -0.84668,-0.81347 l -1.1206,-1.12061 q -1.0376,-1.0376 -1.75147,-1.51904 -0.84668,0.0332 -1.15381,0.0332 -0.31543,0 -0.86328,-0.0332 z'+
      ' m 0,-5.89356 v 5.56983 q 0.34034,0.0415 1.0542,0.0415 3.1211,0 3.1211,-2.83886 0,-0.63086 -0.15772,-1.11231 -0.15771,-0.48144 -0.52295,-0.87158 -0.36523,-0.39844 -1.0376,-0.60596 -0.66406,-0.21582 -1.61035,-0.21582 -0.53955,0 -0.84668,0.0332 z'+
      ' m 19.86377,10.04395 V 235 h -4.13379 v -0.32373 q 0.78858,-0.0332 1.0293,-0.31543 0.24902,-0.29053 0.24902,-1.14551 v -7.23828 q 0,-0.68066 -0.27392,-0.92969 -0.27393,-0.25732 -1.0044,-0.29882 v -0.32374 h 4.13379 v 0.32374 q -0.83008,0 -1.1372,0.27392 -0.30713,0.27393 -0.30713,1.104 v 7.20508 q 0,0.77198 0.29052,1.0625 0.29053,0.28223 1.15381,0.28223 z'+
      ' m 17.46485,0.43994 h -0.43994 l -8.80713,-9.21387 v 7.29639 q 0,0.92139 0.31543,1.20361 0.32373,0.27393 1.40283,0.27393 V 235 h -3.95117 v -0.32373 h 0.0747 q 0.77198,0 1.0791,-0.26563 0.31543,-0.27392 0.31543,-0.87158 v -8.36719 q -0.57275,-0.39843 -1.42773,-0.42333 v -0.32374 h 2.66455 l 8.01025,8.35059 v -6.76514 q 0,-0.77197 -0.32373,-1.00439 -0.31543,-0.23242 -1.34472,-0.25732 v -0.32374 h 3.97607 v 0.32374 q -0.93799,0 -1.24512,0.19091 -0.29882,0.18262 -0.29882,0.69727 z'+
      ' m 17.53955,-3.27881 v 2.36572 q -1.10401,0.56446 -2.43213,0.81348 -1.31983,0.25733 -2.125,0.25733 -1.0791,0 -1.99219,-0.31543 -0.91309,-0.32373 -1.54394,-0.85498 -0.62256,-0.53125 -1.07081,-1.22852 -0.43994,-0.69727 -0.64746,-1.44434 -0.19921,-0.74707 -0.19921,-1.51074 0,-0.55615 0.10791,-1.1206 0.10791,-0.56446 0.34033,-1.12891 0.23242,-0.57275 0.57275,-1.0791 0.34033,-0.51465 0.83008,-0.95459 0.48975,-0.44824 1.0791,-0.77197 0.59766,-0.32373 1.36133,-0.50635 0.77197,-0.19092 1.63525,-0.19092 0.79688,0 1.56055,0.14941 0.76367,0.14112 1.23682,0.29053 0.48144,0.14112 0.58935,0.14112 0.24903,0 0.39014,-0.11622 h 0.24072 v 2.74756 h -0.34033 q -0.32373,-1.48584 -1.25342,-2.1333 -0.92139,-0.64746 -2.23291,-0.64746 -0.87158,0 -1.61865,0.28223 -0.73877,0.27392 -1.27002,0.76367 -0.53125,0.48975 -0.90479,1.15381 -0.36523,0.65576 -0.54785,1.41943 -0.18261,0.76367 -0.18261,1.59375 0,1.0044 0.26562,1.85938 0.27393,0.84668 0.71387,1.42773 0.44824,0.57275 1.02929,0.97949 0.58106,0.40674 1.18702,0.58936 0.60595,0.18262 1.21191,0.18262 1.29492,0 2.59814,-0.64747 v -2.1416 q 0,-0.73047 -0.29882,-1.01269 -0.29883,-0.28223 -1.0625,-0.28223 h -0.63086 v -0.30713 h 4.59033 v 0.30713 q -0.63916,0.0415 -0.91309,0.28223 -0.27392,0.24072 -0.27392,0.78857 z'+
      ' m 14.20263,-3.89306 v 3.229 h -0.32373 q -0.0913,-0.85498 -0.34033,-1.0957 -0.24072,-0.24903 -0.81348,-0.24903 h -2.87207 v 3.62744 q 0,0.55616 0.20752,0.74707 0.20752,0.18262 0.71387,0.18262 h 2.61475 q 0.87158,0 1.26172,-0.39013 0.39013,-0.39844 0.71386,-1.52735 h 0.29883 L 196.4939,235 h -9.03125 v -0.32373 h 0.47314 q 0.98779,0 1.29492,-0.29053 0.30713,-0.29883 0.30713,-1.104 v -7.17188 q 0,-0.75537 -0.27392,-1.0542 -0.26563,-0.30712 -1.08741,-0.30712 h -0.37353 v -0.32374 h 8.15967 l 0.14111,2.36573 h -0.30713 q -0.15771,-1.021 -0.45654,-1.38623 -0.29883,-0.36524 -0.80518,-0.36524 h -3.58594 v 4.1836 h 3.04639 q 0.47315,0 0.69727,-0.27393 0.22412,-0.28223 0.28222,-1.00439 z'+
      ' m 10.31788,2.58154 v 2.87207 q 0,0.73877 0.30712,1.01269 0.30713,0.26563 1.0459,0.26563 h 0.39014 V 235 h -4.80615 v -0.32373 h 0.29052 q 0.77198,0 1.0625,-0.29053 0.29883,-0.29053 0.29883,-1.1206 v -7.15528 q 0,-0.78857 -0.27392,-1.0708 -0.26563,-0.29052 -1.0044,-0.29052 h -0.37353 v -0.32374 q 0.0498,0 2.1416,-0.0996 1.0459,-0.0498 2.1416,-0.0498 2.26611,0 3.41162,0.83008 1.14551,0.82178 1.14551,2.1914 0,0.9629 -0.61426,1.70997 -0.60596,0.73877 -1.65185,1.04589 0.78027,0.60596 1.94238,1.76807 l 1.34472,1.34473 q 0.79688,0.79687 1.59375,1.22851 0.80518,0.43164 1.75147,0.48975 v 0.30713 q -0.88818,0.0415 -1.56055,-0.0249 -0.66406,-0.0664 -1.1289,-0.18262 -0.46485,-0.12451 -0.92969,-0.42334 -0.46484,-0.29883 -0.78858,-0.58106 -0.31542,-0.28222 -0.84667,-0.81347 l -1.12061,-1.12061 q -1.0376,-1.0376 -1.75147,-1.51904 -0.84667,0.0332 -1.1538,0.0332 -0.31543,0 -0.86328,-0.0332 z'+
      ' m 0,-5.89356 v 5.56983 q 0.34033,0.0415 1.05419,0.0415 3.1211,0 3.1211,-2.83886 0,-0.63086 -0.15772,-1.11231 -0.15771,-0.48144 -0.52295,-0.87158 -0.36523,-0.39844 -1.03759,-0.60596 -0.66407,-0.21582 -1.61036,-0.21582 -0.53955,0 -0.84667,0.0332 z"'+
      ' style="fill:#5e5e5e"'+
      ' aria-label="KLIPSPRINGER" />';

export const hubicon =
      '<g transform="scale(0.05 0.05)"><g transform="translate(50 0)">\n'+
      kS+
      '</g>\n'+
      // '  <rect x="0" y="0" width="640" height="900" fill="none" stroke="red" stroke-width="10" />\n'+
      '  </g>\n'+
      '  <text text-anchor="middle"\n'+
      '        x="16" y="46"\n'+
      '        font-family="Bembo Std" font-size="20"\n'+
      '        stroke="none" fill="black">hub</text>\n';

export const flacicon =
      '<g transform="scale(0.05 0.05)"><g transform="translate(50 0)">\n'+
      kS+
      '</g>\n'+
      '  </g>\n'+
      '  <text text-anchor="middle"\n'+
      '        x="16" y="46"\n'+
      '        font-family="Bembo Std" font-size="20"\n'+
      '        stroke="none" fill="black">codec</text>\n';

export const klipicon =
    '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">\n'+
      '  <rect x="0" y="0" width="32" height="32" fill="white" />\n'+
    '  <g transform="matrix(0.03125 0 0 0.03125 7.5675 6.625)">\n'+
    kS+
    '  </g>\n'+
    '</svg>\n';

export const kliplogo =
    '<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256">\n'+
//    '<rect x="0" y="0" width="256" height="256" fill="none" stroke="red" stroke-width="2" />'+
    logo+
    '</svg>\n';

const recordingsSvg = (b) => "'"+'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">'
      + bpaths[b]
      + '</svg>'+"'";

export const recButtons = {
    play_svg: recordingsSvg('playtrack'),
    download_svg: recordingsSvg('download'),
    remove_svg: recordingsSvg('remove')
}

Version: v4.3.2.2 (2026-05-16T17:03:34+02:00)
Raw file
Source code overview
Klipspringer home