@gx-design-vue/pro-utils 0.2.0-beta.80 → 0.2.0-beta.81

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,13 +1,13 @@
1
1
  /*!
2
2
  * Gx Design Pro
3
- * Version: 0.2.0-beta.79
3
+ * Version: 0.2.0-beta.80
4
4
  * Author: gx12358
5
5
  * Copyright (C) 2024 gx12358
6
6
  * License: MIT License
7
7
  * Description: Gx Design Pro Utils
8
- * Date Created: 2025-08-17
8
+ * Date Created: 2025-11-27
9
9
  * Homepage:
10
10
  * Contact: gx12358@gmail.com
11
11
  */
12
- (function(l,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(l=typeof globalThis<"u"?globalThis:l||self,d(l.GPorUtils={},l.vue))})(this,(function(l,d){"use strict";class de{constructor(){this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}_utf8_encode(t){t=t.replace(/\r\n/g,`
13
- `);let n="";for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);i<128?n+=String.fromCharCode(i):i>127&&i<2048?(n+=String.fromCharCode(i>>6|192),n+=String.fromCharCode(i&63|128)):(n+=String.fromCharCode(i>>12|224),n+=String.fromCharCode(i>>6&63|128),n+=String.fromCharCode(i&63|128))}return n}_utf8_decode(t){let n="",r=0,i=0,o=0,c=0;for(;r<t.length;)i=t.charCodeAt(r),i<128?(n+=String.fromCharCode(i),r++):i>191&&i<224?(o=t.charCodeAt(r+1),n+=String.fromCharCode((i&31)<<6|o&63),r+=2):(o=t.charCodeAt(r+1),c=t.charCodeAt(r+2),n+=String.fromCharCode((i&15)<<12|(o&63)<<6|c&63),r+=3);return n}encode(t){let n="",r,i,o,c,f,s,u,a=0;for(t=this._utf8_encode(t);a<t.length;)r=t.charCodeAt(a++),i=t.charCodeAt(a++),o=t.charCodeAt(a++),c=r>>2,f=(r&3)<<4|i>>4,s=(i&15)<<2|o>>6,u=o&63,Number.isNaN(i)?s=u=64:Number.isNaN(o)&&(u=64),n=n+this._keyStr.charAt(c)+this._keyStr.charAt(f)+this._keyStr.charAt(s)+this._keyStr.charAt(u);return n}decode(t){let n="",r,i,o,c,f,s,u,a=0;for(t=t.replace(/[^A-Z0-9+/=]/gi,"");a<t.length;)c=this._keyStr.indexOf(t.charAt(a++)),f=this._keyStr.indexOf(t.charAt(a++)),s=this._keyStr.indexOf(t.charAt(a++)),u=this._keyStr.indexOf(t.charAt(a++)),r=c<<2|f>>4,i=(f&15)<<4|s>>2,o=(s&3)<<6|u,n=n+String.fromCharCode(r),s!==64&&(n=n+String.fromCharCode(i)),u!==64&&(n=n+String.fromCharCode(o));return n=this._utf8_decode(n),n}}function b(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function p(e){return typeof e=="boolean"}function g(e){return typeof e=="number"}function y(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function m(e){return e!==null&&b(e,"Object")}function $(e){return typeof e=="string"||e instanceof String}function ye(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function he(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function ge(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!_())}function _(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function W(...e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r){if($(r))t.push(r);else if(y(r))for(let i=0;i<r.length;i++){const o=W(r[i]);o&&t.push(o)}else if(m(r))for(const i in r)r[i]&&t.push(i)}}return t.filter(n=>n).join(" ")}function me(e,t){if(typeof t!="string"&&!Array.isArray(t))return;const n=Array.isArray(t)?t:t.split(":");let r=e;for(let i=0;i<n.length;i++)if(r&&Object.prototype.hasOwnProperty.call(r,n[i]))r=r[n[i]];else return;return r}const S=typeof window>"u";function pe(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase())}const B=function(e,t){if(S||!e||!t)return"";t=pe(t),t==="float"&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const r=document?.defaultView?.getComputedStyle(e,"");return r?r[t]:""}catch{return e.style[t]}},z=(e,t)=>S?void 0:(t==null?B(e,"overflow"):t?B(e,"overflow-y"):B(e,"overflow-x")).match(/(scroll|auto|overlay)/),we=(e,t)=>{if(S)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(z(n,t))return n;n=n.parentNode}return n},Ae=(e,t)=>{if(S||!e||!t)return!1;const n=e.getBoundingClientRect();let r;return[window,document,document.documentElement,null,void 0].includes(t)?r={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:r=t.getBoundingClientRect(),n.top<r.bottom&&n.bottom>r.top&&n.right>r.left&&n.left<r.right};function F(e){return e!=null&&e===e.window}function q(e,t){if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let r=0;return F(e)?r=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?r=e.documentElement[n]:e&&(r=e[n]),e&&!F(e)&&typeof r!="number"&&(r=(e.ownerDocument||e).documentElement?.[n]),r}function H(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function x(e){return e==null||typeof e!="object"&&typeof e!="function"}function J(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v(e){return w(e)}function w(e,t=new Map){if(x(e))return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const n=Array.from({length:e.length});t.set(e,n);for(let r=0;r<e.length;r++)n[r]=w(e[r],t);return Object.prototype.hasOwnProperty.call(e,"index")&&(n.index=e.index),Object.prototype.hasOwnProperty.call(e,"input")&&(n.input=e.input),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const n=new RegExp(e.source,e.flags);return n.lastIndex=e.lastIndex,n}if(e instanceof Map){const n=new Map;t.set(e,n);for(const[r,i]of e)n.set(r,w(i,t));return n}if(e instanceof Set){const n=new Set;t.set(e,n);for(const r of e)n.add(w(r,t));return n}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(J(e)){const n=new(Object.getPrototypeOf(e)).constructor(e.length);t.set(e,n);for(let r=0;r<e.length;r++)n[r]=w(e[r],t);return n}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const n=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return t.set(e,n),A(n,e,t),n}if(typeof File<"u"&&e instanceof File){const n=new File([e],e.name,{type:e.type});return t.set(e,n),A(n,e,t),n}if(e instanceof Blob){const n=new Blob([e],{type:e.type});return t.set(e,n),A(n,e,t),n}if(e instanceof Error){const n=new e.constructor;return t.set(e,n),n.message=e.message,n.name=e.name,n.stack=e.stack,n.cause=e.cause,A(n,e,t),n}if(typeof e=="object"&&e!==null){const n={};return t.set(e,n),A(n,e,t),n}return e}function A(e,t,n){const r=[...Object.keys(t),...H(t)];for(let i=0;i<r.length;i++){const o=r[i],c=Object.getOwnPropertyDescriptor(e,o);(c==null||c.writable)&&(e[o]=w(t[o],n))}}const O={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3","ogg","wav","aac","m4a","webm"],imageType:["jpeg","jpg","png","gif","bmp","tiff","tif","webp","heic","heif","svg","ico","raw","cr2","nef","arw","dng","psd","eps"],videoType:["mp4","avi","mov","wmv","mkv","flv","webm","mpeg","mpg","3gp","ogv","mxf","vob","rm","rmvb","ts","mts","m2ts","divx","xvid"],audioType:["mp3","wav","aac","flac","ogg","wma","m4a","alac","opus","amr","aiff","au","pcm","ape"]},Z=e=>e!=null&&e!=="";let X=e=>setTimeout(e,16),G=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(X=e=>window.requestAnimationFrame(e),G=e=>window.cancelAnimationFrame(e));let Y=0;const P=new Map;function K(e){P.delete(e)}function U(e,t=1){Y+=1;const n=Y;function r(i){if(i===0)K(n),e();else{const o=X(()=>{r(i-1)});P.set(n,o)}}return r(t),n}U.cancel=e=>{const t=P.get(e);return K(t),G(t)};function Se(e){return e!=null}function D(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}const ve=({suffixCls:e,customizePrefixCls:t,isPor:n,className:r})=>{const i=r||(n?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},Oe=(e,t)=>e?y(e)?e.join("-"):e.toString():`${t||0}`;function Ce(e,{align:t,showIndex:n}){const r=v(e);if(n&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];r.unshift({title:"序号",align:t,fixed:i.fixed,width:60,uuid:j().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else r.filter(i=>i.dataIndex!=="sortIndex");return r}function Te(e,...t){return typeof e=="function"?e(...t):e}function Ue(e){return JSON.parse(JSON.stringify(e))}function Ie(e,t){if(m(e)){const{pageSize:n=10,total:r=0}=e;let{current:i=1}=e;return r-t<=n*(i-1)&&(i=i-1),i===0?1:i}return 1}function Ne(e=[],t,n="children"){function r(i,o){return o.map((c,f)=>{const s=`${i}-${f+1}`;return c[n]&&(c[n]=r(s,c[n])),c.sortIndex=s,c})}return v(e).map((i,o)=>{const c=m(t)&&t.current||1,f=m(t)&&t.pageSize||10,s=`${(c-1)*f+(o+1)}`;return i[n]&&(i[n]=r(`${s}`,i[n])),i.sortIndex=s,i})}function Re(e,t){return y(e)?e?.filter((n,r)=>{if(g(t))return r<=t-1;if(y(t)&&t.length===2){const i=t[0]-1,o=t[1]?t[1]-1:e.length-1;return r<=o&&r>=i}else if(y(t)&&t.length===1){const i=t[0]-1,o=e.length-1;return r<=o&&r>=i}return!0}):[]}function Q(e,t,n,r=0){const i=g(r)&&(r===0||r===1)?r:0,o=e[n],c=t[n];let f=0;return o<c?f=i===0?-1:0:o>c&&(f=i===0?0:-1),f}function k(e,t,n,r=0){const i=g(r)&&(r===0||r===1)?r:0,o=new Date(e[n]),c=new Date(t[n]);let f=0;return o<c?f=i===0?-1:0:o>c&&(f=i===0?0:-1),f}function Ee(e,t,n=0){return e.sort((r,i)=>Q(r,i,t,n))}function Be(e,t,n=0){return e.sort((r,i)=>k(r,i,t,n))}function Fe(e){let t=v(e);const n=new Set(t);return t=Array.from(n),t}function Pe(e,t){const n=["null","undefined"];let r=!0;return e===0?r=!0:n.includes(e)?r=!1:e||(r=!1),r?{value:e,success:r}:{value:t===""?t:t||"-",success:r}}function De(e){let t="";if(e>-1){const n=Math.floor(e/3600),r=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));n<10?t="0"+n+":":t=n+":",r<10&&(t+="0"),t+=r+":",i<10&&(t+="0"),t+=i}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function j(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const r=e,i=[],o=n||r.length;let c,f;if(t)for(c=0;c<t;c+=1)i[c]=r[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",c=0;c<36;c+=1)i[c]||(f=Math.random()*16,i[c]=r[c===19?f&&3||8:f]);return i.join("")},uuidFast(){const t=e,n=Array.from({length:36});let r=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?n[o]="-":o===14?n[o]="4":(r<=2&&(r=33554432+Math.random()*16777216||0),i=r&&15,r=r>4,n[o]=t[o===19?i&&3||8:i]);return n.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16||0;return(t==="x"?n:n&&3||8).toString(16)})}}}function ee(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=t||"children";return Math.max(...e.map(r=>{const i=r[n];return 1+(i?ee(i,n):0)}))}function te(e,t="children"){let n=[];return e.forEach(r=>{n.push(r),y(r[t])&&r[t].length>0&&(n=n.concat(te(r[t],t)))}),n}function Le(e,t){if(!e||!y(e)||e?.length===0)return[];const{id:n="id",parentId:r="parentId",children:i="children",emptyChildren:o=!0}=t||{},c=t?.rootId??0,f=v(e);return f.map(s=>(!o&&s[i]&&s[i]?.length===0&&delete s[i],s)).filter(s=>{const u=f.filter(a=>s[n]===a[r]);return u.length>0?s[i]=u:o&&(s[i]=[]),c===!1?!0:s[r]===c})}function ne(e,t){return e.map(n=>{const r={...n};return r.children&&(r.children=ne(r.children,t)),t(r)||r.children&&r.children.length>0?r:null}).filter(Boolean)}function Ve(e,t,n){const{value:r,children:i}=n||{value:"value",children:"children"};let o=[];function c(f,s){if(f[r]===t)return o=[...s,f[r]],!0;if(f[i]){for(const u of f[i])if(c(u,[...s,f[r]]))return!0}return!1}for(const f of e)if(c(f,[]))break;return o}function Me(e){return e&&y(e)?e[e.length-1]:null}function re(e,t,n){const r=n?.value||"id",i=n?.children||"children";for(const o of e){if(o[r]===t)return o;const c=o[i];if(c){const f=re(c,t,n);if(f)return f}}}function be(e){return URL.createObjectURL(e)}function $e(e){return new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)})}function _e(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let i=r.length;const o=new Uint8Array(i);for(;i--;)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}function We(e,t){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],i=atob(n[1]);let o=i.length;const c=new Uint8Array(o);for(;o--;)c[o]=i.charCodeAt(o);return new File([c],t,{type:r})}function ze(e,t,n){return new window.File([e],t,{type:n})}function ie(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function I(e){if(!e||typeof e!="string")return"";const t=ie(e),n=t.lastIndexOf(".");return n>0&&`${t?.substring?.(n)?.split("?")?.[0]}`?.split(".")?.[1]||""}function C(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";return N(e)?e.includes("data:image/")?n="png":e.includes("data:video/")?n="mp4":e.includes("data:audio/")&&(n="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?n="png":e.includes("video")?n="mp4":e.includes("audio")&&(n="mp3")):n=I(e).toLowerCase(),O.imageType.includes(n)?"1":O.videoType.includes(n)?"3":O.audioType.includes(n)?"2":"4"}function oe(e){const{url:t="",fileType:n="1"}=e||{};let r="",i={play:!1,height:0,size:0,width:0,duration:0};function o(){i={play:!1,height:0,size:0,width:0,duration:0}}return t instanceof File?r=URL.createObjectURL(t):N(t)?r=t:t instanceof Blob?r=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(r=t),new Promise(c=>{let f;if(n==="4"){c(i);return}n==="1"?(f=document.createElement("img"),f.src=r):n==="2"?(f=document.createElement("audio"),f.src=r):n==="3"&&(f=document.createElement("video"),f.src=r),n==="1"?f.onload=function(){o(),i.play=!0,i.width=f.width||0,i.height=f.height||0,c(i),f=null}:f.oncanplay=function(){o(),i.play=!0,i.width=f?.videoWidth||0,i.height=f?.videoHeight||0,i.duration=f?.duration||0,c(i),f=null},f.onerror=function(){o(),c(i),f=null}})}async function qe(e){const{url:t="",currentTime:n,videoSuffix:r="",videoAllowPlay:i=!1}=e;let o="",c=r,f="1",s;return t instanceof File?(o=URL.createObjectURL(t),c=I(t.name),f=C(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),f=C(t)):N(t)?(o=t,f=C(t)):(t.includes("https")||t.includes("http"))&&(o=t,c=I(t),f=C(t)),(c?O.videoAllowType.includes(c.toLowerCase()):!1)?i?L(o,n):(s=await oe({url:o,fileType:f}),s.play?L(o,n):new Promise(a=>{a("")})):new Promise(a=>{a("")})}async function L(e,t=0){return new Promise(n=>{let r=document.createElement("video");r&&(r.controls=!0,r.muted=!0,r.setAttribute("src",e),r.setAttribute("muted",String(!0)),r.setAttribute("crossorigin","anonymous"),r.setAttribute("autoplay",String(!0)),r.addEventListener("loadeddata",async()=>{let i;for(r?.addEventListener("seeked",async()=>{i&&i()});t<(r?.duration||0);){r&&(r.currentTime=t),await new Promise(h=>i=h);const o=document.createElement("canvas"),c=.8,f=o.getContext("2d"),s=r?.videoWidth||0*c,u=r?.videoHeight||0*c,a=0;o.width=r?.videoWidth||0*c,o.height=r?.videoHeight||0*c,r&&f.drawImage(r,0,0,s+a,u+a),r=null,n(s===0||u===0?"":o.toDataURL("image/png",1))}}))})}function N(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function He(e){return typeof e=="string"&&/^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function xe(e,t,n,r=!1){e&&t&&n&&e.addEventListener(t,n,r)}function Je(e,t,n,r=!1){e&&t&&n&&e.removeEventListener(t,n,r)}function Ze(){return/windows|win32/i.test(navigator.userAgent)}function Xe(e){return p(e)?e:!!e}function V(e,t){const n=`^\\d+(?:\\.\\d{0,${e}})?`,r=new RegExp(n),i=t.toString().match(r);if(i){const o=i[0];if(o.includes(".")){const[c,f]=o.split(".");if(/^0*$/.test(f))return c}return o}return t.toString()}function Ge(e,t){const{toChinese:n=!1,fixed:r=2,min:i=1e4}=t||{},o=g(i)?i:1e4,c=g(r)?r:2,f=n?e<o?"":e<1e8?"万":"亿":e<o?"":e<1e8?"w":"亿";if(!g(e))return{str:`${e}`,number:`${e}`};if(e<o)return{str:`${e}`,number:`${e}`};if(c===0){const u=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${u}${f}`,number:u,unit:f}}let s;return e<1e8?(s=V(c,e/1e4),{str:s+f,number:s,unit:f}):(s=V(c,e/1e8),{str:s+f,number:s,unit:f})}function Ye(e,t){let n=0;const r=p(t.removeAfter)?t.removeAfter:!0,i=t.id||"hiddenElement",o={opacity:0,visibility:"hidden",position:"fixed",zIndex:-1,top:0,left:0};let c=document.querySelector(`#${i}`);if(!c){const s=document.createElement("div");s.id=i,document.body.appendChild(s),c=document.querySelector(`#${i}`)}Object.assign(c.style,o);const f=document.createElement(t.createName||"span");return f.innerHTML=e,(t.cssObject||m(t.cssObject))&&Object.assign(f.style,t.cssObject),c.append(f),n=f.getBoundingClientRect()[t.type||"width"],r&&c.removeChild(f),n}function Ke(e){e=g(e)&&!Number.isNaN(e)?e:0;const t=["零","一","二","三","四","五","六","七","八","九"],n=["","十","百","千","万"];e=Number.parseInt(`${e}`);const r=c=>{const f=c.toString().split("").reverse();let s="";for(let u=0;u<f.length;u++)s=(u===0&&f[u]==="0"||u>0&&f[u]==="0"&&f[u-1]==="0"?"":(e<20&&u>0?"":t[f[u]])+(f[u]==="0"?n[0]:n[u]))+s;return s},i=Math.floor(e/1e4);let o=e%1e4;return o.toString().length<4&&(o="0"+o),i?r(i)+"万"+r(o):r(e)}function Qe(e,t){Object.keys(e).forEach(n=>{t(n,e[n])})}function ke(e,t,n,r){const i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function je(e,t={}){const{getContainer:n=()=>window,callback:r,duration:i=450}=t,o=n(),c=q(o,!0),f=Date.now(),s=()=>{const a=Date.now()-f,h=ke(a>i?i:a,c,e,i);F(o)?o.scrollTo(window.pageXOffset,h):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=h:o.scrollTop=h,a<i?U(s):typeof r=="function"&&r()};o&&U(s)}function et(e){let t;const n=i=>()=>{t=null,e(...i)},r=(...i)=>{t==null&&(t=requestAnimationFrame(n(i)))};return r.cancel=()=>cancelAnimationFrame(t),r}const tt=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,nt=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!tt;function R(e,t,n,r){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let i,o,c;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!R(e[o],t[o],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!R(o[1],t.get(o[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(c=Object.keys(e),i=c.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!n?.includes(f)&&!(f==="_owner"&&e.$$typeof)&&!R(e[f],t[f],n,r))return r&&console.log(f),!1}return!0}return e!==e&&t!==t}function rt(e){return/\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const fe=e=>e==null,it=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch(t){return console.error("isUrl error",t),!1}},ot=(...e)=>{const t={},n=e.length;let r,i=0;for(;i<n;i+=1)for(r in e[i])Object.prototype.hasOwnProperty.call(e[i],r)&&(typeof t[r]=="object"&&typeof e[i][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[i][r])?t[r]={...t[r],...e[i][r]}:t[r]=e[i][r]);return t};function T(e,t,n){const r=p(n?.omitNil)?n?.omitNil:!0,i=p(n?.omitEmpty)?n?.omitEmpty:!0,o=Object.keys(t);for(let c=0;c<o.length;c++){const f=o[c],s=t[f],u=e[f];Array.isArray(s)?Array.isArray(u)?s.length===0&&!i?e[f]=s:e[f]=T(u,s,n):e[f]=T([],s,n):D(s)?D(u)?Object.keys(s).length===0&&!i?e[f]=s:e[f]=T(u,s,n):e[f]=T({},s,n):r?(u===void 0||!fe(s))&&(e[f]=s):e[f]=s}return e}let ce=0;const le=(e=21)=>{if(typeof window>"u"||!window.crypto)return(ce+=1).toFixed(0);let t="";const n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t},ft=()=>typeof window>"u"?le():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():le(),ct=e=>{if(e&&e!==!0)return e},lt=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},st=e=>{const t={};return Object.keys(e||{}).forEach(n=>{Array.isArray(e[n])&&e[n]?.length===0||e[n]!==void 0&&(t[n]=e[n])}),t};function ut(e){if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:e.split(":")?.slice(-1)[0]}function se(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function at(e,t){return E(typeof e[t]=="function"?e[t]?.():[])}function E(e=[],t=!0){const n=Array.isArray(e)?e:[e],r=[];return n.forEach(i=>{Array.isArray(i)?r.push(...E(i,t)):i?.type===d.Fragment||i?.type==="template"?r.push(...E(i.children,t)):i&&d.isVNode(i)?t&&!se(i)?r.push(i):t||r.push(i):Z(i)&&r.push(i)}),r}function M({vnode:e,defaultVNode:t},...n){return e===!1?null:typeof e=="function"?e?.(...n):e||t}function ue(e,...t){const{slots:n,key:r="default",render:i,props:o,defaultChildren:c}=e;let f;const s=o[r],u=n?.[r],a=typeof c=="function"?c?.():c;return s===!1?f=!1:s===!0?f=u??a:m(s)&&i?d.isVNode(s)?f=s:f=u:f=s||u,f===!1?!1:i?M({vnode:f,defaultVNode:a},...t):f}function ae(e,...t){const{slots:n,key:r="default",props:i,defaultChildren:o}=e;let c;const f=i[r],s=n?.[r]?.(...t),u=typeof o=="function"?o?.():o;return f===!1?c=!1:f===!0?c=s??u:m(f)?d.isVNode(f)?c=f:c=s:c=f||s,c===!1?!1:M({vnode:c,defaultVNode:u},...t)}function dt(e,...t){const{slots:n,props:r,keys:i,render:o,defaultVNodes:c}=e,f={};return i.forEach((s,u)=>{const a=c?c[u]:null,h=o?ae({slots:n,props:r,key:s,defaultChildren:a},...t):ue({slots:n,props:r,key:s,render:!1,defaultChildren:a},...t);(p(h)||h)&&(f[s]=h)}),f}l.Base64=de,l.arrayRepeat=Fe,l.arraySlice=Re,l.blobToDataURL=ze,l.checkFileType=C,l.classNames=W,l.cloneDeep=v,l.compareArray=Q,l.compareArraySort=Ee,l.compareArrayTimeSort=Be,l.compareTime=k,l.convertValueBoolean=Xe,l.copyProperties=A,l.dataURLtoBlob=_e,l.dataURLtoFile=We,l.deepCopy=Ue,l.deepMerge=T,l.fileTypes=O,l.filterEmpty=E,l.filterTree=ne,l.findSourceByTree=re,l.findValueAndAncestors=Ve,l.forInObject=Qe,l.formatDuration=De,l.formatNumber=V,l.genColumnKey=Oe,l.generateVideoPicture=L,l.getArrayLast=Me,l.getBase64=$e,l.getBlobUrl=be,l.getFileSuffix=I,l.getKeys=ut,l.getLevelData=te,l.getMaxFloor=ee,l.getMediaInfos=oe,l.getPrefixCls=ve,l.getRandomNumber=j,l.getScroll=q,l.getScrollContainer=we,l.getSlot=ue,l.getSlotVNode=ae,l.getSlotsChildren=at,l.getSlotsProps=dt,l.getSortIndex=Ne,l.getSymbols=H,l.getTextWidth=Ye,l.getValueFromObjectByKey=me,l.getVideoCoverPicture=qe,l.getVideoFileUrl=ie,l.handleCurrentPage=Ie,l.handleEmptyField=Pe,l.handleShowIndex=Ce,l.is=b,l.isArray=y,l.isBase64=N,l.isBoolean=p,l.isBrowser=nt,l.isDataURLBase64=He,l.isDeepEqualReact=R,l.isEmptyElement=se,l.isFunction=ye,l.isImg=rt,l.isInContainer=Ae,l.isJSONStr=he,l.isMobile=ge,l.isNil=fe,l.isNotNil=Se,l.isNumber=g,l.isObject=m,l.isPlainObject=D,l.isPrimitive=x,l.isScroll=z,l.isServer=S,l.isString=$,l.isTablet=_,l.isTypedArray=J,l.isUrl=it,l.isValid=Z,l.isWindowsOs=Ze,l.merge=ot,l.nanoid=ft,l.off=Je,l.omitBoolean=ct,l.omitUndefined=lt,l.omitUndefinedAndEmptyArr=st,l.on=xe,l.raf=U,l.runFunction=Te,l.scrollTo=je,l.slotRender=M,l.throttleByAnimationFrame=et,l.toChinesNum=Ke,l.toConvertNumberShow=Ge,l.treeData=Le,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
12
+ (function(s,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(s=typeof globalThis<"u"?globalThis:s||self,d(s.GPorUtils={},s.vue))})(this,(function(s,d){"use strict";class de{constructor(){this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}_utf8_encode(t){t=t.replace(/\r\n/g,`
13
+ `);let r="";for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);i<128?r+=String.fromCharCode(i):i>127&&i<2048?(r+=String.fromCharCode(i>>6|192),r+=String.fromCharCode(i&63|128)):(r+=String.fromCharCode(i>>12|224),r+=String.fromCharCode(i>>6&63|128),r+=String.fromCharCode(i&63|128))}return r}_utf8_decode(t){let r="",n=0,i=0,c=0,o=0;for(;n<t.length;)i=t.charCodeAt(n),i<128?(r+=String.fromCharCode(i),n++):i>191&&i<224?(c=t.charCodeAt(n+1),r+=String.fromCharCode((i&31)<<6|c&63),n+=2):(c=t.charCodeAt(n+1),o=t.charCodeAt(n+2),r+=String.fromCharCode((i&15)<<12|(c&63)<<6|o&63),n+=3);return r}encode(t){let r="",n,i,c,o,f,u,a,l=0;for(t=this._utf8_encode(t);l<t.length;)n=t.charCodeAt(l++),i=t.charCodeAt(l++),c=t.charCodeAt(l++),o=n>>2,f=(n&3)<<4|i>>4,u=(i&15)<<2|c>>6,a=c&63,Number.isNaN(i)?u=a=64:Number.isNaN(c)&&(a=64),r=r+this._keyStr.charAt(o)+this._keyStr.charAt(f)+this._keyStr.charAt(u)+this._keyStr.charAt(a);return r}decode(t){let r="",n,i,c,o,f,u,a,l=0;for(t=t.replace(/[^A-Z0-9+/=]/gi,"");l<t.length;)o=this._keyStr.indexOf(t.charAt(l++)),f=this._keyStr.indexOf(t.charAt(l++)),u=this._keyStr.indexOf(t.charAt(l++)),a=this._keyStr.indexOf(t.charAt(l++)),n=o<<2|f>>4,i=(f&15)<<4|u>>2,c=(u&3)<<6|a,r=r+String.fromCharCode(n),u!==64&&(r=r+String.fromCharCode(i)),a!==64&&(r=r+String.fromCharCode(c));return r=this._utf8_decode(r),r}}function v(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function I(e){return typeof e=="boolean"}function p(e){return typeof e=="number"}function g(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function w(e){return e!==null&&v(e,"Object")}function W(e){return typeof e=="string"||e instanceof String}function ge(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function ye(e){if(typeof e!="string")return!1;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null}catch{return!1}}function he(){const e=navigator.userAgent||navigator.vendor;return!!(/iPhone/.test(e)||/Android/.test(e)&&/Mobile/.test(e)||/Windows Phone/.test(e)||/Mobile/.test(e)&&!V())}function V(){const e=navigator.userAgent||navigator.vendor;return!!(/iPad/.test(e)||/Macintosh/.test(e)&&"ontouchend"in document||/Android/.test(e)&&!/Mobile/.test(e))}function z(...e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(n){if(W(n))t.push(n);else if(g(n))for(let i=0;i<n.length;i++){const c=z(n[i]);c&&t.push(c)}else if(w(n))for(const i in n)n[i]&&t.push(i)}}return t.filter(r=>r).join(" ")}function me(e,t){if(typeof t!="string"&&!Array.isArray(t))return;const r=Array.isArray(t)?t:t.split(":");let n=e;for(let i=0;i<r.length;i++)if(n&&Object.prototype.hasOwnProperty.call(n,r[i]))n=n[r[i]];else return;return n}const O=typeof window>"u";function pe(e){return e.replace(/[-_](.)/g,(t,r)=>r.toUpperCase())}const F=function(e,t){if(O||!e||!t)return"";t=pe(t),t==="float"&&(t="cssFloat");try{const r=e.style[t];if(r)return r;const n=document?.defaultView?.getComputedStyle(e,"");return n?n[t]:""}catch{return e.style[t]}},q=(e,t)=>O?void 0:(t==null?F(e,"overflow"):t?F(e,"overflow-y"):F(e,"overflow-x")).match(/(scroll|auto|overlay)/),we=(e,t)=>{if(O)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(q(r,t))return r;r=r.parentNode}return r},Ae=(e,t)=>{if(O||!e||!t)return!1;const r=e.getBoundingClientRect();let n;return[window,document,document.documentElement,null,void 0].includes(t)?n={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:n=t.getBoundingClientRect(),r.top<n.bottom&&r.bottom>n.top&&r.right>n.left&&r.left<n.right};function P(e){return e!=null&&e===e.window}function H(e,t){if(typeof window>"u")return 0;const r=t?"scrollTop":"scrollLeft";let n=0;return P(e)?n=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?n=e.documentElement[r]:e&&(n=e[r]),e&&!P(e)&&typeof n!="number"&&(n=(e.ownerDocument||e).documentElement?.[r]),n}function x(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Se(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function J(e){return e==null||typeof e!="object"&&typeof e!="function"}function Z(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}const be="[object RegExp]",Oe="[object String]",je="[object Number]",Ue="[object Boolean]",Ie="[object Arguments]",Re="[object Symbol]",Be="[object Date]",Ne="[object Map]",De="[object Set]",Ee="[object Array]",Fe="[object ArrayBuffer]",Pe="[object Object]",Le="[object DataView]",Me="[object Uint8Array]",_e="[object Uint8ClampedArray]",$e="[object Uint16Array]",ve="[object Uint32Array]",We="[object Int8Array]",Ve="[object Int16Array]",ze="[object Int32Array]",qe="[object Float32Array]",He="[object Float64Array]";function xe(e,t){return A(e,void 0,e,new Map,t)}function A(e,t,r,n=new Map,i=void 0){const c=i?.(e,t,r,n);if(c!==void 0)return c;if(J(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const o=Array.from({length:e.length});n.set(e,o);for(let f=0;f<e.length;f++)o[f]=A(e[f],f,r,n,i);return Object.hasOwn(e,"index")&&(o.index=e.index),Object.hasOwn(e,"input")&&(o.input=e.input),o}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const o=new RegExp(e.source,e.flags);return o.lastIndex=e.lastIndex,o}if(e instanceof Map){const o=new Map;n.set(e,o);for(const[f,u]of e)o.set(f,A(u,f,r,n,i));return o}if(e instanceof Set){const o=new Set;n.set(e,o);for(const f of e)o.add(A(f,void 0,r,n,i));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(Z(e)){const o=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,o);for(let f=0;f<e.length;f++)o[f]=A(e[f],f,r,n,i);return o}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const o=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,o),y(o,e,r,n,i),o}if(typeof File<"u"&&e instanceof File){const o=new File([e],e.name,{type:e.type});return n.set(e,o),y(o,e,r,n,i),o}if(typeof Blob<"u"&&e instanceof Blob){const o=new Blob([e],{type:e.type});return n.set(e,o),y(o,e,r,n,i),o}if(e instanceof Error){const o=new e.constructor;return n.set(e,o),o.message=e.message,o.name=e.name,o.stack=e.stack,o.cause=e.cause,y(o,e,r,n,i),o}if(typeof e=="boolean"){const o=!!e.valueOf();return n.set(e,o),y(o,e,r,n,i),o}if(typeof e=="number"){const o=Number(e.valueOf());return n.set(e,o),y(o,e,r,n,i),o}if(typeof e=="string"){const o=String(e.valueOf());return n.set(e,o),y(o,e,r,n,i),o}if(typeof e=="object"&&Je(e)){const o=Object.create(Object.getPrototypeOf(e));return n.set(e,o),y(o,e,r,n,i),o}return e}function y(e,t,r=e,n,i){const c=[...Object.keys(t),...x(t)];for(let o=0;o<c.length;o++){const f=c[o],u=Object.getOwnPropertyDescriptor(e,f);(u==null||u.writable)&&(e[f]=A(t[f],f,r,n,i))}}function Je(e){switch(Se(e)){case Ie:case Ee:case Fe:case Le:case Ue:case Be:case qe:case He:case We:case Ve:case ze:case Ne:case je:case Pe:case be:case De:case Oe:case Re:case Me:case _e:case $e:case ve:return!0;default:return!1}}function S(e){return A(e,void 0,e,new Map,void 0)}const j={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3","ogg","wav","aac","m4a","webm"],imageType:["jpeg","jpg","png","gif","bmp","tiff","tif","webp","heic","heif","svg","ico","raw","cr2","nef","arw","dng","psd","eps"],videoType:["mp4","avi","mov","wmv","mkv","flv","webm","mpeg","mpg","3gp","ogv","mxf","vob","rm","rmvb","ts","mts","m2ts","divx","xvid"],audioType:["mp3","wav","aac","flac","ogg","wma","m4a","alac","opus","amr","aiff","au","pcm","ape"]},X=e=>e!=null&&e!=="";let G=e=>setTimeout(e,16),Y=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(G=e=>window.requestAnimationFrame(e),Y=e=>window.cancelAnimationFrame(e));let K=0;const L=new Map;function Q(e){L.delete(e)}function R(e,t=1){K+=1;const r=K;function n(i){if(i===0)Q(r),e();else{const c=G(()=>{n(i-1)});L.set(r,c)}}return n(t),r}R.cancel=e=>{const t=L.get(e);return Q(t),Y(t)};function Ze(e){return e!=null}function b(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}const Xe=({suffixCls:e,customizePrefixCls:t,isPor:r,className:n})=>{const i=n||(r?"gx-pro":"gx");return t||(e?`${i}-${e}`:i)},Ge=(e,t)=>e?g(e)?e.join("-"):e.toString():`${t||0}`;function Ye(e,{align:t,showIndex:r}){const n=S(e);if(r&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];n.unshift({title:"序号",align:t,fixed:i.fixed,width:60,uuid:C().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else n.filter(i=>i.dataIndex!=="sortIndex");return n}function Ke(e,...t){return typeof e=="function"?e(...t):e}function Qe(e){return JSON.parse(JSON.stringify(e))}function ke(e,t){if(w(e)){const{pageSize:r=10,total:n=0}=e;let{current:i=1}=e;return n-t<=r*(i-1)&&(i=i-1),i===0?1:i}return 1}function Te(e=[],t,r="children"){function n(i,c){return c.map((o,f)=>{const u=`${i}-${f+1}`;return o[r]&&(o[r]=n(u,o[r])),o.sortIndex=u,o})}return S(e).map((i,c)=>{const o=w(t)&&t.current||1,f=w(t)&&t.pageSize||10,u=`${(o-1)*f+(c+1)}`;return i[r]&&(i[r]=n(`${u}`,i[r])),i.sortIndex=u,i})}function Ce(e,t){return g(e)?e?.filter((r,n)=>{if(p(t))return n<=t-1;if(g(t)&&t.length===2){const i=t[0]-1,c=t[1]?t[1]-1:e.length-1;return n<=c&&n>=i}else if(g(t)&&t.length===1){const i=t[0]-1,c=e.length-1;return n<=c&&n>=i}return!0}):[]}function k(e,t,r,n=0){const i=p(n)&&(n===0||n===1)?n:0,c=e[r],o=t[r];let f=0;return c<o?f=i===0?-1:0:c>o&&(f=i===0?0:-1),f}function T(e,t,r,n=0){const i=p(n)&&(n===0||n===1)?n:0,c=new Date(e[r]),o=new Date(t[r]);let f=0;return c<o?f=i===0?-1:0:c>o&&(f=i===0?0:-1),f}function et(e,t,r=0){return e.sort((n,i)=>k(n,i,t,r))}function tt(e,t,r=0){return e.sort((n,i)=>T(n,i,t,r))}function nt(e){let t=S(e);const r=new Set(t);return t=Array.from(r),t}function rt(e,t){const r=["null","undefined"];let n=!0;return e===0?n=!0:r.includes(e)?n=!1:e||(n=!1),n?{value:e,success:n}:{value:t===""?t:t||"-",success:n}}function it(e){let t="";if(e>-1){const r=Math.floor(e/3600),n=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));r<10?t="0"+r+":":t=r+":",n<10&&(t+="0"),t+=n+":",i<10&&(t+="0"),t+=i}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function C(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,r){const n=e,i=[],c=r||n.length;let o,f;if(t)for(o=0;o<t;o+=1)i[o]=n[Number.parseInt(String(Math.random()*c))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",o=0;o<36;o+=1)i[o]||(f=Math.random()*16,i[o]=n[o===19?f&&3||8:f]);return i.join("")},uuidFast(){const t=e,r=Array.from({length:36});let n=0,i,c;for(c=0;c<36;c+=1)c===8||c===13||c===18||c===23?r[c]="-":c===14?r[c]="4":(n<=2&&(n=33554432+Math.random()*16777216||0),i=n&&15,n=n>4,r[c]=t[c===19?i&&3||8:i]);return r.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16||0;return(t==="x"?r:r&&3||8).toString(16)})}}}function ee(e,t){if(!Array.isArray(e)||e.length===0)return 0;const r=t||"children";return Math.max(...e.map(n=>{const i=n[r];return 1+(i?ee(i,r):0)}))}function te(e,t="children"){let r=[];return e.forEach(n=>{r.push(n),g(n[t])&&n[t].length>0&&(r=r.concat(te(n[t],t)))}),r}function ot(e,t){if(!e||!g(e)||e?.length===0)return[];const{id:r="id",parentId:n="parentId",children:i="children",emptyChildren:c=!0}=t||{},o=t?.rootId??0,f=S(e);return f.map(u=>(!c&&u[i]&&u[i]?.length===0&&delete u[i],u)).filter(u=>{const a=f.filter(l=>u[r]===l[n]);return a.length>0?u[i]=a:c&&(u[i]=[]),o===!1?!0:u[n]===o})}function ne(e,t){return e.map(r=>{const n={...r};return n.children&&(n.children=ne(n.children,t)),t(n)||n.children&&n.children.length>0?n:null}).filter(Boolean)}function ct(e,t,r){const{value:n,children:i}=r||{value:"value",children:"children"};let c=[];function o(f,u){if(f[n]===t)return c=[...u,f[n]],!0;if(f[i]){for(const a of f[i])if(o(a,[...u,f[n]]))return!0}return!1}for(const f of e)if(o(f,[]))break;return c}function ft(e){return e&&g(e)?e[e.length-1]:null}function re(e,t,r){const n=r?.value||"id",i=r?.children||"children";for(const c of e){if(c[n]===t)return c;const o=c[i];if(o){const f=re(o,t,r);if(f)return f}}}function st(e){return URL.createObjectURL(e)}function ut(e){return new Promise((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=i=>r(i)})}function at(e){const t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=atob(t[1]);let i=n.length;const c=new Uint8Array(i);for(;i--;)c[i]=n.charCodeAt(i);return new Blob([c],{type:r})}function lt(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[1]);let c=i.length;const o=new Uint8Array(c);for(;c--;)o[c]=i.charCodeAt(c);return new File([o],t,{type:n})}function dt(e,t,r){return new window.File([e],t,{type:r})}function ie(e){if(!e||typeof e!="string")return"";const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function B(e){if(!e||typeof e!="string")return"";const t=ie(e),r=t.lastIndexOf(".");return r>0&&`${t?.substring?.(r)?.split("?")?.[0]}`?.split(".")?.[1]||""}function U(e,t){if(t)return t;if(!e||e==="data:")return"4";let r="4";return N(e)?e.includes("data:image/")?r="png":e.includes("data:video/")?r="mp4":e.includes("data:audio/")&&(r="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?r="png":e.includes("video")?r="mp4":e.includes("audio")&&(r="mp3")):r=B(e).toLowerCase(),j.imageType.includes(r)?"1":j.videoType.includes(r)?"3":j.audioType.includes(r)?"2":"4"}function oe(e){const{url:t="",fileType:r="1"}=e||{};let n="",i={play:!1,height:0,size:0,width:0,duration:0};function c(){i={play:!1,height:0,size:0,width:0,duration:0}}return t instanceof File?n=URL.createObjectURL(t):N(t)?n=t:t instanceof Blob?n=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(n=t),new Promise(o=>{let f;if(r==="4"){o(i);return}r==="1"?(f=document.createElement("img"),f.src=n):r==="2"?(f=document.createElement("audio"),f.src=n):r==="3"&&(f=document.createElement("video"),f.src=n),r==="1"?f.onload=function(){c(),i.play=!0,i.width=f.width||0,i.height=f.height||0,o(i),f=null}:f.oncanplay=function(){c(),i.play=!0,i.width=f?.videoWidth||0,i.height=f?.videoHeight||0,i.duration=f?.duration||0,o(i),f=null},f.onerror=function(){c(),o(i),f=null}})}async function gt(e){const{url:t="",currentTime:r,videoSuffix:n="",videoAllowPlay:i=!1}=e;let c="",o=n,f="1",u;return t instanceof File?(c=URL.createObjectURL(t),o=B(t.name),f=U(t.name)):t instanceof Blob?(c=URL.createObjectURL(t),f=U(t)):N(t)?(c=t,f=U(t)):(t.includes("https")||t.includes("http"))&&(c=t,o=B(t),f=U(t)),(o?j.videoAllowType.includes(o.toLowerCase()):!1)?i?M(c,r):(u=await oe({url:c,fileType:f}),u.play?M(c,r):new Promise(l=>{l("")})):new Promise(l=>{l("")})}async function M(e,t=0){return new Promise(r=>{let n=document.createElement("video");n&&(n.controls=!0,n.muted=!0,n.setAttribute("src",e),n.setAttribute("muted",String(!0)),n.setAttribute("crossorigin","anonymous"),n.setAttribute("autoplay",String(!0)),n.addEventListener("loadeddata",async()=>{let i;for(n?.addEventListener("seeked",async()=>{i&&i()});t<(n?.duration||0);){n&&(n.currentTime=t),await new Promise(m=>i=m);const c=document.createElement("canvas"),o=.8,f=c.getContext("2d"),u=n?.videoWidth||0*o,a=n?.videoHeight||0*o,l=0;c.width=n?.videoWidth||0*o,c.height=n?.videoHeight||0*o,n&&f.drawImage(n,0,0,u+l,a+l),n=null,r(u===0||a===0?"":c.toDataURL("image/png",1))}}))})}function N(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(r=>e.includes(r)))}function yt(e){return typeof e=="string"&&/^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e)}function ht(e,t,r,n=!1){e&&t&&r&&e.addEventListener(t,r,n)}function mt(e,t,r,n=!1){e&&t&&r&&e.removeEventListener(t,r,n)}function pt(){return/windows|win32/i.test(navigator.userAgent)}function wt(e){return I(e)?e:!!e}function _(e,t){const r=`^\\d+(?:\\.\\d{0,${e}})?`,n=new RegExp(r),i=t.toString().match(n);if(i){const c=i[0];if(c.includes(".")){const[o,f]=c.split(".");if(/^0*$/.test(f))return o}return c}return t.toString()}function At(e,t){const{toChinese:r=!1,fixed:n=2,min:i=1e4}=t||{},c=p(i)?i:1e4,o=p(n)?n:2,f=r?e<c?"":e<1e8?"万":"亿":e<c?"":e<1e8?"w":"亿";if(!p(e))return{str:`${e}`,number:`${e}`};if(e<c)return{str:`${e}`,number:`${e}`};if(o===0){const a=(e/(e<1e8?1e4:1e8)).toFixed(1).split(".")[0];return{str:`${a}${f}`,number:a,unit:f}}let u;return e<1e8?(u=_(o,e/1e4),{str:u+f,number:u,unit:f}):(u=_(o,e/1e8),{str:u+f,number:u,unit:f})}function St(e,t){let r=0;const n=I(t.removeAfter)?t.removeAfter:!0,i=t.id||"hiddenElement",c={opacity:0,visibility:"hidden",position:"fixed",zIndex:-1,top:0,left:0};let o=document.querySelector(`#${i}`);if(!o){const u=document.createElement("div");u.id=i,document.body.appendChild(u),o=document.querySelector(`#${i}`)}Object.assign(o.style,c);const f=document.createElement(t.createName||"span");return f.innerHTML=e,(t.cssObject||w(t.cssObject))&&Object.assign(f.style,t.cssObject),o.append(f),r=f.getBoundingClientRect()[t.type||"width"],n&&o.removeChild(f),r}function bt(e){e=p(e)&&!Number.isNaN(e)?e:0;const t=["零","一","二","三","四","五","六","七","八","九"],r=["","十","百","千","万"];e=Number.parseInt(`${e}`);const n=o=>{const f=o.toString().split("").reverse();let u="";for(let a=0;a<f.length;a++)u=(a===0&&f[a]==="0"||a>0&&f[a]==="0"&&f[a-1]==="0"?"":(e<20&&a>0?"":t[f[a]])+(f[a]==="0"?r[0]:r[a]))+u;return u},i=Math.floor(e/1e4);let c=e%1e4;return c.toString().length<4&&(c="0"+c),i?n(i)+"万"+n(c):n(e)}function Ot(e,t){Object.keys(e).forEach(r=>{t(r,e[r])})}function jt(e,t,r,n){const i=r-t;return e/=n/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function Ut(e,t={}){const{getContainer:r=()=>window,callback:n,duration:i=450}=t,c=r(),o=H(c,!0),f=Date.now(),u=()=>{const l=Date.now()-f,m=jt(l>i?i:l,o,e,i);P(c)?c.scrollTo(window.pageXOffset,m):c instanceof HTMLDocument||c.constructor.name==="HTMLDocument"?c.documentElement.scrollTop=m:c.scrollTop=m,l<i?R(u):typeof n=="function"&&n()};c&&R(u)}function It(e){let t;const r=i=>()=>{t=null,e(...i)},n=(...i)=>{t==null&&(t=requestAnimationFrame(r(i)))};return n.cancel=()=>cancelAnimationFrame(t),n}const Rt=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Bt=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Rt;function D(e,t,r,n){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let i,c,o;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(c=i;c--!==0;)if(!D(e[c],t[c],r,n))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(c of e.entries())if(!t.has(c[0]))return!1;for(c of e.entries())if(!D(c[1],t.get(c[0]),r,n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(c of e.entries())if(!t.has(c[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(i=e.length,i!=t.length)return!1;for(c=i;c--!==0;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(t).length)return!1;for(c=i;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[c]))return!1;for(c=i;c--!==0;){const f=o[c];if(!r?.includes(f)&&!(f==="_owner"&&e.$$typeof)&&!D(e[f],t[f],r,n))return n&&console.log(f),!1}return!0}return e!==e&&t!==t}function Nt(e){return/\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const ce=e=>e==null,Dt=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch(t){return console.error("isUrl error",t),!1}};function Et(e){return e==="__proto__"}function h(e,t,r){const n=Object.keys(t);for(let i=0;i<n.length;i++){const c=n[i];if(Et(c))continue;const o=t[c],f=e[c],u=r(f,o,c,e,t);u!==void 0?e[c]=u:b(o)?b(f)?e[c]=h(f,o,r):e[c]=h({},o,r):ce(o)&&(e[c]=o)}return e}const Ft=(...e)=>{const t={},r=e.length;let n,i=0;for(;i<r;i+=1)for(n in e[i])Object.prototype.hasOwnProperty.call(e[i],n)&&(typeof t[n]=="object"&&typeof e[i][n]=="object"&&t[n]!==void 0&&t[n]!==null&&!Array.isArray(t[n])&&!Array.isArray(e[i][n])?t[n]={...t[n],...e[i][n]}:t[n]=e[i][n]);return t};function Pt(e,t){return h(S(e),t,function r(n,i){if(b(i))return b(n)?h(S(n),i,r):h({},i,r)})}function Lt(e,t){return h(e,t,function r(n,i){if(b(i))return b(n)?h(n,i,r):h({},i,r)})}let fe=0;const se=(e=21)=>{if(typeof window>"u"||!window.crypto)return(fe+=1).toFixed(0);let t="";const r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t},Mt=()=>typeof window>"u"?se():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():se(),_t=e=>{if(e&&e!==!0)return e},$t=e=>{const t={};if(Object.keys(e||{}).forEach(r=>{e[r]!==void 0&&(t[r]=e[r])}),!(Object.keys(t).length<1))return t},vt=e=>{const t={};return Object.keys(e||{}).forEach(r=>{Array.isArray(e[r])&&e[r]?.length===0||e[r]!==void 0&&(t[r]=e[r])}),t};function Wt(e){if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:e.split(":")?.slice(-1)[0]}function ue(e){return e&&(e.type===d.Comment||e.type===d.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function Vt(e,t){return E(typeof e[t]=="function"?e[t]?.():[])}function E(e=[],t=!0){const r=Array.isArray(e)?e:[e],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(...E(i,t)):i?.type===d.Fragment||i?.type==="template"?n.push(...E(i.children,t)):i&&d.isVNode(i)?t&&!ue(i)?n.push(i):t||n.push(i):X(i)&&n.push(i)}),n}function $({vnode:e,defaultVNode:t},...r){return e===!1?null:typeof e=="function"?e?.(...r):e||t}function ae(e,...t){const{slots:r,key:n="default",render:i,props:c,defaultChildren:o}=e;let f;const u=c[n],a=r?.[n],l=typeof o=="function"?o?.():o;return u===!1?f=!1:u===!0?f=a??l:w(u)&&i?d.isVNode(u)?f=u:f=a:f=u||a,f===!1?!1:i?$({vnode:f,defaultVNode:l},...t):f}function le(e,...t){const{slots:r,key:n="default",props:i,defaultChildren:c}=e;let o;const f=i[n],u=r?.[n]?.(...t),a=typeof c=="function"?c?.():c;return f===!1?o=!1:f===!0?o=u??a:w(f)?d.isVNode(f)?o=f:o=u:o=f||u,o===!1?!1:$({vnode:o,defaultVNode:a},...t)}function zt(e,...t){const{slots:r,props:n,keys:i,render:c,defaultVNodes:o}=e,f={};return i.forEach((u,a)=>{const l=o?o[a]:null,m=c?le({slots:r,props:n,key:u,defaultChildren:l},...t):ae({slots:r,props:n,key:u,render:!1,defaultChildren:l},...t);(I(m)||m)&&(f[u]=m)}),f}s.Base64=de,s.arrayRepeat=nt,s.arraySlice=Ce,s.blobToDataURL=dt,s.checkFileType=U,s.classNames=z,s.cloneDeep=S,s.cloneDeepWith=xe,s.cloneDeepWithImpl=A,s.compareArray=k,s.compareArraySort=et,s.compareArrayTimeSort=tt,s.compareTime=T,s.convertValueBoolean=wt,s.copyProperties=y,s.dataURLtoBlob=at,s.dataURLtoFile=lt,s.deepCopy=Qe,s.deepMerge=Pt,s.fileTypes=j,s.filterEmpty=E,s.filterTree=ne,s.findSourceByTree=re,s.findValueAndAncestors=ct,s.forInObject=Ot,s.formatDuration=it,s.formatNumber=_,s.genColumnKey=Ge,s.generateVideoPicture=M,s.getArrayLast=ft,s.getBase64=ut,s.getBlobUrl=st,s.getFileSuffix=B,s.getKeys=Wt,s.getLevelData=te,s.getMaxFloor=ee,s.getMediaInfos=oe,s.getPrefixCls=Xe,s.getRandomNumber=C,s.getScroll=H,s.getScrollContainer=we,s.getSlot=ae,s.getSlotVNode=le,s.getSlotsChildren=Vt,s.getSlotsProps=zt,s.getSortIndex=Te,s.getSymbols=x,s.getTextWidth=St,s.getValueFromObjectByKey=me,s.getVideoCoverPicture=gt,s.getVideoFileUrl=ie,s.handleCurrentPage=ke,s.handleEmptyField=rt,s.handleShowIndex=Ye,s.is=v,s.isArray=g,s.isBase64=N,s.isBoolean=I,s.isBrowser=Bt,s.isDataURLBase64=yt,s.isDeepEqualReact=D,s.isEmptyElement=ue,s.isFunction=ge,s.isImg=Nt,s.isInContainer=Ae,s.isJSONStr=ye,s.isMobile=he,s.isNil=ce,s.isNotNil=Ze,s.isNumber=p,s.isObject=w,s.isPlainObject=b,s.isPrimitive=J,s.isScroll=q,s.isServer=O,s.isString=W,s.isTablet=V,s.isTypedArray=Z,s.isUrl=Dt,s.isValid=X,s.isWindowsOs=pt,s.merge=Ft,s.mergeWith=h,s.nanoid=Mt,s.off=mt,s.omitBoolean=_t,s.omitUndefined=$t,s.omitUndefinedAndEmptyArr=vt,s.on=ht,s.raf=R,s.runFunction=Ke,s.scrollTo=Ut,s.slotRender=$,s.throttleByAnimationFrame=It,s.toChinesNum=bt,s.toConvertNumberShow=At,s.treeData=ot,s.useDeepMerge=Lt,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Gets the `toStringTag` of `value`.
3
+ *
4
+ * @private
5
+ * @param {T} value The value to query.
6
+ * @returns {string} Returns the `Object.prototype.toString.call` result.
7
+ */
8
+ export declare function getTag<T>(value: T): string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Checks if a property key is unsafe to modify directly.
3
+ *
4
+ * This function is used in functions like `merge` to prevent prototype pollution attacks
5
+ * by identifying property keys that could modify the object's prototype chain or constructor.
6
+ *
7
+ * @param key - The property key to check
8
+ * @returns `true` if the property is unsafe to modify directly, `false` otherwise
9
+ * @internal
10
+ */
11
+ export declare function isUnsafeProperty(key: PropertyKey): key is "__proto__";
@@ -0,0 +1,26 @@
1
+ export declare const regexpTag = "[object RegExp]";
2
+ export declare const stringTag = "[object String]";
3
+ export declare const numberTag = "[object Number]";
4
+ export declare const booleanTag = "[object Boolean]";
5
+ export declare const argumentsTag = "[object Arguments]";
6
+ export declare const symbolTag = "[object Symbol]";
7
+ export declare const dateTag = "[object Date]";
8
+ export declare const mapTag = "[object Map]";
9
+ export declare const setTag = "[object Set]";
10
+ export declare const arrayTag = "[object Array]";
11
+ export declare const functionTag = "[object Function]";
12
+ export declare const arrayBufferTag = "[object ArrayBuffer]";
13
+ export declare const objectTag = "[object Object]";
14
+ export declare const errorTag = "[object Error]";
15
+ export declare const dataViewTag = "[object DataView]";
16
+ export declare const uint8ArrayTag = "[object Uint8Array]";
17
+ export declare const uint8ClampedArrayTag = "[object Uint8ClampedArray]";
18
+ export declare const uint16ArrayTag = "[object Uint16Array]";
19
+ export declare const uint32ArrayTag = "[object Uint32Array]";
20
+ export declare const bigUint64ArrayTag = "[object BigUint64Array]";
21
+ export declare const int8ArrayTag = "[object Int8Array]";
22
+ export declare const int16ArrayTag = "[object Int16Array]";
23
+ export declare const int32ArrayTag = "[object Int32Array]";
24
+ export declare const bigInt64ArrayTag = "[object BigInt64Array]";
25
+ export declare const float32ArrayTag = "[object Float32Array]";
26
+ export declare const float64ArrayTag = "[object Float64Array]";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gx-design-vue/pro-utils",
3
3
  "type": "module",
4
- "version": "0.2.0-beta.80",
4
+ "version": "0.2.0-beta.81",
5
5
  "description": "Gx Design Pro Utils",
6
6
  "publishConfig": {
7
7
  "access": "public",