jinbi-utils 1.0.26 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import t from"axios";import{spawn as e}from"child_process";import{defineStore as r}from"pinia";var n={isWxWork:"wecom",isWeixin:"wechat",isMobile:"mobile",isMobileAny:"mobile"};function o(t){return new Promise((function(e){return setTimeout(e,t)}))}function i(){if("undefined"==typeof window)return!1;var t=navigator.userAgent.toLowerCase(),e=/midp/i.test(t),r=/ucweb/i.test(t),n=/android/i.test(t),o=/iphone os/i.test(t),i=/windows ce/i.test(t),s=/windows mobile/i.test(t),a=/rv:1.2.3.4/i.test(t);return e||r||n||o||i||s||a}function s(t){return null===t||""===t||void 0===t}var a=function(){localStorage.removeItem("wecom_userinfo"),localStorage.removeItem("wecom_token"),localStorage.removeItem("projectActive"),localStorage.removeItem("loginTime"),localStorage.removeItem("projectInfo")},u=function(t,e){var r=new RegExp("&{1}"+e+"\\=[a-zA-Z0-9_-]+","g"),n=t.replace(/\?/g,"&").match(r)[0];return n.substr(n.indexOf("=")+1)},c=function(t){for(var e=window.location.search.substring(1).split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===t)return n[1]}return!1},f=function(){return localStorage.getItem("wecom_token")},l=function(){var t=navigator.userAgent.toLowerCase(),e=/wxwork/.test(t),r=/micromessenger/.test(t)&&!e,n=window.innerWidth<=768;return{isWxWork:e,isWeixin:r,isMobileScreen:n,isMobileAny:e||r||n}},d=function(t){var e="wecom";for(var r in t){if(t[r]){e=n[r];break}}return e};function p(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*r));return n}var h=function(t){for(var e="",r=document.cookie.split("; "),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===t){e=o[1];break}}return e},v=function(){for(var t=[],e=0;e<=15;e++)t[e]=e.toString(16);var r="";for(e=1;e<=36;e++)r+=9===e||14===e||19===e||24===e?"-":15===e?4:20===e?t[4*Math.random()|8]:t[16*Math.random()|0];return r.replace(/-/g,"")},g=function(){return localStorage.getItem("jsapiTicket")},m=function(t){return localStorage.setItem("jsapiTicket",t)},y=function(){return localStorage.removeItem("jsapiTicket")},w=function(t,e){if(void 0===e&&(e="YYYY年MM月DD日 hh:mm:ss"),!t)return"-";var r=new Date(t),n=r.getFullYear()+"",o=r.getMonth()+1,i=r.getDate(),s=r.getHours()>9?r.getHours():"0"+r.getHours(),a=r.getMinutes()>9?r.getMinutes():"0"+r.getMinutes(),u=r.getSeconds()>9?r.getSeconds():"0"+r.getSeconds();return e.replace("YYYY",n+"").replace("MM",o+"").replace("DD",i+"").replace("hh",s+"").replace("mm",a+"").replace("ss",u+"")},b=function(t){for(var e=window.atob(t.split(",")[1]),r=new ArrayBuffer(e.length),n=new Uint8Array(r),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return new Blob([r],{type:"image/png"})},S=function(){var t=window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),e=/micromessenger/i.test(navigator.userAgent),r=/wxwork/i.test(navigator.userAgent);return r&&t?"com-wx-mobile":r&&!t?"com-wx-pc":e&&t?"wx-mobile":e&&!t?"wx-pc":"other"},M=function(){return/wxwork/i.test(navigator.userAgent)},A=function(){var t=!1;return"uat2-h5-wecom.hengdayun.com"!==location.origin&&"127.0.0.1:8081"!==location.origin&&"localhost:8081"!==location.origin||(t=!0),t},C=function(t,e){var r=new Set;return t.filter((function(t){var n=t[e];return!r.has(n)&&(r.add(n),!0)}))},x=function(t){for(var e=t.split(","),r=e[0].match(/:(.\*?);/)[1],n=atob(e[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:r})},E=function(t,e){for(var r=t.split(","),n=r[0].match(/:(.*);/)[1],o=atob(r[1]),i=o.length,s=new Uint8Array(i);i--;)s[i]=o.charCodeAt(i);return new File([s],e,{type:n})},k=function(t){return/^image\//i.test(t)},O=function(t){var e=t.split(","),r=e[0],n=void 0===r?"":r,o=e[1],i=void 0===o?"":o;return{name:decodeURIComponent(n),url:decodeURIComponent(i)}},I=function(t){return!t||""===t||/^(\d+)(\.\d{1,2})?$/.test(t.toString())},N=function(t,e){var r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(e=e||n.length,t)for(r=0;r<t;r++)o[r]=n[0|Math.random()*e];else{var i=void 0;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(i=0|16*Math.random(),o[r]=n[19==r?3&i|8:i])}return o.join("")},j=function(t,e){var r=t.toLowerCase();return"localstorage"===r?localStorage.getItem("token")||"":"sessionstorage"===r?sessionStorage.getItem("token")||"":localStorage.getItem("token")||sessionStorage.getItem("token")||""},R=function(t,e){var r=t.toLowerCase();"localstorage"===r?localStorage.removeItem("token"):"sessionstorage"===r?sessionStorage.removeItem("token"):(localStorage.removeItem("token"),sessionStorage.getItem("token"))};function q(t){return"string"==typeof t?t.replace(/-/g,"/"):t}function T(t){return t?new Date(q(t)):new Date}function B(t,e){void 0===t&&(t=Date.now()),void 0===e&&(e="yyyy-MM-dd HH:mm:ss"),t=q(t);var r={"M+":(t=new Date(t)).getMonth()+1,"d+":t.getDate(),"h+":t.getHours()%12==0?12:t.getHours()%12,"H+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};return/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(""+t.getFullYear()).substr(4-RegExp.$1.length))),Object.keys(r).forEach((function(t){new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?r[t]:("00"+r[t]).substr((""+r[t]).length)))})),e}function U(t,e,r){if(void 0===e&&(e="yyyy年MM月dd日 HH时mm分ss秒"),void 0===r&&(r="-"),s(t))return r;t=q(t);var n=new Date(t),o=(Date.now()-n.getTime())/1e3;return o<0?t:o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.floor(o/3600)+"小时前":o<172800?"1天前":B(t,e)}function D(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r="yyyy-MM-dd"),s(t))return"-";t=q(t);var n=new Date(t);return n.setDate(n.getDate()+Number(e)),B(n,r)}
1
+ import t from"axios";import{defineStore as e}from"pinia";import r from"decimal.js";export{default as Decimal}from"decimal.js";import n from"china-area-data";import{cloneDeep as o}from"lodash-es";import i from"mitt";import{sm3 as a}from"sm-crypto";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var P=function(t,e){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function F(t,e){function r(){this.constructor=t}P(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var H=function(){return(H=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function z(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function L(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function _(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function W(t,e){if(void 0===e&&(e=2),0===t)return"0 Bytes";var r=e<0?0:e,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]}var $={operation:"divide",factor:100,precision:2,formatAsCurrency:!1,currencySymbol:"¥"};function G(t,e){if(void 0===e&&(e="-"),s(t))return e;var r=t.toString();return r.includes(".")||(r+="."),r.replace(/\d(?=(\d{3})+\.)/g,(function(t){return t+","})).replace(/\.$/,"")}function J(t){void 0===t&&(t="");if(s(t))return"";if(Number(t)>=1e15)return t;var e,r,n,o=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],i=["","拾","佰","仟"],a=["","万","亿","兆"],u=["角","分","毫","厘"],c="";if("0"===(t=parseFloat(t).toString()))return c=o[0]+"元整";if(-1===(t=t.toString()).indexOf(".")?(e=t,r=""):(e=(n=t.split("."))[0],r=n[1].substr(0,4)),parseInt(e,10)>0){for(var f=0,l=e.length,d=0;d<l;d+=1){var p=e.substr(d,1),h=l-d-1,v=h/4,g=h%4;"0"===p?f+=1:(f>0&&(c+=o[0]),f=0,c+=o[parseInt(p,10)]+i[g]),0===g&&f<4&&(c+=a[v])}c+="元"}if(""!==r){var m=r.length;for(d=0;d<m;d+=1){var y=r.substr(d,1);"0"!==y&&(c+=o[Number(y)]+u[d])}}return""===c?c+=o[0]+"元整":""===r&&(c+="整"),c}function Y(t,e){void 0===e&&(e=2);var r=parseFloat(String(t));if(Number.isNaN(r))return"";var n=(r=Math.round(Number(t)*Math.pow(10,e))/Math.pow(10,e)).toString(),o=n.indexOf(".");for(o<0&&(o=n.length,n+=".");n.length<=o+e;)n+="0";return n}function Z(t,e){if(void 0===e&&(e=0),s(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.ceil(n)/r}function K(t,e){if(void 0===e&&(e=0),s(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.floor(n)/r}function V(t,e){var r=Q(t,e),n=H(H({},$),e);if(n.formatter)return n.formatter(r);if(n.formatAsCurrency){var o=r.toFixed(n.precision),i=r>=1e3?G(o):o;return""+n.currencySymbol+i}return r.toFixed(n.precision)}function Q(t,e){var r,n,o=H(H({},$),e);if(null==t||""===t)return 0;if("string"==typeof t){var i=t.replace(/[^\d.-]/g,"");r=i?parseFloat(i):0}else r=t;if(isNaN(r))return 0;if(n="multiply"===o.operation?r*o.factor:0!==o.factor?r/o.factor:0,void 0!==o.precision){var s=Math.pow(10,o.precision);n=Math.round(n*s)/s}return n}function X(t,e){return V(t,H({operation:"divide",factor:100,formatAsCurrency:!0},e))}function tt(t,e){void 0===e&&(e="B");var r=["B","KB","MB","GB","TB"],n=r.indexOf(e.toUpperCase());for(n=-1===n?0:n;t>=1024&&n<r.length;)t/=1024,n+=1;return{size:t,unit:r[n]}}function et(t,e,r){if(void 0===e&&(e="B"),void 0===r&&(r="-"),s(t))return r;var n=tt(parseFloat(t.toString()),e);return""+Z(n.size,2)+n.unit}function rt(t){for(var e=t.match(/:(.*?);/)[1],r=window.atob(t.split(",")[1]),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function nt(t){return new Promise((function(e,r){var n=new FileReader;n.onload=function(t){t&&t.target?e(t.target.result):r(t)},n.onerror=function(t){r(t)},n.readAsDataURL(t)}))}function ot(t,e,r){return new Promise((function(n,o){var i=parseFloat((t.size/1024/1024).toString()),s=new FileReader;s.onload=function(s){var a=new Image;a.onload=function(){var o=a.width,s=a.height,u=document.createElement("canvas"),c=u.getContext("2d"),f=e?e(o,s):1;(Number.isNaN(f)||"number"!=typeof f)&&(f=1);var l=r?r(i,f,o,s):1;if((Number.isNaN(l)||"number"!=typeof l)&&(l=1),c){var d=parseInt((o*f).toString(),10),p=parseInt((s*f).toString(),10);u.setAttribute("width",d.toString()),u.setAttribute("height",p.toString()),c.drawImage(a,0,0,d,p)}var h=u.toDataURL(t.type,l);n(rt(h))},a.onerror=function(t){o(t)},s.target&&(a.src=s.target.result)},s.onerror=function(t){o(t)},s.readAsDataURL(t)}))}function it(t){var e=t.axiosRequest,r=t.notWithCredentials,n=void 0===r?[]:r;return function(t){var r=this,o=t.filename,i=t.url,s=t.data,a=void 0===s?{}:s,u=t.params,c=void 0===u?{}:u,f=t.method,l=void 0===f?"post":f;return new Promise((function(t,s){e({method:l,url:i,data:a,params:c,responseType:"blob",config:{withCredentials:n.some((function(t){return!i.includes(t)}))}}).then((function(e){return z(r,void 0,void 0,(function(){var r,n,i,a,u,c,f,l,d,p;return L(this,(function(h){switch(h.label){case 0:return"application/json"!==(r=null==e?void 0:e.data).type?[3,1]:((n=new FileReader).readAsText(r,"utf-8"),n.onload=function(){var t={};try{t=JSON.parse(n.result)}catch(e){t=r}s(t)},[3,3]);case 1:try{i=e.headers,a=i["content-disposition"],u=decodeURIComponent(a.split(";")[1].split("filename=")[1]),o&&!o.includes(".")?(c=u.split("."),f=c[c.length-1],o+="."+f):o||(o=u)}catch(t){o||(o="download.xlsx")}return l=new Blob([e.data]),d=document.createElement("a"),[4,nt(l)];case 2:p=h.sent(),d.href=p,d.download=o,document.body.appendChild(d),d.click(),document.body.removeChild(d),t(e),h.label=3;case 3:return[2]}}))}))})).catch((function(t){s(t)}))}))}}function st(t,e){var r=Object.keys,n=typeof t;return t&&e&&"object"===n&&n===typeof e?r(t).length===r(e).length&&r(t).every((function(r){return st(t[r],e[r])})):t===e}function at(t,e,r,n,o){if(void 0===o&&(o=[]),o.push(t),t[r]===e)throw"GOT IT!";if(t[n]&&t[n].length>0)for(var i=0;i<t[n].length;i++)at(t[n][i],e,r,n,o);o.pop()}function ut(t,e,r,n){var o=[];try{for(var i=0;i<r.length;i++)at(r[i],t,e,n,o)}catch(t){return o}}function ct(t){return/^(https?:|mailto:|tel:)/.test(t)}function ft(t){if(!t)return t;return t.replace(/^\s+|\s+$/g,"")}function lt(t){return/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/.test(t.toString())}function dt(t){return t=t.toString(),/^1/.test(t)&&11===t.length}function pt(t){return/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/.test(String(t))}function ht(t){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t)}function vt(t){return/^[1-9][0-9]{4,9}$/gim.test(String(t))}function gt(t){return/^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/.test(t)}function mt(t){return new RegExp("^(?:(https?|ftp|rtsp|mms|ws|wss):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:localhost)|(?:[1-9]\\d{0,2}(?:\\.\\d{1,3}){3})|(?:$[0-9a-fA-F:]+$)|(?:(?:[a-zA-Z0-9-_]+\\.)+[a-zA-Z]{2,63}))(?::\\d{1,5})?(?:[/?#]\\S*)?$","i").test(t)}function yt(t,e){return void 0===e&&(e="-"),s(t)?e:t}function wt(t,e,r){if(void 0===e&&(e=" "),void 0===r&&(r="-"),s(t))return r;if(11!==t.toString().length)return t;var n=t.toString().replace(/[^\d]/g,"").split(""),o="";return n.forEach((function(t,r){3!==r&&7!==r||(o+=e),o+=t})),o}function bt(t,e){if(void 0===e&&(e=""),s(t))return e;if(11!==t.toString().length)return t;var r=t.toString();return r.substr(0,3)+"****"+r.substr(7,11)}function St(t,e){return void 0===e&&(e=""),s(t)?e:t.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")}function Mt(){for(var t=[],e=65;e<91;e+=1)t.push(String.fromCharCode(e));return t}function At(t){void 0===t&&(t="");return t.replace(/\B([A-Z])/g,"-$1").toLowerCase()}function Ct(t,e){return t&&"string"==typeof e?t.substring(0,t.indexOf(e)):""}function xt(t){if(!/^(?:(https?|ftp|rtsp|mms|ws|wss):\/\/)?/i.test(t))return console.error(t+"不符合超链接规范"),{};var e=t.indexOf("?");if(-1===e)return{};for(var r={},n=0,o=t.slice(e+1).split("&");n<o.length;n++){var i=o[n].split("="),s=i[0],a=i[1];s&&(r[s]=a||"")}return r}function Et(t,e,r){void 0===r&&(r="*"),"number"==typeof t&&(t=t.toString()),Array.isArray(e)||(e=[e]);for(var n=t.split(""),o=0,i=e;o<i.length;o++){var s=i[o];if("object"!=typeof s||Array.isArray(s))"number"==typeof s&&Number.isInteger(s)&&s>=0&&s<n.length&&(n[s]=r);else{var a=s.start,u=s.end;a>=0&&a<u&&u<n.length&&n.fill(r,a,u+1)}}return n.join("")}var kt={HTTP_STATUS:{TEMP_RESPOND:{Continue:100,SwitchingProtocal:101},SUCCESS:{Ok:200,Created:201,Accepted:202,NoAuthoritativeInformation:203,NoContent:204,ResetContent:205,ParticalContent:206},REDIRECT:{MultipleChoice:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},REQUEST_ERROR:{BadRequest:400,UnAuthorized:401,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAccepted:406,ProxyAuthorizationRequired:407,RequestTimeout:408,UpgradeRequired:426,TokenUnAuthorized:499},SERVER_ERROR:{InternalServerError:500,BadGateway:502,ServiceUnavailable:503,GateTimeout:504,HttpVersionNotSupported:505}},CODES:{Success:"00000",UnAuthorized:"00099",UnAuthorizedPhone:"11001",UnAuthorizedWecom:"11000",UnAuthorizedHavePhone:"11002"},ERR_CODE_WHITE_LIST:[]},Ot=t.create({timeout:15e3,headers:{"Content-Type":"application/json"}}),It=function(t){var e=t.cacheType,r=t.currentMode,n=t.errorCb,o=t.getTokenCb;return t.tokenKey,Ot.interceptors.request.use((function(t){return z(void 0,void 0,void 0,(function(){var r,n;return L(this,(function(o){return r=j(e),n=l(),t.headers.Authorization=r,t.headers.token=r,t.headers.FrontType=d(n),[2,t]}))}))}),(function(t){return Promise.reject(t)})),Ot.interceptors.response.use((function(t){return z(void 0,void 0,void 0,(function(){var n,i,s;return L(this,(function(a){return n=t.data,i=n.code||t.status,n instanceof Blob||i===kt.CODES.Success?[2,n]:i===kt.CODES.UnAuthorized?("local"!==r&&"dev"!==r&&"development"!==r&&(R(e),o&&"function"==typeof o&&o()),[2,Promise.reject(new Error("token过期!"))]):(s=n.message||n.msg,[2,Promise.reject(new Error(s||"Error"))])}))}))}),(function(t){return z(void 0,void 0,void 0,(function(){return L(this,(function(e){return n&&"function"==typeof n&&n(t),[2,Promise.reject(t)]}))}))})),Ot},Nt=function(){function t(t){this.fieldCatalog=t,this.params=t?{field_catalog:t}:{}}return t.prototype.build=function(){return this.params},t}(),jt=function(){function t(t){this.fieldCatalog=t}return t.prototype.query=function(){return new qt(this.fieldCatalog)},t.prototype.insert=function(){return new Tt(this.fieldCatalog)},t.prototype.update=function(){return new Bt(this.fieldCatalog)},t.query=function(t){return new qt(t)},t.insert=function(t){return new Tt(t)},t.update=function(t){return new Bt(t)},t}(),Rt=function(){function t(t,e){this.parent=e,this.nestedFilters={logic:t,filters:[]}}return t.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=t[0],r=t[1];n.nestedFilters.filters.push({field:e,op:"=",value:r})})),this):void 0===r?(this.nestedFilters.filters.push({field:t,op:"=",value:e}),this):(this.nestedFilters.filters.push({field:t,op:e,value:r}),this)},t.prototype.group=function(e){return void 0===e&&(e="and"),new t(e,this)},t.prototype.endGroup=function(){return this.parent instanceof t?(this.parent.addNestedFilters(this.nestedFilters),this.parent):(this.parent.whereNested(this.nestedFilters),this.parent)},t.prototype.addNestedFilters=function(t){this.nestedFilters.filters.push(t)},t.prototype.build=function(){return this.nestedFilters},t}(),qt=function(t){function e(e){var r=t.call(this,e)||this;return r.params=H(H({},r.params),{filters:{logic:"and",filters:[]},order_by:[],limit:100,offset:0}),r}return F(e,t),e.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=t[0],r=t[1];n.params.filters.filters.push({field:e,op:"=",value:r})})),this):void 0===r?(this.params.filters.filters.push({field:t,op:"=",value:e}),this):(this.params.filters.filters.push({field:t,op:e,value:r}),this)},e.prototype.whereNested=function(t){return this.params.filters.filters.push(t),this},e.prototype.group=function(t){return void 0===t&&(t="and"),new Rt(t,this)},e.prototype.orWhere=function(t,e,r){var n,o={logic:"or",filters:[]};if("object"==typeof t?Object.entries(t).forEach((function(t){var e=t[0],r=t[1];o.filters.push({field:e,op:"=",value:r})})):void 0===r?o.filters.push({field:t,op:"=",value:e}):o.filters.push({field:t,op:e,value:r}),0===this.params.filters.filters.length||"or"===this.params.filters.logic)(n=this.params.filters.filters).push.apply(n,o.filters),this.params.filters.logic="or";else{var i={logic:"and",filters:_(this.params.filters.filters)};this.params.filters.filters=[i,o],this.params.filters.logic="and"}return this},e.prototype.whereIn=function(t,e){return this.params.filters.filters.push({field:t,op:"in",value:e}),this},e.prototype.whereNotIn=function(t,e){return this.params.filters.filters.push({field:t,op:"not in",value:e}),this},e.prototype.whereLike=function(t,e){return this.params.filters.filters.push({field:t,op:"like",value:e}),this},e.prototype.whereBetween=function(t,e,r){return this.params.filters.filters.push({field:t,op:"between",value:[e,r]}),this},e.prototype.whereNull=function(t){return this.params.filters.filters.push({field:t,op:"is null",value:null}),this},e.prototype.whereNotNull=function(t){return this.params.filters.filters.push({field:t,op:"is not null",value:null}),this},e.prototype.logic=function(t){return this.params.filters.logic=t,this},e.prototype.orderBy=function(t,e){return void 0===e&&(e="asc"),this.params.order_by.push({field:t,direction:e}),this},e.prototype.limit=function(t){return this.params.limit=t,this},e.prototype.offset=function(t){return this.params.offset=t,this},e.prototype.paginate=function(t,e){return void 0===e&&(e=0),this.params.limit=t,this.params.offset=e,this},e}(Nt),Tt=function(t){function e(e){var r=t.call(this,e)||this;return r.params=H(H({},r.params),{insert:[]}),r}return F(e,t),e.prototype.add=function(t){return this.params.insert.push(t),this},e.prototype.addBatch=function(t){var e;return(e=this.params.insert).push.apply(e,t),this},e}(Nt),Bt=function(t){function e(e){var r=t.call(this,e)||this;return r.currentUpdate=null,r.params=H(H({},r.params),{update:[]}),r}return F(e,t),e.prototype.set=function(t){return this.currentUpdate={set:t,where:{}},this},e.prototype.where=function(t,e){if(!this.currentUpdate)throw new Error("必须先调用 set() 方法");return"object"==typeof t?this.currentUpdate.where=H(H({},this.currentUpdate.where),t):this.currentUpdate.where[t]=e,this},e.prototype.and=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this},e.prototype.setBatch=function(t){var e;return(e=this.params.update).push.apply(e,t),this},e.prototype.build=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this.params},e}(Nt);var Ut=new(function(){function t(){}return t.prototype.request=function(t){return z(this,void 0,void 0,(function(){var r,n;return L(this,(function(o){switch(o.label){case 0:return r=function(t){var e=["-sS","-i"],r=(t.method||"GET").toUpperCase();"GET"!==r&&e.push("-X",r);var n=H({},t.headers||{}),o=Object.keys(n).some((function(t){return"content-type"===t.toLowerCase()})),i=void 0!==t.data&&null!==t.data;i&&!o&&(n["Content-Type"]="application/json");for(var s=0,a=Object.keys(n);s<a.length;s++){var u=a[s];e.push("-H",u+": "+n[u])}if(i){var c=void 0;c=Buffer.isBuffer(t.data)?t.data.toString():"string"==typeof t.data?t.data:JSON.stringify(t.data),e.push("--data",c)}!1!==t.followRedirects&&e.push("-L");var f="number"==typeof t.timeoutMs&&t.timeoutMs>0?t.timeoutMs:15e3;return e.push("--max-time",String(Math.ceil(f/1e3))),e.push(t.url),e}(t),n="win32"===process.platform?"curl.exe":"curl",[4,new Promise((function(t,o){var i=e(n,r,{stdio:["ignore","pipe","pipe"]}),s="",a="";i.stdout.on("data",(function(t){s+=t.toString()})),i.stderr.on("data",(function(t){a+=t.toString()})),i.on("error",(function(t){return o(t)})),i.on("close",(function(e){if(0!==e&&!s)return o(new Error(a||"curl exit "+e));try{t(function(t){var e,r=t.indexOf("\r\n\r\n")>=0?t.indexOf("\r\n\r\n"):t.indexOf("\n\n"),n=r>=0?t.substring(0,r):"",o=r>=0?t.substring(r+("\r\n\r\n"===t.substr(r,4)?4:2)):t,i=function(t){for(var e={},r=0,n=t.split(/\r?\n/);r<n.length;r++){var o=n[r],i=o.indexOf(":");if(i>0){var s=o.substring(0,i).trim(),a=o.substring(i+1).trim();s&&(e[s.toLowerCase()]=a)}}return e}(n),s=200,a=(n.split(/\r?\n/)[0]||"").match(/HTTP\/[0-9.]+\s+(\d{3})/);if(a&&(s=parseInt(a[1],10)),(i["content-type"]||"").includes("application/json"))try{e=JSON.parse(o)}catch(t){}return{status:s,headers:i,body:o,json:e}}(s))}catch(t){o(t)}}))}))];case 1:return[2,o.sent()]}}))}))},t.prototype.get=function(t,e){return z(this,void 0,void 0,(function(){return L(this,(function(r){return[2,this.request(H(H({},e||{}),{url:t,method:"GET"}))]}))}))},t.prototype.post=function(t,e,r){return z(this,void 0,void 0,(function(){return L(this,(function(n){return[2,this.request(H(H({},r||{}),{url:t,method:"POST",data:e}))]}))}))},t}());function Dt(){var t=new Date;return String(t.getFullYear())+"年"+String(t.getMonth()+1)+"月"+String(t.getDate())+"日"+String(t.getHours())+":"+String(t.getMinutes())}function Pt(t){return z(this,void 0,void 0,(function(){var e,r;return L(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),"https://fe-log-producer.jinbizhihui.com",[4,Ut.post("https://fe-log-producer.jinbizhihui.com/log/save",t)];case 1:return e=n.sent(),console.log("[RequestLogger] 远程日志发送成功, result",e),[3,3];case 2:return r=n.sent(),console.error("[RequestLogger] 远程日志发送失败:",(null==r?void 0:r.message)||r),[3,3];case 3:return[2]}}))}))}function Ft(t){return z(this,void 0,void 0,(function(){var e,r,n;return L(this,(function(o){switch(o.label){case 0:e=t.req.header("content-type")||"",o.label=1;case 1:return o.trys.push([1,4,,5]),(r=t.req.raw)&&"function"==typeof r.clone?[4,r.clone().text()]:[3,3];case 2:if(!(n=o.sent()))return[2,void 0];if(e.includes("application/json"))try{return[2,JSON.parse(n)]}catch(t){return[2,n]}return[2,n];case 3:return[3,5];case 4:return o.sent(),[3,5];case 5:return[2,void 0]}}))}))}function Ht(t){var e={};try{t.res.headers.forEach((function(t,r){e[r]=t}))}catch(t){}return e}function zt(t,e,r){return z(this,void 0,void 0,(function(){var n,o,i,s,a,u,c,f,l,d;return L(this,(function(p){switch(p.label){case 0:return n=t.req.header("x-forwarded-for")||t.req.header("x-real-ip")||"unknown",o=t.req.method,i=t.req.url,s=t.req.query(),a=function(t){var e={};try{var r=t.req.raw,n=null==r?void 0:r.headers;n&&n.forEach((function(t,r){e[r]=t}))}catch(t){}return e}(t),[4,Ft(t)];case 1:return u=p.sent(),c=Dt(),f=Date.now(),[4,e()];case 2:return p.sent(),l=Date.now()-f,d={status:t.res.status,headers:Ht(t),duration:l},[4,Pt({system:r,ip:n,path:i,method:o,time:c,params:{method:o,url:i,query:s,body:u},headers:a,result:d})];case 3:return p.sent(),[2]}}))}))}function Lt(t){var e,r={};try{for(var n=(null===(e=t.response)||void 0===e?void 0:e.headers)||{},o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],u=s[1];r[a]=String(u)}}catch(t){}return r}function _t(t,e,r){var n,o,i,s,a,u;return z(this,void 0,void 0,(function(){var c,f,l,d,p,h,v,g,m,y,w;return L(this,(function(b){switch(b.label){case 0:return c=t.ip||(null===(n=t.request)||void 0===n?void 0:n.ip)||"unknown",f=t.path||(null===(o=t.request)||void 0===o?void 0:o.path)||"",l=t.method||(null===(i=t.request)||void 0===i?void 0:i.method)||"",d=t.url||(null===(s=t.request)||void 0===s?void 0:s.url)||"",p=t.query||(null===(a=t.request)||void 0===a?void 0:a.query)||{},h=(null===(u=t.request)||void 0===u?void 0:u.body)||{},v=function(t){var e,r={};try{for(var n=t.headers||(null===(e=t.request)||void 0===e?void 0:e.headers)||{},o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],u=s[1];r[a]=String(u)}}catch(t){}return r}(t),g=Dt(),m=Date.now(),[4,e()];case 1:return b.sent(),y=Date.now()-m,w={status:t.status,body:t.body,headers:Lt(t),duration:y},[4,Pt({system:r,ip:c,path:f,method:l,time:g,params:{method:l,url:d,query:p,body:h},headers:v,result:w})];case 2:return b.sent(),[2]}}))}))}function Wt(t){var e,r={};try{for(var n=(null===(e=t.getHeaders)||void 0===e?void 0:e.call(t))||{},o=0,i=Object.entries(n);o<i.length;o++){var s=i[o],a=s[0],u=s[1];void 0!==u&&(r[a]=String(u))}}catch(t){}return r}function $t(t,e,r){return z(this,void 0,void 0,(function(){var n,o,i,s,a,u,c,f,l,d;return L(this,(function(p){switch(p.label){case 0:return n=t.headers["x-forwarded-for"]||t.headers["x-real-ip"]||t.ip||"unknown",o=t.url||"",i=t.method||"",s=t.query||{},a=t.body||{},u=function(t){var e={};try{for(var r=t.headers||{},n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],s=i[0],a=i[1];e[s]=String(a)}}catch(t){}return e}(t),c=Dt(),f=Date.now(),l=Date.now()-f,d={status:e.statusCode,headers:Wt(e),duration:l},[4,Pt({system:r,ip:n,path:o,method:i,time:c,params:{method:i,url:o,query:s,body:a},headers:u,result:d})];case 1:return p.sent(),[2]}}))}))}function Gt(t){var e=this;return function(r,n){return z(e,void 0,void 0,(function(){return L(this,(function(e){switch(function(t,e){var r;return function(t){var e,r;return t&&"string"==typeof t.method&&"string"==typeof t.url&&t.headers&&(void 0!==t.routerPath||void 0!==t.routeOptions||"function"==typeof t.getValidationFunction||"IncomingMessage"===(null===(r=null===(e=t.raw)||void 0===e?void 0:e.constructor)||void 0===r?void 0:r.name))}(t)&&void 0!==(null==e?void 0:e.statusCode)?"fastify":t&&t.req&&"function"==typeof t.req.header&&"function"==typeof t.req.query&&void 0!==t.req.raw?"hono":t&&t.request&&t.response&&"function"==typeof t.throw?t.requestContext||(null===(r=t.app)||void 0===r?void 0:r.getApplicationContext)?"midway":"koa":"unknown"}(r,n)){case"hono":return[2,zt(r,n,t)];case"fastify":return[2,$t(r,n,t)];case"koa":case"midway":return[2,_t(r,n,t)];default:return console.warn("[requestLoggerUnified] Unknown framework detected, falling back to Koa-style handling"),[2,_t(r,n,t)]}return[2]}))}))}}function Jt(t){var e=this;return function(r,n){return z(e,void 0,void 0,(function(){return L(this,(function(e){return[2,zt(r,n,t)]}))}))}}function Yt(t){var e=this;return function(r,n){return z(e,void 0,void 0,(function(){return L(this,(function(e){return[2,_t(r,n,t)]}))}))}}function Zt(t){var e=this;return function(r,n){return z(e,void 0,void 0,(function(){return L(this,(function(e){return[2,_t(r,n,t)]}))}))}}function Kt(t){var e=this;return function(r,n){return z(e,void 0,void 0,(function(){return L(this,(function(e){return[2,$t(r,n,t)]}))}))}}var Vt=function(t,e){void 0===t&&(t="state");var r=function(t,e){void 0===e&&(e="state");for(var r,n=t;"string"==typeof n;)try{r=n,n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){n=r;break}for(;n&&"object"==typeof n&&e in n&&("string"==typeof n[e]||"object"==typeof n[e]);)if("string"==typeof(n=n[e]))try{n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){break}return n}(e,t);return"object"==typeof r?JSON.stringify(r):String(r)};function Qt(t){var e=t.replace("#","").match(/../g);return e?e.map((function(t){return parseInt(t,16)})):[0,0,0]}function Xt(t,e,r){var n=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e};return"#"+n(t)+n(e)+n(r)}function te(t,e){var r=Qt(t).map((function(t){return Math.floor(t*(1-e))}));return Xt(r[0],r[1],r[2])}function ee(t,e){var r=Qt(t).map((function(t){return Math.floor((255-t)*e+t)}));return Xt(r[0],r[1],r[2])}function re(t,e){if(!Array.isArray(t))return[];for(var r=[],n=0,o=t;n<o.length;n++){var i=o[n];i&&void 0!==i[e]&&null!==i[e]&&r.push(i[e])}return r}function ne(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=r||function(t,e){return JSON.stringify(t)===JSON.stringify(e)};return e.every((function(e){return t.some((function(t){return n(t,e)}))}))}function oe(t){return null==t||("string"==typeof t?0===t.trim().length:Array.isArray(t)?0===t.length:"object"==typeof t&&0===Object.keys(t).length)}function ie(t,e){return Array.isArray(t)&&Array.isArray(e)?t.filter((function(t){return e.includes(t)})):[]}function se(t){return Array.isArray(t)&&t.length>0?t.reduce((function(t,e){return t+e}),0):0}function ae(t,e){return!("undefined"==typeof window||!t)&&!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function ue(t,e){"undefined"!=typeof window&&t&&(ae(t,e)||(t.className+=" "+e))}function ce(t,e){if("undefined"!=typeof window&&t&&ae(t,e)){var r=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(r," ").trim()}}function fe(t,e,r){if("undefined"!=typeof window){var n=r||document.body,o=n.className;o=o.replace(e,"").trim(),n.className=t?(o+" "+e).trim():o}}function le(t,e){if(void 0===e&&(e="_blank"),"undefined"!=typeof window){var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("target",e),r.setAttribute("rel","noreferrer noopener"),r.setAttribute("id","external");var n=document.getElementById("external");n&&document.body.removeChild(n),document.body.appendChild(r),r.click(),r.remove()}}function de(t){if("undefined"==typeof window||"undefined"==typeof document)return!1;var e=document.createElement("textarea"),r=document.activeElement;e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt",e.style.border="0",e.style.padding="0",e.style.margin="0";var n=document.getSelection(),o=null;n&&n.rangeCount>0&&(o=n.getRangeAt(0)),document.body.appendChild(e),e.select(),e.selectionStart=0,e.selectionEnd=t.length;var i=!1;try{i=document.execCommand("copy")}catch(t){console.error("复制失败:",t)}return e.remove(),o&&n&&(n.removeAllRanges(),n.addRange(o)),r&&r.focus(),i}function pe(t){if("undefined"==typeof window||"undefined"==typeof DOMParser)return t;try{var e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return t;var r=e.getAttribute("viewBox");if(!r)throw new Error("Invalid SVG string: Missing viewBox attribute.");var n=r.split(" ");return{width:parseInt(n[2],10),height:parseInt(n[3],10),body:Array.from(e.querySelectorAll("path")).map((function(t){return t.outerHTML})).join(" ")}}catch(e){return console.error("解析 SVG 失败:",e),t}}var he=function(){function t(t){this.ws=null,this.reconnectAttempts=0,this.heartbeatTimer=null,this.listeners=new Map,this.opts={url:t.url,reconnectAttemptsLimit:t.reconnectAttemptsLimit||5,reconnectInterval:t.reconnectInterval||5e3,heartbeatInterval:t.heartbeatInterval||3e4,registerMessage:t.registerMessage}}return Object.defineProperty(t.prototype,"url",{get:function(){return this.opts.url},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e){this.listeners.has(t)||this.listeners.set(t,new Set);var r=this.listeners.get(t);return r.add(e),function(){return r.delete(e)}},t.prototype.emit=function(t,e){var r=this.listeners.get(t);r&&r.forEach((function(t){try{t(e)}catch(t){}}))},t.prototype.connect=function(){try{this.ws=new WebSocket(this.opts.url),this.setupEventListeners()}catch(t){this.emit("error",{message:"WebSocket create failed"})}},t.prototype.setupEventListeners=function(){var t=this;this.ws&&(this.ws.onopen=function(){t.reconnectAttempts=0,t.opts.registerMessage&&t.send(t.opts.registerMessage),t.startHeartbeat(),t.emit("connected",!0)},this.ws.onmessage=function(e){try{var r=JSON.parse(e.data);t.emit("message",r)}catch(e){t.emit("error",{message:"Message parse failed"})}},this.ws.onclose=function(){t.stopHeartbeat(),t.emit("connected",!1),t.emit("closed",void 0),t.reconnect()},this.ws.onerror=function(){t.emit("error",{message:"WebSocket error"})})},t.prototype.send=function(t){if(this.ws&&1===this.ws.readyState)try{this.ws.send(JSON.stringify(t))}catch(t){}},t.prototype.startHeartbeat=function(){var t=this;this.stopHeartbeat(),this.heartbeatTimer=setInterval((function(){t.send({type:"ping"})}),this.opts.heartbeatInterval)},t.prototype.stopHeartbeat=function(){null!=this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)},t.prototype.reconnect=function(){var t=this;this.reconnectAttempts<this.opts.reconnectAttemptsLimit&&(this.reconnectAttempts++,setTimeout((function(){t.connect()}),this.opts.reconnectInterval))},t.prototype.disconnect=function(){if(this.stopHeartbeat(),this.ws)try{this.ws.close()}catch(t){}this.ws=null},Object.defineProperty(t.prototype,"isConnected",{get:function(){return!!this.ws&&1===this.ws.readyState},enumerable:!1,configurable:!0}),t}(),ve=function(){function t(){this.initialized=!1,this.manager=null}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.init=function(t){return z(this,void 0,void 0,(function(){return L(this,(function(e){return this.initialized||(this.manager=new he(t),this.manager.connect(),this.initialized=!0),[2]}))}))},t.prototype.destroy=function(){this.manager&&this.manager.disconnect(),this.manager=null,this.initialized=!1},t.prototype.getManager=function(){return this.manager},t}().getInstance(),ge=new(function(){function t(){this.listeners=new Map}return t.prototype.on=function(t,e){this.listeners.has(t)||this.listeners.set(t,new Set);var r=this.listeners.get(t);return r.add(e),function(){return r.delete(e)}},t.prototype.off=function(t,e){var r=this.listeners.get(t);r&&r.delete(e)},t.prototype.emit=function(t,e){var r=this.listeners.get(t);r&&r.forEach((function(t){try{t(e)}catch(t){}}))},t}()),me=function(t){return void 0===t&&(t="websocket"),r(t,{state:function(){return{isConnected:!1,wsManager:null,messages:[],connectionError:null}},getters:{connectionStatus:function(t){return t.isConnected?"已连接":"未连接"},lastMessage:function(t){return t.messages[t.messages.length-1]||null}},actions:{connect:function(t){var e;return z(this,void 0,void 0,(function(){return L(this,(function(r){return(null===(e=this.wsManager)||void 0===e?void 0:e.isConnected)||(this.wsManager=new he(t),this.setupEventListeners(),this.wsManager.connect()),[2]}))}))},setupEventListeners:function(){var t=this;this.wsManager&&(this.wsManager.on("connected",(function(e){t.isConnected=e,e&&(t.connectionError=null),ge.emit("websocket-connected",e)})),this.wsManager.on("message",(function(e){t.addMessage(e),ge.emit("websocket-message",e)})),this.wsManager.on("error",(function(e){t.connectionError=(null==e?void 0:e.message)||"WebSocket error",ge.emit("websocket-error",{message:t.connectionError})})),this.wsManager.on("closed",(function(){t.isConnected=!1,ge.emit("websocket-closed",void 0)})))},sendMessage:function(t){var e;null===(e=this.wsManager)||void 0===e||e.send(t)},addMessage:function(t){var e=H(H({},t),{timestamp:Date.now(),id:Math.random().toString(36).substring(2,11)});this.messages.push(e),this.messages.length>100&&this.messages.shift()},clearMessages:function(){this.messages=[]},disconnect:function(){var t;null===(t=this.wsManager)||void 0===t||t.disconnect(),this.wsManager=null,this.isConnected=!1,this.connectionError=null},reset:function(){this.disconnect(),this.clearMessages()}}})};export{jt as ApiBuilder,Tt as InsertBuilder,qt as QueryBuilder,Bt as UpdateBuilder,he as WebsocketManager,ue as addClass,D as addDays,x as base64ToBlob,E as base64ToFile,nt as blobToDataURL,v as buildUUID,tt as calcFileSize,Z as ceil,a as clearLoginData,q as compatibleDate,ot as compressImg,Q as computeMoney,b as convertBase64UrlToBlob,J as convertCurrency,de as copyTextToClipboard,me as createWebSocketStore,te as darken,rt as dataURLtoBlob,st as deepEqual,o as delay,i as deviceDetection,ge as emitter,et as fileSizeFormat,C as filterRepeat,ut as findNodePath,K as floor,St as formatBank,W as formatBytes,X as formatCentsToYuan,yt as formatEmptyValue,Y as formatFloat,V as formatMoney,wt as formatPhone,bt as formatPhoneHide,B as formatTime,w as formateTimestamp,U as fromNow,it as genExportByBlob,Mt as generateEnglishLetters,h as getCookie,l as getDeviceType,S as getEnvironment,O as getFileData,d as getFromType,M as getIsComWx,A as getIsDevelopment,re as getKeyList,xt as getQueryMap,u as getQueryString,c as getQueryVariable,pe as getSvgInfo,g as getTicket,j as getToken,f as getWecomToken,Vt as handleFlatStr,ae as hasClass,Qt as hexToRgb,Et as hideTextAtIndex,It as http,kt as httpEnum,At as humpTurnDashed,ie as intersection,oe as isAllEmpty,ht as isEmail,s as isEmpty,ct as isExternal,k as isImage,ne as isIncludeAllChildren,lt as isMobile,dt as isMobileSimple,gt as isPhone,vt as isQQ,pt as isTelephone,mt as isUrl,ee as lighten,T as newDate,le as openLink,p as randomString,Gt as recordLogMiddleware,Kt as recordLogMiddlewareFastify,Jt as recordLogMiddlewareHono,Yt as recordLogMiddlewareKoa,Zt as recordLogMiddlewareMidway,ce as removeClass,y as removeTicket,R as removeToken,Xt as rgbToHex,Pt as sendLog,m as setTicket,Ct as subBefore,se as sum,G as toThousands,fe as toggleClass,ft as trimVal,N as uuid,I as validateTwoDecimal,ve as websocketService};
15
+ ***************************************************************************** */var u=function(t,e){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function s(t,e){function r(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var l=function(){return(l=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function c(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))}function f(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}var v={isWxWork:"wecom",isWeixin:"wechat",isMobile:"mobile",isMobileAny:"mobile"};function y(t){return new Promise((function(e){return setTimeout(e,t)}))}function g(){if("undefined"==typeof window)return!1;var t=navigator.userAgent.toLowerCase(),e=/midp/i.test(t),r=/ucweb/i.test(t),n=/android/i.test(t),o=/iphone os/i.test(t),i=/windows ce/i.test(t),a=/windows mobile/i.test(t),u=/rv:1.2.3.4/i.test(t);return e||r||n||o||i||a||u}function m(t){return null===t||""===t||void 0===t}var w=function(){localStorage.removeItem("wecom_userinfo"),localStorage.removeItem("wecom_token"),localStorage.removeItem("projectActive"),localStorage.removeItem("loginTime"),localStorage.removeItem("projectInfo")},b=function(t,e){var r=new RegExp("&{1}"+e+"\\=[a-zA-Z0-9_-]+","g"),n=t.replace(/\?/g,"&").match(r)[0];return n.substr(n.indexOf("=")+1)},S=function(t){for(var e=window.location.search.substring(1).split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===t)return n[1]}return!1},A=function(){return localStorage.getItem("wecom_token")},E=function(){var t=navigator.userAgent.toLowerCase(),e=/wxwork/.test(t),r=/micromessenger/.test(t)&&!e,n=window.innerWidth<=768;return{isWxWork:e,isWeixin:r,isMobileScreen:n,isMobileAny:e||r||n}},M=function(t){var e="wecom";for(var r in t){if(t[r]){e=v[r];break}}return e};function O(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*r));return n}var C=function(t){for(var e="",r=document.cookie.split("; "),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===t){e=o[1];break}}return e},x=function(){for(var t=[],e=0;e<=15;e++)t[e]=e.toString(16);var r="";for(e=1;e<=36;e++)r+=9===e||14===e||19===e||24===e?"-":15===e?4:20===e?t[4*Math.random()|8]:t[16*Math.random()|0];return r.replace(/-/g,"")},D=function(){return localStorage.getItem("jsapiTicket")},T=function(t){return localStorage.setItem("jsapiTicket",t)},N=function(){return localStorage.removeItem("jsapiTicket")},R=function(t,e){if(void 0===e&&(e="YYYY年MM月DD日 hh:mm:ss"),!t)return"-";var r=new Date(t),n=r.getFullYear()+"",o=r.getMonth()+1,i=r.getDate(),a=r.getHours()>9?r.getHours():"0"+r.getHours(),u=r.getMinutes()>9?r.getMinutes():"0"+r.getMinutes(),s=r.getSeconds()>9?r.getSeconds():"0"+r.getSeconds();return e.replace("YYYY",n+"").replace("MM",o+"").replace("DD",i+"").replace("hh",a+"").replace("mm",u+"").replace("ss",s+"")},L=function(t){for(var e=window.atob(t.split(",")[1]),r=new ArrayBuffer(e.length),n=new Uint8Array(r),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return new Blob([r],{type:"image/png"})},P=function(){var t=window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),e=/micromessenger/i.test(navigator.userAgent),r=/wxwork/i.test(navigator.userAgent);return r&&t?"com-wx-mobile":r&&!t?"com-wx-pc":e&&t?"wx-mobile":e&&!t?"wx-pc":"other"},B=function(){return/wxwork/i.test(navigator.userAgent)},I=function(){var t=!1;return"uat2-h5-wecom.hengdayun.com"!==location.origin&&"127.0.0.1:8081"!==location.origin&&"localhost:8081"!==location.origin||(t=!0),t},_=function(t,e){var r=new Set;return t.filter((function(t){var n=t[e];return!r.has(n)&&(r.add(n),!0)}))},U=function(t){for(var e=t.split(","),r=e[0].match(/:(.\*?);/)[1],n=atob(e[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:r})},F=function(t,e){for(var r=t.split(","),n=r[0].match(/:(.*);/)[1],o=atob(r[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new File([a],e,{type:n})},j=function(t){return/^image\//i.test(t)},k=function(t){var e=h(t.split(","),2),r=e[0],n=void 0===r?"":r,o=e[1],i=void 0===o?"":o;return{name:decodeURIComponent(n),url:decodeURIComponent(i)}},q=function(t){return!t||""===t||/^(\d+)(\.\d{1,2})?$/.test(t.toString())},H=function(t,e){var r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(e=e||n.length,t)for(r=0;r<t;r++)o[r]=n[0|Math.random()*e];else{var i=void 0;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(i=0|16*Math.random(),o[r]=n[19==r?3&i|8:i])}return o.join("")},z=function(t,e){var r=t.toLowerCase();return"localstorage"===r?localStorage.getItem("token")||"":"sessionstorage"===r?sessionStorage.getItem("token")||"":localStorage.getItem("token")||sessionStorage.getItem("token")||""},W=function(t,e){var r=t.toLowerCase();"localstorage"===r?localStorage.removeItem("token"):"sessionstorage"===r?sessionStorage.removeItem("token"):(localStorage.removeItem("token"),sessionStorage.getItem("token"))};function G(t){return"string"==typeof t?t.replace(/-/g,"/"):t}function Y(t){return t?new Date(G(t)):new Date}function $(t,e){void 0===t&&(t=Date.now()),void 0===e&&(e="yyyy-MM-dd HH:mm:ss"),t=G(t);var r={"M+":(t=new Date(t)).getMonth()+1,"d+":t.getDate(),"h+":t.getHours()%12==0?12:t.getHours()%12,"H+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};return/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(""+t.getFullYear()).substr(4-RegExp.$1.length))),Object.keys(r).forEach((function(t){new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?r[t]:("00"+r[t]).substr((""+r[t]).length)))})),e}function J(t,e,r){if(void 0===e&&(e="yyyy年MM月dd日 HH时mm分ss秒"),void 0===r&&(r="-"),m(t))return r;t=G(t);var n=new Date(t),o=(Date.now()-n.getTime())/1e3;return o<0?t:o<30?"刚刚":o<3600?Math.ceil(o/60)+"分钟前":o<86400?Math.floor(o/3600)+"小时前":o<172800?"1天前":$(t,e)}function V(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r="yyyy-MM-dd"),m(t))return"-";t=G(t);var n=new Date(t);return n.setDate(n.getDate()+Number(e)),$(n,r)}function Z(t,e){if(void 0===e&&(e=2),0===t)return"0 Bytes";var r=e<0?0:e,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]}var K={operation:"divide",factor:100,precision:2,formatAsCurrency:!1,currencySymbol:"¥"};function Q(t,e){if(void 0===e&&(e="-"),m(t))return e;var r=t.toString();return r.includes(".")||(r+="."),r.replace(/\d(?=(\d{3})+\.)/g,(function(t){return t+","})).replace(/\.$/,"")}function X(t){void 0===t&&(t="");if(m(t))return"";if(Number(t)>=1e15)return t;var e,r,n,o=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],i=["","拾","佰","仟"],a=["","万","亿","兆"],u=["角","分","毫","厘"],s="";if("0"===(t=parseFloat(t).toString()))return s=o[0]+"元整";if(-1===(t=t.toString()).indexOf(".")?(e=t,r=""):(e=(n=t.split("."))[0],r=n[1].substr(0,4)),parseInt(e,10)>0){for(var l=0,c=e.length,f=0;f<c;f+=1){var d=e.substr(f,1),h=c-f-1,p=h/4,v=h%4;"0"===d?l+=1:(l>0&&(s+=o[0]),l=0,s+=o[parseInt(d,10)]+i[v]),0===v&&l<4&&(s+=a[p])}s+="元"}if(""!==r){var y=r.length;for(f=0;f<y;f+=1){var g=r.substr(f,1);"0"!==g&&(s+=o[Number(g)]+u[f])}}return""===s?s+=o[0]+"元整":""===r&&(s+="整"),s}function tt(t,e){void 0===e&&(e=2);var r=parseFloat(String(t));if(Number.isNaN(r))return"";var n=(r=Math.round(Number(t)*Math.pow(10,e))/Math.pow(10,e)).toString(),o=n.indexOf(".");for(o<0&&(o=n.length,n+=".");n.length<=o+e;)n+="0";return n}function et(t,e){if(void 0===e&&(e=0),m(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.ceil(n)/r}function rt(t,e){if(void 0===e&&(e=0),m(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.floor(n)/r}function nt(t,e){var r=ot(t,e),n=l(l({},K),e);if(n.formatter)return n.formatter(r);if(n.formatAsCurrency){var o=r.toFixed(n.precision),i=r>=1e3?Q(o):o;return""+n.currencySymbol+i}return r.toFixed(n.precision)}function ot(t,e){var r,n,o=l(l({},K),e);if(null==t||""===t)return 0;if("string"==typeof t){var i=t.replace(/[^\d.-]/g,"");r=i?parseFloat(i):0}else r=t;if(isNaN(r))return 0;if(n="multiply"===o.operation?r*o.factor:0!==o.factor?r/o.factor:0,void 0!==o.precision){var a=Math.pow(10,o.precision);n=Math.round(n*a)/a}return n}function it(t,e){return nt(t,l({operation:"divide",factor:100,formatAsCurrency:!0},e))}function at(t,e){void 0===e&&(e="B");var r=["B","KB","MB","GB","TB"],n=r.indexOf(e.toUpperCase());for(n=-1===n?0:n;t>=1024&&n<r.length;)t/=1024,n+=1;return{size:t,unit:r[n]}}function ut(t,e,r){if(void 0===e&&(e="B"),void 0===r&&(r="-"),m(t))return r;var n=at(parseFloat(t.toString()),e);return""+et(n.size,2)+n.unit}function st(t){for(var e=t.match(/:(.*?);/)[1],r=window.atob(t.split(",")[1]),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function lt(t){return new Promise((function(e,r){var n=new FileReader;n.onload=function(t){t&&t.target?e(t.target.result):r(t)},n.onerror=function(t){r(t)},n.readAsDataURL(t)}))}function ct(t,e,r){return new Promise((function(n,o){var i=parseFloat((t.size/1024/1024).toString()),a=new FileReader;a.onload=function(a){var u=new Image;u.onload=function(){var o=u.width,a=u.height,s=document.createElement("canvas"),l=s.getContext("2d"),c=e?e(o,a):1;(Number.isNaN(c)||"number"!=typeof c)&&(c=1);var f=r?r(i,c,o,a):1;if((Number.isNaN(f)||"number"!=typeof f)&&(f=1),l){var d=parseInt((o*c).toString(),10),h=parseInt((a*c).toString(),10);s.setAttribute("width",d.toString()),s.setAttribute("height",h.toString()),l.drawImage(u,0,0,d,h)}var p=s.toDataURL(t.type,f);n(st(p))},u.onerror=function(t){o(t)},a.target&&(u.src=a.target.result)},a.onerror=function(t){o(t)},a.readAsDataURL(t)}))}function ft(t){var e=t.axiosRequest,r=t.notWithCredentials,n=void 0===r?[]:r;return function(t){var r=this,o=t.filename,i=t.url,a=t.data,u=void 0===a?{}:a,s=t.params,l=void 0===s?{}:s,d=t.method,h=void 0===d?"post":d;return new Promise((function(t,a){e({method:h,url:i,data:u,params:l,responseType:"blob",config:{withCredentials:n.some((function(t){return!i.includes(t)}))}}).then((function(e){return c(r,void 0,void 0,(function(){var r,n,i,u,s,l,c,d,h,p;return f(this,(function(f){switch(f.label){case 0:return"application/json"!==(r=null==e?void 0:e.data).type?[3,1]:((n=new FileReader).readAsText(r,"utf-8"),n.onload=function(){var t={};try{t=JSON.parse(n.result)}catch(e){t=r}a(t)},[3,3]);case 1:try{i=e.headers,u=i["content-disposition"],s=decodeURIComponent(u.split(";")[1].split("filename=")[1]),o&&!o.includes(".")?(l=s.split("."),c=l[l.length-1],o+="."+c):o||(o=s)}catch(t){o||(o="download.xlsx")}return d=new Blob([e.data]),h=document.createElement("a"),[4,lt(d)];case 2:p=f.sent(),h.href=p,h.download=o,document.body.appendChild(h),h.click(),document.body.removeChild(h),t(e),f.label=3;case 3:return[2]}}))}))})).catch((function(t){a(t)}))}))}}function dt(t,e){var r=Object.keys,n=typeof t;return t&&e&&"object"===n&&n===typeof e?r(t).length===r(e).length&&r(t).every((function(r){return dt(t[r],e[r])})):t===e}function ht(t,e,r,n,o){if(void 0===o&&(o=[]),o.push(t),t[r]===e)throw"GOT IT!";if(t[n]&&t[n].length>0)for(var i=0;i<t[n].length;i++)ht(t[n][i],e,r,n,o);o.pop()}function pt(t,e,r,n){var o=[];try{for(var i=0;i<r.length;i++)ht(r[i],t,e,n,o)}catch(t){return o}}function vt(t){return/^(https?:|mailto:|tel:)/.test(t)}function yt(t){if(!t)return t;return t.replace(/^\s+|\s+$/g,"")}function gt(t){return/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/.test(t.toString())}function mt(t){return t=t.toString(),/^1/.test(t)&&11===t.length}function wt(t){return/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/.test(String(t))}function bt(t){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t)}function St(t){return/^[1-9][0-9]{4,9}$/gim.test(String(t))}function At(t){return/^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/.test(t)}function Et(t){return new RegExp("^(?:(https?|ftp|rtsp|mms|ws|wss):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:localhost)|(?:[1-9]\\d{0,2}(?:\\.\\d{1,3}){3})|(?:$[0-9a-fA-F:]+$)|(?:(?:[a-zA-Z0-9-_]+\\.)+[a-zA-Z]{2,63}))(?::\\d{1,5})?(?:[/?#]\\S*)?$","i").test(t)}function Mt(t,e){return void 0===e&&(e="-"),m(t)?e:t}function Ot(t,e,r){if(void 0===e&&(e=" "),void 0===r&&(r="-"),m(t))return r;if(11!==t.toString().length)return t;var n=t.toString().replace(/[^\d]/g,"").split(""),o="";return n.forEach((function(t,r){3!==r&&7!==r||(o+=e),o+=t})),o}function Ct(t,e){if(void 0===e&&(e=""),m(t))return e;if(11!==t.toString().length)return t;var r=t.toString();return r.substr(0,3)+"****"+r.substr(7,11)}function xt(t,e){return void 0===e&&(e=""),m(t)?e:t.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")}function Dt(){for(var t=[],e=65;e<91;e+=1)t.push(String.fromCharCode(e));return t}function Tt(t){void 0===t&&(t="");return t.replace(/\B([A-Z])/g,"-$1").toLowerCase()}function Nt(t,e){return t&&"string"==typeof e?t.substring(0,t.indexOf(e)):""}function Rt(t){var e,r;if(!/^(?:(https?|ftp|rtsp|mms|ws|wss):\/\/)?/i.test(t))return console.error(t+"不符合超链接规范"),{};var n=t.indexOf("?");if(-1===n)return{};var o=t.slice(n+1).split("&"),i={};try{for(var a=d(o),u=a.next();!u.done;u=a.next()){var s=h(u.value.split("="),2),l=s[0],c=s[1];l&&(i[l]=c||"")}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return i}function Lt(t,e,r){var n,o;void 0===r&&(r="*"),"number"==typeof t&&(t=t.toString()),Array.isArray(e)||(e=[e]);var i=t.split("");try{for(var a=d(e),u=a.next();!u.done;u=a.next()){var s=u.value;if("object"!=typeof s||Array.isArray(s))"number"==typeof s&&Number.isInteger(s)&&s>=0&&s<i.length&&(i[s]=r);else{var l=s.start,c=s.end;l>=0&&l<c&&c<i.length&&i.fill(r,l,c+1)}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return i.join("")}var Pt={HTTP_STATUS:{TEMP_RESPOND:{Continue:100,SwitchingProtocal:101},SUCCESS:{Ok:200,Created:201,Accepted:202,NoAuthoritativeInformation:203,NoContent:204,ResetContent:205,ParticalContent:206},REDIRECT:{MultipleChoice:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},REQUEST_ERROR:{BadRequest:400,UnAuthorized:401,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAccepted:406,ProxyAuthorizationRequired:407,RequestTimeout:408,UpgradeRequired:426,TokenUnAuthorized:499},SERVER_ERROR:{InternalServerError:500,BadGateway:502,ServiceUnavailable:503,GateTimeout:504,HttpVersionNotSupported:505}},CODES:{Success:"00000",UnAuthorized:"00099",UnAuthorizedPhone:"11001",UnAuthorizedWecom:"11000",UnAuthorizedHavePhone:"11002"},ERR_CODE_WHITE_LIST:[]},Bt=t.create({timeout:15e3,headers:{"Content-Type":"application/json"}}),It=function(t){var e=t.cacheType,r=t.currentMode,n=t.errorCb,o=t.getTokenCb;return t.tokenKey,Bt.interceptors.request.use((function(t){return c(void 0,void 0,void 0,(function(){var r,n;return f(this,(function(o){return r=z(e),n=E(),t.headers.Authorization=r,t.headers.token=r,t.headers.FrontType=M(n),[2,t]}))}))}),(function(t){return Promise.reject(t)})),Bt.interceptors.response.use((function(t){return c(void 0,void 0,void 0,(function(){var n,i,a;return f(this,(function(u){return n=t.data,i=n.code||t.status,n instanceof Blob||i===Pt.CODES.Success?[2,n]:i===Pt.CODES.UnAuthorized?("local"!==r&&"dev"!==r&&"development"!==r&&(W(e),o&&"function"==typeof o&&o()),[2,Promise.reject(new Error("token过期!"))]):(a=n.message||n.msg,[2,Promise.reject(new Error(a||"Error"))])}))}))}),(function(t){return c(void 0,void 0,void 0,(function(){return f(this,(function(e){return n&&"function"==typeof n&&n(t),[2,Promise.reject(t)]}))}))})),Bt},_t=function(){function t(t){this.fieldCatalog=t,this.params=t?{field_catalog:t}:{}}return t.prototype.build=function(){return this.params},t}(),Ut=function(){function t(t){this.fieldCatalog=t}return t.prototype.query=function(){return new jt(this.fieldCatalog)},t.prototype.insert=function(){return new kt(this.fieldCatalog)},t.prototype.update=function(){return new qt(this.fieldCatalog)},t.query=function(t){return new jt(t)},t.insert=function(t){return new kt(t)},t.update=function(t){return new qt(t)},t}(),Ft=function(){function t(t,e){this.parent=e,this.nestedFilters={logic:t,filters:[]}}return t.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=h(t,2),r=e[0],o=e[1];n.nestedFilters.filters.push({field:r,op:"=",value:o})})),this):void 0===r?(this.nestedFilters.filters.push({field:t,op:"=",value:e}),this):(this.nestedFilters.filters.push({field:t,op:e,value:r}),this)},t.prototype.group=function(e){return void 0===e&&(e="and"),new t(e,this)},t.prototype.endGroup=function(){return this.parent instanceof t?(this.parent.addNestedFilters(this.nestedFilters),this.parent):(this.parent.whereNested(this.nestedFilters),this.parent)},t.prototype.addNestedFilters=function(t){this.nestedFilters.filters.push(t)},t.prototype.build=function(){return this.nestedFilters},t}(),jt=function(t){function e(e){var r=t.call(this,e)||this;return r.params=l(l({},r.params),{filters:{logic:"and",filters:[]},order_by:[],limit:100,offset:0}),r}return s(e,t),e.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=h(t,2),r=e[0],o=e[1];n.params.filters.filters.push({field:r,op:"=",value:o})})),this):void 0===r?(this.params.filters.filters.push({field:t,op:"=",value:e}),this):(this.params.filters.filters.push({field:t,op:e,value:r}),this)},e.prototype.whereNested=function(t){return this.params.filters.filters.push(t),this},e.prototype.group=function(t){return void 0===t&&(t="and"),new Ft(t,this)},e.prototype.orWhere=function(t,e,r){var n,o={logic:"or",filters:[]};if("object"==typeof t?Object.entries(t).forEach((function(t){var e=h(t,2),r=e[0],n=e[1];o.filters.push({field:r,op:"=",value:n})})):void 0===r?o.filters.push({field:t,op:"=",value:e}):o.filters.push({field:t,op:e,value:r}),0===this.params.filters.filters.length||"or"===this.params.filters.logic)(n=this.params.filters.filters).push.apply(n,p(o.filters)),this.params.filters.logic="or";else{var i={logic:"and",filters:p(this.params.filters.filters)};this.params.filters.filters=[i,o],this.params.filters.logic="and"}return this},e.prototype.whereIn=function(t,e){return this.params.filters.filters.push({field:t,op:"in",value:e}),this},e.prototype.whereNotIn=function(t,e){return this.params.filters.filters.push({field:t,op:"not in",value:e}),this},e.prototype.whereLike=function(t,e){return this.params.filters.filters.push({field:t,op:"like",value:e}),this},e.prototype.whereBetween=function(t,e,r){return this.params.filters.filters.push({field:t,op:"between",value:[e,r]}),this},e.prototype.whereNull=function(t){return this.params.filters.filters.push({field:t,op:"is null",value:null}),this},e.prototype.whereNotNull=function(t){return this.params.filters.filters.push({field:t,op:"is not null",value:null}),this},e.prototype.logic=function(t){return this.params.filters.logic=t,this},e.prototype.orderBy=function(t,e){return void 0===e&&(e="asc"),this.params.order_by.push({field:t,direction:e}),this},e.prototype.limit=function(t){return this.params.limit=t,this},e.prototype.offset=function(t){return this.params.offset=t,this},e.prototype.paginate=function(t,e){return void 0===e&&(e=0),this.params.limit=t,this.params.offset=e,this},e}(_t),kt=function(t){function e(e){var r=t.call(this,e)||this;return r.params=l(l({},r.params),{insert:[]}),r}return s(e,t),e.prototype.add=function(t){return this.params.insert.push(t),this},e.prototype.addBatch=function(t){var e;return(e=this.params.insert).push.apply(e,p(t)),this},e}(_t),qt=function(t){function e(e){var r=t.call(this,e)||this;return r.currentUpdate=null,r.params=l(l({},r.params),{update:[]}),r}return s(e,t),e.prototype.set=function(t){return this.currentUpdate={set:t,where:{}},this},e.prototype.where=function(t,e){if(!this.currentUpdate)throw new Error("必须先调用 set() 方法");return"object"==typeof t?this.currentUpdate.where=l(l({},this.currentUpdate.where),t):this.currentUpdate.where[t]=e,this},e.prototype.and=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this},e.prototype.setBatch=function(t){var e;return(e=this.params.update).push.apply(e,p(t)),this},e.prototype.build=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this.params},e}(_t);function Ht(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}function zt(t){return l({},t||{})}function Wt(t,e){var r=e.toLowerCase();return Object.keys(t).some((function(t){return t.toLowerCase()===r}))}function Gt(t){try{return JSON.parse(t)}catch(t){return}}function Yt(t){return c(this,void 0,void 0,(function(){var e,r,n,o,i,a,u,s,l,c,d,h,p;return f(this,(function(f){switch(f.label){case 0:e=Ht(),r=(t.method||"GET").toUpperCase(),n="number"==typeof t.timeoutMs&&t.timeoutMs>0?t.timeoutMs:15e3,o=zt(t.headers),i=void 0!==t.data&&null!==t.data,a=void 0,i&&("string"==typeof t.data||void 0!==e.FormData&&t.data instanceof e.FormData||void 0!==e.Blob&&t.data instanceof e.Blob||void 0!==e.ArrayBuffer&&t.data instanceof e.ArrayBuffer?a=t.data:(Wt(o,"content-type")||(o["Content-Type"]="application/json"),a=JSON.stringify(t.data))),u=void 0!==e.AbortController?new e.AbortController:null,s=u?setTimeout((function(){return u.abort()}),n):null,f.label=1;case 1:return f.trys.push([1,,4,5]),[4,e.fetch(t.url,{method:r,headers:o,body:a,redirect:!1===t.followRedirects?"manual":"follow",signal:u?u.signal:void 0})];case 2:return[4,(l=f.sent()).text()];case 3:c=f.sent(),d={};try{l.headers.forEach((function(t,e){d[e.toLowerCase()]=t}))}catch(t){}return h=d["content-type"]||"",p=h.includes("application/json")?Gt(c):void 0,[2,{status:l.status,headers:d,body:c,json:p}];case 4:return s&&clearTimeout(s),[7];case 5:return[2]}}))}))}function $t(t,e){var r,n={http:(r=(0,eval)("require"))("http"),https:r("https")},o=n.http,i=n.https,a=Ht(),u=a.URL,s="function"==typeof u?new u(t.url):null,c=(s?"https:"===s.protocol:String(t.url).startsWith("https://"))?i:o,f=(t.method||"GET").toUpperCase(),p="number"==typeof t.timeoutMs&&t.timeoutMs>0?t.timeoutMs:15e3,v=zt(t.headers),y=void 0!==t.data&&null!==t.data,g=void 0;if(y&&(void 0!==a.Buffer&&a.Buffer&&"function"==typeof a.Buffer.isBuffer&&a.Buffer.isBuffer(t.data)||"string"==typeof t.data?g=t.data:(Wt(v,"content-type")||(v["Content-Type"]="application/json"),g=JSON.stringify(t.data)),null!=g&&!Wt(v,"content-length")))try{var m="string"==typeof g?a.Buffer.byteLength(g):g.length;v["Content-Length"]=String(m)}catch(t){}return new Promise((function(r,n){var o=c.request(t.url,{method:f,headers:v},(function(o){var i=Number(o.statusCode||0),u=function(t){var e,r,n={};try{for(var o=d(Object.entries(t||{})),i=o.next();!i.done;i=o.next()){var a=h(i.value,2),u=a[0],s=a[1];null!=s&&(n[String(u).toLowerCase()]=Array.isArray(s)?String(s.join(",")):String(s))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}(o.headers||{}),s=!1!==t.followRedirects,c=301===i||302===i||303===i||307===i||308===i,p=u.location;if(s&&c&&p&&e<5){o.resume();var v=function(t,e){var r=Ht().URL;return"function"==typeof r?new r(e,t).toString():e}(t.url,p),y=303===i?"GET":f,g=l(l({},t),{url:v,method:y});return 303===i&&(g.data=void 0),void $t(g,e+1).then(r,n)}var m=[];o.on("data",(function(t){return m.push(t)})),o.on("end",(function(){var t=void 0!==a.Buffer&&a.Buffer&&"function"==typeof a.Buffer.concat?a.Buffer.concat(m):m.join?m.join(""):"",e="string"==typeof t?t:t.toString("utf8"),n=(u["content-type"]||"").includes("application/json")?Gt(e):void 0;r({status:i,headers:u,body:e,json:n})}))}));o.on("error",(function(t){return n(t)})),o.setTimeout(p,(function(){return o.destroy(new Error("Request timeout"))})),null!=g&&o.write(g),o.end()}))}var Jt=new(function(){function t(){}return t.prototype.request=function(t){return c(this,void 0,void 0,(function(){return f(this,(function(e){if("function"==typeof Ht().fetch)return[2,Yt(t)];if(r=Ht(),(n=r&&r.process)&&n.versions&&n.versions.node)return[2,$t(t,0)];var r,n;throw new Error("No fetch available in current runtime")}))}))},t.prototype.get=function(t,e){return c(this,void 0,void 0,(function(){return f(this,(function(r){return[2,this.request(l(l({},e||{}),{url:t,method:"GET"}))]}))}))},t.prototype.post=function(t,e,r){return c(this,void 0,void 0,(function(){return f(this,(function(n){return[2,this.request(l(l({},r||{}),{url:t,method:"POST",data:e}))]}))}))},t}());function Vt(){var t=new Date;return String(t.getFullYear())+"年"+String(t.getMonth()+1)+"月"+String(t.getDate())+"日"+String(t.getHours())+":"+String(t.getMinutes())}function Zt(t){return c(this,void 0,void 0,(function(){var e,r;return f(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),"https://fe-log-producer.jinbizhihui.com",[4,Jt.post("https://fe-log-producer.jinbizhihui.com/log/save",t)];case 1:return e=n.sent(),console.log("[RequestLogger] 远程日志发送成功, result",e),[3,3];case 2:return r=n.sent(),console.error("[RequestLogger] 远程日志发送失败:",(null==r?void 0:r.message)||r),[3,3];case 3:return[2]}}))}))}function Kt(t){return c(this,void 0,void 0,(function(){var e,r,n;return f(this,(function(o){switch(o.label){case 0:e=t.req.header("content-type")||"",o.label=1;case 1:return o.trys.push([1,4,,5]),(r=t.req.raw)&&"function"==typeof r.clone?[4,r.clone().text()]:[3,3];case 2:if(!(n=o.sent()))return[2,void 0];if(e.includes("application/json"))try{return[2,JSON.parse(n)]}catch(t){return[2,n]}return[2,n];case 3:return[3,5];case 4:return o.sent(),[3,5];case 5:return[2,void 0]}}))}))}function Qt(t){var e={};try{t.res.headers.forEach((function(t,r){e[r]=t}))}catch(t){}return e}function Xt(t,e,r){return c(this,void 0,void 0,(function(){var n,o,i,a,u,s,l,c,d,h;return f(this,(function(f){switch(f.label){case 0:return n=t.req.header("x-forwarded-for")||t.req.header("x-real-ip")||"unknown",o=t.req.method,i=t.req.url,a=t.req.query(),u=function(t){var e={};try{var r=t.req.raw,n=null==r?void 0:r.headers;n&&n.forEach((function(t,r){e[r]=t}))}catch(t){}return e}(t),[4,Kt(t)];case 1:return s=f.sent(),l=Vt(),c=Date.now(),[4,e()];case 2:return f.sent(),d=Date.now()-c,h={status:t.res.status,headers:Qt(t),duration:d},[4,Zt({system:r,ip:n,path:i,method:o,time:l,params:{method:o,url:i,query:a,body:s},headers:u,result:h})];case 3:return f.sent(),[2]}}))}))}function te(t){var e,r,n,o={};try{var i=(null===(n=t.response)||void 0===n?void 0:n.headers)||{};try{for(var a=d(Object.entries(i)),u=a.next();!u.done;u=a.next()){var s=h(u.value,2),l=s[0],c=s[1];o[l]=String(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}catch(t){}return o}function ee(t,e,r){var n,o,i,a,u,s;return c(this,void 0,void 0,(function(){var l,c,p,v,y,g,m,w,b,S,A;return f(this,(function(f){switch(f.label){case 0:return l=t.ip||(null===(n=t.request)||void 0===n?void 0:n.ip)||"unknown",c=t.path||(null===(o=t.request)||void 0===o?void 0:o.path)||"",p=t.method||(null===(i=t.request)||void 0===i?void 0:i.method)||"",v=t.url||(null===(a=t.request)||void 0===a?void 0:a.url)||"",y=t.query||(null===(u=t.request)||void 0===u?void 0:u.query)||{},g=(null===(s=t.request)||void 0===s?void 0:s.body)||{},m=function(t){var e,r,n,o={};try{var i=t.headers||(null===(n=t.request)||void 0===n?void 0:n.headers)||{};try{for(var a=d(Object.entries(i)),u=a.next();!u.done;u=a.next()){var s=h(u.value,2),l=s[0],c=s[1];o[l]=String(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}catch(t){}return o}(t),w=Vt(),b=Date.now(),[4,e()];case 1:return f.sent(),S=Date.now()-b,A={status:t.status,body:t.body,headers:te(t),duration:S},[4,Zt({system:r,ip:l,path:c,method:p,time:w,params:{method:p,url:v,query:y,body:g},headers:m,result:A})];case 2:return f.sent(),[2]}}))}))}function re(t){var e,r,n,o={};try{var i=(null===(n=t.getHeaders)||void 0===n?void 0:n.call(t))||{};try{for(var a=d(Object.entries(i)),u=a.next();!u.done;u=a.next()){var s=h(u.value,2),l=s[0],c=s[1];void 0!==c&&(o[l]=String(c))}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}catch(t){}return o}function ne(t,e,r){return c(this,void 0,void 0,(function(){var n,o,i,a,u,s,l,c,p,v;return f(this,(function(f){switch(f.label){case 0:return n=t.headers["x-forwarded-for"]||t.headers["x-real-ip"]||t.ip||"unknown",o=t.url||"",i=t.method||"",a=t.query||{},u=t.body||{},s=function(t){var e,r,n={};try{var o=t.headers||{};try{for(var i=d(Object.entries(o)),a=i.next();!a.done;a=i.next()){var u=h(a.value,2),s=u[0],l=u[1];n[s]=String(l)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}catch(t){}return n}(t),l=Vt(),c=Date.now(),p=Date.now()-c,v={status:e.statusCode,headers:re(e),duration:p},[4,Zt({system:r,ip:n,path:o,method:i,time:l,params:{method:i,url:o,query:a,body:u},headers:s,result:v})];case 1:return f.sent(),[2]}}))}))}function oe(t){var e=this;return function(r,n){return c(e,void 0,void 0,(function(){return f(this,(function(e){switch(function(t,e){var r;return function(t){var e,r;return t&&"string"==typeof t.method&&"string"==typeof t.url&&t.headers&&(void 0!==t.routerPath||void 0!==t.routeOptions||"function"==typeof t.getValidationFunction||"IncomingMessage"===(null===(r=null===(e=t.raw)||void 0===e?void 0:e.constructor)||void 0===r?void 0:r.name))}(t)&&void 0!==(null==e?void 0:e.statusCode)?"fastify":t&&t.req&&"function"==typeof t.req.header&&"function"==typeof t.req.query&&void 0!==t.req.raw?"hono":t&&t.request&&t.response&&"function"==typeof t.throw?t.requestContext||(null===(r=t.app)||void 0===r?void 0:r.getApplicationContext)?"midway":"koa":"unknown"}(r,n)){case"hono":return[2,Xt(r,n,t)];case"fastify":return[2,ne(r,n,t)];case"koa":case"midway":return[2,ee(r,n,t)];default:return console.warn("[requestLoggerUnified] Unknown framework detected, falling back to Koa-style handling"),[2,ee(r,n,t)]}return[2]}))}))}}function ie(t){var e=this;return function(r,n){return c(e,void 0,void 0,(function(){return f(this,(function(e){return[2,Xt(r,n,t)]}))}))}}function ae(t){var e=this;return function(r,n){return c(e,void 0,void 0,(function(){return f(this,(function(e){return[2,ee(r,n,t)]}))}))}}function ue(t){var e=this;return function(r,n){return c(e,void 0,void 0,(function(){return f(this,(function(e){return[2,ee(r,n,t)]}))}))}}function se(t){var e=this;return function(r,n){return c(e,void 0,void 0,(function(){return f(this,(function(e){return[2,ne(r,n,t)]}))}))}}var le=function(t,e){void 0===t&&(t="state");var r=function(t,e){void 0===e&&(e="state");for(var r,n=t;"string"==typeof n;)try{r=n,n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){n=r;break}for(;n&&"object"==typeof n&&e in n&&("string"==typeof n[e]||"object"==typeof n[e]);)if("string"==typeof(n=n[e]))try{n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){break}return n}(e,t);return"object"==typeof r?JSON.stringify(r):String(r)};function ce(t){var e=t.replace("#","").match(/../g);return e?e.map((function(t){return parseInt(t,16)})):[0,0,0]}function fe(t,e,r){var n=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e};return"#"+n(t)+n(e)+n(r)}function de(t,e){var r=ce(t).map((function(t){return Math.floor(t*(1-e))}));return fe(r[0],r[1],r[2])}function he(t,e){var r=ce(t).map((function(t){return Math.floor((255-t)*e+t)}));return fe(r[0],r[1],r[2])}function pe(t,e){var r,n;if(!Array.isArray(t))return[];var o=[];try{for(var i=d(t),a=i.next();!a.done;a=i.next()){var u=a.value;u&&void 0!==u[e]&&null!==u[e]&&o.push(u[e])}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o}function ve(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=r||function(t,e){return JSON.stringify(t)===JSON.stringify(e)};return e.every((function(e){return t.some((function(t){return n(t,e)}))}))}function ye(t){return null==t||("string"==typeof t?0===t.trim().length:Array.isArray(t)?0===t.length:"object"==typeof t&&0===Object.keys(t).length)}function ge(t,e){return Array.isArray(t)&&Array.isArray(e)?t.filter((function(t){return e.includes(t)})):[]}function me(t){return Array.isArray(t)&&t.length>0?t.reduce((function(t,e){return t+e}),0):0}function we(t,e){return!("undefined"==typeof window||!t)&&!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function be(t,e){"undefined"!=typeof window&&t&&(we(t,e)||(t.className+=" "+e))}function Se(t,e){if("undefined"!=typeof window&&t&&we(t,e)){var r=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(r," ").trim()}}function Ae(t,e,r){if("undefined"!=typeof window){var n=r||document.body,o=n.className;o=o.replace(e,"").trim(),n.className=t?(o+" "+e).trim():o}}function Ee(t,e){if(void 0===e&&(e="_blank"),"undefined"!=typeof window){var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("target",e),r.setAttribute("rel","noreferrer noopener"),r.setAttribute("id","external");var n=document.getElementById("external");n&&document.body.removeChild(n),document.body.appendChild(r),r.click(),r.remove()}}function Me(t){if("undefined"==typeof window||"undefined"==typeof document)return!1;var e=document.createElement("textarea"),r=document.activeElement;e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt",e.style.border="0",e.style.padding="0",e.style.margin="0";var n=document.getSelection(),o=null;n&&n.rangeCount>0&&(o=n.getRangeAt(0)),document.body.appendChild(e),e.select(),e.selectionStart=0,e.selectionEnd=t.length;var i=!1;try{i=document.execCommand("copy")}catch(t){console.error("复制失败:",t)}return e.remove(),o&&n&&(n.removeAllRanges(),n.addRange(o)),r&&r.focus(),i}function Oe(t){if("undefined"==typeof window||"undefined"==typeof DOMParser)return t;try{var e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return t;var r=e.getAttribute("viewBox");if(!r)throw new Error("Invalid SVG string: Missing viewBox attribute.");var n=r.split(" ");return{width:parseInt(n[2],10),height:parseInt(n[3],10),body:Array.from(e.querySelectorAll("path")).map((function(t){return t.outerHTML})).join(" ")}}catch(e){return console.error("解析 SVG 失败:",e),t}}var Ce,xe,De=function(){function t(t){this.ws=null,this.reconnectAttempts=0,this.heartbeatTimer=null,this.listeners=new Map,this.opts={url:t.url,reconnectAttemptsLimit:t.reconnectAttemptsLimit||5,reconnectInterval:t.reconnectInterval||5e3,heartbeatInterval:t.heartbeatInterval||3e4,registerMessage:t.registerMessage}}return Object.defineProperty(t.prototype,"url",{get:function(){return this.opts.url},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e){this.listeners.has(t)||this.listeners.set(t,new Set);var r=this.listeners.get(t);return r.add(e),function(){return r.delete(e)}},t.prototype.emit=function(t,e){var r=this.listeners.get(t);r&&r.forEach((function(t){try{t(e)}catch(t){}}))},t.prototype.connect=function(){try{this.ws=new WebSocket(this.opts.url),this.setupEventListeners()}catch(t){this.emit("error",{message:"WebSocket create failed"})}},t.prototype.setupEventListeners=function(){var t=this;this.ws&&(this.ws.onopen=function(){t.reconnectAttempts=0,t.opts.registerMessage&&t.send(t.opts.registerMessage),t.startHeartbeat(),t.emit("connected",!0)},this.ws.onmessage=function(e){try{var r=JSON.parse(e.data);t.emit("message",r)}catch(e){t.emit("error",{message:"Message parse failed"})}},this.ws.onclose=function(){t.stopHeartbeat(),t.emit("connected",!1),t.emit("closed",void 0),t.reconnect()},this.ws.onerror=function(){t.emit("error",{message:"WebSocket error"})})},t.prototype.send=function(t){if(this.ws&&1===this.ws.readyState)try{this.ws.send(JSON.stringify(t))}catch(t){}},t.prototype.startHeartbeat=function(){var t=this;this.stopHeartbeat(),this.heartbeatTimer=setInterval((function(){t.send({type:"ping"})}),this.opts.heartbeatInterval)},t.prototype.stopHeartbeat=function(){null!=this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)},t.prototype.reconnect=function(){var t=this;this.reconnectAttempts<this.opts.reconnectAttemptsLimit&&(this.reconnectAttempts++,setTimeout((function(){t.connect()}),this.opts.reconnectInterval))},t.prototype.disconnect=function(){if(this.stopHeartbeat(),this.ws)try{this.ws.close()}catch(t){}this.ws=null},Object.defineProperty(t.prototype,"isConnected",{get:function(){return!!this.ws&&1===this.ws.readyState},enumerable:!1,configurable:!0}),t}(),Te=function(){function t(){this.initialized=!1,this.manager=null}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.init=function(t){return c(this,void 0,void 0,(function(){return f(this,(function(e){return this.initialized||(this.manager=new De(t),this.manager.connect(),this.initialized=!0),[2]}))}))},t.prototype.destroy=function(){this.manager&&this.manager.disconnect(),this.manager=null,this.initialized=!1},t.prototype.getManager=function(){return this.manager},t}().getInstance(),Ne=new(function(){function t(){this.listeners=new Map}return t.prototype.on=function(t,e){this.listeners.has(t)||this.listeners.set(t,new Set);var r=this.listeners.get(t);return r.add(e),function(){return r.delete(e)}},t.prototype.off=function(t,e){var r=this.listeners.get(t);r&&r.delete(e)},t.prototype.emit=function(t,e){var r=this.listeners.get(t);r&&r.forEach((function(t){try{t(e)}catch(t){}}))},t}()),Re=function(t){return void 0===t&&(t="websocket"),e(t,{state:function(){return{isConnected:!1,wsManager:null,messages:[],connectionError:null}},getters:{connectionStatus:function(t){return t.isConnected?"已连接":"未连接"},lastMessage:function(t){return t.messages[t.messages.length-1]||null}},actions:{connect:function(t){var e;return c(this,void 0,void 0,(function(){return f(this,(function(r){return(null===(e=this.wsManager)||void 0===e?void 0:e.isConnected)||(this.wsManager=new De(t),this.setupEventListeners(),this.wsManager.connect()),[2]}))}))},setupEventListeners:function(){var t=this;this.wsManager&&(this.wsManager.on("connected",(function(e){t.isConnected=e,e&&(t.connectionError=null),Ne.emit("websocket-connected",e)})),this.wsManager.on("message",(function(e){t.addMessage(e),Ne.emit("websocket-message",e)})),this.wsManager.on("error",(function(e){t.connectionError=(null==e?void 0:e.message)||"WebSocket error",Ne.emit("websocket-error",{message:t.connectionError})})),this.wsManager.on("closed",(function(){t.isConnected=!1,Ne.emit("websocket-closed",void 0)})))},sendMessage:function(t){var e;null===(e=this.wsManager)||void 0===e||e.send(t)},addMessage:function(t){var e=l(l({},t),{timestamp:Date.now(),id:Math.random().toString(36).substring(2,11)});this.messages.push(e),this.messages.length>100&&this.messages.shift()},clearMessages:function(){this.messages=[]},disconnect:function(){var t;null===(t=this.wsManager)||void 0===t||t.disconnect(),this.wsManager=null,this.isConnected=!1,this.connectionError=null},reset:function(){this.disconnect(),this.clearMessages()}}})},Le={UP:r.ROUND_UP,DOWN:r.ROUND_DOWN,CEIL:r.ROUND_CEIL,FLOOR:r.ROUND_FLOOR,HALF_UP:r.ROUND_HALF_UP,HALF_DOWN:r.ROUND_HALF_DOWN,HALF_EVEN:r.ROUND_HALF_EVEN,HALF_CEIL:r.ROUND_HALF_CEIL,HALF_FLOOR:r.ROUND_HALF_FLOOR},Pe={DECIMAL_PLACES:2,CURRENCY_SYMBOL:"¥",THOUSANDS_SEPARATOR:",",DECIMAL_SEPARATOR:".",ROUNDING_MODE:r.ROUND_HALF_UP},Be=function(){function t(t){this.value=t instanceof r?t:new r(String(t))}return t.prototype.add=function(e){var r=this.toDecimalValue(e);return new t(this.value.plus(r))},t.prototype.subtract=function(e){var r=this.toDecimalValue(e);return new t(this.value.minus(r))},t.prototype.multiply=function(e){return new t(this.value.times(String(e)))},t.prototype.divide=function(e){return new t(this.value.dividedBy(String(e)))},t.prototype.mod=function(e){return new t(this.value.modulo(String(e)))},t.prototype.abs=function(){return new t(this.value.abs())},t.prototype.negate=function(){return new t(this.value.negated())},t.prototype.round=function(e,r){return void 0===e&&(e=Pe.DECIMAL_PLACES),void 0===r&&(r=Pe.ROUNDING_MODE),new t(this.value.toDecimalPlaces(e,r))},t.prototype.ceil=function(e){return void 0===e&&(e=Pe.DECIMAL_PLACES),new t(this.value.toDecimalPlaces(e,r.ROUND_UP))},t.prototype.floor=function(e){return void 0===e&&(e=Pe.DECIMAL_PLACES),new t(this.value.toDecimalPlaces(e,r.ROUND_DOWN))},t.prototype.truncate=function(e){return void 0===e&&(e=Pe.DECIMAL_PLACES),new t(this.value.toDecimalPlaces(e,r.ROUND_DOWN))},t.prototype.isGreaterThan=function(t){var e=this.toDecimalValue(t);return this.value.greaterThan(e)},t.prototype.isGreaterThanOrEqualTo=function(t){var e=this.toDecimalValue(t);return this.value.greaterThanOrEqualTo(e)},t.prototype.isLessThan=function(t){var e=this.toDecimalValue(t);return this.value.lessThan(e)},t.prototype.isLessThanOrEqualTo=function(t){var e=this.toDecimalValue(t);return this.value.lessThanOrEqualTo(e)},t.prototype.equals=function(t){var e=this.toDecimalValue(t);return this.value.equals(e)},t.prototype.isZero=function(){return this.value.isZero()},t.prototype.isPositive=function(){return this.value.isPositive()},t.prototype.isNegative=function(){return this.value.isNegative()},t.prototype.toString=function(){return this.value.toString()},t.prototype.toFixedString=function(t,e){return void 0===t&&(t=Pe.DECIMAL_PLACES),void 0===e&&(e=Pe.ROUNDING_MODE),this.value.toDecimalPlaces(t,e).toFixed(t)},t.prototype.toNumber=function(){return this.value.toNumber()},t.prototype.toDecimal=function(){return this.value},t.prototype.format=function(t){var e=t||{},r=e.symbol,n=void 0===r?Pe.CURRENCY_SYMBOL:r,o=e.decimalPlaces,i=void 0===o?Pe.DECIMAL_PLACES:o,a=e.thousandsSeparator,u=void 0===a?Pe.THOUSANDS_SEPARATOR:a,s=e.decimalSeparator,l=void 0===s?Pe.DECIMAL_SEPARATOR:s,c=e.symbolPosition,f=void 0===c?"prefix":c,d=e.roundingMode,p=void 0===d?Pe.ROUNDING_MODE:d,v=h(this.value.toDecimalPlaces(i,p).toFixed(i).split("."),2),y=v[0],g=v[1],m=void 0===g?"":g,w=u?y.replace(/\B(?=(\d{3})+(?!\d))/g,u):y,b=i>0?""+w+l+m:w;return"prefix"===f?""+n+b:""+b+n},t.prototype.allocate=function(e){if(0===e.length)throw new Error("分配比例数组不能为空");if(e.some((function(t){return t<0})))throw new Error("分配比例不能为负数");var n=e.reduce((function(t,e){return t+e}),0);if(0===n)throw new Error("分配比例总和不能为零");for(var o=[],i=this.value,a=0;a<e.length-1;a++){var u=new r(e[a]),s=this.value.times(u).dividedBy(n).toDecimalPlaces(Pe.DECIMAL_PLACES,r.ROUND_DOWN);o.push(new t(s)),i=i.minus(s)}return o.push(new t(i)),o},t.prototype.percentage=function(e,n){return void 0===n&&(n=Pe.DECIMAL_PLACES),new t(this.value.times(String(e)).dividedBy(100).toDecimalPlaces(n,r.ROUND_HALF_UP))},t.prototype.applyDiscount=function(e,n,o){var i;return void 0===n&&(n=!1),void 0===o&&(o=Pe.DECIMAL_PLACES),i=n?new r(100).minus(String(e)).dividedBy(100):new r(String(e)),new t(this.value.times(i).toDecimalPlaces(o,r.ROUND_HALF_UP))},t.prototype.toDecimalValue=function(e){return e instanceof t?e.value:new r(String(e))},t}(),Ie=function(t){var e,r;if(!Array.isArray(t))return console.warn("tree must be an array"),[];if(!t||0===t.length)return[];var n=[];try{for(var o=d(t),i=o.next();!i.done;i=o.next()){var a=i.value;a.children&&a.children.length>0&&Ie(a.children),void 0!==a.uniqueId&&n.push(a.uniqueId)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},_e=function(t,e){if(void 0===e&&(e=[]),!Array.isArray(t))return console.warn("menuTree must be an array"),[];if(!t||0===t.length)return[];for(var r=0;r<t.length;r++){var n=t[r];n.children&&1===n.children.length&&delete n.children,n.id=r,n.parentId=e.length?e[e.length-1]:null,n.pathList=p(e,[n.id]),n.uniqueId=n.pathList.length>1?n.pathList.join("-"):n.pathList[0],n.children&&n.children.length>0&&_e(n.children,n.pathList)}return t},Ue=function(t,e){if(void 0===e&&(e=[]),!Array.isArray(t))return console.warn("tree must be an array"),[];if(!t||0===t.length)return[];for(var r=0;r<t.length;r++){var n=t[r];n.id=r,n.parentId=e.length?e[e.length-1]:null,n.pathList=p(e,[n.id]),n.children&&n.children.length>0&&Ue(n.children,n.pathList)}return t},Fe=function(t,e){if(Array.isArray(t)){if(t&&0!==t.length){var r=t.find((function(t){return t.uniqueId===e}));if(r)return r;var n=t.filter((function(t){return t.children})).map((function(t){return t.children})).flat(1);return Fe(n,e)}}else console.warn("menuTree must be an array")},je=function(t,e,r){var n,o;if(!Array.isArray(t))return console.warn("menuTree must be an array"),[];if(!t||0===t.length)return[];try{for(var i=d(t),a=i.next();!a.done;a=i.next()){var u=a.value,s=u.children&&u.children.length>0;u.uniqueId===e&&"[object Object]"===Object.prototype.toString.call(r)&&Object.assign(u,r),s&&u.children&&je(u.children,e,r)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return t},ke=function(t,e,r,n){var o,i,a,u,s,l,c,f,h;if(!Array.isArray(t))return console.warn("data must be an array"),[];var p=e||"id",v=r||"parentId",y=n||"children",g={},m={},w=[];try{for(var b=d(t),S=b.next();!S.done;S=b.next()){var A=S.value,E=String(null!==(c=A[v])&&void 0!==c?c:""),M=String(null!==(f=A[p])&&void 0!==f?f:"");null==g[E]&&(g[E]=[]),m[M]=A,g[E].push(A)}}catch(t){o={error:t}}finally{try{S&&!S.done&&(i=b.return)&&i.call(b)}finally{if(o)throw o.error}}try{for(var O=d(t),C=O.next();!C.done;C=O.next()){A=C.value;null==m[E=String(null!==(h=A[v])&&void 0!==h?h:"")]&&w.push(A)}}catch(t){a={error:t}}finally{try{C&&!C.done&&(u=O.return)&&u.call(O)}finally{if(a)throw a.error}}try{for(var x=d(w),D=x.next();!D.done;D=x.next()){T(D.value)}}catch(t){s={error:t}}finally{try{D&&!D.done&&(l=x.return)&&l.call(x)}finally{if(s)throw s.error}}function T(t){var e,r,n,o=String(null!==(n=t[p])&&void 0!==n?n:"");null!==g[o]&&(t[y]=g[o]);var i=t[y];if(i&&Array.isArray(i))try{for(var a=d(i),u=a.next();!u.done;u=a.next()){T(u.value)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}return w},qe={},He={},ze=null!==(Ce=n[86])&&void 0!==Ce?Ce:{},We=[];qe[""]="全部",Object.keys(ze).forEach((function(t){var e=ze[t];We.push({value:t,label:e}),qe[t]=e,He[e]={code:t},He[e]["全部"]={code:""}})),We.forEach((function(t){var e,r=t.value,o=t.label,i=[],a=null!==(e=n[r])&&void 0!==e?e:{};Object.keys(a).forEach((function(t){i.push({value:t,label:a[t]}),qe[t]=a[t];var e=He[o];e[a[t]]={code:t},e[a[t]]["全部"]={code:""}})),i.length&&(t.children=i)})),xe=o(We),We.forEach((function(t){var e=t.children,r=t.label;e&&e.forEach((function(t){var e,o=t.value,i=t.label,a=[],u=null!==(e=n[o])&&void 0!==e?e:{};Object.keys(u).forEach((function(t){a.push({value:t,label:u[t]}),qe[t]=u[t];var e=He[r],n=null==e?void 0:e[i];n&&(n[u[t]]={code:t})})),a.length&&(t.children=a)}))}));var Ge=o(xe);Ge.unshift({value:"",label:"全部"}),Ge.forEach((function(t){var e=t.children;(null==e?void 0:e.length)&&(e.unshift({value:"",label:"全部"}),e.forEach((function(t){var e=t.children;(null==e?void 0:e.length)&&e.unshift({value:"",label:"全部"})})))}));var Ye=o(We);function $e(t,e,r){var n,o,i,a="";if(t&&He[t]){var u=He[t];if(a=null!==(n=u.code)&&void 0!==n?n:"",e&&u[e]){var s=u[e];if(a=a+("全部"===e?"":", ")+(null!==(o=s.code)&&void 0!==o?o:""),r&&s[r])a=a+("全部"===r?"":", ")+(null!==(i=s[r].code)&&void 0!==i?i:"")}}return a}function Je(t){if(!t)return null;var e=t.indexOf("#");return-1!==e?t.substring(e+1):t}function Ve(t){if(!t)return null;var e=t.indexOf("#");if(-1!==e){var r=t.substring(e+1);return r.startsWith("/saas/")?null:r}return null}function Ze(t){var e={byUrl:{},byResourceCode:{},byRoutePath:{},routeToApis:{}};return function t(e,r,n){var o,i,a;void 0===n&&(n=null);try{for(var u=d(e),s=u.next();!s.done;s=u.next()){var l=s.value,c=null===(a=l.configJson)||void 0===a?void 0:a.fieldCatalog,f=Ve(l.url),h=Je(l.url),p=n;3===l.resourceType&&3===l.level&&f&&(p=f,c&&Object.keys(c).length>0&&(r.byRoutePath[f]=c),r.routeToApis[f]||(r.routeToApis[f]=[])),3===l.resourceType&&l.level>=4&&c&&Object.keys(c).length>0&&(r.byResourceCode[l.resourceCode]=c,h&&(r.byUrl[h]=c),p&&r.routeToApis[p]&&r.routeToApis[p].push(l.resourceCode)),l.children&&l.children.length>0&&t(l.children,r,p)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}(t,e),e}function Ke(t,e){var r,n,o={},i=t.byRoutePath[e];i&&Object.assign(o,i);var a=t.routeToApis[e]||[];try{for(var u=d(a),s=u.next();!s.done;s=u.next()){var l=s.value,c=t.byResourceCode[l];c&&Object.assign(o,c)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return o}function Qe(t){var e,r,n={};try{for(var o=d(Object.entries(t)),i=o.next();!i.done;i=o.next()){var a=h(i.value,2),u=(a[0],a[1]);u.allowedField&&(n[u.allowedField]=u)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function Xe(t,e){var r=t.replace(/[^\d.]/g,""),n=r.split(".");n.length>2&&(r=n[0]+"."+n.slice(1).join(""));var o=r.split(".");return 2===o.length&&o[1].length>e&&(r=o[0]+"."+o[1].slice(0,e)),r}function tr(t){return t.replace(/[^\d]/g,"")}function er(t,e){var r=t.startsWith("-"),n=t.replace(/[^\d.]/g,""),o=n.split(".");o.length>2&&(n=o[0]+"."+o.slice(1).join(""));var i=n.split(".");return 2===i.length&&i[1].length>e&&(n=i[0]+"."+i[1].slice(0,e)),r&&n&&(n="-"+n),n}Ye.unshift({value:"",label:"全部"}),Ye.forEach((function(t){var e=t.children;(null==e?void 0:e.length)&&(e.unshift({value:"",label:"全部"}),e.forEach((function(t){var e=t.children;(null==e?void 0:e.length)&&e.unshift({value:"",label:"全部"})})))}));var rr=i();function nr(t){return a(t)}function or(t){return a(t)}var ir={maxFileSize:524288e3,maxTotalSize:5368709120,allowedTypes:[],maxFilesCount:100,checkNetwork:!0,checkQuota:!1};function ar(t,e){if(void 0===e&&(e=ir.maxFileSize),t.size>e){var r=Math.round(e/1024/1024),n=Math.round(t.size/1024/1024);return{valid:!1,code:"FILE_SIZE_EXCEEDED",error:'文件 "'+t.name+'" 大小 '+n+"MB 超过限制 "+r+"MB"}}return{valid:!0}}function ur(t,e){void 0===e&&(e=ir.maxTotalSize);var r=t.reduce((function(t,e){return t+e.size}),0);if(r>e){var n=(e/1024/1024/1024).toFixed(2);return{valid:!1,code:"TOTAL_SIZE_EXCEEDED",error:"总文件大小 "+(r/1024/1024/1024).toFixed(2)+"GB 超过限制 "+n+"GB"}}return{valid:!0}}function sr(t,e){var r;if(void 0===e&&(e=[]),0===e.length)return{valid:!0};var n=t.type.toLowerCase(),o=null===(r=t.name.split(".").pop())||void 0===r?void 0:r.toLowerCase();return e.some((function(t){return t.toLowerCase()===n||t.toLowerCase()==="."+o||t.toLowerCase()===o}))?{valid:!0}:{valid:!1,code:"FILE_TYPE_NOT_ALLOWED",error:'文件 "'+t.name+'" 类型不支持。允许的类型: '+e.join(", ")}}function lr(t,e,r){void 0===r&&(r=ir.maxFilesCount);var n=t+e;return n>r?{valid:!1,code:"FILES_COUNT_EXCEEDED",error:"文件数量超过限制(当前 "+t+" + 新增 "+e+" = "+n+",最大 "+r+")"}:{valid:!0}}function cr(){var t;if(!navigator.onLine)return{valid:!1,code:"NETWORK_OFFLINE",error:"网络连接已断开,请检查网络后重试"};var e=navigator,r=e.connection||e.mozConnection||e.webkitConnection;if(r){var n=null!==(t=r.effectiveType)&&void 0!==t?t:"";if(["slow-2g","2g"].includes(n))return{valid:!0,code:"NETWORK_SLOW",error:"当前网络速度较慢,上传可能需要较长时间"}}return{valid:!0}}function fr(t){return c(this,void 0,void 0,(function(){var e,r,n,o;return f(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,new Promise((function(t){return setTimeout(t,100)}))];case 1:return i.sent(),t>(e={used:1073741824,total:10737418240,available:9663676416}).available?(r=(t/1024/1024/1024).toFixed(2),n=(e.available/1024/1024/1024).toFixed(2),[2,{valid:!1,code:"QUOTA_EXCEEDED",error:"存储空间不足。需要 "+r+"GB,剩余 "+n+"GB"}]):[2,{valid:!0}];case 2:return o=i.sent(),console.error("检查配额失败:",o),[2,{valid:!0,code:"QUOTA_CHECK_FAILED",error:"无法检查存储配额,将继续上传"}];case 3:return[2]}}))}))}function dr(t,e,r){return void 0===e&&(e=[]),void 0===r&&(r={}),c(this,void 0,void 0,(function(){var n,o,i,a,u,s,c,h,v,y,g,m,w,b;return f(this,(function(f){switch(f.label){case 0:if(n=l(l({},ir),r),o=[],!(i=lr(e.length,t.length,n.maxFilesCount)).valid)return[2,[i]];try{for(a=d(t),u=a.next();!u.done;u=a.next())s=u.value,(c=ar(s,n.maxFileSize)).valid?(h=sr(s,n.allowedTypes)).valid||o.push(h):o.push(c)}catch(t){w={error:t}}finally{try{u&&!u.done&&(b=a.return)&&b.call(a)}finally{if(w)throw w.error}}if(o.length>0)return[2,o];if(v=p(e,t),!(y=ur(v,n.maxTotalSize)).valid)return[2,[y]];if(n.checkNetwork){if(!(g=cr()).valid)return[2,[g]];"NETWORK_SLOW"===g.code&&o.push(g)}return n.checkQuota?[4,fr(v.reduce((function(t,e){return t+e.size}),0))]:[3,2];case 1:if(!(m=f.sent()).valid)return[2,[m]];f.label=2;case 2:return 0===o.length&&o.push({valid:!0}),[2,o]}}))}))}function hr(t){if(0===t)return"0 B";var e=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,e)).toFixed(2))+" "+["B","KB","MB","GB","TB"][e]}function pr(t){var e=t.filter((function(t){return!t.valid||"NETWORK_SLOW"===t.code}));return 0===e.length?"":e.map((function(t){return t.error})).join("\n")}var vr=function(){function t(t,e){void 0===t&&(t=10),void 0===e&&(e=3),this.speedPoints=[],this.startTime=0,this.totalBytes=0,this.windowSize=t,this.minPoints=e}return t.prototype.start=function(t){this.startTime=Date.now(),this.totalBytes=t,this.speedPoints=[],this.addPoint(0)},t.prototype.addPoint=function(t){var e=Date.now();this.speedPoints.push({timestamp:e,uploadedBytes:t});var r=1e3*this.windowSize;this.speedPoints=this.speedPoints.filter((function(t){return e-t.timestamp<=r}))},t.prototype.getCurrentSpeed=function(){if(this.speedPoints.length<this.minPoints)return 0;var t=this.speedPoints[0],e=this.speedPoints[this.speedPoints.length-1],r=(e.timestamp-t.timestamp)/1e3,n=e.uploadedBytes-t.uploadedBytes;return 0===r?0:n/r},t.prototype.getAverageSpeed=function(){if(0===this.startTime||0===this.speedPoints.length)return 0;var t=(Date.now()-this.startTime)/1e3,e=this.speedPoints[this.speedPoints.length-1].uploadedBytes;return 0===t?0:e/t},t.prototype.getRemainingTime=function(t){var e=this.getCurrentSpeed();return 0===e?-1:(this.totalBytes-t)/e},t.formatSpeed=function(t){if(0===t)return"0 B/s";var e=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,e)).toFixed(2))+" "+["B/s","KB/s","MB/s","GB/s"][e]},t.formatRemainingTime=function(t){if(t<0||!isFinite(t))return"计算中...";if(t<60)return Math.ceil(t)+" 秒";var e=Math.floor(t/60);if(e<60)return e+" 分钟";var r=Math.floor(e/60),n=e%60;if(r<24)return n>0?r+" 小时 "+n+" 分钟":r+" 小时";var o=Math.floor(r/24),i=r%24;return i>0?o+" 天 "+i+" 小时":o+" 天"},t.prototype.getProgress=function(t){return 0===this.totalBytes?0:Math.min(100,t/this.totalBytes*100)},t.prototype.reset=function(){this.speedPoints=[],this.startTime=0,this.totalBytes=0},t}(),yr=function(){function t(){this.calculators=new Map}return t.prototype.getCalculator=function(t){return this.calculators.has(t)||this.calculators.set(t,new vr),this.calculators.get(t)},t.prototype.removeCalculator=function(t){this.calculators.delete(t)},t.prototype.clear=function(){this.calculators.clear()},t.prototype.getTotalSpeed=function(){var t,e,r=0;try{for(var n=d(this.calculators.values()),o=n.next();!o.done;o=n.next()){r+=o.value.getCurrentSpeed()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},t}(),gr=new yr;export{Ut as ApiBuilder,qe as CodeToText,kt as InsertBuilder,Be as Money,jt as QueryBuilder,Le as RoundingMode,yr as SpeedCalculatorManager,He as TextToCode,qt as UpdateBuilder,vr as UploadSpeedCalculator,De as WebsocketManager,be as addClass,V as addDays,je as appendFieldByUniqueId,U as base64ToBlob,F as base64ToFile,lt as blobToDataURL,Ue as buildHierarchyTree,x as buildUUID,at as calcFileSize,et as ceil,cr as checkNetworkStatus,fr as checkStorageQuota,w as clearLoginData,G as compatibleDate,ct as compressImg,ot as computeMoney,L as convertBase64UrlToBlob,X as convertCurrency,$e as convertTextToCode,Me as copyTextToClipboard,Re as createWebSocketStore,de as darken,st as dataURLtoBlob,dt as deepEqual,y as delay,_e as deleteChildren,g as deviceDetection,Ne as emitter,or as encryptPassword,Ie as extractPathList,ut as fileSizeFormat,_ as filterRepeat,pt as findNodePath,rt as floor,xt as formatBank,Z as formatBytes,it as formatCentsToYuan,Mt as formatEmptyValue,hr as formatFileSize,tt as formatFloat,nt as formatMoney,Ot as formatPhone,Ct as formatPhoneHide,$ as formatTime,R as formateTimestamp,J as fromNow,ft as genExportByBlob,Dt as generateEnglishLetters,C as getCookie,E as getDeviceType,P as getEnvironment,k as getFileData,M as getFromType,B as getIsComWx,I as getIsDevelopment,pe as getKeyList,Ke as getMergedFieldCatalogByRoute,Fe as getNodeByUniqueId,Rt as getQueryMap,b as getQueryString,S as getQueryVariable,Oe as getSvgInfo,D as getTicket,z as getToken,pr as getValidationErrorMessage,A as getWecomToken,le as handleFlatStr,ke as handleTree,we as hasClass,ce as hexToRgb,Lt as hideTextAtIndex,It as http,Pt as httpEnum,Tt as humpTurnDashed,ge as intersection,ye as isAllEmpty,bt as isEmail,m as isEmpty,vt as isExternal,j as isImage,ve as isIncludeAllChildren,gt as isMobile,mt as isMobileSimple,At as isPhone,St as isQQ,wt as isTelephone,Et as isUrl,he as lighten,Xe as limitDecimalInput,tr as limitIntegerInput,er as limitNumberInput,rr as mittBus,Y as newDate,Qe as normalizeFieldCatalog,Ee as openLink,Ze as parseMenuFieldCatalog,xe as provinceAndCityData,Ge as provinceAndCityDataPlus,O as randomString,oe as recordLogMiddleware,se as recordLogMiddlewareFastify,ie as recordLogMiddlewareHono,ae as recordLogMiddlewareKoa,ue as recordLogMiddlewareMidway,We as regionData,Ye as regionDataPlus,Se as removeClass,N as removeTicket,W as removeToken,fe as rgbToHex,Zt as sendLog,T as setTicket,nr as sm3,gr as speedCalculatorManager,Nt as subBefore,me as sum,Q as toThousands,Ae as toggleClass,yt as trimVal,H as uuid,ar as validateFileSize,sr as validateFileType,dr as validateFilesBeforeUpload,lr as validateFilesCount,ur as validateTotalSize,q as validateTwoDecimal,Te as websocketService};