{#- Render a JS/TS import statement based on style and module system.

    Args:
        style: "default", "named", or "namespace"
        name: the binding name (class name, function name, or module alias)
        path: the module path
        module_system: "esm" for ES modules, anything else for CommonJS
-#}
{%- macro js_import(style, name, path, module_system) -%}
{%- if module_system == "esm" -%}
    {%- if style == "named" -%}   import { {{ name }} } from '{{ path }}';
    {%- elif style == "namespace" -%}import * as {{ name }} from '{{ path }}';
    {%- else -%}                     import {{ name }} from '{{ path }}';
    {%- endif -%}
{%- else -%}
    {%- if style == "named" -%}   const { {{ name }} } = require('{{ path }}');
    {%- elif style == "namespace" -%}const {{ name }} = require('{{ path }}');
    {%- else -%}                     const {{ name }} = require('{{ path }}');
    {%- endif -%}
{%- endif -%}
{%- endmacro -%}
