PageSourceSearch

https://smithgroup.com/core/misc/drupal.js?v=9.4.6

js smithgroup.com collected 2026-10-02 03:55:51 UTC 6,388 bytes, 224 lines download raw bytes

1/**
2* DO NOT EDIT THIS FILE.
3* See the following change record for more information,
4* https://www.drupal.org/node/2815083
5* @preserve
6**/
7
8window.Drupal = {
9  behaviors: {},
10  locale: {}
11};
12
13(function (Drupal, drupalSettings, drupalTranslations, console, Proxy, Reflect) {
14  Drupal.throwError = function (error) {
15    setTimeout(function () {
16      throw error;
17    }, 0);
18  };
19
20  Drupal.attachBehaviors = function (context, settings) {
21    context = context || document;
22    settings = settings || drupalSettings;
23    var behaviors = Drupal.behaviors;
24    Object.keys(behaviors || {}).forEach(function (i) {
25      if (typeof behaviors[i].attach === 'function') {
26        try {
27          behaviors[i].attach(context, settings);
28        } catch (e) {
29          Drupal.throwError(e);
30        }
31      }
32    });
33  };
34
35  Drupal.detachBehaviors = function (context, settings, trigger) {
36    context = context || document;
37    settings = settings || drupalSettings;
38    trigger = trigger || 'unload';
39    var behaviors = Drupal.behaviors;
40    Object.keys(behaviors || {}).forEach(function (i) {
41      if (typeof behaviors[i].detach === 'function') {
42        try {
43          behaviors[i].detach(context, settings, trigger);
44        } catch (e) {
45          Drupal.throwError(e);
46        }
47      }
48    });
49  };
50
51  Drupal.checkPlain = function (str) {
52    str = str.toString().replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
53    return str;
54  };
55
56  Drupal.formatString = function (str, args) {
57    var processedArgs = {};
58    Object.keys(args || {}).forEach(function (key) {
59      switch (key.charAt(0)) {
60        case '@':
61          processedArgs[key] = Drupal.checkPlain(args[key]);
62          break;
63
64        case '!':
65          processedArgs[key] = args[key];
66          break;
67
68        default:
69          processedArgs[key] = Drupal.theme('placeholder', args[key]);
70          break;
71      }
72    });
73    return Drupal.stringReplace(str, processedArgs, null);
74  };
75
76  Drupal.stringReplace = function (str, args, keys) {
77    if (str.length === 0) {
78      return str;
79    }
80
81    if (!Array.isArray(keys)) {
82      keys = Object.keys(args || {});
83      keys.sort(function (a, b) {
84        return a.length - b.length;
85      });
86    }
87
88    if (keys.length === 0) {
89      return str;
90    }
91
92    var key = keys.pop();
93    var fragments = str.split(key);
94
95    if (keys.length) {
96      for (var i = 0; i < fragments.length; i++) {
97        fragments[i] = Drupal.stringReplace(fragments[i], args, keys.slice(0));
98      }
99    }
100
101    return fragments.join(args[key]);
102  };
103
104  Drupal.t = function (str, args, options) {
105    options = options || {};
106    options.context = options.context || '';
107
108    if (typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str]) {
109      str = drupalTranslations.strings[options.context][str];
110    }
111
112    if (args) {
113      str = Drupal.formatString(str, args);
114    }
115
116    return str;
117  };
118
119  Drupal.url = function (path) {
120    return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path;
121  };
122
123  Drupal.url.toAbsolute = function (url) {
124    var urlParsingNode = document.createElement('a');
125
126    try {
127      url = decodeURIComponent(url);
128    } catch (e) {}
129
130    urlParsingNode.setAttribute('href', url);
131    return urlParsingNode.cloneNode(false).href;
132  };
133
134  Drupal.url.isLocal = function (url) {
135    var absoluteUrl = Drupal.url.toAbsolute(url);
136    var protocol = window.location.protocol;
137
138    if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) {
139      protocol = 'https:';
140    }
141
142    var baseUrl = "".concat(protocol, "//").concat(window.location.host).concat(drupalSettings.path.baseUrl.slice(0, -1));
143
144    try {
145      absoluteUrl = decodeURIComponent(absoluteUrl);
146    } catch (e) {}
147
148    try {
149      baseUrl = decodeURIComponent(baseUrl);
150    } catch (e) {}
151
152    return absoluteUrl === baseUrl || absoluteUrl.indexOf("".concat(baseUrl, "/")) === 0;
153  };
154
155  Drupal.formatPlural = function (count, singular, plural, args, options) {
156    args = args || {};
157    args['@count'] = count;
158    var pluralDelimiter = drupalSettings.pluralDelimiter;
159    var translations = Drupal.t(singular + pluralDelimiter + plural, args, options).split(pluralDelimiter);
160    var index = 0;
161
162    if (typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula) {
163      index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] : drupalTranslations.pluralFormula.default;
164    } else if (args['@count'] !== 1) {
165      index = 1;
166    }
167
168    return translations[index];
169  };
170
171  Drupal.encodePath = function (item) {
172    return window.encodeURIComponent(item).replace(/%2F/g, '/');
173  };
174
175  Drupal.deprecationError = function (_ref) {
176    var message = _ref.message;
177
178    if (drupalSettings.suppressDeprecationErrors === false && typeof console !== 'undefined' && console.warn) {
179      console.warn("[Deprecation] ".concat(message));
180    }
181  };
182
183  Drupal.deprecatedProperty = function (_ref2) {
184    var target = _ref2.target,
185        deprecatedProperty = _ref2.deprecatedProperty,
186        message = _ref2.message;
187
188    if (!Proxy || !Reflect) {
189      return target;
190    }
191
192    return new Proxy(target, {
193      get: function get(target, key) {
194        if (key === deprecatedProperty) {
195          Drupal.deprecationError({
196            message: message
197          });
198        }
199
200        for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
201          rest[_key - 2] = arguments[_key];
202        }
203
204        return Reflect.get.apply(Reflect, [target, key].concat(rest));
205      }
206    });
207  };
208
209  Drupal.theme = function (func) {
210    if (func in Drupal.theme) {
211      var _Drupal$theme;
212
213      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
214        args[_key2 - 1] = arguments[_key2];
215      }
216
217      return (_Drupal$theme = Drupal.theme)[func].apply(_Drupal$theme, args);
218    }
219  };
220
221  Drupal.theme.placeholder = function (str) {
222    return "<em class=\"placeholder\">".concat(Drupal.checkPlain(str), "</em>");
223  };
224})(Drupal, window.drupalSettings, window.drupalTranslations, window.console, window.Proxy, window.Reflect);

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.