Importing JS module for CustomJS

Hi,
I am pretty new to Bokeh and Javascript and currently experimenting with CustomJS.
Since I want to export a Jupyter Notebook containing interactive Bokeh content without using Bokeh server, I cannot use Python functions.
Therefore, to make calculations less tedious, I am using mathjs module to make calculations on arrays.
Unfortunately, after creating the html file, the following JS callback code doesn’t work :

function linspace(startValue, stopValue, number) {
        var arr = [];
        var step = (stopValue - startValue) / (number - 1);
        for (var i = 0; i < number; i++) {
            arr.push(startValue + (step * i));
        }
        return arr;
    }
    var x = source.data['x']
    var y = source.data['y']
    var t = linspace(0,cb_obj.value,cb_obj.value*10)

    //Calculates the trajectory till time t
    traj_x = (v_0, alpha, t) => math.multiply(v_0,math.cos(alpha),t)
    traj_y = (v_0, alpha, t) => math.add(math.multiply(-0.5, g, t.map(x => x ** 2)), math.multiply(v_0, math.sin(alpha), t))

    x = traj_x(v_0, alpha, t)
    y = traj_y(v_0, alpha, t)

    source.change.emit();

Even though I have imported mathjs at the beginning of the html with the following :
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/7.1.0/math.min.js"integrity="sha512-rCvDXOM8HOkDDjC0l9vQPhUg2n0rKlcsCtDjWG0ajYmVfjgtO6egt/RdSbKSzFCIUaE/OQRwmiU/4PmOeK3J+Q=="crossorigin="anonymous"></script>
When I go into the console I get : Uncaught ReferenceError: math is not defined
I tried putting :

const math = window.mathjs;

at the beginning of the CustomJS code without success.
I also tried importing the module from a local path, no succes either.

So my question : how do I import a JS module from a CDN link into the html file to make it work in the CustomJS callback ?
Thanks !