2026-07-24 07:16:23 +00:00
// Module ID: 6984
// Function ID: 55848
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-24 07:16:23 +00:00
// Dependencies: [6, 7, 6985, 2]
2026-07-21 22:01:30 +00:00
2026-07-24 07:16:23 +00:00
// Module 6984 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _classCallCheck from "_classCallCheck" ;
import _defineProperties from "_defineProperties" ;
const require = arg1 ;
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
2026-07-23 10:11:24 +00:00
let tmp2 = ( ( ) = > {
2026-07-20 16:05:17 +00:00
class Histogram {
constructor ( ) {
2026-07-23 10:11:24 +00:00
tmp = outer1_2 ( this , Histogram ) ;
digest = new Histogram ( outer1_1 [ 2 ] ) . Digest ( ) ;
2026-07-20 16:05:17 +00:00
this . digest = digest ;
this . total = 0 ;
this . samples = 0 ;
this . totalWeight = 0 ;
return ;
}
}
let obj = {
key : "getSamples" ,
value() {
return this . samples ;
}
} ;
2026-07-23 10:11:24 +00:00
let items = [ obj , , , , ] ;
2026-07-20 16:05:17 +00:00
obj = {
key : "addSample" ,
value ( arg0 ) {
let num = arg1 ;
const self = this ;
if ( arg1 === undefined ) {
num = 1 ;
}
self . total = self . total + arg0 * num ;
self . totalWeight = self . totalWeight + num ;
self . samples = self . samples + 1 ;
2026-07-23 10:11:24 +00:00
const push = Histogram ( outer1_1 [ 2 ] ) . TDigest . prototype . push ;
2026-07-20 16:05:17 +00:00
push . call ( self . digest , arg0 , num ) ;
const digest = self . digest ;
digest . check_continuous ( ) ;
}
} ;
items [ 1 ] = obj ;
obj = {
key : "addSamples" ,
value ( arr ) {
let num = arg1 ;
const self = this ;
if ( arg1 === undefined ) {
num = 1 ;
}
self . total = self . total + arr . reduce ( ( arg0 , arg1 ) = > arg0 + arg1 * num , 0 ) ;
self . totalWeight = self . totalWeight + num * arr . length ;
self . samples = self . samples + arr . length ;
2026-07-23 10:11:24 +00:00
const push = Histogram ( outer1_1 [ 2 ] ) . TDigest . prototype . push ;
2026-07-20 16:05:17 +00:00
push . call ( self . digest , arr , num ) ;
const digest = self . digest ;
digest . check_continuous ( ) ;
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "getReport" ,
value() {
let iter2 ;
let items = arg0 ;
const self = this ;
if ( arg0 === undefined ) {
2026-07-23 10:11:24 +00:00
items = [ 25 , 50 , 75 , 90 , 95 ] ;
2026-07-20 16:05:17 +00:00
}
let obj = { } ;
2026-07-23 10:11:24 +00:00
const tmp = outer1_4 ( items ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp ( ) ;
if ( ! iter . done ) {
do {
let value = iter . value ;
let digest = self . digest ;
let percentileResult = digest . percentile ( value / 100 ) ;
let num = 0 ;
if ( null != percentileResult ) {
num = percentileResult ;
}
obj [ value ] = num ;
iter2 = tmp ( ) ;
iter = iter2 ;
} while ( ! iter2 . done ) ;
}
obj = { } ;
const digest2 = self . digest ;
const percentileResult1 = digest2 . percentile ( 0 ) ;
let num2 = 0 ;
if ( null != percentileResult1 ) {
num2 = percentileResult1 ;
}
obj . min = num2 ;
const digest3 = self . digest ;
const percentileResult2 = digest3 . percentile ( 1 ) ;
let num3 = 0 ;
if ( null != percentileResult2 ) {
num3 = percentileResult2 ;
}
obj . max = num3 ;
const digest4 = self . digest ;
const sizeResult = digest4 . size ( ) ;
let num4 = 0 ;
if ( null != sizeResult ) {
num4 = sizeResult ;
}
obj . count = num4 ;
obj . percentiles = obj ;
let num5 = 0 ;
if ( self . totalWeight > 0 ) {
num5 = self . total / self . totalWeight ;
}
obj . mean = num5 ;
obj . samples = self . samples ;
return obj ;
}
} ;
items [ 4 ] = {
key : "getPercentile" ,
value ( arg0 ) {
const digest = this . digest ;
const percentileResult = digest . percentile ( arg0 / 100 ) ;
let num = 0 ;
if ( null != percentileResult ) {
num = percentileResult ;
}
return num ;
}
} ;
return callback ( Histogram , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
const result = require ( "TDigest" ) . fileFinishedImporting ( "lib/Histogram.tsx" ) ;
2026-07-22 07:54:56 +00:00
export const Histogram = tmp2 ;