Help translating Jinka2 into JSTemplate for Custom Button card

Dear all,
I have written a piece of jinja2 code, which I seem unable to get into JS, for youse in a Custom Button Card (icon) template. Might anybody have the nerve to try it on?

here’s the code

          {%- if is_state('binary_sensor.terassentur_rechts',  'off') -%}  
             {%- if states('sensor.position_rollo_door_right')|int >= 90 -%}
               mdi:window-closed-variant
             {%- elif states('sensor.position_rollo_door_right')|int >= 84 -%}
               mdi:window-shutter-open 
             {%- elif states('sensor.position_rollo_door_right')|int >= 45 -%}
               mdi:window-shutter-alert
             {%- else -%}
               mdi:window-shutter
             {%- endif -%}
          {%- elif is_state('binary_sensor.terassentur_rechts',  'on') -%}    
             {%- if states('sensor.position_rollo_door_right')|int >= 83 -%}
             mdi:window-open-variant
             {%- elif states('sensor.position_rollo_door_right')|int < 83 -%}
             mdi:archive-alert
             {%- endif -%}    
          {%- endif -%}

Thanks a million

Manager to get it coded myself du n the end