sparkforensics-server 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/assets/{AutoscalingChurn-Bf5TN-s_.js → AutoscalingChurn-BOiUUfuY.js} +1 -1
- package/public/assets/{CacheUtilization-DRf_FNrK.js → CacheUtilization-DwX7lisd.js} +1 -1
- package/public/assets/{CachingOpportunity-BTJzIhtI.js → CachingOpportunity-DUE3GKpx.js} +1 -1
- package/public/assets/{ColdStart-DnFgnD3n.js → ColdStart-ZHxPrJmI.js} +1 -1
- package/public/assets/{ConfigAudit-B5FsOdmu.js → ConfigAudit-BkVnq2XE.js} +1 -1
- package/public/assets/{CoreUsageArea-CTksBPuq.js → CoreUsageArea-DobrSXk2.js} +1 -1
- package/public/assets/{Dashboard-BFMsMuc_.js → Dashboard-y3_9iQJo.js} +1 -1
- package/public/assets/{DuplicatePlanSubtree-BCt-Guuh.js → DuplicatePlanSubtree-BSQZFeNq.js} +1 -1
- package/public/assets/{DurationHistogram-xRcnND4k.js → DurationHistogram-DlQv4ZCB.js} +1 -1
- package/public/assets/{EmptyState-CnTrSjtU.js → EmptyState-DqnSxTjJ.js} +1 -1
- package/public/assets/{ExecutorUtilization-CP21XlUq.js → ExecutorUtilization-CuQUxaCd.js} +1 -1
- package/public/assets/{GcPressure-BoEJsLjb.js → GcPressure-CLT5hkMJ.js} +1 -1
- package/public/assets/{ImpactEstimate-BHcqJkcZ.js → ImpactEstimate-Df_laG-n.js} +1 -1
- package/public/assets/{IncompleteRun-b9FWrOHn.js → IncompleteRun-CpIkS4XZ.js} +1 -1
- package/public/assets/{JobFailures-C5FkTq3O.js → JobFailures-DKbvYc4J.js} +1 -1
- package/public/assets/{MemoryUtilization-D2W4AB_f.js → MemoryUtilization-C5kHmXIb.js} +1 -1
- package/public/assets/{OverBroadcast-Btu3xorf.js → OverBroadcast-C5pF66aq.js} +1 -1
- package/public/assets/{PartitionSizing-yZWhLN0e.js → PartitionSizing-BvEJQ5M1.js} +1 -1
- package/public/assets/{PlanExplorer-DSk1ivS4.js → PlanExplorer-DjGTZifP.js} +1 -1
- package/public/assets/{PlanGraphRoute-C3iOzUdB.js → PlanGraphRoute-DoIGA7_H.js} +1 -1
- package/public/assets/{RetryWaste-B4436kr1.js → RetryWaste-C0znHd_w.js} +1 -1
- package/public/assets/{RowPagination-oeWB8gBm.js → RowPagination-2icPidMP.js} +1 -1
- package/public/assets/{ShuffleIO-DUiv8EJe.js → ShuffleIO-L_XSnJ_V.js} +1 -1
- package/public/assets/{Skew-D2lB1oQc.js → Skew-w4uV5H_g.js} +1 -1
- package/public/assets/{SlowHost-Qb_8aa-W.js → SlowHost-D5tWJ1UR.js} +1 -1
- package/public/assets/{SmallFiles-u6suTgfj.js → SmallFiles-CTtNiSOh.js} +1 -1
- package/public/assets/{SpeculationWaste-vUCniiFP.js → SpeculationWaste-xCKwjz2K.js} +1 -1
- package/public/assets/{Spill-BskXFX2e.js → Spill-BT8my24K.js} +1 -1
- package/public/assets/{StageFailed-D9b83Jvy.js → StageFailed-De3vVDbc.js} +1 -1
- package/public/assets/{StageFindingGroup-DagqHOUz.js → StageFindingGroup-R4OW-g4U.js} +1 -1
- package/public/assets/{StageHeader-DibMSunO.js → StageHeader-CGeWqC-0.js} +1 -1
- package/public/assets/{StagePill-Dt6V9yVw.js → StagePill-BwwKLcFl.js} +1 -1
- package/public/assets/{StageShape-CfdrDUZa.js → StageShape-D4LmPVyV.js} +1 -1
- package/public/assets/{StageSlowness-BoGLIYKR.js → StageSlowness-8-z6qn4Q.js} +1 -1
- package/public/assets/{Straggler-DU1WSU-m.js → Straggler-BIgxsowI.js} +1 -1
- package/public/assets/{TaskFailures-DkY6zBNJ.js → TaskFailures-B9lLt6Rw.js} +1 -1
- package/public/assets/{TinyTask-Lsnt5mJF.js → TinyTask-DYXks5sT.js} +1 -1
- package/public/assets/{UnderBroadcast-DxHc0lwy.js → UnderBroadcast-BWqWMpeG.js} +1 -1
- package/public/assets/{finding-anchor-Bl1hRK5E.js → finding-anchor-CDbHtqKT.js} +1 -1
- package/public/assets/{inbox-DHIFHqcn.js → inbox-M_EuWNiK.js} +1 -1
- package/public/assets/{index-U654cmB8.js → index-pnImGbgQ.js} +3 -3
- package/public/assets/{parser-worker-5a9aUx3o.js → parser-worker-C3BAO6z9.js} +4 -2
- package/public/assets/{select-CtKaJ5Hx.js → select-C-MZGNpb.js} +1 -1
- package/public/assets/{toggle-group-DB2VfFIx.js → toggle-group-C3nz7UQ_.js} +1 -1
- package/public/assets/{useRecentFiles-BiYdWs8J.js → useRecentFiles-0XuhS91q.js} +4 -4
- package/public/assets/{useSortMode-BhPky1lW.js → useSortMode-DHlKZeWv.js} +1 -1
- package/public/assets/zstd-worker-C1Jq9lfb.js +1 -0
- package/public/docs/404.html +2 -2
- package/public/docs/assets/{app.BczRxXPr.js → app.DsFQcynM.js} +1 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.BEfYag5Q.js +1 -0
- package/public/docs/assets/chunks/{VPLocalSearchBox.DXvkTVnC.js → VPLocalSearchBox.oa8NbaiV.js} +1 -1
- package/public/docs/assets/chunks/{theme.ByUdwrLG.js → theme.Ca4dR9dL.js} +2 -2
- package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.B1vUqtry.js → contributor-guide_architecture_detector-contract.md.aQQfP7pj.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.sf9DU2bA.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_impact-estimation.md.DHVq1UPt.lean.js → contributor-guide_architecture_impact-estimation.md.sf9DU2bA.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.BXQdgG5u.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_overview.md.BXQdgG5u.lean.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.C0SovZX8.js → contributor-guide_architecture_worker-protocol.md.P7d1vtEJ.js} +2 -2
- package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.C0SovZX8.lean.js → contributor-guide_architecture_worker-protocol.md.P7d1vtEJ.lean.js} +1 -1
- package/public/docs/assets/contributor-guide_testing.md.BU6vyA-9.js +1 -0
- package/public/docs/assets/contributor-guide_testing.md.BU6vyA-9.lean.js +1 -0
- package/public/docs/contributor-guide/architecture/board-widgets.html +3 -3
- package/public/docs/contributor-guide/architecture/detector-contract.html +5 -5
- package/public/docs/contributor-guide/architecture/drill-down.html +3 -3
- package/public/docs/contributor-guide/architecture/impact-estimation.html +5 -5
- package/public/docs/contributor-guide/architecture/index.html +3 -3
- package/public/docs/contributor-guide/architecture/overview.html +5 -5
- package/public/docs/contributor-guide/architecture/state-and-history.html +3 -3
- package/public/docs/contributor-guide/architecture/widget-rendering.html +3 -3
- package/public/docs/contributor-guide/architecture/worker-protocol.html +5 -5
- package/public/docs/contributor-guide/contributing.html +3 -3
- package/public/docs/contributor-guide/development-setup.html +3 -3
- package/public/docs/contributor-guide/testing.html +5 -5
- package/public/docs/hashmap.json +1 -1
- package/public/docs/index.html +3 -3
- package/public/docs/tuning-reference/anti-patterns.html +3 -3
- package/public/docs/tuning-reference/aqe.html +3 -3
- package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +3 -3
- package/public/docs/tuning-reference/bottleneck-cold-start.html +3 -3
- package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +3 -3
- package/public/docs/tuning-reference/bottleneck-failures.html +3 -3
- package/public/docs/tuning-reference/bottleneck-gc.html +3 -3
- package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +3 -3
- package/public/docs/tuning-reference/bottleneck-memory-utilization.html +3 -3
- package/public/docs/tuning-reference/bottleneck-retry-waste.html +3 -3
- package/public/docs/tuning-reference/bottleneck-shuffle.html +3 -3
- package/public/docs/tuning-reference/bottleneck-skew.html +3 -3
- package/public/docs/tuning-reference/bottleneck-slow-host.html +3 -3
- package/public/docs/tuning-reference/bottleneck-small-files.html +3 -3
- package/public/docs/tuning-reference/bottleneck-spill.html +3 -3
- package/public/docs/tuning-reference/bottleneck-straggler.html +3 -3
- package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +3 -3
- package/public/docs/tuning-reference/bottleneck-utilization.html +3 -3
- package/public/docs/tuning-reference/caching.html +3 -3
- package/public/docs/tuning-reference/cluster-config.html +3 -3
- package/public/docs/tuning-reference/config.html +3 -3
- package/public/docs/tuning-reference/data-formats.html +3 -3
- package/public/docs/tuning-reference/index.html +3 -3
- package/public/docs/tuning-reference/intro.html +3 -3
- package/public/docs/tuning-reference/joins.html +3 -3
- package/public/docs/tuning-reference/memory-model.html +3 -3
- package/public/docs/tuning-reference/metrics.html +3 -3
- package/public/docs/tuning-reference/partitioning.html +3 -3
- package/public/docs/tuning-reference/pyspark.html +3 -3
- package/public/docs/tuning-reference/shuffle.html +3 -3
- package/public/docs/tuning-reference/spark-architecture.html +3 -3
- package/public/docs/tuning-reference/table-formats.html +3 -3
- package/public/docs/user-guide/alternative-log-retrieval.html +3 -3
- package/public/docs/user-guide/getting-started.html +3 -3
- package/public/docs/user-guide/mcp-tools.html +3 -3
- package/public/docs/user-guide/run-comparison.html +3 -3
- package/public/docs/user-guide/understanding-findings.html +3 -3
- package/public/index.html +1 -1
- package/vendor-core/impact-estimator.js +23 -3
- package/vendor-core/occupancy.js +8 -7
- package/vendor-core/parser-worker.js +31 -15
- package/vendor-core/plan-summary.js +1 -1
- package/vendor-core/stage-quantiles.js +53 -1
- package/vendor-core/types.js +5 -0
- package/vendor-core/zstd-worker-client.js +180 -0
- package/vendor-core/zstd-worker.js +103 -0
- package/public/docs/assets/chunks/@localSearchIndexroot.c2HfrwDg.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.DkXdJ9jE.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.DkXdJ9jE.lean.js +0 -1
- package/public/docs/assets/contributor-guide_testing.md.BohuQWvl.js +0 -1
- package/public/docs/assets/contributor-guide_testing.md.BohuQWvl.lean.js +0 -1
- /package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.B1vUqtry.lean.js → contributor-guide_architecture_detector-contract.md.aQQfP7pj.lean.js} +0 -0
|
@@ -109,7 +109,9 @@ function Fo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...z(n)})}//
|
|
|
109
109
|
function Io(e,t){let n=/* @__PURE__ */ Lo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Rt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Rt(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
|
|
110
110
|
function Lo(e,t){let n=new H({check:`custom`,...z(t)});return n._zod.check=e,n}function Ro(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Ze(e,t,n[t]);return e}function zo(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ma,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Bo(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function G(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,G(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ro(o.schema,c),t.io===`input`&&K(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Vo(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ho(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Vo(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Vo(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
111
111
|
|
|
112
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Uo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Uo(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const Wo=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Go=[`oneOf`,`anyOf`];function Ko(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function qo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Wo.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ko(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ze(n,r,e.length===1?e[0]:qo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ko(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Jo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Wo)if(t in e)return;let n=t.filter(e=>Go.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=qo(t);else{let e=n[0],i=Go.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>qo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ro(e,r))}function Yo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ro(i,s),Ro(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Uo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Jo(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ro(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ze(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Zo(t,`input`,e.processors),output:Zo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function K(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return K(r.element,n);if(r.type===`set`)return K(r.valueType,n);if(r.type===`lazy`)return K(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return K(r.innerType,n);if(r.type===`intersection`)return K(r.left,n)||K(r.right,n);if(r.type===`record`||r.type===`map`)return K(r.keyType,n)||K(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:K(r.in,n)||K(r.out,n);if(r.type===`object`){for(let e in r.shape)if(K(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(K(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(K(e,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}const Xo=(e,t={})=>n=>{let r=zo({...n,processors:t});return G(e,r),Ho(r,e),Yo(r,e)},Zo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=zo({...i??{},target:a,io:t,processors:n});return G(e,o),Ho(o,e),Yo(o,e)},Qo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},$o=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},es=(e,t)=>{Qo(e,`minimum`,t),$o(e,`maximum`,t)},ts=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ns=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},rs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},is=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},as=(e,t)=>Qo(e,`minimum`,t.minimum),os=(e,t)=>$o(e,`maximum`,t.maximum),ss=e=>(t,n)=>{is(t,n.format);let[r,i]=e[n.format];Qo(t,`minimum`,r),$o(t,`maximum`,i)},cs={greater_than:(e,t)=>Qo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>$o(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ts(e,t.value),number_format:ss(_t),bigint_format:ss(vt),min_length:as,max_length:os,length_equals:(e,t)=>es(e,t.length),min_size:as,max_size:os,size_equals:(e,t)=>es(e,t.size),string_format:(e,t)=>{is(e,t.format),t.pattern&&ns(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>rs(e,t.mime)};function ls(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)cs[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Qo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Qo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&$o(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&$o(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ts(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&rs(t,i.mime);for(let e of i.patterns??[])ns(t,e);return t}const us={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ds=/* @__PURE__ */ new Map([[pi,Zn],[hi,Qn]]),fs=e=>ds.get(e)??e,ps=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ls(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=us[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(fs);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ms=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ls(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Bo(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},hs=(e,t,n,r)=>{n.type=`boolean`},gs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},_s=(e,t,n,r)=>{n.not={}},vs=(e,t,n,r)=>{let i=e._zod.def,a=Ue(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ys=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Bo(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Bo(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},bs=(e,t,n,r)=>{Bo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},xs=(e,t,n,r)=>{Bo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ss=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ls(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=G(a.element,t,{...r,path:[...r.path,`items`]})};function Cs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Cs(t.out):t.type===`catch`?Cs(t.innerType):e._zod.optin}const ws=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Bo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ze(i.properties,e,G(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Cs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=G(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ts=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>G(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Es=(e,t,n,r)=>{let i=e._zod.def,a=G(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=G(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Ds=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>G(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?G(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Cs(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=ls(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Os(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Os(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Os(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?lr:cr).source),p):p}const ks=/* @__PURE__ */ new WeakMap;function As(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of ks.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Os(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const js=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ls(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=G(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Ze(i.patternProperties,fs(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=G(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=ks.get(t);n||(n=[],ks.set(t,n),t.deferred.push(()=>As(t))),n.push(e)}i.additionalProperties=G(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Cs(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Ms=(e,t,n,r)=>{let i=e._zod.def,a=G(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ns=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ps=Symbol();function Fs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Bo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ps):JSON.parse(o)}const Is=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Fs(i.defaultValue,e,t,n,r);o!==Ps&&(n.default=o)},Ls=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Fs(i.defaultValue,e,t,n,r);o!==Ps&&(n._prefault=o)},Rs=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Bo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},zs=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;G(o,t,r);let s=t.seen.get(e);s.ref=o},Bs=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Vs=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hs=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Us(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const Ws=/*@__PURE__*/ V(`ZodError`,(e,t)=>{fn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Hs.has(n)||(Hs.add(n),Us(n,`format`,e=>t=>hn(e,t)),Us(n,`flatten`,e=>t=>mn(e,t)),Us(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ge,2)}),Us(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ge,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Gs=/* @__PURE__ */ _n(Ws),Ks=/* @__PURE__ */ vn(Ws),qs=/* @__PURE__ */ yn(Ws),Js=/* @__PURE__ */ xn(Ws),Ys=/* @__PURE__ */ Dn(Ws),Xs=/* @__PURE__ */ On(Ws),Zs=/* @__PURE__ */ kn(Ws),Qs=/* @__PURE__ */ An(Ws),$s=/* @__PURE__ */ jn(Ws),ec=/* @__PURE__ */ Mn(Ws),tc=/* @__PURE__ */ Nn(Ws),nc=/* @__PURE__ */ Pn(Ws);function rc(){rn.localeError||an(Oa())}function ic(){rn.memoizer||an({memoizer:Ta()})}const q=/*@__PURE__*/ V(`ZodType`,(e,t)=>(rc(),U.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(it(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return mt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(wl(e,t))},superRefine(e,t){return this.check(Tl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Oo(e))},optional(){return ol(this)},exactOptional(){return cl(this)},nullable(){return ul(this)},nullish(){return ol(ul(this))},nonoptional(e){return gl(this,e)},array(){return Hc(this)},or(e){return Gc([this,e])},and(e){return Yc(this,e)},transform(e){return bl(this,il(e))},default(e){return fl(this,e)},prefault(e){return ml(this,e)},catch(e){return vl(this,e)},pipe(e){return bl(this,e)},readonly(){return Sl(this)},describe(e){let t=this.clone();return Ma.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ma.get(this);let t=this.clone();return Ma.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Vt(this,`~standard`,{...Fr(this),jsonSchema:{input:Zo(this,`input`),output:Zo(this,`output`)}})},set"~standard"(e){Bt(this,`~standard`,e)},parse:function e(t,n){return Gs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ks(this,t,n,{callee:e})},safeParse(e,t){return qs(this,e,t)},async safeParseAsync(e,t){return Js(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Bt(this,`spa`,e)},validate(e,t){return wn(this,e,t)},validateAsync(e,t){return En(this,e,t)},encode:function e(t,n){return Ys(this,t,n,{callee:e})},decode:function e(t,n){return Xs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Zs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Qs(this,t,n,{callee:e})},safeEncode(e,t){return $s(this,e,t)},safeDecode(e,t){return ec(this,e,t)},async safeEncodeAsync(e,t){return tc(this,e,t)},async safeDecodeAsync(e,t){return nc(this,e,t)},toJSONSchema(e){return Xo(this,{})(e)},get description(){return Ma.get(this)?.description},get _def(){return this._zod.def}}),ac=/*@__PURE__*/ V(`_ZodString`,(e,t)=>{Ir.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r)},/*@__PURE__*/ Ht({format:e=>ls(e).format??null,minLength:e=>ls(e).minimum??null,maxLength:e=>ls(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ So(...e))},includes(...e){return this.check(/* @__PURE__ */ To(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Eo(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Do(...e))},min(...e){return this.check(/* @__PURE__ */ bo(...e))},max(...e){return this.check(/* @__PURE__ */ yo(...e))},length(...e){return this.check(/* @__PURE__ */ xo(...e))},nonempty(...e){return this.check(/* @__PURE__ */ bo(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Co(e))},uppercase(e){return this.check(/* @__PURE__ */ wo(e))},trim(){return this.check(/* @__PURE__ */ Ao())},normalize(...e){return this.check(/* @__PURE__ */ ko(...e))},toLowerCase(){return this.check(/* @__PURE__ */ jo())},toUpperCase(){return this.check(/* @__PURE__ */ Mo())},slugify(){return this.check(/* @__PURE__ */ No())}})),oc=/*@__PURE__*/ V(`ZodString`,(e,t)=>{Ir.init(e,t),ac.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Fa(dc,e))},url(e){return this.check(/* @__PURE__ */ Va(mc,e))},jwt(e){return this.check(/* @__PURE__ */ no(kc,e))},emoji(e){return this.check(/* @__PURE__ */ Ha(hc,e))},guid(e){return this.check(/* @__PURE__ */ Ia(fc,e))},uuid(e){return this.check(/* @__PURE__ */ La(pc,e))},uuidv4(e){return this.check(/* @__PURE__ */ Ra(pc,e))},uuidv6(e){return this.check(/* @__PURE__ */ za(pc,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ba(pc,e))},nanoid(e){return this.check(/* @__PURE__ */ Ua(gc,e))},cuid(e){return this.check(/* @__PURE__ */ Wa(_c,e))},cuid2(e){return this.check(/* @__PURE__ */ Ga(vc,e))},ulid(e){return this.check(/* @__PURE__ */ Ka(yc,e))},base64(e){return this.check(/* @__PURE__ */ $a(Ec,e))},base64url(e){return this.check(/* @__PURE__ */ eo(Dc,e))},xid(e){return this.check(/* @__PURE__ */ qa(bc,e))},ksuid(e){return this.check(/* @__PURE__ */ Ja(xc,e))},ipv4(e){return this.check(/* @__PURE__ */ Ya(Sc,e))},ipv6(e){return this.check(/* @__PURE__ */ Xa(Cc,e))},cidrv4(e){return this.check(/* @__PURE__ */ Za(wc,e))},cidrv6(e){return this.check(/* @__PURE__ */ Qa(Tc,e))},e164(e){return this.check(/* @__PURE__ */ to(Oc,e))},datetime(e){return this.check(/* @__PURE__ */ ro(sc,e))},date(e){return this.check(/* @__PURE__ */ io(cc,e))},time(e){return this.check(/* @__PURE__ */ ao(lc,e))},duration(e){return this.check(/* @__PURE__ */ oo(uc,e))}});function J(e){return/* @__PURE__ */ Pa(oc,e)}const Y=/*@__PURE__*/ V(`ZodStringFormat`,(e,t)=>{W.init(e,t),ac.init(e,t)}),sc=/*@__PURE__*/ V(`ZodISODateTime`,(e,t)=>{ti.init(e,t),Y.init(e,t)}),cc=/*@__PURE__*/ V(`ZodISODate`,(e,t)=>{ni.init(e,t),Y.init(e,t)}),lc=/*@__PURE__*/ V(`ZodISOTime`,(e,t)=>{ri.init(e,t),Y.init(e,t)}),uc=/*@__PURE__*/ V(`ZodISODuration`,(e,t)=>{ii.init(e,t),Y.init(e,t)}),dc=/*@__PURE__*/ V(`ZodEmail`,(e,t)=>{zr.init(e,t),Y.init(e,t)}),fc=/*@__PURE__*/ V(`ZodGUID`,(e,t)=>{Lr.init(e,t),Y.init(e,t)}),pc=/*@__PURE__*/ V(`ZodUUID`,(e,t)=>{Rr.init(e,t),Y.init(e,t)}),mc=/*@__PURE__*/ V(`ZodURL`,(e,t)=>{qr.init(e,t),Y.init(e,t)}),hc=/*@__PURE__*/ V(`ZodEmoji`,(e,t)=>{Jr.init(e,t),Y.init(e,t)}),gc=/*@__PURE__*/ V(`ZodNanoID`,(e,t)=>{Yr.init(e,t),Y.init(e,t)}),_c=/*@__PURE__*/ V(`ZodCUID`,(e,t)=>{Xr.init(e,t),Y.init(e,t)}),vc=/*@__PURE__*/ V(`ZodCUID2`,(e,t)=>{Zr.init(e,t),Y.init(e,t)}),yc=/*@__PURE__*/ V(`ZodULID`,(e,t)=>{Qr.init(e,t),Y.init(e,t)}),bc=/*@__PURE__*/ V(`ZodXID`,(e,t)=>{$r.init(e,t),Y.init(e,t)}),xc=/*@__PURE__*/ V(`ZodKSUID`,(e,t)=>{ei.init(e,t),Y.init(e,t)}),Sc=/*@__PURE__*/ V(`ZodIPv4`,(e,t)=>{ai.init(e,t),Y.init(e,t)}),Cc=/*@__PURE__*/ V(`ZodIPv6`,(e,t)=>{ci.init(e,t),Y.init(e,t)}),wc=/*@__PURE__*/ V(`ZodCIDRv4`,(e,t)=>{li.init(e,t),Y.init(e,t)}),Tc=/*@__PURE__*/ V(`ZodCIDRv6`,(e,t)=>{di.init(e,t),Y.init(e,t)}),Ec=/*@__PURE__*/ V(`ZodBase64`,(e,t)=>{mi.init(e,t),Y.init(e,t)}),Dc=/*@__PURE__*/ V(`ZodBase64URL`,(e,t)=>{_i.init(e,t),Y.init(e,t)}),Oc=/*@__PURE__*/ V(`ZodE164`,(e,t)=>{vi.init(e,t),Y.init(e,t)}),kc=/*@__PURE__*/ V(`ZodJWT`,(e,t)=>{bi.init(e,t),Y.init(e,t)}),Ac=/*@__PURE__*/ V(`ZodNumber`,(e,t)=>{xi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ht({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ls(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ls(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ls(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ls(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ go(e,t))},gte(e,t){return this.check(/* @__PURE__ */ _o(e,t))},min(e,t){return this.check(/* @__PURE__ */ _o(e,t))},lt(e,t){return this.check(/* @__PURE__ */ mo(e,t))},lte(e,t){return this.check(/* @__PURE__ */ ho(e,t))},max(e,t){return this.check(/* @__PURE__ */ ho(e,t))},int(e){return this.check(Mc(e))},safe(e){return this.check(Mc(e))},positive(e){return this.check(/* @__PURE__ */ go(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ _o(0,e))},negative(e){return this.check(/* @__PURE__ */ mo(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ ho(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ vo(e,t))},step(e,t){return this.check(/* @__PURE__ */ vo(e,t))},finite(){return this}}));function X(e){return/* @__PURE__ */ so(Ac,e)}const jc=/*@__PURE__*/ V(`ZodNumberFormat`,(e,t)=>{Si.init(e,t),Ac.init(e,t)});function Mc(e){return/* @__PURE__ */ co(jc,e)}const Nc=/*@__PURE__*/ V(`ZodBoolean`,(e,t)=>{Ci.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r)});function Pc(e){return/* @__PURE__ */ lo(Nc,e)}const Fc=/*@__PURE__*/ V(`ZodNull`,(e,t)=>{wi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r)});function Ic(e){return/* @__PURE__ */ uo(Fc,e)}const Lc=/*@__PURE__*/ V(`ZodUnknown`,(e,t)=>{Ti.init(e,t),q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Rc(){return/* @__PURE__ */ fo(Lc)}const zc=/*@__PURE__*/ V(`ZodNever`,(e,t)=>{Ei.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r)});function Bc(e){return/* @__PURE__ */ po(zc,e)}const Vc=/*@__PURE__*/ V(`ZodArray`,(e,t)=>{ic(),Oi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ bo(e,t))},nonempty(e){return this.check(/* @__PURE__ */ bo(1,e))},max(e,t){return this.check(/* @__PURE__ */ yo(e,t))},length(e,t){return this.check(/* @__PURE__ */ xo(e,t))},unwrap(){return this.element}});function Hc(e,t){return/* @__PURE__ */ Po(Vc,e,t)}const Uc=/*@__PURE__*/ V(`ZodObject`,(e,t)=>{ic(),Pi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),Jt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return tl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(it(this._zod.def,{catchall:e}))},passthrough(){return this.clone(it(this._zod.def,{catchall:Rc()}))},loose(){return this.clone(it(this._zod.def,{catchall:Rc()}))},strict(){return this.clone(it(this._zod.def,{catchall:Bc()}))},strip(){return this.clone(it(this._zod.def,{catchall:void 0}))},extend(e){return St(this,e)},safeExtend(e){return wt(this,e)},merge(e){return Tt(this,e)},pick(e){return yt(this,e)},omit(e){return xt(this,e)},partial(...e){return Et(al,this,e[0])},exactPartial(...e){return Et(sl,this,e[0],`exactPartial`)},required(...e){return Dt(hl,this,e[0])}});function Z(e,t){let n={type:`object`,shape:e??{},...z(t)};return new Uc(n)}const Wc=/*@__PURE__*/ V(`ZodUnion`,(e,t)=>{Ii.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ts(e,t,n,r),e.options=t.options});function Gc(e,t){return new Wc({type:`union`,options:e,...z(t)})}const Kc=/*@__PURE__*/ V(`ZodDiscriminatedUnion`,(e,t)=>{Wc.init(e,t),Ri.init(e,t)});function qc(e,t,n){return new Kc({type:`union`,options:t,discriminator:e,...z(n)})}const Jc=/*@__PURE__*/ V(`ZodIntersection`,(e,t)=>{zi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Es(e,t,n,r)});function Yc(e,t){return new Jc({type:`intersection`,left:e,right:t})}const Xc=/*@__PURE__*/ V(`ZodTuple`,(e,t)=>{ic(),Hi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ds(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new al({type:`optional`,innerType:e}))})}});function Zc(e,t,n){let r=t instanceof U;return new Xc({type:`tuple`,items:e,rest:r?t:null,...z(r?n:t)})}const Qc=/*@__PURE__*/ V(`ZodRecord`,(e,t)=>{ic(),Ki.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function $c(e,t,n){return!t||!t._zod?new Qc({type:`record`,keyType:J(),valueType:e,...z(t)}):new Qc({type:`record`,keyType:e,valueType:t,...z(n)})}const el=/*@__PURE__*/ V(`ZodEnum`,(e,t)=>{qi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new el({...t,checks:[],...z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new el({...t,checks:[],...z(r),entries:i})}});function tl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new el({type:`enum`,entries:n,...z(t)})}const nl=/*@__PURE__*/ V(`ZodLiteral`,(e,t)=>{Ji.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new nl({type:`literal`,values:Array.isArray(e)?e:[e],...z(t)})}const rl=/*@__PURE__*/ V(`ZodTransform`,(e,t)=>{ic(),Yi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Rt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function il(e){return new rl({type:`transform`,transform:e})}const al=/*@__PURE__*/ V(`ZodOptional`,(e,t)=>{Zi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ol(e){return new al({type:`optional`,innerType:e})}const sl=/*@__PURE__*/ V(`ZodExactOptional`,(e,t)=>{Qi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cl(e){return new sl({type:`optional`,innerType:e})}const ll=/*@__PURE__*/ V(`ZodNullable`,(e,t)=>{$i.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ul(e){return new ll({type:`nullable`,innerType:e})}const dl=/*@__PURE__*/ V(`ZodDefault`,(e,t)=>{ea.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fl(e,t){return new dl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():dt(t)}})}const pl=/*@__PURE__*/ V(`ZodPrefault`,(e,t)=>{na.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ml(e,t){return new pl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():dt(t)}})}const hl=/*@__PURE__*/ V(`ZodNonOptional`,(e,t)=>{ra.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gl(e,t){return new hl({type:`nonoptional`,innerType:e,...z(t)})}const _l=/*@__PURE__*/ V(`ZodCatch`,(e,t)=>{oa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vl(e,t){return new _l({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Yt(t)})}const yl=/*@__PURE__*/ V(`ZodPipe`,(e,t)=>{sa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r),e.in=t.in,e.out=t.out});function bl(e,t){return new yl({type:`pipe`,in:e,out:t})}const xl=/*@__PURE__*/ V(`ZodReadonly`,(e,t)=>{la.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new xl({type:`readonly`,innerType:e})}const Cl=/*@__PURE__*/ V(`ZodCustom`,(e,t)=>{da.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r)});function wl(e,t={}){return/* @__PURE__ */ Fo(Cl,e,t)}function Tl(e,t){return/* @__PURE__ */ Io(e,t)}const El={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};var Dl;Dl||={};const Ol=Z({name:J(),accumulatorId:X().optional(),value:Gc([J(),X()]).optional(),metricType:J().optional()}),kl=Z({nodeName:J(),simpleString:J().optional(),metrics:Hc(Ol).optional(),metadata:$c(J(),Rc()).optional(),children:Hc(Rc())});function Al(e){let t=kl.parse(e),n=[{shallow:t,children:[],pendingRaw:[...t.children],depth:0}],r=/* @__PURE__ */ new Map;for(;n.length>0;){let e=n[n.length-1];if(e.pendingRaw.length===0){n.pop();let t={...e.shallow,children:e.children},i=r.get(e);if(i){i.children.push(t);continue}return t}if(e.depth>500)throw Error(`sparkPlanInfo tree exceeds max depth of 500`);let t=e.pendingRaw.shift(),i=kl.parse(t),a={shallow:i,children:[],pendingRaw:[...i.children],depth:e.depth+1};r.set(a,e),n.push(a)}throw Error(`unreachable: sparkPlanInfo tree stack exhausted without resolving root`)}const jl=Rc().nullable().optional().transform((e,t)=>{if(e==null)return null;try{return Al(e)}catch(e){return t.addIssue({code:El.custom,message:e instanceof Error?e.message:String(e)}),Zt}}),Ml=Z({Event:Q(`SparkListenerLogStart`),"Spark Version":J().optional()}),Nl=Z({Event:Q(`SparkListenerApplicationStart`),"App ID":J().optional(),"App Name":J().optional(),Timestamp:X().optional(),"Spark Version":J().optional()}),Pl=Gc([J(),X(),Pc()]),Fl=Z({Event:Q(`SparkListenerEnvironmentUpdate`),"Spark Properties":Gc([$c(J(),Pl),Hc(Zc([J(),Pl])),Ic()]).optional()}),Il=Z({Event:Q(`SparkListenerApplicationEnd`),Timestamp:X().optional()}),Ll=Z({Event:Q(`SparkListenerExecutorAdded`),Timestamp:X(),"Executor ID":J(),"Executor Info":Z({Host:J().optional(),"Total Cores":X().optional(),"Resource Profile Id":X().optional()}).optional(),"Resource Profile Id":X().optional()}),Rl=Z({Event:Q(`SparkListenerExecutorRemoved`),Timestamp:X(),"Executor ID":J(),"Removed Reason":J().optional()}),zl=Z({Event:Q(`SparkListenerJobStart`),"Job ID":X().optional(),"Submission Time":X().optional(),"Stage IDs":Hc(X()).optional(),Properties:Z({"spark.sql.execution.id":Gc([J(),X()]).optional()}).optional()}),Bl=Z({Event:Q(`SparkListenerJobEnd`),"Job ID":X(),"Completion Time":X().optional(),"Job Result":Z({Result:J().optional(),Exception:Z({Message:J().optional()}).optional()}).optional()}),Vl=Z({"RDD ID":X().optional(),Name:J().optional(),Callsite:J().optional(),"Storage Level":Z({"Use Disk":Pc().optional(),"Use Memory":Pc().optional(),Deserialized:Pc().optional(),Replication:X().optional()}).optional(),"Number of Partitions":X().optional(),"Number of Cached Partitions":X().optional(),"Memory Size":X().optional(),"Disk Size":X().optional()}),Hl=qc(`Event`,[Ml,Nl,Fl,Il,zl,Bl,Z({Event:Q(`SparkListenerStageSubmitted`),"Stage Info":Z({"Stage ID":X(),"Stage Name":J().optional(),Details:J().optional(),"Submission Time":X().optional(),"Parent IDs":Hc(X()).optional(),"RDD Info":Hc(Vl).optional()})}),Z({Event:Q(`SparkListenerStageCompleted`),"Stage Info":Z({"Stage ID":X(),"Submission Time":X().optional(),"Completion Time":X().optional(),"Failure Reason":J().optional()})}),Z({Event:Q(`SparkListenerStageExecutorMetrics`),"Stage ID":X(),"Executor ID":J(),"Executor Metrics":$c(J(),X()).optional()}),Z({Event:Q(`SparkListenerTaskEnd`),"Stage ID":X(),"Stage Attempt ID":X().optional(),"Task End Reason":Z({Reason:J().optional()}).optional(),"Task Info":Z({"Launch Time":X().optional(),"Finish Time":X().optional(),Failed:Pc().optional(),Killed:Pc().optional(),Speculative:Pc().optional(),Host:J().optional(),"Executor ID":J().optional(),Locality:J().optional(),Index:X().optional(),"Task ID":X().optional(),"Attempt Number":X().optional(),Accumulables:Hc(Z({ID:X()})).max(1e4).optional()}).optional(),"Task Metrics":Z({"Peak Execution Memory":X().optional(),"JVM GC Time":X().optional(),"Memory Bytes Spilled":X().optional(),"Disk Bytes Spilled":X().optional(),"Executor Run Time":X().optional(),"Executor CPU Time":X().optional(),"Shuffle Read Metrics":Z({"Remote Bytes Read":X().optional(),"Local Bytes Read":X().optional(),"Fetch Wait Time":X().optional()}).optional(),"Shuffle Write Metrics":Z({"Shuffle Bytes Written":X().optional()}).optional(),"Input Metrics":Z({"Bytes Read":X().optional()}).optional(),"Output Metrics":Z({"Bytes Written":X().optional()}).optional()}).optional()}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart`),executionId:X(),description:J().optional(),time:X(),sparkPlanInfo:jl}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate`),executionId:X(),sparkPlanInfo:jl}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd`),executionId:X(),time:X()}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerDriverAccumUpdates`),executionId:X(),accumUpdates:Hc(Zc([X(),X()]))}),Ll,Rl]);function Ul(e){throw Error(`Unreachable case: ${JSON.stringify(e)}`)}const Wl=[{key:`DURATION`,name:`duration`,prop:`duration`},{key:`GC_TIME`,name:`gcTime`,prop:`gcTime`},{key:`MEM_SPILLED`,name:`memorySpilled`,prop:`memSpilled`},{key:`DISK_SPILLED`,name:`diskSpilled`,prop:`diskSpilled`},{key:`SHUFFLE_READ`,name:`shuffleRead`,prop:`shuffleRead`},{key:`SHUFFLE_WRITE`,name:`shuffleWrite`,prop:`shuffleWrite`},{key:`LAUNCH_TIME`,name:`launchTime`,prop:`launchTime`},{key:`FINISH_TIME`,name:`finishTime`,prop:`finishTime`}],Gl=Wl.length,$=Object.freeze({...Object.fromEntries(Wl.map((e,t)=>[e.key,t])),STRIDE:Gl}),Kl=Wl.map(e=>e.name),ql=Wl.map(e=>e.prop);function Jl(e,t,n){if(t.taskAttempts===null)return null;let r=t,i=[],a=0,o=0,s=0,c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=[],f=/* @__PURE__ */ new Map,p=0;for(let e of t.taskAttempts.values()){if(a++,e.failed&&(o++,e.reason&&u.set(e.reason,(u.get(e.reason)??0)+1),d.length<20&&d.push({taskId:e.taskId,attemptNumber:e.attemptNumber,host:e.host,executorId:e.executorId,reason:e.reason,peakExecMem:e.peakExecMem,memSpilled:e.memSpilled,shuffleWrite:e.shuffleWrite})),e.speculative&&s++,e.host){let t=c.get(e.host);t||(t={taskCount:0,totalDuration:0},c.set(e.host,t)),t.taskCount++,t.totalDuration+=e.duration}if(e.executorId){let t=l.get(e.executorId);t||(t={taskCount:0,totalDuration:0,inputBytes:0,shuffleReadBytes:0,shuffleWriteBytes:0},l.set(e.executorId,t)),t.taskCount++,t.totalDuration+=e.duration,t.inputBytes+=e.inputBytes,t.shuffleReadBytes+=e.shuffleRead,t.shuffleWriteBytes+=e.shuffleWrite}e.locality&&f.set(e.locality,(f.get(e.locality)??0)+1),e.peakExecMem>p&&(p=e.peakExecMem),r.shuffleReadBytes+=e.shuffleRead,r.shuffleWriteBytes+=e.shuffleWrite,r.fetchWaitTime+=e.fetchWaitTime,r.memoryBytesSpilled+=e.memSpilled,r.diskBytesSpilled+=e.diskSpilled,r.jvmGCTime+=e.gcTime,r.executorRunTime+=e.executorRunTime,r.executorCpuTime+=e.executorCpuTime,r.inputBytes+=e.inputBytes,r.outputBytes+=e.outputBytes;for(let t=0;t<ql.length;t++)i.push(e[ql[t]])}t.taskCount=a,t.failedTasks=o,t.speculativeTasks=s,t.taskAttempts=null;let m=new Float64Array(i);n.taskStore.set(e,m);let{p50:h,p95:g,max:_}=Ql(m),v=r.memoryBytesSpilled>0?$l(m):`unclassified`,{p50:y,p95:ee,max:b}=Zl(m,$.SHUFFLE_READ),{p50:x,p95:S,max:C}=Zl(m,$.MEM_SPILLED),{p50:w,p95:T,max:E}=Zl(m,$.DISK_SPILLED),D=4*h,O=0,k=0,A=0,j=m.length/$.STRIDE;if(h>0)for(let e=0;e<j;e++){let t=m[e*$.STRIDE+$.DURATION];t>D?(O++,k+=t-h):t>A&&(A=t)}let te=[...c.entries()].map(([e,t])=>({host:e,taskCount:t.taskCount,totalDuration:t.totalDuration})),M=[...l.entries()].map(([e,t])=>({executorId:e,taskCount:t.taskCount,totalDuration:t.totalDuration,inputBytes:t.inputBytes,shuffleReadBytes:t.shuffleReadBytes,shuffleWriteBytes:t.shuffleWriteBytes})),ne=[...u.entries()].map(([e,t])=>({reason:e,count:t})),re=[...f.entries()].map(([e,t])=>({locality:e,count:t})),ie={...t,hostStats:te,executorStats:M,failureReasons:ne,localityStats:re,stragglerCount:O,stragglerExcessMs:k,longestNonStragglerMs:A,failedTaskSamples:d,peakExecutionMemoryMax:p,taskActiveMs:Yl(m),peakConcurrentTasks:Xl(m),taskDurationP50:h,taskDurationP95:g,taskDurationMax:_,shuffleReadP50:y,shuffleReadP95:ee,shuffleReadMax:b,spillMemP50:x,spillMemP95:S,spillMemMax:C,spillDiskP50:w,spillDiskP95:T,spillDiskMax:E,gcPct:r.executorRunTime>0?r.jvmGCTime/r.executorRunTime*100:0,spillClassification:v,stageType:r.shuffleReadBytes>0?`REDUCE`:`MAP`};return delete ie.taskAttempts,{type:`stage`,data:ie}}function Yl(e){let t=e.length/$.STRIDE,n=[];for(let r=0;r<t;r++){let t=e[r*$.STRIDE+$.LAUNCH_TIME],i=e[r*$.STRIDE+$.FINISH_TIME];t>0&&i>t&&n.push([t,i])}n.sort((e,t)=>e[0]-t[0]);let r=0,i=-1/0,a=-1/0;for(let[e,t]of n)e>a?(a>i&&(r+=a-i),i=e,a=t):t>a&&(a=t);return a>i&&(r+=a-i),r}function Xl(e){let t=e.length/$.STRIDE,n=[],r=[];for(let i=0;i<t;i++){let t=e[i*$.STRIDE+$.LAUNCH_TIME],a=e[i*$.STRIDE+$.FINISH_TIME];t>0&&a>t&&(n.push(t),r.push(a))}n.sort((e,t)=>e-t),r.sort((e,t)=>e-t);let i=0,a=0,o=0;for(let e of n){for(;o<r.length&&r[o]<=e;)a--,o++;a++,a>i&&(i=a)}return i}function Zl(e,t){let n=e.length/$.STRIDE;if(n===0)return{p50:0,p95:0,max:0};let r=new Float64Array(n);for(let i=0;i<n;i++)r[i]=e[i*$.STRIDE+t];return r.sort(),{p50:r[Math.ceil(n*.5)-1],p95:r[Math.ceil(n*.95)-1],max:r[n-1]}}function Ql(e){return Zl(e,$.DURATION)}function $l(e){let t=e.length/$.STRIDE;if(t===0)return`unclassified`;let n=0;for(let r=0;r<t;r++)e[r*$.STRIDE+$.MEM_SPILLED]===0&&n++;let r=n/t;return r>=.8?`skew`:r<.2?`volume`:`unclassified`}function eu(e,t){let n=[];for(let{launch:t,finish:r}of e)r>t&&(n.push({t,delta:1}),n.push({t:r,delta:-1}));n.sort((e,t)=>e.t-t.t||e.delta-t.delta);let r=[],i=0;for(let e=0;e<n.length;e++){let a=n[e];i+=a.delta;let o=n[e+1];if(!o||o.t===a.t)continue;let s=t==null?i:Math.min(i,t);r.push({tStart:a.t,tEnd:o.t,busy:s})}return r}function tu(e,{bucketBy:t=`time`,bucketWidthMs:n=1e3,hypotheticalCores:r=null}={}){let i=eu(e,r);if(t===`coreCount`){let e=[];for(let t of i)e[t.busy]=(e[t.busy]??0)+(t.tEnd-t.tStart);for(let t=0;t<e.length;t++)e[t]===void 0&&(e[t]=0);return{mode:`coreCount`,histogram:e}}if(i.length===0)return{mode:`time`,bucketWidthMs:n,startTime:null,endTime:null,buckets:[]};let a=i[0].tStart,o=i[i.length-1].tEnd,s=[];for(let e=a;e<o;e+=n){let t=e+n,r=0;for(let n of i){let i=Math.max(n.tStart,e),a=Math.min(n.tEnd,t);a>i&&(r+=n.busy*(a-i))}s.push({tStart:e,tEnd:t,busyCoreMs:r,avgBusyCores:r/n})}return{mode:`time`,bucketWidthMs:n,startTime:a,endTime:o,buckets:s}}function nu(e){let t=[],n={};for(let[r,i]of e){let e=i.length/$.STRIDE,a=0;for(let n=0;n<e;n++){let e=n*$.STRIDE,r=i[e+$.LAUNCH_TIME],o=i[e+$.FINISH_TIME];a+=i[e+$.DURATION],o>r&&t.push({launch:r,finish:o})}n[r]={totalTaskDurationSum:a,taskCount:e}}let{histogram:r}=tu(t,{bucketBy:`coreCount`}),i=0;for(let e=0;e<r.length;e++)i+=e*r[e];let a=r.length>0?r.length-1:0;return{coreHistogram:r,busyCoreMs:i,peakConcurrentCores:a,perStage:n}}const ru=524288;function iu(){let e=new TextDecoder(`utf-8`),t=``,n=``,r=!1,i=!1,a=``,o=!1,s=0;function c(e){let n=Mu.length-1,r=t.length-e.length;if(a!==``){let t=(a+e.slice(0,n)).indexOf(Mu);if(t!==-1)return r-a.length+t}let i=e.indexOf(Mu);return i===-1?(a=e.length>=n?e.slice(-n):(a+e).slice(-n),-1):r+i}function l(l,u){if(!i){if(t.length<ju.length){r=!ju.startsWith(t);return}if(!(n.length>=ju.length?n:t).startsWith(ju)){r=!0;return}i=!0,a=``,u=t}let d=c(u);if(d===-1)return;r=!0;let f=d+Mu.length;if(Fu(t,f)!==-1)return;let p=0;if(l===Nu)for(let e=t.length-1;e>=f&&t.charCodeAt(e)===Nu;e--)p++;s=p,t=t.substring(0,f),n=t,e.decode(),o=!0}function u(a,c,u){let d=0;if(o){let e=a.indexOf(Pu),t=Iu(a,e===-1?a.length:e,s);if(t===-1&&e===-1){let e=a.length-1;for(;e>=0&&a[e]===Nu;)e--;s=a.length-1-e+(e<0?s:0);return}o=!1,d=t===-1?e:t}let f=e.decode(d===0?a:a.subarray(d),{stream:!0}),p=f.indexOf(`
|
|
112
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Uo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Uo(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const Wo=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),Go=[`oneOf`,`anyOf`];function Ko(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function qo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Wo.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ko(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ze(n,r,e.length===1?e[0]:qo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ko(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Jo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Wo)if(t in e)return;let n=t.filter(e=>Go.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=qo(t);else{let e=n[0],i=Go.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>qo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ro(e,r))}function Yo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ro(i,s),Ro(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Uo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Jo(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ro(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ze(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Zo(t,`input`,e.processors),output:Zo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function K(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return K(r.element,n);if(r.type===`set`)return K(r.valueType,n);if(r.type===`lazy`)return K(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return K(r.innerType,n);if(r.type===`intersection`)return K(r.left,n)||K(r.right,n);if(r.type===`record`||r.type===`map`)return K(r.keyType,n)||K(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:K(r.in,n)||K(r.out,n);if(r.type===`object`){for(let e in r.shape)if(K(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(K(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(K(e,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}const Xo=(e,t={})=>n=>{let r=zo({...n,processors:t});return G(e,r),Ho(r,e),Yo(r,e)},Zo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=zo({...i??{},target:a,io:t,processors:n});return G(e,o),Ho(o,e),Yo(o,e)},Qo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},$o=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},es=(e,t)=>{Qo(e,`minimum`,t),$o(e,`maximum`,t)},ts=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ns=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},rs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},is=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},as=(e,t)=>Qo(e,`minimum`,t.minimum),os=(e,t)=>$o(e,`maximum`,t.maximum),ss=e=>(t,n)=>{is(t,n.format);let[r,i]=e[n.format];Qo(t,`minimum`,r),$o(t,`maximum`,i)},cs={greater_than:(e,t)=>Qo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>$o(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ts(e,t.value),number_format:ss(_t),bigint_format:ss(vt),min_length:as,max_length:os,length_equals:(e,t)=>es(e,t.length),min_size:as,max_size:os,size_equals:(e,t)=>es(e,t.size),string_format:(e,t)=>{is(e,t.format),t.pattern&&ns(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>rs(e,t.mime)};function ls(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)cs[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Qo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Qo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&$o(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&$o(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ts(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&rs(t,i.mime);for(let e of i.patterns??[])ns(t,e);return t}const us={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ds=/* @__PURE__ */ new Map([[pi,Zn],[hi,Qn]]),fs=e=>ds.get(e)??e,ps=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ls(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=us[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(fs);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ms=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ls(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Bo(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},hs=(e,t,n,r)=>{n.type=`boolean`},gs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},_s=(e,t,n,r)=>{n.not={}},vs=(e,t,n,r)=>{let i=e._zod.def,a=Ue(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ys=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Bo(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Bo(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},bs=(e,t,n,r)=>{Bo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},xs=(e,t,n,r)=>{Bo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ss=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ls(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=G(a.element,t,{...r,path:[...r.path,`items`]})};function Cs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Cs(t.out):t.type===`catch`?Cs(t.innerType):e._zod.optin}const ws=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Bo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ze(i.properties,e,G(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Cs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=G(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ts=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>G(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Es=(e,t,n,r)=>{let i=e._zod.def,a=G(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=G(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Ds=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>G(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?G(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Cs(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=ls(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Os(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Os(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Os(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?lr:cr).source),p):p}const ks=/* @__PURE__ */ new WeakMap;function As(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of ks.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Os(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const js=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ls(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=G(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Ze(i.patternProperties,fs(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=G(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=ks.get(t);n||(n=[],ks.set(t,n),t.deferred.push(()=>As(t))),n.push(e)}i.additionalProperties=G(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Cs(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Ms=(e,t,n,r)=>{let i=e._zod.def,a=G(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ns=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ps=Symbol();function Fs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Bo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ps):JSON.parse(o)}const Is=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Fs(i.defaultValue,e,t,n,r);o!==Ps&&(n.default=o)},Ls=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Fs(i.defaultValue,e,t,n,r);o!==Ps&&(n._prefault=o)},Rs=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Bo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},zs=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;G(o,t,r);let s=t.seen.get(e);s.ref=o},Bs=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Vs=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hs=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function Us(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const Ws=/*@__PURE__*/ V(`ZodError`,(e,t)=>{fn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Hs.has(n)||(Hs.add(n),Us(n,`format`,e=>t=>hn(e,t)),Us(n,`flatten`,e=>t=>mn(e,t)),Us(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ge,2)}),Us(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ge,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Gs=/* @__PURE__ */ _n(Ws),Ks=/* @__PURE__ */ vn(Ws),qs=/* @__PURE__ */ yn(Ws),Js=/* @__PURE__ */ xn(Ws),Ys=/* @__PURE__ */ Dn(Ws),Xs=/* @__PURE__ */ On(Ws),Zs=/* @__PURE__ */ kn(Ws),Qs=/* @__PURE__ */ An(Ws),$s=/* @__PURE__ */ jn(Ws),ec=/* @__PURE__ */ Mn(Ws),tc=/* @__PURE__ */ Nn(Ws),nc=/* @__PURE__ */ Pn(Ws);function rc(){rn.localeError||an(Oa())}function ic(){rn.memoizer||an({memoizer:Ta()})}const q=/*@__PURE__*/ V(`ZodType`,(e,t)=>(rc(),U.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(it(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return mt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(wl(e,t))},superRefine(e,t){return this.check(Tl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Oo(e))},optional(){return ol(this)},exactOptional(){return cl(this)},nullable(){return ul(this)},nullish(){return ol(ul(this))},nonoptional(e){return gl(this,e)},array(){return Hc(this)},or(e){return Gc([this,e])},and(e){return Yc(this,e)},transform(e){return bl(this,il(e))},default(e){return fl(this,e)},prefault(e){return ml(this,e)},catch(e){return vl(this,e)},pipe(e){return bl(this,e)},readonly(){return Sl(this)},describe(e){let t=this.clone();return Ma.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ma.get(this);let t=this.clone();return Ma.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Vt(this,`~standard`,{...Fr(this),jsonSchema:{input:Zo(this,`input`),output:Zo(this,`output`)}})},set"~standard"(e){Bt(this,`~standard`,e)},parse:function e(t,n){return Gs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ks(this,t,n,{callee:e})},safeParse(e,t){return qs(this,e,t)},async safeParseAsync(e,t){return Js(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Bt(this,`spa`,e)},validate(e,t){return wn(this,e,t)},validateAsync(e,t){return En(this,e,t)},encode:function e(t,n){return Ys(this,t,n,{callee:e})},decode:function e(t,n){return Xs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Zs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Qs(this,t,n,{callee:e})},safeEncode(e,t){return $s(this,e,t)},safeDecode(e,t){return ec(this,e,t)},async safeEncodeAsync(e,t){return tc(this,e,t)},async safeDecodeAsync(e,t){return nc(this,e,t)},toJSONSchema(e){return Xo(this,{})(e)},get description(){return Ma.get(this)?.description},get _def(){return this._zod.def}}),ac=/*@__PURE__*/ V(`_ZodString`,(e,t)=>{Ir.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r)},/*@__PURE__*/ Ht({format:e=>ls(e).format??null,minLength:e=>ls(e).minimum??null,maxLength:e=>ls(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ So(...e))},includes(...e){return this.check(/* @__PURE__ */ To(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Eo(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Do(...e))},min(...e){return this.check(/* @__PURE__ */ bo(...e))},max(...e){return this.check(/* @__PURE__ */ yo(...e))},length(...e){return this.check(/* @__PURE__ */ xo(...e))},nonempty(...e){return this.check(/* @__PURE__ */ bo(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Co(e))},uppercase(e){return this.check(/* @__PURE__ */ wo(e))},trim(){return this.check(/* @__PURE__ */ Ao())},normalize(...e){return this.check(/* @__PURE__ */ ko(...e))},toLowerCase(){return this.check(/* @__PURE__ */ jo())},toUpperCase(){return this.check(/* @__PURE__ */ Mo())},slugify(){return this.check(/* @__PURE__ */ No())}})),oc=/*@__PURE__*/ V(`ZodString`,(e,t)=>{Ir.init(e,t),ac.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Fa(dc,e))},url(e){return this.check(/* @__PURE__ */ Va(mc,e))},jwt(e){return this.check(/* @__PURE__ */ no(kc,e))},emoji(e){return this.check(/* @__PURE__ */ Ha(hc,e))},guid(e){return this.check(/* @__PURE__ */ Ia(fc,e))},uuid(e){return this.check(/* @__PURE__ */ La(pc,e))},uuidv4(e){return this.check(/* @__PURE__ */ Ra(pc,e))},uuidv6(e){return this.check(/* @__PURE__ */ za(pc,e))},uuidv7(e){return this.check(/* @__PURE__ */ Ba(pc,e))},nanoid(e){return this.check(/* @__PURE__ */ Ua(gc,e))},cuid(e){return this.check(/* @__PURE__ */ Wa(_c,e))},cuid2(e){return this.check(/* @__PURE__ */ Ga(vc,e))},ulid(e){return this.check(/* @__PURE__ */ Ka(yc,e))},base64(e){return this.check(/* @__PURE__ */ $a(Ec,e))},base64url(e){return this.check(/* @__PURE__ */ eo(Dc,e))},xid(e){return this.check(/* @__PURE__ */ qa(bc,e))},ksuid(e){return this.check(/* @__PURE__ */ Ja(xc,e))},ipv4(e){return this.check(/* @__PURE__ */ Ya(Sc,e))},ipv6(e){return this.check(/* @__PURE__ */ Xa(Cc,e))},cidrv4(e){return this.check(/* @__PURE__ */ Za(wc,e))},cidrv6(e){return this.check(/* @__PURE__ */ Qa(Tc,e))},e164(e){return this.check(/* @__PURE__ */ to(Oc,e))},datetime(e){return this.check(/* @__PURE__ */ ro(sc,e))},date(e){return this.check(/* @__PURE__ */ io(cc,e))},time(e){return this.check(/* @__PURE__ */ ao(lc,e))},duration(e){return this.check(/* @__PURE__ */ oo(uc,e))}});function J(e){return/* @__PURE__ */ Pa(oc,e)}const Y=/*@__PURE__*/ V(`ZodStringFormat`,(e,t)=>{W.init(e,t),ac.init(e,t)}),sc=/*@__PURE__*/ V(`ZodISODateTime`,(e,t)=>{ti.init(e,t),Y.init(e,t)}),cc=/*@__PURE__*/ V(`ZodISODate`,(e,t)=>{ni.init(e,t),Y.init(e,t)}),lc=/*@__PURE__*/ V(`ZodISOTime`,(e,t)=>{ri.init(e,t),Y.init(e,t)}),uc=/*@__PURE__*/ V(`ZodISODuration`,(e,t)=>{ii.init(e,t),Y.init(e,t)}),dc=/*@__PURE__*/ V(`ZodEmail`,(e,t)=>{zr.init(e,t),Y.init(e,t)}),fc=/*@__PURE__*/ V(`ZodGUID`,(e,t)=>{Lr.init(e,t),Y.init(e,t)}),pc=/*@__PURE__*/ V(`ZodUUID`,(e,t)=>{Rr.init(e,t),Y.init(e,t)}),mc=/*@__PURE__*/ V(`ZodURL`,(e,t)=>{qr.init(e,t),Y.init(e,t)}),hc=/*@__PURE__*/ V(`ZodEmoji`,(e,t)=>{Jr.init(e,t),Y.init(e,t)}),gc=/*@__PURE__*/ V(`ZodNanoID`,(e,t)=>{Yr.init(e,t),Y.init(e,t)}),_c=/*@__PURE__*/ V(`ZodCUID`,(e,t)=>{Xr.init(e,t),Y.init(e,t)}),vc=/*@__PURE__*/ V(`ZodCUID2`,(e,t)=>{Zr.init(e,t),Y.init(e,t)}),yc=/*@__PURE__*/ V(`ZodULID`,(e,t)=>{Qr.init(e,t),Y.init(e,t)}),bc=/*@__PURE__*/ V(`ZodXID`,(e,t)=>{$r.init(e,t),Y.init(e,t)}),xc=/*@__PURE__*/ V(`ZodKSUID`,(e,t)=>{ei.init(e,t),Y.init(e,t)}),Sc=/*@__PURE__*/ V(`ZodIPv4`,(e,t)=>{ai.init(e,t),Y.init(e,t)}),Cc=/*@__PURE__*/ V(`ZodIPv6`,(e,t)=>{ci.init(e,t),Y.init(e,t)}),wc=/*@__PURE__*/ V(`ZodCIDRv4`,(e,t)=>{li.init(e,t),Y.init(e,t)}),Tc=/*@__PURE__*/ V(`ZodCIDRv6`,(e,t)=>{di.init(e,t),Y.init(e,t)}),Ec=/*@__PURE__*/ V(`ZodBase64`,(e,t)=>{mi.init(e,t),Y.init(e,t)}),Dc=/*@__PURE__*/ V(`ZodBase64URL`,(e,t)=>{_i.init(e,t),Y.init(e,t)}),Oc=/*@__PURE__*/ V(`ZodE164`,(e,t)=>{vi.init(e,t),Y.init(e,t)}),kc=/*@__PURE__*/ V(`ZodJWT`,(e,t)=>{bi.init(e,t),Y.init(e,t)}),Ac=/*@__PURE__*/ V(`ZodNumber`,(e,t)=>{xi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ Ht({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ls(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ls(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ls(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ls(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ go(e,t))},gte(e,t){return this.check(/* @__PURE__ */ _o(e,t))},min(e,t){return this.check(/* @__PURE__ */ _o(e,t))},lt(e,t){return this.check(/* @__PURE__ */ mo(e,t))},lte(e,t){return this.check(/* @__PURE__ */ ho(e,t))},max(e,t){return this.check(/* @__PURE__ */ ho(e,t))},int(e){return this.check(Mc(e))},safe(e){return this.check(Mc(e))},positive(e){return this.check(/* @__PURE__ */ go(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ _o(0,e))},negative(e){return this.check(/* @__PURE__ */ mo(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ ho(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ vo(e,t))},step(e,t){return this.check(/* @__PURE__ */ vo(e,t))},finite(){return this}}));function X(e){return/* @__PURE__ */ so(Ac,e)}const jc=/*@__PURE__*/ V(`ZodNumberFormat`,(e,t)=>{Si.init(e,t),Ac.init(e,t)});function Mc(e){return/* @__PURE__ */ co(jc,e)}const Nc=/*@__PURE__*/ V(`ZodBoolean`,(e,t)=>{Ci.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r)});function Pc(e){return/* @__PURE__ */ lo(Nc,e)}const Fc=/*@__PURE__*/ V(`ZodNull`,(e,t)=>{wi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r)});function Ic(e){return/* @__PURE__ */ uo(Fc,e)}const Lc=/*@__PURE__*/ V(`ZodUnknown`,(e,t)=>{Ti.init(e,t),q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Rc(){return/* @__PURE__ */ fo(Lc)}const zc=/*@__PURE__*/ V(`ZodNever`,(e,t)=>{Ei.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r)});function Bc(e){return/* @__PURE__ */ po(zc,e)}const Vc=/*@__PURE__*/ V(`ZodArray`,(e,t)=>{ic(),Oi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ bo(e,t))},nonempty(e){return this.check(/* @__PURE__ */ bo(1,e))},max(e,t){return this.check(/* @__PURE__ */ yo(e,t))},length(e,t){return this.check(/* @__PURE__ */ xo(e,t))},unwrap(){return this.element}});function Hc(e,t){return/* @__PURE__ */ Po(Vc,e,t)}const Uc=/*@__PURE__*/ V(`ZodObject`,(e,t)=>{ic(),Pi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),Jt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return tl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(it(this._zod.def,{catchall:e}))},passthrough(){return this.clone(it(this._zod.def,{catchall:Rc()}))},loose(){return this.clone(it(this._zod.def,{catchall:Rc()}))},strict(){return this.clone(it(this._zod.def,{catchall:Bc()}))},strip(){return this.clone(it(this._zod.def,{catchall:void 0}))},extend(e){return St(this,e)},safeExtend(e){return wt(this,e)},merge(e){return Tt(this,e)},pick(e){return yt(this,e)},omit(e){return xt(this,e)},partial(...e){return Et(al,this,e[0])},exactPartial(...e){return Et(sl,this,e[0],`exactPartial`)},required(...e){return Dt(hl,this,e[0])}});function Z(e,t){let n={type:`object`,shape:e??{},...z(t)};return new Uc(n)}const Wc=/*@__PURE__*/ V(`ZodUnion`,(e,t)=>{Ii.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ts(e,t,n,r),e.options=t.options});function Gc(e,t){return new Wc({type:`union`,options:e,...z(t)})}const Kc=/*@__PURE__*/ V(`ZodDiscriminatedUnion`,(e,t)=>{Wc.init(e,t),Ri.init(e,t)});function qc(e,t,n){return new Kc({type:`union`,options:t,discriminator:e,...z(n)})}const Jc=/*@__PURE__*/ V(`ZodIntersection`,(e,t)=>{zi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Es(e,t,n,r)});function Yc(e,t){return new Jc({type:`intersection`,left:e,right:t})}const Xc=/*@__PURE__*/ V(`ZodTuple`,(e,t)=>{ic(),Hi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ds(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new al({type:`optional`,innerType:e}))})}});function Zc(e,t,n){let r=t instanceof U;return new Xc({type:`tuple`,items:e,rest:r?t:null,...z(r?n:t)})}const Qc=/*@__PURE__*/ V(`ZodRecord`,(e,t)=>{ic(),Ki.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function $c(e,t,n){return!t||!t._zod?new Qc({type:`record`,keyType:J(),valueType:e,...z(t)}):new Qc({type:`record`,keyType:e,valueType:t,...z(n)})}const el=/*@__PURE__*/ V(`ZodEnum`,(e,t)=>{qi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new el({...t,checks:[],...z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new el({...t,checks:[],...z(r),entries:i})}});function tl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new el({type:`enum`,entries:n,...z(t)})}const nl=/*@__PURE__*/ V(`ZodLiteral`,(e,t)=>{Ji.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new nl({type:`literal`,values:Array.isArray(e)?e:[e],...z(t)})}const rl=/*@__PURE__*/ V(`ZodTransform`,(e,t)=>{ic(),Yi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Rt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Rt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function il(e){return new rl({type:`transform`,transform:e})}const al=/*@__PURE__*/ V(`ZodOptional`,(e,t)=>{Zi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ol(e){return new al({type:`optional`,innerType:e})}const sl=/*@__PURE__*/ V(`ZodExactOptional`,(e,t)=>{Qi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cl(e){return new sl({type:`optional`,innerType:e})}const ll=/*@__PURE__*/ V(`ZodNullable`,(e,t)=>{$i.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ul(e){return new ll({type:`nullable`,innerType:e})}const dl=/*@__PURE__*/ V(`ZodDefault`,(e,t)=>{ea.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fl(e,t){return new dl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():dt(t)}})}const pl=/*@__PURE__*/ V(`ZodPrefault`,(e,t)=>{na.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ml(e,t){return new pl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():dt(t)}})}const hl=/*@__PURE__*/ V(`ZodNonOptional`,(e,t)=>{ra.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gl(e,t){return new hl({type:`nonoptional`,innerType:e,...z(t)})}const _l=/*@__PURE__*/ V(`ZodCatch`,(e,t)=>{oa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vl(e,t){return new _l({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Yt(t)})}const yl=/*@__PURE__*/ V(`ZodPipe`,(e,t)=>{sa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r),e.in=t.in,e.out=t.out});function bl(e,t){return new yl({type:`pipe`,in:e,out:t})}const xl=/*@__PURE__*/ V(`ZodReadonly`,(e,t)=>{la.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new xl({type:`readonly`,innerType:e})}const Cl=/*@__PURE__*/ V(`ZodCustom`,(e,t)=>{da.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r)});function wl(e,t={}){return/* @__PURE__ */ Fo(Cl,e,t)}function Tl(e,t){return/* @__PURE__ */ Io(e,t)}const El={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};var Dl;Dl||={};const Ol=Z({name:J(),accumulatorId:X().optional(),value:Gc([J(),X()]).optional(),metricType:J().optional()}),kl=Z({nodeName:J(),simpleString:J().optional(),metrics:Hc(Ol).optional(),metadata:$c(J(),Rc()).optional(),children:Hc(Rc())});function Al(e){let t=kl.parse(e),n=[{shallow:t,children:[],pendingRaw:[...t.children],depth:0}],r=/* @__PURE__ */ new Map;for(;n.length>0;){let e=n[n.length-1];if(e.pendingRaw.length===0){n.pop();let t={...e.shallow,children:e.children},i=r.get(e);if(i){i.children.push(t);continue}return t}if(e.depth>500)throw Error(`sparkPlanInfo tree exceeds max depth of 500`);let t=e.pendingRaw.shift(),i=kl.parse(t),a={shallow:i,children:[],pendingRaw:[...i.children],depth:e.depth+1};r.set(a,e),n.push(a)}throw Error(`unreachable: sparkPlanInfo tree stack exhausted without resolving root`)}const jl=Rc().nullable().optional().transform((e,t)=>{if(e==null)return null;try{return Al(e)}catch(e){return t.addIssue({code:El.custom,message:e instanceof Error?e.message:String(e)}),Zt}}),Ml=Z({Event:Q(`SparkListenerLogStart`),"Spark Version":J().optional()}),Nl=Z({Event:Q(`SparkListenerApplicationStart`),"App ID":J().optional(),"App Name":J().optional(),Timestamp:X().optional(),"Spark Version":J().optional()}),Pl=Gc([J(),X(),Pc()]),Fl=Z({Event:Q(`SparkListenerEnvironmentUpdate`),"Spark Properties":Gc([$c(J(),Pl),Hc(Zc([J(),Pl])),Ic()]).optional()}),Il=Z({Event:Q(`SparkListenerApplicationEnd`),Timestamp:X().optional()}),Ll=Z({Event:Q(`SparkListenerExecutorAdded`),Timestamp:X(),"Executor ID":J(),"Executor Info":Z({Host:J().optional(),"Total Cores":X().optional(),"Resource Profile Id":X().optional()}).optional(),"Resource Profile Id":X().optional()}),Rl=Z({Event:Q(`SparkListenerExecutorRemoved`),Timestamp:X(),"Executor ID":J(),"Removed Reason":J().optional()}),zl=Z({Event:Q(`SparkListenerJobStart`),"Job ID":X().optional(),"Submission Time":X().optional(),"Stage IDs":Hc(X()).optional(),Properties:Z({"spark.sql.execution.id":Gc([J(),X()]).optional()}).optional()}),Bl=Z({Event:Q(`SparkListenerJobEnd`),"Job ID":X(),"Completion Time":X().optional(),"Job Result":Z({Result:J().optional(),Exception:Z({Message:J().optional()}).optional()}).optional()}),Vl=Z({"RDD ID":X().optional(),Name:J().optional(),Callsite:J().optional(),"Storage Level":Z({"Use Disk":Pc().optional(),"Use Memory":Pc().optional(),Deserialized:Pc().optional(),Replication:X().optional()}).optional(),"Number of Partitions":X().optional(),"Number of Cached Partitions":X().optional(),"Memory Size":X().optional(),"Disk Size":X().optional()}),Hl=qc(`Event`,[Ml,Nl,Fl,Il,zl,Bl,Z({Event:Q(`SparkListenerStageSubmitted`),"Stage Info":Z({"Stage ID":X(),"Stage Name":J().optional(),Details:J().optional(),"Submission Time":X().optional(),"Parent IDs":Hc(X()).optional(),"RDD Info":Hc(Vl).optional()})}),Z({Event:Q(`SparkListenerStageCompleted`),"Stage Info":Z({"Stage ID":X(),"Submission Time":X().optional(),"Completion Time":X().optional(),"Failure Reason":J().optional()})}),Z({Event:Q(`SparkListenerStageExecutorMetrics`),"Stage ID":X(),"Executor ID":J(),"Executor Metrics":$c(J(),X()).optional()}),Z({Event:Q(`SparkListenerTaskEnd`),"Stage ID":X(),"Stage Attempt ID":X().optional(),"Task End Reason":Z({Reason:J().optional()}).optional(),"Task Info":Z({"Launch Time":X().optional(),"Finish Time":X().optional(),Failed:Pc().optional(),Killed:Pc().optional(),Speculative:Pc().optional(),Host:J().optional(),"Executor ID":J().optional(),Locality:J().optional(),Index:X().optional(),"Task ID":X().optional(),"Attempt Number":X().optional(),Accumulables:Hc(Z({ID:X()})).max(1e4).optional()}).optional(),"Task Metrics":Z({"Peak Execution Memory":X().optional(),"JVM GC Time":X().optional(),"Memory Bytes Spilled":X().optional(),"Disk Bytes Spilled":X().optional(),"Executor Run Time":X().optional(),"Executor CPU Time":X().optional(),"Shuffle Read Metrics":Z({"Remote Bytes Read":X().optional(),"Local Bytes Read":X().optional(),"Fetch Wait Time":X().optional()}).optional(),"Shuffle Write Metrics":Z({"Shuffle Bytes Written":X().optional()}).optional(),"Input Metrics":Z({"Bytes Read":X().optional()}).optional(),"Output Metrics":Z({"Bytes Written":X().optional()}).optional()}).optional()}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart`),executionId:X(),description:J().optional(),time:X(),sparkPlanInfo:jl}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate`),executionId:X(),sparkPlanInfo:jl}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd`),executionId:X(),time:X()}),Z({Event:Q(`org.apache.spark.sql.execution.ui.SparkListenerDriverAccumUpdates`),executionId:X(),accumUpdates:Hc(Zc([X(),X()]))}),Ll,Rl]);function Ul(e){throw Error(`Unreachable case: ${JSON.stringify(e)}`)}const Wl=[{key:`DURATION`,name:`duration`,prop:`duration`},{key:`GC_TIME`,name:`gcTime`,prop:`gcTime`},{key:`MEM_SPILLED`,name:`memorySpilled`,prop:`memSpilled`},{key:`DISK_SPILLED`,name:`diskSpilled`,prop:`diskSpilled`},{key:`SHUFFLE_READ`,name:`shuffleRead`,prop:`shuffleRead`},{key:`SHUFFLE_WRITE`,name:`shuffleWrite`,prop:`shuffleWrite`},{key:`LAUNCH_TIME`,name:`launchTime`,prop:`launchTime`},{key:`FINISH_TIME`,name:`finishTime`,prop:`finishTime`}],Gl=Wl.length,$=Object.freeze({...Object.fromEntries(Wl.map((e,t)=>[e.key,t])),STRIDE:Gl}),Kl=Wl.map(e=>e.name),ql=Wl.map(e=>e.prop);function Jl(e,t,n){if(t.taskAttempts===null)return null;let r=t,i=[],a=0,o=0,s=0,c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=[],f=/* @__PURE__ */ new Map,p=0;for(let e of t.taskAttempts.values()){if(a++,e.failed&&(o++,e.reason&&u.set(e.reason,(u.get(e.reason)??0)+1),d.length<20&&d.push({taskId:e.taskId,attemptNumber:e.attemptNumber,host:e.host,executorId:e.executorId,reason:e.reason,peakExecMem:e.peakExecMem,memSpilled:e.memSpilled,shuffleWrite:e.shuffleWrite})),e.speculative&&s++,e.host){let t=c.get(e.host);t||(t={taskCount:0,totalDuration:0},c.set(e.host,t)),t.taskCount++,t.totalDuration+=e.duration}if(e.executorId){let t=l.get(e.executorId);t||(t={taskCount:0,totalDuration:0,inputBytes:0,shuffleReadBytes:0,shuffleWriteBytes:0},l.set(e.executorId,t)),t.taskCount++,t.totalDuration+=e.duration,t.inputBytes+=e.inputBytes,t.shuffleReadBytes+=e.shuffleRead,t.shuffleWriteBytes+=e.shuffleWrite}e.locality&&f.set(e.locality,(f.get(e.locality)??0)+1),e.peakExecMem>p&&(p=e.peakExecMem),r.shuffleReadBytes+=e.shuffleRead,r.shuffleWriteBytes+=e.shuffleWrite,r.fetchWaitTime+=e.fetchWaitTime,r.memoryBytesSpilled+=e.memSpilled,r.diskBytesSpilled+=e.diskSpilled,r.jvmGCTime+=e.gcTime,r.executorRunTime+=e.executorRunTime,r.executorCpuTime+=e.executorCpuTime,r.inputBytes+=e.inputBytes,r.outputBytes+=e.outputBytes;for(let t=0;t<ql.length;t++)i.push(e[ql[t]])}t.taskCount=a,t.failedTasks=o,t.speculativeTasks=s,t.taskAttempts=null;let m=new Float64Array(i);n.taskStore.set(e,m);let{p50:h,p95:g,max:_}=eu(m),v=r.memoryBytesSpilled>0?tu(m):`unclassified`,{p50:y,p95:ee,max:b}=$l(m,$.SHUFFLE_READ),{p50:x,p95:S,max:C}=$l(m,$.MEM_SPILLED),{p50:w,p95:T,max:E}=$l(m,$.DISK_SPILLED),D=4*h,O=0,k=0,A=0,j=m.length/$.STRIDE;if(h>0)for(let e=0;e<j;e++){let t=m[e*$.STRIDE+$.DURATION];t>D?(O++,k+=t-h):t>A&&(A=t)}let te=Xl(m),M=O>0?Zl(m,h,te):0,ne=[...c.entries()].map(([e,t])=>({host:e,taskCount:t.taskCount,totalDuration:t.totalDuration})),re=[...l.entries()].map(([e,t])=>({executorId:e,taskCount:t.taskCount,totalDuration:t.totalDuration,inputBytes:t.inputBytes,shuffleReadBytes:t.shuffleReadBytes,shuffleWriteBytes:t.shuffleWriteBytes})),ie=[...u.entries()].map(([e,t])=>({reason:e,count:t})),ae=[...f.entries()].map(([e,t])=>({locality:e,count:t})),oe={...t,hostStats:ne,executorStats:re,failureReasons:ie,localityStats:ae,stragglerCount:O,stragglerExcessMs:k,longestNonStragglerMs:A,tailReplayRecoveryMs:M,failedTaskSamples:d,peakExecutionMemoryMax:p,taskActiveMs:Yl(m),peakConcurrentTasks:te,taskDurationP50:h,taskDurationP95:g,taskDurationMax:_,shuffleReadP50:y,shuffleReadP95:ee,shuffleReadMax:b,spillMemP50:x,spillMemP95:S,spillMemMax:C,spillDiskP50:w,spillDiskP95:T,spillDiskMax:E,gcPct:r.executorRunTime>0?r.jvmGCTime/r.executorRunTime*100:0,spillClassification:v,stageType:r.shuffleReadBytes>0?`REDUCE`:`MAP`};return delete oe.taskAttempts,{type:`stage`,data:oe}}function Yl(e){let t=e.length/$.STRIDE,n=[];for(let r=0;r<t;r++){let t=e[r*$.STRIDE+$.LAUNCH_TIME],i=e[r*$.STRIDE+$.FINISH_TIME];t>0&&i>t&&n.push([t,i])}n.sort((e,t)=>e[0]-t[0]);let r=0,i=-1/0,a=-1/0;for(let[e,t]of n)e>a?(a>i&&(r+=a-i),i=e,a=t):t>a&&(a=t);return a>i&&(r+=a-i),r}function Xl(e){let t=e.length/$.STRIDE,n=[],r=[];for(let i=0;i<t;i++){let t=e[i*$.STRIDE+$.LAUNCH_TIME],a=e[i*$.STRIDE+$.FINISH_TIME];t>0&&a>t&&(n.push(t),r.push(a))}n.sort((e,t)=>e-t),r.sort((e,t)=>e-t);let i=0,a=0,o=0;for(let e of n){for(;o<r.length&&r[o]<=e;)a--,o++;a++,a>i&&(i=a)}return i}function Zl(e,t,n){let r=e.length/$.STRIDE;if(r<2||!(t>0))return 0;let i=new Uint32Array(r);for(let e=0;e<r;e++)i[e]=e;i.sort((t,n)=>e[t*$.STRIDE+$.LAUNCH_TIME]-e[n*$.STRIDE+$.LAUNCH_TIME]||t-n);let a=new Float64Array(Math.max(1,Math.min(n,r))),o=4*t,s=Ql(e,i,a,1/0,t),c=Ql(e,i,a,o,t);return Math.max(0,s-c)}function Ql(e,t,n,r,i){n.fill(0);let a=n.length,o=0;for(let s=0;s<t.length;s++){let c=e[t[s]*$.STRIDE+$.DURATION],l=n[0]+(c>r?i:c);l>o&&(o=l);let u=0;for(;;){let e=2*u+1;if(e>=a)break;let t=e+1<a&&n[e+1]<n[e]?e+1:e;if(n[t]>=l)break;n[u]=n[t],u=t}n[u]=l}return o}function $l(e,t){let n=e.length/$.STRIDE;if(n===0)return{p50:0,p95:0,max:0};let r=new Float64Array(n);for(let i=0;i<n;i++)r[i]=e[i*$.STRIDE+t];return r.sort(),{p50:r[Math.ceil(n*.5)-1],p95:r[Math.ceil(n*.95)-1],max:r[n-1]}}function eu(e){return $l(e,$.DURATION)}function tu(e){let t=e.length/$.STRIDE;if(t===0)return`unclassified`;let n=0;for(let r=0;r<t;r++)e[r*$.STRIDE+$.MEM_SPILLED]===0&&n++;let r=n/t;return r>=.8?`skew`:r<.2?`volume`:`unclassified`}function nu(e,t){let n=[];for(let{launch:t,finish:r}of e)r>t&&(n.push({t,delta:1}),n.push({t:r,delta:-1}));n.sort((e,t)=>e.t-t.t||e.delta-t.delta);let r=[],i=0;for(let e=0;e<n.length;e++){let a=n[e];i+=a.delta;let o=n[e+1];if(!o||o.t===a.t)continue;let s=t==null?i:Math.min(i,t);r.push({tStart:a.t,tEnd:o.t,busy:s})}return r}function ru(e,{bucketBy:t=`time`,bucketWidthMs:n=1e3,hypotheticalCores:r=null}={}){let i=nu(e,r);if(t===`coreCount`){let e=[];for(let t of i)e[t.busy]=(e[t.busy]??0)+(t.tEnd-t.tStart);for(let t=0;t<e.length;t++)e[t]===void 0&&(e[t]=0);return{mode:`coreCount`,histogram:e}}if(i.length===0)return{mode:`time`,bucketWidthMs:n,startTime:null,endTime:null,buckets:[]};let a=i[0].tStart,o=i[i.length-1].tEnd,s=[];for(let e=a;e<o;e+=n){let t=e+n,r=0;for(let n of i){let i=Math.max(n.tStart,e),a=Math.min(n.tEnd,t);a>i&&(r+=n.busy*(a-i))}s.push({tStart:e,tEnd:t,busyCoreMs:r,avgBusyCores:r/n})}return{mode:`time`,bucketWidthMs:n,startTime:a,endTime:o,buckets:s}}function iu(e){let t=[],n={};for(let[r,i]of e){let e=i.length/$.STRIDE,a=0;for(let n=0;n<e;n++){let e=n*$.STRIDE,r=i[e+$.LAUNCH_TIME],o=i[e+$.FINISH_TIME];a+=i[e+$.DURATION],o>r&&t.push({launch:r,finish:o})}n[r]={totalTaskDurationSum:a,taskCount:e}}let{histogram:r}=ru(t,{bucketBy:`coreCount`}),i=0;for(let e=0;e<r.length;e++)i+=e*r[e];let a=r.length>0?r.length-1:0;return{coreHistogram:r,busyCoreMs:i,peakConcurrentCores:a,perStage:n}}const au=524288;function ou(){let e=new TextDecoder(`utf-8`),t=``,n=``,r=!1,i=!1,a=``,o=!1,s=0;function c(e){let n=Pu.length-1,r=t.length-e.length;if(a!==``){let t=(a+e.slice(0,n)).indexOf(Pu);if(t!==-1)return r-a.length+t}let i=e.indexOf(Pu);return i===-1?(a=e.length>=n?e.slice(-n):(a+e).slice(-n),-1):r+i}function l(l,u){if(!i){if(t.length<Nu.length){r=!Nu.startsWith(t);return}if(!(n.length>=Nu.length?n:t).startsWith(Nu)){r=!0;return}i=!0,a=``,u=t}let d=c(u);if(d===-1)return;r=!0;let f=d+Pu.length;if(Lu(t,f)!==-1)return;let p=0;if(l===Fu)for(let e=t.length-1;e>=f&&t.charCodeAt(e)===Fu;e--)p++;s=p,t=t.substring(0,f),n=t,e.decode(),o=!0}function u(a,c,u){let d=0;if(o){let e=a.indexOf(Iu),t=Ru(a,e===-1?a.length:e,s);if(t===-1&&e===-1){let e=a.length-1;for(;e>=0&&a[e]===Fu;)e--;s=a.length-1-e+(e<0?s:0);return}o=!1,d=t===-1?e:t}let f=e.decode(d===0?a:a.subarray(d),{stream:!0}),p=f.indexOf(`
|
|
113
113
|
`),m=f;if(p===-1)t===``?(t=n=f,i=!1):t+=f;else{let e;if(t===``)e=f.substring(0,p);else{let r=f.substring(0,p);e=t+r,u?.push({index:c.length,head:n,tail:r})}e.length>0&&c.push(e);let a=p+1;for(p=f.indexOf(`
|
|
114
114
|
`,a);p!==-1;)p>a&&c.push(f.substring(a,p)),a=p+1,p=f.indexOf(`
|
|
115
|
-
`,a);t=n=m=a<f.length?f.substring(a):``,r=!1,i=!1}!r&&t!==``&&l(a[a.length-1],m)}return{decode(e,t){let n=[];if(e.length<=ru)u(e,n,t);else for(let r=0;r<e.length;r+=ru)u(e.subarray(r,r+ru),n,t);return n},flush(){let n=(t+e.decode()).trim();return t=``,n?[n]:[]}}}function au(){return{app:null,pendingSparkVersion:null,pendingConfig:null,pendingResources:null,stages:/* @__PURE__ */ new Map,taskStore:/* @__PURE__ */ new Map,sqlExecutions:/* @__PURE__ */ new Map,stageToSqlExec:/* @__PURE__ */ new Map,sqlExecStages:/* @__PURE__ */ new Map,jobs:/* @__PURE__ */ new Map,executors:{added:[],removed:[]},skippedLines:0,accumState:/* @__PURE__ */ new Map,rddInfo:/* @__PURE__ */ new Map,taskAccumStages:/* @__PURE__ */ new Map,pendingAdaptiveUpdates:/* @__PURE__ */ new Map,resolvedPlanExecutions:/* @__PURE__ */ new Set,evidenceInputs:{environmentUpdates:0,applicationEnds:0,stageSubmissions:0,rddStorageSnapshots:0,sqlExecutions:0,resolvedSqlPlans:0,executorMetricRows:0,taskRecords:0}}}function ou(e){if(Array.isArray(e)){let t={};for(let n of e)Array.isArray(n)&&n.length>=2&&(t[n[0]]=String(n[1]));return t}let t={};for(let[n,r]of Object.entries(e??{}))t[n]=String(r);return t}function su(e){if(e==null)return null;let t=String(e).trim().toLowerCase().match(/^([\d.]+)\s*([kmgt]?)(b?)$/);if(!t)return null;let n=parseFloat(t[1]);if(!Number.isFinite(n))return null;switch(t[2]){case`k`:return Math.round(n/1024);case`g`:return Math.round(n*1024);case`t`:return Math.round(n*1024*1024);case`m`:return Math.round(n);default:return t[3]===`b`?Math.round(n/1048576):Math.round(n)}}function cu(e){let t=e??{},n=e=>{if(t[e]==null)return null;let n=parseInt(t[e],10);return Number.isFinite(n)?n:null},r=e=>t[e]==null?null:su(t[e]),i=e=>t[e]==null?null:String(t[e]).toLowerCase()===`true`;return{executor:{memory:t[`spark.executor.memory`]??null,memoryMB:r(`spark.executor.memory`),memoryOverhead:t[`spark.executor.memoryOverhead`]??null,memoryOverheadMB:r(`spark.executor.memoryOverhead`),cores:n(`spark.executor.cores`),instances:n(`spark.executor.instances`)},driver:{memory:t[`spark.driver.memory`]??null,memoryMB:r(`spark.driver.memory`),memoryOverhead:t[`spark.driver.memoryOverhead`]??null,memoryOverheadMB:r(`spark.driver.memoryOverhead`),cores:n(`spark.driver.cores`)},dynamicAllocationEnabled:i(`spark.dynamicAllocation.enabled`),shuffleServiceEnabled:i(`spark.shuffle.service.enabled`),serializer:t[`spark.serializer`]??null}}function lu(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of e)t.set(n,{...r,stageIds:[...r.stageIds].sort((e,t)=>e-t)});return t}function uu(e){return{...e.evidenceInputs}}function du(e){let t=uu(e);return e.app.evidenceInputs=t,{type:`app`,data:{...e.app,rddInfo:lu(e.rddInfo)}}}function fu(e){return{taskId:e.taskId,attemptNumber:e.attemptNumber,host:e.host,executorId:e.executorId,reason:e.reason,peakExecMem:e.peakExecMem,memSpilled:e.memSpilled,shuffleWrite:e.shuffleWrite}}function pu(e,t){let n=e[`Stage ID`],r=t.stages.get(n);if(!r||r.taskAttempts===null)return null;t.evidenceInputs.taskRecords++;let i=e[`Task Info`]?.Accumulables??[];for(let e of i)t.taskAccumStages.has(e.ID)||t.taskAccumStages.set(e.ID,/* @__PURE__ */ new Set),t.taskAccumStages.get(e.ID).add(n);let a=e[`Task Info`]??{},o=e[`Task Metrics`]??{},s=o[`Shuffle Read Metrics`]??{},c=o[`Shuffle Write Metrics`]??{},l=o[`Input Metrics`]??{},u=o[`Output Metrics`]??{},d={duration:(a[`Finish Time`]??0)-(a[`Launch Time`]??0),failed:!!(a.Failed||a.Killed),taskId:a[`Task ID`]??null,attemptNumber:a[`Attempt Number`]??0,launchTime:a[`Launch Time`]??0,finishTime:a[`Finish Time`]??0,reason:e[`Task End Reason`]?.Reason??null,speculative:a.Speculative===!0,host:a.Host??``,executorId:a[`Executor ID`]??``,locality:a.Locality??null,peakExecMem:o[`Peak Execution Memory`]??0,gcTime:o[`JVM GC Time`]??0,memSpilled:o[`Memory Bytes Spilled`]??0,diskSpilled:o[`Disk Bytes Spilled`]??0,shuffleRead:(s[`Remote Bytes Read`]??0)+(s[`Local Bytes Read`]??0),shuffleWrite:c[`Shuffle Bytes Written`]??0,fetchWaitTime:s[`Fetch Wait Time`]??0,executorRunTime:o[`Executor Run Time`]??0,executorCpuTime:o[`Executor CPU Time`]??0,inputBytes:l[`Bytes Read`]??0,outputBytes:u[`Bytes Written`]??0},f=a.Index,p=f==null?Symbol(`no-index`):`${e[`Stage Attempt ID`]??0}:${f}`,m=r.taskAttempts.get(p);return m?m.failed&&!d.failed?(m.speculative||d.speculative?(r.speculationWasteMs+=m.duration,r.speculationWastedAttempts++):(r.retryWasteMs+=m.duration,r.wastedAttempts++,r.retryTaskSamples.length<20&&r.retryTaskSamples.push(fu(m))),r.taskAttempts.set(p,d)):m.speculative||d.speculative?(r.speculationWasteMs+=d.duration,r.speculationWastedAttempts++):(r.retryWasteMs+=d.duration,r.wastedAttempts++,r.retryTaskSamples.length<20&&r.retryTaskSamples.push(fu(d))):r.taskAttempts.set(p,d),null}function mu(e,t,n,r,i){let a=/* @__PURE__ */ new WeakSet,o=/* @__PURE__ */ new WeakMap,s=0,c=i==null?``:`e${i}:`;function l(e){let i=(e.metrics??[]).reduce((e,n)=>(n.accumulatorId!==void 0&&t.has(n.accumulatorId)&&e.push({name:n.name,value:t.get(n.accumulatorId),metricType:n.metricType}),e),[]),a=/* @__PURE__ */ new Set;for(let t of e.metrics??[]){if(t.accumulatorId===void 0)continue;let e=n.get(t.accumulatorId);if(e)for(let t of e)r&&r.has(t)&&a.add(t)}return a.size>0?{metrics:i,stageIds:[...a].sort((e,t)=>e-t)}:{metrics:i}}function u(e,t){let{metrics:n,stageIds:r}=l(e),i={id:`${c}n${s++}`,name:e.nodeName,detail:e.simpleString??``,metrics:n,children:t};return r&&(i.stageIds=r),i}function d(e,t){let{metrics:n,stageIds:r}=l(e),i={id:`${c}n${s++}`,name:e.nodeName,detail:``,metrics:n,children:t,exchangeRole:`write`};r&&(i.stageIds=r);let a={id:`${c}n${s++}`,name:e.nodeName,detail:e.simpleString??``,metrics:[],children:[i],exchangeRole:`read`};return r&&(a.stageIds=r),a}let f=[e],p=[];for(;f.length>0;){let e=f.pop();if(!a.has(e)){a.add(e),p.push(e);for(let t of e.children??[])a.has(t)||f.push(t)}}for(let e=p.length-1;e>=0;e--){let t=p[e],n=[];for(let e of t.children??[]){let t=o.get(e);t&&n.push(t)}let r=t.nodeName===`Exchange`||t.nodeName===`BroadcastExchange`?d(t,n):u(t,n);o.set(t,r)}return o.get(e)}const hu={JVMHeapMemory:`jvmHeapMemory`,JVMOffHeapMemory:`jvmOffHeapMemory`,OnHeapExecutionMemory:`onHeapExecutionMemory`,OffHeapExecutionMemory:`offHeapExecutionMemory`,OnHeapStorageMemory:`onHeapStorageMemory`,OffHeapStorageMemory:`offHeapStorageMemory`,OnHeapUnifiedMemory:`onHeapUnifiedMemory`,OffHeapUnifiedMemory:`offHeapUnifiedMemory`,DirectPoolMemory:`directPoolMemory`,MappedPoolMemory:`mappedPoolMemory`,ProcessTreeJVMVMemory:`processTreeJVMVMemory`,ProcessTreeJVMRSSMemory:`processTreeJVMRSSMemory`,ProcessTreePythonVMemory:`processTreePythonVMemory`,ProcessTreePythonRSSMemory:`processTreePythonRSSMemory`,ProcessTreeOtherVMemory:`processTreeOtherVMemory`,ProcessTreeOtherRSSMemory:`processTreeOtherRSSMemory`,MinorGCCount:`minorGCCount`,MinorGCTime:`minorGCTime`,MajorGCCount:`majorGCCount`,MajorGCTime:`majorGCTime`,TotalGCTime:`totalGCTime`,ConcurrentGCCount:`concurrentGCCount`,ConcurrentGCTime:`concurrentGCTime`};function gu(e,t){let n=t.pendingConfig??{};return t.app={id:e[`App ID`],name:e[`App Name`],startTime:e.Timestamp,endTime:null,sparkVersion:t.pendingSparkVersion??e[`Spark Version`]??null,config:n,resources:t.pendingResources??cu(n),rddInfo:t.rddInfo},du(t)}function _u(e,t){t.evidenceInputs.environmentUpdates++;let n=ou(e[`Spark Properties`]),r=cu(n);return t.app?(t.app.config=n,t.app.resources=r,du(t)):(t.pendingConfig=n,t.pendingResources=r,null)}function vu(e,t){let n=e[`Stage IDs`]??[],r=e.Properties?.[`spark.sql.execution.id`],i=r==null?null:parseInt(String(r),10);if(i!=null){t.sqlExecStages.has(i)||t.sqlExecStages.set(i,/* @__PURE__ */ new Set);let e=t.sqlExecStages.get(i);for(let r of n)t.stageToSqlExec.set(r,i),e.add(r)}let a=e[`Job ID`];return a!=null&&t.jobs.set(a,{id:a,submissionTime:e[`Submission Time`]??null,stageIds:n,sqlExecutionId:i,result:null,succeeded:null,exception:null,completionTime:null}),null}function yu(e,t){let n=e[`Job ID`],r=e[`Job Result`]?.Result??null,i=e[`Job Result`]?.Exception?.Message??null,a=t.jobs.get(n)??{id:n,submissionTime:null,stageIds:[],sqlExecutionId:null,result:null,succeeded:null,exception:null,completionTime:null};return a.result=r,a.succeeded=r===`JobSucceeded`,a.exception=i,a.completionTime=e[`Completion Time`]??null,t.jobs.set(n,a),{type:`job`,data:{...a}}}function bu(e,t){t.evidenceInputs.stageSubmissions++;let n=e[`Stage Info`],r=n[`Stage ID`];return t.stages.set(r,{id:r,name:n[`Stage Name`]??``,details:n.Details??``,submittedAt:n[`Submission Time`]??0,completedAt:0,taskCount:0,failedTasks:0,shuffleReadBytes:0,shuffleWriteBytes:0,fetchWaitTime:0,memoryBytesSpilled:0,diskBytesSpilled:0,jvmGCTime:0,executorRunTime:0,executorCpuTime:0,inputBytes:0,outputBytes:0,sqlExecutionId:t.stageToSqlExec.get(r)??null,parentIds:n[`Parent IDs`]??[],hostStats:/* @__PURE__ */ new Map,speculativeTasks:0,failureReasons:/* @__PURE__ */ new Map,stageFailureReason:null,taskAttempts:/* @__PURE__ */ new Map,retryTaskSamples:[],retryWasteMs:0,wastedAttempts:0,speculationWasteMs:0,speculationWastedAttempts:0,executorMetrics:/* @__PURE__ */ new Map}),xu(n,r,t),null}function xu(e,t,n){for(let r of e[`RDD Info`]??[]){let e=r[`RDD ID`];if(e==null)continue;n.evidenceInputs.rddStorageSnapshots++;let i=r[`Storage Level`]??{},a=n.rddInfo.get(e),o=a?.stageIds??/* @__PURE__ */ new Set;o.add(t),n.rddInfo.set(e,{id:e,name:r.Name??``,callsite:r.Callsite??``,storageLevel:{useDisk:i[`Use Disk`]??!1,useMemory:i[`Use Memory`]??!1,deserialized:i.Deserialized??!1,replication:i.Replication??1},numPartitions:r[`Number of Partitions`]??0,numCachedPartitions:r[`Number of Cached Partitions`]||a?.numCachedPartitions||0,memorySize:r[`Memory Size`]||a?.memorySize||0,diskSize:r[`Disk Size`]||a?.diskSize||0,stageIds:o})}}function Su(e,t){let n=t.stages.get(e[`Stage ID`]);if(!n)return null;let r=e[`Executor Metrics`]??{},i={};for(let[e,t]of Object.entries(hu))r[e]!=null&&(i[t]=r[e]);return Object.keys(i).length>0&&t.evidenceInputs.executorMetricRows++,n.executorMetrics.set(e[`Executor ID`],i),null}function Cu(e,t){t.evidenceInputs.sqlExecutions++;let n=e.sparkPlanInfo??null,r={id:e.executionId,description:e.description??``,startTime:e.time,endTime:null,stageIds:[],sparkPlanInfo:n,hadAdaptiveUpdate:!1};return t.sqlExecutions.set(r.id,r),t.resolvedPlanExecutions.delete(r.id),n!==null&&t.accumState.set(r.id,/* @__PURE__ */ new Map),{type:`sql`,data:r}}function wu(e,t){let n=t.sqlExecutions.get(e.executionId);if(n&&(n.endTime=e.time),t.resolvedPlanExecutions.has(e.executionId))return null;let r=n?.sparkPlanInfo??null;if(!r||!r.nodeName)return t.accumState.delete(e.executionId),n?{type:`sql`,data:{...n}}:null;let i=mu(r,t.accumState.get(e.executionId)??/* @__PURE__ */ new Map,t.taskAccumStages,t.sqlExecStages.get(e.executionId),e.executionId);return t.accumState.delete(e.executionId),n.sparkPlanInfo=null,t.resolvedPlanExecutions.add(e.executionId),t.evidenceInputs.resolvedSqlPlans++,{type:`sqlPlan`,data:{executionId:e.executionId,planTree:i}}}function Tu(e,t){let{executionId:n,accumUpdates:r}=e;if(!t.accumState.has(n))return null;let i=t.accumState.get(n);for(let[e,t]of r)i.set(e,(i.get(e)??0)+t);return null}function Eu(e,t){let n=t.sqlExecutions.get(e.executionId);return n?(e.sparkPlanInfo!=null&&(n.sparkPlanInfo=e.sparkPlanInfo),n.hadAdaptiveUpdate=!0,{type:`sql`,data:{...n,sparkPlanInfo:null}}):null}function Du(e,t){let n={kind:`added`,timestamp:e.Timestamp,executorId:e[`Executor ID`],host:e[`Executor Info`]?.Host??``,totalCores:e[`Executor Info`]?.[`Total Cores`]??0,resourceProfileId:e[`Executor Info`]?.[`Resource Profile Id`]??e[`Resource Profile Id`]??null};return t.executors.added.push(n),{type:`executor`,data:n}}function Ou(e,t){let n={kind:`removed`,timestamp:e.Timestamp,executorId:e[`Executor ID`],reason:e[`Removed Reason`]??``};return t.executors.removed.push(n),{type:`executor`,data:n}}function ku(e,t){switch(e.Event){case`SparkListenerLogStart`:return t.pendingSparkVersion=e[`Spark Version`]??null,null;case`SparkListenerApplicationStart`:return gu(e,t);case`SparkListenerEnvironmentUpdate`:return _u(e,t);case`SparkListenerApplicationEnd`:return t.evidenceInputs.applicationEnds++,t.app?(t.app.endTime=e.Timestamp,du(t)):null;case`SparkListenerJobStart`:return vu(e,t);case`SparkListenerJobEnd`:return yu(e,t);case`SparkListenerStageSubmitted`:return bu(e,t);case`SparkListenerStageCompleted`:{let n=e[`Stage Info`],r=n[`Stage ID`],i=t.stages.get(r);return i?(i.completedAt=n[`Completion Time`]??0,!i.submittedAt&&n[`Submission Time`]!=null&&(i.submittedAt=n[`Submission Time`]),i.stageFailureReason=n[`Failure Reason`]??null,Jl(r,i,t)):null}case`SparkListenerStageExecutorMetrics`:return Su(e,t);case`SparkListenerTaskEnd`:return pu(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart`:return Cu(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate`:return Eu(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd`:return wu(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerDriverAccumUpdates`:return Tu(e,t);case`SparkListenerExecutorAdded`:return Du(e,t);case`SparkListenerExecutorRemoved`:return Ou(e,t);default:return Ul(e)}}const Au=new Set(Hl.options.map(e=>e.shape.Event.value)),ju=`{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQL`,Mu=`"physicalPlanDescription":"`,Nu=92,Pu=10;function Fu(e,t){for(let n=e.indexOf(`"`,t);n!==-1;n=e.indexOf(`"`,n+1)){let r=0;for(let i=n-1;i>=t&&e.charCodeAt(i)===92;i--)r++;if(r%2==0)return n}return-1}function Iu(e,t,n){for(let r=e.indexOf(34);r!==-1&&r<t;r=e.indexOf(34,r+1)){let t=r-1;for(;t>=0&&e[t]===92;)t--;if((r-1-t+(t<0?n:0))%2==0)return r}return-1}function Lu(e){if(!e.startsWith(ju))return e;let t=e.indexOf(Mu);if(t===-1)return e;let n=t+27;if(e.charCodeAt(n)===34)return e;let r=Fu(e,n);return r===-1?e:e.slice(0,n)+e.slice(r)}function Ru(e){if(!e.startsWith(`{"Event":"SparkListenerTaskEnd",`))return null;let t=e.indexOf(`"Accumulables":[`);if(t===-1)return null;let n=t+16,r=e.indexOf(`]`,n);if(r===-1)return null;let i=e.indexOf(`[`,n);if(i!==-1&&i<r)return null;let a=[];for(let t=e.indexOf(`{`,n);t!==-1&&t<r;t=e.indexOf(`{`,t+1)){if(!e.startsWith(`"ID":`,t+1))return null;let n=t+1+5,r=n,i=0;for(let t=e.charCodeAt(r);t>=48&&t<=57;t=e.charCodeAt(++r))i=i*10+t-48;if(r===n||r-n>15)return null;let o=e.charCodeAt(r);if(o!==44&&o!==125)return null;a.push(i)}let o;try{o=JSON.parse(e.slice(0,n)+e.slice(r))}catch{return null}let s=o?.[`Task Info`];return!s||!Array.isArray(s.Accumulables)||s.Accumulables.length!==0?null:(s.Accumulables=a.map(e=>({ID:e})),o)}function zu(e,t,n,r){let i=r&&r.head.length>119?r.head:e;if(!i.startsWith(`{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate","executionId":`))return!1;let a=0,o=99;for(;o<i.length&&i.charCodeAt(o)>=48&&i.charCodeAt(o)<=57;o++)a=a*10+i.charCodeAt(o)-48;if(o===99||i.charCodeAt(o)!==44)return!1;let s=t.sqlExecutions.get(a);return!s||s.endTime!=null?!1:(r&&r.tail.length>=2?r.tail:e).endsWith(`}}`)?(t.pendingAdaptiveUpdates.set(a,e),!0):(Bu(a,t,n),!1)}function Bu(e,t,n){let r=t.pendingAdaptiveUpdates.get(e);r!==void 0&&(t.pendingAdaptiveUpdates.delete(e),Hu(r,t,n))}function Vu(e,t,n,r){zu(e,t,n,r)||Hu(e,t,n)}function Hu(e,t,n){let r;try{r=Ru(e)??JSON.parse(Lu(e))}catch{t.skippedLines++;return}let i=r?.Event;if(typeof i!=`string`||!Au.has(i))return;let a=Hl.safeParse(r);if(!a.success){t.skippedLines++;return}a.data.Event===`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd`&&Bu(a.data.executionId,t,n);let o;try{o=ku(a.data,t)}catch(e){console.error(`processEvent threw for an already-validated event:`,e),t.skippedLines++;return}o&&n(o)}function Uu(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of e.stages)r.executorMetrics instanceof Map&&r.executorMetrics.size>0&&t.set(n,r.executorMetrics);return t}function Wu(e,t,n){for(let n of[...e.pendingAdaptiveUpdates.keys()])Bu(n,e,t);t({type:`progress`,pct:1,linesProcessed:n}),t({type:`runAggregates`,data:nu(e.taskStore)}),t({type:`stageExecutorMetrics`,data:Uu(e)}),t(du(e)),t({type:`done`,skippedLines:e.skippedLines}),e.accumState.clear()}const Gu=/* @__PURE__ */ new Set([`local-server-unavailable`,`upstream-unreachable`,`application-not-found`,`access-or-upstream-failure`,`invalid-event-log`]);function Ku({baseUrl:e,appId:t,attemptId:n}){let r=[[`baseUrl`,e],[`appId`,t]];return n!==null&&r.push([`attemptId`,n]),`/shs-proxy?${r.map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join(`&`)}`}function qu(e){return typeof e==`string`&&Gu.has(e)}const Ju=Z({code:J()}).passthrough();function Yu(e,t){let n=e=>e.match(/(\d+)|(\D+)/g)??[e],r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e++){let t=r[e]??``,n=i[e]??``;if(t===n)continue;let a=Number(t),o=Number(n);return!Number.isNaN(a)&&!Number.isNaN(o)?a-o:t<n?-1:1}return 0}function Xu(e){let t=e.filter(e=>!e.toLowerCase().startsWith(`appstatus`)).filter(e=>/^events_\d+_/.test(e)),n=e=>parseInt(e.match(/^events_(\d+)_/)[1],10),r=t.filter(e=>e.endsWith(`.compact`)).map(n),i=r.length>0?Math.max(...r):-1,a=t.filter(e=>{let t=n(e);return e.endsWith(`.compact`)?t===i:t>i}).sort(Yu),o=a.map(n);for(let e=1;e<o.length;e++)if(o[e]!==o[e-1]+1)throw Error(`Rolling event-log directory is missing file(s) between index ${o[e-1]} and ${o[e]}.`);return a}function Zu(e){return e.length>=2&&e[0]===31&&e[1]===139?`gz`:e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253?`zstd`:e.length>=8&&[76,90,52,66,108,111,99,107].every((t,n)=>e[n]===t)?`lz4`:e.length>=8&&[130,83,78,65,80,80,89,0].every((t,n)=>e[n]===t)?`snappy`:null}function Qu(e,t,n,r){let i=Zu(t);if(i===`lz4`||e.endsWith(`.lz4`)){let e=fe(n);e.push(t),e.end()}else if(i===`gz`||e.endsWith(`.gz`))new ne(n).push(t,!0);else if(i===`zstd`||e.endsWith(`.zstd`)||e.endsWith(`.zst`))(r?r(n):new Ie(n)).push(t,!0);else if(i===`snappy`||e.endsWith(`.snappy`)){let e=He(n);e.push(t),e.end()}else n(t)}function $u(e,t){e({type:`error`,source:`shs`,code:t})}async function ed(e,t,{fetchImpl:n=fetch,emit:r=e=>self.postMessage(e)}={}){let i=Ku(e),a;try{a=await n(i)}catch{$u(r,`local-server-unavailable`);return}if(a.status===404){$u(r,`local-server-unavailable`);return}if(!a.ok){let e=`access-or-upstream-failure`;try{let t=Ju.parse(await a.json());qu(t.code)&&(e=t.code)}catch{}$u(r,e);return}if(!a.body){$u(r,`invalid-event-log`);return}let o,s;try{s=Number(a.headers.get(`content-length`))||null;let e=a.body.getReader(),t=[],n=0;for(;;){let{done:i,value:a}=await e.read();if(i)break;t.push(a),n+=a.length,(!s||n<s)&&r({type:`progress`,pct:s?n/s*.5:null,linesProcessed:0})}o=new Uint8Array(n);let i=0;for(let e of t)o.set(e,i),i+=e.length}catch{$u(r,`local-server-unavailable`);return}if((a.headers.get(`content-type`)||``).startsWith(`text/html`)){$u(r,`local-server-unavailable`);return}s&&r({type:`progress`,pct:.5,linesProcessed:0}),td(o,t,r)}function td(e,t,n,{zstdDecoder:r}={}){let i;try{i=N(e)}catch{$u(n,`invalid-event-log`);return}let a=Object.keys(i),o=a.some(e=>/^events_\d+_/.test(e)),s;if(o)try{s=Xu(a)}catch{$u(n,`invalid-event-log`);return}else s=a.filter(e=>e.toLowerCase()!==`appstatus`).sort(Yu);if(s.length===0){$u(n,`invalid-event-log`);return}let c=iu(),l=[],u=0;for(let e of s)try{Qu(e,i[e],e=>{l.length=0;let r=c.decode(e,l);for(let e=0,i=0;e<r.length;e++)Vu(r[e],t,n,l[i]?.index===e?l[i++]:void 0),u++,u%2e3==0&&n({type:`progress`,pct:null,linesProcessed:u})},r)}catch{$u(n,`invalid-event-log`);return}for(let e of c.flush())Vu(e,t,n);if(!t.app){$u(n,`invalid-event-log`);return}Wu(t,n,u)}const nd=524288;async function rd(e,t,n,r){let i=Zu(new Uint8Array(await e.slice(0,Math.min(8,e.size)).arrayBuffer())),a=0,o=i===`gz`?new ne(e=>t(e,a)):null,s=i===`lz4`?fe(e=>t(e,a)):null,c=e=>t(e,a),l=i===`zstd`?r?r(c):new Ie(c):null,u=i===`snappy`?He(e=>t(e,a)):null,d=Math.max(1,Math.min(n,Math.ceil(e.size/100))),f=0;for(;f<e.size;){let n=f,r=new Uint8Array(await e.slice(n,n+d).arrayBuffer());f+=d;let i=f>=e.size;a=n/e.size,o?o.push(r,i):s?s.push(r):l?await l.push(r,i):u?u.push(r):t(r,a)}s&&s.end(),u&&u.end()}async function id(e,t,{emit:n=e=>self.postMessage(e),chunkSize:r=nd,zstdDecoder:i}={}){if(e.size===0){n({type:`error`,message:`File is empty.`});return}let a=iu(),o=[],s=0,c=(e,r)=>{o.length=0;let i=a.decode(e,o);for(let e=0,a=0;e<i.length;e++)Vu(i[e],t,n,o[a]?.index===e?o[a++]:void 0),s++,s%300==0&&n({type:`progress`,pct:r??null,linesProcessed:s})};try{await rd(e,c,r,i)}catch(t){let r=t instanceof Error?t.message:String(t);n({type:`error`,message:`Could not decompress "${e.name}": ${r}`});return}for(let e of a.flush())Vu(e,t,n);if(!t.app){n({type:`error`,message:`Not a Spark event log: no application-start event found. Choose a Spark event log file, or check the docs for supported formats.`});return}Wu(t,n,s)}async function ad(e,t,{emit:n=e=>self.postMessage(e),chunkSize:r=nd,zstdDecoder:i}={}){if(e.length===0){n({type:`error`,message:`Rolling event-log directory contained no event files.`});return}let a=iu(),o=[],s=0,c=e.reduce((e,t)=>e+t.size,0),l=0,u=0,d=(e,r)=>{o.length=0;let i=a.decode(e,o);for(let e=0,a=0;e<i.length;e++)Vu(i[e],t,n,o[a]?.index===e?o[a++]:void 0),s++,s%300==0&&n({type:`progress`,pct:c>0?(l+(r??0)*u)/c:null,linesProcessed:s})};for(let t of e){u=t.size;try{await rd(t,d,r,i)}catch(e){let r=e instanceof Error?e.message:String(e);n({type:`error`,message:`Could not decompress "${t.name}": ${r}`});return}l+=t.size}for(let e of a.flush())Vu(e,t,n);if(!t.app){n({type:`error`,message:`Not a Spark event log: no application-start event found. Choose a Spark event log file, or check the docs for supported formats.`});return}Wu(t,n,s)}if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope){let e=null;self.onmessage=async({data:t})=>{if(t.type===`parse`)e=au(),await id(t.file,e);else if(t.type===`parseFromUrl`)e=au(),await ed(t.request,e);else if(t.type===`parseFiles`)e=au(),await ad(t.files,e);else if(t.type===`getTaskData`){let{stageId:n,reqId:r}=t,i=e?.taskStore.get(n)??/* @__PURE__ */ new Float64Array;self.postMessage({type:`taskData`,stageId:n,reqId:r,metrics:i.slice(),fieldNames:Kl})}}}
|
|
115
|
+
`,a);t=n=m=a<f.length?f.substring(a):``,r=!1,i=!1}!r&&t!==``&&l(a[a.length-1],m)}return{decode(e,t){let n=[];if(e.length<=au)u(e,n,t);else for(let r=0;r<e.length;r+=au)u(e.subarray(r,r+au),n,t);return n},flush(){let n=(t+e.decode()).trim();return t=``,n?[n]:[]}}}function su(){return{app:null,pendingSparkVersion:null,pendingConfig:null,pendingResources:null,stages:/* @__PURE__ */ new Map,taskStore:/* @__PURE__ */ new Map,sqlExecutions:/* @__PURE__ */ new Map,stageToSqlExec:/* @__PURE__ */ new Map,sqlExecStages:/* @__PURE__ */ new Map,jobs:/* @__PURE__ */ new Map,executors:{added:[],removed:[]},skippedLines:0,accumState:/* @__PURE__ */ new Map,rddInfo:/* @__PURE__ */ new Map,taskAccumStages:/* @__PURE__ */ new Map,pendingAdaptiveUpdates:/* @__PURE__ */ new Map,resolvedPlanExecutions:/* @__PURE__ */ new Set,evidenceInputs:{environmentUpdates:0,applicationEnds:0,stageSubmissions:0,rddStorageSnapshots:0,sqlExecutions:0,resolvedSqlPlans:0,executorMetricRows:0,taskRecords:0}}}function cu(e){if(Array.isArray(e)){let t={};for(let n of e)Array.isArray(n)&&n.length>=2&&(t[n[0]]=String(n[1]));return t}let t={};for(let[n,r]of Object.entries(e??{}))t[n]=String(r);return t}function lu(e){if(e==null)return null;let t=String(e).trim().toLowerCase().match(/^([\d.]+)\s*([kmgt]?)(b?)$/);if(!t)return null;let n=parseFloat(t[1]);if(!Number.isFinite(n))return null;switch(t[2]){case`k`:return Math.round(n/1024);case`g`:return Math.round(n*1024);case`t`:return Math.round(n*1024*1024);case`m`:return Math.round(n);default:return t[3]===`b`?Math.round(n/1048576):Math.round(n)}}function uu(e){let t=e??{},n=e=>{if(t[e]==null)return null;let n=parseInt(t[e],10);return Number.isFinite(n)?n:null},r=e=>t[e]==null?null:lu(t[e]),i=e=>t[e]==null?null:String(t[e]).toLowerCase()===`true`;return{executor:{memory:t[`spark.executor.memory`]??null,memoryMB:r(`spark.executor.memory`),memoryOverhead:t[`spark.executor.memoryOverhead`]??null,memoryOverheadMB:r(`spark.executor.memoryOverhead`),cores:n(`spark.executor.cores`),instances:n(`spark.executor.instances`)},driver:{memory:t[`spark.driver.memory`]??null,memoryMB:r(`spark.driver.memory`),memoryOverhead:t[`spark.driver.memoryOverhead`]??null,memoryOverheadMB:r(`spark.driver.memoryOverhead`),cores:n(`spark.driver.cores`)},dynamicAllocationEnabled:i(`spark.dynamicAllocation.enabled`),shuffleServiceEnabled:i(`spark.shuffle.service.enabled`),serializer:t[`spark.serializer`]??null}}function du(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of e)t.set(n,{...r,stageIds:[...r.stageIds].sort((e,t)=>e-t)});return t}function fu(e){return{...e.evidenceInputs}}function pu(e){let t=fu(e);return e.app.evidenceInputs=t,{type:`app`,data:{...e.app,rddInfo:du(e.rddInfo)}}}function mu(e){return{taskId:e.taskId,attemptNumber:e.attemptNumber,host:e.host,executorId:e.executorId,reason:e.reason,peakExecMem:e.peakExecMem,memSpilled:e.memSpilled,shuffleWrite:e.shuffleWrite}}function hu(e,t){let n=e[`Stage ID`],r=t.stages.get(n);if(!r||r.taskAttempts===null)return null;t.evidenceInputs.taskRecords++;let i=e[`Task Info`]?.Accumulables??[];for(let e of i)t.taskAccumStages.has(e.ID)||t.taskAccumStages.set(e.ID,/* @__PURE__ */ new Set),t.taskAccumStages.get(e.ID).add(n);let a=e[`Task Info`]??{},o=e[`Task Metrics`]??{},s=o[`Shuffle Read Metrics`]??{},c=o[`Shuffle Write Metrics`]??{},l=o[`Input Metrics`]??{},u=o[`Output Metrics`]??{},d={duration:(a[`Finish Time`]??0)-(a[`Launch Time`]??0),failed:!!(a.Failed||a.Killed),taskId:a[`Task ID`]??null,attemptNumber:a[`Attempt Number`]??0,launchTime:a[`Launch Time`]??0,finishTime:a[`Finish Time`]??0,reason:e[`Task End Reason`]?.Reason??null,speculative:a.Speculative===!0,host:a.Host??``,executorId:a[`Executor ID`]??``,locality:a.Locality??null,peakExecMem:o[`Peak Execution Memory`]??0,gcTime:o[`JVM GC Time`]??0,memSpilled:o[`Memory Bytes Spilled`]??0,diskSpilled:o[`Disk Bytes Spilled`]??0,shuffleRead:(s[`Remote Bytes Read`]??0)+(s[`Local Bytes Read`]??0),shuffleWrite:c[`Shuffle Bytes Written`]??0,fetchWaitTime:s[`Fetch Wait Time`]??0,executorRunTime:o[`Executor Run Time`]??0,executorCpuTime:o[`Executor CPU Time`]??0,inputBytes:l[`Bytes Read`]??0,outputBytes:u[`Bytes Written`]??0},f=a.Index,p=f==null?Symbol(`no-index`):`${e[`Stage Attempt ID`]??0}:${f}`,m=r.taskAttempts.get(p);return m?m.failed&&!d.failed?(m.speculative||d.speculative?(r.speculationWasteMs+=m.duration,r.speculationWastedAttempts++):(r.retryWasteMs+=m.duration,r.wastedAttempts++,r.retryTaskSamples.length<20&&r.retryTaskSamples.push(mu(m))),r.taskAttempts.set(p,d)):m.speculative||d.speculative?(r.speculationWasteMs+=d.duration,r.speculationWastedAttempts++):(r.retryWasteMs+=d.duration,r.wastedAttempts++,r.retryTaskSamples.length<20&&r.retryTaskSamples.push(mu(d))):r.taskAttempts.set(p,d),null}function gu(e,t,n,r,i){let a=/* @__PURE__ */ new WeakSet,o=/* @__PURE__ */ new WeakMap,s=0,c=i==null?``:`e${i}:`;function l(e){let i=(e.metrics??[]).reduce((e,n)=>(n.accumulatorId!==void 0&&t.has(n.accumulatorId)&&e.push({name:n.name,value:t.get(n.accumulatorId),metricType:n.metricType}),e),[]),a=/* @__PURE__ */ new Set;for(let t of e.metrics??[]){if(t.accumulatorId===void 0)continue;let e=n.get(t.accumulatorId);if(e)for(let t of e)r&&r.has(t)&&a.add(t)}return a.size>0?{metrics:i,stageIds:[...a].sort((e,t)=>e-t)}:{metrics:i}}function u(e,t){let{metrics:n,stageIds:r}=l(e),i={id:`${c}n${s++}`,name:e.nodeName,detail:e.simpleString??``,metrics:n,children:t};return r&&(i.stageIds=r),i}function d(e,t){let{metrics:n,stageIds:r}=l(e),i={id:`${c}n${s++}`,name:e.nodeName,detail:``,metrics:n,children:t,exchangeRole:`write`};r&&(i.stageIds=r);let a={id:`${c}n${s++}`,name:e.nodeName,detail:e.simpleString??``,metrics:[],children:[i],exchangeRole:`read`};return r&&(a.stageIds=r),a}let f=[e],p=[];for(;f.length>0;){let e=f.pop();if(!a.has(e)){a.add(e),p.push(e);for(let t of e.children??[])a.has(t)||f.push(t)}}for(let e=p.length-1;e>=0;e--){let t=p[e],n=[];for(let e of t.children??[]){let t=o.get(e);t&&n.push(t)}let r=t.nodeName===`Exchange`||t.nodeName===`BroadcastExchange`?d(t,n):u(t,n);o.set(t,r)}return o.get(e)}const _u={JVMHeapMemory:`jvmHeapMemory`,JVMOffHeapMemory:`jvmOffHeapMemory`,OnHeapExecutionMemory:`onHeapExecutionMemory`,OffHeapExecutionMemory:`offHeapExecutionMemory`,OnHeapStorageMemory:`onHeapStorageMemory`,OffHeapStorageMemory:`offHeapStorageMemory`,OnHeapUnifiedMemory:`onHeapUnifiedMemory`,OffHeapUnifiedMemory:`offHeapUnifiedMemory`,DirectPoolMemory:`directPoolMemory`,MappedPoolMemory:`mappedPoolMemory`,ProcessTreeJVMVMemory:`processTreeJVMVMemory`,ProcessTreeJVMRSSMemory:`processTreeJVMRSSMemory`,ProcessTreePythonVMemory:`processTreePythonVMemory`,ProcessTreePythonRSSMemory:`processTreePythonRSSMemory`,ProcessTreeOtherVMemory:`processTreeOtherVMemory`,ProcessTreeOtherRSSMemory:`processTreeOtherRSSMemory`,MinorGCCount:`minorGCCount`,MinorGCTime:`minorGCTime`,MajorGCCount:`majorGCCount`,MajorGCTime:`majorGCTime`,TotalGCTime:`totalGCTime`,ConcurrentGCCount:`concurrentGCCount`,ConcurrentGCTime:`concurrentGCTime`};function vu(e,t){let n=t.pendingConfig??{};return t.app={id:e[`App ID`],name:e[`App Name`],startTime:e.Timestamp,endTime:null,sparkVersion:t.pendingSparkVersion??e[`Spark Version`]??null,config:n,resources:t.pendingResources??uu(n),rddInfo:t.rddInfo},pu(t)}function yu(e,t){t.evidenceInputs.environmentUpdates++;let n=cu(e[`Spark Properties`]),r=uu(n);return t.app?(t.app.config=n,t.app.resources=r,pu(t)):(t.pendingConfig=n,t.pendingResources=r,null)}function bu(e,t){let n=e[`Stage IDs`]??[],r=e.Properties?.[`spark.sql.execution.id`],i=r==null?null:parseInt(String(r),10);if(i!=null){t.sqlExecStages.has(i)||t.sqlExecStages.set(i,/* @__PURE__ */ new Set);let e=t.sqlExecStages.get(i);for(let r of n)t.stageToSqlExec.set(r,i),e.add(r)}let a=e[`Job ID`];return a!=null&&t.jobs.set(a,{id:a,submissionTime:e[`Submission Time`]??null,stageIds:n,sqlExecutionId:i,result:null,succeeded:null,exception:null,completionTime:null}),null}function xu(e,t){let n=e[`Job ID`],r=e[`Job Result`]?.Result??null,i=e[`Job Result`]?.Exception?.Message??null,a=t.jobs.get(n)??{id:n,submissionTime:null,stageIds:[],sqlExecutionId:null,result:null,succeeded:null,exception:null,completionTime:null};return a.result=r,a.succeeded=r===`JobSucceeded`,a.exception=i,a.completionTime=e[`Completion Time`]??null,t.jobs.set(n,a),{type:`job`,data:{...a}}}function Su(e,t){t.evidenceInputs.stageSubmissions++;let n=e[`Stage Info`],r=n[`Stage ID`];return t.stages.set(r,{id:r,name:n[`Stage Name`]??``,details:n.Details??``,submittedAt:n[`Submission Time`]??0,completedAt:0,taskCount:0,failedTasks:0,shuffleReadBytes:0,shuffleWriteBytes:0,fetchWaitTime:0,memoryBytesSpilled:0,diskBytesSpilled:0,jvmGCTime:0,executorRunTime:0,executorCpuTime:0,inputBytes:0,outputBytes:0,sqlExecutionId:t.stageToSqlExec.get(r)??null,parentIds:n[`Parent IDs`]??[],hostStats:/* @__PURE__ */ new Map,speculativeTasks:0,failureReasons:/* @__PURE__ */ new Map,stageFailureReason:null,taskAttempts:/* @__PURE__ */ new Map,retryTaskSamples:[],retryWasteMs:0,wastedAttempts:0,speculationWasteMs:0,speculationWastedAttempts:0,executorMetrics:/* @__PURE__ */ new Map}),Cu(n,r,t),null}function Cu(e,t,n){for(let r of e[`RDD Info`]??[]){let e=r[`RDD ID`];if(e==null)continue;n.evidenceInputs.rddStorageSnapshots++;let i=r[`Storage Level`]??{},a=n.rddInfo.get(e),o=a?.stageIds??/* @__PURE__ */ new Set;o.add(t),n.rddInfo.set(e,{id:e,name:r.Name??``,callsite:r.Callsite??``,storageLevel:{useDisk:i[`Use Disk`]??!1,useMemory:i[`Use Memory`]??!1,deserialized:i.Deserialized??!1,replication:i.Replication??1},numPartitions:r[`Number of Partitions`]??0,numCachedPartitions:r[`Number of Cached Partitions`]||a?.numCachedPartitions||0,memorySize:r[`Memory Size`]||a?.memorySize||0,diskSize:r[`Disk Size`]||a?.diskSize||0,stageIds:o})}}function wu(e,t){let n=t.stages.get(e[`Stage ID`]);if(!n)return null;let r=e[`Executor Metrics`]??{},i={};for(let[e,t]of Object.entries(_u))r[e]!=null&&(i[t]=r[e]);return Object.keys(i).length>0&&t.evidenceInputs.executorMetricRows++,n.executorMetrics.set(e[`Executor ID`],i),null}function Tu(e,t){t.evidenceInputs.sqlExecutions++;let n=e.sparkPlanInfo??null,r={id:e.executionId,description:e.description??``,startTime:e.time,endTime:null,stageIds:[],sparkPlanInfo:n,hadAdaptiveUpdate:!1};return t.sqlExecutions.set(r.id,r),t.resolvedPlanExecutions.delete(r.id),n!==null&&t.accumState.set(r.id,/* @__PURE__ */ new Map),{type:`sql`,data:r}}function Eu(e,t){let n=t.sqlExecutions.get(e.executionId);if(n&&(n.endTime=e.time),t.resolvedPlanExecutions.has(e.executionId))return null;let r=n?.sparkPlanInfo??null;if(!r||!r.nodeName)return t.accumState.delete(e.executionId),n?{type:`sql`,data:{...n}}:null;let i=gu(r,t.accumState.get(e.executionId)??/* @__PURE__ */ new Map,t.taskAccumStages,t.sqlExecStages.get(e.executionId),e.executionId);return t.accumState.delete(e.executionId),n.sparkPlanInfo=null,t.resolvedPlanExecutions.add(e.executionId),t.evidenceInputs.resolvedSqlPlans++,{type:`sqlPlan`,data:{executionId:e.executionId,planTree:i}}}function Du(e,t){let{executionId:n,accumUpdates:r}=e;if(!t.accumState.has(n))return null;let i=t.accumState.get(n);for(let[e,t]of r)i.set(e,(i.get(e)??0)+t);return null}function Ou(e,t){let n=t.sqlExecutions.get(e.executionId);return n?(e.sparkPlanInfo!=null&&(n.sparkPlanInfo=e.sparkPlanInfo),n.hadAdaptiveUpdate=!0,{type:`sql`,data:{...n,sparkPlanInfo:null}}):null}function ku(e,t){let n={kind:`added`,timestamp:e.Timestamp,executorId:e[`Executor ID`],host:e[`Executor Info`]?.Host??``,totalCores:e[`Executor Info`]?.[`Total Cores`]??0,resourceProfileId:e[`Executor Info`]?.[`Resource Profile Id`]??e[`Resource Profile Id`]??null};return t.executors.added.push(n),{type:`executor`,data:n}}function Au(e,t){let n={kind:`removed`,timestamp:e.Timestamp,executorId:e[`Executor ID`],reason:e[`Removed Reason`]??``};return t.executors.removed.push(n),{type:`executor`,data:n}}function ju(e,t){switch(e.Event){case`SparkListenerLogStart`:return t.pendingSparkVersion=e[`Spark Version`]??null,null;case`SparkListenerApplicationStart`:return vu(e,t);case`SparkListenerEnvironmentUpdate`:return yu(e,t);case`SparkListenerApplicationEnd`:return t.evidenceInputs.applicationEnds++,t.app?(t.app.endTime=e.Timestamp,pu(t)):null;case`SparkListenerJobStart`:return bu(e,t);case`SparkListenerJobEnd`:return xu(e,t);case`SparkListenerStageSubmitted`:return Su(e,t);case`SparkListenerStageCompleted`:{let n=e[`Stage Info`],r=n[`Stage ID`],i=t.stages.get(r);return i?(i.completedAt=n[`Completion Time`]??0,!i.submittedAt&&n[`Submission Time`]!=null&&(i.submittedAt=n[`Submission Time`]),i.stageFailureReason=n[`Failure Reason`]??null,Jl(r,i,t)):null}case`SparkListenerStageExecutorMetrics`:return wu(e,t);case`SparkListenerTaskEnd`:return hu(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart`:return Tu(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate`:return Ou(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd`:return Eu(e,t);case`org.apache.spark.sql.execution.ui.SparkListenerDriverAccumUpdates`:return Du(e,t);case`SparkListenerExecutorAdded`:return ku(e,t);case`SparkListenerExecutorRemoved`:return Au(e,t);default:return Ul(e)}}const Mu=new Set(Hl.options.map(e=>e.shape.Event.value)),Nu=`{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQL`,Pu=`"physicalPlanDescription":"`,Fu=92,Iu=10;function Lu(e,t){for(let n=e.indexOf(`"`,t);n!==-1;n=e.indexOf(`"`,n+1)){let r=0;for(let i=n-1;i>=t&&e.charCodeAt(i)===92;i--)r++;if(r%2==0)return n}return-1}function Ru(e,t,n){for(let r=e.indexOf(34);r!==-1&&r<t;r=e.indexOf(34,r+1)){let t=r-1;for(;t>=0&&e[t]===92;)t--;if((r-1-t+(t<0?n:0))%2==0)return r}return-1}function zu(e){if(!e.startsWith(Nu))return e;let t=e.indexOf(Pu);if(t===-1)return e;let n=t+27;if(e.charCodeAt(n)===34)return e;let r=Lu(e,n);return r===-1?e:e.slice(0,n)+e.slice(r)}function Bu(e){if(!e.startsWith(`{"Event":"SparkListenerTaskEnd",`))return null;let t=e.indexOf(`"Accumulables":[`);if(t===-1)return null;let n=t+16,r=e.indexOf(`]`,n);if(r===-1)return null;let i=e.indexOf(`[`,n);if(i!==-1&&i<r)return null;let a=[];for(let t=e.indexOf(`{`,n);t!==-1&&t<r;t=e.indexOf(`{`,t+1)){if(!e.startsWith(`"ID":`,t+1))return null;let n=t+1+5,r=n,i=0;for(let t=e.charCodeAt(r);t>=48&&t<=57;t=e.charCodeAt(++r))i=i*10+t-48;if(r===n||r-n>15)return null;let o=e.charCodeAt(r);if(o!==44&&o!==125)return null;a.push(i)}let o;try{o=JSON.parse(e.slice(0,n)+e.slice(r))}catch{return null}let s=o?.[`Task Info`];return!s||!Array.isArray(s.Accumulables)||s.Accumulables.length!==0?null:(s.Accumulables=a.map(e=>({ID:e})),o)}function Vu(e,t,n,r){let i=r&&r.head.length>119?r.head:e;if(!i.startsWith(`{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate","executionId":`))return!1;let a=0,o=99;for(;o<i.length&&i.charCodeAt(o)>=48&&i.charCodeAt(o)<=57;o++)a=a*10+i.charCodeAt(o)-48;if(o===99||i.charCodeAt(o)!==44)return!1;let s=t.sqlExecutions.get(a);return!s||s.endTime!=null?!1:(r&&r.tail.length>=2?r.tail:e).endsWith(`}}`)?(t.pendingAdaptiveUpdates.set(a,e),!0):(Hu(a,t,n),!1)}function Hu(e,t,n){let r=t.pendingAdaptiveUpdates.get(e);r!==void 0&&(t.pendingAdaptiveUpdates.delete(e),Wu(r,t,n))}function Uu(e,t,n,r){Vu(e,t,n,r)||Wu(e,t,n)}function Wu(e,t,n){let r;try{r=Bu(e)??JSON.parse(zu(e))}catch{t.skippedLines++;return}let i=r?.Event;if(typeof i!=`string`||!Mu.has(i))return;let a=Hl.safeParse(r);if(!a.success){t.skippedLines++;return}a.data.Event===`org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd`&&Hu(a.data.executionId,t,n);let o;try{o=ju(a.data,t)}catch(e){console.error(`processEvent threw for an already-validated event:`,e),t.skippedLines++;return}o&&n(o)}function Gu(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of e.stages)r.executorMetrics instanceof Map&&r.executorMetrics.size>0&&t.set(n,r.executorMetrics);return t}function Ku(e,t,n){for(let n of[...e.pendingAdaptiveUpdates.keys()])Hu(n,e,t);t({type:`progress`,pct:1,linesProcessed:n}),t({type:`runAggregates`,data:iu(e.taskStore)}),t({type:`stageExecutorMetrics`,data:Gu(e)}),t(pu(e)),t({type:`done`,skippedLines:e.skippedLines}),e.accumState.clear()}const qu=/* @__PURE__ */ new Set([`local-server-unavailable`,`upstream-unreachable`,`application-not-found`,`access-or-upstream-failure`,`invalid-event-log`]);function Ju({baseUrl:e,appId:t,attemptId:n}){let r=[[`baseUrl`,e],[`appId`,t]];return n!==null&&r.push([`attemptId`,n]),`/shs-proxy?${r.map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join(`&`)}`}function Yu(e){return typeof e==`string`&&qu.has(e)}const Xu=Z({code:J()}).passthrough();function Zu(e,t){let n=e=>e.match(/(\d+)|(\D+)/g)??[e],r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e++){let t=r[e]??``,n=i[e]??``;if(t===n)continue;let a=Number(t),o=Number(n);return!Number.isNaN(a)&&!Number.isNaN(o)?a-o:t<n?-1:1}return 0}function Qu(e){let t=e.filter(e=>!e.toLowerCase().startsWith(`appstatus`)).filter(e=>/^events_\d+_/.test(e)),n=e=>parseInt(e.match(/^events_(\d+)_/)[1],10),r=t.filter(e=>e.endsWith(`.compact`)).map(n),i=r.length>0?Math.max(...r):-1,a=t.filter(e=>{let t=n(e);return e.endsWith(`.compact`)?t===i:t>i}).sort(Zu),o=a.map(n);for(let e=1;e<o.length;e++)if(o[e]!==o[e-1]+1)throw Error(`Rolling event-log directory is missing file(s) between index ${o[e-1]} and ${o[e]}.`);return a}function $u(e){return e.length>=2&&e[0]===31&&e[1]===139?`gz`:e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253?`zstd`:e.length>=8&&[76,90,52,66,108,111,99,107].every((t,n)=>e[n]===t)?`lz4`:e.length>=8&&[130,83,78,65,80,80,89,0].every((t,n)=>e[n]===t)?`snappy`:null}function ed(e,t,n,r){let i=$u(t);if(i===`lz4`||e.endsWith(`.lz4`)){let e=fe(n);e.push(t),e.end()}else if(i===`gz`||e.endsWith(`.gz`))new ne(n).push(t,!0);else if(i===`zstd`||e.endsWith(`.zstd`)||e.endsWith(`.zst`))(r?r(n):new Ie(n)).push(t,!0);else if(i===`snappy`||e.endsWith(`.snappy`)){let e=He(n);e.push(t),e.end()}else n(t)}function td(e,t){e({type:`error`,source:`shs`,code:t})}async function nd(e,t,{fetchImpl:n=fetch,emit:r=e=>self.postMessage(e)}={}){let i=Ju(e),a;try{a=await n(i)}catch{td(r,`local-server-unavailable`);return}if(a.status===404){td(r,`local-server-unavailable`);return}if(!a.ok){let e=`access-or-upstream-failure`;try{let t=Xu.parse(await a.json());Yu(t.code)&&(e=t.code)}catch{}td(r,e);return}if(!a.body){td(r,`invalid-event-log`);return}let o,s;try{s=Number(a.headers.get(`content-length`))||null;let e=a.body.getReader(),t=[],n=0;for(;;){let{done:i,value:a}=await e.read();if(i)break;t.push(a),n+=a.length,(!s||n<s)&&r({type:`progress`,pct:s?n/s*.5:null,linesProcessed:0})}o=new Uint8Array(n);let i=0;for(let e of t)o.set(e,i),i+=e.length}catch{td(r,`local-server-unavailable`);return}if((a.headers.get(`content-type`)||``).startsWith(`text/html`)){td(r,`local-server-unavailable`);return}s&&r({type:`progress`,pct:.5,linesProcessed:0}),rd(o,t,r)}function rd(e,t,n,{zstdDecoder:r}={}){let i;try{i=N(e)}catch{td(n,`invalid-event-log`);return}let a=Object.keys(i),o=a.some(e=>/^events_\d+_/.test(e)),s;if(o)try{s=Qu(a)}catch{td(n,`invalid-event-log`);return}else s=a.filter(e=>e.toLowerCase()!==`appstatus`).sort(Zu);if(s.length===0){td(n,`invalid-event-log`);return}let c=ou(),l=[],u=0;for(let e of s)try{ed(e,i[e],e=>{l.length=0;let r=c.decode(e,l);for(let e=0,i=0;e<r.length;e++)Uu(r[e],t,n,l[i]?.index===e?l[i++]:void 0),u++,u%2e3==0&&n({type:`progress`,pct:null,linesProcessed:u})},r)}catch{td(n,`invalid-event-log`);return}for(let e of c.flush())Uu(e,t,n);if(!t.app){td(n,`invalid-event-log`);return}Ku(t,n,u)}function id(e,t,{maxInFlight:n=3,onFallback:r}={}){let i=null,a=null,o=null,s=0,c=e=>{i?.terminate?.(),i=null,a=Promise.resolve(!1),r?.(e)},l=()=>new Promise(t=>{let n;try{n=e()}catch(e){c(`could not start the decompress worker: ${e instanceof Error?e.message:String(e)}`),t(!1);return}let r=!1,a=(e,a=``)=>{r||(r=!0,e?i=n:(n.terminate?.(),c(a)),t(e))};n.onmessage=({data:e})=>{e.type===`ready`?a(!0):o&&`id`in e&&e.id===o.id&&o.onReply(e)},n.onerror=e=>{e.preventDefault();let t=e.message||`unknown error`;if(!r){a(!1,`the decompress worker failed to load: ${t}`);return}let n=o;c(`the decompress worker crashed: ${t}`),n?.fail(/* @__PURE__ */ Error(`Decompress worker crashed: ${t}`))}});return e=>{let r=s++,c=!1,u=null,d=0,f=0,p=null,m=null,h=e=>new Promise(t=>{let n=()=>{e()&&(m=null,t())};m=n,n()}),g={id:r,onReply(t){if(!p){if(t.type===`chunk`)try{e(new Uint8Array(t.bytes,0,t.length))}catch(e){i?.postMessage({type:`cancel`,id:r},[]),g.fail(e instanceof Error?e:Error(String(e)))}else t.type===`consumed`?(f--,m?.()):t.type===`error`&&g.fail(Error(t.message))}},fail(e){p||(p=e,o===g&&(o=null),m?.())}},_=async()=>{if(c=!0,a??=l(),!await a||!i){u=t(e);return}o=g,i.postMessage({type:`start`,id:r},[])};return{async push(e,t=!1){if(c||await _(),u)return u.push(e,t);if(p)throw p;let a=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.slice().buffer;if(!i)throw Error(`Decompress worker is gone`);if(i.postMessage({type:`data`,id:r,seq:d++,bytes:a,final:t},[a]),f++,await h(()=>p!==null||f<(t?1:n)),p)throw p;t&&o===g&&(o=null)},cancel(){u||!c||p||(i?.postMessage({type:`cancel`,id:r},[]),g.fail(/* @__PURE__ */ Error(`Decompression cancelled`)))}}}}const ad=524288;async function od(e,t,n,r){let i=$u(new Uint8Array(await e.slice(0,Math.min(8,e.size)).arrayBuffer())),a=0,o=i===`gz`?new ne(e=>t(e,a)):null,s=i===`lz4`?fe(e=>t(e,a)):null,c=e=>t(e,a),l=i===`zstd`?r?r(c):new Ie(c):null,u=i===`snappy`?He(e=>t(e,a)):null,d=Math.max(1,Math.min(n,Math.ceil(e.size/100))),f=0;try{for(;f<e.size;){let n=f,r=new Uint8Array(await e.slice(n,n+d).arrayBuffer());f+=d;let i=f>=e.size;a=n/e.size,o?o.push(r,i):s?s.push(r):l?await l.push(r,i):u?u.push(r):t(r,a)}}catch(e){throw l?.cancel?.(),e}s&&s.end(),u&&u.end()}async function sd(e,t,{emit:n=e=>self.postMessage(e),chunkSize:r=ad,zstdDecoder:i}={}){if(e.size===0){n({type:`error`,message:`File is empty.`});return}let a=ou(),o=[],s=0,c=(e,r)=>{o.length=0;let i=a.decode(e,o);for(let e=0,a=0;e<i.length;e++)Uu(i[e],t,n,o[a]?.index===e?o[a++]:void 0),s++,s%300==0&&n({type:`progress`,pct:r??null,linesProcessed:s})};try{await od(e,c,r,i)}catch(t){let r=t instanceof Error?t.message:String(t);n({type:`error`,message:`Could not decompress "${e.name}": ${r}`});return}for(let e of a.flush())Uu(e,t,n);if(!t.app){n({type:`error`,message:`Not a Spark event log: no application-start event found. Choose a Spark event log file, or check the docs for supported formats.`});return}Ku(t,n,s)}async function cd(e,t,{emit:n=e=>self.postMessage(e),chunkSize:r=ad,zstdDecoder:i}={}){if(e.length===0){n({type:`error`,message:`Rolling event-log directory contained no event files.`});return}let a=ou(),o=[],s=0,c=e.reduce((e,t)=>e+t.size,0),l=0,u=0,d=(e,r)=>{o.length=0;let i=a.decode(e,o);for(let e=0,a=0;e<i.length;e++)Uu(i[e],t,n,o[a]?.index===e?o[a++]:void 0),s++,s%300==0&&n({type:`progress`,pct:c>0?(l+(r??0)*u)/c:null,linesProcessed:s})};for(let t of e){u=t.size;try{await od(t,d,r,i)}catch(e){let r=e instanceof Error?e.message:String(e);n({type:`error`,message:`Could not decompress "${t.name}": ${r}`});return}l+=t.size}for(let e of a.flush())Uu(e,t,n);if(!t.app){n({type:`error`,message:`Not a Spark event log: no application-start event found. Choose a Spark event log file, or check the docs for supported formats.`});return}Ku(t,n,s)}if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope){let e=null,t=id(()=>new Worker(new URL(
|
|
116
|
+
/* @vite-ignore */
|
|
117
|
+
new URL(`zstd-worker-C1Jq9lfb.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),e=>new Ie(e),{onFallback:e=>console.warn(`zstd: decompressing on the parse worker: ${e}`)});self.onmessage=async({data:n})=>{if(n.type===`parse`)e=su(),await sd(n.file,e,{zstdDecoder:t});else if(n.type===`parseFromUrl`)e=su(),await nd(n.request,e);else if(n.type===`parseFiles`)e=su(),await cd(n.files,e,{zstdDecoder:t});else if(n.type===`getTaskData`){let{stageId:t,reqId:r}=n,i=e?.taskStore.get(t)??/* @__PURE__ */ new Float64Array;self.postMessage({type:`taskData`,stageId:t,reqId:r,metrics:i.slice(),fieldNames:Kl})}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-hePW80VL.js";import{M as e}from"./charts-vendor-0VMaLVLN.js";import{a as t,c as n,d as r,f as i,i as a,l as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./react-vendor-D2TLlSzI.js";import{p as m}from"./plan-graph-vendor-B0sEms9Z.js";import{H as h}from"./useRecentFiles-
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{M as e}from"./charts-vendor-0VMaLVLN.js";import{a as t,c as n,d as r,f as i,i as a,l as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./react-vendor-D2TLlSzI.js";import{p as m}from"./plan-graph-vendor-B0sEms9Z.js";import{H as h}from"./useRecentFiles-0XuhS91q.js";import{Lt as g,Ot as _,kt as v}from"./index-pnImGbgQ.js";e();var y=m(),b=l;function x({className:e,...t}){return(0,y.jsx)(r,{"data-slot":`select-value`,className:g(`flex flex-1 text-left`,e),...t})}function S({className:e,size:t=`default`,children:n,...r}){return(0,y.jsxs)(i,{"data-slot":`select-trigger`,"data-size":t,className:g(`flex w-fit cursor-pointer items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,y.jsx)(p,{render:(0,y.jsx)(v,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function C({className:e,children:t,side:r=`bottom`,sideOffset:i=4,align:a=`center`,alignOffset:s=0,alignItemWithTrigger:l=!0,...u}){return(0,y.jsx)(o,{children:(0,y.jsx)(n,{side:r,sideOffset:i,align:a,alignOffset:s,alignItemWithTrigger:l,className:`isolate z-50`,children:(0,y.jsxs)(d,{"data-slot":`select-content`,"data-align-trigger":l,className:g(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...u,children:[(0,y.jsx)(T,{}),(0,y.jsx)(c,{children:t}),(0,y.jsx)(E,{})]})})})}function w({className:e,children:n,...r}){return(0,y.jsxs)(t,{"data-slot":`select-item`,className:g(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...r,children:[(0,y.jsx)(u,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:n}),(0,y.jsx)(a,{render:(0,y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,y.jsx)(h,{className:`pointer-events-none`})})]})}function T({className:e,...t}){return(0,y.jsx)(f,{"data-slot":`select-scroll-up-button`,className:g(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,y.jsx)(_,{})})}function E({className:e,...t}){return(0,y.jsx)(s,{"data-slot":`select-scroll-down-button`,className:g(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,y.jsx)(v,{})})}export{x as a,S as i,C as n,w as r,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{M as n,j as r}from"./react-vendor-D2TLlSzI.js";import{p as i}from"./plan-graph-vendor-B0sEms9Z.js";import{D as a}from"./useRecentFiles-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t}from"./charts-vendor-0VMaLVLN.js";import{M as n,j as r}from"./react-vendor-D2TLlSzI.js";import{p as i}from"./plan-graph-vendor-B0sEms9Z.js";import{D as a}from"./useRecentFiles-0XuhS91q.js";import{Lt as o}from"./index-pnImGbgQ.js";var s=e(t(),1),c=i(),l=s.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function u({className:e,variant:t,size:n,spacing:i=2,orientation:a=`horizontal`,children:s,...u}){return(0,c.jsx)(r,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":i,"data-orientation":a,style:{"--gap":i},className:o(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,e),...u,children:(0,c.jsx)(l.Provider,{value:{variant:t,size:n,spacing:i,orientation:a},children:s})})}function d({className:e,children:t,variant:r=`default`,size:i=`default`,...u}){let d=s.useContext(l);return(0,c.jsx)(n,{"data-slot":`toggle-group-item`,"data-variant":d.variant||r,"data-size":d.size||i,"data-spacing":d.spacing,className:o(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,a({variant:d.variant||r,size:d.size||i}),e),...u,children:t})}export{d as n,u as t};
|