@xpert-ai/plugin-live-dashboard 0.6.2 → 0.7.1
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/.xpertai-plugin/plugin.json +1 -1
- package/README.md +14 -2
- package/assets/explore/PROVENANCE.md +9 -0
- package/assets/explore/category-contribution.webp +0 -0
- package/assets/explore/ecommerce-operations.webp +0 -0
- package/assets/explore/extensions.svg +1 -0
- package/assets/explore/generation-prompts.json +107 -0
- package/assets/explore/global-assets.webp +0 -0
- package/assets/explore/hotel-cancellation.webp +0 -0
- package/assets/explore/hotel-operations.webp +0 -0
- package/assets/explore/insights.svg +1 -0
- package/assets/explore/knowledge.svg +1 -0
- package/assets/explore/legal-defense.webp +0 -0
- package/assets/explore/order-promotion.webp +0 -0
- package/assets/explore/outbound-travel.webp +0 -0
- package/assets/explore/schedule.svg +1 -0
- package/assets/explore/steam-market.webp +0 -0
- package/assets/explore/weather-alerts.webp +0 -0
- package/assets/library/catalog/README.md +11 -0
- package/assets/library/catalog/analysis-template-conversion-diagnosis.svg +1 -0
- package/assets/library/catalog/analysis-template-customer-lifecycle.svg +1 -0
- package/assets/library/catalog/analysis-template-growth-attribution.svg +1 -0
- package/assets/library/catalog/analysis-template-multi-criteria.svg +1 -0
- package/assets/library/catalog/analysis-template-regional-flow.svg +1 -0
- package/assets/library/catalog/analysis-template-risk-monitoring.svg +1 -0
- package/assets/library/catalog/component-analysis-note.svg +1 -0
- package/assets/library/catalog/component-box-plot.svg +1 -0
- package/assets/library/catalog/component-bullet.svg +1 -0
- package/assets/library/catalog/component-calendar-heatmap.svg +1 -0
- package/assets/library/catalog/component-collapsible-panel.svg +1 -0
- package/assets/library/catalog/component-combo-chart.svg +1 -0
- package/assets/library/catalog/component-content-panel.svg +1 -0
- package/assets/library/catalog/component-date-range.svg +1 -0
- package/assets/library/catalog/component-detail-table.svg +1 -0
- package/assets/library/catalog/component-donut.svg +1 -0
- package/assets/library/catalog/component-dumbbell.svg +1 -0
- package/assets/library/catalog/component-event-timeline.svg +1 -0
- package/assets/library/catalog/component-funnel.svg +1 -0
- package/assets/library/catalog/component-histogram.svg +1 -0
- package/assets/library/catalog/component-keyword-filter.svg +1 -0
- package/assets/library/catalog/component-matrix-heatmap.svg +1 -0
- package/assets/library/catalog/component-metric-card.svg +1 -0
- package/assets/library/catalog/component-metric-group.svg +1 -0
- package/assets/library/catalog/component-multi-series.svg +1 -0
- package/assets/library/catalog/component-number-range.svg +1 -0
- package/assets/library/catalog/component-option-filter.svg +1 -0
- package/assets/library/catalog/component-pareto.svg +1 -0
- package/assets/library/catalog/component-percent-stacked.svg +1 -0
- package/assets/library/catalog/component-pivot-table.svg +1 -0
- package/assets/library/catalog/component-radar.svg +1 -0
- package/assets/library/catalog/component-ranking.svg +1 -0
- package/assets/library/catalog/component-sankey.svg +1 -0
- package/assets/library/catalog/component-scatter-bubble.svg +1 -0
- package/assets/library/catalog/component-segmented-filter.svg +1 -0
- package/assets/library/catalog/component-small-multiples.svg +1 -0
- package/assets/library/catalog/component-sunburst.svg +1 -0
- package/assets/library/catalog/component-tabbed-panel.svg +1 -0
- package/assets/library/catalog/component-target-progress.svg +1 -0
- package/assets/library/catalog/component-toggle-filter.svg +1 -0
- package/assets/library/catalog/component-treemap.svg +1 -0
- package/assets/library/catalog/component-trend-comparison.svg +1 -0
- package/assets/library/catalog/component-waterfall.svg +1 -0
- package/assets/library/catalog/provenance.json +524 -0
- package/assets/library/catalog/visual-theme-amber-sunset.svg +1 -0
- package/assets/library/catalog/visual-theme-art-deco.svg +1 -0
- package/assets/library/catalog/visual-theme-bauhaus.svg +1 -0
- package/assets/library/catalog/visual-theme-burgundy-night.svg +1 -0
- package/assets/library/catalog/visual-theme-cinematic.svg +1 -0
- package/assets/library/catalog/visual-theme-clarity-blue.svg +1 -0
- package/assets/library/catalog/visual-theme-clay.svg +1 -0
- package/assets/library/catalog/visual-theme-cobalt-diagonal.svg +1 -0
- package/assets/library/catalog/visual-theme-coral-cream.svg +1 -0
- package/assets/library/catalog/visual-theme-crimson-black.svg +1 -0
- package/assets/library/catalog/visual-theme-cyberpunk.svg +1 -0
- package/assets/library/catalog/visual-theme-dark-olive.svg +1 -0
- package/assets/library/catalog/visual-theme-dark-tech.svg +1 -0
- package/assets/library/catalog/visual-theme-deep-sea-blue.svg +1 -0
- package/assets/library/catalog/visual-theme-deep-sea-mist.svg +1 -0
- package/assets/library/catalog/visual-theme-financial-trading.svg +1 -0
- package/assets/library/catalog/visual-theme-flat.svg +1 -0
- package/assets/library/catalog/visual-theme-frosted-tech.svg +1 -0
- package/assets/library/catalog/visual-theme-golden-eye.svg +1 -0
- package/assets/library/catalog/visual-theme-hand-drawn.svg +1 -0
- package/assets/library/catalog/visual-theme-industrial.svg +1 -0
- package/assets/library/catalog/visual-theme-layered-paper.svg +1 -0
- package/assets/library/catalog/visual-theme-material.svg +1 -0
- package/assets/library/catalog/visual-theme-maximalism.svg +1 -0
- package/assets/library/catalog/visual-theme-midnight-emerald.svg +1 -0
- package/assets/library/catalog/visual-theme-minimal-modern.svg +1 -0
- package/assets/library/catalog/visual-theme-misty-green.svg +1 -0
- package/assets/library/catalog/visual-theme-misty-rose.svg +1 -0
- package/assets/library/catalog/visual-theme-natural-terrain.svg +1 -0
- package/assets/library/catalog/visual-theme-neo-brutalism.svg +1 -0
- package/assets/library/catalog/visual-theme-newsprint.svg +1 -0
- package/assets/library/catalog/visual-theme-olive-terracotta.svg +1 -0
- package/assets/library/catalog/visual-theme-paper-journal.svg +1 -0
- package/assets/library/catalog/visual-theme-pastel-matrix.svg +1 -0
- package/assets/library/catalog/visual-theme-pixel-dashboard.svg +1 -0
- package/assets/library/catalog/visual-theme-premium-business.svg +1 -0
- package/assets/library/catalog/visual-theme-redline-brief.svg +1 -0
- package/assets/library/catalog/visual-theme-sage.svg +1 -0
- package/assets/library/catalog/visual-theme-soft-porcelain.svg +1 -0
- package/assets/library/catalog/visual-theme-swiss-grid.svg +1 -0
- package/assets/library/catalog/visual-theme-tdesign-enterprise.svg +1 -0
- package/assets/library/catalog/visual-theme-terminal-green.svg +1 -0
- package/assets/library/catalog/visual-theme-warm-sand.svg +1 -0
- package/dist/lib/agent.schema.d.ts +514 -32
- package/dist/lib/analysis-scene-chart.d.ts +8 -0
- package/dist/lib/analysis-scene-chart.js +61 -0
- package/dist/lib/analysis-scene-tool.d.ts +87 -0
- package/dist/lib/analysis-scene-tool.js +33 -0
- package/dist/lib/analysis-scene-widget.d.ts +6 -0
- package/dist/lib/analysis-scene-widget.js +107 -0
- package/dist/lib/analysis-scene.schema.d.ts +66 -0
- package/dist/lib/analysis-scene.schema.js +20 -0
- package/dist/lib/archive.service.d.ts +35 -0
- package/dist/lib/artifact-type.provider.d.ts +1 -0
- package/dist/lib/artifact-type.provider.js +18 -0
- package/dist/lib/bundled-example-source.d.ts +11 -0
- package/dist/lib/bundled-example-source.js +60 -0
- package/dist/lib/certification.schema.d.ts +4 -0
- package/dist/lib/certification.schema.js +14 -0
- package/dist/lib/content-capability.js +1 -0
- package/dist/lib/content-type.d.ts +2 -0
- package/dist/lib/content-type.js +5 -0
- package/dist/lib/content.provider.js +5 -3
- package/dist/lib/dashboard-archive.d.ts +35 -0
- package/dist/lib/dashboard-artifact.d.ts +93 -0
- package/dist/lib/dashboard-artifact.js +24 -0
- package/dist/lib/dashboard-delivery.d.ts +11 -0
- package/dist/lib/dashboard-delivery.js +55 -0
- package/dist/lib/dashboard-discovery.schema.d.ts +446 -0
- package/dist/lib/dashboard-discovery.schema.js +35 -0
- package/dist/lib/dashboard-navigation.d.ts +22 -21
- package/dist/lib/dashboard-navigation.js +5 -4
- package/dist/lib/dashboard-queries.d.ts +2 -2
- package/dist/lib/dashboard-queries.js +2 -2
- package/dist/lib/dashboard-receipt.js +1 -1
- package/dist/lib/dashboard-view.schema.d.ts +964 -64
- package/dist/lib/dashboard.schema.d.ts +738 -23
- package/dist/lib/dashboard.schema.js +8 -2
- package/dist/lib/dashboard.service.d.ts +155 -2
- package/dist/lib/dashboard.service.js +38 -4
- package/dist/lib/dataset-artifact.provider.d.ts +13 -0
- package/dist/lib/dataset-artifact.provider.js +57 -0
- package/dist/lib/dataset.schema.d.ts +195 -0
- package/dist/lib/dataset.schema.js +23 -0
- package/dist/lib/dataset.service.d.ts +54 -0
- package/dist/lib/dataset.service.js +119 -0
- package/dist/lib/definition-tools.d.ts +14 -54
- package/dist/lib/definition-tools.js +29 -9
- package/dist/lib/document-package.d.ts +35 -0
- package/dist/lib/editing.d.ts +552 -2
- package/dist/lib/evidence/evidence-diff.d.ts +17 -0
- package/dist/lib/evidence/evidence-diff.js +30 -0
- package/dist/lib/evidence/evidence-transfers.d.ts +14 -0
- package/dist/lib/evidence/evidence-transfers.js +41 -0
- package/dist/lib/evidence/evidence-view.provider.d.ts +91 -0
- package/dist/lib/evidence/evidence-view.provider.js +92 -0
- package/dist/lib/evidence/evidence.entity.d.ts +14 -0
- package/dist/lib/evidence/evidence.entity.js +62 -0
- package/dist/lib/evidence/evidence.provider.d.ts +43 -0
- package/dist/lib/evidence/evidence.provider.js +91 -0
- package/dist/lib/evidence/evidence.service.d.ts +67 -0
- package/dist/lib/evidence/evidence.service.js +218 -0
- package/dist/lib/explore-catalog.d.ts +15 -0
- package/dist/lib/explore-catalog.js +51 -0
- package/dist/lib/explore-catalog.json +131 -0
- package/dist/lib/explore.schema.d.ts +69 -0
- package/dist/lib/explore.schema.js +9 -0
- package/dist/lib/group-sharing.d.ts +17 -0
- package/dist/lib/group-sharing.js +39 -0
- package/dist/lib/hotel-document.d.ts +3 -0
- package/dist/lib/hotel-document.js +26 -0
- package/dist/lib/hotel-template.d.ts +246 -0
- package/dist/lib/hotel-template.js +77 -0
- package/dist/lib/library/access.d.ts +9 -0
- package/dist/lib/library/access.js +14 -0
- package/dist/lib/library/actions.d.ts +7 -0
- package/dist/lib/library/actions.js +55 -0
- package/dist/lib/library/archive.d.ts +13 -0
- package/dist/lib/library/archive.js +123 -0
- package/dist/lib/library/asset-validation.d.ts +4 -0
- package/dist/lib/library/asset-validation.js +77 -0
- package/dist/lib/library/catalog-blueprints.json +3225 -0
- package/dist/lib/library/catalog.service.d.ts +2427 -0
- package/dist/lib/library/catalog.service.js +270 -0
- package/dist/lib/library/dataset-binding.service.d.ts +65 -0
- package/dist/lib/library/dataset-binding.service.js +152 -0
- package/dist/lib/library/directory-contract.d.ts +161 -0
- package/dist/lib/library/directory-contract.js +19 -0
- package/dist/lib/library/directory.service.d.ts +33 -0
- package/dist/lib/library/directory.service.js +69 -0
- package/dist/lib/library/entities.d.ts +80 -0
- package/dist/lib/library/entities.js +280 -0
- package/dist/lib/library/execution-contract.d.ts +200 -0
- package/dist/lib/library/execution-contract.js +19 -0
- package/dist/lib/library/execution-resolution.d.ts +2490 -0
- package/dist/lib/library/execution-resolution.js +101 -0
- package/dist/lib/library/file-artifact.provider.d.ts +7 -0
- package/dist/lib/library/file-artifact.provider.js +35 -0
- package/dist/lib/library/files.service.d.ts +20 -0
- package/dist/lib/library/files.service.js +112 -0
- package/dist/lib/library/origin.schema.d.ts +171 -0
- package/dist/lib/library/origin.schema.js +14 -0
- package/dist/lib/library/resource-contract.d.ts +2779 -0
- package/dist/lib/library/resource-contract.js +167 -0
- package/dist/lib/library/resource-json.d.ts +11 -0
- package/dist/lib/library/resource-json.js +53 -0
- package/dist/lib/library/task-preparation.service.d.ts +14 -0
- package/dist/lib/library/task-preparation.service.js +85 -0
- package/dist/lib/library/template-compiler.d.ts +19 -0
- package/dist/lib/library/template-compiler.js +73 -0
- package/dist/lib/library/template-execution.service.d.ts +79 -0
- package/dist/lib/library/template-execution.service.js +135 -0
- package/dist/lib/library/transfers.service.d.ts +94 -0
- package/dist/lib/library/transfers.service.js +193 -0
- package/dist/lib/library/zip-container.d.ts +10 -0
- package/dist/lib/library/zip-container.js +79 -0
- package/dist/lib/library-view.provider.d.ts +88 -0
- package/dist/lib/library-view.provider.js +164 -0
- package/dist/lib/library.schema.d.ts +347 -0
- package/dist/lib/library.schema.js +41 -0
- package/dist/lib/middleware.d.ts +8 -2
- package/dist/lib/middleware.js +119 -11
- package/dist/lib/monitor.js +2 -2
- package/dist/lib/plugin.js +21 -1
- package/dist/lib/presentation.provider.d.ts +35 -0
- package/dist/lib/presentation.provider.js +4 -15
- package/dist/lib/projects.schema.d.ts +4 -4
- package/dist/lib/query-session.d.ts +1 -1
- package/dist/lib/query-session.js +13 -8
- package/dist/lib/remote-entry.d.ts +1 -1
- package/dist/lib/remote-entry.js +2 -2
- package/dist/lib/resource.schema.d.ts +1067 -0
- package/dist/lib/resource.schema.js +76 -0
- package/dist/lib/runtime-context.d.ts +2 -0
- package/dist/lib/runtime-context.js +22 -0
- package/dist/lib/sharing.service.d.ts +12 -0
- package/dist/lib/sharing.service.js +4 -0
- package/dist/lib/source-executions.d.ts +69 -51
- package/dist/lib/source-executions.js +2 -1
- package/dist/lib/template.schema.d.ts +36 -0
- package/dist/lib/template.schema.js +17 -0
- package/dist/lib/template.service.d.ts +21 -0
- package/dist/lib/template.service.js +56 -0
- package/dist/lib/templates.js +5 -5
- package/dist/lib/view.provider.d.ts +129 -4
- package/dist/lib/view.provider.js +61 -35
- package/dist/remote/app.css +1 -1
- package/dist/remote/app.js +54 -53
- package/dist/remote/build-manifest.json +238 -46
- package/dist/sandbox-actions/action.json +1 -1
- package/dist/sandbox-actions/bundle/host.js +2 -2
- package/docs/content-packages.mdx +43 -0
- package/docs/dashboard-starter.mdx +22 -0
- package/docs/data-view.mdx +30 -0
- package/docs/dataset-generation.mdx +32 -0
- package/docs/dataset-storage.mdx +29 -0
- package/docs/docs.json +15 -0
- package/docs/editing.mdx +6 -0
- package/docs/html-mode.md +1 -1
- package/docs/index.mdx +8 -0
- package/docs/inline-analysis.mdx +62 -0
- package/docs/library-browser-verification.mdx +46 -0
- package/docs/library-detail-ui.mdx +21 -0
- package/docs/library-directory-ui.mdx +24 -0
- package/docs/library-execution.mdx +49 -0
- package/docs/library-import-ui.mdx +20 -0
- package/docs/library-storage.mdx +63 -0
- package/docs/proposals/resource-sharing-decoupling.mdx +83 -0
- package/docs/standard-theme.mdx +28 -0
- package/docs/template-agent-handoff.mdx +37 -0
- package/docs/verification.mdx +4 -0
- package/package.json +9 -5
- package/skills/live-dashboard/SKILL.md +41 -1
- package/skills/live-dashboard/examples/README.md +2 -2
- package/skills/live-dashboard/examples/production-quality/README.md +2 -2
- package/skills/live-dashboard/examples/regional-sales/README.md +3 -3
- package/skills/live-dashboard/examples/regional-sales/query.json +49 -1
- package/skills/live-dashboard/examples/sales-overview/README.md +2 -2
- package/skills/live-dashboard/references/attribution-analysis.md +8 -0
- package/skills/live-dashboard/references/pareto-analysis.md +8 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var DocumentHost=(function(se){"use strict";var k;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(k||(k={}));var Se;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const f=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),V=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=k.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class q extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return n(this),s}static assert(e){if(!(e instanceof q))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}q.create=r=>new q(r);const ye=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,k.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${k.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${k.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${k.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:k.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,k.assertNever(r)}return{message:t}};let et=ye;function tt(){return et}const rt=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const u=s.filter(l=>!!l).slice().reverse();for(const l of u)o=l(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function d(r,e){const t=tt(),s=rt({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===ye?void 0:ye].filter(n=>!!n)});r.common.issues.push(s)}class A{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return g;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return A.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return g;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const g=Object.freeze({status:"aborted"}),ne=r=>({status:"dirty",value:r}),R=r=>({status:"valid",value:r}),Ce=r=>r.status==="aborted",Ae=r=>r.status==="dirty",H=r=>r.status==="valid",ce=r=>typeof Promise<"u"&&r instanceof Promise;var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));class U{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const De=(r,e)=>{if(H(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new q(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:u}=r;return i.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:u??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:u??t??o.defaultError}},description:n}}class b{get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ce(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},n=this._parseSync({data:e,path:s.path,parent:s});return De(s,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return H(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>H(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(ce(n)?n:Promise.resolve(n));return De(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new ee({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return B.create(this,this._def)}nullable(){return te.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z.create(this)}promise(){return he.create(this,this._def)}or(e){return ue.create([this,e],this._def)}and(e){return le.create(this,e,this._def)}transform(e){return new ee({..._(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new we({..._(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new It({typeName:p.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ee({..._(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ie.create(this,e)}readonly(){return Te.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const st=/^c[^\s-]{8,}$/i,nt=/^[0-9a-z]+$/,at=/^[0-9A-HJKMNP-TV-Z]{26}$/i,it=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ot=/^[a-z0-9_-]{21}$/i,ct=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ut=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _e;const ft=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ht=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,mt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Re="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",_t=new RegExp(`^${Re}$`);function Me(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function vt(r){return new RegExp(`^${Me(r)}$`)}function xt(r){let e=`${Re}T${Me(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function bt(r,e){return!!((e==="v4"||!e)&&ft.test(r)||(e==="v6"||!e)&&mt.test(r))}function kt(r,e){if(!ct.test(r))return!1;try{const[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function wt(r,e){return!!((e==="v4"||!e)&&ht.test(r)||(e==="v6"||!e)&&pt.test(r))}class P extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),g}const s=new A;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ut.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")_e||(_e=new RegExp(lt,"u")),_e.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")it.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")ot.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")st.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")at.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?xt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?_t.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?vt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?dt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?bt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?kt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?wt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?gt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?yt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):k.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new P({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}P.create=r=>new P({checks:[],typeName:p.ZodString,coerce:r?.coerce??!1,..._(r)});function Et(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=Number.parseInt(r.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class J extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),g}let s;const n=new A;for(const a of this._def.checks)a.kind==="int"?k.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Et(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_finite,message:a.message}),n.dirty()):k.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&k.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}J.create=r=>new J({checks:[],typeName:p.ZodNumber,coerce:r?.coerce||!1,..._(r)});class ae extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s;const n=new A;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):k.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new ae({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ae.create=r=>new ae({checks:[],typeName:p.ZodBigInt,coerce:r?.coerce??!1,..._(r)});class ve extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),g}return R(e.data)}}ve.create=r=>new ve({typeName:p.ZodBoolean,coerce:r?.coerce||!1,..._(r)});class de extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),g}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),g}const s=new A;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):k.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new de({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}de.create=r=>new de({checks:[],coerce:r?.coerce||!1,typeName:p.ZodDate,..._(r)});class je extends b{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),g}return R(e.data)}}je.create=r=>new je({typeName:p.ZodSymbol,..._(r)});class Ue extends b{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),g}return R(e.data)}}Ue.create=r=>new Ue({typeName:p.ZodUndefined,..._(r)});class xe extends b{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),g}return R(e.data)}}xe.create=r=>new xe({typeName:p.ZodNull,..._(r)});class Ze extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return R(e.data)}}Ze.create=r=>new Ze({typeName:p.ZodAny,..._(r)});class Le extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return R(e.data)}}Le.create=r=>new Le({typeName:p.ZodUnknown,..._(r)});class z extends b{_parse(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),g}}z.create=r=>new z({typeName:p.ZodNever,..._(r)});class qe extends b{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),g}return R(e.data)}}qe.create=r=>new qe({typeName:p.ZodVoid,..._(r)});class Z extends b{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return d(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),g;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(d(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(d(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(d(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new U(t,i,t.path,o)))).then(i=>A.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new U(t,i,t.path,o)));return A.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new Z({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new Z({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new Z({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}Z.create=(r,e)=>new Z({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,..._(e)});function X(r){if(r instanceof O){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=B.create(X(s))}return new O({...r._def,shape:()=>e})}else return r instanceof Z?new Z({...r._def,type:X(r.element)}):r instanceof B?B.create(X(r.unwrap())):r instanceof te?te.create(X(r.unwrap())):r instanceof Y?Y.create(r.items.map(e=>X(e))):r}class O extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=k.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){const l=this._getOrReturnCtx(e);return d(l,{code:c.invalid_type,expected:f.object,received:l.parsedType}),g}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof z&&this._def.unknownKeys==="strip"))for(const l in n.data)i.includes(l)||o.push(l);const u=[];for(const l of i){const m=a[l],S=n.data[l];u.push({key:{status:"valid",value:l},value:m._parse(new U(n,S,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof z){const l=this._def.unknownKeys;if(l==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:n.data[m]}});else if(l==="strict")o.length>0&&(d(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const m of o){const S=n.data[m];u.push({key:{status:"valid",value:m},value:l._parse(new U(n,S,n.path,m)),alwaysSet:m in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const m of u){const S=await m.key,D=await m.value;l.push({key:S,value:D,alwaysSet:m.alwaysSet})}return l}).then(l=>A.mergeObjectSync(s,l)):A.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new O({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{const n=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new O({...this._def,catchall:e})}pick(e){const t={};for(const s of k.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new O({...this._def,shape:()=>t})}omit(e){const t={};for(const s of k.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new O({...this._def,shape:()=>t})}deepPartial(){return X(this)}partial(e){const t={};for(const s of k.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new O({...this._def,shape:()=>t})}required(e){const t={};for(const s of k.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof B;)a=a._def.innerType;t[s]=a}return new O({...this._def,shape:()=>t})}keyof(){return Ve(k.objectKeys(this.shape))}}O.create=(r,e)=>new O({shape:()=>r,unknownKeys:"strip",catchall:z.create(),typeName:p.ZodObject,..._(e)}),O.strictCreate=(r,e)=>new O({shape:()=>r,unknownKeys:"strict",catchall:z.create(),typeName:p.ZodObject,..._(e)}),O.lazycreate=(r,e)=>new O({shape:r,unknownKeys:"strip",catchall:z.create(),typeName:p.ZodObject,..._(e)});class ue extends b{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new q(o.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:i}),g}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const u of s){const l={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:l});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new q(u));return d(t,{code:c.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}}ue.create=(r,e)=>new ue({options:r,typeName:p.ZodUnion,..._(e)});function be(r,e){const t=V(r),s=V(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=k.objectKeys(e),a=k.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=be(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=be(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class le extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Ce(a)||Ce(i))return g;const o=be(a.value,i.value);return o.valid?((Ae(a)||Ae(i))&&t.dirty(),{status:t.value,value:o.data}):(d(s,{code:c.invalid_intersection_types}),g)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}le.create=(r,e,t)=>new le({left:r,right:e,typeName:p.ZodIntersection,..._(t)});class Y extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return d(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),g;if(s.data.length<this._def.items.length)return d(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&s.data.length>this._def.items.length&&(d(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new U(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>A.mergeArray(t,i)):A.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Y({...this._def,rest:e})}}Y.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y({items:r,typeName:p.ZodTuple,rest:null,..._(e)})};class fe extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return d(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),g;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new U(s,o,s.path,o)),value:i._parse(new U(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?A.mergeObjectAsync(t,n):A.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof b?new fe({keyType:e,valueType:t,typeName:p.ZodRecord,..._(s)}):new fe({keyType:P.create(),valueType:e,typeName:p.ZodRecord,..._(t)})}}class Pe extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return d(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),g;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],l)=>({key:n._parse(new U(s,o,s.path,[l,"key"])),value:a._parse(new U(s,u,s.path,[l,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const l=await u.key,m=await u.value;if(l.status==="aborted"||m.status==="aborted")return g;(l.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(l.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const l=u.key,m=u.value;if(l.status==="aborted"||m.status==="aborted")return g;(l.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(l.value,m.value)}return{status:t.value,value:o}}}}Pe.create=(r,e,t)=>new Pe({valueType:e,keyType:r,typeName:p.ZodMap,..._(t)});class ie extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return d(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),g;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(d(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(d(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const l=new Set;for(const m of u){if(m.status==="aborted")return g;m.status==="dirty"&&t.dirty(),l.add(m.value)}return{status:t.value,value:l}}const o=[...s.data.values()].map((u,l)=>a._parse(new U(s,u,s.path,l)));return s.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new ie({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new ie({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ie.create=(r,e)=>new ie({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,..._(e)});class $e extends b{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}$e.create=(r,e)=>new $e({getter:r,typeName:p.ZodLazy,..._(e)});class ke extends b{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}ke.create=(r,e)=>new ke({value:r,typeName:p.ZodLiteral,..._(e)});function Ve(r,e){return new K({values:r,typeName:p.ZodEnum,..._(e)})}class K extends b{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{expected:k.joinValues(s),received:t.parsedType,code:c.invalid_type}),g}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:s}),g}return R(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return K.create(e,{...this._def,...t})}exclude(e,t=this._def){return K.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}K.create=Ve;class ze extends b{_parse(e){const t=k.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=k.objectValues(t);return d(s,{expected:k.joinValues(n),received:s.parsedType,code:c.invalid_type}),g}if(this._cache||(this._cache=new Set(k.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=k.objectValues(t);return d(s,{received:s.data,code:c.invalid_enum_value,options:n}),g}return R(e.data)}get enum(){return this._def.values}}ze.create=(r,e)=>new ze({values:r,typeName:p.ZodNativeEnum,..._(e)});class he extends b{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return d(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),g;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return R(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}he.create=(r,e)=>new he({type:r,typeName:p.ZodPromise,..._(e)});class ee extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{d(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return g;const u=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return u.status==="aborted"?g:u.status==="dirty"||t.value==="dirty"?ne(u.value):u});{if(t.value==="aborted")return g;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?g:o.status==="dirty"||t.value==="dirty"?ne(o.value):o}}if(n.type==="refinement"){const i=o=>{const u=n.refinement(o,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!H(i))return g;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>H(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):g);k.assertNever(n)}}ee.create=(r,e,t)=>new ee({schema:r,typeName:p.ZodEffects,effect:e,..._(t)}),ee.createWithPreprocess=(r,e,t)=>new ee({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,..._(t)});class B extends b{_parse(e){return this._getType(e)===f.undefined?R(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}B.create=(r,e)=>new B({innerType:r,typeName:p.ZodOptional,..._(e)});class te extends b{_parse(e){return this._getType(e)===f.null?R(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}te.create=(r,e)=>new te({innerType:r,typeName:p.ZodNullable,..._(e)});class we extends b{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}we.create=(r,e)=>new we({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class Ee extends b{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ce(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new q(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ee.create=(r,e)=>new Ee({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Be extends b{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),g}return{status:"valid",value:e.data}}}Be.create=r=>new Be({typeName:p.ZodNaN,..._(r)});class It extends b{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ie extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?g:a.status==="dirty"?(t.dirty(),ne(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?g:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new Ie({in:e,out:t,typeName:p.ZodPipeline})}}class Te extends b{_parse(e){const t=this._def.innerType._parse(e),s=n=>(H(n)&&(n.value=Object.freeze(n.value)),n);return ce(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}Te.create=(r,e)=>new Te({innerType:r,typeName:p.ZodReadonly,..._(e)});var p;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(p||(p={}));const j=P.create,Tt=J.create,Nt=ve.create,Ot=xe.create;z.create;const me=Z.create,re=O.create,St=ue.create;le.create,Y.create;const Ct=fe.create,Q=ke.create,Ne=K.create;he.create,B.create,te.create;function At(r,e){if(r==null)return{};var t={},s=Object.keys(r),n,a;for(a=0;a<s.length;a++)n=s[a],!(e.indexOf(n)>=0)&&(t[n]=r[n]);return t}function F(){return F=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},F.apply(this,arguments)}const Fe="xpert.artifact-document",We=1,pe=j().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,79}$/),Dt=St([j().max(4e3),Tt().finite(),Nt(),Ot()]),Ye=Ct(pe,Dt).refine(r=>Object.keys(r).length<=24,"Too many controls"),Rt=re({type:Q("query"),requestId:j().min(1).max(80),bindingId:pe,controls:Ye,priority:Ne(["interactive","initial","refresh"]).optional()}).strict(),Mt=re({bindingIds:me(pe).max(64).refine(r=>new Set(r).size===r.length,"Duplicate binding IDs"),defaults:Ye,theme:Ne(["light","dark"]),locale:j().min(1).max(80)}).strict(),jt=j().min(1).max(3e5).superRefine((r,e)=>{(new TextEncoder().encode(r).byteLength>3e5||!/<html[\s>]/i.test(r)||!/<body[\s>]/i.test(r))&&e.addIssue({code:"custom",message:"Supply a complete UTF-8 HTML document, at most 300 KB"})}),Ut=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),L=(r,e)=>r>>>e|r<<32-e;function Zt(r){const e=new Uint8Array(Math.ceil((r.length+9)/64)*64);e.set(r),e[r.length]=128;const t=new DataView(e.buffer);t.setUint32(e.length-8,Math.floor(r.length/536870912)),t.setUint32(e.length-4,r.length*8>>>0);const s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n=new Uint32Array(64);for(let a=0;a<e.length;a+=64){for(let w=0;w<16;w++)n[w]=t.getUint32(a+w*4);for(let w=16;w<64;w++){const v=n[w-15],y=n[w-2],E=L(v,7)^L(v,18)^v>>>3,N=L(y,17)^L(y,19)^y>>>10;n[w]=n[w-16]+E+n[w-7]+N>>>0}let[i,o,u,l,m,S,D,M]=s;for(let w=0;w<64;w++){const v=L(m,6)^L(m,11)^L(m,25),y=m&S^~m&D,E=M+v+y+Ut[w]+n[w]>>>0,N=L(i,2)^L(i,13)^L(i,22),W=i&o^i&u^o&u,G=N+W>>>0;M=D,D=S,S=m,m=l+E>>>0,l=u,u=o,o=i,i=E+G>>>0}s[0]=s[0]+i>>>0,s[1]=s[1]+o>>>0,s[2]=s[2]+u>>>0,s[3]=s[3]+l>>>0,s[4]=s[4]+m>>>0,s[5]=s[5]+S>>>0,s[6]=s[6]+D>>>0,s[7]=s[7]+M>>>0}return Array.from(s,a=>a.toString(16).padStart(8,"0")).join("")}const Qe=re({id:pe,version:j().regex(/^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/),format:Q("classic-script"),global:j().regex(/^[A-Za-z_$][A-Za-z0-9_$]{0,79}$/).refine(r=>!["window","self","globalThis","document","parent","top","location","xpertLiveArtifact","__proto__","constructor","prototype"].includes(r)),sha256:j().regex(/^[a-f0-9]{64}$/)}).strict(),Lt=Qe.transform(r=>({id:r.id,version:r.version,format:"classic-script",global:r.global,sha256:r.sha256})),qt=me(Lt).max(8).superRefine((r,e)=>{(new Set(r.map(t=>t.id)).size!==r.length||new Set(r.map(t=>t.global)).size!==r.length)&&e.addIssue({code:"custom",message:"Duplicate dependency ID or global"})}),Pt=me(Qe.extend({source:j().min(1).max(4e6)}).strict().transform(r=>({id:r.id,version:r.version,format:"classic-script",global:r.global,sha256:r.sha256,source:r.source}))).max(8);function $t(r,e){const t=Pt.parse(r);qt.parse(t.map(n=>{var{source:a}=n,i=At(n,["source"]);return i}));let s=0;for(const n of t){const a=new TextEncoder().encode(n.source);if(s+=a.length,a.length>4e6||s>8e6)throw new Error("DOCUMENT_DEPENDENCY_TOO_LARGE");if(Zt(a)!==n.sha256)throw new Error("DOCUMENT_DEPENDENCY_INTEGRITY_FAILED")}return t.map(n=>({id:n.id,version:n.version,global:n.global,sha256:n.sha256,source:n.source,format:"classic-script"}))}function Vt(r){const e=t=>JSON.stringify(t).replace(/</g,"\\u003c").replace(/>/g,"\\u003e");return $t(r).map(t=>`<script>(()=>{const s=document.createElement('script');s.textContent=${e(t.source)};document.head.appendChild(s);s.remove();if(typeof window[${e(t.global)}]==='undefined')throw new Error('DOCUMENT_DEPENDENCY_GLOBAL_MISSING');})();<\/script>`).join("")}const zt=j().max(250).refine(r=>{try{const e=new URL(r);return e.protocol==="https:"&&e.origin===r&&!e.username&&!e.password&&/^(?:[a-z0-9.-]+|\[[a-f0-9:]+\])$/i.test(e.hostname)}catch{return!1}},"Use an exact HTTPS origin without a path, credentials or wildcard"),ge=me(zt).max(16),Bt=re({mode:Ne(["restricted","unrestricted"]).optional(),scripts:ge.optional(),styles:ge.optional(),fonts:ge.optional(),images:ge.optional()}).strict();function Ge(r){const e=Bt.parse(r??{});if(e.mode==="unrestricted")return["default-src * data: blob:","script-src * data: blob: 'unsafe-inline'","style-src * data: blob: 'unsafe-inline'","img-src * data: blob:","font-src * data: blob:","connect-src * data: blob: ws: wss:","media-src * data: blob:","frame-src * data: blob:","worker-src * data: blob:","object-src 'none'","base-uri 'none'","form-action 'none'"].join("; ");const t=s=>s?.length?` ${[...new Set(s)].join(" ")}`:"";return["default-src 'none'",`script-src 'unsafe-inline'${t(e.scripts)}`,`style-src 'unsafe-inline'${t(e.styles)}`,`img-src data: blob:${t(e.images)}`,`font-src data:${t(e.fonts)}`,"connect-src 'none'","frame-src 'none'","worker-src 'none'","object-src 'none'","base-uri 'none'","form-action 'none'"].join("; ")}function Ft(r,e,t){let s;try{s=new URL(t)}catch{return!1}if(r.mode==="unrestricted")return["http:","https:","ws:","wss:","data:","blob:"].includes(s.protocol);if(s.protocol!=="https:"||s.username||s.password)return!1;const n=e==="script"?r.scripts:e==="stylesheet"?r.styles:e==="font"?r.fonts:e==="image"?r.images:void 0;var a;return(a=n?.includes(s.origin))!=null?a:!1}Ge();function Wt(r,e,t=[],s){if(jt.parse(r),!/^[a-f0-9]{32}$/.test(e))throw new Error("Invalid Artifact document session ID");return`<!doctype html><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="${Ge(s)}"><script>${Yt.replace("__XPERT_DOCUMENT_SESSION__",e)}<\/script>${Vt(t)}${r}`}const Yt=String.raw`
|
|
1
|
+
var DocumentHost=(function(se){"use strict";var k;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(k||(k={}));var Se;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const f=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=k.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class P extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return n(this),s}static assert(e){if(!(e instanceof P))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}P.create=r=>new P(r);const ye=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,k.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${k.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${k.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${k.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:k.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,k.assertNever(r)}return{message:t}};let et=ye;function tt(){return et}const rt=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const u=s.filter(l=>!!l).slice().reverse();for(const l of u)o=l(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function d(r,e){const t=tt(),s=rt({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===ye?void 0:ye].filter(n=>!!n)});r.common.issues.push(s)}class A{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return g;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return A.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return g;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const g=Object.freeze({status:"aborted"}),ne=r=>({status:"dirty",value:r}),R=r=>({status:"valid",value:r}),Ce=r=>r.status==="aborted",Ae=r=>r.status==="dirty",H=r=>r.status==="valid",ce=r=>typeof Promise<"u"&&r instanceof Promise;var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));class U{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const De=(r,e)=>{if(H(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new P(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:u}=r;return i.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:u??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:u??t??o.defaultError}},description:n}}class b{get description(){return this._def.description}_getType(e){return z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ce(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},n=this._parseSync({data:e,path:s.path,parent:s});return De(s,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return H(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>H(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(ce(n)?n:Promise.resolve(n));return De(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new ee({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return F.create(this,this._def)}nullable(){return te.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z.create(this)}promise(){return he.create(this,this._def)}or(e){return ue.create([this,e],this._def)}and(e){return le.create(this,e,this._def)}transform(e){return new ee({...v(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new we({...v(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new It({typeName:p.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ee({...v(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ie.create(this,e)}readonly(){return Te.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const st=/^c[^\s-]{8,}$/i,nt=/^[0-9a-z]+$/,at=/^[0-9A-HJKMNP-TV-Z]{26}$/i,it=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ot=/^[a-z0-9_-]{21}$/i,ct=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ut=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _e;const ft=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ht=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,mt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Re="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",_t=new RegExp(`^${Re}$`);function Me(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function vt(r){return new RegExp(`^${Me(r)}$`)}function xt(r){let e=`${Re}T${Me(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function bt(r,e){return!!((e==="v4"||!e)&&ft.test(r)||(e==="v6"||!e)&&mt.test(r))}function kt(r,e){if(!ct.test(r))return!1;try{const[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function wt(r,e){return!!((e==="v4"||!e)&&ht.test(r)||(e==="v6"||!e)&&pt.test(r))}class $ extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),g}const s=new A;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ut.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")_e||(_e=new RegExp(lt,"u")),_e.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")it.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")ot.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")st.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")at.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?xt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?_t.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?vt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?dt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?bt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?kt(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?wt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?gt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?yt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):k.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new $({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new $({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new $({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new $({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}$.create=r=>new $({checks:[],typeName:p.ZodString,coerce:r?.coerce??!1,...v(r)});function Et(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=Number.parseInt(r.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class J extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),g}let s;const n=new A;for(const a of this._def.checks)a.kind==="int"?k.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Et(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_finite,message:a.message}),n.dirty()):k.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&k.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}J.create=r=>new J({checks:[],typeName:p.ZodNumber,coerce:r?.coerce||!1,...v(r)});class ae extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s;const n=new A;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):k.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new ae({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ae.create=r=>new ae({checks:[],typeName:p.ZodBigInt,coerce:r?.coerce??!1,...v(r)});class ve extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),g}return R(e.data)}}ve.create=r=>new ve({typeName:p.ZodBoolean,coerce:r?.coerce||!1,...v(r)});class de extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),g}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),g}const s=new A;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):k.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new de({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}de.create=r=>new de({checks:[],coerce:r?.coerce||!1,typeName:p.ZodDate,...v(r)});class je extends b{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),g}return R(e.data)}}je.create=r=>new je({typeName:p.ZodSymbol,...v(r)});class Ue extends b{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),g}return R(e.data)}}Ue.create=r=>new Ue({typeName:p.ZodUndefined,...v(r)});class xe extends b{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),g}return R(e.data)}}xe.create=r=>new xe({typeName:p.ZodNull,...v(r)});class Ze extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return R(e.data)}}Ze.create=r=>new Ze({typeName:p.ZodAny,...v(r)});class Le extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return R(e.data)}}Le.create=r=>new Le({typeName:p.ZodUnknown,...v(r)});class B extends b{_parse(e){const t=this._getOrReturnCtx(e);return d(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),g}}B.create=r=>new B({typeName:p.ZodNever,...v(r)});class qe extends b{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),g}return R(e.data)}}qe.create=r=>new qe({typeName:p.ZodVoid,...v(r)});class Z extends b{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return d(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),g;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(d(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(d(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(d(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new U(t,i,t.path,o)))).then(i=>A.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new U(t,i,t.path,o)));return A.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new Z({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new Z({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new Z({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}Z.create=(r,e)=>new Z({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...v(e)});function X(r){if(r instanceof O){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=F.create(X(s))}return new O({...r._def,shape:()=>e})}else return r instanceof Z?new Z({...r._def,type:X(r.element)}):r instanceof F?F.create(X(r.unwrap())):r instanceof te?te.create(X(r.unwrap())):r instanceof Y?Y.create(r.items.map(e=>X(e))):r}class O extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=k.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){const l=this._getOrReturnCtx(e);return d(l,{code:c.invalid_type,expected:f.object,received:l.parsedType}),g}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof B&&this._def.unknownKeys==="strip"))for(const l in n.data)i.includes(l)||o.push(l);const u=[];for(const l of i){const m=a[l],S=n.data[l];u.push({key:{status:"valid",value:l},value:m._parse(new U(n,S,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof B){const l=this._def.unknownKeys;if(l==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:n.data[m]}});else if(l==="strict")o.length>0&&(d(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const m of o){const S=n.data[m];u.push({key:{status:"valid",value:m},value:l._parse(new U(n,S,n.path,m)),alwaysSet:m in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const m of u){const S=await m.key,D=await m.value;l.push({key:S,value:D,alwaysSet:m.alwaysSet})}return l}).then(l=>A.mergeObjectSync(s,l)):A.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new O({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{const n=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new O({...this._def,catchall:e})}pick(e){const t={};for(const s of k.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new O({...this._def,shape:()=>t})}omit(e){const t={};for(const s of k.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new O({...this._def,shape:()=>t})}deepPartial(){return X(this)}partial(e){const t={};for(const s of k.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new O({...this._def,shape:()=>t})}required(e){const t={};for(const s of k.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof F;)a=a._def.innerType;t[s]=a}return new O({...this._def,shape:()=>t})}keyof(){return Ve(k.objectKeys(this.shape))}}O.create=(r,e)=>new O({shape:()=>r,unknownKeys:"strip",catchall:B.create(),typeName:p.ZodObject,...v(e)}),O.strictCreate=(r,e)=>new O({shape:()=>r,unknownKeys:"strict",catchall:B.create(),typeName:p.ZodObject,...v(e)}),O.lazycreate=(r,e)=>new O({shape:r,unknownKeys:"strip",catchall:B.create(),typeName:p.ZodObject,...v(e)});class ue extends b{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new P(o.ctx.common.issues));return d(t,{code:c.invalid_union,unionErrors:i}),g}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const u of s){const l={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:l});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new P(u));return d(t,{code:c.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}}ue.create=(r,e)=>new ue({options:r,typeName:p.ZodUnion,...v(e)});function be(r,e){const t=z(r),s=z(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=k.objectKeys(e),a=k.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const u=be(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],u=be(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class le extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(Ce(a)||Ce(i))return g;const o=be(a.value,i.value);return o.valid?((Ae(a)||Ae(i))&&t.dirty(),{status:t.value,value:o.data}):(d(s,{code:c.invalid_intersection_types}),g)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}le.create=(r,e,t)=>new le({left:r,right:e,typeName:p.ZodIntersection,...v(t)});class Y extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return d(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),g;if(s.data.length<this._def.items.length)return d(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&s.data.length>this._def.items.length&&(d(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new U(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>A.mergeArray(t,i)):A.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Y({...this._def,rest:e})}}Y.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y({items:r,typeName:p.ZodTuple,rest:null,...v(e)})};class fe extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return d(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),g;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new U(s,o,s.path,o)),value:i._parse(new U(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?A.mergeObjectAsync(t,n):A.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof b?new fe({keyType:e,valueType:t,typeName:p.ZodRecord,...v(s)}):new fe({keyType:$.create(),valueType:e,typeName:p.ZodRecord,...v(t)})}}class Pe extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return d(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),g;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],l)=>({key:n._parse(new U(s,o,s.path,[l,"key"])),value:a._parse(new U(s,u,s.path,[l,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const l=await u.key,m=await u.value;if(l.status==="aborted"||m.status==="aborted")return g;(l.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(l.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const l=u.key,m=u.value;if(l.status==="aborted"||m.status==="aborted")return g;(l.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(l.value,m.value)}return{status:t.value,value:o}}}}Pe.create=(r,e,t)=>new Pe({valueType:e,keyType:r,typeName:p.ZodMap,...v(t)});class ie extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return d(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),g;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(d(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(d(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const l=new Set;for(const m of u){if(m.status==="aborted")return g;m.status==="dirty"&&t.dirty(),l.add(m.value)}return{status:t.value,value:l}}const o=[...s.data.values()].map((u,l)=>a._parse(new U(s,u,s.path,l)));return s.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new ie({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new ie({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ie.create=(r,e)=>new ie({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,...v(e)});class $e extends b{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}$e.create=(r,e)=>new $e({getter:r,typeName:p.ZodLazy,...v(e)});class ke extends b{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return d(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}ke.create=(r,e)=>new ke({value:r,typeName:p.ZodLiteral,...v(e)});function Ve(r,e){return new K({values:r,typeName:p.ZodEnum,...v(e)})}class K extends b{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{expected:k.joinValues(s),received:t.parsedType,code:c.invalid_type}),g}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return d(t,{received:t.data,code:c.invalid_enum_value,options:s}),g}return R(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return K.create(e,{...this._def,...t})}exclude(e,t=this._def){return K.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}K.create=Ve;class ze extends b{_parse(e){const t=k.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=k.objectValues(t);return d(s,{expected:k.joinValues(n),received:s.parsedType,code:c.invalid_type}),g}if(this._cache||(this._cache=new Set(k.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=k.objectValues(t);return d(s,{received:s.data,code:c.invalid_enum_value,options:n}),g}return R(e.data)}get enum(){return this._def.values}}ze.create=(r,e)=>new ze({values:r,typeName:p.ZodNativeEnum,...v(e)});class he extends b{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return d(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),g;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return R(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}he.create=(r,e)=>new he({type:r,typeName:p.ZodPromise,...v(e)});class ee extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{d(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return g;const u=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return u.status==="aborted"?g:u.status==="dirty"||t.value==="dirty"?ne(u.value):u});{if(t.value==="aborted")return g;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?g:o.status==="dirty"||t.value==="dirty"?ne(o.value):o}}if(n.type==="refinement"){const i=o=>{const u=n.refinement(o,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!H(i))return g;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>H(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):g);k.assertNever(n)}}ee.create=(r,e,t)=>new ee({schema:r,typeName:p.ZodEffects,effect:e,...v(t)}),ee.createWithPreprocess=(r,e,t)=>new ee({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,...v(t)});class F extends b{_parse(e){return this._getType(e)===f.undefined?R(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}F.create=(r,e)=>new F({innerType:r,typeName:p.ZodOptional,...v(e)});class te extends b{_parse(e){return this._getType(e)===f.null?R(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}te.create=(r,e)=>new te({innerType:r,typeName:p.ZodNullable,...v(e)});class we extends b{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}we.create=(r,e)=>new we({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class Ee extends b{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ce(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new P(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new P(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ee.create=(r,e)=>new Ee({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class Be extends b{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),g}return{status:"valid",value:e.data}}}Be.create=r=>new Be({typeName:p.ZodNaN,...v(r)});class It extends b{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ie extends b{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?g:a.status==="dirty"?(t.dirty(),ne(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?g:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new Ie({in:e,out:t,typeName:p.ZodPipeline})}}class Te extends b{_parse(e){const t=this._def.innerType._parse(e),s=n=>(H(n)&&(n.value=Object.freeze(n.value)),n);return ce(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}Te.create=(r,e)=>new Te({innerType:r,typeName:p.ZodReadonly,...v(e)});var p;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(p||(p={}));const j=$.create,Tt=J.create,Nt=ve.create,Ot=xe.create;B.create;const me=Z.create,re=O.create,St=ue.create;le.create,Y.create;const Ct=fe.create,Q=ke.create,Ne=K.create;he.create,F.create,te.create;function At(r,e){if(r==null)return{};var t={},s=Object.keys(r),n,a;for(a=0;a<s.length;a++)n=s[a],!(e.indexOf(n)>=0)&&(t[n]=r[n]);return t}function L(){return L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},L.apply(this,arguments)}const Fe="xpert.artifact-document",We=1,pe=j().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,79}$/),Dt=St([j().max(4e3),Tt().finite(),Nt(),Ot()]),Ye=Ct(pe,Dt).refine(r=>Object.keys(r).length<=24,"Too many controls"),Rt=re({type:Q("query"),requestId:j().min(1).max(80),bindingId:pe,controls:Ye,priority:Ne(["interactive","initial","refresh"]).optional()}).strict(),Mt=re({bindingIds:me(pe).max(64).refine(r=>new Set(r).size===r.length,"Duplicate binding IDs"),defaults:Ye,theme:Ne(["light","dark"]),locale:j().min(1).max(80)}).strict(),jt=j().min(1).max(3e5).superRefine((r,e)=>{(new TextEncoder().encode(r).byteLength>3e5||!/<html[\s>]/i.test(r)||!/<body[\s>]/i.test(r))&&e.addIssue({code:"custom",message:"Supply a complete UTF-8 HTML document, at most 300 KB"})}),Ut=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),q=(r,e)=>r>>>e|r<<32-e;function Zt(r){const e=new Uint8Array(Math.ceil((r.length+9)/64)*64);e.set(r),e[r.length]=128;const t=new DataView(e.buffer);t.setUint32(e.length-8,Math.floor(r.length/536870912)),t.setUint32(e.length-4,r.length*8>>>0);const s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),n=new Uint32Array(64);for(let a=0;a<e.length;a+=64){for(let w=0;w<16;w++)n[w]=t.getUint32(a+w*4);for(let w=16;w<64;w++){const y=n[w-15],_=n[w-2],E=q(y,7)^q(y,18)^y>>>3,N=q(_,17)^q(_,19)^_>>>10;n[w]=n[w-16]+E+n[w-7]+N>>>0}let[i,o,u,l,m,S,D,M]=s;for(let w=0;w<64;w++){const y=q(m,6)^q(m,11)^q(m,25),_=m&S^~m&D,E=M+y+_+Ut[w]+n[w]>>>0,N=q(i,2)^q(i,13)^q(i,22),W=i&o^i&u^o&u,G=N+W>>>0;M=D,D=S,S=m,m=l+E>>>0,l=u,u=o,o=i,i=E+G>>>0}s[0]=s[0]+i>>>0,s[1]=s[1]+o>>>0,s[2]=s[2]+u>>>0,s[3]=s[3]+l>>>0,s[4]=s[4]+m>>>0,s[5]=s[5]+S>>>0,s[6]=s[6]+D>>>0,s[7]=s[7]+M>>>0}return Array.from(s,a=>a.toString(16).padStart(8,"0")).join("")}const Qe=re({id:pe,version:j().regex(/^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/),format:Q("classic-script"),global:j().regex(/^[A-Za-z_$][A-Za-z0-9_$]{0,79}$/).refine(r=>!["window","self","globalThis","document","parent","top","location","xpertLiveArtifact","__proto__","constructor","prototype"].includes(r)),sha256:j().regex(/^[a-f0-9]{64}$/)}).strict(),Lt=Qe.transform(r=>({id:r.id,version:r.version,format:"classic-script",global:r.global,sha256:r.sha256})),qt=me(Lt).max(8).superRefine((r,e)=>{(new Set(r.map(t=>t.id)).size!==r.length||new Set(r.map(t=>t.global)).size!==r.length)&&e.addIssue({code:"custom",message:"Duplicate dependency ID or global"})}),Pt=me(Qe.extend({source:j().min(1).max(4e6)}).strict().transform(r=>({id:r.id,version:r.version,format:"classic-script",global:r.global,sha256:r.sha256,source:r.source}))).max(8);function $t(r,e){const t=Pt.parse(r);qt.parse(t.map(n=>{var{source:a}=n,i=At(n,["source"]);return i}));let s=0;for(const n of t){const a=new TextEncoder().encode(n.source);if(s+=a.length,a.length>4e6||s>8e6)throw new Error("DOCUMENT_DEPENDENCY_TOO_LARGE");if(Zt(a)!==n.sha256)throw new Error("DOCUMENT_DEPENDENCY_INTEGRITY_FAILED")}return t.map(n=>({id:n.id,version:n.version,global:n.global,sha256:n.sha256,source:n.source,format:"classic-script"}))}function Vt(r){const e=t=>JSON.stringify(t).replace(/</g,"\\u003c").replace(/>/g,"\\u003e");return $t(r).map(t=>`<script>(()=>{const s=document.createElement('script');s.textContent=${e(t.source)};document.head.appendChild(s);s.remove();if(typeof window[${e(t.global)}]==='undefined')throw new Error('DOCUMENT_DEPENDENCY_GLOBAL_MISSING');})();<\/script>`).join("")}const zt=j().max(250).refine(r=>{try{const e=new URL(r);return e.protocol==="https:"&&e.origin===r&&!e.username&&!e.password&&/^(?:[a-z0-9.-]+|\[[a-f0-9:]+\])$/i.test(e.hostname)}catch{return!1}},"Use an exact HTTPS origin without a path, credentials or wildcard"),ge=me(zt).max(16),Bt=re({mode:Ne(["restricted","unrestricted"]).optional(),scripts:ge.optional(),styles:ge.optional(),fonts:ge.optional(),images:ge.optional()}).strict();function Ge(r){const e=Bt.parse(r??{});if(e.mode==="unrestricted")return["default-src * data: blob:","script-src * data: blob: 'unsafe-inline'","style-src * data: blob: 'unsafe-inline'","img-src * data: blob:","font-src * data: blob:","connect-src * data: blob: ws: wss:","media-src * data: blob:","frame-src * data: blob:","worker-src * data: blob:","object-src 'none'","base-uri 'none'","form-action 'none'"].join("; ");const t=s=>s?.length?` ${[...new Set(s)].join(" ")}`:"";return["default-src 'none'",`script-src 'unsafe-inline'${t(e.scripts)}`,`style-src 'unsafe-inline'${t(e.styles)}`,`img-src data: blob:${t(e.images)}`,`font-src data:${t(e.fonts)}`,"connect-src 'none'","frame-src 'none'","worker-src 'none'","object-src 'none'","base-uri 'none'","form-action 'none'"].join("; ")}function Ft(r,e,t){let s;try{s=new URL(t)}catch{return!1}if(r.mode==="unrestricted")return["http:","https:","ws:","wss:","data:","blob:"].includes(s.protocol);if(s.protocol!=="https:"||s.username||s.password)return!1;const n=e==="script"?r.scripts:e==="stylesheet"?r.styles:e==="font"?r.fonts:e==="image"?r.images:void 0;var a;return(a=n?.includes(s.origin))!=null?a:!1}Ge();function Wt(r,e,t=[],s){if(jt.parse(r),!/^[a-f0-9]{32}$/.test(e))throw new Error("Invalid Artifact document session ID");return`<!doctype html><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="${Ge(s)}"><script>${Yt.replace("__XPERT_DOCUMENT_SESSION__",e)}<\/script>${Vt(t)}${r}`}const Yt=String.raw`
|
|
2
2
|
;(() => {
|
|
3
3
|
'use strict'
|
|
4
4
|
const SESSION_ID = '__XPERT_DOCUMENT_SESSION__'
|
|
@@ -195,4 +195,4 @@ var DocumentHost=(function(se){"use strict";var k;(function(r){r.assertEqual=n=>
|
|
|
195
195
|
})
|
|
196
196
|
parent.postMessage({ channel: CHANNEL, version: VERSION, type: 'ready', sessionId: SESSION_ID }, '*')
|
|
197
197
|
})()
|
|
198
|
-
`,Oe=r=>Object.assign(new Error(r),{code:r}),Qt=r=>JSON.stringify([r.bindingId,Object.keys(r.controls).sort().map(
|
|
198
|
+
`,Oe=r=>Object.assign(new Error(r),{code:r}),Qt=r=>{var e;return JSON.stringify([r.bindingId,(e=r.cache)!=null?e:null,Object.keys(r.controls).sort().map(t=>[t,r.controls[t]])])},He={interactive:0,initial:1,refresh:2},Gt=18e4,Ht=45e3,Je=6e4;function Jt(r){const e=(y,_,E)=>Number.isFinite(y)?Math.max(1,Math.min(E,Math.floor(y))):_,t=e(r.concurrency,4,8),s=e(r.dispatchesPerMinute,60,1024),n=[],a=new Set,i=new Map,o=[];let u=!1,l;const m=(y,_)=>{try{y?.(_)}catch{}},S=()=>m(r.onBusy,!u&&(n.length>0||a.size>0)),D=(y,_,E)=>{y.state=L({},y.state,{state:_},_==="running"?{startedAt:Date.now()}:_!=="queued"?{finishedAt:Date.now()}:{},E?{code:E}:{}),m(r.onState,L({},y.state))},M=(y,_)=>{y.settled||(y.settled=!0,clearTimeout(y.timer),y.controller.abort(),D(y,_==="DOCUMENT_QUERY_SUPERSEDED"?"superseded":"failed",_),y.reject(Oe(_)),i.get(y.input.bindingId)===y&&i.delete(y.input.bindingId))},w=()=>{if(clearTimeout(l),u)return;const y=Date.now();for(;o.length&&o[0]<=y-Je;)o.shift();for(;n.length&&a.size<t&&o.length<s;){n.sort((E,N)=>E.priority-N.priority||E.state.queuedAt-N.state.queuedAt);const _=n.shift();clearTimeout(_.timer),a.add(_),o.push(Date.now()),D(_,"running"),_.timer=setTimeout(()=>M(_,"DOCUMENT_QUERY_TIMEOUT"),Ht),Promise.resolve().then(()=>r.execute(_.input,_.controller.signal)).then(E=>{u||_.settled||(_.settled=!0,D(_,"succeeded"),_.resolve(E))},()=>M(_,"DOCUMENT_QUERY_FAILED")).finally(()=>{clearTimeout(_.timer),a.delete(_),i.get(_.input.bindingId)===_&&i.delete(_.input.bindingId),w()})}n.length&&o.length>=s&&(l=setTimeout(w,Math.max(1,o[0]+Je-Date.now()))),S()};return{query(y,_="interactive"){if(u)return Promise.reject(Oe("DOCUMENT_DISPOSED"));const E=Qt(y),N=i.get(y.bindingId);if(N?.key===E&&!N.settled)return N.priority=Math.min(N.priority,He[_]),N.promise;if(N){const T=n.indexOf(N);T>=0&&n.splice(T,1),M(N,"DOCUMENT_QUERY_SUPERSEDED")}if(n.length>=64)return Promise.reject(Oe("DOCUMENT_QUEUE_LIMIT"));let W,G;const oe=new Promise((T,C)=>{W=T,G=C}),x={input:L({bindingId:y.bindingId,controls:L({},y.controls)},y.cache?{cache:L({},y.cache)}:{}),key:E,priority:He[_],controller:new AbortController,promise:oe,resolve:W,reject:G,state:L({},y,{controls:L({},y.controls),state:"queued",queuedAt:Date.now()}),settled:!1};return x.timer=setTimeout(()=>{const T=n.indexOf(x);T>=0&&n.splice(T,1),M(x,"DOCUMENT_QUEUE_TIMEOUT"),w()},Gt),i.set(y.bindingId,x),n.push(x),D(x,"queued"),w(),oe},get busy(){return n.length>0||a.size>0},dispose(){if(!u){u=!0,clearTimeout(l);for(const y of[...n,...a])M(y,"DOCUMENT_DISPOSED");n.length=0,i.clear(),S()}}}}const Xt=re({channel:Q(Fe),version:Q(We),type:Q("ready"),sessionId:j().regex(/^[a-f0-9]{32}$/)}).strict(),Kt=re({type:Q("diagnostic"),code:Q("DOCUMENT_BINDING_DENIED")}).strict();function er(r,e){if(!r.ownerDocument.querySelector("meta[data-xpert-document-policy]"))throw new Error("Install the Artifact document frame policy before mounting a document");const t=Mt.parse(e.context),s=Array.from(crypto.getRandomValues(new Uint8Array(16)),x=>x.toString(16).padStart(2,"0")).join(""),n=Wt(e.html,s,e.dependencies,e.networkPolicy),a=new MessageChannel,i=new Set(t.bindingIds),o=Number.isFinite(e.dispatchesPerMinute)?Math.max(256,Math.min(1024,e.dispatchesPerMinute)):256,u=new Set,l=new Map,m=new Set,S=new Map,D=r.ownerDocument.defaultView;let M=!1,w=!1,y=0,_=Date.now();r.setAttribute("sandbox",e.allowDownloads===!0?"allow-scripts allow-downloads":"allow-scripts"),r.referrerPolicy="no-referrer";const E=(x,T)=>{try{x?.(T)}catch{}},N=x=>{w||a.port1.postMessage(x)},W=(x,T)=>{N({type:"result",requestId:x,ok:!1,code:T}),E(e.onError,T)},G=Jt({concurrency:e.concurrency,dispatchesPerMinute:e.dispatchesPerMinute,execute:async(x,T)=>{if(T.aborted)throw new Error("DOCUMENT_QUERY_SUPERSEDED");const C=[...l.values()].find(I=>I.bindingId===x.bindingId&&Object.keys(I.controls).length===Object.keys(x.controls).length&&Object.keys(x.controls).every(V=>I.controls[V]===x.controls[V]));if(!C)throw new Error("DOCUMENT_QUERY_SUPERSEDED");m.add(C.requestId);try{return await e.query(C,T)}finally{m.delete(C.requestId)}},onBusy:x=>E(e.onBusy,x),onState:x=>{if(E(e.onQueryState,x),x.state==="running")for(const T of l.values())T.bindingId===x.bindingId&&N({type:"query-state",requestId:T.requestId,state:"running"})}});a.port1.onmessage=async x=>{if(w)return;const T=Kt.safeParse(x.data);if(T.success){E(e.onError,T.data.code);return}const C=Rt.safeParse(x.data);if(!C.success){E(e.onError,"DOCUMENT_INVALID_REQUEST");return}const I={type:C.data.type,requestId:C.data.requestId,bindingId:C.data.bindingId,controls:C.data.controls,priority:C.data.priority};if(!i.has(I.bindingId)){W(I.requestId,"DOCUMENT_BINDING_DENIED");return}if(Date.now()-_>=6e4&&(y=0,_=Date.now(),u.clear()),l.has(I.requestId)||m.has(I.requestId)||u.has(I.requestId)){W(I.requestId,"DOCUMENT_REQUEST_REPLAY");return}if(l.size>=128||++y>o){W(I.requestId,"DOCUMENT_QUERY_LIMIT");return}u.add(I.requestId),l.set(I.requestId,I),S.set(I.bindingId,I.requestId),N({type:"query-state",requestId:I.requestId,state:"queued"});try{const V=await G.query(I,I.priority);w||(N({type:"result",requestId:I.requestId,ok:!0,dataset:V}),S.get(I.bindingId)===I.requestId&&E(e.onResult,V))}catch(V){if(!w){const Ke=V instanceof Error&&/^DOCUMENT_[A-Z_]+$/.test(V.message)?V.message:"DOCUMENT_QUERY_FAILED";N({type:"result",requestId:I.requestId,ok:!1,code:Ke}),S.get(I.bindingId)===I.requestId&&E(e.onError,Ke)}}finally{l.delete(I.requestId)}};const oe=x=>{var T;if(w||M||x.source!==r.contentWindow)return;const C=Xt.safeParse(x.data);!C.success||C.data.sessionId!==s||(M=!0,(T=r.contentWindow)==null||T.postMessage({channel:Fe,version:We,type:"init",sessionId:s,context:t},"*",[a.port2]))};return D.addEventListener("message",oe),a.port1.start(),r.srcdoc=n,{refresh(x){if(x!==void 0&&!i.has(x))throw new Error("DOCUMENT_BINDING_DENIED");N(L({type:"refresh"},x?{bindingId:x}:{}))},dispose(){w||(w=!0,G.dispose(),l.clear(),D.removeEventListener("message",oe),a.port1.close(),a.port2.close(),E(e.onBusy,!1))}}}function tr(r){if(r.querySelector("meta[data-xpert-document-policy]"))return;const e=r.createElement("meta");e.httpEquiv="Content-Security-Policy",e.content="frame-src 'none'",e.dataset.xpertDocumentPolicy="1",r.head.prepend(e)}const Xe={mode:"unrestricted"};function rr(r,e){return Ft(Xe,r,e)}function sr(r,e){const t=new Map;return er(r,{...e,dispatchesPerMinute:Math.max(60,e.context.bindingIds.length*16),networkPolicy:Xe,query:async(s,n)=>{const a=(t.get(s.bindingId)??0)+1;if(t.set(s.bindingId,a),a>16)throw e.onError?.("DOCUMENT_SNAPSHOT_REPLAY_LIMIT"),new Error("DOCUMENT_SNAPSHOT_REPLAY_LIMIT");return e.query(s,n)}})}return se.installArtifactDocumentFramePolicy=tr,se.isDashboardResourceAllowed=rr,se.mountArtifactDocument=sr,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"}),se})({});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 示例内容与模板目录
|
|
3
|
+
description: 十个分析任务、模板占位目录、原创封面和可迁移的 V2 内容包
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Warning>
|
|
7
|
+
内容格式、目录元数据和执行契约处于 Beta 阶段,后续可能发生破坏性调整。
|
|
8
|
+
</Warning>
|
|
9
|
+
|
|
10
|
+
## 目录和可执行内容
|
|
11
|
+
|
|
12
|
+
探索首页提供分析与洞察、数据与知识、定时任务和技能扩展四个入口。分析与洞察进入示例列表,数据与知识进入已有数据管理;定时任务和技能扩展目前只说明预留范围。
|
|
13
|
+
|
|
14
|
+
模板目录包含 6 个分析模板、43 个视觉主题和 37 个组件,支持分类、搜索、主题外观筛选和服务端分页。这 86 项是展示占位,只有说明和原创 SVG 形态预览,不代表可执行模板。预览中的图表和值为示意,不是查询结果。
|
|
15
|
+
|
|
16
|
+
十个分析任务另以 V2 内容包提供:酒店经营分析、出境旅行、Steam 市场、天气预警、品类贡献、电商经营、全球资产、法律分析、订单促销和酒店取消归因。其中酒店经营分析使用固定 HTML 模板,其余任务提供分析提示词,由 Agent 在用户发送后执行。联网检索、Kaggle MCP 和外部技能需在目标环境另行提供,导入不会安装或授予这些能力。
|
|
17
|
+
|
|
18
|
+
目录蓝图保存在 `src/lib/library/catalog-blueprints.json`,仅用于展示和按逻辑身份匹配当前用户已导入的资源。用户上传的正文、固定版本和公开状态仍由数据库管理,不写回静态目录。未导入任务禁用使用入口;浏览页面不会自动灌入数据。
|
|
19
|
+
|
|
20
|
+
## 生成和导入 ZIP
|
|
21
|
+
|
|
22
|
+
从源码仓库的插件目录完成构建后,执行以下任一命令,输出文件必须尚不存在:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
node scripts/export-explore-v2.mjs ./explore-insights.xpert-library.zip
|
|
26
|
+
node scripts/export-hotel-v2.mjs ./hotel-operations.xpert-library.zip
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
完整探索包包含 10 个任务、15 个资源和 14 个附件。酒店独立包包含任务、模板、主题、数据集四个资源及两个附件。探索包为酒店任务新增封面并使用版本 `2.1.0`,保留酒店独立包 `2.0.0` 的依赖摘要。
|
|
30
|
+
|
|
31
|
+
作者脚本在源码仓库运行,不属于插件启动流程。将 ZIP 通过[导入预检与确认](/library-import-ui)导入为私有资源,再从目录使用。目标客户部署可以导入同一个 ZIP,重新分配本地记录;数据源凭据和系统存储配置不在包内。已导入资源可从详情导出完整依赖闭包,见[资源库与 ZIP 迁移](/library-storage)。
|
|
32
|
+
|
|
33
|
+
## 数据口径和封面
|
|
34
|
+
|
|
35
|
+
酒店数据为 720 条、订单数据为 1080 条、天气数据为 360 条确定性合成记录,均明确标注演示用途。酒店房费为未取消预订的 ADR × 晚数估算,不是实际收入;取消率使用状态已知的预订为分母。模板按显式字段映射查询,不把业务数据行写入 HTML。
|
|
36
|
+
|
|
37
|
+
十张 WebP 任务封面为重新生成的插图,四张分类 SVG 和 86 张目录 SVG 为原创代码绘制。素材来源、生成记录与摘要分别保存在 `assets/explore/PROVENANCE.md`、`assets/explore/generation-prompts.json` 和 `assets/library/catalog/provenance.json`;界面不依赖远程图片服务。封面和图形只说明任务主题,不作为分析证据。
|
|
38
|
+
|
|
39
|
+
点击使用只向 ChatKit 准备可编辑的提示词、附件和技能,发送由用户完成。准备配方与保存回执的约束见[Agent 交接](/template-agent-handoff)。
|
|
40
|
+
|
|
41
|
+
## 验证边界
|
|
42
|
+
|
|
43
|
+
内容测试检查包的确定性、依赖闭包、数据数量、固定版本保留、图像摘要和酒店查询交互;目录测试覆盖分页、筛选、只读及未导入状态。单元测试和生产包挂载检查不等同于真实 ChatKit、Agent、外部数据能力或客户部署验收。其余九个任务不应宣称已完成最终分析产物验收。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 新建 Dashboard 初始界面
|
|
3
|
+
description: 从数据、模板或示例开始创建看板
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<Warning>
|
|
7
|
+
初始界面与导航入口处于 Beta 阶段,后续可能发生破坏性调整。
|
|
8
|
+
</Warning>
|
|
9
|
+
|
|
10
|
+
具有编辑权限且尚未选中看板时,个人工作区和项目工作区都展示初始界面。它仅占用已有 View 的内容区域,使用共享 shadcn 组件及 Tailwind 字体、间距样式。
|
|
11
|
+
|
|
12
|
+
| 入口 | 行为 |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| 我的数据 | 打开已有数据源和 Dataset 管理页面 |
|
|
15
|
+
| 模板库 | 打开已导入及公开的分析模板、主题与组件目录 |
|
|
16
|
+
| 探索示例 | 打开已导入及公开的示例任务目录 |
|
|
17
|
+
|
|
18
|
+
三个入口只通过 `workbench.navigation.open` 请求平台打开对应 View,不发送聊天消息,也不创建或发布看板。导航处理中禁用入口;失败时展示错误,允许重试。
|
|
19
|
+
|
|
20
|
+
“交给助理分析”沿用已有的开始分析操作:先清除上一个看板的编辑目标,再向当前对话发送开始分析请求。它与示例目录中的“使用此任务”行为不同,后者仅准备输入框草稿,等待用户发送。
|
|
21
|
+
|
|
22
|
+
本批不预置模板、示例数据或封面。相关目录功能见[资源目录页面](./library-directory-ui)。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 添加数据视图
|
|
3
|
+
description: 浏览授权数据源,编辑并预览可复用查询
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Beta 阶段**:添加数据视图与可复用数据集功能仍在演进。后续迭代可能随时引入不兼容变更,包括视图标识、动作接口、参数及存储格式;Beta 期间不保证向后兼容,升级时可能需要迁移或重新创建数据集定义。
|
|
7
|
+
|
|
8
|
+
在 Workbench 的新增视图菜单打开「添加数据」。视图按需打开,沿用当前 Assistant 或 Project 的作用域。
|
|
9
|
+
|
|
10
|
+
## 数据源
|
|
11
|
+
|
|
12
|
+
「数据源」页签展示当前用户可访问的 Analytics 来源。选择来源后,可以浏览 Provider 返回的目录与数据项、查看字段元数据和查询契约,并选择查询方式。
|
|
13
|
+
|
|
14
|
+
连接凭据与授权由平台管理。此视图使用宿主提供的数据源,不创建数据库连接或保存密码。来源被撤销后,查询与保存仍由平台执行权限检查。
|
|
15
|
+
|
|
16
|
+
## 数据集
|
|
17
|
+
|
|
18
|
+
「数据集」页签支持新建、编辑、查询预览和回收定义。列表按页加载;名称搜索筛选已加载的条目,可以继续加载更多。
|
|
19
|
+
|
|
20
|
+
新建时选择来源与查询方式,填写查询 JSON,配置输出字段、类型、角色和数据粒度。也可以从已有看板复用 Binding,再调整名称、查询与默认筛选值。
|
|
21
|
+
|
|
22
|
+
预览展示返回行数、完整性、来源获取时间和执行标识;表格最多展示前 100 行。保存前,后端再次校验查询。修改或回收携带当前修订号,遇到冲突时需要重新打开最新定义。
|
|
23
|
+
|
|
24
|
+
回收前会显示确认框。失败时保留对话框与错误信息;成功后刷新列表。已复制到看板中的查询不随数据集定义一起删除。
|
|
25
|
+
|
|
26
|
+
## 作用域与界面
|
|
27
|
+
|
|
28
|
+
切换项目或对话作用域时清空当前选中项和编辑状态,重新读取宿主数据。仅切换语言或主题时保留当前操作状态。表单、弹窗和表格复用共享 shadcn 组件,适应宿主主题和视图宽度。
|
|
29
|
+
|
|
30
|
+
查询定义的存储与访问规则见 [数据集存储](./dataset-storage)。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 从数据集生成标准看板
|
|
3
|
+
description: 校验数据集修订与字段映射,创建独立的标准看板草稿
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Beta 阶段**:生成接口、预设标识及字段映射约定可能随时发生不兼容变更,暂不保证向后兼容。
|
|
7
|
+
|
|
8
|
+
`template-create` 是添加数据 View 暴露的基础动作。调用方提供已有数据集的 Artifact ID、预期修订号、新看板定义 ID、标题、展示预设、主题和字段映射,服务在当前宿主授权作用域中创建看板草稿。
|
|
9
|
+
|
|
10
|
+
本批不包含模板库选择界面、模板目录条目、封面、酒店示例或公开数据。这里的预设是标准图表的组装规则,业务查询来自用户已保存的数据集。
|
|
11
|
+
|
|
12
|
+
## 生成规则
|
|
13
|
+
|
|
14
|
+
| 参数 | 行为 |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `datasetId`、`datasetRevision` | 读取数据集当前定义;修订不一致时拒绝生成,调用方需要重新读取并确认映射 |
|
|
17
|
+
| `id`、`title` | 用新 UUID 创建独立看板;已有草稿不被覆盖 |
|
|
18
|
+
| `template` | `comparison` / `bar` 使用柱状图,`trend` / `line` 使用折线图,另支持 `area`、`pie` 和仅明细的 `details` |
|
|
19
|
+
| `x`、`y` | 图表模式要求字段存在且 y 是数值字段;x 必须覆盖数据集输出粒度,不能把明细伪装成汇总 |
|
|
20
|
+
| `theme` | 复用[标准看板主题适配](/standard-theme)的 `system`、`slate`、`contrast` |
|
|
21
|
+
|
|
22
|
+
每个草稿包含一个 Binding、对应筛选控件和一张明细表;图表模式额外包含主图。明细表最多展示输出定义中前 30 个字段,完整 Binding 字段定义仍保留。多个粒度维度的查询需要先在数据集中聚合为适合该图表的粒度;此接口不会擅自改写查询或执行二次聚合。
|
|
23
|
+
|
|
24
|
+
数据集的筛选默认值同时复制到 Binding 参数与看板控件,保持默认查询一致。输入严格校验,不接受额外的用户身份、源连接、原生查询或 HTML 参数。
|
|
25
|
+
|
|
26
|
+
## 权限与保存
|
|
27
|
+
|
|
28
|
+
服务先验证数据集所属租户、组织、用户或项目作用域及当前编辑权限,再走现有看板保存流程,重新查询当前授权数据并校验筛选条件。数据源权限撤销、字段不匹配、查询失败或修订冲突时,不产生成功的草稿回执。
|
|
29
|
+
|
|
30
|
+
成功返回新看板的 `artifactId`、`draftRevision` 和 `status: draft`,不自动发布。看板保存查询定义和展示结构,不保存预览结果行。已存在的看板修订通过原有 CAS 约束保护。
|
|
31
|
+
|
|
32
|
+
生成后的看板持有 Binding 副本。后续修改或回收数据集不会同步改动这份看板;看板查询仍受实时数据源权限约束。
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 数据集存储
|
|
3
|
+
description: 可复用查询定义、作用域隔离与草稿修订约束
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Beta 阶段**:添加数据视图与可复用数据集功能仍在演进。后续迭代可能随时引入不兼容变更,包括视图标识、动作接口、参数及存储格式;Beta 期间不保证向后兼容,升级时可能需要迁移或重新创建数据集定义。
|
|
7
|
+
|
|
8
|
+
数据集保存一份可复用的 Analytics Binding 和筛选默认值。预览时重新执行查询,保存内容不包含查询结果行。数据源发现与查询继续使用平台 Analytics Runtime Capability。
|
|
9
|
+
|
|
10
|
+
## 存储方式
|
|
11
|
+
|
|
12
|
+
- Artifact 类型为 `live-dashboard-dataset`,采用仅草稿生命周期。
|
|
13
|
+
- 数据集定义包含稳定 ID、名称、描述、Binding 和筛选默认值,JSON 内容最大为 200,000 字节。
|
|
14
|
+
- 定义文件通过 Artifact Content 写入,再由 Artifact Drafts 关联文件引用与修订号;读取通过 Workspace Files 完成。插件不绑定具体文件存储后端。
|
|
15
|
+
- 列表元数据保存名称、描述、来源、Provider 和字段数,不缓存业务数据。
|
|
16
|
+
|
|
17
|
+
## 访问范围
|
|
18
|
+
|
|
19
|
+
个人数据集隔离到当前 Assistant 和用户;项目数据集隔离到当前 Project。每次读取或修改都会校验租户、组织及资源归属,并重新检查项目角色和 Assistant 绑定。
|
|
20
|
+
|
|
21
|
+
项目数据集定义仅供可编辑项目的用户访问。普通成员不能读取定义草稿;离开项目、失去编辑权限或解除 Assistant 绑定后,后续访问会被拒绝。Artifact 文件入口也执行个人所有者或项目编辑权限校验。
|
|
22
|
+
|
|
23
|
+
## 保存、预览与回收
|
|
24
|
+
|
|
25
|
+
保存前执行来源查询验证。来源访问被撤销或查询无效时,不写入新的定义修订。预览执行当前查询,仍受数据源权限约束。
|
|
26
|
+
|
|
27
|
+
新建使用 `expectedRevision: 0`;修改与回收使用当前修订号。版本冲突由宿主草稿接口拒绝,避免覆盖他人的修改。回收后,数据集不再出现在有效列表中。
|
|
28
|
+
|
|
29
|
+
本模块提供数据集持久化服务与 Artifact 类型。数据管理视图、模板生成、公开资源发布及 ZIP 迁移由各自模块接入。
|
package/docs/docs.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"quick-start",
|
|
22
22
|
"superstore",
|
|
23
23
|
"visual-styles",
|
|
24
|
+
"standard-theme",
|
|
24
25
|
"visual-styles-acceptance",
|
|
25
26
|
"trend-workspace",
|
|
26
27
|
"trend-workspace-acceptance",
|
|
@@ -28,9 +29,23 @@
|
|
|
28
29
|
"html-mode",
|
|
29
30
|
"frontend-libraries",
|
|
30
31
|
"frontend-libraries-acceptance",
|
|
32
|
+
"inline-analysis",
|
|
33
|
+
"data-view",
|
|
34
|
+
"dataset-storage",
|
|
35
|
+
"dataset-generation",
|
|
36
|
+
"library-storage",
|
|
37
|
+
"library-execution",
|
|
38
|
+
"template-agent-handoff",
|
|
39
|
+
"content-packages",
|
|
40
|
+
"library-browser-verification",
|
|
41
|
+
"library-import-ui",
|
|
42
|
+
"library-detail-ui",
|
|
43
|
+
"library-directory-ui",
|
|
44
|
+
"dashboard-starter",
|
|
31
45
|
"drafts",
|
|
32
46
|
"drafts-acceptance",
|
|
33
47
|
"team-sharing",
|
|
48
|
+
"proposals/resource-sharing-decoupling",
|
|
34
49
|
"team-sharing-acceptance",
|
|
35
50
|
"chat-resource-cards",
|
|
36
51
|
"editing",
|
package/docs/editing.mdx
CHANGED
|
@@ -48,6 +48,12 @@ HTML 页面仍然只通过 `query(bindingId, controls)` 取数。增加编辑工
|
|
|
48
48
|
旧版本保留原 HTML、控件和 Binding;打开旧版本仍会查询当前有权访问的最新来源数据。
|
|
49
49
|
版本历史保存的是看板定义,不是历史查询结果快照。
|
|
50
50
|
|
|
51
|
+
在版本历史打开正式版本后,有编辑权限的成员可从“更多”选择“恢复为草稿”。
|
|
52
|
+
确认框说明该操作会替换当前工作草稿;取消操作保持当前查看的版本和工作草稿不变。
|
|
53
|
+
恢复会重新校验当前数据权限、查询和页面,保留历史版本锁定的前端库资源。
|
|
54
|
+
成功后仍是同一看板的新草稿修订,正式版本和已有分享不会变化;需要另行审阅并发布。
|
|
55
|
+
确认期间有人编辑或发布时,恢复返回冲突,不覆盖对方的改动。
|
|
56
|
+
|
|
51
57
|
## 分层边界
|
|
52
58
|
|
|
53
59
|
平台继续负责 Workspace Files、Artifacts 版本与授权、上下文消息桥和 HTML 隔离。
|
package/docs/html-mode.md
CHANGED
|
@@ -19,7 +19,7 @@ HTML iframe → 专属 MessagePort → Live Dashboard View → query-binding
|
|
|
19
19
|
|
|
20
20
|
## 平台接口
|
|
21
21
|
|
|
22
|
-
`@xpert-ai/plugin-sdk/artifact-document` 是浏览器安全子入口。`mountArtifactDocument` 封装 HTML 格式验证、CSP
|
|
22
|
+
`@xpert-ai/plugin-sdk/artifact-document` 是浏览器安全子入口。`mountArtifactDocument` 封装 HTML 格式验证、CSP、独立 MessageChannel、Binding ID 白名单、请求限额、销毁和刷新。每次挂载都从 `sandbox="allow-scripts"` 开始;只有可信宿主显式传入 `allowDownloads: true` 时才追加 `allow-downloads`。交互式 HTML 看板会开启下载。HTML 预检使用同一个挂载函数但不传入该选项,验证沙箱保持仅脚本。同源、表单和弹窗仍然拒绝。`installArtifactDocumentFramePolicy` 在专用宿主文档安装 frame-src 策略,禁止子文档自行跳转到外部 URL。需要 SDK 3.38.0 及以上,构建期钉扎在 3.38.0。
|
|
23
23
|
|
|
24
24
|
平台不依赖 `live-dashboard`、data-xpert、图表库或任何业务页面。插件可以替换渲染器与数据源,而不复制平台权限和隔离逻辑。
|
|
25
25
|
|
package/docs/index.mdx
CHANGED
|
@@ -59,3 +59,11 @@ and Microsoft Learn MCP topics (ten search snippets per topic). The viewer now
|
|
|
59
59
|
accepts canonical Definition/Artifact references instead of requiring DataSource
|
|
60
60
|
fields. Filter probes also retain sanitized Analytics diagnostics so the Agent can
|
|
61
61
|
repair a mistaken unique grain without dropping repeated document snippets.
|
|
62
|
+
|
|
63
|
+
## 资源库与模板任务(Beta)
|
|
64
|
+
|
|
65
|
+
从[新建看板](./dashboard-starter)进入[资源目录](./library-directory-ui),浏览已导入或公开的示例、分析模板、视觉主题、组件及公开数据集。资源版本和附件的存储、导入导出见[资源库与 ZIP 迁移](./library-storage),具体操作见[ZIP 导入](./library-import-ui)和[资源详情](./library-detail-ui)。
|
|
66
|
+
|
|
67
|
+
选择任务只准备对话草稿,用户发送后再由 Agent 创建独立看板。配方、重试与完成条件见[模板任务与 Agent 交接](./template-agent-handoff)及[模板实例化](./library-execution)。这套能力处于 Beta 阶段,契约可能发生破坏性调整;不自动安装业务内容,也不代表新的真实环境验收。
|
|
68
|
+
|
|
69
|
+
十个分析示例、酒店模板、合成数据、原创封面与 86 项目录占位已纳入内容作者工作流。通过独立 ZIP 显式导入;格式处于 Beta,详见[示例内容与模板目录](./content-packages)。
|