Files
tekelanew_acs/acs/nladmin-ui/node_modules/xe-ajax/dist/xe-ajax.umd.min.js

6 lines
14 KiB
JavaScript
Raw Normal View History

2024-12-03 17:40:13 +08:00
/**
* xe-ajax.js v4.0.5
* MIT License.
* @preserve
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.XEAjax=e()}(this,function(){"use strict";var e="undefined",a=encodeURIComponent,r=typeof window===e&&typeof process!==e,t=typeof AbortController!==e&&typeof AbortSignal!==e,n=typeof console===e?"":console,o="";function u(t){return!!t&&t.constructor===Object}function c(t){return!!t&&t.constructor===Array}function s(t,e){for(var n=t.length-1;0<=n;n--)if(e===t[n])return n;return-1}function f(t,e,n){for(var r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function i(t){return t.origin||(r?"":o.origin||o.protocol+"//"+o.host)}r||(o=location);var y={IS_N:r,IS_F:!r&&!!self.fetch,IS_A:!(typeof Blob===e||typeof FormData===e||typeof FileReader===e),IS_FAC:t,IS_DP:Object.defineProperty&&{}.__defineGetter__,isFData:function(t){return typeof FormData!==e&&t instanceof FormData},isURLSParams:function(t){return typeof URLSearchParams!==e&&t instanceof URLSearchParams},isCrossOrigin:function(t){if(!r){var e=(""+t).match(/(\w+:)\/{2}((.*?)\/|(.*)$)/);if(e&&2<e.length)return e[1]!==o.protocol||e[2].split("/")[0]!==o.host}return!1},isStr:function(t){return"string"==typeof t},isObj:function(t){return t&&"object"==typeof t},isPlainObject:u,isFn:function(t){return"function"==typeof t},createErr:function(t){return new Error(t)},err:n.error?function(t){n.error(t)}:function(){},getOrigin:i,getBaseURL:function(t){if(t.baseURL)return t.baseURL;if(r)return"";var e=o.pathname,n=s(e,"/")+1;return i(t)+(n===e.length?e:e.substring(0,n))},objectEach:f,serialize:function(t){var n,r=[];return f(t,function(t,e){void 0!==t&&(n=c(t),u(t)||n?r=r.concat(function r(t,o,s){var i=[];return f(t,function(t,e){var n=c(t);u(t)||n?i=i.concat(r(t,o+"["+e+"]",n)):i.push(a(o+"["+(s?"":e)+"]")+"="+a(null===t?"":t))}),i}(t,e,n)):r.push(a(e)+"="+a(null===t?"":t)))}),r.join("&").replace(/%20/g,"+")},assign:Object.assign||function(t){for(var e,n=arguments,r=1,o=n.length;r<o;r++)for(var s in e=n[r])e.hasOwnProperty(s)&&(t[s]=e[s]);return t},trim:function(t){return(""+t).replace(/(^\s*)|(\s*$)/g,"")},includes:function(t,e){return-1<s(t,e)},arrayEach:function(t,e,n){for(var r=0,o=t.length;r<o;r++)e.call(n,t[r],r,t)},headersEach:function(t,e){t&&t.forEach&&t.forEach(e)}},d={method:"GET",mode:"cors",cache:"default",credentials:"same-origin",redirect:"follow",bodyType:"json-data",headers:{Accept:"application/json, text/plain, */*"}};function h(t){Object.assign(this,{autoCompute:!0,fixed:2,meanSpeed:0,onDownloadProgress:null,onUploadProgress:null},t,{_progress:{value:0,total:0,loaded:0}})}function l(t){return(""+t).toLowerCase()}function p(t,e){var n,r,o;this.$index=0,this.$list=(n=t,r=e,o=[],y.objectEach(n,function(t,e){o.push([e,t,[e,t]][r])}),o),this.next=function(){return e=(t=this).$list[this.$index],{done:r=t.$index++>=t.$list.length,value:r?n:e};var t,e,n,r}}function g(t){var n=this;n._d={},y[t instanceof m?"headersEach":"objectEach"](t,function(t,e){n.set(e,t)})}y.IS_DP&&y.arrayEach("time,speed,loaded,value,total,remaining".split(","),function(t){Object.defineProperty(h.prototype,t,{get:function(){return this._progress[t]}})});var v=g.prototype;v.set=function(t,e){this._d[l(t)]=e},v.get=function(t){var e=l(t);return this.has(e)?this._d[e]:null},v.append=function(t,e){var n=l(t),r=this._d;this.has(n)?r[n]=r[n]+", "+e:r[n]=""+e},v.has=function(t){return this._d.hasOwnProperty(l(t))},v.keys=function(){return new p(this._d,0)},v.values=function(){return new p(this._d,1)},v.entries=function(){return new p(this._d,2)},v.delete=function(t){delete this._d[l(t)]},v.forEach=function(t,e){y.objectEach(this._d,t,e)};var m="undefined"==typeof Headers?g:Headers;function b(r,t,e){this.locked=!1,this._getBody=function(){var n=this;return y.IS_DP?e._response.bodyUsed=!0:e.bodyUsed=!0,new Promise(function(t,e){n.locked?e(y.createErr("body stream already read")):(n.locked=!0,t(r))})}}function _(){this.onaborted=null,y.IS_DP?this._store={aborted:!1}:this.aborted=!1}y.IS_DP&&Object.defineProperty(_.prototype,"aborted",{get:function(){return this._store.aborted}}