1/* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/progress.js. */ 2(function ($, Drupal) { 3 Drupal.theme.progressBar = function (id) { 4 return "<div id=\"".concat(id, "\" class=\"progress\" aria-live=\"polite\">") + '<div class="progress__label"> </div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description"> </div>' + '</div>'; 5 }; 6 Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) { 7 this.id = id; 8 this.method = method || 'GET'; 9 this.updateCallback = updateCallback; 10 this.errorCallback = errorCallback; 11 this.element = $(Drupal.theme('progressBar', id)); 12 }; 13 $.extend(Drupal.ProgressBar.prototype, { 14 setProgress: function setProgress(percentage, message, label) { 15 if (percentage >= 0 && percentage <= 100) { 16 $(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%")); 17 $(this.element).find('div.progress__percentage').html("".concat(percentage, "%")); 18 } 19 $('div.progress__description', this.element).html(message); 20 $('div.progress__label', this.element).html(label); 21 if (this.updateCallback) { 22 this.updateCallback(percentage, message, this); 23 } 24 }, 25 startMonitoring: function startMonitoring(uri, delay) { 26 this.delay = delay; 27 this.uri = uri; 28 this.sendPing(); 29 }, 30 stopMonitoring: function stopMonitoring() { 31 clearTimeout(this.timer); 32 this.uri = null; 33 }, 34 sendPing: function sendPing() { 35 if (this.timer) { 36 clearTimeout(this.timer); 37 } 38 if (this.uri) { 39 var pb = this; 40 var uri = this.uri; 41 if (uri.indexOf('?') === -1) { 42 uri += '?'; 43 } else { 44 uri += '&'; 45 } 46 uri += '_format=json'; 47 $.ajax({ 48 type: this.method, 49 url: uri, 50 data: '', 51 dataType: 'json', 52 success: function success(progress) { 53 if (progress.status === 0) { 54 pb.displayError(progress.data); 55 return; 56 } 57 pb.setProgress(progress.percentage, progress.message, progress.label); 58 pb.timer = setTimeout(function () { 59 pb.sendPing(); 60 }, pb.delay); 61 }, 62 error: function error(xmlhttp) { 63 var e = new Drupal.AjaxError(xmlhttp, pb.uri); 64 pb.displayError("<pre>".concat(e.message, "</pre>")); 65 } 66 }); 67 } 68 }, 69 displayError: function displayError(string) { 70 var error = $('<div class="messages messages--error"></div>').html(string); 71 $(this.element).before(error).hide(); 72 if (this.errorCallback) { 73 this.errorCallback(this); 74 } 75 } 76 }); 77 })(jQuery, Drupal); 78 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/progress.js. */ 79 ; 80 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/modules/responsive_image/js/responsive_image.ajax.js. */ 81 (function (Drupal) { 82 Drupal.behaviors.responsiveImageAJAX = { 83 attach: function attach() { 84 if (window.picturefill) { 85 window.picturefill(); 86 } 87 } 88 }; 89 })(Drupal); 90 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/modules/responsive_image/js/responsive_image.ajax.js. */ 91 ; 92 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/ajax.js. */ 93 function _toConsumableArray(arr) { 94 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); 95 } 96 97 function _nonIterableSpread() { 98 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 99 } 100 101 function _unsupportedIterableToArray(o, minLen) { 102 if (!o) return; 103 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 104 var n = Object.prototype.toString.call(o).slice(8, -1); 105 if (n === "Object" && o.constructor) n = o.constructor.name; 106 if (n === "Map" || n === "Set") return Array.from(o); 107 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 108 } 109 110 function _iterableToArray(iter) { 111 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); 112 } 113 114 function _arrayWithoutHoles(arr) { 115 if (Array.isArray(arr)) return _arrayLikeToArray(arr); 116 } 117 118 function _arrayLikeToArray(arr, len) { 119 if (len == null || len > arr.length) len = arr.length; 120 for (var i = 0, arr2 = new Array(len); i < len; i++) { 121 arr2[i] = arr[i]; 122 } 123 return arr2; 124 } 125 (function ($, window, Drupal, drupalSettings, _ref) { 126 var isFocusable = _ref.isFocusable, 127 tabbable = _ref.tabbable; 128 Drupal.behaviors.AJAX = { 129 attach: function attach(context, settings) { 130 function loadAjaxBehavior(base) { 131 var elementSettings = settings.ajax[base]; 132 if (typeof elementSettings.selector === 'undefined') { 133 elementSettings.selector = "#".concat(base); 134 } 135 once('drupal-ajax', $(elementSettings.selector)).forEac
135h(function (el) { 136 elementSettings.element = el; 137 elementSettings.base = base; 138 Drupal.ajax(elementSettings); 139 }); 140 } 141 Object.keys(settings.ajax || {}).forEach(function (base) { 142 return loadAjaxBehavior(base); 143 }); 144 Drupal.ajax.bindAjaxLinks(document.body); 145 once('ajax', '.use-ajax-submit').forEach(function (el) { 146 var elementSettings = {}; 147 elementSettings.url = $(el.form).attr('action'); 148 elementSettings.setClick = true; 149 elementSettings.event = 'click'; 150 elementSettings.progress = { 151 type: 'throbber' 152 }; 153 elementSettings.base = el.id; 154 elementSettings.element = el; 155 Drupal.ajax(elementSettings); 156 }); 157 }, 158 detach: function detach(context, settings, trigger) { 159 if (trigger === 'unload') { 160 Drupal.ajax.expired().forEach(function (instance) { 161 Drupal.ajax.instances[instance.instanceIndex] = null; 162 }); 163 } 164 } 165 }; 166 Drupal.AjaxError = function (xmlhttp, uri, customMessage) { 167 var statusCode; 168 var statusText; 169 var responseText; 170 if (xmlhttp.status) { 171 statusCode = "\n".concat(Drupal.t('An AJAX HTTP error occurred.'), "\n").concat(Drupal.t('HTTP Result Code: !status', { 172 '!status': xmlhttp.status 173 })); 174 } else { 175 statusCode = "\n".concat(Drupal.t('An AJAX HTTP request terminated abnormally.')); 176 } 177 statusCode += "\n".concat(Drupal.t('Debugging information follows.')); 178 var pathText = "\n".concat(Drupal.t('Path: !uri', { 179 '!uri': uri 180 })); 181 statusText = ''; 182 try { 183 statusText = "\n".concat(Drupal.t('StatusText: !statusText', { 184 '!statusText': xmlhttp.statusText.trim() 185 })); 186 } catch (e) {} 187 responseText = ''; 188 try { 189 responseText = "\n".concat(Drupal.t('ResponseText: !responseText', { 190 '!responseText': xmlhttp.responseText.trim() 191 })); 192 } catch (e) {} 193 responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ''); 194 responseText = responseText.replace(/[\n]+\s+/g, '\n'); 195 var readyStateText = xmlhttp.status === 0 ? "\n".concat(Drupal.t('ReadyState: !readyState', { 196 '!readyState': xmlhttp.readyState 197 })) : ''; 198 customMessage = customMessage ? "\n".concat(Drupal.t('CustomMessage: !customMessage', { 199 '!customMessage': customMessage 200 })) : ''; 201 this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText; 202 this.name = 'AjaxError'; 203 }; 204 Drupal.AjaxError.prototype = new Error(); 205 Drupal.AjaxError.prototype.constructor = Drupal.AjaxError; 206 Drupal.ajax = function (settings) { 207 if (arguments.length !== 1) { 208 throw new Error('Drupal.ajax() function must be called with one configuration object only'); 209 } 210 var base = settings.base || false; 211 var element = settings.element || false; 212 delete settings.base; 213 delete settings.element; 214 if (!settings.progress && !element) { 215 settings.progress = false; 216 } 217 var ajax = new Drupal.Ajax(base, element, settings); 218 ajax.instanceIndex = Drupal.ajax.instances.length; 219 Drupal.ajax.instances.push(ajax); 220 return ajax; 221 }; 222 Drupal.ajax.instances = []; 223 Drupal.ajax.expired = function () { 224 return Drupal.ajax.instances.filter(function (instance) { 225 return instance && instance.element !== false && !document.body.contains(instance.element); 226 }); 227 }; 228 Drupal.ajax.bindAjaxLinks = function (element) { 229 once('ajax', '.use-ajax', element).forEach(function (ajaxLink) { 230 var $linkElement = $(ajaxLink); 231 var elementSettings = { 232 progress: { 233 type: 'throbber' 234 }, 235 dialogType: $linkElement.data('dialog-type'), 236 dialog: $linkElement.data('dialog-options'), 237 dialogRenderer: $linkElement.data('dialog-renderer'), 238 base: $linkElement.attr('id'), 239 element: ajaxLink 240 }; 241 var href = $linkElement.attr('href'); 242 if (href) { 243 elementSettings.url = href; 244 elementSettings.event = 'click'; 245 } 246 Drupal.ajax(elementSettings); 247 }); 248 }; 249 Drupal.Ajax = function (base, element, elementSettings) { 250 var defaults = { 251 event: element ? 'mousedown' : null, 252 keypress: true,
253 selector: base ? "#".concat(base) : null, 254 effect: 'none', 255 speed: 'none', 256 method: 'replaceWith', 257 progress: { 258 type: 'throbber', 259 message: Drupal.t('Please wait...') 260 }, 261 submit: { 262 js: true 263 } 264 }; 265 $.extend(this, defaults, elementSettings); 266 this.commands = new Drupal.AjaxCommands(); 267 this.instanceIndex = false; 268 if (this.wrapper) { 269 this.wrapper = "#".concat(this.wrapper); 270 } 271 this.element = element; 272 this.element_settings = elementSettings; 273 this.elementSettings = elementSettings; 274 if (this.element && this.element.form) { 275 this.$form = $(this.element.form); 276 } 277 if (!this.url) { 278 var $element = $(this.element); 279 if ($element.is('a')) { 280 this.url = $element.attr('href'); 281 } else if (this.element && element.form) { 282 this.url = this.$form.attr('action'); 283 } 284 } 285 var originalUrl = this.url; 286 this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1'); 287 if (drupalSettings.ajaxTrustedUrl[originalUrl]) { 288 drupalSettings.ajaxTrustedUrl[this.url] = true; 289 } 290 var ajax = this; 291 ajax.options = { 292 url: ajax.url, 293 data: ajax.submit, 294 beforeSerialize: function beforeSerialize(elementSettings, options) { 295 return ajax.beforeSerialize(elementSettings, options); 296 }, 297 beforeSubmit: function beforeSubmit(formValues, elementSettings, options) { 298 ajax.ajaxing = true; 299 return ajax.beforeSubmit(formValues, elementSettings, options); 300 }, 301 beforeSend: function beforeSend(xmlhttprequest, options) { 302 ajax.ajaxing = true; 303 return ajax.beforeSend(xmlhttprequest, options); 304 }, 305 success: function success(response, status, xmlhttprequest) { 306 if (typeof response === 'string') { 307 response = $.parseJSON(response); 308 } 309 if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) { 310 if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { 311 var customMessage = Drupal.t('The response failed verification so will not be processed.'); 312 return ajax.error(xmlhttprequest, ajax.url, customMessage); 313 } 314 } 315 return ajax.success(response, status); 316 }, 317 complete: function complete(xmlhttprequest, status) { 318 ajax.ajaxing = false; 319 if (status === 'error' || status === 'parsererror') { 320 return ajax.error(xmlhttprequest, ajax.url); 321 } 322 }, 323 dataType: 'json', 324 jsonp: false, 325 type: 'POST' 326 }; 327 if (elementSettings.dialog) { 328 ajax.options.data.dialogOptions = elementSettings.dialog; 329 } 330 if (ajax.options.url.indexOf('?') === -1) { 331 ajax.options.url += '?'; 332 } else { 333 ajax.options.url += '&'; 334 } 335 var wrapper = "drupal_".concat(elementSettings.dialogType || 'ajax'); 336 if (elementSettings.dialogRenderer) { 337 wrapper += ".".concat(elementSettings.dialogRenderer); 338 } 339 ajax.options.url += "".concat(Drupal.ajax.WRAPPER_FORMAT, "=").concat(wrapper); 340 $(ajax.element).on(elementSettings.event, function (event) { 341 if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { 342 throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', { 343 '!url': ajax.url 344 })); 345 } 346 return ajax.eventResponse(this, event); 347 }); 348 if (elementSettings.keypress) { 349 $(ajax.element).on('keypress', function (event) { 350 return ajax.keypressResponse(this, event); 351 }); 352 } 353 if (elementSettings.prevent) { 354 $(ajax.element).on(elementSettings.prevent, false); 355 } 356 }; 357 Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format'; 358 Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; 359 Drupal.Ajax.prototype.execute = function () { 360 if (this.ajaxing) { 361 return; 362 } 363 try { 364 this.beforeSerialize(this.element, this.options); 365 return $.ajax(this.options); 366 } catch (e) { 367 this.ajaxing = false;
368 window.alert("An error occurred while attempting to process ".concat(this.options.url, ": ").concat(e.message)); 369 return $.Deferred().reject(); 370 } 371 }; 372 Drupal.Ajax.prototype.keypressResponse = function (element, event) { 373 var ajax = this; 374 if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') { 375 event.preventDefault(); 376 event.stopPropagation(); 377 $(element).trigger(ajax.elementSettings.event); 378 } 379 }; 380 Drupal.Ajax.prototype.eventResponse = function (element, event) { 381 event.preventDefault(); 382 event.stopPropagation(); 383 var ajax = this; 384 if (ajax.ajaxing) { 385 return; 386 } 387 try { 388 if (ajax.$form) { 389 if (ajax.setClick) { 390 element.form.clk = element; 391 } 392 ajax.$form.ajaxSubmit(ajax.options); 393 } else { 394 ajax.beforeSerialize(ajax.element, ajax.options); 395 $.ajax(ajax.options); 396 } 397 } catch (e) { 398 ajax.ajaxing = false; 399 window.alert("An error occurred while attempting to process ".concat(ajax.options.url, ": ").concat(e.message)); 400 } 401 }; 402 Drupal.Ajax.prototype.beforeSerialize = function (element, options) { 403 if (this.$form && document.body.contains(this.$form.get(0))) { 404 var settings = this.settings || drupalSettings; 405 Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize'); 406 } 407 options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; 408 var pageState = drupalSettings.ajaxPageState; 409 options.data['ajax_page_state[theme]'] = pageState.theme; 410 options.data['ajax_page_state[theme_token]'] = pageState.theme_token; 411 options.data['ajax_page_state[libraries]'] = pageState.libraries; 412 }; 413 Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {}; 414 Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) { 415 if (this.$form) { 416 options.extraData = options.extraData || {}; 417 options.extraData.ajax_iframe_upload = '1'; 418 var v = $.fieldValue(this.element); 419 if (v !== null) { 420 options.extraData[this.element.name] = v; 421 } 422 } 423 $(this.element).prop('disabled', true); 424 if (!this.progress || !this.progress.type) { 425 return; 426 } 427 var progressIndicatorMethod = "setProgressIndicator".concat(this.progress.type.slice(0, 1).toUpperCase()).concat(this.progress.type.slice(1).toLowerCase()); 428 if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') { 429 this[progressIndicatorMethod].call(this); 430 } 431 }; 432 Drupal.theme.ajaxProgressThrobber = function (message) { 433 var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : ''; 434 var throbber = '<div class="throbber"> </div>'; 435 return "<div class=\"ajax-progress ajax-progress-throbber\">".concat(throbber).concat(messageMarkup, "</div>"); 436 }; 437 Drupal.theme.ajaxProgressIndicatorFullscreen = function () { 438 return '<div class="ajax-progress ajax-progress-fullscreen"> </div>'; 439 }; 440 Drupal.theme.ajaxProgressMessage = function (message) { 441 return "<div class=\"message\">".concat(message, "</div>"); 442 }; 443 Drupal.theme.ajaxProgressBar = function ($element) { 444 return $('<div class="ajax-progress ajax-progress-bar"></div>').append($element); 445 }; 446 Drupal.Ajax.prototype.setProgressIndicatorBar = function () { 447 var progressBar = new Drupal.ProgressBar("ajax-progress-".concat(this.element.id), $.noop, this.progress.method, $.noop); 448 if (this.progress.message) { 449 progressBar.setProgress(-1, this.progress.message); 450 } 451 if (this.progress.url) { 452 progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); 453 } 454 this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element)); 455 this.progress.object = progressBar; 456 $(this.element).after(this.progress.element); 457 }; 458 Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { 459 this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message)); 460 $(this.element).after(this.progress.element); 461 }; 462 Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { 463 this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen')); 464 $('body').append(this.progress.element); 465 }; 466 Drupal.Ajax.prototype.success = function (response, status) { 467 var _this = this; 468 if (this.progress.element) { 469 $(this.progress.element).remove(); 470 } 471 if (this.progress.object) { 472 this.progress.object.stopMonitoring(); 473 } 474 $(this.element).prop('disabled', false); 475 var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray(); 476 var focusChanged = false;
477 Object.keys(response || {}).forEach(function (i) { 478 if (response[i].command && _this.commands[response[i].command]) { 479 _this.commands[response[i].command](_this, response[i], status); 480 if (response[i].command === 'invoke' && response[i].method === 'focus' || response[i].command === 'focusFirst') { 481 focusChanged = true; 482 } 483 } 484 }); 485 if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) { 486 var target = false; 487 for (var n = elementParents.length - 1; !target && n >= 0; n--) { 488 target = document.querySelector("[data-drupal-selector=\"".concat(elementParents[n].getAttribute('data-drupal-selector'), "\"]")); 489 } 490 if (target) { 491 $(target).trigger('focus'); 492 } 493 } 494 if (this.$form && document.body.contains(this.$form.get(0))) { 495 var settings = this.settings || drupalSettings; 496 Drupal.attachBehaviors(this.$form.get(0), settings); 497 } 498 this.settings = null; 499 }; 500 Drupal.Ajax.prototype.getEffect = function (response) { 501 var type = response.effect || this.effect; 502 var speed = response.speed || this.speed; 503 var effect = {}; 504 if (type === 'none') { 505 effect.showEffect = 'show'; 506 effect.hideEffect = 'hide'; 507 effect.showSpeed = ''; 508 } else if (type === 'fade') { 509 effect.showEffect = 'fadeIn'; 510 effect.hideEffect = 'fadeOut'; 511 effect.showSpeed = speed; 512 } else { 513 effect.showEffect = "".concat(type, "Toggle"); 514 effect.hideEffect = "".concat(type, "Toggle"); 515 effect.showSpeed = speed; 516 } 517 return effect; 518 }; 519 Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { 520 if (this.progress.element) { 521 $(this.progress.element).remove(); 522 } 523 if (this.progress.object) { 524 this.progress.object.stopMonitoring(); 525 } 526 $(this.wrapper).show(); 527 $(this.element).prop('disabled', false); 528 if (this.$form && document.body.contains(this.$form.get(0))) { 529 var settings = this.settings || drupalSettings; 530 Drupal.attachBehaviors(this.$form.get(0), settings); 531 } 532 throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage); 533 }; 534 Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) { 535 return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) { 536 return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent)); 537 }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent; 538 }; 539 Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) { 540 return $('<div></div>').append($elements); 541 }; 542 Drupal.AjaxCommands = function () {}; 543 Drupal.AjaxCommands.prototype = { 544 insert: function insert(ajax, response) { 545 var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); 546 var method = response.method || ajax.method; 547 var effect = ajax.getEffect(response); 548 var settings = response.settings || ajax.settings || drupalSettings; 549 var $newContent = $($.parseHTML(response.data, document, true)); 550 $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response); 551 switch (method) { 552 case 'html': 553 case 'replaceWith': 554 case 'replaceAll': 555 case 'empty': 556 case 'remove': 557 Drupal.detachBehaviors($wrapper.get(0), settings); 558 break; 559 default: 560 break; 561 } 562 $wrapper[method]($newContent); 563 if (effect.showEffect !== 'show') { 564 $newContent.hide(); 565 } 566 var $ajaxNewContent = $newContent.find('.ajax-new-content'); 567 if ($ajaxNewContent.length) { 568 $ajaxNewContent.hide(); 569 $newContent.show(); 570 $ajaxNewContent[effect.showEffect](effect.showSpeed); 571 } else if (effect.showEffect !== 'show') { 572 $newContent[effect.showEffect](effect.showSpeed); 573 } 574 if ($newContent.parents('html').length) { 575 $newContent.each(function (index, element) { 576 if (element.nodeType === Node.ELEMENT_NODE) { 577 Drupal.attachBehaviors(element, settings); 578 } 579 }); 580 } 581 }, 582 remove: function remove(ajax, response, status) { 583 var settings = response.settings || ajax.settings || drupalSettings; 584 $(response.selector).each(function () { 585 Drupal.detachBehaviors(this, settings); 586 }).remove(); 587 }, 588 changed: function changed(ajax, response, status) { 589 var $element = $(response.selector); 590 if (!$element.hasClass('ajax-changed')) { 591 $element.addClass('ajax-changed'); 592 if (response.asterisk) { 593 $element.find(response.asterisk).append(" <abbr class=\"ajax-changed\" title=\"".concat(Drupal.t('Changed'), "\">*</abbr> ")); 594 } 595 } 596 }, 597 alert: function alert(ajax, response, status) { 598 window.alert(response.text); 599 }, 600 announce: function announce(ajax, response) { 601 if (response.priority) { 602 Drupal.announce(response.text, response.priority); 603 } else { 604 Drupal.announce(response.text); 605 } 606 }, 607 redirect: function redirect(ajax, response, status) { 608 window.location = response.url; 609 }, 610 css: function css(ajax, response, status) { 611 $(response.selector).css(response.argument); 612 }, 613 settings: function settings(ajax, response, status) { 614 var ajaxSettings = drupalSettings.ajax; 615 if (ajaxSettings) {
616 Drupal.ajax.expired().forEach(function (instance) { 617 if (instance.selector) { 618 var selector = instance.selector.replace('#', ''); 619 if (selector in ajaxSettings) { 620 delete ajaxSettings[selector]; 621 } 622 } 623 }); 624 } 625 if (response.merge) { 626 $.extend(true, drupalSettings, response.settings); 627 } else { 628 ajax.settings = response.settings; 629 } 630 }, 631 data: function data(ajax, response, status) { 632 $(response.selector).data(response.name, response.value); 633 }, 634 focusFirst: function focusFirst(ajax, response, status) { 635 var focusChanged = false; 636 var container = document.querySelector(response.selector); 637 if (container) { 638 var tabbableElements = tabbable(container); 639 if (tabbableElements.length) { 640 tabbableElements[0].focus(); 641 focusChanged = true; 642 } else if (isFocusable(container)) { 643 container.focus(); 644 focusChanged = true; 645 } 646 } 647 if (ajax.hasOwnProperty('element') && !focusChanged) { 648 ajax.element.focus(); 649 } 650 }, 651 invoke: function invoke(ajax, response, status) { 652 var $element = $(response.selector); 653 $element[response.method].apply($element, _toConsumableArray(response.args)); 654 }, 655 restripe: function restripe(ajax, response, status) { 656 $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even'); 657 }, 658 update_build_id: function update_build_id(ajax, response, status) { 659 $("input[name=\"form_build_id\"][value=\"".concat(response.old, "\"]")).val(response.new); 660 }, 661 add_css: function add_css(ajax, response, status) { 662 $('head').prepend(response.data); 663 }, 664 message: function message(ajax, response) { 665 var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector)); 666 if (response.clearPrevious) { 667 messages.clear(); 668 } 669 messages.add(response.message, response.messageOptions); 670 } 671 }; 672 }) 673 (jQuery, window, Drupal, drupalSettings, window.tabbable); 674 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/ajax.js. */ 675 ; 676 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/debounce.js. */ 677 Drupal.debounce = function (func, wait, immediate) { 678 var timeout; 679 var result; 680 return function () { 681 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 682 args[_key] = arguments[_key]; 683 } 684 var context = this; 685 var later = function later() { 686 timeout = null; 687 if (!immediate) { 688 result = func.apply(context, args); 689 } 690 }; 691 var callNow = immediate && !timeout; 692 clearTimeout(timeout); 693 timeout = setTimeout(later, wait); 694 if (callNow) { 695 result = func.apply(context, args); 696 } 697 return result; 698 }; 699 }; 700 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/debounce.js. */ 701 ; 702 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/displace.js. */ 703 (function ($, Drupal, debounce) { 704 var offsets = { 705 top: 0, 706 right: 0, 707 bottom: 0, 708 left: 0 709 }; 710 711 function getRawOffset(el, edge) { 712 var $el = $(el); 713 var documentElement = document.documentElement; 714 var displacement = 0; 715 var horizontal = edge === 'left' || edge === 'right'; 716 var placement = $el.offset()[horizontal ? 'left' : 'top']; 717 placement -= window["scroll".concat(horizontal ? 'X' : 'Y')] || document.documentElement["scroll".concat(horizontal ? 'Left' : 'Top')] || 0; 718 switch (edge) { 719 case 'top': 720 displacement = placement + $el.outerHeight(); 721 break; 722 case 'left': 723 displacement = placement + $el.outerWidth(); 724 break; 725 case 'bottom': 726 displacement = documentElement.clientHeight - placement; 727 break; 728 case 'right': 729 displacement = documentElement.clientWidth - placement; 730 break; 731 default: 732 displacement = 0; 733 }
734 return displacement; 735 } 736 737 function calculateOffset(edge) { 738 var edgeOffset = 0; 739 var displacingElements = document.querySelectorAll("[data-offset-".concat(edge, "]")); 740 var n = displacingElements.length; 741 for (var i = 0; i < n; i++) { 742 var el = displacingElements[i]; 743 if (el.style.display === 'none') { 744 continue; 745 } 746 var displacement = parseInt(el.getAttribute("data-offset-".concat(edge)), 10); 747 if (isNaN(displacement)) { 748 displacement = getRawOffset(el, edge); 749 } 750 edgeOffset = Math.max(edgeOffset, displacement); 751 } 752 return edgeOffset; 753 } 754 755 function calculateOffsets() { 756 return { 757 top: calculateOffset('top'), 758 right: calculateOffset('right'), 759 bottom: calculateOffset('bottom'), 760 left: calculateOffset('left') 761 }; 762 } 763 764 function displace(broadcast) { 765 offsets = calculateOffsets(); 766 Drupal.displace.offsets = offsets; 767 if (typeof broadcast === 'undefined' || broadcast) { 768 $(document).trigger('drupalViewportOffsetChange', offsets); 769 } 770 return offsets; 771 } 772 Drupal.behaviors.drupalDisplace = { 773 attach: function attach() { 774 if (this.displaceProcessed) { 775 return; 776 } 777 this.displaceProcessed = true; 778 $(window).on('resize.drupalDisplace', debounce(displace, 200)); 779 } 780 }; 781 Drupal.displace = displace; 782 $.extend(Drupal.displace, { 783 offsets: offsets, 784 calculateOffset: calculateOffset 785 }); 786 })(jQuery, Drupal, Drupal.debounce); 787 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/displace.js. */ 788 ; 789 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/jquery.tabbable.shim.js. */ 790 (function ($, Drupal, _ref) { 791 var isTabbable = _ref.isTabbable; 792 $.extend($.expr[':'], { 793 tabbable: function tabbable(element) { 794 Drupal.deprecationError({ 795 message: 'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 10.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730' 796 }); 797 if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') { 798 var tabIndex = element.getAttribute('tabIndex'); 799 if (tabIndex === null || tabIndex < 0) { 800 return false; 801 } 802 } 803 return isTabbable(element); 804 } 805 }); 806 })(jQuery, Drupal, window.tabbable); 807 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/jquery.tabbable.shim.js. */ 808 ; 809 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/position.js. */ 810 (function ($) { 811 var cachedScrollbarWidth = null; 812 var max = Math.max, 813 abs = Math.abs; 814 var regexHorizontal = /left|center|right/; 815 var regexVertical = /top|center|bottom/; 816 var regexOffset = /[+-]\d+(\.[\d]+)?%?/; 817 var regexPosition = /^\w+/; 818 var regexPercent = /%$/; 819 var _position = $.fn.position; 820 821 function getOffsets(offsets, width, height) { 822 return [parseFloat(offsets[0]) * (regexPercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (regexPercent.test(offsets[1]) ? height / 100 : 1)]; 823 } 824 825 function parseCss(element, property) { 826 return parseInt($.css(element, property), 10) || 0; 827 } 828 829 function getDimensions(elem) { 830 var raw = elem[0]; 831 if (raw.nodeType === 9) { 832 return { 833 width: elem.width(), 834 height: elem.height(), 835 offset: { 836 top: 0, 837 left: 0 838 } 839 }; 840 } 841 if ($.isWindow(raw)) { 842 return { 843 width: elem.width(), 844 height: elem.height(), 845 offset: { 846 top: elem.scrollTop(), 847 left: elem.scrollLeft() 848 } 849 }; 850 } 851 if (raw.preventDefault) { 852 return { 853 width: 0, 854 height: 0, 855 offset: { 856 top: raw.pageY, 857 left: raw.pageX 858 } 859 }; 860 } 861 return { 862 width: elem.outerWidth(), 863 height: elem.outerHeight(), 864 offset: elem.offset() 865 }; 866 } 867 var collisions = { 868 fit: { 869 left: function left(position, data) { 870 var within = data.within; 871 var withinOffset = within.isWindow ? within.scrollLeft : within.offset.left; 872 var outerWidth = within.width; 873 var collisionPosLeft = position.left - data.collisionPosition.marginLeft; 874 var overLeft = withinOffset - collisionPosLeft; 875 var overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset; 876 var newOverRight; 877 if (data.collisionWidth > outerWidth) { 878 if (overLeft > 0 && overRight <= 0) { 879 newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; 880 position.left += overLeft - newOverRight; 881 } else if (overRight > 0 && overLeft <= 0) { 882 position.left = withinOffset; 883 } else if (overLeft > overRight) { 884 position.left = withinOffset + outerWidth - data.collisionWidth; 885 } else { 886 position.left = withinOffset; 887 } 888 } else if (overLeft > 0) { 889 position.left += overLeft; 890 } else if (overRight > 0) { 891 position.left -= overRight; 892 } else { 893 position.left = max(position.left - collisionPosLeft, position.left); 894 } 895 },
896 top: function top(position, data) { 897 var within = data.within; 898 var withinOffset = within.isWindow ? within.scrollTop : within.offset.top; 899 var outerHeight = data.within.height; 900 var collisionPosTop = position.top - data.collisionPosition.marginTop; 901 var overTop = withinOffset - collisionPosTop; 902 var overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset; 903 var newOverBottom; 904 if (data.collisionHeight > outerHeight) { 905 if (overTop > 0 && overBottom <= 0) { 906 newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; 907 position.top += overTop - newOverBottom; 908 } else if (overBottom > 0 && overTop <= 0) { 909 position.top = withinOffset; 910 } else if (overTop > overBottom) { 911 position.top = withinOffset + outerHeight - data.collisionHeight; 912 } else { 913 position.top = withinOffset; 914 } 915 } else if (overTop > 0) { 916 position.top += overTop; 917 } else if (overBottom > 0) { 918 position.top -= overBottom; 919 } else { 920 position.top = max(position.top - collisionPosTop, position.top); 921 } 922 } 923 }, 924 flip: { 925 left: function left(position, data) { 926 var within = data.within; 927 var withinOffset = within.offset.left + within.scrollLeft; 928 var outerWidth = within.width; 929 var offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left; 930 var collisionPosLeft = position.left - data.collisionPosition.marginLeft; 931 var overLeft = collisionPosLeft - offsetLeft; 932 var overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft; 933 var myOffset = data.my[0] === 'left' ? -data.elemWidth : data.my[0] === 'right' ? data.elemWidth : 0; 934 var atOffset = data.at[0] === 'left' ? data.targetWidth : data.at[0] === 'right' ? -data.targetWidth : 0; 935 var offset = -2 * data.offset[0]; 936 var newOverRight; 937 var newOverLeft; 938 if (overLeft < 0) { 939 newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; 940 if (newOverRight < 0 || newOverRight < abs(overLeft)) { 941 position.left += myOffset + atOffset + offset; 942 } 943 } else if (overRight > 0) { 944 newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; 945 if (newOverLeft > 0 || abs(newOverLeft) < overRight) { 946 position.left += myOffset + atOffset + offset; 947 } 948 } 949 },
950 top: function top(position, data) { 951 var within = data.within; 952 var withinOffset = within.offset.top + within.scrollTop; 953 var outerHeight = within.height; 954 var offsetTop = within.isWindow ? within.scrollTop : within.offset.top; 955 var collisionPosTop = position.top - data.collisionPosition.marginTop; 956 var overTop = collisionPosTop - offsetTop; 957 var overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop; 958 var top = data.my[1] === 'top'; 959 var myOffset = top ? -data.elemHeight : data.my[1] === 'bottom' ? data.elemHeight : 0; 960 var atOffset = data.at[1] === 'top' ? data.targetHeight : data.at[1] === 'bottom' ? -data.targetHeight : 0; 961 var offset = -2 * data.offset[1]; 962 var newOverTop; 963 var newOverBottom; 964 if (overTop < 0) { 965 newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; 966 if (newOverBottom < 0 || newOverBottom < abs(overTop)) { 967 position.top += myOffset + atOffset + offset; 968 } 969 } else if (overBottom > 0) { 970 newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; 971 if (newOverTop > 0 || abs(newOverTop) < overBottom) { 972 position.top += myOffset + atOffset + offset; 973 } 974 } 975 } 976 }, 977 flipfit: { 978 left: function left() { 979 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 980 args[_key] = arguments[_key]; 981 } 982 collisions.flip.left.apply(this, args); 983 collisions.fit.left.apply(this, args); 984 },
985 top: function top() { 986 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 987 args[_key2] = arguments[_key2]; 988 } 989 collisions.flip.top.apply(this, args); 990 collisions.fit.top.apply(this, args); 991 } 992 } 993 }; 994 $.position = { 995 scrollbarWidth: function scrollbarWidth() { 996 if (cachedScrollbarWidth !== undefined) { 997 return cachedScrollbarWidth; 998 } 999 var div = $('<div ' + "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + "<div style='height:100px;width:auto;'></div></div>"); 1000 var innerDiv = div.children()[0]; 1001 $('body').append(div); 1002 var w1 = innerDiv.offsetWidth; 1003 div.css('overflow', 'scroll'); 1004 var w2 = innerDiv.offsetWidth; 1005 if (w1 === w2) { 1006 w2 = div[0].clientWidth; 1007 } 1008 div.remove(); 1009 cachedScrollbarWidth = w1 - w2; 1010 return cachedScrollbarWidth; 1011 }, 1012 getScrollInfo: function getScrollInfo(within) { 1013 var overflowX = within.isWindow || within.isDocument ? '' : within.element.css('overflow-x'); 1014 var overflowY = within.isWindow || within.isDocument ? '' : within.element.css('overflow-y'); 1015 var hasOverflowX = overflowX === 'scroll' || overflowX === 'auto' && within.width < within.element[0].scrollWidth; 1016 var hasOverflowY = overflowY === 'scroll' || overflowY === 'auto' && within.height < within.element[0].scrollHeight; 1017 return { 1018 width: hasOverflowY ? $.position.scrollbarWidth() : 0, 1019 height: hasOverflowX ? $.position.scrollbarWidth() : 0 1020 }; 1021 }, 1022 getWithinInfo: function getWithinInfo(element) { 1023 var withinElement = $(element || window); 1024 var isWindow = $.isWindow(withinElement[0]); 1025 var isDocument = !!withinElement[0] && withinElement[0].nodeType === 9; 1026 var hasOffset = !isWindow && !isDocument; 1027 return { 1028 element: withinElement, 1029 isWindow: isWindow, 1030 isDocument: isDocument, 1031 offset: hasOffset ? $(element).offset() : { 1032 left: 0, 1033 top: 0 1034 }, 1035 scrollLeft: withinElement.scrollLeft(), 1036 scrollTop: withinElement.scrollTop(), 1037 width: withinElement.outerWidth(), 1038 height: withinElement.outerHeight() 1039 }; 1040 } 1041 }; 1042 $.fn.position = function (options) { 1043 if (!options || !options.of) { 1044 return _position.apply(this, arguments); 1045 } 1046 options = $.extend({}, options); 1047 var within = $.position.getWithinInfo(options.within); 1048 var scrollInfo = $.position.getScrollInfo(within); 1049 var collision = (options.collision || 'flip').split(' '); 1050 var offsets = {}; 1051 var target = typeof options.of === 'string' ? $(document).find(options.of) : $(options.of); 1052 var dimensions = getDimensions(target); 1053 var targetWidth = dimensions.width; 1054 var targetHeight = dimensions.height; 1055 var targetOffset = dimensions.offset; 1056 if (target[0].preventDefault) { 1057 options.at = 'left top'; 1058 } 1059 var basePosition = $.extend({}, targetOffset); 1060 $.each(['my', 'at'], function () { 1061 var pos = (options[this] || '').split(' '); 1062 if (pos.length === 1) { 1063 pos = regexHorizontal.test(pos[0]) ? pos.concat(['center']) : regexVertical.test(pos[0]) ? ['center'].concat(pos) : ['center', 'center']; 1064 } 1065 pos[0] = regexHorizontal.test(pos[0]) ? pos[0] : 'center'; 1066 pos[1] = regexVertical.test(pos[1]) ? pos[1] : 'center'; 1067 var horizontalOffset = regexOffset.exec(pos[0]); 1068 var verticalOffset = regexOffset.exec(pos[1]); 1069 offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0]; 1070 options[this] = [regexPosition.exec(pos[0])[0], regexPosition.exec(pos[1])[0]]; 1071 }); 1072 if (collision.length === 1) { 1073 collision[1] = collision[0]; 1074 } 1075 if (options.at[0] === 'right') { 1076 basePosition.left += targetWidth; 1077 } else if (options.at[0] === 'center') { 1078 basePosition.left += targetWidth / 2; 1079 } 1080 if (options.at[1] === 'bottom') { 1081 basePosition.top += targetHeight; 1082 } else if (options.at[1] === 'center') { 1083 basePosition.top += targetHeight / 2; 1084 } 1085 var atOffset = getOffsets(offsets.at, targetWidth, targetHeight); 1086 basePosition.left += atOffset[0]; 1087 basePosition.top += atOffset[1]; 1088 return this.each(function () { 1089 var using; 1090 var elem = $(this); 1091 var elemWidth = elem.outerWidth(); 1092 var elemHeight = elem.outerHeight(); 1093 var marginLeft = parseCss(this, 'marginLeft'); 1094 var marginTop = parseCss(this, 'marginTop'); 1095 var collisionWidth = elemWidth + marginLeft + parseCss(this, 'marginRight') + scrollInfo.width; 1096 var collisionHeight = elemHeight + marginTop + parseCss(this, 'marginBottom') + scrollInfo.height; 1097 var position = $.extend({}, basePosition); 1098 var myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight()); 1099 if (options.my[0] === 'right') { 1100 position.left -= elemWidth; 1101 } else if (options.my[0] === 'center') { 1102 position.left -= elemWidth / 2; 1103 } 1104 if (options.my[1] === 'bottom') { 1105 position.top -= elemHeight; 1106 } else if (options.my[1] === 'center') { 1107 position.top -= elemHeight / 2; 1108 } 1109 position.left += myOffset[0]; 1110 position.top += myOffset[1]; 1111 var collisionPosition = { 1112 marginLeft: marginLeft, 1113 marginTop: marginTop 1114 }; 1115 $.each(['left', 'top'], function (i, dir) { 1116 if (collisions[collision[i]]) { 1117 collisions[collision[i]][dir](position, { 1118 targetWidth: targetWidth, 1119 targetHeight: targetHeight, 1120 elemWidth: elemWidth, 1121 elemHeight: elemHeight, 1122 collisionPosition: collisionPosition, 1123 collisionWidth: collisionWidth, 1124 collisionHeight: collisionHeight, 1125 offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]], 1126 my: options.my, 1127 at: options.at, 1128 within: within, 1129 elem: elem 1130 }); 1131 } 1132 }); 1133 if (options.using) { 1134 using = function using(props) { 1135 var left = targetOffset.left - position.left; 1136 var right = left + targetWidth - elemWidth; 1137 var top = targetOffset.top - position.top; 1138 var bottom = top + targetHeight - elemHeight; 1139 var feedback = { 1140 target: { 1141 element: target, 1142 left: targetOffset.left, 1143 top: targetOffset.top, 1144 width: targetWidth, 1145 height: targetHeight 1146 }, 1147 element: { 1148 element: elem, 1149 left: position.left, 1150 top: position.top, 1151 width: elemWidth, 1152 height: elemHeight 1153 }, 1154 horizontal: right < 0 ? 'left' : left > 0 ? 'right' : 'center', 1155 vertical: bottom < 0 ? 'top' : top > 0 ? 'bottom' : 'middle' 1156 }; 1157 if (targetWidth < elemWidth && abs(left + right) < targetWidth) { 1158 feedback.horizontal = 'center'; 1159 } 1160 if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) { 1161 feedback.vertical = 'middle'; 1162 } 1163 if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) { 1164 feedback.important = 'horizontal'; 1165 } else { 1166 feedback.important = 'vertical'; 1167 } 1168 options.using.call(this, props, feedback); 1169 }; 1170 } 1171 elem.offset($.extend(position, { 1172 using: using 1173 })); 1174 }); 1175 }; 1176 if (!$.hasOwnProperty('ui')) { 1177 $.ui = {}; 1178 } 1179 $.ui.position = collisions; 1180 })(jQuery); 1181 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/position.js. */ 1182 ; 1183 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/dialog/dialog.js. */ 1184 (function ($, Drupal, drupalSettings) { 1185 drupalSettings.dialog = { 1186 autoOpen: true, 1187 dialogClass: '', 1188 buttonClass: 'button', 1189 buttonPrimaryClass: 'button--primary', 1190 close: function close(event) { 1191 Drupal.dialog(event.target).close(); 1192 Drupal.detachBehaviors(event.target, null, 'unload'); 1193 } 1194 }; 1195 Drupal.dialog = function (element, options) { 1196 var undef; 1197 var $element = $(element); 1198 var dialog = { 1199 open: false, 1200 returnValue: undef 1201 }; 1202
1203 function openDialog(settings) { 1204 settings = $.extend({}, drupalSettings.dialog, options, settings); 1205 $(window).trigger('dialog:beforecreate', [dialog, $element, settings]); 1206 $element.dialog(settings); 1207 dialog.open = true; 1208 $(window).trigger('dialog:aftercreate', [dialog, $element, settings]); 1209 } 1210 1211 function closeDialog(value) { 1212 $(window).trigger('dialog:beforeclose', [dialog, $element]); 1213 $element.dialog('close'); 1214 dialog.returnValue = value; 1215 dialog.open = false; 1216 $(window).trigger('dialog:afterclose', [dialog, $element]); 1217 } 1218 dialog.show = function () { 1219 openDialog({ 1220 modal: false 1221 }); 1222 }; 1223 dialog.showModal = function () { 1224 openDialog({ 1225 modal: true 1226 }); 1227 }; 1228 dialog.close = closeDialog; 1229 return dialog; 1230 }; 1231 })(jQuery, Drupal, drupalSettings); 1232 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/dialog/dialog.js. */ 1233 ; 1234 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/dialog/dialog.position.js. */ 1235 (function ($, Drupal, drupalSettings, debounce, displace) { 1236 drupalSettings.dialog = $.extend({ 1237 autoResize: true, 1238 maxHeight: '95%' 1239 }, drupalSettings.dialog); 1240 1241 function resetPosition(options) { 1242 var offsets = displace.offsets; 1243 var left = offsets.left - offsets.right; 1244 var top = offsets.top - offsets.bottom; 1245 var leftString = "".concat((left > 0 ? '+' : '-') + Math.abs(Math.round(left / 2)), "px"); 1246 var topString = "".concat((top > 0 ? '+' : '-') + Math.abs(Math.round(top / 2)), "px"); 1247 options.position = { 1248 my: "center".concat(left !== 0 ? leftString : '', " center").concat(top !== 0 ? topString : ''), 1249 of: window 1250 }; 1251 return options; 1252 } 1253 1254 function resetSize(event) { 1255 var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position']; 1256 var adjustedOptions = {}; 1257 var windowHeight = $(window).height(); 1258 var option; 1259 var optionValue; 1260 var adjustedValue; 1261 for (var n = 0; n < positionOptions.length; n++) { 1262 option = positionOptions[n]; 1263 optionValue = event.data.settings[option]; 1264 if (optionValue) { 1265 if (typeof optionValue === 'string' && /%$/.test(optionValue) && /height/i.test(option)) { 1266 windowHeight -= displace.offsets.top + displace.offsets.bottom; 1267 adjustedValue = parseInt(0.01 * parseInt(optionValue, 10) * windowHeight, 10); 1268 if (option === 'height' && event.data.$element.parent().outerHeight() < adjustedValue) { 1269 adjustedValue = 'auto'; 1270 } 1271 adjustedOptions[option] = adjustedValue; 1272 } 1273 } 1274 } 1275 if (!event.data.settings.modal) { 1276 adjustedOptions = resetPosition(adjustedOptions); 1277 } 1278 event.data.$element.dialog('option', adjustedOptions).trigger('dialogContentResize'); 1279 } 1280 $(window).on({ 1281 'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) { 1282 var autoResize = debounce(resetSize, 20); 1283 var eventData = { 1284 settings: settings, 1285 $element: $element 1286 }; 1287 if (settings.autoResize === true || settings.autoResize === 'true') { 1288 $element.dialog('option', { 1289 resizable: false, 1290 draggable: false 1291 }).dialog('widget').css('position', 'fixed'); 1292 $(window).on('resize.dialogResize scroll.dialogResize', eventData, autoResize).trigger('resize.dialogResize'); 1293 $(document).on('drupalViewportOffsetChange.dialogResize', eventData, autoResize); 1294 } 1295 }, 1296 'dialog:beforeclose': function dialogBeforeclose(event, dialog, $element) { 1297 $(window).off('.dialogResize'); 1298 $(document).off('.dialogResize'); 1299 } 1300 }); 1301 })(jQuery, Drupal, drupalSettings, Drupal.debounce, Drupal.displace); 1302 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/dialog/dialog.position.js. */ 1303 ; 1304 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/dialog/dialog.jquery-ui.js. */ 1305 (function ($, _ref) { 1306 var tabbable = _ref.tabbable, 1307 isTabbable = _ref.isTabbable; 1308 $.widget('ui.dialog', $.ui.dialog, { 1309 options: { 1310 buttonClass: 'button', 1311 buttonPrimaryClass: 'button--primary' 1312 }, 1313 _createButtons: function _createButtons() { 1314 var opts = this.options; 1315 var primaryIndex; 1316 var index; 1317 var il = opts.buttons.length; 1318 for (index = 0; index < il; index++) { 1319 if (opts.buttons[index].primary && opts.buttons[index].primary === true) { 1320 primaryIndex = index; 1321 delete opts.buttons[index].primary; 1322 break; 1323 } 1324 } 1325 this._super(); 1326 var $buttons = this.uiButtonSet.children().addClass(opts.buttonClass); 1327 if (typeof primaryIndex !== 'undefined') { 1328 $buttons.eq(index).addClass(opts.buttonPrimaryClass); 1329 } 1330 }, 1331 _focusTabbable: function _focusTabbable() { 1332 var hasFocus = this._focusedElement ? this._focusedElement.get(0) : null; 1333 if (!hasFocus) { 1334 hasFocus = this.element.find('[autofocus]').get(0); 1335 } 1336 if (!hasFocus) { 1337 var $elements = [this.element, this.uiDialogButtonPane]; 1338 for (var i = 0; i < $elements.length; i++) { 1339 var element = $elements[i].get(0); 1340 if (element) { 1341 var elementTabbable = tabbable(element); 1342 hasFocus = elementTabbable.length ? elementTabbable[0] : null; 1343 } 1344 if (hasFocus) { 1345 break; 1346 } 1347 } 1348 } 1349 if (!hasFocus) { 1350 var closeBtn = this.uiDialogTitlebarClose.get(0); 1351 hasFocus = closeBtn && isTabbable(closeBtn) ? closeBtn : null; 1352 } 1353 if (!hasFocus) { 1354 hasFocus = this.uiDialog.get(0); 1355 } 1356 $(hasFocus).eq(0).trigger('focus'); 1357 } 1358 }); 1359 })(jQuery, window.tabbable); 1360 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/dialog/dialog.jquery-ui.js. */ 1361 ; 1362 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/core/misc/dialog/dialog.ajax.js. */ 1363 (function ($, Drupal) { 1364 Drupal.behaviors.dialog = { 1365 attach: function attach(context, settings) { 1366 var $context = $(context); 1367 if (!$('#drupal-modal').length) { 1368 $('<div id="drupal-modal" class="ui-front"></div>').hide().appendTo('body'); 1369 } 1370 var $dialog = $context.closest('.ui-dialog-content'); 1371 if ($dialog.length) { 1372 if ($dialog.dialog('option', 'drupalAutoButtons')) { 1373 $dialog.trigger('dialogButtonsChange'); 1374 } 1375 $dialog.dialog('widget').trigger('focus'); 1376 } 1377 var originalClose = settings.dialog.close; 1378 settings.dialog.close = function (event) { 1379 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 1380 args[_key - 1] = arguments[_key]; 1381 } 1382 originalClose.apply(settings.dialog, [event].concat(args)); 1383 $(event.target).remove(); 1384 }; 1385 }, 1386 prepareDialogButtons: function prepareDialogButtons($dialog) { 1387 var buttons = []; 1388 var $buttons = $dialog.find('.form-actions input[type=submit], .form-actions a.button'); 1389 $buttons.each(function () { 1390 var $originalButton = $(this).css({ 1391 display: 'none' 1392 }); 1393 buttons.push({ 1394 text: $originalButton.html() || $originalButton.attr('value'), 1395 class: $originalButton.attr('class'), 1396 click: function click(e) { 1397 if ($originalButton.is('a')) { 1398 $originalButton[0].click(); 1399 } else { 1400 $originalButton.trigger('mousedown').trigger('mouseup').trigger('click'); 1401 e.preventDefault(); 1402 } 1403 } 1404 }); 1405 }); 1406 return buttons; 1407 } 1408 }; 1409 Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) { 1410 if (!response.selector) { 1411 return false;
vendor: 10,422 bytes, lines 1412-1617
1412 } 1413 var $dialog = $(response.selector); 1414 if (!$dialog.length) { 1415 $dialog = $("<div id=\"".concat(response.selector.replace(/^#/, ''), "\" class=\"ui-front\"></div>")).appendTo('body'); 1416 } 1417 if (!ajax.wrapper) { 1418 ajax.wrapper = $dialog.attr('id'); 1419 } 1420 response.command = 'insert'; 1421 response.method = 'html'; 1422 ajax.commands.insert(ajax, response, status); 1423 if (!response.dialogOptions.buttons) { 1424 response.dialogOptions.drupalAutoButtons = true; 1425 response.dialogOptions.buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog); 1426 } 1427 $dialog.on('dialogButtonsChange', function () { 1428 var buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog); 1429 $dialog.dialog('option', 'buttons', buttons); 1430 }); 1431 response.dialogOptions = response.dialogOptions || {}; 1432 var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions); 1433 if (response.dialogOptions.modal) { 1434 dialog.showModal(); 1435 } else { 1436 dialog.show(); 1437 } 1438 $dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions'); 1439 }; 1440 Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) { 1441 var $dialog = $(response.selector); 1442 if ($dialog.length) { 1443 Drupal.dialog($dialog.get(0)).close(); 1444 if (!response.persist) { 1445 $dialog.remove(); 1446 } 1447 } 1448 $dialog.off('dialogButtonsChange'); 1449 }; 1450 Drupal.AjaxCommands.prototype.setDialogOption = function (ajax, response, status) { 1451 var $dialog = $(response.selector); 1452 if ($dialog.length) { 1453 $dialog.dialog('option', response.optionName, response.optionValue); 1454 } 1455 }; 1456 $(window).on('dialog:aftercreate', function (e, dialog, $element, settings) { 1457 $element.on('click.dialog', '.dialog-cancel', function (e) { 1458 dialog.close('cancel'); 1459 e.preventDefault(); 1460 e.stopPropagation(); 1461 }); 1462 }); 1463 $(window).on('dialog:beforeclose', function (e, dialog, $element) { 1464 $element.off('.dialog'); 1465 }); 1466 })(jQuery, Drupal); 1467 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/core/misc/dialog/dialog.ajax.js. */ 1468 ; 1469 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/modules/contrib/jquery_ui_accordion/jquery.ui/ui/widgets/accordion-min.js. */ 1470 /*! jQuery UI - v1.12.1 - 2017-03-31 1471 * http://jqueryui.com 1472 * Copyright jQuery Foundation and other contributors; Licensed */ 1473 ! function (a) { 1474 "function" == typeof define && define.amd ? define(["jquery", "../version", "../keycode", "../unique-id", "../widget"], a) : a(jQuery) 1475 }(function (a) { 1476 return a.widget("ui.accordion", { 1477 version: "1.12.1", 1478 options: { 1479 active: 0, 1480 animate: {}, 1481 classes: { 1482 "ui-accordion-header": "ui-corner-top", 1483 "ui-accordion-header-collapsed": "ui-corner-all", 1484 "ui-accordion-content": "ui-corner-bottom" 1485 }, 1486 collapsible: !1, 1487 event: "click", 1488 header: "> li > :first-child, > :not(li):even", 1489 heightStyle: "auto", 1490 icons: { 1491 activeHeader: "ui-icon-triangle-1-s", 1492 header: "ui-icon-triangle-1-e" 1493 }, 1494 activate: null, 1495 beforeActivate: null 1496 }, 1497 hideProps: { 1498 borderTopWidth: "hide", 1499 borderBottomWidth: "hide", 1500 paddingTop: "hide", 1501 paddingBottom: "hide", 1502 height: "hide" 1503 }, 1504 showProps: { 1505 borderTopWidth: "show", 1506 borderBottomWidth: "show", 1507 paddingTop: "show", 1508 paddingBottom: "show", 1509 height: "show" 1510 }, 1511 _create: function () { 1512 var b = this.options; 1513 this.prevShow = this.prevHide = a(), this._addClass("ui-accordion", "ui-widget ui-helper-reset"), this.element.attr("role", "tablist"), b.collapsible || b.active !== !1 && null != b.active || (b.active = 0), this._processPanels(), b.active < 0 && (b.active += this.headers.length), this._refresh() 1514 }, 1515 _getCreateEventData: function () { 1516 return { 1517 header: this.active, 1518 panel: this.active.length ? this.active.next() : a() 1519 } 1520 }, 1521 _createIcons: function () { 1522 var b, c, d = this.options.icons; 1523 d && (b = a("<span>"), this._addClass(b, "ui-accordion-header-icon", "ui-icon " + d.header), b.prependTo(this.headers), c = this.active.children(".ui-accordion-header-icon"), this._removeClass(c, d.header)._addClass(c, null, d.activeHeader)._addClass(this.headers, "ui-accordion-icons")) 1524 }, 1525 _destroyIcons: function () { 1526 this._removeClass(this.headers, "ui-accordion-icons"), this.headers.children(".ui-accordion-header-icon").remove() 1527 }, 1528 _destroy: function () { 1529 var a; 1530 this.element.removeAttr("role"), this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(), this._destroyIcons(), a = this.headers.next().css("display", "").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(), "content" !== this.options.heightStyle && a.css("height", "") 1531 }, 1532 _setOption: function (a, b) { 1533 return "active" === a ? void this._activate(b) : ("event" === a && (this.options.event && this._off(this.headers, this.options.event), this._setupEvents(b)), this._super(a, b), "collapsible" !== a || b || this.options.active !== !1 || this._activate(0), void("icons" === a && (this._destroyIcons(), b && this._createIcons()))) 1534 }, 1535 _setOptionDisabled: function (a) { 1536 this._super(a), this.element.attr("aria-disabled", a), this._toggleClass(null, "ui-state-disabled", !!a), this._toggleClass(this.headers.add(this.headers.next()), null, "ui-state-disabled", !!a) 1537 }, 1538 _keydown: function (b) { 1539 if (!b.altKey && !b.ctrlKey) { 1540 var c = a.ui.keyCode, 1541 d = this.headers.length, 1542 e = this.headers.index(b.target), 1543 f = !1; 1544 switch (b.keyCode) { 1545 case c.RIGHT: 1546 case c.DOWN: 1547 f = this.headers[(e + 1) % d]; 1548 break; 1549 case c.LEFT: 1550 case c.UP: 1551 f = this.headers[(e - 1 + d) % d]; 1552 break; 1553 case c.SPACE: 1554 case c.ENTER: 1555 this._eventHandler(b); 1556 break; 1557 case c.HOME: 1558 f = this.headers[0]; 1559 break; 1560 case c.END: 1561 f = this.headers[d - 1] 1562 } 1563 f && (a(b.target).attr("tabIndex", -1), a(f).attr("tabIndex", 0), a(f).trigger("focus"), b.preventDefault()) 1564 } 1565 }, 1566 _panelKeyDown: function (b) { 1567 b.keyCode === a.ui.keyCode.UP && b.ctrlKey && a(b.currentTarget).prev().trigger("focus") 1568 }, 1569 refresh: function () { 1570 var b = this.options; 1571 this._processPanels(), b.active === !1 && b.collapsible === !0 || !this.headers.length ? (b.active = !1, this.active = a()) : b.active === !1 ? this._activate(0) : this.active.length && !a.contains(this.element[0], this.active[0]) ? this.headers.length === this.headers.find(".ui-state-disabled").length ? (b.active = !1, this.active = a()) : this._activate(Math.max(0, b.active - 1)) : b.active = this.headers.index(this.active), this._destroyIcons(), this._refresh() 1572 }, 1573 _processPanels: function () { 1574 var a = this.headers, 1575 b = this.panels; 1576 this.headers = this.element.find(this.options.header), this._addClass(this.headers, "ui-accordion-header ui-accordion-header-collapsed", "ui-state-default"), this.panels = this.headers.next().filter(":not(.ui-accordion-content-active)").hide(), this._addClass(this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content"), b && (this._off(a.not(this.headers)), this._off(b.not(this.panels))) 1577 }, 1578 _refresh: function () { 1579 var b, c = this.options, 1580 d = c.heightStyle, 1581 e = this.element.parent(); 1582 this.active = this._findActive(c.active), this._addClass(this.active, "ui-accordion-header-active", "ui-state-active")._removeClass(this.active, "ui-accordion-header-collapsed"), this._addClass(this.active.next(), "ui-accordion-content-active"), this.active.next().show(), this.headers.attr("role", "tab").each(function () { 1583 var b = a(this), 1584 c = b.uniqueId().attr("id"), 1585 d = b.next(), 1586 e = d.uniqueId().attr("id"); 1587 b.attr("aria-controls", e), d.attr("aria-labelledby", c) 1588 }).next().attr("role", "tabpanel"), this.headers.not(this.active).attr({ 1589 "aria-selected": "false", 1590 "aria-expanded": "false", 1591 tabIndex: -1 1592 }).next().attr({ 1593 "aria-hidden": "true" 1594 }).hide(), this.active.length ? this.active.attr({ 1595 "aria-selected": "true", 1596 "aria-expanded": "true", 1597 tabIndex: 0 1598 }).next().attr({ 1599 "aria-hidden": "false" 1600 }) : this.headers.eq(0).attr("tabIndex", 0), this._createIcons(), this._setupEvents(c.event), "fill" === d ? (b = e.height(), this.element.siblings(":visible").each(function () { 1601 var c = a(this), 1602 d = c.css("position"); 1603 "absolute" !== d && "fixed" !== d && (b -= c.outerHeight(!0)) 1604 }), this.headers.each(function () { 1605 b -= a(this).outerHeight(!0) 1606 }), this.headers.next().each(function () { 1607 a(this).height(Math.max(0, b - a(this).innerHeight() + a(this).height())) 1608 }).css("overflow", "auto")) : "auto" === d && (b = 0, this.headers.next().each(function () { 1609 var c = a(this).is(":visible"); 1610 c || a(this).show(), b = Math.max(b, a(this).css("height", "").height()), c || a(this).hide() 1611 }).height(b)) 1612 }, 1613 _activate: function (b) { 1614 var c = this._findActive(b)[0]; 1615 c !== this.active[0] && (c = c || this.active[0], this._eventHandler({ 1616 target: c, 1617 currentTarget: c,
vendor: 5,108 bytes, lines 1618-1721
1618 preventDefault: a.noop 1619 })) 1620 }, 1621 _findActive: function (b) { 1622 return "number" == typeof b ? this.headers.eq(b) : a() 1623 }, 1624 _setupEvents: function (b) { 1625 var c = { 1626 keydown: "_keydown" 1627 }; 1628 b && a.each(b.split(" "), function (a, b) { 1629 c[b] = "_eventHandler" 1630 }), this._off(this.headers.add(this.headers.next())), this._on(this.headers, c), this._on(this.headers.next(), { 1631 keydown: "_panelKeyDown" 1632 }), this._hoverable(this.headers), this._focusable(this.headers) 1633 }, 1634 _eventHandler: function (b) { 1635 var c, d, e = this.options, 1636 f = this.active, 1637 g = a(b.currentTarget), 1638 h = g[0] === f[0], 1639 i = h && e.collapsible, 1640 j = i ? a() : g.next(), 1641 k = f.next(), 1642 l = { 1643 oldHeader: f, 1644 oldPanel: k, 1645 newHeader: i ? a() : g, 1646 newPanel: j 1647 }; 1648 b.preventDefault(), h && !e.collapsible || this._trigger("beforeActivate", b, l) === !1 || (e.active = !i && this.headers.index(g), this.active = h ? a() : g, this._toggle(l), this._removeClass(f, "ui-accordion-header-active", "ui-state-active"), e.icons && (c = f.children(".ui-accordion-header-icon"), this._removeClass(c, null, e.icons.activeHeader)._addClass(c, null, e.icons.header)), h || (this._removeClass(g, "ui-accordion-header-collapsed")._addClass(g, "ui-accordion-header-active", "ui-state-active"), e.icons && (d = g.children(".ui-accordion-header-icon"), this._removeClass(d, null, e.icons.header)._addClass(d, null, e.icons.activeHeader)), this._addClass(g.next(), "ui-accordion-content-active"))) 1649 }, 1650 _toggle: function (b) { 1651 var c = b.newPanel, 1652 d = this.prevShow.length ? this.prevShow : b.oldPanel; 1653 this.prevShow.add(this.prevHide).stop(!0, !0), this.prevShow = c, this.prevHide = d, this.options.animate ? this._animate(c, d, b) : (d.hide(), c.show(), this._toggleComplete(b)), d.attr({ 1654 "aria-hidden": "true" 1655 }), d.prev().attr({ 1656 "aria-selected": "false", 1657 "aria-expanded": "false" 1658 }), c.length && d.length ? d.prev().attr({ 1659 tabIndex: -1, 1660 "aria-expanded": "false" 1661 }) : c.length && this.headers.filter(function () { 1662 return 0 === parseInt(a(this).attr("tabIndex"), 10) 1663 }).attr("tabIndex", -1), c.attr("aria-hidden", "false").prev().attr({ 1664 "aria-selected": "true", 1665 "aria-expanded": "true", 1666 tabIndex: 0 1667 }) 1668 }, 1669 _animate: function (a, b, c) { 1670 var d, e, f, g = this, 1671 h = 0, 1672 i = a.css("box-sizing"), 1673 j = a.length && (!b.length || a.index() < b.index()), 1674 k = this.options.animate || {}, 1675 l = j && k.down || k, 1676 m = function () { 1677 g._toggleComplete(c) 1678 }; 1679 return "number" == typeof l && (f = l), "string" == typeof l && (e = l), e = e || l.easing || k.easing, f = f || l.duration || k.duration, b.length ? a.length ? (d = a.show().outerHeight(), b.animate(this.hideProps, { 1680 duration: f, 1681 easing: e, 1682 step: function (a, b) { 1683 b.now = Math.round(a) 1684 } 1685 }), void a.hide().animate(this.showProps, { 1686 duration: f, 1687 easing: e, 1688 complete: m, 1689 step: function (a, c) { 1690 c.now = Math.round(a), "height" !== c.prop ? "content-box" === i && (h += c.now) : "content" !== g.options.heightStyle && (c.now = Math.round(d - b.outerHeight() - h), h = 0) 1691 } 1692 })) : b.animate(this.hideProps, f, e, m) : a.animate(this.showProps, f, e, m) 1693 }, 1694 _toggleComplete: function (a) { 1695 var b = a.oldPanel, 1696 c = b.prev(); 1697 this._removeClass(b, "ui-accordion-content-active"), this._removeClass(c, "ui-accordion-header-active")._addClass(c, "ui-accordion-header-collapsed"), b.length && (b.parent()[0].className = b.parent()[0].className), this._trigger("activate", null, a) 1698 } 1699 }) 1700 }); 1701 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/modules/contrib/jquery_ui_accordion/jquery.ui/ui/widgets/accordion-min.js. */ 1702 ; 1703 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/themes/custom/gsone_revamp/js/global.js. */ 1704 (function ($, Drupal) { 1705 'use strict'; 1706 let helper; 1707 helper = { 1708 getCookie: function (cname) { 1709 let name = cname + "="; 1710 let ca = document.cookie.split(';'); 1711 for (var i = 0; i < ca.length; i++) { 1712 let c = ca[i]; 1713 while (c.charAt(0) == ' ') { 1714 c = c.substring(1); 1715 } 1716 if (c.indexOf(name) == 0) { 1717 return c.substring(name.length, c.length); 1718 } 1719 } 1720 return ""; 1721 },
1722 setCookie: function (cname, cvalue, exdays) { 1723 let d = new Date(); 1724 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 1725 let expires = "expires=" + d.toUTCString(); 1726 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 1727 } 1728 }; 1729 Drupal.behaviors.gsoneRevamp = { 1730 attach: function (context, settings) { 1731 if ($('body').hasClass('path-frontpage')) { 1732 if (helper.getCookie('uspopup_cookie_js') == '') { 1733 helper.setCookie('uspopup_cookie_js', 'displayed', 30); 1734 jQuery('#us-cookie-overlay').show(); 1735 } else { 1736 jQuery('#us-cookie-overlay').hide(); 1737 } 1738 } 1739 } 1740 }; 1741 Drupal.behaviors.searchBlock = { 1742 attach: function (context, settings) { 1743 $('.search-field').click(function (e) { 1744 e.preventDefault(); 1745 if ($("#search-block-form").hasClass("d-none")) { 1746 $('#search-block-form').removeClass('d-none'); 1747 $('.region-top-header').addClass('special-padding'); 1748 $('#search-block-form input').focus(); 1749 } else { 1750 $('#search-block-form').addClass('d-none'); 1751 $('.region-top-header').removeClass('special-padding'); 1752 } 1753 }); 1754 $('.close-button').click(function (e) { 1755 e.preventDefault(); 1756 $('#search-block-form').addClass('d-none'); 1757 $('.region-top-header').removeClass('special-padding'); 1758 }); 1759 } 1760 }; 1761 Drupal.behaviors.EventsNewsMenu = { 1762 attach: function (context, settings) { 1763 var html = $('.menu-desktop .news-event-template'); 1764 $('.menu-desktop #news-events-menu').html(html); 1765 } 1766 }; 1767 Drupal.behaviors.openDiv = { 1768 attach: function (context, settings) { 1769 $(".open-div").click(function (e) { 1770 e.preventDefault(); 1771 if ($(this).siblings('ul').hasClass('dn')) { 1772 $(this).siblings('ul').removeClass('dn'); 1773 $(this).siblings('ul').addClass('ps'); 1774 $(this).css("transform", "rotate(180deg)"); 1775 } else { 1776 $(this).siblings('ul').addClass('dn'); 1777 $(this).siblings('ul').removeClass('ps'); 1778 $(this).css("transform", ""); 1779 } 1780 }); 1781 } 1782 }; 1783 Drupal.behaviors.listGroupLinks = { 1784 attach: function (context, settings) { 1785 var isLargeWindow = $(window).width(); 1786 $(window).on('resize', function () { 1787 isLargeWindow = $(this).width() < 768; 1788 }); 1789 $(".list-group.collapsible-list .title").click(function (e) { 1790 if (isLargeWindow < 768) { 1791 e.preventDefault(); 1792 $(".list-group.collapsible-list .links").toggle(); 1793 $(".list-group.collapsible-list .title svg").toggleClass('rotate'); 1794 $(".list-group.collapsible-list").css('height', 'unset'); 1795 } 1796 }); 1797 } 1798 }; 1799 Drupal.behaviors.videoImage = { 1800 attach: function (context, settings) { 1801 function remoteVideo(click) { 1802 click.hide(); 1803 var siblingVideo = click.siblings(); 1804 siblingVideo.addClass('d-block'); 1805 siblingVideo.find('iframe').show(); 1806 siblingVideo.find('iframe').contents().find('iframe')[0].src += "&autoplay=1" 1807 } 1808 $(".video-block.video-open-modal .cover-image.remote").on('click', function (event) { 1809 $(this).parent().find('iframe').contents().find('iframe')[0].src += "&autoplay=1"; 1810 }); 1811 $(".video-block.video-open-modal .cover-image.video").on('click', function (event) { 1812 var vid = $(this).parent().find('video'); 1813 vid[0].autoplay = true; 1814 vid[0].load(); 1815 }); 1816 $(".video-open-modal-feature-banner .photo-background .img-wrapper").on('click', function (event) { 1817 $(this).closest('.video-open-modal-feature-banner').find('iframe').contents().find('iframe')[0].src += "&autoplay=1"; 1818 $(this).closest('.video-open-modal-feature-banner').find('.video-modal').modal({ 1819 backdrop: false 1820 }); 1821 }); 1822 $(".video-block.video-open-modal .modal, .video-open-modal-feature-banner .modal").on('hidden.bs.modal', function (e) { 1823 if ($(this).find('iframe').length > 0) { 1824 let videoSrc = $(this).find('iframe').contents().find('iframe')[0].src; 1825 let newVideoSrc = videoSrc.replaceAll("&autoplay=1", ""); 1826 $(this).find('iframe').contents().find('iframe')[0].src = newVideoSrc; 1827 } else { 1828 let vidClose = $(this).find('video'); 1829 vidClose[0].pause(); 1830 } 1831 }); 1832 $(".card-block-with-video-simple .cover-image.remote").click(function (e) { 1833 e.preventDefault(); 1834 remoteVideo($(this)); 1835 }); 1836 } 1837 }; 1838 Drupal.behaviors.videoImageModal = { 1839 attach: function (context, settings) { 1840 $(".card-block-with-video.video-open-modal").on('click', function (event) { 1841 $(this).parent().find('iframe').contents().find('iframe')[0].src += "&autoplay=1"; 1842 }); 1843 $(".card-block-section .modal").on('hidden.bs.modal', function (e) { 1844 let videoSrc = $(this).find('iframe').contents().find('iframe')[0].src; 1845 let newVideoSrc = videoSrc.replaceAll("&autoplay=1", ""); 1846 $(this).find('iframe').contents().find('iframe')[0].src = newVideoSrc; 1847 }); 1848 } 1849 }; 1850 Drupal.behaviors.Getslogan = { 1851 attach: function (context, settings) { 1852 var html = $('.region-top-header .slogan').text(); 1853 $('.bottom-navigation .site-slogan-div p').html(html); 1854 var html = $('.region-top-header #block-gsone-revamp-servicemenu .nav').clone(); 1855 $('.bottom-navigation .service-links').html(html); 1856 } 1857 }; 1858 Drupal.behaviors.caseStudy = { 1859 attach: function (context, settings) { 1860 $(".case-study-library-block .filters-box .button-filters").click(function (e) { 1861 e.preventDefault(); 1862 $(".case-study-library-block .filters-wrapper").removeClass('d-none'); 1863 $('body').addClass('hide-scroll'); 1864 }); 1865 $(".case-study-library-block .filters-wrapper .close-button").click(function (e) { 1866 e.preventDefault(); 1867 $(".case-study-library-block .filters-wrapper").addClass('d-none'); 1868 $('body').removeClass('hide-scroll'); 1869 }); 1870 $('.case-study-library-block .download-button').once().each(function (index, el) { 1871 $(el).on('click', function (e) { 1872 e.preventDefault(); 1873 if ($(this).parent().hasClass('show')) { 1874 $(this).parent().removeClass('show'); 1875 $(this).next().removeClass('d-block'); 1876 } else { 1877 $(this).next().addClass('d-block'); 1878 $(this).parent().addClass('show'); 1879 } 1880 }); 1881 }); 1882 $('.case-study-library-block .dropdown-options li a').once().each(function (index, el) { 1883 $(el).on('click', function (e) { 1884 e.preventDefault(); 1885 $(this).parent().parent().removeClass('d-block'); 1886 $(this).parent().parent().parent().removeClass('show'); 1887 }); 1888 }); 1889 } 1890 }; 1891 Drupal.behaviors.smoothScrool = { 1892 attach: function () { 1893 $('a[href^="#"]:not(.nav-link, .internal-link, .select-datapool)').on('click', function (e) { 1894 var id = $(this).attr('href'); 1895 var targetOffset = $(id).offset().top; 1896 $('html, body').animate({ 1897 scrollTop: targetOffset - 50 1898 }, 500); 1899 }); 1900 } 1901 }; 1902 Drupal.behaviors.popupIframe = { 1903 attach: function (context, settings) { 1904 $(".link-w-popup .link").click(function (e) { 1905 e.preventDefault(); 1906 let videoSrc = $(this).parent().parent().find('iframe').attr("src"); 1907 $(this).parent().parent().find('iframe').attr("src", videoSrc + "?autoplay=1"); 1908 }); 1909 $(".link-w-popup .modal").on('hidden.bs.modal', function (e) { 1910 let videoSrc = $(this).find('iframe').attr("src"); 1911 let newVideoSrc = videoSrc.replace("?autoplay=1", ""); 1912 $(this).find('iframe').attr("src", newVideoSrc); 1913 }); 1914 } 1915 }; 1916 Drupal.behaviors.hashUrlAccordion = { 1917 attach: function (context, settings) { 1918 var hash = window.location.hash; 1919 if (isNaN(parseInt(hash.charAt(1), 10)) && hash !== '') { 1920 var element = document.querySelector('body'); 1921 element = element.querySelector(hash); 1922 if ($(hash).parent().hasClass('paragraph--type--accordion')) { 1923 element.classList.add('show'); 1924 var yOffset = 200; 1925 var y = element.getBoundingClientRect().top + window.pageYOffset - yOffset; 1926 window.scrollTo({ 1927 top: y, 1928 behavior: 'smooth' 1929 }); 1930 } 1931 } 1932 } 1933 }; 1934 Drupal.behaviors.matchHeightLibrary = { 1935 attach: function (context, settings) { 1936 $('.matchheight section > div').matchHeight(); 1937 $('.matchheight .views-height').matchHeight(); 1938 } 1939 }; 1940 Drupal.behaviors.hashUrl = { 1941 attach: function (context, settings) { 1942 var hash = window.location.hash; 1943 if (isNaN(parseInt(hash.charAt(1), 10)) && hash !== '') { 1944 var hash = window.location.hash; 1945 var element = document.querySelector('body'); 1946 element = element.querySelector(hash); 1947 if (element.nextElementSibling.classList.contains('collapse')) { 1948 element.nextElementSibling.classList.add('show'); 1949 } 1950 var yOffset = 200; 1951 var y = element.getBoundingClientRect().top + window.pageYOffset - yOffset; 1952 window.scrollTo({ 1953 top: y, 1954 behavior: 'smooth' 1955 }); 1956 } 1957 } 1958 }; 1959 Drupal.behaviors.tabUrlSwitch = { 1960 attach: function () { 1961 var url = document.location.toString(); 1962 if (url.match('#')) { 1963 if ($('.nav-tabs a[href="#' + url.split('#')[1] + '"]').length) { 1964 $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show'); 1965 $('a.nav-link').removeClass('active'); 1966 $('a.nav-link[href="#' + url.split('#')[1] + '"]').addClass('active'); 1967 } 1968 } 1969 $('.nav-tabs a').click(function (e) { 1970 window.location.hash = this.hash; 1971 }); 1972 } 1973 } 1974 Drupal.behaviors.dateLettering = { 1975 attach: function () { 1976 $('.healthcare-news-teaser-block .date .datetime').once().each(function (index, el) { 1977 var text = el.textContent ? el.textContent : el.innerText; 1978 var items = text.split('-'); 1979 var html = '';
1980 items.forEach(function (text) { 1981 html += '<span>' + text + '</span>'; 1982 }); 1983 el.innerHTML = html; 1984 }); 1985 } 1986 } 1987 Drupal.behaviors.addBreadcrumbsColor = { 1988 attach: function () { 1989 if ($('div').hasClass('bg-breadcrumb-gray')) { 1990 $('.site-content').addClass('bg-color-gray'); 1991 } 1992 } 1993 }; 1994 Drupal.behaviors.changeBgContacts = { 1995 attach: function () { 1996 if ($('div').hasClass('change-bg-page')) { 1997 $('.site-content').addClass('bg-color-ui-1'); 1998 } 1999 } 2000 } 2001 Drupal.behaviors.contactsPage = { 2002 attach: function () { 2003 $('.general-contact-info-wrapper .contacts-info .field--name-field-email-text a').attr('target', '_blank'); 2004 } 2005 } 2006 })(jQuery, Drupal); 2007 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/themes/custom/gsone_revamp/js/global.js. */ 2008 ; 2009 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/themes/custom/gsone_revamp/js/jquery.matchHeight.js. */ 2010 /** 2011 * jquery.matchHeight-min.js v0.5.2 2012 * http://brm.io/jquery-match-height/ 2013 * License: MIT 2014 */ 2015 (function (b) { 2016 b.fn.matchHeight = function (a) { 2017 if ("remove" === a) { 2018 var d = this; 2019 this.css("height", ""); 2020 b.each(b.fn.matchHeight._groups, function (b, a) { 2021 a.elements = a.elements.not(d) 2022 }); 2023 return this 2024 } 2025 if (1 >= this.length) return this; 2026 a = "undefined" !== typeof a ? a : !0; 2027 b.fn.matchHeight._groups.push({ 2028 elements: this, 2029 byRow: a 2030 }); 2031 b.fn.matchHeight._apply(this, a); 2032 return this 2033 }; 2034 b.fn.matchHeight._apply = function (a, d) { 2035 var c = b(a), 2036 e = [c]; 2037 d && (c.css({ 2038 display: "block", 2039 "padding-top": "0", 2040 "padding-bottom": "0", 2041 "border-top": "0", 2042 "border-bottom": "0", 2043 height: "100px" 2044 }), 2045 e = k(c), c.css({ 2046 display: "", 2047 "padding-top": "", 2048 "padding-bottom": "", 2049 "border-top": "", 2050 "border-bottom": "", 2051 height: "" 2052 })); 2053 b.each(e, function (a, c) { 2054 var d = b(c), 2055 e = 0; 2056 d.each(function () { 2057 var a = b(this); 2058 a.css({ 2059 display: "block", 2060 height: "" 2061 }); 2062 a.outerHeight(!1) > e && (e = a.outerHeight(!1)); 2063 a.css({ 2064 display: "" 2065 }) 2066 }); 2067 d.each(function () { 2068 var a = b(this), 2069 c = 0; 2070 "border-box" !== a.css("box-sizing") && (c += g(a.css("border-top-width")) + g(a.css("border-bottom-width")), c += g(a.css("padding-top")) + g(a.css("padding-bottom"))); 2071 a.css("height", e - c) 2072 }) 2073 }); 2074 return this 2075 }; 2076 b.fn.matchHeight._applyDataApi = function () { 2077 var a = {}; 2078 b("[data-match-height], [data-mh]").each(function () { 2079 var d = b(this), 2080 c = d.attr("data-match-height"); 2081 a[c] = c in a ? a[c].add(d) : d 2082 }); 2083 b.each(a, function () { 2084 this.matchHeight(!0) 2085 }) 2086 }; 2087 b.fn.matchHeight._groups = []; 2088 b.fn.matchHeight._throttle = 80; 2089 var h = -1, 2090 f = -1; 2091 b.fn.matchHeight._update = function (a) { 2092 if (a && "resize" === a.type) { 2093 a = b(window).width(); 2094 if (a === h) return; 2095 h = a 2096 } - 1 === f && (f = setTimeout(function () { 2097 b.each(b.fn.matchHeight._groups, function () { 2098 b.fn.matchHeight._apply(this.elements, 2099 this.byRow) 2100 }); 2101 f = -1 2102 }, b.fn.matchHeight._throttle)) 2103 }; 2104 b(b.fn.matchHeight._applyDataApi); 2105 b(window).bind("load resize orientationchange", b.fn.matchHeight._update); 2106 var k = function (a) { 2107 var d = null, 2108 c = []; 2109 b(a).each(function () { 2110 var a = b(this), 2111 f = a.offset().top - g(a.css("margin-top")), 2112 h = 0 < c.length ? c[c.length - 1] : null; 2113 null === h ? c.push(a) : 1 >= Math.floor(Math.abs(d - f)) ? c[c.length - 1] = h.add(a) : c.push(a); 2114 d = f 2115 }); 2116 return c 2117 }, 2118 g = function (a) { 2119 return parseFloat(a) || 0 2120 } 2121 })(jQuery); 2122 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/themes/custom/gsone_revamp/js/jquery.matchHeight.js. */ 2123 ; 2124 /* Source and licensing information for the line(s) below can be found at https://www.gs1.org/modules/contrib/bootstrap_styles/js/plugins/scroll_effects/build.js. */ 2125 (function ($, _, Drupal, drupalSettings) { 2126 "use strict"; 2127 Drupal.behaviors.scrollEffectsInit = { 2128 attach: function (context, settings) { 2129 AOS.init(); 2130 } 2131 } 2132 })(window.jQuery, window._, window.Drupal, window.drupalSettings); 2133 /* Source and licensing information for the above line(s) can be found at https://www.gs1.org/modules/contrib/bootstrap_styles/js/plugins/scroll_effects/build.js. */ 2134 ; 2135
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.