minutool 1.0.31 → 1.0.32
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.
- package/dist/index.d.ts +17 -1
- package/dist/minutool.js +596 -583
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +5 -5
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/minutool.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(o,O){typeof exports=="object"&&typeof module<"u"?O(exports):typeof define=="function"&&define.amd?define(["exports"],O):(o=typeof globalThis<"u"?globalThis:o||self,O(o.Minutool={}))})(this,function(o){"use strict";const O=e=>e,ot=e=>Math.min(1,Math.max(0,e)),le=(e,t,n)=>e+(t-e)*n,at=(e,t,n,i=O)=>le(e,t,i(n)),rt=e=>e*e,ct=e=>1-(1-e)*(1-e),st=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,lt=e=>e*e*e,ut=e=>1-Math.pow(1-e,3),ue=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,pt=e=>e*e*e*e,dt=e=>1-Math.pow(1-e,4),mt=e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,ft=e=>e*e*e*e*e,ht=e=>1-Math.pow(1-e,5),gt=e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,wt=e=>1-Math.cos(e*Math.PI/2),Et=e=>Math.sin(e*Math.PI/2),vt=e=>-(Math.cos(Math.PI*e)-1)/2,Mt=e=>e===0?0:Math.pow(2,10*e-10),Tt=e=>e===1?1:1-Math.pow(2,-10*e),bt=e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,yt=e=>1-Math.sqrt(1-Math.pow(e,2)),St=e=>Math.sqrt(1-Math.pow(e-1,2)),At=e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,_t=(e,t=1.70158)=>(t+1)*e*e*e-t*e*e,Ot=(e,t=1.70158)=>1+(t+1)*Math.pow(e-1,3)+t*Math.pow(e-1,2),Ct=(e,t=1.70158)=>{const n=t*1.525;return e<.5?Math.pow(2*e,2)*((n+1)*2*e-n)/2:(Math.pow(2*e-2,2)*((n+1)*(e*2-2)+n)+2)/2},It=e=>{if(e===0||e===1)return e;const t=2*Math.PI/3;return-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*t)},Nt=e=>{if(e===0||e===1)return e;const t=2*Math.PI/3;return Math.pow(2,-10*e)*Math.sin((e*10-.75)*t)+1},Dt=e=>{if(e===0||e===1)return e;const t=2*Math.PI/4.5;return e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*t))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*t)/2+1},L=e=>e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375,Rt=e=>1-L(1-e),Lt=e=>e<.5?(1-L(1-2*e))/2:(1+L(2*e-1))/2,kt=(e,t)=>{let n=[];for(let i=0;i<e.length;i++)n.push(e[i][t]);return n},Ht=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n]===t)return n;return null},Pt=(e,t)=>{let n=new Map;return e.filter((i,a)=>{let r=t?t(i,a):i;if(!n.has(r))return n.set(r,!0),!0})},Bt=(e,t,n)=>{if(!e||!e.length)return e;let i={};if(e.forEach(r=>{let l=r[t];i[l]||(i[l]=[]),i[l].push(r)}),!n)return i;let a={};for(let r in i)a[r]=i[r][0];return a},Ft=e=>Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{}),xt=(e,t)=>{let n=e.length;if(t<1||!n)return[];if(t>n)return[e];let i=[],a=Math.floor(n/t),r=n%t;for(let l=1;l<=a;l++)i.push(e.splice(0,t));return r&&i.push(e.splice(0,r)),i},Ut=e=>{let t=-1;for(let n=e.length-1;n>=0;n--)if(e[n]){t=n;break}return e.slice(0,t+1)},pe=window.devicePixelRatio*96,$t=()=>window.innerWidth>window.innerHeight,Yt=()=>window.innerHeight>window.innerWidth,de=e=>{const t=e;if(e.requestFullscreen)return e.requestFullscreen();if(t.webkitRequestFullScreen)return t.webkitRequestFullScreen();throw t.mozRequestFullScreen&&t.mozRequestFullScreen(),t.msRequestFullScreen&&t.msRequestFullScreen(),"Browser no allow full screen"},me=()=>document.exitFullscreen(),jt=e=>new Promise((t,n)=>{fe()?me().then(t).catch(n):de(e).then(t).catch(n)}),fe=()=>!!document.fullscreenElement,qt=e=>{const t=navigator.language||navigator.userLanguage;if(e.includes(t))return t;const n=t.split("-")[0],i=e.find(a=>a.startsWith(n));return i||e[0]},zt=()=>navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Wt=(1+Math.sqrt(5))/2-1,$=96,Gt=(e,t=$)=>e/25.4*t,Kt=e=>Math.round(e*56.6929),Qt=e=>e*2.83464566929,Vt=e=>e/2.83464566929,Jt=(e,t=$)=>25.4*e/t,Xt=(e,t,n)=>Math.min(Math.max(e,t),n),M=(e,t,n,i=!0)=>i?e>=t&&e<=n:e>t&&e<n,Zt=(e,t)=>Math.floor(Math.random()*(t+1-e))+e,he=(e,t=2)=>{let n=Math.pow(10,t);return Math.round(e*n)/n},C=e=>typeof e=="number"?isFinite(e):typeof e!="string"?!1:/^[+-]?(\d+\.?\d*|\.\d+)$/.test(e),en=(...e)=>{let t=0;return e.forEach(n=>{if(typeof n=="number"&&C(n)){const i=n.toString().split(".")[1];i&&(t=Math.max(t,i.length))}}),t},tn=e=>(e=Math.abs(Number(e)),e===0?1:Math.floor(Math.log10(e))+1),ge=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),k=(e,t="")=>{if(typeof e=="number")return{val:e,unit:t};if(C(e))return{val:parseFloat(e),unit:t};const n=/^(-?[\d.]+)([a-z%]+)$/i,i=e.trim().match(n);if(!i)throw new Error("unit parse fail:"+e);return{val:parseFloat(i[1]),unit:i[2].toLowerCase()}},Y=(e,t,n={})=>{const i=k(e);if(!i)throw new Error(`Invalid value: ${e}`);const a=i.val,r=i.unit;if(!C(a))throw new Error(`Invalid number in value: ${e}`);const l=n.dpi||pe;if(r===t)return a;const c={mm:1,cm:10,in:25.4,px:25.4/l,pt:25.4/72,pc:25.4/6},s={mm:1,cm:1/10,in:1/25.4,px:l/25.4,pt:72/25.4,pc:6/25.4};if(!c[r])throw new Error(`Unsupported source unit: ${r}`);if(!s[t])throw new Error(`Unsupported target unit: ${t}`);return a*c[r]*s[t]},we=(e,t=0)=>C(e)?parseFloat(String(e)):t,nn=e=>(e+"").replace(/\\(.?)/g,function(t,n){switch(n){case"\\":return"\\";case"0":return"\0";case"":return"";default:return n}}),on=(e,t,n="...")=>{let i=/[^\x00-\xff]/g;if(e.replace(i,"mm").length<=t)return e;let a=Math.floor(t/2);for(let r=a;r<e.length;r++)if(e.substr(0,r).replace(i,"mm").length>=t)return e.substr(0,r)+n;return e},an=(e,t)=>{const n=Object.keys(t),i=Object.values(t);return new Function(...n,`return \`${e}\`;`)(...i)},rn=e=>e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase()),cn=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),sn=(e,t,n="...")=>e.length<=t?e:e.slice(0,t)+n,H=e=>(e+"").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1"),Ee=e=>{let t="",n=0,i=0,a=0,r=0;for(;n<e.length;)i=e.charCodeAt(n),i<128?(t+=String.fromCharCode(i),n++):i>191&&i<224?(a=e.charCodeAt(n+1),t+=String.fromCharCode((i&31)<<6|a&63),n+=2):(a=e.charCodeAt(n+1),r=e.charCodeAt(n+2),t+=String.fromCharCode((i&15)<<12|(a&63)<<6|r&63),n+=3);return t},j=e=>{e=e.replace(/\r\n/g,"n");let t="";for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(i&63|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(i&63|128))}return t},ln=e=>{let t=0,n=e.length,i=-1;for(let a=0;a<n;a++)i=e.charCodeAt(a),i>=0&&i<=128?t+=1:t+=3;return t},un="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890",ve=(e=6,t=un)=>{let n="";for(let i=0;i<e;i++){let a=Math.round(Math.random()*(t.length-1));n+=t.substring(a,a+1)}return n},pn=(e=1,t=8)=>{let n=[];const i="bcdfghjklmnpqrstvwxyz",a="aeiou";for(;e-- >0;){let r="";for(let l=0;l<t;l=l+3)r+=i[Math.floor(Math.random()*i.length)],r+=a[Math.floor(Math.random()*a.length)],r+=i[Math.floor(Math.random()*i.length)];n.push(r)}return n},dn=(e,t=!1)=>{let n=[];return e.replace(/[-_\s+]/g," ").split(" ").forEach((i,a)=>{n.push(a===0&&!t?i:ge(i))}),n.join("")},q=0,z=1,Me=2,mn=(e,t="",n=q)=>{if(t.length){let i=new RegExp("^["+H(t)+"]+"),a=new RegExp("["+H(t)+"]+$");return n===z?e.replace(i,""):n===Me?e.replace(a,""):e.replace(i,"").replace(a,"")}else return n===q?e.trim():n===z?e.trimStart():e.trimEnd()},fn=(e,t)=>{let n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n},hn=e=>/[\u4e00-\u9fa5]/.test(e),gn=(e,t="B",n=2)=>{const i=["B","KB","MB","GB","TB","PB"];let a=i.indexOf(t.toUpperCase());if(a===-1)throw new Error(`Unsupported unit: ${t}`);for(;e>=1024&&a<i.length-1;)e/=1024,a++;return he(e,n)},b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",wn=e=>{let t="",n,i,a,r,l,c,s,u=0;for(e=e.replace(/\+\+[++^A-Za-z0-9+/=]/g,"");u<e.length;)r=b.indexOf(e.charAt(u++)),l=b.indexOf(e.charAt(u++)),c=b.indexOf(e.charAt(u++)),s=b.indexOf(e.charAt(u++)),n=r<<2|l>>4,i=(l&15)<<4|c>>2,a=(c&3)<<6|s,t=t+String.fromCharCode(n),c!==64&&(t=t+String.fromCharCode(i)),s!==64&&(t=t+String.fromCharCode(a));return t=Ee(t),t},En=e=>j(e).replace("+","-").replace("/","_"),vn=e=>{let t="",n,i,a,r,l,c,s,u=0;for(e=j(e);u<e.length;)n=e.charCodeAt(u++),i=e.charCodeAt(u++),a=e.charCodeAt(u++),r=n>>2,l=(n&3)<<4|i>>4,c=(i&15)<<2|a>>6,s=a&63,isNaN(i)?c=s=64:isNaN(a)&&(s=64),t=t+b.charAt(r)+b.charAt(l)+b.charAt(c)+b.charAt(s);return t},Te=async e=>await Mn(e),Mn=e=>new Promise((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=a=>n(a)}),Tn=(e,t,n,i="/",a)=>{let r="";if(n){let c=new Date;c.setTime(Date.now()+n*24*60*60*1e3),r="; expires="+c.toUTCString()}let l=e+"="+(t||"")+r+"; path="+i;a&&(l+="; domain="+a),document.cookie=l},bn=e=>{let t=e+"=",n=document.cookie.split(";");for(let i=0;i<n.length;i++){let a=n[i];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},P=(e,t="/",n)=>{let i=e+"=; Path="+t+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";n&&(i+=" Domain="+n+";"),document.cookie=i},yn=(e,t)=>{const n=(t||(location==null?void 0:location.hostname)).split(".");for(;n.length>1;)P(e,"/",n.join(".")),P(e,"/","."+n.join(".")),n.shift();P(e)};let Sn=0;const be=(e="")=>"guid_"+(e||ve(6))+ ++Sn,An=(e,t)=>{let n,i,a=0;return function(){let r=+new Date;n=this,i=arguments,r-a>t&&(e.apply(n,i),a=r)}},_n=(e,t)=>{let n,i,a=0,r=!1;return function(){if(r)return;let l=+new Date;n=this,i=arguments;let c=t-(l-a);c<=0?(e.apply(n,i),a=l):(r=!0,setTimeout(()=>{e.apply(n,i),r=!1,a=l},c))}},On=(e,t)=>{let n;return function(){let i=this,a=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(i,a)},t)}},Cn=e=>e&&typeof e=="object"&&e.then&&typeof e.then=="function",In=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},Nn=e=>e&&typeof e=="object"&&!Array.isArray(e),Dn=e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!1,ye=e=>typeof e!="string"||e.trim()===""?!1:/^(https?:\/\/|\/\/|\/|\.\.?\/*)/i.test(e),Rn=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},Ln=()=>{let e=new Error().stack;console.log(e)},W=new EventTarget,kn=new Map,G=new Map;let Hn=0;const Pn="__MINUTOOL_SYM_EVENT__";function K(e){if(!G.has(e)){const t=`${Pn}${++Hn}`;G.set(e,t),kn.set(t,e)}return G.get(e)}const Bn=(e,t)=>{const n=e.map(i=>Se(i,t));return()=>n.forEach(i=>i())},Se=(e,t)=>(W.addEventListener(typeof e=="symbol"?K(e):e,t),()=>Ae(e,t)),Ae=(e,t)=>{W.removeEventListener(typeof e=="symbol"?K(e):e,t)},Fn=(e,t)=>{W.dispatchEvent(new CustomEvent(typeof e=="symbol"?K(e):e,{detail:t}))},xn=e=>{if(document.readyState==="complete"||document.readyState==="interactive")e();else{const t=()=>{e(),document.removeEventListener("DOMContentLoaded",t)};document.addEventListener("DOMContentLoaded",t)}},Un=(e,t,n,i)=>y(e,n,r=>{var s;const l=r.target,c=(s=l==null?void 0:l.closest)==null?void 0:s.call(l,t);c&&i(r,c)}),$n=(e,t)=>y(e,"click",t),Yn=(e,t)=>y(e,"keyup",t),jn=(e,t)=>y(e,"keydown",t),qn=(e,t)=>y(e,"dblclick",t),y=(e,t,n,i)=>{const a=l=>{n(l)},r=typeof e=="string"?T(e):e;if(!r)throw new Error(`EventTarget not found for selector: ${e}`);return r.addEventListener(t,a,i),()=>{r.removeEventListener(t,a,i)}},zn=(e,t,n=50)=>{let i=!1,a=null,r=null,l=null;const c=E=>{let m=E.target.value;r!==m&&(r=m,t(m,E))},s=E=>{const d=E;d.isComposing||i||(l=d,a&&clearTimeout(a),a=window.setTimeout(()=>{a=null,!(i||!l)&&(c(l),l=null)},n))},u=()=>{i=!0},p=()=>{i=!1};return e.addEventListener("input",s),e.addEventListener("compositionstart",u),e.addEventListener("compositionend",p),()=>{e.removeEventListener("input",s),e.removeEventListener("compositionstart",u),e.removeEventListener("compositionend",p),a&&(clearTimeout(a),a=null),l=null}},Wn=(e,t)=>{const n=i=>{i.key===e&&t(i.newValue)};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}},Gn=(e,t)=>{if("createEvent"in document){let n=document.createEvent("HTMLEvents");n.initEvent(t.toLowerCase(),!1,!0),e.dispatchEvent(n)}else e.fireEvent("on"+t.toLowerCase())},Kn=e=>{const t=T(e);t&&(t.style.display="none")},Qn=e=>{const t=T(e);t&&(t.style.display="")},Vn=e=>{let t=T(e);return t&&t.parentNode&&t.parentNode.removeChild(t)},Q="disabled",_e=(e,t="")=>V(e,t,!1),Oe=(e,t="")=>V(e,t,!0),V=(e,t="",n=null)=>{let i=T(e),a=n===null?!i.classList.contains(Q):!n;a&&Ie(`.${Q} {pointer-event:none !important;}`,"__element_lock_style__"),i.classList.toggle(Q,a),i[a?"setAttribute":"removeAttribute"]("disabled","disabled"),i[a?"setAttribute":"removeAttribute"]("data-disabled","disabled"),t&&i.classList.toggle(t,a)},Jn=(e,t,n)=>{e=T(e);let i=!1;const a=[];return a.push(y(e,"mouseenter",()=>{i||(i=!0,t&&t())})),a.push(y(e,"mouseleave",()=>{i&&(i=!1,n&&n())})),()=>{a.forEach(r=>r())}},Xn=(e,t)=>{_e(e),t(()=>{Oe(e)})},Zn=e=>e.parentNode?Array.prototype.indexOf.call(e.parentNode.children,e):-1,J=(e,t=document)=>{if(typeof e=="string")return e=e.trim(),e.indexOf(":scope")!==0&&(e=":scope "+e),Array.from(t.querySelectorAll(e));if(Array.isArray(e)){let n=[];return e.forEach(i=>{n.push(...J(i))}),n}else return NodeList.prototype.isPrototypeOf(e)||HTMLCollection.prototype.isPrototypeOf(e)?Array.from(e):e instanceof HTMLElement?[e]:e},T=(e,t=document)=>typeof e=="string"?t.querySelector(e):e,ei=e=>{let t=document.getElementsByTagName("*"),n=[];for(n=[];e&&e.nodeType===1;e=e.parentNode)if(e.hasAttribute("id")){let i=0;for(let a=0;a<t.length&&(t[a].hasAttribute("id")&&t[a].id===e.id&&i++,!(i>1));a++);if(i===1)return n.unshift('id("'+e.getAttribute("id")+'")'),n.join("/");n.unshift(e.localName.toLowerCase()+'[@id="'+e.getAttribute("id")+'"]')}else if(e.hasAttribute("class"))n.unshift(e.localName.toLowerCase()+'[@class="'+e.getAttribute("class")+'"]');else{let i,a;for(i=1,a=e.previousSibling;a;a=a.previousSibling)a.localName===e.localName&&i++;n.unshift(e.localName.toLowerCase()+"["+i+"]")}return n.length?"/"+n.join("/"):null},ti=(e,t,n=!0)=>{const i="ON_DOM_TREE_CHANGE_BIND_"+be();let a=()=>{J(`input:not([${i}]), textarea:not([${i}]), select:not([${i}])`,e).forEach(r=>{r.setAttribute(i,"1"),r.addEventListener("change",t)})};Ce(e,{attributes:!0,subtree:!0,childList:!0},()=>{n&&a(),t()},10),n&&a()},Ce=(e,t,n,i=10)=>{let a=0,r=!1,l=new MutationObserver(()=>{if(r)return;let c=i-(Date.now()-a);c>0?(r=!0,setTimeout(()=>{r=!1,a=Date.now(),n(l)},c)):(a=Date.now(),n(l))});l.observe(e,t)},ni=(e,t={left:0,top:0,width:window.innerWidth,height:window.innerHeight})=>{let n={left:e.left,top:e.top};return e.width>t.width||e.height>t.height||(e.width+e.left>t.width+t.left&&(n.left=e.left-(e.width+e.left-(t.width+t.left))),e.height+e.top>t.height+t.top&&(n.top=e.top-(e.height+e.top-(t.height+t.top))),e.left<t.left&&(n.left=t.left),e.top<t.top&&(n.top=t.top)),n},ii=(e,t)=>e.left<=t.left?e.left+e.width>=t.left&&(M(t.top,e.top,e.top+e.height)||M(t.top+t.height,e.top,e.top+e.height)||t.top>=e.top&&t.height>=e.height):t.left+t.width>=e.left&&(M(e.top,t.top,t.top+t.height)||M(e.top+e.height,t.top,t.top+t.height)||e.top>=t.top&&e.height>=t.height),oi=e=>e?!!(e.tabIndex>=0||e instanceof HTMLAnchorElement&&e.href||e instanceof HTMLButtonElement&&!e.disabled||e instanceof HTMLInputElement&&!e.disabled||e instanceof HTMLTextAreaElement&&!e.disabled):!1;let S={};const ai=(e,t=!1)=>(!t&&e in S||(S[e]=new Promise((n,i)=>{let a=document.createElement("link");a.rel="stylesheet",a.href=e,a.onload=()=>{n()},a.onerror=()=>{i()},document.head.append(a)})),S[e]),ri=(e,t=!1)=>(!t&&e in S||(S[e]=new Promise((n,i)=>{let a=document.createElement("script");a.src=e,a.onload=()=>{n()},a.onerror=()=>{i()},document.head.append(a)})),S[e]),ci=e=>{let t=e.style.visibility,n=e.style.display,i,a;return e.style.visibility="hidden",e.style.display="block",i=e.clientWidth,a=e.clientHeight,e.style.visibility=t,e.style.display=n,{width:i,height:a}},Ie=(e,t="",n=document)=>{if(t&&n.querySelector(`#${t}`))return n.querySelector(`#${t}`);let i=n.createElement("style");return n.head.appendChild(i),i.innerHTML=e,t&&(i.id=t),i},si=(e,t)=>M(e.top,t.top,t.top+t.height)&&M(e.left,t.left,t.left+t.width)&&M(e.top+e.height,t.top,t.top+t.height)&&M(e.left+e.width,t.left,t.left+t.width),li=e=>Math.pow(10,-e),ui=(e,t)=>{try{return new URL(e,t).href}catch{return e}},pi=(e,t=null)=>{const n=document.createElement("template");e=e.trim(),n.innerHTML=e;let i=[];return t?Array.from(n.content.children).forEach(a=>{i.push(t.appendChild(a))}):i=Array.from(n.content.children),i.length===1?i[0]:i},Ne=(e,t=!1)=>{if(!e)throw new Error("el is null");const n=e.getBoundingClientRect();if(t&&!n.height){const i=e.style.visibility,a=e.style.display;e.style.visibility="hidden",e.style.display="block";const r=Ne(e);return e.style.visibility=i,e.style.display=a,r}return{top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width,height:n.height}},di=e=>{let t={};for(let n in e){const i=e[n];i!=null&&(t[`--${n}`]=`${i}`)}return t},mi=(e,t=null)=>{const n=T(e);t=T(t||n);const i=n.style.position,a=n.style.left,r=n.style.top,l=n.style.transform;let c=!1,s=0,u=0;const p=m=>{c&&(n.style.position="fixed",n.style.transform="none",n.style.left=`${m.clientX-s}px`,n.style.top=`${m.clientY-u}px`)},E=()=>{c=!1,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",E)},d=m=>{if(m.button!==0)return;c=!0;const _=n.getBoundingClientRect();s=m.clientX-_.left,u=m.clientY-_.top,document.addEventListener("mousemove",p),document.addEventListener("mouseup",E),m.preventDefault()};return t.addEventListener("mousedown",d),()=>{E(),t.removeEventListener("mousedown",d),n.style.position=i,n.style.left=a,n.style.top=r,n.style.transform=l}},D=new WeakMap,De=e=>{const t=D.get(e);t&&(cancelAnimationFrame(t.raf),D.delete(e),e.style.scrollBehavior=t.prevBehavior)},fi=(e,t,n={})=>{const{duration:i=380,axis:a="scrollLeft",onEnd:r,easingFn:l=ue}=n;De(e);const c=e.style.scrollBehavior;e.style.scrollBehavior="auto";const s=a==="scrollLeft"?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,u=Math.max(0,Math.min(s,t)),p=e[a],E=u-p,d=()=>{e.style.scrollBehavior=c,r==null||r()};if(Math.abs(E)<1){d();return}const m=performance.now(),_=se=>{const U=Math.min(1,(se-m)/i);e[a]=p+E*l(U);const v=D.get(e);U<1&&v?v.raf=requestAnimationFrame(_):(D.delete(e),d())};D.set(e,{raf:requestAnimationFrame(_),prevBehavior:c})},hi=e=>e.replace(/[\\/:*?"<>|]/g,"_").replace(/[\0-\x1F]/g,"_").replace(/\s+/g," ").replace(/^\.+/,"").replace(/\.+$/,"").trim(),X=e=>new Promise((t,n)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=a=>n(a),i.readAsDataURL(e)}),Re={},Z=(e,t=null)=>t!==null?(Re[e]=t,null):Re[e]||null,gi=async e=>{if(!e)return null;if(typeof e=="string"&&e.startsWith("data:"))return e;try{if(typeof e=="string"&&ye(e)){const t=await fetch(e);if(!t.ok)throw new Error(`Fetch failed: ${t.status}`);const n=await t.blob();return await X(n)}return e instanceof Blob?await X(e):null}catch(t){return console.warn("file2Base64DataURL failed:",t),null}},wi=(e,t)=>{const n=document.createElement("a");n.rel="noopener noreferrer",n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)},ee=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","CANVAS","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","NOSCRIPT","OL","P","PRE","SECTION","TABLE","TFOOT","UL","VIDEO"],Ei=["A","ABBR","ACRONYM","B","BDO","BIG","BUTTON","CITE","CODE","DFN","EM","I","KBD","LABEL","MAP","OBJECT","OUTPUT","Q","S","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRONG","SUB","SUP","TEXTAREA","TIME","TT","U","VAR"].concat(...ee),vi=["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"],Le=["STYLE","COMMENT","SELECT","OPTION","SCRIPT","TITLE","HEAD","BUTTON","META","LINK","PARAM","SOURCE"],Mi=(e,t={})=>{t.keepLineBreak=t.keepLineBreak!==!1;const n=t.imgReplacer!==void 0?t.imgReplacer:"[Image]";e=e.replace(/<img[^>]*src=["']([^"']*)["'][^>]*alt=["']([^"']*)["'][^>]*>/gi,function(r,l,c){return typeof n=="function"?n(l,c):n}),e=e.replace(/<img[^>]*alt=["']([^"']*)["'][^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,l,c){return typeof n=="function"?n(c,l):n}),e=e.replace(/<img[^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,l){return typeof n=="function"?n(l,""):n});const i=t.videoReplacer!==void 0?t.videoReplacer:"[Video]";return e=e.replace(/<video[^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,l){return typeof i=="function"?i(l,""):i}),e=e.replace(/<video[^>]*>[\s\S]*?<source[^>]*src=["']([^"']*)["'][^>]*>[\s\S]*?<\/video>/gi,function(r,l){return typeof i=="function"?i(l,""):i}),Le.forEach(r=>{e=e.replace(new RegExp(`<${r}[^>]*>([\\s\\S]*?)<\\/${r}>`,"gi"),""),e=e.replace(new RegExp(`<${r}[^>]*>`,"gi"),"")}),e=e.replace(/[\r|\n]/g,""),e=e.replace(/<(\w+)([^>]*)>/g,function(r,l,c){return ee.includes(l.toUpperCase())?`
|
|
2
|
-
`:""}),e=e.replace(/<\/(\w+)([^>]*)>/g,function(r,
|
|
3
|
-
`),
|
|
4
|
-
`);if(i.length<2)return n;let a="<table>";return i.forEach((r,
|
|
5
|
-
`,(""+e).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">").replace(/\r\n/g,t).replace(/[\r\n]/g,t)),Ci=(e,t)=>{let n=e.split("");return t=t||0,n.map(i=>`&#${t?"x"+i.charCodeAt(0).toString(16):i.charCodeAt(0)};`).join("")},Ii=(e,t,n='<span class="matched">%s</span>')=>t?e.replace(new RegExp(H(t),"ig"),i=>n.replace("%s",i)):e,Ni=e=>{if(!e.src)return null;if(e.src.indexOf("data:")===0)return e.src;let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");return n?(n.drawImage(e,0,0,e.width,e.height),t.toDataURL("image/png")):null},He=e=>{const t=new XMLSerializer().serializeToString(e),n=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)},Pe=e=>new Promise((t,n)=>{const i=He(e),a=new Image;a.onload=()=>{t(a)},a.onerror=r=>{n(new Error("Failed to load SVG into Image:"+r))},a.src=i}),Di=(e,t=null,n=null)=>(t=t||"image/png",new Promise((i,a)=>{const r=C(n)?we(n):1;Pe(e).then(l=>{const[c,s]=Be(e),u=document.createElement("canvas");u.width=c*r,u.height=s*r,u.getContext("2d").drawImage(l,0,0,c*r,s*r),URL.revokeObjectURL(l.src),i(u.toDataURL(t))},a)})),Be=e=>{let t=null,n=null;const i=e.getAttribute("width"),a=e.getAttribute("height");if(i&&a)try{const r=k(i,"px"),l=k(a,"px");r&&l&&(t=Y(r.val+r.unit,"px"),n=Y(l.val+l.unit,"px"))}catch{}if(t===null||n===null){const r=e.viewBox.baseVal;r&&r.width&&r.height&&(t=r.width,n=r.height)}if(t===null||n===null){const r=e.getBoundingClientRect();t=r.width,n=r.height}return[t,n]},Ri=(e,t=!1)=>new Promise((n,i)=>{if(t){const r=Z(e);if(r)return n(r)}let a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="blob",a.onload=function(){if(this.status===200){let r=this.response;Te(r).then(l=>{t&&Z(e,l),n(l)}).catch(l=>{i(l)})}},a.onerror=function(){i("Error:"+this.statusText)},a.onabort=function(){i("Request abort")},a.send()}),A=(e,t)=>{let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535},Li=(e,t)=>e<<t|e>>>32-t,B=(e,t,n,i,a,r)=>A(Li(A(A(t,e),A(i,r)),a),n),f=(e,t,n,i,a,r,l)=>B(t&n|~t&i,e,t,a,r,l),h=(e,t,n,i,a,r,l)=>B(t&i|n&~i,e,t,a,r,l),g=(e,t,n,i,a,r,l)=>B(t^n^i,e,t,a,r,l),w=(e,t,n,i,a,r,l)=>B(n^(t|~i),e,t,a,r,l),F=(e,t)=>{e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;let n,i,a,r,l,c=1732584193,s=-271733879,u=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)i=c,a=s,r=u,l=p,c=f(c,s,u,p,e[n],7,-680876936),p=f(p,c,s,u,e[n+1],12,-389564586),u=f(u,p,c,s,e[n+2],17,606105819),s=f(s,u,p,c,e[n+3],22,-1044525330),c=f(c,s,u,p,e[n+4],7,-176418897),p=f(p,c,s,u,e[n+5],12,1200080426),u=f(u,p,c,s,e[n+6],17,-1473231341),s=f(s,u,p,c,e[n+7],22,-45705983),c=f(c,s,u,p,e[n+8],7,1770035416),p=f(p,c,s,u,e[n+9],12,-1958414417),u=f(u,p,c,s,e[n+10],17,-42063),s=f(s,u,p,c,e[n+11],22,-1990404162),c=f(c,s,u,p,e[n+12],7,1804603682),p=f(p,c,s,u,e[n+13],12,-40341101),u=f(u,p,c,s,e[n+14],17,-1502002290),s=f(s,u,p,c,e[n+15],22,1236535329),c=h(c,s,u,p,e[n+1],5,-165796510),p=h(p,c,s,u,e[n+6],9,-1069501632),u=h(u,p,c,s,e[n+11],14,643717713),s=h(s,u,p,c,e[n],20,-373897302),c=h(c,s,u,p,e[n+5],5,-701558691),p=h(p,c,s,u,e[n+10],9,38016083),u=h(u,p,c,s,e[n+15],14,-660478335),s=h(s,u,p,c,e[n+4],20,-405537848),c=h(c,s,u,p,e[n+9],5,568446438),p=h(p,c,s,u,e[n+14],9,-1019803690),u=h(u,p,c,s,e[n+3],14,-187363961),s=h(s,u,p,c,e[n+8],20,1163531501),c=h(c,s,u,p,e[n+13],5,-1444681467),p=h(p,c,s,u,e[n+2],9,-51403784),u=h(u,p,c,s,e[n+7],14,1735328473),s=h(s,u,p,c,e[n+12],20,-1926607734),c=g(c,s,u,p,e[n+5],4,-378558),p=g(p,c,s,u,e[n+8],11,-2022574463),u=g(u,p,c,s,e[n+11],16,1839030562),s=g(s,u,p,c,e[n+14],23,-35309556),c=g(c,s,u,p,e[n+1],4,-1530992060),p=g(p,c,s,u,e[n+4],11,1272893353),u=g(u,p,c,s,e[n+7],16,-155497632),s=g(s,u,p,c,e[n+10],23,-1094730640),c=g(c,s,u,p,e[n+13],4,681279174),p=g(p,c,s,u,e[n],11,-358537222),u=g(u,p,c,s,e[n+3],16,-722521979),s=g(s,u,p,c,e[n+6],23,76029189),c=g(c,s,u,p,e[n+9],4,-640364487),p=g(p,c,s,u,e[n+12],11,-421815835),u=g(u,p,c,s,e[n+15],16,530742520),s=g(s,u,p,c,e[n+2],23,-995338651),c=w(c,s,u,p,e[n],6,-198630844),p=w(p,c,s,u,e[n+7],10,1126891415),u=w(u,p,c,s,e[n+14],15,-1416354905),s=w(s,u,p,c,e[n+5],21,-57434055),c=w(c,s,u,p,e[n+12],6,1700485571),p=w(p,c,s,u,e[n+3],10,-1894986606),u=w(u,p,c,s,e[n+10],15,-1051523),s=w(s,u,p,c,e[n+1],21,-2054922799),c=w(c,s,u,p,e[n+8],6,1873313359),p=w(p,c,s,u,e[n+15],10,-30611744),u=w(u,p,c,s,e[n+6],15,-1560198380),s=w(s,u,p,c,e[n+13],21,1309151649),c=w(c,s,u,p,e[n+4],6,-145523070),p=w(p,c,s,u,e[n+11],10,-1120210379),u=w(u,p,c,s,e[n+2],15,718787259),s=w(s,u,p,c,e[n+9],21,-343485551),c=A(c,i),s=A(s,a),u=A(u,r),p=A(p,l);return[c,s,u,p]},Fe=e=>{let t,n="",i=e.length*32;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n},ne=e=>{let t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;let i=e.length*8;for(t=0;t<i;t+=8)n[t>>5]|=(e.charCodeAt(t/8)&255)<<t%32;return n},ki=e=>Fe(F(ne(e),e.length*8)),Hi=(e,t)=>{let n,i=ne(e),a=[],r=[],l;for(a[15]=r[15]=void 0,i.length>16&&(i=F(i,e.length*8)),n=0;n<16;n+=1)a[n]=i[n]^909522486,r[n]=i[n]^1549556828;return l=F(a.concat(ne(t)),512+t.length*8),Fe(F(r.concat(l),640))},xe=e=>{let t="0123456789abcdef",n="",i,a;for(a=0;a<e.length;a+=1)i=e.charCodeAt(a),n+=t.charAt(i>>>4&15)+t.charAt(i&15);return n},ie=e=>unescape(encodeURIComponent(e)),Ue=e=>ki(ie(e)),Pi=e=>xe(Ue(e)),$e=(e,t)=>Hi(ie(e),ie(t)),Bi=(e,t)=>xe($e(e,t)),Fi=(e,t,n)=>t?n?$e(t,e):Bi(t,e):n?Ue(e):Pi(e),xi="application/octet-stream",I="application/json",Ye="application/x-www-form-urlencoded",je="multipart/form-data",Ui="text/plain",$i="text/html",Yi={323:"text/h323",accdb:"application/msaccess",accde:"application/msaccess",accdt:"application/msaccess",acx:"application/internet-property-stream",ai:"application/postscript",aif:"audio/x-aiff",aifc:"audio/aiff",aiff:"audio/aiff",application:"application/x-ms-application",art:"image/x-jg",asf:"video/x-ms-asf",asm:"text/plain",asr:"video/x-ms-asf",asx:"video/x-ms-asf",atom:"application/atom+xml",au:"audio/basic",avi:"video/x-msvideo",axs:"application/olescript",bas:"text/plain",bcpio:"application/x-bcpio",bmp:"image/bmp",c:"text/plain",calx:"application/vnd.ms-office.calx",cat:"application/vnd.ms-pki.seccat",cdf:"application/x-cdf",class:"application/x-java-applet",clp:"application/x-msclip",cmx:"image/x-cmx",cnf:"text/plain",cod:"image/cis-cod",cpio:"application/x-cpio",cpp:"text/plain",crd:"application/x-mscardfile",crl:"application/pkix-crl",crt:"application/x-x509-ca-cert",csh:"application/x-csh",css:"text/css",dcr:"application/x-director",der:"application/x-x509-ca-cert",dib:"image/bmp",dir:"application/x-director",disco:"text/xml",dll:"application/x-msdownload","dll.config":"text/xml",dlm:"text/dlm",doc:"application/msword",docm:"application/vnd.ms-word.document.macroEnabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroEnabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",dtd:"text/xml",dvi:"application/x-dvi",dwf:"drawing/x-dwf",dxr:"application/x-director",eml:"message/rfc822",eps:"application/postscript",etx:"text/x-setext",evy:"application/envoy","exe.config":"text/xml",fdf:"application/vnd.fdf",fif:"application/fractals",flr:"x-world/x-vrml",flv:"video/x-flv",gif:"image/gif",gtar:"application/x-gtar",gz:"application/x-gzip",h:"text/plain",hdf:"application/x-hdf",hdml:"text/x-hdml",hhc:"application/x-oleobject",hlp:"application/winhlp",hqx:"application/mac-binhex40",hta:"application/hta",htc:"text/x-component",htm:"text/html",html:"text/html",htt:"text/webviewhtml",hxt:"text/html",ico:"image/x-icon",ief:"image/ief",iii:"application/x-iphone",ins:"application/x-internet-signup",isp:"application/x-internet-signup",IVF:"video/x-ivf",jar:"application/java-archive",jck:"application/liquidmotion",jcz:"application/liquidmotion",jfif:"image/pjpeg",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/x-javascript",jsx:"text/jscript",latex:"application/x-latex",lit:"application/x-ms-reader",lsf:"video/x-la-asf",lsx:"video/x-la-asf",m13:"application/x-msmediaview",m14:"application/x-msmediaview",m1v:"video/mpeg",m3u:"audio/x-mpegurl",man:"application/x-troff-man",manifest:"application/x-ms-manifest",map:"text/plain",mdb:"application/x-msaccess",me:"application/x-troff-me",mht:"message/rfc822",mhtml:"message/rfc822",mid:"audio/mid",midi:"audio/mid",mmf:"application/x-smaf",mno:"text/xml",mny:"application/x-msmoney",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"video/mpeg",mp3:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpp:"application/vnd.ms-project",mpv2:"video/mpeg",ms:"application/x-troff-ms",mvb:"application/x-msmediaview",mvc:"application/x-miva-compiled",nc:"application/x-netcdf",nsc:"video/x-ms-asf",nws:"message/rfc822",oda:"application/oda",odc:"text/x-ms-odc",ods:"application/oleobject",one:"application/onenote",onea:"application/onenote",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",osdx:"application/opensearchdescription+xml",p10:"application/pkcs10",p12:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7r:"application/x-pkcs7-certreqresp",p7s:"application/pkcs7-signature",pbm:"image/x-portable-bitmap",pdf:"application/pdf",pfx:"application/x-pkcs12",pgm:"image/x-portable-graymap",pko:"application/vnd.ms-pki.pko",pma:"application/x-perfmon",pmc:"application/x-perfmon",pml:"application/x-perfmon",pmr:"application/x-perfmon",pmw:"application/x-perfmon",png:"image/png",pnm:"image/x-portable-anymap",pnz:"image/png",pot:"application/vnd.ms-powerpoint",potm:"application/vnd.ms-powerpoint.template.macroEnabled.12",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",ppam:"application/vnd.ms-powerpoint.addin.macroEnabled.12",ppm:"image/x-portable-pixmap",pps:"application/vnd.ms-powerpoint",ppsm:"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",ppt:"application/vnd.ms-powerpoint",pptm:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",prf:"application/pics-rules",ps:"application/postscript",pub:"application/x-mspublisher",qt:"video/quicktime",qtl:"application/x-quicktimeplayer",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",ras:"image/x-cmu-raster",rf:"image/vnd.rn-realflash",rgb:"image/x-rgb",rm:"application/vnd.rn-realmedia",rmi:"audio/mid",roff:"application/x-troff",rpm:"audio/x-pn-realaudio-plugin",rtf:"application/rtf",rtx:"text/richtext",scd:"application/x-msschedule",sct:"text/scriptlet",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sgml:"text/sgml",sh:"application/x-sh",shar:"application/x-shar",sit:"application/x-stuffit",sldm:"application/vnd.ms-powerpoint.slide.macroEnabled.12",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",smd:"audio/x-smd",smx:"audio/x-smd",smz:"audio/x-smd",snd:"audio/basic",spc:"application/x-pkcs7-certificates",spl:"application/futuresplash",src:"application/x-wais-source",ssm:"application/streamingmedia",sst:"application/vnd.ms-pki.certstore",stl:"application/vnd.ms-pki.stl",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",svg:"image/svg+xml",swf:"application/x-shockwave-flash",t:"application/x-troff",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",texi:"application/x-texinfo",texinfo:"application/x-texinfo",tgz:"application/x-compressed",thmx:"application/vnd.ms-officetheme",tif:"image/tiff",tiff:"image/tiff",tr:"application/x-troff",trm:"application/x-msterminal",tsv:"text/tab-separated-values",txt:"text/plain",uls:"text/iuls",ustar:"application/x-ustar",vbs:"text/vbscript",vcf:"text/x-vcard",vcs:"text/plain",vdx:"application/vnd.ms-visio.viewer",vml:"text/xml",vsd:"application/vnd.visio",vss:"application/vnd.visio",vst:"application/vnd.visio",vsto:"application/x-ms-vsto",vsw:"application/vnd.visio",vsx:"application/vnd.visio",vtx:"application/vnd.visio",wav:"audio/wav",wax:"audio/x-ms-wax",wbmp:"image/vnd.wap.wbmp",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wks:"application/vnd.ms-works",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wmd:"application/x-ms-wmd",wmf:"application/x-msmetafile",wml:"text/vnd.wap.wml",wmlc:"application/vnd.wap.wmlc",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wmp:"video/x-ms-wmp",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wmz:"application/x-ms-wmz",wps:"application/vnd.ms-works",wri:"application/x-mswrite",wrl:"x-world/x-vrml",wrz:"x-world/x-vrml",wsdl:"text/xml",wvx:"video/x-ms-wvx",x:"application/directx",xaf:"x-world/x-vrml",xaml:"application/xaml+xml",xap:"application/x-silverlight-app",xbap:"application/x-ms-xbap",xbm:"image/x-xbitmap",xdr:"text/plain",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroEnabled.12",xlc:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.12",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroEnabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",xml:"text/xml",xof:"x-world/x-vrml",xpm:"image/x-xpixmap",xps:"application/vnd.ms-xpsdocument",xsd:"text/xml",xsf:"text/xml",xsl:"text/xml",xslt:"text/xml",xwd:"image/x-xwindowdump",z:"application/x-compress",zip:"application/x-zip-compressed"},oe=e=>{const t={};return e.replace(/^\?/,"").split("&").forEach(n=>{const[i,a]=n.split("=");i&&(t[decodeURIComponent(i)]=decodeURIComponent(a||""))}),t},qe=(e,t)=>{const[n,i]=e.split("?"),r={...i?oe(i):{},...t},l=ae(r);return`${n}?${l}`},ae=e=>{if(typeof e>"u"||typeof e!="object")return e;let t=[];for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===null)continue;typeof e[n]=="object"&&e[n].length?e[n].forEach(i=>{t.push(encodeURI(n+"="+i))}):typeof e[n]=="object"||t.push(encodeURI(n+"="+e[n]))}return t.join("&")};class ze extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}const We=(e,t={})=>{const n=new AbortController;let i=null;t.timeout&&(i=setTimeout(()=>n.abort(),t.timeout));const a=()=>{i!==null&&(clearTimeout(i),i=null)},r=c=>{const s=c,u=s.then.bind(s),p=s.catch.bind(s),E=s.finally.bind(s);return s.then=function(d,m){return r(u(d,m))},s.catch=function(d){return r(p(d))},s.finally=function(d){return r(E(d))},s.abort=d=>{a(),s.aborted=!0,n.abort(new ze(d||"request aborted."))},s.abortSilently=()=>{a(),s.aborted=!0;try{n.abort()}catch{}},s},l=fetch(e,{...t,signal:n.signal}).then(c=>(a(),c)).catch(c=>{throw a(),c});return r(l)},ji=(e,t,n)=>{if(t==null)return;const i=e.replace(/([A-Z])/g,"-$1").replace(/^-/,"");n[i]=String(t)},qi=e=>{const t={};if(!e)return t;if(e instanceof Headers)e.forEach((n,i)=>{t[i]=n});else if(Array.isArray(e))e.forEach(([n,i])=>{t[n]=String(i)});else for(const n in e)t[n]=String(e[n]);return t},Ge=e=>["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal","window"].includes(e),x=(e,t=null,n={})=>{n=n||{},n.method=n.method||"GET";const i=n.method.toUpperCase()==="GET",a=qi(n.headers);for(let l in n)!Ge(l)&&l!=="timeout"&&ji(l,n[l],a);i&&t&&(e=qe(e,typeof t=="string"?oe(t):t),t=null);const r={};for(let l in n)l==="timeout"?r.timeout=n.timeout:Ge(l)&&l!=="headers"&&(r[l]=n[l]);if(r.headers=a,!i){const l=a["Content-Type"]||a["content-type"];r.body=zi(t,l)}return We(e,r).then(l=>{if(!l.ok)throw new Error(`HTTP error! status: ${l.status}`);return l})},Ke=e=>typeof e=="string"||e instanceof FormData||e instanceof URLSearchParams||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e),zi=(e,t)=>{if(Ke(e)||typeof e!="object")return e;switch(t==null?void 0:t.toLowerCase()){case I:return JSON.stringify(e);case Ye:case je:default:return ae(e)}},Wi=(e,t=null,n={})=>x(e,t,{...n,ContentType:I,Accept:I}).then(i=>i.json()),Gi=(e,t=null,n={})=>x(e,t,{...n,method:"POST",ContentType:I,Accept:I}).then(i=>i.json()),Ki=(e,t,n=null,i={})=>{const a=new FormData;if(Object.keys(t).forEach(r=>{a.append(r,t[r],t[r].name)}),n)for(let r in n)n.hasOwnProperty(r)&&a.append(r,n[r]);return x(e,a,{...i,method:"POST"}).then(r=>r.json())},re=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(t=>re(t));if(e instanceof Object){const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n]=re(e[n]));return t}return e},Qi=e=>Object.keys(e).length===0,Vi=(e,t)=>{let n={};for(let i in e)t[i]!==void 0?n[t[i]]=e[i]:n[i]=e[i];return n},Ji=e=>Object.entries(e).map(([t,n])=>[/^\d+$/.test(t)?Number(t):t,n]),Xi=e=>{const t={};for(const[n,i]of e){const a=typeof n=="string"&&/^\d+$/.test(n)?Number(n):n;t[a]=i}return t},Zi=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[n,t])),eo=(e,t,n)=>{const i=t.split(".");let a=e;for(const r of i){if(a==null)return n;a=a[r]}return a!==void 0?a:n},to=(e,t,n)=>{const i=t.split("."),a=i.pop();let r=e;for(const l of i)(!(l in r)||typeof r[l]!="object")&&(r[l]={}),r=r[l];r[a]=n},Qe=(e,...t)=>{for(const n of t)for(const i in n)if(n.hasOwnProperty(i)){const a=n[i],r=e[i];a&&typeof a=="object"&&!Array.isArray(a)&&r&&typeof r=="object"&&!Array.isArray(r)?e[i]=Qe(r,a):e[i]=a}return e},Ve=(e,t=!1)=>{const n=e;for(const i in n)n[i]===null?delete n[i]:t&&typeof n[i]=="object"&&Ve(n[i],!0);return e},no=new Date().getFullYear(),io=new Date().getMonth()+1,oo=new Date().getDate(),ao=60*1e3,ro=60*60*1e3,N=24*60*60*1e3,co=7*N,so=30*N,lo=31*N,uo=365*N,po=366*N,mo=0,fo=1,ho=2,go=3,wo=4,Eo=5,vo=6,Je=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Xe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ze=["January","February","March","April","May","June","July","August","September","October","November","December"],et=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Mo=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],To=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],bo=["日","一","二","三","四","五","六"],yo=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],So=(e,t,n)=>{let i=()=>{if(t&&t(e),e-- >0){setTimeout(i,1e3);return}n&&n()};i()},Ao=e=>{if(!e||e<10)return"刚刚";e=Math.floor(e/1e3);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=e%60;let a="";return t>0&&(a+=t+"小时"),(n>0||t>0)&&(a+=n+"分钟"),a+=i+"秒前",a},_o=(e,t=!1)=>{const n=new Date(e);return new Date(n.getTime()-n.getTimezoneOffset()*6e4).toISOString().slice(0,t?19:16)},Oo=(e,t,n)=>e<=0?1/0:(Date.now()-n)/e*(t-e),tt={d:e=>{let t=e.getDate();return(t<10?"0":"")+t},D:e=>Xe[e.getDay()],j:e=>e.getDate(),l:e=>Je[e.getDay()],N:e=>{let t=e.getDay();return t===0?7:t},S:e=>{let t=e.getDate();return t%10===1&&t!==11?"st":t%10===2&&t!==12?"nd":t%10===3&&t!==13?"rd":"th"},w:e=>e.getDay(),z:e=>{let t=new Date(e.getFullYear(),0,1);return Math.ceil((e.getTime()-t.getTime())/864e5)},W:e=>{let t=new Date(e.valueOf()),n=(e.getDay()+6)%7;t.setDate(t.getDate()-n+3);let i=t.valueOf();t.setMonth(0,1),t.getDay()!==4&&t.setMonth(0,1+(4-t.getDay()+7)%7);let a=1+Math.ceil((i-t.getTime())/6048e5);return a<10?"0"+a:a},F:e=>Ze[e.getMonth()],m:e=>{let t=e.getMonth();return(t<9?"0":"")+(t+1)},M:e=>et[e.getMonth()],n:e=>e.getMonth()+1,t:e=>{let t=e.getFullYear(),n=e.getMonth()+1;return n===12&&(t=t++,n=0),new Date(t,n,0).getDate()},L:e=>{let t=e.getFullYear();return t%400===0||t%100!==0&&t%4===0},o:e=>{let t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},Y:e=>e.getFullYear(),y:e=>(""+e.getFullYear()).substr(2),a:e=>e.getHours()<12?"am":"pm",A:e=>e.getHours()<12?"AM":"PM",B:e=>Math.floor(((e.getUTCHours()+1)%24+e.getUTCMinutes()/60+e.getUTCSeconds()/3600)*1e3/24),g:e=>e.getHours()%12||12,G:e=>e.getHours(),h:e=>{let t=e.getHours();return((t%12||12)<10?"0":"")+(t%12||12)},H:e=>{let t=e.getHours();return(t<10?"0":"")+t},i:e=>{let t=e.getMinutes();return(t<10?"0":"")+t},s:e=>{let t=e.getSeconds();return(t<10?"0":"")+t},v:e=>{let t=e.getMilliseconds();return(t<10?"00":t<100?"0":"")+t},e:e=>Intl.DateTimeFormat().resolvedOptions().timeZone,I:e=>{let t=null;for(let n=0;n<12;++n){let a=new Date(e.getFullYear(),n,1).getTimezoneOffset();if(t===null)t=a;else if(a<t){t=a;break}else if(a>t)break}return e.getTimezoneOffset()===t?1:0},O:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},P:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+":"+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},T:e=>{let t=e.toLocaleTimeString(navigator.language,{timeZoneName:"short"}).split(" ");return t[t.length-1]},Z:e=>-e.getTimezoneOffset()*60,c:e=>ce("Y-m-d\\TH:i:sP",e),r:e=>e.toString(),U:e=>Math.floor(e.getTime()/1e3)},ce=function(e,t=null){let n=null;return typeof t=="object"&&t!==null?n=t:n=new Date(t||Date.now()),e.replace(/(\\?)(.)/g,function(i,a,r){return a===""&&tt[r]?String(tt[r](n)):r})},nt=e=>{const t=new Date,n=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),i=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=n.formatToParts(t),r=i.formatToParts(t),l=p=>{const E=p.find(v=>v.type==="year").value,d=p.find(v=>v.type==="month").value,m=p.find(v=>v.type==="day").value,_=p.find(v=>v.type==="hour").value,se=p.find(v=>v.type==="minute").value,U=p.find(v=>v.type==="second").value;return Date.UTC(Number(E),Number(d)-1,Number(m),Number(_),Number(se),Number(U))},c=l(a),s=l(r);return(c-s)/1e3/60},it=e=>{const t=Math.floor(e/60),n=Math.abs(e%60);return`${t>=0?"+":"-"}${String(Math.abs(t)).padStart(2,"0")}:${String(n).padStart(2,"0")}`},Co=e=>{const t=nt(e);return it(t)},Io=e=>ce("W",e);o.AbortError=ze,o.BLOCK_TAGS=ee,o.Base64Encode=vn,o.COMMON_DPI=96,o.DATE_NOW=oo,o.DAY_FRIDAY=Eo,o.DAY_MONDAY=fo,o.DAY_SATURDAY=vo,o.DAY_SUNDAY=mo,o.DAY_THURSDAY=wo,o.DAY_TUESDAY=ho,o.DAY_WEDNESDAY=go,o.GOLDEN_RATIO=Wt,o.MIME_BINARY_DEFAULT=xi,o.MIME_EXTENSION_MAP=Yi,o.MIME_FORM=Ye,o.MIME_HTML=$i,o.MIME_JSON=I,o.MIME_MULTIPART=je,o.MIME_TEXT=Ui,o.MONTH_NAMES_CN=Mo,o.MONTH_NAMES_EN=Ze,o.MONTH_NAMES_SHORT_CN=To,o.MONTH_NAMES_SHORT_EN=et,o.MONTH_NOW=io,o.ONE_DAY=N,o.ONE_HOUR=ro,o.ONE_MINUTE=ao,o.ONE_MONTH30=so,o.ONE_MONTH31=lo,o.ONE_WEEK=co,o.ONE_YEAR365=uo,o.ONE_YEAR366=po,o.PAIR_TAGS=Ei,o.REMOVABLE_TAGS=Le,o.SCREEN_DPI=pe,o.SELF_CLOSING_TAGS=vi,o.STAND_DPI=$,o.TRIM_BOTH=q,o.TRIM_LEFT=z,o.TRIM_RIGHT=Me,o.WEEK_DAY_NAMES_CN=yo,o.WEEK_DAY_NAMES_EN=Je,o.WEEK_DAY_NAMES_SHORT_CN=bo,o.WEEK_DAY_NAMES_SHORT_EN=Xe,o.YEAR_NOW=no,o.abortableFetch=We,o.arrayChunk=xt,o.arrayColumn=kt,o.arrayDistinct=Pt,o.arrayGroup=Bt,o.arrayIndex=Ht,o.arraySortByKey=Ft,o.arrayTrimTail=Ut,o.base64Decode=wn,o.base64UrlSafeEncode=En,o.between=M,o.bindClick=$n,o.bindDomEvent=y,o.bindDoubleClick=qn,o.bindInputDebounce=zn,o.bindKeyDown=jn,o.bindKeyUp=Yn,o.bindNodeMove=mi,o.bindStorageEvent=Wn,o.blobToBase64=Te,o.blobToDataUri=X,o.buildHtmlHidden=Ai,o.buildStyleVars=di,o.calcRemainingMSecs=Oo,o.camelCase=rn,o.cancelScrollAnimation=De,o.capitalize=ge,o.clamp01=ot,o.cleanNull=Ve,o.convertMinutesToTimezoneOffsetStr=it,o.countDown=So,o.createDomByHtml=pi,o.cssSelectorEscape=bi,o.cutString=on,o.debounce=On,o.decodeHTMLEntities=Si,o.deepClone=re,o.deleteCookie=P,o.deleteCookieAllPaths=yn,o.detectLanguage=qt,o.detectedPrecision=en,o.digitCount=tn,o.disabled=_e,o.dispatchEvent=Fn,o.downloadFile=wi,o.easeInBack=_t,o.easeInBounce=Rt,o.easeInCirc=yt,o.easeInCubic=lt,o.easeInElastic=It,o.easeInExpo=Mt,o.easeInOutBack=Ct,o.easeInOutBounce=Lt,o.easeInOutCirc=At,o.easeInOutCubic=ue,o.easeInOutElastic=Dt,o.easeInOutExpo=bt,o.easeInOutQuad=st,o.easeInOutQuart=mt,o.easeInOutQuint=gt,o.easeInOutSine=vt,o.easeInQuad=rt,o.easeInQuart=pt,o.easeInQuint=ft,o.easeInSine=wt,o.easeOutBack=Ot,o.easeOutBounce=L,o.easeOutCirc=St,o.easeOutCubic=ut,o.easeOutElastic=Nt,o.easeOutExpo=Tt,o.easeOutQuad=ct,o.easeOutQuart=dt,o.easeOutQuint=ht,o.easeOutSine=Et,o.easeValue=at,o.enabled=Oe,o.enterFullScreen=de,o.entityToString=yi,o.escapeAttr=te,o.escapeHtml=ke,o.eventDelegate=Un,o.exitFullScreen=me,o.extract=an,o.fileToBase64DataUri=gi,o.findAll=J,o.findOne=T,o.fixBaseUrl=ui,o.floatVal=we,o.formatDate=ce,o.formatSize=gn,o.getBoundingClientRect=Ne,o.getCookie=bn,o.getDomDimension=ci,o.getJson=Wi,o.getNodeXPath=ei,o.getTimezoneOffsetMinutes=nt,o.getTimezoneOffsetStr=Co,o.getUTF8StrLen=ln,o.getWeekNumber=Io,o.guid=be,o.hide=Kn,o.highlightText=Ii,o.html2Text=Mi,o.imgToBase64=Ni,o.insertStyleSheet=Ie,o.isBodyInit=Ke,o.isChinese=hn,o.isEmptyObject=Qi,o.isFirefox=zt,o.isFocusable=oi,o.isFunction=Dn,o.isInFullScreen=fe,o.isJSON=Rn,o.isJson=In,o.isLandscape=$t,o.isNumberic=C,o.isObject=Nn,o.isPortrait=Yt,o.isPromise=Cn,o.isUrl=ye,o.kebabCase=cn,o.keepRectInContainer=ni,o.lerp=le,o.limit=Xt,o.linear=O,o.loadCss=ai,o.loadScript=ri,o.lockElementInteraction=Xn,o.markdown2Html=Oi,o.md5=Fi,o.mmToPt=Qt,o.mmToPx=Gt,o.mmToTwip=Kt,o.msToHMS=Ao,o.mutationEffective=Ce,o.nodeIndex=Zn,o.objToQuery=ae,o.objectEntries=Ji,o.objectFromEntries=Xi,o.objectGet=eo,o.objectKeyReplace=Vi,o.objectMerge=Qe,o.objectSet=to,o.objectSwitchKV=Zi,o.offEvent=Ae,o.onDocReady=xn,o.onDomTreeChange=ti,o.onEvent=Se,o.onEvents=Bn,o.onHover=Jn,o.parseUnit=k,o.postFiles=Ki,o.postJson=Gi,o.precisionToStep=li,o.printStack=Ln,o.ptToMm=Vt,o.pxToMm=Jt,o.queryReplace=qe,o.queryToObj=oe,o.randomInt=Zt,o.randomString=ve,o.randomWords=pn,o.rectAssoc=ii,o.rectInLayout=si,o.regQuote=H,o.remove=Vn,o.request=x,o.round=he,o.sanitizeFileName=hi,o.scrollToAnimated=fi,o.setCookie=Tn,o.show=Qn,o.srcToBase64=Ri,o.strChunk=fn,o.strToPascalCase=dn,o.stringToEntity=Ci,o.stripSlashes=nn,o.svgGetDimension=Be,o.svgToImg=Pe,o.svgToImgData=Di,o.svgToSrc=He,o.text2Html=Ti,o.throttle=An,o.throttleEffect=_n,o.timestampToDateTimeLocal=_o,o.toggleDisabled=V,o.toggleFullScreen=jt,o.triggerDomEvent=Gn,o.trim=mn,o.truncate=sn,o.unescapeHtml=_i,o.unitConvert=Y,o.urlB64DataCache=Z,o.utf8Decode=Ee,o.utf8Encode=j,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(o,N){typeof exports=="object"&&typeof module<"u"?N(exports):typeof define=="function"&&define.amd?define(["exports"],N):(o=typeof globalThis<"u"?globalThis:o||self,N(o.Minutool={}))})(this,function(o){"use strict";const N=e=>e,rt=e=>Math.min(1,Math.max(0,e)),pe=(e,t,n)=>e+(t-e)*n,ct=(e,t,n,i=N)=>pe(e,t,i(n)),st=e=>e*e,lt=e=>1-(1-e)*(1-e),ut=e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,pt=e=>e*e*e,mt=e=>1-Math.pow(1-e,3),me=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,dt=e=>e*e*e*e,ft=e=>1-Math.pow(1-e,4),ht=e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,gt=e=>e*e*e*e*e,wt=e=>1-Math.pow(1-e,5),Et=e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,Mt=e=>1-Math.cos(e*Math.PI/2),vt=e=>Math.sin(e*Math.PI/2),Tt=e=>-(Math.cos(Math.PI*e)-1)/2,bt=e=>e===0?0:Math.pow(2,10*e-10),yt=e=>e===1?1:1-Math.pow(2,-10*e),St=e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,At=e=>1-Math.sqrt(1-Math.pow(e,2)),_t=e=>Math.sqrt(1-Math.pow(e-1,2)),Ot=e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,Ct=(e,t=1.70158)=>(t+1)*e*e*e-t*e*e,It=(e,t=1.70158)=>1+(t+1)*Math.pow(e-1,3)+t*Math.pow(e-1,2),Nt=(e,t=1.70158)=>{const n=t*1.525;return e<.5?Math.pow(2*e,2)*((n+1)*2*e-n)/2:(Math.pow(2*e-2,2)*((n+1)*(e*2-2)+n)+2)/2},Dt=e=>{if(e===0||e===1)return e;const t=2*Math.PI/3;return-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*t)},Rt=e=>{if(e===0||e===1)return e;const t=2*Math.PI/3;return Math.pow(2,-10*e)*Math.sin((e*10-.75)*t)+1},Lt=e=>{if(e===0||e===1)return e;const t=2*Math.PI/4.5;return e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*t))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*t)/2+1},P=e=>e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375,kt=e=>1-P(1-e),Ht=e=>e<.5?(1-P(1-2*e))/2:(1+P(2*e-1))/2,Pt=(e,t)=>{let n=[];for(let i=0;i<e.length;i++)n.push(e[i][t]);return n},Bt=(e,t)=>{for(let n=0;n<e.length;n++)if(e[n]===t)return n;return null},xt=(e,t)=>{let n=new Map;return e.filter((i,a)=>{let r=t?t(i,a):i;if(!n.has(r))return n.set(r,!0),!0})},Ft=(e,t,n)=>{if(!e||!e.length)return e;let i={};if(e.forEach(r=>{let c=r[t];i[c]||(i[c]=[]),i[c].push(r)}),!n)return i;let a={};for(let r in i)a[r]=i[r][0];return a},Ut=e=>Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{}),$t=(e,t)=>{let n=e.length;if(t<1||!n)return[];if(t>n)return[e];let i=[],a=Math.floor(n/t),r=n%t;for(let c=1;c<=a;c++)i.push(e.splice(0,t));return r&&i.push(e.splice(0,r)),i},Yt=e=>{let t=-1;for(let n=e.length-1;n>=0;n--)if(e[n]){t=n;break}return e.slice(0,t+1)},de=window.devicePixelRatio*96,jt=()=>window.innerWidth>window.innerHeight,qt=()=>window.innerHeight>window.innerWidth,fe=e=>{const t=e;if(e.requestFullscreen)return e.requestFullscreen();if(t.webkitRequestFullScreen)return t.webkitRequestFullScreen();throw t.mozRequestFullScreen&&t.mozRequestFullScreen(),t.msRequestFullScreen&&t.msRequestFullScreen(),"Browser no allow full screen"},he=()=>document.exitFullscreen(),zt=e=>new Promise((t,n)=>{ge()?he().then(t).catch(n):fe(e).then(t).catch(n)}),ge=()=>!!document.fullscreenElement,Wt=e=>{const t=navigator.language||navigator.userLanguage;if(e.includes(t))return t;const n=t.split("-")[0],i=e.find(a=>a.startsWith(n));return i||e[0]},Gt=()=>navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Kt=(1+Math.sqrt(5))/2-1,q=96,Qt=(e,t=q)=>e/25.4*t,Vt=e=>Math.round(e*56.6929),Jt=e=>e*2.83464566929,Xt=e=>e/2.83464566929,Zt=(e,t=q)=>25.4*e/t,en=(e,t,n)=>Math.min(Math.max(e,t),n),v=(e,t,n,i=!0)=>i?e>=t&&e<=n:e>t&&e<n,tn=(e,t)=>Math.floor(Math.random()*(t+1-e))+e,we=(e,t=2)=>{let n=Math.pow(10,t);return Math.round(e*n)/n},D=e=>typeof e=="number"?isFinite(e):typeof e!="string"?!1:/^[+-]?(\d+\.?\d*|\.\d+)$/.test(e),nn=(...e)=>{let t=0;return e.forEach(n=>{if(typeof n=="number"&&D(n)){const i=n.toString().split(".")[1];i&&(t=Math.max(t,i.length))}}),t},on=e=>(e=Math.abs(Number(e)),e===0?1:Math.floor(Math.log10(e))+1),Ee=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),B=(e,t="")=>{if(typeof e=="number")return{val:e,unit:t};if(D(e))return{val:parseFloat(e),unit:t};const n=/^(-?[\d.]+)([a-z%]+)$/i,i=e.trim().match(n);if(!i)throw new Error("unit parse fail:"+e);return{val:parseFloat(i[1]),unit:i[2].toLowerCase()}},z=(e,t,n={})=>{const i=B(e);if(!i)throw new Error(`Invalid value: ${e}`);const a=i.val,r=i.unit;if(!D(a))throw new Error(`Invalid number in value: ${e}`);const c=n.dpi||de;if(r===t)return a;const s={mm:1,cm:10,in:25.4,px:25.4/c,pt:25.4/72,pc:25.4/6},l={mm:1,cm:1/10,in:1/25.4,px:c/25.4,pt:72/25.4,pc:6/25.4};if(!s[r])throw new Error(`Unsupported source unit: ${r}`);if(!l[t])throw new Error(`Unsupported target unit: ${t}`);return a*s[r]*l[t]},Me=(e,t=0)=>D(e)?parseFloat(String(e)):t,an=e=>(e+"").replace(/\\(.?)/g,function(t,n){switch(n){case"\\":return"\\";case"0":return"\0";case"":return"";default:return n}}),rn=(e,t,n="...")=>{let i=/[^\x00-\xff]/g;if(e.replace(i,"mm").length<=t)return e;let a=Math.floor(t/2);for(let r=a;r<e.length;r++)if(e.substr(0,r).replace(i,"mm").length>=t)return e.substr(0,r)+n;return e},cn=(e,t)=>{const n=Object.keys(t),i=Object.values(t);return new Function(...n,`return \`${e}\`;`)(...i)},sn=e=>e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase()),ln=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),un=(e,t,n="...")=>e.length<=t?e:e.slice(0,t)+n,x=e=>(e+"").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1"),ve=e=>{let t="",n=0,i=0,a=0,r=0;for(;n<e.length;)i=e.charCodeAt(n),i<128?(t+=String.fromCharCode(i),n++):i>191&&i<224?(a=e.charCodeAt(n+1),t+=String.fromCharCode((i&31)<<6|a&63),n+=2):(a=e.charCodeAt(n+1),r=e.charCodeAt(n+2),t+=String.fromCharCode((i&15)<<12|(a&63)<<6|r&63),n+=3);return t},W=e=>{e=e.replace(/\r\n/g,"n");let t="";for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(i&63|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(i&63|128))}return t},pn=e=>{let t=0,n=e.length,i=-1;for(let a=0;a<n;a++)i=e.charCodeAt(a),i>=0&&i<=128?t+=1:t+=3;return t},mn="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890",Te=(e=6,t=mn)=>{let n="";for(let i=0;i<e;i++){let a=Math.round(Math.random()*(t.length-1));n+=t.substring(a,a+1)}return n},dn=(e=1,t=8)=>{let n=[];const i="bcdfghjklmnpqrstvwxyz",a="aeiou";for(;e-- >0;){let r="";for(let c=0;c<t;c=c+3)r+=i[Math.floor(Math.random()*i.length)],r+=a[Math.floor(Math.random()*a.length)],r+=i[Math.floor(Math.random()*i.length)];n.push(r)}return n},fn=(e,t=!1)=>{let n=[];return e.replace(/[-_\s+]/g," ").split(" ").forEach((i,a)=>{n.push(a===0&&!t?i:Ee(i))}),n.join("")},G=0,K=1,be=2,hn=(e,t="",n=G)=>{if(t.length){let i=new RegExp("^["+x(t)+"]+"),a=new RegExp("["+x(t)+"]+$");return n===K?e.replace(i,""):n===be?e.replace(a,""):e.replace(i,"").replace(a,"")}else return n===G?e.trim():n===K?e.trimStart():e.trimEnd()},gn=(e,t)=>{let n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n},wn=e=>/[\u4e00-\u9fa5]/.test(e),En=(e,t="B",n=2)=>{const i=["B","KB","MB","GB","TB","PB"];let a=i.indexOf(t.toUpperCase());if(a===-1)throw new Error(`Unsupported unit: ${t}`);for(;e>=1024&&a<i.length-1;)e/=1024,a++;return we(e,n)},b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Mn=e=>{let t="",n,i,a,r,c,s,l,u=0;for(e=e.replace(/\+\+[++^A-Za-z0-9+/=]/g,"");u<e.length;)r=b.indexOf(e.charAt(u++)),c=b.indexOf(e.charAt(u++)),s=b.indexOf(e.charAt(u++)),l=b.indexOf(e.charAt(u++)),n=r<<2|c>>4,i=(c&15)<<4|s>>2,a=(s&3)<<6|l,t=t+String.fromCharCode(n),s!==64&&(t=t+String.fromCharCode(i)),l!==64&&(t=t+String.fromCharCode(a));return t=ve(t),t},vn=e=>W(e).replace("+","-").replace("/","_"),Tn=e=>{let t="",n,i,a,r,c,s,l,u=0;for(e=W(e);u<e.length;)n=e.charCodeAt(u++),i=e.charCodeAt(u++),a=e.charCodeAt(u++),r=n>>2,c=(n&3)<<4|i>>4,s=(i&15)<<2|a>>6,l=a&63,isNaN(i)?s=l=64:isNaN(a)&&(l=64),t=t+b.charAt(r)+b.charAt(c)+b.charAt(s)+b.charAt(l);return t},ye=async e=>await bn(e),bn=e=>new Promise((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=a=>n(a)}),yn=(e,t,n,i="/",a)=>{let r="";if(n){let s=new Date;s.setTime(Date.now()+n*24*60*60*1e3),r="; expires="+s.toUTCString()}let c=e+"="+(t||"")+r+"; path="+i;a&&(c+="; domain="+a),document.cookie=c},Sn=e=>{let t=e+"=",n=document.cookie.split(";");for(let i=0;i<n.length;i++){let a=n[i];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},F=(e,t="/",n)=>{let i=e+"=; Path="+t+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";n&&(i+=" Domain="+n+";"),document.cookie=i},An=(e,t)=>{const n=(t||(location==null?void 0:location.hostname)).split(".");for(;n.length>1;)F(e,"/",n.join(".")),F(e,"/","."+n.join(".")),n.shift();F(e)};let _n=0;const Se=(e="")=>"guid_"+(e||Te(6))+ ++_n,On=(e,t)=>{let n,i,a=0;return function(){let r=+new Date;n=this,i=arguments,r-a>t&&(e.apply(n,i),a=r)}},Cn=(e,t)=>{let n,i,a=0,r=!1;return function(){if(r)return;let c=+new Date;n=this,i=arguments;let s=t-(c-a);s<=0?(e.apply(n,i),a=c):(r=!0,setTimeout(()=>{e.apply(n,i),r=!1,a=c},s))}},In=(e,t)=>{let n;return function(){let i=this,a=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(i,a)},t)}},Nn=e=>e&&typeof e=="object"&&e.then&&typeof e.then=="function",Dn=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},Rn=e=>e&&typeof e=="object"&&!Array.isArray(e),Ln=e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!1,Ae=e=>typeof e!="string"||e.trim()===""?!1:/^(https?:\/\/|\/\/|\/|\.\.?\/*)/i.test(e),kn=e=>{let t=!1;try{JSON.parse(e),t=!0}catch{}return t},Hn=()=>{let e=new Error().stack;console.log(e)},Q=new EventTarget,Pn=new Map,V=new Map;let Bn=0;const xn="__MINUTOOL_SYM_EVENT__";function J(e){if(!V.has(e)){const t=`${xn}${++Bn}`;V.set(e,t),Pn.set(t,e)}return V.get(e)}const Fn=(e,t)=>{const n=e.map(i=>_e(i,t));return()=>n.forEach(i=>i())},_e=(e,t)=>(Q.addEventListener(typeof e=="symbol"?J(e):e,t),()=>Oe(e,t)),Oe=(e,t)=>{Q.removeEventListener(typeof e=="symbol"?J(e):e,t)},Un=(e,t)=>{Q.dispatchEvent(new CustomEvent(typeof e=="symbol"?J(e):e,{detail:t}))},$n=e=>{if(document.readyState==="complete"||document.readyState==="interactive")e();else{const t=()=>{e(),document.removeEventListener("DOMContentLoaded",t)};document.addEventListener("DOMContentLoaded",t)}},Yn=(e,t,n,i)=>y(e,n,r=>{var l;const c=r.target,s=(l=c==null?void 0:c.closest)==null?void 0:l.call(c,t);s&&i(r,s)}),jn=(e,t)=>y(e,"click",t),qn=(e,t)=>y(e,"keyup",t),zn=(e,t)=>y(e,"keydown",t),Wn=(e,t)=>y(e,"dblclick",t),y=(e,t,n,i)=>{const a=c=>{n(c)},r=typeof e=="string"?T(e):e;if(!r)throw new Error(`EventTarget not found for selector: ${e}`);return r.addEventListener(t,a,i),()=>{r.removeEventListener(t,a,i)}},Gn=(e,t,n=50)=>{let i=!1,a=null,r=null,c=null;const s=E=>{let M=E.target.value;r!==M&&(r=M,t(M,E))},l=E=>{const d=E;d.isComposing||i||(c=d,a&&clearTimeout(a),a=window.setTimeout(()=>{a=null,!(i||!c)&&(s(c),c=null)},n))},u=()=>{i=!0},p=()=>{i=!1};return e.addEventListener("input",l),e.addEventListener("compositionstart",u),e.addEventListener("compositionend",p),()=>{e.removeEventListener("input",l),e.removeEventListener("compositionstart",u),e.removeEventListener("compositionend",p),a&&(clearTimeout(a),a=null),c=null}},Kn=(e,t)=>{const n=i=>{i.key===e&&t(i.newValue)};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}},Qn=(e,t)=>{if("createEvent"in document){let n=document.createEvent("HTMLEvents");n.initEvent(t.toLowerCase(),!1,!0),e.dispatchEvent(n)}else e.fireEvent("on"+t.toLowerCase())},Vn=e=>{const t=T(e);t&&(t.style.display="none")},Jn=e=>{const t=T(e);t&&(t.style.display="")},Xn=e=>{let t=T(e);return t&&t.parentNode&&t.parentNode.removeChild(t)},X="disabled",Ce=(e,t="")=>Z(e,t,!1),Ie=(e,t="")=>Z(e,t,!0),Z=(e,t="",n=null)=>{let i=T(e),a=n===null?!i.classList.contains(X):!n;a&&De(`.${X} {pointer-event:none !important;}`,"__element_lock_style__"),i.classList.toggle(X,a),i[a?"setAttribute":"removeAttribute"]("disabled","disabled"),i[a?"setAttribute":"removeAttribute"]("data-disabled","disabled"),t&&i.classList.toggle(t,a)},Zn=(e,t,n)=>{e=T(e);let i=!1;const a=[];return a.push(y(e,"mouseenter",()=>{i||(i=!0,t&&t())})),a.push(y(e,"mouseleave",()=>{i&&(i=!1,n&&n())})),()=>{a.forEach(r=>r())}},ei=(e,t)=>{Ce(e),t(()=>{Ie(e)})},ti=e=>e.parentNode?Array.prototype.indexOf.call(e.parentNode.children,e):-1,ee=(e,t=document)=>{if(typeof e=="string")return e=e.trim(),e.indexOf(":scope")!==0&&(e=":scope "+e),Array.from(t.querySelectorAll(e));if(Array.isArray(e)){let n=[];return e.forEach(i=>{n.push(...ee(i))}),n}else return NodeList.prototype.isPrototypeOf(e)||HTMLCollection.prototype.isPrototypeOf(e)?Array.from(e):e instanceof HTMLElement?[e]:e},T=(e,t=document)=>typeof e=="string"?t.querySelector(e):e,ni=e=>{let t=document.getElementsByTagName("*"),n=[];for(n=[];e&&e.nodeType===1;e=e.parentNode)if(e.hasAttribute("id")){let i=0;for(let a=0;a<t.length&&(t[a].hasAttribute("id")&&t[a].id===e.id&&i++,!(i>1));a++);if(i===1)return n.unshift('id("'+e.getAttribute("id")+'")'),n.join("/");n.unshift(e.localName.toLowerCase()+'[@id="'+e.getAttribute("id")+'"]')}else if(e.hasAttribute("class"))n.unshift(e.localName.toLowerCase()+'[@class="'+e.getAttribute("class")+'"]');else{let i,a;for(i=1,a=e.previousSibling;a;a=a.previousSibling)a.localName===e.localName&&i++;n.unshift(e.localName.toLowerCase()+"["+i+"]")}return n.length?"/"+n.join("/"):null},ii=(e,t,n=!0)=>{const i="ON_DOM_TREE_CHANGE_BIND_"+Se();let a=()=>{ee(`input:not([${i}]), textarea:not([${i}]), select:not([${i}])`,e).forEach(r=>{r.setAttribute(i,"1"),r.addEventListener("change",t)})};Ne(e,{attributes:!0,subtree:!0,childList:!0},()=>{n&&a(),t()},10),n&&a()},Ne=(e,t,n,i=10)=>{let a=0,r=!1,c=new MutationObserver(()=>{if(r)return;let s=i-(Date.now()-a);s>0?(r=!0,setTimeout(()=>{r=!1,a=Date.now(),n(c)},s)):(a=Date.now(),n(c))});c.observe(e,t)},oi=(e,t={left:0,top:0,width:window.innerWidth,height:window.innerHeight})=>{let n={left:e.left,top:e.top};return e.width>t.width||e.height>t.height||(e.width+e.left>t.width+t.left&&(n.left=e.left-(e.width+e.left-(t.width+t.left))),e.height+e.top>t.height+t.top&&(n.top=e.top-(e.height+e.top-(t.height+t.top))),e.left<t.left&&(n.left=t.left),e.top<t.top&&(n.top=t.top)),n},ai=(e,t)=>e.left<=t.left?e.left+e.width>=t.left&&(v(t.top,e.top,e.top+e.height)||v(t.top+t.height,e.top,e.top+e.height)||t.top>=e.top&&t.height>=e.height):t.left+t.width>=e.left&&(v(e.top,t.top,t.top+t.height)||v(e.top+e.height,t.top,t.top+t.height)||e.top>=t.top&&e.height>=t.height),ri=e=>e?!!(e.tabIndex>=0||e instanceof HTMLAnchorElement&&e.href||e instanceof HTMLButtonElement&&!e.disabled||e instanceof HTMLInputElement&&!e.disabled||e instanceof HTMLTextAreaElement&&!e.disabled):!1;let S={};const ci=(e,t=!1)=>(!t&&e in S||(S[e]=new Promise((n,i)=>{let a=document.createElement("link");a.rel="stylesheet",a.href=e,a.onload=()=>{n()},a.onerror=()=>{i()},document.head.append(a)})),S[e]),si=(e,t=!1)=>(!t&&e in S||(S[e]=new Promise((n,i)=>{let a=document.createElement("script");a.src=e,a.onload=()=>{n()},a.onerror=()=>{i()},document.head.append(a)})),S[e]),li=e=>{let t=e.style.visibility,n=e.style.display,i,a;return e.style.visibility="hidden",e.style.display="block",i=e.clientWidth,a=e.clientHeight,e.style.visibility=t,e.style.display=n,{width:i,height:a}},De=(e,t="",n=document)=>{if(t&&n.querySelector(`#${t}`))return n.querySelector(`#${t}`);let i=n.createElement("style");return n.head.appendChild(i),i.innerHTML=e,t&&(i.id=t),i},ui=(e,t)=>v(e.top,t.top,t.top+t.height)&&v(e.left,t.left,t.left+t.width)&&v(e.top+e.height,t.top,t.top+t.height)&&v(e.left+e.width,t.left,t.left+t.width),pi=e=>Math.pow(10,-e),mi=(e,t)=>{try{return new URL(e,t).href}catch{return e}},di=(e,t=null)=>{const n=document.createElement("template");e=e.trim(),n.innerHTML=e;let i=[];return t?Array.from(n.content.children).forEach(a=>{i.push(t.appendChild(a))}):i=Array.from(n.content.children),i.length===1?i[0]:i},Re=(e,t=!1)=>{if(!e)throw new Error("el is null");const n=e.getBoundingClientRect();if(t&&!n.height){const i=e.style.visibility,a=e.style.display;e.style.visibility="hidden",e.style.display="block";const r=Re(e);return e.style.visibility=i,e.style.display=a,r}return{top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width,height:n.height}},fi=e=>{let t={};for(let n in e){const i=e[n];i!=null&&(t[`--${n}`]=`${i}`)}return t},hi=(e,t=null,{lockInView:n=!1,onStart:i,onEnd:a,onMove:r}={})=>{const c=T(e);t=T(t||c);const s=c.style.position,l=c.style.left,u=c.style.top,p=c.style.transform;let E=!1,d=0,M=0;const _=m=>{if(!E)return;c.style.position="fixed",c.style.transform="none";let I=m.clientX-d,j=m.clientY-M;if(n){const Ro=window.innerWidth-c.offsetWidth,Lo=window.innerHeight-c.offsetHeight;I=Math.min(Math.max(0,I),Ro),j=Math.min(Math.max(0,j),Lo)}c.style.left=`${I}px`,c.style.top=`${j}px`,r&&r(I,j)},O=()=>{E=!1,document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",O),a&&a(parseInt(c.style.left,10),parseInt(c.style.top,10))},C=m=>{if(m.button!==0||i&&i()===!1)return;E=!0;const I=c.getBoundingClientRect();d=m.clientX-I.left,M=m.clientY-I.top,document.addEventListener("mousemove",_),document.addEventListener("mouseup",O),m.preventDefault()};return t.addEventListener("mousedown",C),()=>{O(),t.removeEventListener("mousedown",C),c.style.position=s,c.style.left=l,c.style.top=u,c.style.transform=p}},k=new WeakMap,Le=e=>{const t=k.get(e);t&&(cancelAnimationFrame(t.raf),k.delete(e),e.style.scrollBehavior=t.prevBehavior)},gi=(e,t,n={})=>{const{duration:i=380,axis:a="scrollLeft",onEnd:r,easingFn:c=me}=n;Le(e);const s=e.style.scrollBehavior;e.style.scrollBehavior="auto";const l=a==="scrollLeft"?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,u=Math.max(0,Math.min(l,t)),p=e[a],E=u-p,d=()=>{e.style.scrollBehavior=s,r==null||r()};if(Math.abs(E)<1){d();return}const M=performance.now(),_=O=>{const C=Math.min(1,(O-M)/i);e[a]=p+E*c(C);const m=k.get(e);C<1&&m?m.raf=requestAnimationFrame(_):(k.delete(e),d())};k.set(e,{raf:requestAnimationFrame(_),prevBehavior:s})},wi=e=>e.replace(/[\\/:*?"<>|]/g,"_").replace(/[\0-\x1F]/g,"_").replace(/\s+/g," ").replace(/^\.+/,"").replace(/\.+$/,"").trim(),te=e=>new Promise((t,n)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=a=>n(a),i.readAsDataURL(e)}),ke={},ne=(e,t=null)=>t!==null?(ke[e]=t,null):ke[e]||null,Ei=async e=>{if(!e)return null;if(typeof e=="string"&&e.startsWith("data:"))return e;try{if(typeof e=="string"&&Ae(e)){const t=await fetch(e);if(!t.ok)throw new Error(`Fetch failed: ${t.status}`);const n=await t.blob();return await te(n)}return e instanceof Blob?await te(e):null}catch(t){return console.warn("file2Base64DataURL failed:",t),null}},Mi=(e,t)=>{const n=document.createElement("a");n.rel="noopener noreferrer",n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)},ie=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","CANVAS","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","NOSCRIPT","OL","P","PRE","SECTION","TABLE","TFOOT","UL","VIDEO"],vi=["A","ABBR","ACRONYM","B","BDO","BIG","BUTTON","CITE","CODE","DFN","EM","I","KBD","LABEL","MAP","OBJECT","OUTPUT","Q","S","SAMP","SCRIPT","SELECT","SMALL","SPAN","STRONG","SUB","SUP","TEXTAREA","TIME","TT","U","VAR"].concat(...ie),Ti=["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"],He=["STYLE","COMMENT","SELECT","OPTION","SCRIPT","TITLE","HEAD","BUTTON","META","LINK","PARAM","SOURCE"],bi=(e,t={})=>{t.keepLineBreak=t.keepLineBreak!==!1;const n=t.imgReplacer!==void 0?t.imgReplacer:"[Image]";e=e.replace(/<img[^>]*src=["']([^"']*)["'][^>]*alt=["']([^"']*)["'][^>]*>/gi,function(r,c,s){return typeof n=="function"?n(c,s):n}),e=e.replace(/<img[^>]*alt=["']([^"']*)["'][^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,c,s){return typeof n=="function"?n(s,c):n}),e=e.replace(/<img[^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,c){return typeof n=="function"?n(c,""):n});const i=t.videoReplacer!==void 0?t.videoReplacer:"[Video]";return e=e.replace(/<video[^>]*src=["']([^"']*)["'][^>]*>/gi,function(r,c){return typeof i=="function"?i(c,""):i}),e=e.replace(/<video[^>]*>[\s\S]*?<source[^>]*src=["']([^"']*)["'][^>]*>[\s\S]*?<\/video>/gi,function(r,c){return typeof i=="function"?i(c,""):i}),He.forEach(r=>{e=e.replace(new RegExp(`<${r}[^>]*>([\\s\\S]*?)<\\/${r}>`,"gi"),""),e=e.replace(new RegExp(`<${r}[^>]*>`,"gi"),"")}),e=e.replace(/[\r|\n]/g,""),e=e.replace(/<(\w+)([^>]*)>/g,function(r,c,s){return ie.includes(c.toUpperCase())?`
|
|
2
|
+
`:""}),e=e.replace(/<\/(\w+)([^>]*)>/g,function(r,c,s){return""}),e=e.replace(/<[^>]+>/g,""),[[/ /gi," "],[/</gi,"<"],[/>/gi,">"],[/"/gi,'"'],[/'/gi,"'"]].forEach(([r,c])=>{e=e.replace(r,c)}),e=e.replace(/&#(\d+);/g,function(r,c){return String.fromCharCode(parseInt(c))}),e=e.replace(/&/gi,"&"),t.keepLineBreak||(e=e.replace(/\n+/g," ")),e=e.trim(),e},yi=e=>Pe(e,0,!1).replace(/\n/g,"<br/>"),Si=e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g,"\\$&"),Ai=e=>{let t=e.split(";");return t.pop(),t.map(n=>String.fromCharCode(n[2]==="x"?parseInt(n.slice(3),16):parseInt(n.slice(2)))).join("")};let H;const _i=e=>(H||(H=document.createElement("div")),e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),H.innerHTML=e,e=H.textContent||"",H.textContent="",e),Oi=e=>{let t="";for(let n in e){let i=e[n]===null?"":e[n];t+=`<input type="hidden" name="${oe(n)}" value="${oe(i)}"/>`}return t},Pe=(e,t=2,n=!0)=>{let i=String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return n&&(i=i.replace(/[\r\n]/g,"<br/>")),t&&(i=i.replace(/\t/g," ".repeat(t))),i=i.replace(/\s/g," "),i},Ci=e=>String(e).replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/&/g,"&").replace(/<br.*>/,`
|
|
3
|
+
`),Ii=e=>{if(!e)return"";let t=e;return t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),t=t.replace(/^###### (.*$)/gim,"<h6>$1</h6>"),t=t.replace(/^##### (.*$)/gim,"<h5>$1</h5>"),t=t.replace(/^#### (.*$)/gim,"<h4>$1</h4>"),t=t.replace(/^### (.*$)/gim,"<h3>$1</h3>"),t=t.replace(/^## (.*$)/gim,"<h2>$1</h2>"),t=t.replace(/^# (.*$)/gim,"<h1>$1</h1>"),t=t.replace(/\*\*(.*?)\*\*/gim,"<strong>$1</strong>"),t=t.replace(/\*(.*?)\*/gim,"<em>$1</em>"),t=t.replace(/`(.*?)`/gim,"<code>$1</code>"),t=t.replace(/!\[(.*?)\]\((.*?)\)/gim,'<img src="$2" alt="$1" />'),t=t.replace(/\[(.*?)\]\((.*?)\)/gim,'<a href="$2" target="_blank">$1</a>'),t=t.replace(/((\|.*\|\n)+)/g,n=>{const i=n.trim().split(`
|
|
4
|
+
`);if(i.length<2)return n;let a="<table>";return i.forEach((r,c)=>{const s=r.split("|").slice(1,-1);if(/^\s*-+\s*$/.test(s[0]))return;const l=c===0?"th":"td";a+="<tr>",s.forEach(u=>{a+=`<${l}>${u.trim()}</${l}>`}),a+="</tr>"}),a+="</table>",a}),t=t.replace(/^\s*-\s+(.*)/gim,"<li>$1</li>"),t=t.replace(/(<li>.*<\/li>)/gims,"<ul>$1</ul>"),t=t.replace(/\n/g,"<br />"),t.trim()},oe=(e,t="")=>(t=t?" ":`
|
|
5
|
+
`,(""+e).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">").replace(/\r\n/g,t).replace(/[\r\n]/g,t)),Ni=(e,t)=>{let n=e.split("");return t=t||0,n.map(i=>`&#${t?"x"+i.charCodeAt(0).toString(16):i.charCodeAt(0)};`).join("")},Di=(e,t,n='<span class="matched">%s</span>')=>t?e.replace(new RegExp(x(t),"ig"),i=>n.replace("%s",i)):e,Ri=e=>{if(!e.src)return null;if(e.src.indexOf("data:")===0)return e.src;let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");return n?(n.drawImage(e,0,0,e.width,e.height),t.toDataURL("image/png")):null},Be=e=>{const t=new XMLSerializer().serializeToString(e),n=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)},xe=e=>new Promise((t,n)=>{const i=Be(e),a=new Image;a.onload=()=>{t(a)},a.onerror=r=>{n(new Error("Failed to load SVG into Image:"+r))},a.src=i}),Li=(e,t=null,n=null)=>(t=t||"image/png",new Promise((i,a)=>{const r=D(n)?Me(n):1;xe(e).then(c=>{const[s,l]=Fe(e),u=document.createElement("canvas");u.width=s*r,u.height=l*r,u.getContext("2d").drawImage(c,0,0,s*r,l*r),URL.revokeObjectURL(c.src),i(u.toDataURL(t))},a)})),Fe=e=>{let t=null,n=null;const i=e.getAttribute("width"),a=e.getAttribute("height");if(i&&a)try{const r=B(i,"px"),c=B(a,"px");r&&c&&(t=z(r.val+r.unit,"px"),n=z(c.val+c.unit,"px"))}catch{}if(t===null||n===null){const r=e.viewBox.baseVal;r&&r.width&&r.height&&(t=r.width,n=r.height)}if(t===null||n===null){const r=e.getBoundingClientRect();t=r.width,n=r.height}return[t,n]},ki=(e,t=!1)=>new Promise((n,i)=>{if(t){const r=ne(e);if(r)return n(r)}let a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="blob",a.onload=function(){if(this.status===200){let r=this.response;ye(r).then(c=>{t&&ne(e,c),n(c)}).catch(c=>{i(c)})}},a.onerror=function(){i("Error:"+this.statusText)},a.onabort=function(){i("Request abort")},a.send()}),A=(e,t)=>{let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535},Hi=(e,t)=>e<<t|e>>>32-t,U=(e,t,n,i,a,r)=>A(Hi(A(A(t,e),A(i,r)),a),n),f=(e,t,n,i,a,r,c)=>U(t&n|~t&i,e,t,a,r,c),h=(e,t,n,i,a,r,c)=>U(t&i|n&~i,e,t,a,r,c),g=(e,t,n,i,a,r,c)=>U(t^n^i,e,t,a,r,c),w=(e,t,n,i,a,r,c)=>U(n^(t|~i),e,t,a,r,c),$=(e,t)=>{e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;let n,i,a,r,c,s=1732584193,l=-271733879,u=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)i=s,a=l,r=u,c=p,s=f(s,l,u,p,e[n],7,-680876936),p=f(p,s,l,u,e[n+1],12,-389564586),u=f(u,p,s,l,e[n+2],17,606105819),l=f(l,u,p,s,e[n+3],22,-1044525330),s=f(s,l,u,p,e[n+4],7,-176418897),p=f(p,s,l,u,e[n+5],12,1200080426),u=f(u,p,s,l,e[n+6],17,-1473231341),l=f(l,u,p,s,e[n+7],22,-45705983),s=f(s,l,u,p,e[n+8],7,1770035416),p=f(p,s,l,u,e[n+9],12,-1958414417),u=f(u,p,s,l,e[n+10],17,-42063),l=f(l,u,p,s,e[n+11],22,-1990404162),s=f(s,l,u,p,e[n+12],7,1804603682),p=f(p,s,l,u,e[n+13],12,-40341101),u=f(u,p,s,l,e[n+14],17,-1502002290),l=f(l,u,p,s,e[n+15],22,1236535329),s=h(s,l,u,p,e[n+1],5,-165796510),p=h(p,s,l,u,e[n+6],9,-1069501632),u=h(u,p,s,l,e[n+11],14,643717713),l=h(l,u,p,s,e[n],20,-373897302),s=h(s,l,u,p,e[n+5],5,-701558691),p=h(p,s,l,u,e[n+10],9,38016083),u=h(u,p,s,l,e[n+15],14,-660478335),l=h(l,u,p,s,e[n+4],20,-405537848),s=h(s,l,u,p,e[n+9],5,568446438),p=h(p,s,l,u,e[n+14],9,-1019803690),u=h(u,p,s,l,e[n+3],14,-187363961),l=h(l,u,p,s,e[n+8],20,1163531501),s=h(s,l,u,p,e[n+13],5,-1444681467),p=h(p,s,l,u,e[n+2],9,-51403784),u=h(u,p,s,l,e[n+7],14,1735328473),l=h(l,u,p,s,e[n+12],20,-1926607734),s=g(s,l,u,p,e[n+5],4,-378558),p=g(p,s,l,u,e[n+8],11,-2022574463),u=g(u,p,s,l,e[n+11],16,1839030562),l=g(l,u,p,s,e[n+14],23,-35309556),s=g(s,l,u,p,e[n+1],4,-1530992060),p=g(p,s,l,u,e[n+4],11,1272893353),u=g(u,p,s,l,e[n+7],16,-155497632),l=g(l,u,p,s,e[n+10],23,-1094730640),s=g(s,l,u,p,e[n+13],4,681279174),p=g(p,s,l,u,e[n],11,-358537222),u=g(u,p,s,l,e[n+3],16,-722521979),l=g(l,u,p,s,e[n+6],23,76029189),s=g(s,l,u,p,e[n+9],4,-640364487),p=g(p,s,l,u,e[n+12],11,-421815835),u=g(u,p,s,l,e[n+15],16,530742520),l=g(l,u,p,s,e[n+2],23,-995338651),s=w(s,l,u,p,e[n],6,-198630844),p=w(p,s,l,u,e[n+7],10,1126891415),u=w(u,p,s,l,e[n+14],15,-1416354905),l=w(l,u,p,s,e[n+5],21,-57434055),s=w(s,l,u,p,e[n+12],6,1700485571),p=w(p,s,l,u,e[n+3],10,-1894986606),u=w(u,p,s,l,e[n+10],15,-1051523),l=w(l,u,p,s,e[n+1],21,-2054922799),s=w(s,l,u,p,e[n+8],6,1873313359),p=w(p,s,l,u,e[n+15],10,-30611744),u=w(u,p,s,l,e[n+6],15,-1560198380),l=w(l,u,p,s,e[n+13],21,1309151649),s=w(s,l,u,p,e[n+4],6,-145523070),p=w(p,s,l,u,e[n+11],10,-1120210379),u=w(u,p,s,l,e[n+2],15,718787259),l=w(l,u,p,s,e[n+9],21,-343485551),s=A(s,i),l=A(l,a),u=A(u,r),p=A(p,c);return[s,l,u,p]},Ue=e=>{let t,n="",i=e.length*32;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n},ae=e=>{let t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;let i=e.length*8;for(t=0;t<i;t+=8)n[t>>5]|=(e.charCodeAt(t/8)&255)<<t%32;return n},Pi=e=>Ue($(ae(e),e.length*8)),Bi=(e,t)=>{let n,i=ae(e),a=[],r=[],c;for(a[15]=r[15]=void 0,i.length>16&&(i=$(i,e.length*8)),n=0;n<16;n+=1)a[n]=i[n]^909522486,r[n]=i[n]^1549556828;return c=$(a.concat(ae(t)),512+t.length*8),Ue($(r.concat(c),640))},$e=e=>{let t="0123456789abcdef",n="",i,a;for(a=0;a<e.length;a+=1)i=e.charCodeAt(a),n+=t.charAt(i>>>4&15)+t.charAt(i&15);return n},re=e=>unescape(encodeURIComponent(e)),Ye=e=>Pi(re(e)),xi=e=>$e(Ye(e)),je=(e,t)=>Bi(re(e),re(t)),Fi=(e,t)=>$e(je(e,t)),Ui=(e,t,n)=>t?n?je(t,e):Fi(t,e):n?Ye(e):xi(e),$i="application/octet-stream",R="application/json",qe="application/x-www-form-urlencoded",ze="multipart/form-data",Yi="text/plain",ji="text/html",qi={323:"text/h323",accdb:"application/msaccess",accde:"application/msaccess",accdt:"application/msaccess",acx:"application/internet-property-stream",ai:"application/postscript",aif:"audio/x-aiff",aifc:"audio/aiff",aiff:"audio/aiff",application:"application/x-ms-application",art:"image/x-jg",asf:"video/x-ms-asf",asm:"text/plain",asr:"video/x-ms-asf",asx:"video/x-ms-asf",atom:"application/atom+xml",au:"audio/basic",avi:"video/x-msvideo",axs:"application/olescript",bas:"text/plain",bcpio:"application/x-bcpio",bmp:"image/bmp",c:"text/plain",calx:"application/vnd.ms-office.calx",cat:"application/vnd.ms-pki.seccat",cdf:"application/x-cdf",class:"application/x-java-applet",clp:"application/x-msclip",cmx:"image/x-cmx",cnf:"text/plain",cod:"image/cis-cod",cpio:"application/x-cpio",cpp:"text/plain",crd:"application/x-mscardfile",crl:"application/pkix-crl",crt:"application/x-x509-ca-cert",csh:"application/x-csh",css:"text/css",dcr:"application/x-director",der:"application/x-x509-ca-cert",dib:"image/bmp",dir:"application/x-director",disco:"text/xml",dll:"application/x-msdownload","dll.config":"text/xml",dlm:"text/dlm",doc:"application/msword",docm:"application/vnd.ms-word.document.macroEnabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroEnabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",dtd:"text/xml",dvi:"application/x-dvi",dwf:"drawing/x-dwf",dxr:"application/x-director",eml:"message/rfc822",eps:"application/postscript",etx:"text/x-setext",evy:"application/envoy","exe.config":"text/xml",fdf:"application/vnd.fdf",fif:"application/fractals",flr:"x-world/x-vrml",flv:"video/x-flv",gif:"image/gif",gtar:"application/x-gtar",gz:"application/x-gzip",h:"text/plain",hdf:"application/x-hdf",hdml:"text/x-hdml",hhc:"application/x-oleobject",hlp:"application/winhlp",hqx:"application/mac-binhex40",hta:"application/hta",htc:"text/x-component",htm:"text/html",html:"text/html",htt:"text/webviewhtml",hxt:"text/html",ico:"image/x-icon",ief:"image/ief",iii:"application/x-iphone",ins:"application/x-internet-signup",isp:"application/x-internet-signup",IVF:"video/x-ivf",jar:"application/java-archive",jck:"application/liquidmotion",jcz:"application/liquidmotion",jfif:"image/pjpeg",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/x-javascript",jsx:"text/jscript",latex:"application/x-latex",lit:"application/x-ms-reader",lsf:"video/x-la-asf",lsx:"video/x-la-asf",m13:"application/x-msmediaview",m14:"application/x-msmediaview",m1v:"video/mpeg",m3u:"audio/x-mpegurl",man:"application/x-troff-man",manifest:"application/x-ms-manifest",map:"text/plain",mdb:"application/x-msaccess",me:"application/x-troff-me",mht:"message/rfc822",mhtml:"message/rfc822",mid:"audio/mid",midi:"audio/mid",mmf:"application/x-smaf",mno:"text/xml",mny:"application/x-msmoney",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"video/mpeg",mp3:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpp:"application/vnd.ms-project",mpv2:"video/mpeg",ms:"application/x-troff-ms",mvb:"application/x-msmediaview",mvc:"application/x-miva-compiled",nc:"application/x-netcdf",nsc:"video/x-ms-asf",nws:"message/rfc822",oda:"application/oda",odc:"text/x-ms-odc",ods:"application/oleobject",one:"application/onenote",onea:"application/onenote",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",osdx:"application/opensearchdescription+xml",p10:"application/pkcs10",p12:"application/x-pkcs12",p7b:"application/x-pkcs7-certificates",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7r:"application/x-pkcs7-certreqresp",p7s:"application/pkcs7-signature",pbm:"image/x-portable-bitmap",pdf:"application/pdf",pfx:"application/x-pkcs12",pgm:"image/x-portable-graymap",pko:"application/vnd.ms-pki.pko",pma:"application/x-perfmon",pmc:"application/x-perfmon",pml:"application/x-perfmon",pmr:"application/x-perfmon",pmw:"application/x-perfmon",png:"image/png",pnm:"image/x-portable-anymap",pnz:"image/png",pot:"application/vnd.ms-powerpoint",potm:"application/vnd.ms-powerpoint.template.macroEnabled.12",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",ppam:"application/vnd.ms-powerpoint.addin.macroEnabled.12",ppm:"image/x-portable-pixmap",pps:"application/vnd.ms-powerpoint",ppsm:"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",ppt:"application/vnd.ms-powerpoint",pptm:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",prf:"application/pics-rules",ps:"application/postscript",pub:"application/x-mspublisher",qt:"video/quicktime",qtl:"application/x-quicktimeplayer",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",ras:"image/x-cmu-raster",rf:"image/vnd.rn-realflash",rgb:"image/x-rgb",rm:"application/vnd.rn-realmedia",rmi:"audio/mid",roff:"application/x-troff",rpm:"audio/x-pn-realaudio-plugin",rtf:"application/rtf",rtx:"text/richtext",scd:"application/x-msschedule",sct:"text/scriptlet",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sgml:"text/sgml",sh:"application/x-sh",shar:"application/x-shar",sit:"application/x-stuffit",sldm:"application/vnd.ms-powerpoint.slide.macroEnabled.12",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",smd:"audio/x-smd",smx:"audio/x-smd",smz:"audio/x-smd",snd:"audio/basic",spc:"application/x-pkcs7-certificates",spl:"application/futuresplash",src:"application/x-wais-source",ssm:"application/streamingmedia",sst:"application/vnd.ms-pki.certstore",stl:"application/vnd.ms-pki.stl",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",svg:"image/svg+xml",swf:"application/x-shockwave-flash",t:"application/x-troff",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",texi:"application/x-texinfo",texinfo:"application/x-texinfo",tgz:"application/x-compressed",thmx:"application/vnd.ms-officetheme",tif:"image/tiff",tiff:"image/tiff",tr:"application/x-troff",trm:"application/x-msterminal",tsv:"text/tab-separated-values",txt:"text/plain",uls:"text/iuls",ustar:"application/x-ustar",vbs:"text/vbscript",vcf:"text/x-vcard",vcs:"text/plain",vdx:"application/vnd.ms-visio.viewer",vml:"text/xml",vsd:"application/vnd.visio",vss:"application/vnd.visio",vst:"application/vnd.visio",vsto:"application/x-ms-vsto",vsw:"application/vnd.visio",vsx:"application/vnd.visio",vtx:"application/vnd.visio",wav:"audio/wav",wax:"audio/x-ms-wax",wbmp:"image/vnd.wap.wbmp",wcm:"application/vnd.ms-works",wdb:"application/vnd.ms-works",wks:"application/vnd.ms-works",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wmd:"application/x-ms-wmd",wmf:"application/x-msmetafile",wml:"text/vnd.wap.wml",wmlc:"application/vnd.wap.wmlc",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wmp:"video/x-ms-wmp",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wmz:"application/x-ms-wmz",wps:"application/vnd.ms-works",wri:"application/x-mswrite",wrl:"x-world/x-vrml",wrz:"x-world/x-vrml",wsdl:"text/xml",wvx:"video/x-ms-wvx",x:"application/directx",xaf:"x-world/x-vrml",xaml:"application/xaml+xml",xap:"application/x-silverlight-app",xbap:"application/x-ms-xbap",xbm:"image/x-xbitmap",xdr:"text/plain",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroEnabled.12",xlc:"application/vnd.ms-excel",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.12",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroEnabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",xml:"text/xml",xof:"x-world/x-vrml",xpm:"image/x-xpixmap",xps:"application/vnd.ms-xpsdocument",xsd:"text/xml",xsf:"text/xml",xsl:"text/xml",xslt:"text/xml",xwd:"image/x-xwindowdump",z:"application/x-compress",zip:"application/x-zip-compressed"},ce=e=>{const t={};return e.replace(/^\?/,"").split("&").forEach(n=>{const[i,a]=n.split("=");i&&(t[decodeURIComponent(i)]=decodeURIComponent(a||""))}),t},We=(e,t)=>{const[n,i]=e.split("?"),r={...i?ce(i):{},...t},c=se(r);return`${n}?${c}`},se=e=>{if(typeof e>"u"||typeof e!="object")return e;let t=[];for(let n in e)if(e.hasOwnProperty(n)){if(e[n]===null)continue;typeof e[n]=="object"&&e[n].length?e[n].forEach(i=>{t.push(encodeURI(n+"="+i))}):typeof e[n]=="object"||t.push(encodeURI(n+"="+e[n]))}return t.join("&")};class Ge extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}const Ke=(e,t={})=>{const n=new AbortController;let i=null;t.timeout&&(i=setTimeout(()=>n.abort(),t.timeout));const a=()=>{i!==null&&(clearTimeout(i),i=null)},r=s=>{const l=s,u=l.then.bind(l),p=l.catch.bind(l),E=l.finally.bind(l);return l.then=function(d,M){return r(u(d,M))},l.catch=function(d){return r(p(d))},l.finally=function(d){return r(E(d))},l.abort=d=>{a(),l.aborted=!0,n.abort(new Ge(d||"request aborted."))},l.abortSilently=()=>{a(),l.aborted=!0;try{n.abort()}catch{}},l},c=fetch(e,{...t,signal:n.signal}).then(s=>(a(),s)).catch(s=>{throw a(),s});return r(c)},zi=(e,t,n)=>{if(t==null)return;const i=e.replace(/([A-Z])/g,"-$1").replace(/^-/,"");n[i]=String(t)},Wi=e=>{const t={};if(!e)return t;if(e instanceof Headers)e.forEach((n,i)=>{t[i]=n});else if(Array.isArray(e))e.forEach(([n,i])=>{t[n]=String(i)});else for(const n in e)t[n]=String(e[n]);return t},Qe=e=>["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal","window"].includes(e),Y=(e,t=null,n={})=>{n=n||{},n.method=n.method||"GET";const i=n.method.toUpperCase()==="GET",a=Wi(n.headers);for(let c in n)!Qe(c)&&c!=="timeout"&&zi(c,n[c],a);i&&t&&(e=We(e,typeof t=="string"?ce(t):t),t=null);const r={};for(let c in n)c==="timeout"?r.timeout=n.timeout:Qe(c)&&c!=="headers"&&(r[c]=n[c]);if(r.headers=a,!i){const c=a["Content-Type"]||a["content-type"];r.body=Gi(t,c)}return Ke(e,r).then(c=>{if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c})},Ve=e=>typeof e=="string"||e instanceof FormData||e instanceof URLSearchParams||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e),Gi=(e,t)=>{if(Ve(e)||typeof e!="object")return e;switch(t==null?void 0:t.toLowerCase()){case R:return JSON.stringify(e);case qe:case ze:default:return se(e)}},Ki=(e,t=null,n={})=>Y(e,t,{...n,ContentType:R,Accept:R}).then(i=>i.json()),Qi=(e,t=null,n={})=>Y(e,t,{...n,method:"POST",ContentType:R,Accept:R}).then(i=>i.json()),Vi=(e,t,n=null,i={})=>{const a=new FormData;if(Object.keys(t).forEach(r=>{a.append(r,t[r],t[r].name)}),n)for(let r in n)n.hasOwnProperty(r)&&a.append(r,n[r]);return Y(e,a,{...i,method:"POST"}).then(r=>r.json())},le=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(t=>le(t));if(e instanceof Object){const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n]=le(e[n]));return t}return e},Ji=e=>Object.keys(e).length===0,Xi=(e,t)=>{let n={};for(let i in e)t[i]!==void 0?n[t[i]]=e[i]:n[i]=e[i];return n},Zi=e=>Object.entries(e).map(([t,n])=>[/^\d+$/.test(t)?Number(t):t,n]),eo=e=>{const t={};for(const[n,i]of e){const a=typeof n=="string"&&/^\d+$/.test(n)?Number(n):n;t[a]=i}return t},to=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[n,t])),no=(e,t,n)=>{const i=t.split(".");let a=e;for(const r of i){if(a==null)return n;a=a[r]}return a!==void 0?a:n},io=(e,t,n)=>{const i=t.split("."),a=i.pop();let r=e;for(const c of i)(!(c in r)||typeof r[c]!="object")&&(r[c]={}),r=r[c];r[a]=n},Je=(e,...t)=>{for(const n of t)for(const i in n)if(n.hasOwnProperty(i)){const a=n[i],r=e[i];a&&typeof a=="object"&&!Array.isArray(a)&&r&&typeof r=="object"&&!Array.isArray(r)?e[i]=Je(r,a):e[i]=a}return e},Xe=(e,t=!1)=>{const n=e;for(const i in n)n[i]===null?delete n[i]:t&&typeof n[i]=="object"&&Xe(n[i],!0);return e},oo=new Date().getFullYear(),ao=new Date().getMonth()+1,ro=new Date().getDate(),co=60*1e3,so=60*60*1e3,L=24*60*60*1e3,lo=7*L,uo=30*L,po=31*L,mo=365*L,fo=366*L,ho=0,go=1,wo=2,Eo=3,Mo=4,vo=5,To=6,Ze=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],et=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tt=["January","February","March","April","May","June","July","August","September","October","November","December"],nt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],bo=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],yo=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],So=["日","一","二","三","四","五","六"],Ao=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],_o=(e,t,n)=>{let i=()=>{if(t&&t(e),e-- >0){setTimeout(i,1e3);return}n&&n()};i()},Oo=e=>{if(!e||e<10)return"刚刚";e=Math.floor(e/1e3);const t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=e%60;let a="";return t>0&&(a+=t+"小时"),(n>0||t>0)&&(a+=n+"分钟"),a+=i+"秒前",a},Co=(e,t=!1)=>{const n=new Date(e);return new Date(n.getTime()-n.getTimezoneOffset()*6e4).toISOString().slice(0,t?19:16)},Io=(e,t,n)=>e<=0?1/0:(Date.now()-n)/e*(t-e),it={d:e=>{let t=e.getDate();return(t<10?"0":"")+t},D:e=>et[e.getDay()],j:e=>e.getDate(),l:e=>Ze[e.getDay()],N:e=>{let t=e.getDay();return t===0?7:t},S:e=>{let t=e.getDate();return t%10===1&&t!==11?"st":t%10===2&&t!==12?"nd":t%10===3&&t!==13?"rd":"th"},w:e=>e.getDay(),z:e=>{let t=new Date(e.getFullYear(),0,1);return Math.ceil((e.getTime()-t.getTime())/864e5)},W:e=>{let t=new Date(e.valueOf()),n=(e.getDay()+6)%7;t.setDate(t.getDate()-n+3);let i=t.valueOf();t.setMonth(0,1),t.getDay()!==4&&t.setMonth(0,1+(4-t.getDay()+7)%7);let a=1+Math.ceil((i-t.getTime())/6048e5);return a<10?"0"+a:a},F:e=>tt[e.getMonth()],m:e=>{let t=e.getMonth();return(t<9?"0":"")+(t+1)},M:e=>nt[e.getMonth()],n:e=>e.getMonth()+1,t:e=>{let t=e.getFullYear(),n=e.getMonth()+1;return n===12&&(t=t++,n=0),new Date(t,n,0).getDate()},L:e=>{let t=e.getFullYear();return t%400===0||t%100!==0&&t%4===0},o:e=>{let t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},Y:e=>e.getFullYear(),y:e=>(""+e.getFullYear()).substr(2),a:e=>e.getHours()<12?"am":"pm",A:e=>e.getHours()<12?"AM":"PM",B:e=>Math.floor(((e.getUTCHours()+1)%24+e.getUTCMinutes()/60+e.getUTCSeconds()/3600)*1e3/24),g:e=>e.getHours()%12||12,G:e=>e.getHours(),h:e=>{let t=e.getHours();return((t%12||12)<10?"0":"")+(t%12||12)},H:e=>{let t=e.getHours();return(t<10?"0":"")+t},i:e=>{let t=e.getMinutes();return(t<10?"0":"")+t},s:e=>{let t=e.getSeconds();return(t<10?"0":"")+t},v:e=>{let t=e.getMilliseconds();return(t<10?"00":t<100?"0":"")+t},e:e=>Intl.DateTimeFormat().resolvedOptions().timeZone,I:e=>{let t=null;for(let n=0;n<12;++n){let a=new Date(e.getFullYear(),n,1).getTimezoneOffset();if(t===null)t=a;else if(a<t){t=a;break}else if(a>t)break}return e.getTimezoneOffset()===t?1:0},O:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},P:e=>{let t=e.getTimezoneOffset();return(-t<0?"-":"+")+(Math.abs(t/60)<10?"0":"")+Math.floor(Math.abs(t/60))+":"+(Math.abs(t%60)===0?"00":(Math.abs(t%60)<10?"0":"")+Math.abs(t%60))},T:e=>{let t=e.toLocaleTimeString(navigator.language,{timeZoneName:"short"}).split(" ");return t[t.length-1]},Z:e=>-e.getTimezoneOffset()*60,c:e=>ue("Y-m-d\\TH:i:sP",e),r:e=>e.toString(),U:e=>Math.floor(e.getTime()/1e3)},ue=function(e,t=null){let n=null;return typeof t=="object"&&t!==null?n=t:n=new Date(t||Date.now()),e.replace(/(\\?)(.)/g,function(i,a,r){return a===""&&it[r]?String(it[r](n)):r})},ot=e=>{const t=new Date,n=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),i=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a=n.formatToParts(t),r=i.formatToParts(t),c=p=>{const E=p.find(m=>m.type==="year").value,d=p.find(m=>m.type==="month").value,M=p.find(m=>m.type==="day").value,_=p.find(m=>m.type==="hour").value,O=p.find(m=>m.type==="minute").value,C=p.find(m=>m.type==="second").value;return Date.UTC(Number(E),Number(d)-1,Number(M),Number(_),Number(O),Number(C))},s=c(a),l=c(r);return(s-l)/1e3/60},at=e=>{const t=Math.floor(e/60),n=Math.abs(e%60);return`${t>=0?"+":"-"}${String(Math.abs(t)).padStart(2,"0")}:${String(n).padStart(2,"0")}`},No=e=>{const t=ot(e);return at(t)},Do=e=>ue("W",e);o.AbortError=Ge,o.BLOCK_TAGS=ie,o.Base64Encode=Tn,o.COMMON_DPI=96,o.DATE_NOW=ro,o.DAY_FRIDAY=vo,o.DAY_MONDAY=go,o.DAY_SATURDAY=To,o.DAY_SUNDAY=ho,o.DAY_THURSDAY=Mo,o.DAY_TUESDAY=wo,o.DAY_WEDNESDAY=Eo,o.GOLDEN_RATIO=Kt,o.MIME_BINARY_DEFAULT=$i,o.MIME_EXTENSION_MAP=qi,o.MIME_FORM=qe,o.MIME_HTML=ji,o.MIME_JSON=R,o.MIME_MULTIPART=ze,o.MIME_TEXT=Yi,o.MONTH_NAMES_CN=bo,o.MONTH_NAMES_EN=tt,o.MONTH_NAMES_SHORT_CN=yo,o.MONTH_NAMES_SHORT_EN=nt,o.MONTH_NOW=ao,o.ONE_DAY=L,o.ONE_HOUR=so,o.ONE_MINUTE=co,o.ONE_MONTH30=uo,o.ONE_MONTH31=po,o.ONE_WEEK=lo,o.ONE_YEAR365=mo,o.ONE_YEAR366=fo,o.PAIR_TAGS=vi,o.REMOVABLE_TAGS=He,o.SCREEN_DPI=de,o.SELF_CLOSING_TAGS=Ti,o.STAND_DPI=q,o.TRIM_BOTH=G,o.TRIM_LEFT=K,o.TRIM_RIGHT=be,o.WEEK_DAY_NAMES_CN=Ao,o.WEEK_DAY_NAMES_EN=Ze,o.WEEK_DAY_NAMES_SHORT_CN=So,o.WEEK_DAY_NAMES_SHORT_EN=et,o.YEAR_NOW=oo,o.abortableFetch=Ke,o.arrayChunk=$t,o.arrayColumn=Pt,o.arrayDistinct=xt,o.arrayGroup=Ft,o.arrayIndex=Bt,o.arraySortByKey=Ut,o.arrayTrimTail=Yt,o.base64Decode=Mn,o.base64UrlSafeEncode=vn,o.between=v,o.bindClick=jn,o.bindDomEvent=y,o.bindDoubleClick=Wn,o.bindInputDebounce=Gn,o.bindKeyDown=zn,o.bindKeyUp=qn,o.bindNodeMove=hi,o.bindStorageEvent=Kn,o.blobToBase64=ye,o.blobToDataUri=te,o.buildHtmlHidden=Oi,o.buildStyleVars=fi,o.calcRemainingMSecs=Io,o.camelCase=sn,o.cancelScrollAnimation=Le,o.capitalize=Ee,o.clamp01=rt,o.cleanNull=Xe,o.convertMinutesToTimezoneOffsetStr=at,o.countDown=_o,o.createDomByHtml=di,o.cssSelectorEscape=Si,o.cutString=rn,o.debounce=In,o.decodeHTMLEntities=_i,o.deepClone=le,o.deleteCookie=F,o.deleteCookieAllPaths=An,o.detectLanguage=Wt,o.detectedPrecision=nn,o.digitCount=on,o.disabled=Ce,o.dispatchEvent=Un,o.downloadFile=Mi,o.easeInBack=Ct,o.easeInBounce=kt,o.easeInCirc=At,o.easeInCubic=pt,o.easeInElastic=Dt,o.easeInExpo=bt,o.easeInOutBack=Nt,o.easeInOutBounce=Ht,o.easeInOutCirc=Ot,o.easeInOutCubic=me,o.easeInOutElastic=Lt,o.easeInOutExpo=St,o.easeInOutQuad=ut,o.easeInOutQuart=ht,o.easeInOutQuint=Et,o.easeInOutSine=Tt,o.easeInQuad=st,o.easeInQuart=dt,o.easeInQuint=gt,o.easeInSine=Mt,o.easeOutBack=It,o.easeOutBounce=P,o.easeOutCirc=_t,o.easeOutCubic=mt,o.easeOutElastic=Rt,o.easeOutExpo=yt,o.easeOutQuad=lt,o.easeOutQuart=ft,o.easeOutQuint=wt,o.easeOutSine=vt,o.easeValue=ct,o.enabled=Ie,o.enterFullScreen=fe,o.entityToString=Ai,o.escapeAttr=oe,o.escapeHtml=Pe,o.eventDelegate=Yn,o.exitFullScreen=he,o.extract=cn,o.fileToBase64DataUri=Ei,o.findAll=ee,o.findOne=T,o.fixBaseUrl=mi,o.floatVal=Me,o.formatDate=ue,o.formatSize=En,o.getBoundingClientRect=Re,o.getCookie=Sn,o.getDomDimension=li,o.getJson=Ki,o.getNodeXPath=ni,o.getTimezoneOffsetMinutes=ot,o.getTimezoneOffsetStr=No,o.getUTF8StrLen=pn,o.getWeekNumber=Do,o.guid=Se,o.hide=Vn,o.highlightText=Di,o.html2Text=bi,o.imgToBase64=Ri,o.insertStyleSheet=De,o.isBodyInit=Ve,o.isChinese=wn,o.isEmptyObject=Ji,o.isFirefox=Gt,o.isFocusable=ri,o.isFunction=Ln,o.isInFullScreen=ge,o.isJSON=kn,o.isJson=Dn,o.isLandscape=jt,o.isNumberic=D,o.isObject=Rn,o.isPortrait=qt,o.isPromise=Nn,o.isUrl=Ae,o.kebabCase=ln,o.keepRectInContainer=oi,o.lerp=pe,o.limit=en,o.linear=N,o.loadCss=ci,o.loadScript=si,o.lockElementInteraction=ei,o.markdown2Html=Ii,o.md5=Ui,o.mmToPt=Jt,o.mmToPx=Qt,o.mmToTwip=Vt,o.msToHMS=Oo,o.mutationEffective=Ne,o.nodeIndex=ti,o.objToQuery=se,o.objectEntries=Zi,o.objectFromEntries=eo,o.objectGet=no,o.objectKeyReplace=Xi,o.objectMerge=Je,o.objectSet=io,o.objectSwitchKV=to,o.offEvent=Oe,o.onDocReady=$n,o.onDomTreeChange=ii,o.onEvent=_e,o.onEvents=Fn,o.onHover=Zn,o.parseUnit=B,o.postFiles=Vi,o.postJson=Qi,o.precisionToStep=pi,o.printStack=Hn,o.ptToMm=Xt,o.pxToMm=Zt,o.queryReplace=We,o.queryToObj=ce,o.randomInt=tn,o.randomString=Te,o.randomWords=dn,o.rectAssoc=ai,o.rectInLayout=ui,o.regQuote=x,o.remove=Xn,o.request=Y,o.round=we,o.sanitizeFileName=wi,o.scrollToAnimated=gi,o.setCookie=yn,o.show=Jn,o.srcToBase64=ki,o.strChunk=gn,o.strToPascalCase=fn,o.stringToEntity=Ni,o.stripSlashes=an,o.svgGetDimension=Fe,o.svgToImg=xe,o.svgToImgData=Li,o.svgToSrc=Be,o.text2Html=yi,o.throttle=On,o.throttleEffect=Cn,o.timestampToDateTimeLocal=Co,o.toggleDisabled=Z,o.toggleFullScreen=zt,o.triggerDomEvent=Qn,o.trim=hn,o.truncate=un,o.unescapeHtml=Ci,o.unitConvert=z,o.urlB64DataCache=ne,o.utf8Decode=ve,o.utf8Encode=W,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
6
6
|
//# sourceMappingURL=minutool.umd.cjs.map
|