@randajan/jet-core
Advanced tools
Comparing version 2.1.2 to 2.1.4
@@ -1,3 +0,3 @@ | ||
var ye=Object.defineProperty;var be=(e,t)=>{for(var r in t)ye(e,r,{get:t[r],enumerable:!0})};var E=class extends Function{static extend(t,r={}){for(let o in r)Object.defineProperty(t,o,{value:r[o],enumerable:!0});return t}constructor(t,r={}){super();return E.extend(Object.setPrototypeOf(t?t.bind():this,new.target.prototype),r)}},B=E;var K={},I=new Map,Q={},X=(e,t)=>`jet${t?` type '${t}'`:""} ${e}`,y=(e,t)=>{throw X(e,t)},V=(e,t)=>{console.warn(X(e,t))},v=e=>K[e],ee=e=>{let t=I.get(e);return t?t[0]:void 0},te=(e,t=!1,r=!1)=>{let o=t?[]:void 0;if(e==null)return o;let n=I.get(e.constructor);if(!n)return o;for(let s of n){if(s.is&&!s.is(e))continue;let i=r?s:s.name;if(o)o.push(i);else return i}return o},b=(e,t=!1)=>te(e,t,!0),$=(e,t=!1)=>te(e,t,!1),re=e=>{K[e.name]=e,Object.defineProperty(Q,e.name,{enumerable:!0,value:e.constructor});let t=I.get(e.constructor);t?t.unshift(e):I.set(e.constructor,[e])},d=new B($,{types:Q});var q=["only","full","tap","pull","is","to","copy","rnd"],je=e=>{let t=typeof e;return e!=null&&(t==="function"||t==="object")},_e=(e,t)=>t instanceof e,R=(e,t,r=!1)=>{if(!e)return!1;let o=v(e);if(o)return t==null||t.constructor!==o.constructor?!1:r||e===$(t);let n=typeof e;return n==="string"?typeof t===e:t==null||n!=="function"&&n!=="object"?!1:r?t instanceof e:t.constructor===e},k=(e,t)=>{if(!t)return e===!1||e===0||!!e;for(let r of t(e))if(r!=null)return!0;return!1},C=(e,t,r,...o)=>{let n=v(e);if(!n){r&&y(`unable execute '${t}' - type unknown`,e);return}if(!n[t]){r&&y(`undefined operation '${t}' - unavailable for this type`,e);return}return n[t](...o)},P=(e,t,r,...o)=>{let n=$(e);if(!n){r&&y(`unable execute '${t}' - missing type of '${e}'`);return}return C(n,t,r,e,...o)},N=(e,t,...r)=>{let o=v(e),n=je(e);n&&t>0&&y(`unable execute '${q[t]}' - unavailable for plain constructors`),e&&!n&&!o&&y(`unable execute '${q[t]}' - type unknown`,e),!e&&t!==1&&y(`unable execute '${q[t]}' - type missing`);for(let s of r)if(n){if(_e(e,s))return s}else{let i=b(s);if((!e||i&&i.name===e)&&(t!==1||i&&i.full(s)||!i&&k(s)))return t===3?i.copy(s):s}if(t>1)return o.create()},D=(e,t,...r)=>{let o=v(e);o||y("unable execute 'to' - type unknown",e);let n=b(t);if(!n)return o.create();if(o.name===n.name)return t;let s=n.to[e]||n.to["*"];return s?D(e,s(t,...r),...r):o.create(t)},L=(e,t,r)=>{let o=typeof t,n=v(e);n||y("unable define 'to' - type unknown",e);let s=n.to;if(o==="function")s["*"]=t;else if(o==="object"&&Array.isArray(t))for(let i in t)s[t[i]]=r;else if(o==="object")for(let i in t)s[i]=t[i];else s[t]=r},T=(e,t,r,o)=>{if(!e)return;e=Array.from(e);let n=e.length;return e[Math.floor(Number.jet.rnd(Number.jet.frame(t||0,0,n),Number.jet.frame(r||n,0,n),o))]};var z=!0,Ne=(e,t,r={})=>{let{create:o,is:n,full:s,copy:i,rnd:l,keys:f,vals:a,entries:p,get:x,set:h,rem:w,to:me,plugins:U,extend:Y,extendPrototype:he,extendConstructor:ge}=r;v(e)&&y("is allready defined",e),t||y("constructor missing",e),(f||a||p)&&!(f&&a&&p)&&y("keys, vals or entries missing",e);let G=t.prototype;o=o||((...c)=>new t(...c)),i=i||(c=>c);let S=Y!==!1&&ge!==!1,j=Y!==!1&&he!==!1;if(S||j){let c=ee(t);c?(V(`constructor allready extended as '${c}'. Use option 'extend=false'`,e),S=null,j=null):(S&&Object.defineProperty(t,"jet",{value:S={}}),j&&(j={},Object.defineProperty(G,"jet",{get:function(){return{__:this,...j}}})))}let g=(c,m,_)=>{let O=c?(A,...xe)=>R(e,A)?_(A,...xe):void 0:_;c&&j&&Object.defineProperty(j,m,{enumerable:z,value:function(...A){return _(this.__,...A)}}),S&&Object.defineProperty(S,m,{enumerable:z,value:O}),Object.defineProperty(d[m],e,{enumerable:z,value:O})};if(g(!1,"create",o),g(!1,"is",(c,m=!1)=>R(e,c,m)),g(!1,"to",(c,...m)=>D(e,c,...m)),g(!1,"only",(...c)=>N(e,0,...c)),g(!1,"full",(...c)=>N(e,1,...c)),g(!1,"tap",(...c)=>N(e,2,...c)),g(!1,"pull",(...c)=>N(e,3,...c)),g(!1,"rnd",l=l||o),g(!0,"isFull",s=s||(c=>k(c,a))),p&&(g(!0,"keys",f),g(!0,"vals",a),g(!0,"entries",p),g(!0,"get",x=x||((c,m)=>c[m])),g(!0,"set",h=h||((c,m,_)=>c[m]=_)),g(!0,"rem",w=w||((c,m)=>delete c[m])),g(!0,"getRND",(c,m,_,O)=>T(a(c),m,_,O))),re({name:e,constructor:t,prototype:G,is:n,create:o,full:s,copy:i,rnd:l,keys:f,vals:a,entries:p,get:x,set:h,rem:w,to:{}}),L(e,me),(S||j)&&U)for(let c in U){let m=U[c],_=d.isRunnable(m);S&&Object.defineProperty(S,c,{enumerable:z,value:_?(O,...A)=>m(D(e,O),...A):m}),_&&j&&Object.defineProperty(j,c,{enumerable:z,value:function(...O){return m(this.__,...O)}})}return t},ne=Ne;var W={};be(W,{assign:()=>Oe,clone:()=>Pe,deflate:()=>ce,dig:()=>fe,digIn:()=>J,digOut:()=>we,forEach:()=>M,inflate:()=>Se,json:()=>Me,map:()=>le,melt:()=>pe,merge:()=>ve,prop:()=>de,reducer:()=>ue});var se=(e,t,r,o,n,s)=>{let i=b(e);if(!i||!i.entries)return s||e;let l=s||i.create();for(let[f,a]of i.entries(e)){let p=(n?n+".":"")+f,x=r&&d.isMapable(a);x?o?a=r(a,p,n,f):a=se(a,t,r,o,p,s):a=t(a,p,n,f),a!==void 0&&(s?x||s.push(a):i.set(l,f,a))}return l},ie=(e,t,r,o,n)=>se(e,Function.jet.tap(t),r,d.isRunnable(r),String.jet.to(o,"."),n),M=(e,t,r,o)=>ie(e,t,r,o,[]),le=(e,t,r,o)=>ie(e,t,r,o),ue=e=>{let t=0,r;return r=(...o)=>e(r,t++,...o)},fe=(e,t,r)=>{let o=String.jet.to(t,".").split("."),n=o.length-1;return ue((s,i,l)=>{let f=o.slice(0,i).join(".");return r(s,l,(f?f+".":"")+o[i],f,o[i],i===n)})(e)},we=(e,t,r)=>{let o=String.jet.to(t,".").split(".");for(let n of o)if((e=d.get(e,n,!1))==null)return r;return e},J=(e,t,r,o=!0,n=void 0)=>{let s=(i,l,f,a,p,x)=>{let h=b(l);if(!h||!h.entries){if(!o)return l;l=String.jet.isNumeric(p)?[]:{},h=b(l)}let w=x?r:i(h.get(l,p,!1));if(w!=null)return h.set(l,p,w,!1),l;if(h.rem(l,p),h.full(l))return l};return fe(e,t,d.isRunnable(n)?(i,l,f,a,p,x)=>n(h=>s(i,h,f,a,p,x),l,f,a,p,x):s)},ce=(e,t=!1)=>{let r={},o=(s,i)=>{r[i]=s},n=(s,i)=>{o(s,i),M(s,o,n,i)};return M(e,o,t?n:!0),r},Se=(e,t=!0)=>{let r={};for(let o of d.keys(e).sort())!t&&d.isMapable(e[o])||J(r,"to."+o,e[o],!0);return r.to},ae=(e,t,...r)=>{let o={to:t},n=ce(o.to,!0),s=(l,f)=>{o.to=J(o.to,f,l)},i=(l,f)=>{n[f]||s(n[f]=b(l).create(),f),Array.isArray(l)&&Array.isArray(n[f])?n[f].push(...l):M(l,s,i,f)};for(let l of r)M(l,s,!!e||i);return o.to},Oe=(e,t,r=!0)=>ae(r,e,t),ve=(...e)=>ae(!1,{},...e),Pe=(e,t)=>le(e,r=>r,t),pe=(e,t)=>{let r="",o=String.jet.to(t);return d.isMapable(e)?(M(e,n=>{n=pe(n,o),r+=n?(r?o:"")+n:""}),r):String.jet.to(e,o)},de={add:(e,t,r,o=!1,n=!1,s=!0)=>(d.isMapable(t)?M(t,(i,l)=>{let f=String.jet.isNumeric(l);de.add(e,f?i:l,f?r:i,o,n,s)}):(!e[t]||s)&&Object.defineProperty(e,t,{value:r,writable:o,configurable:o,enumerable:n}),e),get:(e,t)=>{if(t||(t=Array.from(Object.getOwnPropertyNames(e))),!d.isMapable(t))return e[t];let r={};return M(t,o=>r[o]=e[o]),r}},Me={from:(e,t=!1)=>{if(d.isMapable(e))return e;try{return JSON.parse(String.jet.to(e))}catch(r){if(t===!0)throw r}},to:(e,t=!1)=>{let r=Number.jet.only(t===!0?2:t);return JSON.stringify(d.isMapable(e)?e:{},null,r)}};B.extend(d,{is:R,to:D,isFull:e=>{let t=b(e);return t?t.full(e):k(e)},isMapable:e=>{let t=b(e);return t?!!t.entries:!1},isRunnable:e=>typeof e=="function",full:(...e)=>N(null,1,...e),only:(e,...t)=>N(e,0,...t),tap:(e,...t)=>N(e,2,...t),pull:(e,...t)=>N(e,3,...t),create:(e,...t)=>C(e,"create",!0,...t),rnd:(e,...t)=>C(e,"rnd",!0,...t),copy:e=>P(e,"copy"),keys:(e,t=!1)=>P(e,"keys",t)||[],vals:(e,t=!1)=>P(e,"vals",t)||[],entries:(e,t=!1)=>P(e,"entries",t)||[],get:(e,t,r=!1)=>P(e,"get",r,t),set:(e,t,r,o=!1)=>P(e,"set",o,t,r),rem:(e,t,r=!0)=>P(e,"rem",r,t),getRND:(e,t,r,o)=>{let n=b(e);if(n.vals)e=n.vals(e);else if(typeof e!="string")return;return T(e,t,r,o)},run:(e,...t)=>d.isRunnable(e)?[e(...t)]:d.map(e,r=>d.run(r,...t)),...W,define:new B(ne,{to:L})});d.define("Plex",B,{copy:e=>Object.defineProperties({},Object.getOwnPropertyDescriptors(e)),keys:e=>Object.keys(e),vals:e=>Object.values(e),entries:e=>Object.entries(e)});var u=d;var Fe=u.define("Object",Object,{create:Object,copy:e=>Object.defineProperties({},Object.getOwnPropertyDescriptors(e)),keys:e=>Object.keys(e),vals:e=>Object.values(e),entries:e=>Object.entries(e),extendPrototype:!1,to:{Function:e=>t=>e,Symbol:e=>Symbol(u.json.to(e)),Boolean:e=>u.isFull.Object(e),Number:e=>Object.values(e),Array:e=>Object.values(e),String:e=>u.json.to(e),Promise:async e=>e,Error:e=>u.json.to(e),RegExp:(e,t)=>u.melt(e,t??"|")}});var Ae=u.define("Boolean",Boolean,{create:Boolean,rnd:e=>Math.random()<(e||.5)});var Be=u.define("Number",Number,{create:Number,rnd:(e,t,r)=>{let o=Math.random();return r?o=Math.pow(o,2):r===!1&&(o=Math.sqrt(o)),o.jet.fromRatio(e||0,t||e*2||1)},to:{Function:e=>t=>e,Boolean:e=>!!e,Array:(e,t)=>t?[e]:Array(e),Promise:async e=>e,String:e=>String(e)},plugins:{x:(e,t,r)=>{let o=t,n=Number.jet.zoomIn(e,r),[s,i]=n;return o==="/"?s/i:o==="*"?s*i/Math.pow(n.zoom,2):(o==="+"?s+i:o==="-"?s-i:o==="%"?s%i:NaN)/n.zoom},frame:(e,t,r)=>(e=r==null?e:Math.min(e,r),t==null?e:Math.max(e,t)),round:(e,t,r)=>{let o=Math.pow(10,t||0);return Math[r==null?"round":r?"ceil":"floor"](e*o)/o},len:(e,t)=>{let r=t,o=String.jet.to(e),n=o.length,s=o.indexOf("."),i=s>=0;return r===!1?i?n-s-1:0:!i||!r?n:s},period:(e,t,r)=>{let o=r-t;return(o+(e-t)%o)%o+t},toRatio:(e,t,r)=>{let o=r-t;return o?(e-t)/o:0},fromRatio:(e,t,r)=>{let o=r-t;return e*o+t},zoomIn:(...e)=>{let t=Math.pow(10,Math.max(...e.map(r=>Number.jet.len(r,!1))));return u.prop.add(e.map(r=>Math.round(r*t)),"zoom",t)},zoomOut:(...e)=>e.map(t=>t/e.zoom),diffusion:(e,t,r,o)=>{let n=e*o;return Number.jet.rnd(Math.max(t,e-n),Math.min(r,e+n))},snap:(e,t,r,o,n,s=!0)=>{var i=e,l=t,f=r,a=o,p=f!=null,x=a!=null,h=n;if(i==null||l==null||l<=0||!(p||x))return i;s&&(i=Number.jet.frame(i,f,a));var w=p?i-f:a-i;return i=w%l?(p?f:a)+Number.jet.round(w/l,0,h==null?null:h===p)*l*(p*2-1):i,s?Number.jet.frame(i,f,a):i},whatpow:(e,t)=>Math.log(e)/Math.log(Number.jet.to(t)),toHex:e=>{var t=Math.round(e).toString(16);return t.length===1?"0"+t:t},toLetter:(e,t)=>{t=String.jet.to(t)||"ABCDEFGHIJKLMNOPQRSTUVWXYZ";let r=t.length;return(e>=r?Number.jet.toLetter(Math.floor(e/r)-1):"")+t[e%r]}}});var De={point:"\u2022",cross:"\xD7",flake:"\u2600",draft:"\u232D",power:"\u26A1",star:"\u2605",skull:"\u2620",card:"\u2660\u2665\u2666\u2663",notes:"\u2669\u266A\u266B\u266C\u266D\u266E\u266F",chess:"\u2654\u2655\u2656\u2657\u2658\u2659\u265A\u265B\u265C\u265D\u265E\u265F",block:"\u2596\u2597\u2598\u2599\u259A\u259B\u259C\u259D\u259E\u259F",bar:"\u2502\u2551 \u258C\u2590\u2588",iting:"\u2630\u2631\u2632\u2633\u2634\u2635\u2636\u2637",astro:"\u2648\u2649\u264A\u264B\u264C\u264D\u264E\u264F\u2650\u2651\u2652\u2653",die:"\u2680\u2681\u2682\u2683\u2684\u2685",runic:"\u16A0\u16A1\u16A2\u16A3\u16A4\u16A5\u16A6\u16A7\u16A8\u16A9\u16AA\u16AB\u16AC\u16AD\u16AE\u16AF\u16B0\u16B1\u16B3\u16B4\u16B5\u16B6\u16B7\u16B8\u16B9\u16BA\u16BB\u16BC\u16BD\u16BE\u16BF\u16C0\u16C1\u16C2\u16C3\u16C4\u16C5\u16C6\u16C7\u16C8\u16C9\u16CA\u16CB\u16CF\u16D0\u16D1\u16D2\u16D3\u16D4\u16D5\u16D6\u16D7\u16D8\u16D9\u16DA\u16DB\u16DC\u16DD\u16DE\u16DF\u16E0\u16E1\u16E2\u16E3\u16E4\u16E5\u16E6\u16E8\u16E9\u16EA\u16EE\u16EF\u16F0",dots:"\u2800\u2801\u2802\u2803\u2804\u2805\u2806\u2807\u2808\u2809\u280A\u280B\u280C\u280D\u280E\u280F\u2810\u2811\u2812\u2813\u2814\u2815\u2816\u2817\u2818\u2819\u281A\u281B\u281C\u281D\u281E\u281F\u2820\u2821\u2822\u2823\u2824\u2825\u2826\u2827\u2828\u2829\u282A\u282B\u282C\u282D\u282E\u282F\u2830\u2831\u2832\u2833\u2834\u2835\u2836\u2837\u2838\u2839\u283A\u283B\u283C\u283D\u283E\u283F\u2840\u2841\u2842\u2843\u2844\u2845\u2846\u2847\u2848\u2849\u284A\u284B\u284C\u284D\u284E\u284F\u2850\u2851\u2852\u2853\u2854\u2855\u2856\u2857\u2858\u2859\u285A\u285B\u285C\u285D\u285E\u285F\u2860\u2861\u2862\u2863\u2864\u2865\u2866\u2867\u2868\u2869\u286A\u286B\u286C\u286D\u286E\u286F\u2870\u2871\u2872\u2873\u2874\u2875\u2876\u2877\u2878\u2879\u287A\u287B\u287C\u287D\u287E\u287F\u2880\u2881\u2882\u2883\u2884\u2885\u2886\u2887\u2888\u2889\u288A\u288B\u288C\u288D\u288E\u288F\u2890\u2891\u2892\u2893\u2894\u2895\u2896\u2897\u2898\u2899\u289A\u289B\u289C\u289D\u289E\u289F\u28A0\u28A1\u28A2\u28A3\u28A4\u28A5\u28A6\u28A7\u28A8\u28A9\u28AA\u28AB\u28AC\u28AD\u28AE\u28AF\u28B0\u28B1\u28B2\u28B3\u28B4\u28B5\u28B6\u28B7\u28B8\u28B9\u28BA\u28BB\u28BC\u28BD\u28BE\u28BF\u28C0\u28C1\u28C2\u28C3\u28C4\u28C5\u28C6\u28C7\u28C8\u28C9\u28CA\u28CB\u28CC\u28CD\u28CE\u28CF\u28D0\u28D1\u28D2\u28D3\u28D4\u28D5\u28D6\u28D7\u28D8\u28D9\u28DA\u28DB\u28DC\u28DD\u28DE\u28DF\u28E0\u28E1\u28E2\u28E3\u28E4\u28E5\u28E6\u28E7\u28E8\u28E9\u28EA\u28EB\u28EC\u28ED\u28EE\u28EF\u28F0\u28F1\u28F2\u28F3\u28F4\u28F5\u28F6\u28F7\u28F8\u28F9\u28FA\u28FB\u28FC\u28FD\u28FE\u28FF"},Re=u.define("String",String,{create:e=>e==null?"":String(e),rnd:(e,t,r)=>{let o=["bcdfghjklmnpqrstvwxz","aeiouy"],n=o[0].length/(o[0].length+o[1].length),s=Number.jet.rnd(Math.max(e,2),t,r),i=Boolean.jet.rnd(n),l="";for(;l.length<s;)l+=u.childRnd(o[+(i=!i)]);return l},to:{Function:e=>t=>e,Boolean:e=>!["0","false","null","undefined","NaN"].includes(e.toLowerCase()),Array:(e,t)=>e.split(t),Object:e=>u.json.from(e),Promise:async e=>e,Number:(e,t)=>{if(e){if(t)return Number(e)}else return 0;let r=String(e).replace(/\u00A0/g," ").match(RegExp.jet.lib.number);return!r||!r[0]?0:Number(r[0].replaceAll(" ","").replace(",","."))||0}},plugins:{isNumeric:e=>!isNaN(Number(e)),lower:e=>e.toLowerCase(),upper:e=>e.toUpperCase(),capitalize:e=>e.charAt(0).jet.upper()+e.slice(1),delone:e=>{let t="",r="aaccdeeillnooorstuuuyrzzAACCDEEILLNOOORSTUUUYRZZ",o="\xE1\xE4\u010D\u0107\u010F\xE9\u011B\xED\u013A\u013E\u0148\xF3\xF4\xF6\u0155\u0161\u0165\xFA\u016F\xFC\xFD\u0159\u017E\u017A\xC1\xC4\u010C\u0106\u010E\xC9\u011A\xCD\u0139\u013D\u0147\xD3\xD4\xD6\u0154\u0160\u0164\xDA\u016E\xDC\xDD\u0158\u017D\u0179";for(let n of e){let s=o.indexOf(n);t+=s>=0?r[s]:n}return t},efface:(e,t)=>e.replaceAll(t,"").replace(/[\s\n\r]+/g," ").trim(),simplify:(e,t)=>e.jet.efface(t).jet.delone().jet.lower(),sort:(...e)=>e.map(t=>{let r=String.jet.to(t),o=r.jet.delone();return{l:o.jet.lower(),d:o,s:r}}).sort((t,r)=>{for(let o=0;;o++)for(let n in t){let s=t[n].charCodeAt(o)||0,i=r[n].charCodeAt(o)||0;if(s!==i||!s)return s-i}}).map(t=>t.s),fight:(...e)=>String.jet.sort(...e)[0],carret:(e,t)=>Number.jet.tap(t,e.length).frame(0,e.length),splice:(e,t,r,...o)=>{let n=e.jet.carret(t),s=Number.jet.frame(r,0,e.length-n);return e.slice(0,n)+String.jet.to(o,"")+e.slice(n+s)},hide:(e,t,r)=>{if(!e)return e;for(var o="",n=e,s=De[t]||t||"\u2022",i=r===!1,l=0;l<e.length;l++)o+=i&&(n[l]===` | ||
`||n[l]===" ")?n[l]:s.length-1?u.childRnd(s):s;return o},levenshtein:(e,t,r)=>{var o=r===!1?[e,t]:[e.jet.simplify(r),String.jet.simplify(t,r)];if(o[0]===o[1])return 1;if(!o[0]||!o[1])return 0;var n=[o[0].length,o[1].length],s=[];n[1]>n[0]&&(n.reverse(),o.reverse());for(var i=0;i<=n[0];i++){for(var l=i,f=0;f<=n[1];f++)if(i===0)s[f]=f;else if(f>0){var a=s[f-1];o[0].charAt(i-1)!==o[1].charAt(f-1)&&(a=Math.min(Math.min(a,l),s[f])+1),s[f-1]=l,l=a}i>0&&(s[n[1]]=l)}return(n[0]-s[n[1]])/parseFloat(n[0])},mutate:(e,t)=>{for(var r=[],o=e.length/2,n=e.length*2,s=Math.abs(1e3*(t||1));r.length<s;){var i=String.jet.rnd(o,n);r.push([i,i.jet.levenshtein(e)])}return r.sort((l,f)=>f[1]-l[1])[0][0]}}});var ke=u.define("Symbol",Symbol,{create:Symbol,rnd:(...e)=>Symbol(u.rnd.String(...e)),to:e=>String(e).slice(7,-1)});var ze=u.define("Function",Function,{create:Function,copy:e=>Object.defineProperties({[e.name]:(...t)=>e(...t)}[e.name],Object.getOwnPropertyDescriptors(e)),to:{"*":(e,...t)=>e(...t),Promise:async(e,...t)=>await e(...t)}});var Ee=u.define("RegExp",RegExp,{create:RegExp,copy:e=>RegExp(e.source),extendPrototype:!1,plugins:{lib:{line:/[^\n\r]+/g,number:/-?[0-9]+(\s+[0-9]+)*([,.][0-9]+)?/,word:/[^\s\n\r]+/g,num:/-?[0-9]*[.,]?[0-9]+/,email:/(?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i,ip:/((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))/i,domain:/([a-z0-9]+\.)+(cz|de|sk|au|com|eu|info|org|[a-z]+)/i,hexadecimal:/[0-9a-fA-F]{6,6}/}},to:{String:e=>e.toString().slice(1,-1)}});var Ie=u.define("Date",Date,{create:e=>e?new Date(e):new Date,rnd:(e,t)=>new Date(Number.jet.rnd(new Date(e).getTime(),t?new Date(t).getTime():Date.now()*2))});var $e=u.define("NaN",Number,{create:e=>NaN,is:isNaN,primitives:["object"],extend:!1,to:e=>{}});var Ce=u.define("Error",Error,{create:Error,rnd:(...e)=>new Error(u.rnd.String(...e))});var Le=u.define("Promise",Promise,{create:e=>new Promise(u.only.Function(e,t=>t()))});var Te=u.define("Array",Array,{create:Array,copy:e=>Array.from(e),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries(),to:{Function:e=>t=>e,Boolean:e=>e.jet.isFull(),Number:e=>e.length,String:(e,t)=>u.melt(e,t),Object:e=>Object.assign({},e),Promise:async e=>e,Error:(e,t)=>u.melt(e,t??" "),RegExp:(e,t)=>u.melt(e,t??"|")},plugins:{swap:(e,t,r)=>(e[t]=e.splice(r,1,e[t])[0],e),shuffle:e=>{for(var t=e.length-1;t>0;t--)e.jet.swap(Math.floor(Math.random()*(t+1)),t);return e},clean:(e,t,r)=>(r=Function.jet.tap(r,o=>o??void 0),t!==!1?e.filter(r):u.map(e,r))}});var Ue=u.define("Set",Set,{keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries(),get:(e,t)=>e.has(t)?t:void 0,set:(e,t,r)=>e.add(r)?r:void 0,rem:(e,t)=>e.delete(t),to:{"*":e=>Array.from(e),Function:e=>t=>e,Boolean:e=>e.jet.isFull(),Object:e=>u.merge(e),Promise:async e=>e}});var qe=u.define("Map",Map,{copy:e=>new Map(e),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries(),get:(e,t)=>e.get(t),set:(e,t,r)=>e.set(t,r),rem:(e,t)=>e.delete(t)});var F=class extends Array{static pass(t,r,o,n=1){if(!Array.isArray(t))throw"Pool.pass 'from' require array";if(!Array.isArray(r))throw"Pool.pass 'to' require array";return r.push(...t.splice(o,n))>=0}has(t){return this.includes(t)}add(...t){return this.splice(-1,0,...t),this}remove(...t){for(let r of t){let o=this.indexOf(r);o>=0&&super.splice(o,1)}return this}push(...t){return this.splice(-1,0,...t),this}unshift(...t){return this.splice(0,0,...t),this}put(t,...r){return this.splice(t,0,...r),this}splice(t,r=1,...o){let n;if(r<0&&(r=0),t<0&&(t=Math.max(0,this.length+t+1-r)),o.length){let s=this.autoFilter._current,i=this.autoSort._current;o=o.flat(),s&&(o=o.filter(s)),t===this.length?super.push(...o):t===0?super.unshift(...o):n=super.splice(t,r,...o),i&&this.sort(i)}else r>0&&(n=super.splice(t,r));return n||new F}passTo(t,r,o=1){return F.pass(this,t,r,o)}passFrom(t,r,o=1){return F.pass(t,this,r,o)}flush(){return this.splice(0,this.length)}filter(t){for(let r=this.length-1;r>=0;r--)t(this[r],r,this)||super.splice(r,1);return this}map(t){let r=[];for(let o=this.length-1;o>=0;o--)r.push(t(this[o],o,this));return r}autoFilter(t){return u.isRunnable(t)?(this.autoFilter._current=t,this.filter(t)):delete this.autoFilter._current,this}autoSort(t){return u.isRunnable(t)?(this.autoSort._current=t,this.sort(t)):delete this.autoSort._current,this}},Z=u.define("Pool",F,{copy:e=>new F(...e).autoFilter(e.autoFilter._current).autoSort(e.autoSort._current),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries()});var H=class extends Z{constructor(...t){super(...t);this.autoFilter(Function.jet.is).with()}with(...t){return this.with._current=t,this}run(...t){let r=this.run,o=!r._current,n=r._current=[];for(let s of this)if(n.push(s(...this.with._current,...t)),n!==r._current)break;return n=r._current,o&&delete r._current,n}fit(...t){if(this.fit._current)throw"RunPool.fit maximum call stack size exceeded";this.fit._current=!0;let r=this.with._current,o=u.reducer((n,s,...i)=>this[s]?this[s](n,...r,...i):i[0])(...r,...t);return delete this.fit._current,o}},Je=u.define("RunPool",H,{copy:e=>new H(...e).autoFilter(e.autoFilter._current).autoSort(e.autoSort._current),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries()});var tr=u,rr=u.types.Plex;export{Te as Array,Ae as Boolean,Ie as Date,Ce as Error,ze as Function,qe as Map,$e as NaN,Be as Number,Fe as Object,rr as Plex,Z as Pool,Le as Promise,Ee as RegExp,Je as RunPool,Ue as Set,Re as String,ke as Symbol,tr as default}; | ||
var ye=Object.defineProperty;var be=(e,t)=>{for(var r in t)ye(e,r,{get:t[r],enumerable:!0})};var I=class extends Function{static extend(t,r={}){for(let o in r)Object.defineProperty(t,o,{value:r[o],enumerable:!0});return t}constructor(t,r={}){super();return I.extend(Object.setPrototypeOf(t?t.bind():this,new.target.prototype),r)}},B=I;var Q={},$=new Map,X={},V=(e,t)=>`jet${t?` type '${t}'`:""} ${e}`,b=(e,t)=>{throw V(e,t)},ee=(e,t)=>{console.warn(V(e,t))},v=e=>Q[e],te=e=>{let t=$.get(e);return t?t[0]:void 0},re=(e,t=!1,r=!1)=>{let o=t?[]:void 0;if(e==null)return o;let n=$.get(e.constructor);if(!n)return o;for(let s of n){if(s.is&&!s.is(e))continue;let i=r?s:s.name;if(o)o.push(i);else return i}return o},j=(e,t=!1)=>re(e,t,!0),C=(e,t=!1)=>re(e,t,!1),oe=e=>{Q[e.name]=e,Object.defineProperty(X,e.name,{enumerable:!0,value:e.constructor});let t=$.get(e.constructor);t?t.unshift(e):$.set(e.constructor,[e])},m=new B(C,{types:X});var J=["only","full","tap","pull","is","to","copy","rnd"],je=e=>{let t=typeof e;return e!=null&&(t==="function"||t==="object")},_e=(e,t)=>t instanceof e,R=(e,t,r=!1)=>{if(!e)return!1;let o=v(e);if(o)return t==null||t.constructor!==o.constructor?!1:r||e===C(t);let n=typeof e;return n==="string"?typeof t===e:t==null||n!=="function"&&n!=="object"?!1:r?t instanceof e:t.constructor===e},k=(e,t)=>{if(!t)return e===!1||e===0||!!e;for(let r of t(e))if(r!=null)return!0;return!1},L=(e,t,r,...o)=>{let n=v(e);if(!n){r&&b(`unable execute '${t}' - type unknown`,e);return}if(!n[t]){r&&b(`undefined operation '${t}' - unavailable for this type`,e);return}return n[t](...o)},P=(e,t,r,...o)=>{let n=C(e);if(!n){r&&b(`unable execute '${t}' - missing type of '${e}'`);return}return L(n,t,r,e,...o)},N=(e,t,...r)=>{let o=v(e),n=je(e);n&&t>0&&b(`unable execute '${J[t]}' - unavailable for plain constructors`),e&&!n&&!o&&b(`unable execute '${J[t]}' - type unknown`,e),!e&&t!==1&&b(`unable execute '${J[t]}' - type missing`);for(let s of r)if(n){if(_e(e,s))return s}else{let i=j(s);if((!e||i&&i.name===e)&&(t!==1||i&&i.full(s)||!i&&k(s)))return t===3?i.copy(s):s}if(t>1)return o.create()},D=(e,t,...r)=>{let o=v(e);o||b("unable execute 'to' - type unknown",e);let n=j(t);if(!n)return o.create();if(o.name===n.name)return t;let s=n.to[e]||n.to["*"];return s?D(e,s(t,...r),...r):o.create(t)},T=(e,t,r)=>{let o=typeof t,n=v(e);n||b("unable define 'to' - type unknown",e);let s=n.to;if(o==="function")s["*"]=t;else if(o==="object"&&Array.isArray(t))for(let i in t)s[t[i]]=r;else if(o==="object")for(let i in t)s[i]=t[i];else s[t]=r},U=(e,t,r,o)=>{if(!e)return;e=Array.from(e);let n=e.length;return e[Math.floor(Number.jet.rnd(Number.jet.frame(t||0,0,n),Number.jet.frame(r||n,0,n),o))]};var z=!0,we=(e,t,r={})=>{let{create:o,is:n,full:s,copy:i,rnd:u,keys:f,vals:p,entries:a,get:d,set:h,rem:y,to:E,plugins:q,extend:G,extendPrototype:he,extendConstructor:ge}=r;v(e)&&b("is allready defined",e),t||b("constructor missing",e),(f||p||a)&&!(f&&p&&a)&&b("keys, vals or entries missing",e);let K=t.prototype;o=o||((...c)=>new t(...c)),i=i||(c=>c);let S=G!==!1&&ge!==!1,_=G!==!1&&he!==!1;if(S||_){let c=te(t);c?(ee(`constructor allready extended as '${c}'. Use option 'extend=false'`,e),S=null,_=null):(S&&Object.defineProperty(t,"jet",{value:S={}}),_&&(_={},Object.defineProperty(K,"jet",{get:function(){return{__:this,..._}}})))}let x=(c,g,w)=>{let O=c?(F,...xe)=>R(e,F)?w(F,...xe):void 0:w;c&&_&&Object.defineProperty(_,g,{enumerable:z,value:function(...F){return w(this.__,...F)}}),S&&Object.defineProperty(S,g,{enumerable:z,value:O}),Object.defineProperty(m[g],e,{enumerable:z,value:O})};if(x(!1,"create",o),x(!1,"is",(c,g=!1)=>R(e,c,g)),x(!1,"to",(c,...g)=>D(e,c,...g)),x(!1,"only",(...c)=>N(e,0,...c)),x(!1,"full",(...c)=>N(e,1,...c)),x(!1,"tap",(...c)=>N(e,2,...c)),x(!1,"pull",(...c)=>N(e,3,...c)),x(!1,"rnd",u=u||o),x(!0,"isFull",s=s||(c=>k(c,p))),a&&(x(!0,"keys",f),x(!0,"vals",p),x(!0,"entries",a),x(!0,"get",d=d||((c,g)=>c[g])),x(!0,"set",h=h||((c,g,w)=>c[g]=w)),x(!0,"rem",y=y||((c,g)=>delete c[g])),x(!0,"getRND",(c,g,w,O)=>U(p(c),g,w,O))),oe({name:e,constructor:t,prototype:K,is:n,create:o,full:s,copy:i,rnd:u,keys:f,vals:p,entries:a,get:d,set:h,rem:y,to:{}}),T(e,E),(S||_)&&q)for(let c in q){let g=q[c],w=m.isRunnable(g);S&&Object.defineProperty(S,c,{enumerable:z,value:w?(O,...F)=>g(D(e,O),...F):g}),w&&_&&Object.defineProperty(_,c,{enumerable:z,value:function(...O){return g(this.__,...O)}})}return t},se=we;var Z={};be(Z,{assign:()=>ve,deflate:()=>ce,dig:()=>fe,digIn:()=>W,digOut:()=>Se,forEach:()=>M,inflate:()=>Oe,json:()=>Me,map:()=>Ne,melt:()=>pe,merge:()=>Pe,prop:()=>de,reducer:()=>le});var ie=({create:e,entries:t,set:r},o,n,s,i,u,f)=>{let p=f||e();for(let[a,d]of t(o)){let h=(u?u+".":"")+a,y=s||!n?j(d):null,E=s&&y&&y.entries;E?i?d=s(d,h,u,a):d=ie(y,d,n,s,i,h,f):d=n?n(d,h,u,a):y?y.copy(d):d,d!==void 0&&(f?E||f.push(d):r(p,a,d))}return p},ue=(e,t,r,o,n)=>{let s=j(e);if(s&&s.entries)return ie(s,e,t,r,m.isRunnable(r),String.jet.to(o,"."),n);let i=t?t(e,"","",""):s.copy?s.copy(e):e;return n&&i!==void 0&&n.push(i),n||i},M=(e,t,r=!1,o="")=>ue(e,t,r,o,[]),Ne=(e,t,r=!1,o="")=>ue(e,t,r,o),le=e=>{let t=0,r;return r=(...o)=>e(r,t++,...o)},fe=(e,t,r)=>{let o=String.jet.to(t,".").split("."),n=o.length-1;return le((s,i,u)=>{let f=o.slice(0,i).join(".");return r(s,u,(f?f+".":"")+o[i],f,o[i],i===n)})(e)},Se=(e,t,r)=>{let o=String.jet.to(t,".").split(".");for(let n of o)if((e=m.get(e,n,!1))==null)return r;return e},W=(e,t,r,o=!0,n=void 0)=>{let s=(i,u,f,p,a,d)=>{let h=j(u);if(!h||!h.entries){if(!o)return u;u=String.jet.isNumeric(a)?[]:{},h=j(u)}let y=d?r:i(h.get(u,a,!1));if(y!=null)return h.set(u,a,y,!1),u;if(h.rem(u,a),h.full(u))return u};return fe(e,t,m.isRunnable(n)?(i,u,f,p,a,d)=>n(h=>s(i,h,f,p,a,d),u,f,p,a,d):s)},ce=(e,t=!1)=>{let r={},o=(s,i)=>{r[i]=s},n=(s,i)=>{o(s,i),M(s,o,n,i)};return M(e,o,t?n:!0),r},Oe=(e,t=!0)=>{let r={};for(let o of m.keys(e).sort())!t&&m.isMapable(e[o])||W(r,"to."+o,e[o],!0);return r.to},ae=(e,t,...r)=>{let o={to:t},n=ce(o.to,!0),s=(u,f)=>{o.to=W(o.to,f,u)},i=(u,f)=>{n[f]||s(n[f]=j(u).create(),f),Array.isArray(u)&&Array.isArray(n[f])?n[f].push(...u):M(u,s,i,f)};for(let u of r)M(u,s,!!e||i);return o.to},ve=(e,t,r=!0)=>ae(r,e,t),Pe=(...e)=>ae(!1,{},...e),pe=(e,t)=>{let r="",o=String.jet.to(t);return m.isMapable(e)?(M(e,n=>{n=pe(n,o),r+=n?(r?o:"")+n:""}),r):String.jet.to(e,o)},de={add:(e,t,r,o=!1,n=!1,s=!0)=>(m.isMapable(t)?M(t,(i,u)=>{let f=String.jet.isNumeric(u);de.add(e,f?i:u,f?r:i,o,n,s)}):(!e[t]||s)&&Object.defineProperty(e,t,{value:r,writable:o,configurable:o,enumerable:n}),e),get:(e,t)=>{if(t||(t=Array.from(Object.getOwnPropertyNames(e))),!m.isMapable(t))return e[t];let r={};return M(t,o=>r[o]=e[o]),r}},Me={from:(e,t=!1)=>{if(m.isMapable(e))return e;try{return JSON.parse(String.jet.to(e))}catch(r){if(t===!0)throw r}},to:(e,t=!1)=>{let r=Number.jet.only(t===!0?2:t);return JSON.stringify(m.isMapable(e)?e:{},null,r)}};B.extend(m,{is:R,to:D,isFull:e=>{let t=j(e);return t?t.full(e):k(e)},isMapable:e=>{let t=j(e);return t?!!t.entries:!1},isRunnable:e=>typeof e=="function",full:(...e)=>N(null,1,...e),only:(e,...t)=>N(e,0,...t),tap:(e,...t)=>N(e,2,...t),pull:(e,...t)=>N(e,3,...t),create:(e,...t)=>L(e,"create",!0,...t),rnd:(e,...t)=>L(e,"rnd",!0,...t),copy:(e,t=!1)=>t?m.map(e,void 0,!0):P(e,"copy"),keys:(e,t=!1)=>P(e,"keys",t)||[],vals:(e,t=!1)=>P(e,"vals",t)||[],entries:(e,t=!1)=>P(e,"entries",t)||[],get:(e,t,r=!1)=>P(e,"get",r,t),set:(e,t,r,o=!1)=>P(e,"set",o,t,r),rem:(e,t,r=!0)=>P(e,"rem",r,t),getRND:(e,t,r,o)=>{let n=j(e);if(n.vals)e=n.vals(e);else if(typeof e!="string")return;return U(e,t,r,o)},run:(e,...t)=>m.isRunnable(e)?[e(...t)]:m.map(e,r=>m.run(r,...t)),...Z,define:new B(se,{to:T})});m.define("Plex",B,{copy:e=>Object.defineProperties({},Object.getOwnPropertyDescriptors(e)),keys:e=>Object.keys(e),vals:e=>Object.values(e),entries:e=>Object.entries(e)});var l=m;var Ae=l.define("Object",Object,{create:Object,copy:e=>Object.defineProperties({},Object.getOwnPropertyDescriptors(e)),keys:e=>Object.keys(e),vals:e=>Object.values(e),entries:e=>Object.entries(e),extendPrototype:!1,to:{Function:e=>t=>e,Symbol:e=>Symbol(l.json.to(e)),Boolean:e=>l.isFull.Object(e),Number:e=>Object.values(e),Array:e=>Object.values(e),String:e=>l.json.to(e),Promise:async e=>e,Error:e=>l.json.to(e),RegExp:(e,t)=>l.melt(e,t??"|")}});var Fe=l.define("Boolean",Boolean,{create:Boolean,rnd:e=>Math.random()<(e||.5)});var Be=l.define("Number",Number,{create:Number,rnd:(e,t,r)=>{let o=Math.random();return r?o=Math.pow(o,2):r===!1&&(o=Math.sqrt(o)),o.jet.fromRatio(e||0,t||e*2||1)},to:{Function:e=>t=>e,Boolean:e=>!!e,Array:(e,t)=>t?[e]:Array(e),Promise:async e=>e,String:e=>String(e)},plugins:{x:(e,t,r)=>{let o=t,n=Number.jet.zoomIn(e,r),[s,i]=n;return o==="/"?s/i:o==="*"?s*i/Math.pow(n.zoom,2):(o==="+"?s+i:o==="-"?s-i:o==="%"?s%i:NaN)/n.zoom},frame:(e,t,r)=>(e=r==null?e:Math.min(e,r),t==null?e:Math.max(e,t)),round:(e,t,r)=>{let o=Math.pow(10,t||0);return Math[r==null?"round":r?"ceil":"floor"](e*o)/o},len:(e,t)=>{let r=t,o=String.jet.to(e),n=o.length,s=o.indexOf("."),i=s>=0;return r===!1?i?n-s-1:0:!i||!r?n:s},period:(e,t,r)=>{let o=r-t;return(o+(e-t)%o)%o+t},toRatio:(e,t,r)=>{let o=r-t;return o?(e-t)/o:0},fromRatio:(e,t,r)=>{let o=r-t;return e*o+t},zoomIn:(...e)=>{let t=Math.pow(10,Math.max(...e.map(r=>Number.jet.len(r,!1))));return l.prop.add(e.map(r=>Math.round(r*t)),"zoom",t)},zoomOut:(...e)=>e.map(t=>t/e.zoom),diffusion:(e,t,r,o)=>{let n=e*o;return Number.jet.rnd(Math.max(t,e-n),Math.min(r,e+n))},snap:(e,t,r,o,n,s=!0)=>{var i=e,u=t,f=r,p=o,a=f!=null,d=p!=null,h=n;if(i==null||u==null||u<=0||!(a||d))return i;s&&(i=Number.jet.frame(i,f,p));var y=a?i-f:p-i;return i=y%u?(a?f:p)+Number.jet.round(y/u,0,h==null?null:h===a)*u*(a*2-1):i,s?Number.jet.frame(i,f,p):i},whatpow:(e,t)=>Math.log(e)/Math.log(Number.jet.to(t)),toHex:e=>{var t=Math.round(e).toString(16);return t.length===1?"0"+t:t},toLetter:(e,t)=>{t=String.jet.to(t)||"ABCDEFGHIJKLMNOPQRSTUVWXYZ";let r=t.length;return(e>=r?Number.jet.toLetter(Math.floor(e/r)-1):"")+t[e%r]}}});var De={point:"\u2022",cross:"\xD7",flake:"\u2600",draft:"\u232D",power:"\u26A1",star:"\u2605",skull:"\u2620",card:"\u2660\u2665\u2666\u2663",notes:"\u2669\u266A\u266B\u266C\u266D\u266E\u266F",chess:"\u2654\u2655\u2656\u2657\u2658\u2659\u265A\u265B\u265C\u265D\u265E\u265F",block:"\u2596\u2597\u2598\u2599\u259A\u259B\u259C\u259D\u259E\u259F",bar:"\u2502\u2551 \u258C\u2590\u2588",iting:"\u2630\u2631\u2632\u2633\u2634\u2635\u2636\u2637",astro:"\u2648\u2649\u264A\u264B\u264C\u264D\u264E\u264F\u2650\u2651\u2652\u2653",die:"\u2680\u2681\u2682\u2683\u2684\u2685",runic:"\u16A0\u16A1\u16A2\u16A3\u16A4\u16A5\u16A6\u16A7\u16A8\u16A9\u16AA\u16AB\u16AC\u16AD\u16AE\u16AF\u16B0\u16B1\u16B3\u16B4\u16B5\u16B6\u16B7\u16B8\u16B9\u16BA\u16BB\u16BC\u16BD\u16BE\u16BF\u16C0\u16C1\u16C2\u16C3\u16C4\u16C5\u16C6\u16C7\u16C8\u16C9\u16CA\u16CB\u16CF\u16D0\u16D1\u16D2\u16D3\u16D4\u16D5\u16D6\u16D7\u16D8\u16D9\u16DA\u16DB\u16DC\u16DD\u16DE\u16DF\u16E0\u16E1\u16E2\u16E3\u16E4\u16E5\u16E6\u16E8\u16E9\u16EA\u16EE\u16EF\u16F0",dots:"\u2800\u2801\u2802\u2803\u2804\u2805\u2806\u2807\u2808\u2809\u280A\u280B\u280C\u280D\u280E\u280F\u2810\u2811\u2812\u2813\u2814\u2815\u2816\u2817\u2818\u2819\u281A\u281B\u281C\u281D\u281E\u281F\u2820\u2821\u2822\u2823\u2824\u2825\u2826\u2827\u2828\u2829\u282A\u282B\u282C\u282D\u282E\u282F\u2830\u2831\u2832\u2833\u2834\u2835\u2836\u2837\u2838\u2839\u283A\u283B\u283C\u283D\u283E\u283F\u2840\u2841\u2842\u2843\u2844\u2845\u2846\u2847\u2848\u2849\u284A\u284B\u284C\u284D\u284E\u284F\u2850\u2851\u2852\u2853\u2854\u2855\u2856\u2857\u2858\u2859\u285A\u285B\u285C\u285D\u285E\u285F\u2860\u2861\u2862\u2863\u2864\u2865\u2866\u2867\u2868\u2869\u286A\u286B\u286C\u286D\u286E\u286F\u2870\u2871\u2872\u2873\u2874\u2875\u2876\u2877\u2878\u2879\u287A\u287B\u287C\u287D\u287E\u287F\u2880\u2881\u2882\u2883\u2884\u2885\u2886\u2887\u2888\u2889\u288A\u288B\u288C\u288D\u288E\u288F\u2890\u2891\u2892\u2893\u2894\u2895\u2896\u2897\u2898\u2899\u289A\u289B\u289C\u289D\u289E\u289F\u28A0\u28A1\u28A2\u28A3\u28A4\u28A5\u28A6\u28A7\u28A8\u28A9\u28AA\u28AB\u28AC\u28AD\u28AE\u28AF\u28B0\u28B1\u28B2\u28B3\u28B4\u28B5\u28B6\u28B7\u28B8\u28B9\u28BA\u28BB\u28BC\u28BD\u28BE\u28BF\u28C0\u28C1\u28C2\u28C3\u28C4\u28C5\u28C6\u28C7\u28C8\u28C9\u28CA\u28CB\u28CC\u28CD\u28CE\u28CF\u28D0\u28D1\u28D2\u28D3\u28D4\u28D5\u28D6\u28D7\u28D8\u28D9\u28DA\u28DB\u28DC\u28DD\u28DE\u28DF\u28E0\u28E1\u28E2\u28E3\u28E4\u28E5\u28E6\u28E7\u28E8\u28E9\u28EA\u28EB\u28EC\u28ED\u28EE\u28EF\u28F0\u28F1\u28F2\u28F3\u28F4\u28F5\u28F6\u28F7\u28F8\u28F9\u28FA\u28FB\u28FC\u28FD\u28FE\u28FF"},Re=l.define("String",String,{create:e=>e==null?"":String(e),rnd:(e,t,r)=>{let o=["bcdfghjklmnpqrstvwxz","aeiouy"],n=o[0].length/(o[0].length+o[1].length),s=Number.jet.rnd(Math.max(e,2),t,r),i=Boolean.jet.rnd(n),u="";for(;u.length<s;)u+=l.childRnd(o[+(i=!i)]);return u},to:{Function:e=>t=>e,Boolean:e=>!["0","false","null","undefined","NaN"].includes(e.toLowerCase()),Array:(e,t)=>e.split(t),Object:e=>l.json.from(e),Promise:async e=>e,Number:(e,t)=>{if(e){if(t)return Number(e)}else return 0;let r=String(e).replace(/\u00A0/g," ").match(RegExp.jet.lib.number);return!r||!r[0]?0:Number(r[0].replaceAll(" ","").replace(",","."))||0}},plugins:{isNumeric:e=>!isNaN(Number(e)),lower:e=>e.toLowerCase(),upper:e=>e.toUpperCase(),capitalize:e=>e.charAt(0).jet.upper()+e.slice(1),delone:e=>{let t="",r="aaccdeeillnooorstuuuyrzzAACCDEEILLNOOORSTUUUYRZZ",o="\xE1\xE4\u010D\u0107\u010F\xE9\u011B\xED\u013A\u013E\u0148\xF3\xF4\xF6\u0155\u0161\u0165\xFA\u016F\xFC\xFD\u0159\u017E\u017A\xC1\xC4\u010C\u0106\u010E\xC9\u011A\xCD\u0139\u013D\u0147\xD3\xD4\xD6\u0154\u0160\u0164\xDA\u016E\xDC\xDD\u0158\u017D\u0179";for(let n of e){let s=o.indexOf(n);t+=s>=0?r[s]:n}return t},efface:(e,t)=>e.replaceAll(t,"").replace(/[\s\n\r]+/g," ").trim(),simplify:(e,t)=>e.jet.efface(t).jet.delone().jet.lower(),sort:(...e)=>e.map(t=>{let r=String.jet.to(t),o=r.jet.delone();return{l:o.jet.lower(),d:o,s:r}}).sort((t,r)=>{for(let o=0;;o++)for(let n in t){let s=t[n].charCodeAt(o)||0,i=r[n].charCodeAt(o)||0;if(s!==i||!s)return s-i}}).map(t=>t.s),fight:(...e)=>String.jet.sort(...e)[0],carret:(e,t)=>Number.jet.tap(t,e.length).frame(0,e.length),splice:(e,t,r,...o)=>{let n=e.jet.carret(t),s=Number.jet.frame(r,0,e.length-n);return e.slice(0,n)+String.jet.to(o,"")+e.slice(n+s)},hide:(e,t,r)=>{if(!e)return e;for(var o="",n=e,s=De[t]||t||"\u2022",i=r===!1,u=0;u<e.length;u++)o+=i&&(n[u]===` | ||
`||n[u]===" ")?n[u]:s.length-1?l.childRnd(s):s;return o},levenshtein:(e,t,r)=>{var o=r===!1?[e,t]:[e.jet.simplify(r),String.jet.simplify(t,r)];if(o[0]===o[1])return 1;if(!o[0]||!o[1])return 0;var n=[o[0].length,o[1].length],s=[];n[1]>n[0]&&(n.reverse(),o.reverse());for(var i=0;i<=n[0];i++){for(var u=i,f=0;f<=n[1];f++)if(i===0)s[f]=f;else if(f>0){var p=s[f-1];o[0].charAt(i-1)!==o[1].charAt(f-1)&&(p=Math.min(Math.min(p,u),s[f])+1),s[f-1]=u,u=p}i>0&&(s[n[1]]=u)}return(n[0]-s[n[1]])/parseFloat(n[0])},mutate:(e,t)=>{for(var r=[],o=e.length/2,n=e.length*2,s=Math.abs(1e3*(t||1));r.length<s;){var i=String.jet.rnd(o,n);r.push([i,i.jet.levenshtein(e)])}return r.sort((u,f)=>f[1]-u[1])[0][0]}}});var me=e=>String(e).slice(7,-1),ke=l.define("Symbol",Symbol,{create:Symbol,copy:e=>Symbol(me(e)),rnd:(...e)=>Symbol(l.rnd.String(...e)),to:me});var ze=l.define("Function",Function,{create:Function,copy:e=>Object.defineProperties({[e.name]:(...t)=>e(...t)}[e.name],Object.getOwnPropertyDescriptors(e)),to:{"*":(e,...t)=>e(...t),Promise:async(e,...t)=>await e(...t)}});var Ee=l.define("RegExp",RegExp,{create:RegExp,copy:e=>RegExp(e.source),extendPrototype:!1,plugins:{lib:{line:/[^\n\r]+/g,number:/-?[0-9]+(\s+[0-9]+)*([,.][0-9]+)?/,word:/[^\s\n\r]+/g,num:/-?[0-9]*[.,]?[0-9]+/,email:/(?:[a-z0-9!#$%&'*+/=?^_{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i,ip:/((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))/i,domain:/([a-z0-9]+\.)+(cz|de|sk|au|com|eu|info|org|[a-z]+)/i,hexadecimal:/[0-9a-fA-F]{6,6}/}},to:{String:e=>e.source}});var Ie=l.define("Date",Date,{create:e=>e?new Date(e):new Date,rnd:(e,t)=>new Date(Number.jet.rnd(new Date(e).getTime(),t?new Date(t).getTime():Date.now()*2))});var $e=l.define("NaN",Number,{create:e=>NaN,is:isNaN,primitives:["object"],extend:!1,to:e=>{}});var Ce=l.define("Error",Error,{create:Error,rnd:(...e)=>new Error(l.rnd.String(...e))});var Le=l.define("Promise",Promise,{create:e=>new Promise(l.only.Function(e,t=>t()))});var Te=l.define("Array",Array,{create:Array,copy:e=>Array.from(e),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries(),to:{Function:e=>t=>e,Boolean:e=>e.jet.isFull(),Number:e=>e.length,String:(e,t)=>l.melt(e,t),Object:e=>Object.assign({},e),Promise:async e=>e,Error:(e,t)=>l.melt(e,t??" "),RegExp:(e,t)=>l.melt(e,t??"|")},plugins:{swap:(e,t,r)=>(e[t]=e.splice(r,1,e[t])[0],e),shuffle:e=>{for(var t=e.length-1;t>0;t--)e.jet.swap(Math.floor(Math.random()*(t+1)),t);return e},clean:(e,t,r)=>(r=Function.jet.tap(r,o=>o??void 0),t!==!1?e.filter(r):l.map(e,r))}});var Ue=l.define("Set",Set,{copy:e=>new Set(e),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries(),get:(e,t)=>e.has(t)?t:void 0,set:(e,t,r)=>e.add(r)?r:void 0,rem:(e,t)=>e.delete(t),to:{"*":e=>Array.from(e),Function:e=>t=>e,Boolean:e=>e.jet.isFull(),Object:e=>l.merge(e),Promise:async e=>e}});var qe=l.define("Map",Map,{copy:e=>new Map(e),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries(),get:(e,t)=>e.get(t),set:(e,t,r)=>e.set(t,r),rem:(e,t)=>e.delete(t)});var A=class extends Array{static pass(t,r,o,n=1){if(!Array.isArray(t))throw"Pool.pass 'from' require array";if(!Array.isArray(r))throw"Pool.pass 'to' require array";return r.push(...t.splice(o,n))>=0}has(t){return this.includes(t)}add(...t){return this.splice(-1,0,...t),this}remove(...t){for(let r of t){let o=this.indexOf(r);o>=0&&super.splice(o,1)}return this}push(...t){return this.splice(-1,0,...t),this}unshift(...t){return this.splice(0,0,...t),this}put(t,...r){return this.splice(t,0,...r),this}splice(t,r=1,...o){let n;if(r<0&&(r=0),t<0&&(t=Math.max(0,this.length+t+1-r)),o.length){let s=this.autoFilter._current,i=this.autoSort._current;o=o.flat(),s&&(o=o.filter(s)),t===this.length?super.push(...o):t===0?super.unshift(...o):n=super.splice(t,r,...o),i&&this.sort(i)}else r>0&&(n=super.splice(t,r));return n||new A}passTo(t,r,o=1){return A.pass(this,t,r,o)}passFrom(t,r,o=1){return A.pass(t,this,r,o)}flush(){return this.splice(0,this.length)}filter(t){for(let r=this.length-1;r>=0;r--)t(this[r],r,this)||super.splice(r,1);return this}map(t){let r=[];for(let o=this.length-1;o>=0;o--)r.push(t(this[o],o,this));return r}autoFilter(t){return l.isRunnable(t)?(this.autoFilter._current=t,this.filter(t)):delete this.autoFilter._current,this}autoSort(t){return l.isRunnable(t)?(this.autoSort._current=t,this.sort(t)):delete this.autoSort._current,this}},H=l.define("Pool",A,{copy:e=>new A(...e).autoFilter(e.autoFilter._current).autoSort(e.autoSort._current),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries()});var Y=class extends H{constructor(...t){super(...t);this.autoFilter(Function.jet.is).with()}with(...t){return this.with._current=t,this}run(...t){let r=this.run,o=!r._current,n=r._current=[];for(let s of this)if(n.push(s(...this.with._current,...t)),n!==r._current)break;return n=r._current,o&&delete r._current,n}fit(...t){if(this.fit._current)throw"RunPool.fit maximum call stack size exceeded";this.fit._current=!0;let r=this.with._current,o=l.reducer((n,s,...i)=>this[s]?this[s](n,...r,...i):i[0])(...r,...t);return delete this.fit._current,o}},Je=l.define("RunPool",Y,{copy:e=>new Y(...e).autoFilter(e.autoFilter._current).autoSort(e.autoSort._current),keys:e=>e.keys(),vals:e=>e.values(),entries:e=>e.entries()});var tr=l,rr=l.types.Plex;export{Te as Array,Fe as Boolean,Ie as Date,Ce as Error,ze as Function,qe as Map,$e as NaN,Be as Number,Ae as Object,rr as Plex,H as Pool,Le as Promise,Ee as RegExp,Je as RunPool,Ue as Set,Re as String,ke as Symbol,tr as default}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@randajan/jet-core", | ||
"version": "2.1.2", | ||
"version": "2.1.4", | ||
"description": "Ecosystem of types and related usefull tools.", | ||
@@ -5,0 +5,0 @@ "repository": "randajan/jet-core", |
@@ -89,3 +89,3 @@ # @randajan/jet-core | ||
### __jet.copy(any)__ | ||
### __jet.copy(any, deep=false)__ | ||
_Will create copy of instance_ | ||
@@ -95,4 +95,5 @@ | ||
* any: _any variable_ | ||
* deep: _boolean (deep copy of mapable objects)_ | ||
* Return | ||
* _new instance or the old if there isn't defined copy function_ | ||
* _new instance or the old if there wasn't defined copy function_ | ||
* Example | ||
@@ -99,0 +100,0 @@ * jet.copy({a:1}) == Object.assign({}, {a:1}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96432
80
262