Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jxstjh/auth-client

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jxstjh/auth-client - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

lib/index.js

@@ -8,2 +8,2 @@ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=14)}([function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n,o;

* Released under the MIT license
*/!function(i){if(void 0===(o="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=o),!0,e.exports=i(),!!0){var s=window.Cookies,a=window.Cookies=i();a.noConflict=function(){return window.Cookies=s,a}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function o(){}function i(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var s=JSON.stringify(r);/^[\{\[]/.test(s)&&(r=s)}catch(e){}r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=t+"="+r+a}}function s(e,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],s=0;s<i.length;s++){var a=i[s].split("="),c=a.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=t(a[0]);if(c=(n.read||n)(c,u)||t(c),r)try{c=JSON.parse(c)}catch(e){}if(o[u]=c,e===u)break}catch(e){}}return e?o[e]:o}}return o.set=i,o.get=function(e){return s(e,!1)},o.getJSON=function(e){return s(e,!0)},o.remove=function(t,r){i(t,"",e(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))}))},function(e,t,r){e.exports=r(9)},function(e,t,r){"use strict";const n=r(10),o=r(11),i=r(12),s=r(13),a=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function u(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function f(e,t){return t.decode?o(e):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function h(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function d(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const o="string"==typeof r&&r.includes(e.arrayFormatSeparator),i="string"==typeof r&&!o&&f(r,e).includes(e.arrayFormatSeparator);r=i?f(r,e):r;const s=o||i?r.split(e.arrayFormatSeparator).map(t=>f(t,e)):null===r?r:f(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(n[t]=r?f(r,e):r);const i=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>f(t,e));void 0!==n[t]?n[t]=[].concat(n[t],i):n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const o of e.split("&")){if(""===o)continue;let[e,s]=i(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:f(s,t),r(f(e,t),s,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=h(r[e],t);else n[e]=h(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=p,t.parse=d,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const o=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[u(t,e),"[",o,"]"].join("")]:[...r,[u(t,e),"[",u(o,e),"]=",u(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[u(t,e),"[]"].join("")]:[...r,[u(t,e),"[]=",u(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:(o=null===o?"":o,0===n.length?[[u(r,e),t,u(o,e)].join("")]:[[n,u(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,u(t,e)]:[...r,[u(t,e),"=",u(n,e)].join("")]}}(t),o={};for(const t of Object.keys(e))r(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map(r=>{const o=e[r];return void 0===o?"":null===o?u(r,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?u(r,t)+"[]":o.reduce(n(r),[]).join("&"):u(r,t)+"="+u(o,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=i(e,"#");return Object.assign({url:r.split("?")[0]||"",query:d(p(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:f(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const n=l(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),s=Object.assign(i,e.query);let c=t.stringify(s,r);c&&(c="?"+c);let f=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(f="#"+(r[a]?u(e.fragmentIdentifier,r):e.fragmentIdentifier)),`${n}${c}${f}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);const{url:o,query:i,fragmentIdentifier:c}=t.parseUrl(e,n);return t.stringifyUrl({url:o,query:s(i,r),fragmentIdentifier:c},n)},t.exclude=(e,r,n)=>{const o=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,o,n)}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,r)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,s,a;if(u(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=f(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):v(o,o.length)}function y(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,f=v(c,u);for(r=0;r<u;++r)i(f[r],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return u(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,o,i,s;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},a.prototype.listenerCount=y,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,c,"next",e)}function c(e){r(s,o,i,a,c,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof l?t:l,i=Object.create(o.prototype),s=new k(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=b(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,s),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&r.call(v,o)&&(d=v);var m=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(o,i){function s(){return new t((function(n,s){!function n(o,i,s,a){var c=u(e[o],e,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(l).then((function(e){f.value=e,s(f)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=m.constructor=h,h.constructor=p,p.displayName=a(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,a(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(w.prototype),w.prototype[i]=function(){return this},e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var s=new w(c(t,r,n,o),i);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},g(m),a(m,s,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],i(r),i(n))}function s(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=i(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=s(r[0]);n!==r[0]&&(t[r[0]]=n)}r=o.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),a=0;a<i.length;a++){var c=i[a];e=e.replace(new RegExp(c,"g"),t[c])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),o=Array.isArray(t),i=0;i<n.length;i++){var s=n[i],a=e[s];(o?-1!==t.indexOf(s):t(s,a,e))&&(r[s]=a)}return r}},function(e,t,r){"use strict";r.r(t),r.d(t,"AuthClient",(function(){return I}));var n,o=r(4),i=r.n(o),s=r(5),a=r.n(s),c=r(0),u=r.n(c);!function(e){e.SSO="sso",e.DD="dingTalk",e.CUSTOM="custom"}(n||(n={}));var f="inited",l="error",p=r(6);function h(e){this.message=e}h.prototype=new Error,h.prototype.name="InvalidCharacterError";"undefined"!=typeof window&&window.atob&&window.atob.bind(window);function d(e){this.message=e}d.prototype=new Error,d.prototype.name="InvalidTokenError";var y=r(1),v=r.n(y),m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};v.a.set(e,t,r)},g=function(e){return v.a.get(e)},w=function(e){v.a.remove(e)},b=r(7),x=r.n(b),_=r(8),k=r.n(_),L=r(2),O=r.n(L),j=function(){var e=k()(O.a.mark((function e(){var t,r,n,o,i,s,a,c,u=arguments;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:"",r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:"GET",o=u.length>3&&void 0!==u[3]?u[3]:"fetch",n=n.toUpperCase(),t=t,"GET"==n&&(i="",Object.keys(r).forEach((function(e){i+=e+"="+r[e]+"&"})),""!==i&&(i=i.substr(0,i.lastIndexOf("&")),t=t+"?"+i)),!window.fetch||"fetch"!=o){e.next=25;break}return s={credentials:"include",method:n,headers:{Accept:"application/json","Content-Type":"application/json"},mode:"cors",cache:"force-cache"},"POST"==n&&Object.defineProperty(s,"body",{value:JSON.stringify(r)}),e.prev=10,e.next=13,fetch(t,s);case 13:return a=e.sent,e.next=16,a.json();case 16:return c=e.sent,e.abrupt("return",c);case 20:throw e.prev=20,e.t0=e.catch(10),new Error(e.t0);case 23:e.next=26;break;case 25:return e.abrupt("return",new Promise((function(e,o){var i;i=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject;var s="";"POST"==n&&(s=JSON.stringify(r)),i.open(n,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(s),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status){var t=i.response;"object"!==x()(t)&&(t=JSON.parse(t)),e(t)}else o(i)}})));case 26:case"end":return e.stop()}}),e,null,[[10,20]])})));return function(){return e.apply(this,arguments)}}(),S=r(3),E="JH_AUTH_CLIENT_BASE",C=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),r=window.location.search.substr(1).match(t);return null!=r?decodeURI(r[2]):null},I=function(){function e(t){i()(this,e),this.option=t,u()(this,"_tokenInfo",void 0),u()(this,"_user",void 0),u()(this,"_emitter",new p),u()(this,"_href",void 0),u()(this,"_permissionList",void 0),this.option=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={SSOServer:"http://authorization.test.jxwrd.gov.cn",resourceCode:"93d95466c3354e01babded985924e2c7",jwtToken:!0,method:n.SSO,cacheInCookie:!1};return Object.assign(t,e)}(t),this._href=window.location.href;var r,o=(r=E+"_isDirty",JSON.parse(sessionStorage.getItem(r)));this.init(o)}return a()(e,[{key:"token",get:function(){return this._tokenInfo.access_token}},{key:"tokenInfo",get:function(){return this._tokenInfo},set:function(e){this._tokenInfo=e}},{key:"user",get:function(){return this._user},set:function(e){this._user=e}},{key:"permissionList",get:function(){return this._permissionList},set:function(e){this._permissionList=e}},{key:"init",value:function(e){var t=this;if(e&&this.getCookieCache()){var r=this.user,o=this.tokenInfo,i=this.permissionList,s=C("tmpTicket");s&&"null"!==s&&"undefined"!==s?this.validateBytmpTicket(s):setTimeout((function(){t._emitter.emit(f,{umsAdmin:r,tokenInfo:o,permissionList:i})}),26)}else switch(this.option.method){case n.CUSTOM:return;case n.SSO:return void this.initSSOMethod()}}},{key:"getCookieCache",value:function(){return this.user=g(E+"_user"),this.tokenInfo=g(E+"_tokenInfo"),this.permissionList=g(E+"_permissionList"),!(!this.user||!this.tokenInfo)||(this.removeAllCookie(),!1)}},{key:"removeAllCookie",value:function(){w(E+"_user"),w(E+"_tokenInfo"),w(E+"_permissionList")}},{key:"setAllCookies",value:function(){var e={expires:(this.tokenInfo&&this.tokenInfo.expires_in||3600)/3600/24};m(E+"_user",this.user,e),m(E+"_tokenInfo",this.tokenInfo,e),m(E+"_permissionList",this.permissionList,e)}},{key:"initSSOMethod",value:function(){var e,t,r=C("tmpTicket");if(e=E+"_isDirty",t=!0,sessionStorage.setItem(e,JSON.stringify(t)),r&&"null"!==r&&"undefined"!==r)this.validateBytmpTicket(r);else{var n=encodeURIComponent(this._href);window.location.href="".concat(this.option.SSOServer,"/login?code=").concat(this.option.resourceCode,"&returnUrl=").concat(n)}}},{key:"validateBytmpTicket",value:function(e){var t=this;return new Promise((function(r,n){j(t.option.SSOServer+"/verify-tmp-ticket?tmpTicket="+e,{},"post").then((function(e){if(0===e.code){var o=e.data,i=o.umsAdmin,s=o.tokenInfo,a=o.permissionList;t.user=i,t.tokenInfo=s,t.permissionList=a||[],t.setAllCookies(),t._emitter.emit(f,e.data),r(e.data),t.fixUrlQuery()}else t._emitter.emit(l,e),n(e)})).catch((function(e){t._emitter.emit(l,e),n(e)}))}))}},{key:"fixUrlQuery",value:function(){!function(e){var t=S.parse(location.search);delete t[e];var r=window.location,n=Object.keys(t).length>0?r.origin+r.pathname+S.stringify(t):r.origin+r.pathname;"pushState"in history?(console.log("进来了"),history.replaceState(null,null,n)):window.location.replace(n)}("tmpTicket")}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"destroy",value:function(){this._emitter.removeAllListeners(),this._emitter=null}}]),e}()}])}));
*/!function(i){if(void 0===(o="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=o),!0,e.exports=i(),!!0){var s=window.Cookies,a=window.Cookies=i();a.noConflict=function(){return window.Cookies=s,a}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function o(){}function i(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var s=JSON.stringify(r);/^[\{\[]/.test(s)&&(r=s)}catch(e){}r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=t+"="+r+a}}function s(e,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],s=0;s<i.length;s++){var a=i[s].split("="),c=a.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=t(a[0]);if(c=(n.read||n)(c,u)||t(c),r)try{c=JSON.parse(c)}catch(e){}if(o[u]=c,e===u)break}catch(e){}}return e?o[e]:o}}return o.set=i,o.get=function(e){return s(e,!1)},o.getJSON=function(e){return s(e,!0)},o.remove=function(t,r){i(t,"",e(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))}))},function(e,t,r){e.exports=r(9)},function(e,t,r){"use strict";const n=r(10),o=r(11),i=r(12),s=r(13),a=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function u(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function f(e,t){return t.decode?o(e):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function h(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function d(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const o="string"==typeof r&&r.includes(e.arrayFormatSeparator),i="string"==typeof r&&!o&&f(r,e).includes(e.arrayFormatSeparator);r=i?f(r,e):r;const s=o||i?r.split(e.arrayFormatSeparator).map(t=>f(t,e)):null===r?r:f(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(n[t]=r?f(r,e):r);const i=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>f(t,e));void 0!==n[t]?n[t]=[].concat(n[t],i):n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const o of e.split("&")){if(""===o)continue;let[e,s]=i(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:f(s,t),r(f(e,t),s,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=h(r[e],t);else n[e]=h(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=p,t.parse=d,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const o=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[u(t,e),"[",o,"]"].join("")]:[...r,[u(t,e),"[",u(o,e),"]=",u(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[u(t,e),"[]"].join("")]:[...r,[u(t,e),"[]=",u(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?n:(o=null===o?"":o,0===n.length?[[u(r,e),t,u(o,e)].join("")]:[[n,u(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,u(t,e)]:[...r,[u(t,e),"=",u(n,e)].join("")]}}(t),o={};for(const t of Object.keys(e))r(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map(r=>{const o=e[r];return void 0===o?"":null===o?u(r,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?u(r,t)+"[]":o.reduce(n(r),[]).join("&"):u(r,t)+"="+u(o,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=i(e,"#");return Object.assign({url:r.split("?")[0]||"",query:d(p(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:f(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[a]:!0},r);const n=l(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),s=Object.assign(i,e.query);let c=t.stringify(s,r);c&&(c="?"+c);let f=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(f="#"+(r[a]?u(e.fragmentIdentifier,r):e.fragmentIdentifier)),`${n}${c}${f}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);const{url:o,query:i,fragmentIdentifier:c}=t.parseUrl(e,n);return t.stringifyUrl({url:o,query:s(i,r),fragmentIdentifier:c},n)},t.exclude=(e,r,n)=>{const o=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,o,n)}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,r)}(e,o,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,s,a;if(u(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=f(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):v(o,o.length)}function y(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,f=v(c,u);for(r=0;r<u;++r)i(f[r],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return u(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,o,i,s;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},a.prototype.listenerCount=y,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,c,"next",e)}function c(e){r(s,o,i,a,c,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof l?t:l,i=Object.create(o.prototype),s=new k(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var s=r.delegate;if(s){var a=b(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,s),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&r.call(v,o)&&(d=v);var m=h.prototype=l.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(o,i){function s(){return new t((function(n,s){!function n(o,i,s,a){var c=u(e[o],e,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(l).then((function(e){f.value=e,s(f)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}(o,i,n,s)}))}return n=n?n.then(s,s):s()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=m.constructor=h,h.constructor=p,p.displayName=a(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,a(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(w.prototype),w.prototype[i]=function(){return this},e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var s=new w(c(t,r,n,o),i);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},g(m),a(m,s,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],i(r),i(n))}function s(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=i(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=s(r[0]);n!==r[0]&&(t[r[0]]=n)}r=o.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),a=0;a<i.length;a++){var c=i[a];e=e.replace(new RegExp(c,"g"),t[c])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),o=Array.isArray(t),i=0;i<n.length;i++){var s=n[i],a=e[s];(o?-1!==t.indexOf(s):t(s,a,e))&&(r[s]=a)}return r}},function(e,t,r){"use strict";r.r(t),r.d(t,"AuthClient",(function(){return T}));var n,o,i=r(4),s=r.n(i),a=r(5),c=r.n(a),u=r(0),f=r.n(u);!function(e){e.SSO="sso",e.DD="dingTalk",e.CUSTOM="custom"}(n||(n={})),function(e){e.HASH="hash",e.HISTORY="history"}(o||(o={}));var l="inited",p="error",h=r(6);function d(e){this.message=e}d.prototype=new Error,d.prototype.name="InvalidCharacterError";"undefined"!=typeof window&&window.atob&&window.atob.bind(window);function y(e){this.message=e}y.prototype=new Error,y.prototype.name="InvalidTokenError";var v=r(1),m=r.n(v),g=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m.a.set(e,t,r)},w=function(e){return m.a.get(e)},b=function(e){m.a.remove(e)},x=r(7),_=r.n(x),k=r(8),L=r.n(k),O=r(2),j=r.n(O),S=function(){var e=L()(j.a.mark((function e(){var t,r,n,o,i,s,a,c,u=arguments;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:"",r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:"GET",o=u.length>3&&void 0!==u[3]?u[3]:"fetch",n=n.toUpperCase(),t=t,"GET"==n&&(i="",Object.keys(r).forEach((function(e){i+=e+"="+r[e]+"&"})),""!==i&&(i=i.substr(0,i.lastIndexOf("&")),t=t+"?"+i)),!window.fetch||"fetch"!=o){e.next=25;break}return s={credentials:"include",method:n,headers:{Accept:"application/json","Content-Type":"application/json"},mode:"cors",cache:"force-cache"},"POST"==n&&Object.defineProperty(s,"body",{value:JSON.stringify(r)}),e.prev=10,e.next=13,fetch(t,s);case 13:return a=e.sent,e.next=16,a.json();case 16:return c=e.sent,e.abrupt("return",c);case 20:throw e.prev=20,e.t0=e.catch(10),new Error(e.t0);case 23:e.next=26;break;case 25:return e.abrupt("return",new Promise((function(e,o){var i;i=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject;var s="";"POST"==n&&(s=JSON.stringify(r)),i.open(n,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(s),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status){var t=i.response;"object"!==_()(t)&&(t=JSON.parse(t)),e(t)}else o(i)}})));case 26:case"end":return e.stop()}}),e,null,[[10,20]])})));return function(){return e.apply(this,arguments)}}(),E=r(3),C="JH_AUTH_CLIENT_BASE",I=function(e,t){var r,n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)");return t===o.HISTORY?null!=(r=window.location.hash.substr(1).match(n))?decodeURI(r[2]):null:null!=(r=window.location.search.substr(1).match(n))?decodeURI(r[2]):null},T=function(){function e(t){s()(this,e),this.option=t,f()(this,"_tokenInfo",void 0),f()(this,"_user",void 0),f()(this,"_emitter",new h),f()(this,"_href",void 0),f()(this,"_permissionList",void 0),this.option=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={SSOServer:"http://authorization.test.jxwrd.gov.cn",resourceCode:"93d95466c3354e01babded985924e2c7",jwtToken:!0,routerMode:o.HASH,method:n.SSO,cacheInCookie:!1};return Object.assign(t,e)}(t),this._href=window.location.href;var r,i=(r=C+"_isDirty",JSON.parse(sessionStorage.getItem(r)));this.init(i)}return c()(e,[{key:"token",get:function(){return this._tokenInfo.access_token}},{key:"tokenInfo",get:function(){return this._tokenInfo},set:function(e){this._tokenInfo=e}},{key:"user",get:function(){return this._user},set:function(e){this._user=e}},{key:"permissionList",get:function(){return this._permissionList},set:function(e){this._permissionList=e}},{key:"init",value:function(e){var t=this;if(e&&this.getCookieCache()){var r=this.user,o=this.tokenInfo,i=this.permissionList,s=I("tmpTicket",this.option.routerMode);s&&"null"!==s&&"undefined"!==s?this.validateBytmpTicket(s):setTimeout((function(){t._emitter.emit(l,{umsAdmin:r,tokenInfo:o,permissionList:i})}),26)}else switch(this.option.method){case n.CUSTOM:return;case n.SSO:return void this.initSSOMethod()}}},{key:"getCookieCache",value:function(){return this.user=w(C+"_user"),this.tokenInfo=w(C+"_tokenInfo"),this.permissionList=w(C+"_permissionList"),!(!this.user||!this.tokenInfo)||(this.removeAllCookie(),!1)}},{key:"removeAllCookie",value:function(){b(C+"_user"),b(C+"_tokenInfo"),b(C+"_permissionList")}},{key:"setAllCookies",value:function(){var e={expires:(this.tokenInfo&&this.tokenInfo.expires_in||3600)/3600/24};g(C+"_user",this.user,e),g(C+"_tokenInfo",this.tokenInfo,e),g(C+"_permissionList",this.permissionList,e)}},{key:"initSSOMethod",value:function(){var e,t,r=I("tmpTicket");if(e=C+"_isDirty",t=!0,sessionStorage.setItem(e,JSON.stringify(t)),r&&"null"!==r&&"undefined"!==r)this.validateBytmpTicket(r);else{var n=encodeURIComponent(this._href);window.location.href="".concat(this.option.SSOServer,"/login?code=").concat(this.option.resourceCode,"&returnUrl=").concat(n)}}},{key:"validateBytmpTicket",value:function(e){var t=this;return new Promise((function(r,n){S(t.option.SSOServer+"/verify-tmp-ticket?tmpTicket="+e,{},"post").then((function(e){if(0===e.code){var o=e.data,i=o.umsAdmin,s=o.tokenInfo,a=o.permissionList;t.user=i,t.tokenInfo=s,t.permissionList=a||[],t.setAllCookies(),t._emitter.emit(l,e.data),r(e.data),t.fixUrlQuery()}else t._emitter.emit(p,e),n(e)})).catch((function(e){t._emitter.emit(p,e),n(e)}))}))}},{key:"fixUrlQuery",value:function(){!function(e){var t=E.parse(location.search);delete t[e];var r=window.location,n=Object.keys(t).length>0?r.origin+r.pathname+E.stringify(t):r.origin+r.pathname;"pushState"in history?(console.log("进来了"),history.replaceState(null,null,n)):window.location.replace(n)}("tmpTicket")}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"destroy",value:function(){this._emitter.removeAllListeners(),this._emitter=null}}]),e}()}])}));

@@ -8,2 +8,2 @@ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(global,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=14)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n,o;

* Released under the MIT license
*/!function(i){if(void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o),!0,t.exports=i(),!!0){var a=window.Cookies,s=window.Cookies=i();s.noConflict=function(){return window.Cookies=a,s}}}((function(){function t(){for(var t=0,e={};t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function o(){}function i(e,r,i){if("undefined"!=typeof document){"number"==typeof(i=t({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var a=JSON.stringify(r);/^[\{\[]/.test(a)&&(r=a)}catch(t){}r=n.write?n.write(r,e):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in i)i[c]&&(s+="; "+c,!0!==i[c]&&(s+="="+i[c].split(";")[0]));return document.cookie=e+"="+r+s}}function a(t,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],a=0;a<i.length;a++){var s=i[a].split("="),c=s.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=e(s[0]);if(c=(n.read||n)(c,u)||e(c),r)try{c=JSON.parse(c)}catch(t){}if(o[u]=c,t===u)break}catch(t){}}return t?o[t]:o}}return o.set=i,o.get=function(t){return a(t,!1)},o.getJSON=function(t){return a(t,!0)},o.remove=function(e,r){i(e,"",t(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))}))},function(t,e,r){t.exports=r(9)},function(t,e,r){"use strict";const n=r(10),o=r(11),i=r(12),a=r(13),s=Symbol("encodeFragmentIdentifier");function c(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function u(t,e){return e.encode?e.strict?n(t):encodeURIComponent(t):t}function f(t,e){return e.decode?o(t):t}function l(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function p(t){const e=(t=l(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function d(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function h(t,e){c((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==n[t]?n[t]=[].concat(n[t],r):n[t]=[r]:n[t]=r};case"comma":case"separator":return(e,r,n)=>{const o="string"==typeof r&&r.includes(t.arrayFormatSeparator),i="string"==typeof r&&!o&&f(r,t).includes(t.arrayFormatSeparator);r=i?f(r,t):r;const a=o||i?r.split(t.arrayFormatSeparator).map(e=>f(e,t)):null===r?r:f(r,t);n[e]=a};case"bracket-separator":return(e,r,n)=>{const o=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!o)return void(n[e]=r?f(r,t):r);const i=null===r?[]:r.split(t.arrayFormatSeparator).map(e=>f(e,t));void 0!==n[e]?n[e]=[].concat(n[e],i):n[e]=i};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),n=Object.create(null);if("string"!=typeof t)return n;if(!(t=t.trim().replace(/^[?#&]/,"")))return n;for(const o of t.split("&")){if(""===o)continue;let[t,a]=i(e.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:f(a,e),r(f(t,e),a,n)}for(const t of Object.keys(n)){const r=n[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=d(r[t],e);else n[t]=d(r,e)}return!1===e.sort?n:(!0===e.sort?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((t,e)=>{const r=n[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(r):t[e]=r,t},Object.create(null))}e.extract=p,e.parse=h,e.stringify=(t,e)=>{if(!t)return"";c((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],n=function(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const o=r.length;return void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[u(e,t),"[",o,"]"].join("")]:[...r,[u(e,t),"[",u(o,t),"]=",u(n,t)].join("")]};case"bracket":return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[u(e,t),"[]"].join("")]:[...r,[u(e,t),"[]=",u(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return r=>(n,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?n:(o=null===o?"":o,0===n.length?[[u(r,t),e,u(o,t)].join("")]:[[n,u(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,u(e,t)]:[...r,[u(e,t),"=",u(n,t)].join("")]}}(e),o={};for(const e of Object.keys(t))r(e)||(o[e]=t[e]);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map(r=>{const o=t[r];return void 0===o?"":null===o?u(r,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?u(r,e)+"[]":o.reduce(n(r),[]).join("&"):u(r,e)+"="+u(o,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,n]=i(t,"#");return Object.assign({url:r.split("?")[0]||"",query:h(p(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:f(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[s]:!0},r);const n=l(t.url).split("?")[0]||"",o=e.extract(t.url),i=e.parse(o,{sort:!1}),a=Object.assign(i,t.query);let c=e.stringify(a,r);c&&(c="?"+c);let f=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(f="#"+(r[s]?u(t.fragmentIdentifier,r):t.fragmentIdentifier)),`${n}${c}${f}`},e.pick=(t,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[s]:!1},n);const{url:o,query:i,fragmentIdentifier:c}=e.parseUrl(t,n);return e.stringifyUrl({url:o,query:a(i,r),fragmentIdentifier:c},n)},e.exclude=(t,r,n)=>{const o=Array.isArray(r)?t=>!r.includes(t):(t,e)=>!r(t,e);return e.pick(t,o,n)}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=require("events")},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,c,"next",t)}function c(t){r(a,o,i,s,c,"throw",t)}s(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function d(){}var h={};h[o]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(_([])));m&&m!==e&&r.call(m,o)&&(h=m);var v=d.prototype=l.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=v.constructor=d,d.constructor=p,p.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},g(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(v),s(v,a,"Generator"),v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],i(r),i(n))}function a(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(n),r=1;r<e.length;r++)e=(t=i(e,r).join("")).match(n);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=a(r[0]);n!==r[0]&&(e[r[0]]=n)}r=o.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),s=0;s<i.length;s++){var c=i[s];t=t.replace(new RegExp(c,"g"),e[c])}return t}(t)}}},function(t,e,r){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},function(t,e,r){"use strict";t.exports=function(t,e){for(var r={},n=Object.keys(t),o=Array.isArray(e),i=0;i<n.length;i++){var a=n[i],s=t[a];(o?-1!==e.indexOf(a):e(a,s,t))&&(r[a]=s)}return r}},function(t,e,r){"use strict";r.r(e),r.d(e,"AuthClient",(function(){return C}));var n,o=r(4),i=r.n(o),a=r(5),s=r.n(a),c=r(0),u=r.n(c);!function(t){t.SSO="sso",t.DD="dingTalk",t.CUSTOM="custom"}(n||(n={}));var f="inited",l="error",p=r(6);function d(t){this.message=t}d.prototype=new Error,d.prototype.name="InvalidCharacterError";"undefined"!=typeof window&&window.atob&&window.atob.bind(window);function h(t){this.message=t}h.prototype=new Error,h.prototype.name="InvalidTokenError";var y=r(1),m=r.n(y),v=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m.a.set(t,e,r)},g=function(t){return m.a.get(t)},w=function(t){m.a.remove(t)},b=r(7),x=r.n(b),k=r(8),S=r.n(k),_=r(2),O=r.n(_),j=function(){var t=S()(O.a.mark((function t(){var e,r,n,o,i,a,s,c,u=arguments;return O.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:"",r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:"GET",o=u.length>3&&void 0!==u[3]?u[3]:"fetch",n=n.toUpperCase(),e=e,"GET"==n&&(i="",Object.keys(r).forEach((function(t){i+=t+"="+r[t]+"&"})),""!==i&&(i=i.substr(0,i.lastIndexOf("&")),e=e+"?"+i)),!window.fetch||"fetch"!=o){t.next=25;break}return a={credentials:"include",method:n,headers:{Accept:"application/json","Content-Type":"application/json"},mode:"cors",cache:"force-cache"},"POST"==n&&Object.defineProperty(a,"body",{value:JSON.stringify(r)}),t.prev=10,t.next=13,fetch(e,a);case 13:return s=t.sent,t.next=16,s.json();case 16:return c=t.sent,t.abrupt("return",c);case 20:throw t.prev=20,t.t0=t.catch(10),new Error(t.t0);case 23:t.next=26;break;case 25:return t.abrupt("return",new Promise((function(t,o){var i;i=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject;var a="";"POST"==n&&(a=JSON.stringify(r)),i.open(n,e,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(a),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status){var e=i.response;"object"!==x()(e)&&(e=JSON.parse(e)),t(e)}else o(i)}})));case 26:case"end":return t.stop()}}),t,null,[[10,20]])})));return function(){return t.apply(this,arguments)}}(),E=r(3),I="JH_AUTH_CLIENT_BASE",L=function(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),r=window.location.search.substr(1).match(e);return null!=r?decodeURI(r[2]):null},C=function(){function t(e){i()(this,t),this.option=e,u()(this,"_tokenInfo",void 0),u()(this,"_user",void 0),u()(this,"_emitter",new p),u()(this,"_href",void 0),u()(this,"_permissionList",void 0),this.option=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={SSOServer:"http://authorization.test.jxwrd.gov.cn",resourceCode:"93d95466c3354e01babded985924e2c7",jwtToken:!0,method:n.SSO,cacheInCookie:!1};return Object.assign(e,t)}(e),this._href=window.location.href;var r,o=(r=I+"_isDirty",JSON.parse(sessionStorage.getItem(r)));this.init(o)}return s()(t,[{key:"token",get:function(){return this._tokenInfo.access_token}},{key:"tokenInfo",get:function(){return this._tokenInfo},set:function(t){this._tokenInfo=t}},{key:"user",get:function(){return this._user},set:function(t){this._user=t}},{key:"permissionList",get:function(){return this._permissionList},set:function(t){this._permissionList=t}},{key:"init",value:function(t){var e=this;if(t&&this.getCookieCache()){var r=this.user,o=this.tokenInfo,i=this.permissionList,a=L("tmpTicket");a&&"null"!==a&&"undefined"!==a?this.validateBytmpTicket(a):setTimeout((function(){e._emitter.emit(f,{umsAdmin:r,tokenInfo:o,permissionList:i})}),26)}else switch(this.option.method){case n.CUSTOM:return;case n.SSO:return void this.initSSOMethod()}}},{key:"getCookieCache",value:function(){return this.user=g(I+"_user"),this.tokenInfo=g(I+"_tokenInfo"),this.permissionList=g(I+"_permissionList"),!(!this.user||!this.tokenInfo)||(this.removeAllCookie(),!1)}},{key:"removeAllCookie",value:function(){w(I+"_user"),w(I+"_tokenInfo"),w(I+"_permissionList")}},{key:"setAllCookies",value:function(){var t={expires:(this.tokenInfo&&this.tokenInfo.expires_in||3600)/3600/24};v(I+"_user",this.user,t),v(I+"_tokenInfo",this.tokenInfo,t),v(I+"_permissionList",this.permissionList,t)}},{key:"initSSOMethod",value:function(){var t,e,r=L("tmpTicket");if(t=I+"_isDirty",e=!0,sessionStorage.setItem(t,JSON.stringify(e)),r&&"null"!==r&&"undefined"!==r)this.validateBytmpTicket(r);else{var n=encodeURIComponent(this._href);window.location.href="".concat(this.option.SSOServer,"/login?code=").concat(this.option.resourceCode,"&returnUrl=").concat(n)}}},{key:"validateBytmpTicket",value:function(t){var e=this;return new Promise((function(r,n){j(e.option.SSOServer+"/verify-tmp-ticket?tmpTicket="+t,{},"post").then((function(t){if(0===t.code){var o=t.data,i=o.umsAdmin,a=o.tokenInfo,s=o.permissionList;e.user=i,e.tokenInfo=a,e.permissionList=s||[],e.setAllCookies(),e._emitter.emit(f,t.data),r(t.data),e.fixUrlQuery()}else e._emitter.emit(l,t),n(t)})).catch((function(t){e._emitter.emit(l,t),n(t)}))}))}},{key:"fixUrlQuery",value:function(){!function(t){var e=E.parse(location.search);delete e[t];var r=window.location,n=Object.keys(e).length>0?r.origin+r.pathname+E.stringify(e):r.origin+r.pathname;"pushState"in history?(console.log("进来了"),history.replaceState(null,null,n)):window.location.replace(n)}("tmpTicket")}},{key:"on",value:function(t,e){this._emitter.addListener(t,e)}},{key:"off",value:function(t,e){this._emitter.removeListener(t,e)}},{key:"destroy",value:function(){this._emitter.removeAllListeners(),this._emitter=null}}]),t}()}])}));
*/!function(i){if(void 0===(o="function"==typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o),!0,t.exports=i(),!!0){var a=window.Cookies,s=window.Cookies=i();s.noConflict=function(){return window.Cookies=a,s}}}((function(){function t(){for(var t=0,e={};t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function o(){}function i(e,r,i){if("undefined"!=typeof document){"number"==typeof(i=t({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var a=JSON.stringify(r);/^[\{\[]/.test(a)&&(r=a)}catch(t){}r=n.write?n.write(r,e):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in i)i[c]&&(s+="; "+c,!0!==i[c]&&(s+="="+i[c].split(";")[0]));return document.cookie=e+"="+r+s}}function a(t,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],a=0;a<i.length;a++){var s=i[a].split("="),c=s.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=e(s[0]);if(c=(n.read||n)(c,u)||e(c),r)try{c=JSON.parse(c)}catch(t){}if(o[u]=c,t===u)break}catch(t){}}return t?o[t]:o}}return o.set=i,o.get=function(t){return a(t,!1)},o.getJSON=function(t){return a(t,!0)},o.remove=function(e,r){i(e,"",t(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))}))},function(t,e,r){t.exports=r(9)},function(t,e,r){"use strict";const n=r(10),o=r(11),i=r(12),a=r(13),s=Symbol("encodeFragmentIdentifier");function c(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function u(t,e){return e.encode?e.strict?n(t):encodeURIComponent(t):t}function f(t,e){return e.decode?o(t):t}function l(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function p(t){const e=(t=l(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function d(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function h(t,e){c((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==n[t]?n[t]=[].concat(n[t],r):n[t]=[r]:n[t]=r};case"comma":case"separator":return(e,r,n)=>{const o="string"==typeof r&&r.includes(t.arrayFormatSeparator),i="string"==typeof r&&!o&&f(r,t).includes(t.arrayFormatSeparator);r=i?f(r,t):r;const a=o||i?r.split(t.arrayFormatSeparator).map(e=>f(e,t)):null===r?r:f(r,t);n[e]=a};case"bracket-separator":return(e,r,n)=>{const o=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!o)return void(n[e]=r?f(r,t):r);const i=null===r?[]:r.split(t.arrayFormatSeparator).map(e=>f(e,t));void 0!==n[e]?n[e]=[].concat(n[e],i):n[e]=i};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),n=Object.create(null);if("string"!=typeof t)return n;if(!(t=t.trim().replace(/^[?#&]/,"")))return n;for(const o of t.split("&")){if(""===o)continue;let[t,a]=i(e.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:f(a,e),r(f(t,e),a,n)}for(const t of Object.keys(n)){const r=n[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=d(r[t],e);else n[t]=d(r,e)}return!1===e.sort?n:(!0===e.sort?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((t,e)=>{const r=n[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(r):t[e]=r,t},Object.create(null))}e.extract=p,e.parse=h,e.stringify=(t,e)=>{if(!t)return"";c((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],n=function(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const o=r.length;return void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[u(e,t),"[",o,"]"].join("")]:[...r,[u(e,t),"[",u(o,t),"]=",u(n,t)].join("")]};case"bracket":return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[u(e,t),"[]"].join("")]:[...r,[u(e,t),"[]=",u(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return r=>(n,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?n:(o=null===o?"":o,0===n.length?[[u(r,t),e,u(o,t)].join("")]:[[n,u(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,u(e,t)]:[...r,[u(e,t),"=",u(n,t)].join("")]}}(e),o={};for(const e of Object.keys(t))r(e)||(o[e]=t[e]);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map(r=>{const o=t[r];return void 0===o?"":null===o?u(r,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?u(r,e)+"[]":o.reduce(n(r),[]).join("&"):u(r,e)+"="+u(o,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,n]=i(t,"#");return Object.assign({url:r.split("?")[0]||"",query:h(p(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:f(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[s]:!0},r);const n=l(t.url).split("?")[0]||"",o=e.extract(t.url),i=e.parse(o,{sort:!1}),a=Object.assign(i,t.query);let c=e.stringify(a,r);c&&(c="?"+c);let f=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(f="#"+(r[s]?u(t.fragmentIdentifier,r):t.fragmentIdentifier)),`${n}${c}${f}`},e.pick=(t,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[s]:!1},n);const{url:o,query:i,fragmentIdentifier:c}=e.parseUrl(t,n);return e.stringifyUrl({url:o,query:a(i,r),fragmentIdentifier:c},n)},e.exclude=(t,r,n)=>{const o=Array.isArray(r)?t=>!r.includes(t):(t,e)=>!r(t,e);return e.pick(t,o,n)}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=require("events")},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,c,"next",t)}function c(t){r(a,o,i,s,c,"throw",t)}s(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function d(){}var h={};h[o]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(_([])));m&&m!==e&&r.call(m,o)&&(h=m);var v=d.prototype=l.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=v.constructor=d,d.constructor=p,p.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},g(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(v),s(v,a,"Generator"),v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())},function(t,e,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function i(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],i(r),i(n))}function a(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(n),r=1;r<e.length;r++)e=(t=i(e,r).join("")).match(n);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=a(r[0]);n!==r[0]&&(e[r[0]]=n)}r=o.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),s=0;s<i.length;s++){var c=i[s];t=t.replace(new RegExp(c,"g"),e[c])}return t}(t)}}},function(t,e,r){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},function(t,e,r){"use strict";t.exports=function(t,e){for(var r={},n=Object.keys(t),o=Array.isArray(e),i=0;i<n.length;i++){var a=n[i],s=t[a];(o?-1!==e.indexOf(a):e(a,s,t))&&(r[a]=s)}return r}},function(t,e,r){"use strict";r.r(e),r.d(e,"AuthClient",(function(){return F}));var n,o,i=r(4),a=r.n(i),s=r(5),c=r.n(s),u=r(0),f=r.n(u);!function(t){t.SSO="sso",t.DD="dingTalk",t.CUSTOM="custom"}(n||(n={})),function(t){t.HASH="hash",t.HISTORY="history"}(o||(o={}));var l="inited",p="error",d=r(6);function h(t){this.message=t}h.prototype=new Error,h.prototype.name="InvalidCharacterError";"undefined"!=typeof window&&window.atob&&window.atob.bind(window);function y(t){this.message=t}y.prototype=new Error,y.prototype.name="InvalidTokenError";var m=r(1),v=r.n(m),g=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};v.a.set(t,e,r)},w=function(t){return v.a.get(t)},b=function(t){v.a.remove(t)},x=r(7),k=r.n(x),S=r(8),_=r.n(S),O=r(2),j=r.n(O),I=function(){var t=_()(j.a.mark((function t(){var e,r,n,o,i,a,s,c,u=arguments;return j.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.length>0&&void 0!==u[0]?u[0]:"",r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]?u[2]:"GET",o=u.length>3&&void 0!==u[3]?u[3]:"fetch",n=n.toUpperCase(),e=e,"GET"==n&&(i="",Object.keys(r).forEach((function(t){i+=t+"="+r[t]+"&"})),""!==i&&(i=i.substr(0,i.lastIndexOf("&")),e=e+"?"+i)),!window.fetch||"fetch"!=o){t.next=25;break}return a={credentials:"include",method:n,headers:{Accept:"application/json","Content-Type":"application/json"},mode:"cors",cache:"force-cache"},"POST"==n&&Object.defineProperty(a,"body",{value:JSON.stringify(r)}),t.prev=10,t.next=13,fetch(e,a);case 13:return s=t.sent,t.next=16,s.json();case 16:return c=t.sent,t.abrupt("return",c);case 20:throw t.prev=20,t.t0=t.catch(10),new Error(t.t0);case 23:t.next=26;break;case 25:return t.abrupt("return",new Promise((function(t,o){var i;i=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject;var a="";"POST"==n&&(a=JSON.stringify(r)),i.open(n,e,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(a),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status){var e=i.response;"object"!==k()(e)&&(e=JSON.parse(e)),t(e)}else o(i)}})));case 26:case"end":return t.stop()}}),t,null,[[10,20]])})));return function(){return t.apply(this,arguments)}}(),E=r(3),L="JH_AUTH_CLIENT_BASE",C=function(t,e){var r,n=new RegExp("(^|&)"+t+"=([^&]*)(&|$)");return e===o.HISTORY?null!=(r=window.location.hash.substr(1).match(n))?decodeURI(r[2]):null:null!=(r=window.location.search.substr(1).match(n))?decodeURI(r[2]):null},F=function(){function t(e){a()(this,t),this.option=e,f()(this,"_tokenInfo",void 0),f()(this,"_user",void 0),f()(this,"_emitter",new d),f()(this,"_href",void 0),f()(this,"_permissionList",void 0),this.option=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={SSOServer:"http://authorization.test.jxwrd.gov.cn",resourceCode:"93d95466c3354e01babded985924e2c7",jwtToken:!0,routerMode:o.HASH,method:n.SSO,cacheInCookie:!1};return Object.assign(e,t)}(e),this._href=window.location.href;var r,i=(r=L+"_isDirty",JSON.parse(sessionStorage.getItem(r)));this.init(i)}return c()(t,[{key:"token",get:function(){return this._tokenInfo.access_token}},{key:"tokenInfo",get:function(){return this._tokenInfo},set:function(t){this._tokenInfo=t}},{key:"user",get:function(){return this._user},set:function(t){this._user=t}},{key:"permissionList",get:function(){return this._permissionList},set:function(t){this._permissionList=t}},{key:"init",value:function(t){var e=this;if(t&&this.getCookieCache()){var r=this.user,o=this.tokenInfo,i=this.permissionList,a=C("tmpTicket",this.option.routerMode);a&&"null"!==a&&"undefined"!==a?this.validateBytmpTicket(a):setTimeout((function(){e._emitter.emit(l,{umsAdmin:r,tokenInfo:o,permissionList:i})}),26)}else switch(this.option.method){case n.CUSTOM:return;case n.SSO:return void this.initSSOMethod()}}},{key:"getCookieCache",value:function(){return this.user=w(L+"_user"),this.tokenInfo=w(L+"_tokenInfo"),this.permissionList=w(L+"_permissionList"),!(!this.user||!this.tokenInfo)||(this.removeAllCookie(),!1)}},{key:"removeAllCookie",value:function(){b(L+"_user"),b(L+"_tokenInfo"),b(L+"_permissionList")}},{key:"setAllCookies",value:function(){var t={expires:(this.tokenInfo&&this.tokenInfo.expires_in||3600)/3600/24};g(L+"_user",this.user,t),g(L+"_tokenInfo",this.tokenInfo,t),g(L+"_permissionList",this.permissionList,t)}},{key:"initSSOMethod",value:function(){var t,e,r=C("tmpTicket");if(t=L+"_isDirty",e=!0,sessionStorage.setItem(t,JSON.stringify(e)),r&&"null"!==r&&"undefined"!==r)this.validateBytmpTicket(r);else{var n=encodeURIComponent(this._href);window.location.href="".concat(this.option.SSOServer,"/login?code=").concat(this.option.resourceCode,"&returnUrl=").concat(n)}}},{key:"validateBytmpTicket",value:function(t){var e=this;return new Promise((function(r,n){I(e.option.SSOServer+"/verify-tmp-ticket?tmpTicket="+t,{},"post").then((function(t){if(0===t.code){var o=t.data,i=o.umsAdmin,a=o.tokenInfo,s=o.permissionList;e.user=i,e.tokenInfo=a,e.permissionList=s||[],e.setAllCookies(),e._emitter.emit(l,t.data),r(t.data),e.fixUrlQuery()}else e._emitter.emit(p,t),n(t)})).catch((function(t){e._emitter.emit(p,t),n(t)}))}))}},{key:"fixUrlQuery",value:function(){!function(t){var e=E.parse(location.search);delete e[t];var r=window.location,n=Object.keys(e).length>0?r.origin+r.pathname+E.stringify(e):r.origin+r.pathname;"pushState"in history?(console.log("进来了"),history.replaceState(null,null,n)):window.location.replace(n)}("tmpTicket")}},{key:"on",value:function(t,e){this._emitter.addListener(t,e)}},{key:"off",value:function(t,e){this._emitter.removeListener(t,e)}},{key:"destroy",value:function(){this._emitter.removeAllListeners(),this._emitter=null}}]),t}()}])}));
{
"name": "@jxstjh/auth-client",
"version": "0.0.1",
"version": "0.0.2",
"description": "匹配4a认证的客户端工具包 🌼",

@@ -21,3 +21,3 @@ "main": "lib/index.js",

"build:all": "yarn clear && yarn build:transpile && yarn build:types",
"build:transpile": "babel src/* --out-dir lib --extensions .ts",
"build:transpile": "babel src/index.ts --out-dir lib --extensions .ts",
"build:webpack": "webpack --config webpack.config.ts",

@@ -24,0 +24,0 @@ "build:types": "tsc"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc