@absoluteui/helpers 0.13.1 → 0.13.3

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.
Files changed (111) hide show
  1. package/README.md +1 -1
  2. package/SECURITY.md +2 -2
  3. package/dist/array/compare.js +1 -1
  4. package/dist/array/index.js +1 -1
  5. package/dist/array/tree.js +1 -1
  6. package/dist/async/batch.js +1 -1
  7. package/dist/async/concurrency.js +1 -1
  8. package/dist/async/control.js +1 -1
  9. package/dist/async/index.js +1 -1
  10. package/dist/async/signal.js +1 -1
  11. package/dist/boolean/index.js +1 -1
  12. package/dist/business-calendar/days.js +1 -1
  13. package/dist/business-calendar/describe.js +1 -1
  14. package/dist/business-calendar/engine.js +1 -1
  15. package/dist/business-calendar/hours.js +1 -1
  16. package/dist/business-calendar/index.js +1 -1
  17. package/dist/business-calendar/internal.js +1 -1
  18. package/dist/business-calendar/rules.js +1 -1
  19. package/dist/color/index.js +1 -1
  20. package/dist/color/named.js +1 -1
  21. package/dist/compare/index.js +1 -1
  22. package/dist/convert/index.js +1 -1
  23. package/dist/csv/index.js +1 -1
  24. package/dist/csv/parse.js +1 -1
  25. package/dist/csv/stringify.js +1 -1
  26. package/dist/date/calendar.js +1 -1
  27. package/dist/date/format.js +1 -1
  28. package/dist/date/index.js +1 -1
  29. package/dist/date/intervals.js +1 -1
  30. package/dist/date/intl-cache.js +1 -1
  31. package/dist/date/locale.js +1 -1
  32. package/dist/date/plain-date.js +1 -1
  33. package/dist/date/plain-time.js +1 -1
  34. package/dist/date/zone.js +1 -1
  35. package/dist/decimal/index.js +1 -1
  36. package/dist/ds/avl.js +1 -1
  37. package/dist/ds/bitset.js +1 -1
  38. package/dist/ds/bloom.js +1 -1
  39. package/dist/ds/caches.js +1 -1
  40. package/dist/ds/disjoint-set.js +1 -1
  41. package/dist/ds/emitter.js +1 -1
  42. package/dist/ds/graph.js +1 -1
  43. package/dist/ds/heap.js +1 -1
  44. package/dist/ds/index.js +1 -1
  45. package/dist/ds/internal.js +1 -1
  46. package/dist/ds/interval-tree.js +1 -1
  47. package/dist/ds/linked-list.js +1 -1
  48. package/dist/ds/maps.js +1 -1
  49. package/dist/ds/ring.js +1 -1
  50. package/dist/ds/sorted.js +1 -1
  51. package/dist/ds/stack.js +1 -1
  52. package/dist/ds/trie.js +1 -1
  53. package/dist/duration/index.js +1 -1
  54. package/dist/encoding/index.js +1 -1
  55. package/dist/error/index.js +1 -1
  56. package/dist/fn/index.js +1 -1
  57. package/dist/fn/memo.js +1 -1
  58. package/dist/fn/timing.js +1 -1
  59. package/dist/http/headers.js +1 -1
  60. package/dist/http/index.js +1 -1
  61. package/dist/http/problem.js +1 -1
  62. package/dist/http/response.js +1 -1
  63. package/dist/http/status.js +1 -1
  64. package/dist/index.js +1 -1
  65. package/dist/internal/keys.js +1 -1
  66. package/dist/is/index.js +1 -1
  67. package/dist/json/index.js +1 -1
  68. package/dist/json/internal.js +1 -1
  69. package/dist/json/ndjson.js +1 -1
  70. package/dist/json/parse.js +1 -1
  71. package/dist/json/patch.js +1 -1
  72. package/dist/json/pointer.js +1 -1
  73. package/dist/json/stringify.js +1 -1
  74. package/dist/linq/enumerable.js +1 -1
  75. package/dist/linq/index.js +1 -1
  76. package/dist/linq/operators.js +1 -1
  77. package/dist/number/core.js +1 -1
  78. package/dist/number/format.js +1 -1
  79. package/dist/number/index.js +1 -1
  80. package/dist/number/internal.js +1 -1
  81. package/dist/number/parse.js +1 -1
  82. package/dist/number/words.js +1 -1
  83. package/dist/object/basic.js +1 -1
  84. package/dist/object/deep.js +1 -1
  85. package/dist/object/diff.js +1 -1
  86. package/dist/object/index.js +1 -1
  87. package/dist/object/internal.js +1 -1
  88. package/dist/object/path.js +1 -1
  89. package/dist/random/core.js +1 -1
  90. package/dist/random/index.js +1 -1
  91. package/dist/random/seeded.js +1 -1
  92. package/dist/sanitize/index.js +1 -1
  93. package/dist/sanitize/pii.js +1 -1
  94. package/dist/sanitize/records.js +1 -1
  95. package/dist/sanitize/text.js +1 -1
  96. package/dist/set/index.js +1 -1
  97. package/dist/stats/index.js +1 -1
  98. package/dist/string/index.js +1 -1
  99. package/dist/string/internal.js +1 -1
  100. package/dist/string/words.js +1 -1
  101. package/dist/timezone/index.js +1 -1
  102. package/dist/url/index.js +1 -1
  103. package/dist/validate/builders.js +1 -1
  104. package/dist/validate/formats.js +1 -1
  105. package/dist/validate/index.js +1 -1
  106. package/dist/validate/schema.js +1 -1
  107. package/dist/zip/index.js +1 -1
  108. package/dist/zip/internal.js +1 -1
  109. package/dist/zip/reader.js +1 -1
  110. package/dist/zip/writer.js +1 -1
  111. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  class u{#t=new Map;#e=new Map;#s=new Map;#r=0;constructor(t){if(t)for(const s of t)this.add(s)}get size(){return this.#t.size}get setCount(){return this.#r}add(t){return this.#t.has(t)||(this.#t.set(t,t),this.#e.set(t,0),this.#s.set(t,1),this.#r++),this}has(t){return this.#t.has(t)}find(t){if(!this.#t.has(t))return;let s=t;for(let e=this.#t.get(s);e!==s;e=this.#t.get(s))s=e;for(let e=t;e!==s;){const r=this.#t.get(e);this.#t.set(e,s),e=r}return s}union(t,s){this.add(t).add(s);const e=this.find(t),r=this.find(s);if(e===r)return!1;const n=this.#e.get(e)??0,a=this.#e.get(r)??0,[i,h]=n>=a?[e,r]:[r,e];return this.#t.set(h,i),n===a&&this.#e.set(i,n+1),this.#s.set(i,(this.#s.get(i)??0)+(this.#s.get(h)??0)),this.#s.delete(h),this.#r--,!0}connected(t,s){return this.#t.has(t)&&this.#t.has(s)&&this.find(t)===this.find(s)}sizeOf(t){return this.#t.has(t)?this.#s.get(this.find(t))??0:0}sets(){const t=new Map;for(const s of this.#t.keys()){const e=this.find(s),r=t.get(e);r?r.push(s):t.set(e,[s])}return[...t.values()]}clear(){this.#t.clear(),this.#e.clear(),this.#s.clear(),this.#r=0}toArray(){return[...this.#t.keys()]}[Symbol.iterator](){return this.#t.keys()}}export{u as DisjointSet};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{toError as o}from"../error/index.js";class E{#e=new Map;#t=new Set;#r;constructor(e={}){this.#r=e}on(e,r){let t=this.#e.get(e);t||(t=[],this.#e.set(e,t)),t.push(r);const s=this.#r.maxListeners??10;return s>0&&t.length>s&&!this.#t.has(e)&&(this.#t.add(e),this.#r.onMaxListeners?.(e,t.length)),()=>{this.off(e,r)}}once(e,r){const t=(...n)=>{s(),r(...n)},s=this.on(e,t);return s}off(e,r){const t=this.#e.get(e);if(!t)return!1;const s=t.indexOf(r);return s<0?!1:(t.splice(s,1),t.length===0&&(this.#e.delete(e),this.#t.delete(e)),!0)}emit(e,...r){const t=this.#e.get(e);if(!t||t.length===0)return!1;for(const s of t.slice()){if(!this.#r.isolateErrors){s(...r);continue}try{s(...r)}catch(n){this.#r.onError?.(o(n),e)}}return!0}listenerCount(e){if(e!==void 0)return this.#e.get(e)?.length??0;let r=0;for(const t of this.#e.values())r+=t.length;return r}eventNames(){return[...this.#e.keys()]}removeAllListeners(e){e===void 0?(this.#e.clear(),this.#t.clear()):(this.#e.delete(e),this.#t.delete(e))}clear(){this.removeAllListeners()}}export{E as TypedEventEmitter};
package/dist/ds/graph.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{HelperError as w,ValidationError as g}from"../error/index.js";import{BinaryHeap as y}from"./heap.js";import{Queue as m}from"./ring.js";class v{directed;#e=new Map;#t;#n=0;constructor(e={}){this.directed=e.directed??!0,this.#t=this.directed?new Map:this.#e}get size(){return this.#e.size}get edgeCount(){return this.#n}addNode(e){return this.#e.has(e)||(this.#e.set(e,new Map),this.directed&&this.#t.set(e,new Map)),this}hasNode(e){return this.#e.has(e)}addEdge(e,t,n=1){if(Number.isNaN(n))throw new g("HLP_DS_GRAPH_INVALID_WEIGHT","Edge weight must be a number.");this.addNode(e).addNode(t);const s=this.#e.get(e);return s?(s.has(t)||this.#n++,s.set(t,n),this.#t.get(t)?.set(e,n),this):this}hasEdge(e,t){return this.#e.get(e)?.has(t)??!1}weight(e,t){return this.#e.get(e)?.get(t)}removeEdge(e,t){return this.#e.get(e)?.delete(t)?(this.#t.get(t)?.delete(e),this.#n--,!0):!1}removeNode(e){const t=this.#e.get(e);if(!t)return!1;if(this.directed){const n=this.#t.get(e)??new Map;this.#n-=t.size+n.size-(t.has(e)?1:0);for(const s of t.keys())this.#t.get(s)?.delete(e);for(const s of n.keys())this.#e.get(s)?.delete(e);this.#t.delete(e)}else{this.#n-=t.size;for(const n of t.keys())n!==e&&this.#e.get(n)?.delete(e)}return this.#e.delete(e),!0}neighbors(e){return[...this.#e.get(e)?.keys()??[]]}inNeighbors(e){return[...this.#t.get(e)?.keys()??[]]}nodes(){return[...this.#e.keys()]}*edges(){const e=this.directed?void 0:new Set;for(const[t,n]of this.#e){for(const[s,i]of n)e?.has(s)||(yield[t,s,i]);e?.add(t)}}clear(){this.#e.clear(),this.#t.clear(),this.#n=0}toArray(){return this.nodes()}[Symbol.iterator](){return this.#e.keys()}*bfs(e){if(!this.#e.has(e))return;const t=new Set([e]),n=new m([e]);for(;n.size>0;){const s=n.dequeue();yield s;for(const i of this.#e.get(s)?.keys()??[])t.has(i)||(t.add(i),n.enqueue(i))}}*dfs(e){if(!this.#e.has(e))return;const t=new Set,n=[e];for(;n.length>0;){const s=n.pop();if(t.has(s))continue;t.add(s),yield s;const i=this.neighbors(s);for(let r=i.length-1;r>=0;r--){const o=i[r];t.has(o)||n.push(o)}}}topologicalSort(){this.#i();const e=new Map;for(const[s,i]of this.#t)e.set(s,i.size);const t=new m;for(const[s,i]of e)i===0&&t.enqueue(s);const n=[];for(;t.size>0;){const s=t.dequeue();n.push(s);for(const i of this.#e.get(s)?.keys()??[]){const r=(e.get(i)??0)-1;e.set(i,r),r===0&&t.enqueue(i)}}if(n.length<this.#e.size)throw new w("HLP_DS_GRAPH_CYCLE","The graph contains a cycle.",{kind:"conflict",details:{cycle:this.findCycle()??[]}});return n}hasCycle(){return this.findCycle()!==void 0}findCycle(){return this.directed?this.#r():this.#o()}shortestPath(e,t){if(!this.#e.has(e)||!this.#e.has(t))return;const{dist:n,prev:s}=this.#s(e,t),i=n.get(t);if(i===void 0)return;const r=[t];for(let o=t;o!==e&&s.has(o);)o=s.get(o),r.push(o);return{path:r.reverse(),distance:i}}distancesFrom(e){return this.#e.has(e)?this.#s(e,void 0).dist:new Map}connectedComponents(){const e=new Set,t=[];for(const n of this.#e.keys()){if(e.has(n))continue;e.add(n);const s=[],i=new m([n]);for(;i.size>0;){const r=i.dequeue();s.push(r);for(const o of[this.#e.get(r),this.directed?this.#t.get(r):void 0])for(const h of o?.keys()??[])e.has(h)||(e.add(h),i.enqueue(h))}t.push(s)}return t}stronglyConnectedComponents(){if(!this.directed)return this.connectedComponents();let e=0;const t=new Map,n=new Map,s=new Set,i=[],r=[];for(const o of this.#e.keys()){if(t.has(o))continue;const h=[],a=d=>{t.set(d,e),n.set(d,e),e++,i.push(d),s.add(d),h.push([d,(this.#e.get(d)??new Map).keys()])};a(o);for(let d=h.at(-1);d;d=h.at(-1)){const[c,u]=d,N=u.next();if(!N.done){const f=N.value;t.has(f)?s.has(f)&&n.set(c,Math.min(n.get(c)??0,t.get(f)??0)):a(f);continue}h.pop();const p=h[h.length-1];if(p&&n.set(p[0],Math.min(n.get(p[0])??0,n.get(c)??0)),n.get(c)===t.get(c)){const f=[];for(;;){const l=i.pop();if(s.delete(l),f.push(l),l===c)break}r.push(f)}}}return r}#i(){if(!this.directed)throw new g("HLP_DS_GRAPH_UNDIRECTED","This operation needs a directed graph.")}#s(e,t){const n=new Map([[e,0]]),s=new Map,i=new Set,r=new y([[0,e]],(o,h)=>o[0]-h[0]);for(let o=r.pop();o;o=r.pop()){const[h,a]=o;if(!i.has(a)){if(i.add(a),t!==void 0&&a===t)break;for(const[d,c]of this.#e.get(a)??[]){if(c<0)throw new g("HLP_DS_GRAPH_NEGATIVE_WEIGHT","Shortest path needs non-negative edge weights.");const u=h+c,N=n.get(d);(N===void 0||u<N)&&(n.set(d,u),s.set(d,a),r.push([u,d]))}}}if(t!==void 0)for(const o of[...n.keys()])!i.has(o)&&o!==t&&n.delete(o);return{dist:n,prev:s}}#r(){const e=new Map,t=new Map;for(const n of this.#e.keys()){if(e.has(n))continue;const s=[[n,(this.#e.get(n)??new Map).keys()]];e.set(n,1);for(let i=s.at(-1);i;i=s.at(-1)){const[r,o]=i,h=o.next();if(h.done){e.set(r,2),s.pop();continue}const a=h.value,d=e.get(a);if(d===1){const c=[r];for(let u=r;u!==a;)u=t.get(u),c.push(u);return c.reverse()}d===void 0&&(e.set(a,1),t.set(a,r),s.push([a,(this.#e.get(a)??new Map).keys()]))}}}#o(){const e=new Set,t=new Map;for(const n of this.#e.keys()){if(e.has(n))continue;e.add(n);const s=[[n,(this.#e.get(n)??new Map).keys()]];for(let i=s.at(-1);i;i=s.at(-1)){const[r,o]=i,h=o.next();if(h.done){s.pop();continue}const a=h.value;if(a===r)return[r];if(!(t.has(r)&&t.get(r)===a)){if(e.has(a)){const d=[r];for(let c=r;c!==a;)c=t.get(c),d.push(c);return d.reverse()}e.add(a),t.set(a,r),s.push([a,(this.#e.get(a)??new Map).keys()])}}}}}export{v as Graph};
package/dist/ds/heap.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{naturalCompare as T}from"./internal.js";class a{#t;#e;constructor(e,t=T){this.#e=t,this.#t=e?[...e]:[];for(let s=(this.#t.length>>1)-1;s>=0;s--)this.#s(s)}static from(e,t=T){return new a(e,t)}get size(){return this.#t.length}isEmpty(){return this.#t.length===0}push(e){return this.#t.push(e),this.#r(this.#t.length-1),this}peek(){return this.#t[0]}pop(){const e=this.#t;if(e.length===0)return;const t=e[0],s=e.pop();return e.length>0&&(e[0]=s,this.#s(0)),t}replace(e){const t=this.#t;if(t.length===0){t.push(e);return}const s=t[0];return t[0]=e,this.#s(0),s}remove(e,t=Object.is){const s=this.#t,r=s.findIndex(n=>t(n,e));if(r<0)return!1;const i=s.pop();return r<s.length&&(s[r]=i,this.#s(r),this.#r(r)),!0}clear(){this.#t=[]}toArray(){return this.#t.slice()}toSortedArray(){return this.#t.slice().sort(this.#e)}*drain(){for(;this.#t.length>0;)yield this.pop()}[Symbol.iterator](){return this.#t.slice()[Symbol.iterator]()}#r(e){const t=this.#t,s=t[e];let r=e;for(;r>0;){const i=r-1>>1,n=t[i];if(this.#e(s,n)>=0)break;t[r]=n,r=i}t[r]=s}#s(e){const t=this.#t,s=t.length,r=t[e];let i=e;for(;;){const n=2*i+1;if(n>=s)break;const o=n+1;let h=n;o<s&&this.#e(t[o],t[n])<0&&(h=o);const l=t[h];if(this.#e(l,r)>=0)break;t[i]=l,i=h}t[i]=r}}class u extends a{}export{a as BinaryHeap,u as PriorityQueue};
package/dist/ds/index.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{naturalCompare as r}from"./internal.js";import{Stack as p}from"./stack.js";import{Deque as a,Queue as n,CircularBuffer as m}from"./ring.js";import{BinaryHeap as f,PriorityQueue as s}from"./heap.js";import{LinkedList as l}from"./linked-list.js";import{LRUCache as L,LFUCache as T,TTLCache as h}from"./caches.js";import{SortedMap as C,SortedSet as O}from"./sorted.js";import{IntervalTree as M}from"./interval-tree.js";import{Trie as B,TrieMap as E}from"./trie.js";import{Graph as F}from"./graph.js";import{DisjointSet as U}from"./disjoint-set.js";import{BitSet as I}from"./bitset.js";import{MultiMap as D,BiMap as G}from"./maps.js";import{BloomFilter as Q}from"./bloom.js";import{TypedEventEmitter as q}from"./emitter.js";export{G as BiMap,f as BinaryHeap,I as BitSet,Q as BloomFilter,m as CircularBuffer,a as Deque,U as DisjointSet,F as Graph,M as IntervalTree,T as LFUCache,L as LRUCache,l as LinkedList,D as MultiMap,s as PriorityQueue,n as Queue,C as SortedMap,O as SortedSet,p as Stack,h as TTLCache,B as Trie,E as TrieMap,q as TypedEventEmitter,r as naturalCompare};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{HelperError as n,ValidationError as t}from"../error/index.js";function o(e,r){if(typeof e=="number"&&typeof r=="number")return e<r?-1:e>r?1:e===r?0:Number.isNaN(e)?Number.isNaN(r)?0:1:-1;if(typeof e=="string"&&typeof r=="string"||typeof e=="bigint"&&typeof r=="bigint"||typeof e=="boolean"&&typeof r=="boolean")return e<r?-1:e>r?1:0;if(e instanceof Date&&r instanceof Date)return o(e.getTime(),r.getTime());throw new t("HLP_DS_NOT_COMPARABLE","Values are not comparable without a custom comparer.")}function u(e,r=!1){if(!Number.isSafeInteger(e)||e<(r?0:1))throw new t("HLP_DS_INVALID_CAPACITY","Capacity must be a positive integer.")}function f(e){if(!Number.isFinite(e)||e<=0)throw new t("HLP_DS_INVALID_TTL","TTL must be a finite number of milliseconds greater than zero.")}function a(){return new n("HLP_DS_CONCURRENT_MODIFICATION","The collection was modified during iteration.",{kind:"conflict"})}export{u as assertCapacity,f as assertTtl,a as concurrentModification,o as naturalCompare};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as f}from"../error/index.js";import{AvlTree as d}from"./avl.js";const h=(t,e)=>t.start-e.start||t.end-e.end||t.seq-e.seq;class v{bounds;#e=new d(h,e=>{e.aug=Math.max(e.key.end,e.left?e.left.aug:-1/0,e.right?e.right.aug:-1/0)});#r=0;constructor(e={}){this.bounds=e.bounds??"[]"}get size(){return this.#e.size}insert(e,n,r){u(e,n);const s={start:e,end:n,value:r,seq:this.#r++};return this.#e.insert(s,void 0),s}remove(e){return!c(e)||this.#e.find(e)?.key!==e?!1:(this.#e.delete(e),!0)}delete(e,n,r){for(const s of this.#e.ascending({key:{start:e,end:n,value:r,seq:-1/0},exclusive:!1})){if(s.key.start!==e||s.key.end!==n)return!1;if(Object.is(s.key.value,r))return this.#e.delete(s.key),!0}return!1}search(e,n){u(e,n);const r=this.bounds==="[)";return this.#n(e,n,r,r)}searchPoint(e){if(Number.isNaN(e))throw new f("HLP_DS_INVALID_INTERVAL","The point must be a number.");return this.#n(e,e,this.bounds==="[)",!1)}overlaps(e,n){u(e,n);const r=this.bounds==="[)";return this.#n(e,n,r,r,1).length>0}clear(){this.#e.clear()}toArray(){return[...this]}*[Symbol.iterator](){for(const e of this.#e.ascending())yield e.key}#n(e,n,r,s,m=1/0){const a=[],y=o=>r?o>e:o>=e,l=[];let i=this.#e.root;for(;l.length>0||i;){for(;i&&y(i.aug);)l.push(i),i=i.left;const o=l.pop();if(!o)break;const b=o.key.start;if((s?b>=n:b>n)||y(o.key.end)&&(a.push(o.key),a.length>=m))break;i=o.right}return a}}function c(t){return typeof t.seq=="number"}function u(t,e){if(Number.isNaN(t)||Number.isNaN(e)||typeof t!="number"||typeof e!="number"||t>e)throw new f("HLP_DS_INVALID_INTERVAL","An interval needs numeric bounds with start <= end.")}export{v as IntervalTree};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as r}from"../error/index.js";class s{constructor(e,t){this.value=e;this.owner=t}value;prev=void 0;next=void 0;owner}class h{#e;#t;#n=0;constructor(e){if(e)for(const t of e)this.push(t)}get size(){return this.#n}get head(){return this.#e}get tail(){return this.#t}isEmpty(){return this.#n===0}push(e){const t=new s(e,this);return this.#i(this.#t,t),t}unshift(e){const t=new s(e,this);return this.#i(void 0,t),t}pop(){const e=this.#t;if(e)return this.#d(e),e.value}shift(){const e=this.#e;if(e)return this.#d(e),e.value}insertAfter(e,t){const n=this.#s(e),i=new s(t,this);return this.#i(n,i),i}insertBefore(e,t){const n=this.#s(e),i=new s(t,this);return this.#i(n.prev,i),i}remove(e){const t=this.#s(e);return this.#d(t),t.value}find(e){for(let t=this.#e;t;t=t.next)if(e(t.value))return t}reverse(){let e=this.#e;for(;e;){const t=e.next;e.next=e.prev,e.prev=t,e=t}return[this.#e,this.#t]=[this.#t,this.#e],this}clear(){for(let e=this.#e;e;){const t=e.next;e.owner=void 0,e.prev=e.next=void 0,e=t}this.#e=this.#t=void 0,this.#n=0}toArray(){return[...this]}*nodes(){for(let e=this.#e;e;e=e.next)yield e}*[Symbol.iterator](){for(let e=this.#e;e;e=e.next)yield e.value}#s(e){if(!(e instanceof s)||e.owner!==this)throw new r("HLP_DS_FOREIGN_NODE","The node does not belong to this list.");return e}#i(e,t){const n=e?e.next:this.#e;t.prev=e,t.next=n,e?e.next=t:this.#e=t,n?n.prev=t:this.#t=t,this.#n++}#d(e){e.prev?e.prev.next=e.next:this.#e=e.next,e.next?e.next.prev=e.prev:this.#t=e.prev,e.prev=e.next=void 0,e.owner=void 0,this.#n--}}export{h as LinkedList};
package/dist/ds/maps.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ConflictError as n}from"../error/index.js";class h{unique;#e=new Map;#t=0;constructor(e,t={}){if(this.unique=t.unique??!1,e)for(const[r,s]of e)this.add(r,s)}get size(){return this.#t}get keyCount(){return this.#e.size}add(e,t){let r=this.#e.get(e);if(r||(r=this.unique?new Set:[],this.#e.set(e,r)),r instanceof Set){if(r.has(t))return this;r.add(t)}else r.push(t);return this.#t++,this}get(e){const t=this.#e.get(e);return t?[...t]:[]}has(e){return this.#e.has(e)}hasEntry(e,t){const r=this.#e.get(e);return r instanceof Set?r.has(t):r?.includes(t)??!1}delete(e){const t=this.#e.get(e);return t?(this.#t-=t instanceof Set?t.size:t.length,this.#e.delete(e)):!1}deleteEntry(e,t){const r=this.#e.get(e);if(!r)return!1;if(r instanceof Set){if(!r.delete(t))return!1}else{const s=r.indexOf(t);if(s<0)return!1;r.splice(s,1)}return this.#t--,(r instanceof Set?r.size:r.length)===0&&this.#e.delete(e),!0}clear(){this.#e.clear(),this.#t=0}keys(){return this.#e.keys()}*groups(){for(const[e,t]of this.#e)yield[e,[...t]]}toArray(){return[...this]}*[Symbol.iterator](){for(const[e,t]of this.#e)for(const r of t)yield[e,r]}}class i{#e=new Map;#t=new Map;constructor(e){if(e)for(const[t,r]of e)this.set(t,r)}get size(){return this.#e.size}set(e,t){const r=this.#t.get(t);if(this.#t.has(t)&&r!==e)throw new n("HLP_DS_BIMAP_DUPLICATE_VALUE","The value is already mapped to another key.");return this.forceSet(e,t)}forceSet(e,t){return this.delete(e),this.deleteValue(t),this.#e.set(e,t),this.#t.set(t,e),this}get(e){return this.#e.get(e)}getKey(e){return this.#t.get(e)}has(e){return this.#e.has(e)}hasValue(e){return this.#t.has(e)}delete(e){return this.#e.has(e)?(this.#t.delete(this.#e.get(e)),this.#e.delete(e),!0):!1}deleteValue(e){return this.#t.has(e)?(this.#e.delete(this.#t.get(e)),this.#t.delete(e),!0):!1}inverse(){return new i(this.#t)}clear(){this.#e.clear(),this.#t.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}toArray(){return[...this.#e]}[Symbol.iterator](){return this.#e.entries()}}export{i as BiMap,h as MultiMap};
package/dist/ds/ring.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as r}from"../error/index.js";import{assertCapacity as u}from"./internal.js";const n=8;class h{buf=new Array(n);head=0;length=0;get mask(){return this.buf.length-1}grow(){const t=this.buf,e=new Array(t.length*2);for(let i=0;i<this.length;i++)e[i]=t[this.head+i&this.mask];this.buf=e,this.head=0}pushBack(t){this.length===this.buf.length&&this.grow(),this.buf[this.head+this.length&this.mask]=t,this.length++}pushFront(t){this.length===this.buf.length&&this.grow(),this.head=this.head-1&this.mask,this.buf[this.head]=t,this.length++}popFront(){if(this.length===0)return;const t=this.buf[this.head];return this.buf[this.head]=void 0,this.head=this.head+1&this.mask,this.length--,t}popBack(){if(this.length===0)return;const t=this.head+this.length-1&this.mask,e=this.buf[t];return this.buf[t]=void 0,this.length--,e}at(t){const e=t<0?this.length+t:t;if(!(!Number.isInteger(e)||e<0||e>=this.length))return this.buf[this.head+e&this.mask]}clear(){this.buf=new Array(n),this.head=0,this.length=0}*values(){for(let t=0;t<this.length;t++)yield this.buf[this.head+t&this.mask]}}class o{#t=new h;constructor(t){if(t)for(const e of t)this.#t.pushBack(e)}get size(){return this.#t.length}isEmpty(){return this.#t.length===0}push(t){return this.#t.pushBack(t),this}unshift(t){return this.#t.pushFront(t),this}pop(){return this.#t.popBack()}shift(){return this.#t.popFront()}peekFront(){return this.#t.at(0)}peekBack(){return this.#t.at(-1)}at(t){return this.#t.at(t)}clear(){this.#t.clear()}toArray(){return[...this.#t.values()]}[Symbol.iterator](){return this.#t.values()}}class l{#t=new h;constructor(t){if(t)for(const e of t)this.#t.pushBack(e)}get size(){return this.#t.length}isEmpty(){return this.#t.length===0}enqueue(t){return this.#t.pushBack(t),this}dequeue(){return this.#t.popFront()}peek(){return this.#t.at(0)}clear(){this.#t.clear()}toArray(){return[...this.#t.values()]}[Symbol.iterator](){return this.#t.values()}}class f{#t;#i=0;#e=0;constructor(t){if(u(t),t>2**30)throw new r("HLP_DS_INVALID_CAPACITY","Capacity is too large.");this.#t=new Array(t)}get capacity(){return this.#t.length}get size(){return this.#e}isFull(){return this.#e===this.#t.length}isEmpty(){return this.#e===0}push(t){const e=this.#t.length;if(this.#e<e){this.#t[(this.#i+this.#e)%e]=t,this.#e++;return}const i=this.#t[this.#i];return this.#t[this.#i]=t,this.#i=(this.#i+1)%e,i}shift(){if(this.#e===0)return;const t=this.#t[this.#i];return this.#t[this.#i]=void 0,this.#i=(this.#i+1)%this.#t.length,this.#e--,t}pop(){if(this.#e===0)return;const t=(this.#i+this.#e-1)%this.#t.length,e=this.#t[t];return this.#t[t]=void 0,this.#e--,e}at(t){const e=t<0?this.#e+t:t;if(!(!Number.isInteger(e)||e<0||e>=this.#e))return this.#t[(this.#i+e)%this.#t.length]}clear(){this.#t.fill(void 0),this.#i=0,this.#e=0}toArray(){return[...this]}*[Symbol.iterator](){for(let t=0;t<this.#e;t++)yield this.#t[(this.#i+t)%this.#t.length]}}export{f as CircularBuffer,o as Deque,l as Queue};
package/dist/ds/sorted.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{AvlTree as a}from"./avl.js";import{naturalCompare as f}from"./internal.js";class c{#e;constructor(e,n=f){if(this.#e=new a(n),e)for(const[t,o]of e)this.#e.insert(t,o)}get size(){return this.#e.size}get(e){return this.#e.find(e)?.value}has(e){return this.#e.find(e)!==void 0}set(e,n){return this.#e.insert(e,n),this}delete(e){return this.#e.delete(e)!==void 0}clear(){this.#e.clear()}first(){return i(this.#e.min())}last(){return i(this.#e.max())}floor(e){return i(this.#e.below(e,!0))}ceiling(e){return i(this.#e.above(e,!0))}lower(e){return i(this.#e.below(e,!1))}higher(e){return i(this.#e.above(e,!1))}shift(){const e=this.#e.min();if(e)return this.#e.delete(e.key),[e.key,e.value]}pop(){const e=this.#e.max();if(e)return this.#e.delete(e.key),[e.key,e.value]}*between(e,n,t="[]"){const o=this.#e.cmp,u=t.endsWith(")");for(const r of this.#e.ascending({key:e,exclusive:t.startsWith("(")})){const d=o(r.key,n);if(d>0||d===0&&u)return;yield[r.key,r.value]}}*keys(){for(const e of this.#e.ascending())yield e.key}*values(){for(const e of this.#e.ascending())yield e.value}entries(){return this[Symbol.iterator]()}*reversed(){for(const e of this.#e.descending())yield[e.key,e.value]}toArray(){return[...this]}*[Symbol.iterator](){for(const e of this.#e.ascending())yield[e.key,e.value]}}function i(s){return s?[s.key,s.value]:void 0}class y{#e;constructor(e,n=f){if(this.#e=new a(n),e)for(const t of e)this.#e.insert(t,void 0)}get size(){return this.#e.size}add(e){return this.#e.find(e)||this.#e.insert(e,void 0),this}has(e){return this.#e.find(e)!==void 0}delete(e){return this.#e.delete(e)!==void 0}clear(){this.#e.clear()}first(){return this.#e.min()?.key}last(){return this.#e.max()?.key}floor(e){return this.#e.below(e,!0)?.key}ceiling(e){return this.#e.above(e,!0)?.key}lower(e){return this.#e.below(e,!1)?.key}higher(e){return this.#e.above(e,!1)?.key}*between(e,n,t="[]"){const o=this.#e.cmp,u=t.endsWith(")");for(const r of this.#e.ascending({key:e,exclusive:t.startsWith("(")})){const d=o(r.key,n);if(d>0||d===0&&u)return;yield r.key}}*reversed(){for(const e of this.#e.descending())yield e.key}toArray(){return[...this]}*[Symbol.iterator](){for(const e of this.#e.ascending())yield e.key}}export{c as SortedMap,y as SortedSet};
package/dist/ds/stack.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  class s{#t=[];constructor(t){if(t)for(const e of t)this.#t.push(e)}get size(){return this.#t.length}isEmpty(){return this.#t.length===0}push(t){return this.#t.push(t),this}pop(){return this.#t.pop()}peek(){return this.#t[this.#t.length-1]}clear(){this.#t=[]}toArray(){return this.#t.slice().reverse()}*[Symbol.iterator](){for(let t=this.#t.length-1;t>=0;t--)yield this.#t[t]}}export{s as Stack};
package/dist/ds/trie.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  const f=()=>({children:void 0,entry:void 0,count:0});class c{#e=f();#t;constructor(e,t={}){const n=t.caseFold;if(this.#t=n===void 0||n===!1?r=>r:n===!0?r=>r.toLowerCase():r=>r.toLocaleLowerCase(n),e)for(const[r,s]of e)this.set(r,s)}get size(){return this.#e.count}set(e,t){const n=[this.#e];let r=this.#e;for(const i of this.#t(e)){r.children??=new Map;let o=r.children.get(i);o||(o=f(),r.children.set(i,o)),r=o,n.push(r)}const s=r.entry===void 0;if(r.entry={key:e,value:t},s)for(const i of n)i.count++;return this}get(e){return this.#r(this.#t(e))?.entry?.value}has(e){return this.#r(this.#t(e))?.entry!==void 0}delete(e){const t=[];let n=this.#e;for(const r of this.#t(e)){const s=n.children?.get(r);if(!s)return!1;t.push([n,r]),n=s}if(n.entry===void 0)return!1;n.entry=void 0;for(const[r]of t)r.count--;n.count--;for(const[r,s]of t.reverse()){const i=r.children?.get(s);if(!i||i.count>0)break;r.children?.delete(s),r.children?.size===0&&(r.children=void 0)}return!0}hasPrefix(e){return(this.#r(this.#t(e))?.count??0)>0}countPrefix(e){return this.#r(this.#t(e))?.count??0}entriesWithPrefix(e,t=1/0){const n=[],r=this.#r(this.#t(e));if(!r||t<=0)return n;const s=[r];for(let i=s.pop();i&&!(i.entry&&(n.push([i.entry.key,i.entry.value]),n.length>=t));i=s.pop())if(i.children){const o=[...i.children.keys()].sort().reverse();for(const u of o){const d=i.children.get(u);d&&s.push(d)}}return n}keysWithPrefix(e,t=1/0){return this.entriesWithPrefix(e,t).map(([n])=>n)}longestCommonPrefix(){if(this.#e.count===0)return"";let e="",t=this.#e;for(;!t.entry&&t.children?.size===1;){const n=t.children.entries().next();if(n.done)break;const[r,s]=n.value;e+=r,t=s}return e}longestPrefixOf(e){let t=this.#e,n=t.entry?.key;for(const r of this.#t(e)){if(t=t.children?.get(r),!t)break;t.entry&&(n=t.entry.key)}return n}clear(){this.#e=f()}toArray(){return this.entriesWithPrefix("")}[Symbol.iterator](){return this.toArray()[Symbol.iterator]()}#r(e){let t=this.#e;for(const n of e)if(t=t.children?.get(n),!t)return;return t}}class l{#e;constructor(e,t={}){if(this.#e=new c(void 0,t),e)for(const n of e)this.#e.set(n,!0)}get size(){return this.#e.size}insert(e){return this.#e.set(e,!0),this}has(e){return this.#e.has(e)}delete(e){return this.#e.delete(e)}startsWith(e){return this.#e.hasPrefix(e)}findByPrefix(e,t=1/0){return this.#e.keysWithPrefix(e,t)}countPrefix(e){return this.#e.countPrefix(e)}longestCommonPrefix(){return this.#e.longestCommonPrefix()}longestPrefixOf(e){return this.#e.longestPrefixOf(e)}clear(){this.#e.clear()}toArray(){return this.#e.keysWithPrefix("")}[Symbol.iterator](){return this.toArray()[Symbol.iterator]()}}export{l as Trie,c as TrieMap};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as X,ValidationError as l}from"../error/index.js";import{addDays as v,addMonths as W,isPlainDateTime as H,plainDateTime as T,plainDateTimeToEpochMilliseconds as A,timeFromMilliseconds as Q,toPlainDate as q,fromEpochDay as B}from"../date/index.js";import{cachedIntl as J,listFormat as V,numberFormat as y}from"../date/intl-cache.js";import{instantToZoned as K,toEpochMs as Z,zonedToInstant as z}from"../date/zone.js";const w=["years","months","weeks","days","hours","minutes","seconds","milliseconds"],g=864e5,U={weeks:7*g,days:g,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1};function h(){return new X("HLP_DURATION_OUT_OF_RANGE","Duration exceeds the safe integer range.")}function N(n){let t=0;const e={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0};for(const i of w){const o=n[i]??0;if(!Number.isSafeInteger(o))throw new l("HLP_DURATION_INVALID_FIELD","Duration fields must be safe integers.",{details:{property:i}});if(o===0)continue;const r=o<0?-1:1;if(t!==0&&r!==t)throw new l("HLP_DURATION_MIXED_SIGNS","Duration fields must not mix signs.");t=r,e[i]=Math.abs(o)}return Object.freeze({...e,sign:t})}function b(n){if(typeof n!="object"||n===null)return!1;const t=n;if(t.sign!==-1&&t.sign!==0&&t.sign!==1)return!1;let e=!1;for(const i of w){const o=t[i];if(typeof o!="number"||!Number.isSafeInteger(o)||o<0)return!1;o&&(e=!0)}return e===(t.sign!==0)}function x(n){return Object.freeze({...n,sign:0-n.sign})}const G=(n,t)=>n[t]===0?0:n.sign*n[t],nn=/^([+-])?P(?:(\d{1,16})Y)?(?:(\d{1,16})M)?(?:(\d{1,16})W)?(?:(\d{1,16})D)?(?:T(?:(\d{1,16})H)?(?:(\d{1,16})M)?(?:(\d{1,16})(?:[.,](\d{1,9}))?S)?)?$/;function dn(n){if(typeof n!="string"||n.length>128)return;const t=nn.exec(n);if(!t)return;const e=t[2]!==void 0||t[3]!==void 0||t[4]!==void 0||t[5]!==void 0,i=t[6]!==void 0||t[7]!==void 0||t[8]!==void 0;if(!e&&!i||n.includes("T")&&!i)return;const o=t[9]??"";if(/[1-9]/.test(o.slice(3)))return;const r=[t[2],t[3],t[4],t[5],t[6],t[7],t[8]].map(d=>Number(d??0));if(!r.every(d=>Number.isSafeInteger(d)))return;const[s=0,a=0,u=0,f=0,p=0,F=0,_=0]=r,O=Number(o.slice(0,3).padEnd(3,"0")),I=N({years:s,months:a,weeks:u,days:f,hours:p,minutes:F,seconds:_,milliseconds:O});return t[1]==="-"?x(I):I}function mn(n){let t="";n.years&&(t+=`${String(n.years)}Y`),n.months&&(t+=`${String(n.months)}M`),n.weeks&&(t+=`${String(n.weeks)}W`),n.days&&(t+=`${String(n.days)}D`);let e="";return n.hours&&(e+=`${String(n.hours)}H`),n.minutes&&(e+=`${String(n.minutes)}M`),(n.seconds||n.milliseconds)&&(e+=`${String(n.seconds)}${n.milliseconds?`.${String(n.milliseconds).padStart(3,"0").replace(/0{1,2}$/,"")}`:""}S`),!t&&!e?"PT0S":`${n.sign<0?"-":""}P${t}${e?`T${e}`:""}`}const tn=n=>typeof n=="object"&&"timeZone"in n,j=n=>H(n)?n:T(n);function S(n){const t=n.hours*36e5+n.minutes*6e4+n.seconds*1e3+n.milliseconds;if(!Number.isSafeInteger(t))throw h();return n.sign*t}function E(n,t){const e=t.years*12+t.months,i=t.weeks*7+t.days;if(!Number.isSafeInteger(e)||!Number.isSafeInteger(i))throw h();return v(W(n,t.sign*e+0),t.sign*i+0)}function en(n,t){if(!b(t))throw new l("HLP_DURATION_INVALID","Expected a Duration.");if(H(n)){const e=E(n.date,t),i=A(T(e,n.time))+S(t),o=Math.floor(i/g);return T(B(o),Q(i-o*g))}return v(E(q(n),t),Math.trunc(S(t)/g)+0)}function on(n,t,e){if(!b(t))throw new l("HLP_DURATION_INVALID","Expected a Duration.");const i=Z(n);let o=i;if(t.years||t.months||t.weeks||t.days){const r=K(i,e);o=z(T(E(r.date,t),r.time),e)}return Z(o+S(t))}function Y(n,t={}){if(!b(n))throw new l("HLP_DURATION_INVALID","Expected a Duration.");const{relativeTo:e}=t;if(e===void 0){if(n.years||n.months)throw new l("HLP_DURATION_RELATIVE_TO_REQUIRED","Years and months need a relativeTo date.");const o=n.weeks*U.weeks+n.days*g+n.hours*36e5+n.minutes*6e4+n.seconds*1e3+n.milliseconds;if(!Number.isSafeInteger(o))throw h();return o===0?0:n.sign*o}if(tn(e)){const o=z(j(e.dateTime),e.timeZone,{disambiguation:e.disambiguation??"compatible"});return on(o,n,e.timeZone)-o+0}const i=j(e);return A(en(i,n))-A(i)+0}const c=["weeks","days","hours","minutes","seconds","milliseconds"];function R(n){if(!c.includes(n))throw new l("HLP_DURATION_INVALID_UNIT","Unsupported largest unit.")}function P(n,t){const e={weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0};let i=n;for(const o of c.slice(c.indexOf(t))){const r=U[o];e[o]=Math.floor(i/r),i-=e[o]*r}return e}function Dn(n,t={}){if(!Number.isFinite(n))throw new l("HLP_DURATION_INVALID_FIELD","Milliseconds must be finite.");const e=Math.trunc(n);if(!Number.isSafeInteger(e))throw h();const i=t.largestUnit??"hours";R(i);const o=P(Math.abs(e),i),r=N(o);return e<0?x(r):r}function gn(n,t={}){if(!b(n))throw new l("HLP_DURATION_INVALID","Expected a Duration.");const e=t.largestUnit??"hours";R(e);const i=c.slice(c.indexOf(e));let o=0;for(const u of i)o+=n[u]*U[u];if(!Number.isSafeInteger(o))throw h();const r=P(o,e),s={...n};for(const u of i)s[u]=r[u];const a=N(s);return n.sign<0?x(a):a}function hn(n,t,e={}){const i=Y(n,e),o=Y(t,e);return i<o?-1:i>o?1:0}const rn={years:"year",months:"month",weeks:"week",days:"day",hours:"hour",minutes:"minute",seconds:"second",milliseconds:"millisecond"};function L(n,t,e,i){return y(e,{style:"unit",unit:rn[t],unitDisplay:i}).format(n)}function sn(n,t,e){const i=e==="digital"?"short":e,o=e==="digital"?w.slice(0,4):w,r=[];for(const s of o)n[s]&&r.push(L(r.length===0?G(n,s):n[s],s,t,i));if(e==="digital"){const s=y(t,{minimumIntegerDigits:2,useGrouping:!1}),a=n.sign<0&&r.length===0;let u=`${y(t,{useGrouping:!1}).format(a?-n.hours:n.hours)}:${s.format(n.minutes)}:${s.format(n.seconds)}`;return n.milliseconds&&(u+=`${y(t,{}).formatToParts(1.5).find(f=>f.type==="decimal")?.value??"."}${y(t,{minimumIntegerDigits:3,useGrouping:!1}).format(n.milliseconds)}`),r.push(u),V(t,{type:"unit",style:"narrow"}).format(r)}return r.length===0?L(0,"seconds",t,i):V(t,{type:"unit",style:i}).format(r)}function an(n,t={}){if(!b(n))throw new l("HLP_DURATION_INVALID","Expected a Duration.");const e=t.style??"long",{locale:i}=t,o=Intl.DurationFormat;if(o&&(t.useNative??!0)){const r=J("df",i,{style:e},()=>new o(i,{style:e}));if(n.sign===0)return e==="digital"?r.format({seconds:0}):L(0,"seconds",i,e);const s={};for(const a of w)n[a]&&(s[a]=G(n,a));return r.format(s)}return sn(n,i,e)}function pn(n,t={}){if(!Number.isFinite(n))throw new l("HLP_DURATION_INVALID_FIELD","Milliseconds must be finite.");const e=t.largestUnits??2;if(!Number.isInteger(e)||e<1||e>6)throw new l("HLP_DURATION_INVALID_UNIT","largestUnits must be an integer 1 to 6.");const i=t.largestUnit??"days",o=t.smallestUnit??"seconds";R(i),R(o);const r=c.indexOf(i),s=c.indexOf(o);if(s<r)throw new l("HLP_DURATION_INVALID_UNIT","smallestUnit is larger than largestUnit.");const a=Math.abs(Math.trunc(n));if(!Number.isSafeInteger(a))throw h();const u=P(a,i);let f=c.findIndex((m,D)=>D>=r&&u[m]>0);(f<0||f>s)&&(f=s);const p=Math.min(f+e-1,s),F=c[p]??"seconds",_=U[F],O=Math.round(a/_)*_,I=P(O,i),d=c.findIndex((m,D)=>D>=r&&I[m]>0),$={};if(d>=0)for(let m=d;m<=Math.min(d+e-1,s);m++){const D=c[m];D&&($[D]=I[D])}const M=N($),k=t.style??"long",C={style:k,...t.locale===void 0?{}:{locale:t.locale},...t.useNative===void 0?{}:{useNative:t.useNative}};return M.sign===0?L(0,o,t.locale,k):an(n<0?x(M):M,C)}function In(n,t={}){if(!Number.isFinite(n))throw new l("HLP_DURATION_INVALID_FIELD","Milliseconds must be finite.");const e=Math.floor(Math.abs(n)),i=Math.floor(e/36e5),o=Math.floor(e%36e5/6e4),r=Math.floor(e%6e4/1e3),s=(f,p=2)=>String(f).padStart(p,"0"),a=`${s(i)}:${s(o)}:${s(r)}${t.milliseconds?`.${s(e%1e3,3)}`:""}`,u=t.milliseconds?e:e-e%1e3;return n<0&&u>0?`-${a}`:a}export{en as addDuration,on as addDurationInZone,hn as compareDurations,N as duration,Y as durationToMilliseconds,In as formatClock,an as formatDuration,mn as formatIsoDuration,pn as humanizeDuration,b as isDuration,Dn as millisecondsToDuration,x as negateDuration,gn as normalizeDuration,dn as parseIsoDuration};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as x,ValidationError as d}from"../error/index.js";const D=Uint8Array,g=Uint8Array.prototype;function y(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function h(e){return typeof e=="string"?C(e):y(e)}let L;const _=new Map;function C(e){return L??=new TextEncoder,L.encode(e)}function E(e,t={}){const n=t.fatal??!1,o=y(e);if(t.keepBom===!0)try{return new TextDecoder("utf-8",{fatal:n,ignoreBOM:!0}).decode(o)}catch(a){throw new d("HLP_ENCODING_INVALID_UTF8","The bytes are not valid UTF-8.",{cause:a})}let r=_.get(n);r||(r=new TextDecoder("utf-8",{fatal:n}),_.set(n,r));try{return r.decode(o)}catch(a){throw new d("HLP_ENCODING_INVALID_UTF8","The bytes are not valid UTF-8.",{cause:a})}}const B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",N=new Map;function O(e){let t=N.get(e);if(!t){t=new Int16Array(128).fill(-1);for(let n=0;n<64;n++)t[e.charCodeAt(n)]=n;N.set(e,t)}return t}function T(e,t,n){if(g.toBase64)return g.toBase64.call(e,{alphabet:t?"base64url":"base64",omitPadding:!n});const o=t?U:B,r=[];let a="";const s=e.length;let i=0;for(;i+2<s;i+=3){const f=(e[i]??0)<<16|(e[i+1]??0)<<8|(e[i+2]??0);a+=o.charAt(f>>>18)+o.charAt(f>>>12&63)+o.charAt(f>>>6&63)+o.charAt(f&63),a.length>=8192&&(r.push(a),a="")}const c=s-i;if(c===1){const f=(e[i]??0)<<16;a+=o.charAt(f>>>18)+o.charAt(f>>>12&63)+(n?"==":"")}else if(c===2){const f=(e[i]??0)<<16|(e[i+1]??0)<<8;a+=o.charAt(f>>>18)+o.charAt(f>>>12&63)+o.charAt(f>>>6&63)+(n?"=":"")}return r.push(a),r.join("")}const w=e=>e===32||e===9||e===10||e===12||e===13;function p(e,t){const n=O(t?U:B);let o="",r=0;for(let s=0;s<e.length;s++){const i=e.charCodeAt(s);if(!w(i)){if(i===61){r++;continue}if(r>0||i>127||(n[i]??-1)<0)return;o+=e.charAt(s)}}if(o.length%4!==1&&!(r>0&&(r>2||(o.length+r)%4!==0)))return o}function I(e,t){if(D.fromBase64)return D.fromBase64(e,{alphabet:t?"base64url":"base64"});const n=O(t?U:B),o=e.length,r=new Uint8Array(Math.floor(o*3/4));let a=0,s=0,i=0;for(let c=0;c<o;c++)s=s<<6|(n[e.charCodeAt(c)]??0),i+=6,i>=8&&(i-=8,r[a++]=s>>>i&255),s&=255;return r}function k(e){return T(h(e),!1,!0)}function R(e){const t=p(e,!1);if(t===void 0)throw new d("HLP_ENCODING_INVALID_BASE64","The input is not valid base64.");return I(t,!1)}function F(e,t={}){return E(R(e),t)}function S(e){return T(h(e),!0,!1)}function M(e){const t=p(e,!0);if(t===void 0)throw new d("HLP_ENCODING_INVALID_BASE64","The input is not valid base64url.");return I(t,!0)}function j(e,t={}){return E(M(e),t)}function z(e,t={}){const n=t.alphabet==="base64url";if(t.allowWhitespace!==!0){for(let r=0;r<e.length;r++)if(w(e.charCodeAt(r)))return!1}if(p(e,n)===void 0)return!1;if(t.requirePadding===!0){let r=0;for(let a=0;a<e.length;a++)w(e.charCodeAt(a))||r++;return r%4===0}return!0}const P="0123456789abcdef";function W(e,t={}){const n=h(e);let o;if(g.toHex)o=g.toHex.call(n);else{const r=new Array(n.length);for(let a=0;a<n.length;a++){const s=n[a]??0;r[a]=P.charAt(s>>>4)+P.charAt(s&15)}o=r.join("")}return t.uppercase===!0?o.toUpperCase():o}function b(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e>=65&&e<=70?e-55:-1}function X(e){if(e.length%2!==0)throw new d("HLP_ENCODING_INVALID_HEX","The input is not valid hex.");const t=new Uint8Array(e.length/2);for(let n=0;n<t.length;n++){const o=b(e.charCodeAt(2*n)),r=b(e.charCodeAt(2*n+1));if(o<0||r<0)throw new d("HLP_ENCODING_INVALID_HEX","The input is not valid hex.");t[n]=o<<4|r}return t}function $(e,t){const n=y(e),o=y(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==o[r])return!1;return!0}function J(...e){const t=e.map(y);let n=0;for(const a of t)n+=a.length;const o=new Uint8Array(n);let r=0;for(const a of t)o.set(a,r),r+=a.length;return o}const v=/^[\w!#$%&'*+.^`|~-]+\/[\w!#$%&'*+.^`|~-]+$/;function K(e,t="application/octet-stream"){if(t.length>255||!v.test(t))throw new d("HLP_ENCODING_INVALID_MIME","The MIME type is not valid.");return`data:${t.toLowerCase()};base64,${k(e)}`}function Q(e,t={}){const n=t.maxBytes??10485760;if(e.length>n*3+1024)throw new x("HLP_ENCODING_DATA_URL_TOO_LARGE","The data URL exceeds the size limit.");const o=e.trim();if(o.slice(0,5).toLowerCase()!=="data:")return;const r=o.indexOf(",");if(r<0)return;const a=o.slice(5,r).split(";").map(l=>l.trim()),s=o.slice(r+1);let i=!1;a.length>1&&a[a.length-1]?.toLowerCase()==="base64"&&(i=!0,a.pop());const c=(a.shift()??"").toLowerCase();if(c!==""&&(c.length>255||!v.test(c)))return;const f=Object.create(null);for(const l of a){const u=l.indexOf("=");if(u<=0)continue;const H=l.slice(0,u).trim().toLowerCase();f[H]=l.slice(u+1).trim()}c===""&&!("charset"in f)&&(f.charset="US-ASCII");let A;if(i){let l;try{l=decodeURIComponent(s)}catch{return}const u=p(l,!1);if(u===void 0)return;if(Math.floor(u.length*3/4)>n)throw new x("HLP_ENCODING_DATA_URL_TOO_LARGE","The data URL exceeds the size limit.");A=I(u,!1)}else if(A=G(s),A.length>n)throw new x("HLP_ENCODING_DATA_URL_TOO_LARGE","The data URL exceeds the size limit.");return{mimeType:c===""?"text/plain":c,parameters:f,base64:i,bytes:A}}function G(e){const t=C(e),n=new Uint8Array(t.length);let o=0;for(let r=0;r<t.length;r++){const a=t[r]??0;if(a===37&&r+2<t.length){const s=b(t[r+1]??0),i=b(t[r+2]??0);if(s>=0&&i>=0){n[o++]=s<<4|i,r+=2;continue}}n[o++]=a}return n.slice(0,o)}let m;function V(){if(m)return m;const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return m=e,e}function Y(e,t=0){const n=V(),o=h(e);let r=(t^4294967295)>>>0;for(const a of o)r=(n[(r^a)&255]??0)^r>>>8;return(r^4294967295)>>>0}function Z(e,t=1){const n=h(e);let o=t&65535,r=t>>>16&65535;const a=65521;for(let s=0;s<n.length;){const i=Math.min(s+5552,n.length);for(;s<i;s++)o+=n[s]??0,r+=o;o%=a,r%=a}return(r<<16|o)>>>0}function ee(e,t=2166136261){const n=h(e);let o=t>>>0;for(const r of n)o^=r,o=Math.imul(o,16777619)>>>0;return o}export{Z as adler32,R as base64Decode,F as base64DecodeText,k as base64Encode,M as base64UrlDecode,j as base64UrlDecodeText,S as base64UrlEncode,$ as bytesEqual,J as concatBytes,Y as crc32,ee as fnv1a32,X as hexDecode,W as hexEncode,z as isBase64,Q as parseDataUrl,K as toDataUrl,E as utf8Decode,C as utf8Encode};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  class i extends Error{name="HelperError";code;kind;details;fields;constructor(e,n,t={}){super(n,t.cause===void 0?void 0:{cause:t.cause}),this.code=e,this.kind=t.kind??"internal",this.details=Object.freeze({...t.details}),this.fields=Object.freeze({...t.fields})}}class x extends i{name="ValidationError";constructor(e,n,t={}){super(e,n,{...t,kind:"validation"})}}class T extends i{name="NotFoundError";constructor(e,n,t={}){super(e,n,{...t,kind:"not-found"})}}class w extends i{name="ConflictError";constructor(e,n,t={}){super(e,n,{...t,kind:"conflict"})}}class H extends i{name="TimeoutError";constructor(e="HLP_TIMEOUT",n="The operation timed out.",t={}){super(e,n,{...t,kind:"timeout"})}}class O extends i{name="AbortError";constructor(e="HLP_ABORTED",n="The operation was aborted.",t={}){super(e,n,{...t,kind:"aborted"})}}class v extends i{name="LimitError";constructor(e,n,t={}){super(e,n,{...t,kind:"limit"})}}const E=new Map([[0,"network"],[400,"validation"],[401,"unauthorized"],[403,"forbidden"],[404,"not-found"],[408,"timeout"],[409,"conflict"],[410,"not-found"],[412,"conflict"],[413,"too-large"],[422,"validation"],[429,"rate-limited"],[502,"unavailable"],[503,"unavailable"],[504,"timeout"]]);function g(r){const e=E.get(r);return e!==void 0?e:r>=500&&r<=599?"server":"client"}const m=new Set(["network","offline","timeout","rate-limited","unavailable"]);class y extends i{name="HttpError";status;statusText;problem;method;url;category;retryable;retryAfterMs;requestId;body;constructor(e,n,t){const s=t.category??g(t.status),a=s==="cancelled"?"aborted":s==="timeout"&&t.status===0?"timeout":t.status===401?"unauthorized":t.status===403?"forbidden":t.status===404?"not-found":t.status===409?"conflict":"http";super(e,n,{...t,kind:a}),this.status=t.status,this.statusText=t.statusText??"",this.problem=t.problem,this.method=t.method,this.url=t.url,this.category=s,this.retryable=t.retryable??(m.has(s)||t.status===425||t.status===500),this.retryAfterMs=t.retryAfterMs,this.requestId=t.requestId,this.body=t.body}toJSON(){const e=this.problem?.type;return{name:this.name,code:this.code,message:this.message,status:this.status,category:this.category,retryable:this.retryable,method:this.method,url:this.url,requestId:this.requestId,retryAfterMs:this.retryAfterMs,fields:this.fields,problemType:typeof e=="string"?e:void 0}}}function A(r,e){return r instanceof i&&(e===void 0||r.code===e)}function S(r){return r instanceof i&&r.kind==="aborted"?!0:typeof r=="object"&&r!==null&&r.name==="AbortError"}function l(r){return r instanceof Error?r:new i("HLP_NON_ERROR_THROWN","A non-error value was thrown.",{cause:r})}function z(r,e={}){const{includeStack:n=!1,maxDepth:t=5}=e,s=(a,f)=>{const o=l(a),d={name:o.name,message:o.message};return o instanceof i&&(d.code=o.code,d.kind=o.kind,Object.keys(o.details).length&&(d.details=o.details),Object.keys(o.fields).length&&(d.fields=o.fields)),o instanceof y&&(d.status=o.status),n&&o.stack!==void 0&&(d.stack=o.stack),o.cause!==void 0&&f<t&&!(o instanceof i&&o.code==="HLP_NON_ERROR_THROWN")&&(d.cause=s(o.cause,f+1)),d};return s(r,0)}function k(r){if(typeof r!="object"||r===null)return new i("HLP_INVALID_SERIALIZED_ERROR","Invalid serialized error.");const e=r,n=typeof e.message=="string"?e.message:"Unknown error.",t=typeof e.code=="string"?e.code:"HLP_DESERIALIZED",s={...p(e.details)?{details:e.details}:{},...h(e.fields)?{fields:e.fields}:{},...e.cause!==void 0?{cause:k(e.cause)}:{}},a=typeof e.status=="number"?new y(t,n,{...s,status:e.status}):new i(t,n,{...s,kind:R(e.kind)?e.kind:"internal"});return typeof e.name=="string"&&(a.name=e.name),a}const b=["validation","not-found","conflict","http","timeout","aborted","unauthorized","forbidden","unsupported","limit","internal"],R=r=>typeof r=="string"&&b.includes(r),p=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),h=r=>p(r)&&Object.values(r).every(e=>typeof e=="string");function u(r){return{ok:!0,value:r}}function c(r){return{ok:!1,error:r}}function I(r){try{return u(r())}catch(e){return c(l(e))}}async function _(r){try{return u(await r())}catch(e){return c(l(e))}}function C(r){if(r.ok)return r.value;throw r.error instanceof Error?r.error:l(r.error)}function L(r,e){return r.ok?r.value:e}function F(r,e){return r.ok?u(e(r.value)):r}function N(r,e){return r.ok?r:c(e(r.error))}function P(r){const e=[];for(const n of r){if(!n.ok)return n;e.push(n.value)}return u(e)}function j(r,e="_form"){const n={};for(const t of r)if(t instanceof i&&Object.keys(t.fields).length)for(const[s,a]of Object.entries(t.fields))s in n||(n[s]=a);else e in n||(n[e]=l(t).message);return n}function K(r,e="Invariant failed.",n="HLP_ASSERT"){if(!r)throw new i(n,e)}function M(r,e="Unexpected value."){throw new i("HLP_UNREACHABLE",e,{cause:r})}export{O as AbortError,w as ConflictError,i as HelperError,y as HttpError,v as LimitError,T as NotFoundError,H as TimeoutError,x as ValidationError,M as assertNever,P as combineResults,k as deserializeError,c as err,j as fieldErrors,g as httpFailureCategory,K as invariant,S as isAbortError,A as isHelperError,N as mapError,F as mapResult,u as ok,z as serializeError,l as toError,I as tryCatch,_ as tryCatchAsync,C as unwrap,L as unwrapOr};
package/dist/fn/index.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as c,toError as u,tryCatch as d}from"../error/index.js";import{debounce as m,throttle as h,rafThrottle as G}from"./timing.js";import{memoize as T,memoizeOne as I}from"./memo.js";const i=()=>{};function p(n){return n}function A(n){return()=>n}function s(n){return(...e)=>!n(...e)}function b(n){let e;return(...o)=>{if(!e)try{e={ok:!0,value:n(...o)}}catch(t){e={ok:!1,error:t}}if(e.ok)return e.value;throw u(e.error)}}function a(n){if(!Number.isSafeInteger(n)||n<0)throw new c("HLP_FN_INVALID_COUNT","Count must be a non-negative integer.")}function x(n,e){a(n);let o=0,t;return(...r)=>(o++,o<n&&(t=e(...r)),t)}function B(n,e){a(n);let o=0;return(...t)=>(o++,o>=n?e(...t):void 0)}function C(n,...e){return(...o)=>{let t=n(...o);for(const r of e)t=r(t);return t}}function D(...n){return(...e)=>{let o=n.length-1;const t=n[o];if(!t)return e[0];let r=t(...e);for(o--;o>=0;o--)r=n[o](r);return r}}function k(n){return e=>(n(e),e)}function w(n){return d(n)}function g(n,e,...o){return n?e(...o):void 0}function E(n,e){try{return n()}catch(o){e?.(u(o));return}}function l(n){return e=>n(e)}export{B as after,w as attempt,x as before,g as callIf,D as compose,A as constant,m as debounce,p as identity,T as memoize,I as memoizeOne,s as negate,i as noop,b as once,C as pipe,G as rafThrottle,E as safeCall,k as tap,h as throttle,l as unary};
package/dist/fn/memo.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as c}from"../error/index.js";function x(o,t={}){const e=t.maxSize??1e3;if(!Number.isSafeInteger(e)||e<1)throw new c("HLP_FN_INVALID_SIZE","maxSize must be a positive integer.");const r=t.ttlMs;if(r!==void 0&&(!Number.isFinite(r)||r<=0))throw new c("HLP_FN_INVALID_TTL","ttlMs must be a finite number greater than zero.");const a=t.key??((...i)=>i[0]),d=t.now??Date.now,n=new Map,s=(...i)=>{const u=a(...i),l=n.get(u);if(l&&(n.delete(u),l.expires>d()))return n.set(u,l),l.value;const m=o(...i);if(n.set(u,{value:m,expires:r===void 0?1/0:d()+r}),n.size>e){const f=n.keys().next();f.done||n.delete(f.value)}return m};return s.clear=()=>{n.clear()},s.delete=(...i)=>n.delete(a(...i)),Object.defineProperty(s,"size",{get:()=>n.size,enumerable:!0}),s}function z(o,t=A){let e;return(...r)=>{if(e&&t(r,e.args))return e.value;const a=o(...r);return e={args:r,value:a},a}}function A(o,t){if(o.length!==t.length)return!1;for(let e=0;e<o.length;e++)if(!Object.is(o[e],t[e]))return!1;return!0}export{x as memoize,z as memoizeOne};
package/dist/fn/timing.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as p}from"../error/index.js";function h(a,n){if(!Number.isFinite(a)||a<0)throw new p("HLP_FN_INVALID_WAIT","Wait must be a finite number of milliseconds >= 0.",{details:{name:n}})}function W(a,n,t={}){h(n,"wait");const f=t.leading??!1,c=t.trailing??!0;let d;t.maxWait!==void 0&&(h(t.maxWait,"maxWait"),d=Math.max(t.maxWait,n));let u,o,i,l,s=0;const A=e=>{const r=u;return u=void 0,s=e,r&&(o=a(...r)),o},R=e=>{const r=e-(l??0),g=n-r;return d===void 0?g:Math.min(g,d-(e-s))},T=e=>{if(l===void 0)return!0;const r=e-l;return r>=n||r<0||d!==void 0&&e-s>=d},x=e=>(i=void 0,c&&u?A(e):(u=void 0,o)),m=()=>{const e=Date.now();if(T(e)){x(e);return}i=setTimeout(m,R(e))},v=e=>(s=e,i=setTimeout(m,n),f?A(e):o),b=(...e)=>{const r=Date.now(),g=T(r);if(u=e,l=r,g){if(i===void 0)return v(r);if(d!==void 0)return clearTimeout(i),i=setTimeout(m,n),A(r)}return i??=setTimeout(m,n),o};return b.cancel=()=>{i!==void 0&&clearTimeout(i),s=0,u=l=i=void 0},b.flush=()=>i===void 0?o:(clearTimeout(i),x(Date.now())),b.pending=()=>i!==void 0,b}function y(a,n,t={}){return W(a,n,{leading:t.leading??!0,trailing:t.trailing??!0,maxWait:n})}function D(a){let n,t;const f=()=>{t=void 0;const d=n;n=void 0,d&&a(...d)},c=(...d)=>{if(n=d,t)return;const u=typeof globalThis.requestAnimationFrame=="function"?globalThis.requestAnimationFrame.bind(globalThis):void 0;if(u){const o=u(f);t=()=>{globalThis.cancelAnimationFrame(o)}}else{const o=setTimeout(f,16);t=()=>{clearTimeout(o)}}};return c.cancel=()=>{t?.(),t=void 0,n=void 0},c}export{W as debounce,D as rafThrottle,y as throttle};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as w}from"../error/index.js";import{isUnsafeKey as T}from"../internal/keys.js";import{safeFileName as L}from"../sanitize/index.js";const c=16384,A="!#$%&'*+-.^_`|~",M=e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||e.length===1&&A.includes(e)},R=e=>e===" "||e===" ";function l(e,t){if(e.length>t)throw new w("HLP_HTTP_HEADER_TOO_LONG","The header value exceeds the length limit.",{details:{max:t}})}class g{constructor(t){this.s=t}s;i=0;get done(){return this.i>=this.s.length}peek(){return this.s.charAt(this.i)}ows(){for(;this.i<this.s.length&&R(this.s.charAt(this.i));)this.i++}eat(t){return this.s.charAt(this.i)===t?(this.i++,!0):!1}token(){const t=this.i;for(;this.i<this.s.length&&M(this.s.charAt(this.i));)this.i++;return this.s.slice(t,this.i)}quoted(){if(!this.eat('"'))return;let t="";for(;this.i<this.s.length;){const r=this.s.charAt(this.i++);if(r==='"')return t;r==="\\"&&this.i<this.s.length?t+=this.s.charAt(this.i++):t+=r}}value(){return this.peek()==='"'?this.quoted():this.token()}skipPast(t){for(;this.i<this.s.length;){const r=this.s.charAt(this.i);if(r==='"'){if(this.quoted()===void 0)return;continue}if(this.i++,r===t)return}}}function p(e,t){const r=[];for(;;){if(e.ows(),e.done||t&&e.peek()===",")return r;if(!e.eat(";")){e.i++;continue}e.ows();const n=e.token().toLowerCase();e.ows();let o="";e.eat("=")&&(e.ows(),o=e.value()??""),n!==""&&r.push([n,o])}}function y(e){const t={};for(const[r,n]of e)!T(r)&&!Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=n);return t}function k(e){const t=e.indexOf("'"),r=t<0?-1:e.indexOf("'",t+1);if(r<0)return;const n=e.slice(0,t).toLowerCase(),o=e.slice(r+1),i=[];for(let s=0;s<o.length;s++){const a=o.charAt(s);if(a==="%"){const d=o.slice(s+1,s+3);if(!/^[\da-f]{2}$/i.test(d))return;i.push(parseInt(d,16)),s+=2}else{const d=a.charCodeAt(0);if(d>126||d<=32)return;i.push(d)}}if(n==="utf-8")try{return new TextDecoder("utf-8",{fatal:!0}).decode(Uint8Array.from(i))}catch{return}if(n==="iso-8859-1")return String.fromCharCode(...i)}function O(e){if(typeof e!="string"||e.length>1024)return;const t=new g(e.trim()),r=t.token().toLowerCase();if(r===""||!t.eat("/"))return;const n=t.token().toLowerCase();if(n==="")return;const o=y(p(t,!1));o.charset!==void 0&&(o.charset=o.charset.toLowerCase());const i=n.lastIndexOf("+");return{type:r,subtype:n,suffix:i>0?n.slice(i):"",mediaType:`${r}/${n}`,params:o}}function z(e){const t=O(e);return t!==void 0&&(t.mediaType==="application/json"||t.suffix==="+json")}function K(e){if(typeof e!="string")return;l(e,c);const t=new g(e.trim()),r=t.token().toLowerCase();if(r==="")return;const n=y(p(t,!1)),i=(n["filename*"]===void 0?void 0:k(n["filename*"]))??n.filename;let s;if(i!==void 0){const a=i.slice(Math.max(i.lastIndexOf("/"),i.lastIndexOf("\\"))+1);s=L(a)}return{type:r,filename:i,safeFilename:s,params:n}}const N=2147483648,E=e=>{if(!(typeof e!="string"||!/^\d{1,19}$/.test(e)))return Math.min(Number(e),N)};function v(e){const t={};if(typeof e=="string"){l(e,c);const i=new g(e);for(;!i.done;){i.ows();const s=i.token().toLowerCase();i.ows();let a=!0;i.eat("=")&&(i.ows(),a=i.value()??""),s!==""&&!T(s)&&!Object.prototype.hasOwnProperty.call(t,s)&&(t[s]=a),i.skipPast(",")}}const r=i=>Object.prototype.hasOwnProperty.call(t,i),n={noCache:r("no-cache"),noStore:r("no-store"),noTransform:r("no-transform"),mustRevalidate:r("must-revalidate"),proxyRevalidate:r("proxy-revalidate"),mustUnderstand:r("must-understand"),private:r("private"),public:r("public"),immutable:r("immutable"),onlyIfCached:r("only-if-cached"),directives:t},o=(i,s)=>{const a=E(t[s]);a!==void 0&&(n[i]=a)};return o("maxAge","max-age"),o("sMaxAge","s-maxage"),o("staleWhileRevalidate","stale-while-revalidate"),o("staleIfError","stale-if-error"),o("minFresh","min-fresh"),t["max-stale"]===!0?n.maxStale=1/0:o("maxStale","max-stale"),n}const S=e=>e===33||e>=35&&e<=126||e>=128&&e<=255;function b(e){if(typeof e!="string"||e.length>1024)return;const t=e.trim(),r=t.startsWith("W/"),n=r?t.slice(2):t;if(n.length<2||!n.startsWith('"')||!n.endsWith('"'))return;const o=n.slice(1,-1);for(let i=0;i<o.length;i++)if(!S(o.charCodeAt(i)))return;return{weak:r,tag:o}}function D(e){if(typeof e!="string")return[];if(l(e,c),e.trim()==="*")return"*";const t=[];let r=0;for(;r<e.length&&t.length<1e3;){const n=e.indexOf('"',r);if(n<0)break;const o=e.indexOf('"',n+1);if(o<0)break;const i=e.slice(Math.max(0,n-2),n)==="W/",s=b((i?"W/":"")+e.slice(n,o+1));s&&t.push(s),r=o+1}return t}function _(e,t,r={}){const n=typeof e=="string"||e===null||e===void 0?b(e):e,o=typeof t=="string"||t===null||t===void 0?b(t):t;return!n||n.tag!==o?.tag?!1:r.weak!==!1||!n.weak&&!o.weak}function J(e,t,r={}){const n=D(e);return n==="*"?t!=null:n.some(o=>_(o,t,r))}function G(e,t=50){if(typeof e!="string")return[];l(e,4096);const r=[];for(const n of e.split(",").slice(0,t)){const[o="",...i]=n.split(";"),s=o.trim();if(!/^(?:\*|[a-z]{1,8}(?:-[\da-z]{1,8})*)$/i.test(s))continue;let a=1,d=!0;for(const h of i){const[u="",f=""]=h.split("=").map(m=>m.trim());u.toLowerCase()==="q"&&(/^(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?)$/.test(f)?a=Number(f):d=!1)}d&&a>0&&r.push({tag:s,q:a})}return r.map((n,o)=>({e:n,i:o})).sort((n,o)=>o.e.q-n.e.q||n.i-o.i).map(({e:n})=>n)}function P(e,t={}){const{baseUrl:r,maxLinks:n=100,maxLength:o=c}=t;if(typeof e!="string")return[];l(e,o);const i=new g(e),s=[];for(;!i.done;){if(i.ows(),i.eat(","))continue;if(!i.eat("<")){i.skipPast(",");continue}const a=e.indexOf(">",i.i);if(a<0)break;let d=e.slice(i.i,a).trim();i.i=a+1;const h=p(i,!0),u=y(h),f=u["title*"]===void 0?void 0:k(u["title*"]);f!==void 0&&(u["title*"]=f);const m=(u.rel??"").toLowerCase().split(/[\t ]+/).filter(C=>C!=="");if(r!==void 0)try{d=new URL(d,r).href}catch{continue}if(s.length>=n)throw new w("HLP_HTTP_TOO_MANY_LINKS","The Link header has too many links.",{details:{maxLinks:n}});s.push({uri:d,rel:m,params:u})}return s}function X(e,t){const r=typeof e=="string"||e===null||e===void 0?P(e,t===void 0?{}:{baseUrl:t}):e,n={};for(const o of r)for(const i of o.rel){const s=i==="previous"?"prev":i;(s==="next"||s==="prev"||s==="first"||s==="last")&&n[s]===void 0&&(n[s]=o.uri)}return n}const F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],I=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) ([A-Z][a-z]{2}) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,H=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-([A-Z][a-z]{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,W=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) ([A-Z][a-z]{2}) ([\d ]\d) (\d{2}):(\d{2}):(\d{2}) (\d{4})$/;function x(e,t,r,n,o,i){const s=F.indexOf(t);if(s<0||n>23||o>59||i>60)return;const a=Date.UTC(e,s,r,n,o,Math.min(i,59)),d=new Date(a);return d.getUTCDate()===r&&d.getUTCMonth()===s?a:void 0}function $(e,t=Date.now()){if(typeof e!="string"||e.length>64)return;const r=e.trim();let n=I.exec(r);if(n)return x(Number(n[3]),n[2]??"",Number(n[1]),Number(n[4]),Number(n[5]),Number(n[6]));if(n=H.exec(r),n){const o=new Date(t).getUTCFullYear();let i=Math.floor(o/100)*100+Number(n[3]);return i>o+50&&(i-=100),x(i,n[2]??"",Number(n[1]),Number(n[4]),Number(n[5]),Number(n[6]))}if(n=W.exec(r),n)return x(Number(n[6]),n[1]??"",Number((n[2]??"").trim()),Number(n[3]),Number(n[4]),Number(n[5]))}function Y(e,t=Date.now(),r={}){const{maxMs:n=36e5}=r;if(typeof e!="string")return;const o=e.trim();if(/^\d{1,12}$/.test(o))return Math.min(Number(o)*1e3,n);const i=$(o,t);if(i===void 0)return;const s=typeof t=="number"?t:t.getTime();return Math.min(Math.max(0,i-s),n)}export{k as decodeExtValue,_ as etagMatches,J as etagMatchesAny,X as getPaginationLinks,z as isJsonContentType,G as parseAcceptLanguage,v as parseCacheControl,K as parseContentDisposition,O as parseContentType,b as parseETag,D as parseETagList,$ as parseHttpDate,P as parseLinkHeader,Y as parseRetryAfter};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{httpStatus as s,statusText as a,isInformational as r,isSuccess as o,isRedirect as p,isClientError as i,isServerError as n,isRetryableStatus as y,DEFAULT_RETRYABLE_STATUSES as g,isIdempotentMethod as l,isSafeMethod as S,userMessageForStatus as u,DEFAULT_STATUS_MESSAGES as C,statusClass as E,statusMessageCatalog as c,localizedStatusMessages as T,composeStatusMessages as m,describeStatus as L}from"./status.js";import{parseContentType as M,isJsonContentType as f,parseContentDisposition as A,decodeExtValue as D,parseCacheControl as R,parseETag as h,parseETagList as x,etagMatches as F,etagMatchesAny as H,parseAcceptLanguage as b,parseLinkHeader as k,getPaginationLinks as P,parseHttpDate as U,parseRetryAfter as _}from"./headers.js";import{parseProblemDetails as O,problemToFieldErrors as v,isProblemDetails as z}from"./problem.js";import{assertResponse as G,classifyHttpError as J,safeUrlForLog as N}from"./response.js";import{httpFailureCategory as Y}from"../error/index.js";export{g as DEFAULT_RETRYABLE_STATUSES,C as DEFAULT_STATUS_MESSAGES,G as assertResponse,J as classifyHttpError,m as composeStatusMessages,D as decodeExtValue,L as describeStatus,F as etagMatches,H as etagMatchesAny,P as getPaginationLinks,Y as httpFailureCategory,s as httpStatus,i as isClientError,l as isIdempotentMethod,r as isInformational,f as isJsonContentType,z as isProblemDetails,p as isRedirect,y as isRetryableStatus,S as isSafeMethod,n as isServerError,o as isSuccess,T as localizedStatusMessages,b as parseAcceptLanguage,R as parseCacheControl,A as parseContentDisposition,M as parseContentType,h as parseETag,x as parseETagList,U as parseHttpDate,k as parseLinkHeader,O as parseProblemDetails,_ as parseRetryAfter,v as problemToFieldErrors,N as safeUrlForLog,E as statusClass,c as statusMessageCatalog,a as statusText,u as userMessageForStatus};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as y}from"../error/index.js";import{isUnsafeKey as l}from"../internal/keys.js";import{isPlainObject as d}from"../is/index.js";const g=new Set(["type","title","status","detail","instance"]);function P(n){if(!d(n))return!1;const{type:t,title:i,status:s,detail:e,instance:r}=n;return t!==void 0&&typeof t!="string"||i!==void 0&&typeof i!="string"||s!==void 0&&!(Number.isInteger(s)&&s>=100&&s<=599)||e!==void 0&&typeof e!="string"||r!==void 0&&typeof r!="string"?!1:t!==void 0||i!==void 0||s!==void 0}function p(n){let t=n.startsWith("#")?n.slice(1):n;if(!t.startsWith("/"))return t.startsWith("$.")?t.slice(2):t;t=t.slice(1);let i="";for(const s of t.split("/")){let e=s.replaceAll("~1","/").replaceAll("~0","~");try{e=decodeURIComponent(e)}catch{}i+=/^\d+$/.test(e)?`[${e}]`:i===""?e:`.${e}`}return i}const m=n=>{if(typeof n=="string")return n;if(Array.isArray(n))return n.find(t=>typeof t=="string")};function b(n,t=200){const i={};if(!d(n))return i;const s=d(n.extensions)?{...n.extensions,...n}:n,e=(o,a)=>{const u=typeof o=="string"?p(o.trim()):void 0,c=m(a);u===void 0||c===void 0||l(u)||Object.keys(i).length>=t||Object.prototype.hasOwnProperty.call(i,u)||(i[u]=c)},r=o=>{if(Array.isArray(o))for(const a of o.slice(0,t))d(a)&&e(a.pointer??a.field??a.name??a.path??a.propertyPath??a.parameter,a.detail??a.reason??a.message??a.title)};r(s["invalid-params"]),r(s.violations);const f=s.errors;if(Array.isArray(f))r(f);else if(d(f))for(const o of Object.keys(f).slice(0,t))e(o,f[o]);return i}function R(n,t={}){const{maxLength:i=1e6}=t;let s=n;if(typeof n=="string"){if(n.length>i)throw new y("HLP_HTTP_PROBLEM_TOO_LARGE","The problem details document is too large.",{details:{maxLength:i}});try{s=JSON.parse(n,(o,a)=>l(o)?void 0:a)}catch{return}}if(!d(s))return;const e=s,r={type:typeof e.type=="string"&&e.type!==""?e.type:"about:blank",extensions:{},fieldErrors:{}};typeof e.title=="string"&&(r.title=e.title),Number.isInteger(e.status)&&e.status>=100&&e.status<=599&&(r.status=e.status),typeof e.detail=="string"&&(r.detail=e.detail),typeof e.instance=="string"&&(r.instance=e.instance);const f={};for(const o of Object.keys(e))!g.has(o)&&!l(o)&&(f[o]=e[o]);if(r.extensions=f,r.fieldErrors=b(e),!(r.title===void 0&&r.status===void 0&&r.detail===void 0&&e.type===void 0))return r}export{P as isProblemDetails,R as parseProblemDetails,b as problemToFieldErrors};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{HelperError as p,HttpError as c,isAbortError as m}from"../error/index.js";import{isJsonContentType as y,parseContentType as T}from"./headers.js";import{isSuccess as h,statusText as w}from"./status.js";function x(t){try{const n=new URL(t);return`${n.origin==="null"?n.protocol:n.origin}${n.pathname}`}catch{const n=t.search(/[?#]/);return n<0?t:t.slice(0,n)}}function C(t,n={}){const{expectStatus:e=h,expectContentType:r,method:i}=n,o=t.status,f=typeof e=="function"?e(o):typeof e=="number"?o===e:e.includes(o),u={status:o,statusText:t.statusText!==void 0&&t.statusText!==""?t.statusText:w(o),...i===void 0?{}:{method:i.toUpperCase()},...t.url===void 0||t.url===""?{}:{url:x(t.url)}};if(!f)throw new c("HLP_HTTP_STATUS",`The server responded with an unexpected status (${o}).`,u);if(r===void 0||o===204||o===205||o===304)return;const a=t.headers.get("content-type");let s;if(r==="json")s=y(a);else{const d=T(a)?.mediaType;s=d!==void 0&&(typeof r=="string"?[r]:r).some(l=>l.toLowerCase()===d)}if(!s)throw new c("HLP_HTTP_CONTENT_TYPE","The server responded with an unexpected content type.",{...u,details:{expected:r}})}function H(t){if(typeof t!="object"||t===null)return"unknown";if(t.name==="TimeoutError"||t instanceof p&&t.kind==="timeout")return"timeout";if(m(t))return"aborted";const e=t.status;if(typeof e=="number"&&Number.isInteger(e)){if(e===0)return"network";if(e===401||e===403||e===407)return"auth";if(e===408||e===504)return"timeout";if(e>=400&&e<500)return"client";if(e>=500&&e<600)return"server"}return t instanceof p&&(t.kind==="unauthorized"||t.kind==="forbidden")?"auth":t instanceof TypeError?"network":"unknown"}export{C as assertResponse,H as classifyHttpError,x as safeUrlForLog};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  const C=Object.freeze({CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,IM_USED:226,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,CONTENT_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_CONTENT:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511}),l=new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[103,"Early Hints"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[208,"Already Reported"],[226,"IM Used"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Found"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[308,"Permanent Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Timeout"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Content Too Large"],[414,"URI Too Long"],[415,"Unsupported Media Type"],[416,"Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[421,"Misdirected Request"],[422,"Unprocessable Content"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Timeout"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[508,"Loop Detected"],[510,"Not Extended"],[511,"Network Authentication Required"]]);function E(e){return l.get(e)??""}const o=(e,t)=>Number.isInteger(e)&&e>=t&&e<t+100;function h(e){return o(e,100)}function g(e){return o(e,200)}function p(e){return o(e,300)}function R(e){return o(e,400)}function m(e){return o(e,500)}const S=new Set([408,425,429,500,502,503,504]);function _(e,t=S){return Array.isArray(t)?t.includes(e):t.has(e)}const s=new Set(["GET","HEAD","OPTIONS","TRACE"]),f=new Set([...s,"PUT","DELETE"]);function I(e){return f.has(e.toUpperCase())}function D(e){return s.has(e.toUpperCase())}const d=Object.freeze({0:"Unable to connect. Check your internet connection and try again.",100:"The server is ready to receive the rest of the request.",101:"The connection is switching to a different protocol.",102:"The server is still processing the request.",103:"The server is preparing the response.",200:"Done.",201:"Created.",202:"Accepted. It will be processed shortly.",203:"Done. The information came from another source and may differ from the original.",204:"Done.",205:"Done. Clear the form to continue.",206:"Part of the content was returned.",207:"Done. Some parts have their own results.",208:"Done. Some items were already included.",226:"Done.",300:"Several versions are available. Choose one to continue.",301:"This item has moved to a new address.",302:"This item is temporarily at a different address.",303:"The result is available at a different address.",304:"The item has not changed.",305:"This item must be accessed through a proxy.",307:"This item is temporarily at a different address.",308:"This item has moved to a new address.",400:"Some of the information is not valid. Check it and try again.",401:"Your session has ended. Sign in again to continue.",402:"Payment is required to do this.",403:"You do not have permission to do this. Contact your administrator if you need access.",404:"The item could not be found. It may have been moved or deleted.",405:"This action is not available. Reload the page and try again.",406:"The server cannot provide this in a supported format.",407:"Sign in to the proxy server to continue.",408:"The request took too long. Check your connection and try again.",409:"This item was changed by someone else. Reload it and try again.",410:"This item is no longer available.",411:"The request was incomplete. Try again.",412:"This item was changed by someone else. Reload it and try again.",413:"The file or data is too large. Reduce its size and try again.",414:"The request is too long. Shorten your search or filters and try again.",415:"This file type is not supported. Choose a different file and try again.",416:"The requested part of the file is not available.",417:"The server could not meet the requirements of the request. Try again.",418:"The server cannot do this.",421:"The request reached the wrong server. Try again.",422:"Some of the information is not valid. Check it and try again.",423:"This item is locked. Try again later or contact the person who is editing it.",424:"This could not be completed because a related action failed.",425:"The server is not ready to process this yet. Try again.",426:"This needs a newer connection. Update your browser or app and try again.",428:"Reload this item before changing it, then try again.",429:"Too many requests. Wait a moment and try again.",431:"The request is too large. Clear the cookies for this site and try again.",451:"This content is not available for legal reasons.",500:"Something went wrong on our side. Try again later.",501:"This action is not supported.",502:"The service is temporarily unavailable. Try again in a few minutes.",503:"The service is temporarily unavailable. Try again in a few minutes.",504:"The service is taking too long to respond. Try again in a few minutes.",505:"The server does not support this connection. Try again later.",506:"The server is not set up correctly. Try again later.",507:"The server is out of storage. Try again later.",508:"The server stopped processing this request. Try again later.",510:"The server needs more information to complete this.",511:"Sign in to the network (for example, a Wi-Fi sign-in page) to continue."});function u(e){return e===0?"network":h(e)?"informational":g(e)?"success":p(e)?"redirect":R(e)?"client-error":m(e)?"server-error":"unknown"}const y={network:d[0]??"",informational:"The request is in progress.",success:"Done.",redirect:"This item is at a different address.","client-error":"The request could not be completed. Check the information and try again.","server-error":"Something went wrong on our side. Try again later.",unknown:"Something unexpected happened. Try again."};function N(e,t){const n=t?.(e);return n!==void 0?n:d[e]??y[u(e)]}function O(e){return t=>Object.hasOwn(e,t)?e[t]:void 0}function b(e,t){const n=[],r=t.split("-");for(let a=r.length;a>0;a--){const T=r.slice(0,a).join("-"),i=Object.entries(e).find(([c])=>c.toLowerCase()===T.toLowerCase());i&&n.push(i[1])}return A(...n.map(O))}function A(...e){return t=>{for(const n of e){const r=n?.(t);if(r!==void 0)return r}}}function U(e,t){return{status:e,reason:E(e),message:N(e,t),statusClass:u(e)}}export{S as DEFAULT_RETRYABLE_STATUSES,d as DEFAULT_STATUS_MESSAGES,A as composeStatusMessages,U as describeStatus,C as httpStatus,R as isClientError,I as isIdempotentMethod,h as isInformational,p as isRedirect,_ as isRetryableStatus,D as isSafeMethod,m as isServerError,g as isSuccess,b as localizedStatusMessages,u as statusClass,O as statusMessageCatalog,E as statusText,N as userMessageForStatus};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import*as o from"./is/index.js";import*as e from"./convert/index.js";import*as a from"./error/index.js";import*as s from"./array/index.js";import*as t from"./set/index.js";import*as m from"./object/index.js";import*as p from"./linq/index.js";import*as f from"./string/index.js";import*as x from"./number/index.js";import*as n from"./decimal/index.js";import*as i from"./stats/index.js";import*as c from"./boolean/index.js";import*as d from"./compare/index.js";import*as l from"./random/index.js";import*as b from"./encoding/index.js";import*as u from"./zip/index.js";import*as v from"./url/index.js";import*as z from"./color/index.js";import*as g from"./json/index.js";import*as j from"./csv/index.js";import*as y from"./validate/index.js";import*as h from"./sanitize/index.js";import*as q from"./http/index.js";import*as C from"./fn/index.js";import*as k from"./async/index.js";import*as w from"./ds/index.js";import*as A from"./date/index.js";import*as B from"./timezone/index.js";import*as D from"./duration/index.js";import*as E from"./business-calendar/index.js";export{s as array,k as async,c as boolean,E as businessCalendar,z as color,d as compare,e as convert,j as csv,A as date,n as decimal,w as ds,D as duration,b as encoding,a as error,C as fn,q as http,o as is,g as json,p as linq,x as number,m as object,l as random,h as sanitize,t as set,i as stats,f as string,B as timezone,v as url,y as validate,u as zip};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as t}from"../error/index.js";const r=new Set(["__proto__","constructor","prototype"]);function n(o){return typeof o=="string"&&r.has(o)}function a(o){if(n(o))throw new t("HLP_UNSAFE_KEY","Refusing to use an unsafe object key.")}function s(o,e){return Object.prototype.hasOwnProperty.call(o,e)}export{a as assertSafeKey,s as hasOwn,n as isUnsafeKey};
package/dist/is/index.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as o}from"../error/index.js";function f(n){return n==null}function a(n){return n!=null}function l(n){return typeof n=="string"}function c(n){return typeof n=="number"}function i(n){return typeof n=="number"&&Number.isFinite(n)}function p(n){return Number.isInteger(n)}function y(n){return Number.isSafeInteger(n)}function b(n){return typeof n=="bigint"}function w(n){return typeof n=="boolean"}function k(n){return typeof n=="symbol"}function g(n){return typeof n=="function"}function d(n){return typeof n=="object"&&n!==null}function r(n){if(typeof n!="object"||n===null)return!1;const e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function x(n){return Array.isArray(n)}function m(n){return Array.isArray(n)&&n.length>0}function u(n){return n instanceof Date&&!Number.isNaN(n.getTime())}function A(n){return n instanceof Date}function T(n){return n instanceof RegExp}function N(n){return n instanceof Map}function S(n){return n instanceof Set}function h(n){return n instanceof Error}function j(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&typeof n.then=="function"}function I(n){return n!=null&&typeof n[Symbol.iterator]=="function"}function B(n){return n!=null&&typeof n[Symbol.asyncIterator]=="function"}function E(n){return n instanceof ArrayBuffer||ArrayBuffer.isView(n)}function O(n){return n===null||typeof n!="object"&&typeof n!="function"}function D(n){return n==null?!0:typeof n=="string"||Array.isArray(n)?n.length===0:n instanceof Map||n instanceof Set?n.size===0:ArrayBuffer.isView(n)||n instanceof ArrayBuffer?n.byteLength===0:r(n)?Object.keys(n).length===0:!1}function P(n){return n==null||typeof n=="string"&&n.trim().length===0}function R(n,e){return e.includes(n)}function L(n,e){return typeof n=="object"&&n!==null&&Object.prototype.hasOwnProperty.call(n,e)}function V(){return typeof globalThis.document<"u"||typeof globalThis.self<"u"&&typeof globalThis.importScripts=="function"}function t(n,e){throw new o("HLP_TYPE_ASSERTION",`Expected ${n}.`,e===void 0?{}:{details:{name:e}})}function F(n,e){typeof n!="string"&&t("a string",e)}function K(n,e){i(n)||t("a finite number",e)}function M(n,e){Number.isInteger(n)||t("an integer",e)}function v(n,e){typeof n!="boolean"&&t("a boolean",e)}function _(n,e){r(n)||t("a plain object",e)}function z(n,e){Array.isArray(n)||t("an array",e)}function H(n,e){n==null&&t("a defined value",e)}function Y(n,e){u(n)||t("a valid Date",e)}export{z as assertArray,v as assertBoolean,H as assertDefined,K as assertFiniteNumber,M as assertInteger,_ as assertPlainObject,F as assertString,Y as assertValidDate,L as hasKey,x as isArray,B as isAsyncIterable,b as isBigInt,E as isBinary,P as isBlank,w as isBoolean,V as isBrowserLike,A as isDate,a as isDefined,D as isEmpty,h as isError,i as isFiniteNumber,g as isFunction,p as isInteger,I as isIterable,N as isMap,f as isNil,m as isNonEmptyArray,c as isNumber,d as isObject,R as isOneOf,r as isPlainObject,O as isPrimitive,j as isPromiseLike,T as isRegExp,y as isSafeInteger,S as isSet,l as isString,k as isSymbol,u as isValidDate};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{safeJsonParse as t,parseJsonOrThrow as r,isValidJson as s}from"./parse.js";import{safeJsonStringify as a,canonicalJson as p,prettyJson as i,jsonByteSize as y}from"./stringify.js";import{parsePointer as J,formatPointer as f,getByPointer as c,hasPointer as h,setByPointer as m,removeByPointer as O}from"./pointer.js";import{applyJsonPatch as S,tryApplyJsonPatch as d,createJsonPatch as l,applyMergePatch as x,createMergePatch as j}from"./patch.js";import{parseNdjson as v,stringifyNdjson as N}from"./ndjson.js";export{S as applyJsonPatch,x as applyMergePatch,p as canonicalJson,l as createJsonPatch,j as createMergePatch,f as formatPointer,c as getByPointer,h as hasPointer,s as isValidJson,y as jsonByteSize,r as parseJsonOrThrow,v as parseNdjson,J as parsePointer,i as prettyJson,O as removeByPointer,t as safeJsonParse,a as safeJsonStringify,m as setByPointer,N as stringifyNdjson,d as tryApplyJsonPatch};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{isPlainObject as f}from"../is/index.js";import{hasOwn as C}from"../internal/keys.js";import{daysInMonth as O}from"../date/plain-date.js";function D(n){return Array.isArray(n)||f(n)}function j(n){return Array.isArray(n)?n.slice():Object.getPrototypeOf(n)===null?Object.assign(Object.create(null),n):{...n}}function p(n){if(Array.isArray(n))return n.map(p);if(f(n)){const r=j(n);for(const e of Object.keys(r))r[e]=p(r[e]);return r}return n}function b(n,r){if(n===r)return!0;if(Array.isArray(n)){if(!Array.isArray(r)||n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(!b(n[e],r[e]))return!1;return!0}if(f(n)&&f(r)){const e=Object.keys(n);if(e.length!==Object.keys(r).length)return!1;for(const t of e)if(!C(r,t)||!b(n[t],r[t]))return!1;return!0}return!1}const J=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:\d{2})$/;function E(n){if(n.length<17||n.length>40)return;const r=J.exec(n);if(!r)return;const[,e="",t="",o="",A="",N="",w="0",x="",s="Z"]=r;if(e==="-000000")return;const d=Number(e),i=Number(t),u=Number(o),l=Number(A),m=Number(N),a=Number(w);if(i<1||i>12||u<1||u>O(d,i)||l>23||m>59||a>59)return;let h=0;if(s!=="Z"){const g=Number(s.slice(1,3)),k=Number(s.slice(4,6));if(g>23||k>59)return;h=(s.startsWith("-")?-1:1)*(g*60+k)}const c=new Date(0);c.setUTCFullYear(d,i-1,u),c.setUTCHours(l,m-h,a,Math.floor(+`0.${x||"0"}`*1e3));const y=c.getTime();return Number.isNaN(y)?void 0:y}function M(n){let r=0;for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);if(t<128)r+=1;else if(t<2048)r+=2;else if(t>=55296&&t<=56319&&e+1<n.length){const o=n.charCodeAt(e+1);o>=56320&&o<=57343?(r+=4,e++):r+=3}else r+=3}return r}export{p as cloneJson,j as copyJsonContainer,D as isJsonContainer,b as jsonEqual,E as parseIsoDateTimeWithZone,M as utf8Length};
@@ -1,4 +1,4 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{HelperError as _,LimitError as p,ValidationError as O,err as a,ok as S}from"../error/index.js";import{safeJsonParse as c}from"./parse.js";import{safeJsonStringify as h}from"./stringify.js";function w(n,l={}){const{maxLength:e=1e8,maxLineLength:f=1e7,maxLines:r=1e6,onError:L="fail",onLineError:N,...g}=l;if(typeof n!="string")return a(new O("HLP_JSON_INVALID_INPUT","JSON input must be a string."));if(n.length>e)return a(new p("HLP_JSON_TOO_LONG","NDJSON text exceeds the maximum length.",{details:{maxLength:e}}));const d=[];let u=0,i=0;for(;i<=n.length;){let s=n.indexOf(`
3
3
  `,i);s===-1&&(s=n.length),u++;let o=n.slice(i,s);if(i=s+1,o.endsWith("\r")&&(o=o.slice(0,-1)),o.trim()==="")continue;if(d.length>=r)return a(new p("HLP_JSON_TOO_MANY_LINES","NDJSON has too many records.",{details:{maxLines:r}}));const t=c(o,{...g,maxLength:f});if(t.ok){d.push(t.value);continue}const m=new _(t.error.code,"An NDJSON line is not valid.",{kind:t.error.kind,details:{...t.error.details,line:u}});if(L==="fail")return a(m);N?.(u,m)}return S(d)}function x(n,l={}){let e="";for(const f of n){const r=h(f,l);if(r===void 0)throw new O("HLP_JSON_NOT_SERIALIZABLE","A value cannot be represented as JSON.");e+=`${r}
4
4
  `}return e}export{w as parseNdjson,x as stringifyNdjson};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{HelperError as p,LimitError as w,ValidationError as d,err as O,ok as P}from"../error/index.js";import{isUnsafeKey as _}from"../internal/keys.js";import{parseIsoDateTimeWithZone as m}from"./internal.js";const N=1e7;function x(e,n){let r=0,a=!1;for(let t=0;t<e.length;t++){const s=e.charCodeAt(t);if(a)s===92?t++:s===34&&(a=!1);else if(s===34)a=!0;else if(s===123||s===91){if(++r>n)return!1}else(s===125||s===93)&&r--}return!0}function g(e){const n=[];e.dates&&n.push((a,t)=>{if(typeof t!="string")return t;const s=m(t);return s===void 0?t:new Date(s)});const{reviver:r}=e;if(typeof r=="function"?n.push(r):r&&n.push(...r),n.length!==0)return n.length===1?n[0]:(a,t,s)=>{let f=t;for(const l of n)if(f=l(a,f,s),f===void 0)return;return f}}function v(e,n){const{maxLength:r=N,maxDepth:a=256,maxKeys:t=1e4,unsafeKeys:s="error"}=n;if(typeof e!="string")throw new d("HLP_JSON_INVALID_INPUT","JSON input must be a string.");if(e.length>r)throw new w("HLP_JSON_TOO_LONG","JSON text exceeds the maximum length.",{details:{maxLength:r}});if(!x(e,a))throw new w("HLP_JSON_TOO_DEEP","JSON nesting exceeds the maximum depth.",{details:{maxDepth:a}});let f;try{f=JSON.parse(e)}catch{throw new d("HLP_JSON_SYNTAX","The text is not valid JSON.")}const l=g(n),c=(k,y,i)=>{if(typeof i=="object"&&i!==null)if(Array.isArray(i))for(let o=0;o<i.length;o++)i[o]=c(i,String(o),i[o]);else{const o=i,h=Object.keys(o);if(h.length>t)throw new w("HLP_JSON_TOO_MANY_KEYS","A JSON object has too many keys.",{details:{maxKeys:t}});for(const u of h){if(_(u)){if(s==="error")throw new d("HLP_JSON_UNSAFE_KEY","JSON contains an unsafe object key.");Reflect.deleteProperty(o,u);continue}const J=c(o,u,o[u]);J===void 0?Reflect.deleteProperty(o,u):o[u]=J}}if(!l)return i;try{return l(y,i,k)}catch(o){throw o instanceof p?o:new p("HLP_JSON_REVIVER","A JSON reviver failed.",{cause:o,kind:"validation"})}};return c({"":f},"",f)}function T(e){return e instanceof p?e:new p("HLP_JSON_PARSE","JSON parsing failed.",{cause:e})}function S(e,n={}){try{const r=v(e,n);return n.validate&&!n.validate(r)?O(new d("HLP_JSON_SHAPE","JSON does not have the expected shape.")):P(r)}catch(r){return O(T(r))}}function L(e,n={}){const r=S(e,n);if(!r.ok)throw r.error;return r.value}function b(e,n={}){return S(e,n).ok}export{b as isValidJson,L as parseJsonOrThrow,S as safeJsonParse};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{HelperError as h,LimitError as S,ValidationError as J,err as T,ok as C}from"../error/index.js";import{isPlainObject as u}from"../is/index.js";import{assertSafeKey as w,hasOwn as l}from"../internal/keys.js";import{cloneJson as L,copyJsonContainer as _,isJsonContainer as R,jsonEqual as P}from"./internal.js";import{arrayIndex as g,formatPointer as y,found as E,parsePointer as j,resolve as I}from"./pointer.js";class b extends Error{constructor(o,n){super(n);this.code=o;this.text=n}code;text}const A=(i,r)=>{throw new b(i,r)},p=()=>A("HLP_JSON_PATCH_PATH_NOT_FOUND","A patch path does not resolve to a value."),d=()=>A("HLP_JSON_PATCH_INVALID","A patch operation is not valid.");class D{root;copied=new WeakSet;constructor(r){this.root=r}own(r){if(!R(r))return p();if(this.copied.has(r))return r;const o=_(r);return this.copied.add(o),o}parent(r){for(const n of r)w(n);this.root=this.own(this.root);let o=this.root;for(let n=0;n<r.length-1;n++){const e=r[n]??"";let s=e;Array.isArray(o)?s=g(o,e,!1)??p():l(o,e)||p();const c=this.own(o[s]);o[s]=c,o=c}return o}add(r,o){if(r.length===0){this.root=o;return}const n=this.parent(r),e=r[r.length-1]??"";Array.isArray(n)?n.splice(g(n,e,!0)??p(),0,o):n[e]=o}remove(r){r.length===0&&d();const o=this.parent(r),n=r[r.length-1]??"";Array.isArray(o)?o.splice(g(o,n,!1)??p(),1):l(o,n)?Reflect.deleteProperty(o,n):p()}replace(r,o){if(r.length===0){this.root=o;return}const n=this.parent(r),e=r[r.length-1]??"";Array.isArray(n)?n[g(n,e,!1)??p()]=o:l(n,e)?n[e]=o:p()}get(r){const o=I(this.root,r);return E(o)?o:p()}}function O(i,r){const o=i[r];if(typeof o!="string")return d();try{return j(o)}catch(n){if(n instanceof h&&n.kind==="limit")throw n;return d()}}function v(i){return l(i,"value")?i.value:d()}function H(i,r,o){const{maxOperations:n=1e4}=o;if(!Array.isArray(r))throw new J("HLP_JSON_PATCH_INVALID","A JSON Patch must be an array.");if(r.length>n)throw new S("HLP_JSON_PATCH_TOO_LARGE","The JSON Patch has too many operations.",{details:{maxOperations:n}});const e=new D(i);return r.forEach((s,c)=>{try{u(s)||d();const t=s,a=O(t,"path");switch(t.op){case"add":e.add(a,v(t));break;case"remove":e.remove(a);break;case"replace":e.replace(a,v(t));break;case"move":{const f=O(t,"from");f.length<a.length&&f.every((k,m)=>k===a[m])&&d();const N=e.get(f);if(f.length===a.length&&f.every((k,m)=>k===a[m]))break;e.remove(f),e.add(a,N);break}case"copy":e.add(a,L(e.get(O(t,"from"))));break;case"test":P(e.get(a),v(t))||A("HLP_JSON_PATCH_TEST_FAILED","A JSON Patch test operation failed.");break;default:d()}}catch(t){const a={operation:c};throw t instanceof b?new J(t.code,t.text,{details:a}):t instanceof h?new h(t.code,t.message,{details:a,kind:t.kind}):t}}),e.root}function U(i,r,o={}){return H(i,r,o)}function W(i,r,o={}){try{return C(H(i,r,o))}catch(n){return T(n instanceof h?n:new h("HLP_JSON_PATCH_FAILED","The JSON Patch could not be applied.",{cause:n}))}}function z(i,r){const o=[],n=(e,s,c)=>{if(Array.isArray(e)&&Array.isArray(s)){const t=Math.min(e.length,s.length);for(let a=0;a<t;a++)n(e[a],s[a],[...c,a]);for(let a=t;a<s.length;a++)o.push({op:"add",path:y([...c,a]),value:s[a]});for(let a=e.length-1;a>=t;a--)o.push({op:"remove",path:y([...c,a])});return}if(u(e)&&u(s)){for(const t of Object.keys(e))l(s,t)?n(e[t],s[t],[...c,t]):o.push({op:"remove",path:y([...c,t])});for(const t of Object.keys(s))l(e,t)||o.push({op:"add",path:y([...c,t]),value:s[t]});return}P(e,s)||o.push({op:"replace",path:y(c),value:s})};return n(i,r,[]),o}function F(i,r){if(!u(r))return r;const o=u(i)?_(i):{};for(const n of Object.keys(r)){w(n);const e=r[n];e===null?Reflect.deleteProperty(o,n):o[n]=F(l(o,n)?o[n]:void 0,e)}return o}function x(i,r){if(!u(i)||!u(r))return r;const o={};for(const n of Object.keys(i))l(r,n)||(w(n),o[n]=null);for(const n of Object.keys(r))l(i,n)&&P(i[n],r[n])||(w(n),o[n]=l(i,n)?x(i[n],r[n]):r[n]);return o}export{U as applyJsonPatch,F as applyMergePatch,z as createJsonPatch,x as createMergePatch,W as tryApplyJsonPatch};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as h,ValidationError as y}from"../error/index.js";import{assertSafeKey as N,hasOwn as m}from"../internal/keys.js";import{copyJsonContainer as P,isJsonContainer as O}from"./internal.js";const _=1e5,x=/^(?:0|[1-9]\d{0,14})$/,f=()=>{throw new y("HLP_JSON_POINTER_INVALID","The JSON Pointer is not valid.")},c=()=>{throw new y("HLP_JSON_POINTER_NOT_FOUND","The JSON Pointer does not resolve to a value.")};function I(e){if(!e.includes("~"))return e;for(let n=0;n<e.length;n++)e[n]==="~"&&e[n+1]!=="0"&&e[n+1]!=="1"&&f();return e.replace(/~1/g,"/").replace(/~0/g,"~")}function a(e){if(typeof e!="string"&&f(),e.length>_)throw new h("HLP_JSON_POINTER_TOO_LONG","The JSON Pointer is too long.");let n=e;if(n.startsWith("#"))try{n=decodeURIComponent(n.slice(1))}catch{f()}return n===""?[]:(n.startsWith("/")||f(),n.slice(1).split("/").map(I))}function T(e,n={}){const r=e.map(t=>String(t).replace(/~/g,"~0").replace(/\//g,"~1"));return n.fragment?`#${r.map(t=>`/${encodeURIComponent(t)}`).join("")}`:r.map(t=>`/${t}`).join("")}function d(e,n,r){if(n==="-")return r?e.length:void 0;if(!x.test(n))return;const t=Number(n);return t<e.length||r&&t===e.length?t:void 0}const u=Symbol("missing");function g(e,n){let r=e;for(const t of n)if(Array.isArray(r)){const o=d(r,t,!1);if(o===void 0)return u;r=r[o]}else if(typeof r=="object"&&r!==null&&m(r,t))r=r[t];else return u;return r}function b(e){return e!==u}function k(e,n){const r=g(e,a(n));return r===u?void 0:r}function R(e,n){return g(e,a(n))!==u}function w(e,n,r){for(const o of n)N(o);const t=(o,i)=>{if(!O(o))return c();const s=P(o),l=n[i]??"";if(i===n.length-1)r(s,l);else{const p=g(o,[l]);p===u&&c(),s[Array.isArray(s)?String(d(s,l,!1)):l]=t(p,i+1)}return s};return t(e,0)}function v(e,n,r){const t=a(n);return t.length===0?r:w(e,t,(o,i)=>{if(Array.isArray(o)){const s=d(o,i,!0);s===void 0?c():o[s]=r}else o[i]=r})}function C(e,n){const r=a(n);return r.length===0?f():w(e,r,(t,o)=>{if(Array.isArray(t)){const i=d(t,o,!1);i===void 0?c():t.splice(i,1)}else m(t,o)?Reflect.deleteProperty(t,o):c()})}export{d as arrayIndex,w as editAt,T as formatPointer,b as found,k as getByPointer,R as hasPointer,c as notFound,a as parsePointer,C as removeByPointer,g as resolve,v as setByPointer};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as x,ValidationError as p}from"../error/index.js";import{utf8Length as v}from"./internal.js";function J(s,o,a){o==="__proto__"?Object.defineProperty(s,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):s[o]=a}function j(s){return typeof s.toJSON=="function"}function _(s,o={}){const{circular:a="placeholder",circularPlaceholder:b="[Circular]",bigint:m="string",map:t="entries",date:c="iso",error:w="object",indent:g,maxLength:f}=o,d=new Set,u=(L,N)=>{let r=L;if(typeof r=="bigint"){if(m==="error")throw new p("HLP_JSON_BIGINT","BigInt values cannot be serialized.");return r.toString()}if(typeof r!="object"||r===null)return r;if(r instanceof Date){const e=r.getTime();return c==="epoch"?Number.isNaN(e)?null:e:Number.isNaN(e)?null:r.toISOString()}if(r instanceof Number||r instanceof String||r instanceof Boolean)return r.valueOf();if(j(r)&&(r=r.toJSON(N),typeof r!="object"||r===null))return u(r,N);const n=r;if(d.has(n)){if(a==="error")throw new p("HLP_JSON_CIRCULAR","The value contains a circular reference.");return b}d.add(n);let l;if(n instanceof Map)if(t==="object"){const e={};for(const[i,S]of n){const y=u(i,""),h=typeof y=="string"?y:JSON.stringify(y)??"";J(e,h,u(S,h))}l=e}else l=[...n].map(([e,i],S)=>[u(e,String(S)),u(i,String(S))]);else if(n instanceof Set)l=[...n].map((e,i)=>u(e,String(i)));else if(n instanceof Error)if(w==="message")l=n.message;else{const e=n.code;l={name:n.name,message:n.message,...typeof e=="string"?{code:e}:{}}}else if(Array.isArray(n))l=n.map((e,i)=>u(e,String(i)));else if(ArrayBuffer.isView(n)&&!(n instanceof DataView))l=Array.from(n,(e,i)=>u(e,String(i)));else{const e={};for(const i of Object.keys(n))J(e,i,u(n[i],i));l=e}return d.delete(n),l},k=JSON.stringify(u(s,""),null,g);if(k!==void 0&&f!==void 0&&k.length>f)throw new x("HLP_JSON_TOO_LONG","JSON output exceeds the maximum length.",{details:{maxLength:f}});return k}const O=()=>{throw new p("HLP_JSON_NOT_SERIALIZABLE","The value cannot be represented as canonical JSON.")};function I(s){const o=new Set,a=(b,m)=>{let t=b;switch(typeof t=="object"&&t!==null&&j(t)&&(t=t.toJSON(m)),(t instanceof Number||t instanceof String||t instanceof Boolean)&&(t=t.valueOf()),typeof t){case"string":return JSON.stringify(t);case"boolean":return t?"true":"false";case"number":return Number.isFinite(t)?JSON.stringify(t):O();case"bigint":return O();case"undefined":case"function":case"symbol":return;default:break}if(t===null)return"null";const c=t;if(o.has(c))throw new p("HLP_JSON_CIRCULAR","The value contains a circular reference.");o.add(c);let w;if(Array.isArray(c))w=`[${c.map((g,f)=>a(g,String(f))??"null").join(",")}]`;else{const g=[];for(const f of Object.keys(c).sort()){const d=a(c[f],f);d!==void 0&&g.push(`${JSON.stringify(f)}:${d}`)}w=`{${g.join(",")}}`}return o.delete(c),w};return a(s,"")??O()}function P(s,o=2){return _(s,{indent:o})??""}function T(s,o={}){const a=_(s,o);return a===void 0?0:v(a)}export{I as canonicalJson,T as jsonByteSize,P as prettyJson,_ as safeJsonStringify};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as s}from"../error/index.js";import*as t from"./operators.js";class n{#e;constructor(e){this.#e=e}[Symbol.iterator](){return this.#e[Symbol.iterator]()}pipe(...e){return e.reduce((r,i)=>i(r),this.#e)}#r(e){return new n(e(this.#e))}where(e){return this.#r(t.where(e))}whereType(e){return this.#r(t.whereType(e))}select(e){return this.#r(t.select(e))}selectMany(e,r){return r?this.#r(t.selectMany(e,r)):this.#r(t.selectMany(e))}orderBy(e,r){return new T(t.orderBy(e,r)(this.#e))}orderByDescending(e,r){return new T(t.orderByDescending(e,r)(this.#e))}reverse(){return this.#r(t.reverse())}groupBy(e,r,i){const m=r??(a=>a),o=t.groupBy(e,m)(this.#e);return new n(t.select(a=>i?i(a.key,new n(a.items)):new l(a.key,a.items))(o))}join(e,r,i,m){return this.#r(t.join(e,r,i,m))}groupJoin(e,r,i,m){return this.#r(t.groupJoin(e,r,i,(o,a)=>m(o,new n(a))))}leftJoin(e,r,i,m){return this.#r(t.leftJoin(e,r,i,m))}distinct(){return this.#r(t.distinct())}distinctBy(e){return this.#r(t.distinctBy(e))}union(e){return this.#r(t.union(e))}unionBy(e,r){return this.#r(t.unionBy(e,r))}intersect(e){return this.#r(t.intersect(e))}intersectBy(e,r){return this.#r(t.intersectBy(e,r))}except(e){return this.#r(t.except(e))}exceptBy(e,r){return this.#r(t.exceptBy(e,r))}concat(e){return this.#r(t.concat(e))}zip(e,r){return r?this.#r(t.zip(e,r)):this.#r(t.zip(e))}append(e){return this.#r(t.append(e))}prepend(e){return this.#r(t.prepend(e))}defaultIfEmpty(e){return this.#r(t.defaultIfEmpty(e))}chunk(e){return this.#r(t.chunk(e))}take(e){return this.#r(t.take(e))}takeWhile(e){return this.#r(t.takeWhile(e))}takeLast(e){return this.#r(t.takeLast(e))}skip(e){return this.#r(t.skip(e))}skipWhile(e){return this.#r(t.skipWhile(e))}skipLast(e){return this.#r(t.skipLast(e))}first(e){return t.first(e)(this.#e)}firstOrDefault(e,r){return t.firstOrDefault(e,r)(this.#e)}last(e){return t.last(e)(this.#e)}lastOrDefault(e,r){return t.lastOrDefault(e,r)(this.#e)}single(e){return t.single(e)(this.#e)}singleOrDefault(e,r){return t.singleOrDefault(e,r)(this.#e)}elementAt(e){return t.elementAt(e)(this.#e)}elementAtOrDefault(e,r){return t.elementAtOrDefault(e,r)(this.#e)}any(e){return t.any(e)(this.#e)}all(e){return t.all(e)(this.#e)}contains(e,r){return t.contains(e,r)(this.#e)}sequenceEqual(e,r){return t.sequenceEqual(e,r)(this.#e)}count(e){return t.count(e)(this.#e)}sum(e){return e?t.sum(e)(this.#e):t.sum()(this.#e)}average(e){return e?t.average(e)(this.#e):t.average()(this.#e)}min(e,r){return e?t.min(e,r)(this.#e):t.min()(this.#e)}max(e,r){return e?t.max(e,r)(this.#e):t.max()(this.#e)}minBy(e,r){return t.minBy(e,r)(this.#e)}maxBy(e,r){return t.maxBy(e,r)(this.#e)}aggregate(...e){return t.aggregate(...e)(this.#e)}toArray(){return[...this.#e]}toSet(){return new Set(this.#e)}toMap(e,r){return r?t.toMap(e,r)(this.#e):t.toMap(e)(this.#e)}toDictionary(e,r){return r?t.toMap(e,r)(this.#e):t.toMap(e)(this.#e)}toLookup(e,r){return r?t.toLookup(e,r)(this.#e):t.toLookup(e)(this.#e)}forEach(e){t.forEach(e)(this.#e)}}class T extends n{#e;constructor(e){super(e),this.#e=e}thenBy(e,r){return new T(this.#e.thenBy(e,r))}thenByDescending(e,r){return new T(this.#e.thenByDescending(e,r))}}class l extends n{key;constructor(e,r){super(r),this.key=e}}function d(u){return u instanceof n?u:new n(u)}function p(u,e){if(t.assertCount(e),!Number.isFinite(u))throw new s("HLP_LINQ_INVALID_ARGUMENT","Range start must be finite.");return new n({*[Symbol.iterator](){for(let r=0;r<e;r++)yield u+r}})}function c(u,e){return t.assertCount(e),new n({*[Symbol.iterator](){for(let r=0;r<e;r++)yield u}})}function h(){return new n([])}export{n as Enumerable,l as EnumerableGrouping,T as OrderedEnumerable,h as empty,d as from,p as range,c as repeat};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  export*from"./operators.js";import{Enumerable as o,EnumerableGrouping as a,OrderedEnumerable as n,empty as p,from as t,range as u,repeat as b}from"./enumerable.js";export{o as Enumerable,a as EnumerableGrouping,n as OrderedEnumerable,p as empty,t as from,u as range,b as repeat};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ConflictError as g,NotFoundError as w,ValidationError as D}from"../error/index.js";const a=e=>({[Symbol.iterator]:e}),I=(e,n)=>e===n||e!==e&&n!==n,s=()=>new w("HLP_LINQ_NO_ELEMENTS","The sequence contains no matching element."),v=()=>new g("HLP_LINQ_MULTIPLE_ELEMENTS","The sequence contains more than one matching element."),L=()=>new w("HLP_LINQ_INDEX_OUT_OF_RANGE","The index is out of range.");function d(e){if(!Number.isSafeInteger(e)||e<0)throw new D("HLP_LINQ_INVALID_ARGUMENT","Count must be a non-negative integer.")}function x(e){if(e==null)return 0;switch(typeof e){case"boolean":return 1;case"number":return Number.isNaN(e)?0:2;case"bigint":return 2;case"string":return 3;default:return e instanceof Date?Number.isNaN(e.getTime())?0:4:5}}function p(e,n){const t=x(e),r=x(n);if(t!==r)return t-r;if(t===0||t===5)return 0;if(t===4)return e.getTime()-n.getTime();const o=e,i=n;return o===i?0:o<i?-1:o>i?1:0}function H(e,...n){return n.reduce((t,r)=>r(t),e)}function Q(e){return n=>a(function*(){let t=0;for(const r of n)e(r,t++)&&(yield r)})}function z(e){return n=>a(function*(){for(const t of n)e(t)&&(yield t)})}function V(e){return n=>a(function*(){let t=0;for(const r of n)yield e(r,t++)})}function J(e,n){return t=>a(function*(){let r=0;for(const o of t)for(const i of e(o,r++))yield n?n(o,i):i})}class m{#e;#n;constructor(n,t){this.#e=n,this.#n=t}thenBy(n,t){return new m(this.#e,[...this.#n,b(n,t,!1)])}thenByDescending(n,t){return new m(this.#e,[...this.#n,b(n,t,!0)])}*[Symbol.iterator](){const n=[...this.#e],r=this.#n.map(i=>({sp:i,keys:n.map(u=>i.key(u))})),o=n.map((i,u)=>u);o.sort((i,u)=>{for(const{sp:T,keys:f}of r){const l=T.compare(f[i],f[u]);if(l!==0)return T.desc?-l:l}return i-u});for(const i of o)yield n[i]}}function b(e,n,t){return{key:e,compare:n??p,desc:t}}function W(e,n){return t=>new m(t,[b(e,n,!1)])}function j(e,n){return t=>new m(t,[b(e,n,!0)])}function X(e,n){return t=>t.thenBy(e,n)}function Y(e,n){return t=>t.thenByDescending(e,n)}function Z(){return e=>a(function*(){const n=[...e];for(let t=n.length-1;t>=0;t--)yield n[t]})}class O{key;items;constructor(n,t){this.key=n,this.items=t}[Symbol.iterator](){return this.items[Symbol.iterator]()}}function R(e,n,t){const r=new Map;for(const o of e){const i=n(o),u=r.get(i);u?u.push(t(o)):r.set(i,[t(o)])}return r}function $(e,n,t){const r=n??(o=>o);return o=>a(function*(){for(const[i,u]of R(o,e,r))yield t?t(i,u):new O(i,u)})}class N{#e;constructor(n){this.#e=n}get size(){return this.#e.size}has(n){return this.#e.has(n)}get(n){return this.#e.get(n)??[]}*[Symbol.iterator](){for(const[n,t]of this.#e)yield new O(n,t)}}function k(e,n){const t=new Map;for(const r of e){const o=n(r);if(o==null)continue;const i=t.get(o);i?i.push(r):t.set(o,[r])}return t}function ee(e,n,t,r){return o=>a(function*(){const i=k(e,t);for(const u of o){const T=n(u);if(T!=null)for(const f of i.get(T)??[])yield r(u,f)}})}function ne(e,n,t,r){return o=>a(function*(){const i=k(e,t);for(const u of o){const T=n(u);yield r(u,T==null?[]:i.get(T)??[])}})}function te(e,n,t,r){return o=>a(function*(){const i=k(e,t);for(const u of o){const T=n(u),f=T==null?void 0:i.get(T);if(f)for(const l of f)yield r(u,l);else yield r(u,void 0)}})}function re(){return E(e=>e)}function E(e){return n=>a(function*(){const t=new Set;for(const r of n){const o=e(r);t.has(o)||(t.add(o),yield r)}})}function oe(e){return P(e,n=>n)}function P(e,n){return t=>E(n)(G(e)(t))}function ie(e){return M(e,n=>n)}function M(e,n){return t=>a(function*(){const r=new Set;for(const o of e)r.add(n(o));for(const o of t){const i=n(o);r.delete(i)&&(yield o)}})}function ue(e){return F(e,n=>n)}function F(e,n){return t=>a(function*(){const r=new Set;for(const o of e)r.add(n(o));for(const o of t){const i=n(o);r.has(i)||(r.add(i),yield o)}})}function G(e){return n=>a(function*(){yield*n,yield*e})}function ae(e,n){return t=>a(function*(){const r=t[Symbol.iterator](),o=e[Symbol.iterator]();try{for(;;){const i=r.next();if(i.done===!0)return;const u=o.next();if(u.done===!0)return;yield n?n(i.value,u.value):[i.value,u.value]}}finally{r.return?.(),o.return?.()}})}function Te(e){return n=>a(function*(){yield*n,yield e})}function fe(e){return n=>a(function*(){yield e,yield*n})}function ce(e){return n=>a(function*(){let t=!1;for(const r of n)t=!0,yield r;t||(yield e)})}function le(e){if(!Number.isSafeInteger(e)||e<1)throw new D("HLP_LINQ_INVALID_ARGUMENT","Chunk size must be a positive integer.");return n=>a(function*(){let t=[];for(const r of n)t.push(r),t.length===e&&(yield t,t=[]);t.length&&(yield t)})}function pe(e){return d(e),n=>a(function*(){if(e===0)return;let t=0;for(const r of n)if(yield r,++t>=e)return})}function se(e){return n=>a(function*(){let t=0;for(const r of n){if(!e(r,t++))return;yield r}})}function me(e){return d(e),n=>a(function*(){if(e===0)return;const t=[];let r=0;for(const o of n)t.length<e?t.push(o):(t[r]=o,r=(r+1)%e);for(let o=0;o<t.length;o++)yield t[(r+o)%t.length]})}function de(e){return d(e),n=>a(function*(){let t=0;for(const r of n)t++>=e&&(yield r)})}function xe(e){return n=>a(function*(){let t=!0,r=0;for(const o of n)t&&e(o,r++)||(t=!1,yield o)})}function be(e){return d(e),n=>a(function*(){if(e===0){yield*n;return}const t=[];let r=0;for(const o of n){if(t.length<e){t.push(o);continue}yield t[r],t[r]=o,r=(r+1)%e}})}function ye(){return e=>[...e]}function Ke(){return e=>new Set(e)}function _(e,n){return t=>{const r=new Map;for(const o of t){const i=e(o);if(r.has(i))throw new g("HLP_LINQ_DUPLICATE_KEY","The sequence produced a duplicate key.");r.set(i,n?n(o):o)}return r}}const he=_;function ke(e,n){return t=>new N(R(t,e,n??(r=>r)))}function ge(e){return n=>{let t=0;for(const r of n)e(r,t++)}}const c=()=>!0;function we(e=c){return n=>{let t=0;for(const r of n)if(e(r,t++))return r;throw s()}}function De(e=c,n){return t=>{let r=0;for(const o of t)if(e(o,r++))return o;return n}}function A(e,n){let t=!1,r,o=0;for(const i of e)n(i,o++)&&(t=!0,r=i);return{found:t,value:r}}function Ie(e=c){return n=>{const t=A(n,e);if(!t.found)throw s();return t.value}}function Oe(e=c,n){return t=>{const r=A(t,e);return r.found?r.value:n}}function C(e,n){let t=!1,r,o=0;for(const i of e)if(n(i,o++)){if(t)throw v();t=!0,r=i}return{found:t,value:r}}function Re(e=c){return n=>{const t=C(n,e);if(!t.found)throw s();return t.value}}function Ee(e=c,n){return t=>{const r=C(t,e);return r.found?r.value:n}}function U(e,n){if(!Number.isSafeInteger(n))return{found:!1,value:void 0};if(Array.isArray(e)||n<0){const r=Array.isArray(e)?e:[...e],o=n<0?r.length+n:n;return o>=0&&o<r.length?{found:!0,value:r[o]}:{found:!1,value:void 0}}let t=0;for(const r of e)if(t++===n)return{found:!0,value:r};return{found:!1,value:void 0}}function Ae(e){return n=>{const t=U(n,e);if(!t.found)throw L();return t.value}}function Ce(e,n){return t=>{const r=U(t,e);return r.found?r.value:n}}function Ue(e=c){return n=>{let t=0;for(const r of n)if(e(r,t++))return!0;return!1}}function Be(e){return n=>{let t=0;for(const r of n)if(!e(r,t++))return!1;return!0}}function Se(e,n=I){return t=>{for(const r of t)if(n(r,e))return!0;return!1}}function ve(e,n=I){return t=>{const r=t[Symbol.iterator](),o=e[Symbol.iterator]();try{for(;;){const i=r.next(),u=o.next();if(i.done===!0||u.done===!0)return i.done===u.done;if(!n(i.value,u.value))return!1}}finally{r.return?.(),o.return?.()}}}function Le(e){return n=>{if(!e){if(Array.isArray(n))return n.length;if(n instanceof Set||n instanceof Map)return n.size}const t=e??c;let r=0,o=0;for(const i of n)t(i,o++)&&r++;return r}}function B(e){let n=0,t=0,r=0;for(const o of e){const i=n+o;t+=Math.abs(n)>=Math.abs(o)?n-i+o:o-i+n,n=i,r++}return{sum:n+t,n:r}}function y(e,n){return V(n)(e)}function Ve(e){return n=>B(e?y(n,e):n).sum}function Ne(e){return n=>{const t=B(e?y(n,e):n);if(t.n===0)throw s();return t.sum/t.n}}function K(e,n,t){let r=!1,o;for(const i of e)x(i)!==0&&(!r||t(i,o)*n<0)&&(o=i,r=!0);if(!r)throw s();return o}function Pe(e,n=p){return t=>e?K(y(t,e),1,n):K(t,1,p)}function Me(e,n=p){return t=>e?K(y(t,e),-1,n):K(t,-1,p)}function S(e,n,t,r){let o=!1,i,u;for(const T of e){const f=n(T);x(f)!==0&&(!o||t(f,u)*r<0)&&(i=T,u=f,o=!0)}return i}function Fe(e,n=p){return t=>S(t,e,n,1)}function Ge(e,n=p){return t=>S(t,e,n,-1)}function _e(...e){return n=>{if(e.length===1){const i=e[0],u=n[Symbol.iterator](),T=u.next();if(T.done===!0)throw s();let f=T.value,l=1;for(let h=u.next();h.done!==!0;h=u.next())f=i(f,h.value,l++);return f}const t=e[1];let r=e[0],o=0;for(const i of n)r=t(r,i,o++);return e.length>2?e[2](r):r}}export{O as Grouping,N as Lookup,m as OrderedSequence,_e as aggregate,Be as all,Ue as any,Te as append,d as assertCount,Ne as average,le as chunk,G as concat,Se as contains,Le as count,p as defaultCompare,ce as defaultIfEmpty,re as distinct,E as distinctBy,Ae as elementAt,Ce as elementAtOrDefault,ue as except,F as exceptBy,we as first,De as firstOrDefault,ge as forEach,$ as groupBy,ne as groupJoin,ie as intersect,M as intersectBy,ee as join,Ie as last,Oe as lastOrDefault,te as leftJoin,Me as max,Ge as maxBy,Pe as min,Fe as minBy,W as orderBy,j as orderByDescending,H as pipe,fe as prepend,Z as reverse,I as sameValueZero,V as select,J as selectMany,ve as sequenceEqual,Re as single,Ee as singleOrDefault,de as skip,be as skipLast,xe as skipWhile,Ve as sum,pe as take,me as takeLast,se as takeWhile,X as thenBy,Y as thenByDescending,ye as toArray,he as toDictionary,ke as toLookup,_ as toMap,Ke as toSet,oe as union,P as unionBy,Q as where,z as whereType,ae as zip};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as p,ValidationError as b}from"../error/index.js";import{assertInteger as c,fractionDigits as d,numberParts as _,shift as m}from"./internal.js";const f=n=>n===0?0:n;function x(n){if(!Number.isInteger(n)||n<-308||n>308)throw new b("HLP_NUMBER_PLACES","Decimal places must be an integer between -308 and 308.")}function T(n,e,r){if(e>r)throw new b("HLP_NUMBER_RANGE","The minimum must not exceed the maximum.");return n<e?e:n>r?r:n}function U(n,e,r,t={}){const{inclusive:i=!0}=t,u=Math.min(e,r),o=Math.max(e,r),s=i===!0||i==="min"?n>=u:n>u,a=i===!0||i==="max"?n<=o:n<o;return s&&a}function M(n,e=0){if(x(e),!Number.isFinite(n))return n;const r=m(Math.abs(n),e);return Number.isFinite(r)?f(Math.sign(n)*m(Math.round(r),-e)):n}function y(n,e=0){if(x(e),!Number.isFinite(n))return n;const r=m(Math.abs(n),e);if(!Number.isFinite(r))return n;const t=Math.floor(r),i=r-t,u=i>.5?t+1:i<.5||t%2===0?t:t+1;return f(Math.sign(n)*m(u,-e))}function h(n,e,r){if(x(r),!Number.isFinite(e))return e;const t=m(e,r);return Number.isFinite(t)?f(m(n(t),-r)):e}function H(n,e=0){return h(Math.floor,n,e)}function k(n,e=0){return h(Math.ceil,n,e)}function C(n,e=0){return h(Math.trunc,n,e)}function G(n,e){if(!(e>0)||!Number.isFinite(e))throw new b("HLP_NUMBER_STEP","The step must be a positive finite number.");if(!Number.isFinite(n))return n;const r=Math.max(d(n),d(e)),t=m(n,r)/m(e,r),i=Math.sign(t)*Math.round(Math.abs(t));return M(i*e,d(e))}function q(n){return Number.isInteger(n)&&n%2===0}function D(n){return Number.isInteger(n)&&n%2!==0}function Z(n){return n>0?1:n<0?-1:n===0?0:Number.NaN}function $(n){return n===0&&1/n<0}function V(n){return f(n)}const g=(n,e)=>Number.isFinite(n)?e===void 0?f(n):M(n,e):void 0;function z(n,e,r={}){if(e!==0)return g(n/e*100,r.places)}function X(n,e,r={}){if(n!==0)return g((e-n)/Math.abs(n)*100,r.places)}function j(n,e,r={}){if(e!==0)return g(n/e,r.places)}function E(n,e,r){return(1-r)*n+r*e}function w(n,e,r){return n===e?0:(r-n)/(e-n)}function J(n,e,r,t,i,u={}){const o=w(e,r,n);return E(t,i,u.clamp?Math.min(1,Math.max(0,o)):o)}function K(n,e,r={}){const{relative:t=1e-9,absolute:i=1e-12}=r;return n===e?!0:!Number.isFinite(n)||!Number.isFinite(e)?!1:Math.abs(n-e)<=Math.max(t*Math.max(Math.abs(n),Math.abs(e)),i)}function I(n){let e=0,r=0,t=0;for(const i of n){t+=i;const u=e+i;r+=Math.abs(e)>=Math.abs(i)?e-u+i:i-u+e,e=u}return Number.isFinite(t)?f(e+r):t}function Q(n){return I(n)}function W(n){let e=1;for(const r of n)e*=r;return e}function P(n,e){c(n),c(e);let r=Math.abs(n),t=Math.abs(e);for(;t;)[r,t]=[t,r%t];return r}function Y(n,e){if(n===0||e===0)return c(n),c(e),0;const r=Math.abs(n/P(n,e)*e);if(!Number.isSafeInteger(r))throw new p("HLP_NUMBER_UNSAFE","The result is not a safe integer.");return r}const l=n=>n<0n?-n:n;function R(n,e){let r=l(n),t=l(e);for(;t;)[r,t]=[t,r%t];return r}function v(n,e){return n===0n||e===0n?0n:l(n/R(n,e)*e)}function O(n,e,r){let t=1n,i=n%r,u=e;for(;u>0n;)u&1n&&(t=t*i%r),i=i*i%r,u>>=1n;return t}const N=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n],B=3317044064679887385961981n;function F(n){if(typeof n=="number"){if(!Number.isInteger(n)||n<2)return!1;if(!Number.isSafeInteger(n))throw new b("HLP_NUMBER_UNSAFE","Expected a safe integer; pass a bigint for larger values.");if(n<4)return!0;if(n%2===0||n%3===0)return!1;if(n<1e10){for(let t=5;t*t<=n;t+=6)if(n%t===0||n%(t+2)===0)return!1;return!0}return F(BigInt(n))}if(n<2n)return!1;if(n>=B)throw new p("HLP_NUMBER_TOO_LARGE","The value exceeds the deterministic primality limit.");for(const t of N){if(n===t)return!0;if(n%t===0n)return!1}let e=n-1n,r=0;for(;(e&1n)===0n;)e>>=1n,r++;n:for(const t of N){let i=O(t,e,n);if(!(i===1n||i===n-1n)){for(let u=1;u<r;u++)if(i=i*i%n,i===n-1n)continue n;return!1}}return!0}const L=1e4;function nn(n){if(c(n),n<0)throw new b("HLP_NUMBER_NEGATIVE","Expected a non-negative integer.");if(n>L)throw new p("HLP_NUMBER_TOO_LARGE","The value exceeds the factorial limit.");let e=1n;for(let r=2n,t=BigInt(n);r<=t;r++)e*=r;return e}function en(n,e){if(!Number.isFinite(n))return String(n);if(e!==void 0&&(!Number.isInteger(e)||e<0||e>100))throw new b("HLP_NUMBER_PLACES","Decimal places must be an integer between 0 and 100.");const r=_(n),t=e===void 0?Math.min(r.exponent,0):-e;let i=BigInt(r.digits);if(r.exponent>=t)i*=10n**BigInt(r.exponent-t);else{const s=10n**BigInt(t-r.exponent),a=i/s;i=i%s*2n>=s?a+1n:a}const u=-t;let o=i.toString();return u>0&&(o=o.padStart(u+1,"0"),o=`${o.slice(0,-u)}.${o.slice(-u)}`),r.negative&&i!==0n?`-${o}`:o}export{L as MAX_FACTORIAL,K as approximatelyEqual,k as ceil,T as clamp,nn as factorial,H as floor,P as gcd,R as gcdBigInt,U as inRange,w as inverseLerp,q as isEven,$ as isNegativeZero,D as isOdd,F as isPrime,I as kahanSum,Y as lcm,v as lcmBigInt,E as lerp,V as normalizeZero,z as percent,X as percentChange,W as product,j as ratio,J as remap,M as round,y as roundHalfEven,G as roundTo,Z as sign,Q as sum,en as toFixedSafe,C as trunc};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as c}from"../error/index.js";import{assertFinite as y}from"./internal.js";const b=64,h=new Map,O=new Map;function f(t,e){const o=t===void 0?"":typeof t=="string"?t:t.join(","),r=Object.entries(e).filter(([,n])=>n!==void 0);return r.sort(([n],[a])=>n<a?-1:n>a?1:0),`${o}|${JSON.stringify(r)}`}function d(t,e,o){let r=t.get(e);if(r===void 0){try{r=o()}catch(n){throw new c("HLP_NUMBER_FORMAT_OPTIONS","Invalid locale or format options.",{cause:n})}if(t.size>=b){const n=t.keys().next();n.done||t.delete(n.value)}t.set(e,r)}return r}function l(t,e={}){return d(h,f(t,e),()=>new Intl.NumberFormat(t,e))}function F(t,e){return d(O,f(t,e),()=>new Intl.PluralRules(t,e))}function C(t,e={}){const{locale:o,...r}=e;return l(o,r).format(t)}function R(t,e,o={}){if(!/^[a-z]{3}$/i.test(e))throw new c("HLP_NUMBER_CURRENCY","Expected a three-letter ISO 4217 currency code.");const{locale:r,display:n,...a}=o;return l(r,{...a,style:"currency",currency:e.toUpperCase(),...n?{currencyDisplay:n}:{}}).format(t)}function M(t,e={}){const{locale:o,...r}=e;return l(o,{...r,style:"percent"}).format(t)}function P(t,e={}){const{locale:o,display:r="short",...n}=e;return l(o,{...n,notation:"compact",compactDisplay:r}).format(t)}function x(t,e,o={}){const{locale:r,unitDisplay:n="short",...a}=o;return l(r,{...a,style:"unit",unit:e,unitDisplay:n}).format(t)}const N={en:{one:"st",two:"nd",few:"rd",other:"th"},fr:{one:"er",other:"e"},de:{other:"."},nl:{other:"e"},es:{other:"\xBA"},it:{other:"\xBA"},pt:{other:"\xBA"},sv:{one:":a",other:":e"},da:{other:"."},nb:{other:"."},fi:{other:"."},pl:{other:"."},cs:{other:"."}};function L(t,e){y(t);const o=typeof e=="string"?{locale:e}:e??{},r=F(o.locale,{type:"ordinal"}),n=r.resolvedOptions().locale.split("-")[0]??"en",a=o.suffixes??N[n]??{},s=r.select(t),i=a[s]??a.other??"";return`${l(o.locale).format(t)}${i}`}const m=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"];function D(t,e={}){y(t);const{locale:o,base:r=1e3,style:n="short",maximumFractionDigits:a=1}=e;if(![1e3,1024].includes(r))throw new c("HLP_NUMBER_BYTES_BASE","The base must be 1000 or 1024.");const s=Math.abs(t);let i=s<1?0:Math.min(m.length-1,Math.floor(Math.log(s)/Math.log(r)));i>0&&s<r**i&&i--;let u=s/r**i;const p=10**a;Math.round(u*p)/p>=r&&i<m.length-1&&(i++,u=s/r**i);const g=m[i]??"byte";return x(Math.sign(t)*u,g,{locale:o,unitDisplay:n,maximumFractionDigits:a})}export{D as formatBytes,P as formatCompact,R as formatCurrency,C as formatNumber,L as formatOrdinal,M as formatPercent,x as formatUnit,l as numberFormat};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{clamp as e,inRange as t,round as a,roundHalfEven as m,floor as n,ceil as p,trunc as i,roundTo as s,isEven as f,isOdd as u,sign as c,isNegativeZero as O,normalizeZero as l,percent as d,percentChange as g,ratio as x,lerp as y,inverseLerp as N,remap as b,approximatelyEqual as F,kahanSum as B,sum as R,product as C,gcd as T,lcm as A,gcdBigInt as E,lcmBigInt as I,isPrime as P,factorial as S,MAX_FACTORIAL as j,toFixedSafe as v}from"./core.js";import{formatNumber as M,formatCurrency as U,formatPercent as X,formatCompact as _,formatUnit as h,formatOrdinal as W,formatBytes as Z}from"./format.js";import{parseNumber as q,parseNumberString as w,parseBytes as z,isSafeNumberString as H,MAX_NUMBER_TEXT as V}from"./parse.js";import{numberToWords as G,toRoman as J,fromRoman as K}from"./words.js";export{j as MAX_FACTORIAL,V as MAX_NUMBER_TEXT,F as approximatelyEqual,p as ceil,e as clamp,S as factorial,n as floor,Z as formatBytes,_ as formatCompact,U as formatCurrency,M as formatNumber,W as formatOrdinal,X as formatPercent,h as formatUnit,K as fromRoman,T as gcd,E as gcdBigInt,t as inRange,N as inverseLerp,f as isEven,O as isNegativeZero,u as isOdd,P as isPrime,H as isSafeNumberString,B as kahanSum,A as lcm,I as lcmBigInt,y as lerp,l as normalizeZero,G as numberToWords,z as parseBytes,q as parseNumber,w as parseNumberString,d as percent,g as percentChange,C as product,x as ratio,b as remap,a as round,m as roundHalfEven,s as roundTo,c as sign,R as sum,v as toFixedSafe,J as toRoman,i as trunc};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as c}from"../error/index.js";function a(t){const e=String(Math.abs(t)),n=e.indexOf("e"),r=n===-1?e:e.slice(0,n);let o=n===-1?0:Number(e.slice(n+1));const i=r.indexOf(".");let s=r;return i!==-1&&(s=r.slice(0,i)+r.slice(i+1),o-=r.length-i-1),s=s.replace(/^0+(?=\d)/,""),{negative:t<0,digits:s,exponent:o}}function u(t){const{digits:e,exponent:n}=t;let r;if(n>=0)r=e==="0"?"0":e+"0".repeat(n);else{const o=e.padStart(-n+1,"0"),i=o.length+n;r=`${o.slice(0,i)}.${o.slice(i)}`}return t.negative&&/[1-9]/.test(e)?`-${r}`:r}function l(t){return u(a(t))}function b(t){const{exponent:e}=a(t);return e<0?-e:0}function f(t,e){const n=String(t),r=n.indexOf("e");return r===-1?+`${n}e${e}`:+`${n.slice(0,r)}e${Number(n.slice(r+1))+e}`}function g(t,e="HLP_NUMBER_NOT_FINITE"){if(!Number.isFinite(t))throw new c(e,"Expected a finite number.")}function p(t,e="HLP_NUMBER_NOT_INTEGER"){if(!Number.isInteger(t))throw new c(e,"Expected an integer.")}export{g as assertFinite,p as assertInteger,b as fractionDigits,a as numberParts,u as partsToPlain,l as plainString,f as shift};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as w}from"../error/index.js";import{numberFormat as N}from"./format.js";import{partsToPlain as T}from"./internal.js";const A=1e3,S=[" ","\xA0","\u202F","\u2009"],R=[1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,6112,6160,6470,6608,6992,43216,43264,65296],v=e=>e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297,k=e=>Array.from(e).filter(s=>!v(s.codePointAt(0)??0)).join(""),P=new Map;function M(e){const s=e===void 0?"":typeof e=="string"?e:e.join(","),n=P.get(s);if(n)return n;const f=N(e,{useGrouping:!0}).formatToParts(-12345678905e-1),r=k;let t=",",g=".",a="-";const u=[];for(const i of f)i.type==="group"?t=i.value:i.type==="decimal"?g=i.value:i.type==="minusSign"?a=r(i.value)||"-":i.type==="integer"&&u.push(i.value.length);const b=N(e,{signDisplay:"always"}).formatToParts(1).find(i=>i.type==="plusSign"),p=N(e,{style:"percent"}).formatToParts(.5).find(i=>i.type==="percentSign"),d=new Set([t]);if(S.includes(t))for(const i of S)d.add(i);(t==="\u2019"||t==="'")&&(d.add("'"),d.add("\u2019"));const l=u.at(-1)??3,m={group:d,decimal:g,minus:new Set(["-","\u2212",a]),plus:new Set(["+",b&&r(b.value)||"+"]),percent:new Set(["%","\u066A",p&&r(p.value)||"%"]),primary:l,secondary:u.length>2?u.at(-2)??l:l};return P.size>=32&&P.clear(),P.set(s,m),m}function _(e){const s=e.codePointAt(0)??0;for(const n of R)if(s>=n&&s<=n+9)return String(s-n);return e}function E(e,s={}){if(typeof e!="string")return;if(e.length>A)throw new w("HLP_NUMBER_TOO_LONG","The numeric text exceeds the length limit.");const n=M(s.locale),f=s.strict===!0,r=Array.from(k(e).trim(),_);let t=0,g=!1,a=!1,u=!1;const b=()=>{for(;t<r.length&&S.includes(r[t]??"");)t++};for(let o=0;o<2;o++){const c=r[t]??"";!a&&(n.minus.has(c)||n.plus.has(c))?(g=n.minus.has(c),a=!0,t++):!u&&n.percent.has(c)&&(u=!0,t++,b())}let p=-1;for(let o=r.length-1;o>=0;o--){const c=r[o]??"";if(c>="0"&&c<="9"){p=o;break}}const d=[];let l="",m="",i="",y=!1,L=!1,h=!1;for(;t<r.length;t++){const o=r[t]??"";if(o>="0"&&o<="9")L=!0,h=!1,y?i+=o:l+=o;else if(o===n.decimal&&!y){if(h)return;y=!0,d.push(l.length),m+=l,l=""}else if(n.group.has(o)&&!y){if(S.includes(o)&&t>p)break;if(l===""||h)return;d.push(l.length),m+=l,l="",h=!0}else break}if(y||(d.push(l.length),m+=l),h||(b(),!u&&n.percent.has(r[t]??"")&&(u=!0,t++),t!==r.length||!L))return;if(f){if(y&&(i===""||m===""))return;if(d.length>1){const o=d.length-1;for(let c=0;c<=o;c++){const x=d[c]??0;if(c===o?x!==n.primary:c===0?x<1||x>n.secondary:x!==n.secondary)return}}}const I=(m+i).replace(/^0+(?=\d)/,"");return T({negative:g,digits:I,exponent:-i.length-(u?2:0)})}function D(e,s={}){const n=E(e,s);if(n===void 0)return;const f=Number(n);return Number.isFinite(f)?f===0?0:f:void 0}const O=new Map([["k",1],["kb",1],["kilobyte",1],["kilobytes",1],["m",2],["mb",2],["megabyte",2],["megabytes",2],["g",3],["gb",3],["gigabyte",3],["gigabytes",3],["t",4],["tb",4],["terabyte",4],["terabytes",4],["p",5],["pb",5],["petabyte",5],["petabytes",5]]),B=new Map([["kib",1],["kibibyte",1],["kibibytes",1],["mib",2],["mebibyte",2],["mebibytes",2],["gib",3],["gibibyte",3],["gibibytes",3],["tib",4],["tebibyte",4],["tebibytes",4],["pib",5],["pebibyte",5],["pebibytes",5]]);function F(e,s={}){if(typeof e!="string")return;if(e.length>256)throw new w("HLP_NUMBER_TOO_LONG","The byte size text exceeds the length limit.");const{base:n=1e3,locale:f="en"}=s,r=e.trim(),t=r.search(/\p{L}/u),g=(t===-1?r:r.slice(0,t)).trim(),a=(t===-1?"":r.slice(t)).trim().toLowerCase();if(g.includes("%"))return;const u=D(g,{locale:f});if(u===void 0||u<0)return;let b;if(a===""||a==="b"||a==="byte"||a==="bytes")b=1;else if(O.has(a))b=n**(O.get(a)??0);else if(B.has(a))b=1024**(B.get(a)??0);else return;const p=Math.round(u*b);return Number.isSafeInteger(p)?p:void 0}function U(e){if(typeof e!="string"||e.length>400||!/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(e))return!1;const s=e.replace(/^[+-]/,""),[n="",f=""]=s.split(".");let r=f.length;for(;r>0&&f.charCodeAt(r-1)===48;)r--;const t=f.slice(0,r);if(t===""){const a=Number(n||"0");return Number.isSafeInteger(a)&&BigInt(n||"0")===BigInt(a)}return(n+t).replace(/^0+/,"").length<=15&&Number(s)!==0}export{A as MAX_NUMBER_TEXT,U as isSafeNumberString,F as parseBytes,D as parseNumber,E as parseNumberString};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{LimitError as c,ValidationError as p}from"../error/index.js";import{assertFinite as g,plainString as b}from"./internal.js";const a=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],N=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],h=["","thousand","million","billion","trillion","quadrillion"];function d(e,o){const t=Math.floor(e/100),n=e%100,r=[];return t&&r.push(`${a[t]??""} hundred`),n&&(t&&o&&r.push("and"),r.push(n<20?a[n]??"":`${N[Math.floor(n/10)]??""}${n%10?`-${a[n%10]??""}`:""}`)),r.join(" ")}function E(e,o={}){if(g(e),Math.abs(e)>1e15)throw new c("HLP_NUMBER_TOO_LARGE","The value exceeds the supported range for words.");const t=o.and===!0,[n="0",r=""]=b(Math.abs(e)).split(".");let i=Number(n);const f=[];i===0&&f.push("zero");for(let s=0;i>0;s++){const l=i%1e3;i=Math.floor(i/1e3),l&&f.unshift(h[s]?`${d(l,t)} ${h[s]??""}`:d(l,t))}let u=f.join(" ");if(t&&Number(n)>=1e3&&Number(n)%1e3<100&&Number(n)%1e3>0){const s=f.pop()??"";u=`${f.join(" ")} and ${s}`}return r&&(u+=` point ${Array.from(r,s=>a[Number(s)]??"").join(" ")}`),e<0&&u!=="zero"?`minus ${u}`:u}const M=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function y(e){if(!Number.isInteger(e)||e<1||e>3999)throw new p("HLP_NUMBER_ROMAN_RANGE","Roman numerals support integers from 1 to 3999.");let o=e,t="";for(const[n,r]of M)for(;o>=n;)t+=r,o-=n;return t}const m=new Map([["I",1],["V",5],["X",10],["L",50],["C",100],["D",500],["M",1e3]]);function R(e){if(typeof e!="string"||e.length===0||e.length>15)return;const o=e.toUpperCase();let t=0;for(let n=0;n<o.length;n++){const r=m.get(o.charAt(n));if(r===void 0)return;const i=m.get(o.charAt(n+1))??0;t+=r<i?-r:r}return t>=1&&t<=3999&&y(t)===o?t:void 0}export{R as fromRoman,E as numberToWords,y as toRoman};
@@ -1,2 +1,2 @@
1
- /*! AbsoluteUI @absoluteui/helpers v0.13.1 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
1
+ /*! AbsoluteUI @absoluteui/helpers v0.13.3 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
2
2
  import{ValidationError as j}from"../error/index.js";import{isPlainObject as d}from"../is/index.js";import{assertSafeKey as y,hasOwn as k}from"../internal/keys.js";import{circular as p,put as f}from"./internal.js";function V(e,n){const t={};for(const o of n)k(e,o)&&f(t,o,e[o]);return t}function h(e,n){const t=new Set(n),o={};for(const[r,c]of Object.entries(e))t.has(r)||f(o,r,c);return o}function l(e,n){const t={};for(const[o,r]of Object.entries(e))n(r,o)&&f(t,o,r);return t}function P(e,n){return l(e,(t,o)=>!n(t,o))}function A(e,n){const t={};for(const[o,r]of Object.entries(e)){const c=n(r,o);y(c),t[c]=r}return t}function S(e,n){const t={};for(const[o,r]of Object.entries(e))f(t,o,n(r,o));return t}function E(e,n){const t={};for(const o of Object.entries(e)){const[r,c]=n(o);y(r),t[r]=c}return t}function _(e,n){return l(e,(t,o)=>n(o))}function B(e,n){return l(e,t=>n(t))}function b(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);throw new j("HLP_OBJECT_INVALID_KEY","The value cannot be used as an object key.")}function I(e){const n={};for(const[t,o]of Object.entries(e)){const r=b(o);y(r),n[r]=t}return n}function M(e,n=t=>t){const t={};for(const[o,r]of Object.entries(e)){const c=b(n(r));y(c),(t[c]??=[]).push(o)}return t}function C(e,n){const t={};for(const[o,r]of Object.entries(e)){const c=k(n,o)?n[o]??o:o;c!==o&&y(c),f(t,c,r)}return t}function L(e,n={}){const{remove:t="nullish",deep:o=!1}=n,r=new Set,c=s=>s===void 0?!0:t==="undefined"?!1:s===null?!0:t!=="empty"?!1:s===""?!0:Array.isArray(s)?s.length===0:d(s)&&Object.keys(s).length===0,T=s=>{if(!o||!Array.isArray(s)&&!d(s))return s;r.has(s)&&p(),r.add(s);let a;if(Array.isArray(s))a=s.map(T);else{const u={};for(const[x,O]of Object.entries(s)){const g=T(O);c(g)||f(u,x,g)}a=u}return r.delete(s),a},i={};for(const[s,a]of Object.entries(e)){const u=T(a);c(u)||f(i,s,u)}return i}function z(e,...n){const t={};for(const[o,r]of Object.entries(e))f(t,o,r);for(const o of n)for(const[r,c]of Object.entries(o))(!k(t,r)||t[r]===void 0)&&f(t,r,c);return t}function D(e){return Object.keys(e)}function H(e){return Object.values(e)}function J(e){return Object.entries(e)}function N(e){return Object.fromEntries(e)}function Y(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||typeof n!="object"||e===null||n===null||Array.isArray(e)!==Array.isArray(n))return!1;const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const o of t)if(!k(n,o)||!Object.is(e[o],n[o]))return!1;return!0}function q(e,n){if(!(typeof e!="object"&&typeof e!="function"||e===null))return k(e,n)?e[n]:void 0}function F(e){return e==null?0:typeof e=="string"||Array.isArray(e)?e.length:e instanceof Map||e instanceof Set?e.size:typeof e=="object"?Object.keys(e).length:0}function G(e,n=t=>t){const t={};for(const o of Object.values(e)){const r=b(n(o));y(r),t[r]=(t[r]??0)+1}return t}function Q(e,n={}){const{recursive:t=!1,compare:o}=n,r=new Set,c=i=>{r.has(i)&&p(),r.add(i);const s=Object.keys(i);o?s.sort(o):s.sort();const a={};for(const u of s)f(a,u,t?T(i[u]):i[u]);return r.delete(i),a},T=i=>{if(Array.isArray(i)){r.has(i)&&p(),r.add(i);const s=i.map(T);return r.delete(i),s}return d(i)?c(i):i};return c(e)}function U(e){return new Map(Object.entries(e))}function W(e){const n={};for(const[t,o]of e){if(typeof t!="string"&&typeof t!="number")throw new j("HLP_OBJECT_INVALID_KEY","The value cannot be used as an object key.");const r=String(t);y(r),n[r]=o}return n}export{L as compactObject,G as countValuesBy,z as defaults,_ as filterKeys,B as filterValues,q as getOwn,I as invert,M as invertBy,Y as isShallowEqual,E as mapEntries,A as mapKeys,W as mapToObject,S as mapValues,U as objectToMap,h as omit,P as omitBy,V as pick,l as pickBy,C as renameKeys,F as size,Q as sortKeys,J as typedEntries,N as typedFromEntries,D as typedKeys,H as typedValues};