mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-11 08:31:30 -04:00
6 lines
100 KiB
JavaScript
6 lines
100 KiB
JavaScript
![]() |
function $r(e,t){const n=Object.create(null),r=e.split(",");for(let s=0;s<r.length;s++)n[r[s]]=!0;return t?s=>!!n[s.toLowerCase()]:s=>!!n[s]}const se={},Tt=[],Ne=()=>{},Gi=()=>!1,el=/^on[^a-z]/,un=e=>el.test(e),Nr=e=>e.startsWith("onUpdate:"),le=Object.assign,Rr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},tl=Object.prototype.hasOwnProperty,Q=(e,t)=>tl.call(e,t),D=Array.isArray,St=e=>fn(e)==="[object Map]",wt=e=>fn(e)==="[object Set]",ps=e=>fn(e)==="[object Date]",W=e=>typeof e=="function",oe=e=>typeof e=="string",en=e=>typeof e=="symbol",G=e=>e!==null&&typeof e=="object",Co=e=>G(e)&&W(e.then)&&W(e.catch),xo=Object.prototype.toString,fn=e=>xo.call(e),nl=e=>fn(e).slice(8,-1),Eo=e=>fn(e)==="[object Object]",kr=e=>oe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Jt=$r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},rl=/-(\w)/g,De=Vn(e=>e.replace(rl,(t,n)=>n?n.toUpperCase():"")),sl=/\B([A-Z])/g,Ct=Vn(e=>e.replace(sl,"-$1").toLowerCase()),Kn=Vn(e=>e.charAt(0).toUpperCase()+e.slice(1)),lr=Vn(e=>e?`on${Kn(e)}`:""),tn=(e,t)=>!Object.is(e,t),Sn=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},In=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Mn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ol=e=>{const t=oe(e)?Number(e):NaN;return isNaN(t)?e:t};let hs;const _r=()=>hs||(hs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Wn(e){if(D(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=oe(r)?al(r):Wn(r);if(s)for(const o in s)t[o]=s[o]}return t}else{if(oe(e))return e;if(G(e))return e}}const il=/;(?![^(]*\))/g,ll=/:([^]+)/,cl=/\/\*[^]*?\*\//g;function al(e){const t={};return e.replace(cl,"").split(il).forEach(n=>{if(n){const r=n.split(ll);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function dn(e){let t="";if(oe(e))t=e;else if(D(e))for(let n=0;n<e.length;n++){const r=dn(e[n]);r&&(t+=r+" ")}else if(G(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function pf(e){if(!e)return null;let{class:t,style:n}=e;return t&&!oe(t)&&(e.class=dn(t)),n&&(e.style=Wn(n)),e}const ul="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",fl=$r(ul);function Oo(e){return!!e||e===""}function dl(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=rt(e[r],t[r]);return n}function rt(e,t){if(e===t)return!0;let n=ps(e),r=ps(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=en(e),r=en(t),n||r)return e===t;if(n=D(e),r=D(t),n||r)return n&&r?dl(e,t):!1;if(n=G(e),r=G(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const l=e.hasOwnProperty(i),c=t.hasOwnProperty(i);if(l&&!c||!l&&c||!rt(e[i],t[i]))return!1}}return String(e)===String(t)}function zn(e,t){return e.findIndex(n=>rt(n,t))}const hf=e=>oe(e)?e:e==null?"":D(e)||G(e)&&(e.toString===xo||!W(e.toString))?JSON.stringify(e,Po,2):String(e),Po=(e,t)=>t&&t.__v_isRef?Po(e,t.value):St(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s])=>(n[`${r} =>`]=s,n),{})}:wt(t)?{[`Set(${t.size})`]:[...t.values()]}:G(t)&&!D(t)&&!Eo(t)?String(t):t;let Ce;class To{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Ce,!t&&Ce&&(this.index=(Ce.scopes||(Ce.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=Ce;try{return Ce=this,t()}finally{Ce=n}}}on(){Ce=this}off(){Ce=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.scopes)for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0,this._active=!1}}}function So(e){return new To(e)}function pl(e,t=Ce){t&&t.active&&t.effects.push(e)}function Lr(){r
|
||
|
* pinia v2.0.34
|
||
|
* (c) 2023 Eduardo San Martin Morote
|
||
|
* @license MIT
|
||
|
*/let zi;const sr=e=>zi=e,qi=Symbol();function Ir(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Gt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Gt||(Gt={}));function Yf(){const e=So(!0),t=e.run(()=>Y({}));let n=[],r=[];const s=Nt({install(o){sr(s),s._a=o,o.provide(qi,s),o.config.globalProperties.$pinia=s,r.forEach(i=>n.push(i)),r=[]},use(o){return!this._a&&!ef?r.push(o):n.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return s}const Ji=()=>{};function bo(e,t,n,r=Ji){e.push(t);const s=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),r())};return!n&&Lr()&&Ao(s),s}function Pt(e,...t){e.slice().forEach(n=>{n(...t)})}function Mr(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,r)=>e.set(r,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],s=e[n];Ir(s)&&Ir(r)&&e.hasOwnProperty(n)&&!ee(r)&&!Ke(r)?e[n]=Mr(s,r):e[n]=r}return e}const tf=Symbol();function nf(e){return!Ir(e)||!e.hasOwnProperty(tf)}const{assign:Ge}=Object;function rf(e){return!!(ee(e)&&e.effect)}function sf(e,t,n,r){const{state:s,actions:o,getters:i}=t,l=n.state.value[e];let c;function a(){l||(n.state.value[e]=s?s():{});const f=Vo(n.state.value[e]);return Ge(f,o,Object.keys(i||{}).reduce((h,p)=>(h[p]=Nt(ue(()=>{sr(n);const m=n._s.get(e);return i[p].call(m,m)})),h),{}))}return c=Yi(e,a,t,n,r,!0),c}function Yi(e,t,n={},r,s,o){let i;const l=Ge({actions:{}},n),c={deep:!0};let a,f,h=Nt([]),p=Nt([]),m;const b=r.state.value[e];!o&&!b&&(r.state.value[e]={}),Y({});let _;function S(I){let g;a=f=!1,typeof I=="function"?(I(r.state.value[e]),g={type:Gt.patchFunction,storeId:e,events:m}):(Mr(r.state.value[e],I),g={type:Gt.patchObject,payload:I,storeId:e,events:m});const M=_=Symbol();Yn().then(()=>{_===M&&(a=!0)}),f=!0,Pt(h,g,r.state.value[e])}const y=o?function(){const{state:g}=n,M=g?g():{};this.$patch(R=>{Ge(R,M)})}:Ji;function C(){i.stop(),h=[],p=[],r._s.delete(e)}function F(I,g){return function(){sr(r);const M=Array.from(arguments),R=[],K=[];function k(te){R.push(te)}function z(te){K.push(te)}Pt(p,{args:M,name:I,store:N,after:k,onError:z});let L;try{L=g.apply(this&&this.$id===e?this:N,M)}catch(te){throw Pt(K,te),te}return L instanceof Promise?L.then(te=>(Pt(R,te),te)).catch(te=>(Pt(K,te),Promise.reject(te))):(Pt(R,L),L)}}const O={_p:r,$id:e,$onAction:bo.bind(null,p),$patch:S,$reset:y,$subscribe(I,g={}){const M=bo(h,I,g.detached,()=>R()),R=i.run(()=>ae(()=>r.state.value[e],K=>{(g.flush==="sync"?f:a)&&I({storeId:e,type:Gt.direct,events:m},K)},Ge({},c,g)));return M},$dispose:C},N=Mt(O);r._s.set(e,N);const B=r._e.run(()=>(i=So(),i.run(()=>t())));for(const I in B){const g=B[I];if(ee(g)&&!rf(g)||Ke(g))o||(b&&nf(g)&&(ee(g)?g.value=b[I]:Mr(g,b[I])),r.state.value[e][I]=g);else if(typeof g=="function"){const M=F(I,g);B[I]=M,l.actions[I]=g}}return Ge(N,B),Ge(J(N),B),Object.defineProperty(N,"$state",{get:()=>r.state.value[e],set:I=>{S(g=>{Ge(g,I)})}}),r._p.forEach(I=>{Ge(N,i.run(()=>I({store:N,app:r._a,pinia:r,options:l})))}),b&&o&&n.hydrate&&n.hydrate(N.$state,b),a=!0,f=!0,N}function of(e,t,n){let r,s;const o=typeof t=="function";typeof e=="string"?(r=e,s=o?n:t):(s=e,r=e.id);function i(l,c){const a=at();return l=l||a&&Qt(qi,null),l&&sr(l),l=zi,l._s.has(r)||(o?Yi(r,t,s,l):sf(r,s,l)),l._s.get(r)}return i.$id=r,i}function Qf(e){{e=J(e);const t={};for(const n in e){const r=e[n];(ee(r)||Ke(r))&&(t[n]=Ko(e,n))}return t}}const lf=of("style",{state:()=>{const e=Du(),t=Za(e),n=ls("(max-width: 700px)"),r=Wi("isMenuCollapsed",n.value);return ae(n,s=>r.value=s),{isDarkTheme:e,toggleDark:t,isMenuCollapsed:r,isSmallScreen:n}}});function Qi(e){return{themes:e,useTheme(){const t=lf();return ue(()=>e[t.isDarkTheme?"dark":"light"])}}}const{themes:cf,useTheme:af}=Qi({light:{background:"#ffffff",text:{baseColor:"#333639",mutedColor:"#767c82"},default:{color:"rgba(46, 51, 56, 0.05)",colorHover:"rgba(46, 51, 56, 0.09)",colorPressed:"rgba(46, 51, 56, 0.22)"},primary:{color:"#18a058",colorHover:"#1ea54c",col
|