jmini 0.0.78 → 0.0.80
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/cjs/index.js +1 -1
- package/esm/fetcher.d.ts +1 -0
- package/esm/fetcher.js +1 -1
- package/esm/time.d.ts +8 -8
- package/esm/time.js +1 -1
- package/esm/uuid.d.ts +2 -2
- package/esm/uuid.js +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var N=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptor,ie=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var j=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var L=Math.pow,X=(e,t,r)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>{for(var r in t||(t={}))V.call(t,r)&&X(e,r,t[r]);if(O)for(var r of O(t))G.call(t,r)&&X(e,r,t[r]);return e},J=(e,t)=>re(e,ie(t));var Q=(e,t)=>{var r={};for(var i in e)V.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&O)for(var i of O(e))t.indexOf(i)<0&&G.call(e,i)&&(r[i]=e[i]);return r};var ae=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},oe=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of se(t))!V.call(e,n)&&n!==r&&N(e,n,{get:()=>t[n],enumerable:!(i=ne(t,n))||i.enumerable});return e};var ue=e=>oe(N({},"__esModule",{value:!0}),e);var y=(e,t,r)=>new Promise((i,n)=>{var s=l=>{try{u(r.next(l))}catch(h){n(h)}},o=l=>{try{u(r.throw(l))}catch(h){n(h)}},u=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);u((r=r.apply(e,t)).next())}),K=function(e,t){this[0]=e,this[1]=t},Z=(e,t,r)=>{var i=(o,u,l,h)=>{try{var p=r[o](u),d=(u=p.value)instanceof K,C=p.done;Promise.resolve(d?u[0]:u).then(m=>d?i(o==="return"?o:"next",u[1]?{done:m.done,value:m.value}:m,l,h):l({value:m,done:C})).catch(m=>i("throw",m,l,h))}catch(m){h(m)}},n=o=>s[o]=u=>new Promise((l,h)=>i(o,u,l,h)),s={};return r=r.apply(e,t),s[j("asyncIterator")]=()=>s,n("next"),n("throw"),n("return"),s};var ee=(e,t,r)=>(t=e[j("asyncIterator")])?t.call(e):(e=e[j("iterator")](),t={},r=(i,n)=>(n=e[i])&&(t[i]=s=>new Promise((o,u,l)=>(s=n.call(e,s),l=s.done,Promise.resolve(s.value).then(h=>o({value:h,done:l}),u)))),r("next"),r("return"),t);var Se={};ae(Se,{Fetcher:()=>f,Filer:()=>S,Server:()=>_,Time:()=>c,UUID:()=>x,default:()=>ve,useStore:()=>E});module.exports=ue(Se);typeof HTMLElement!="undefined"&&(HTMLElement.prototype.position=function(){return this.getBoundingClientRect()});typeof String!="undefined"&&(String.prototype.compress=function(){return this.trim().replace(/(\s|\n|\t)/ig,"")},String.prototype.encode=function(){return encodeURIComponent(this)},String.prototype.decode=function(){return decodeURIComponent(this)},String.prototype.toUpper=function(){return this.toLocaleUpperCase()},String.prototype.toLower=function(){return this.toLocaleLowerCase()},String.prototype.toCapital=function(){let e=this;return e&&(e=e.replace(/^./,this[0].toUpper()).replace(/(\s|_|-)[a-z]{1}/ig,t=>t[1].toUpper())),e},String.prototype.clip=function(e,t){return this.slice(e,t)},String.prototype.partReplace=function(e,t){return this.slice(0,e)+t+this.slice(e+t.length)},String.prototype.toBlob=function(e){let t=atob(this.replace(/^.*,/,"")),r=new Uint8Array(t.length);for(var i=0;i<t.length;i++)r[i]=t.charCodeAt(i);try{var n=new Blob([r.buffer],{type:e})}catch(s){return!1}return n},String.prototype.toNumber=function(){return Number(this.removeLetters())},String.prototype.removeLetters=function(){return this.replace(/[\D]/ig,"")},String.prototype.removeSpecifics=function(){return this.replace(/[^\w\s\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]|_/uig,"")},String.prototype.removeJP=function(){return this.replace(/[\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]+/uig,"")},String.prototype.zen2hanNumber=function(){return this.replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).replace(/[--﹣−‐⁃‑‒–—﹘―⎯⏤ーー─━]/g,"-").replace(/¥/,"\xA5").replace(/、/,",").replace(/(/,"(").replace(/)/,")").replace(/+/,"+")},String.prototype.escapeRegExChar=function(){return this.replace(/\\/g,"\\\\").replace(/(\?|\^|\$|\.|\||\*|\+|\(|\)|\{|\}|\[|\])/g,"\\$1")});typeof Number!="undefined"&&(Number.prototype.zeroEmbed=function(e){return String(this).padStart(e||2,"0")},Number.prototype.ratio=function(e,t=2){let r=L(10,t);return Math.round(this/e*r*100)/r},Number.prototype.rate=function(e,t=2){let r=L(10,t);return Math.round(this/e*r)/r},Number.prototype.rank=function(e=1){let t=L(10,e),r=Number(this);if(r<1e3)return String(this);let i=r.toLocaleString().replace(/\d/ig,"").length;return Math.round(r/L(1e3,i)*t)/t+("KMGTPEZY"[i-1]||"")},Number.prototype.rankJp=function(){let e=Number(this),t="";return e>=1e12?t=`${e/1e12}\u5146`:e>=1e8?t=`${e/1e8}\u5104`:e>=1e4?t=`${e/1e4}\u4E07`:e>=1e3?t=`${e/1e3}\u5343`:t=`${e.toLocaleString()}`,t},Number.prototype.toDate=function(e="/"){let t=String(this),r=t.slice(0,4),i=t.slice(4,6),n=t.slice(6,8),s=[];return r.length!=4||s.push(r),i.length!=2||s.push(i),n.length!=2||s.push(n),s.join(e)});if(typeof Array!="undefined"){let e=(r,...i)=>{var s;let n=r;for(let o of i){if(o!==(o!=null?o:!o))break;n=(s=(n||{})[o!=null?o:""])!=null?s:null}return n},t=r=>typeof r=="number"&&!isNaN(r);Array.prototype.toASC=function(r,i,n){let s=[];Array.isArray(r)?s.push(...r):r&&(s=[r]);let o=[],u=[];for(let l of s){let h=String(l).match(/([^\.\[\]"]+)/g);o.push(h),u.push(this.every(p=>t(Number(e(p,...h)))))}return this.sort((l,h)=>{for(let p=0;p<o.length;p++){let d=o[p],C=u[p],m=e(l,...d),M=e(h,...d);if(C){if(Number(m)>Number(M))return 1;if(Number(m)<Number(M))return-1;continue}if(t(m)&&!t(M))return-1;if(!t(m)&&t(M))return 1;let g=String(m).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,k=>k.padStart(10,"0")),D=String(M).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,k=>k.padStart(10,"0")),P=g.localeCompare(D,i,n);if(P!=0)return P}return 0})},Array.prototype.toDESC=function(...r){return this.toASC(...r).reverse()},Array.prototype.getSum=function(...r){return this.reduce((i,n)=>i+(r?e(n,...r):Number(n)||0),0)},Array.prototype.getAve=function(...r){return this.getSum(...r)/this.length},Array.prototype.getMedian=function(...r){let i=this.map(s=>r?e(s,...r):Number(s)||0);i.sort((s,o)=>s-o);let n=Math.floor(i.length/2);return i.length%2===0?(i[n-1]+i[n])/2:i[n]},Array.prototype.getMin=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.min(...i)},Array.prototype.getMax=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.max(...i)}}typeof File!="undefined"&&(File.prototype.convert=function(e){return e=e||"dataURL",new Promise((t,r)=>{let i=new FileReader;i.onload=s=>t(s),i.onerror=s=>r(s);let n="readAs"+(e==null?void 0:e.toCapital());i[n](this)})});var le=(e=24)=>Array.from({length:e}).map((t,r)=>{let i=r==0?25:35,n=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*i)][n?"toUpper":"toLower"]()}).join(""),x=le;x.gen128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");x.gen32Hex=(e="Formatted",t="-")=>{let r=Array.from({length:32}).map((i,n)=>"0123456789abcdef"[Math.round(Math.random()*15)]).join("").toUpper();return e=="Formatted"&&(r=[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,20),r.slice(20,32)].join(t)),r};x.to32Format=e=>[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-").toUpper();var he=e=>new a.prototype.jmini(e),a=he;a.prototype={};a.extend=function(e,t=a){for(var[r,i]of Object.entries(e))t.prototype[r]=i};a.expando="__jmini_"+x();var b=(e,t)=>(e.queue.push(t),U(e),e),U=e=>y(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let t=e.queue.shift();t&&(yield t()),e.queueProcess=!1,U(e)}),I=(e,t)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,i]of Object.entries(t))r.match(/queue/)||(e[r]=i);return e},me=(e,t)=>{if(t.length){for(var r=0;r<t.length;r++){let i=t[r];i&&(i[a.expando]||(a.is.element(i)||a.is.shadowRoot(i))&&(i[a.expando]={events:{}})),e[r]=i}e.length=t.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,U(e),e};a.extend({constructor:a,jmini:function(e){return this.src=e,this.srcType=a.is.what(e),this.queueProcess=!0,this.queue=[],me(this,a.is.jmini(e)?e.get():a.is.element(e)?[e]:a.is.elements(e)?e:a.is.shadowRoot(e)?[e]:a.is.string(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}});a.prototype[String(Symbol.iterator)]=[][Symbol.iterator];a.prototype.jmini.prototype=a.prototype;{let e=function(n,s,o){let u=[];for(let l=0;l<(n.length||0);l++)u.push(s(n[l],l));return o&&(u=u.filter(l=>l!=null)),u},t=n=>(n.for((s,o)=>{if(!(a.is.element(s)||a.is.shadowRoot(s)))return;let u=s.cloneNode(),l=s.parentNode;l&&l.replaceChild(u,s),n[o]=u}),n),r=(n,s)=>(a(s).for(o=>{if(n&&(a.is.element(o)||a.is.shadowRoot(o)))if(a.is.string(n)||a.is.number(n))n=String(n),o.insertAdjacentHTML("beforeend",String(n));else if(a.is.element(n))o.appendChild(n);else{a.is.jmini(n)?n=n.get():a.is.element(n)?n=[n]:a.is.keyValueDictionary(n)&&(n=[a(n)]);for(var u=0;u<n.length;u++)r(n[u],o)}}),s),i=(n,s,...o)=>{let{p:u,s:l}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return n.for(h=>{if(a.is.string(o[0]))h.insertAdjacentHTML(u,o[0]);else{if(!h.parentNode)return;a(o[0]).for(d=>{o[1]&&(d=d.cloneNode(!0)),h.parentNode.insertBefore(d,h[l]||h)})}}),n};a.extend({get:function(n){return n?this[0]:e(this,s=>s)},for:function(n,s=1){let o=e(this,(u,l)=>n(u,l),1);return s?o:[]},await:function(n){return b(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},n)}))},abort:function(){return b(this,()=>y(this,null,function*(){return this.queue=[],this}))},callback:function(n){return b(this,()=>y(this,null,function*(){return yield n(this),this}))},click:function(){return b(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];a.is.element(s)&&s.click()}return this})},focus:function(){return b(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];a.is.element(s)&&s.focus()}return this})},addEvent:function(n){return b(this,()=>{let{eventType:s,eventID:o=x(),target:u,callback:l,options:h}=n;return h=R({passive:!0,capture:!1},h),this.for(p=>{if(!(a.is.element(p)||a.is.shadowRoot(p)))return;let{events:d}=p[a.expando];if(u){let C=l;l=m=>{if(m.target){if(a.is.string(u)){let g=m.target.closest(u);g&&(!g||C.call(g,m))}else if(a.is.elements(u)){for(let M of u)if(m.target==M)return C.call(M,m)}}}}if(d[o]){let C=d[o];p.removeEventListener(C.eventType,C.callback,C.options)}d[o]={eventType:s,callback:l,options:h},p.addEventListener(s,l,h)}),this})},removeEvent:function(n){return b(this,()=>{let s=a.is.array(n)?n:[n];return this.for(o=>{let{events:u}=o[a.expando];for(let l of s){let h=u[l];h&&o.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(n){return b(this,()=>I(this,r(n,t(this))))},empty:function(){return b(this,()=>I(this,t(this)))},append:function(n){return b(this,()=>{r(n,this)})},remove:function(){return b(this,()=>(this.for((n,s)=>{n&&a.is.element(n)&&(n.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...n){return b(this,()=>I(this,i(this,"before",...n)))},after:function(...n){return b(this,()=>I(this,i(this,"after",...n)))},find:function(n){return b(this,()=>{let s=[],o=this[0];o||I(this,a()),(a.is.element(o)||a.is.shadowRoot(o))&&(a.is.string(n)?s=o.querySelectorAll(n):a.is.element(o)&&a(n).for(u=>{let l=o.childNodes;for(let h of l)if(h===u){s.push(h);break}else h.childNodes.length&&(s=[...s,...a(h).find(u).for(p=>p)])})),I(this,a(s))})},parent:function(n){return b(this,()=>{var o,u;let s=a(n?(o=this[0])==null?void 0:o.closest(n):(u=this[0])==null?void 0:u.parentNode);I(this,s)})},children:function(n){return b(this,()=>{let s=this[0].children;a.is.exist(n)&&(n=String(n).replace(/^ : /,""),s=n=="first"?s[0]:n=="last"?s[s.length-1]:s[Number(n)]);let o=a(s);return I(this,o)})},addClass:function(n){return b(this,()=>(n&&this.for(s=>{let o=a.is.string(n)?n.split(" "):n;s&&a.is.element(s)&&s.classList.add(...o)}),this))},removeClass:function(n){return b(this,()=>(n&&this.for(s=>{let o=a.is.string(n)?n.split(" "):n;s&&a.is.element(s)&&s.classList.remove(...o)}),this))},toggleClass:function(n){return b(this,()=>(n&&this.for(s=>{s.classList.toggle(n)}),this))},hasClass:function(n=""){if(this[0])return this[0].classList.contains(n.replace(/^\./,""))},findClass:function(n){let s=[];return this[0]&&(s=[...this[0].classList].filter(o=>o.match(n))),s},css:function(n){return b(this,()=>(this.for(s=>{if(a.is.element(s))for(let[o,u]of Object.entries(n)){if(a.is.number(u)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[o]=u+"px";continue}s.style[o]=String(u)}}),this))},getAttribute:function(n){return this[0].getAttribute(String(n))},setAttribute:function(n,s){return b(this,()=>(this.for(o=>o.setAttribute(n,s)),this))},getStyleProperty:function(n){let s=this[0];return s&&a.is.element(s)?getComputedStyle(s).getPropertyValue(n):""},setStyleProperty:function(n,s){let o=this[0];return o&&a.is.element(o)&&o.style.setProperty(n,s),this},val:function(){var s;let n=this[0];return(n==null?void 0:n.value)||((s=n==null?void 0:n.dataset)==null?void 0:s.value)},position:function(){return a.is.element(this[0])?this[0].getBoundingClientRect():{}}})}a.flatArray=(e,t)=>{if(!a.is.array(e))return[e];let r=[];for(let i of e)r.push(...t=="-R"?a.flatArray(i,"-R"):[i]);return r};a.uniqueArray=(e,t)=>{let r=e;return t?r=Array.from(new Map(e.map(i=>[a.getKeyValue(i,t||"0"),i])).values()):r=Array.from(new Set(e)),r};a.getKeyValue=(e,t)=>{let r={},i=e;return t.split(".").forEach(n=>{i=i==null?void 0:i[n],r=i}),r};a.Stringify=(...e)=>{let[t,r,i]=e;return JSON.stringify(t,r!=null?r:(()=>{let n=new WeakSet;return(s,o)=>{if(typeof o=="object"&&o!==null){if(n.has(o))return"[Circular Reference]";n.add(o)}return o}})(),i)};a.Objectify=(e,t)=>{try{return JSON.parse(e)}catch(r){return t!=null?t:null}};a.SortifyObject=(e,t)=>{let r={};return Object.keys(e).sort().forEach(i=>{let n=e[i];if(t){if(a.is.keyValueDictionary(n)){r[i]=a.SortifyObject(n,t);return}if(a.is.array(n)){r[i]=n.map(s=>a.is.keyValueDictionary(s)||a.is.array(s)?a.SortifyObject(s,t):s);return}}r[i]=n}),r};a.randomNumber=(e=0,t=100,r)=>{if(e>t)return NaN;let i=Math.round(Math.random()*(t-e))+e;return r&&r.length&&r.includes(i)?a.randomNumber(e,t,r):i};a.try=e=>{try{return[e(),!0]}catch(t){return[t,!1]}};a.trySync=e=>y(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});a.scope=e=>e();a.scopeSync=e=>y(void 0,null,function*(){return yield e()});a.createElement=function(e){var d;let{tag:t,className:r="",id:i,html:n,attr:s,style:o,parent:u}=e,l=document.createElement(t||"div");if(r&&l.classList.add(...r.split(" ")),i&&(l.id=i),s)for(let C of Object.entries(s)){let m=C[0],M=(d=C[1])!=null?d:"";if(m=="data"&&a.is.keyValueDictionary(M))for(let[g,D]of Object.entries(M))l.dataset[g]=D;else m=="for"?m="htmlFor":m=="tabindex"?m="tabIndex":m=="aria-label"&&(m="ariaLabel"),l[m]=M}if(n&&a(l).append(n),o)for(var[h,p]of Object.entries(o))l.style[h]=p;return u&&a(u).append(l),l};a.setCookie=e=>{let{hostname:t}=new URL(location.toString()),{name:r,value:i="",age:n=60*60*24*365,path:s="/",domain:o=t,secure:u=!1}=e,l=`${r}=${i}max-age=${n}path=${s}domain=${o}`;u&&(l+=" Secure"),document.cookie=l};a.getCookie=e=>{let t=document.cookie.match(new RegExp(e+"=[^]*"));return t?t[0].replace(new RegExp(e+"="),""):""};a.localStrage={set:(e,t)=>{localStorage.setItem(e,a.Stringify(t))},get:e=>{let t=localStorage.getItem(e);return a.Objectify(t,t)}};a.deleteCookie=e=>{document.cookie=e+"=max-age=0"};a.getScreenSize=()=>{let{innerHeight:e,innerWidth:t,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:s}=window,o=Number(a(document.body).getStyleProperty("--sat").removeLetters()),u=Number(a(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:t,pageHeight:e-o-u,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:s,safeAreaTop:o,safeAreaBottom:u}};a.getCursor=e=>{var i,n,s,o,u,l,h,p;let t=(o=e.pageX)!=null?o:(s=(i=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:i.pageX)!=null?s:(((n=e==null?void 0:e.originalEvent)==null?void 0:n.touches)||[])[0].pageX,r=(p=e.pageY)!=null?p:(h=(u=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:u.pageY)!=null?h:(((l=e==null?void 0:e.originalEvent)==null?void 0:l.touches)||[])[0].pageY;return{x:t,y:r}};a.pending=(e,t)=>new Promise((r,i)=>{e(r),t&&setTimeout(()=>{r(!0)},t)});a.deepMerge=(e,...t)=>{if(!t.length)return e;let r=t.shift();if(a.is.keyValueDictionary(e)&&a.is.keyValueDictionary(r))for(let i in r)a.is.keyValueDictionary(r[i])?(e[i]||Object.assign(e,{[i]:{}}),a.deepMerge(e[i],r[i])):Object.assign(e,{[i]:r[i]});return a.deepMerge(e,...t)};a.deepCopy=e=>{if(a.is.array(e))return e.map(t=>a.deepCopy(t));if(a.is.keyValueDictionary(e)){let t={};return Object.entries(e).forEach(([r,i])=>{t[r]=a.deepCopy(i)}),t}return e};a.queryParams={get:e=>{let t=new URL(e||location.href),r={};return t.searchParams.forEach((i,n)=>r[n]=i),r},set:(e,t)=>{let r=new URL(t||location.href);return Object.entries(e).forEach(([i,n])=>{r.searchParams.set(i,String(n))}),t||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,t)=>{let r=new URL(t||location.href);return e.forEach(i=>{r.searchParams.delete(i)}),t||history.replaceState({},"",r.pathname+r.search),r.toString()}};a.ellipsisText=(e,t)=>{let r=String(e);return r.length>t&&(r=r.slice(0,t)+" ..."),r};a.is={equal:function(e,t,r){return r==null||r?a.Stringify(e)===a.Stringify(t):e===t},what:function(e){let t="other";return this.jmini(e)?t="jmini":this.element(e)?t="element":this.elements(e)?t="elements":this.shadowRoot(e)?t="shadowRoot":this.string(e)?t="string":this.number(e)?t="number":this.array(e)?t="array":this.function(e)?t="function":this.date(e)?t="date":typeof e=="undefined"?t="undefined":this.keyValueDictionary(e)?t="keyValueDictionary":e==null?t="null":isNaN(e)&&(t="NaN"),t},exist:function(e){return e===(e!=null?e:!e)},nullish:function(e){return!this.exist(e)},jmini:function(e){return(e||{}).constructor===a},string:function(e){return typeof e=="string"},boolean:function(e){return typeof e=="boolean"},number:function(e){return!isNaN(e)&&typeof e=="number"},array:function(e){let t={}.toString.call(e);return Array.isArray(e)||e instanceof Array||t=="[object NodeList]"||t=="[object HTMLCollection]"},function:function(e){return typeof e=="function"},keyValueDictionary:function(e){return{}.toString.call(e)==="[object Object]"&&!this.jmini(e)},element:function(e){return e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e))},elements:function(e){let t={}.toString.call(e),r=Number(!!e&&typeof e!="string"&&this.array(e)&&t!=="[object Text]");if(r&&t!=="[object NodeList]")for(var i of e)r&=Number(this.element(i));return!!r},shadowRoot:function(e){return e instanceof ShadowRoot},date:function(e){return this.number(new Date(e).getTime())}};var ce=e=>new c.prototype.Time(e),c=ce;c.prototype={};var fe=function(e){c.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0&&(e=new Date));let t=new Date(String(e).replace(/\//g,"-"));return this.set(t)};a.extend({value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,constructor:c,Time:fe,clone:function(){return c(this)},set:function(e){this.value=e;let t=a.is.date(e);if(this.validate=t,!t)return this.ms=-1,this.year=-1,this.month=-1,this.weekday=-1,this.weekInYear=-1,this.date=-1,this.hours=-1,this.minutes=-1,this.seconds=-1,this;this.ms=e.getTime(),this.weekday=e.getDay(),this.year=e.getFullYear(),this.month=e.getMonth()+1,this.date=e.getDate();{let r=new Date(this.year,0,1),i=new Date(r.valueOf());i.setDate(i.getDate()-(r.getDay()+1));let n=e.getTime()-i.getTime(),s=Math.ceil(n/(1e3*60*60*24));this.weekInYear=Math.ceil(s/7)}{let r=new Date(this.year,this.month-1,1),i=new Date(r.valueOf());i.setDate(i.getDate()-(r.getDay()+1));let n=e.getTime()-i.getTime(),s=Math.ceil(n/(1e3*60*60*24)),o=Math.ceil(s/7);this.weekInMonth=o}{let r=new Date(this.year,this.month,0),i=r.getDay(),n=new Date(new Date(r).setDate(r.getDate()-i));this.isLastWeekInMonth=this.date>=n.getDate()}return this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this},isPast:function(){let e=c();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=c(e);return this.year==t.year},isSameMonth:function(e){let t=c(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=c(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=c(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},setYear:function(e){let t=new Date(this.value.valueOf());return t.setFullYear(e),this.set(t)},setMonth:function(e){let t=new Date(this.value.valueOf());return t.setMonth(e-1),t.getMonth()!=(e-1)%12&&t.setDate(0),this.set(t)},setDate:function(e){let t=new Date(this.value.valueOf());return t.setDate(e),this.set(t)},setHours:function(e){let t=new Date(this.value.valueOf());return t.setHours(e),this.set(t)},setMinutes:function(e){let t=new Date(this.value.valueOf());return t.setMinutes(e),this.set(t)},setSeconds:function(e){let t=new Date(this.value.valueOf());return t.setSeconds(e),this.set(t)},setMilliseconds:function(e){let t=new Date(this.value.valueOf());return t.setMilliseconds(e),this.set(t)},addYear:function(e){return this.setYear(this.year+e)},addMonth:function(e){return this.setMonth(this.month+e)},addWeek:function(e){return this.addDate(7*e)},addDate:function(e){return this.setDate(this.date+e)},addHours:function(e){return this.setHours(this.hours+e)},addMinutes:function(e){return this.setMinutes(this.minutes+e)},addSeconds:function(e){return this.setSeconds(this.seconds+e)},toFormat:function(e){return this.validate?e.replace(/\%y/ig,this.year.zeroEmbed(4)).replace(/\%m/ig,this.month.zeroEmbed(2)).replace(/\%d/ig,this.date.zeroEmbed(2)).replace(/\%w/ig,this.weekInYear.zeroEmbed(2)).replace(/\%h/ig,this.hours.zeroEmbed(2)).replace(/\%i/ig,this.minutes.zeroEmbed(2)).replace(/\%s/ig,this.seconds.zeroEmbed(2)):""},toFormatYMD:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D"):""},toFormatYM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708"):this.toFormat("%Y/%M"):""},toFormatMD:function(e){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):""},toFormatHM:function(e){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206"):this.toFormat("%h:%i"):""},toFormatYMDHM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%i\u5206"):this.toFormat("%Y/%M/%D %h:%i"):""},toFormatYMDHMS:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2"):this.toFormat("%Y/%M/%D %h:%i:%s"):""},toLangYMD:function(e){if(!this.validate)return"";let t=c(),r=t.diff(this);return r.dates==0?"\u4ECA\u65E5":r.dates==1?"\u6628\u65E5":r.dates>=-7&&r.dates<0?-1*r.dates+"\u65E5\u5F8C":r.dates<=7&&r.dates>0?r.dates+"\u65E5\u524D":this.isSameYear(t)?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D")},setFirstOfTheDay:function(){let e=new Date(this.value.valueOf());return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),this.set(e)},setLastOfTheDay:function(){let e=new Date(this.value.valueOf());return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),this.set(e)},setFromFormatHHMM:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(4).replace(/(\d{2})(\d{2})/,"$1:$2"),[r,i]=t.split(":"),n=new Date(this.value.valueOf());return n.setHours(Number(r)),n.setMinutes(Number(i)),this.set(n)},setFromFormatHHMMSS:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(6).replace(/(\d{2})(\d{2})(\d{2})/,"$1:$2:$3"),[r,i,n]=t.split(":"),s=new Date(this.value.valueOf());return s.setHours(Number(r)),s.setMinutes(Number(i)),s.setSeconds(Number(n)),this.set(s)},getFirstDayOfTheYear:function(){return c(new Date(this.value.getFullYear(),0,1))},getLastDayOfTheYear:function(){return c(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfTheMonth:function(){return c(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfTheMonth:function(){return c(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfTheWeek:function(){let e=c(this.value);return e.addDate(-e.weekday)},getLastDayOfTheWeek:function(){let e=c(this.value);return e.addDate(6-e.weekday)},diff:function(e){return{years:this.year-e.year,months:(this.year-e.year)*12+(this.month-e.month),dates:a.scope(()=>{let t=864e5,r=this.clone().setFirstOfTheDay(),i=e.clone().setFirstOfTheDay();return Math.floor((r.ms-i.ms)/t)}),hours:a.scope(()=>{let t=36e5,r=this.clone().setMinutes(0).setSeconds(0).setMilliseconds(0),i=e.clone().setMinutes(0).setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),minutes:a.scope(()=>{let t=6e4,r=this.clone().setSeconds(0).setMilliseconds(0),i=e.clone().setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),seconds:a.scope(()=>{let t=this.clone().setMilliseconds(0),r=e.clone().setMilliseconds(0);return Math.floor((t.ms-r.ms)/1e3)}),ms:this.ms-e.ms}},getAge:function(e){let t=e||c(),r=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&r--,r}},c);c.isTimeObject=e=>{var t;return((t=e||{})==null?void 0:t.constructor)===c};c.getFromNumberYYYYMMDD=e=>{let t=Number(e).zeroEmbed(8).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return c(t+" 00:00:00")};c.getShortYMDs=(e,t)=>{let r="",i="";return e.year==t.year&&e.year==c().year?r=e.toFormatMD():r=e.toFormatYMD(),e.year!=t.year?i=t.toFormatYMD():i=t.toFormatMD(),[r,i]};c.getPeriodArray=(e,t,r)=>{let i=[],n=t;if(!t.validate||!r.validate)return i;for(;n.toFormatYMDHMS().toNumber()<=r.toFormatYMDHMS().toNumber();)i.push(n),e=="year"?n=c(n).addYear(1):e=="month"?n=c(n).addMonth(1):e=="week"?n=c(n).addWeek(1):e=="day"?n=c(n).addDate(1):e=="hours"?n=c(n).addHours(1):e=="minutes"?n=c(n).addMinutes(1):e=="seconds"&&(n=c(n).addSeconds(1));return i};c.prototype.Time.prototype=c.prototype;var w={},E={set:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{let s=w[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),w[i]={privateKey:t,value:n}}),r},update:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{var o;let s=w[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),w[i]=J(R({},w[i]),{value:R(R({},(o=w[i])==null?void 0:o.value),n)})}),r},get:(e,t)=>{let r=w[e];if(!(r&&r.privateKey&&r.privateKey!=t))return r==null?void 0:r.value},delete:(e,t)=>{let r=w[e];return r&&r.privateKey&&r.privateKey!=t?!1:(delete w[e],!0)}};var pe=(...[e,t,r])=>new v.prototype.Interval(e,t,r),v=pe;v.prototype={};var ye=function(...[e,t,r]){return this.fn=e,this.ms=t,this.key=r,this.isFinished=!1,v.abort(this.key),this.store(),this};a.extend({key:"",ms:0,timeoutIndex:-1,fn:null,isFinished:!1,Interval:ye,store:function(){E.set({["Interval_"+this.key]:this})},once:function(){if(this.fn){let e=()=>{this.fn&&this.fn(),this.isFinished=!0,this.store()};this.timeoutIndex=setTimeout(e,this.ms)}return this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return v.abort(this.timeoutIndex),this},setState:function(e){return Object.entries(e).forEach(([t,r])=>{this.hasOwnProperty(t)&&(this[t]=r)}),this.store(),this}},v);v.abort=e=>{if(a.is.number(e))return clearInterval(e);let t=E.get("Interval_"+e);t&&(t&&clearInterval(t.timeoutIndex),t.setState({isFinished:!0}))};v.get=e=>E.get("Interval_"+e);v.once=(e,t,r)=>v(e,t,r).once();v.series=(e,t)=>y(void 0,null,function*(){return new Promise(r=>{let i=v.get(e);if(i&&!i.isFinished)return r(null);let n=()=>{v.abort(e)};r(n),t&&v(n,t,e).once()})});v.start=(e,t,r)=>v(e,t,r).start();v.prototype.Interval.prototype=v.prototype;var de=(e,t)=>new f.prototype.Fetcher(e,t),f=de;f.prototype={};f.waitList=[];f.setDefaultTrafficControl=0;f.setDefaultTimeout=1e3*60*10;f.abort=e=>{let t="fetcher.abortController."+e,r=E.get(t);console.log(r),r&&r.abort()};f.isReadableStream=e=>e instanceof ReadableStream;f.isReadableStreamReader=e=>e instanceof ReadableStreamDefaultReader;f.streamToContext=(e,t)=>y(void 0,null,function*(){try{let r=(t==null?void 0:t.reader)||e.getReader();if(!f.isReadableStreamReader(r))return{ok:!1,done:!0,data:null};if(!r)return{ok:!1,done:!0,data:null};let i=(t==null?void 0:t.decoder)||new TextDecoder("utf-8"),n=yield r.read();return{ok:!0,done:n.done,data:i.decode(n.value)}}catch(r){return{ok:!1,done:!0,data:r}}});var ge=function(e,t){var n;t=t||{};let r=t.body;t.body&&!a.is.string(t.body)&&((n=t.bodyStringify)==null||n)&&(r=a.Stringify(t.body||{}));let i=e;return a.is.string(e)&&!e.match(/https?:/)&&(i=location.origin+"/"+e.replace(/^\//,"")),this.url=i,this.method=t.method||"get",this.streamStatus="open",this.params=J(R({key:x(),response_format:"json",timeout:f.setDefaultTimeout,trafficControl:f.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:R(R({"Content-Type":"application/json"},f.setDefaultHeaders&&f.setDefaultHeaders()),t.headers),body:r}),this};a.extend({Fetcher:ge,params:{},url:"",method:"GET",streamStatus:"closed",onStartCB:void 0,onKeyDuplicateCB:void 0,onCompleteCB:void 0,onRetryCB:void 0,isRetry:!1,extraBody:{},abortController:null,setExtraBody:function(e){return this.extraBody=R(R({},this.extraBody),e),this},onErrorCB:()=>{},onResultCB:()=>{},onStreamCB:()=>{},onStart:function(e){return this.onStartCB=e,this},onKeyDuplicate:function(e){return this.onKeyDuplicateCB=e,this},onStream:function(e){return this.onStreamCB=e,this},onResult:function(e){return this.onResultCB=e,this},onComplete:function(e){return this.onCompleteCB=e,this},onRetry:function(e){return this.onRetryCB=e,this},onError:function(e){return this.onErrorCB=e,this},onStreamProcess:function(e){return y(this,null,function*(){let{response:t,errorCB:r,streamCB:i,reader:n,decoder:s}=e,o=t.body,u=this,l=function(){return Z(this,null,function*(){if(!t.ok){a.scope(()=>y(this,null,function*(){let{ok:M,done:g,data:D}=yield f.streamToContext(o,{reader:n,decoder:s});M&&r(D)}));return}let m=!1;for(;!m;){let{ok:M,done:g,data:D}=yield new K(f.streamToContext(o,{reader:n,decoder:s}));u.streamStatus=="abort"?(u.streamStatus="closed",n.cancel(),g=!0):u.streamStatus=="closed"&&(g=!0),g&&(m=g,n.releaseLock()),i(D,g)}})};try{for(var h=ee(l()),p,d,C;p=!(d=yield h.next()).done;p=!1){let m=d.value;;}}catch(d){C=[d]}finally{try{p&&(d=h.return)&&(yield d.call(h))}finally{if(C)throw C[0]}}})},get:function(){return this.method="GET",this.send()},head:function(){return this.method="HEAD",this.send()},post:function(){return this.method="POST",this.send()},put:function(){return this.method="PUT",this.send()},delete:function(){return this.method="DELETE",this.send()},patch:function(){return this.method="PATCH",this.send()},options:function(){return this.method="OPTIONS",this.send()},send:function(){return y(this,null,function*(){var z;let e=this.params,t=performance.now(),W=e,{key:r,response_format:i,trafficControl:n,preventMultiRequest:s,timeout:o,queries:u}=W,l=Q(W,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);l.method=this.method;let h=[this.method,r].join("."),p=f.waitList.includes(h);f.waitList=[...f.waitList,h];let d=!1,C=!1,m=!1,M=0,g=500,D="InternalServerError",P={},k=null,B=new AbortController,te=setTimeout(()=>{B.abort(),console.log("timeout",o)},e.timeout);l.signal=B.signal,this.abortController=B;let $="fetcher.abortController."+this.params.key;E.set({[$]:B});let H=()=>{d=!0},q=()=>(B.abort(),f.waitList=f.waitList.filter(T=>T!=h),{isCancelled:d,isAborted:C,ok:!1,status:0,statusText:"CANCELLED",body:P,requestTime:0,rawData:null});try{if(f.setDefaultOnStart&&(yield f.setDefaultOnStart(e,H)),this.onStartCB&&(yield this.onStartCB(e,H)),d)return q();if(p){if(this.onKeyDuplicateCB&&(yield this.onKeyDuplicateCB(H)),d)return q();if(s)throw g=429,new Error("TooManyRequests")}let T=a.queryParams.set(R({},u),String(this.url)),Y=yield fetch(T,l).then(F=>y(this,null,function*(){return m=F.ok,g=F.status,D=F.statusText,k=F,i=="none"||i=="stream"?F:F[i]()})).catch(F=>{throw new Error(F)});E.delete($),P=Y}catch(T){g==200&&(g=500,m=!1),g==429&&(D="TooManyRequests"),B.signal.aborted&&(g=408,D="Timeout",C=!0),g==500&&(D=String(T)||D),P={errorCode:String(T)}}finally{clearTimeout(te),M=performance.now()-t}let A={isCancelled:d,isAborted:C,ok:m,status:g,statusText:D,body:P,additionalBody:this.extraBody,requestTime:M,rawData:k};if(!m){if(this.onRetryCB&&!this.isRetry){this.isRetry=!0;let T=yield this.onRetryCB(A.body,this.params,this);if(T)return f.waitList=f.waitList.filter(Y=>Y!=h),this.params=T,this.send()}this.onErrorCB&&this.onErrorCB(A.body)}if(m&&this.onStreamCB&&e.response_format=="stream"){let T=(z=k.body)==null?void 0:z.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:A,reader:T,decoder:new TextDecoder("utf-8")})}if(e.trafficControl){let T=e.trafficControl-Math.round(M);T>0&&(yield a.pending(()=>{},T),A.requestTime=e.trafficControl)}return m&&this.onCompleteCB&&this.onCompleteCB(A.body),this.onResultCB&&this.onResultCB(A,e),f.setDefaultOnEnd&&f.setDefaultOnEnd(A,e),f.waitList=f.waitList.filter(T=>T!=h),A})},abortStream:function(){this.streamStatus="abort"}},f);f.prototype.Fetcher.prototype=f.prototype;var be=e=>new S.prototype.Filer(e),S=be;S.prototype={};var Ce=function(e){this.ok=!0;try{let[t,r]=e.name.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" ");this.file=e,this.extension=r,this.fileName=t,this.type=e.type}catch(t){console.log(t),this.ok=!1}return this};a.extend({ok:!1,extension:"",type:"",file:{},fileName:"",Filer:Ce,isValid:function(){return this.ok},toBlob:function(){return y(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return y(this,null,function*(){var t;return(t=(yield this.file.convert("dataURL")).target)==null?void 0:t.result})},toAarrayBuffer:function(){return y(this,null,function*(){var t;return(t=(yield this.file.convert("arrayBuffer")).target)==null?void 0:t.result})},toObjectURL:function(){return y(this,null,function*(){return URL.createObjectURL(this.file)})},updateFileName:function(e){let t=new File([this.file],e+"."+this.extension);return this.file=t,this.fileName=e,this},updateMimeType:function(e){return this.file=new File([this.file],this.fileName+"."+this.extension,{type:e}),this.type=e,this},updateExtension:function(e){let t=new File([this.file],this.fileName+"."+e);return this.file=t,this.extension=e,this}},S);S.fromFile=e=>y(void 0,null,function*(){return S(e)});S.fromBlob=(e,t)=>y(void 0,null,function*(){let r=(t==null?void 0:t.fileName)||"file",i=(t==null?void 0:t.extension)||"",n=new File([e],r+"."+i,{type:t==null?void 0:t.mimeType});return S(n)});S.fromArrayBuffer=(e,t)=>y(void 0,null,function*(){return S.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t)});S.fromObjectURL=(e,t)=>y(void 0,null,function*(){let r=yield f(e,{response_format:"blob"}).get();return r.ok?S.fromBlob(r.body,t):S({})});S.fromDataURL=(e,t)=>y(void 0,null,function*(){let r=yield e.toBlob((t==null?void 0:t.mimeType)||"");return r?S.fromBlob(r,t):S({})});S.prototype.Filer.prototype=S.prototype;var Me=function(e){let t=e,r=null;return t.use((i,n,s)=>{let o=n;o.return=u=>{let{ok:l,status:h,body:p={},bodyStringify:d=!0}=u||{};h=h!=null?h:(l!=null?l:!0)&&200||403;let C=p;return d&&!a.is.string(p)&&(C=a.Stringify(p)),n.status(h).end(C)},s()}),t.onPathRouter=function(i){return r=i,this},t.pathRouter=function(i){if(!r)return;let n=r(i);return n.route(i),t.use(i,n),n},t.exception=function(i){return t.use(i),this},t},_=Me;_.getLocalIP=e=>{let t="";return a.scope(()=>{if(!e)return;let r=e.networkInterfaces();for(let[i,n]of Object.entries(r))n.forEach(s=>{!s.internal&&s.family==="IPv4"&&!s.address.match(/^(169|127)/)&&(t=s.address)})}),t};_.getIP=function(e){var i;return(((e==null?void 0:e.headers["x-forwarded-for"])||((i=e==null?void 0:e.socket)==null?void 0:i.remoteAddress)||"").toString().match(new RegExp(/(::ffff:)?(\d+\.\d+.\d+\.\d+(:\d+)?)/))||[])[2]||"UNKNOWN IP"};a.copyToClipboard=e=>y(void 0,null,function*(){let t="";a.is.string(e)?t=e:a.is.function(e)&&(t=e());let r={ok:!1,body:"NotSupported"};return yield y(void 0,null,function*(){let i;if(navigator.clipboard){if(i=yield navigator.clipboard.writeText(t).then(()=>!0,()=>!1),!i)return}else{let n=document.createElement("input");if(a(document.body).append(n),n.value=t,n.select(),i=document.execCommand("copy"),document.body.removeChild(n),!i)return}r={ok:!0,body:""}}),r});a.ImageLoader=(e,t)=>new Promise((r,i)=>{let n=t||new Image;n.onload=()=>r(n),n.onerror=s=>i(s),n.src=e});a.formatCharacter={postal:{JP:e=>{let t="--";return e=String(e).replace(/\D/ig,""),e.length==7&&(t=e.replace(/^(\d{3})(.*)/,"$1-$2")),t}},tel:{_:e=>{let t=e;return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t},mobile:e=>{let t="--";return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),t},fixed:e=>{let t="--";return e=String(e).removeLetters(),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t}}};a.transformer={weekday:{ENG:e=>["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"][e]+"day",JP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]+"\u66DC\u65E5",shortJP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]},wareki:e=>{let t=[],r=[],i=!1;return[{From:1868,To:1912,name:"\u660E\u6CBB"},{From:1912,To:1926,name:"\u5927\u6B63"},{From:1926,To:1989,name:"\u662D\u548C"},{From:1989,To:2019,name:"\u5E73\u6210"},{From:2019,To:1e5,name:"\u4EE4\u548C"}].forEach(s=>{let{From:o,To:u,name:l}=s;if(o<=e&&e<=u){let h=e-o+1;h==1&&(i=!0,h="\u5143"),r.push(l+h+"\u5E74"),t.push(l)}}),{era:t,value:r,gap:i}}};a.interval=v;f.setDefaultHeaders=()=>({});var ve=a;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
|
|
1
|
+
"use strict";var N=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptor,ie=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var V=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var L=Math.pow,X=(e,t,r)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))j.call(t,r)&&X(e,r,t[r]);if(O)for(var r of O(t))G.call(t,r)&&X(e,r,t[r]);return e},J=(e,t)=>re(e,ie(t));var Q=(e,t)=>{var r={};for(var i in e)j.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&O)for(var i of O(e))t.indexOf(i)<0&&G.call(e,i)&&(r[i]=e[i]);return r};var ae=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},oe=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of se(t))!j.call(e,n)&&n!==r&&N(e,n,{get:()=>t[n],enumerable:!(i=ne(t,n))||i.enumerable});return e};var ue=e=>oe(N({},"__esModule",{value:!0}),e);var y=(e,t,r)=>new Promise((i,n)=>{var s=l=>{try{u(r.next(l))}catch(h){n(h)}},o=l=>{try{u(r.throw(l))}catch(h){n(h)}},u=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);u((r=r.apply(e,t)).next())}),K=function(e,t){this[0]=e,this[1]=t},Z=(e,t,r)=>{var i=(o,u,l,h)=>{try{var p=r[o](u),d=(u=p.value)instanceof K,C=p.done;Promise.resolve(d?u[0]:u).then(m=>d?i(o==="return"?o:"next",u[1]?{done:m.done,value:m.value}:m,l,h):l({value:m,done:C})).catch(m=>i("throw",m,l,h))}catch(m){h(m)}},n=o=>s[o]=u=>new Promise((l,h)=>i(o,u,l,h)),s={};return r=r.apply(e,t),s[V("asyncIterator")]=()=>s,n("next"),n("throw"),n("return"),s};var ee=(e,t,r)=>(t=e[V("asyncIterator")])?t.call(e):(e=e[V("iterator")](),t={},r=(i,n)=>(n=e[i])&&(t[i]=s=>new Promise((o,u,l)=>(s=n.call(e,s),l=s.done,Promise.resolve(s.value).then(h=>o({value:h,done:l}),u)))),r("next"),r("return"),t);var ve={};ae(ve,{Fetcher:()=>c,Filer:()=>v,Server:()=>_,Time:()=>f,UUID:()=>E,default:()=>Se,useStore:()=>T});module.exports=ue(ve);typeof HTMLElement!="undefined"&&(HTMLElement.prototype.position=function(){return this.getBoundingClientRect()});typeof String!="undefined"&&(String.prototype.compress=function(){return this.trim().replace(/(\s|\n|\t)/ig,"")},String.prototype.encode=function(){return encodeURIComponent(this)},String.prototype.decode=function(){return decodeURIComponent(this)},String.prototype.toUpper=function(){return this.toLocaleUpperCase()},String.prototype.toLower=function(){return this.toLocaleLowerCase()},String.prototype.toCapital=function(){let e=this;return e&&(e=e.replace(/^./,this[0].toUpper()).replace(/(\s|_|-)[a-z]{1}/ig,t=>t[1].toUpper())),e},String.prototype.clip=function(e,t){return this.slice(e,t)},String.prototype.partReplace=function(e,t){return this.slice(0,e)+t+this.slice(e+t.length)},String.prototype.toBlob=function(e){let t=atob(this.replace(/^.*,/,"")),r=new Uint8Array(t.length);for(var i=0;i<t.length;i++)r[i]=t.charCodeAt(i);try{var n=new Blob([r.buffer],{type:e})}catch(s){return!1}return n},String.prototype.toNumber=function(){return Number(this.removeLetters())},String.prototype.removeLetters=function(){return this.replace(/[\D]/ig,"")},String.prototype.removeSpecifics=function(){return this.replace(/[^\w\s\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]|_/uig,"")},String.prototype.removeJP=function(){return this.replace(/[\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]+/uig,"")},String.prototype.zen2hanNumber=function(){return this.replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).replace(/[--﹣−‐⁃‑‒–—﹘―⎯⏤ーー─━]/g,"-").replace(/¥/,"\xA5").replace(/、/,",").replace(/(/,"(").replace(/)/,")").replace(/+/,"+")},String.prototype.escapeRegExChar=function(){return this.replace(/\\/g,"\\\\").replace(/(\?|\^|\$|\.|\||\*|\+|\(|\)|\{|\}|\[|\])/g,"\\$1")});typeof Number!="undefined"&&(Number.prototype.zeroEmbed=function(e){return String(this).padStart(e||2,"0")},Number.prototype.ratio=function(e,t=2){let r=L(10,t);return Math.round(this/e*r*100)/r},Number.prototype.rate=function(e,t=2){let r=L(10,t);return Math.round(this/e*r)/r},Number.prototype.rank=function(e=1){let t=L(10,e),r=Number(this);if(r<1e3)return String(this);let i=r.toLocaleString().replace(/\d/ig,"").length;return Math.round(r/L(1e3,i)*t)/t+("KMGTPEZY"[i-1]||"")},Number.prototype.rankJp=function(){let e=Number(this),t="";return e>=1e12?t=`${e/1e12}\u5146`:e>=1e8?t=`${e/1e8}\u5104`:e>=1e4?t=`${e/1e4}\u4E07`:e>=1e3?t=`${e/1e3}\u5343`:t=`${e.toLocaleString()}`,t},Number.prototype.toDate=function(e="/"){let t=String(this),r=t.slice(0,4),i=t.slice(4,6),n=t.slice(6,8),s=[];return r.length!=4||s.push(r),i.length!=2||s.push(i),n.length!=2||s.push(n),s.join(e)});if(typeof Array!="undefined"){let e=(r,...i)=>{var s;let n=r;for(let o of i){if(o!==(o!=null?o:!o))break;n=(s=(n||{})[o!=null?o:""])!=null?s:null}return n},t=r=>typeof r=="number"&&!isNaN(r);Array.prototype.toASC=function(r,i,n){let s=[];Array.isArray(r)?s.push(...r):r&&(s=[r]);let o=[],u=[];for(let l of s){let h=String(l).match(/([^\.\[\]"]+)/g);o.push(h),u.push(this.every(p=>t(Number(e(p,...h)))))}return this.sort((l,h)=>{for(let p=0;p<o.length;p++){let d=o[p],C=u[p],m=e(l,...d),M=e(h,...d);if(C){if(Number(m)>Number(M))return 1;if(Number(m)<Number(M))return-1;continue}if(t(m)&&!t(M))return-1;if(!t(m)&&t(M))return 1;let g=String(m).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,k=>k.padStart(10,"0")),R=String(M).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,k=>k.padStart(10,"0")),P=g.localeCompare(R,i,n);if(P!=0)return P}return 0})},Array.prototype.toDESC=function(...r){return this.toASC(...r).reverse()},Array.prototype.getSum=function(...r){return this.reduce((i,n)=>i+(r?e(n,...r):Number(n)||0),0)},Array.prototype.getAve=function(...r){return this.getSum(...r)/this.length},Array.prototype.getMedian=function(...r){let i=this.map(s=>r?e(s,...r):Number(s)||0);i.sort((s,o)=>s-o);let n=Math.floor(i.length/2);return i.length%2===0?(i[n-1]+i[n])/2:i[n]},Array.prototype.getMin=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.min(...i)},Array.prototype.getMax=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.max(...i)}}typeof File!="undefined"&&(File.prototype.convert=function(e){return e=e||"dataURL",new Promise((t,r)=>{let i=new FileReader;i.onload=s=>t(s),i.onerror=s=>r(s);let n="readAs"+(e==null?void 0:e.toCapital());i[n](this)})});var le=(e=24)=>Array.from({length:e}).map((t,r)=>{let i=r==0?25:35,n=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*i)][n?"toUpper":"toLower"]()}).join(""),E=le;E.get128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");E.get32Hex=(e="Formatted",t="-")=>{let r=Array.from({length:32}).map((i,n)=>"0123456789abcdef"[Math.round(Math.random()*15)]).join("").toUpper();return e=="Formatted"&&(r=[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,20),r.slice(20,32)].join(t)),r};E.to32Format=e=>[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-").toUpper();var he=e=>new a.prototype.jmini(e),a=he;a.prototype={};a.extend=function(e,t=a){for(var[r,i]of Object.entries(e))t.prototype[r]=i};a.expando="__jmini_"+E();var b=(e,t)=>(e.queue.push(t),U(e),e),U=e=>y(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let t=e.queue.shift();t&&(yield t()),e.queueProcess=!1,U(e)}),I=(e,t)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,i]of Object.entries(t))r.match(/queue/)||(e[r]=i);return e},me=(e,t)=>{if(t.length){for(var r=0;r<t.length;r++){let i=t[r];i&&(i[a.expando]||(a.is.element(i)||a.is.shadowRoot(i))&&(i[a.expando]={events:{}})),e[r]=i}e.length=t.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,U(e),e};a.extend({constructor:a,jmini:function(e){return this.src=e,this.srcType=a.is.what(e),this.queueProcess=!0,this.queue=[],me(this,a.is.jmini(e)?e.get():a.is.element(e)?[e]:a.is.elements(e)?e:a.is.shadowRoot(e)?[e]:a.is.string(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}});a.prototype[String(Symbol.iterator)]=[][Symbol.iterator];a.prototype.jmini.prototype=a.prototype;{let e=function(n,s,o){let u=[];for(let l=0;l<(n.length||0);l++)u.push(s(n[l],l));return o&&(u=u.filter(l=>l!=null)),u},t=n=>(n.for((s,o)=>{if(!(a.is.element(s)||a.is.shadowRoot(s)))return;let u=s.cloneNode(),l=s.parentNode;l&&l.replaceChild(u,s),n[o]=u}),n),r=(n,s)=>(a(s).for(o=>{if(n&&(a.is.element(o)||a.is.shadowRoot(o)))if(a.is.string(n)||a.is.number(n))n=String(n),o.insertAdjacentHTML("beforeend",String(n));else if(a.is.element(n))o.appendChild(n);else{a.is.jmini(n)?n=n.get():a.is.element(n)?n=[n]:a.is.keyValueDictionary(n)&&(n=[a(n)]);for(var u=0;u<n.length;u++)r(n[u],o)}}),s),i=(n,s,...o)=>{let{p:u,s:l}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return n.for(h=>{if(a.is.string(o[0]))h.insertAdjacentHTML(u,o[0]);else{if(!h.parentNode)return;a(o[0]).for(d=>{o[1]&&(d=d.cloneNode(!0)),h.parentNode.insertBefore(d,h[l]||h)})}}),n};a.extend({get:function(n){return n?this[0]:e(this,s=>s)},for:function(n,s=1){let o=e(this,(u,l)=>n(u,l),1);return s?o:[]},await:function(n){return b(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},n)}))},abort:function(){return b(this,()=>y(this,null,function*(){return this.queue=[],this}))},callback:function(n){return b(this,()=>y(this,null,function*(){return yield n(this),this}))},click:function(){return b(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];a.is.element(s)&&s.click()}return this})},focus:function(){return b(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];a.is.element(s)&&s.focus()}return this})},addEvent:function(n){return b(this,()=>{let{eventType:s,eventID:o=E(),target:u,callback:l,options:h}=n;return h=x({passive:!0,capture:!1},h),this.for(p=>{if(!(a.is.element(p)||a.is.shadowRoot(p)))return;let{events:d}=p[a.expando];if(u){let C=l;l=m=>{if(m.target){if(a.is.string(u)){let g=m.target.closest(u);g&&(!g||C.call(g,m))}else if(a.is.elements(u)){for(let M of u)if(m.target==M)return C.call(M,m)}}}}if(d[o]){let C=d[o];p.removeEventListener(C.eventType,C.callback,C.options)}d[o]={eventType:s,callback:l,options:h},p.addEventListener(s,l,h)}),this})},removeEvent:function(n){return b(this,()=>{let s=a.is.array(n)?n:[n];return this.for(o=>{let{events:u}=o[a.expando];for(let l of s){let h=u[l];h&&o.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(n){return b(this,()=>I(this,r(n,t(this))))},empty:function(){return b(this,()=>I(this,t(this)))},append:function(n){return b(this,()=>{r(n,this)})},remove:function(){return b(this,()=>(this.for((n,s)=>{n&&a.is.element(n)&&(n.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...n){return b(this,()=>I(this,i(this,"before",...n)))},after:function(...n){return b(this,()=>I(this,i(this,"after",...n)))},find:function(n){return b(this,()=>{let s=[],o=this[0];o||I(this,a()),(a.is.element(o)||a.is.shadowRoot(o))&&(a.is.string(n)?s=o.querySelectorAll(n):a.is.element(o)&&a(n).for(u=>{let l=o.childNodes;for(let h of l)if(h===u){s.push(h);break}else h.childNodes.length&&(s=[...s,...a(h).find(u).for(p=>p)])})),I(this,a(s))})},parent:function(n){return b(this,()=>{var o,u;let s=a(n?(o=this[0])==null?void 0:o.closest(n):(u=this[0])==null?void 0:u.parentNode);I(this,s)})},children:function(n){return b(this,()=>{let s=this[0].children;a.is.exist(n)&&(n=String(n).replace(/^ : /,""),s=n=="first"?s[0]:n=="last"?s[s.length-1]:s[Number(n)]);let o=a(s);return I(this,o)})},addClass:function(n){return b(this,()=>(n&&this.for(s=>{let o=a.is.string(n)?n.split(" "):n;s&&a.is.element(s)&&s.classList.add(...o)}),this))},removeClass:function(n){return b(this,()=>(n&&this.for(s=>{let o=a.is.string(n)?n.split(" "):n;s&&a.is.element(s)&&s.classList.remove(...o)}),this))},toggleClass:function(n){return b(this,()=>(n&&this.for(s=>{s.classList.toggle(n)}),this))},hasClass:function(n=""){if(this[0])return this[0].classList.contains(n.replace(/^\./,""))},findClass:function(n){let s=[];return this[0]&&(s=[...this[0].classList].filter(o=>o.match(n))),s},css:function(n){return b(this,()=>(this.for(s=>{if(a.is.element(s))for(let[o,u]of Object.entries(n)){if(a.is.number(u)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[o]=u+"px";continue}s.style[o]=String(u)}}),this))},getAttribute:function(n){return this[0].getAttribute(String(n))},setAttribute:function(n,s){return b(this,()=>(this.for(o=>o.setAttribute(n,s)),this))},getStyleProperty:function(n){let s=this[0];return s&&a.is.element(s)?getComputedStyle(s).getPropertyValue(n):""},setStyleProperty:function(n,s){let o=this[0];return o&&a.is.element(o)&&o.style.setProperty(n,s),this},val:function(){var s;let n=this[0];return(n==null?void 0:n.value)||((s=n==null?void 0:n.dataset)==null?void 0:s.value)},position:function(){return a.is.element(this[0])?this[0].getBoundingClientRect():{}}})}a.flatArray=(e,t)=>{if(!a.is.array(e))return[e];let r=[];for(let i of e)r.push(...t=="-R"?a.flatArray(i,"-R"):[i]);return r};a.uniqueArray=(e,t)=>{let r=e;return t?r=Array.from(new Map(e.map(i=>[a.getKeyValue(i,t||"0"),i])).values()):r=Array.from(new Set(e)),r};a.getKeyValue=(e,t)=>{let r={},i=e;return t.split(".").forEach(n=>{i=i==null?void 0:i[n],r=i}),r};a.Stringify=(...e)=>{let[t,r,i]=e;return JSON.stringify(t,r!=null?r:(()=>{let n=new WeakSet;return(s,o)=>{if(typeof o=="object"&&o!==null){if(n.has(o))return"[Circular Reference]";n.add(o)}return o}})(),i)};a.Objectify=(e,t)=>{try{return JSON.parse(e)}catch(r){return t!=null?t:null}};a.SortifyObject=(e,t)=>{let r={};return Object.keys(e).sort().forEach(i=>{let n=e[i];if(t){if(a.is.keyValueDictionary(n)){r[i]=a.SortifyObject(n,t);return}if(a.is.array(n)){r[i]=n.map(s=>a.is.keyValueDictionary(s)||a.is.array(s)?a.SortifyObject(s,t):s);return}}r[i]=n}),r};a.randomNumber=(e=0,t=100,r)=>{if(e>t)return NaN;let i=Math.round(Math.random()*(t-e))+e;return r&&r.length&&r.includes(i)?a.randomNumber(e,t,r):i};a.try=e=>{try{return[e(),!0]}catch(t){return[t,!1]}};a.trySync=e=>y(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});a.scope=e=>e();a.scopeSync=e=>y(void 0,null,function*(){return yield e()});a.createElement=function(e){var d;let{tag:t,className:r="",id:i,html:n,attr:s,style:o,parent:u}=e,l=document.createElement(t||"div");if(r&&l.classList.add(...r.split(" ")),i&&(l.id=i),s)for(let C of Object.entries(s)){let m=C[0],M=(d=C[1])!=null?d:"";if(m=="data"&&a.is.keyValueDictionary(M))for(let[g,R]of Object.entries(M))l.dataset[g]=R;else m=="for"?m="htmlFor":m=="tabindex"?m="tabIndex":m=="aria-label"&&(m="ariaLabel"),l[m]=M}if(n&&a(l).append(n),o)for(var[h,p]of Object.entries(o))l.style[h]=p;return u&&a(u).append(l),l};a.setCookie=e=>{let{hostname:t}=new URL(location.toString()),{name:r,value:i="",age:n=60*60*24*365,path:s="/",domain:o=t,secure:u=!1}=e,l=`${r}=${i}max-age=${n}path=${s}domain=${o}`;u&&(l+=" Secure"),document.cookie=l};a.getCookie=e=>{let t=document.cookie.match(new RegExp(e+"=[^]*"));return t?t[0].replace(new RegExp(e+"="),""):""};a.localStrage={set:(e,t)=>{localStorage.setItem(e,a.Stringify(t))},get:e=>{let t=localStorage.getItem(e);return a.Objectify(t,t)}};a.deleteCookie=e=>{document.cookie=e+"=max-age=0"};a.getScreenSize=()=>{let{innerHeight:e,innerWidth:t,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:s}=window,o=Number(a(document.body).getStyleProperty("--sat").removeLetters()),u=Number(a(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:t,pageHeight:e-o-u,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:s,safeAreaTop:o,safeAreaBottom:u}};a.getCursor=e=>{var i,n,s,o,u,l,h,p;let t=(o=e.pageX)!=null?o:(s=(i=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:i.pageX)!=null?s:(((n=e==null?void 0:e.originalEvent)==null?void 0:n.touches)||[])[0].pageX,r=(p=e.pageY)!=null?p:(h=(u=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:u.pageY)!=null?h:(((l=e==null?void 0:e.originalEvent)==null?void 0:l.touches)||[])[0].pageY;return{x:t,y:r}};a.pending=(e,t)=>new Promise((r,i)=>{e(r),t&&setTimeout(()=>{r(!0)},t)});a.deepMerge=(e,...t)=>{if(!t.length)return e;let r=t.shift();if(a.is.keyValueDictionary(e)&&a.is.keyValueDictionary(r))for(let i in r)a.is.keyValueDictionary(r[i])?(e[i]||Object.assign(e,{[i]:{}}),a.deepMerge(e[i],r[i])):Object.assign(e,{[i]:r[i]});return a.deepMerge(e,...t)};a.deepCopy=e=>{if(a.is.array(e))return e.map(t=>a.deepCopy(t));if(a.is.keyValueDictionary(e)){let t={};return Object.entries(e).forEach(([r,i])=>{t[r]=a.deepCopy(i)}),t}return e};a.queryParams={get:e=>{let t=new URL(e||location.href),r={};return t.searchParams.forEach((i,n)=>r[n]=i),r},set:(e,t)=>{let r=new URL(t||location.href);return Object.entries(e).forEach(([i,n])=>{r.searchParams.set(i,String(n))}),t||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,t)=>{let r=new URL(t||location.href);return e.forEach(i=>{r.searchParams.delete(i)}),t||history.replaceState({},"",r.pathname+r.search),r.toString()}};a.ellipsisText=(e,t)=>{let r=String(e);return r.length>t&&(r=r.slice(0,t)+" ..."),r};a.is={equal:function(e,t,r){return r==null||r?a.Stringify(e)===a.Stringify(t):e===t},what:function(e){let t="other";return this.jmini(e)?t="jmini":this.element(e)?t="element":this.elements(e)?t="elements":this.shadowRoot(e)?t="shadowRoot":this.string(e)?t="string":this.number(e)?t="number":this.array(e)?t="array":this.function(e)?t="function":this.date(e)?t="date":typeof e=="undefined"?t="undefined":this.keyValueDictionary(e)?t="keyValueDictionary":e==null?t="null":isNaN(e)&&(t="NaN"),t},exist:function(e){return e===(e!=null?e:!e)},nullish:function(e){return!this.exist(e)},jmini:function(e){return(e||{}).constructor===a},string:function(e){return typeof e=="string"},boolean:function(e){return typeof e=="boolean"},number:function(e){return!isNaN(e)&&typeof e=="number"},array:function(e){let t={}.toString.call(e);return Array.isArray(e)||e instanceof Array||t=="[object NodeList]"||t=="[object HTMLCollection]"},function:function(e){return typeof e=="function"},keyValueDictionary:function(e){return{}.toString.call(e)==="[object Object]"&&!this.jmini(e)},element:function(e){return e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e))},elements:function(e){let t={}.toString.call(e),r=Number(!!e&&typeof e!="string"&&this.array(e)&&t!=="[object Text]");if(r&&t!=="[object NodeList]")for(var i of e)r&=Number(this.element(i));return!!r},shadowRoot:function(e){return e instanceof ShadowRoot},date:function(e){return this.number(new Date(e).getTime())}};var ce=e=>new f.prototype.Time(e),f=ce;f.prototype={};var fe=function(e){f.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0&&(e=new Date));let t=new Date(String(e).replace(/\//g,"-"));return this.set(t)};a.extend({value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,constructor:f,Time:fe,clone:function(){return f(this)},set:function(e){this.value=e;let t=a.is.date(e);if(this.validate=t,!t)return this.ms=-1,this.year=-1,this.month=-1,this.weekday=-1,this.weekInYear=-1,this.date=-1,this.hours=-1,this.minutes=-1,this.seconds=-1,this;this.ms=e.getTime(),this.weekday=e.getDay(),this.year=e.getFullYear(),this.month=e.getMonth()+1,this.date=e.getDate();{let r=new Date(this.year,0,1),i=new Date(r.valueOf());i.setDate(i.getDate()-(r.getDay()+1));let n=e.getTime()-i.getTime(),s=Math.ceil(n/(1e3*60*60*24));this.weekInYear=Math.ceil(s/7)}{let r=new Date(this.year,this.month-1,1),i=new Date(r.valueOf());i.setDate(i.getDate()-(r.getDay()+1));let n=e.getTime()-i.getTime(),s=Math.ceil(n/(1e3*60*60*24)),o=Math.ceil(s/7);this.weekInMonth=o}{let r=new Date(this.year,this.month,0),i=r.getDay(),n=new Date(new Date(r).setDate(r.getDate()-i));this.isLastWeekInMonth=this.date>=n.getDate()}return this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this},isPast:function(){let e=f();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=f(e);return this.year==t.year},isSameMonth:function(e){let t=f(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=f(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=f(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},setYear:function(e){let t=new Date(this.value.valueOf());return t.setFullYear(e),this.set(t)},setMonth:function(e){let t=new Date(this.value.valueOf()),r=t.getDate();t.setDate(1),t.setMonth(e-1);let i=f(t).getLastDayOfMonth();return t.setDate(Math.min(r,i.date)),this.set(t)},setDate:function(e){let t=new Date(this.value.valueOf());return t.setDate(e),this.set(t)},setHours:function(e){let t=new Date(this.value.valueOf());return t.setHours(e),this.set(t)},setMinutes:function(e){let t=new Date(this.value.valueOf());return t.setMinutes(e),this.set(t)},setSeconds:function(e){let t=new Date(this.value.valueOf());return t.setSeconds(e),this.set(t)},setMilliseconds:function(e){let t=new Date(this.value.valueOf());return t.setMilliseconds(e),this.set(t)},addYear:function(e){return this.setYear(this.year+e)},addMonth:function(e){return this.setMonth(this.month+e)},addWeek:function(e){return this.addDate(7*e)},addDate:function(e){return this.setDate(this.date+e)},addHours:function(e){return this.setHours(this.hours+e)},addMinutes:function(e){return this.setMinutes(this.minutes+e)},addSeconds:function(e){return this.setSeconds(this.seconds+e)},toFormat:function(e){return this.validate?e.replace(/\%y/ig,this.year.zeroEmbed(4)).replace(/\%m/ig,this.month.zeroEmbed(2)).replace(/\%d/ig,this.date.zeroEmbed(2)).replace(/\%w/ig,this.weekInYear.zeroEmbed(2)).replace(/\%h/ig,this.hours.zeroEmbed(2)).replace(/\%i/ig,this.minutes.zeroEmbed(2)).replace(/\%s/ig,this.seconds.zeroEmbed(2)):""},toFormatYMD:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D"):""},toFormatYM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708"):this.toFormat("%Y/%M"):""},toFormatMD:function(e){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):""},toFormatHM:function(e){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206"):this.toFormat("%h:%i"):""},toFormatYMDHM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%i\u5206"):this.toFormat("%Y/%M/%D %h:%i"):""},toFormatYMDHMS:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2"):this.toFormat("%Y/%M/%D %h:%i:%s"):""},toLangYMD:function(e){if(!this.validate)return"";let t=f(),r=t.diff(this);return r.dates==0?"\u4ECA\u65E5":r.dates==1?"\u6628\u65E5":r.dates>=-7&&r.dates<0?-1*r.dates+"\u65E5\u5F8C":r.dates<=7&&r.dates>0?r.dates+"\u65E5\u524D":this.isSameYear(t)?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D")},setFirstOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),this.set(e)},setLastOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),this.set(e)},setFromFormatHHMM:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(4).replace(/(\d{2})(\d{2})/,"$1:$2"),[r,i]=t.split(":"),n=new Date(this.value.valueOf());return n.setHours(Number(r)),n.setMinutes(Number(i)),this.set(n)},setFromFormatHHMMSS:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(6).replace(/(\d{2})(\d{2})(\d{2})/,"$1:$2:$3"),[r,i,n]=t.split(":"),s=new Date(this.value.valueOf());return s.setHours(Number(r)),s.setMinutes(Number(i)),s.setSeconds(Number(n)),this.set(s)},getFirstDayOfYear:function(){return f(new Date(this.value.getFullYear(),0,1))},getLastDayOfYear:function(){return f(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfMonth:function(){return f(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfMonth:function(){return f(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfWeek:function(){let e=f(this.value);return e.addDate(-e.weekday)},getLastDayOfWeek:function(){let e=f(this.value);return e.addDate(6-e.weekday)},diff:function(e){return{years:this.year-e.year,months:(this.year-e.year)*12+(this.month-e.month),dates:a.scope(()=>{let t=864e5,r=this.clone().setFirstOfDay(),i=e.clone().setFirstOfDay();return Math.floor((r.ms-i.ms)/t)}),hours:a.scope(()=>{let t=36e5,r=this.clone().setMinutes(0).setSeconds(0).setMilliseconds(0),i=e.clone().setMinutes(0).setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),minutes:a.scope(()=>{let t=6e4,r=this.clone().setSeconds(0).setMilliseconds(0),i=e.clone().setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),seconds:a.scope(()=>{let t=this.clone().setMilliseconds(0),r=e.clone().setMilliseconds(0);return Math.floor((t.ms-r.ms)/1e3)}),ms:this.ms-e.ms}},getAge:function(e){let t=e||f(),r=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&r--,r}},f);f.isTimeObject=e=>{var t;return((t=e||{})==null?void 0:t.constructor)===f};f.getFromNumberYYYYMMDD=e=>{let t=Number(e).zeroEmbed(8).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return f(t+" 00:00:00")};f.getShortYMDs=(e,t)=>{let r="",i="";return e.year==t.year&&e.year==f().year?r=e.toFormatMD():r=e.toFormatYMD(),e.year!=t.year?i=t.toFormatYMD():i=t.toFormatMD(),[r,i]};f.getPeriodArray=(e,t,r)=>{let i=[],n=t;if(!t.validate||!r.validate)return i;for(;n.toFormatYMDHMS().toNumber()<=r.toFormatYMDHMS().toNumber();)i.push(n),e=="year"?n=f(n).addYear(1):e=="month"?n=f(n).addMonth(1):e=="week"?n=f(n).addWeek(1):e=="day"?n=f(n).addDate(1):e=="hours"?n=f(n).addHours(1):e=="minutes"?n=f(n).addMinutes(1):e=="seconds"&&(n=f(n).addSeconds(1));return i};f.prototype.Time.prototype=f.prototype;var w={},T={set:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{let s=w[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),w[i]={privateKey:t,value:n}}),r},update:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{var o;let s=w[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),w[i]=J(x({},w[i]),{value:x(x({},(o=w[i])==null?void 0:o.value),n)})}),r},get:(e,t)=>{let r=w[e];if(!(r&&r.privateKey&&r.privateKey!=t))return r==null?void 0:r.value},delete:(e,t)=>{let r=w[e];return r&&r.privateKey&&r.privateKey!=t?!1:(delete w[e],!0)}};var pe=(...[e,t,r])=>new S.prototype.Interval(e,t,r),S=pe;S.prototype={};var ye=function(...[e,t,r]){return this.fn=e,this.ms=t,this.key=r,this.isFinished=!1,S.abort(this.key),this.store(),this};a.extend({key:"",ms:0,timeoutIndex:-1,fn:null,isFinished:!1,Interval:ye,store:function(){T.set({["Interval_"+this.key]:this})},once:function(){if(this.fn){let e=()=>{this.fn&&this.fn(),this.isFinished=!0,this.store()};this.timeoutIndex=setTimeout(e,this.ms)}return this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return S.abort(this.timeoutIndex),this},setState:function(e){return Object.entries(e).forEach(([t,r])=>{this.hasOwnProperty(t)&&(this[t]=r)}),this.store(),this}},S);S.abort=e=>{if(a.is.number(e))return clearInterval(e);let t=T.get("Interval_"+e);t&&(t&&clearInterval(t.timeoutIndex),t.setState({isFinished:!0}))};S.get=e=>T.get("Interval_"+e);S.once=(e,t,r)=>S(e,t,r).once();S.series=(e,t)=>y(void 0,null,function*(){return new Promise(r=>{let i=S.get(e);if(i&&!i.isFinished)return r(null);let n=()=>{S.abort(e)};r(n),t&&S(n,t,e).once()})});S.start=(e,t,r)=>S(e,t,r).start();S.prototype.Interval.prototype=S.prototype;var de=(e,t)=>new c.prototype.Fetcher(e,t),c=de;c.prototype={};c.waitList=[];c.setDefaultTrafficControl=0;c.setDefaultTimeout=1e3*60*10;c.abort=e=>{let t="fetcher.abortController."+e,r=T.get(t);console.log(r),r&&r.abort()};c.toFlatQuery=e=>{let t={};return Object.entries(e).forEach(([r,i])=>{if(a.is.array(i)){t[r]=i.join(",");return}else if(a.is.keyValueDictionary(i)){Object.entries(c.toFlatQuery(i)).forEach(([n,s])=>{t[`${r}.${n}`]=s});return}t[r]=i}),t};c.isReadableStream=e=>e instanceof ReadableStream;c.isReadableStreamReader=e=>e instanceof ReadableStreamDefaultReader;c.streamToContext=(e,t)=>y(void 0,null,function*(){try{let r=(t==null?void 0:t.reader)||e.getReader();if(!c.isReadableStreamReader(r))return{ok:!1,done:!0,data:null};if(!r)return{ok:!1,done:!0,data:null};let i=(t==null?void 0:t.decoder)||new TextDecoder("utf-8"),n=yield r.read();return{ok:!0,done:n.done,data:i.decode(n.value)}}catch(r){return{ok:!1,done:!0,data:r}}});var ge=function(e,t){var n;t=t||{};let r=t.body;t.body&&!a.is.string(t.body)&&((n=t.bodyStringify)==null||n)&&(r=a.Stringify(t.body||{}));let i=e;return a.is.string(e)&&!e.match(/https?:/)&&(i=location.origin+"/"+e.replace(/^\//,"")),this.url=i,this.method=t.method||"get",this.streamStatus="open",this.params=J(x({key:E(),response_format:"json",timeout:c.setDefaultTimeout,trafficControl:c.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:x(x({"Content-Type":"application/json"},c.setDefaultHeaders&&c.setDefaultHeaders()),t.headers),body:r}),this};a.extend({Fetcher:ge,params:{},url:"",method:"GET",streamStatus:"closed",onStartCB:void 0,onKeyDuplicateCB:void 0,onCompleteCB:void 0,onRetryCB:void 0,isRetry:!1,extraBody:{},abortController:null,setExtraBody:function(e){return this.extraBody=x(x({},this.extraBody),e),this},onErrorCB:()=>{},onResultCB:()=>{},onStreamCB:()=>{},onStart:function(e){return this.onStartCB=e,this},onKeyDuplicate:function(e){return this.onKeyDuplicateCB=e,this},onStream:function(e){return this.onStreamCB=e,this},onResult:function(e){return this.onResultCB=e,this},onComplete:function(e){return this.onCompleteCB=e,this},onRetry:function(e){return this.onRetryCB=e,this},onError:function(e){return this.onErrorCB=e,this},onStreamProcess:function(e){return y(this,null,function*(){let{response:t,errorCB:r,streamCB:i,reader:n,decoder:s}=e,o=t.body,u=this,l=function(){return Z(this,null,function*(){if(!t.ok){a.scope(()=>y(this,null,function*(){let{ok:M,done:g,data:R}=yield c.streamToContext(o,{reader:n,decoder:s});M&&r(R)}));return}let m=!1;for(;!m;){let{ok:M,done:g,data:R}=yield new K(c.streamToContext(o,{reader:n,decoder:s}));u.streamStatus=="abort"?(u.streamStatus="closed",n.cancel(),g=!0):u.streamStatus=="closed"&&(g=!0),g&&(m=g,n.releaseLock()),i(R,g)}})};try{for(var h=ee(l()),p,d,C;p=!(d=yield h.next()).done;p=!1){let m=d.value;;}}catch(d){C=[d]}finally{try{p&&(d=h.return)&&(yield d.call(h))}finally{if(C)throw C[0]}}})},get:function(){return this.method="GET",this.send()},head:function(){return this.method="HEAD",this.send()},post:function(){return this.method="POST",this.send()},put:function(){return this.method="PUT",this.send()},delete:function(){return this.method="DELETE",this.send()},patch:function(){return this.method="PATCH",this.send()},options:function(){return this.method="OPTIONS",this.send()},send:function(){return y(this,null,function*(){var z;let e=this.params,t=performance.now(),W=e,{key:r,response_format:i,trafficControl:n,preventMultiRequest:s,timeout:o,queries:u}=W,l=Q(W,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);l.method=this.method;let h=[this.method,r].join("."),p=c.waitList.includes(h);c.waitList=[...c.waitList,h];let d=!1,C=!1,m=!1,M=0,g=500,R="InternalServerError",P={},k=null,B=new AbortController,te=setTimeout(()=>{B.abort(),console.log("timeout",o)},e.timeout);l.signal=B.signal,this.abortController=B;let $="fetcher.abortController."+this.params.key;T.set({[$]:B});let H=()=>{d=!0},q=()=>(B.abort(),c.waitList=c.waitList.filter(D=>D!=h),{isCancelled:d,isAborted:C,ok:!1,status:0,statusText:"CANCELLED",body:P,requestTime:0,rawData:null});try{if(c.setDefaultOnStart&&(yield c.setDefaultOnStart(e,H)),this.onStartCB&&(yield this.onStartCB(e,H)),d)return q();if(p){if(this.onKeyDuplicateCB&&(yield this.onKeyDuplicateCB(H)),d)return q();if(s)throw g=429,new Error("TooManyRequests")}let D=a.queryParams.set(x({},c.toFlatQuery(u||{})),String(this.url)),Y=yield fetch(D,l).then(F=>y(this,null,function*(){return m=F.ok,g=F.status,R=F.statusText,k=F,i=="none"||i=="stream"?F:F[i]()})).catch(F=>{throw new Error(F)});T.delete($),P=Y}catch(D){g==200&&(g=500,m=!1),g==429&&(R="TooManyRequests"),B.signal.aborted&&(g=408,R="Timeout",C=!0),g==500&&(R=String(D)||R),P={errorCode:String(D)}}finally{clearTimeout(te),M=performance.now()-t}let A={isCancelled:d,isAborted:C,ok:m,status:g,statusText:R,body:P,additionalBody:this.extraBody,requestTime:M,rawData:k};if(!m){if(this.onRetryCB&&!this.isRetry){this.isRetry=!0;let D=yield this.onRetryCB(A.body,this.params,this);if(D)return c.waitList=c.waitList.filter(Y=>Y!=h),this.params=D,this.send()}this.onErrorCB&&this.onErrorCB(A.body)}if(m&&this.onStreamCB&&e.response_format=="stream"){let D=(z=k.body)==null?void 0:z.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:A,reader:D,decoder:new TextDecoder("utf-8")})}if(e.trafficControl){let D=e.trafficControl-Math.round(M);D>0&&(yield a.pending(()=>{},D),A.requestTime=e.trafficControl)}return m&&this.onCompleteCB&&this.onCompleteCB(A.body),this.onResultCB&&this.onResultCB(A,e),c.setDefaultOnEnd&&c.setDefaultOnEnd(A,e),c.waitList=c.waitList.filter(D=>D!=h),A})},abortStream:function(){this.streamStatus="abort"}},c);c.prototype.Fetcher.prototype=c.prototype;var be=e=>new v.prototype.Filer(e),v=be;v.prototype={};var Ce=function(e){this.ok=!0;try{let[t,r]=e.name.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" ");this.file=e,this.extension=r,this.fileName=t,this.type=e.type}catch(t){console.log(t),this.ok=!1}return this};a.extend({ok:!1,extension:"",type:"",file:{},fileName:"",Filer:Ce,isValid:function(){return this.ok},toBlob:function(){return y(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return y(this,null,function*(){var t;return(t=(yield this.file.convert("dataURL")).target)==null?void 0:t.result})},toAarrayBuffer:function(){return y(this,null,function*(){var t;return(t=(yield this.file.convert("arrayBuffer")).target)==null?void 0:t.result})},toObjectURL:function(){return y(this,null,function*(){return URL.createObjectURL(this.file)})},updateFileName:function(e){let t=new File([this.file],e+"."+this.extension);return this.file=t,this.fileName=e,this},updateMimeType:function(e){return this.file=new File([this.file],this.fileName+"."+this.extension,{type:e}),this.type=e,this},updateExtension:function(e){let t=new File([this.file],this.fileName+"."+e);return this.file=t,this.extension=e,this}},v);v.fromFile=e=>y(void 0,null,function*(){return v(e)});v.fromBlob=(e,t)=>y(void 0,null,function*(){let r=(t==null?void 0:t.fileName)||"file",i=(t==null?void 0:t.extension)||"",n=new File([e],r+"."+i,{type:t==null?void 0:t.mimeType});return v(n)});v.fromArrayBuffer=(e,t)=>y(void 0,null,function*(){return v.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t)});v.fromObjectURL=(e,t)=>y(void 0,null,function*(){let r=yield c(e,{response_format:"blob"}).get();return r.ok?v.fromBlob(r.body,t):v({})});v.fromDataURL=(e,t)=>y(void 0,null,function*(){let r=yield e.toBlob((t==null?void 0:t.mimeType)||"");return r?v.fromBlob(r,t):v({})});v.prototype.Filer.prototype=v.prototype;var Me=function(e){let t=e,r=null;return t.use((i,n,s)=>{let o=n;o.return=u=>{let{ok:l,status:h,body:p={},bodyStringify:d=!0}=u||{};h=h!=null?h:(l!=null?l:!0)&&200||403;let C=p;return d&&!a.is.string(p)&&(C=a.Stringify(p)),n.status(h).end(C)},s()}),t.onPathRouter=function(i){return r=i,this},t.pathRouter=function(i){if(!r)return;let n=r(i);return n.route(i),t.use(i,n),n},t.exception=function(i){return t.use(i),this},t},_=Me;_.getLocalIP=e=>{let t="";return a.scope(()=>{if(!e)return;let r=e.networkInterfaces();for(let[i,n]of Object.entries(r))n.forEach(s=>{!s.internal&&s.family==="IPv4"&&!s.address.match(/^(169|127)/)&&(t=s.address)})}),t};_.getIP=function(e){var i;return(((e==null?void 0:e.headers["x-forwarded-for"])||((i=e==null?void 0:e.socket)==null?void 0:i.remoteAddress)||"").toString().match(new RegExp(/(::ffff:)?(\d+\.\d+.\d+\.\d+(:\d+)?)/))||[])[2]||"UNKNOWN IP"};a.copyToClipboard=e=>y(void 0,null,function*(){let t="";a.is.string(e)?t=e:a.is.function(e)&&(t=e());let r={ok:!1,body:"NotSupported"};return yield y(void 0,null,function*(){let i;if(navigator.clipboard){if(i=yield navigator.clipboard.writeText(t).then(()=>!0,()=>!1),!i)return}else{let n=document.createElement("input");if(a(document.body).append(n),n.value=t,n.select(),i=document.execCommand("copy"),document.body.removeChild(n),!i)return}r={ok:!0,body:""}}),r});a.ImageLoader=(e,t)=>new Promise((r,i)=>{let n=t||new Image;n.onload=()=>r(n),n.onerror=s=>i(s),n.src=e});a.formatCharacter={postal:{JP:e=>{let t="--";return e=String(e).replace(/\D/ig,""),e.length==7&&(t=e.replace(/^(\d{3})(.*)/,"$1-$2")),t}},tel:{_:e=>{let t=e;return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t},mobile:e=>{let t="--";return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),t},fixed:e=>{let t="--";return e=String(e).removeLetters(),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t}}};a.transformer={weekday:{ENG:e=>["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"][e]+"day",JP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]+"\u66DC\u65E5",shortJP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]},wareki:e=>{let t=[],r=[],i=!1;return[{From:1868,To:1912,name:"\u660E\u6CBB"},{From:1912,To:1926,name:"\u5927\u6B63"},{From:1926,To:1989,name:"\u662D\u548C"},{From:1989,To:2019,name:"\u5E73\u6210"},{From:2019,To:1e5,name:"\u4EE4\u548C"}].forEach(s=>{let{From:o,To:u,name:l}=s;if(o<=e&&e<=u){let h=e-o+1;h==1&&(i=!0,h="\u5143"),r.push(l+h+"\u5E74"),t.push(l)}}),{era:t,value:r,gap:i}}};a.interval=S;c.setDefaultHeaders=()=>({});var Se=a;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
|
package/esm/fetcher.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ declare namespace Fetcher {
|
|
|
87
87
|
setDefaultTrafficControl: number;
|
|
88
88
|
setDefaultTimeout: number;
|
|
89
89
|
setDefaultHeaders?: () => HeadersInit;
|
|
90
|
+
toFlatQuery(keyValues: KeyValueDict): KeyValueDict;
|
|
90
91
|
setDefaultOnStart?: (params: Input, abort: Function) => void;
|
|
91
92
|
setDefaultOnEnd?: (result: Output<any>, params: Input) => void;
|
|
92
93
|
isReadableStream(v: any): boolean;
|
package/esm/fetcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as h,c as
|
|
1
|
+
import{b as h,c as F,d as O,e as R,f as k,g as K,h as q}from"./chunk-ABA72NWU.js";import d from"./core";import{UUID as M}from"./uuid";import{useStore as g}from"./useStore";const j=(t,r)=>new e.prototype.Fetcher(t,r),e=j;e.prototype={},e.waitList=[],e.setDefaultTrafficControl=0,e.setDefaultTimeout=1e3*60*10,e.abort=t=>{let r="fetcher.abortController."+t,o=g.get(r);console.log(o),o&&o.abort()},e.toFlatQuery=t=>{let r={};return Object.entries(t).forEach(([o,a])=>{if(d.is.array(a)){r[o]=a.join(",");return}else if(d.is.keyValueDictionary(a)){Object.entries(e.toFlatQuery(a)).forEach(([i,m])=>{r[`${o}.${i}`]=m});return}r[o]=a}),r},e.isReadableStream=t=>t instanceof ReadableStream,e.isReadableStreamReader=t=>t instanceof ReadableStreamDefaultReader,e.streamToContext=(t,r)=>R(void 0,null,function*(){try{const o=(r==null?void 0:r.reader)||t.getReader();if(!e.isReadableStreamReader(o))return{ok:!1,done:!0,data:null};if(!o)return{ok:!1,done:!0,data:null};const a=(r==null?void 0:r.decoder)||new TextDecoder("utf-8");let i=yield o.read();return{ok:!0,done:i.done,data:a.decode(i.value)}}catch(o){return{ok:!1,done:!0,data:o}}});const U=function(t,r){var i;r=r||{};let o=r.body;r.body&&!d.is.string(r.body)&&((i=r.bodyStringify)==null||i)&&(o=d.Stringify(r.body||{}));let a=t;return d.is.string(t)&&!t.match(/https?:/)&&(a=location.origin+"/"+t.replace(/^\//,"")),this.url=a,this.method=r.method||"get",this.streamStatus="open",this.params=F(h({key:M(),response_format:"json",timeout:e.setDefaultTimeout,trafficControl:e.setDefaultTrafficControl,preventMultiRequest:!0},r),{headers:h(h({"Content-Type":"application/json"},e.setDefaultHeaders&&e.setDefaultHeaders()),r.headers),body:o}),this};d.extend({Fetcher:U,params:{},url:"",method:"GET",streamStatus:"closed",onStartCB:void 0,onKeyDuplicateCB:void 0,onCompleteCB:void 0,onRetryCB:void 0,isRetry:!1,extraBody:{},abortController:null,setExtraBody:function(t){return this.extraBody=h(h({},this.extraBody),t),this},onErrorCB:()=>{},onResultCB:()=>{},onStreamCB:()=>{},onStart:function(t){return this.onStartCB=t,this},onKeyDuplicate:function(t){return this.onKeyDuplicateCB=t,this},onStream:function(t){return this.onStreamCB=t,this},onResult:function(t){return this.onResultCB=t,this},onComplete:function(t){return this.onCompleteCB=t,this},onRetry:function(t){return this.onRetryCB=t,this},onError:function(t){return this.onErrorCB=t,this},onStreamProcess:function(t){return R(this,null,function*(){let{response:r,errorCB:o,streamCB:a,reader:i,decoder:m}=t,A=r.body,C=this;const b=function(){return K(this,null,function*(){if(!r.ok){d.scope(()=>R(this,null,function*(){let{ok:f,done:s,data:l}=yield e.streamToContext(A,{reader:i,decoder:m});f&&o(l)}));return}let u=!1;for(;!u;){let{ok:f,done:s,data:l}=yield new k(e.streamToContext(A,{reader:i,decoder:m}));C.streamStatus=="abort"?(C.streamStatus="closed",i.cancel(),s=!0):C.streamStatus=="closed"&&(s=!0),s&&(u=s,i.releaseLock()),a(l,s)}})};try{for(var _=q(b()),L,E,B;L=!(E=yield _.next()).done;L=!1){let u=E.value;;}}catch(E){B=[E]}finally{try{L&&(E=_.return)&&(yield E.call(_))}finally{if(B)throw B[0]}}})},get:function(){return this.method="GET",this.send()},head:function(){return this.method="HEAD",this.send()},post:function(){return this.method="POST",this.send()},put:function(){return this.method="PUT",this.send()},delete:function(){return this.method="DELETE",this.send()},patch:function(){return this.method="PATCH",this.send()},options:function(){return this.method="OPTIONS",this.send()},send:function(){return R(this,null,function*(){var I;let t=this.params,r=performance.now(),v=t,{key:o,response_format:a,trafficControl:i,preventMultiRequest:m,timeout:A,queries:C}=v,b=O(v,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);b.method=this.method;let _=[this.method,o].join("."),L=e.waitList.includes(_);e.waitList=[...e.waitList,_];let E=!1,B=!1,u=!1,f=0,s=500,l="InternalServerError",S={},D=null,p=new AbortController,V=setTimeout(()=>{p.abort(),console.log("timeout",A)},t.timeout);b.signal=p.signal,this.abortController=p;let P="fetcher.abortController."+this.params.key;g.set({[P]:p});const T=()=>{E=!0},x=()=>(p.abort(),e.waitList=e.waitList.filter(n=>n!=_),{isCancelled:E,isAborted:B,ok:!1,status:0,statusText:"CANCELLED",body:S,requestTime:0,rawData:null});try{if(e.setDefaultOnStart&&(yield e.setDefaultOnStart(t,T)),this.onStartCB&&(yield this.onStartCB(t,T)),E)return x();if(L){if(this.onKeyDuplicateCB&&(yield this.onKeyDuplicateCB(T)),E)return x();if(m)throw s=429,new Error("TooManyRequests")}let n=d.queryParams.set(h({},e.toFlatQuery(C||{})),String(this.url));const w=yield fetch(n,b).then(y=>R(this,null,function*(){return u=y.ok,s=y.status,l=y.statusText,D=y,a=="none"||a=="stream"?y:y[a]()})).catch(y=>{throw new Error(y)});g.delete(P),S=w}catch(n){s==200&&(s=500,u=!1),s==429&&(l="TooManyRequests"),p.signal.aborted&&(s=408,l="Timeout",B=!0),s==500&&(l=String(n)||l),S={errorCode:String(n)}}finally{clearTimeout(V),f=performance.now()-r}let c={isCancelled:E,isAborted:B,ok:u,status:s,statusText:l,body:S,additionalBody:this.extraBody,requestTime:f,rawData:D};if(!u){if(this.onRetryCB&&!this.isRetry){this.isRetry=!0;let n=yield this.onRetryCB(c.body,this.params,this);if(n)return e.waitList=e.waitList.filter(w=>w!=_),this.params=n,this.send()}this.onErrorCB&&this.onErrorCB(c.body)}if(u&&this.onStreamCB&&t.response_format=="stream"){let n=(I=D.body)==null?void 0:I.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:c,reader:n,decoder:new TextDecoder("utf-8")})}if(t.trafficControl){let n=t.trafficControl-Math.round(f);n>0&&(yield d.pending(()=>{},n),c.requestTime=t.trafficControl)}return u&&this.onCompleteCB&&this.onCompleteCB(c.body),this.onResultCB&&this.onResultCB(c,t),e.setDefaultOnEnd&&e.setDefaultOnEnd(c,t),e.waitList=e.waitList.filter(n=>n!=_),c})},abortStream:function(){this.streamStatus="abort"}},e),e.prototype.Fetcher.prototype=e.prototype;export{e as Fetcher,e as default};
|
package/esm/time.d.ts
CHANGED
|
@@ -49,16 +49,16 @@ declare namespace Time {
|
|
|
49
49
|
toFormatYMDHM(lang?: 'JP'): string;
|
|
50
50
|
toFormatYMDHMS(lang?: 'JP'): string;
|
|
51
51
|
toLangYMD(lang?: 'JP'): string;
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
setFirstOfDay(): Chains;
|
|
53
|
+
setLastOfDay(): Chains;
|
|
54
54
|
setFromFormatHHMM(v: string | number): Chains;
|
|
55
55
|
setFromFormatHHMMSS(v: string | number): Chains;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
getFirstDayOfYear(): Chains;
|
|
57
|
+
getLastDayOfYear(): Chains;
|
|
58
|
+
getFirstDayOfMonth(): Chains;
|
|
59
|
+
getLastDayOfMonth(): Chains;
|
|
60
|
+
getFirstDayOfWeek(): Chains;
|
|
61
|
+
getLastDayOfWeek(): Chains;
|
|
62
62
|
diff(v: Chains): {
|
|
63
63
|
years: number;
|
|
64
64
|
months: number;
|
package/esm/time.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-ABA72NWU.js";import o from"./core";const h=e=>new n.prototype.Time(e),n=h;n.prototype={};const m=function(e){n.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0&&(e=new Date));let t=new Date(String(e).replace(/\//g,"-"));return this.set(t)};o.extend({value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,constructor:n,Time:m,clone:function(){return n(this)},set:function(e){this.value=e;let t=o.is.date(e);if(this.validate=t,!t)return this.ms=-1,this.year=-1,this.month=-1,this.weekday=-1,this.weekInYear=-1,this.date=-1,this.hours=-1,this.minutes=-1,this.seconds=-1,this;this.ms=e.getTime(),this.weekday=e.getDay(),this.year=e.getFullYear(),this.month=e.getMonth()+1,this.date=e.getDate();{let s=new Date(this.year,0,1),a=new Date(s.valueOf());a.setDate(a.getDate()-(s.getDay()+1));let r=e.getTime()-a.getTime(),i=Math.ceil(r/(1e3*60*60*24));this.weekInYear=Math.ceil(i/7)}{let s=new Date(this.year,this.month-1,1),a=new Date(s.valueOf());a.setDate(a.getDate()-(s.getDay()+1));let r=e.getTime()-a.getTime(),i=Math.ceil(r/(1e3*60*60*24)),u=Math.ceil(i/7);this.weekInMonth=u}{let s=new Date(this.year,this.month,0),a=s.getDay(),r=new Date(new Date(s).setDate(s.getDate()-a));this.isLastWeekInMonth=this.date>=r.getDate()}return this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this},isPast:function(){let e=n();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=n(e);return this.year==t.year},isSameMonth:function(e){let t=n(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=n(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=n(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},setYear:function(e){let t=new Date(this.value.valueOf());return t.setFullYear(e),this.set(t)},setMonth:function(e){let t=new Date(this.value.valueOf());
|
|
1
|
+
import"./chunk-ABA72NWU.js";import o from"./core";const h=e=>new n.prototype.Time(e),n=h;n.prototype={};const m=function(e){n.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0&&(e=new Date));let t=new Date(String(e).replace(/\//g,"-"));return this.set(t)};o.extend({value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,constructor:n,Time:m,clone:function(){return n(this)},set:function(e){this.value=e;let t=o.is.date(e);if(this.validate=t,!t)return this.ms=-1,this.year=-1,this.month=-1,this.weekday=-1,this.weekInYear=-1,this.date=-1,this.hours=-1,this.minutes=-1,this.seconds=-1,this;this.ms=e.getTime(),this.weekday=e.getDay(),this.year=e.getFullYear(),this.month=e.getMonth()+1,this.date=e.getDate();{let s=new Date(this.year,0,1),a=new Date(s.valueOf());a.setDate(a.getDate()-(s.getDay()+1));let r=e.getTime()-a.getTime(),i=Math.ceil(r/(1e3*60*60*24));this.weekInYear=Math.ceil(i/7)}{let s=new Date(this.year,this.month-1,1),a=new Date(s.valueOf());a.setDate(a.getDate()-(s.getDay()+1));let r=e.getTime()-a.getTime(),i=Math.ceil(r/(1e3*60*60*24)),u=Math.ceil(i/7);this.weekInMonth=u}{let s=new Date(this.year,this.month,0),a=s.getDay(),r=new Date(new Date(s).setDate(s.getDate()-a));this.isLastWeekInMonth=this.date>=r.getDate()}return this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this},isPast:function(){let e=n();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=n(e);return this.year==t.year},isSameMonth:function(e){let t=n(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=n(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=n(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},setYear:function(e){let t=new Date(this.value.valueOf());return t.setFullYear(e),this.set(t)},setMonth:function(e){let t=new Date(this.value.valueOf()),s=t.getDate();t.setDate(1),t.setMonth(e-1);let a=n(t).getLastDayOfMonth();return t.setDate(Math.min(s,a.date)),this.set(t)},setDate:function(e){let t=new Date(this.value.valueOf());return t.setDate(e),this.set(t)},setHours:function(e){let t=new Date(this.value.valueOf());return t.setHours(e),this.set(t)},setMinutes:function(e){let t=new Date(this.value.valueOf());return t.setMinutes(e),this.set(t)},setSeconds:function(e){let t=new Date(this.value.valueOf());return t.setSeconds(e),this.set(t)},setMilliseconds:function(e){let t=new Date(this.value.valueOf());return t.setMilliseconds(e),this.set(t)},addYear:function(e){return this.setYear(this.year+e)},addMonth:function(e){return this.setMonth(this.month+e)},addWeek:function(e){return this.addDate(7*e)},addDate:function(e){return this.setDate(this.date+e)},addHours:function(e){return this.setHours(this.hours+e)},addMinutes:function(e){return this.setMinutes(this.minutes+e)},addSeconds:function(e){return this.setSeconds(this.seconds+e)},toFormat:function(e){return this.validate?e.replace(/\%y/ig,this.year.zeroEmbed(4)).replace(/\%m/ig,this.month.zeroEmbed(2)).replace(/\%d/ig,this.date.zeroEmbed(2)).replace(/\%w/ig,this.weekInYear.zeroEmbed(2)).replace(/\%h/ig,this.hours.zeroEmbed(2)).replace(/\%i/ig,this.minutes.zeroEmbed(2)).replace(/\%s/ig,this.seconds.zeroEmbed(2)):""},toFormatYMD:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D"):""},toFormatYM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708"):this.toFormat("%Y/%M"):""},toFormatMD:function(e){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):""},toFormatHM:function(e){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206"):this.toFormat("%h:%i"):""},toFormatYMDHM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%i\u5206"):this.toFormat("%Y/%M/%D %h:%i"):""},toFormatYMDHMS:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2"):this.toFormat("%Y/%M/%D %h:%i:%s"):""},toLangYMD:function(e){if(!this.validate)return"";let t=n(),s=t.diff(this);return s.dates==0?"\u4ECA\u65E5":s.dates==1?"\u6628\u65E5":s.dates>=-7&&s.dates<0?-1*s.dates+"\u65E5\u5F8C":s.dates<=7&&s.dates>0?s.dates+"\u65E5\u524D":this.isSameYear(t)?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D")},setFirstOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),this.set(e)},setLastOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),this.set(e)},setFromFormatHHMM:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(4).replace(/(\d{2})(\d{2})/,"$1:$2"),[s,a]=t.split(":"),r=new Date(this.value.valueOf());return r.setHours(Number(s)),r.setMinutes(Number(a)),this.set(r)},setFromFormatHHMMSS:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(6).replace(/(\d{2})(\d{2})(\d{2})/,"$1:$2:$3"),[s,a,r]=t.split(":"),i=new Date(this.value.valueOf());return i.setHours(Number(s)),i.setMinutes(Number(a)),i.setSeconds(Number(r)),this.set(i)},getFirstDayOfYear:function(){return n(new Date(this.value.getFullYear(),0,1))},getLastDayOfYear:function(){return n(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfMonth:function(){return n(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfMonth:function(){return n(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfWeek:function(){let e=n(this.value);return e.addDate(-e.weekday)},getLastDayOfWeek:function(){let e=n(this.value);return e.addDate(6-e.weekday)},diff:function(e){return{years:this.year-e.year,months:(this.year-e.year)*12+(this.month-e.month),dates:o.scope(()=>{let t=864e5,s=this.clone().setFirstOfDay(),a=e.clone().setFirstOfDay();return Math.floor((s.ms-a.ms)/t)}),hours:o.scope(()=>{let t=36e5,s=this.clone().setMinutes(0).setSeconds(0).setMilliseconds(0),a=e.clone().setMinutes(0).setSeconds(0).setMilliseconds(0);return Math.floor((s.ms-a.ms)/t)}),minutes:o.scope(()=>{let t=6e4,s=this.clone().setSeconds(0).setMilliseconds(0),a=e.clone().setSeconds(0).setMilliseconds(0);return Math.floor((s.ms-a.ms)/t)}),seconds:o.scope(()=>{let t=this.clone().setMilliseconds(0),s=e.clone().setMilliseconds(0);return Math.floor((t.ms-s.ms)/1e3)}),ms:this.ms-e.ms}},getAge:function(e){let t=e||n(),s=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&s--,s}},n),n.isTimeObject=e=>{var t;return((t=e||{})==null?void 0:t.constructor)===n},n.getFromNumberYYYYMMDD=e=>{let t=Number(e).zeroEmbed(8).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return n(t+" 00:00:00")},n.getShortYMDs=(e,t)=>{let s="",a="";return e.year==t.year&&e.year==n().year?s=e.toFormatMD():s=e.toFormatYMD(),e.year!=t.year?a=t.toFormatYMD():a=t.toFormatMD(),[s,a]},n.getPeriodArray=(e,t,s)=>{let a=[],r=t;if(!t.validate||!s.validate)return a;for(;r.toFormatYMDHMS().toNumber()<=s.toFormatYMDHMS().toNumber();)a.push(r),e=="year"?r=n(r).addYear(1):e=="month"?r=n(r).addMonth(1):e=="week"?r=n(r).addWeek(1):e=="day"?r=n(r).addDate(1):e=="hours"?r=n(r).addHours(1):e=="minutes"?r=n(r).addMinutes(1):e=="seconds"&&(r=n(r).addSeconds(1));return a},n.prototype.Time.prototype=n.prototype;export{n as Time,n as default};
|
package/esm/uuid.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ declare namespace UUID {
|
|
|
2
2
|
namespace Methods {
|
|
3
3
|
type FN = (length?: number) => string;
|
|
4
4
|
type Chains = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
get128Binary(): string;
|
|
6
|
+
get32Hex(type?: 'Formatted' | 'None', separate?: string): string;
|
|
7
7
|
to32Format(v: string, separate?: string): string;
|
|
8
8
|
};
|
|
9
9
|
}
|
package/esm/uuid.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-ABA72NWU.js";const s=(e=24)=>Array.from({length:e}).map((n,t)=>{let o=t==0?25:35,a=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*o)][a?"toUpper":"toLower"]()}).join(""),r=s;r.
|
|
1
|
+
import"./chunk-ABA72NWU.js";const s=(e=24)=>Array.from({length:e}).map((n,t)=>{let o=t==0?25:35,a=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*o)][a?"toUpper":"toLower"]()}).join(""),r=s;r.get128Binary=()=>Array.from({length:128}).map((e,n)=>"01"[Math.round(Math.random()*1)]).join(""),r.get32Hex=(e="Formatted",n="-")=>{let t=Array.from({length:32}).map((o,a)=>"0123456789abcdef"[Math.round(Math.random()*15)]).join("").toUpper();return e=="Formatted"&&(t=[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20,32)].join(n)),t},r.to32Format=e=>[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-").toUpper();export{r as UUID,r as default};
|