jmini 0.0.105 → 0.0.106

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var B=Object.defineProperty,ne=Object.defineProperties,ie=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertyNames,_=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?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E=(e,t)=>{for(var r in t||(t={}))V.call(t,r)&&X(e,r,t[r]);if(_)for(var r of _(t))G.call(t,r)&&X(e,r,t[r]);return e},N=(e,t)=>ne(e,se(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&&_)for(var i of _(e))t.indexOf(i)<0&&G.call(e,i)&&(r[i]=e[i]);return r};var oe=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},le=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ae(t))!V.call(e,n)&&n!==r&&B(e,n,{get:()=>t[n],enumerable:!(i=ie(t,n))||i.enumerable});return e};var ue=e=>le(B({},"__esModule",{value:!0}),e);var g=(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())}),U=function(e,t){this[0]=e,this[1]=t},Z=(e,t,r)=>{var i=(o,u,l,h)=>{try{var d=r[o](u),y=(u=d.value)instanceof U,M=d.done;Promise.resolve(y?u[0]:u).then(f=>y?i(o==="return"?o:"next",u[1]?{done:f.done,value:f.value}:f,l,h):l({value:f,done:M})).catch(f=>i("throw",f,l,h))}catch(f){h(f)}},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 De={};oe(De,{Fetcher:()=>c,Filer:()=>T,Server:()=>J,Time:()=>m,UUID:()=>w,default:()=>Te,useStore:()=>D});module.exports=ue(De);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){let t="";if(e.length==2){let[r,i]=e;t=[this.slice(0,r),i,this.slice(r+i.length)].join("")}if(e.length==3){let[r,i,n]=e;t=[this.slice(0,r),n,this.slice(r+i)].join("")}return t},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(){let e=this.replace(/[^\d.-]/g,"").replace(/(-)(?=.*\d)/g,"").replace(/(\d+)\.(\d+)\.(\d+)/g,"$1.$2$3");return Number(e)||0},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){let t=Number(this)<0,r=Math.abs(Number(this));return isNaN(r)?"":(t?"-":"")+String(r).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]),s.length||(s=[""]);let o=[],u=[];for(let l of s){let h=String(l).match(/([^\.\[\]"]+)/g)||"";o.push(h),u.push(this.every(d=>t(Number(e(d,...h)))))}return this.sort((l,h)=>{for(let d=0;d<o.length;d++){let y=o[d]||"",M=u[d],f=e(l,...y),p=e(h,...y);if(M){if(Number(f)>Number(p))return 1;if(Number(f)<Number(p))return-1;continue}if(t(f)&&!t(p))return-1;if(!t(f)&&t(p))return 1;let b=String(f).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,O=>O.padStart(10,"0")),R=String(p).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,O=>O.padStart(10,"0")),I=b.localeCompare(R,i,n);if(I!=0)return I}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){e=e||"dataURL";let t="readAs"+(e==null?void 0:e.toCapital());return new Promise((r,i)=>{let n=new FileReader;n.onload=s=>{r(n.result)},n.onerror=s=>i(n.error||s),n[t](this)})},File.prototype.clone=function(){return new File([this.slice(0,this.size,this.type)],this.name,{type:this.type,lastModified:this.lastModified})});var he=(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(""),w=he;w.get128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");w.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};w.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 me=e=>new a.prototype.jmini(e),a=me;a.prototype={};a.extend=function(e,t=a){for(var[r,i]of Object.entries(e))t.prototype[r]=i};a.expando="__jmini_"+w();a.__classAlias="jmini";var C=(e,t)=>(e.queue.push(t),$(e),e),$=e=>g(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,$(e)}),k=(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},fe=(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,$(e),e};a.extend({constructor:a,__classAlias:a.__classAlias,jmini:function(e){return this.src=e,this.srcType=a.is.what(e),this.queueProcess=!0,this.queue=[],fe(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(y=>{o[1]&&(y=y.cloneNode(!0)),h.parentNode.insertBefore(y,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 C(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},n)}))},abort:function(){return C(this,()=>g(this,null,function*(){return this.queue=[],this}))},callback:function(n){return C(this,()=>g(this,null,function*(){return yield n(this),this}))},click:function(){return C(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];a.is.element(s)&&s.click()}return this})},focus:function(){return C(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 C(this,()=>{let{eventType:s,eventID:o=w(),target:u,callback:l,options:h}=n;return h=E({passive:!0,capture:!1},h),this.for(d=>{if(!(a.is.element(d)||a.is.shadowRoot(d)))return;let{events:y}=d[a.expando];if(u){let M=l;l=f=>{if(f.target){if(a.is.string(u)){let b=f.target.closest(u);b&&(!b||M.call(b,f))}else if(a.is.elements(u)){for(let p of u)if(f.target==p)return M.call(p,f)}}}}if(y[o]){let M=y[o];d.removeEventListener(M.eventType,M.callback,M.options)}y[o]={eventType:s,callback:l,options:h},d.addEventListener(s,l,h)}),this})},removeEvent:function(n){return C(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 C(this,()=>k(this,r(n,t(this))))},empty:function(){return C(this,()=>k(this,t(this)))},append:function(n){return C(this,()=>{r(n,this)})},remove:function(){return C(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 C(this,()=>k(this,i(this,"before",...n)))},after:function(...n){return C(this,()=>k(this,i(this,"after",...n)))},find:function(n){return C(this,()=>{let s=[],o=this[0];o||k(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(d=>d)])})),k(this,a(s))})},parent:function(n){return C(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);k(this,s)})},children:function(n){return C(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 k(this,o)})},addClass:function(n){return C(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 C(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 C(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 C(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 C(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)=>t?Array.from(new Map(e.map(r=>[a.getKeyValue(r,t||"0"),r])).values()):Array.from(new Set(e));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!e||!a.is.array(e)&&!a.is.keyValueDictionary(e)?null:(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=>g(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});a.scope=e=>e();a.scopeSync=e=>g(void 0,null,function*(){return yield e()});a.createElement=function(e){var y;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 M of Object.entries(s)){let f=M[0],p=(y=M[1])!=null?y:"";if(f=="data"&&a.is.keyValueDictionary(p))for(let[b,R]of Object.entries(p))l.dataset[b]=R;else f=="for"?f="htmlFor":f=="tabindex"?f="tabIndex":f=="aria-label"&&(f="ariaLabel"),l[f]=p}if(n&&a(l).append(n),o)for(var[h,d]of Object.entries(o))l.style[h]=d;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.localStorage={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,d;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=(d=e.pageY)!=null?d:(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)=>{let r=t||Number(e)||0;return new Promise((i,n)=>{a.is.function(e)&&e(i),r&&setTimeout(()=>{i(!0)},r)})};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.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,t)=>{let r=new URL(t||location.href);if(a.is.string(e))r.pathname=e;else{let i=a.url.path.get();Object.entries(e).forEach(([n,s])=>{i[Number(n)]=s}),r.pathname="/"+i.filter(n=>n!=null).join("/")}return t||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{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.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){var t,r;return((t=e||{})==null?void 0:t.constructor)===a||((r=e||{})==null?void 0:r.__classAlias)===a.__classAlias},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())},inRange:function(e,t,r,i=!0){return i?t<=e&&e<=r:t<e&&e<r}};var x={},D={set:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{let s=x[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),x[i]={privateKey:t,value:n}}),r},update:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{var o;let s=x[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),x[i]=N(E({},x[i]),{value:E(E({},(o=x[i])==null?void 0:o.value),n)})}),r},get:(e,t)=>{let r=x[e];if(!(r&&r.privateKey&&r.privateKey!=t))return r==null?void 0:r.value},delete:(e,t)=>{let r=x[e];return r&&r.privateKey&&r.privateKey!=t?!1:(delete x[e],!0)}};var te=-new Date().getTimezoneOffset(),ce=(e,t)=>new m.prototype.Time(e,t),m=ce;m.prototype={};m.__classAlias="jmini.Time";var de=function(e,t){if(t&&(this.localTimezoneOffset=t),m.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0?e=new Date:e===0&&(e=new Date(0))),e&&(a.is.number(e)&&(e=new Date(e)),a.is.string(e)&&(e=String(e).trim().replace(/\//g,"-").replace(/ +|\s+/g," ").replace(/\-+/g,"-"),e=e.replace(/^(\d{4}-\d{2}-\d{2})$/,"$1T00:00:00").replace(/^(\d{4}-\d{2}-\d{2})\s+/,"$1T").replace(/^(\d{4}-\d{2}-\d{2}T\d{2})(:?|:+)$/,"$1:00").replace(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(:?|:+)$/,"$1:00"),e.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1,3})?$/)))){let i=this.getLocalTimezoneOffset(),n=Math.floor(i/60),s=i%60;n>=0&&(e+="+"),e+=n.zeroEmbed(2),e+=":"+s.zeroEmbed(2)}let r=new Date(String(e));return this.set(r)};a.extend({constructor:m,Time:de,__classAlias:m.__classAlias,value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,warekiYear:-1,wareki:"",warekiLabel:"",year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,localTimezoneOffset:void 0,getLocalTimezoneOffset:function(){var e,t;return(t=(e=this.localTimezoneOffset)!=null?e:D.get("jmini/time/env/localTimezoneOffset"))!=null?t:te},setLocalTimezoneOffset:function(e,t){return this.localTimezoneOffset=e,t&&D.set({"jmini/time/env/localTimezoneOffset":e}),this.set(this.value)},clone:function(){return m(this,this.localTimezoneOffset)},set:function(e){var n;this.value=e;let t=a.is.date(e);if(this.validate=t,a.is.nullish(this.localTimezoneOffset)&&(this.localTimezoneOffset=(n=D.get("jmini/time/env/localTimezoneOffset"))!=null?n:te),!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;let r=e.getTime()+e.getTimezoneOffset()*6e4,i=new Date(r+this.getLocalTimezoneOffset()*60*1e3);this.ms=e.getTime(),this.year=i.getFullYear(),this.month=i.getMonth()+1,this.date=i.getDate(),this.weekday=i.getDay(),this.hours=i.getHours(),this.minutes=i.getMinutes(),this.seconds=i.getSeconds();{let s=this.year||0,o=this.month||0,u=this.date||0,l=Number(s+o.zeroEmbed(2)+u.zeroEmbed(2));l>=20190501?(this.warekiYear=s-2018,this.wareki="REIWA",this.warekiLabel="\u4EE4\u548C"):l>=19890108?(this.warekiYear=s-1988,this.wareki="HEISEI",this.warekiLabel="\u5E73\u6210"):l>=19261225?(this.warekiYear=s-1925,this.wareki="SHOUWA",this.warekiLabel="\u662D\u548C"):l>=19120730?(this.warekiYear=s-1911,this.wareki="TAISHO",this.warekiLabel="\u5927\u6B63"):l>=19680125?(this.warekiYear=s-1867,this.wareki="MEIJI",this.warekiLabel="\u660E\u6CBB"):(this.warekiYear=0,this.wareki="",this.warekiLabel="")}{let s=new Date(this.year,0,1),o=new Date(s.valueOf());o.setDate(o.getDate()-(s.getDay()+1));let u=this.ms-o.getTime(),l=Math.ceil(u/(1e3*60*60*24));this.weekInYear=Math.ceil(l/7)}{let s=new Date(this.year,this.month-1,1),o=new Date(s.valueOf());o.setDate(o.getDate()-(s.getDay()+1));let u=this.ms-o.getTime(),l=Math.ceil(u/(1e3*60*60*24)),h=Math.ceil(l/7);this.weekInMonth=h}{let s=new Date(this.year,this.month,0),o=s.getDay(),u=new Date(new Date(s).setDate(s.getDate()-o));this.isLastWeekInMonth=this.date>=u.getDate()}return this},isPast:function(){let e=m();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=m(e);return this.year==t.year},isSameMonth:function(e){let t=m(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=m(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=m(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},isInRange:function(e,t){return!this.validate||!e.validate||!t.validate?!1:this.value>=e.value&&this.value<=t.value},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=m(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,t){if(!this.validate)return"";let r=this;return a.is.exist(t)&&(r=r.clone(),r.setLocalTimezoneOffset(t||0)),e.replace(/\%y/ig,r.year.zeroEmbed(4)).replace(/\%m/ig,r.month.zeroEmbed(2)).replace(/\%d/ig,r.date.zeroEmbed(2)).replace(/\%w/ig,r.weekInYear.zeroEmbed(2)).replace(/\%h/ig,r.hours.zeroEmbed(2)).replace(/\%i/ig,r.minutes.zeroEmbed(2)).replace(/\%s/ig,r.seconds.zeroEmbed(2))},toFormatISO:function(){return this.value.toISOString()},toFormatabbrYMD:function(e,t){if(!this.validate)return"";let r=this.isSameYear(m()),i="%Y/%M/%D";return r&&(i="%M/%D"),e=="JP"&&(i="%Y\u5E74%M\u6708%D\u65E5",r&&(i="%M\u6708%D\u65E5")),this.toFormat(i,t)},toFormatYMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t):""},toFormatYM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708",t):this.toFormat("%Y/%M",t):""},toFormatMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):""},toFormatHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206",t):this.toFormat("%h:%i",t):""},toFormatHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206%s\u79D2",t):this.toFormat("%h:%i:%s",t):""},toFormatYMDHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%i\u5206",t):this.toFormat("%Y/%M/%D %h:%i",t):""},toFormatYMDHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2",t):this.toFormat("%Y/%M/%D %h:%i:%s",t):""},toLangYMD:function(e,t){if(!this.validate)return"";let r=m(),i=r.diff(this);return i.dates==0?"\u4ECA\u65E5":i.dates==1?"\u6628\u65E5":i.dates>=-7&&i.dates<0?-1*i.dates+"\u65E5\u5F8C":i.dates<=7&&i.dates>0?i.dates+"\u65E5\u524D":this.isSameYear(r)?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t)},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 m(new Date(this.value.getFullYear(),0,1))},getLastDayOfYear:function(){return m(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfMonth:function(){return m(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfMonth:function(){return m(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfWeek:function(){let e=m(this.value);return e.addDate(-e.weekday)},getLastDayOfWeek:function(){let e=m(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||m(),r=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&r--,r}},m);m.isTimeObject=e=>{var t,r;return((t=e||{})==null?void 0:t.constructor)===m||((r=e||{})==null?void 0:r.__classAlias)===m.__classAlias};m.getFromNumberYYYYMMDD=e=>{let t=Number(e).zeroEmbed(8).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return m(t+" 00:00:00")};m.getShortYMDs=(e,t)=>{let r="",i="";return e.year==t.year&&e.year==m().year?r=e.toFormatMD():r=e.toFormatYMD(),e.year!=t.year?i=t.toFormatYMD():i=t.toFormatMD(),[r,i]};m.getPeriodArray=(e,t,r)=>{let i=[],n=t;if(!t.validate||!r.validate)return i;for(e=="year"?n=m(n).setMonth(1).setDate(1).setFirstOfDay():e=="month"?n=m(n).setDate(1):e=="week"?n=m(n).getFirstDayOfWeek():e=="day"?n=m(n).setFirstOfDay():e=="hours"?n=m(n).setMinutes(0).setSeconds(0).setMilliseconds(0):e=="minutes"?n=m(n).setSeconds(0).setMilliseconds(0):e=="seconds"&&(n=m(n).setMilliseconds(0));n.toFormatYMDHMS().toNumber()<=r.toFormatYMDHMS().toNumber();)i.push(n),e=="year"?n=m(n).addYear(1):e=="month"?n=m(n).addMonth(1):e=="week"?n=m(n).addWeek(1):e=="day"?n=m(n).addDate(1):e=="hours"?n=m(n).addHours(1):e=="minutes"?n=m(n).addMinutes(1):e=="seconds"&&(n=m(n).addSeconds(1));return i};m.prototype.Time.prototype=m.prototype;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(){D.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=D.get("Interval_"+e);t&&(t&&clearInterval(t.timeoutIndex),t.setState({isFinished:!0}))};S.get=e=>D.get("Interval_"+e);S.once=(e,t,r)=>S(e,t,r).once();S.series=(e,t)=>g(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 ge=(e,t)=>new c.prototype.Fetcher(e,t),c=ge;c.prototype={};c.waitList=[];c.setDefaultTrafficControl=0;c.setDefaultTimeout=1e3*60*10;c.abort=e=>{let t="fetcher.abortController."+e,r=D.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)=>g(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 be=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=N(E({key:w(),response_format:"json",timeout:c.setDefaultTimeout,trafficControl:c.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:E(E({"Content-Type":"application/json"},c.setDefaultHeaders&&c.setDefaultHeaders()),t.headers),body:r}),this};a.extend({Fetcher:be,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=E(E({},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 g(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(()=>g(this,null,function*(){let{ok:p,done:b,data:R}=yield c.streamToContext(o,{reader:n,decoder:s});p&&r(R)}));return}let f=!1;for(;!f;){let{ok:p,done:b,data:R}=yield new U(c.streamToContext(o,{reader:n,decoder:s}));u.streamStatus=="abort"?(u.streamStatus="closed",n.cancel(),b=!0):u.streamStatus=="closed"&&(b=!0),b&&(f=b,n.releaseLock()),i(R,b)}})};try{for(var h=ee(l()),d,y,M;d=!(y=yield h.next()).done;d=!1){let f=y.value;;}}catch(y){M=[y]}finally{try{d&&(y=h.return)&&(yield y.call(h))}finally{if(M)throw M[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 g(this,null,function*(){var W;let e=this.params,t=performance.now(),q=e,{key:r,response_format:i,trafficControl:n=0,preventMultiRequest:s,timeout:o,queries:u}=q,l=Q(q,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);l.method=this.method;let h=[this.method,r].join("."),d=c.waitList.includes(h);c.waitList=[...c.waitList,h];let y=!1,M=!1,f=!1,p=500,b="InternalServerError",R={},I=null,O=null;n>0&&(O=a.pending(n));let P=new AbortController,re=setTimeout(()=>{P.abort(),console.log("timeout",o)},e.timeout);l.signal=P.signal,this.abortController=P;let K="fetcher.abortController."+this.params.key;D.set({[K]:P});let H=()=>{y=!0},z=()=>(P.abort(),c.waitList=c.waitList.filter(v=>v!=h),{isCancelled:y,isAborted:M,ok:!1,status:0,statusText:"CANCELLED",body:R,requestTime:0,rawData:null});try{if(c.setDefaultOnStart&&(yield c.setDefaultOnStart(e,H)),this.onStartCB&&(yield this.onStartCB(e,H)),y)return z();if(d){if(this.onKeyDuplicateCB&&(yield this.onKeyDuplicateCB(H)),y)return z();if(s)throw p=429,new Error("TooManyRequests")}let v=a.url.search.set(E({},c.toFlatQuery(u||{})),String(this.url)),Y=yield fetch(v,l).then(F=>g(this,null,function*(){return f=F.ok,p=F.status,b=F.statusText,I=F,i=="none"||i=="stream"?F:F[i]()})).catch(F=>{throw new Error(F)});D.delete(K),R=Y}catch(v){p==200&&(p=500,f=!1),p==429&&(b="TooManyRequests"),P.signal.aborted&&(p=408,b="Timeout",M=!0),p==500&&(b=String(v)||b),R={errorCode:String(v)}}finally{clearTimeout(re)}let A={isCancelled:y,isAborted:M,ok:f,status:p,statusText:b,body:R,additionalBody:this.extraBody,requestTime:performance.now()-t,rawData:I};if(!f){if(this.onRetryCB&&!this.isRetry){this.isRetry=!0;let v=yield this.onRetryCB(A.body,this.params,this);if(v)return c.waitList=c.waitList.filter(Y=>Y!=h),this.params=v,this.send()}this.onErrorCB&&this.onErrorCB(A.body)}if(f&&this.onStreamCB&&e.response_format=="stream"){let v=(W=I.body)==null?void 0:W.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:A,reader:v,decoder:new TextDecoder("utf-8")})}return yield O,A.requestTime=performance.now()-t,f&&this.onCompleteCB&&this.onCompleteCB(A.body),this.onResultCB&&this.onResultCB(A,e),c.setDefaultOnEnd&&c.setDefaultOnEnd(A,e),c.waitList=c.waitList.filter(v=>v!=h),A})},abortStream:function(){this.streamStatus="abort"}},c);c.prototype.Fetcher.prototype=c.prototype;var Ce=e=>new T.prototype.Filer(e),T=Ce;T.prototype={};var Me=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:Me,isValid:function(){return this.ok},toBlob:function(){return g(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return g(this,null,function*(){return yield this.file.convert("dataURL")})},toAarrayBuffer:function(){return g(this,null,function*(){return yield this.file.convert("arrayBuffer")})},toObjectURL:function(){return g(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}},T);T.fromFile=e=>T(e);T.fromBlob=(e,t)=>{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 T(n)};T.fromArrayBuffer=(e,t)=>T.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t);T.fromObjectURL=(e,t)=>g(void 0,null,function*(){let r=yield c(e,{response_format:"blob"}).get();return r.ok?T.fromBlob(r.body,t):T({})});T.fromDataURL=(e,t)=>{let r=e.toBlob((t==null?void 0:t.mimeType)||"");return r?T.fromBlob(r,t):T({})};T.prototype.Filer.prototype=T.prototype;var Se=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:d={},bodyStringify:y=!0}=u||{};h=h!=null?h:(l!=null?l:!0)&&200||403;let M=d;return y&&!a.is.string(d)&&(M=a.Stringify(d)),n.status(h).end(M)},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},J=Se;J.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};J.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=>g(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 g(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)=>{let r;return new Promise((i,n)=>{r=t||new Image,r.onload=()=>i(r),r.onerror=s=>n(s),r.crossOrigin="anonymous",r.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 Te=a;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
1
+ "use strict";var B=Object.defineProperty,ne=Object.defineProperties,ie=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertyNames,_=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?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E=(e,t)=>{for(var r in t||(t={}))V.call(t,r)&&X(e,r,t[r]);if(_)for(var r of _(t))G.call(t,r)&&X(e,r,t[r]);return e},N=(e,t)=>ne(e,se(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&&_)for(var i of _(e))t.indexOf(i)<0&&G.call(e,i)&&(r[i]=e[i]);return r};var oe=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},le=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ae(t))!V.call(e,n)&&n!==r&&B(e,n,{get:()=>t[n],enumerable:!(i=ie(t,n))||i.enumerable});return e};var ue=e=>le(B({},"__esModule",{value:!0}),e);var g=(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())}),U=function(e,t){this[0]=e,this[1]=t},Z=(e,t,r)=>{var i=(o,u,l,h)=>{try{var d=r[o](u),y=(u=d.value)instanceof U,M=d.done;Promise.resolve(y?u[0]:u).then(f=>y?i(o==="return"?o:"next",u[1]?{done:f.done,value:f.value}:f,l,h):l({value:f,done:M})).catch(f=>i("throw",f,l,h))}catch(f){h(f)}},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 De={};oe(De,{Fetcher:()=>c,Filer:()=>T,Server:()=>J,Time:()=>m,UUID:()=>w,default:()=>Te,useStore:()=>D});module.exports=ue(De);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){let t="";if(e.length==2){let[r,i]=e;t=[this.slice(0,r),i,this.slice(r+i.length)].join("")}if(e.length==3){let[r,i,n]=e;t=[this.slice(0,r),n,this.slice(r+i)].join("")}return t},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(){let e=this.replace(/[^\d.-]/g,"").replace(/(-)(?=.*\d)/g,"").replace(/(\d+)\.(\d+)\.(\d+)/g,"$1.$2$3");return Number(e)||0},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){let t=Number(this)<0,r=Math.abs(Number(this));return isNaN(r)?"":(t?"-":"")+String(r).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]),s.length||(s=[""]);let o=[],u=[];for(let l of s){let h=String(l).match(/([^\.\[\]"]+)/g)||"";o.push(h),u.push(this.every(d=>t(Number(e(d,...h)))))}return this.sort((l,h)=>{for(let d=0;d<o.length;d++){let y=o[d]||"",M=u[d],f=e(l,...y),p=e(h,...y);if(M){if(Number(f)>Number(p))return 1;if(Number(f)<Number(p))return-1;continue}if(t(f)&&!t(p))return-1;if(!t(f)&&t(p))return 1;let b=String(f).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,O=>O.padStart(10,"0")),R=String(p).replace(/(\d+),(\d+)/g,"$1$2").replace(/(\d+)/g,O=>O.padStart(10,"0")),I=b.localeCompare(R,i,n);if(I!=0)return I}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){e=e||"dataURL";let t="readAs"+(e==null?void 0:e.toCapital());return new Promise((r,i)=>{let n=new FileReader;n.onload=s=>{r(n.result)},n.onerror=s=>i(n.error||s),n[t](this)})},File.prototype.clone=function(){return new File([this.slice(0,this.size,this.type)],this.name,{type:this.type,lastModified:this.lastModified})});var he=(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(""),w=he;w.get128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");w.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};w.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 me=e=>new a.prototype.jmini(e),a=me;a.prototype={};a.extend=function(e,t=a){for(var[r,i]of Object.entries(e))t.prototype[r]=i};a.expando="__jmini_"+w();a.__classAlias="jmini";var C=(e,t)=>(e.queue.push(t),$(e),e),$=e=>g(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,$(e)}),k=(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},fe=(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,$(e),e};a.extend({constructor:a,__classAlias:a.__classAlias,jmini:function(e){return this.src=e,this.srcType=a.is.what(e),this.queueProcess=!0,this.queue=[],fe(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(y=>{o[1]&&(y=y.cloneNode(!0)),h.parentNode.insertBefore(y,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 C(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},n)}))},abort:function(){return C(this,()=>g(this,null,function*(){return this.queue=[],this}))},callback:function(n){return C(this,()=>g(this,null,function*(){return yield n(this),this}))},click:function(){return C(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];a.is.element(s)&&s.click()}return this})},focus:function(){return C(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 C(this,()=>{let{eventType:s,eventID:o=w(),target:u,callback:l,options:h}=n;return h=E({passive:!0,capture:!1},h),this.for(d=>{if(!(a.is.element(d)||a.is.shadowRoot(d)))return;let{events:y}=d[a.expando];if(u){let M=l;l=f=>{if(f.target){if(a.is.string(u)){let b=f.target.closest(u);b&&(!b||M.call(b,f))}else if(a.is.elements(u)){for(let p of u)if(f.target==p)return M.call(p,f)}}}}if(y[o]){let M=y[o];d.removeEventListener(M.eventType,M.callback,M.options)}y[o]={eventType:s,callback:l,options:h},d.addEventListener(s,l,h)}),this})},removeEvent:function(n){return C(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 C(this,()=>k(this,r(n,t(this))))},empty:function(){return C(this,()=>k(this,t(this)))},append:function(n){return C(this,()=>{r(n,this)})},remove:function(){return C(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 C(this,()=>k(this,i(this,"before",...n)))},after:function(...n){return C(this,()=>k(this,i(this,"after",...n)))},find:function(n){return C(this,()=>{let s=[],o=this[0];o||k(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(d=>d)])})),k(this,a(s))})},parent:function(n){return C(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);k(this,s)})},children:function(n){return C(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 k(this,o)})},addClass:function(n){return C(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 C(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 C(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 C(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 C(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)=>t?Array.from(new Map(e.map(r=>[a.getKeyValue(r,t||"0"),r])).values()):Array.from(new Set(e));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!e||!a.is.array(e)&&!a.is.keyValueDictionary(e)?null:(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=>g(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});a.scope=e=>e();a.scopeSync=e=>g(void 0,null,function*(){return yield e()});a.createElement=function(e){var y;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 M of Object.entries(s)){let f=M[0],p=(y=M[1])!=null?y:"";if(f=="data"&&a.is.keyValueDictionary(p))for(let[b,R]of Object.entries(p))l.dataset[b]=R;else f=="for"?f="htmlFor":f=="tabindex"?f="tabIndex":f=="aria-label"&&(f="ariaLabel"),l[f]=p}if(n&&a(l).append(n),o)for(var[h,d]of Object.entries(o))l.style[h]=d;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.localStorage={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,d;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=(d=e.pageY)!=null?d:(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)=>{let r=t||Number(e)||0;return new Promise((i,n)=>{a.is.function(e)&&e(i),r&&setTimeout(()=>{i(!0)},r)})};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.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,t)=>{let r=new URL(t||location.href);if(a.is.string(e))r.pathname=e;else{let i=a.url.path.get();Object.entries(e).forEach(([n,s])=>{i[Number(n)]=s}),r.pathname="/"+i.filter(n=>n!=null).join("/")}return t||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{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.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){var t,r;return((t=e||{})==null?void 0:t.constructor)===a||((r=e||{})==null?void 0:r.__classAlias)===a.__classAlias},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())},inRange:function(e,t,r,i=!0){return i?t<=e&&e<=r:t<e&&e<r},oneOf:function(e,...t){return t==null?void 0:t.includes(e)}};var x={},D={set:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{let s=x[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),x[i]={privateKey:t,value:n}}),r},update:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{var o;let s=x[i]||{};s&&s.privateKey&&s.privateKey!=t&&(r=!1),x[i]=N(E({},x[i]),{value:E(E({},(o=x[i])==null?void 0:o.value),n)})}),r},get:(e,t)=>{let r=x[e];if(!(r&&r.privateKey&&r.privateKey!=t))return r==null?void 0:r.value},delete:(e,t)=>{let r=x[e];return r&&r.privateKey&&r.privateKey!=t?!1:(delete x[e],!0)}};var te=-new Date().getTimezoneOffset(),ce=(e,t)=>new m.prototype.Time(e,t),m=ce;m.prototype={};m.__classAlias="jmini.Time";var de=function(e,t){if(t&&(this.localTimezoneOffset=t),m.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0?e=new Date:e===0&&(e=new Date(0))),e&&(a.is.number(e)&&(e=new Date(e)),a.is.string(e)&&(e=String(e).trim().replace(/\//g,"-").replace(/ +|\s+/g," ").replace(/\-+/g,"-"),e=e.replace(/^(\d{4}-\d{2}-\d{2})$/,"$1T00:00:00").replace(/^(\d{4}-\d{2}-\d{2})\s+/,"$1T").replace(/^(\d{4}-\d{2}-\d{2}T\d{2})(:?|:+)$/,"$1:00").replace(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(:?|:+)$/,"$1:00"),e.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1,3})?$/)))){let i=this.getLocalTimezoneOffset(),n=Math.floor(i/60),s=i%60;n>=0&&(e+="+"),e+=n.zeroEmbed(2),e+=":"+s.zeroEmbed(2)}let r=new Date(String(e));return this.set(r)};a.extend({constructor:m,Time:de,__classAlias:m.__classAlias,value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,warekiYear:-1,wareki:"",warekiLabel:"",year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,localTimezoneOffset:void 0,getLocalTimezoneOffset:function(){var e,t;return(t=(e=this.localTimezoneOffset)!=null?e:D.get("jmini/time/env/localTimezoneOffset"))!=null?t:te},setLocalTimezoneOffset:function(e,t){return this.localTimezoneOffset=e,t&&D.set({"jmini/time/env/localTimezoneOffset":e}),this.set(this.value)},clone:function(){return m(this,this.localTimezoneOffset)},set:function(e){var n;this.value=e;let t=a.is.date(e);if(this.validate=t,a.is.nullish(this.localTimezoneOffset)&&(this.localTimezoneOffset=(n=D.get("jmini/time/env/localTimezoneOffset"))!=null?n:te),!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;let r=e.getTime()+e.getTimezoneOffset()*6e4,i=new Date(r+this.getLocalTimezoneOffset()*60*1e3);this.ms=e.getTime(),this.year=i.getFullYear(),this.month=i.getMonth()+1,this.date=i.getDate(),this.weekday=i.getDay(),this.hours=i.getHours(),this.minutes=i.getMinutes(),this.seconds=i.getSeconds();{let s=this.year||0,o=this.month||0,u=this.date||0,l=Number(s+o.zeroEmbed(2)+u.zeroEmbed(2));l>=20190501?(this.warekiYear=s-2018,this.wareki="REIWA",this.warekiLabel="\u4EE4\u548C"):l>=19890108?(this.warekiYear=s-1988,this.wareki="HEISEI",this.warekiLabel="\u5E73\u6210"):l>=19261225?(this.warekiYear=s-1925,this.wareki="SHOUWA",this.warekiLabel="\u662D\u548C"):l>=19120730?(this.warekiYear=s-1911,this.wareki="TAISHO",this.warekiLabel="\u5927\u6B63"):l>=19680125?(this.warekiYear=s-1867,this.wareki="MEIJI",this.warekiLabel="\u660E\u6CBB"):(this.warekiYear=0,this.wareki="",this.warekiLabel="")}{let s=new Date(this.year,0,1),o=new Date(s.valueOf());o.setDate(o.getDate()-(s.getDay()+1));let u=this.ms-o.getTime(),l=Math.ceil(u/(1e3*60*60*24));this.weekInYear=Math.ceil(l/7)}{let s=new Date(this.year,this.month-1,1),o=new Date(s.valueOf());o.setDate(o.getDate()-(s.getDay()+1));let u=this.ms-o.getTime(),l=Math.ceil(u/(1e3*60*60*24)),h=Math.ceil(l/7);this.weekInMonth=h}{let s=new Date(this.year,this.month,0),o=s.getDay(),u=new Date(new Date(s).setDate(s.getDate()-o));this.isLastWeekInMonth=this.date>=u.getDate()}return this},isPast:function(){let e=m();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=m(e);return this.year==t.year},isSameMonth:function(e){let t=m(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=m(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=m(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},isInRange:function(e,t){return!this.validate||!e.validate||!t.validate?!1:this.value>=e.value&&this.value<=t.value},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=m(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,t){if(!this.validate)return"";let r=this;return a.is.exist(t)&&(r=r.clone(),r.setLocalTimezoneOffset(t||0)),e.replace(/\%y/ig,r.year.zeroEmbed(4)).replace(/\%m/ig,r.month.zeroEmbed(2)).replace(/\%d/ig,r.date.zeroEmbed(2)).replace(/\%w/ig,r.weekInYear.zeroEmbed(2)).replace(/\%h/ig,r.hours.zeroEmbed(2)).replace(/\%i/ig,r.minutes.zeroEmbed(2)).replace(/\%s/ig,r.seconds.zeroEmbed(2))},toFormatISO:function(){return this.value.toISOString()},toFormatabbrYMD:function(e,t){if(!this.validate)return"";let r=this.isSameYear(m()),i="%Y/%M/%D";return r&&(i="%M/%D"),e=="JP"&&(i="%Y\u5E74%M\u6708%D\u65E5",r&&(i="%M\u6708%D\u65E5")),this.toFormat(i,t)},toFormatYMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t):""},toFormatYM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708",t):this.toFormat("%Y/%M",t):""},toFormatMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):""},toFormatHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206",t):this.toFormat("%h:%i",t):""},toFormatHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206%s\u79D2",t):this.toFormat("%h:%i:%s",t):""},toFormatYMDHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%i\u5206",t):this.toFormat("%Y/%M/%D %h:%i",t):""},toFormatYMDHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2",t):this.toFormat("%Y/%M/%D %h:%i:%s",t):""},toLangYMD:function(e,t){if(!this.validate)return"";let r=m(),i=r.diff(this);return i.dates==0?"\u4ECA\u65E5":i.dates==1?"\u6628\u65E5":i.dates>=-7&&i.dates<0?-1*i.dates+"\u65E5\u5F8C":i.dates<=7&&i.dates>0?i.dates+"\u65E5\u524D":this.isSameYear(r)?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t)},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 m(new Date(this.value.getFullYear(),0,1))},getLastDayOfYear:function(){return m(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfMonth:function(){return m(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfMonth:function(){return m(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfWeek:function(){let e=m(this.value);return e.addDate(-e.weekday)},getLastDayOfWeek:function(){let e=m(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||m(),r=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&r--,r}},m);m.isTimeObject=e=>{var t,r;return((t=e||{})==null?void 0:t.constructor)===m||((r=e||{})==null?void 0:r.__classAlias)===m.__classAlias};m.getFromNumberYYYYMMDD=e=>{let t=Number(e).zeroEmbed(8).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return m(t+" 00:00:00")};m.getShortYMDs=(e,t)=>{let r="",i="";return e.year==t.year&&e.year==m().year?r=e.toFormatMD():r=e.toFormatYMD(),e.year!=t.year?i=t.toFormatYMD():i=t.toFormatMD(),[r,i]};m.getPeriodArray=(e,t,r)=>{let i=[],n=t;if(!t.validate||!r.validate)return i;for(e=="year"?n=m(n).setMonth(1).setDate(1).setFirstOfDay():e=="month"?n=m(n).setDate(1):e=="week"?n=m(n).getFirstDayOfWeek():e=="day"?n=m(n).setFirstOfDay():e=="hours"?n=m(n).setMinutes(0).setSeconds(0).setMilliseconds(0):e=="minutes"?n=m(n).setSeconds(0).setMilliseconds(0):e=="seconds"&&(n=m(n).setMilliseconds(0));n.toFormatYMDHMS().toNumber()<=r.toFormatYMDHMS().toNumber();)i.push(n),e=="year"?n=m(n).addYear(1):e=="month"?n=m(n).addMonth(1):e=="week"?n=m(n).addWeek(1):e=="day"?n=m(n).addDate(1):e=="hours"?n=m(n).addHours(1):e=="minutes"?n=m(n).addMinutes(1):e=="seconds"&&(n=m(n).addSeconds(1));return i};m.prototype.Time.prototype=m.prototype;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(){D.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=D.get("Interval_"+e);t&&(t&&clearInterval(t.timeoutIndex),t.setState({isFinished:!0}))};S.get=e=>D.get("Interval_"+e);S.once=(e,t,r)=>S(e,t,r).once();S.series=(e,t)=>g(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 ge=(e,t)=>new c.prototype.Fetcher(e,t),c=ge;c.prototype={};c.waitList=[];c.setDefaultTrafficControl=0;c.setDefaultTimeout=1e3*60*10;c.abort=e=>{let t="fetcher.abortController."+e,r=D.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)=>g(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 be=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=N(E({key:w(),response_format:"json",timeout:c.setDefaultTimeout,trafficControl:c.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:E(E({"Content-Type":"application/json"},c.setDefaultHeaders&&c.setDefaultHeaders()),t.headers),body:r}),this};a.extend({Fetcher:be,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=E(E({},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 g(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(()=>g(this,null,function*(){let{ok:p,done:b,data:R}=yield c.streamToContext(o,{reader:n,decoder:s});p&&r(R)}));return}let f=!1;for(;!f;){let{ok:p,done:b,data:R}=yield new U(c.streamToContext(o,{reader:n,decoder:s}));u.streamStatus=="abort"?(u.streamStatus="closed",n.cancel(),b=!0):u.streamStatus=="closed"&&(b=!0),b&&(f=b,n.releaseLock()),i(R,b)}})};try{for(var h=ee(l()),d,y,M;d=!(y=yield h.next()).done;d=!1){let f=y.value;;}}catch(y){M=[y]}finally{try{d&&(y=h.return)&&(yield y.call(h))}finally{if(M)throw M[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 g(this,null,function*(){var W;let e=this.params,t=performance.now(),q=e,{key:r,response_format:i,trafficControl:n=0,preventMultiRequest:s,timeout:o,queries:u}=q,l=Q(q,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);l.method=this.method;let h=[this.method,r].join("."),d=c.waitList.includes(h);c.waitList=[...c.waitList,h];let y=!1,M=!1,f=!1,p=500,b="InternalServerError",R={},I=null,O=null;n>0&&(O=a.pending(n));let P=new AbortController,re=setTimeout(()=>{P.abort(),console.log("timeout",o)},e.timeout);l.signal=P.signal,this.abortController=P;let K="fetcher.abortController."+this.params.key;D.set({[K]:P});let H=()=>{y=!0},z=()=>(P.abort(),c.waitList=c.waitList.filter(v=>v!=h),{isCancelled:y,isAborted:M,ok:!1,status:0,statusText:"CANCELLED",body:R,requestTime:0,rawData:null});try{if(c.setDefaultOnStart&&(yield c.setDefaultOnStart(e,H)),this.onStartCB&&(yield this.onStartCB(e,H)),y)return z();if(d){if(this.onKeyDuplicateCB&&(yield this.onKeyDuplicateCB(H)),y)return z();if(s)throw p=429,new Error("TooManyRequests")}let v=a.url.search.set(E({},c.toFlatQuery(u||{})),String(this.url)),Y=yield fetch(v,l).then(F=>g(this,null,function*(){return f=F.ok,p=F.status,b=F.statusText,I=F,i=="none"||i=="stream"?F:F[i]()})).catch(F=>{throw new Error(F)});D.delete(K),R=Y}catch(v){p==200&&(p=500,f=!1),p==429&&(b="TooManyRequests"),P.signal.aborted&&(p=408,b="Timeout",M=!0),p==500&&(b=String(v)||b),R={errorCode:String(v)}}finally{clearTimeout(re)}let A={isCancelled:y,isAborted:M,ok:f,status:p,statusText:b,body:R,additionalBody:this.extraBody,requestTime:performance.now()-t,rawData:I};if(!f){if(this.onRetryCB&&!this.isRetry){this.isRetry=!0;let v=yield this.onRetryCB(A.body,this.params,this);if(v)return c.waitList=c.waitList.filter(Y=>Y!=h),this.params=v,this.send()}this.onErrorCB&&this.onErrorCB(A.body)}if(f&&this.onStreamCB&&e.response_format=="stream"){let v=(W=I.body)==null?void 0:W.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:A,reader:v,decoder:new TextDecoder("utf-8")})}return yield O,A.requestTime=performance.now()-t,f&&this.onCompleteCB&&this.onCompleteCB(A.body),this.onResultCB&&this.onResultCB(A,e),c.setDefaultOnEnd&&c.setDefaultOnEnd(A,e),c.waitList=c.waitList.filter(v=>v!=h),A})},abortStream:function(){this.streamStatus="abort"}},c);c.prototype.Fetcher.prototype=c.prototype;var Ce=e=>new T.prototype.Filer(e),T=Ce;T.prototype={};var Me=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:Me,isValid:function(){return this.ok},toBlob:function(){return g(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return g(this,null,function*(){return yield this.file.convert("dataURL")})},toAarrayBuffer:function(){return g(this,null,function*(){return yield this.file.convert("arrayBuffer")})},toObjectURL:function(){return g(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}},T);T.fromFile=e=>T(e);T.fromBlob=(e,t)=>{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 T(n)};T.fromArrayBuffer=(e,t)=>T.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t);T.fromObjectURL=(e,t)=>g(void 0,null,function*(){let r=yield c(e,{response_format:"blob"}).get();return r.ok?T.fromBlob(r.body,t):T({})});T.fromDataURL=(e,t)=>{let r=e.toBlob((t==null?void 0:t.mimeType)||"");return r?T.fromBlob(r,t):T({})};T.prototype.Filer.prototype=T.prototype;var Se=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:d={},bodyStringify:y=!0}=u||{};h=h!=null?h:(l!=null?l:!0)&&200||403;let M=d;return y&&!a.is.string(d)&&(M=a.Stringify(d)),n.status(h).end(M)},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},J=Se;J.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};J.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=>g(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 g(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)=>{let r;return new Promise((i,n)=>{r=t||new Image,r.onload=()=>i(r),r.onerror=s=>n(s),r.crossOrigin="anonymous",r.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 Te=a;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
package/esm/core.d.ts CHANGED
@@ -163,9 +163,10 @@ declare namespace Jmini {
163
163
  shadowRoot(v: any): v is ShadowRoot;
164
164
  date(v: any): v is Date;
165
165
  inRange(v: any, min: any, max: any, equal?: boolean): boolean;
166
+ oneOf<T = any>(v: T, c1: NoInfer<T>, ...cN: NoInfer<T>[]): boolean;
166
167
  };
167
168
  ellipsisText(value: string, length: number): string;
168
- flatArray<T = any>(v: any, regression?: '-R'): T[];
169
+ flatArray<T = any>(v: T, regression?: '-R'): T[];
169
170
  uniqueArray<T = any>(v: T[], key?: keyof T): T[];
170
171
  getKeyValue<T = any>(object: KeyValueDict, keys: string): T;
171
172
  deepMerge<T = any>(target: T, ...args: T[]): T;
package/esm/core.js CHANGED
@@ -1 +1 @@
1
- import{b as T,e as b}from"./chunk-ABA72NWU.js";import{UUID as S}from"./uuid";import"./primitiveExtension";const w=e=>new n.prototype.jmini(e),n=w;n.prototype={},n.extend=function(e,i=n){for(var[r,a]of Object.entries(e))i.prototype[r]=a},n.expando="__jmini_"+S(),n.__classAlias="jmini";const h=(e,i)=>(e.queue.push(i),E(e),e),E=e=>b(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let i=e.queue.shift();i&&(yield i()),e.queueProcess=!1,E(e)}),p=(e,i)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,a]of Object.entries(i))r.match(/queue/)||(e[r]=a);return e},v=(e,i)=>{if(i.length){for(var r=0;r<i.length;r++){let a=i[r];a&&(a[n.expando]||(n.is.element(a)||n.is.shadowRoot(a))&&(a[n.expando]={events:{}})),e[r]=a}e.length=i.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,E(e),e};n.extend({constructor:n,__classAlias:n.__classAlias,jmini:function(e){return this.src=e,this.srcType=n.is.what(e),this.queueProcess=!0,this.queue=[],v(this,n.is.jmini(e)?e.get():n.is.element(e)?[e]:n.is.elements(e)?e:n.is.shadowRoot(e)?[e]:n.is.string(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}}),n.prototype[String(Symbol.iterator)]=[][Symbol.iterator],n.prototype.jmini.prototype=n.prototype;{const e=function(t,s,o){let l=[];for(let u=0;u<(t.length||0);u++)l.push(s(t[u],u));return o&&(l=l.filter(u=>u!=null)),l},i=t=>(t.for((s,o)=>{if(!(n.is.element(s)||n.is.shadowRoot(s)))return;let l=s.cloneNode(),u=s.parentNode;u&&u.replaceChild(l,s),t[o]=l}),t),r=(t,s)=>(n(s).for(o=>{if(t&&(n.is.element(o)||n.is.shadowRoot(o)))if(n.is.string(t)||n.is.number(t))t=String(t),o.insertAdjacentHTML("beforeend",String(t));else if(n.is.element(t))o.appendChild(t);else{n.is.jmini(t)?t=t.get():n.is.element(t)?t=[t]:n.is.keyValueDictionary(t)&&(t=[n(t)]);for(var l=0;l<t.length;l++)r(t[l],o)}}),s),a=(t,s,...o)=>{let{p:l,s:u}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return t.for(c=>{if(n.is.string(o[0]))c.insertAdjacentHTML(l,o[0]);else{if(!c.parentNode)return;n(o[0]).for(y=>{o[1]&&(y=y.cloneNode(!0)),c.parentNode.insertBefore(y,c[u]||c)})}}),t};n.extend({get:function(t){return t?this[0]:e(this,s=>s)},for:function(t,s=1){let o=e(this,(l,u)=>t(l,u),1);return s?o:[]},await:function(t){return h(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},t)}))},abort:function(){return h(this,()=>b(this,null,function*(){return this.queue=[],this}))},callback:function(t){return h(this,()=>b(this,null,function*(){return yield t(this),this}))},click:function(){return h(this,()=>{for(var t=0;t<this.length;t++){let s=this[t];n.is.element(s)&&s.click()}return this})},focus:function(){return h(this,()=>{for(var t=0;t<this.length;t++){let s=this[t];n.is.element(s)&&s.focus()}return this})},addEvent:function(t){return h(this,()=>{let{eventType:s,eventID:o=S(),target:l,callback:u,options:c}=t;return c=T({passive:!0,capture:!1},c),this.for(m=>{if(!(n.is.element(m)||n.is.shadowRoot(m)))return;let{events:y}=m[n.expando];if(l){let g=u;u=f=>{if(f.target){if(n.is.string(l)){let C=f.target.closest(l);C&&(!C||g.call(C,f))}else if(n.is.elements(l)){for(let d of l)if(f.target==d)return g.call(d,f)}}}}if(y[o]){let g=y[o];m.removeEventListener(g.eventType,g.callback,g.options)}y[o]={eventType:s,callback:u,options:c},m.addEventListener(s,u,c)}),this})},removeEvent:function(t){return h(this,()=>{let s=n.is.array(t)?t:[t];return this.for(o=>{let{events:l}=o[n.expando];for(let u of s){let c=l[u];c&&o.removeEventListener(c.eventType,c.callback,c.options)}}),this})},html:function(t){return h(this,()=>p(this,r(t,i(this))))},empty:function(){return h(this,()=>p(this,i(this)))},append:function(t){return h(this,()=>{r(t,this)})},remove:function(){return h(this,()=>(this.for((t,s)=>{t&&n.is.element(t)&&(t.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...t){return h(this,()=>p(this,a(this,"before",...t)))},after:function(...t){return h(this,()=>p(this,a(this,"after",...t)))},find:function(t){return h(this,()=>{let s=[],o=this[0];o||p(this,n()),(n.is.element(o)||n.is.shadowRoot(o))&&(n.is.string(t)?s=o.querySelectorAll(t):n.is.element(o)&&n(t).for(l=>{let u=o.childNodes;for(let c of u)if(c===l){s.push(c);break}else c.childNodes.length&&(s=[...s,...n(c).find(l).for(m=>m)])})),p(this,n(s))})},parent:function(t){return h(this,()=>{var o,l;let s=n(t?(o=this[0])==null?void 0:o.closest(t):(l=this[0])==null?void 0:l.parentNode);p(this,s)})},children:function(t){return h(this,()=>{let s=this[0].children;n.is.exist(t)&&(t=String(t).replace(/^ : /,""),s=t=="first"?s[0]:t=="last"?s[s.length-1]:s[Number(t)]);let o=n(s);return p(this,o)})},addClass:function(t){return h(this,()=>(t&&this.for(s=>{let o=n.is.string(t)?t.split(" "):t;s&&n.is.element(s)&&s.classList.add(...o)}),this))},removeClass:function(t){return h(this,()=>(t&&this.for(s=>{let o=n.is.string(t)?t.split(" "):t;s&&n.is.element(s)&&s.classList.remove(...o)}),this))},toggleClass:function(t){return h(this,()=>(t&&this.for(s=>{s.classList.toggle(t)}),this))},hasClass:function(t=""){if(this[0])return this[0].classList.contains(t.replace(/^\./,""))},findClass:function(t){let s=[];return this[0]&&(s=[...this[0].classList].filter(o=>o.match(t))),s},css:function(t){return h(this,()=>(this.for(s=>{if(n.is.element(s))for(let[o,l]of Object.entries(t)){if(n.is.number(l)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[o]=l+"px";continue}s.style[o]=String(l)}}),this))},getAttribute:function(t){return this[0].getAttribute(String(t))},setAttribute:function(t,s){return h(this,()=>(this.for(o=>o.setAttribute(t,s)),this))},getStyleProperty:function(t){let s=this[0];return s&&n.is.element(s)?getComputedStyle(s).getPropertyValue(t):""},setStyleProperty:function(t,s){let o=this[0];return o&&n.is.element(o)&&o.style.setProperty(t,s),this},val:function(){var s;let t=this[0];return(t==null?void 0:t.value)||((s=t==null?void 0:t.dataset)==null?void 0:s.value)},position:function(){return n.is.element(this[0])?this[0].getBoundingClientRect():{}}})}n.flatArray=(e,i)=>{if(!n.is.array(e))return[e];let r=[];for(let a of e)r.push(...i=="-R"?n.flatArray(a,"-R"):[a]);return r},n.uniqueArray=(e,i)=>i?Array.from(new Map(e.map(r=>[n.getKeyValue(r,i||"0"),r])).values()):Array.from(new Set(e)),n.getKeyValue=(e,i)=>{let r={},a=e;return i.split(".").forEach(t=>{a=a==null?void 0:a[t],r=a}),r},n.Stringify=(...e)=>{let[i,r,a]=e;return JSON.stringify(i,r!=null?r:(()=>{const t=new WeakSet;return(s,o)=>{if(typeof o=="object"&&o!==null){if(t.has(o))return"[Circular Reference]";t.add(o)}return o}})(),a)},n.Objectify=(e,i)=>{try{return JSON.parse(e)}catch(r){return i!=null?i:null}},n.SortifyObject=(e,i)=>{let r={};return!e||!n.is.array(e)&&!n.is.keyValueDictionary(e)?null:(Object.keys(e).sort().forEach(a=>{let t=e[a];if(i){if(n.is.keyValueDictionary(t)){r[a]=n.SortifyObject(t,i);return}if(n.is.array(t)){r[a]=t.map(s=>n.is.keyValueDictionary(s)||n.is.array(s)?n.SortifyObject(s,i):s);return}}r[a]=t}),r)},n.randomNumber=(e=0,i=100,r)=>{if(e>i)return NaN;let a=Math.round(Math.random()*(i-e))+e;return r&&r.length&&r.includes(a)?n.randomNumber(e,i,r):a},n.try=e=>{try{return[e(),!0]}catch(i){return[i,!1]}},n.trySync=e=>b(void 0,null,function*(){try{return[yield e(),!0]}catch(i){return[i,!1]}}),n.scope=e=>e(),n.scopeSync=e=>b(void 0,null,function*(){return yield e()}),n.createElement=function(e){var y;let{tag:i,className:r="",id:a,html:t,attr:s,style:o,parent:l}=e,u=document.createElement(i||"div");if(r&&u.classList.add(...r.split(" ")),a&&(u.id=a),s)for(let g of Object.entries(s)){let f=g[0],d=(y=g[1])!=null?y:"";if(f=="data"&&n.is.keyValueDictionary(d))for(let[C,J]of Object.entries(d))u.dataset[C]=J;else f=="for"?f="htmlFor":f=="tabindex"?f="tabIndex":f=="aria-label"&&(f="ariaLabel"),u[f]=d}if(t&&n(u).append(t),o)for(var[c,m]of Object.entries(o))u.style[c]=m;return l&&n(l).append(u),u},n.setCookie=e=>{let{hostname:i}=new URL(location.toString()),{name:r,value:a="",age:t=60*60*24*365,path:s="/",domain:o=i,secure:l=!1}=e,u=`${r}=${a}max-age=${t}path=${s}domain=${o}`;l&&(u+=" Secure"),document.cookie=u},n.getCookie=e=>{let i=document.cookie.match(new RegExp(e+"=[^]*"));return i?i[0].replace(new RegExp(e+"="),""):""},n.localStorage={set:(e,i)=>{localStorage.setItem(e,n.Stringify(i))},get:e=>{let i=localStorage.getItem(e);return n.Objectify(i,i)}},n.deleteCookie=e=>{document.cookie=e+"=max-age=0"},n.getScreenSize=()=>{let{innerHeight:e,innerWidth:i,scrollY:r,scrollX:a,pageXOffset:t,pageYOffset:s}=window,o=Number(n(document.body).getStyleProperty("--sat").removeLetters()),l=Number(n(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:i,pageHeight:e-o-l,scrollY:r,scrollX:a,pageXOffset:t,pageYOffset:s,safeAreaTop:o,safeAreaBottom:l}},n.getCursor=e=>{var a,t,s,o,l,u,c,m;let i=(o=e.pageX)!=null?o:(s=(a=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:a.pageX)!=null?s:(((t=e==null?void 0:e.originalEvent)==null?void 0:t.touches)||[])[0].pageX,r=(m=e.pageY)!=null?m:(c=(l=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:l.pageY)!=null?c:(((u=e==null?void 0:e.originalEvent)==null?void 0:u.touches)||[])[0].pageY;return{x:i,y:r}},n.pending=(e,i)=>{let r=i||Number(e)||0;return new Promise((a,t)=>{n.is.function(e)&&e(a),r&&setTimeout(()=>{a(!0)},r)})},n.deepMerge=(e,...i)=>{if(!i.length)return e;const r=i.shift();if(n.is.keyValueDictionary(e)&&n.is.keyValueDictionary(r))for(const a in r)n.is.keyValueDictionary(r[a])?(e[a]||Object.assign(e,{[a]:{}}),n.deepMerge(e[a],r[a])):Object.assign(e,{[a]:r[a]});return n.deepMerge(e,...i)},n.deepCopy=e=>{if(n.is.array(e))return e.map(i=>n.deepCopy(i));if(n.is.keyValueDictionary(e)){let i={};return Object.entries(e).forEach(([r,a])=>{i[r]=n.deepCopy(a)}),i}return e},n.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,i)=>{const r=new URL(i||location.href);if(n.is.string(e))r.pathname=e;else{let a=n.url.path.get();Object.entries(e).forEach(([t,s])=>{a[Number(t)]=s}),r.pathname="/"+a.filter(t=>t!=null).join("/")}return i||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((a,t)=>r[t]=a),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([a,t])=>{r.searchParams.set(a,String(t))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(a=>{r.searchParams.delete(a)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}}},n.queryParams={get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((a,t)=>r[t]=a),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([a,t])=>{r.searchParams.set(a,String(t))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(a=>{r.searchParams.delete(a)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}},n.ellipsisText=(e,i)=>{let r=String(e);return r.length>i&&(r=r.slice(0,i)+" ..."),r},n.is={equal:function(e,i,r){return r==null||r?n.Stringify(e)===n.Stringify(i):e===i},what:function(e){let i="other";return this.jmini(e)?i="jmini":this.element(e)?i="element":this.elements(e)?i="elements":this.shadowRoot(e)?i="shadowRoot":this.string(e)?i="string":this.number(e)?i="number":this.array(e)?i="array":this.function(e)?i="function":this.date(e)?i="date":typeof e=="undefined"?i="undefined":this.keyValueDictionary(e)?i="keyValueDictionary":e==null?i="null":isNaN(e)&&(i="NaN"),i},exist:function(e){return e===(e!=null?e:!e)},nullish:function(e){return!this.exist(e)},jmini:function(e){var i,r;return((i=e||{})==null?void 0:i.constructor)===n||((r=e||{})==null?void 0:r.__classAlias)===n.__classAlias},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 i={}.toString.call(e);return Array.isArray(e)||e instanceof Array||i=="[object NodeList]"||i=="[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 i={}.toString.call(e),r=Number(!!e&&typeof e!="string"&&this.array(e)&&i!=="[object Text]");if(r&&i!=="[object NodeList]")for(var a of e)r&=Number(this.element(a));return!!r},shadowRoot:function(e){return e instanceof ShadowRoot},date:function(e){return this.number(new Date(e).getTime())},inRange:function(e,i,r,a=!0){return a?i<=e&&e<=r:i<e&&e<r}};export{n as Jmini,n as default};
1
+ import{b as T,e as b}from"./chunk-ABA72NWU.js";import{UUID as S}from"./uuid";import"./primitiveExtension";const w=e=>new n.prototype.jmini(e),n=w;n.prototype={},n.extend=function(e,i=n){for(var[r,a]of Object.entries(e))i.prototype[r]=a},n.expando="__jmini_"+S(),n.__classAlias="jmini";const h=(e,i)=>(e.queue.push(i),E(e),e),E=e=>b(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let i=e.queue.shift();i&&(yield i()),e.queueProcess=!1,E(e)}),p=(e,i)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,a]of Object.entries(i))r.match(/queue/)||(e[r]=a);return e},v=(e,i)=>{if(i.length){for(var r=0;r<i.length;r++){let a=i[r];a&&(a[n.expando]||(n.is.element(a)||n.is.shadowRoot(a))&&(a[n.expando]={events:{}})),e[r]=a}e.length=i.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,E(e),e};n.extend({constructor:n,__classAlias:n.__classAlias,jmini:function(e){return this.src=e,this.srcType=n.is.what(e),this.queueProcess=!0,this.queue=[],v(this,n.is.jmini(e)?e.get():n.is.element(e)?[e]:n.is.elements(e)?e:n.is.shadowRoot(e)?[e]:n.is.string(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}}),n.prototype[String(Symbol.iterator)]=[][Symbol.iterator],n.prototype.jmini.prototype=n.prototype;{const e=function(t,s,o){let l=[];for(let u=0;u<(t.length||0);u++)l.push(s(t[u],u));return o&&(l=l.filter(u=>u!=null)),l},i=t=>(t.for((s,o)=>{if(!(n.is.element(s)||n.is.shadowRoot(s)))return;let l=s.cloneNode(),u=s.parentNode;u&&u.replaceChild(l,s),t[o]=l}),t),r=(t,s)=>(n(s).for(o=>{if(t&&(n.is.element(o)||n.is.shadowRoot(o)))if(n.is.string(t)||n.is.number(t))t=String(t),o.insertAdjacentHTML("beforeend",String(t));else if(n.is.element(t))o.appendChild(t);else{n.is.jmini(t)?t=t.get():n.is.element(t)?t=[t]:n.is.keyValueDictionary(t)&&(t=[n(t)]);for(var l=0;l<t.length;l++)r(t[l],o)}}),s),a=(t,s,...o)=>{let{p:l,s:u}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return t.for(c=>{if(n.is.string(o[0]))c.insertAdjacentHTML(l,o[0]);else{if(!c.parentNode)return;n(o[0]).for(y=>{o[1]&&(y=y.cloneNode(!0)),c.parentNode.insertBefore(y,c[u]||c)})}}),t};n.extend({get:function(t){return t?this[0]:e(this,s=>s)},for:function(t,s=1){let o=e(this,(l,u)=>t(l,u),1);return s?o:[]},await:function(t){return h(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},t)}))},abort:function(){return h(this,()=>b(this,null,function*(){return this.queue=[],this}))},callback:function(t){return h(this,()=>b(this,null,function*(){return yield t(this),this}))},click:function(){return h(this,()=>{for(var t=0;t<this.length;t++){let s=this[t];n.is.element(s)&&s.click()}return this})},focus:function(){return h(this,()=>{for(var t=0;t<this.length;t++){let s=this[t];n.is.element(s)&&s.focus()}return this})},addEvent:function(t){return h(this,()=>{let{eventType:s,eventID:o=S(),target:l,callback:u,options:c}=t;return c=T({passive:!0,capture:!1},c),this.for(m=>{if(!(n.is.element(m)||n.is.shadowRoot(m)))return;let{events:y}=m[n.expando];if(l){let g=u;u=f=>{if(f.target){if(n.is.string(l)){let C=f.target.closest(l);C&&(!C||g.call(C,f))}else if(n.is.elements(l)){for(let d of l)if(f.target==d)return g.call(d,f)}}}}if(y[o]){let g=y[o];m.removeEventListener(g.eventType,g.callback,g.options)}y[o]={eventType:s,callback:u,options:c},m.addEventListener(s,u,c)}),this})},removeEvent:function(t){return h(this,()=>{let s=n.is.array(t)?t:[t];return this.for(o=>{let{events:l}=o[n.expando];for(let u of s){let c=l[u];c&&o.removeEventListener(c.eventType,c.callback,c.options)}}),this})},html:function(t){return h(this,()=>p(this,r(t,i(this))))},empty:function(){return h(this,()=>p(this,i(this)))},append:function(t){return h(this,()=>{r(t,this)})},remove:function(){return h(this,()=>(this.for((t,s)=>{t&&n.is.element(t)&&(t.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...t){return h(this,()=>p(this,a(this,"before",...t)))},after:function(...t){return h(this,()=>p(this,a(this,"after",...t)))},find:function(t){return h(this,()=>{let s=[],o=this[0];o||p(this,n()),(n.is.element(o)||n.is.shadowRoot(o))&&(n.is.string(t)?s=o.querySelectorAll(t):n.is.element(o)&&n(t).for(l=>{let u=o.childNodes;for(let c of u)if(c===l){s.push(c);break}else c.childNodes.length&&(s=[...s,...n(c).find(l).for(m=>m)])})),p(this,n(s))})},parent:function(t){return h(this,()=>{var o,l;let s=n(t?(o=this[0])==null?void 0:o.closest(t):(l=this[0])==null?void 0:l.parentNode);p(this,s)})},children:function(t){return h(this,()=>{let s=this[0].children;n.is.exist(t)&&(t=String(t).replace(/^ : /,""),s=t=="first"?s[0]:t=="last"?s[s.length-1]:s[Number(t)]);let o=n(s);return p(this,o)})},addClass:function(t){return h(this,()=>(t&&this.for(s=>{let o=n.is.string(t)?t.split(" "):t;s&&n.is.element(s)&&s.classList.add(...o)}),this))},removeClass:function(t){return h(this,()=>(t&&this.for(s=>{let o=n.is.string(t)?t.split(" "):t;s&&n.is.element(s)&&s.classList.remove(...o)}),this))},toggleClass:function(t){return h(this,()=>(t&&this.for(s=>{s.classList.toggle(t)}),this))},hasClass:function(t=""){if(this[0])return this[0].classList.contains(t.replace(/^\./,""))},findClass:function(t){let s=[];return this[0]&&(s=[...this[0].classList].filter(o=>o.match(t))),s},css:function(t){return h(this,()=>(this.for(s=>{if(n.is.element(s))for(let[o,l]of Object.entries(t)){if(n.is.number(l)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[o]=l+"px";continue}s.style[o]=String(l)}}),this))},getAttribute:function(t){return this[0].getAttribute(String(t))},setAttribute:function(t,s){return h(this,()=>(this.for(o=>o.setAttribute(t,s)),this))},getStyleProperty:function(t){let s=this[0];return s&&n.is.element(s)?getComputedStyle(s).getPropertyValue(t):""},setStyleProperty:function(t,s){let o=this[0];return o&&n.is.element(o)&&o.style.setProperty(t,s),this},val:function(){var s;let t=this[0];return(t==null?void 0:t.value)||((s=t==null?void 0:t.dataset)==null?void 0:s.value)},position:function(){return n.is.element(this[0])?this[0].getBoundingClientRect():{}}})}n.flatArray=(e,i)=>{if(!n.is.array(e))return[e];let r=[];for(let a of e)r.push(...i=="-R"?n.flatArray(a,"-R"):[a]);return r},n.uniqueArray=(e,i)=>i?Array.from(new Map(e.map(r=>[n.getKeyValue(r,i||"0"),r])).values()):Array.from(new Set(e)),n.getKeyValue=(e,i)=>{let r={},a=e;return i.split(".").forEach(t=>{a=a==null?void 0:a[t],r=a}),r},n.Stringify=(...e)=>{let[i,r,a]=e;return JSON.stringify(i,r!=null?r:(()=>{const t=new WeakSet;return(s,o)=>{if(typeof o=="object"&&o!==null){if(t.has(o))return"[Circular Reference]";t.add(o)}return o}})(),a)},n.Objectify=(e,i)=>{try{return JSON.parse(e)}catch(r){return i!=null?i:null}},n.SortifyObject=(e,i)=>{let r={};return!e||!n.is.array(e)&&!n.is.keyValueDictionary(e)?null:(Object.keys(e).sort().forEach(a=>{let t=e[a];if(i){if(n.is.keyValueDictionary(t)){r[a]=n.SortifyObject(t,i);return}if(n.is.array(t)){r[a]=t.map(s=>n.is.keyValueDictionary(s)||n.is.array(s)?n.SortifyObject(s,i):s);return}}r[a]=t}),r)},n.randomNumber=(e=0,i=100,r)=>{if(e>i)return NaN;let a=Math.round(Math.random()*(i-e))+e;return r&&r.length&&r.includes(a)?n.randomNumber(e,i,r):a},n.try=e=>{try{return[e(),!0]}catch(i){return[i,!1]}},n.trySync=e=>b(void 0,null,function*(){try{return[yield e(),!0]}catch(i){return[i,!1]}}),n.scope=e=>e(),n.scopeSync=e=>b(void 0,null,function*(){return yield e()}),n.createElement=function(e){var y;let{tag:i,className:r="",id:a,html:t,attr:s,style:o,parent:l}=e,u=document.createElement(i||"div");if(r&&u.classList.add(...r.split(" ")),a&&(u.id=a),s)for(let g of Object.entries(s)){let f=g[0],d=(y=g[1])!=null?y:"";if(f=="data"&&n.is.keyValueDictionary(d))for(let[C,J]of Object.entries(d))u.dataset[C]=J;else f=="for"?f="htmlFor":f=="tabindex"?f="tabIndex":f=="aria-label"&&(f="ariaLabel"),u[f]=d}if(t&&n(u).append(t),o)for(var[c,m]of Object.entries(o))u.style[c]=m;return l&&n(l).append(u),u},n.setCookie=e=>{let{hostname:i}=new URL(location.toString()),{name:r,value:a="",age:t=60*60*24*365,path:s="/",domain:o=i,secure:l=!1}=e,u=`${r}=${a}max-age=${t}path=${s}domain=${o}`;l&&(u+=" Secure"),document.cookie=u},n.getCookie=e=>{let i=document.cookie.match(new RegExp(e+"=[^]*"));return i?i[0].replace(new RegExp(e+"="),""):""},n.localStorage={set:(e,i)=>{localStorage.setItem(e,n.Stringify(i))},get:e=>{let i=localStorage.getItem(e);return n.Objectify(i,i)}},n.deleteCookie=e=>{document.cookie=e+"=max-age=0"},n.getScreenSize=()=>{let{innerHeight:e,innerWidth:i,scrollY:r,scrollX:a,pageXOffset:t,pageYOffset:s}=window,o=Number(n(document.body).getStyleProperty("--sat").removeLetters()),l=Number(n(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:i,pageHeight:e-o-l,scrollY:r,scrollX:a,pageXOffset:t,pageYOffset:s,safeAreaTop:o,safeAreaBottom:l}},n.getCursor=e=>{var a,t,s,o,l,u,c,m;let i=(o=e.pageX)!=null?o:(s=(a=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:a.pageX)!=null?s:(((t=e==null?void 0:e.originalEvent)==null?void 0:t.touches)||[])[0].pageX,r=(m=e.pageY)!=null?m:(c=(l=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:l.pageY)!=null?c:(((u=e==null?void 0:e.originalEvent)==null?void 0:u.touches)||[])[0].pageY;return{x:i,y:r}},n.pending=(e,i)=>{let r=i||Number(e)||0;return new Promise((a,t)=>{n.is.function(e)&&e(a),r&&setTimeout(()=>{a(!0)},r)})},n.deepMerge=(e,...i)=>{if(!i.length)return e;const r=i.shift();if(n.is.keyValueDictionary(e)&&n.is.keyValueDictionary(r))for(const a in r)n.is.keyValueDictionary(r[a])?(e[a]||Object.assign(e,{[a]:{}}),n.deepMerge(e[a],r[a])):Object.assign(e,{[a]:r[a]});return n.deepMerge(e,...i)},n.deepCopy=e=>{if(n.is.array(e))return e.map(i=>n.deepCopy(i));if(n.is.keyValueDictionary(e)){let i={};return Object.entries(e).forEach(([r,a])=>{i[r]=n.deepCopy(a)}),i}return e},n.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,i)=>{const r=new URL(i||location.href);if(n.is.string(e))r.pathname=e;else{let a=n.url.path.get();Object.entries(e).forEach(([t,s])=>{a[Number(t)]=s}),r.pathname="/"+a.filter(t=>t!=null).join("/")}return i||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((a,t)=>r[t]=a),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([a,t])=>{r.searchParams.set(a,String(t))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(a=>{r.searchParams.delete(a)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}}},n.queryParams={get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((a,t)=>r[t]=a),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([a,t])=>{r.searchParams.set(a,String(t))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(a=>{r.searchParams.delete(a)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}},n.ellipsisText=(e,i)=>{let r=String(e);return r.length>i&&(r=r.slice(0,i)+" ..."),r},n.is={equal:function(e,i,r){return r==null||r?n.Stringify(e)===n.Stringify(i):e===i},what:function(e){let i="other";return this.jmini(e)?i="jmini":this.element(e)?i="element":this.elements(e)?i="elements":this.shadowRoot(e)?i="shadowRoot":this.string(e)?i="string":this.number(e)?i="number":this.array(e)?i="array":this.function(e)?i="function":this.date(e)?i="date":typeof e=="undefined"?i="undefined":this.keyValueDictionary(e)?i="keyValueDictionary":e==null?i="null":isNaN(e)&&(i="NaN"),i},exist:function(e){return e===(e!=null?e:!e)},nullish:function(e){return!this.exist(e)},jmini:function(e){var i,r;return((i=e||{})==null?void 0:i.constructor)===n||((r=e||{})==null?void 0:r.__classAlias)===n.__classAlias},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 i={}.toString.call(e);return Array.isArray(e)||e instanceof Array||i=="[object NodeList]"||i=="[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 i={}.toString.call(e),r=Number(!!e&&typeof e!="string"&&this.array(e)&&i!=="[object Text]");if(r&&i!=="[object NodeList]")for(var a of e)r&=Number(this.element(a));return!!r},shadowRoot:function(e){return e instanceof ShadowRoot},date:function(e){return this.number(new Date(e).getTime())},inRange:function(e,i,r,a=!0){return a?i<=e&&e<=r:i<e&&e<r},oneOf:function(e,...i){return i==null?void 0:i.includes(e)}};export{n as Jmini,n as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmini",
3
- "version": "0.0.105",
3
+ "version": "0.0.106",
4
4
  "description": "minified JavaScript Framework",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",