WordPress/wp-includes/js/backbone.min.js
desrosj 0ae050a6c6 Build/Test Tools: Support NodeJS 14.x in the 3.9 branch.
This updates the 3.9 branch to support the latest LTS version of NodeJS (currently 14.x), allowing the same version to be used across all WordPress branches that receive security updates as a courtesy.

Because older branches use (really) old versions of NodeJS, the local Docker environment cannot be backported since the needed dependencies will not run on these older versions (see #48301). This also blocks the ability to move automated testing over to GitHub Actions (see #50401).

This change also introduces a `packager-lock.json` file to the branch.

In addition to backporting the package updates that happened after branching 3.9, dependencies that were removed in future releases have also been updated to their latest versions.

Props desrosj, dd32, netweb, jorbin.
Merges [28695,28796,28821,29270,29505,29858-30059,30061-30063,30066-30067,31425,31504,31557,31648-31650,32356-32357,32988,33726,35363,35513,35521,35538-35541,35859,36861-36865,37017,37019,37020,37212,37612,38111,39110,39113,39115-39117,39478,41835,42460-42461,42463,42887,43320,43323,43977,44219,44233,45321,45765,46404,46408-46409,47404,47867,47872-47873,48705,49636,49933,49937,49939,50126,50176,50185] to the 3.9 branch.
See #52341.
Built from https://develop.svn.wordpress.org/branches/3.9@50220


git-svn-id: http://core.svn.wordpress.org/branches/3.9@49886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-05 04:40:29 +00:00

1 line
19 KiB
JavaScript

!function(n,s){var t;"function"==typeof define&&define.amd?define(["underscore","jquery","exports"],function(t,e,i){n.Backbone=s(n,i,t,e)}):"undefined"!=typeof exports?(t=require("underscore"),s(n,exports,t)):n.Backbone=s(n,{},n._,n.jQuery||n.Zepto||n.ender||n.$)}(this,function(t,o,w,e){var i=t.Backbone,n=[],s=(n.push,n.slice);n.splice;o.VERSION="1.1.2",o.$=e,o.noConflict=function(){return t.Backbone=i,this},o.emulateHTTP=!1,o.emulateJSON=!1;var r=o.Events={on:function(t,e,i){return l(this,"on",t,[e,i])&&e&&(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:i,ctx:i||this})),this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var n=this,s=w.once(function(){n.off(t,s),e.apply(this,arguments)});return s._callback=e,this.on(t,s,i)},off:function(t,e,i){var n,s,r,o,a,h,c,u;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i)return this._events=void 0,this;for(a=0,h=(o=t?[t]:w.keys(this._events)).length;a<h;a++)if(t=o[a],r=this._events[t]){if(this._events[t]=n=[],e||i)for(c=0,u=r.length;c<u;c++)s=r[c],(e&&e!==s.callback&&e!==s.callback._callback||i&&i!==s.context)&&n.push(s);n.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!l(this,"trigger",t,e))return this;var i=this._events[t],n=this._events.all;return i&&a(i,e),n&&a(n,arguments),this},stopListening:function(t,e,i){var n=this._listeningTo;if(!n)return this;var s,r=!e&&!i;for(s in i||"object"!=typeof e||(i=this),t&&((n={})[t._listenId]=t),n)(t=n[s]).off(e,i,this),(r||w.isEmpty(t._events))&&delete this._listeningTo[s];return this}},h=/\s+/,l=function(t,e,i,n){if(!i)return!0;if("object"==typeof i){for(var s in i)t[e].apply(t,[s,i[s]].concat(n));return!1}if(h.test(i)){for(var r=i.split(h),o=0,a=r.length;o<a;o++)t[e].apply(t,[r[o]].concat(n));return!1}return!0},a=function(t,e){var i,n=-1,s=t.length,r=e[0],o=e[1],a=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o,a);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}};w.each({listenTo:"on",listenToOnce:"once"},function(s,t){r[t]=function(t,e,i){var n=this._listeningTo||(this._listeningTo={});return i||"object"!=typeof e||(i=this),(n[t._listenId||(t._listenId=w.uniqueId("l"))]=t)[s](e,i,this),this}}),r.bind=r.on,r.unbind=r.off,w.extend(o,r);var x=o.Model=function(t,e){var i=t||{};e=e||{},this.cid=w.uniqueId("c"),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(i=this.parse(i,e)||{}),i=w.defaults({},i,w.result(this,"defaults")),this.set(i,e),this.changed={},this.initialize.apply(this,arguments)};w.extend(x.prototype,r,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return w.clone(this.attributes)},sync:function(){return o.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return w.escape(this.get(t))},has:function(t){return null!=this.get(t)},set:function(t,e,i){var n,s,r,o,a,h,c;if(null==t)return this;if("object"==typeof t?(s=t,i=e):(s={})[t]=e,i=i||{},!this._validate(s,i))return!1;for(n in r=i.unset,a=i.silent,o=[],t=this._changing,this._changing=!0,t||(this._previousAttributes=w.clone(this.attributes),this.changed={}),c=this.attributes,h=this._previousAttributes,this.idAttribute in s&&(this.id=s[this.idAttribute]),s)e=s[n],w.isEqual(c[n],e)||o.push(n),w.isEqual(h[n],e)?delete this.changed[n]:this.changed[n]=e,r?delete c[n]:c[n]=e;if(!a){o.length&&(this._pending=i);for(var u=0,l=o.length;u<l;u++)this.trigger("change:"+o[u],this,c[o[u]],i)}if(t)return this;if(!a)for(;this._pending;)i=this._pending,this._pending=!1,this.trigger("change",this,i);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,w.extend({},e,{unset:!0}))},clear:function(t){var e,i={};for(e in this.attributes)i[e]=void 0;return this.set(i,w.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!w.isEmpty(this.changed):w.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&w.clone(this.changed);var e,i,n=!1,s=this._changing?this._previousAttributes:this.attributes;for(i in t)w.isEqual(s[i],e=t[i])||((n=n||{})[i]=e);return n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return w.clone(this._previousAttributes)},fetch:function(e){void 0===(e=e?w.clone(e):{}).parse&&(e.parse=!0);var i=this,n=e.success;return e.success=function(t){if(!i.set(i.parse(t,e),e))return!1;n&&n(i,t,e),i.trigger("sync",i,t,e)},I(this,e),this.sync("read",this,e)},save:function(t,e,i){var n,s=this.attributes;if(null==t||"object"==typeof t?(n=t,i=e):(n={})[t]=e,i=w.extend({validate:!0},i),n&&!i.wait){if(!this.set(n,i))return!1}else if(!this._validate(n,i))return!1;n&&i.wait&&(this.attributes=w.extend({},s,n)),void 0===i.parse&&(i.parse=!0);var r=this,o=i.success;return i.success=function(t){r.attributes=s;var e=r.parse(t,i);if(i.wait&&(e=w.extend(n||{},e)),w.isObject(e)&&!r.set(e,i))return!1;o&&o(r,t,i),r.trigger("sync",r,t,i)},I(this,i),"patch"==(e=this.isNew()?"create":i.patch?"patch":"update")&&(i.attrs=n),e=this.sync(e,this,i),n&&i.wait&&(this.attributes=s),e},destroy:function(e){e=e?w.clone(e):{};function i(){n.trigger("destroy",n,n.collection,e)}var n=this,s=e.success;if(e.success=function(t){(e.wait||n.isNew())&&i(),s&&s(n,t,e),n.isNew()||n.trigger("sync",n,t,e)},this.isNew())return e.success(),!1;I(this,e);var t=this.sync("delete",this,e);return e.wait||i(),t},url:function(){var t=w.result(this,"urlRoot")||w.result(this.collection,"url")||A();return this.isNew()?t:t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},w.extend(t||{},{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=w.extend({},this.attributes,t);t=this.validationError=this.validate(t,e)||null;return!t||(this.trigger("invalid",this,t,w.extend(e,{validationError:t})),!1)}});w.each(["keys","values","pairs","invert","pick","omit"],function(e){x.prototype[e]=function(){var t=s.call(arguments);return t.unshift(this.attributes),w[e].apply(w,t)}});var c=o.Collection=function(t,e){(e=e||{}).model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,w.extend({silent:!0},e))},E={add:!0,remove:!0,merge:!0},u={add:!0,remove:!1};w.extend(c.prototype,r,{model:x,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return o.sync.apply(this,arguments)},add:function(t,e){return this.set(t,w.extend({merge:!1},e,u))},remove:function(t,e){var i,n,s,r,o=!w.isArray(t);for(e=e||{},i=0,n=(t=o?[t]:w.clone(t)).length;i<n;i++)(r=t[i]=this.get(t[i]))&&(delete this._byId[r.id],delete this._byId[r.cid],s=this.indexOf(r),this.models.splice(s,1),this.length--,e.silent||(e.index=s,r.trigger("remove",r,this,e)),this._removeReference(r,e));return o?t[0]:t},set:function(t,e){(e=w.defaults({},e,E)).parse&&(t=this.parse(t,e));var i,n,s,r,o=!w.isArray(t);t=o?t?[t]:[]:w.clone(t);var a=e.at,h=this.model,c=this.comparator&&null==a&&!1!==e.sort,u=w.isString(this.comparator)?this.comparator:null,l=[],d=[],f={},p=e.add,g=e.merge,v=e.remove,m=!(c||!p||!v)&&[];for(_=0,b=t.length;_<b;_++){if(s=(n=t[_]||{})instanceof x?i=n:n[h.prototype.idAttribute||"id"],s=this.get(s))v&&(f[s.cid]=!0),g&&(n=n===i?i.attributes:n,e.parse&&(n=s.parse(n,e)),s.set(n,e),c&&!r&&s.hasChanged(u)&&(r=!0)),t[_]=s;else if(p){if(!(i=t[_]=this._prepareModel(n,e)))continue;l.push(i),this._addReference(i,e)}i=s||i,!m||!i.isNew()&&f[i.id]||m.push(i),f[i.id]=!0}if(v){for(_=0,b=this.length;_<b;++_)f[(i=this.models[_]).cid]||d.push(i);d.length&&this.remove(d,e)}if(l.length||m&&m.length)if(c&&(r=!0),this.length+=l.length,null!=a)for(_=0,b=l.length;_<b;_++)this.models.splice(a+_,0,l[_]);else{m&&(this.models.length=0);for(var y=m||l,_=0,b=y.length;_<b;_++)this.models.push(y[_])}if(r&&this.sort({silent:!0}),!e.silent){for(_=0,b=l.length;_<b;_++)(i=l[_]).trigger("add",i,this,e);(r||m&&m.length)&&this.trigger("sort",this,e)}return o?t[0]:t},reset:function(t,e){e=e||{};for(var i=0,n=this.models.length;i<n;i++)this._removeReference(this.models[i],e);return e.previousModels=this.models,this._reset(),t=this.add(t,w.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,w.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t),e},unshift:function(t,e){return this.add(t,w.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t),e},slice:function(){return s.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(i,t){return w.isEmpty(i)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var e in i)if(i[e]!==t.get(e))return!1;return!0})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t=t||{},w.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(w.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return w.invoke(this.models,"get",t)},fetch:function(i){void 0===(i=i?w.clone(i):{}).parse&&(i.parse=!0);var n=i.success,s=this;return i.success=function(t){var e=i.reset?"reset":"set";s[e](t,i),n&&n(s,t,i),s.trigger("sync",s,t,i)},I(this,i),this.sync("read",this,i)},create:function(t,i){if(i=i?w.clone(i):{},!(t=this._prepareModel(t,i)))return!1;i.wait||this.add(t,i);var n=this,s=i.success;return i.success=function(t,e){i.wait&&n.add(t,i),s&&s(t,e,i)},t.save(null,i),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(t instanceof x)return t;t=new((e=e?w.clone(e):{}).collection=this).model(t,e);return t.validationError?(this.trigger("invalid",this,t.validationError,e),!1):t},_addReference:function(t,e){null!=(this._byId[t.cid]=t).id&&(this._byId[t.id]=t),t.collection||(t.collection=this),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){("add"!==t&&"remove"!==t||i===this)&&("destroy"===t&&this.remove(e,n),e&&t==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],null!=e.id&&(this._byId[e.id]=e)),this.trigger.apply(this,arguments))}});w.each(["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"],function(e){c.prototype[e]=function(){var t=s.call(arguments);return t.unshift(this.models),w[e].apply(w,t)}});w.each(["groupBy","countBy","sortBy","indexBy"],function(n){c.prototype[n]=function(e,t){var i=w.isFunction(e)?e:function(t){return t.get(e)};return w[n](this.models,i,t)}});var n=o.View=function(t){this.cid=w.uniqueId("view"),t=t||{},w.extend(this,w.pick(t,f)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},d=/^(\S+)\s*(.*)$/,f=["model","collection","el","id","attributes","className","tagName","events"];w.extend(n.prototype,r,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,e){return this.$el&&this.undelegateEvents(),this.$el=t instanceof o.$?t:o.$(t),this.el=this.$el[0],!1!==e&&this.delegateEvents(),this},delegateEvents:function(t){if(!(t=t||w.result(this,"events")))return this;for(var e in this.undelegateEvents(),t){var i,n,s=t[e];(s=!w.isFunction(s)?this[t[e]]:s)&&(i=(n=e.match(d))[1],n=n[2],s=w.bind(s,this),i+=".delegateEvents"+this.cid,""===n?this.$el.on(i,s):this.$el.on(i,n,s))}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){var t;this.el?this.setElement(w.result(this,"el"),!1):(t=w.extend({},w.result(this,"attributes")),this.id&&(t.id=w.result(this,"id")),this.className&&(t["class"]=w.result(this,"className")),t=o.$("<"+w.result(this,"tagName")+">").attr(t),this.setElement(t,!1))}}),o.sync=function(t,e,i){var n=g[t];w.defaults(i=i||{},{emulateHTTP:o.emulateHTTP,emulateJSON:o.emulateJSON});var s,r={type:n,dataType:"json"};i.url||(r.url=w.result(e,"url")||A()),null!=i.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(i.attrs||e.toJSON(i))),i.emulateJSON&&(r.contentType="application/x-www-form-urlencoded",r.data=r.data?{model:r.data}:{}),!i.emulateHTTP||"PUT"!==n&&"DELETE"!==n&&"PATCH"!==n||(r.type="POST",i.emulateJSON&&(r.data._method=n),s=i.beforeSend,i.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",n),s)return s.apply(this,arguments)}),"GET"===r.type||i.emulateJSON||(r.processData=!1),"PATCH"===r.type&&p&&(r.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});r=i.xhr=o.ajax(w.extend(r,i));return e.trigger("request",e,r,i),r};var p=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),g={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};o.ajax=function(){return o.$.ajax.apply(o.$,arguments)};var e=o.Router=function(t){(t=t||{}).routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},v=/\((.*?)\)/g,m=/(\(\?)?:\w+/g,y=/\*\w+/g,_=/[\-{}\[\]+?.,\\\^$|#\s]/g;w.extend(e.prototype,r,{initialize:function(){},route:function(e,i,n){w.isRegExp(e)||(e=this._routeToRegExp(e)),w.isFunction(i)&&(n=i,i=""),n=n||this[i];var s=this;return o.history.route(e,function(t){t=s._extractParameters(e,t);s.execute(n,t),s.trigger.apply(s,["route:"+i].concat(t)),s.trigger("route",i,t),o.history.trigger("route",s,i,t)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,e){return o.history.navigate(t,e),this},_bindRoutes:function(){if(this.routes){this.routes=w.result(this,"routes");for(var t,e=w.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(_,"\\$&").replace(v,"(?:$1)?").replace(m,function(t,e){return e?t:"([^/?]+)"}).replace(y,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return w.map(i,function(t,e){return e===i.length-1?t||null:t?decodeURIComponent(t):null})}});var b=o.History=function(){this.handlers=[],w.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},k=/^[#\/]|\s+$/g,T=/^\/+|\/+$/g,$=/msie [\w.]+/,S=/\/$/,H=/#.*$/;b.started=!1,w.extend(b.prototype,r,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){t=(t||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(t,e){return null==t&&(this._hasPushState||!this._wantsHashChange||e?(t=decodeURI(this.location.pathname+this.location.search),e=this.root.replace(S,""),t.indexOf(e)||(t=t.slice(e.length))):t=this.getHash()),t.replace(k,"")},start:function(t){if(b.started)throw new Error("Backbone.history has already been started");b.started=!0,this.options=w.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment(),i=document.documentMode,t=$.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(T,"/"),t&&this._wantsHashChange&&(i=o.$('<iframe src="javascript:0" tabindex="-1">'),this.iframe=i.hide().appendTo("body")[0].contentWindow,this.navigate(e)),this._hasPushState?o.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!t?o.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=e;e=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&e.hash&&(this.fragment=this.getHash().replace(k,""),this.history.replaceState({},document.title,this.root+this.fragment))}if(!this.options.silent)return this.loadUrl()},stop:function(){o.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),b.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if((e=e===this.fragment&&this.iframe?this.getFragment(this.getHash(this.iframe)):e)===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(e){return e=this.fragment=this.getFragment(e),w.any(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0})},navigate:function(t,e){if(!b.started)return!1;e&&!0!==e||(e={trigger:!!e});var i=this.root+(t=this.getFragment(t||""));if(t=t.replace(H,""),this.fragment!==t){if(""===(this.fragment=t)&&"/"!==i&&(i=i.slice(0,-1)),this._hasPushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getFragment(this.getHash(this.iframe))&&(e.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){i?(i=t.href.replace(/(javascript:|#).*$/,""),t.replace(i+"#"+e)):t.hash="#"+e}}),o.history=new b;x.extend=c.extend=e.extend=n.extend=b.extend=function(t,e){var i=this,n=t&&w.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)};w.extend(n,i,e);e=function(){this.constructor=n};return e.prototype=i.prototype,n.prototype=new e,t&&w.extend(n.prototype,t),n.__super__=i.prototype,n};var A=function(){throw new Error('A "url" property or function must be specified')},I=function(e,i){var n=i.error;i.error=function(t){n&&n(e,t,i),e.trigger("error",e,t,i)}};return o});