PageSourceSearch

https://neuropace.com/wp-content/themes/salient/js/DrawSvg.js?ver=0.75175100%201790245966

js neuropace.com collected 2026-09-24 10:34:02 UTC 9,663 bytes, 329 lines download raw bytes

1!(function (e, t) {
2  "object" == typeof exports && "undefined" != typeof module
3    ? t(exports)
4    : "function" == typeof define && define.amd
5    ? define(["exports"], t)
6    : t(((e = e || self).window = e.window || {}));
7})(this, function (e) {
8  "use strict";
9  function i() {
10    return "undefined" != typeof window;
11  }
12  function j() {
13    return a || (i() && (a = window.gsap) && a.registerPlugin && a);
14  }
15  function m(e) {
16    return Math.round(1e4 * e) / 1e4;
17  }
18  function n(e) {
19    return parseFloat(e) || 0;
20  }
21  function o(e, t) {
22    var r = n(e);
23    return ~e.indexOf("%") ? (r / 100) * t : r;
24  }
25  function p(e, t) {
26    return n(e.getAttribute(t));
27  }
28  function r(e, t, r, i, o, s) {
29    return P(Math.pow((n(r) - n(e)) * o, 2) + Math.pow((n(i) - n(t)) * s, 2));
30  }
31  function s(e) {
32    return console.warn(e);
33  }
34  function t(e) {
35    return "non-scaling-stroke" === e.getAttribute("vector-effect");
36  }
37  function w() {
38    return String.fromCharCode.apply(null, arguments);
39  }
40  function A(e) {
41    if (!(e = v(e)[0])) return 0;
42    var n,
43      i,
44      o,
45      a,
46      f,
47      d,
48      h,
49      l = e.tagName.toLowerCase(),
50      w = e.style,
51      u = 1,
52      c = 1;
53    t(e) &&
54      ((c = e.getScreenCTM()),
55      (u = P(c.a * c.a + c.b * c.b)),
56      (c = P(c.d * c.d + c.c * c.c)));
57    try {
58      i = e.getBBox();
59    } catch (e) {
60      s(
61        "Some browsers won't measure invisible elements (like display:none or masks inside defs)."
62      );
63    }
64    var g = i || { x: 0, y: 0, width: 0, height: 0 },
65      _ = g.x,
66      y = g.y,
67      x = g.width,
68      m = g.height;
69    if (
70      ((i && (x || m)) ||
71        !k[l] ||
72        ((x = p(e, k[l][0])),
73        (m = p(e, k[l][1])),
74        "rect" !== l && "line" !== l && ((x *= 2), (m *= 2)),
75        "line" === l &&
76          ((_ = p(e, "x1")),
77          (y = p(e, "y1")),
78          (x = Math.abs(x - _)),
79          (m = Math.abs(m - y)))),
80      "path" === l)
81    )
82      (a = w.strokeDasharray),
83        (w.strokeDasharray = "none"),
84        (n = e.getTotalLength() || 0),
85        u !== c &&
86          s(
87            "Warning: <path> length cannot be measured when vector-effect is non-scaling-stroke and the element isn't proportionally scaled."
88          ),
89        (n *= (u + c) / 2),
90        (w.strokeDasharray = a);
91    else if ("rect" === l) n = 2 * x * u + 2 * m * c;
92    else if ("line" === l) n = r(_, y, _ + x, y + m, u, c);
93    else if ("polyline" === l || "polygon" === l)
94      for (
95        o = e.getAttribute("points").match(b) || [],
96          "polygon" === l && o.push(o[0], o[1]),
97          n = 0,
98          f = 2;
99        f < o.length;
100        f += 2
101      )
102        n += r(o[f - 2], o[f - 1], o[f], o[f + 1], u, c) || 0;
103    else
104      ("circle" !== l && "ellipse" !== l) ||
105        ((d = (x / 2) * u),
106        (h = (m / 2) * c),
107        (n = Math.PI * (3 * (d + h) - P((3 * d + h) * (d + 3 * h)))));
108    return n || 0;
109  }
110  function B(e, t) {
111    if (!(e = v(e)[0])) return [0, 0];
112    t = t || A(e) + 1;
113    var r = d.getComputedStyle(e),
114      i = r.strokeDasharray || "",
115      o = n(r.strokeDashoffset),
116      s = i.indexOf(",");
117    return (
118      s < 0 && (s = i.indexOf(" ")),
119      t < (i = s < 0 ? t : n(i.substr(0, s))) && (i = t),
120      [-o || 0, i - o || 0]
121    );
122  }
123  function C() {
124    i() &&
125      ((d = window),
126      (l = a = j()),
127      (v = a.utils.toArray),
128      (h = -1 !== ((d.navigator || {}).userAgent || "").indexOf("Edge")));
129  }
130  var a,
131    v,
132    d,
133    h,
134    l,
135    b = /[-+=\.]*\d+[\.e\-\+]*\d*[e\-\+]*\d*/gi,
136    k = {
137      rect: ["width", "height"],
138      circle: ["r", "r"],
139      ellipse: ["rx", "ry"],
140      line: ["x2", "y2"],
141    },
142    P = Math.sqrt,
143    f = "DrawSVGPlugin",
144    u = w(103, 114, 101, 101, 110, 115, 111, 99, 107, 46, 99, 111, 109),
145    c = (function (e) {
146      for (
147        var t =
148            1 ===
149              (window ? window.location.href : "").indexOf(
150                w(102, 105, 108, 101, 58, 47, 47)
151              ) ||
152            -1 !== e.indexOf(w(108, 111, 99, 97, 108, 104, 111, 115, 116)) ||
153            -1 !== e.indexOf(w(49, 50, 55, 46, 48, 32, 48, 46, 49)),
154          n = [
155            u,
156            w(99, 111, 100, 101, 112, 101, 110, 46, 105, 111),
157            w(
158              99,
159              111,
160              100,
161              101,
162              112,
163              101,
164              110,
165              46,
166              112,
167              108,
168              117,
169              109,
170              98,
171              105,
172              110,
173              103
174            ),
175            w(99, 111, 100, 101, 112, 101, 110, 46, 100, 101, 118),
176            w(99, 111, 100, 101, 112, 101, 110, 46, 97, 112, 112),
177            w(112, 101, 110, 115, 46, 99, 108, 111, 117, 100),
178            w(99, 115, 115, 45, 116, 114, 105, 99, 107, 115, 46, 99, 111, 109),
179            w(99, 100, 112, 110, 46, 105, 111),
180            w(112, 101, 110, 115, 46, 105, 111),
181            w(103, 97, 110, 110, 111, 110, 46, 116, 118),
182            w(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 110, 101, 116),
183            w(
184              116,
185              104,
186              101,
187              109,
188              101,
189              102,
190              111,
191              114,
192              101,
193              115,
194              116,
195              46,
196              110,
197              101,
198              116
199            ),
200            w(99, 101, 114, 101, 98, 114, 97, 120, 46, 99, 111, 46, 117, 107),
201            w(116, 121, 109, 112, 97, 110, 117, 115, 46, 110, 101, 116),
202            w(116, 119, 101, 101, 110, 109, 97, 120, 46, 99, 111, 109),
203            w(116, 119, 101, 101, 110, 108, 105, 116, 101, 46, 99, 111, 109),
204            w(112, 108, 110, 107, 114, 46, 99, 111),
205            w(104, 111, 116, 106, 97, 114, 46, 99, 111, 109),
206            w(119, 101, 98, 112, 97, 99, 107, 98, 105, 110, 46, 99, 111, 109),
207            w(97, 114, 99, 104, 105, 118, 101, 46, 111, 114, 103),
208            w(99, 111, 100, 101, 115, 97, 110, 100, 98, 111, 120, 46, 105, 111),
209            w(99, 115, 98, 46, 97, 112, 112),
210            w(115, 116, 97, 99, 107, 98, 108, 105, 116, 122, 46, 99, 111, 109),
211            w(99, 111, 100, 105, 101, 114, 46, 105, 111),
212            w(
213              109,
214              111,
215              116,
216              105,
217              111,
218              110,
219              116,
220              114,
221              105,
222              99,
223              107,
224              115,
225              46,
226              99,
227              111,
228              109
229            ),
230            w(106, 115, 102, 105, 100, 100, 108, 101, 46, 110, 101, 116),
231          ],
232          r = n.length;
233        -1 < --r;
234
235      )
236        if (-1 !== e.indexOf(n[r])) return !0;
237    })(window ? window.location.host : ""),
238    g = {
239      version: "3.6.1",
240      name: "drawSVG",
241      register: function register(e) {
242        (a = e), C();
243      },
244      init: function init(e, r) {
245        if (!e.getBBox) return !1;
246        l || C();
247        var i,
248          s,
249          a,
250          f = A(e);
251        return (
252          (this._style = e.style),
253          (this._target = e),
254          r + "" == "true"
255            ? (r = "0 100%")
256            : r
257            ? -1 === (r + "").indexOf(" ") && (r = "0 " + r)
258            : (r = "0 0"),
259          (s = (function _parse(e, t, n) {
260            var r,
261              i,
262              s = e.indexOf(" ");
263            return (
264              (i =
265                s < 0
266                  ? ((r = void 0 !== n ? n + "" : e), e)
267                  : ((r = e.substr(0, s)), e.substr(s + 1))),
268              (r = o(r, t)),
269              (i = o(i, t)) < r ? [i, r] : [r, i]
270            );
271          })(r, f, (i = B(e, f))[0])),
272          (this._length = m(f)),
273          (this._dash = m(i[1] - i[0])),
274          (this._offset = m(-i[0])),
275          (this._dashPT = this.add(this, "_dash", this._dash, m(s[1] - s[0]))),
276          (this._offsetPT = this.add(this, "_offset", this._offset, m(-s[0]))),
277          h &&
278            (a = d.getComputedStyle(e)).strokeLinecap !== a.strokeLinejoin &&
279            ((s = n(a.strokeMiterlimit)),
280            this.add(e.style, "strokeMiterlimit", s, s + 0.01)),
281          (this._live = t(e) || ~(r + "").indexOf("live")),
282          this._props.push("drawSVG"),
283          c
284        );
285      },
286      render: function render(e, t) {
287        var n,
288          r,
289          i,
290          o,
291          s = t._pt,
292          a = t._style;
293        if (s) {
294          for (
295            t._live &&
296            (n = A(t._target)) !== t._length &&
297            ((r = n / t._length),
298            (t._length = n),
299            t._offsetPT && ((t._offsetPT.s *= r), (t._offsetPT.c *= r)),
300            t._dashPT
301              ? ((t._dashPT.s *= r), (t._dashPT.c *= r))
302              : (t._dash *= r));
303            s;
304
305          )
306            s.r(e, s.d), (s = s._next);
307          (i = t._dash || (e && 1 !== e && 1e-4) || 0),
308            (n = t._length - i + 0.1),
309            (o = t._offset),
310            i &&
311              o &&
312              i + Math.abs(o % t._length) > t._length - 0.2 &&
313              (o += o < 0 ? 0.1 : -0.1) &&
314              (n += 0.1),
315            (a.strokeDashoffset = i ? o : o + 0.001),
316            (a.strokeDasharray =
317              n < 0.2 ? "none" : i ? i + "px," + n + "px" : "0px, 999999px");
318        }
319      },
320      getLength: A,
321      getPosition: B,
322    };
323  j() && a.registerPlugin(g), (e.DrawSVGPlugin = g), (e.default = g);
324  if (typeof window === "undefined" || window !== e) {
325    Object.defineProperty(e, "__esModule", { value: !0 });
326  } else {
327    delete e.default;
328  }
329});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.