1(function($) { 2 function __(string) { 3 return WFLS_ADMIN_TRANSLATIONS[string] || string; 4 } 5 window['WFLS'] = { 6 panelIsOpen: false, 7 basePageName: '', 8 panelQueue: [], 9 pendingChanges: {}, 10 userIsActivating: false, 11 12 //Screen sizes 13 SCREEN_XS: 'xs', 14 SCREEN_SM: 'sm', 15 SCREEN_MD: 'md', 16 SCREEN_LG: 'lg', 17 18 init: function() { 19 this.basePageName = document.title; 20 21 var featuredPageShell = document.querySelector('.wfls-featured-page-shell'); 22 if (featuredPageShell) { 23 var shellHeightUpdateScheduled = false; 24 var updateFeaturedPageShellHeight = function() { 25 shellHeightUpdateScheduled = false; 26 var documentTop = featuredPageShell.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || 0); 27 featuredPageShell.style.minHeight = Math.max(window.innerHeight - documentTop, 0) + 'px'; 28 }; 29 var scheduleFeaturedPageShellHeightUpdate = function() { 30 if (shellHeightUpdateScheduled) { 31 return; 32 } 33 shellHeightUpdateScheduled = true; 34 if (window.requestAnimationFrame) { 35 window.requestAnimationFrame(updateFeaturedPageShellHeight); 36 } 37 else { 38 window.setTimeout(updateFeaturedPageShellHeight, 0); 39 } 40 }; 41 42 updateFeaturedPageShellHeight(); 43 $(window).on('resize.wflsFeaturedPage', scheduleFeaturedPageShellHeightUpdate); 44 if (window.MutationObserver && featuredPageShell.parentNode) { 45 var featuredPageObserver = new MutationObserver(scheduleFeaturedPageShellHeightUpdate); 46 featuredPageObserver.observe(featuredPageShell.parentNode, {childList: true, subtree: true}); 47 } 48 } 49 50 var tabs = $('.wfls-page-tabs').find('.wfls-tab a'); 51 if (tabs.length > 0) { 52 tabs.click(function(event) { 53 var link = this; 54 var activeTab = $('.wfls-page-tabs').find('.wfls-tab.wfls-active'); 55 var tab = $(link).closest('.wfls-tab'); 56 var tabChangeRequest = { 57 from: activeTab.data('target') || null, 58 to: tab.data('target'), 59 href: link.href, 60 prevented: false, 61 proceed: function() { 62 window.location.href = link.href; 63 window.location.reload(true); 64 } 65 }; 66 67 if (window.WFLSEventEmitter) { 68 window.WFLSEventEmitter.emit('beforeTabChange', tabChangeRequest); 69 } 70 if (tabChangeRequest.prevented) { 71 event.preventDefault(); 72 if (activeTab.length && window.history && window.history.replaceState) { 73 window.history.replaceState('', document.title, activeTab.find('a').attr('href')); 74 } 75 return; 76 } 77 78 $('.wfls-page-tabs').find('.wfls-tab').removeClass('wfls-active'); 79 $('.wfls-tab-content').removeClass('wfls-active'); 80 81 tab.addClass('wfls-active'); 82 var content = $('#' + tab.data('target')); 83 content.addClass('wfls-active'); 84 document.title = tab.data('pageTitle') + " \u2039 " + WFLS.basePageName; 85 $(window).trigger('wfls-tab-change', [tab.data('target')]); 86 }); 87 var activateHashTab = function() { 88 var hashes = WFLS.parseHashes(); 89 var hash = hashes[hashes.length - 1]; 90 for (var i = 0; i < tabs.length; i++) { 91 if (hash == $(tabs[i]).closest('.wfls-tab').data('target')) { 92 $(tabs[i]).trigger('click'); 93 return; 94 } 95 } 96 $(tabs[0]).trigger('click'); 97 }; 98 if (window.location.hash) { 99 activateHashTab(); 100 } 101 else { 102 $(tabs[0]).trigger('click'); 103 } 104 $(window).on('hashchange', function () { 105 activateHashTab(); 106 }); 107 } 108 }, 109 110 /** 111 * Sends a WP AJAX call, automatically adding our nonce. 112 * 113 * @param string action 114 * @param string|array|object payload 115 * @param function successCallback 116 * @param function failureCallback 117 */ 118 ajax: function(action, payload, successCallback, failureCallback) { 119 if (typeof(payload) == 'string') { 120 if (payload.length > 0) { 121 payload += '&'; 122 } 123 payload += 'action=' + action + '&nonce=' + WFLSVars.nonce; 124 } 125 else if (typeof(payload) == 'object' && payload instanceof Array) { 126 // jQuery serialized form data 127 payload.push({ 128 name: 'action', 129 value: action 130 }); 131 payload.push({ 132 name: 'nonce', 133 value: WFLSVars.nonce 134 }); 135 } 136 else if (typeof(payload) == 'object') { 137 payload['action'] = action; 138 payload['nonce'] = WFLSVars.nonce; 139 } 140 141 142 $.ajax({ 143 type: 'POST', 144 url: WFLSVars.ajaxurl, 145 dataType: "json", 146 data: payload, 147 success: function(json) { 148 typeof successCallback == 'function' && successCallback(json); 149 }, 150 error: function() { 151 typeof failureCallback == 'function' && failureCallback(); 152 } 153 }); 154 }, 155 156 escapeHTML: function(str) { 157 return String(str) 158 .replace(/&/g, '&') 159 .replace(/</g, '<') 160 .replace(/>/g, '>') 161 .replace(/"/g, '"') 162 .replace(/'/g, '''); 163 }, 164 165 base64UrlToUint8Array: function(base64url) { 166 var padding = '='.repeat((4 - (base64url.length % 4)) % 4); 167 var base64 = (base64url + padding).replace(/-/g, '+').replace(/_/g, '/'); 168 var raw = window.atob(base64); 169 var bytes = new Uint8Array(raw.length); 170 for (var i = 0; i < raw.length; i++) { 171 bytes[i] = raw.charCodeAt(i); 172 } 173 return bytes; 174 }, 175 176 arrayBufferToBase64Url: function(buffer) { 177 var bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer); 178 var binary = ''; 179 for (var i = 0; i < bytes.length; i++) { 180 binary += String.fromCharCode(bytes[i]); 181 } 182 return window.btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/g, ''); 183 }, 184 185 publicKeyOptionsFromJSON: function(options) { 186 var parsed = $.extend(true, {}, options); 187 parsed.challenge = WFLS.base64UrlToUint8Array(parsed.challenge); 188 parsed.user.id = WFLS.base64UrlToUint8Array(parsed.user.id); 189 if (parsed.excludeCredentials && parsed.excludeCredentials.length) { 190 for (var i = 0; i < parsed.excludeCredentials.length; i++) { 191 parsed.excludeCredentials[i].id = WFLS.base64UrlToUint8Array(parsed.excludeCredentials[i].id); 192 } 193 } 194 return parsed; 195 }, 196 197 credentialToJSON: function(credential) { 198 var transports = []; 199 var clientExtensionResults = {}; 200 if (credential.response && typeof credential.response.getTransports === 'function') { 201 transports = credential.response.getTransports(); 202 } 203 if (typeof credential.getClientExtensionResults === 'function') { 204 clientExtensionResults = credential.getClientExtensionResults() || {}; 205 } 206 return { 207 id: credential.id, 208 type: credential.type, 209 rawId: WFLS.arrayBufferToBase64Url(credential.rawId), 210 clientExtensionResults: clientExtensionResults, 211 response: { 212 clientDataJSON: WFLS.arrayBufferToBase64Url(credential.response.clientDataJSON), 213 attestationObject: WFLS.arrayBufferToBase64Url(credential.response.attestationObject), 214 transports: transports 215 } 216 }; 217 }, 218 219 /** 220 * Closes the current standalone modal dialog. Supports being used directly as an event handler. 221 * 222 * @param event (optional) 223 */ 224 closeStandaloneModal: function(event) { 225 event && event.preventDefault(); 226 event && event.stopPropagation(); 227 WFLS.currentDialog && WFLS.currentDialog.dialog('close'); 228 }, 229 230 /** 231 * Displays a modal dialog with fixed HTML content using built-in WP functionality. This is intended for 232 * use by content that may not have the Vue runtime available. 233 * 234 * @param html 235 * @param settings 236 */ 237 standaloneModalHTML: function(html, settings) { 238 if (!settings) { settings = {}; } 239 WFLS.currentDialog && WFLS.currentDialog.dialog('close'); 240 WFLS.currentDialog = $('<div>', { html: html }).dialog({ 241 modal: true, 242 width: settings.width ? settings.width : (WFLS.screenSize(500) ? 300 : 400), 243 resizable: false, 244 draggable: false, 245 zIndex: 9998, 246 close: function () { 247 $(this).dialog('destroy').remove(); 248 WFLS.currentDialog = false;
249 typeof settings.onClose === 'function' && settings.onClose(); 250 }, 251 open: function () { 252 var dialog = $(this); 253 var widget = dialog.dialog('widget'); 254 var instance = dialog.dialog('instance'); 255 256 widget.attr('id', 'wfls-standalone-modal').css('z-index', 9999); 257 instance && instance.overlay && instance.overlay.attr('id', 'wfls-standalone-modal-overlay'); 258 259 typeof settings.onOpen === 'function' && settings.onOpen(this); 260 } 261 }); 262 }, 263 264 standaloneModal: function(heading, body, settings) { 265 if (!settings) { settings = {}; } 266 var html = 267 '<div class="wfls-modal">' + 268 '<div class="wfls-modal-header">' + 269 '<div class="wfls-modal-header-content">' + 270 '<div class="wfls-modal-title">' + 271 '<strong>' + (typeof heading === 'object' ? heading.html : WFLS.escapeHTML(heading)) + '</strong>' + 272 '</div>' + 273 '</div>' + 274 '<div class="wfls-modal-header-action"></div>' + 275 '</div>' + 276 '<div class="wfls-modal-content">' + 277 (typeof body === 'object' ? body.html : WFLS.escapeHTML(body)) + 278 '</div>' + 279 '<div class="wfls-modal-footer">' + 280 '<ul class="wfls-flex-horizontal wfls-flex-align-right wfls-full-width">' + 281 '<li class="wfls-padding-add-left-small"><a href="#" class="wfls-btn wfls-btn-primary wfls-btn-callout-subtle wfls-generic-close-btn">' + __('Close') + '</a></li>' + 282 '</ul>' + 283 '</div>' + 284 '</div>'; 285 286 var originalOpen = settings.onOpen; 287 settings.onOpen = function(dialog) { 288 $(dialog).find('.wfls-generic-close-btn').on('click', WFLS.closeStandaloneModal); 289 typeof originalOpen === 'function' && originalOpen(dialog); 290 } 291 WFLS.standaloneModalHTML(html, settings) 292 }, 293 294 /** 295 * Parses and returns the hash portion of a URL, working around user agents that URL-encode the # character. 296 * 297 * @returns {Array} 298 */ 299 parseHashes: function() { 300 var hashes = window.location.hash.replace('%23', '#'); 301 var splitHashes = hashes.split('#'); 302 var result = []; 303 for (var i = 0; i < splitHashes.length; i++) { 304 if (splitHashes[i].length > 0) { 305 result.push(splitHashes[i]); 306 } 307 } 308 return result; 309 }, 310 311 /** 312 * Returns whether or not the screen size is within the size given. This may be a numerical value 313 * or one of the WFLS_SCREEN_ constants. 314 * 315 * @param size 316 * @returns {boolean} 317 */ 318 screenSize: function(size) { 319 switch (size) { 320 case WFLS.SCREEN_XS: 321 return window.matchMedia("only screen and (max-width: 767px)").matches; 322 case WFLS.SCREEN_SM: 323 return window.matchMedia("only screen and (max-width: 991px)").matches; 324 case WFLS.SCREEN_MD: 325 return window.matchMedia("only screen and (max-width: 1199px)").matches; 326 case WFLS.SCREEN_LG: 327 return window.matchMedia("only screen and (max-width: 32767px)").matches; 328 } 329 330 var parsed = parseInt(size); 331 if (isNaN(parsed)) { 332 return false; 333 } 334 return window.matchMedia("only screen and (max-width: " + parsed + "px)").matches; 335 }, 336 }; 337 338 $(function() { 339 WFLS.init(); 340 }); 341 342 $.fn.crossfade = function(incoming, duration, complete) { 343 duration = duration || 400; 344 complete = complete || function() { }; 345 346 return this.each(function() { 347 $(this).fadeOut(duration, function() { 348 $(incoming).fadeIn(duration, complete); 349 }); 350 }); 351 }; 352})(jQuery); 353 354/*! @source https://github.com/eligrey/FileSaver.js/blob/master/dist/FileSaver.min.js */ 355(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error("could not download file")},d.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");
vendor: 1,788 bytes, line 355
355b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g,"undefined"!=typeof module&&(module.exports=g)});
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.