@edugate/ai-agent 0.3.0 → 0.4.0
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/dist/index.d.mts +46 -9
- package/dist/index.d.ts +46 -9
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -24156,20 +24156,30 @@ type ShapeBlockTheme = z.infer<typeof ShapeBlockThemeSchema>;
|
|
|
24156
24156
|
*/
|
|
24157
24157
|
type LogicalTarget = "title" | "answers" | "button" | "general";
|
|
24158
24158
|
/**
|
|
24159
|
-
* blockType (lowercased) → logical target → REAL key(s) it writes
|
|
24160
|
-
*
|
|
24161
|
-
*
|
|
24159
|
+
* blockType (lowercased) → logical target → REAL key(s) it writes, DERIVED from
|
|
24160
|
+
* each block's capabilities.styleTargets in the registry — the single source of
|
|
24161
|
+
* truth. `general` is mapped on every styleable block to its real wrapper key so
|
|
24162
|
+
* "set the block background" works everywhere. Only blocks that declare logical
|
|
24163
|
+
* targets appear (Embed/Arrow/Chart/Media/Puzzle are absent). Keys are lowercased
|
|
24164
|
+
* for the published string-keyed contract.
|
|
24162
24165
|
*/
|
|
24163
24166
|
declare const STYLE_TARGET_MAP: Record<string, Partial<Record<LogicalTarget, string[]>>>;
|
|
24164
24167
|
/** The real style keys a block exposes via the 4 logical targets (image of the
|
|
24165
24168
|
* map). Subset of BLOCK_STYLE_KEYS. */
|
|
24166
24169
|
declare function realStyleKeysFor(blockType: string): string[];
|
|
24167
24170
|
/**
|
|
24168
|
-
*
|
|
24169
|
-
*
|
|
24170
|
-
* `grid`/`clueText`, flashcard `navigation`).
|
|
24171
|
-
* the `update_block_style(target, …)` tool
|
|
24172
|
-
*
|
|
24171
|
+
* blockType (lowercased) → the FULL set of real sub-element style keys the
|
|
24172
|
+
* block's renderer reads — INCLUDING ones with no logical-target alias (e.g.
|
|
24173
|
+
* crossword `grid`/`clueText`, flashcard `navigation`). Addressable directly via
|
|
24174
|
+
* the `update_block_style(target, …)` tool. DERIVED from each block's
|
|
24175
|
+
* capabilities.styleKeys in the registry (the single source of truth). It is
|
|
24176
|
+
* hand-curated there, NOT scraped from theme.ts, because the theme `styles`
|
|
24177
|
+
* object also carries non-style scalars (e.g. DragAndDrop `referenceSize` =
|
|
24178
|
+
* {width,height}) that must not be advertised as style targets.
|
|
24179
|
+
*
|
|
24180
|
+
* GUARDED: registry/__tests__/registry.consistency.spec.ts fails CI if a
|
|
24181
|
+
* styleable block type's styleKeys don't cover every real key STYLE_TARGET_MAP
|
|
24182
|
+
* maps a logical target to.
|
|
24173
24183
|
*/
|
|
24174
24184
|
declare const BLOCK_STYLE_KEYS: Record<string, string[]>;
|
|
24175
24185
|
/** Block types whose renderer reads NO theme.styles — they cannot be recoloured
|
|
@@ -70329,11 +70339,30 @@ interface BlockCapabilities {
|
|
|
70329
70339
|
* styleable via logical targets (see UNSTYLEABLE_BLOCKS).
|
|
70330
70340
|
*/
|
|
70331
70341
|
styleTargets?: Partial<Record<LogicalTarget, string[]>>;
|
|
70342
|
+
/**
|
|
70343
|
+
* The FULL set of real sub-element style keys this block's renderer reads
|
|
70344
|
+
* (successor of BLOCK_STYLE_KEYS in ../style-targets.ts). Superset of every
|
|
70345
|
+
* real key styleTargets maps to — the extra keys have no logical alias but
|
|
70346
|
+
* are addressable directly via update_block_style. Hand-curated, NOT derived
|
|
70347
|
+
* from the theme schema: theme `styles` objects also carry non-style scalars
|
|
70348
|
+
* (e.g. DragAndDrop `referenceSize` = {width,height}) that must NOT be
|
|
70349
|
+
* advertised as style targets. Undefined = block exposes no style keys
|
|
70350
|
+
* (UNSTYLEABLE_BLOCKS, or a pre-existing gap like Embed/Arrow).
|
|
70351
|
+
*/
|
|
70352
|
+
styleKeys?: string[];
|
|
70332
70353
|
/** How the 360° scene renders this block; replaces the silent raster fallback switch. */
|
|
70333
70354
|
vrMode: "interactive" | "raster" | "custom";
|
|
70334
70355
|
analytics?: {
|
|
70335
70356
|
scorable: boolean;
|
|
70336
70357
|
};
|
|
70358
|
+
/**
|
|
70359
|
+
* 2D-canvas layout facts read by the Player renderer. `autoHeight` = the block
|
|
70360
|
+
* renders content-driven ("height: auto"), ignoring its stored size.height —
|
|
70361
|
+
* previously a hardcoded block-type list in Player.tsx. Undefined = false.
|
|
70362
|
+
*/
|
|
70363
|
+
layout?: {
|
|
70364
|
+
autoHeight?: boolean;
|
|
70365
|
+
};
|
|
70337
70366
|
}
|
|
70338
70367
|
interface BlockCoreDefinition<TType extends BlockType, TContent extends z.ZodTypeAny, TTheme extends z.ZodTypeAny = never> {
|
|
70339
70368
|
type: TType;
|
|
@@ -70420,6 +70449,14 @@ declare const REGISTRY_CONTENT_SCHEMAS: {
|
|
|
70420
70449
|
declare const REGISTRY_STYLE_TARGETS: {
|
|
70421
70450
|
[K in BlockType]: Partial<Record<LogicalTarget, string[]>>;
|
|
70422
70451
|
};
|
|
70452
|
+
/**
|
|
70453
|
+
* The block types whose responses carry a score (capabilities.analytics.scorable).
|
|
70454
|
+
* Single source for "which blocks produce scored analytics" — replaces inline
|
|
70455
|
+
* type lists that had drifted (the task-analytics summary once recognised only
|
|
70456
|
+
* Quiz; a client component keyed the Italian literal "Anagramma" that the wire
|
|
70457
|
+
* never emits). Canonical BlockType spellings only.
|
|
70458
|
+
*/
|
|
70459
|
+
declare const SCORABLE_BLOCK_TYPES: readonly BlockType[];
|
|
70423
70460
|
|
|
70424
70461
|
declare const CURRENT_SCHEMA_VERSION = 1;
|
|
70425
70462
|
declare class ActivityContentMigrationError extends Error {
|
|
@@ -70590,4 +70627,4 @@ declare function getBlockJsonSchema(blockType: string): Record<string, unknown>
|
|
|
70590
70627
|
*/
|
|
70591
70628
|
declare function getAllBlockJsonSchemas(): Record<string, Record<string, unknown>>;
|
|
70592
70629
|
|
|
70593
|
-
export { type AIState, type Action, type ActionBlock, ActionBlockSchema, type ActionCondition, ActionConditionSchema, ActionSchema, type ActionType, ActionTypeSchema, type ActionVariable, ActionVariableSchema, type ActivityContent, ActivityContentMigrationError, ActivityContentSchema, type ActivityContext, ActivityContextSchema, type ActivityVariable, ActivityVariableSchema, type AnagramBlock, AnagramBlockSchema, type AnagramBlockTheme, AnagramBlockThemeSchema, type Animation, AnimationSchema, type ArrowBlock, ArrowBlockSchema, type ArrowHeadType, ArrowHeadTypeSchema, type ArrowLabel, ArrowLabelSchema, BASE_BLOCK_FIELDS, BLOCK_CONTENT_SCHEMAS, BLOCK_REGISTRY, BLOCK_STYLE_KEYS, BLOCK_TYPES, type Block, type BlockCapabilities, type BlockCapabilitiesManifestEntry, type BlockCoreDefinition, type BlockEvent, BlockEventSchema, type BlockEventType, BlockEventTypeSchema, type BlockGroup, BlockGroupSchema, type BlockReferenceOptions, type BlockRegistryView, BlockSchema, type BlockTheme, BlockThemeSchema, type BlockType, BlockTypeSchema, type BoxSide, BoxSideSchema, type BoxStyles, BoxStylesSchema, CANVAS_OP_NAMES, CANVAS_OP_REQUIRED, CURRENT_SCHEMA_VERSION, type CanvasDragItem, CanvasDragItemSchema, type CanvasOp, type CanvasOpErrorCode, CanvasOpSchema, type CanvasOpValidation, type CanvasOpValidationCode, type CanvasOpValidationResult, type CardDeckBlock, CardDeckBlockSchema, type CardDeckBlockTheme, CardDeckBlockThemeSchema, type CardItem, CardItemSchema, type ChartBlock, ChartBlockSchema, type ChoiceQuestion, ChoiceQuestionSchema, type ClickCondition, ClickConditionSchema, type ClozeBlock, ClozeBlockSchema, type ClozeBlockTheme, ClozeBlockThemeSchema, type ConditionOperator, ConditionOperatorSchema, type ConflictVerdict, type CropData, CropDataSchema, type CrosswordBlock, CrosswordBlockSchema, type CrosswordBlockTheme, CrosswordBlockThemeSchema, type CrosswordCell, CrosswordCellSchema, type CrosswordLayoutOutput, CrosswordLayoutOutputSchema, type CrosswordLayoutWord, CrosswordLayoutWordSchema, type DiceBlock, DiceBlockSchema, type DiceBlockTheme, DiceBlockThemeSchema, type DiceType, DiceTypeSchema, type DragAndDropBlock, DragAndDropBlockSchema, type DragAndDropBlockTheme, DragAndDropBlockThemeSchema, type DragAndDropGroup, DragAndDropGroupSchema, DragAndDropItemSchema, type EditorBlock, EditorBlockSchema, type EditorBlockTheme, EditorBlockThemeSchema, type EmbedBlock, EmbedBlockSchema, type FlashcardBlock, FlashcardBlockSchema, type FlashcardBlockTheme, FlashcardBlockThemeSchema, FlashcardContentSchema, type FlashcardItem, FlashcardItemSchema, type GridSize, GridSizeSchema, type HotpointBlock, HotpointBlockSchema, type HotpointBlockTheme, HotpointBlockThemeSchema, ImageAlignSchema, ImageSizeSchema, type KeyPressCondition, KeyPressConditionSchema, type LogicalTarget, type MatchPairsBlock, MatchPairsBlockSchema, type MatchPairsBlockTheme, MatchPairsBlockThemeSchema, type MatchPairsPair, MatchPairsPairSchema, type MathOperation, MathOperationSchema, type MediaBlock, MediaBlockSchema, type MediaItem, MediaItemSchema, type MediaRef, MediaRefSchema, type MediaSource, MediaSourceSchema, type MediaType, MediaTypeSchema, type MemoryBlock, MemoryBlockSchema, type MemoryBlockTheme, MemoryBlockThemeSchema, type MemoryPair, MemoryPairSchema, type MentionResolution, type MigrateActivityContentResult, type MigrationRegistry, type OpTarget, type OpTargetKind, type Position, PositionSchema, type PuzzleBlock, PuzzleBlockSchema, type PuzzleGameMode, PuzzleGameModeSchema, type Question, type QuestionOption, QuestionOptionSchema, QuestionSchema, type QuestionType, QuestionTypeSchema, type QuizBlock, QuizBlockSchema, type QuizBlockTheme, QuizBlockThemeSchema, type QuizCondition, QuizConditionSchema, REGISTRY_CONTENT_SCHEMAS, REGISTRY_STYLE_TARGETS, type Radius, RadiusSchema, type ResolvedEntity, STYLE_TARGET_MAP, type Scene, type SceneBlockRef, SceneBlockRefSchema, SceneSchema, type SceneSummary, SceneSummarySchema, type SceneType, SceneTypeSchema, type ShapeBlock, ShapeBlockSchema, type ShapeBlockTheme, ShapeBlockThemeSchema, type ShapeType, ShapeTypeSchema, type Size, SizeSchema, type SpinningWheelBlock, SpinningWheelBlockSchema, type SpinningWheelBlockTheme, SpinningWheelBlockThemeSchema, type TextQuestion, TextQuestionSchema, type TextStyles, TextStylesSchema, type TimerCondition, TimerConditionSchema, type TrueFalseQuestion, TrueFalseQuestionSchema, UNSTYLEABLE_BLOCKS, type VideoSettings, VideoSettingsSchema, type WheelSlice, WheelSliceSchema, type WordSearchBlock, WordSearchBlockSchema, type WordSearchBlockTheme, WordSearchBlockThemeSchema, WordSearchDataSchema, type WordSearchDifficulty, WordSearchDifficultySchema, actionsV1toV2, applyItemPatch, createCanvasOpValidator, defineBlock, detectConflict, entitySignature, generateBlockReference, getAllBlockJsonSchemas, getBlockDefinition, getBlockJsonSchema, getCapabilitiesManifest, isKnownCanvasOp, listBlockTypes, mapLogicalThemeStyles, mergeTheme, migrateActivityContent, opConflictStamp, opTarget, parseMentions, realStyleKeysFor, resolveMentions, stableStringify, styleTargetsHelpFor, validateCanvasOp };
|
|
70630
|
+
export { type AIState, type Action, type ActionBlock, ActionBlockSchema, type ActionCondition, ActionConditionSchema, ActionSchema, type ActionType, ActionTypeSchema, type ActionVariable, ActionVariableSchema, type ActivityContent, ActivityContentMigrationError, ActivityContentSchema, type ActivityContext, ActivityContextSchema, type ActivityVariable, ActivityVariableSchema, type AnagramBlock, AnagramBlockSchema, type AnagramBlockTheme, AnagramBlockThemeSchema, type Animation, AnimationSchema, type ArrowBlock, ArrowBlockSchema, type ArrowHeadType, ArrowHeadTypeSchema, type ArrowLabel, ArrowLabelSchema, BASE_BLOCK_FIELDS, BLOCK_CONTENT_SCHEMAS, BLOCK_REGISTRY, BLOCK_STYLE_KEYS, BLOCK_TYPES, type Block, type BlockCapabilities, type BlockCapabilitiesManifestEntry, type BlockCoreDefinition, type BlockEvent, BlockEventSchema, type BlockEventType, BlockEventTypeSchema, type BlockGroup, BlockGroupSchema, type BlockReferenceOptions, type BlockRegistryView, BlockSchema, type BlockTheme, BlockThemeSchema, type BlockType, BlockTypeSchema, type BoxSide, BoxSideSchema, type BoxStyles, BoxStylesSchema, CANVAS_OP_NAMES, CANVAS_OP_REQUIRED, CURRENT_SCHEMA_VERSION, type CanvasDragItem, CanvasDragItemSchema, type CanvasOp, type CanvasOpErrorCode, CanvasOpSchema, type CanvasOpValidation, type CanvasOpValidationCode, type CanvasOpValidationResult, type CardDeckBlock, CardDeckBlockSchema, type CardDeckBlockTheme, CardDeckBlockThemeSchema, type CardItem, CardItemSchema, type ChartBlock, ChartBlockSchema, type ChoiceQuestion, ChoiceQuestionSchema, type ClickCondition, ClickConditionSchema, type ClozeBlock, ClozeBlockSchema, type ClozeBlockTheme, ClozeBlockThemeSchema, type ConditionOperator, ConditionOperatorSchema, type ConflictVerdict, type CropData, CropDataSchema, type CrosswordBlock, CrosswordBlockSchema, type CrosswordBlockTheme, CrosswordBlockThemeSchema, type CrosswordCell, CrosswordCellSchema, type CrosswordLayoutOutput, CrosswordLayoutOutputSchema, type CrosswordLayoutWord, CrosswordLayoutWordSchema, type DiceBlock, DiceBlockSchema, type DiceBlockTheme, DiceBlockThemeSchema, type DiceType, DiceTypeSchema, type DragAndDropBlock, DragAndDropBlockSchema, type DragAndDropBlockTheme, DragAndDropBlockThemeSchema, type DragAndDropGroup, DragAndDropGroupSchema, DragAndDropItemSchema, type EditorBlock, EditorBlockSchema, type EditorBlockTheme, EditorBlockThemeSchema, type EmbedBlock, EmbedBlockSchema, type FlashcardBlock, FlashcardBlockSchema, type FlashcardBlockTheme, FlashcardBlockThemeSchema, FlashcardContentSchema, type FlashcardItem, FlashcardItemSchema, type GridSize, GridSizeSchema, type HotpointBlock, HotpointBlockSchema, type HotpointBlockTheme, HotpointBlockThemeSchema, ImageAlignSchema, ImageSizeSchema, type KeyPressCondition, KeyPressConditionSchema, type LogicalTarget, type MatchPairsBlock, MatchPairsBlockSchema, type MatchPairsBlockTheme, MatchPairsBlockThemeSchema, type MatchPairsPair, MatchPairsPairSchema, type MathOperation, MathOperationSchema, type MediaBlock, MediaBlockSchema, type MediaItem, MediaItemSchema, type MediaRef, MediaRefSchema, type MediaSource, MediaSourceSchema, type MediaType, MediaTypeSchema, type MemoryBlock, MemoryBlockSchema, type MemoryBlockTheme, MemoryBlockThemeSchema, type MemoryPair, MemoryPairSchema, type MentionResolution, type MigrateActivityContentResult, type MigrationRegistry, type OpTarget, type OpTargetKind, type Position, PositionSchema, type PuzzleBlock, PuzzleBlockSchema, type PuzzleGameMode, PuzzleGameModeSchema, type Question, type QuestionOption, QuestionOptionSchema, QuestionSchema, type QuestionType, QuestionTypeSchema, type QuizBlock, QuizBlockSchema, type QuizBlockTheme, QuizBlockThemeSchema, type QuizCondition, QuizConditionSchema, REGISTRY_CONTENT_SCHEMAS, REGISTRY_STYLE_TARGETS, type Radius, RadiusSchema, type ResolvedEntity, SCORABLE_BLOCK_TYPES, STYLE_TARGET_MAP, type Scene, type SceneBlockRef, SceneBlockRefSchema, SceneSchema, type SceneSummary, SceneSummarySchema, type SceneType, SceneTypeSchema, type ShapeBlock, ShapeBlockSchema, type ShapeBlockTheme, ShapeBlockThemeSchema, type ShapeType, ShapeTypeSchema, type Size, SizeSchema, type SpinningWheelBlock, SpinningWheelBlockSchema, type SpinningWheelBlockTheme, SpinningWheelBlockThemeSchema, type TextQuestion, TextQuestionSchema, type TextStyles, TextStylesSchema, type TimerCondition, TimerConditionSchema, type TrueFalseQuestion, TrueFalseQuestionSchema, UNSTYLEABLE_BLOCKS, type VideoSettings, VideoSettingsSchema, type WheelSlice, WheelSliceSchema, type WordSearchBlock, WordSearchBlockSchema, type WordSearchBlockTheme, WordSearchBlockThemeSchema, WordSearchDataSchema, type WordSearchDifficulty, WordSearchDifficultySchema, actionsV1toV2, applyItemPatch, createCanvasOpValidator, defineBlock, detectConflict, entitySignature, generateBlockReference, getAllBlockJsonSchemas, getBlockDefinition, getBlockJsonSchema, getCapabilitiesManifest, isKnownCanvasOp, listBlockTypes, mapLogicalThemeStyles, mergeTheme, migrateActivityContent, opConflictStamp, opTarget, parseMentions, realStyleKeysFor, resolveMentions, stableStringify, styleTargetsHelpFor, validateCanvasOp };
|
package/dist/index.d.ts
CHANGED
|
@@ -24156,20 +24156,30 @@ type ShapeBlockTheme = z.infer<typeof ShapeBlockThemeSchema>;
|
|
|
24156
24156
|
*/
|
|
24157
24157
|
type LogicalTarget = "title" | "answers" | "button" | "general";
|
|
24158
24158
|
/**
|
|
24159
|
-
* blockType (lowercased) → logical target → REAL key(s) it writes
|
|
24160
|
-
*
|
|
24161
|
-
*
|
|
24159
|
+
* blockType (lowercased) → logical target → REAL key(s) it writes, DERIVED from
|
|
24160
|
+
* each block's capabilities.styleTargets in the registry — the single source of
|
|
24161
|
+
* truth. `general` is mapped on every styleable block to its real wrapper key so
|
|
24162
|
+
* "set the block background" works everywhere. Only blocks that declare logical
|
|
24163
|
+
* targets appear (Embed/Arrow/Chart/Media/Puzzle are absent). Keys are lowercased
|
|
24164
|
+
* for the published string-keyed contract.
|
|
24162
24165
|
*/
|
|
24163
24166
|
declare const STYLE_TARGET_MAP: Record<string, Partial<Record<LogicalTarget, string[]>>>;
|
|
24164
24167
|
/** The real style keys a block exposes via the 4 logical targets (image of the
|
|
24165
24168
|
* map). Subset of BLOCK_STYLE_KEYS. */
|
|
24166
24169
|
declare function realStyleKeysFor(blockType: string): string[];
|
|
24167
24170
|
/**
|
|
24168
|
-
*
|
|
24169
|
-
*
|
|
24170
|
-
* `grid`/`clueText`, flashcard `navigation`).
|
|
24171
|
-
* the `update_block_style(target, …)` tool
|
|
24172
|
-
*
|
|
24171
|
+
* blockType (lowercased) → the FULL set of real sub-element style keys the
|
|
24172
|
+
* block's renderer reads — INCLUDING ones with no logical-target alias (e.g.
|
|
24173
|
+
* crossword `grid`/`clueText`, flashcard `navigation`). Addressable directly via
|
|
24174
|
+
* the `update_block_style(target, …)` tool. DERIVED from each block's
|
|
24175
|
+
* capabilities.styleKeys in the registry (the single source of truth). It is
|
|
24176
|
+
* hand-curated there, NOT scraped from theme.ts, because the theme `styles`
|
|
24177
|
+
* object also carries non-style scalars (e.g. DragAndDrop `referenceSize` =
|
|
24178
|
+
* {width,height}) that must not be advertised as style targets.
|
|
24179
|
+
*
|
|
24180
|
+
* GUARDED: registry/__tests__/registry.consistency.spec.ts fails CI if a
|
|
24181
|
+
* styleable block type's styleKeys don't cover every real key STYLE_TARGET_MAP
|
|
24182
|
+
* maps a logical target to.
|
|
24173
24183
|
*/
|
|
24174
24184
|
declare const BLOCK_STYLE_KEYS: Record<string, string[]>;
|
|
24175
24185
|
/** Block types whose renderer reads NO theme.styles — they cannot be recoloured
|
|
@@ -70329,11 +70339,30 @@ interface BlockCapabilities {
|
|
|
70329
70339
|
* styleable via logical targets (see UNSTYLEABLE_BLOCKS).
|
|
70330
70340
|
*/
|
|
70331
70341
|
styleTargets?: Partial<Record<LogicalTarget, string[]>>;
|
|
70342
|
+
/**
|
|
70343
|
+
* The FULL set of real sub-element style keys this block's renderer reads
|
|
70344
|
+
* (successor of BLOCK_STYLE_KEYS in ../style-targets.ts). Superset of every
|
|
70345
|
+
* real key styleTargets maps to — the extra keys have no logical alias but
|
|
70346
|
+
* are addressable directly via update_block_style. Hand-curated, NOT derived
|
|
70347
|
+
* from the theme schema: theme `styles` objects also carry non-style scalars
|
|
70348
|
+
* (e.g. DragAndDrop `referenceSize` = {width,height}) that must NOT be
|
|
70349
|
+
* advertised as style targets. Undefined = block exposes no style keys
|
|
70350
|
+
* (UNSTYLEABLE_BLOCKS, or a pre-existing gap like Embed/Arrow).
|
|
70351
|
+
*/
|
|
70352
|
+
styleKeys?: string[];
|
|
70332
70353
|
/** How the 360° scene renders this block; replaces the silent raster fallback switch. */
|
|
70333
70354
|
vrMode: "interactive" | "raster" | "custom";
|
|
70334
70355
|
analytics?: {
|
|
70335
70356
|
scorable: boolean;
|
|
70336
70357
|
};
|
|
70358
|
+
/**
|
|
70359
|
+
* 2D-canvas layout facts read by the Player renderer. `autoHeight` = the block
|
|
70360
|
+
* renders content-driven ("height: auto"), ignoring its stored size.height —
|
|
70361
|
+
* previously a hardcoded block-type list in Player.tsx. Undefined = false.
|
|
70362
|
+
*/
|
|
70363
|
+
layout?: {
|
|
70364
|
+
autoHeight?: boolean;
|
|
70365
|
+
};
|
|
70337
70366
|
}
|
|
70338
70367
|
interface BlockCoreDefinition<TType extends BlockType, TContent extends z.ZodTypeAny, TTheme extends z.ZodTypeAny = never> {
|
|
70339
70368
|
type: TType;
|
|
@@ -70420,6 +70449,14 @@ declare const REGISTRY_CONTENT_SCHEMAS: {
|
|
|
70420
70449
|
declare const REGISTRY_STYLE_TARGETS: {
|
|
70421
70450
|
[K in BlockType]: Partial<Record<LogicalTarget, string[]>>;
|
|
70422
70451
|
};
|
|
70452
|
+
/**
|
|
70453
|
+
* The block types whose responses carry a score (capabilities.analytics.scorable).
|
|
70454
|
+
* Single source for "which blocks produce scored analytics" — replaces inline
|
|
70455
|
+
* type lists that had drifted (the task-analytics summary once recognised only
|
|
70456
|
+
* Quiz; a client component keyed the Italian literal "Anagramma" that the wire
|
|
70457
|
+
* never emits). Canonical BlockType spellings only.
|
|
70458
|
+
*/
|
|
70459
|
+
declare const SCORABLE_BLOCK_TYPES: readonly BlockType[];
|
|
70423
70460
|
|
|
70424
70461
|
declare const CURRENT_SCHEMA_VERSION = 1;
|
|
70425
70462
|
declare class ActivityContentMigrationError extends Error {
|
|
@@ -70590,4 +70627,4 @@ declare function getBlockJsonSchema(blockType: string): Record<string, unknown>
|
|
|
70590
70627
|
*/
|
|
70591
70628
|
declare function getAllBlockJsonSchemas(): Record<string, Record<string, unknown>>;
|
|
70592
70629
|
|
|
70593
|
-
export { type AIState, type Action, type ActionBlock, ActionBlockSchema, type ActionCondition, ActionConditionSchema, ActionSchema, type ActionType, ActionTypeSchema, type ActionVariable, ActionVariableSchema, type ActivityContent, ActivityContentMigrationError, ActivityContentSchema, type ActivityContext, ActivityContextSchema, type ActivityVariable, ActivityVariableSchema, type AnagramBlock, AnagramBlockSchema, type AnagramBlockTheme, AnagramBlockThemeSchema, type Animation, AnimationSchema, type ArrowBlock, ArrowBlockSchema, type ArrowHeadType, ArrowHeadTypeSchema, type ArrowLabel, ArrowLabelSchema, BASE_BLOCK_FIELDS, BLOCK_CONTENT_SCHEMAS, BLOCK_REGISTRY, BLOCK_STYLE_KEYS, BLOCK_TYPES, type Block, type BlockCapabilities, type BlockCapabilitiesManifestEntry, type BlockCoreDefinition, type BlockEvent, BlockEventSchema, type BlockEventType, BlockEventTypeSchema, type BlockGroup, BlockGroupSchema, type BlockReferenceOptions, type BlockRegistryView, BlockSchema, type BlockTheme, BlockThemeSchema, type BlockType, BlockTypeSchema, type BoxSide, BoxSideSchema, type BoxStyles, BoxStylesSchema, CANVAS_OP_NAMES, CANVAS_OP_REQUIRED, CURRENT_SCHEMA_VERSION, type CanvasDragItem, CanvasDragItemSchema, type CanvasOp, type CanvasOpErrorCode, CanvasOpSchema, type CanvasOpValidation, type CanvasOpValidationCode, type CanvasOpValidationResult, type CardDeckBlock, CardDeckBlockSchema, type CardDeckBlockTheme, CardDeckBlockThemeSchema, type CardItem, CardItemSchema, type ChartBlock, ChartBlockSchema, type ChoiceQuestion, ChoiceQuestionSchema, type ClickCondition, ClickConditionSchema, type ClozeBlock, ClozeBlockSchema, type ClozeBlockTheme, ClozeBlockThemeSchema, type ConditionOperator, ConditionOperatorSchema, type ConflictVerdict, type CropData, CropDataSchema, type CrosswordBlock, CrosswordBlockSchema, type CrosswordBlockTheme, CrosswordBlockThemeSchema, type CrosswordCell, CrosswordCellSchema, type CrosswordLayoutOutput, CrosswordLayoutOutputSchema, type CrosswordLayoutWord, CrosswordLayoutWordSchema, type DiceBlock, DiceBlockSchema, type DiceBlockTheme, DiceBlockThemeSchema, type DiceType, DiceTypeSchema, type DragAndDropBlock, DragAndDropBlockSchema, type DragAndDropBlockTheme, DragAndDropBlockThemeSchema, type DragAndDropGroup, DragAndDropGroupSchema, DragAndDropItemSchema, type EditorBlock, EditorBlockSchema, type EditorBlockTheme, EditorBlockThemeSchema, type EmbedBlock, EmbedBlockSchema, type FlashcardBlock, FlashcardBlockSchema, type FlashcardBlockTheme, FlashcardBlockThemeSchema, FlashcardContentSchema, type FlashcardItem, FlashcardItemSchema, type GridSize, GridSizeSchema, type HotpointBlock, HotpointBlockSchema, type HotpointBlockTheme, HotpointBlockThemeSchema, ImageAlignSchema, ImageSizeSchema, type KeyPressCondition, KeyPressConditionSchema, type LogicalTarget, type MatchPairsBlock, MatchPairsBlockSchema, type MatchPairsBlockTheme, MatchPairsBlockThemeSchema, type MatchPairsPair, MatchPairsPairSchema, type MathOperation, MathOperationSchema, type MediaBlock, MediaBlockSchema, type MediaItem, MediaItemSchema, type MediaRef, MediaRefSchema, type MediaSource, MediaSourceSchema, type MediaType, MediaTypeSchema, type MemoryBlock, MemoryBlockSchema, type MemoryBlockTheme, MemoryBlockThemeSchema, type MemoryPair, MemoryPairSchema, type MentionResolution, type MigrateActivityContentResult, type MigrationRegistry, type OpTarget, type OpTargetKind, type Position, PositionSchema, type PuzzleBlock, PuzzleBlockSchema, type PuzzleGameMode, PuzzleGameModeSchema, type Question, type QuestionOption, QuestionOptionSchema, QuestionSchema, type QuestionType, QuestionTypeSchema, type QuizBlock, QuizBlockSchema, type QuizBlockTheme, QuizBlockThemeSchema, type QuizCondition, QuizConditionSchema, REGISTRY_CONTENT_SCHEMAS, REGISTRY_STYLE_TARGETS, type Radius, RadiusSchema, type ResolvedEntity, STYLE_TARGET_MAP, type Scene, type SceneBlockRef, SceneBlockRefSchema, SceneSchema, type SceneSummary, SceneSummarySchema, type SceneType, SceneTypeSchema, type ShapeBlock, ShapeBlockSchema, type ShapeBlockTheme, ShapeBlockThemeSchema, type ShapeType, ShapeTypeSchema, type Size, SizeSchema, type SpinningWheelBlock, SpinningWheelBlockSchema, type SpinningWheelBlockTheme, SpinningWheelBlockThemeSchema, type TextQuestion, TextQuestionSchema, type TextStyles, TextStylesSchema, type TimerCondition, TimerConditionSchema, type TrueFalseQuestion, TrueFalseQuestionSchema, UNSTYLEABLE_BLOCKS, type VideoSettings, VideoSettingsSchema, type WheelSlice, WheelSliceSchema, type WordSearchBlock, WordSearchBlockSchema, type WordSearchBlockTheme, WordSearchBlockThemeSchema, WordSearchDataSchema, type WordSearchDifficulty, WordSearchDifficultySchema, actionsV1toV2, applyItemPatch, createCanvasOpValidator, defineBlock, detectConflict, entitySignature, generateBlockReference, getAllBlockJsonSchemas, getBlockDefinition, getBlockJsonSchema, getCapabilitiesManifest, isKnownCanvasOp, listBlockTypes, mapLogicalThemeStyles, mergeTheme, migrateActivityContent, opConflictStamp, opTarget, parseMentions, realStyleKeysFor, resolveMentions, stableStringify, styleTargetsHelpFor, validateCanvasOp };
|
|
70630
|
+
export { type AIState, type Action, type ActionBlock, ActionBlockSchema, type ActionCondition, ActionConditionSchema, ActionSchema, type ActionType, ActionTypeSchema, type ActionVariable, ActionVariableSchema, type ActivityContent, ActivityContentMigrationError, ActivityContentSchema, type ActivityContext, ActivityContextSchema, type ActivityVariable, ActivityVariableSchema, type AnagramBlock, AnagramBlockSchema, type AnagramBlockTheme, AnagramBlockThemeSchema, type Animation, AnimationSchema, type ArrowBlock, ArrowBlockSchema, type ArrowHeadType, ArrowHeadTypeSchema, type ArrowLabel, ArrowLabelSchema, BASE_BLOCK_FIELDS, BLOCK_CONTENT_SCHEMAS, BLOCK_REGISTRY, BLOCK_STYLE_KEYS, BLOCK_TYPES, type Block, type BlockCapabilities, type BlockCapabilitiesManifestEntry, type BlockCoreDefinition, type BlockEvent, BlockEventSchema, type BlockEventType, BlockEventTypeSchema, type BlockGroup, BlockGroupSchema, type BlockReferenceOptions, type BlockRegistryView, BlockSchema, type BlockTheme, BlockThemeSchema, type BlockType, BlockTypeSchema, type BoxSide, BoxSideSchema, type BoxStyles, BoxStylesSchema, CANVAS_OP_NAMES, CANVAS_OP_REQUIRED, CURRENT_SCHEMA_VERSION, type CanvasDragItem, CanvasDragItemSchema, type CanvasOp, type CanvasOpErrorCode, CanvasOpSchema, type CanvasOpValidation, type CanvasOpValidationCode, type CanvasOpValidationResult, type CardDeckBlock, CardDeckBlockSchema, type CardDeckBlockTheme, CardDeckBlockThemeSchema, type CardItem, CardItemSchema, type ChartBlock, ChartBlockSchema, type ChoiceQuestion, ChoiceQuestionSchema, type ClickCondition, ClickConditionSchema, type ClozeBlock, ClozeBlockSchema, type ClozeBlockTheme, ClozeBlockThemeSchema, type ConditionOperator, ConditionOperatorSchema, type ConflictVerdict, type CropData, CropDataSchema, type CrosswordBlock, CrosswordBlockSchema, type CrosswordBlockTheme, CrosswordBlockThemeSchema, type CrosswordCell, CrosswordCellSchema, type CrosswordLayoutOutput, CrosswordLayoutOutputSchema, type CrosswordLayoutWord, CrosswordLayoutWordSchema, type DiceBlock, DiceBlockSchema, type DiceBlockTheme, DiceBlockThemeSchema, type DiceType, DiceTypeSchema, type DragAndDropBlock, DragAndDropBlockSchema, type DragAndDropBlockTheme, DragAndDropBlockThemeSchema, type DragAndDropGroup, DragAndDropGroupSchema, DragAndDropItemSchema, type EditorBlock, EditorBlockSchema, type EditorBlockTheme, EditorBlockThemeSchema, type EmbedBlock, EmbedBlockSchema, type FlashcardBlock, FlashcardBlockSchema, type FlashcardBlockTheme, FlashcardBlockThemeSchema, FlashcardContentSchema, type FlashcardItem, FlashcardItemSchema, type GridSize, GridSizeSchema, type HotpointBlock, HotpointBlockSchema, type HotpointBlockTheme, HotpointBlockThemeSchema, ImageAlignSchema, ImageSizeSchema, type KeyPressCondition, KeyPressConditionSchema, type LogicalTarget, type MatchPairsBlock, MatchPairsBlockSchema, type MatchPairsBlockTheme, MatchPairsBlockThemeSchema, type MatchPairsPair, MatchPairsPairSchema, type MathOperation, MathOperationSchema, type MediaBlock, MediaBlockSchema, type MediaItem, MediaItemSchema, type MediaRef, MediaRefSchema, type MediaSource, MediaSourceSchema, type MediaType, MediaTypeSchema, type MemoryBlock, MemoryBlockSchema, type MemoryBlockTheme, MemoryBlockThemeSchema, type MemoryPair, MemoryPairSchema, type MentionResolution, type MigrateActivityContentResult, type MigrationRegistry, type OpTarget, type OpTargetKind, type Position, PositionSchema, type PuzzleBlock, PuzzleBlockSchema, type PuzzleGameMode, PuzzleGameModeSchema, type Question, type QuestionOption, QuestionOptionSchema, QuestionSchema, type QuestionType, QuestionTypeSchema, type QuizBlock, QuizBlockSchema, type QuizBlockTheme, QuizBlockThemeSchema, type QuizCondition, QuizConditionSchema, REGISTRY_CONTENT_SCHEMAS, REGISTRY_STYLE_TARGETS, type Radius, RadiusSchema, type ResolvedEntity, SCORABLE_BLOCK_TYPES, STYLE_TARGET_MAP, type Scene, type SceneBlockRef, SceneBlockRefSchema, SceneSchema, type SceneSummary, SceneSummarySchema, type SceneType, SceneTypeSchema, type ShapeBlock, ShapeBlockSchema, type ShapeBlockTheme, ShapeBlockThemeSchema, type ShapeType, ShapeTypeSchema, type Size, SizeSchema, type SpinningWheelBlock, SpinningWheelBlockSchema, type SpinningWheelBlockTheme, SpinningWheelBlockThemeSchema, type TextQuestion, TextQuestionSchema, type TextStyles, TextStylesSchema, type TimerCondition, TimerConditionSchema, type TrueFalseQuestion, TrueFalseQuestionSchema, UNSTYLEABLE_BLOCKS, type VideoSettings, VideoSettingsSchema, type WheelSlice, WheelSliceSchema, type WordSearchBlock, WordSearchBlockSchema, type WordSearchBlockTheme, WordSearchBlockThemeSchema, WordSearchDataSchema, type WordSearchDifficulty, WordSearchDifficultySchema, actionsV1toV2, applyItemPatch, createCanvasOpValidator, defineBlock, detectConflict, entitySignature, generateBlockReference, getAllBlockJsonSchemas, getBlockDefinition, getBlockJsonSchema, getCapabilitiesManifest, isKnownCanvasOp, listBlockTypes, mapLogicalThemeStyles, mergeTheme, migrateActivityContent, opConflictStamp, opTarget, parseMentions, realStyleKeysFor, resolveMentions, stableStringify, styleTargetsHelpFor, validateCanvasOp };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var Po=Object.create;var Me=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Lo=Object.getOwnPropertyNames;var Ro=Object.getPrototypeOf,No=Object.prototype.hasOwnProperty;var Wo=(o,i)=>{for(var n in i)Me(o,n,{get:i[n],enumerable:!0})},Lt=(o,i,n,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of Lo(i))!No.call(o,a)&&a!==n&&Me(o,a,{get:()=>i[a],enumerable:!(c=_o(i,a))||c.enumerable});return o};var Fo=(o,i,n)=>(n=o!=null?Po(Ro(o)):{},Lt(i||!o||!o.__esModule?Me(n,"default",{value:o,enumerable:!0}):n,o)),Qo=o=>Lt(Me({},"__esModule",{value:!0}),o);var Cr={};Wo(Cr,{ActionBlockSchema:()=>eo,ActionConditionSchema:()=>Ne,ActionSchema:()=>Fe,ActionTypeSchema:()=>lt,ActionVariableSchema:()=>pt,ActivityContentMigrationError:()=>Ie,ActivityContentSchema:()=>to,ActivityContextSchema:()=>ro,ActivityVariableSchema:()=>Zt,AnagramBlockSchema:()=>be,AnagramBlockThemeSchema:()=>_,AnimationSchema:()=>rt,ArrowBlockSchema:()=>De,ArrowHeadTypeSchema:()=>He,ArrowLabelSchema:()=>Ct,BASE_BLOCK_FIELDS:()=>Ge,BLOCK_CONTENT_SCHEMAS:()=>Z,BLOCK_REGISTRY:()=>A,BLOCK_STYLE_KEYS:()=>it,BLOCK_TYPES:()=>I,BlockEventSchema:()=>Ut,BlockEventTypeSchema:()=>We,BlockGroupSchema:()=>At,BlockSchema:()=>$e,BlockThemeSchema:()=>B,BlockTypeSchema:()=>Pe,BoxSideSchema:()=>Le,BoxStylesSchema:()=>d,CANVAS_OP_NAMES:()=>Ko,CANVAS_OP_REQUIRED:()=>Ee,CURRENT_SCHEMA_VERSION:()=>Ye,CanvasDragItemSchema:()=>oo,CanvasOpSchema:()=>Xe,CardDeckBlockSchema:()=>ze,CardDeckBlockThemeSchema:()=>K,CardItemSchema:()=>le,ChartBlockSchema:()=>Te,ChoiceQuestionSchema:()=>ht,ClickConditionSchema:()=>Yt,ClozeBlockSchema:()=>we,ClozeBlockThemeSchema:()=>Q,ConditionOperatorSchema:()=>ct,CropDataSchema:()=>tt,CrosswordBlockSchema:()=>Y,CrosswordBlockThemeSchema:()=>R,CrosswordCellSchema:()=>St,CrosswordLayoutOutputSchema:()=>xt,CrosswordLayoutWordSchema:()=>kt,DiceBlockSchema:()=>ge,DiceBlockThemeSchema:()=>L,DiceTypeSchema:()=>gt,DragAndDropBlockSchema:()=>ye,DragAndDropBlockThemeSchema:()=>O,DragAndDropGroupSchema:()=>ie,DragAndDropItemSchema:()=>bt,EditorBlockSchema:()=>he,EditorBlockThemeSchema:()=>P,EmbedBlockSchema:()=>fe,FlashcardBlockSchema:()=>xe,FlashcardBlockThemeSchema:()=>V,FlashcardContentSchema:()=>Ve,FlashcardItemSchema:()=>se,GridSizeSchema:()=>oe,HotpointBlockSchema:()=>de,HotpointBlockThemeSchema:()=>M,ImageAlignSchema:()=>Qe,ImageSizeSchema:()=>Ke,KeyPressConditionSchema:()=>Jt,MatchPairsBlockSchema:()=>Ce,MatchPairsBlockThemeSchema:()=>H,MatchPairsPairSchema:()=>pe,MathOperationSchema:()=>st,MediaBlockSchema:()=>ue,MediaItemSchema:()=>S,MediaRefSchema:()=>Kt,MediaSourceSchema:()=>et,MediaTypeSchema:()=>re,MemoryBlockSchema:()=>ke,MemoryBlockThemeSchema:()=>W,MemoryPairSchema:()=>ae,PositionSchema:()=>_e,PuzzleBlockSchema:()=>Se,PuzzleGameModeSchema:()=>wt,QuestionOptionSchema:()=>mt,QuestionSchema:()=>$,QuestionTypeSchema:()=>Xt,QuizBlockSchema:()=>me,QuizBlockThemeSchema:()=>E,QuizConditionSchema:()=>$t,REGISTRY_CONTENT_SCHEMAS:()=>qe,REGISTRY_STYLE_TARGETS:()=>zo,RadiusSchema:()=>nt,STYLE_TARGET_MAP:()=>ne,SceneBlockRefSchema:()=>It,SceneSchema:()=>Dt,SceneSummarySchema:()=>jt,SceneTypeSchema:()=>yt,ShapeBlockSchema:()=>Ae,ShapeBlockThemeSchema:()=>G,ShapeTypeSchema:()=>Tt,SizeSchema:()=>v,SpinningWheelBlockSchema:()=>Be,SpinningWheelBlockThemeSchema:()=>F,TextQuestionSchema:()=>ft,TextStylesSchema:()=>b,TimerConditionSchema:()=>qt,TrueFalseQuestionSchema:()=>ut,UNSTYLEABLE_BLOCKS:()=>at,VideoSettingsSchema:()=>ot,WheelSliceSchema:()=>ce,WordSearchBlockSchema:()=>J,WordSearchBlockThemeSchema:()=>N,WordSearchDataSchema:()=>Bt,WordSearchDifficultySchema:()=>zt,actionsV1toV2:()=>vo,applyItemPatch:()=>Ho,createCanvasOpValidator:()=>mr,defineBlock:()=>k,detectConflict:()=>ur,entitySignature:()=>Ft,generateBlockReference:()=>Do,getAllBlockJsonSchemas:()=>Tr,getBlockDefinition:()=>wo,getBlockJsonSchema:()=>Oo,getCapabilitiesManifest:()=>kr,isKnownCanvasOp:()=>Rt,listBlockTypes:()=>Eo,mapLogicalThemeStyles:()=>Re,mergeTheme:()=>Gt,migrateActivityContent:()=>jo,opConflictStamp:()=>fr,opTarget:()=>Wt,parseMentions:()=>xr,realStyleKeysFor:()=>Vt,resolveMentions:()=>Br,stableStringify:()=>te,styleTargetsHelpFor:()=>Ht,validateCanvasOp:()=>Vo});module.exports=Qo(Cr);var Ee={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},Ko=Object.keys(Ee);function Rt(o){return Object.prototype.hasOwnProperty.call(Ee,o)}function Vo(o,i){if(!Rt(o))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${o}"`]};if(typeof i!="object"||i===null||Array.isArray(i))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=i,c=Ee[o].filter(a=>n[a]===void 0||n[a]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(a=>`missing field: ${a}`)}:o==="groupBlocks"&&(!Array.isArray(n.blockIds)||n.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function Ho(o,i,n){let c=Array.isArray(o)?[...o]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let a=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(a,c.length)),0,n.item),c}return i==="updateItem"?c.map(a=>a&&typeof a=="object"&&a.id===n.itemId?{...a,...n.item??{}}:a):c.filter(a=>!(a&&typeof a=="object"&&a.id===n.itemId))}var r=require("zod"),j=()=>r.z.record(r.z.string(),r.z.unknown()),Go=r.z.object({scene:j().optional(),newIndex:r.z.number().optional()}).passthrough(),$o=r.z.object({sceneId:r.z.string()}),qo=r.z.object({sceneId:r.z.string(),block:j()}),Yo=r.z.object({sceneId:r.z.string(),updates:j().optional(),newIndex:r.z.number().optional()}),Jo=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),Zo=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),updates:j()}),Uo=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),Xo=r.z.object({blockIds:r.z.array(r.z.string())}),er=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),theme:j()}),tr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),elementId:r.z.string(),customStyle:j()}),or=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),action:j()}),rr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),actionId:r.z.string()}),nr=r.z.object({operation:r.z.string(),name:r.z.string(),defaultValue:r.z.unknown().optional()}).passthrough(),ir=r.z.object({scope:r.z.string().optional(),sceneId:r.z.string().optional(),blockId:r.z.string().optional(),hasTimer:r.z.boolean().optional(),timer:r.z.unknown().optional()}).passthrough(),ar=r.z.object({sceneId:r.z.string(),newIndex:r.z.number()}),cr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),item:r.z.unknown(),at:r.z.number().optional()}),sr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string(),item:r.z.unknown()}),lr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string()}),pr=r.z.object({activity:r.z.unknown()}),Xe=r.z.discriminatedUnion("action",[r.z.object({action:r.z.literal("createScene"),data:Go}),r.z.object({action:r.z.literal("deleteScene"),data:$o}),r.z.object({action:r.z.literal("addBlock"),data:qo}),r.z.object({action:r.z.literal("updateScene"),data:Yo}),r.z.object({action:r.z.literal("deleteBlock"),data:Jo}),r.z.object({action:r.z.literal("updateBlock"),data:Zo}),r.z.object({action:r.z.literal("duplicateBlock"),data:Uo}),r.z.object({action:r.z.literal("groupBlocks"),data:Xo}),r.z.object({action:r.z.literal("updateBlockTheme"),data:er}),r.z.object({action:r.z.literal("updateBlockElementStyle"),data:tr}),r.z.object({action:r.z.literal("addAction"),data:or}),r.z.object({action:r.z.literal("removeAction"),data:rr}),r.z.object({action:r.z.literal("manageVariables"),data:nr}),r.z.object({action:r.z.literal("configureTimer"),data:ir}),r.z.object({action:r.z.literal("reorderScenes"),data:ar}),r.z.object({action:r.z.literal("insertItem"),data:cr}),r.z.object({action:r.z.literal("updateItem"),data:sr}),r.z.object({action:r.z.literal("deleteItem"),data:lr}),r.z.object({action:r.z.literal("replaceActivity"),data:pr})]);var Nt=require("zod");function Oe(o){return o.issues.map(i=>{let n=i.path.join(".");return n?`${n}: ${i.message}`:i.message})}function mr(o,i){return n=>{let c=Xe.safeParse(n);if(!c.success)return{ok:!1,code:"SHAPE_INVALID",errors:Oe(c.error)};let{action:a,data:l}=c.data;if(a==="addBlock"){let s=l.block,h=typeof s.type=="string"?s.type:void 0,u=h?o.getContentSchema(h):void 0;if(!h||!u)return{ok:!1,code:"UNKNOWN_BLOCK_TYPE",errors:[`addBlock: unknown block type "${String(s.type)}"`]};let f=u.safeParse(s);return f.success?{ok:!0}:{ok:!1,code:"CONTENT_INVALID",errors:Oe(f.error)}}if(a==="insertItem"||a==="updateItem"||a==="deleteItem"){let s=i?.(l.blockId);if(!s)return{ok:!0};let h=o.getCollectionSchema(s,l.collection);if(!h)return{ok:!1,code:"UNKNOWN_COLLECTION",errors:[`unknown collection "${l.collection}" for block type "${s}"`]};if(a==="insertItem"||a==="updateItem"){let u=h.safeParse(l.item);if(!u.success)return{ok:!1,code:"ITEM_INVALID",errors:Oe(u.error)}}return{ok:!0}}if(a==="updateBlock"){let s=i?.(l.blockId),h=s?o.getContentSchema(s):void 0;if(!h)return{ok:!0};if(h instanceof Nt.z.ZodObject){let f=h.deepPartial().safeParse(l.updates);if(!f.success)return{ok:!1,code:"CONTENT_INVALID",errors:Oe(f.error)}}return{ok:!0}}return{ok:!0}}}var dr=new Set(["position","size","rotation","zIndex","z"]);function te(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?"["+o.map(te).join(",")+"]":"{"+Object.keys(o).sort().map(n=>JSON.stringify(n)+":"+te(o[n])).join(",")+"}"}function Wt(o,i){let n=i??{};switch(o){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return n.blockId?{kind:"block",blockId:n.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return n.blockId&&n.collection&&n.itemId?{kind:"item",blockId:n.blockId,collection:n.collection,itemId:n.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function hr(o,i){if(Array.isArray(o))for(let n of o){let c=n?.blocks?.find?.(a=>a&&a.id===i);if(c)return c}}function Ft(o,i){if(i.kind==="untracked")return null;let n=i.blockId?hr(o,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let l={};for(let s of Object.keys(n))dr.has(s)||(l[s]=n[s]);return te(l)}let c=n[i.collection];if(!Array.isArray(c))return null;let a=c.find(l=>l&&l.id===i.itemId);return a?te(a):null}function ur(o,i){return o==null?"apply":i==null?"missing":o===i?"apply":"stale"}function fr(o,i,n){let c=Wt(o,i);return{target:c,baseSignature:Ft(n,c)}}var Qt=require("zod"),I=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],Pe=Qt.z.enum(I);var m=require("zod"),_e=m.z.object({x:m.z.number(),y:m.z.number(),z:m.z.number().optional()}),v=m.z.object({width:m.z.number().optional(),height:m.z.number().optional()}),oe=m.z.object({rows:m.z.number(),cols:m.z.number()}),re=m.z.enum(["image","color","gif","shape","illustration","video","audio"]),et=m.z.enum(["unsplash","pexels","upload","url","library","tenor"]),tt=m.z.object({x:m.z.number(),y:m.z.number(),width:m.z.number(),height:m.z.number(),zoom:m.z.number().optional(),rotation:m.z.number().optional(),aspect:m.z.number().optional()}),ot=m.z.object({autoplay:m.z.boolean().optional(),loop:m.z.boolean().optional(),muted:m.z.boolean().optional(),controls:m.z.boolean().optional(),poster:m.z.string().optional(),volume:m.z.number().optional()}),S=m.z.object({id:m.z.string().optional(),url:m.z.string().optional(),title:m.z.string().optional(),type:re.describe("Media type (image, color, gif, shape, illustration, video, audio)."),source:et.optional(),alt:m.z.string().optional(),width:m.z.number().optional(),height:m.z.number().optional(),format:m.z.enum(["cover","contain"]).optional(),color:m.z.string().optional(),cropData:tt.optional(),duration:m.z.number().optional(),videoSettings:ot.optional()}),Kt=S;var t=require("zod");var rt=t.z.object({type:t.z.union([t.z.enum(["none","fade","direction","bounce","scale","rotate"]),t.z.string()]),duration:t.z.number().optional(),delay:t.z.number().optional(),phase:t.z.enum(["in","both","out"]).optional(),direction:t.z.enum(["up","right","down","left"]).optional()}),Le=t.z.object({top:t.z.union([t.z.string(),t.z.number()]).optional(),right:t.z.union([t.z.string(),t.z.number()]).optional(),bottom:t.z.union([t.z.string(),t.z.number()]).optional(),left:t.z.union([t.z.string(),t.z.number()]).optional()}),nt=t.z.object({topLeft:t.z.union([t.z.string(),t.z.number()]).optional(),topRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomLeft:t.z.union([t.z.string(),t.z.number()]).optional()}),d=t.z.object({background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),backgroundOpacity:t.z.number().optional(),backgroundMedia:S.optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:Le.optional(),borderRadius:nt.optional(),padding:t.z.union([t.z.string(),t.z.number(),Le]).optional()}),b=t.z.object({color:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),fontWeight:t.z.union([t.z.string(),t.z.number()]).optional(),textAlign:t.z.enum(["left","center","right","justify"]).optional()}),z=d.merge(b),B=t.z.object({spacing:t.z.enum(["no-spacing","small","medium","large"]).optional(),animation:rt.optional(),styles:t.z.record(t.z.record(t.z.any())).optional()}),M=B.extend({styles:t.z.object({hotpoint:t.z.object({icon:t.z.string().optional(),iconPosition:t.z.enum(["left","right"]).optional(),iconSize:t.z.string().optional(),iconColor:t.z.string().optional(),image:S.optional(),imageFormat:t.z.enum(["circle","square","custom"]).optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:t.z.string().optional(),borderRadius:t.z.string().optional(),glow:t.z.boolean().optional(),glowColor:t.z.string().optional(),background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),textColor:t.z.string().optional()}).optional()}).optional()}),E=B.extend({layout:t.z.enum(["horizontal","vertical","grid"]),gridColumns:t.z.number().optional(),preset:t.z.enum(["default","modern","trivia","custom"]),styles:t.z.object({general:z,question:z,answers:z.extend({customStyles:t.z.array(t.z.object({color:t.z.string().optional(),backgroundColor:t.z.string().optional(),targets:t.z.string().optional()})).optional(),hover:z.optional()}),button:z.extend({variant:t.z.enum(["default","outline","ghost"]).optional(),hover:z.optional()})}).optional()}),O=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),gridColumns:t.z.number().optional(),gridGap:t.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:t.z.object({x:t.z.number().optional(),y:t.z.number().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:t.z.object({title:b.optional(),sandbox:d.optional(),item:z.optional(),group:d.optional(),container:d.extend({url:t.z.string().optional(),type:re.optional()}).optional(),groups:z.optional(),feedback:t.z.object({correct:t.z.string().optional(),incorrect:t.z.string().optional(),active:t.z.string().optional()}).optional(),referenceSize:t.z.object({width:t.z.number(),height:t.z.number()}).optional()}).optional()}),P=B.extend({styles:t.z.object({editor:d.optional()}).optional()}),_=B.extend({styles:t.z.object({letter:d.optional(),letterText:b.optional(),slot:d.optional(),container:d.optional()}).optional()}),L=B.extend({styles:t.z.object({button:d.extend({hover:z.optional()}).optional(),buttonText:b.optional(),container:d.optional()}).optional()}),R=B.extend({primaryColor:t.z.string().optional(),layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({text:b.optional(),cell:d.optional(),grid:d.optional(),clueContainer:d.optional(),clueText:b.optional(),clueTitle:b.optional()}).optional()}),N=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({wordSearch:t.z.object({primaryColor:t.z.string().optional(),highlightColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),textColor:t.z.string().optional(),cellBackgroundColor:t.z.string().optional()}).optional(),text:b.optional(),cell:d.optional(),grid:d.optional(),wordListContainer:d.optional(),wordListText:b.optional(),wordListTitle:b.optional()}).optional()}),W=B.extend({styles:t.z.object({text:b.optional(),container:d.optional(),infoContainer:d.optional(),infoText:b.optional(),card:d.optional()}).optional()}),F=B.extend({styles:t.z.object({wheelText:b.optional()}).optional()}),Q=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:b.optional(),container:d.optional(),wordBank:d.optional(),word:d.optional(),blank:d.optional()}).optional()}),K=B.extend({styles:t.z.object({card:d.optional(),cardText:b.optional(),container:d.optional()}).optional()}),V=B.extend({styles:t.z.object({cardFront:d.optional(),cardBack:d.optional(),frontText:b.optional(),backText:b.optional(),navigation:d.optional(),navigationText:b.optional()}).optional()}),H=B.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:b.optional(),card:d.optional(),container:d.optional()}).optional()}),G=B.extend({styles:t.z.object({shape:z.extend({fillColor:t.z.string().optional(),textColor:t.z.string().optional(),borderStyle:t.z.enum(["solid","dashed","dotted"]).optional(),padding:t.z.number().optional()}).optional()}).optional()});var ne={quiz:{title:["question"],answers:["answers"],button:["button"],general:["general"]},poll:{title:["question"],answers:["answers"],button:["button"],general:["general"]},flashcard:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},memory:{title:["text"],answers:["card"],general:["container"]},matchpairs:{title:["text"],answers:["card"],general:["container"]},cloze:{title:["text"],answers:["word","blank"],general:["container"]},carddeck:{title:["cardText"],answers:["card"],general:["container"]},anagram:{title:["letterText"],answers:["letter","slot"],general:["container"]},dice:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},crossword:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},wordsearch:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},spinningwheel:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},shape:{title:["shape"],answers:["shape"],general:["shape"]},hotpoint:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},editor:{title:["editor"],answers:["editor"],general:["editor"]},draganddrop:{title:["title"],answers:["item"],general:["container"]}};function Vt(o){let i=ne[o.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let a of c??[])n.add(a);return[...n]}var it={quiz:["general","question","answers","button"],poll:["general","question","answers","button"],flashcard:["cardFront","cardBack","frontText","backText","navigation","navigationText"],memory:["container","card","text","infoContainer","infoText"],matchpairs:["container","card","text"],cloze:["container","text","wordBank","word","blank"],carddeck:["container","card","cardText"],anagram:["container","letter","letterText","slot"],dice:["container","button","buttonText"],crossword:["grid","cell","text","clueContainer","clueTitle","clueText"],wordsearch:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],spinningwheel:["wheelText"],shape:["shape"],editor:["editor"],hotpoint:["hotpoint"],draganddrop:["container","title","sandbox","groups","item","group"]},at=new Set(["chart","media","image","puzzle"]);function Ht(o){if(!o)return"";let i=o.toLowerCase();if(at.has(i))return`
|
|
2
|
-
[STYLE TARGETS] Il blocco "${o}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let
|
|
3
|
-
[STYLE TARGETS for ${o}] Logical targets (update_block_theme): ${a}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function Re(o,i){if(!o)return o;let n={...o};for(let[h,u]of Object.entries(n))if(u&&typeof u=="object"){let f={...u},y=!1;f.backgroundColor!==void 0&&f.background===void 0&&(f.background=!0,y=!0),f.borderColor!==void 0&&f.border===void 0&&(f.border=!0,y=!0),y&&(n[h]=f)}if(!i)return n;let c=ne[i.toLowerCase()];if(!c)return n;let a=(h,u)=>{u&&(n[h]={...n[h]||{},...u})},l=["title","answers","button","general"],s={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let h of l){let u=s[h],f=c[h];if(u&&f)for(let y of f)a(y,u)}return n}function Gt(o,i,n){if(!o){let s={...i};return s.styles&&(s.styles=Re(s.styles,n)),s}if(!i)return o;let c={...o,...i},a=Re(i.styles,n),l=o.styles||{};if(o.styles||a){c.styles={...l,...a};for(let s of Object.keys(c.styles))l[s]&&a?.[s]&&(c.styles[s]={...l[s],...a[s]})}return c}var p=require("zod"),We=p.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),ct=p.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),$t=p.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),qt=p.z.enum(["completed","half_way"]),Yt=p.z.enum(["single_click","double_click"]),Jt=p.z.literal("key_pressed"),Ne=p.z.object({event:We.optional(),variableName:p.z.string().optional(),operator:ct.optional(),value:p.z.any()}),st=p.z.enum(["set","add","subtract","multiply","divide"]),lt=p.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),pt=p.z.object({name:p.z.string(),value:p.z.union([p.z.number(),p.z.string(),p.z.boolean()]),operation:st.optional()}),Fe=p.z.object({id:p.z.string(),type:lt,condition:Ne.optional(),conditions:p.z.array(Ne).optional(),conditionsOperator:p.z.enum(["and","or"]).optional(),modalContent:p.z.string().optional(),audioUrl:p.z.string().optional(),linkUrl:p.z.string().optional(),targetSceneId:p.z.string().optional(),targetBlockId:p.z.string().optional(),direction:p.z.enum(["up","down","left","right"]).optional(),distance:p.z.number().optional(),variable:pt.optional()}),Zt=p.z.object({name:p.z.string(),defaultValue:p.z.union([p.z.string(),p.z.number(),p.z.boolean()])}),Ut=p.z.object({type:We,blockId:p.z.string(),data:p.z.record(p.z.any()).optional()});var g=require("zod");var Xt=g.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),Qe=g.z.enum(["left","right","center"]),Ke=g.z.object({width:g.z.number().optional(),height:g.z.number().optional()}),mt=g.z.object({id:g.z.string(),text:g.z.string().describe("The option's answer text."),isCorrect:g.z.boolean().describe("Whether this option is a correct answer."),image:S.optional().describe("Option image."),imageAlign:Qe.optional().describe("Option image alignment."),imageSize:Ke.optional().describe("Option image size.")}),dt={id:g.z.string(),text:g.z.string().describe("The question text."),score:g.z.number().optional(),image:S.optional().describe("Question image."),imageAlign:Qe.optional().describe("Question image alignment."),imageSize:Ke.optional().describe("Question image size.")},ht=g.z.object({...dt,type:g.z.enum(["single-choice","multiple-choice"]),options:g.z.array(mt).describe("Answer options for this choice question.")}),ut=g.z.object({...dt,type:g.z.literal("true-false"),correctAnswer:g.z.boolean().describe("The correct answer (true or false).")}),ft=g.z.object({...dt,type:g.z.enum(["short-answers","long-answers"]),minCharacters:g.z.number().optional().describe("Minimum number of characters required in the answer."),maxCharacters:g.z.number().optional().describe("Maximum number of characters allowed in the answer.")}),$=g.z.discriminatedUnion("type",[ht,ut,ft]);var e=require("zod");var yt=e.z.enum(["2D","360\xB0"]),q={id:e.z.string(),type:Pe,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:_e.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:v.optional(),minSize:v.optional(),maxSize:v.optional(),theme:B.optional()},T={...q,actions:e.z.array(Fe).optional(),score:e.z.number().optional()},Ge=Object.freeze(Object.keys(q)),eo=e.z.object(T),bt=e.z.object({id:e.z.string(),text:e.z.string(),background:S.optional().describe("Background image/color for item."),opacity:e.z.number().optional().describe("Opacity of the item (0-1)."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles.")}),ie=e.z.object({id:e.z.string(),name:e.z.string().describe("Group/dropzone name."),background:S.optional().describe("Background image/color for group."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),singleItem:e.z.boolean().optional().describe("Accept only one item inside."),opacity:e.z.number().optional().describe("Opacity of the group (0-1)."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles."),items:e.z.array(bt).describe("Items that belong in this group.")}),gt=e.z.enum(["d4","d6","d8","d10","d12","d20"]),St=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()}),kt=e.z.object({answer:e.z.string(),clue:e.z.string(),image:S.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()}),xt=e.z.object({grid:e.z.array(e.z.array(St)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(kt)}),Bt=e.z.object({grid:e.z.array(e.z.array(e.z.string())),placedWords:e.z.array(e.z.object({word:e.z.string(),clean:e.z.string(),path:e.z.array(e.z.object({x:e.z.number(),y:e.z.number()}))}))}),ae=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]).describe("Pair type."),content:e.z.tuple([e.z.string(),e.z.string()]).describe("Pair content [item1, item2].")}),ce=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional().describe("CSS color for the slice."),image:S.optional().describe("Slice image.")}),Ve=e.z.object({type:e.z.enum(["text","image"]).describe("Content type: text or image."),content:e.z.any().describe("The content value: a string for text, or a MediaItem for image.")}),se=e.z.object({id:e.z.string(),front:Ve.describe("Front side."),back:Ve.describe("Back side.")}),le=e.z.object({id:e.z.string(),frontImage:S.optional().describe("Front image."),frontText:e.z.string().optional().describe("Front text.")}),pe=e.z.object({id:e.z.string(),leftLabel:e.z.string().describe("Left side text."),rightLabel:e.z.string().describe("Right side text."),leftImage:e.z.any().optional().describe("Left side image."),rightImage:e.z.any().optional().describe("Right side image.")}),Tt=e.z.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]),He=e.z.enum(["none","arrow","circle","square"]),Ct=e.z.object({id:e.z.string(),text:e.z.string().describe("Label text."),t:e.z.number().describe("Position along the arrow path, from 0 (start) to 1 (end)."),offsetX:e.z.number().optional().describe("Pixel offset from the arrow path on the x axis."),offsetY:e.z.number().optional().describe("Pixel offset from the arrow path on the y axis."),fontSize:e.z.number().optional().describe("Label font size."),color:e.z.string().optional().describe("Label text color."),backgroundColor:e.z.string().optional().describe("Label background color.")}),me=e.z.object({...T,type:e.z.literal("Quiz"),questions:e.z.array($).optional().describe("Array of question objects."),previewIndex:e.z.number().optional().describe("Index of the question currently previewed in the editor."),required:e.z.boolean().optional().describe("Whether answering this quiz is required to proceed."),showResults:e.z.boolean().optional().describe("Show correct/incorrect feedback after submitting."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry the quiz."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed."),submitText:e.z.string().optional().describe("Label for submit button."),timer:e.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:e.z.boolean().optional().describe("Show current/total questions count."),theme:E}),de=e.z.object({...T,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional().describe("Show an icon marker on the hotpoint."),element:e.z.enum(["image","button"]).describe("Underlying element type for the hotpoint."),theme:M.optional()}),he=e.z.object({...T,type:e.z.literal("Editor"),content:e.z.any().optional().describe("Rich-text editor content (Plate.js JSON document)."),readonly:e.z.boolean().optional().describe("Make the editor content read-only during play."),theme:P.optional()}),ue=e.z.object({...q,type:e.z.literal("Media"),media:S.optional().describe("Media asset displayed by this block.")}),fe=e.z.object({...q,type:e.z.literal("Embed"),url:e.z.string().optional().describe("Embed content URL."),readOnly:e.z.boolean().optional().describe("Prevent interaction with the embedded content.")}),ye=e.z.object({...T,type:e.z.literal("DragAndDrop"),groups:e.z.array(ie).describe("Drag-and-drop groups."),theme:O.optional(),showResults:e.z.boolean().optional().describe("Show result feedback immediately."),layout:e.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:e.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside the sandbox."),groupBackground:S.optional().describe("Shared background image/color for all groups."),enableWrongAnswers:e.z.boolean().optional().describe("Allow placing items in incorrect groups."),itemBackground:S.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:e.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:e.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:e.z.number().optional().describe("Proportion ratio for split layout.")}),be=e.z.object({...T,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()).describe("Letters to unscramble (shuffled tiles the learner rearranges)."),correctWord:e.z.string().describe("The correct word."),theme:_.optional(),clue:e.z.string().optional().describe("A hint."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry after an incorrect answer."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed.")}),ge=e.z.object({...T,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional().describe("History of previous roll results."),diceType:gt.optional().describe("Type of die (number of faces)."),faceOverrides:e.z.any().optional().describe("Custom overrides for individual die faces."),color:e.z.string().optional().describe("CSS color for dice."),showNumber:e.z.boolean().optional().describe("Show the numeric value on the die face."),diceCount:e.z.number().optional().describe("Number of dice to roll together."),dicePool:e.z.record(e.z.number()).optional().describe("Named pool of dice configurations."),persistent:e.z.boolean().optional().describe("Keep dice visible after roll."),theme:L.optional()}),wt=e.z.enum(["scattered","rotated","scattered_rotated"]),Se=e.z.object({...T,type:e.z.literal("Puzzle"),image:S.optional().describe("Image URL or MediaItem for puzzle."),pieces:e.z.number().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:wt.optional().describe("Arrangement mode for scattered puzzle pieces (scattered, rotated, or both)."),puzzleType:e.z.enum(["swap","slide"]).optional().describe("Puzzle interaction type: swap adjacent pieces or slide into an empty space."),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:e.z.string().optional().describe("Deterministic seed for piece placement.")}),Y=e.z.object({...T,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string().describe("The answer for this clue."),clue:e.z.string().describe("The clue text shown to the learner."),image:S.optional().describe("Clue image.")})).optional(),layout:xt.optional(),theme:R.optional()}),zt=e.z.enum(["easy","medium","hard"]),J=e.z.object({...T,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional().describe("List of words to hide in the grid."),gridSize:oe.optional().describe("Grid dimensions."),difficulty:zt.optional().describe("Difficulty level, affecting word placement and grid noise."),data:Bt.optional(),theme:N.optional()}),ke=e.z.object({...T,type:e.z.literal("Memory"),pairs:e.z.array(ae).describe("Array of pair objects."),gridSize:oe.optional().describe("Grid dimensions."),hideScore:e.z.boolean().optional().describe("Hide the score display during play."),theme:W.optional()}),xe=e.z.object({...T,type:e.z.literal("Flashcard"),cards:e.z.array(se).describe("Array of card objects."),theme:V.optional()}),Be=e.z.object({...T,type:e.z.literal("SpinningWheel"),slices:e.z.array(ce).describe("Wheel slices (min 2)."),spinDuration:e.z.number().optional().describe("Spin duration in seconds."),theme:F.optional()}),Te=e.z.object({...T,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]).describe("Chart visualization type."),chartData:e.z.array(e.z.any()).describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional().describe("Custom color palette for chart series."),xAxisLabel:e.z.string().optional().describe("Label for the X axis."),yAxisLabel:e.z.string().optional().describe("Label for the Y axis."),showLegend:e.z.boolean().optional().describe("Show the chart legend."),showTooltip:e.z.boolean().optional().describe("Show tooltips on hover."),stacked:e.z.boolean().optional().describe("Stack series values instead of grouping them."),seriesNames:e.z.record(e.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")})}),Ce=e.z.object({...T,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional().describe("Instruction text."),pairs:e.z.array(pe).describe("Array of pair objects."),theme:H.optional()}),we=e.z.object({...T,type:e.z.literal("Cloze"),templateText:e.z.string().optional().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),theme:Q.optional(),mode:e.z.enum(["write","drag-drop"]).optional().describe("Input mode. Default: write.")}),ze=e.z.object({...T,type:e.z.literal("CardDeck"),cards:e.z.array(le).describe("Array of card objects."),backImage:S.optional().describe("Shared back image for all cards."),discardLogic:e.z.enum(["delete","return"]).describe("What happens to a card after it's used: delete it or return it to the deck."),theme:K.optional()}),Ae=e.z.object({...q,type:e.z.literal("Shape"),shapeType:Tt.optional().describe("Shape outline to render."),text:e.z.string().optional().describe("Text inside shape."),theme:G.optional()}),De=e.z.object({...q,type:e.z.literal("Arrow"),startBlockId:e.z.string().describe("ID of the block this arrow starts from."),endBlockId:e.z.string().optional().describe("ID of the block this arrow ends at, if connected to a block."),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional().describe("Free-floating end point coordinates, used when not connected to a block."),startHandle:e.z.enum(["top","right","bottom","left"]).describe("Anchor side on the start block."),endHandle:e.z.enum(["top","right","bottom","left"]).optional().describe("Anchor side on the end block."),connectionType:e.z.enum(["straight","orthogonal","curved"]).describe("Line routing style."),strokeColor:e.z.string().optional().describe("Line color."),strokeWidth:e.z.number().optional().describe("Line thickness in pixels."),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional().describe("Line dash style."),showHead:e.z.boolean().optional().describe("Show arrowheads on the line."),startHead:He.optional().describe("Arrowhead style at the start."),endHead:He.optional().describe("Arrowhead style at the end."),bendOffsetX:e.z.number().optional().describe("Manual bend offset on the x axis, for curved/orthogonal routing."),bendOffsetY:e.z.number().optional().describe("Manual bend offset on the y axis, for curved/orthogonal routing."),segmentCount:e.z.number().optional().describe("Number of segments for orthogonal routing."),bendOffsets:e.z.array(e.z.number()).optional().describe("Per-segment bend offsets for orthogonal routing."),labels:e.z.array(Ct).optional().describe("Text labels placed along the arrow.")}),$e=e.z.discriminatedUnion("type",[me,de,he,fe,ue,ye,be,ge,Se,Y,J,ke,xe,Be,Te,Ce,Ae,De,we,ze]),At=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()}),Dt=e.z.object({id:e.z.string(),title:e.z.string(),type:yt,background:e.z.union([e.z.string(),e.z.array(e.z.string()),S]).optional(),backgroundColor:e.z.string().optional(),backgroundAutoplay:e.z.boolean().optional(),backgroundLoop:e.z.boolean().optional(),secretCode:e.z.string().optional(),hidden:e.z.boolean().optional(),blocks:e.z.array($e),groups:e.z.array(At).optional(),canvas:e.z.object({width:e.z.number().optional(),height:e.z.number().optional(),preset:e.z.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()}),to=e.z.object({id:e.z.string(),title:e.z.string(),schemaVersion:e.z.number().optional(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(Dt),variables:e.z.array(e.z.object({name:e.z.string(),defaultValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean()])})).optional(),audio:e.z.array(e.z.object({id:e.z.string(),media:S.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()}),oo=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:$e});var C=require("zod"),It=C.z.object({id:C.z.string(),type:C.z.string(),title:C.z.string()}),jt=C.z.object({id:C.z.string(),title:C.z.string(),position:C.z.number(),blocks:C.z.array(It).default([])}),ro=C.z.object({activity:C.z.object({id:C.z.string(),title:C.z.string(),scenes:C.z.array(jt).default([])}),activeSceneId:C.z.string().nullable().optional()});var Ao=Fo(require("zod-to-json-schema"));function k(o){return o}var no={type:"Quiz",contentSchema:me,themeSchema:E,defaultContent:{id:"",type:"Quiz",title:"Quiz",rotation:0,size:{width:300,height:200},questions:[],theme:{layout:"vertical",preset:"default"}},capabilities:{hasActions:!0,hasScore:!0,collections:{questions:$},styleTargets:{title:["question"],answers:["answers"],button:["button"],general:["general"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var io={type:"Editor",contentSchema:he,themeSchema:P,defaultContent:{id:"",type:"Editor",title:"Editor",rotation:0,size:{width:100,height:50}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["editor"],answers:["editor"],general:["editor"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var ao={type:"Hotpoint",contentSchema:de,themeSchema:M,defaultContent:{id:"",type:"Hotpoint",title:"Hotpoint",rotation:0,size:{width:50,height:50},element:"button"},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},vrMode:"custom",analytics:{scorable:!1}},version:1};var co={type:"Embed",contentSchema:fe,defaultContent:{id:"",type:"Embed",title:"Embed",rotation:0,size:{width:250,height:150}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var so={type:"Media",contentSchema:ue,defaultContent:{id:"",type:"Media",title:"Media",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var lo={type:"DragAndDrop",contentSchema:ye,themeSchema:O,defaultContent:{id:"",type:"DragAndDrop",title:"DragAndDrop",rotation:0,size:{width:150,height:150},groups:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{groups:ie},styleTargets:{title:["title"],answers:["item"],general:["container"]},vrMode:"raster",analytics:{scorable:!0}},version:1};var po={type:"Anagram",contentSchema:be,themeSchema:_,defaultContent:{id:"",type:"Anagram",title:"Anagram",rotation:0,size:{width:150,height:100},letters:[],correctWord:""},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["letterText"],answers:["letter","slot"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var mo={type:"Dice",contentSchema:ge,themeSchema:L,defaultContent:{id:"",type:"Dice",title:"Dice",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},vrMode:"interactive",analytics:{scorable:!1}},version:1};var yr=Y.shape.words.unwrap().element,ho={type:"Crossword",contentSchema:Y,themeSchema:R,defaultContent:{id:"",type:"Crossword",title:"Crossword",rotation:0,size:{width:300,height:300}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:yr},styleTargets:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var br=J.shape.words.unwrap().element,uo={type:"WordSearch",contentSchema:J,themeSchema:N,defaultContent:{id:"",type:"WordSearch",title:"WordSearch",rotation:0,size:{width:500,height:400}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:br},styleTargets:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var fo={type:"Puzzle",contentSchema:Se,defaultContent:{id:"",type:"Puzzle",title:"Puzzle",rotation:0,size:{width:250,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!0}},version:1};var yo={type:"Memory",contentSchema:ke,themeSchema:W,defaultContent:{id:"",type:"Memory",title:"Memory",rotation:0,size:{width:400,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:ae},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var bo={type:"Flashcard",contentSchema:xe,themeSchema:V,defaultContent:{id:"",type:"Flashcard",title:"Flashcard",rotation:0,size:{width:400,height:300},cards:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:se},styleTargets:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var go={type:"SpinningWheel",contentSchema:Be,themeSchema:F,defaultContent:{id:"",type:"SpinningWheel",title:"SpinningWheel",rotation:0,size:{width:350,height:450},slices:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{slices:ce},styleTargets:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var So={type:"Chart",contentSchema:Te,defaultContent:{id:"",type:"Chart",title:"Chart",rotation:0,size:{width:300,height:200},chartType:"bar",chartData:[],chartConfig:{}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var ko={type:"MatchPairs",contentSchema:Ce,themeSchema:H,defaultContent:{id:"",type:"MatchPairs",title:"MatchPairs",rotation:0,size:{width:600,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:pe},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var xo={type:"Shape",contentSchema:Ae,themeSchema:G,defaultContent:{id:"",type:"Shape",title:"Shape",rotation:0,size:{width:50,height:50}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:{title:["shape"],answers:["shape"],general:["shape"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var Bo={type:"Arrow",contentSchema:De,defaultContent:{id:"",type:"Arrow",title:"Arrow",rotation:0,startBlockId:"",startHandle:"top",connectionType:"straight",strokeColor:"#000000",strokeWidth:2,showHead:!0},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var To={type:"Cloze",contentSchema:we,themeSchema:Q,defaultContent:{id:"",type:"Cloze",title:"Cloze",rotation:0,size:{width:450,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["text"],answers:["word","blank"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Co={type:"CardDeck",contentSchema:ze,themeSchema:K,defaultContent:{id:"",type:"CardDeck",title:"CardDeck",rotation:0,size:{width:180,height:260},cards:[],discardLogic:"delete"},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:le},styleTargets:{title:["cardText"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var A={Quiz:no,Editor:io,Hotpoint:ao,Embed:co,Media:so,DragAndDrop:lo,Anagram:po,Dice:mo,Crossword:ho,WordSearch:uo,Puzzle:fo,Memory:yo,Flashcard:bo,SpinningWheel:go,Chart:So,MatchPairs:ko,Shape:xo,Arrow:Bo,Cloze:To,CardDeck:Co};function wo(o){return A[o]}var qe=Object.fromEntries(I.map(o=>[o,A[o].contentSchema])),zo=Object.fromEntries(I.map(o=>[o,A[o].capabilities.styleTargets??{}]));var gr=Ao.zodToJsonSchema,Z=qe;function Sr(o,i,n,c){let a=n?"*required*":"optional",l=vt(i),s=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${o}\` (${l}, ${a})${s}`}function vt(o){return o.enum?`enum: ${o.enum.map(i=>JSON.stringify(i)).join(" | ")}`:o.anyOf||o.oneOf?(o.anyOf||o.oneOf).map(vt).join(" | "):Array.isArray(o.type)?o.type.join(" | "):o.type==="array"&&o.items?`array<${vt(o.items)}>`:o.type==="object"?"object":o.type??"any"}function Mt(o,i){let n=[],c=new Set(o.required??[]),a=o.properties??{};for(let[l,s]of Object.entries(a))n.push(Sr(l,s,c.has(l),i)),s.type==="object"&&s.properties?n.push(Mt(s,i+" ")):s.type==="array"&&s.items?.type==="object"&&n.push(Mt(s.items,i+" "));return n.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
${u||"_(no configurable fields)_"}`)}return
|
|
1
|
+
"use strict";var _o=Object.create;var Me=Object.defineProperty;var Po=Object.getOwnPropertyDescriptor;var Ro=Object.getOwnPropertyNames;var No=Object.getPrototypeOf,Wo=Object.prototype.hasOwnProperty;var Ko=(o,n)=>{for(var i in n)Me(o,i,{get:n[i],enumerable:!0})},Pt=(o,n,i,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Ro(n))!Wo.call(o,a)&&a!==i&&Me(o,a,{get:()=>n[a],enumerable:!(c=Po(n,a))||c.enumerable});return o};var Fo=(o,n,i)=>(i=o!=null?_o(No(o)):{},Pt(n||!o||!o.__esModule?Me(i,"default",{value:o,enumerable:!0}):i,o)),Qo=o=>Pt(Me({},"__esModule",{value:!0}),o);var zr={};Ko(zr,{ActionBlockSchema:()=>Zt,ActionConditionSchema:()=>We,ActionSchema:()=>Fe,ActionTypeSchema:()=>dt,ActionVariableSchema:()=>ht,ActivityContentMigrationError:()=>Ie,ActivityContentSchema:()=>Ut,ActivityContextSchema:()=>zo,ActivityVariableSchema:()=>qt,AnagramBlockSchema:()=>fe,AnagramBlockThemeSchema:()=>_,AnimationSchema:()=>rt,ArrowBlockSchema:()=>Ae,ArrowHeadTypeSchema:()=>He,ArrowLabelSchema:()=>xt,BASE_BLOCK_FIELDS:()=>Ve,BLOCK_CONTENT_SCHEMAS:()=>Z,BLOCK_REGISTRY:()=>z,BLOCK_STYLE_KEYS:()=>At,BLOCK_TYPES:()=>w,BlockEventSchema:()=>Jt,BlockEventTypeSchema:()=>Ke,BlockGroupSchema:()=>zt,BlockSchema:()=>Ge,BlockThemeSchema:()=>x,BlockTypeSchema:()=>Le,BoxSideSchema:()=>Pe,BoxStylesSchema:()=>d,CANVAS_OP_NAMES:()=>Ho,CANVAS_OP_REQUIRED:()=>Ee,CURRENT_SCHEMA_VERSION:()=>qe,CanvasDragItemSchema:()=>Xt,CanvasOpSchema:()=>Xe,CardDeckBlockSchema:()=>ze,CardDeckBlockThemeSchema:()=>Q,CardItemSchema:()=>se,ChartBlockSchema:()=>xe,ChoiceQuestionSchema:()=>ct,ClickConditionSchema:()=>$t,ClozeBlockSchema:()=>Ce,ClozeBlockThemeSchema:()=>F,ConditionOperatorSchema:()=>pt,CropDataSchema:()=>tt,CrosswordBlockSchema:()=>q,CrosswordBlockThemeSchema:()=>R,CrosswordCellSchema:()=>bt,CrosswordLayoutOutputSchema:()=>St,CrosswordLayoutWordSchema:()=>gt,DiceBlockSchema:()=>be,DiceBlockThemeSchema:()=>P,DiceTypeSchema:()=>ft,DragAndDropBlockSchema:()=>ye,DragAndDropBlockThemeSchema:()=>O,DragAndDropGroupSchema:()=>ne,DragAndDropItemSchema:()=>yt,EditorBlockSchema:()=>de,EditorBlockThemeSchema:()=>L,EmbedBlockSchema:()=>ue,FlashcardBlockSchema:()=>ke,FlashcardBlockThemeSchema:()=>H,FlashcardContentSchema:()=>Qe,FlashcardItemSchema:()=>ce,GridSizeSchema:()=>oe,HotpointBlockSchema:()=>me,HotpointBlockThemeSchema:()=>M,ImageAlignSchema:()=>Re,ImageSizeSchema:()=>Ne,KeyPressConditionSchema:()=>Yt,MatchPairsBlockSchema:()=>Te,MatchPairsBlockThemeSchema:()=>V,MatchPairsPairSchema:()=>le,MathOperationSchema:()=>mt,MediaBlockSchema:()=>he,MediaItemSchema:()=>S,MediaRefSchema:()=>Qt,MediaSourceSchema:()=>et,MediaTypeSchema:()=>re,MemoryBlockSchema:()=>Se,MemoryBlockThemeSchema:()=>W,MemoryPairSchema:()=>ie,PositionSchema:()=>_e,PuzzleBlockSchema:()=>ge,PuzzleGameModeSchema:()=>Tt,QuestionOptionSchema:()=>it,QuestionSchema:()=>$,QuestionTypeSchema:()=>Ht,QuizBlockSchema:()=>pe,QuizBlockThemeSchema:()=>E,QuizConditionSchema:()=>Vt,REGISTRY_CONTENT_SCHEMAS:()=>Ye,REGISTRY_STYLE_TARGETS:()=>wo,RadiusSchema:()=>nt,SCORABLE_BLOCK_TYPES:()=>Ao,STYLE_TARGET_MAP:()=>De,SceneBlockRefSchema:()=>It,SceneSchema:()=>wt,SceneSummarySchema:()=>jt,SceneTypeSchema:()=>ut,ShapeBlockSchema:()=>we,ShapeBlockThemeSchema:()=>G,ShapeTypeSchema:()=>Bt,SizeSchema:()=>v,SpinningWheelBlockSchema:()=>Be,SpinningWheelBlockThemeSchema:()=>K,TextQuestionSchema:()=>lt,TextStylesSchema:()=>b,TimerConditionSchema:()=>Gt,TrueFalseQuestionSchema:()=>st,UNSTYLEABLE_BLOCKS:()=>Dt,VideoSettingsSchema:()=>ot,WheelSliceSchema:()=>ae,WordSearchBlockSchema:()=>J,WordSearchBlockThemeSchema:()=>N,WordSearchDataSchema:()=>kt,WordSearchDifficultySchema:()=>Ct,actionsV1toV2:()=>Mo,applyItemPatch:()=>Go,createCanvasOpValidator:()=>dr,defineBlock:()=>k,detectConflict:()=>yr,entitySignature:()=>Kt,generateBlockReference:()=>Io,getAllBlockJsonSchemas:()=>Cr,getBlockDefinition:()=>Bo,getBlockJsonSchema:()=>Lo,getCapabilitiesManifest:()=>Br,isKnownCanvasOp:()=>Rt,listBlockTypes:()=>Oo,mapLogicalThemeStyles:()=>$e,mergeTheme:()=>Co,migrateActivityContent:()=>vo,opConflictStamp:()=>fr,opTarget:()=>Wt,parseMentions:()=>xr,realStyleKeysFor:()=>xo,resolveMentions:()=>Tr,stableStringify:()=>te,styleTargetsHelpFor:()=>To,validateCanvasOp:()=>Vo});module.exports=Qo(zr);var Ee={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},Ho=Object.keys(Ee);function Rt(o){return Object.prototype.hasOwnProperty.call(Ee,o)}function Vo(o,n){if(!Rt(o))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${o}"`]};if(typeof n!="object"||n===null||Array.isArray(n))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let i=n,c=Ee[o].filter(a=>i[a]===void 0||i[a]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(a=>`missing field: ${a}`)}:o==="groupBlocks"&&(!Array.isArray(i.blockIds)||i.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function Go(o,n,i){let c=Array.isArray(o)?[...o]:[];if(n==="insertItem"){if(i.item===void 0||i.item===null)return c;let a=typeof i.at=="number"?i.at:c.length;return c.splice(Math.max(0,Math.min(a,c.length)),0,i.item),c}return n==="updateItem"?c.map(a=>a&&typeof a=="object"&&a.id===i.itemId?{...a,...i.item??{}}:a):c.filter(a=>!(a&&typeof a=="object"&&a.id===i.itemId))}var r=require("zod"),j=()=>r.z.record(r.z.string(),r.z.unknown()),$o=r.z.object({scene:j().optional(),newIndex:r.z.number().optional()}).passthrough(),Yo=r.z.object({sceneId:r.z.string()}),qo=r.z.object({sceneId:r.z.string(),block:j()}),Jo=r.z.object({sceneId:r.z.string(),updates:j().optional(),newIndex:r.z.number().optional()}),Zo=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),Uo=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),updates:j()}),Xo=r.z.object({sceneId:r.z.string(),blockId:r.z.string()}),er=r.z.object({blockIds:r.z.array(r.z.string())}),tr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),theme:j()}),or=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),elementId:r.z.string(),customStyle:j()}),rr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),action:j()}),nr=r.z.object({sceneId:r.z.string(),blockId:r.z.string(),actionId:r.z.string()}),ir=r.z.object({operation:r.z.string(),name:r.z.string(),defaultValue:r.z.unknown().optional()}).passthrough(),ar=r.z.object({scope:r.z.string().optional(),sceneId:r.z.string().optional(),blockId:r.z.string().optional(),hasTimer:r.z.boolean().optional(),timer:r.z.unknown().optional()}).passthrough(),cr=r.z.object({sceneId:r.z.string(),newIndex:r.z.number()}),sr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),item:r.z.unknown(),at:r.z.number().optional()}),lr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string(),item:r.z.unknown()}),pr=r.z.object({sceneId:r.z.string().optional(),blockId:r.z.string(),collection:r.z.string(),itemId:r.z.string()}),mr=r.z.object({activity:r.z.unknown()}),Xe=r.z.discriminatedUnion("action",[r.z.object({action:r.z.literal("createScene"),data:$o}),r.z.object({action:r.z.literal("deleteScene"),data:Yo}),r.z.object({action:r.z.literal("addBlock"),data:qo}),r.z.object({action:r.z.literal("updateScene"),data:Jo}),r.z.object({action:r.z.literal("deleteBlock"),data:Zo}),r.z.object({action:r.z.literal("updateBlock"),data:Uo}),r.z.object({action:r.z.literal("duplicateBlock"),data:Xo}),r.z.object({action:r.z.literal("groupBlocks"),data:er}),r.z.object({action:r.z.literal("updateBlockTheme"),data:tr}),r.z.object({action:r.z.literal("updateBlockElementStyle"),data:or}),r.z.object({action:r.z.literal("addAction"),data:rr}),r.z.object({action:r.z.literal("removeAction"),data:nr}),r.z.object({action:r.z.literal("manageVariables"),data:ir}),r.z.object({action:r.z.literal("configureTimer"),data:ar}),r.z.object({action:r.z.literal("reorderScenes"),data:cr}),r.z.object({action:r.z.literal("insertItem"),data:sr}),r.z.object({action:r.z.literal("updateItem"),data:lr}),r.z.object({action:r.z.literal("deleteItem"),data:pr}),r.z.object({action:r.z.literal("replaceActivity"),data:mr})]);var Nt=require("zod");function Oe(o){return o.issues.map(n=>{let i=n.path.join(".");return i?`${i}: ${n.message}`:n.message})}function dr(o,n){return i=>{let c=Xe.safeParse(i);if(!c.success)return{ok:!1,code:"SHAPE_INVALID",errors:Oe(c.error)};let{action:a,data:l}=c.data;if(a==="addBlock"){let s=l.block,h=typeof s.type=="string"?s.type:void 0,u=h?o.getContentSchema(h):void 0;if(!h||!u)return{ok:!1,code:"UNKNOWN_BLOCK_TYPE",errors:[`addBlock: unknown block type "${String(s.type)}"`]};let y=u.safeParse(s);return y.success?{ok:!0}:{ok:!1,code:"CONTENT_INVALID",errors:Oe(y.error)}}if(a==="insertItem"||a==="updateItem"||a==="deleteItem"){let s=n?.(l.blockId);if(!s)return{ok:!0};let h=o.getCollectionSchema(s,l.collection);if(!h)return{ok:!1,code:"UNKNOWN_COLLECTION",errors:[`unknown collection "${l.collection}" for block type "${s}"`]};if(a==="insertItem"||a==="updateItem"){let u=h.safeParse(l.item);if(!u.success)return{ok:!1,code:"ITEM_INVALID",errors:Oe(u.error)}}return{ok:!0}}if(a==="updateBlock"){let s=n?.(l.blockId),h=s?o.getContentSchema(s):void 0;if(!h)return{ok:!0};if(h instanceof Nt.z.ZodObject){let y=h.deepPartial().safeParse(l.updates);if(!y.success)return{ok:!1,code:"CONTENT_INVALID",errors:Oe(y.error)}}return{ok:!0}}return{ok:!0}}}var hr=new Set(["position","size","rotation","zIndex","z"]);function te(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?"["+o.map(te).join(",")+"]":"{"+Object.keys(o).sort().map(i=>JSON.stringify(i)+":"+te(o[i])).join(",")+"}"}function Wt(o,n){let i=n??{};switch(o){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return i.blockId?{kind:"block",blockId:i.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return i.blockId&&i.collection&&i.itemId?{kind:"item",blockId:i.blockId,collection:i.collection,itemId:i.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function ur(o,n){if(Array.isArray(o))for(let i of o){let c=i?.blocks?.find?.(a=>a&&a.id===n);if(c)return c}}function Kt(o,n){if(n.kind==="untracked")return null;let i=n.blockId?ur(o,n.blockId):void 0;if(!i)return null;if(n.kind==="block"){let l={};for(let s of Object.keys(i))hr.has(s)||(l[s]=i[s]);return te(l)}let c=i[n.collection];if(!Array.isArray(c))return null;let a=c.find(l=>l&&l.id===n.itemId);return a?te(a):null}function yr(o,n){return o==null?"apply":n==null?"missing":o===n?"apply":"stale"}function fr(o,n,i){let c=Wt(o,n);return{target:c,baseSignature:Kt(i,c)}}var Ft=require("zod"),w=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],Le=Ft.z.enum(w);var m=require("zod"),_e=m.z.object({x:m.z.number(),y:m.z.number(),z:m.z.number().optional()}),v=m.z.object({width:m.z.number().optional(),height:m.z.number().optional()}),oe=m.z.object({rows:m.z.number(),cols:m.z.number()}),re=m.z.enum(["image","color","gif","shape","illustration","video","audio"]),et=m.z.enum(["unsplash","pexels","upload","url","library","tenor"]),tt=m.z.object({x:m.z.number(),y:m.z.number(),width:m.z.number(),height:m.z.number(),zoom:m.z.number().optional(),rotation:m.z.number().optional(),aspect:m.z.number().optional()}),ot=m.z.object({autoplay:m.z.boolean().optional(),loop:m.z.boolean().optional(),muted:m.z.boolean().optional(),controls:m.z.boolean().optional(),poster:m.z.string().optional(),volume:m.z.number().optional()}),S=m.z.object({id:m.z.string().optional(),url:m.z.string().optional(),title:m.z.string().optional(),type:re.describe("Media type (image, color, gif, shape, illustration, video, audio)."),source:et.optional(),alt:m.z.string().optional(),width:m.z.number().optional(),height:m.z.number().optional(),format:m.z.enum(["cover","contain"]).optional(),color:m.z.string().optional(),cropData:tt.optional(),duration:m.z.number().optional(),videoSettings:ot.optional()}),Qt=S;var t=require("zod");var rt=t.z.object({type:t.z.union([t.z.enum(["none","fade","direction","bounce","scale","rotate"]),t.z.string()]),duration:t.z.number().optional(),delay:t.z.number().optional(),phase:t.z.enum(["in","both","out"]).optional(),direction:t.z.enum(["up","right","down","left"]).optional()}),Pe=t.z.object({top:t.z.union([t.z.string(),t.z.number()]).optional(),right:t.z.union([t.z.string(),t.z.number()]).optional(),bottom:t.z.union([t.z.string(),t.z.number()]).optional(),left:t.z.union([t.z.string(),t.z.number()]).optional()}),nt=t.z.object({topLeft:t.z.union([t.z.string(),t.z.number()]).optional(),topRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomRight:t.z.union([t.z.string(),t.z.number()]).optional(),bottomLeft:t.z.union([t.z.string(),t.z.number()]).optional()}),d=t.z.object({background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),backgroundOpacity:t.z.number().optional(),backgroundMedia:S.optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:Pe.optional(),borderRadius:nt.optional(),padding:t.z.union([t.z.string(),t.z.number(),Pe]).optional()}),b=t.z.object({color:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),fontWeight:t.z.union([t.z.string(),t.z.number()]).optional(),textAlign:t.z.enum(["left","center","right","justify"]).optional()}),D=d.merge(b),x=t.z.object({spacing:t.z.enum(["no-spacing","small","medium","large"]).optional(),animation:rt.optional(),styles:t.z.record(t.z.record(t.z.any())).optional()}),M=x.extend({styles:t.z.object({hotpoint:t.z.object({icon:t.z.string().optional(),iconPosition:t.z.enum(["left","right"]).optional(),iconSize:t.z.string().optional(),iconColor:t.z.string().optional(),image:S.optional(),imageFormat:t.z.enum(["circle","square","custom"]).optional(),border:t.z.boolean().optional(),borderColor:t.z.string().optional(),borderWidth:t.z.string().optional(),borderRadius:t.z.string().optional(),glow:t.z.boolean().optional(),glowColor:t.z.string().optional(),background:t.z.boolean().optional(),backgroundColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),fontStyle:t.z.string().optional(),textColor:t.z.string().optional()}).optional()}).optional()}),E=x.extend({layout:t.z.enum(["horizontal","vertical","grid"]),gridColumns:t.z.number().optional(),preset:t.z.enum(["default","modern","trivia","custom"]),styles:t.z.object({general:D,question:D,answers:D.extend({customStyles:t.z.array(t.z.object({color:t.z.string().optional(),backgroundColor:t.z.string().optional(),targets:t.z.string().optional()})).optional(),hover:D.optional()}),button:D.extend({variant:t.z.enum(["default","outline","ghost"]).optional(),hover:D.optional()})}).optional()}),O=x.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),gridColumns:t.z.number().optional(),gridGap:t.z.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:t.z.object({x:t.z.number().optional(),y:t.z.number().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:t.z.object({title:b.optional(),sandbox:d.optional(),item:D.optional(),group:d.optional(),container:d.extend({url:t.z.string().optional(),type:re.optional()}).optional(),groups:D.optional(),feedback:t.z.object({correct:t.z.string().optional(),incorrect:t.z.string().optional(),active:t.z.string().optional()}).optional(),referenceSize:t.z.object({width:t.z.number(),height:t.z.number()}).optional()}).optional()}),L=x.extend({styles:t.z.object({editor:d.optional()}).optional()}),_=x.extend({styles:t.z.object({letter:d.optional(),letterText:b.optional(),slot:d.optional(),container:d.optional()}).optional()}),P=x.extend({styles:t.z.object({button:d.extend({hover:D.optional()}).optional(),buttonText:b.optional(),container:d.optional()}).optional()}),R=x.extend({primaryColor:t.z.string().optional(),layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({text:b.optional(),cell:d.optional(),grid:d.optional(),clueContainer:d.optional(),clueText:b.optional(),clueTitle:b.optional()}).optional()}),N=x.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),splitRatio:t.z.number().optional(),styles:t.z.object({wordSearch:t.z.object({primaryColor:t.z.string().optional(),highlightColor:t.z.string().optional(),fontSize:t.z.number().optional(),fontFamily:t.z.string().optional(),textColor:t.z.string().optional(),cellBackgroundColor:t.z.string().optional()}).optional(),text:b.optional(),cell:d.optional(),grid:d.optional(),wordListContainer:d.optional(),wordListText:b.optional(),wordListTitle:b.optional()}).optional()}),W=x.extend({styles:t.z.object({text:b.optional(),container:d.optional(),infoContainer:d.optional(),infoText:b.optional(),card:d.optional()}).optional()}),K=x.extend({styles:t.z.object({wheelText:b.optional()}).optional()}),F=x.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:b.optional(),container:d.optional(),wordBank:d.optional(),word:d.optional(),blank:d.optional()}).optional()}),Q=x.extend({styles:t.z.object({card:d.optional(),cardText:b.optional(),container:d.optional()}).optional()}),H=x.extend({styles:t.z.object({cardFront:d.optional(),cardBack:d.optional(),frontText:b.optional(),backText:b.optional(),navigation:d.optional(),navigationText:b.optional()}).optional()}),V=x.extend({layoutPosition:t.z.enum(["left","right","top","bottom"]).optional(),styles:t.z.object({text:b.optional(),card:d.optional(),container:d.optional()}).optional()}),G=x.extend({styles:t.z.object({shape:D.extend({fillColor:t.z.string().optional(),textColor:t.z.string().optional(),borderStyle:t.z.enum(["solid","dashed","dotted"]).optional(),padding:t.z.number().optional()}).optional()}).optional()});function k(o){return o}var e=require("zod");var g=require("zod");var Ht=g.z.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),Re=g.z.enum(["left","right","center"]),Ne=g.z.object({width:g.z.number().optional(),height:g.z.number().optional()}),it=g.z.object({id:g.z.string(),text:g.z.string().describe("The option's answer text."),isCorrect:g.z.boolean().describe("Whether this option is a correct answer."),image:S.optional().describe("Option image."),imageAlign:Re.optional().describe("Option image alignment."),imageSize:Ne.optional().describe("Option image size.")}),at={id:g.z.string(),text:g.z.string().describe("The question text."),score:g.z.number().optional(),image:S.optional().describe("Question image."),imageAlign:Re.optional().describe("Question image alignment."),imageSize:Ne.optional().describe("Question image size.")},ct=g.z.object({...at,type:g.z.enum(["single-choice","multiple-choice"]),options:g.z.array(it).describe("Answer options for this choice question.")}),st=g.z.object({...at,type:g.z.literal("true-false"),correctAnswer:g.z.boolean().describe("The correct answer (true or false).")}),lt=g.z.object({...at,type:g.z.enum(["short-answers","long-answers"]),minCharacters:g.z.number().optional().describe("Minimum number of characters required in the answer."),maxCharacters:g.z.number().optional().describe("Maximum number of characters allowed in the answer.")}),$=g.z.discriminatedUnion("type",[ct,st,lt]);var p=require("zod"),Ke=p.z.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),pt=p.z.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),Vt=p.z.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),Gt=p.z.enum(["completed","half_way"]),$t=p.z.enum(["single_click","double_click"]),Yt=p.z.literal("key_pressed"),We=p.z.object({event:Ke.optional(),variableName:p.z.string().optional(),operator:pt.optional(),value:p.z.any()}),mt=p.z.enum(["set","add","subtract","multiply","divide"]),dt=p.z.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),ht=p.z.object({name:p.z.string(),value:p.z.union([p.z.number(),p.z.string(),p.z.boolean()]),operation:mt.optional()}),Fe=p.z.object({id:p.z.string(),type:dt,condition:We.optional(),conditions:p.z.array(We).optional(),conditionsOperator:p.z.enum(["and","or"]).optional(),modalContent:p.z.string().optional(),audioUrl:p.z.string().optional(),linkUrl:p.z.string().optional(),targetSceneId:p.z.string().optional(),targetBlockId:p.z.string().optional(),direction:p.z.enum(["up","down","left","right"]).optional(),distance:p.z.number().optional(),variable:ht.optional()}),qt=p.z.object({name:p.z.string(),defaultValue:p.z.union([p.z.string(),p.z.number(),p.z.boolean()])}),Jt=p.z.object({type:Ke,blockId:p.z.string(),data:p.z.record(p.z.any()).optional()});var ut=e.z.enum(["2D","360\xB0"]),Y={id:e.z.string(),type:Le,title:e.z.string(),showTitle:e.z.boolean().optional(),locked:e.z.boolean().optional(),groupId:e.z.string().optional(),position:_e.optional(),rotation:e.z.number(),hidden:e.z.boolean().optional(),draggable:e.z.boolean().optional(),size:v.optional(),minSize:v.optional(),maxSize:v.optional(),theme:x.optional()},T={...Y,actions:e.z.array(Fe).optional(),score:e.z.number().optional()},Ve=Object.freeze(Object.keys(Y)),Zt=e.z.object(T),yt=e.z.object({id:e.z.string(),text:e.z.string(),background:S.optional().describe("Background image/color for item."),opacity:e.z.number().optional().describe("Opacity of the item (0-1)."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles.")}),ne=e.z.object({id:e.z.string(),name:e.z.string().describe("Group/dropzone name."),background:S.optional().describe("Background image/color for group."),x:e.z.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.z.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.z.number().optional().describe("Manual width in pixels."),height:e.z.number().optional().describe("Manual height in pixels."),singleItem:e.z.boolean().optional().describe("Accept only one item inside."),opacity:e.z.number().optional().describe("Opacity of the group (0-1)."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles."),items:e.z.array(yt).describe("Items that belong in this group.")}),ft=e.z.enum(["d4","d6","d8","d10","d12","d20"]),bt=e.z.object({char:e.z.string(),isBlack:e.z.boolean(),number:e.z.number().optional(),row:e.z.number(),col:e.z.number()}),gt=e.z.object({answer:e.z.string(),clue:e.z.string(),image:S.optional(),startx:e.z.number(),starty:e.z.number(),orientation:e.z.enum(["across","down","none"]),position:e.z.number()}),St=e.z.object({grid:e.z.array(e.z.array(bt)),rows:e.z.number(),cols:e.z.number(),words:e.z.array(gt)}),kt=e.z.object({grid:e.z.array(e.z.array(e.z.string())),placedWords:e.z.array(e.z.object({word:e.z.string(),clean:e.z.string(),path:e.z.array(e.z.object({x:e.z.number(),y:e.z.number()}))}))}),ie=e.z.object({id:e.z.string(),type:e.z.enum(["img-img","img-word","word-word"]).describe("Pair type."),content:e.z.tuple([e.z.string(),e.z.string()]).describe("Pair content [item1, item2].")}),ae=e.z.object({id:e.z.string(),text:e.z.string(),color:e.z.string().optional().describe("CSS color for the slice."),image:S.optional().describe("Slice image.")}),Qe=e.z.object({type:e.z.enum(["text","image"]).describe("Content type: text or image."),content:e.z.any().describe("The content value: a string for text, or a MediaItem for image.")}),ce=e.z.object({id:e.z.string(),front:Qe.describe("Front side."),back:Qe.describe("Back side.")}),se=e.z.object({id:e.z.string(),frontImage:S.optional().describe("Front image."),frontText:e.z.string().optional().describe("Front text.")}),le=e.z.object({id:e.z.string(),leftLabel:e.z.string().describe("Left side text."),rightLabel:e.z.string().describe("Right side text."),leftImage:e.z.any().optional().describe("Left side image."),rightImage:e.z.any().optional().describe("Right side image.")}),Bt=e.z.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]),He=e.z.enum(["none","arrow","circle","square"]),xt=e.z.object({id:e.z.string(),text:e.z.string().describe("Label text."),t:e.z.number().describe("Position along the arrow path, from 0 (start) to 1 (end)."),offsetX:e.z.number().optional().describe("Pixel offset from the arrow path on the x axis."),offsetY:e.z.number().optional().describe("Pixel offset from the arrow path on the y axis."),fontSize:e.z.number().optional().describe("Label font size."),color:e.z.string().optional().describe("Label text color."),backgroundColor:e.z.string().optional().describe("Label background color.")}),pe=e.z.object({...T,type:e.z.literal("Quiz"),questions:e.z.array($).optional().describe("Array of question objects."),previewIndex:e.z.number().optional().describe("Index of the question currently previewed in the editor."),required:e.z.boolean().optional().describe("Whether answering this quiz is required to proceed."),showResults:e.z.boolean().optional().describe("Show correct/incorrect feedback after submitting."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry the quiz."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed."),submitText:e.z.string().optional().describe("Label for submit button."),timer:e.z.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:e.z.boolean().optional().describe("Show current/total questions count."),theme:E}),me=e.z.object({...T,type:e.z.literal("Hotpoint"),showIcon:e.z.boolean().optional().describe("Show an icon marker on the hotpoint."),element:e.z.enum(["image","button"]).describe("Underlying element type for the hotpoint."),theme:M.optional()}),de=e.z.object({...T,type:e.z.literal("Editor"),content:e.z.any().optional().describe("Rich-text editor content (Plate.js JSON document)."),readonly:e.z.boolean().optional().describe("Make the editor content read-only during play."),theme:L.optional()}),he=e.z.object({...Y,type:e.z.literal("Media"),media:S.optional().describe("Media asset displayed by this block.")}),ue=e.z.object({...Y,type:e.z.literal("Embed"),url:e.z.string().optional().describe("Embed content URL."),readOnly:e.z.boolean().optional().describe("Prevent interaction with the embedded content.")}),ye=e.z.object({...T,type:e.z.literal("DragAndDrop"),groups:e.z.array(ne).describe("Drag-and-drop groups."),theme:O.optional(),showResults:e.z.boolean().optional().describe("Show result feedback immediately."),layout:e.z.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:e.z.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside the sandbox."),groupBackground:S.optional().describe("Shared background image/color for all groups."),enableWrongAnswers:e.z.boolean().optional().describe("Allow placing items in incorrect groups."),itemBackground:S.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:e.z.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:e.z.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:e.z.number().optional().describe("Proportion ratio for split layout.")}),fe=e.z.object({...T,type:e.z.literal("Anagram"),letters:e.z.array(e.z.string()).describe("Letters to unscramble (shuffled tiles the learner rearranges)."),correctWord:e.z.string().describe("The correct word."),theme:_.optional(),clue:e.z.string().optional().describe("A hint."),allowRetry:e.z.boolean().optional().describe("Allow the learner to retry after an incorrect answer."),maxRetry:e.z.string().optional().describe("Maximum number of retry attempts allowed.")}),be=e.z.object({...T,type:e.z.literal("Dice"),rollHistory:e.z.array(e.z.number()).optional().describe("History of previous roll results."),diceType:ft.optional().describe("Type of die (number of faces)."),faceOverrides:e.z.any().optional().describe("Custom overrides for individual die faces."),color:e.z.string().optional().describe("CSS color for dice."),showNumber:e.z.boolean().optional().describe("Show the numeric value on the die face."),diceCount:e.z.number().optional().describe("Number of dice to roll together."),dicePool:e.z.record(e.z.number()).optional().describe("Named pool of dice configurations."),persistent:e.z.boolean().optional().describe("Keep dice visible after roll."),theme:P.optional()}),Tt=e.z.enum(["scattered","rotated","scattered_rotated"]),ge=e.z.object({...T,type:e.z.literal("Puzzle"),image:S.optional().describe("Image URL or MediaItem for puzzle."),pieces:e.z.number().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:Tt.optional().describe("Arrangement mode for scattered puzzle pieces (scattered, rotated, or both)."),puzzleType:e.z.enum(["swap","slide"]).optional().describe("Puzzle interaction type: swap adjacent pieces or slide into an empty space."),showNumbers:e.z.union([e.z.boolean(),e.z.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:e.z.string().optional().describe("Deterministic seed for piece placement.")}),q=e.z.object({...T,type:e.z.literal("Crossword"),words:e.z.array(e.z.object({answer:e.z.string().describe("The answer for this clue."),clue:e.z.string().describe("The clue text shown to the learner."),image:S.optional().describe("Clue image.")})).optional(),layout:St.optional(),theme:R.optional()}),Ct=e.z.enum(["easy","medium","hard"]),J=e.z.object({...T,type:e.z.literal("WordSearch"),words:e.z.array(e.z.string()).optional().describe("List of words to hide in the grid."),gridSize:oe.optional().describe("Grid dimensions."),difficulty:Ct.optional().describe("Difficulty level, affecting word placement and grid noise."),data:kt.optional(),theme:N.optional()}),Se=e.z.object({...T,type:e.z.literal("Memory"),pairs:e.z.array(ie).describe("Array of pair objects."),gridSize:oe.optional().describe("Grid dimensions."),hideScore:e.z.boolean().optional().describe("Hide the score display during play."),theme:W.optional()}),ke=e.z.object({...T,type:e.z.literal("Flashcard"),cards:e.z.array(ce).describe("Array of card objects."),theme:H.optional()}),Be=e.z.object({...T,type:e.z.literal("SpinningWheel"),slices:e.z.array(ae).describe("Wheel slices (min 2)."),spinDuration:e.z.number().optional().describe("Spin duration in seconds."),theme:K.optional()}),xe=e.z.object({...T,type:e.z.literal("Chart"),chartType:e.z.enum(["line","bar","pie","doughnut","radar","area","scatter"]).describe("Chart visualization type."),chartData:e.z.array(e.z.any()).describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:e.z.object({colors:e.z.array(e.z.string()).optional().describe("Custom color palette for chart series."),xAxisLabel:e.z.string().optional().describe("Label for the X axis."),yAxisLabel:e.z.string().optional().describe("Label for the Y axis."),showLegend:e.z.boolean().optional().describe("Show the chart legend."),showTooltip:e.z.boolean().optional().describe("Show tooltips on hover."),stacked:e.z.boolean().optional().describe("Stack series values instead of grouping them."),seriesNames:e.z.record(e.z.string()).optional().describe("Dictionary mapping series keys to custom labels.")})}),Te=e.z.object({...T,type:e.z.literal("MatchPairs"),instructions:e.z.string().optional().describe("Instruction text."),pairs:e.z.array(le).describe("Array of pair objects."),theme:V.optional()}),Ce=e.z.object({...T,type:e.z.literal("Cloze"),templateText:e.z.string().optional().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),theme:F.optional(),mode:e.z.enum(["write","drag-drop"]).optional().describe("Input mode. Default: write.")}),ze=e.z.object({...T,type:e.z.literal("CardDeck"),cards:e.z.array(se).describe("Array of card objects."),backImage:S.optional().describe("Shared back image for all cards."),discardLogic:e.z.enum(["delete","return"]).describe("What happens to a card after it's used: delete it or return it to the deck."),theme:Q.optional()}),we=e.z.object({...Y,type:e.z.literal("Shape"),shapeType:Bt.optional().describe("Shape outline to render."),text:e.z.string().optional().describe("Text inside shape."),theme:G.optional()}),Ae=e.z.object({...Y,type:e.z.literal("Arrow"),startBlockId:e.z.string().describe("ID of the block this arrow starts from."),endBlockId:e.z.string().optional().describe("ID of the block this arrow ends at, if connected to a block."),endPos:e.z.object({x:e.z.number(),y:e.z.number()}).optional().describe("Free-floating end point coordinates, used when not connected to a block."),startHandle:e.z.enum(["top","right","bottom","left"]).describe("Anchor side on the start block."),endHandle:e.z.enum(["top","right","bottom","left"]).optional().describe("Anchor side on the end block."),connectionType:e.z.enum(["straight","orthogonal","curved"]).describe("Line routing style."),strokeColor:e.z.string().optional().describe("Line color."),strokeWidth:e.z.number().optional().describe("Line thickness in pixels."),strokeStyle:e.z.enum(["solid","dashed","dotted"]).optional().describe("Line dash style."),showHead:e.z.boolean().optional().describe("Show arrowheads on the line."),startHead:He.optional().describe("Arrowhead style at the start."),endHead:He.optional().describe("Arrowhead style at the end."),bendOffsetX:e.z.number().optional().describe("Manual bend offset on the x axis, for curved/orthogonal routing."),bendOffsetY:e.z.number().optional().describe("Manual bend offset on the y axis, for curved/orthogonal routing."),segmentCount:e.z.number().optional().describe("Number of segments for orthogonal routing."),bendOffsets:e.z.array(e.z.number()).optional().describe("Per-segment bend offsets for orthogonal routing."),labels:e.z.array(xt).optional().describe("Text labels placed along the arrow.")}),Ge=e.z.discriminatedUnion("type",[pe,me,de,ue,he,ye,fe,be,ge,q,J,Se,ke,Be,xe,Te,we,Ae,Ce,ze]),zt=e.z.object({id:e.z.string(),name:e.z.string(),locked:e.z.boolean().optional()}),wt=e.z.object({id:e.z.string(),title:e.z.string(),type:ut,background:e.z.union([e.z.string(),e.z.array(e.z.string()),S]).optional(),backgroundColor:e.z.string().optional(),backgroundAutoplay:e.z.boolean().optional(),backgroundLoop:e.z.boolean().optional(),secretCode:e.z.string().optional(),hidden:e.z.boolean().optional(),blocks:e.z.array(Ge),groups:e.z.array(zt).optional(),canvas:e.z.object({width:e.z.number().optional(),height:e.z.number().optional(),preset:e.z.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()}),Ut=e.z.object({id:e.z.string(),title:e.z.string(),schemaVersion:e.z.number().optional(),hasTimer:e.z.boolean(),timer:e.z.string().optional(),allowNavigation:e.z.boolean(),scenes:e.z.array(wt),variables:e.z.array(e.z.object({name:e.z.string(),defaultValue:e.z.union([e.z.string(),e.z.number(),e.z.boolean()])})).optional(),audio:e.z.array(e.z.object({id:e.z.string(),media:S.optional(),scenes:e.z.string().optional(),autoplay:e.z.boolean().optional(),loop:e.z.boolean().optional()})).optional()}),Xt=e.z.object({id:e.z.string(),type:e.z.literal("BLOCK"),sceneId:e.z.string(),blockData:Ge});var eo={type:"Quiz",contentSchema:pe,themeSchema:E,defaultContent:{id:"",type:"Quiz",title:"Quiz",rotation:0,size:{width:300,height:200},questions:[],theme:{layout:"vertical",preset:"default"}},capabilities:{hasActions:!0,hasScore:!0,collections:{questions:$},styleTargets:{title:["question"],answers:["answers"],button:["button"],general:["general"]},styleKeys:["general","question","answers","button"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var to={type:"Editor",contentSchema:de,themeSchema:L,defaultContent:{id:"",type:"Editor",title:"Editor",rotation:0,size:{width:100,height:50}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["editor"],answers:["editor"],general:["editor"]},styleKeys:["editor"],vrMode:"raster",analytics:{scorable:!1}},version:1};var oo={type:"Hotpoint",contentSchema:me,themeSchema:M,defaultContent:{id:"",type:"Hotpoint",title:"Hotpoint",rotation:0,size:{width:50,height:50},element:"button"},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},styleKeys:["hotpoint"],vrMode:"custom",analytics:{scorable:!1}},version:1};var ro={type:"Embed",contentSchema:ue,defaultContent:{id:"",type:"Embed",title:"Embed",rotation:0,size:{width:250,height:150}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var no={type:"Media",contentSchema:he,defaultContent:{id:"",type:"Media",title:"Media",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var io={type:"DragAndDrop",contentSchema:ye,themeSchema:O,defaultContent:{id:"",type:"DragAndDrop",title:"DragAndDrop",rotation:0,size:{width:150,height:150},groups:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{groups:ne},styleTargets:{title:["title"],answers:["item"],general:["container"]},styleKeys:["container","title","sandbox","groups","item","group"],vrMode:"raster",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var ao={type:"Anagram",contentSchema:fe,themeSchema:_,defaultContent:{id:"",type:"Anagram",title:"Anagram",rotation:0,size:{width:150,height:100},letters:[],correctWord:""},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["letterText"],answers:["letter","slot"],general:["container"]},styleKeys:["container","letter","letterText","slot"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var co={type:"Dice",contentSchema:be,themeSchema:P,defaultContent:{id:"",type:"Dice",title:"Dice",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},styleKeys:["container","button","buttonText"],vrMode:"interactive",analytics:{scorable:!1}},version:1};var br=q.shape.words.unwrap().element,so={type:"Crossword",contentSchema:q,themeSchema:R,defaultContent:{id:"",type:"Crossword",title:"Crossword",rotation:0,size:{width:300,height:300}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:br},styleTargets:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},styleKeys:["grid","cell","text","clueContainer","clueTitle","clueText"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var gr=J.shape.words.unwrap().element,lo={type:"WordSearch",contentSchema:J,themeSchema:N,defaultContent:{id:"",type:"WordSearch",title:"WordSearch",rotation:0,size:{width:500,height:400}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:gr},styleTargets:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},styleKeys:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var po={type:"Puzzle",contentSchema:ge,defaultContent:{id:"",type:"Puzzle",title:"Puzzle",rotation:0,size:{width:250,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!0}},version:1};var mo={type:"Memory",contentSchema:Se,themeSchema:W,defaultContent:{id:"",type:"Memory",title:"Memory",rotation:0,size:{width:400,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:ie},styleTargets:{title:["text"],answers:["card"],general:["container"]},styleKeys:["container","card","text","infoContainer","infoText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var ho={type:"Flashcard",contentSchema:ke,themeSchema:H,defaultContent:{id:"",type:"Flashcard",title:"Flashcard",rotation:0,size:{width:400,height:300},cards:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:ce},styleTargets:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},styleKeys:["cardFront","cardBack","frontText","backText","navigation","navigationText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var uo={type:"SpinningWheel",contentSchema:Be,themeSchema:K,defaultContent:{id:"",type:"SpinningWheel",title:"SpinningWheel",rotation:0,size:{width:350,height:450},slices:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{slices:ae},styleTargets:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},styleKeys:["wheelText"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var yo={type:"Chart",contentSchema:xe,defaultContent:{id:"",type:"Chart",title:"Chart",rotation:0,size:{width:300,height:200},chartType:"bar",chartData:[],chartConfig:{}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var fo={type:"MatchPairs",contentSchema:Te,themeSchema:V,defaultContent:{id:"",type:"MatchPairs",title:"MatchPairs",rotation:0,size:{width:600,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:le},styleTargets:{title:["text"],answers:["card"],general:["container"]},styleKeys:["container","card","text"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var bo={type:"Shape",contentSchema:we,themeSchema:G,defaultContent:{id:"",type:"Shape",title:"Shape",rotation:0,size:{width:50,height:50}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:{title:["shape"],answers:["shape"],general:["shape"]},styleKeys:["shape"],vrMode:"raster",analytics:{scorable:!1}},version:1};var go={type:"Arrow",contentSchema:Ae,defaultContent:{id:"",type:"Arrow",title:"Arrow",rotation:0,startBlockId:"",startHandle:"top",connectionType:"straight",strokeColor:"#000000",strokeWidth:2,showHead:!0},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var So={type:"Cloze",contentSchema:Ce,themeSchema:F,defaultContent:{id:"",type:"Cloze",title:"Cloze",rotation:0,size:{width:450,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["text"],answers:["word","blank"],general:["container"]},styleKeys:["container","text","wordBank","word","blank"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var ko={type:"CardDeck",contentSchema:ze,themeSchema:Q,defaultContent:{id:"",type:"CardDeck",title:"CardDeck",rotation:0,size:{width:180,height:260},cards:[],discardLogic:"delete"},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:se},styleTargets:{title:["cardText"],answers:["card"],general:["container"]},styleKeys:["container","card","cardText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var z={Quiz:eo,Editor:to,Hotpoint:oo,Embed:ro,Media:no,DragAndDrop:io,Anagram:ao,Dice:co,Crossword:so,WordSearch:lo,Puzzle:po,Memory:mo,Flashcard:ho,SpinningWheel:uo,Chart:yo,MatchPairs:fo,Shape:bo,Arrow:go,Cloze:So,CardDeck:ko};function Bo(o){return z[o]}var De=Object.fromEntries(w.flatMap(o=>{let n=z[o].capabilities.styleTargets;return n&&Object.keys(n).length>0?[[o.toLowerCase(),n]]:[]}));function xo(o){let n=De[o.toLowerCase()];if(!n)return[];let i=new Set;for(let c of Object.values(n))for(let a of c??[])i.add(a);return[...i]}var At=Object.fromEntries(w.flatMap(o=>{let n=z[o].capabilities.styleKeys;return n&&n.length>0?[[o.toLowerCase(),n]]:[]})),Dt=new Set(["chart","media","image","puzzle"]);function To(o){if(!o)return"";let n=o.toLowerCase();if(Dt.has(n))return`
|
|
2
|
+
[STYLE TARGETS] Il blocco "${o}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let i=At[n];if(!i||i.length===0)return"";let c=De[n]??{},a=["general","title","answers","button"].filter(l=>c[l]).map(l=>`${l}\u2192${c[l].join("/")}`).join(", ");return`
|
|
3
|
+
[STYLE TARGETS for ${o}] Logical targets (update_block_theme): ${a}. Real sub-element keys (update_block_style 'target'): ${i.join(", ")}.`}function $e(o,n){if(!o)return o;let i={...o};for(let[h,u]of Object.entries(i))if(u&&typeof u=="object"){let y={...u},f=!1;y.backgroundColor!==void 0&&y.background===void 0&&(y.background=!0,f=!0),y.borderColor!==void 0&&y.border===void 0&&(y.border=!0,f=!0),f&&(i[h]=y)}if(!n)return i;let c=De[n.toLowerCase()];if(!c)return i;let a=(h,u)=>{u&&(i[h]={...i[h]||{},...u})},l=["title","answers","button","general"],s={title:i.title,answers:i.answers,button:i.button??i.buttons,general:i.general};for(let h of l){let u=s[h],y=c[h];if(u&&y)for(let f of y)a(f,u)}return i}function Co(o,n,i){if(!o){let s={...n};return s.styles&&(s.styles=$e(s.styles,i)),s}if(!n)return o;let c={...o,...n},a=$e(n.styles,i),l=o.styles||{};if(o.styles||a){c.styles={...l,...a};for(let s of Object.keys(c.styles))l[s]&&a?.[s]&&(c.styles[s]={...l[s],...a[s]})}return c}var C=require("zod"),It=C.z.object({id:C.z.string(),type:C.z.string(),title:C.z.string()}),jt=C.z.object({id:C.z.string(),title:C.z.string(),position:C.z.number(),blocks:C.z.array(It).default([])}),zo=C.z.object({activity:C.z.object({id:C.z.string(),title:C.z.string(),scenes:C.z.array(jt).default([])}),activeSceneId:C.z.string().nullable().optional()});var Do=Fo(require("zod-to-json-schema"));var Ye=Object.fromEntries(w.map(o=>[o,z[o].contentSchema])),wo=Object.fromEntries(w.map(o=>[o,z[o].capabilities.styleTargets??{}])),Ao=w.filter(o=>z[o].capabilities.analytics?.scorable===!0);var Sr=Do.zodToJsonSchema,Z=Ye;function kr(o,n,i,c){let a=i?"*required*":"optional",l=vt(n),s=n.description?` \u2014 ${n.description}`:"";return`${c}- \`${o}\` (${l}, ${a})${s}`}function vt(o){return o.enum?`enum: ${o.enum.map(n=>JSON.stringify(n)).join(" | ")}`:o.anyOf||o.oneOf?(o.anyOf||o.oneOf).map(vt).join(" | "):Array.isArray(o.type)?o.type.join(" | "):o.type==="array"&&o.items?`array<${vt(o.items)}>`:o.type==="object"?"object":o.type??"any"}function Mt(o,n){let i=[],c=new Set(o.required??[]),a=o.properties??{};for(let[l,s]of Object.entries(a))i.push(kr(l,s,c.has(l),n)),s.type==="object"&&s.properties?i.push(Mt(s,n+" ")):s.type==="array"&&s.items?.type==="object"&&i.push(Mt(s.items,n+" "));return i.join(`
|
|
4
|
+
`)}function Io(o={}){let n=[],i=new Map,c=Object.fromEntries(Ve.map(a=>[a,!0]));for(let[a,l]of Object.entries(Z)){let s=o.contentOnly?l.omit(c):l,h=i.get(s)??[];h.push(a),i.set(s,h)}for(let[a,l]of i.entries()){let s=l.join(" / "),h=Sr(a,{target:"jsonSchema7"}),u=Mt(h,"");n.push(`### ${s}
|
|
5
|
+
${u||"_(no configurable fields)_"}`)}return n.join(`
|
|
6
6
|
|
|
7
|
-
`)}var
|
|
7
|
+
`)}var qe=1,jo="__blockSchemaVersion",Ie=class extends Error{constructor(n){super(n),this.name="ActivityContentMigrationError"}};function vo(o,n=z){if(typeof o!="object"||o===null||Array.isArray(o))throw new Ie(`migrateActivityContent expects a non-null, non-array object; got ${o===null?"null":typeof o}`);let i=[],c=!1,a=o,s=(Array.isArray(a.scenes)?a.scenes:[]).map((u,y)=>{if(typeof u!="object"||u===null||Array.isArray(u))return i.push(`scenes[${y}]: not an object, left intact`),u;let f=u,B=Array.isArray(f.blocks)?f.blocks:[],A=!1,Je=B.map((U,je)=>{if(typeof U!="object"||U===null||Array.isArray(U))return i.push(`scenes[${y}].blocks[${je}]: not an object, left intact`),U;let X=U,ee=X.type,Ze=typeof ee=="string"?n[ee]:void 0;if(!Ze)return i.push(`scenes[${y}].blocks[${je}]: unknown block type "${String(ee)}", left intact`),X;let Ot=X[jo],I=typeof Ot=="number"?Ot:1,Ue=X,Lt=!1;for(;I<Ze.version;){let _t=Ze.migrations?.[I];if(!_t){i.push(`scenes[${y}].blocks[${je}]: missing migration from v${I} for type "${ee}", stopped at v${I}`);break}let ve=_t(Ue);if(typeof ve!="object"||ve===null||Array.isArray(ve)){i.push(`scenes[${y}].blocks[${je}]: migration from v${I} for type "${ee}" returned a non-object, stopped at v${I}`);break}Ue={...ve},Lt=!0,I+=1}return Lt?(A=!0,{...Ue,[jo]:I}):X});return A?(c=!0,{...f,blocks:Je}):f});return a.schemaVersion!==qe&&(c=!0),{content:{...a,scenes:s,schemaVersion:qe},changed:c,issues:i}}var Mo=o=>{if(typeof o!="object"||o===null||Array.isArray(o))return o;let n=o;if(!Array.isArray(n.actions))return o;let i=n.actions.map(c=>{if(typeof c!="object"||c===null||Array.isArray(c))return c;let a=c;if(a.condition===void 0||Array.isArray(a.conditions))return a;let{condition:l,...s}=a;return{...s,conditions:[l],conditionsOperator:a.conditionsOperator??"and"}});return{...n,actions:i}};function Br(){return w.map(o=>{let n=z[o];return{type:o,version:n.version,hasActions:n.capabilities.hasActions,hasScore:n.capabilities.hasScore,collections:Object.keys(n.capabilities.collections??{}),styleTargets:n.capabilities.styleTargets??{},vrMode:n.capabilities.vrMode}})}var Et=/@\[([^\]|]+)\|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\]/g;function xr(o){let n=[];for(let i of(o??"").matchAll(Et))n.push({name:i[1].trim(),id:i[2]});return n}function Tr(o,n){let i=new Map,c=new Map;for(let f of n?.scenes??[]){f?.id&&i.set(f.id,f);for(let B of f?.blocks??[])B?.id&&c.set(B.id,{block:B,sceneId:f.id})}let a=[],l=new Set,s=f=>c.has(f)?"il blocco selezionato":i.has(f)?"la scena selezionata":"l'elemento selezionato",h=(f,B)=>{if(!l.has(B))if(c.has(B)){let{block:A,sceneId:Je}=c.get(B);a.push({id:B,name:f,kind:"block",blockType:A?.type,sceneId:Je}),l.add(B)}else i.has(B)&&(a.push({id:B,name:f,kind:"scene"}),l.add(B))},u=(o??"").replace(Et,(f,B,A)=>(h(B.trim(),A),B.trim())),y=(o??"").replace(Et,(f,B,A)=>c.has(A)||i.has(A)?s(A):B.trim());return{cleanedText:u,agentText:y,entities:a}}var Eo=require("zod-to-json-schema");function Oo(){return Object.keys(Z)}function Lo(o){let n=Z[o];if(n)return(0,Eo.zodToJsonSchema)(n,{target:"jsonSchema7",$refStrategy:"none"})}function Cr(){return Object.fromEntries(Oo().map(o=>[o,Lo(o)]))}0&&(module.exports={ActionBlockSchema,ActionConditionSchema,ActionSchema,ActionTypeSchema,ActionVariableSchema,ActivityContentMigrationError,ActivityContentSchema,ActivityContextSchema,ActivityVariableSchema,AnagramBlockSchema,AnagramBlockThemeSchema,AnimationSchema,ArrowBlockSchema,ArrowHeadTypeSchema,ArrowLabelSchema,BASE_BLOCK_FIELDS,BLOCK_CONTENT_SCHEMAS,BLOCK_REGISTRY,BLOCK_STYLE_KEYS,BLOCK_TYPES,BlockEventSchema,BlockEventTypeSchema,BlockGroupSchema,BlockSchema,BlockThemeSchema,BlockTypeSchema,BoxSideSchema,BoxStylesSchema,CANVAS_OP_NAMES,CANVAS_OP_REQUIRED,CURRENT_SCHEMA_VERSION,CanvasDragItemSchema,CanvasOpSchema,CardDeckBlockSchema,CardDeckBlockThemeSchema,CardItemSchema,ChartBlockSchema,ChoiceQuestionSchema,ClickConditionSchema,ClozeBlockSchema,ClozeBlockThemeSchema,ConditionOperatorSchema,CropDataSchema,CrosswordBlockSchema,CrosswordBlockThemeSchema,CrosswordCellSchema,CrosswordLayoutOutputSchema,CrosswordLayoutWordSchema,DiceBlockSchema,DiceBlockThemeSchema,DiceTypeSchema,DragAndDropBlockSchema,DragAndDropBlockThemeSchema,DragAndDropGroupSchema,DragAndDropItemSchema,EditorBlockSchema,EditorBlockThemeSchema,EmbedBlockSchema,FlashcardBlockSchema,FlashcardBlockThemeSchema,FlashcardContentSchema,FlashcardItemSchema,GridSizeSchema,HotpointBlockSchema,HotpointBlockThemeSchema,ImageAlignSchema,ImageSizeSchema,KeyPressConditionSchema,MatchPairsBlockSchema,MatchPairsBlockThemeSchema,MatchPairsPairSchema,MathOperationSchema,MediaBlockSchema,MediaItemSchema,MediaRefSchema,MediaSourceSchema,MediaTypeSchema,MemoryBlockSchema,MemoryBlockThemeSchema,MemoryPairSchema,PositionSchema,PuzzleBlockSchema,PuzzleGameModeSchema,QuestionOptionSchema,QuestionSchema,QuestionTypeSchema,QuizBlockSchema,QuizBlockThemeSchema,QuizConditionSchema,REGISTRY_CONTENT_SCHEMAS,REGISTRY_STYLE_TARGETS,RadiusSchema,SCORABLE_BLOCK_TYPES,STYLE_TARGET_MAP,SceneBlockRefSchema,SceneSchema,SceneSummarySchema,SceneTypeSchema,ShapeBlockSchema,ShapeBlockThemeSchema,ShapeTypeSchema,SizeSchema,SpinningWheelBlockSchema,SpinningWheelBlockThemeSchema,TextQuestionSchema,TextStylesSchema,TimerConditionSchema,TrueFalseQuestionSchema,UNSTYLEABLE_BLOCKS,VideoSettingsSchema,WheelSliceSchema,WordSearchBlockSchema,WordSearchBlockThemeSchema,WordSearchDataSchema,WordSearchDifficultySchema,actionsV1toV2,applyItemPatch,createCanvasOpValidator,defineBlock,detectConflict,entitySignature,generateBlockReference,getAllBlockJsonSchemas,getBlockDefinition,getBlockJsonSchema,getCapabilitiesManifest,isKnownCanvasOp,listBlockTypes,mapLogicalThemeStyles,mergeTheme,migrateActivityContent,opConflictStamp,opTarget,parseMentions,realStyleKeysFor,resolveMentions,stableStringify,styleTargetsHelpFor,validateCanvasOp});
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var _e={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},nr=Object.keys(_e);function no(o){return Object.prototype.hasOwnProperty.call(_e,o)}function ir(o,i){if(!no(o))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${o}"`]};if(typeof i!="object"||i===null||Array.isArray(i))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let n=i,c=_e[o].filter(a=>n[a]===void 0||n[a]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(a=>`missing field: ${a}`)}:o==="groupBlocks"&&(!Array.isArray(n.blockIds)||n.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function ar(o,i,n){let c=Array.isArray(o)?[...o]:[];if(i==="insertItem"){if(n.item===void 0||n.item===null)return c;let a=typeof n.at=="number"?n.at:c.length;return c.splice(Math.max(0,Math.min(a,c.length)),0,n.item),c}return i==="updateItem"?c.map(a=>a&&typeof a=="object"&&a.id===n.itemId?{...a,...n.item??{}}:a):c.filter(a=>!(a&&typeof a=="object"&&a.id===n.itemId))}import{z as r}from"zod";var I=()=>r.record(r.string(),r.unknown()),io=r.object({scene:I().optional(),newIndex:r.number().optional()}).passthrough(),ao=r.object({sceneId:r.string()}),co=r.object({sceneId:r.string(),block:I()}),so=r.object({sceneId:r.string(),updates:I().optional(),newIndex:r.number().optional()}),lo=r.object({sceneId:r.string(),blockId:r.string()}),po=r.object({sceneId:r.string(),blockId:r.string(),updates:I()}),mo=r.object({sceneId:r.string(),blockId:r.string()}),ho=r.object({blockIds:r.array(r.string())}),uo=r.object({sceneId:r.string(),blockId:r.string(),theme:I()}),fo=r.object({sceneId:r.string(),blockId:r.string(),elementId:r.string(),customStyle:I()}),yo=r.object({sceneId:r.string(),blockId:r.string(),action:I()}),bo=r.object({sceneId:r.string(),blockId:r.string(),actionId:r.string()}),go=r.object({operation:r.string(),name:r.string(),defaultValue:r.unknown().optional()}).passthrough(),So=r.object({scope:r.string().optional(),sceneId:r.string().optional(),blockId:r.string().optional(),hasTimer:r.boolean().optional(),timer:r.unknown().optional()}).passthrough(),ko=r.object({sceneId:r.string(),newIndex:r.number()}),xo=r.object({sceneId:r.string().optional(),blockId:r.string(),collection:r.string(),item:r.unknown(),at:r.number().optional()}),Bo=r.object({sceneId:r.string().optional(),blockId:r.string(),collection:r.string(),itemId:r.string(),item:r.unknown()}),To=r.object({sceneId:r.string().optional(),blockId:r.string(),collection:r.string(),itemId:r.string()}),Co=r.object({activity:r.unknown()}),it=r.discriminatedUnion("action",[r.object({action:r.literal("createScene"),data:io}),r.object({action:r.literal("deleteScene"),data:ao}),r.object({action:r.literal("addBlock"),data:co}),r.object({action:r.literal("updateScene"),data:so}),r.object({action:r.literal("deleteBlock"),data:lo}),r.object({action:r.literal("updateBlock"),data:po}),r.object({action:r.literal("duplicateBlock"),data:mo}),r.object({action:r.literal("groupBlocks"),data:ho}),r.object({action:r.literal("updateBlockTheme"),data:uo}),r.object({action:r.literal("updateBlockElementStyle"),data:fo}),r.object({action:r.literal("addAction"),data:yo}),r.object({action:r.literal("removeAction"),data:bo}),r.object({action:r.literal("manageVariables"),data:go}),r.object({action:r.literal("configureTimer"),data:So}),r.object({action:r.literal("reorderScenes"),data:ko}),r.object({action:r.literal("insertItem"),data:xo}),r.object({action:r.literal("updateItem"),data:Bo}),r.object({action:r.literal("deleteItem"),data:To}),r.object({action:r.literal("replaceActivity"),data:Co})]);import{z as wo}from"zod";function re(o){return o.issues.map(i=>{let n=i.path.join(".");return n?`${n}: ${i.message}`:i.message})}function dr(o,i){return n=>{let c=it.safeParse(n);if(!c.success)return{ok:!1,code:"SHAPE_INVALID",errors:re(c.error)};let{action:a,data:l}=c.data;if(a==="addBlock"){let s=l.block,h=typeof s.type=="string"?s.type:void 0,u=h?o.getContentSchema(h):void 0;if(!h||!u)return{ok:!1,code:"UNKNOWN_BLOCK_TYPE",errors:[`addBlock: unknown block type "${String(s.type)}"`]};let f=u.safeParse(s);return f.success?{ok:!0}:{ok:!1,code:"CONTENT_INVALID",errors:re(f.error)}}if(a==="insertItem"||a==="updateItem"||a==="deleteItem"){let s=i?.(l.blockId);if(!s)return{ok:!0};let h=o.getCollectionSchema(s,l.collection);if(!h)return{ok:!1,code:"UNKNOWN_COLLECTION",errors:[`unknown collection "${l.collection}" for block type "${s}"`]};if(a==="insertItem"||a==="updateItem"){let u=h.safeParse(l.item);if(!u.success)return{ok:!1,code:"ITEM_INVALID",errors:re(u.error)}}return{ok:!0}}if(a==="updateBlock"){let s=i?.(l.blockId),h=s?o.getContentSchema(s):void 0;if(!h)return{ok:!0};if(h instanceof wo.ZodObject){let f=h.deepPartial().safeParse(l.updates);if(!f.success)return{ok:!1,code:"CONTENT_INVALID",errors:re(f.error)}}return{ok:!0}}return{ok:!0}}}var zo=new Set(["position","size","rotation","zIndex","z"]);function ne(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?"["+o.map(ne).join(",")+"]":"{"+Object.keys(o).sort().map(n=>JSON.stringify(n)+":"+ne(o[n])).join(",")+"}"}function Ao(o,i){let n=i??{};switch(o){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return n.blockId?{kind:"block",blockId:n.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return n.blockId&&n.collection&&n.itemId?{kind:"item",blockId:n.blockId,collection:n.collection,itemId:n.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function Do(o,i){if(Array.isArray(o))for(let n of o){let c=n?.blocks?.find?.(a=>a&&a.id===i);if(c)return c}}function Io(o,i){if(i.kind==="untracked")return null;let n=i.blockId?Do(o,i.blockId):void 0;if(!n)return null;if(i.kind==="block"){let l={};for(let s of Object.keys(n))zo.has(s)||(l[s]=n[s]);return ne(l)}let c=n[i.collection];if(!Array.isArray(c))return null;let a=c.find(l=>l&&l.id===i.itemId);return a?ne(a):null}function ur(o,i){return o==null?"apply":i==null?"missing":o===i?"apply":"stale"}function fr(o,i,n){let c=Ao(o,i);return{target:c,baseSignature:Io(n,c)}}import{z as jo}from"zod";var j=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],Le=jo.enum(j);import{z as m}from"zod";var Re=m.object({x:m.number(),y:m.number(),z:m.number().optional()}),P=m.object({width:m.number().optional(),height:m.number().optional()}),ie=m.object({rows:m.number(),cols:m.number()}),ae=m.enum(["image","color","gif","shape","illustration","video","audio"]),at=m.enum(["unsplash","pexels","upload","url","library","tenor"]),ct=m.object({x:m.number(),y:m.number(),width:m.number(),height:m.number(),zoom:m.number().optional(),rotation:m.number().optional(),aspect:m.number().optional()}),st=m.object({autoplay:m.boolean().optional(),loop:m.boolean().optional(),muted:m.boolean().optional(),controls:m.boolean().optional(),poster:m.string().optional(),volume:m.number().optional()}),S=m.object({id:m.string().optional(),url:m.string().optional(),title:m.string().optional(),type:ae.describe("Media type (image, color, gif, shape, illustration, video, audio)."),source:at.optional(),alt:m.string().optional(),width:m.number().optional(),height:m.number().optional(),format:m.enum(["cover","contain"]).optional(),color:m.string().optional(),cropData:ct.optional(),duration:m.number().optional(),videoSettings:st.optional()}),vo=S;import{z as t}from"zod";var lt=t.object({type:t.union([t.enum(["none","fade","direction","bounce","scale","rotate"]),t.string()]),duration:t.number().optional(),delay:t.number().optional(),phase:t.enum(["in","both","out"]).optional(),direction:t.enum(["up","right","down","left"]).optional()}),Ne=t.object({top:t.union([t.string(),t.number()]).optional(),right:t.union([t.string(),t.number()]).optional(),bottom:t.union([t.string(),t.number()]).optional(),left:t.union([t.string(),t.number()]).optional()}),pt=t.object({topLeft:t.union([t.string(),t.number()]).optional(),topRight:t.union([t.string(),t.number()]).optional(),bottomRight:t.union([t.string(),t.number()]).optional(),bottomLeft:t.union([t.string(),t.number()]).optional()}),d=t.object({background:t.boolean().optional(),backgroundColor:t.string().optional(),backgroundOpacity:t.number().optional(),backgroundMedia:S.optional(),border:t.boolean().optional(),borderColor:t.string().optional(),borderWidth:Ne.optional(),borderRadius:pt.optional(),padding:t.union([t.string(),t.number(),Ne]).optional()}),b=t.object({color:t.string().optional(),fontSize:t.number().optional(),fontFamily:t.string().optional(),fontStyle:t.string().optional(),fontWeight:t.union([t.string(),t.number()]).optional(),textAlign:t.enum(["left","center","right","justify"]).optional()}),z=d.merge(b),B=t.object({spacing:t.enum(["no-spacing","small","medium","large"]).optional(),animation:lt.optional(),styles:t.record(t.record(t.any())).optional()}),_=B.extend({styles:t.object({hotpoint:t.object({icon:t.string().optional(),iconPosition:t.enum(["left","right"]).optional(),iconSize:t.string().optional(),iconColor:t.string().optional(),image:S.optional(),imageFormat:t.enum(["circle","square","custom"]).optional(),border:t.boolean().optional(),borderColor:t.string().optional(),borderWidth:t.string().optional(),borderRadius:t.string().optional(),glow:t.boolean().optional(),glowColor:t.string().optional(),background:t.boolean().optional(),backgroundColor:t.string().optional(),fontSize:t.number().optional(),fontFamily:t.string().optional(),fontStyle:t.string().optional(),textColor:t.string().optional()}).optional()}).optional()}),L=B.extend({layout:t.enum(["horizontal","vertical","grid"]),gridColumns:t.number().optional(),preset:t.enum(["default","modern","trivia","custom"]),styles:t.object({general:z,question:z,answers:z.extend({customStyles:t.array(t.object({color:t.string().optional(),backgroundColor:t.string().optional(),targets:t.string().optional()})).optional(),hover:z.optional()}),button:z.extend({variant:t.enum(["default","outline","ghost"]).optional(),hover:z.optional()})}).optional()}),R=B.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),splitRatio:t.number().optional(),gridColumns:t.number().optional(),gridGap:t.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:t.object({x:t.number().optional(),y:t.number().optional(),width:t.number().optional(),height:t.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:t.object({title:b.optional(),sandbox:d.optional(),item:z.optional(),group:d.optional(),container:d.extend({url:t.string().optional(),type:ae.optional()}).optional(),groups:z.optional(),feedback:t.object({correct:t.string().optional(),incorrect:t.string().optional(),active:t.string().optional()}).optional(),referenceSize:t.object({width:t.number(),height:t.number()}).optional()}).optional()}),N=B.extend({styles:t.object({editor:d.optional()}).optional()}),W=B.extend({styles:t.object({letter:d.optional(),letterText:b.optional(),slot:d.optional(),container:d.optional()}).optional()}),F=B.extend({styles:t.object({button:d.extend({hover:z.optional()}).optional(),buttonText:b.optional(),container:d.optional()}).optional()}),Q=B.extend({primaryColor:t.string().optional(),layoutPosition:t.enum(["left","right","top","bottom"]).optional(),splitRatio:t.number().optional(),styles:t.object({text:b.optional(),cell:d.optional(),grid:d.optional(),clueContainer:d.optional(),clueText:b.optional(),clueTitle:b.optional()}).optional()}),K=B.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),splitRatio:t.number().optional(),styles:t.object({wordSearch:t.object({primaryColor:t.string().optional(),highlightColor:t.string().optional(),fontSize:t.number().optional(),fontFamily:t.string().optional(),textColor:t.string().optional(),cellBackgroundColor:t.string().optional()}).optional(),text:b.optional(),cell:d.optional(),grid:d.optional(),wordListContainer:d.optional(),wordListText:b.optional(),wordListTitle:b.optional()}).optional()}),V=B.extend({styles:t.object({text:b.optional(),container:d.optional(),infoContainer:d.optional(),infoText:b.optional(),card:d.optional()}).optional()}),H=B.extend({styles:t.object({wheelText:b.optional()}).optional()}),G=B.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),styles:t.object({text:b.optional(),container:d.optional(),wordBank:d.optional(),word:d.optional(),blank:d.optional()}).optional()}),$=B.extend({styles:t.object({card:d.optional(),cardText:b.optional(),container:d.optional()}).optional()}),q=B.extend({styles:t.object({cardFront:d.optional(),cardBack:d.optional(),frontText:b.optional(),backText:b.optional(),navigation:d.optional(),navigationText:b.optional()}).optional()}),Y=B.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),styles:t.object({text:b.optional(),card:d.optional(),container:d.optional()}).optional()}),J=B.extend({styles:t.object({shape:z.extend({fillColor:t.string().optional(),textColor:t.string().optional(),borderStyle:t.enum(["solid","dashed","dotted"]).optional(),padding:t.number().optional()}).optional()}).optional()});var ce={quiz:{title:["question"],answers:["answers"],button:["button"],general:["general"]},poll:{title:["question"],answers:["answers"],button:["button"],general:["general"]},flashcard:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},memory:{title:["text"],answers:["card"],general:["container"]},matchpairs:{title:["text"],answers:["card"],general:["container"]},cloze:{title:["text"],answers:["word","blank"],general:["container"]},carddeck:{title:["cardText"],answers:["card"],general:["container"]},anagram:{title:["letterText"],answers:["letter","slot"],general:["container"]},dice:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},crossword:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},wordsearch:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},spinningwheel:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},shape:{title:["shape"],answers:["shape"],general:["shape"]},hotpoint:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},editor:{title:["editor"],answers:["editor"],general:["editor"]},draganddrop:{title:["title"],answers:["item"],general:["container"]}};function Mo(o){let i=ce[o.toLowerCase()];if(!i)return[];let n=new Set;for(let c of Object.values(i))for(let a of c??[])n.add(a);return[...n]}var mt={quiz:["general","question","answers","button"],poll:["general","question","answers","button"],flashcard:["cardFront","cardBack","frontText","backText","navigation","navigationText"],memory:["container","card","text","infoContainer","infoText"],matchpairs:["container","card","text"],cloze:["container","text","wordBank","word","blank"],carddeck:["container","card","cardText"],anagram:["container","letter","letterText","slot"],dice:["container","button","buttonText"],crossword:["grid","cell","text","clueContainer","clueTitle","clueText"],wordsearch:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],spinningwheel:["wheelText"],shape:["shape"],editor:["editor"],hotpoint:["hotpoint"],draganddrop:["container","title","sandbox","groups","item","group"]},dt=new Set(["chart","media","image","puzzle"]);function Eo(o){if(!o)return"";let i=o.toLowerCase();if(dt.has(i))return`
|
|
2
|
-
[STYLE TARGETS] Il blocco "${o}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let
|
|
3
|
-
[STYLE TARGETS for ${o}] Logical targets (update_block_theme): ${a}. Real sub-element keys (update_block_style 'target'): ${n.join(", ")}.`}function We(o,i){if(!o)return o;let n={...o};for(let[h,u]of Object.entries(n))if(u&&typeof u=="object"){let f={...u},y=!1;f.backgroundColor!==void 0&&f.background===void 0&&(f.background=!0,y=!0),f.borderColor!==void 0&&f.border===void 0&&(f.border=!0,y=!0),y&&(n[h]=f)}if(!i)return n;let c=ce[i.toLowerCase()];if(!c)return n;let a=(h,u)=>{u&&(n[h]={...n[h]||{},...u})},l=["title","answers","button","general"],s={title:n.title,answers:n.answers,button:n.button??n.buttons,general:n.general};for(let h of l){let u=s[h],f=c[h];if(u&&f)for(let y of f)a(y,u)}return n}function Oo(o,i,n){if(!o){let s={...i};return s.styles&&(s.styles=We(s.styles,n)),s}if(!i)return o;let c={...o,...i},a=We(i.styles,n),l=o.styles||{};if(o.styles||a){c.styles={...l,...a};for(let s of Object.keys(c.styles))l[s]&&a?.[s]&&(c.styles[s]={...l[s],...a[s]})}return c}import{z as p}from"zod";var Qe=p.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),ht=p.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),Po=p.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),_o=p.enum(["completed","half_way"]),Lo=p.enum(["single_click","double_click"]),Ro=p.literal("key_pressed"),Fe=p.object({event:Qe.optional(),variableName:p.string().optional(),operator:ht.optional(),value:p.any()}),ut=p.enum(["set","add","subtract","multiply","divide"]),ft=p.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),yt=p.object({name:p.string(),value:p.union([p.number(),p.string(),p.boolean()]),operation:ut.optional()}),Ke=p.object({id:p.string(),type:ft,condition:Fe.optional(),conditions:p.array(Fe).optional(),conditionsOperator:p.enum(["and","or"]).optional(),modalContent:p.string().optional(),audioUrl:p.string().optional(),linkUrl:p.string().optional(),targetSceneId:p.string().optional(),targetBlockId:p.string().optional(),direction:p.enum(["up","down","left","right"]).optional(),distance:p.number().optional(),variable:yt.optional()}),No=p.object({name:p.string(),defaultValue:p.union([p.string(),p.number(),p.boolean()])}),Wo=p.object({type:Qe,blockId:p.string(),data:p.record(p.any()).optional()});import{z as g}from"zod";var Fo=g.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),Ve=g.enum(["left","right","center"]),He=g.object({width:g.number().optional(),height:g.number().optional()}),bt=g.object({id:g.string(),text:g.string().describe("The option's answer text."),isCorrect:g.boolean().describe("Whether this option is a correct answer."),image:S.optional().describe("Option image."),imageAlign:Ve.optional().describe("Option image alignment."),imageSize:He.optional().describe("Option image size.")}),Ge={id:g.string(),text:g.string().describe("The question text."),score:g.number().optional(),image:S.optional().describe("Question image."),imageAlign:Ve.optional().describe("Question image alignment."),imageSize:He.optional().describe("Question image size.")},gt=g.object({...Ge,type:g.enum(["single-choice","multiple-choice"]),options:g.array(bt).describe("Answer options for this choice question.")}),St=g.object({...Ge,type:g.literal("true-false"),correctAnswer:g.boolean().describe("The correct answer (true or false).")}),kt=g.object({...Ge,type:g.enum(["short-answers","long-answers"]),minCharacters:g.number().optional().describe("Minimum number of characters required in the answer."),maxCharacters:g.number().optional().describe("Maximum number of characters allowed in the answer.")}),Z=g.discriminatedUnion("type",[gt,St,kt]);import{z as e}from"zod";var xt=e.enum(["2D","360\xB0"]),v={id:e.string(),type:Le,title:e.string(),showTitle:e.boolean().optional(),locked:e.boolean().optional(),groupId:e.string().optional(),position:Re.optional(),rotation:e.number(),hidden:e.boolean().optional(),draggable:e.boolean().optional(),size:P.optional(),minSize:P.optional(),maxSize:P.optional(),theme:B.optional()},T={...v,actions:e.array(Ke).optional(),score:e.number().optional()},Ye=Object.freeze(Object.keys(v)),Qo=e.object(T),Bt=e.object({id:e.string(),text:e.string(),background:S.optional().describe("Background image/color for item."),opacity:e.number().optional().describe("Opacity of the item (0-1)."),x:e.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.number().optional().describe("Manual width in pixels."),height:e.number().optional().describe("Manual height in pixels."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles.")}),se=e.object({id:e.string(),name:e.string().describe("Group/dropzone name."),background:S.optional().describe("Background image/color for group."),x:e.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.number().optional().describe("Manual width in pixels."),height:e.number().optional().describe("Manual height in pixels."),singleItem:e.boolean().optional().describe("Accept only one item inside."),opacity:e.number().optional().describe("Opacity of the group (0-1)."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles."),items:e.array(Bt).describe("Items that belong in this group.")}),Tt=e.enum(["d4","d6","d8","d10","d12","d20"]),Ct=e.object({char:e.string(),isBlack:e.boolean(),number:e.number().optional(),row:e.number(),col:e.number()}),wt=e.object({answer:e.string(),clue:e.string(),image:S.optional(),startx:e.number(),starty:e.number(),orientation:e.enum(["across","down","none"]),position:e.number()}),zt=e.object({grid:e.array(e.array(Ct)),rows:e.number(),cols:e.number(),words:e.array(wt)}),At=e.object({grid:e.array(e.array(e.string())),placedWords:e.array(e.object({word:e.string(),clean:e.string(),path:e.array(e.object({x:e.number(),y:e.number()}))}))}),le=e.object({id:e.string(),type:e.enum(["img-img","img-word","word-word"]).describe("Pair type."),content:e.tuple([e.string(),e.string()]).describe("Pair content [item1, item2].")}),pe=e.object({id:e.string(),text:e.string(),color:e.string().optional().describe("CSS color for the slice."),image:S.optional().describe("Slice image.")}),$e=e.object({type:e.enum(["text","image"]).describe("Content type: text or image."),content:e.any().describe("The content value: a string for text, or a MediaItem for image.")}),me=e.object({id:e.string(),front:$e.describe("Front side."),back:$e.describe("Back side.")}),de=e.object({id:e.string(),frontImage:S.optional().describe("Front image."),frontText:e.string().optional().describe("Front text.")}),he=e.object({id:e.string(),leftLabel:e.string().describe("Left side text."),rightLabel:e.string().describe("Right side text."),leftImage:e.any().optional().describe("Left side image."),rightImage:e.any().optional().describe("Right side image.")}),Dt=e.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]),qe=e.enum(["none","arrow","circle","square"]),It=e.object({id:e.string(),text:e.string().describe("Label text."),t:e.number().describe("Position along the arrow path, from 0 (start) to 1 (end)."),offsetX:e.number().optional().describe("Pixel offset from the arrow path on the x axis."),offsetY:e.number().optional().describe("Pixel offset from the arrow path on the y axis."),fontSize:e.number().optional().describe("Label font size."),color:e.string().optional().describe("Label text color."),backgroundColor:e.string().optional().describe("Label background color.")}),ue=e.object({...T,type:e.literal("Quiz"),questions:e.array(Z).optional().describe("Array of question objects."),previewIndex:e.number().optional().describe("Index of the question currently previewed in the editor."),required:e.boolean().optional().describe("Whether answering this quiz is required to proceed."),showResults:e.boolean().optional().describe("Show correct/incorrect feedback after submitting."),allowRetry:e.boolean().optional().describe("Allow the learner to retry the quiz."),maxRetry:e.string().optional().describe("Maximum number of retry attempts allowed."),submitText:e.string().optional().describe("Label for submit button."),timer:e.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:e.boolean().optional().describe("Show current/total questions count."),theme:L}),fe=e.object({...T,type:e.literal("Hotpoint"),showIcon:e.boolean().optional().describe("Show an icon marker on the hotpoint."),element:e.enum(["image","button"]).describe("Underlying element type for the hotpoint."),theme:_.optional()}),ye=e.object({...T,type:e.literal("Editor"),content:e.any().optional().describe("Rich-text editor content (Plate.js JSON document)."),readonly:e.boolean().optional().describe("Make the editor content read-only during play."),theme:N.optional()}),be=e.object({...v,type:e.literal("Media"),media:S.optional().describe("Media asset displayed by this block.")}),ge=e.object({...v,type:e.literal("Embed"),url:e.string().optional().describe("Embed content URL."),readOnly:e.boolean().optional().describe("Prevent interaction with the embedded content.")}),Se=e.object({...T,type:e.literal("DragAndDrop"),groups:e.array(se).describe("Drag-and-drop groups."),theme:R.optional(),showResults:e.boolean().optional().describe("Show result feedback immediately."),layout:e.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:e.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside the sandbox."),groupBackground:S.optional().describe("Shared background image/color for all groups."),enableWrongAnswers:e.boolean().optional().describe("Allow placing items in incorrect groups."),itemBackground:S.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:e.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:e.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:e.number().optional().describe("Proportion ratio for split layout.")}),ke=e.object({...T,type:e.literal("Anagram"),letters:e.array(e.string()).describe("Letters to unscramble (shuffled tiles the learner rearranges)."),correctWord:e.string().describe("The correct word."),theme:W.optional(),clue:e.string().optional().describe("A hint."),allowRetry:e.boolean().optional().describe("Allow the learner to retry after an incorrect answer."),maxRetry:e.string().optional().describe("Maximum number of retry attempts allowed.")}),xe=e.object({...T,type:e.literal("Dice"),rollHistory:e.array(e.number()).optional().describe("History of previous roll results."),diceType:Tt.optional().describe("Type of die (number of faces)."),faceOverrides:e.any().optional().describe("Custom overrides for individual die faces."),color:e.string().optional().describe("CSS color for dice."),showNumber:e.boolean().optional().describe("Show the numeric value on the die face."),diceCount:e.number().optional().describe("Number of dice to roll together."),dicePool:e.record(e.number()).optional().describe("Named pool of dice configurations."),persistent:e.boolean().optional().describe("Keep dice visible after roll."),theme:F.optional()}),jt=e.enum(["scattered","rotated","scattered_rotated"]),Be=e.object({...T,type:e.literal("Puzzle"),image:S.optional().describe("Image URL or MediaItem for puzzle."),pieces:e.number().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:jt.optional().describe("Arrangement mode for scattered puzzle pieces (scattered, rotated, or both)."),puzzleType:e.enum(["swap","slide"]).optional().describe("Puzzle interaction type: swap adjacent pieces or slide into an empty space."),showNumbers:e.union([e.boolean(),e.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:e.string().optional().describe("Deterministic seed for piece placement.")}),U=e.object({...T,type:e.literal("Crossword"),words:e.array(e.object({answer:e.string().describe("The answer for this clue."),clue:e.string().describe("The clue text shown to the learner."),image:S.optional().describe("Clue image.")})).optional(),layout:zt.optional(),theme:Q.optional()}),vt=e.enum(["easy","medium","hard"]),X=e.object({...T,type:e.literal("WordSearch"),words:e.array(e.string()).optional().describe("List of words to hide in the grid."),gridSize:ie.optional().describe("Grid dimensions."),difficulty:vt.optional().describe("Difficulty level, affecting word placement and grid noise."),data:At.optional(),theme:K.optional()}),Te=e.object({...T,type:e.literal("Memory"),pairs:e.array(le).describe("Array of pair objects."),gridSize:ie.optional().describe("Grid dimensions."),hideScore:e.boolean().optional().describe("Hide the score display during play."),theme:V.optional()}),Ce=e.object({...T,type:e.literal("Flashcard"),cards:e.array(me).describe("Array of card objects."),theme:q.optional()}),we=e.object({...T,type:e.literal("SpinningWheel"),slices:e.array(pe).describe("Wheel slices (min 2)."),spinDuration:e.number().optional().describe("Spin duration in seconds."),theme:H.optional()}),ze=e.object({...T,type:e.literal("Chart"),chartType:e.enum(["line","bar","pie","doughnut","radar","area","scatter"]).describe("Chart visualization type."),chartData:e.array(e.any()).describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:e.object({colors:e.array(e.string()).optional().describe("Custom color palette for chart series."),xAxisLabel:e.string().optional().describe("Label for the X axis."),yAxisLabel:e.string().optional().describe("Label for the Y axis."),showLegend:e.boolean().optional().describe("Show the chart legend."),showTooltip:e.boolean().optional().describe("Show tooltips on hover."),stacked:e.boolean().optional().describe("Stack series values instead of grouping them."),seriesNames:e.record(e.string()).optional().describe("Dictionary mapping series keys to custom labels.")})}),Ae=e.object({...T,type:e.literal("MatchPairs"),instructions:e.string().optional().describe("Instruction text."),pairs:e.array(he).describe("Array of pair objects."),theme:Y.optional()}),De=e.object({...T,type:e.literal("Cloze"),templateText:e.string().optional().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),theme:G.optional(),mode:e.enum(["write","drag-drop"]).optional().describe("Input mode. Default: write.")}),Ie=e.object({...T,type:e.literal("CardDeck"),cards:e.array(de).describe("Array of card objects."),backImage:S.optional().describe("Shared back image for all cards."),discardLogic:e.enum(["delete","return"]).describe("What happens to a card after it's used: delete it or return it to the deck."),theme:$.optional()}),je=e.object({...v,type:e.literal("Shape"),shapeType:Dt.optional().describe("Shape outline to render."),text:e.string().optional().describe("Text inside shape."),theme:J.optional()}),ve=e.object({...v,type:e.literal("Arrow"),startBlockId:e.string().describe("ID of the block this arrow starts from."),endBlockId:e.string().optional().describe("ID of the block this arrow ends at, if connected to a block."),endPos:e.object({x:e.number(),y:e.number()}).optional().describe("Free-floating end point coordinates, used when not connected to a block."),startHandle:e.enum(["top","right","bottom","left"]).describe("Anchor side on the start block."),endHandle:e.enum(["top","right","bottom","left"]).optional().describe("Anchor side on the end block."),connectionType:e.enum(["straight","orthogonal","curved"]).describe("Line routing style."),strokeColor:e.string().optional().describe("Line color."),strokeWidth:e.number().optional().describe("Line thickness in pixels."),strokeStyle:e.enum(["solid","dashed","dotted"]).optional().describe("Line dash style."),showHead:e.boolean().optional().describe("Show arrowheads on the line."),startHead:qe.optional().describe("Arrowhead style at the start."),endHead:qe.optional().describe("Arrowhead style at the end."),bendOffsetX:e.number().optional().describe("Manual bend offset on the x axis, for curved/orthogonal routing."),bendOffsetY:e.number().optional().describe("Manual bend offset on the y axis, for curved/orthogonal routing."),segmentCount:e.number().optional().describe("Number of segments for orthogonal routing."),bendOffsets:e.array(e.number()).optional().describe("Per-segment bend offsets for orthogonal routing."),labels:e.array(It).optional().describe("Text labels placed along the arrow.")}),Je=e.discriminatedUnion("type",[ue,fe,ye,ge,be,Se,ke,xe,Be,U,X,Te,Ce,we,ze,Ae,je,ve,De,Ie]),Mt=e.object({id:e.string(),name:e.string(),locked:e.boolean().optional()}),Et=e.object({id:e.string(),title:e.string(),type:xt,background:e.union([e.string(),e.array(e.string()),S]).optional(),backgroundColor:e.string().optional(),backgroundAutoplay:e.boolean().optional(),backgroundLoop:e.boolean().optional(),secretCode:e.string().optional(),hidden:e.boolean().optional(),blocks:e.array(Je),groups:e.array(Mt).optional(),canvas:e.object({width:e.number().optional(),height:e.number().optional(),preset:e.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()}),Ko=e.object({id:e.string(),title:e.string(),schemaVersion:e.number().optional(),hasTimer:e.boolean(),timer:e.string().optional(),allowNavigation:e.boolean(),scenes:e.array(Et),variables:e.array(e.object({name:e.string(),defaultValue:e.union([e.string(),e.number(),e.boolean()])})).optional(),audio:e.array(e.object({id:e.string(),media:S.optional(),scenes:e.string().optional(),autoplay:e.boolean().optional(),loop:e.boolean().optional()})).optional()}),Vo=e.object({id:e.string(),type:e.literal("BLOCK"),sceneId:e.string(),blockData:Je});import{z as C}from"zod";var Ot=C.object({id:C.string(),type:C.string(),title:C.string()}),Pt=C.object({id:C.string(),title:C.string(),position:C.number(),blocks:C.array(Ot).default([])}),Ho=C.object({activity:C.object({id:C.string(),title:C.string(),scenes:C.array(Pt).default([])}),activeSceneId:C.string().nullable().optional()});import*as oo from"zod-to-json-schema";function k(o){return o}var _t={type:"Quiz",contentSchema:ue,themeSchema:L,defaultContent:{id:"",type:"Quiz",title:"Quiz",rotation:0,size:{width:300,height:200},questions:[],theme:{layout:"vertical",preset:"default"}},capabilities:{hasActions:!0,hasScore:!0,collections:{questions:Z},styleTargets:{title:["question"],answers:["answers"],button:["button"],general:["general"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Lt={type:"Editor",contentSchema:ye,themeSchema:N,defaultContent:{id:"",type:"Editor",title:"Editor",rotation:0,size:{width:100,height:50}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["editor"],answers:["editor"],general:["editor"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var Rt={type:"Hotpoint",contentSchema:fe,themeSchema:_,defaultContent:{id:"",type:"Hotpoint",title:"Hotpoint",rotation:0,size:{width:50,height:50},element:"button"},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},vrMode:"custom",analytics:{scorable:!1}},version:1};var Nt={type:"Embed",contentSchema:ge,defaultContent:{id:"",type:"Embed",title:"Embed",rotation:0,size:{width:250,height:150}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var Wt={type:"Media",contentSchema:be,defaultContent:{id:"",type:"Media",title:"Media",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var Ft={type:"DragAndDrop",contentSchema:Se,themeSchema:R,defaultContent:{id:"",type:"DragAndDrop",title:"DragAndDrop",rotation:0,size:{width:150,height:150},groups:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{groups:se},styleTargets:{title:["title"],answers:["item"],general:["container"]},vrMode:"raster",analytics:{scorable:!0}},version:1};var Qt={type:"Anagram",contentSchema:ke,themeSchema:W,defaultContent:{id:"",type:"Anagram",title:"Anagram",rotation:0,size:{width:150,height:100},letters:[],correctWord:""},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["letterText"],answers:["letter","slot"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Kt={type:"Dice",contentSchema:xe,themeSchema:F,defaultContent:{id:"",type:"Dice",title:"Dice",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},vrMode:"interactive",analytics:{scorable:!1}},version:1};var Go=U.shape.words.unwrap().element,Vt={type:"Crossword",contentSchema:U,themeSchema:Q,defaultContent:{id:"",type:"Crossword",title:"Crossword",rotation:0,size:{width:300,height:300}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:Go},styleTargets:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var $o=X.shape.words.unwrap().element,Ht={type:"WordSearch",contentSchema:X,themeSchema:K,defaultContent:{id:"",type:"WordSearch",title:"WordSearch",rotation:0,size:{width:500,height:400}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:$o},styleTargets:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Gt={type:"Puzzle",contentSchema:Be,defaultContent:{id:"",type:"Puzzle",title:"Puzzle",rotation:0,size:{width:250,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!0}},version:1};var $t={type:"Memory",contentSchema:Te,themeSchema:V,defaultContent:{id:"",type:"Memory",title:"Memory",rotation:0,size:{width:400,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:le},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var qt={type:"Flashcard",contentSchema:Ce,themeSchema:q,defaultContent:{id:"",type:"Flashcard",title:"Flashcard",rotation:0,size:{width:400,height:300},cards:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:me},styleTargets:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Yt={type:"SpinningWheel",contentSchema:we,themeSchema:H,defaultContent:{id:"",type:"SpinningWheel",title:"SpinningWheel",rotation:0,size:{width:350,height:450},slices:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{slices:pe},styleTargets:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Jt={type:"Chart",contentSchema:ze,defaultContent:{id:"",type:"Chart",title:"Chart",rotation:0,size:{width:300,height:200},chartType:"bar",chartData:[],chartConfig:{}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var Zt={type:"MatchPairs",contentSchema:Ae,themeSchema:Y,defaultContent:{id:"",type:"MatchPairs",title:"MatchPairs",rotation:0,size:{width:600,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:he},styleTargets:{title:["text"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var Ut={type:"Shape",contentSchema:je,themeSchema:J,defaultContent:{id:"",type:"Shape",title:"Shape",rotation:0,size:{width:50,height:50}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:{title:["shape"],answers:["shape"],general:["shape"]},vrMode:"raster",analytics:{scorable:!1}},version:1};var Xt={type:"Arrow",contentSchema:ve,defaultContent:{id:"",type:"Arrow",title:"Arrow",rotation:0,startBlockId:"",startHandle:"top",connectionType:"straight",strokeColor:"#000000",strokeWidth:2,showHead:!0},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var eo={type:"Cloze",contentSchema:De,themeSchema:G,defaultContent:{id:"",type:"Cloze",title:"Cloze",rotation:0,size:{width:450,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["text"],answers:["word","blank"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var to={type:"CardDeck",contentSchema:Ie,themeSchema:$,defaultContent:{id:"",type:"CardDeck",title:"CardDeck",rotation:0,size:{width:180,height:260},cards:[],discardLogic:"delete"},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:de},styleTargets:{title:["cardText"],answers:["card"],general:["container"]},vrMode:"interactive",analytics:{scorable:!0}},version:1};var A={Quiz:_t,Editor:Lt,Hotpoint:Rt,Embed:Nt,Media:Wt,DragAndDrop:Ft,Anagram:Qt,Dice:Kt,Crossword:Vt,WordSearch:Ht,Puzzle:Gt,Memory:$t,Flashcard:qt,SpinningWheel:Yt,Chart:Jt,MatchPairs:Zt,Shape:Ut,Arrow:Xt,Cloze:eo,CardDeck:to};function qo(o){return A[o]}var Ze=Object.fromEntries(j.map(o=>[o,A[o].contentSchema])),Yo=Object.fromEntries(j.map(o=>[o,A[o].capabilities.styleTargets??{}]));var Jo=oo.zodToJsonSchema,ee=Ze;function Zo(o,i,n,c){let a=n?"*required*":"optional",l=Ue(i),s=i.description?` \u2014 ${i.description}`:"";return`${c}- \`${o}\` (${l}, ${a})${s}`}function Ue(o){return o.enum?`enum: ${o.enum.map(i=>JSON.stringify(i)).join(" | ")}`:o.anyOf||o.oneOf?(o.anyOf||o.oneOf).map(Ue).join(" | "):Array.isArray(o.type)?o.type.join(" | "):o.type==="array"&&o.items?`array<${Ue(o.items)}>`:o.type==="object"?"object":o.type??"any"}function Xe(o,i){let n=[],c=new Set(o.required??[]),a=o.properties??{};for(let[l,s]of Object.entries(a))n.push(Zo(l,s,c.has(l),i)),s.type==="object"&&s.properties?n.push(Xe(s,i+" ")):s.type==="array"&&s.items?.type==="object"&&n.push(Xe(s.items,i+" "));return n.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
${u||"_(no configurable fields)_"}`)}return
|
|
1
|
+
var _e={createScene:[],deleteScene:["sceneId"],addBlock:["sceneId","block"],updateScene:["sceneId"],deleteBlock:["sceneId","blockId"],updateBlock:["sceneId","blockId","updates"],duplicateBlock:["sceneId","blockId"],groupBlocks:["blockIds"],updateBlockTheme:["sceneId","blockId","theme"],updateBlockElementStyle:["sceneId","blockId","elementId","customStyle"],addAction:["sceneId","blockId","action"],removeAction:["sceneId","blockId","actionId"],manageVariables:["operation","name"],configureTimer:[],reorderScenes:["sceneId","newIndex"],insertItem:["blockId","collection","item"],updateItem:["blockId","collection","itemId","item"],deleteItem:["blockId","collection","itemId"]},ir=Object.keys(_e);function no(o){return Object.prototype.hasOwnProperty.call(_e,o)}function ar(o,n){if(!no(o))return{ok:!1,code:"UNKNOWN_OP",errors:[`unknown op "${o}"`]};if(typeof n!="object"||n===null||Array.isArray(n))return{ok:!1,code:"NOT_OBJECT",errors:["op data must be an object"]};let i=n,c=_e[o].filter(a=>i[a]===void 0||i[a]===null);return c.length>0?{ok:!1,code:"MISSING_FIELDS",errors:c.map(a=>`missing field: ${a}`)}:o==="groupBlocks"&&(!Array.isArray(i.blockIds)||i.blockIds.length<2)?{ok:!1,code:"MISSING_FIELDS",errors:["groupBlocks requires a blockIds array with >= 2 ids"]}:{ok:!0}}function cr(o,n,i){let c=Array.isArray(o)?[...o]:[];if(n==="insertItem"){if(i.item===void 0||i.item===null)return c;let a=typeof i.at=="number"?i.at:c.length;return c.splice(Math.max(0,Math.min(a,c.length)),0,i.item),c}return n==="updateItem"?c.map(a=>a&&typeof a=="object"&&a.id===i.itemId?{...a,...i.item??{}}:a):c.filter(a=>!(a&&typeof a=="object"&&a.id===i.itemId))}import{z as r}from"zod";var j=()=>r.record(r.string(),r.unknown()),io=r.object({scene:j().optional(),newIndex:r.number().optional()}).passthrough(),ao=r.object({sceneId:r.string()}),co=r.object({sceneId:r.string(),block:j()}),so=r.object({sceneId:r.string(),updates:j().optional(),newIndex:r.number().optional()}),lo=r.object({sceneId:r.string(),blockId:r.string()}),po=r.object({sceneId:r.string(),blockId:r.string(),updates:j()}),mo=r.object({sceneId:r.string(),blockId:r.string()}),ho=r.object({blockIds:r.array(r.string())}),uo=r.object({sceneId:r.string(),blockId:r.string(),theme:j()}),yo=r.object({sceneId:r.string(),blockId:r.string(),elementId:r.string(),customStyle:j()}),fo=r.object({sceneId:r.string(),blockId:r.string(),action:j()}),bo=r.object({sceneId:r.string(),blockId:r.string(),actionId:r.string()}),go=r.object({operation:r.string(),name:r.string(),defaultValue:r.unknown().optional()}).passthrough(),So=r.object({scope:r.string().optional(),sceneId:r.string().optional(),blockId:r.string().optional(),hasTimer:r.boolean().optional(),timer:r.unknown().optional()}).passthrough(),ko=r.object({sceneId:r.string(),newIndex:r.number()}),Bo=r.object({sceneId:r.string().optional(),blockId:r.string(),collection:r.string(),item:r.unknown(),at:r.number().optional()}),xo=r.object({sceneId:r.string().optional(),blockId:r.string(),collection:r.string(),itemId:r.string(),item:r.unknown()}),To=r.object({sceneId:r.string().optional(),blockId:r.string(),collection:r.string(),itemId:r.string()}),Co=r.object({activity:r.unknown()}),it=r.discriminatedUnion("action",[r.object({action:r.literal("createScene"),data:io}),r.object({action:r.literal("deleteScene"),data:ao}),r.object({action:r.literal("addBlock"),data:co}),r.object({action:r.literal("updateScene"),data:so}),r.object({action:r.literal("deleteBlock"),data:lo}),r.object({action:r.literal("updateBlock"),data:po}),r.object({action:r.literal("duplicateBlock"),data:mo}),r.object({action:r.literal("groupBlocks"),data:ho}),r.object({action:r.literal("updateBlockTheme"),data:uo}),r.object({action:r.literal("updateBlockElementStyle"),data:yo}),r.object({action:r.literal("addAction"),data:fo}),r.object({action:r.literal("removeAction"),data:bo}),r.object({action:r.literal("manageVariables"),data:go}),r.object({action:r.literal("configureTimer"),data:So}),r.object({action:r.literal("reorderScenes"),data:ko}),r.object({action:r.literal("insertItem"),data:Bo}),r.object({action:r.literal("updateItem"),data:xo}),r.object({action:r.literal("deleteItem"),data:To}),r.object({action:r.literal("replaceActivity"),data:Co})]);import{z as zo}from"zod";function re(o){return o.issues.map(n=>{let i=n.path.join(".");return i?`${i}: ${n.message}`:n.message})}function hr(o,n){return i=>{let c=it.safeParse(i);if(!c.success)return{ok:!1,code:"SHAPE_INVALID",errors:re(c.error)};let{action:a,data:l}=c.data;if(a==="addBlock"){let s=l.block,h=typeof s.type=="string"?s.type:void 0,u=h?o.getContentSchema(h):void 0;if(!h||!u)return{ok:!1,code:"UNKNOWN_BLOCK_TYPE",errors:[`addBlock: unknown block type "${String(s.type)}"`]};let y=u.safeParse(s);return y.success?{ok:!0}:{ok:!1,code:"CONTENT_INVALID",errors:re(y.error)}}if(a==="insertItem"||a==="updateItem"||a==="deleteItem"){let s=n?.(l.blockId);if(!s)return{ok:!0};let h=o.getCollectionSchema(s,l.collection);if(!h)return{ok:!1,code:"UNKNOWN_COLLECTION",errors:[`unknown collection "${l.collection}" for block type "${s}"`]};if(a==="insertItem"||a==="updateItem"){let u=h.safeParse(l.item);if(!u.success)return{ok:!1,code:"ITEM_INVALID",errors:re(u.error)}}return{ok:!0}}if(a==="updateBlock"){let s=n?.(l.blockId),h=s?o.getContentSchema(s):void 0;if(!h)return{ok:!0};if(h instanceof zo.ZodObject){let y=h.deepPartial().safeParse(l.updates);if(!y.success)return{ok:!1,code:"CONTENT_INVALID",errors:re(y.error)}}return{ok:!0}}return{ok:!0}}}var wo=new Set(["position","size","rotation","zIndex","z"]);function ne(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?"["+o.map(ne).join(",")+"]":"{"+Object.keys(o).sort().map(i=>JSON.stringify(i)+":"+ne(o[i])).join(",")+"}"}function Ao(o,n){let i=n??{};switch(o){case"updateBlock":case"updateBlockTheme":case"updateBlockElementStyle":case"deleteBlock":case"duplicateBlock":case"removeAction":return i.blockId?{kind:"block",blockId:i.blockId}:{kind:"untracked"};case"updateItem":case"deleteItem":return i.blockId&&i.collection&&i.itemId?{kind:"item",blockId:i.blockId,collection:i.collection,itemId:i.itemId}:{kind:"untracked"};default:return{kind:"untracked"}}}function Do(o,n){if(Array.isArray(o))for(let i of o){let c=i?.blocks?.find?.(a=>a&&a.id===n);if(c)return c}}function Io(o,n){if(n.kind==="untracked")return null;let i=n.blockId?Do(o,n.blockId):void 0;if(!i)return null;if(n.kind==="block"){let l={};for(let s of Object.keys(i))wo.has(s)||(l[s]=i[s]);return ne(l)}let c=i[n.collection];if(!Array.isArray(c))return null;let a=c.find(l=>l&&l.id===n.itemId);return a?ne(a):null}function yr(o,n){return o==null?"apply":n==null?"missing":o===n?"apply":"stale"}function fr(o,n,i){let c=Ao(o,n);return{target:c,baseSignature:Io(i,c)}}import{z as jo}from"zod";var w=["Quiz","Editor","Hotpoint","Embed","Media","DragAndDrop","Anagram","Dice","Crossword","WordSearch","Puzzle","Memory","Flashcard","SpinningWheel","Chart","MatchPairs","Shape","Arrow","Cloze","CardDeck"],Pe=jo.enum(w);import{z as m}from"zod";var Re=m.object({x:m.number(),y:m.number(),z:m.number().optional()}),L=m.object({width:m.number().optional(),height:m.number().optional()}),ie=m.object({rows:m.number(),cols:m.number()}),ae=m.enum(["image","color","gif","shape","illustration","video","audio"]),at=m.enum(["unsplash","pexels","upload","url","library","tenor"]),ct=m.object({x:m.number(),y:m.number(),width:m.number(),height:m.number(),zoom:m.number().optional(),rotation:m.number().optional(),aspect:m.number().optional()}),st=m.object({autoplay:m.boolean().optional(),loop:m.boolean().optional(),muted:m.boolean().optional(),controls:m.boolean().optional(),poster:m.string().optional(),volume:m.number().optional()}),S=m.object({id:m.string().optional(),url:m.string().optional(),title:m.string().optional(),type:ae.describe("Media type (image, color, gif, shape, illustration, video, audio)."),source:at.optional(),alt:m.string().optional(),width:m.number().optional(),height:m.number().optional(),format:m.enum(["cover","contain"]).optional(),color:m.string().optional(),cropData:ct.optional(),duration:m.number().optional(),videoSettings:st.optional()}),vo=S;import{z as t}from"zod";var lt=t.object({type:t.union([t.enum(["none","fade","direction","bounce","scale","rotate"]),t.string()]),duration:t.number().optional(),delay:t.number().optional(),phase:t.enum(["in","both","out"]).optional(),direction:t.enum(["up","right","down","left"]).optional()}),Ne=t.object({top:t.union([t.string(),t.number()]).optional(),right:t.union([t.string(),t.number()]).optional(),bottom:t.union([t.string(),t.number()]).optional(),left:t.union([t.string(),t.number()]).optional()}),pt=t.object({topLeft:t.union([t.string(),t.number()]).optional(),topRight:t.union([t.string(),t.number()]).optional(),bottomRight:t.union([t.string(),t.number()]).optional(),bottomLeft:t.union([t.string(),t.number()]).optional()}),d=t.object({background:t.boolean().optional(),backgroundColor:t.string().optional(),backgroundOpacity:t.number().optional(),backgroundMedia:S.optional(),border:t.boolean().optional(),borderColor:t.string().optional(),borderWidth:Ne.optional(),borderRadius:pt.optional(),padding:t.union([t.string(),t.number(),Ne]).optional()}),b=t.object({color:t.string().optional(),fontSize:t.number().optional(),fontFamily:t.string().optional(),fontStyle:t.string().optional(),fontWeight:t.union([t.string(),t.number()]).optional(),textAlign:t.enum(["left","center","right","justify"]).optional()}),D=d.merge(b),x=t.object({spacing:t.enum(["no-spacing","small","medium","large"]).optional(),animation:lt.optional(),styles:t.record(t.record(t.any())).optional()}),_=x.extend({styles:t.object({hotpoint:t.object({icon:t.string().optional(),iconPosition:t.enum(["left","right"]).optional(),iconSize:t.string().optional(),iconColor:t.string().optional(),image:S.optional(),imageFormat:t.enum(["circle","square","custom"]).optional(),border:t.boolean().optional(),borderColor:t.string().optional(),borderWidth:t.string().optional(),borderRadius:t.string().optional(),glow:t.boolean().optional(),glowColor:t.string().optional(),background:t.boolean().optional(),backgroundColor:t.string().optional(),fontSize:t.number().optional(),fontFamily:t.string().optional(),fontStyle:t.string().optional(),textColor:t.string().optional()}).optional()}).optional()}),P=x.extend({layout:t.enum(["horizontal","vertical","grid"]),gridColumns:t.number().optional(),preset:t.enum(["default","modern","trivia","custom"]),styles:t.object({general:D,question:D,answers:D.extend({customStyles:t.array(t.object({color:t.string().optional(),backgroundColor:t.string().optional(),targets:t.string().optional()})).optional(),hover:D.optional()}),button:D.extend({variant:t.enum(["default","outline","ghost"]).optional(),hover:D.optional()})}).optional()}),R=x.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),splitRatio:t.number().optional(),gridColumns:t.number().optional(),gridGap:t.number().optional().describe("Gap in pixels between auto-laid items (list/grid)."),pool:t.object({x:t.number().optional(),y:t.number().optional(),width:t.number().optional(),height:t.number().optional()}).optional().describe("Movable/resizable frame for the list/grid item pool (sandbox px)."),styles:t.object({title:b.optional(),sandbox:d.optional(),item:D.optional(),group:d.optional(),container:d.extend({url:t.string().optional(),type:ae.optional()}).optional(),groups:D.optional(),feedback:t.object({correct:t.string().optional(),incorrect:t.string().optional(),active:t.string().optional()}).optional(),referenceSize:t.object({width:t.number(),height:t.number()}).optional()}).optional()}),N=x.extend({styles:t.object({editor:d.optional()}).optional()}),W=x.extend({styles:t.object({letter:d.optional(),letterText:b.optional(),slot:d.optional(),container:d.optional()}).optional()}),K=x.extend({styles:t.object({button:d.extend({hover:D.optional()}).optional(),buttonText:b.optional(),container:d.optional()}).optional()}),F=x.extend({primaryColor:t.string().optional(),layoutPosition:t.enum(["left","right","top","bottom"]).optional(),splitRatio:t.number().optional(),styles:t.object({text:b.optional(),cell:d.optional(),grid:d.optional(),clueContainer:d.optional(),clueText:b.optional(),clueTitle:b.optional()}).optional()}),Q=x.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),splitRatio:t.number().optional(),styles:t.object({wordSearch:t.object({primaryColor:t.string().optional(),highlightColor:t.string().optional(),fontSize:t.number().optional(),fontFamily:t.string().optional(),textColor:t.string().optional(),cellBackgroundColor:t.string().optional()}).optional(),text:b.optional(),cell:d.optional(),grid:d.optional(),wordListContainer:d.optional(),wordListText:b.optional(),wordListTitle:b.optional()}).optional()}),H=x.extend({styles:t.object({text:b.optional(),container:d.optional(),infoContainer:d.optional(),infoText:b.optional(),card:d.optional()}).optional()}),V=x.extend({styles:t.object({wheelText:b.optional()}).optional()}),G=x.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),styles:t.object({text:b.optional(),container:d.optional(),wordBank:d.optional(),word:d.optional(),blank:d.optional()}).optional()}),$=x.extend({styles:t.object({card:d.optional(),cardText:b.optional(),container:d.optional()}).optional()}),Y=x.extend({styles:t.object({cardFront:d.optional(),cardBack:d.optional(),frontText:b.optional(),backText:b.optional(),navigation:d.optional(),navigationText:b.optional()}).optional()}),q=x.extend({layoutPosition:t.enum(["left","right","top","bottom"]).optional(),styles:t.object({text:b.optional(),card:d.optional(),container:d.optional()}).optional()}),J=x.extend({styles:t.object({shape:D.extend({fillColor:t.string().optional(),textColor:t.string().optional(),borderStyle:t.enum(["solid","dashed","dotted"]).optional(),padding:t.number().optional()}).optional()}).optional()});function k(o){return o}import{z as e}from"zod";import{z as g}from"zod";var Mo=g.enum(["single-choice","multiple-choice","true-false","short-answers","long-answers"]),We=g.enum(["left","right","center"]),Ke=g.object({width:g.number().optional(),height:g.number().optional()}),mt=g.object({id:g.string(),text:g.string().describe("The option's answer text."),isCorrect:g.boolean().describe("Whether this option is a correct answer."),image:S.optional().describe("Option image."),imageAlign:We.optional().describe("Option image alignment."),imageSize:Ke.optional().describe("Option image size.")}),Fe={id:g.string(),text:g.string().describe("The question text."),score:g.number().optional(),image:S.optional().describe("Question image."),imageAlign:We.optional().describe("Question image alignment."),imageSize:Ke.optional().describe("Question image size.")},dt=g.object({...Fe,type:g.enum(["single-choice","multiple-choice"]),options:g.array(mt).describe("Answer options for this choice question.")}),ht=g.object({...Fe,type:g.literal("true-false"),correctAnswer:g.boolean().describe("The correct answer (true or false).")}),ut=g.object({...Fe,type:g.enum(["short-answers","long-answers"]),minCharacters:g.number().optional().describe("Minimum number of characters required in the answer."),maxCharacters:g.number().optional().describe("Maximum number of characters allowed in the answer.")}),Z=g.discriminatedUnion("type",[dt,ht,ut]);import{z as p}from"zod";var He=p.enum(["quiz_submit","timer_complete","click","scored","keypress","variable","custom","item_dropped","item_removed","group_filled","media_ended"]),yt=p.enum(["equals","not_equals","greater_than","less_than","greater_than_or_equal","less_than_or_equal","contains"]),Eo=p.enum(["all_correct","incorrect","all_wrong","score_perfect","score_above_75","score_above_50","failed"]),Oo=p.enum(["completed","half_way"]),Lo=p.enum(["single_click","double_click"]),_o=p.literal("key_pressed"),Qe=p.object({event:He.optional(),variableName:p.string().optional(),operator:yt.optional(),value:p.any()}),ft=p.enum(["set","add","subtract","multiply","divide"]),bt=p.enum(["navigate","modal","audio","reveal","hide","toggle_visibility","link","refresh","complete","set_variable","math_variable","move"]),gt=p.object({name:p.string(),value:p.union([p.number(),p.string(),p.boolean()]),operation:ft.optional()}),Ve=p.object({id:p.string(),type:bt,condition:Qe.optional(),conditions:p.array(Qe).optional(),conditionsOperator:p.enum(["and","or"]).optional(),modalContent:p.string().optional(),audioUrl:p.string().optional(),linkUrl:p.string().optional(),targetSceneId:p.string().optional(),targetBlockId:p.string().optional(),direction:p.enum(["up","down","left","right"]).optional(),distance:p.number().optional(),variable:gt.optional()}),Po=p.object({name:p.string(),defaultValue:p.union([p.string(),p.number(),p.boolean()])}),Ro=p.object({type:He,blockId:p.string(),data:p.record(p.any()).optional()});var St=e.enum(["2D","360\xB0"]),v={id:e.string(),type:Pe,title:e.string(),showTitle:e.boolean().optional(),locked:e.boolean().optional(),groupId:e.string().optional(),position:Re.optional(),rotation:e.number(),hidden:e.boolean().optional(),draggable:e.boolean().optional(),size:L.optional(),minSize:L.optional(),maxSize:L.optional(),theme:x.optional()},T={...v,actions:e.array(Ve).optional(),score:e.number().optional()},Ye=Object.freeze(Object.keys(v)),No=e.object(T),kt=e.object({id:e.string(),text:e.string(),background:S.optional().describe("Background image/color for item."),opacity:e.number().optional().describe("Opacity of the item (0-1)."),x:e.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.number().optional().describe("Manual width in pixels."),height:e.number().optional().describe("Manual height in pixels."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles.")}),ce=e.object({id:e.string(),name:e.string().describe("Group/dropzone name."),background:S.optional().describe("Background image/color for group."),x:e.number().optional().describe("Manual x position in pixels (sandbox space, origin top-left; sandbox size = block.size)."),y:e.number().optional().describe("Manual y position in pixels (sandbox space, origin top-left)."),width:e.number().optional().describe("Manual width in pixels."),height:e.number().optional().describe("Manual height in pixels."),singleItem:e.boolean().optional().describe("Accept only one item inside."),opacity:e.number().optional().describe("Opacity of the group (0-1)."),styles:d.optional().describe("Box custom styling styles."),textStyles:b.optional().describe("Text custom styling styles."),items:e.array(kt).describe("Items that belong in this group.")}),Bt=e.enum(["d4","d6","d8","d10","d12","d20"]),xt=e.object({char:e.string(),isBlack:e.boolean(),number:e.number().optional(),row:e.number(),col:e.number()}),Tt=e.object({answer:e.string(),clue:e.string(),image:S.optional(),startx:e.number(),starty:e.number(),orientation:e.enum(["across","down","none"]),position:e.number()}),Ct=e.object({grid:e.array(e.array(xt)),rows:e.number(),cols:e.number(),words:e.array(Tt)}),zt=e.object({grid:e.array(e.array(e.string())),placedWords:e.array(e.object({word:e.string(),clean:e.string(),path:e.array(e.object({x:e.number(),y:e.number()}))}))}),se=e.object({id:e.string(),type:e.enum(["img-img","img-word","word-word"]).describe("Pair type."),content:e.tuple([e.string(),e.string()]).describe("Pair content [item1, item2].")}),le=e.object({id:e.string(),text:e.string(),color:e.string().optional().describe("CSS color for the slice."),image:S.optional().describe("Slice image.")}),Ge=e.object({type:e.enum(["text","image"]).describe("Content type: text or image."),content:e.any().describe("The content value: a string for text, or a MediaItem for image.")}),pe=e.object({id:e.string(),front:Ge.describe("Front side."),back:Ge.describe("Back side.")}),me=e.object({id:e.string(),frontImage:S.optional().describe("Front image."),frontText:e.string().optional().describe("Front text.")}),de=e.object({id:e.string(),leftLabel:e.string().describe("Left side text."),rightLabel:e.string().describe("Right side text."),leftImage:e.any().optional().describe("Left side image."),rightImage:e.any().optional().describe("Right side image.")}),wt=e.enum(["rectangle","rounded-rectangle","circle","triangle","triangle-inverted","pentagon","hexagon","heptagon","octagon","decagon","star","star-4","star-5","star-6","star-8","star-12","star-24","arrow-block-right","arrow-block-left","arrow-block-up","arrow-block-down","arrow-block-left-right","flow-process","flow-decision","flow-data","flow-document","flow-start-stop","callout-rect","callout-round","callout-cloud","cloud","heart","banner","tear","gear","asterisk"]),$e=e.enum(["none","arrow","circle","square"]),At=e.object({id:e.string(),text:e.string().describe("Label text."),t:e.number().describe("Position along the arrow path, from 0 (start) to 1 (end)."),offsetX:e.number().optional().describe("Pixel offset from the arrow path on the x axis."),offsetY:e.number().optional().describe("Pixel offset from the arrow path on the y axis."),fontSize:e.number().optional().describe("Label font size."),color:e.string().optional().describe("Label text color."),backgroundColor:e.string().optional().describe("Label background color.")}),he=e.object({...T,type:e.literal("Quiz"),questions:e.array(Z).optional().describe("Array of question objects."),previewIndex:e.number().optional().describe("Index of the question currently previewed in the editor."),required:e.boolean().optional().describe("Whether answering this quiz is required to proceed."),showResults:e.boolean().optional().describe("Show correct/incorrect feedback after submitting."),allowRetry:e.boolean().optional().describe("Allow the learner to retry the quiz."),maxRetry:e.string().optional().describe("Maximum number of retry attempts allowed."),submitText:e.string().optional().describe("Label for submit button."),timer:e.string().optional().describe("Timer duration in seconds as a string."),showQuestionCount:e.boolean().optional().describe("Show current/total questions count."),theme:P}),ue=e.object({...T,type:e.literal("Hotpoint"),showIcon:e.boolean().optional().describe("Show an icon marker on the hotpoint."),element:e.enum(["image","button"]).describe("Underlying element type for the hotpoint."),theme:_.optional()}),ye=e.object({...T,type:e.literal("Editor"),content:e.any().optional().describe("Rich-text editor content (Plate.js JSON document)."),readonly:e.boolean().optional().describe("Make the editor content read-only during play."),theme:N.optional()}),fe=e.object({...v,type:e.literal("Media"),media:S.optional().describe("Media asset displayed by this block.")}),be=e.object({...v,type:e.literal("Embed"),url:e.string().optional().describe("Embed content URL."),readOnly:e.boolean().optional().describe("Prevent interaction with the embedded content.")}),ge=e.object({...T,type:e.literal("DragAndDrop"),groups:e.array(ce).describe("Drag-and-drop groups."),theme:R.optional(),showResults:e.boolean().optional().describe("Show result feedback immediately."),layout:e.enum(["manual","split"]).optional().describe("Layout mode: manual placements or split areas."),itemArrangement:e.enum(["random","list","grid"]).optional().describe("Initial item arrangement inside the sandbox."),groupBackground:S.optional().describe("Shared background image/color for all groups."),enableWrongAnswers:e.boolean().optional().describe("Allow placing items in incorrect groups."),itemBackground:S.optional().describe("Shared background image/color for all items."),groupBackgroundOpacity:e.number().optional().describe("Shared group background opacity (0-1)."),itemBackgroundOpacity:e.number().optional().describe("Shared item background opacity (0-1)."),splitRatio:e.number().optional().describe("Proportion ratio for split layout.")}),Se=e.object({...T,type:e.literal("Anagram"),letters:e.array(e.string()).describe("Letters to unscramble (shuffled tiles the learner rearranges)."),correctWord:e.string().describe("The correct word."),theme:W.optional(),clue:e.string().optional().describe("A hint."),allowRetry:e.boolean().optional().describe("Allow the learner to retry after an incorrect answer."),maxRetry:e.string().optional().describe("Maximum number of retry attempts allowed.")}),ke=e.object({...T,type:e.literal("Dice"),rollHistory:e.array(e.number()).optional().describe("History of previous roll results."),diceType:Bt.optional().describe("Type of die (number of faces)."),faceOverrides:e.any().optional().describe("Custom overrides for individual die faces."),color:e.string().optional().describe("CSS color for dice."),showNumber:e.boolean().optional().describe("Show the numeric value on the die face."),diceCount:e.number().optional().describe("Number of dice to roll together."),dicePool:e.record(e.number()).optional().describe("Named pool of dice configurations."),persistent:e.boolean().optional().describe("Keep dice visible after roll."),theme:K.optional()}),Dt=e.enum(["scattered","rotated","scattered_rotated"]),Be=e.object({...T,type:e.literal("Puzzle"),image:S.optional().describe("Image URL or MediaItem for puzzle."),pieces:e.number().optional().describe("Number of pieces (e.g. 9, 16, 25)."),gameMode:Dt.optional().describe("Arrangement mode for scattered puzzle pieces (scattered, rotated, or both)."),puzzleType:e.enum(["swap","slide"]).optional().describe("Puzzle interaction type: swap adjacent pieces or slide into an empty space."),showNumbers:e.union([e.boolean(),e.string()]).optional().describe("Show helper numbers on puzzle pieces."),seed:e.string().optional().describe("Deterministic seed for piece placement.")}),U=e.object({...T,type:e.literal("Crossword"),words:e.array(e.object({answer:e.string().describe("The answer for this clue."),clue:e.string().describe("The clue text shown to the learner."),image:S.optional().describe("Clue image.")})).optional(),layout:Ct.optional(),theme:F.optional()}),It=e.enum(["easy","medium","hard"]),X=e.object({...T,type:e.literal("WordSearch"),words:e.array(e.string()).optional().describe("List of words to hide in the grid."),gridSize:ie.optional().describe("Grid dimensions."),difficulty:It.optional().describe("Difficulty level, affecting word placement and grid noise."),data:zt.optional(),theme:Q.optional()}),xe=e.object({...T,type:e.literal("Memory"),pairs:e.array(se).describe("Array of pair objects."),gridSize:ie.optional().describe("Grid dimensions."),hideScore:e.boolean().optional().describe("Hide the score display during play."),theme:H.optional()}),Te=e.object({...T,type:e.literal("Flashcard"),cards:e.array(pe).describe("Array of card objects."),theme:Y.optional()}),Ce=e.object({...T,type:e.literal("SpinningWheel"),slices:e.array(le).describe("Wheel slices (min 2)."),spinDuration:e.number().optional().describe("Spin duration in seconds."),theme:V.optional()}),ze=e.object({...T,type:e.literal("Chart"),chartType:e.enum(["line","bar","pie","doughnut","radar","area","scatter"]).describe("Chart visualization type."),chartData:e.array(e.any()).describe("Data array, e.g. [{name:'A', value:10}]."),chartConfig:e.object({colors:e.array(e.string()).optional().describe("Custom color palette for chart series."),xAxisLabel:e.string().optional().describe("Label for the X axis."),yAxisLabel:e.string().optional().describe("Label for the Y axis."),showLegend:e.boolean().optional().describe("Show the chart legend."),showTooltip:e.boolean().optional().describe("Show tooltips on hover."),stacked:e.boolean().optional().describe("Stack series values instead of grouping them."),seriesNames:e.record(e.string()).optional().describe("Dictionary mapping series keys to custom labels.")})}),we=e.object({...T,type:e.literal("MatchPairs"),instructions:e.string().optional().describe("Instruction text."),pairs:e.array(de).describe("Array of pair objects."),theme:q.optional()}),Ae=e.object({...T,type:e.literal("Cloze"),templateText:e.string().optional().describe('Template text with blanks in [brackets]. E.g. "The capital of Italy is [Rome]."'),theme:G.optional(),mode:e.enum(["write","drag-drop"]).optional().describe("Input mode. Default: write.")}),De=e.object({...T,type:e.literal("CardDeck"),cards:e.array(me).describe("Array of card objects."),backImage:S.optional().describe("Shared back image for all cards."),discardLogic:e.enum(["delete","return"]).describe("What happens to a card after it's used: delete it or return it to the deck."),theme:$.optional()}),Ie=e.object({...v,type:e.literal("Shape"),shapeType:wt.optional().describe("Shape outline to render."),text:e.string().optional().describe("Text inside shape."),theme:J.optional()}),je=e.object({...v,type:e.literal("Arrow"),startBlockId:e.string().describe("ID of the block this arrow starts from."),endBlockId:e.string().optional().describe("ID of the block this arrow ends at, if connected to a block."),endPos:e.object({x:e.number(),y:e.number()}).optional().describe("Free-floating end point coordinates, used when not connected to a block."),startHandle:e.enum(["top","right","bottom","left"]).describe("Anchor side on the start block."),endHandle:e.enum(["top","right","bottom","left"]).optional().describe("Anchor side on the end block."),connectionType:e.enum(["straight","orthogonal","curved"]).describe("Line routing style."),strokeColor:e.string().optional().describe("Line color."),strokeWidth:e.number().optional().describe("Line thickness in pixels."),strokeStyle:e.enum(["solid","dashed","dotted"]).optional().describe("Line dash style."),showHead:e.boolean().optional().describe("Show arrowheads on the line."),startHead:$e.optional().describe("Arrowhead style at the start."),endHead:$e.optional().describe("Arrowhead style at the end."),bendOffsetX:e.number().optional().describe("Manual bend offset on the x axis, for curved/orthogonal routing."),bendOffsetY:e.number().optional().describe("Manual bend offset on the y axis, for curved/orthogonal routing."),segmentCount:e.number().optional().describe("Number of segments for orthogonal routing."),bendOffsets:e.array(e.number()).optional().describe("Per-segment bend offsets for orthogonal routing."),labels:e.array(At).optional().describe("Text labels placed along the arrow.")}),qe=e.discriminatedUnion("type",[he,ue,ye,be,fe,ge,Se,ke,Be,U,X,xe,Te,Ce,ze,we,Ie,je,Ae,De]),jt=e.object({id:e.string(),name:e.string(),locked:e.boolean().optional()}),vt=e.object({id:e.string(),title:e.string(),type:St,background:e.union([e.string(),e.array(e.string()),S]).optional(),backgroundColor:e.string().optional(),backgroundAutoplay:e.boolean().optional(),backgroundLoop:e.boolean().optional(),secretCode:e.string().optional(),hidden:e.boolean().optional(),blocks:e.array(qe),groups:e.array(jt).optional(),canvas:e.object({width:e.number().optional(),height:e.number().optional(),preset:e.enum(["landscape","mobile","infographics","square","custom"]).optional()}).optional()}),Wo=e.object({id:e.string(),title:e.string(),schemaVersion:e.number().optional(),hasTimer:e.boolean(),timer:e.string().optional(),allowNavigation:e.boolean(),scenes:e.array(vt),variables:e.array(e.object({name:e.string(),defaultValue:e.union([e.string(),e.number(),e.boolean()])})).optional(),audio:e.array(e.object({id:e.string(),media:S.optional(),scenes:e.string().optional(),autoplay:e.boolean().optional(),loop:e.boolean().optional()})).optional()}),Ko=e.object({id:e.string(),type:e.literal("BLOCK"),sceneId:e.string(),blockData:qe});var Mt={type:"Quiz",contentSchema:he,themeSchema:P,defaultContent:{id:"",type:"Quiz",title:"Quiz",rotation:0,size:{width:300,height:200},questions:[],theme:{layout:"vertical",preset:"default"}},capabilities:{hasActions:!0,hasScore:!0,collections:{questions:Z},styleTargets:{title:["question"],answers:["answers"],button:["button"],general:["general"]},styleKeys:["general","question","answers","button"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var Et={type:"Editor",contentSchema:ye,themeSchema:N,defaultContent:{id:"",type:"Editor",title:"Editor",rotation:0,size:{width:100,height:50}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["editor"],answers:["editor"],general:["editor"]},styleKeys:["editor"],vrMode:"raster",analytics:{scorable:!1}},version:1};var Ot={type:"Hotpoint",contentSchema:ue,themeSchema:_,defaultContent:{id:"",type:"Hotpoint",title:"Hotpoint",rotation:0,size:{width:50,height:50},element:"button"},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["hotpoint"],answers:["hotpoint"],general:["hotpoint"]},styleKeys:["hotpoint"],vrMode:"custom",analytics:{scorable:!1}},version:1};var Lt={type:"Embed",contentSchema:be,defaultContent:{id:"",type:"Embed",title:"Embed",rotation:0,size:{width:250,height:150}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var _t={type:"Media",contentSchema:fe,defaultContent:{id:"",type:"Media",title:"Media",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var Pt={type:"DragAndDrop",contentSchema:ge,themeSchema:R,defaultContent:{id:"",type:"DragAndDrop",title:"DragAndDrop",rotation:0,size:{width:150,height:150},groups:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{groups:ce},styleTargets:{title:["title"],answers:["item"],general:["container"]},styleKeys:["container","title","sandbox","groups","item","group"],vrMode:"raster",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var Rt={type:"Anagram",contentSchema:Se,themeSchema:W,defaultContent:{id:"",type:"Anagram",title:"Anagram",rotation:0,size:{width:150,height:100},letters:[],correctWord:""},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["letterText"],answers:["letter","slot"],general:["container"]},styleKeys:["container","letter","letterText","slot"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var Nt={type:"Dice",contentSchema:ke,themeSchema:K,defaultContent:{id:"",type:"Dice",title:"Dice",rotation:0,size:{width:100,height:100}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["buttonText"],answers:["button"],button:["button"],general:["container"]},styleKeys:["container","button","buttonText"],vrMode:"interactive",analytics:{scorable:!1}},version:1};var Fo=U.shape.words.unwrap().element,Wt={type:"Crossword",contentSchema:U,themeSchema:F,defaultContent:{id:"",type:"Crossword",title:"Crossword",rotation:0,size:{width:300,height:300}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:Fo},styleTargets:{title:["clueTitle","text"],answers:["cell"],general:["grid"]},styleKeys:["grid","cell","text","clueContainer","clueTitle","clueText"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var Qo=X.shape.words.unwrap().element,Kt={type:"WordSearch",contentSchema:X,themeSchema:Q,defaultContent:{id:"",type:"WordSearch",title:"WordSearch",rotation:0,size:{width:500,height:400}},capabilities:{hasActions:!0,hasScore:!0,collections:{words:Qo},styleTargets:{title:["wordListTitle","text"],answers:["cell"],general:["grid"]},styleKeys:["grid","cell","text","wordListContainer","wordListTitle","wordListText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var Ft={type:"Puzzle",contentSchema:Be,defaultContent:{id:"",type:"Puzzle",title:"Puzzle",rotation:0,size:{width:250,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!0}},version:1};var Qt={type:"Memory",contentSchema:xe,themeSchema:H,defaultContent:{id:"",type:"Memory",title:"Memory",rotation:0,size:{width:400,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:se},styleTargets:{title:["text"],answers:["card"],general:["container"]},styleKeys:["container","card","text","infoContainer","infoText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var Ht={type:"Flashcard",contentSchema:Te,themeSchema:Y,defaultContent:{id:"",type:"Flashcard",title:"Flashcard",rotation:0,size:{width:400,height:300},cards:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:pe},styleTargets:{title:["frontText","backText"],answers:["cardFront","cardBack"],general:["cardFront","cardBack"]},styleKeys:["cardFront","cardBack","frontText","backText","navigation","navigationText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var Vt={type:"SpinningWheel",contentSchema:Ce,themeSchema:V,defaultContent:{id:"",type:"SpinningWheel",title:"SpinningWheel",rotation:0,size:{width:350,height:450},slices:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{slices:le},styleTargets:{title:["wheelText"],answers:["wheelText"],general:["wheelText"]},styleKeys:["wheelText"],vrMode:"interactive",analytics:{scorable:!0},layout:{autoHeight:!0}},version:1};var Gt={type:"Chart",contentSchema:ze,defaultContent:{id:"",type:"Chart",title:"Chart",rotation:0,size:{width:300,height:200},chartType:"bar",chartData:[],chartConfig:{}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:void 0,vrMode:"interactive",analytics:{scorable:!1}},version:1};var $t={type:"MatchPairs",contentSchema:we,themeSchema:q,defaultContent:{id:"",type:"MatchPairs",title:"MatchPairs",rotation:0,size:{width:600,height:400},pairs:[]},capabilities:{hasActions:!0,hasScore:!0,collections:{pairs:de},styleTargets:{title:["text"],answers:["card"],general:["container"]},styleKeys:["container","card","text"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var Yt={type:"Shape",contentSchema:Ie,themeSchema:J,defaultContent:{id:"",type:"Shape",title:"Shape",rotation:0,size:{width:50,height:50}},capabilities:{hasActions:!1,hasScore:!1,styleTargets:{title:["shape"],answers:["shape"],general:["shape"]},styleKeys:["shape"],vrMode:"raster",analytics:{scorable:!1}},version:1};var qt={type:"Arrow",contentSchema:je,defaultContent:{id:"",type:"Arrow",title:"Arrow",rotation:0,startBlockId:"",startHandle:"top",connectionType:"straight",strokeColor:"#000000",strokeWidth:2,showHead:!0},capabilities:{hasActions:!1,hasScore:!1,styleTargets:void 0,vrMode:"raster",analytics:{scorable:!1}},version:1};var Jt={type:"Cloze",contentSchema:Ae,themeSchema:G,defaultContent:{id:"",type:"Cloze",title:"Cloze",rotation:0,size:{width:450,height:250}},capabilities:{hasActions:!0,hasScore:!0,styleTargets:{title:["text"],answers:["word","blank"],general:["container"]},styleKeys:["container","text","wordBank","word","blank"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var Zt={type:"CardDeck",contentSchema:De,themeSchema:$,defaultContent:{id:"",type:"CardDeck",title:"CardDeck",rotation:0,size:{width:180,height:260},cards:[],discardLogic:"delete"},capabilities:{hasActions:!0,hasScore:!0,collections:{cards:me},styleTargets:{title:["cardText"],answers:["card"],general:["container"]},styleKeys:["container","card","cardText"],vrMode:"interactive",analytics:{scorable:!0}},version:1};var z={Quiz:Mt,Editor:Et,Hotpoint:Ot,Embed:Lt,Media:_t,DragAndDrop:Pt,Anagram:Rt,Dice:Nt,Crossword:Wt,WordSearch:Kt,Puzzle:Ft,Memory:Qt,Flashcard:Ht,SpinningWheel:Vt,Chart:Gt,MatchPairs:$t,Shape:Yt,Arrow:qt,Cloze:Jt,CardDeck:Zt};function Ho(o){return z[o]}var ve=Object.fromEntries(w.flatMap(o=>{let n=z[o].capabilities.styleTargets;return n&&Object.keys(n).length>0?[[o.toLowerCase(),n]]:[]}));function Vo(o){let n=ve[o.toLowerCase()];if(!n)return[];let i=new Set;for(let c of Object.values(n))for(let a of c??[])i.add(a);return[...i]}var Ut=Object.fromEntries(w.flatMap(o=>{let n=z[o].capabilities.styleKeys;return n&&n.length>0?[[o.toLowerCase(),n]]:[]})),Xt=new Set(["chart","media","image","puzzle"]);function Go(o){if(!o)return"";let n=o.toLowerCase();if(Xt.has(n))return`
|
|
2
|
+
[STYLE TARGETS] Il blocco "${o}" non ha sotto-elementi tematizzabili: NON puoi cambiarne colori/bordi via update_block_theme. Puoi solo cambiare lo sfondo della SCENA \u2014 sii onesto col l'utente.`;let i=Ut[n];if(!i||i.length===0)return"";let c=ve[n]??{},a=["general","title","answers","button"].filter(l=>c[l]).map(l=>`${l}\u2192${c[l].join("/")}`).join(", ");return`
|
|
3
|
+
[STYLE TARGETS for ${o}] Logical targets (update_block_theme): ${a}. Real sub-element keys (update_block_style 'target'): ${i.join(", ")}.`}function Je(o,n){if(!o)return o;let i={...o};for(let[h,u]of Object.entries(i))if(u&&typeof u=="object"){let y={...u},f=!1;y.backgroundColor!==void 0&&y.background===void 0&&(y.background=!0,f=!0),y.borderColor!==void 0&&y.border===void 0&&(y.border=!0,f=!0),f&&(i[h]=y)}if(!n)return i;let c=ve[n.toLowerCase()];if(!c)return i;let a=(h,u)=>{u&&(i[h]={...i[h]||{},...u})},l=["title","answers","button","general"],s={title:i.title,answers:i.answers,button:i.button??i.buttons,general:i.general};for(let h of l){let u=s[h],y=c[h];if(u&&y)for(let f of y)a(f,u)}return i}function $o(o,n,i){if(!o){let s={...n};return s.styles&&(s.styles=Je(s.styles,i)),s}if(!n)return o;let c={...o,...n},a=Je(n.styles,i),l=o.styles||{};if(o.styles||a){c.styles={...l,...a};for(let s of Object.keys(c.styles))l[s]&&a?.[s]&&(c.styles[s]={...l[s],...a[s]})}return c}import{z as C}from"zod";var eo=C.object({id:C.string(),type:C.string(),title:C.string()}),to=C.object({id:C.string(),title:C.string(),position:C.number(),blocks:C.array(eo).default([])}),Yo=C.object({activity:C.object({id:C.string(),title:C.string(),scenes:C.array(to).default([])}),activeSceneId:C.string().nullable().optional()});import*as oo from"zod-to-json-schema";var Ze=Object.fromEntries(w.map(o=>[o,z[o].contentSchema])),qo=Object.fromEntries(w.map(o=>[o,z[o].capabilities.styleTargets??{}])),Jo=w.filter(o=>z[o].capabilities.analytics?.scorable===!0);var Zo=oo.zodToJsonSchema,ee=Ze;function Uo(o,n,i,c){let a=i?"*required*":"optional",l=Ue(n),s=n.description?` \u2014 ${n.description}`:"";return`${c}- \`${o}\` (${l}, ${a})${s}`}function Ue(o){return o.enum?`enum: ${o.enum.map(n=>JSON.stringify(n)).join(" | ")}`:o.anyOf||o.oneOf?(o.anyOf||o.oneOf).map(Ue).join(" | "):Array.isArray(o.type)?o.type.join(" | "):o.type==="array"&&o.items?`array<${Ue(o.items)}>`:o.type==="object"?"object":o.type??"any"}function Xe(o,n){let i=[],c=new Set(o.required??[]),a=o.properties??{};for(let[l,s]of Object.entries(a))i.push(Uo(l,s,c.has(l),n)),s.type==="object"&&s.properties?i.push(Xe(s,n+" ")):s.type==="array"&&s.items?.type==="object"&&i.push(Xe(s.items,n+" "));return i.join(`
|
|
4
|
+
`)}function Xo(o={}){let n=[],i=new Map,c=Object.fromEntries(Ye.map(a=>[a,!0]));for(let[a,l]of Object.entries(ee)){let s=o.contentOnly?l.omit(c):l,h=i.get(s)??[];h.push(a),i.set(s,h)}for(let[a,l]of i.entries()){let s=l.join(" / "),h=Zo(a,{target:"jsonSchema7"}),u=Xe(h,"");n.push(`### ${s}
|
|
5
|
+
${u||"_(no configurable fields)_"}`)}return n.join(`
|
|
6
6
|
|
|
7
|
-
`)}var et=1,ro="__blockSchemaVersion",Me=class extends Error{constructor(
|
|
7
|
+
`)}var et=1,ro="__blockSchemaVersion",Me=class extends Error{constructor(n){super(n),this.name="ActivityContentMigrationError"}};function er(o,n=z){if(typeof o!="object"||o===null||Array.isArray(o))throw new Me(`migrateActivityContent expects a non-null, non-array object; got ${o===null?"null":typeof o}`);let i=[],c=!1,a=o,s=(Array.isArray(a.scenes)?a.scenes:[]).map((u,y)=>{if(typeof u!="object"||u===null||Array.isArray(u))return i.push(`scenes[${y}]: not an object, left intact`),u;let f=u,B=Array.isArray(f.blocks)?f.blocks:[],A=!1,Ee=B.map((M,te)=>{if(typeof M!="object"||M===null||Array.isArray(M))return i.push(`scenes[${y}].blocks[${te}]: not an object, left intact`),M;let E=M,O=E.type,Oe=typeof O=="string"?n[O]:void 0;if(!Oe)return i.push(`scenes[${y}].blocks[${te}]: unknown block type "${String(O)}", left intact`),E;let ot=E[ro],I=typeof ot=="number"?ot:1,Le=E,rt=!1;for(;I<Oe.version;){let nt=Oe.migrations?.[I];if(!nt){i.push(`scenes[${y}].blocks[${te}]: missing migration from v${I} for type "${O}", stopped at v${I}`);break}let oe=nt(Le);if(typeof oe!="object"||oe===null||Array.isArray(oe)){i.push(`scenes[${y}].blocks[${te}]: migration from v${I} for type "${O}" returned a non-object, stopped at v${I}`);break}Le={...oe},rt=!0,I+=1}return rt?(A=!0,{...Le,[ro]:I}):E});return A?(c=!0,{...f,blocks:Ee}):f});return a.schemaVersion!==et&&(c=!0),{content:{...a,scenes:s,schemaVersion:et},changed:c,issues:i}}var tr=o=>{if(typeof o!="object"||o===null||Array.isArray(o))return o;let n=o;if(!Array.isArray(n.actions))return o;let i=n.actions.map(c=>{if(typeof c!="object"||c===null||Array.isArray(c))return c;let a=c;if(a.condition===void 0||Array.isArray(a.conditions))return a;let{condition:l,...s}=a;return{...s,conditions:[l],conditionsOperator:a.conditionsOperator??"and"}});return{...n,actions:i}};function na(){return w.map(o=>{let n=z[o];return{type:o,version:n.version,hasActions:n.capabilities.hasActions,hasScore:n.capabilities.hasScore,collections:Object.keys(n.capabilities.collections??{}),styleTargets:n.capabilities.styleTargets??{},vrMode:n.capabilities.vrMode}})}var tt=/@\[([^\]|]+)\|([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\]/g;function aa(o){let n=[];for(let i of(o??"").matchAll(tt))n.push({name:i[1].trim(),id:i[2]});return n}function ca(o,n){let i=new Map,c=new Map;for(let f of n?.scenes??[]){f?.id&&i.set(f.id,f);for(let B of f?.blocks??[])B?.id&&c.set(B.id,{block:B,sceneId:f.id})}let a=[],l=new Set,s=f=>c.has(f)?"il blocco selezionato":i.has(f)?"la scena selezionata":"l'elemento selezionato",h=(f,B)=>{if(!l.has(B))if(c.has(B)){let{block:A,sceneId:Ee}=c.get(B);a.push({id:B,name:f,kind:"block",blockType:A?.type,sceneId:Ee}),l.add(B)}else i.has(B)&&(a.push({id:B,name:f,kind:"scene"}),l.add(B))},u=(o??"").replace(tt,(f,B,A)=>(h(B.trim(),A),B.trim())),y=(o??"").replace(tt,(f,B,A)=>c.has(A)||i.has(A)?s(A):B.trim());return{cleanedText:u,agentText:y,entities:a}}import{zodToJsonSchema as or}from"zod-to-json-schema";function rr(){return Object.keys(ee)}function nr(o){let n=ee[o];if(n)return or(n,{target:"jsonSchema7",$refStrategy:"none"})}function ma(){return Object.fromEntries(rr().map(o=>[o,nr(o)]))}export{No as ActionBlockSchema,Qe as ActionConditionSchema,Ve as ActionSchema,bt as ActionTypeSchema,gt as ActionVariableSchema,Me as ActivityContentMigrationError,Wo as ActivityContentSchema,Yo as ActivityContextSchema,Po as ActivityVariableSchema,Se as AnagramBlockSchema,W as AnagramBlockThemeSchema,lt as AnimationSchema,je as ArrowBlockSchema,$e as ArrowHeadTypeSchema,At as ArrowLabelSchema,Ye as BASE_BLOCK_FIELDS,ee as BLOCK_CONTENT_SCHEMAS,z as BLOCK_REGISTRY,Ut as BLOCK_STYLE_KEYS,w as BLOCK_TYPES,Ro as BlockEventSchema,He as BlockEventTypeSchema,jt as BlockGroupSchema,qe as BlockSchema,x as BlockThemeSchema,Pe as BlockTypeSchema,Ne as BoxSideSchema,d as BoxStylesSchema,ir as CANVAS_OP_NAMES,_e as CANVAS_OP_REQUIRED,et as CURRENT_SCHEMA_VERSION,Ko as CanvasDragItemSchema,it as CanvasOpSchema,De as CardDeckBlockSchema,$ as CardDeckBlockThemeSchema,me as CardItemSchema,ze as ChartBlockSchema,dt as ChoiceQuestionSchema,Lo as ClickConditionSchema,Ae as ClozeBlockSchema,G as ClozeBlockThemeSchema,yt as ConditionOperatorSchema,ct as CropDataSchema,U as CrosswordBlockSchema,F as CrosswordBlockThemeSchema,xt as CrosswordCellSchema,Ct as CrosswordLayoutOutputSchema,Tt as CrosswordLayoutWordSchema,ke as DiceBlockSchema,K as DiceBlockThemeSchema,Bt as DiceTypeSchema,ge as DragAndDropBlockSchema,R as DragAndDropBlockThemeSchema,ce as DragAndDropGroupSchema,kt as DragAndDropItemSchema,ye as EditorBlockSchema,N as EditorBlockThemeSchema,be as EmbedBlockSchema,Te as FlashcardBlockSchema,Y as FlashcardBlockThemeSchema,Ge as FlashcardContentSchema,pe as FlashcardItemSchema,ie as GridSizeSchema,ue as HotpointBlockSchema,_ as HotpointBlockThemeSchema,We as ImageAlignSchema,Ke as ImageSizeSchema,_o as KeyPressConditionSchema,we as MatchPairsBlockSchema,q as MatchPairsBlockThemeSchema,de as MatchPairsPairSchema,ft as MathOperationSchema,fe as MediaBlockSchema,S as MediaItemSchema,vo as MediaRefSchema,at as MediaSourceSchema,ae as MediaTypeSchema,xe as MemoryBlockSchema,H as MemoryBlockThemeSchema,se as MemoryPairSchema,Re as PositionSchema,Be as PuzzleBlockSchema,Dt as PuzzleGameModeSchema,mt as QuestionOptionSchema,Z as QuestionSchema,Mo as QuestionTypeSchema,he as QuizBlockSchema,P as QuizBlockThemeSchema,Eo as QuizConditionSchema,Ze as REGISTRY_CONTENT_SCHEMAS,qo as REGISTRY_STYLE_TARGETS,pt as RadiusSchema,Jo as SCORABLE_BLOCK_TYPES,ve as STYLE_TARGET_MAP,eo as SceneBlockRefSchema,vt as SceneSchema,to as SceneSummarySchema,St as SceneTypeSchema,Ie as ShapeBlockSchema,J as ShapeBlockThemeSchema,wt as ShapeTypeSchema,L as SizeSchema,Ce as SpinningWheelBlockSchema,V as SpinningWheelBlockThemeSchema,ut as TextQuestionSchema,b as TextStylesSchema,Oo as TimerConditionSchema,ht as TrueFalseQuestionSchema,Xt as UNSTYLEABLE_BLOCKS,st as VideoSettingsSchema,le as WheelSliceSchema,X as WordSearchBlockSchema,Q as WordSearchBlockThemeSchema,zt as WordSearchDataSchema,It as WordSearchDifficultySchema,tr as actionsV1toV2,cr as applyItemPatch,hr as createCanvasOpValidator,k as defineBlock,yr as detectConflict,Io as entitySignature,Xo as generateBlockReference,ma as getAllBlockJsonSchemas,Ho as getBlockDefinition,nr as getBlockJsonSchema,na as getCapabilitiesManifest,no as isKnownCanvasOp,rr as listBlockTypes,Je as mapLogicalThemeStyles,$o as mergeTheme,er as migrateActivityContent,fr as opConflictStamp,Ao as opTarget,aa as parseMentions,Vo as realStyleKeysFor,ca as resolveMentions,ne as stableStringify,Go as styleTargetsHelpFor,ar as validateCanvasOp};
|