framer-api 0.0.1-beta.4 → 0.0.1-nightly.20260121115836

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.ts CHANGED
@@ -3223,7 +3223,7 @@ type NamespaceMembers<Class, Namespace extends string, Parent = undefined> = {
3223
3223
  [Member in Exclude<keyof Class, keyof Parent> as Member extends string ? `${Namespace}.${Member}` : never]: Class[Member];
3224
3224
  };
3225
3225
  type AllMembers = Omit<FramerPluginAPIAlpha, "isAllowedTo" | "subscribeToIsAllowedTo"> & NamespaceMembers<ImageAsset, "ImageAsset"> & NamespaceMembers<CodeFile, "CodeFile"> & NamespaceMembers<CodeFileVersion, "CodeFileVersion"> & NamespaceMembers<ComponentInstancePlaceholder, "ComponentInstancePlaceholder"> & NamespaceMembers<Field, "Field"> & NamespaceMembers<BooleanField, "BooleanField", Field> & NamespaceMembers<ColorField, "ColorField", Field> & NamespaceMembers<NumberField, "NumberField", Field> & NamespaceMembers<StringField, "StringField", Field> & NamespaceMembers<FormattedTextField, "FormattedTextField", Field> & NamespaceMembers<ImageField, "ImageField", Field> & NamespaceMembers<LinkField, "LinkField", Field> & NamespaceMembers<DateField, "DateField", Field> & NamespaceMembers<FieldDivider, "FieldDivider", Field> & NamespaceMembers<UnsupportedField, "UnsupportedField", Field> & NamespaceMembers<FileField, "FileField", Field> & NamespaceMembers<EnumField, "EnumField", Field> & NamespaceMembers<CollectionReferenceField, "CollectionReferenceField", Field> & NamespaceMembers<MultiCollectionReferenceField, "MultiCollectionReferenceField", Field> & NamespaceMembers<ManagedCollection, "ManagedCollection"> & NamespaceMembers<Collection, "Collection"> & NamespaceMembers<CollectionItem, "CollectionItem"> & NamespaceMembers<NodeMethods, "Node"> & NamespaceMembers<FrameNode, "FrameNode", NodeMethods> & NamespaceMembers<TextNode, "TextNode", NodeMethods> & NamespaceMembers<SVGNode, "SVGNode", NodeMethods> & NamespaceMembers<ComponentInstanceNode, "ComponentInstanceNode", NodeMethods> & NamespaceMembers<WebPageNode, "WebPageNode", NodeMethods> & NamespaceMembers<ComponentNode, "ComponentNode", NodeMethods> & NamespaceMembers<UnknownNode, "UnknownNode", NodeMethods> & NamespaceMembers<ColorStyle, "ColorStyle"> & NamespaceMembers<TextStyle, "TextStyle"> & NamespaceMembers<Variable, "Variable"> & NamespaceMembers<BooleanVariable, "BooleanVariable", Variable> & NamespaceMembers<NumberVariable, "NumberVariable", Variable> & NamespaceMembers<StringVariable, "StringVariable", Variable> & NamespaceMembers<FormattedTextVariable, "FormattedTextVariable", Variable> & NamespaceMembers<EnumCase, "EnumCase"> & NamespaceMembers<EnumVariable, "EnumVariable", Variable> & NamespaceMembers<ColorVariable, "ColorVariable", Variable> & NamespaceMembers<ImageVariable, "ImageVariable", Variable> & NamespaceMembers<FileVariable, "FileVariable", Variable> & NamespaceMembers<LinkVariable, "LinkVariable", Variable> & NamespaceMembers<DateVariable, "DateVariable", Variable> & NamespaceMembers<BorderVariable, "BorderVariable", Variable> & NamespaceMembers<UnsupportedVariable, "UnsupportedVariable", Variable> & NamespaceMembers<VectorSet, "VectorSet"> & NamespaceMembers<VectorSetItem, "VectorSetItem">;
3226
- declare const unprotectedMessageTypesSource: ["closeNotification", "closePlugin", "getActiveCollection", "getActiveLocale", "getActiveManagedCollection", "getCanvasRoot", "getChildren", "getCollection", "getCollectionFields", "getCollectionFields2", "getCollectionItems", "getCollectionItems2", "getCollections", "getColorStyle", "getColorStyles", "getCurrentUser", "getCurrentUser2", "getCustomCode", "getDefaultLocale", "getFont", "getFonts", "getImage", "getImageData", "getLocales", "getLocalizationGroups", "getManagedCollection", "getManagedCollectionFields", "getManagedCollectionFields2", "getManagedCollectionItemIds", "getManagedCollections", "getNode", "getNodesWithAttribute", "getNodesWithAttributeSet", "getNodesWithType", "getParent", "getPluginData", "getPluginDataForNode", "getPluginDataKeys", "getPluginDataKeysForNode", "getProjectInfo", "getProjectInfo2", "getPublishInfo", "getRect", "getSelection", "getSVGForNode", "getText", "getTextForNode", "getTextStyle", "getTextStyles", "hideUI", "setBackgroundMessage", "notify", "onPointerDown", "setActiveCollection", "setSelection", "showUI", "getCodeFileVersionContent", "typecheckCode", "getCodeFileVersions", "getCodeFiles", "getCodeFile", "getRedirects", "uploadFile", "uploadFiles", "uploadImage", "uploadImages", "zoomIntoView", "navigateTo", "getRuntimeErrorForModule", "getRuntimeErrorForCodeComponentNode", "showProgressOnInstances", "removeProgressFromInstances", "addComponentInstancePlaceholder", "updateComponentInstancePlaceholder", "removeComponentInstancePlaceholder", "setMenu", "showContextMenu", "getBreakpointSuggestionsForWebPage", "getActiveCollectionItemForWebPage", "getVariables", "getVectorSets", "getVectorSetItems", "getVectorSetItemVariables", "getChangedPaths", "getChangeContributors", "getDeployments", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions", "lintCode"];
3226
+ declare const unprotectedMessageTypesSource: ["closeNotification", "closePlugin", "setCloseWarning", "getActiveCollection", "getActiveLocale", "getActiveManagedCollection", "getCanvasRoot", "getChildren", "getCollection", "getCollectionFields", "getCollectionFields2", "getCollectionItems", "getCollectionItems2", "getCollections", "getColorStyle", "getColorStyles", "getCurrentUser", "getCurrentUser2", "getCustomCode", "getDefaultLocale", "getFont", "getFonts", "getImage", "getImageData", "getLocales", "getLocalizationGroups", "getManagedCollection", "getManagedCollectionFields", "getManagedCollectionFields2", "getManagedCollectionItemIds", "getManagedCollections", "getNode", "getNodesWithAttribute", "getNodesWithAttributeSet", "getNodesWithType", "getParent", "getPluginData", "getPluginDataForNode", "getPluginDataKeys", "getPluginDataKeysForNode", "getProjectInfo", "getProjectInfo2", "getPublishInfo", "getRect", "getSelection", "getSVGForNode", "getText", "getTextForNode", "getTextStyle", "getTextStyles", "hideUI", "setBackgroundMessage", "notify", "onPointerDown", "setActiveCollection", "setSelection", "showUI", "getCodeFileVersionContent", "typecheckCode", "getCodeFileVersions", "getCodeFiles", "getCodeFile", "getRedirects", "uploadFile", "uploadFiles", "uploadImage", "uploadImages", "zoomIntoView", "navigateTo", "getRuntimeErrorForModule", "getRuntimeErrorForCodeComponentNode", "showProgressOnInstances", "removeProgressFromInstances", "addComponentInstancePlaceholder", "updateComponentInstancePlaceholder", "removeComponentInstancePlaceholder", "setMenu", "showContextMenu", "getBreakpointSuggestionsForWebPage", "getActiveCollectionItemForWebPage", "getVariables", "getVectorSets", "getVectorSetItems", "getVectorSetItemVariables", "getChangedPaths", "getChangeContributors", "getDeployments", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions", "lintCode"];
3227
3227
  type UnprotectedMessageType = (typeof unprotectedMessageTypesSource)[number];
3228
3228
  type ProtectedMessageType = Exclude<keyof PluginMessageAPI, UnprotectedMessageType>;
3229
3229
  type Method = keyof {
@@ -3288,6 +3288,8 @@ declare const methodToMessageTypes: {
3288
3288
  readonly hideUI: [];
3289
3289
  /** @beta */
3290
3290
  readonly setBackgroundMessage: [];
3291
+ /** @beta */
3292
+ readonly setCloseWarning: [];
3291
3293
  /** @deprecated The lintCode API was removed. */
3292
3294
  readonly lintCode: [];
3293
3295
  readonly makeDraggable: ["onDragEnd", "onDragStart", "onDrag", "setDragData", "preloadDetachedComponentLayers", "preloadImageUrlForInsertion", "preloadDragPreviewImage"];
@@ -3362,10 +3364,10 @@ declare const methodToMessageTypes: {
3362
3364
  /** @alpha */
3363
3365
  readonly "ComponentInstancePlaceholder.replaceWithComponentInstance": ["replaceComponentInstancePlaceholderWithComponentInstance"];
3364
3366
  readonly "Field.remove": ["removeCollectionFields"];
3365
- readonly "Field.setAttributes": ["addCollectionFields"];
3367
+ readonly "Field.setAttributes": ["addCollectionFields2"];
3366
3368
  readonly "EnumField.addCase": ["addEnumCase"];
3367
3369
  readonly "EnumField.setCaseOrder": ["setEnumCaseOrder"];
3368
- readonly "Collection.addFields": ["addCollectionFields"];
3370
+ readonly "Collection.addFields": ["addCollectionFields2"];
3369
3371
  readonly "Collection.addItems": ["addCollectionItems2"];
3370
3372
  readonly "Collection.getFields": [];
3371
3373
  readonly "Collection.getItems": [];
@@ -3447,8 +3449,8 @@ declare const methodToMessageTypes: {
3447
3449
  readonly "EnumVariable.addCase": ["addEnumCase"];
3448
3450
  /** @alpha */
3449
3451
  readonly "EnumVariable.setCaseOrder": ["setEnumCaseOrder"];
3450
- /** @beta */
3451
3452
  readonly createCollection: ["createCollection"];
3453
+ readonly createManagedCollection: ["createManagedCollection"];
3452
3454
  readonly [getAiServiceInfo]: [];
3453
3455
  readonly [sendTrackingEvent]: [];
3454
3456
  readonly [getHTMLForNode]: [];
@@ -4035,8 +4037,10 @@ declare class FramerPluginAPI {
4035
4037
  *
4036
4038
  * @param fileName - The name of the code file, must include the extension. Use `*.tsx` for TSX files, otherwise the React JSX syntax will be rejected.
4037
4039
  * @param content - The content of the code file.
4040
+ * @param compilerOptions - Optional compiler options to override the default compiler options for type checking.
4041
+ * @param sessionId - Optional session ID. Pass it when repeatedly type checking the same file. If not provided, a new session will be created for each type check, which is slow.
4038
4042
  */
4039
- typecheckCode(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions): Promise<TypecheckDiagnostic[]>;
4043
+ typecheckCode(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions, sessionId?: string): Promise<TypecheckDiagnostic[]>;
4040
4044
  /**
4041
4045
  * Subscribe to changes in code files.
4042
4046
  * This will be called when code files are added, removed, or updated and will return an array of
@@ -4101,11 +4105,27 @@ declare class FramerPluginAPI {
4101
4105
  * Create a new collection.
4102
4106
  */
4103
4107
  createCollection(name: string): Promise<Collection>;
4108
+ /**
4109
+ * Create a new managed collection.
4110
+ */
4111
+ createManagedCollection(name: string): Promise<ManagedCollection>;
4112
+ /**
4113
+ * Initial state data passed from Vekter during handshake.
4114
+ */
4115
+ get [$framerInternal.initialState](): InitialState;
4104
4116
  }
4105
4117
  /** @beta */
4106
4118
  declare class FramerPluginAPIBeta extends FramerPluginAPI {
4107
4119
  #private;
4108
4120
  constructor(engine: PluginEngine);
4121
+ /**
4122
+ * @beta
4123
+ *
4124
+ * Set a warning message to show when the user attempts to close the plugin. Set to false to disable.
4125
+ * - `string` to enable with a custom message.
4126
+ * - `false` to disable.
4127
+ * */
4128
+ setCloseWarning(message: string | false): Promise<void>;
4109
4129
  }
4110
4130
  /** @alpha */
4111
4131
  declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
@@ -4129,11 +4149,6 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
4129
4149
  get [$framerInternal.environmentInfo](): EnvironmentInfo | null;
4130
4150
  /** @internal */
4131
4151
  get [$framerInternal.showUncheckedPermissionToasts](): boolean;
4132
- /**
4133
- * Initial state data passed from Vekter during handshake.
4134
- * @internal
4135
- */
4136
- get [$framerInternal.initialState](): InitialState;
4137
4152
  /** @internal */
4138
4153
  set [$framerInternal.showUncheckedPermissionToasts](value: boolean);
4139
4154
  /**
@@ -4174,7 +4189,10 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
4174
4189
  }>;
4175
4190
  /** @internal - Available only through framer-api */
4176
4191
  [$framerApiOnly.getChangeContributors](fromVersion?: number, toVersion?: number): Promise<string[]>;
4177
- /** @internal - Available only through framer-api */
4192
+ /**
4193
+ * @deprecated Use `createManagedCollection` instead.
4194
+ * @internal - Available only through framer-api
4195
+ * */
4178
4196
  [$framerApiOnly.createManagedCollection](name: string): Promise<ManagedCollection>;
4179
4197
  /** @internal - Rejects all pending method calls with the given error */
4180
4198
  [$framerApiOnly.rejectAllPending](error: FramerPluginError): void;
@@ -4253,6 +4271,7 @@ type MessageApiDragData = ComponentDragData | OtherDragData;
4253
4271
  interface PluginMessageAPI {
4254
4272
  hideUI: FramerPluginAPI["hideUI"];
4255
4273
  setBackgroundMessage: FramerPluginAPI["setBackgroundMessage"];
4274
+ setCloseWarning: (message: string | false) => Promise<void>;
4256
4275
  closePlugin: (...parameters: Parameters<FramerPluginAPI["closePlugin"]>) => Promise<void>;
4257
4276
  removeNode: FramerPluginAPI["removeNode"];
4258
4277
  removeNodes: FramerPluginAPI["removeNodes"];
@@ -4410,7 +4429,7 @@ interface PluginMessageAPI {
4410
4429
  getCodeFileVersionContent: (fileId: string, versionId: string) => Promise<string>;
4411
4430
  /** @deprecated The lintCode API was removed. */
4412
4431
  lintCode(fileName: string, content: string, rules: LintConfig): Promise<LintDiagnostic[]>;
4413
- typecheckCode(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions): Promise<TypecheckDiagnostic[]>;
4432
+ typecheckCode(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions, sessionId?: string): Promise<TypecheckDiagnostic[]>;
4414
4433
  addRedirects: (redirects: RedirectInput[]) => Promise<RedirectData[]>;
4415
4434
  getRedirects: () => Promise<readonly RedirectData[]>;
4416
4435
  setRedirectOrder: (redirectIds: string[]) => Promise<void>;
@@ -4673,7 +4692,10 @@ declare enum ErrorCode {
4673
4692
  PROJECT_CLOSED = "PROJECT_CLOSED",
4674
4693
  POOL_EXHAUSTED = "POOL_EXHAUSTED",
4675
4694
  TIMEOUT = "TIMEOUT",
4676
- INTERNAL = "INTERNAL"
4695
+ INTERNAL = "INTERNAL",
4696
+ NODE_NOT_FOUND = "NODE_NOT_FOUND",
4697
+ SCREENSHOT_TOO_LARGE = "SCREENSHOT_TOO_LARGE",
4698
+ INVALID_REQUEST = "INVALID_REQUEST"
4677
4699
  }
4678
4700
  declare class FramerAPIError extends Error {
4679
4701
  readonly code: ErrorCode;
@@ -4681,10 +4703,30 @@ declare class FramerAPIError extends Error {
4681
4703
  }
4682
4704
  declare function isRetryableError(error: unknown): boolean;
4683
4705
 
4706
+ interface ScreenshotOptions {
4707
+ /** Image format. Default: "png" */
4708
+ format?: "png" | "jpeg";
4709
+ /** JPEG quality (0-100). Only applies when format is "jpeg". Default: 100 */
4710
+ quality?: number;
4711
+ /** Pixel density multiplier for retina/HiDPI screenshots. Default: 1 */
4712
+ scale?: 0.5 | 1 | 1.5 | 2 | 3 | 4;
4713
+ /** Clip region in CSS pixels (before scale). Captures only this portion of the node. */
4714
+ clip?: {
4715
+ x: number;
4716
+ y: number;
4717
+ width: number;
4718
+ height: number;
4719
+ };
4720
+ }
4721
+ interface ScreenshotResult {
4722
+ data: Buffer;
4723
+ mimeType: string;
4724
+ }
4684
4725
  declare const enabledMethods: {
4685
4726
  showUI: false;
4686
4727
  hideUI: false;
4687
4728
  closePlugin: false;
4729
+ setCloseWarning: true;
4688
4730
  notify: false;
4689
4731
  setMenu: false;
4690
4732
  showContextMenu: false;
@@ -4784,6 +4826,7 @@ declare const enabledMethods: {
4784
4826
  mode: true;
4785
4827
  isAllowedTo: false;
4786
4828
  createFrameNode: true;
4829
+ createManagedCollection: true;
4787
4830
  };
4788
4831
  type EnabledMethodsConfig = typeof enabledMethods;
4789
4832
  type BlockedMethods = {
@@ -4797,7 +4840,11 @@ interface FramerConnectionMethods {
4797
4840
  [Symbol.dispose](): void;
4798
4841
  [Symbol.asyncDispose](): Promise<void>;
4799
4842
  }
4800
- type Framer = AvailablePluginMethods & FramerConnectionMethods & FramerApiOnlyMethods;
4843
+ interface FramerScreenshotMethods {
4844
+ screenshot(nodeId: string, options?: ScreenshotOptions): Promise<ScreenshotResult>;
4845
+ exportSVG(nodeId: string): Promise<string>;
4846
+ }
4847
+ type Framer = AvailablePluginMethods & FramerConnectionMethods & FramerScreenshotMethods & FramerApiOnlyMethods;
4801
4848
 
4802
4849
  /**
4803
4850
  * Connect to a Framer project and start using the Framer API.
@@ -4828,7 +4875,17 @@ type Framer = AvailablePluginMethods & FramerConnectionMethods & FramerApiOnlyMe
4828
4875
  * const framer = await connect(projectUrl, apiKey)
4829
4876
  * ```
4830
4877
  */
4831
- declare function connect(projectUrlOrId: string, token?: string): Promise<Framer>;
4878
+ /**
4879
+ * @internal
4880
+ */
4881
+ interface ConnectOptions {
4882
+ /**
4883
+ * Override the headless server URL (e.g., for local development)
4884
+ * @internal
4885
+ */
4886
+ serverUrl?: string;
4887
+ }
4888
+ declare function connect(projectUrlOrId: string, token?: string, options?: ConnectOptions): Promise<Framer>;
4832
4889
  /**
4833
4890
  * Connect to a Framer project and execute a callback with the Framer instance.
4834
4891
  * The connection will be closed automatically when the resolves.
@@ -4844,6 +4901,6 @@ declare function connect(projectUrlOrId: string, token?: string): Promise<Framer
4844
4901
  * })
4845
4902
  * ```
4846
4903
  */
4847
- declare function withConnection<T>(projectUrlOrId: string, callback: (framer: Framer) => Promise<T>, token?: string): Promise<T>;
4904
+ declare function withConnection<T>(projectUrlOrId: string, callback: (framer: Framer) => Promise<T>, token?: string, options?: ConnectOptions): Promise<T>;
4848
4905
 
4849
- export { type AllTraits, type AnyNode, type ApiVersion1ProjectInfo, type ApiVersion1User, type ArrayControl, type ArrayFieldDataEntry, type ArrayFieldDataEntryInput, type ArrayItem, type ArrayItemData, type ArrayItemInput, type AxisOverflow, type BooleanControl, BooleanField, BooleanVariable, type Border, type BorderControl, type BorderRadius, type BorderRadiusControl, type BorderStyle, BorderVariable, type BorderWidth, type Breakpoint, type CanvasNode, type CanvasRootNode, CodeFile, type CodeFileComponentExport, type CodeFileExport, type CodeFileOverrideExport, CodeFileVersion, Collection, CollectionItem, type CollectionItemData, type CollectionItemInput, type CollectionReferenceControl, CollectionReferenceField, type ColorControl, ColorField, type ColorStop, ColorStyle, ColorVariable, ComponentInstanceNode, ComponentInstancePlaceholder, type ComponentInstancePlaceholderAttributes, type ComponentInstancePlaceholderData, ComponentNode, type ComponentVariable, type ComputedValue, ConicGradient, type Control, type ControlAttributes, type CreateField, type CreateVariable, type CursorControl, type CustomCode, type CustomCodeLocation, type CustomCursorControl, type DateControl, DateField, DateVariable, type Deployment, DesignPageNode, type DiagnosticSpan, type EditableManagedCollectionField, EnumCase, type EnumCaseData, type EnumControl, EnumField, EnumVariable, ErrorCode, type Field, type FieldData, type FieldDataEntry, type FieldDataEntryInput, type FieldDataInput, FieldDivider, type FileControl, FileField, FileVariable, type FitContent, type FitImage, Font, type FontControl, type FormattedTextControl, FormattedTextField, FormattedTextVariable, FrameNode, type Framer, FramerAPIError, FramerPluginClosedError, FramerPluginError, type FusedNumberControl, type GapControl, type Gesture, type Gradient, type GridContentAlignment, type GridItemAlignment, type GridItemColumnSpan, type GridLayout, type HeightConstraint, type HeightLength, type Hostname, type HostnameType, ImageAsset, type ImageControl, ImageField, type ImageRendering, ImageVariable, type InlineLocalizationValueByLocale, type IsBreakpoint, type IsComponentGestureVariant, type IsComponentVariant, type LayoutType, type Length, LinearGradient, type LinkControl, LinkField, type LinkRelControl, LinkVariable, type LintConfig, type LintDiagnostic, type LintLink, type Locale, type LocaleId, type LocalizationData, type LocalizationGroup, type LocalizationGroupStatus, type LocalizationGroupStatusByLocale, type LocalizationSource, type LocalizationSourceId, type LocalizationSourceUpdate, type LocalizationValueByLocale, type LocalizedValueStatus, type LocalizedValueUpdate, ManagedCollection, type ManagedCollectionField, type ManagedCollectionFieldInput, type ManagedCollectionItemInput, type Mode, type MultiCollectionReferenceControl, MultiCollectionReferenceField, type NodeAttributeKey, type NodeId, type NodeRuntimeErrorResult, type NumberControl, NumberField, NumberVariable, type ObjectControl, type Overflow, type Ownership, type PaddingControl, type PageScopeControl, type Position, type ProjectInfo, type ProtectedMethod, type Publish, type PublishInfo, type PublishResult, RadialGradient, type Rect$1 as Rect, Redirect, type RedirectInput, SVGNode, type ScrollSectionControl, type SetLocalizationDataResult, type ShadowControl, type ShowProgressOnInstancesAttributes, type StackAlignment, type StackDirection, type StackDistribution, type StackLayout, type StringControl, StringField, StringVariable, type TextAlignment, type TextDecoration, TextNode, TextStyle, type TextStyleBreakpoint, type TextStyleTag, type TextTransform, type TrackingIdControl, type TraitVariant, type TraitVariantData, type TraitVariantNode, type TransitionControl, type TypecheckDiagnostic, UnsupportedComputedValue, UnsupportedField, UnsupportedVariable, type UpdateFieldAttributes, type User, type Variable, VectorSet, type VectorSetData, VectorSetItem, type VectorSetItemControl, type VectorSetItemData, VectorSetItemNode, type VectorSetItemVariable, VectorSetNode, WebPageNode, type WidthConstraint, type WidthLength, type WithAspectRatioTrait, type WithBackgroundColorTrait, type WithBackgroundGradientTrait, type WithBackgroundImageTrait, type WithBorderRadiusTrait, type WithBorderTrait, type WithBreakpointTrait, type WithComponentInfoTrait, type WithComponentVariantTrait, type WithControlAttributesTrait, type WithFontTrait, type WithGridItemTrait, type WithIdTrait, type WithImageRenderingTrait, type WithInlineTextStyleTrait, type WithLayoutTrait, type WithLinkTrait, type WithLockedTrait, type WithNameTrait, type WithNullableComponentInfoTrait, type WithOpacityTrait, type WithOverflowTrait, type WithPinsTrait, type WithPositionTrait, type WithReplicaInfoTrait, type WithRequiredComponentInfoTrait, type WithRotationTrait, type WithSVGTrait, type WithSizeConstraintsTrait, type WithSizeTrait, type WithTextTruncationTrait, type WithVisibleTrait, type WithWebPageInfoTrait, type WithZIndexTrait, configure, connect, framer, hasGridLayout, hasStackLayout, isBreakpoint, isCodeFileComponentExport, isCodeFileOverrideExport, isColorStyle, isComponentGestureVariant, isComponentInstanceNode, isComponentNode, isComponentVariable, isComponentVariant, isComputedValue, isDesignPageNode, isField, isFileAsset, isFrameNode, isImageAsset, isRetryableError, isSVGNode, isTextNode, isTextStyle, isVariable, isVectorSetItemNode, isVectorSetNode, isWebPageNode, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundColorData, supportsBackgroundGradient, supportsBackgroundGradientData, supportsBackgroundImage, supportsBackgroundImageData, supportsBorder, supportsBorderRadius, supportsBreakpoint, supportsComponentInfo, supportsComponentVariant, supportsFont, supportsFontData, supportsImageRendering, supportsInlineTextStyle, supportsInlineTextStyleData, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSVG, supportsSize, supportsSizeConstraints, supportsTextTruncation, supportsVisible, supportsZIndex, withConnection };
4906
+ export { type AllTraits, type AnyNode, type ApiVersion1ProjectInfo, type ApiVersion1User, type ArrayControl, type ArrayFieldDataEntry, type ArrayFieldDataEntryInput, type ArrayItem, type ArrayItemData, type ArrayItemInput, type AxisOverflow, type BooleanControl, BooleanField, BooleanVariable, type Border, type BorderControl, type BorderRadius, type BorderRadiusControl, type BorderStyle, BorderVariable, type BorderWidth, type Breakpoint, type CanvasNode, type CanvasRootNode, CodeFile, type CodeFileComponentExport, type CodeFileExport, type CodeFileOverrideExport, CodeFileVersion, Collection, CollectionItem, type CollectionItemData, type CollectionItemInput, type CollectionReferenceControl, CollectionReferenceField, type ColorControl, ColorField, type ColorStop, ColorStyle, ColorVariable, ComponentInstanceNode, ComponentInstancePlaceholder, type ComponentInstancePlaceholderAttributes, type ComponentInstancePlaceholderData, ComponentNode, type ComponentVariable, type ComputedValue, ConicGradient, type ConnectOptions, type Control, type ControlAttributes, type CreateField, type CreateVariable, type CursorControl, type CustomCode, type CustomCodeLocation, type CustomCursorControl, type DateControl, DateField, DateVariable, type Deployment, DesignPageNode, type DiagnosticSpan, type EditableManagedCollectionField, EnumCase, type EnumCaseData, type EnumControl, EnumField, EnumVariable, ErrorCode, type Field, type FieldData, type FieldDataEntry, type FieldDataEntryInput, type FieldDataInput, FieldDivider, type FileControl, FileField, FileVariable, type FitContent, type FitImage, Font, type FontControl, type FormattedTextControl, FormattedTextField, FormattedTextVariable, FrameNode, type Framer, FramerAPIError, FramerPluginClosedError, FramerPluginError, type FusedNumberControl, type GapControl, type Gesture, type Gradient, type GridContentAlignment, type GridItemAlignment, type GridItemColumnSpan, type GridLayout, type HeightConstraint, type HeightLength, type Hostname, type HostnameType, ImageAsset, type ImageControl, ImageField, type ImageRendering, ImageVariable, type InlineLocalizationValueByLocale, type IsBreakpoint, type IsComponentGestureVariant, type IsComponentVariant, type LayoutType, type Length, LinearGradient, type LinkControl, LinkField, type LinkRelControl, LinkVariable, type LintConfig, type LintDiagnostic, type LintLink, type Locale, type LocaleId, type LocalizationData, type LocalizationGroup, type LocalizationGroupStatus, type LocalizationGroupStatusByLocale, type LocalizationSource, type LocalizationSourceId, type LocalizationSourceUpdate, type LocalizationValueByLocale, type LocalizedValueStatus, type LocalizedValueUpdate, ManagedCollection, type ManagedCollectionField, type ManagedCollectionFieldInput, type ManagedCollectionItemInput, type Mode, type MultiCollectionReferenceControl, MultiCollectionReferenceField, type NodeAttributeKey, type NodeId, type NodeRuntimeErrorResult, type NumberControl, NumberField, NumberVariable, type ObjectControl, type Overflow, type Ownership, type PaddingControl, type PageScopeControl, type Position, type ProjectInfo, type ProtectedMethod, type Publish, type PublishInfo, type PublishResult, RadialGradient, type Rect$1 as Rect, Redirect, type RedirectInput, SVGNode, type ScreenshotOptions, type ScreenshotResult, type ScrollSectionControl, type SetLocalizationDataResult, type ShadowControl, type ShowProgressOnInstancesAttributes, type StackAlignment, type StackDirection, type StackDistribution, type StackLayout, type StringControl, StringField, StringVariable, type TextAlignment, type TextDecoration, TextNode, TextStyle, type TextStyleBreakpoint, type TextStyleTag, type TextTransform, type TrackingIdControl, type TraitVariant, type TraitVariantData, type TraitVariantNode, type TransitionControl, type TypecheckDiagnostic, UnsupportedComputedValue, UnsupportedField, UnsupportedVariable, type UpdateFieldAttributes, type User, type Variable, VectorSet, type VectorSetData, VectorSetItem, type VectorSetItemControl, type VectorSetItemData, VectorSetItemNode, type VectorSetItemVariable, VectorSetNode, WebPageNode, type WidthConstraint, type WidthLength, type WithAspectRatioTrait, type WithBackgroundColorTrait, type WithBackgroundGradientTrait, type WithBackgroundImageTrait, type WithBorderRadiusTrait, type WithBorderTrait, type WithBreakpointTrait, type WithComponentInfoTrait, type WithComponentVariantTrait, type WithControlAttributesTrait, type WithFontTrait, type WithGridItemTrait, type WithIdTrait, type WithImageRenderingTrait, type WithInlineTextStyleTrait, type WithLayoutTrait, type WithLinkTrait, type WithLockedTrait, type WithNameTrait, type WithNullableComponentInfoTrait, type WithOpacityTrait, type WithOverflowTrait, type WithPinsTrait, type WithPositionTrait, type WithReplicaInfoTrait, type WithRequiredComponentInfoTrait, type WithRotationTrait, type WithSVGTrait, type WithSizeConstraintsTrait, type WithSizeTrait, type WithTextTruncationTrait, type WithVisibleTrait, type WithWebPageInfoTrait, type WithZIndexTrait, configure, connect, framer, hasGridLayout, hasStackLayout, isBreakpoint, isCodeFileComponentExport, isCodeFileOverrideExport, isColorStyle, isComponentGestureVariant, isComponentInstanceNode, isComponentNode, isComponentVariable, isComponentVariant, isComputedValue, isDesignPageNode, isField, isFileAsset, isFrameNode, isImageAsset, isRetryableError, isSVGNode, isTextNode, isTextStyle, isVariable, isVectorSetItemNode, isVectorSetNode, isWebPageNode, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundColorData, supportsBackgroundGradient, supportsBackgroundGradientData, supportsBackgroundImage, supportsBackgroundImageData, supportsBorder, supportsBorderRadius, supportsBreakpoint, supportsComponentInfo, supportsComponentVariant, supportsFont, supportsFontData, supportsImageRendering, supportsInlineTextStyle, supportsInlineTextStyleData, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSVG, supportsSize, supportsSizeConstraints, supportsTextTruncation, supportsVisible, supportsZIndex, withConnection };
package/dist/index.js CHANGED
@@ -1,15 +1,14 @@
1
- import { WebSocket } from 'unenv/node/http';
2
- import qo from 'unenv/node/process';
3
- import * as nt from 'devalue';
1
+ import { process as process$1, isWorkerd } from 'std-env';
2
+ import * as rt from 'devalue';
4
3
 
5
- /* Framer API SDK v0.0.1-beta.4 */
6
- var Mr=Object.defineProperty;var r=(i,e)=>Mr(i,"name",{value:e,configurable:true});function at(i){return i!==undefined}r(at,"isDefined");function zi(i){return i===undefined}r(zi,"isUndefined");function x(i){return i===null}r(x,"isNull");function Gi(i){return i!==null}r(Gi,"isNotNull");function be(i){return i===true||i===false}r(be,"isBoolean");function g(i){return typeof i=="string"}r(g,"isString");function $(i){return typeof i=="number"&&Number.isFinite(i)}r($,"isNumber");function Er(i){return typeof i=="function"}r(Er,"isFunction");function v(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(v,"isObject");function st(i){if(typeof i!="object"||i===null)return false;let e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}r(st,"isPlainObject");function Ut(i){return Array.isArray(i)}r(Ut,"isArray");function lt(i,e){throw e||new Error(i?`Unexpected value: ${i}`:"Application entered invalid state")}r(lt,"assertNever");function m(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
4
+ /* Framer API SDK v0.0.1-nightly.20260121115836 */
5
+ var Er=Object.defineProperty;var r=(i,e)=>Er(i,"name",{value:e,configurable:true});function st(i){return i!==undefined}r(st,"isDefined");function zi(i){return i===undefined}r(zi,"isUndefined");function C(i){return i===null}r(C,"isNull");function Gi(i){return i!==null}r(Gi,"isNotNull");function be(i){return i===true||i===false}r(be,"isBoolean");function g(i){return typeof i=="string"}r(g,"isString");function H(i){return typeof i=="number"&&Number.isFinite(i)}r(H,"isNumber");function Mr(i){return typeof i=="function"}r(Mr,"isFunction");function D(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(D,"isObject");function lt(i){if(typeof i!="object"||i===null)return false;let e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}r(lt,"isPlainObject");function Ut(i){return Array.isArray(i)}r(Ut,"isArray");function dt(i,e){throw e||new Error(i?`Unexpected value: ${i}`:"Application entered invalid state")}r(dt,"assertNever");function m(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
7
6
  `);n[1]?.includes("assert")?(n.splice(1,1),t.stack=n.join(`
8
7
  `)):n[0]?.includes("assert")&&(n.splice(0,1),t.stack=n.join(`
9
- `));}catch{}throw t}r(m,"assert");function S(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!Er(t)||S(t);}return Object.freeze(i)}r(S,"deepFreeze");function Ki(i){return [i.slice(0,-1),i.at(-1)]}r(Ki,"splitRestAndLast");var c="__class";var Ot=Symbol(),zt=Symbol(),Ar=Symbol(),Vr=Symbol(),wr=Symbol(),Wr=Symbol(),Lr=Symbol(),Gt=Symbol(),Kt=Symbol(),l={getAiServiceInfo:Ot,sendTrackingEvent:zt,environmentInfo:Ar,initialState:Vr,showUncheckedPermissionToasts:wr,marshal:Wr,unmarshal:Lr,getHTMLForNode:Gt,setHTMLForNode:Kt},dt="INTERNAL_",ut=`${dt}getAiServiceInfo`,ct=`${dt}sendTrackingEvent`,se=`${dt}getHTMLForNode`,le=`${dt}setHTMLForNode`;var k=class{static{r(this,"VariableBase");}#e;#t;get nodeId(){return this.#t.nodeId}get nodeType(){return this.#t.nodeType}get id(){return this.#t.id}get name(){return this.#t.name}get description(){return this.#t.description??null}constructor(e,t){this.#e=e,this.#t=t;}async setAttributes(e){let t=await this.#e.invoke("updateVariable",this.nodeId,this.id,{...e,type:this.type});if(x(t))return null;let n=this.constructor;return new n(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},M="Variable";function A(i){let e=i.at(0);return m(!zi(e)),`${e.toLowerCase()}${i.slice(1,-M.length)}`}r(A,"classToType");var Rr=`Boolean${M}`,Br=A(Rr),xe=class i extends k{static{r(this,"BooleanVariable");}type=Br;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Ur=`Number${M}`,Or=A(Ur),Ce=class i extends k{static{r(this,"NumberVariable");}type=Or;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},zr=`String${M}`,Gr=A(zr),Ie=class i extends k{static{r(this,"StringVariable");}type=Gr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Kr=`FormattedText${M}`,$r=A(Kr),Te=class i extends k{static{r(this,"FormattedTextVariable");}type=$r;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Hr=`Enum${M}`,jr=A(Hr),H=class i{static{r(this,"EnumCase");}#e;#t;#i;#n;get id(){return this.#n.id}get name(){return this.#n.name}get nameByLocale(){return this.#n.nameByLocale}constructor(e,t,n,o){this.#e=e,this.#t=t,this.#i=n,this.#n=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#i,this.id,e);return t?new i(this.#e,this.#t,this.#i,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#i,this.id);}},Pe=class i extends k{static{r(this,"EnumVariable");}type=jr;#e;#t;#i;get cases(){return this.#i||(this.#i=S(this.#t.cases.map(e=>new H(this.#e,this.nodeId,this.id,e)))),this.#i}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new H(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},_r=`Color${M}`,qr=A(_r),Se=class i extends k{static{r(this,"ColorVariable");}type=qr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Yr=`Image${M}`,Xr=A(Yr),Fe=class i extends k{static{r(this,"ImageVariable");}type=Xr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Zr=`File${M}`,Jr=A(Zr),De=class i extends k{static{r(this,"FileVariable");}type=Jr;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Qr=`Link${M}`,eo=A(Qr),ve=class i extends k{static{r(this,"LinkVariable");}type=eo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},to=`Date${M}`,io=A(to),Ne=class i extends k{static{r(this,"DateVariable");}type=io;#e;get displayTime(){return this.#e.displayTime}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},no=`Border${M}`,ro=A(no),ke=class i extends k{static{r(this,"BorderVariable");}type=ro;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},oo=`Unsupported${M}`,ao=A(oo),Me=class i extends k{static{r(this,"UnsupportedVariable");}type=ao;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}};function $i(i){return i instanceof k}r($i,"isVariable");function so(i){return $i(i)&&i.nodeType==="component"}r(so,"isComponentVariable");var R=class{static{r(this,"FieldBase");}#e;#t;#i;get id(){return this.#i.id}get name(){return this.#i.name}constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[n]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(m(at(n)),x(n))return null;m(n.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,n)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},w=class extends R{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,n){super(e,t,n),this.#e=n;}},pt=class extends R{static{r(this,"BooleanField");}type=jt},mt=class extends R{static{r(this,"ColorField");}type=_t},gt=class extends R{static{r(this,"NumberField");}type=qt},ft=class extends w{static{r(this,"StringField");}type=Yt;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},yt=class extends w{static{r(this,"FormattedTextField");}type=Xt},Ee=class extends w{static{r(this,"ImageField");}type=Zt},ht=class extends w{static{r(this,"LinkField");}type=Qt},bt=class extends w{static{r(this,"DateField");}type=ei;#e;get displayTime(){return this.#e.displayTime}constructor(e,t,n){super(e,t,n),this.#e=n;}},xt=class extends R{static{r(this,"FieldDivider");}type=oi},Ae=class extends R{static{r(this,"UnsupportedField");}type=ai},Ct=class extends w{static{r(this,"FileField");}type=ti;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,n){super(e,t,n),this.#e=n;}},It=class extends R{static{r(this,"EnumField");}type=ii;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new H(this.#e,this.#t,this.id,e)),S(this.#n)),this.#n}constructor(e,t,n){super(e,t,n),this.#e=e,this.#t=t,this.#i=n;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new H(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},Tt=class extends w{static{r(this,"CollectionReferenceField");}type=ni;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Pt=class extends w{static{r(this,"MultiCollectionReferenceField");}type=ri;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},$t=class extends w{static{r(this,"ArrayField");}type=Jt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Ee(e,t,o)];}};function Ht(i,e,t){return i.map(n=>{switch(n.type){case jt:return new pt(e,t,n);case _t:return new mt(e,t,n);case qt:return new gt(e,t,n);case Yt:return new ft(e,t,n);case Xt:return new yt(e,t,n);case Zt:return new Ee(e,t,n);case Qt:return new ht(e,t,n);case ei:return new bt(e,t,n);case oi:return new xt(e,t,n);case ai:return new Ae(e,t,n);case ti:return new Ct(e,t,n);case ii:return new It(e,t,n);case ni:return new Tt(e,t,n);case ri:return new Pt(e,t,n);case Jt:return new $t(e,t,n);default:return new Ae(e,t,n)}})}r(Ht,"fieldDefinitionDataArrayToFieldClassInstances");function lo(i){return i instanceof R}r(lo,"isField");var Hi="action";function uo(i){return !!i&&Hi in i&&g(i[Hi])}r(uo,"isLocalizedValueUpdate");function ji(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return uo(n)&&(e[t]=n),e},{})}r(ji,"filterInlineLocalizationValues");var Ve=class i{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function co(i){return i instanceof Ve}r(co,"isFileAsset");var po="ImageAsset";function _i(i){return v(i)?i[c]===po:false}r(_i,"isImageAssetData");var j=class i{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new i(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return fo(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),n=new Blob([t],{type:e});return createImageBitmap(n)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((n,o)=>{let a=new Image;a.onload=()=>n(a),a.onerror=()=>o(),a.src=t;})}};function mo(i){return i instanceof j}r(mo,"isImageAsset");function _(i){return i.type==="bytes"?[i.bytes.buffer]:[]}r(_,"getTransferable");function go(i){if(!v(i))return false;let e="bytes",t="mimeType";return !(!(e in i)||!(t in i)||!(i[e]instanceof Uint8Array)||!g(i[t]))}r(go,"isBytesData");async function we(i){if(i instanceof File)return di(i);let e=await qi(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}r(we,"createImageTransferFromInput");async function si(i){if(i instanceof File)return di(i);let e=await qi(i.file);return {name:i.name,...e}}r(si,"createFileTransferFromInput");async function qi(i){return i instanceof File?di(i):go(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}r(qi,"createAssetTransferFromAssetInput");function li(i){return Promise.all(i.map(we))}r(li,"createNamedAssetDataTransferFromInput");async function di(i){return new Promise((e,t)=>{let n=new FileReader;n.onload=o=>{let a=i.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(s);e({bytes:d,mimeType:a,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}r(di,"getAssetDataFromFile");async function fo(i){let e=i instanceof File,t=e?URL.createObjectURL(i):i,n=new Image;return n.crossOrigin="anonymous",new Promise((o,a)=>{n.onload=()=>{o({width:n.naturalWidth,height:n.naturalHeight});},n.onerror=s=>{a(s);},n.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(fo,"measureImage");var St=class{static{r(this,"ComputedValueBase");}};var yo="unsupported",We=class i extends St{static{r(this,"UnsupportedComputedValue");}type=yo;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return this.#e}};function ho(i){return i instanceof St}r(ho,"isComputedValue");var bo="Font";function Xi(i){return v(i)&&i[c]===bo}r(Xi,"isFontData");function xo(i){if(!$(i))return false;switch(i){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(xo,"isFontWeight");function Co(i){if(!g(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}r(Co,"isFontStyle");function Zi(i){return v(i)?g(i.family)&&g(i.selector)&&xo(i.weight)&&Co(i.style):false}r(Zi,"isFont");var O=class i{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let n=Yi.get(t.selector);if(n)return n;let o=new i(t);return Yi.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Yi=new Map;var Io="LinearGradient",To="RadialGradient",Po="ConicGradient",de=class{static{r(this,"GradientBase");}#e;get stops(){return this.#e.stops}constructor(e){this.#e=e;}cloneWithAttributes(e){let t=this.constructor;return new t({...this.#e,...e})}},Le=class i extends de{static{r(this,"LinearGradient");}[c]=Io;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Re=class i extends de{static{r(this,"RadialGradient");}[c]=To;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,n)=>{m(g(t.color),"ColorStyle not supported yet");let o=this.stops[n+1],a=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${a*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},Be=class i extends de{static{r(this,"ConicGradient");}[c]=Po;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function Ji(i){return i instanceof de}r(Ji,"isGradient");var So="ColorStyle";function Ft(i){return v(i)?i[c]===So:false}r(Ft,"isColorStyleData");var J=class i{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function ue(i){return i instanceof J}r(ue,"isColorStyle");var Fo="TextStyle";function Qi(i){return v(i)?i[c]===Fo:false}r(Qi,"isTextStyleData");var Ue=class i{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=O[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&O[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&O[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&O[l.unmarshal](e,t.boldItalicFont),this.color=Ft(t.color)?J[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Ft(t.decorationColor)?J[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:ue(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:ue(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function ui(i){return i instanceof Ue}r(ui,"isTextStyle");function Do(i){return v(i)&&l.marshal in i}r(Do,"isSelfMarshalable");function B(i){if(Do(i))return i[l.marshal]();if(Ut(i))return i.map(B);if(st(i)){let e={};for(let t of Object.keys(i))e[t]=B(i[t]);return e}return i}r(B,"marshal");var en={ColorStyle:J,ConicGradient:Be,FileAsset:Ve,Font:O,ImageAsset:j,LinearGradient:Le,RadialGradient:Re,TextStyle:Ue,BooleanVariable:xe,BorderVariable:ke,ColorVariable:Se,DateVariable:Ne,EnumVariable:Pe,FileVariable:De,FormattedTextVariable:Te,ImageVariable:Fe,LinkVariable:ve,NumberVariable:Ce,StringVariable:Ie,UnsupportedVariable:Me,UnsupportedComputedValue:We};function vo(i){return st(i)&&g(i[c])&&i[c]in en}r(vo,"isSelfUnmarshalable");function h(i,e){if(vo(e))return en[e[c]][l.unmarshal](i,e);if(Ut(e))return e.map(t=>h(i,t));if(st(e)){let t={};for(let n of Object.keys(e))t[n]=h(i,e[n]);return t}return e}r(h,"unmarshal");var No={array:false,boolean:false,collectionReference:false,color:false,date:false,enum:false,file:false,formattedText:false,image:true,link:false,multiCollectionReference:false,number:false,string:false,unsupported:false};function ko(i){return No[i]}r(ko,"isSupportedArrayItemFieldType");function Mo(i){return ko(i.type)}r(Mo,"isSupportedArrayItemFieldDataEntry");var jt="boolean",_t="color",qt="number",Yt="string",Xt="formattedText",Zt="image",Jt="array",Qt="link",ei="date",ti="file",ii="enum",ni="collectionReference",ri="multiCollectionReference",oi="divider",ai="unsupported";function Eo(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?ji(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}r(Eo,"sanitizeEnumFieldForMessage");function tn(i,e){let t={};for(let n in i){let o=i[n];if(!o)continue;if(o.type!=="array"){t[n]=h(e,o);continue}let a=o.value.map(s=>{let d=tn(s.fieldData,e),I={};for(let b in d){let F=d[b];m(F&&Mo(F),"Unsupported array item field data entry"),I[b]=F;}return {...s,fieldData:I}});t[n]={...o,value:a};}return t}r(tn,"deserializeFieldData");var ce=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,m(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,S(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=Eo(e);return this.#e.invoke("setManagedCollectionFields",this.id,t)}async addItems(e){return this.#e.invoke("addManagedCollectionItems2",this.id,e)}async removeItems(e){return this.#e.invoke("removeManagedCollectionItems",this.id,e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},Q=class{static{r(this,"Collection");}id;name;slugFieldName;slugFieldBasedOn;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.slugFieldName=e.slugFieldName,this.slugFieldBasedOn=e.slugFieldBasedOn,this.readonly=e.readonly,this.managedBy=e.managedBy,this.#e=t,S(this);}async setItemOrder(e){return this.#e.invoke("setCollectionItemOrder",this.id,e)}async getFields(){let e=await this.#e.invoke("getCollectionFields2",this.id,true);return Ht(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return m(t.every(Gi)),Ht(t,this.#e,this.id)}async removeFields(e){return this.#e.invoke("removeCollectionFields",this.id,e)}async setFieldOrder(e){return this.#e.invoke("setCollectionFieldOrder",this.id,e)}async getItems(){return (await this.#e.invoke("getCollectionItems2",this.id)).map(t=>new Oe(t,this.#e))}async addItems(e){await this.#e.invoke("addCollectionItems2",this.id,e);}async removeItems(e){return this.#e.invoke("removeCollectionItems",e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},Oe=class i{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=tn(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=n,this.#e=t,S(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new i(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var Ao={fixed:true,sticky:true,absolute:true,relative:true},nn="position";function Ls(i){if(!(nn in i))return false;let e=i[nn];return g(e)&&Ao[e]===true}r(Ls,"supportsPosition");var rn="top";function Rs(i){if(!(rn in i))return false;let e=i[rn];return g(e)||x(e)}r(Rs,"supportsPins");var on="width";function Bs(i){if(!(on in i))return false;let e=i[on];return g(e)||x(e)}r(Bs,"supportsSize");var an="maxWidth";function Us(i){if(!(an in i))return false;let e=i[an];return g(e)||x(e)}r(Us,"supportsSizeConstraints");var sn="aspectRatio";function Os(i){if(!(sn in i))return false;let e=i[sn];return $(e)||x(e)}r(Os,"supportsAspectRatio");var ln="name";function zs(i){if(!(ln in i))return false;let e=i[ln];return g(e)||x(e)}r(zs,"supportsName");var dn="visible";function Gs(i){if(!(dn in i))return false;let e=i[dn];return be(e)}r(Gs,"supportsVisible");var un="locked";function Ks(i){if(!(un in i))return false;let e=i[un];return be(e)}r(Ks,"supportsLocked");var cn="backgroundColor";function $s(i){if(!(cn in i))return false;let e=i[cn];return g(e)||ue(e)||x(e)}r($s,"supportsBackgroundColor");var pn="backgroundColor";function Hs(i){if(!(pn in i))return false;let e=i[pn];return g(e)||Ft(e)||x(e)}r(Hs,"supportsBackgroundColorData");var mn="backgroundImage";function js(i){if(!(mn in i))return false;let e=i[mn];return e instanceof j||x(e)}r(js,"supportsBackgroundImage");var gn="backgroundImage";function _s(i){if(!(gn in i))return false;let e=i[gn];return e instanceof j?false:_i(e)||x(e)}r(_s,"supportsBackgroundImageData");var fn="backgroundGradient";function qs(i){if(!(fn in i))return false;let e=i[fn];return Ji(e)||x(e)}r(qs,"supportsBackgroundGradient");var yn="backgroundGradient";function Ys(i){if(!(yn in i))return false;let e=i[yn];return v(e)||x(e)}r(Ys,"supportsBackgroundGradientData");var hn="rotation";function Xs(i){if(!(hn in i))return false;let e=i[hn];return $(e)}r(Xs,"supportsRotation");var bn="opacity";function Zs(i){if(!(bn in i))return false;let e=i[bn];return $(e)}r(Zs,"supportsOpacity");var xn="borderRadius";function Js(i){if(!(xn in i))return false;let e=i[xn];return g(e)||x(e)}r(Js,"supportsBorderRadius");var Cn="border";function Qs(i){if(!(Cn in i))return false;let e=i[Cn];return x(e)||ue(e.color)}r(Qs,"supportsBorder");var In="svg";function el(i){if(!(In in i))return false;let e=i[In];return g(e)}r(el,"supportsSVG");var Tn="textTruncation";function tl(i){if(!(Tn in i))return false;let e=i[Tn];return $(e)||x(e)}r(tl,"supportsTextTruncation");var Pn="zIndex";function il(i){if(!(Pn in i))return false;let e=i[Pn];return $(e)||x(e)}r(il,"supportsZIndex");var Sn="overflow";function nl(i){if(!(Sn in i))return false;let e=i[Sn];return g(e)||x(e)}r(nl,"supportsOverflow");var Fn="componentIdentifier";function rl(i){if(!(Fn in i))return false;let e=i[Fn];return g(e)}r(rl,"supportsComponentInfo");var Dn="font";function ol(i){if(!(Dn in i))return false;let e=i[Dn];return Zi(e)}r(ol,"supportsFont");var vn="font";function al(i){if(!(vn in i))return false;let e=i[vn];return Xi(e)||x(e)}r(al,"supportsFontData");var Nn="inlineTextStyle";function sl(i){if(!(Nn in i))return false;let e=i[Nn];return ui(e)||x(e)}r(sl,"supportsInlineTextStyle");var kn="inlineTextStyle";function ll(i){if(!(kn in i))return false;let e=i[kn];return Qi(e)||x(e)}r(ll,"supportsInlineTextStyleData");var Mn="link";function dl(i){if(!(Mn in i))return false;let e=i[Mn];return g(e)||x(e)}r(dl,"supportsLink");var En="imageRendering";function ul(i){if(!(En in i))return false;let e=i[En];return g(e)||x(e)}r(ul,"supportsImageRendering");var An="layout";function Wn(i){if(!(An in i))return false;let e=i[An];return g(e)||x(e)}r(Wn,"supportsLayout");function cl(i){return Wn(i)?i.layout==="stack":false}r(cl,"hasStackLayout");function pl(i){return Wn(i)?i.layout==="grid":false}r(pl,"hasGridLayout");var Vn="isVariant";function Ln(i){if(!(Vn in i))return false;let e=i[Vn];return be(e)}r(Ln,"supportsComponentVariant");function ci(i){return Ln(i)?i.isVariant:false}r(ci,"isComponentVariant");function Rn(i){return !Ln(i)||!ci(i)?false:!x(i.gesture)}r(Rn,"isComponentGestureVariant");var wn="isBreakpoint";function Vo(i){if(!(wn in i))return false;let e=i[wn];return be(e)}r(Vo,"supportsBreakpoint");function Bn(i){return Vo(i)?i.isBreakpoint:false}r(Bn,"isBreakpoint");var V=class{static{r(this,"NodeMethods");}id;originalId;#e;constructor(e,t){this.id=e.id,this.originalId=e.originalId??null,this.#e=t;}get isReplica(){return this.originalId!==null}async remove(){return this.#e.invoke("removeNodes2",[this.id])}async select(){return this.#e.invoke("setSelection",[this.id])}async clone(){if(this[c]==="UnknownNode")throw Error("Can not clone unknown node");return this.#e.cloneNode(this.id)}async setAttributes(e){if(this[c]==="UnknownNode")throw Error("Can not set attributes on unknown node");return this.#e.setAttributes(this.id,e)}async getRect(){return this.#e.invoke("getRect",this.id)}async zoomIntoView(e){return this.#e.invoke("zoomIntoView",[this.id],e)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}async getParent(){return this.#e.getParent(this.id)}async getChildren(){return ee(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return ee(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>C(n,this.#e))}async getNodesWithAttribute(e){return ee(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>C(n,this.#e))}async getNodesWithAttributeSet(e){return ee(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>C(n,this.#e))}async*walk(){if(yield this,!ee(this))for(let e of await this.getChildren())yield*e.walk();}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}},U=class extends V{static{r(this,"FrameNode");}[c]="FrameNode";name;visible;locked;backgroundColor;backgroundImage;backgroundGradient;rotation;opacity;borderRadius;border;imageRendering;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;zIndex;link;linkOpenInNewTab;overflow;overflowX;overflowY;layout;gap;padding;stackDirection;stackDistribution;stackAlignment;stackWrapEnabled;gridColumnCount;gridRowCount;gridAlignment;gridColumnWidthType;gridColumnWidth;gridColumnMinWidth;gridRowHeightType;gridRowHeight;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;isVariant;isPrimaryVariant;isBreakpoint;isPrimaryBreakpoint;inheritsFromId;gesture;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.backgroundColor=h(t,e.backgroundColor)??null,this.backgroundImage=h(t,e.backgroundImage)??null,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.borderRadius=e.borderRadius??null,this.border=h(t,e.border)??null,this.backgroundGradient=h(t,e.backgroundGradient)??null,this.imageRendering=e.imageRendering??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,this.zIndex=e.zIndex??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.layout=e.layout??null,this.gap=e.gap??null,this.padding=e.padding??null,this.stackDirection=e.stackDirection??null,this.stackDistribution=e.stackDistribution??null,this.stackAlignment=e.stackAlignment??null,this.stackWrapEnabled=e.stackWrapEnabled??null,this.gridColumnCount=e.gridColumnCount??null,this.gridRowCount=e.gridRowCount??null,this.gridAlignment=e.gridAlignment??null,this.gridColumnWidthType=e.gridColumnWidthType??null,this.gridColumnWidth=e.gridColumnWidth??null,this.gridColumnMinWidth=e.gridColumnMinWidth??null,this.gridRowHeightType=e.gridRowHeightType??null,this.gridRowHeight=e.gridRowHeight??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,this.inheritsFromId=e.inheritsFromId??null,this.gesture=e.gesture??null,this.isVariant=e.isVariant??false,this.isPrimaryVariant=e.isPrimaryVariant??false,this.isBreakpoint=e.isBreakpoint??false,this.isPrimaryBreakpoint=e.isPrimaryBreakpoint??false,S(this);}},te=class extends V{static{r(this,"TextNode");}[c]="TextNode";name;visible;locked;rotation;opacity;zIndex;font;inlineTextStyle;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;link;linkOpenInNewTab;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;overflow;overflowX;overflowY;textTruncation;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.zIndex=e.zIndex??null,this.font=h(t,e.font)??null,this.inlineTextStyle=h(t,e.inlineTextStyle)??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.textTruncation=e.textTruncation??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,S(this);}async setText(e){await this.#e.invoke("setTextForNode",this.id,e);}async getText(){return this.#e.invoke("getTextForNode",this.id)}async setHTML(e){await this.#e.invoke(le,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(se,this.id)}},ze=class extends V{static{r(this,"SVGNode");}[c]="SVGNode";name;visible;locked;svg;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.svg=e.svg,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,S(this);}},Ge=class extends V{static{r(this,"VectorSetItemNode");}[c]="VectorSetItemNode";name;visible;locked;top;right;bottom;left;centerX;centerY;width;height;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.top=e.top??null,this.right=e.right??null,this.bottom=e.bottom??null,this.left=e.left??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,S(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ke=class extends V{static{r(this,"ComponentInstanceNode");}[c]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#i;get typedControls(){return this.#i||(this.#i=h(this.#e,this.#t.typedControls)??{}),this.#i}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=h(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,S(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},ie=class extends V{static{r(this,"WebPageNode");}[c]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,S(this);}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let n=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=C(n,this.#e);return m(o instanceof U),m(Bn(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Oe(e,this.#e):null}},ne=class extends V{static{r(this,"ComponentNode");}[c]="ComponentNode";name;componentIdentifier;insertURL;componentName;#e;constructor(e,t){super(e,t),this.#e=t,this.componentIdentifier=e.componentIdentifier,this.insertURL=e.insertURL??null,this.componentName=e.componentName??null,this.name=e.name??null,S(this);}async addVariant(e,t){let n=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!n)throw new Error("Failed to add variant to component");let o=C(n,this.#e);return m(o instanceof U),m(ci(o),"Node is not a component variant"),o}async addGestureVariant(e,t,n){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,n);if(!o)throw new Error("Failed to add state to component");let a=C(o,this.#e);return m(a instanceof U),m(Rn(a),"Node is not a gesture variant"),a}async getVariables(){let e=await this.#e.invoke("getVariables",this.id);return h(this.#e,e)}async addVariables(e){let t=await this.#e.invoke("addVariables",this.id,B(e));return h(this.#e,t)}async removeVariables(e){await this.#e.invoke("removeVariables",this.id,e);}async setVariableOrder(e){await this.#e.invoke("setVariableOrder",this.id,e);}},$e=class extends V{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},re=class extends V{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},He=class extends V{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),S(this);}};function C(i,e){switch(i[c]){case "DesignPageNode":return new re(i,e);case "WebPageNode":return new ie(i,e);case "ComponentNode":return new ne(i,e);case "VectorSetNode":return new $e(i,e);case "VectorSetItemNode":return new Ge(i,e);case "ComponentInstanceNode":return new Ke(i,e);case "FrameNode":return new U(i,e);case "SVGNode":return new ze(i,e);case "TextNode":return new te(i,e);case "UnknownNode":return new He(i,e);default:return new He(i,e)}}r(C,"convertRawNodeDataToNode");function Dt(i){return i instanceof U}r(Dt,"isFrameNode");function Un(i){return i instanceof te}r(Un,"isTextNode");function On(i){return i instanceof ze}r(On,"isSVGNode");function pe(i){return i instanceof Ke}r(pe,"isComponentInstanceNode");function zn(i){return i instanceof ie}r(zn,"isWebPageNode");function Gn(i){return i instanceof ne}r(Gn,"isComponentNode");function Kn(i){return i instanceof re}r(Kn,"isDesignPageNode");function $n(i){return i instanceof $e}r($n,"isVectorSetNode");function Hn(i){return i instanceof Ge}r(Hn,"isVectorSetItemNode");function ee(i){return i instanceof He}r(ee,"isUnknownNode");function je(i){return !!(Dt(i)||Un(i)||pe(i)||On(i)||Hn(i)||ee(i))}r(je,"isCanvasNode");function pi(i){return !!(zn(i)||Kn(i)||Gn(i)||$n(i)||ee(i))}r(pi,"isCanvasRootNode");var _e=class{static{r(this,"VectorSet");}id;name;owner;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.owner=e.owner,this.#e=t;}async getItems(){return (await this.#e.invoke("getVectorSetItems",this.id)).map(t=>new vt(t,this.#e))}},vt=class{static{r(this,"VectorSetItem");}id;name;insertUrl;iconUrl;#e;#t;constructor(e,t){this.id=e.id,this.name=e.name,this.insertUrl=e.insertUrl,this.iconUrl=e.iconUrl,this.#e=e.moduleId,this.#t=t;}async getVariables(){return this.#t.invoke("getVectorSetItemVariables",this.id,this.#e)}};var qe=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},q=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function wo(i){return i.type==="separator"}r(wo,"isSeparatorMenuItem");function Nt(i,e){let t=[];for(let n of i){if(wo(n)){t.push(n);continue}let{onAction:o,...a}=n,s=a;if(n.onAction){let d=Math.random();e.set(d,n.onAction),s.actionId=d;}n.submenu&&(s.submenu=Nt(n.submenu,e)),t.push(s);}return t}r(Nt,"addMenuItemsToOnActionCallbackMap");var kt="type",jn={[kt]:"pluginReadySignal"},Lo="pluginReadyResponse";var Ro={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function _n(i){return v(i)&&g(i[kt])&&i[kt]in Ro}r(_n,"isVekterToPluginNonHandshakeMessage");function qn(i){return v(i)&&i[kt]===Lo}r(qn,"isPluginReadyResponse");var mi=Symbol(),gi=Symbol(),fi=Symbol(),yi=Symbol(),hi=Symbol(),bi=Symbol(),xi=Symbol(),E={publish:mi,getDeployments:gi,deploy:fi,getChangedPaths:yi,getChangeContributors:hi,createManagedCollection:bi,rejectAllPending:xi};function Ci(i){return typeof i=="string"&&i in E}r(Ci,"isFramerApiOnlyMethod");var Bo=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions","lintCode"],Uo=["closeNotification","closePlugin","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","typecheckCode","getCodeFileVersions","getCodeFiles","getCodeFile","getRedirects","uploadFile","uploadFiles","uploadImage","uploadImages","zoomIntoView","navigateTo","getRuntimeErrorForModule","getRuntimeErrorForCodeComponentNode","showProgressOnInstances","removeProgressFromInstances","addComponentInstancePlaceholder","updateComponentInstancePlaceholder","removeComponentInstancePlaceholder","setMenu","showContextMenu","getBreakpointSuggestionsForWebPage","getActiveCollectionItemForWebPage","getVariables","getVectorSets","getVectorSetItems","getVectorSetItemVariables","getChangedPaths","getChangeContributors","getDeployments",ut,ct,se,"getAiServiceInfo","sendTrackingEvent",...Bo];new Set(Uo);var Ii={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[le],"TextNode.getHTML":[],"ComponentNode.addVariant":["addVariantToComponent"],"ComponentNode.addGestureVariant":["addGestureVariantToComponent"],"ComponentNode.getVariables":[],"ComponentNode.addVariables":["addVariables"],"ComponentNode.removeVariables":["removeVariables"],"WebPageNode.getBreakpointSuggestions":[],"WebPageNode.addBreakpoint":["addBreakpointToWebPage"],"WebPageNode.getActiveCollectionItem":[],"ColorStyle.getPluginData":[],"ColorStyle.getPluginDataKeys":[],"ColorStyle.remove":["removeColorStyle"],"ColorStyle.setAttributes":["setColorStyleAttributes"],"ColorStyle.setPluginData":["setPluginDataForNode"],"TextStyle.getPluginData":[],"TextStyle.getPluginDataKeys":[],"TextStyle.remove":["removeTextStyle"],"TextStyle.setAttributes":["setTextStyleAttributes"],"TextStyle.setPluginData":["setPluginDataForNode"],"Variable.setAttributes":["updateVariable"],"Variable.remove":["removeVariables"],"ComponentNode.setVariableOrder":["setVariableOrder"],"EnumCase.remove":["removeEnumCase"],"EnumCase.setAttributes":["updateEnumCase"],"EnumVariable.addCase":["addEnumCase"],"EnumVariable.setCaseOrder":["setEnumCaseOrder"],createCollection:["createCollection"],[Ot]:[],[zt]:[],[Gt]:[],[Kt]:[],[mi]:["publish"],[gi]:[],[fi]:["deploy"],[yi]:[],[hi]:[],[bi]:["createManagedCollection"],[xi]:[]},Mt=[];for(let i of Object.keys(Ii))Ii[i].length!==0&&Mt.push(i);S(Mt);function Ti(i){let e={};for(let t of Mt){let n=Ii[t];e[t]=n.every(o=>i[o]);}return e}r(Ti,"createPerMethodPermissionMap");function Yn(){let i={};for(let e of Mt)i[e]=true;return i}r(Yn,"createPerMethodPermissionMapForTesting");var me=null;function Xn(i){if(typeof window>"u")return;if(!me){let t=document.createElement("style");document.head.appendChild(t),me=t.sheet;}if(!me){i();return}let e=me.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{me&&me.deleteRule(e);});});}r(Xn,"withDisabledCssTransitions");var Ye=class{static{r(this,"PluginEngine");}methodInvocationId=0;notificationId=0;postMessage;methodResponseHandlers=new Map;mode;subscriptions=new Map;perMethodPermissionMap;permissionSubscriptions=new Set;messageTypesCheckedInIsAllowedTo=new Set;showUncheckedPermissionToasts=true;environmentInfo=null;initialState;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;rejectAllPending(e){for(let[t,n]of this.methodResponseHandlers)n.reject(e),this.methodResponseHandlers.delete(t);}constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=Yn(),this.initialState={mode:"canvas",intent:"plugin/open"};return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof q&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof q&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.initialState=e.initialState??{mode:e.mode,intent:"plugin/open"},this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=Ti(e.permissionMap),this.postMessage=(t,n)=>e.transport.send(t,n),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:lt(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(B)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:a,reject:s}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let n=this.subscriptions.get(e)??new Set;return n.add(t),this.subscriptions.set(e,n),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=e=>{let t=e?.data??e;if(_n(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Ti(t.permissionMap);for(let n of this.permissionSubscriptions)n();break}case "methodResponse":{let n=this.methodResponseHandlers.get(t.id);if(!n)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),g(t.error)?n.reject(new qe(t.error)):n.resolve(t.result);break}case "subscriptionMessage":{let{topic:n,payload:o}=t,a=this.subscriptions.get(n);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let n=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!n)throw new Error("Menu action received for an unknown menu item");n();break}default:lt(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:lt(t);}}applyPluginTheme=e=>{Xn(()=>{document.body.setAttribute("data-framer-theme",e.mode);for(let t in e.tokens)document.body.style.setProperty(t,e.tokens[t]);});};async cloneNode(e){let t=await this.invoke("cloneNode",e);return t?C(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?C(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?C(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=C(n,this);return m(je(o)),o})}notify=(e,t)=>{let n=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:n,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:()=>this.invoke("closeNotification",n)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=Nt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=Nt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function Oo(i){return i.type==="component"}r(Oo,"isCodeFileComponentExport");function zo(i){return i.type==="override"}r(zo,"isCodeFileOverrideExport");var Pi=class{static{r(this,"CodeFileVersion");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get createdAt(){return this.#e.createdAt}get createdBy(){return this.#e.createdBy}constructor(e,t){this.#t=t,this.#e=e;}async getContent(){return await this.#t.invoke("getCodeFileVersionContent",this.#e.fileId,this.#e.id)}},Y=class i{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new i(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new i(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new Pi(t,this.#t))}async showProgressOnInstances(e){return this.#t.invoke("showProgressOnInstances",this.id,e)}async removeProgressFromInstances(){return this.#t.invoke("removeProgressFromInstances",this.id)}async lint(e){return Promise.resolve([])}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var Et=class i{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new i(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let n=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!n)return null;let o=C(n,this.#t);return m(pe(o)),o}};var Go=(()=>{let i=null;return {disableUntilMouseUp:()=>{if(i)return;i=document.createElement("style"),i.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(i);let e=r(()=>{i&&(document.head.removeChild(i),i=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),n=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",n);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",n);}r(o,"cleanup");}}})(),Zn=5,Ko=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function $o(){}r($o,"noop");function Jn(i,e,t,n){if(i.mode!=="canvas")return $o;let o=Ko.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,I=oe.subscribeToIsAllowedTo("makeDraggable",p=>{p||T();}),b=r(p=>{oe.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&i.invoke("onDragEnd",{...p,dragSessionId:o}).then(y=>{try{n?.(y);}catch{}}).catch(y=>{if(y instanceof Error){n?.({status:"error",reason:y.message});return}if(typeof y=="string"){n?.({status:"error",reason:y});return}n?.({status:"error"});}),T());},"endDrag"),F=r(p=>{if(!oe.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(p.buttons>0&&!!(p.buttons&1))){b({cancelled:false});return}let{clientX:D,clientY:Z}=p;if(s.type==="pointerDown"){let he=D-s.dragStart.mouse.x,Oi=Z-s.dragStart.mouse.y;if(Math.abs(he)<Zn&&Math.abs(Oi)<Zn)return;s={type:"dragging",dragStart:s.dragStart},i.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),Go.disableUntilMouseUp();}d.setPointerCapture(p.pointerId);let P={x:D,y:Z};i.invoke("onDrag",{dragSessionId:o,mouse:P}).then(he=>{s.type==="dragging"&&(document.body.style.cursor=he??"");});},"handlePointerChange"),G=r(p=>{p.key==="Escape"&&b({cancelled:true});},"handleKeyDown"),K=r(()=>{b({cancelled:true});},"handleBlur"),f=r(p=>{if(!oe.isAllowedTo("makeDraggable"))return;b({cancelled:true});let y=e.getBoundingClientRect(),D={x:y.x,y:y.y,width:y.width,height:y.height},Z,P=e.querySelectorAll("svg");if(P.length===1){let ot=P.item(0).getBoundingClientRect();Z={x:ot.x,y:ot.y,width:ot.width,height:ot.height};}let he={x:p.clientX,y:p.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:D,svgRect:Z,mouse:he}},i.invoke("setDragData",o,t()),d.addEventListener("pointermove",F,true),d.addEventListener("pointerup",F,true),window.addEventListener("keydown",G,true),window.addEventListener("blur",K);},"handlePointerDown"),u=r(()=>{if(!oe.isAllowedTo("makeDraggable"))return;let p=t();p.type==="detachedComponentLayers"&&i.invoke("preloadDetachedComponentLayers",p.url),p.type==="image"&&i.invoke("preloadImageUrlForInsertion",p.image),p.previewImage&&i.invoke("preloadDragPreviewImage",p.previewImage);},"preload");e.addEventListener("pointerdown",f),e.addEventListener("mouseenter",u);function T(){s={type:"idle"},document.body.style.cursor=a,d.removeEventListener("pointermove",F,true),d.removeEventListener("pointerup",F,true),window.removeEventListener("keydown",G,true),window.removeEventListener("blur",K);}return r(T,"dragCleanup"),()=>{e.removeEventListener("pointerdown",f),e.removeEventListener("mouseenter",u),b({cancelled:true}),I();}}r(Jn,"makeDraggable");var ge=class i{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[n]=await this.#t.invoke("addRedirects",[t]);return m(at(n)),x(n)?null:new i(n,this.#t)}};var Si=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,n]=Ki(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,n(o));},"update");return this.#e.permissionSubscriptions.add(a),()=>{this.#e.permissionSubscriptions.delete(a);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new q}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let n=C(t,this.#e);return m(je(n)),n})}async setSelection(e){let t=g(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let n=t.map(o=>{let a=C(o,this.#e);return m(je(a)),a});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=C(e,this.#e);return m(pi(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=C(t,this.#e);m(pi(n)),e(n);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let n=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!n)return null;let o=C(n,this.#e);return m(o instanceof U),o}async removeNodes(e){return this.#e.invoke("removeNodes2",e)}async removeNode(e){return this.removeNodes([e])}async cloneNode(e){return this.#e.cloneNode(e)}async getNode(e){let t=await this.#e.invoke("getNode",e);return t?C(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let n=g(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",n,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,n){return this.#e.invoke("setParent",e,t,n)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(n=>C(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>C(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>C(n,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?h(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(h(this.#e,t));})}async addImage(e){let t=await we(e),n=_(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await we(e),n=_(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await we(e),n=_(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return h(this.#e,o)}async addImages(e){let t=await li(e),n=t.flatMap(_);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await li(e),n=t.flatMap(_),o=await this.#e.invokeTransferable("uploadImages",n,t);return h(this.#e,o)}async uploadFile(e){let t=await si(e),n=await this.#e.invokeTransferable("uploadFile",_(t),t);return h(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(si)),n=t.flatMap(_),o=await this.#e.invokeTransferable("uploadFiles",n,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:n}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:n}),a=C(o,this.#e);return m(pe(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),a=C(o,this.#e);return m(Dt(a)),a}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,n){return Jn(this.#e,e,t,n)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return m(e,"Collection data must be defined"),new ce(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return m(e,"Collections data must be defined"),e.map(t=>new ce(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new Q(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new Q(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new Q(t,this.#e))}notify=(e,t)=>this.#e.notify(e,t);async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return h(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?h(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return h(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let n=h(this.#e,t);return e(n)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return h(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?h(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return h(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let n=h(this.#e,t);return e(n)})}async getFont(e,t){let n=await this.#e.invoke("getFont",e,t);return n?h(this.#e,n):null}async getFonts(){let e=await this.#e.invoke("getFonts");return h(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(){return this.#e.invoke("getLocalizationGroups")}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new ge(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new ge(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new ge(n,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,n){let o=await this.#e.invoke("createCodeFile",e,t,n);return new Y(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new Y(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new Y(t,this.#e):null}lintCode(e,t,n){return Promise.resolve([])}typecheckCode(e,t,n){return this.#e.invoke("typecheckCode",e,t,n)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let n=t?.map(o=>new Y(o,this.#e));return e(n)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let n=t?new Y(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=C(t,this.#e);return m(n instanceof re,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=C(t,this.#e);return m(n instanceof ie,"Expected node to be a WebPageNode"),n}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new Q(t,this.#e)}},Fi=class extends Si{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},Xe=class extends Fi{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new Et(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(ut)}async[l.sendTrackingEvent](e,t,n){return this.#e.invoke(ct,e,t,n)}async[l.getHTMLForNode](e){return this.#e.invoke(se,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(le,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}get[l.initialState](){return this.#e.initialState}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let n=await this.#e.invoke("createNode","TextNode",t??null,e);if(!n)return null;let o=C(n,this.#e);return m(o instanceof te),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=C(t,this.#e);return m(n instanceof ne),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new _e(t,this.#e))}async[E.publish](){return this.#e.invoke("publish")}async[E.getDeployments](){return this.#e.invoke("getDeployments")}async[E.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[E.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[E.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[E.createManagedCollection](e){let t=await this.#e.invoke("createManagedCollection",e);return new ce(t,this.#e)}[E.rejectAllPending](e){this.#e.rejectAllPending(e);}};var Di=class{constructor(e){this.origin=e;}static{r(this,"IframeTransport");}send(e,t){window.parent.postMessage(e,this.origin,t);}onMessage(e){window.addEventListener("message",e);}};async function Ho(){return new Promise(i=>{function e({data:t,origin:n}){if(!qn(t))return;window.removeEventListener("message",e);let a={transport:new Di(n),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:n,theme:t.theme??null,initialState:t.initialState};i(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(jn,"*");})}r(Ho,"createBrowserContext");async function jo(){return typeof window<"u"?Ho():null}r(jo,"bootstrap");var Qn=await jo(),oe=Qn?new Xe(new Ye(Qn)):new Proxy({},{get(i,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function er(i){return new Xe(new Ye(i))}r(er,"createFramerInstance");var Yo=qo,tr=Yo.env;function Xo(i){Object.assign(tr,i);}r(Xo,"configure");function fe(i,e){return tr[i]??e}r(fe,"getEnv");var ir=typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof globalThis.WebSocketPair<"u",nr=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:WebSocket;async function rr(i,e){let t=new URL(i.href);t.protocol=t.protocol==="wss:"?"https:":t.protocol==="ws:"?"http:":t.protocol;let o=(await fetch(t.href,{headers:{Upgrade:"websocket",...e}})).webSocket;if(!o)throw new Error("WebSocket upgrade failed - server did not accept");return o.accept(),o}r(rr,"connectWebSocketCF");var or,ar;try{or=await import('node:fs'),ar=await import('node:path');}catch{}var vi=or,Ni=ar;var At=(o=>(o.PROJECT_CLOSED="PROJECT_CLOSED",o.POOL_EXHAUSTED="POOL_EXHAUSTED",o.TIMEOUT="TIMEOUT",o.INTERNAL="INTERNAL",o))(At||{}),W=class extends Error{static{r(this,"FramerAPIError");}code;constructor(e,t){super(e),this.name="FramerAPIError",this.code=t,this.stack=undefined;}};function Zo(i){return i instanceof W?i.code==="POOL_EXHAUSTED":false}r(Zo,"isRetryableError");function L(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
8
+ `));}catch{}throw t}r(m,"assert");function F(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!Mr(t)||F(t);}return Object.freeze(i)}r(F,"deepFreeze");function Ki(i){return [i.slice(0,-1),i.at(-1)]}r(Ki,"splitRestAndLast");var c="__class";var Ot=Symbol(),zt=Symbol(),Ar=Symbol(),Vr=Symbol(),wr=Symbol(),Wr=Symbol(),Lr=Symbol(),Gt=Symbol(),Kt=Symbol(),l={getAiServiceInfo:Ot,sendTrackingEvent:zt,environmentInfo:Ar,initialState:Vr,showUncheckedPermissionToasts:wr,marshal:Wr,unmarshal:Lr,getHTMLForNode:Gt,setHTMLForNode:Kt},ut="INTERNAL_",ct=`${ut}getAiServiceInfo`,pt=`${ut}sendTrackingEvent`,le=`${ut}getHTMLForNode`,de=`${ut}setHTMLForNode`;var k=class{static{r(this,"VariableBase");}#e;#t;get nodeId(){return this.#t.nodeId}get nodeType(){return this.#t.nodeType}get id(){return this.#t.id}get name(){return this.#t.name}get description(){return this.#t.description??null}constructor(e,t){this.#e=e,this.#t=t;}async setAttributes(e){let t=await this.#e.invoke("updateVariable",this.nodeId,this.id,{...e,type:this.type});if(C(t))return null;let n=this.constructor;return new n(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},A="Variable";function w(i){let e=i.at(0);return m(!zi(e)),`${e.toLowerCase()}${i.slice(1,-A.length)}`}r(w,"classToType");var Rr=`Boolean${A}`,Br=w(Rr),xe=class i extends k{static{r(this,"BooleanVariable");}type=Br;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Ur=`Number${A}`,Or=w(Ur),Ce=class i extends k{static{r(this,"NumberVariable");}type=Or;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},zr=`String${A}`,Gr=w(zr),Ie=class i extends k{static{r(this,"StringVariable");}type=Gr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Kr=`FormattedText${A}`,$r=w(Kr),Te=class i extends k{static{r(this,"FormattedTextVariable");}type=$r;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Hr=`Enum${A}`,jr=w(Hr),j=class i{static{r(this,"EnumCase");}#e;#t;#i;#n;get id(){return this.#n.id}get name(){return this.#n.name}get nameByLocale(){return this.#n.nameByLocale}constructor(e,t,n,o){this.#e=e,this.#t=t,this.#i=n,this.#n=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#i,this.id,e);return t?new i(this.#e,this.#t,this.#i,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#i,this.id);}},Pe=class i extends k{static{r(this,"EnumVariable");}type=jr;#e;#t;#i;get cases(){return this.#i||(this.#i=F(this.#t.cases.map(e=>new j(this.#e,this.nodeId,this.id,e)))),this.#i}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new j(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},_r=`Color${A}`,qr=w(_r),Se=class i extends k{static{r(this,"ColorVariable");}type=qr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Yr=`Image${A}`,Xr=w(Yr),Fe=class i extends k{static{r(this,"ImageVariable");}type=Xr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Zr=`File${A}`,Jr=w(Zr),De=class i extends k{static{r(this,"FileVariable");}type=Jr;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Qr=`Link${A}`,eo=w(Qr),ve=class i extends k{static{r(this,"LinkVariable");}type=eo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},to=`Date${A}`,io=w(to),Ne=class i extends k{static{r(this,"DateVariable");}type=io;#e;get displayTime(){return this.#e.displayTime}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},no=`Border${A}`,ro=w(no),ke=class i extends k{static{r(this,"BorderVariable");}type=ro;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},oo=`Unsupported${A}`,ao=w(oo),Ee=class i extends k{static{r(this,"UnsupportedVariable");}type=ao;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}};function $i(i){return i instanceof k}r($i,"isVariable");function so(i){return $i(i)&&i.nodeType==="component"}r(so,"isComponentVariable");var B=class{static{r(this,"FieldBase");}#e;#t;#i;get id(){return this.#i.id}get name(){return this.#i.name}constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[n]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(m(st(n)),C(n))return null;m(n.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,n)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},L=class extends B{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,n){super(e,t,n),this.#e=n;}},mt=class extends B{static{r(this,"BooleanField");}type=jt},gt=class extends B{static{r(this,"ColorField");}type=_t},ft=class extends B{static{r(this,"NumberField");}type=qt},yt=class extends L{static{r(this,"StringField");}type=Yt;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},ht=class extends L{static{r(this,"FormattedTextField");}type=Xt},Me=class extends L{static{r(this,"ImageField");}type=Zt},bt=class extends L{static{r(this,"LinkField");}type=Qt},xt=class extends L{static{r(this,"DateField");}type=ei;#e;get displayTime(){return this.#e.displayTime}constructor(e,t,n){super(e,t,n),this.#e=n;}},Ct=class extends B{static{r(this,"FieldDivider");}type=oi},Ae=class extends B{static{r(this,"UnsupportedField");}type=ai},It=class extends L{static{r(this,"FileField");}type=ti;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,n){super(e,t,n),this.#e=n;}},Tt=class extends B{static{r(this,"EnumField");}type=ii;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new j(this.#e,this.#t,this.id,e)),F(this.#n)),this.#n}constructor(e,t,n){super(e,t,n),this.#e=e,this.#t=t,this.#i=n;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new j(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},Pt=class extends L{static{r(this,"CollectionReferenceField");}type=ni;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},St=class extends L{static{r(this,"MultiCollectionReferenceField");}type=ri;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},$t=class extends L{static{r(this,"ArrayField");}type=Jt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Me(e,t,o)];}};function Ht(i,e,t){return i.map(n=>{switch(n.type){case jt:return new mt(e,t,n);case _t:return new gt(e,t,n);case qt:return new ft(e,t,n);case Yt:return new yt(e,t,n);case Xt:return new ht(e,t,n);case Zt:return new Me(e,t,n);case Qt:return new bt(e,t,n);case ei:return new xt(e,t,n);case oi:return new Ct(e,t,n);case ai:return new Ae(e,t,n);case ti:return new It(e,t,n);case ii:return new Tt(e,t,n);case ni:return new Pt(e,t,n);case ri:return new St(e,t,n);case Jt:return new $t(e,t,n);default:return new Ae(e,t,n)}})}r(Ht,"fieldDefinitionDataArrayToFieldClassInstances");function lo(i){return i instanceof B}r(lo,"isField");var Hi="action";function uo(i){return !!i&&Hi in i&&g(i[Hi])}r(uo,"isLocalizedValueUpdate");function ji(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return uo(n)&&(e[t]=n),e},{})}r(ji,"filterInlineLocalizationValues");var Ve=class i{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function co(i){return i instanceof Ve}r(co,"isFileAsset");var po="ImageAsset";function _i(i){return D(i)?i[c]===po:false}r(_i,"isImageAssetData");var _=class i{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new i(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return fo(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),n=new Blob([t],{type:e});return createImageBitmap(n)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((n,o)=>{let s=new Image;s.onload=()=>n(s),s.onerror=()=>o(),s.src=t;})}};function mo(i){return i instanceof _}r(mo,"isImageAsset");function q(i){return i.type==="bytes"?[i.bytes.buffer]:[]}r(q,"getTransferable");function go(i){if(!D(i))return false;let e="bytes",t="mimeType";return !(!(e in i)||!(t in i)||!(i[e]instanceof Uint8Array)||!g(i[t]))}r(go,"isBytesData");async function we(i){if(i instanceof File)return di(i);let e=await qi(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}r(we,"createImageTransferFromInput");async function si(i){if(i instanceof File)return di(i);let e=await qi(i.file);return {name:i.name,...e}}r(si,"createFileTransferFromInput");async function qi(i){return i instanceof File?di(i):go(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}r(qi,"createAssetTransferFromAssetInput");function li(i){return Promise.all(i.map(we))}r(li,"createNamedAssetDataTransferFromInput");async function di(i){return new Promise((e,t)=>{let n=new FileReader;n.onload=o=>{let s=i.type,a=o.target?.result;if(!a||!(a instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(a);e({bytes:d,mimeType:s,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}r(di,"getAssetDataFromFile");async function fo(i){let e=i instanceof File,t=e?URL.createObjectURL(i):i,n=new Image;return n.crossOrigin="anonymous",new Promise((o,s)=>{n.onload=()=>{o({width:n.naturalWidth,height:n.naturalHeight});},n.onerror=a=>{s(a);},n.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(fo,"measureImage");var Ft=class{static{r(this,"ComputedValueBase");}};var yo="unsupported",We=class i extends Ft{static{r(this,"UnsupportedComputedValue");}type=yo;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return this.#e}};function ho(i){return i instanceof Ft}r(ho,"isComputedValue");var bo="Font";function Xi(i){return D(i)&&i[c]===bo}r(Xi,"isFontData");function xo(i){if(!H(i))return false;switch(i){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(xo,"isFontWeight");function Co(i){if(!g(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}r(Co,"isFontStyle");function Zi(i){return D(i)?g(i.family)&&g(i.selector)&&xo(i.weight)&&Co(i.style):false}r(Zi,"isFont");var G=class i{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let n=Yi.get(t.selector);if(n)return n;let o=new i(t);return Yi.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Yi=new Map;var Io="LinearGradient",To="RadialGradient",Po="ConicGradient",ue=class{static{r(this,"GradientBase");}#e;get stops(){return this.#e.stops}constructor(e){this.#e=e;}cloneWithAttributes(e){let t=this.constructor;return new t({...this.#e,...e})}},Le=class i extends ue{static{r(this,"LinearGradient");}[c]=Io;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return U({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Re=class i extends ue{static{r(this,"RadialGradient");}[c]=To;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return U({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,n)=>{m(g(t.color),"ColorStyle not supported yet");let o=this.stops[n+1],s=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${s*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},Be=class i extends ue{static{r(this,"ConicGradient");}[c]=Po;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return U({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function Ji(i){return i instanceof ue}r(Ji,"isGradient");var So="ColorStyle";function Dt(i){return D(i)?i[c]===So:false}r(Dt,"isColorStyleData");var J=class i{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function ce(i){return i instanceof J}r(ce,"isColorStyle");var Fo="TextStyle";function Qi(i){return D(i)?i[c]===Fo:false}r(Qi,"isTextStyleData");var Ue=class i{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=G[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&G[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&G[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&G[l.unmarshal](e,t.boldItalicFont),this.color=Dt(t.color)?J[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Dt(t.decorationColor)?J[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:ce(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:ce(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function ui(i){return i instanceof Ue}r(ui,"isTextStyle");function Do(i){return D(i)&&l.marshal in i}r(Do,"isSelfMarshalable");function U(i){if(Do(i))return i[l.marshal]();if(Ut(i))return i.map(U);if(lt(i)){let e={};for(let t of Object.keys(i))e[t]=U(i[t]);return e}return i}r(U,"marshal");var en={ColorStyle:J,ConicGradient:Be,FileAsset:Ve,Font:G,ImageAsset:_,LinearGradient:Le,RadialGradient:Re,TextStyle:Ue,BooleanVariable:xe,BorderVariable:ke,ColorVariable:Se,DateVariable:Ne,EnumVariable:Pe,FileVariable:De,FormattedTextVariable:Te,ImageVariable:Fe,LinkVariable:ve,NumberVariable:Ce,StringVariable:Ie,UnsupportedVariable:Ee,UnsupportedComputedValue:We};function vo(i){return lt(i)&&g(i[c])&&i[c]in en}r(vo,"isSelfUnmarshalable");function h(i,e){if(vo(e))return en[e[c]][l.unmarshal](i,e);if(Ut(e))return e.map(t=>h(i,t));if(lt(e)){let t={};for(let n of Object.keys(e))t[n]=h(i,e[n]);return t}return e}r(h,"unmarshal");var No={array:false,boolean:false,collectionReference:false,color:false,date:false,enum:false,file:false,formattedText:false,image:true,link:false,multiCollectionReference:false,number:false,string:false,unsupported:false};function ko(i){return No[i]}r(ko,"isSupportedArrayItemFieldType");function Eo(i){return ko(i.type)}r(Eo,"isSupportedArrayItemFieldDataEntry");var jt="boolean",_t="color",qt="number",Yt="string",Xt="formattedText",Zt="image",Jt="array",Qt="link",ei="date",ti="file",ii="enum",ni="collectionReference",ri="multiCollectionReference",oi="divider",ai="unsupported";function Mo(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?ji(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}r(Mo,"sanitizeEnumFieldForMessage");function tn(i,e){let t={};for(let n in i){let o=i[n];if(!o)continue;if(o.type!=="array"){t[n]=h(e,o);continue}let s=o.value.map(a=>{let d=tn(a.fieldData,e),x={};for(let b in d){let P=d[b];m(P&&Eo(P),"Unsupported array item field data entry"),x[b]=P;}return {...a,fieldData:x}});t[n]={...o,value:s};}return t}r(tn,"deserializeFieldData");var pe=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,m(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,F(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=Mo(e);return this.#e.invoke("setManagedCollectionFields",this.id,t)}async addItems(e){return this.#e.invoke("addManagedCollectionItems2",this.id,e)}async removeItems(e){return this.#e.invoke("removeManagedCollectionItems",this.id,e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},Q=class{static{r(this,"Collection");}id;name;slugFieldName;slugFieldBasedOn;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.slugFieldName=e.slugFieldName,this.slugFieldBasedOn=e.slugFieldBasedOn,this.readonly=e.readonly,this.managedBy=e.managedBy,this.#e=t,F(this);}async setItemOrder(e){return this.#e.invoke("setCollectionItemOrder",this.id,e)}async getFields(){let e=await this.#e.invoke("getCollectionFields2",this.id,true);return Ht(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return m(t.every(Gi)),Ht(t,this.#e,this.id)}async removeFields(e){return this.#e.invoke("removeCollectionFields",this.id,e)}async setFieldOrder(e){return this.#e.invoke("setCollectionFieldOrder",this.id,e)}async getItems(){return (await this.#e.invoke("getCollectionItems2",this.id)).map(t=>new Oe(t,this.#e))}async addItems(e){await this.#e.invoke("addCollectionItems2",this.id,e);}async removeItems(e){return this.#e.invoke("removeCollectionItems",e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},Oe=class i{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=tn(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=n,this.#e=t,F(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new i(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var Ao={fixed:true,sticky:true,absolute:true,relative:true},nn="position";function Ws(i){if(!(nn in i))return false;let e=i[nn];return g(e)&&Ao[e]===true}r(Ws,"supportsPosition");var rn="top";function Ls(i){if(!(rn in i))return false;let e=i[rn];return g(e)||C(e)}r(Ls,"supportsPins");var on="width";function Rs(i){if(!(on in i))return false;let e=i[on];return g(e)||C(e)}r(Rs,"supportsSize");var an="maxWidth";function Bs(i){if(!(an in i))return false;let e=i[an];return g(e)||C(e)}r(Bs,"supportsSizeConstraints");var sn="aspectRatio";function Us(i){if(!(sn in i))return false;let e=i[sn];return H(e)||C(e)}r(Us,"supportsAspectRatio");var ln="name";function Os(i){if(!(ln in i))return false;let e=i[ln];return g(e)||C(e)}r(Os,"supportsName");var dn="visible";function zs(i){if(!(dn in i))return false;let e=i[dn];return be(e)}r(zs,"supportsVisible");var un="locked";function Gs(i){if(!(un in i))return false;let e=i[un];return be(e)}r(Gs,"supportsLocked");var cn="backgroundColor";function Ks(i){if(!(cn in i))return false;let e=i[cn];return g(e)||ce(e)||C(e)}r(Ks,"supportsBackgroundColor");var pn="backgroundColor";function $s(i){if(!(pn in i))return false;let e=i[pn];return g(e)||Dt(e)||C(e)}r($s,"supportsBackgroundColorData");var mn="backgroundImage";function Hs(i){if(!(mn in i))return false;let e=i[mn];return e instanceof _||C(e)}r(Hs,"supportsBackgroundImage");var gn="backgroundImage";function js(i){if(!(gn in i))return false;let e=i[gn];return e instanceof _?false:_i(e)||C(e)}r(js,"supportsBackgroundImageData");var fn="backgroundGradient";function _s(i){if(!(fn in i))return false;let e=i[fn];return Ji(e)||C(e)}r(_s,"supportsBackgroundGradient");var yn="backgroundGradient";function qs(i){if(!(yn in i))return false;let e=i[yn];return D(e)||C(e)}r(qs,"supportsBackgroundGradientData");var hn="rotation";function Ys(i){if(!(hn in i))return false;let e=i[hn];return H(e)}r(Ys,"supportsRotation");var bn="opacity";function Xs(i){if(!(bn in i))return false;let e=i[bn];return H(e)}r(Xs,"supportsOpacity");var xn="borderRadius";function Zs(i){if(!(xn in i))return false;let e=i[xn];return g(e)||C(e)}r(Zs,"supportsBorderRadius");var Cn="border";function Js(i){if(!(Cn in i))return false;let e=i[Cn];return C(e)||ce(e.color)}r(Js,"supportsBorder");var In="svg";function Qs(i){if(!(In in i))return false;let e=i[In];return g(e)}r(Qs,"supportsSVG");var Tn="textTruncation";function el(i){if(!(Tn in i))return false;let e=i[Tn];return H(e)||C(e)}r(el,"supportsTextTruncation");var Pn="zIndex";function tl(i){if(!(Pn in i))return false;let e=i[Pn];return H(e)||C(e)}r(tl,"supportsZIndex");var Sn="overflow";function il(i){if(!(Sn in i))return false;let e=i[Sn];return g(e)||C(e)}r(il,"supportsOverflow");var Fn="componentIdentifier";function nl(i){if(!(Fn in i))return false;let e=i[Fn];return g(e)}r(nl,"supportsComponentInfo");var Dn="font";function rl(i){if(!(Dn in i))return false;let e=i[Dn];return Zi(e)}r(rl,"supportsFont");var vn="font";function ol(i){if(!(vn in i))return false;let e=i[vn];return Xi(e)||C(e)}r(ol,"supportsFontData");var Nn="inlineTextStyle";function al(i){if(!(Nn in i))return false;let e=i[Nn];return ui(e)||C(e)}r(al,"supportsInlineTextStyle");var kn="inlineTextStyle";function sl(i){if(!(kn in i))return false;let e=i[kn];return Qi(e)||C(e)}r(sl,"supportsInlineTextStyleData");var En="link";function ll(i){if(!(En in i))return false;let e=i[En];return g(e)||C(e)}r(ll,"supportsLink");var Mn="imageRendering";function dl(i){if(!(Mn in i))return false;let e=i[Mn];return g(e)||C(e)}r(dl,"supportsImageRendering");var An="layout";function Wn(i){if(!(An in i))return false;let e=i[An];return g(e)||C(e)}r(Wn,"supportsLayout");function ul(i){return Wn(i)?i.layout==="stack":false}r(ul,"hasStackLayout");function cl(i){return Wn(i)?i.layout==="grid":false}r(cl,"hasGridLayout");var Vn="isVariant";function Ln(i){if(!(Vn in i))return false;let e=i[Vn];return be(e)}r(Ln,"supportsComponentVariant");function ci(i){return Ln(i)?i.isVariant:false}r(ci,"isComponentVariant");function Rn(i){return !Ln(i)||!ci(i)?false:!C(i.gesture)}r(Rn,"isComponentGestureVariant");var wn="isBreakpoint";function Vo(i){if(!(wn in i))return false;let e=i[wn];return be(e)}r(Vo,"supportsBreakpoint");function Bn(i){return Vo(i)?i.isBreakpoint:false}r(Bn,"isBreakpoint");var W=class{static{r(this,"NodeMethods");}id;originalId;#e;constructor(e,t){this.id=e.id,this.originalId=e.originalId??null,this.#e=t;}get isReplica(){return this.originalId!==null}async remove(){return this.#e.invoke("removeNodes2",[this.id])}async select(){return this.#e.invoke("setSelection",[this.id])}async clone(){if(this[c]==="UnknownNode")throw Error("Can not clone unknown node");return this.#e.cloneNode(this.id)}async setAttributes(e){if(this[c]==="UnknownNode")throw Error("Can not set attributes on unknown node");return this.#e.setAttributes(this.id,e)}async getRect(){return this.#e.invoke("getRect",this.id)}async zoomIntoView(e){return this.#e.invoke("zoomIntoView",[this.id],e)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}async getParent(){return this.#e.getParent(this.id)}async getChildren(){return ee(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return ee(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>I(n,this.#e))}async getNodesWithAttribute(e){return ee(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>I(n,this.#e))}async getNodesWithAttributeSet(e){return ee(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>I(n,this.#e))}async*walk(){if(yield this,!ee(this))for(let e of await this.getChildren())yield*e.walk();}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}},O=class extends W{static{r(this,"FrameNode");}[c]="FrameNode";name;visible;locked;backgroundColor;backgroundImage;backgroundGradient;rotation;opacity;borderRadius;border;imageRendering;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;zIndex;link;linkOpenInNewTab;overflow;overflowX;overflowY;layout;gap;padding;stackDirection;stackDistribution;stackAlignment;stackWrapEnabled;gridColumnCount;gridRowCount;gridAlignment;gridColumnWidthType;gridColumnWidth;gridColumnMinWidth;gridRowHeightType;gridRowHeight;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;isVariant;isPrimaryVariant;isBreakpoint;isPrimaryBreakpoint;inheritsFromId;gesture;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.backgroundColor=h(t,e.backgroundColor)??null,this.backgroundImage=h(t,e.backgroundImage)??null,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.borderRadius=e.borderRadius??null,this.border=h(t,e.border)??null,this.backgroundGradient=h(t,e.backgroundGradient)??null,this.imageRendering=e.imageRendering??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,this.zIndex=e.zIndex??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.layout=e.layout??null,this.gap=e.gap??null,this.padding=e.padding??null,this.stackDirection=e.stackDirection??null,this.stackDistribution=e.stackDistribution??null,this.stackAlignment=e.stackAlignment??null,this.stackWrapEnabled=e.stackWrapEnabled??null,this.gridColumnCount=e.gridColumnCount??null,this.gridRowCount=e.gridRowCount??null,this.gridAlignment=e.gridAlignment??null,this.gridColumnWidthType=e.gridColumnWidthType??null,this.gridColumnWidth=e.gridColumnWidth??null,this.gridColumnMinWidth=e.gridColumnMinWidth??null,this.gridRowHeightType=e.gridRowHeightType??null,this.gridRowHeight=e.gridRowHeight??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,this.inheritsFromId=e.inheritsFromId??null,this.gesture=e.gesture??null,this.isVariant=e.isVariant??false,this.isPrimaryVariant=e.isPrimaryVariant??false,this.isBreakpoint=e.isBreakpoint??false,this.isPrimaryBreakpoint=e.isPrimaryBreakpoint??false,F(this);}},te=class extends W{static{r(this,"TextNode");}[c]="TextNode";name;visible;locked;rotation;opacity;zIndex;font;inlineTextStyle;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;link;linkOpenInNewTab;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;overflow;overflowX;overflowY;textTruncation;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.zIndex=e.zIndex??null,this.font=h(t,e.font)??null,this.inlineTextStyle=h(t,e.inlineTextStyle)??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.textTruncation=e.textTruncation??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,F(this);}async setText(e){await this.#e.invoke("setTextForNode",this.id,e);}async getText(){return this.#e.invoke("getTextForNode",this.id)}async setHTML(e){await this.#e.invoke(de,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(le,this.id)}},ze=class extends W{static{r(this,"SVGNode");}[c]="SVGNode";name;visible;locked;svg;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.svg=e.svg,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,F(this);}},Ge=class extends W{static{r(this,"VectorSetItemNode");}[c]="VectorSetItemNode";name;visible;locked;top;right;bottom;left;centerX;centerY;width;height;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.top=e.top??null,this.right=e.right??null,this.bottom=e.bottom??null,this.left=e.left??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,F(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ke=class extends W{static{r(this,"ComponentInstanceNode");}[c]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#i;get typedControls(){return this.#i||(this.#i=h(this.#e,this.#t.typedControls)??{}),this.#i}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=h(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,F(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},ie=class extends W{static{r(this,"WebPageNode");}[c]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,F(this);}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let n=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=I(n,this.#e);return m(o instanceof O),m(Bn(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Oe(e,this.#e):null}},ne=class extends W{static{r(this,"ComponentNode");}[c]="ComponentNode";name;componentIdentifier;insertURL;componentName;#e;constructor(e,t){super(e,t),this.#e=t,this.componentIdentifier=e.componentIdentifier,this.insertURL=e.insertURL??null,this.componentName=e.componentName??null,this.name=e.name??null,F(this);}async addVariant(e,t){let n=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!n)throw new Error("Failed to add variant to component");let o=I(n,this.#e);return m(o instanceof O),m(ci(o),"Node is not a component variant"),o}async addGestureVariant(e,t,n){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,n);if(!o)throw new Error("Failed to add state to component");let s=I(o,this.#e);return m(s instanceof O),m(Rn(s),"Node is not a gesture variant"),s}async getVariables(){let e=await this.#e.invoke("getVariables",this.id);return h(this.#e,e)}async addVariables(e){let t=await this.#e.invoke("addVariables",this.id,U(e));return h(this.#e,t)}async removeVariables(e){await this.#e.invoke("removeVariables",this.id,e);}async setVariableOrder(e){await this.#e.invoke("setVariableOrder",this.id,e);}},$e=class extends W{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,F(this);}},re=class extends W{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,F(this);}},He=class extends W{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),F(this);}};function I(i,e){switch(i[c]){case "DesignPageNode":return new re(i,e);case "WebPageNode":return new ie(i,e);case "ComponentNode":return new ne(i,e);case "VectorSetNode":return new $e(i,e);case "VectorSetItemNode":return new Ge(i,e);case "ComponentInstanceNode":return new Ke(i,e);case "FrameNode":return new O(i,e);case "SVGNode":return new ze(i,e);case "TextNode":return new te(i,e);case "UnknownNode":return new He(i,e);default:return new He(i,e)}}r(I,"convertRawNodeDataToNode");function vt(i){return i instanceof O}r(vt,"isFrameNode");function Un(i){return i instanceof te}r(Un,"isTextNode");function On(i){return i instanceof ze}r(On,"isSVGNode");function me(i){return i instanceof Ke}r(me,"isComponentInstanceNode");function zn(i){return i instanceof ie}r(zn,"isWebPageNode");function Gn(i){return i instanceof ne}r(Gn,"isComponentNode");function Kn(i){return i instanceof re}r(Kn,"isDesignPageNode");function $n(i){return i instanceof $e}r($n,"isVectorSetNode");function Hn(i){return i instanceof Ge}r(Hn,"isVectorSetItemNode");function ee(i){return i instanceof He}r(ee,"isUnknownNode");function je(i){return !!(vt(i)||Un(i)||me(i)||On(i)||Hn(i)||ee(i))}r(je,"isCanvasNode");function pi(i){return !!(zn(i)||Kn(i)||Gn(i)||$n(i)||ee(i))}r(pi,"isCanvasRootNode");var _e=class{static{r(this,"VectorSet");}id;name;owner;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.owner=e.owner,this.#e=t;}async getItems(){return (await this.#e.invoke("getVectorSetItems",this.id)).map(t=>new Nt(t,this.#e))}},Nt=class{static{r(this,"VectorSetItem");}id;name;insertUrl;iconUrl;#e;#t;constructor(e,t){this.id=e.id,this.name=e.name,this.insertUrl=e.insertUrl,this.iconUrl=e.iconUrl,this.#e=e.moduleId,this.#t=t;}async getVariables(){return this.#t.invoke("getVectorSetItemVariables",this.id,this.#e)}};var qe=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},Y=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function wo(i){return i.type==="separator"}r(wo,"isSeparatorMenuItem");function kt(i,e){let t=[];for(let n of i){if(wo(n)){t.push(n);continue}let{onAction:o,...s}=n,a=s;if(n.onAction){let d=Math.random();e.set(d,n.onAction),a.actionId=d;}n.submenu&&(a.submenu=kt(n.submenu,e)),t.push(a);}return t}r(kt,"addMenuItemsToOnActionCallbackMap");var Et="type",jn={[Et]:"pluginReadySignal"},Lo="pluginReadyResponse";var Ro={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function _n(i){return D(i)&&g(i[Et])&&i[Et]in Ro}r(_n,"isVekterToPluginNonHandshakeMessage");function qn(i){return D(i)&&i[Et]===Lo}r(qn,"isPluginReadyResponse");var mi=Symbol(),gi=Symbol(),fi=Symbol(),yi=Symbol(),hi=Symbol(),bi=Symbol(),xi=Symbol(),V={publish:mi,getDeployments:gi,deploy:fi,getChangedPaths:yi,getChangeContributors:hi,createManagedCollection:bi,rejectAllPending:xi};function Ci(i){return typeof i=="string"&&i in V}r(Ci,"isFramerApiOnlyMethod");var Bo=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions","lintCode"],Uo=["closeNotification","closePlugin","setCloseWarning","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","typecheckCode","getCodeFileVersions","getCodeFiles","getCodeFile","getRedirects","uploadFile","uploadFiles","uploadImage","uploadImages","zoomIntoView","navigateTo","getRuntimeErrorForModule","getRuntimeErrorForCodeComponentNode","showProgressOnInstances","removeProgressFromInstances","addComponentInstancePlaceholder","updateComponentInstancePlaceholder","removeComponentInstancePlaceholder","setMenu","showContextMenu","getBreakpointSuggestionsForWebPage","getActiveCollectionItemForWebPage","getVariables","getVectorSets","getVectorSetItems","getVectorSetItemVariables","getChangedPaths","getChangeContributors","getDeployments",ct,pt,le,"getAiServiceInfo","sendTrackingEvent",...Bo];new Set(Uo);var Ii={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],setCloseWarning:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields2"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields2"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[de],"TextNode.getHTML":[],"ComponentNode.addVariant":["addVariantToComponent"],"ComponentNode.addGestureVariant":["addGestureVariantToComponent"],"ComponentNode.getVariables":[],"ComponentNode.addVariables":["addVariables"],"ComponentNode.removeVariables":["removeVariables"],"WebPageNode.getBreakpointSuggestions":[],"WebPageNode.addBreakpoint":["addBreakpointToWebPage"],"WebPageNode.getActiveCollectionItem":[],"ColorStyle.getPluginData":[],"ColorStyle.getPluginDataKeys":[],"ColorStyle.remove":["removeColorStyle"],"ColorStyle.setAttributes":["setColorStyleAttributes"],"ColorStyle.setPluginData":["setPluginDataForNode"],"TextStyle.getPluginData":[],"TextStyle.getPluginDataKeys":[],"TextStyle.remove":["removeTextStyle"],"TextStyle.setAttributes":["setTextStyleAttributes"],"TextStyle.setPluginData":["setPluginDataForNode"],"Variable.setAttributes":["updateVariable"],"Variable.remove":["removeVariables"],"ComponentNode.setVariableOrder":["setVariableOrder"],"EnumCase.remove":["removeEnumCase"],"EnumCase.setAttributes":["updateEnumCase"],"EnumVariable.addCase":["addEnumCase"],"EnumVariable.setCaseOrder":["setEnumCaseOrder"],createCollection:["createCollection"],createManagedCollection:["createManagedCollection"],[Ot]:[],[zt]:[],[Gt]:[],[Kt]:[],[mi]:["publish"],[gi]:[],[fi]:["deploy"],[yi]:[],[hi]:[],[bi]:["createManagedCollection"],[xi]:[]},Mt=[];for(let i of Object.keys(Ii))Ii[i].length!==0&&Mt.push(i);F(Mt);function Ti(i){let e={};for(let t of Mt){let n=Ii[t];e[t]=n.every(o=>i[o]);}return e}r(Ti,"createPerMethodPermissionMap");function Yn(){let i={};for(let e of Mt)i[e]=true;return i}r(Yn,"createPerMethodPermissionMapForTesting");var ge=null;function Xn(i){if(typeof window>"u")return;if(!ge){let t=document.createElement("style");document.head.appendChild(t),ge=t.sheet;}if(!ge){i();return}let e=ge.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ge&&ge.deleteRule(e);});});}r(Xn,"withDisabledCssTransitions");var Ye=class{static{r(this,"PluginEngine");}methodInvocationId=0;notificationId=0;postMessage;methodResponseHandlers=new Map;mode;subscriptions=new Map;perMethodPermissionMap;permissionSubscriptions=new Set;messageTypesCheckedInIsAllowedTo=new Set;showUncheckedPermissionToasts=true;environmentInfo=null;initialState;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;rejectAllPending(e){for(let[t,n]of this.methodResponseHandlers)n.reject(e),this.methodResponseHandlers.delete(t);}constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=Yn(),this.initialState={mode:"canvas",intent:"plugin/open"};return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof Y&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof Y&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.initialState=e.initialState??{mode:e.mode,intent:"plugin/open"},this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=Ti(e.permissionMap),this.postMessage=(t,n)=>e.transport.send(t,n),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:dt(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((s,a)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(U)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:s,reject:a}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let n=this.subscriptions.get(e)??new Set;return n.add(t),this.subscriptions.set(e,n),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=e=>{let t=e?.data??e;if(_n(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Ti(t.permissionMap);for(let n of this.permissionSubscriptions)n();break}case "methodResponse":{let n=this.methodResponseHandlers.get(t.id);if(!n)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),g(t.error)?n.reject(new qe(t.error)):n.resolve(t.result);break}case "subscriptionMessage":{let{topic:n,payload:o}=t,s=this.subscriptions.get(n);if(!s)throw new Error("Received a subscription message but no handler present");for(let a of s)a(o);break}case "menuAction":{let n=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!n)throw new Error("Menu action received for an unknown menu item");n();break}default:dt(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:dt(t);}}applyPluginTheme=e=>{Xn(()=>{document.body.setAttribute("data-framer-theme",e.mode);for(let t in e.tokens)document.body.style.setProperty(t,e.tokens[t]);});};async cloneNode(e){let t=await this.invoke("cloneNode",e);return t?I(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?I(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?I(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=I(n,this);return m(je(o)),o})}notify=(e,t)=>{let n=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:n,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:()=>this.invoke("closeNotification",n)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=kt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=kt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function Oo(i){return i.type==="component"}r(Oo,"isCodeFileComponentExport");function zo(i){return i.type==="override"}r(zo,"isCodeFileOverrideExport");var Pi=class{static{r(this,"CodeFileVersion");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get createdAt(){return this.#e.createdAt}get createdBy(){return this.#e.createdBy}constructor(e,t){this.#t=t,this.#e=e;}async getContent(){return await this.#t.invoke("getCodeFileVersionContent",this.#e.fileId,this.#e.id)}},X=class i{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new i(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new i(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new Pi(t,this.#t))}async showProgressOnInstances(e){return this.#t.invoke("showProgressOnInstances",this.id,e)}async removeProgressFromInstances(){return this.#t.invoke("removeProgressFromInstances",this.id)}async lint(e){return Promise.resolve([])}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e,this.id)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var At=class i{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new i(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let n=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!n)return null;let o=I(n,this.#t);return m(me(o)),o}};var Go=(()=>{let i=null;return {disableUntilMouseUp:()=>{if(i)return;i=document.createElement("style"),i.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(i);let e=r(()=>{i&&(document.head.removeChild(i),i=null,o());},"enablePointerEvents"),t=r(s=>{s.buttons>0&&s.buttons&1||e();},"handlePointerChange"),n=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",n);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",n);}r(o,"cleanup");}}})(),Zn=5,Ko=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function $o(){}r($o,"noop");function Jn(i,e,t,n){if(i.mode!=="canvas")return $o;let o=Ko.next(),s=document.body.style.cursor,a={type:"idle"},d=document.body,x=oe.subscribeToIsAllowedTo("makeDraggable",p=>{p||T();}),b=r(p=>{oe.isAllowedTo("makeDraggable")&&a.type!=="idle"&&(a.type==="dragging"&&i.invoke("onDragEnd",{...p,dragSessionId:o}).then(y=>{try{n?.(y);}catch{}}).catch(y=>{if(y instanceof Error){n?.({status:"error",reason:y.message});return}if(typeof y=="string"){n?.({status:"error",reason:y});return}n?.({status:"error"});}),T());},"endDrag"),P=r(p=>{if(!oe.isAllowedTo("makeDraggable")||a.type==="idle")return;if(!(p.buttons>0&&!!(p.buttons&1))){b({cancelled:false});return}let{clientX:M,clientY:N}=p;if(a.type==="pointerDown"){let S=M-a.dragStart.mouse.x,Oi=N-a.dragStart.mouse.y;if(Math.abs(S)<Zn&&Math.abs(Oi)<Zn)return;a={type:"dragging",dragStart:a.dragStart},i.invoke("onDragStart",a.dragStart),document.getSelection()?.empty(),Go.disableUntilMouseUp();}d.setPointerCapture(p.pointerId);let se={x:M,y:N};i.invoke("onDrag",{dragSessionId:o,mouse:se}).then(S=>{a.type==="dragging"&&(document.body.style.cursor=S??"");});},"handlePointerChange"),z=r(p=>{p.key==="Escape"&&b({cancelled:true});},"handleKeyDown"),$=r(()=>{b({cancelled:true});},"handleBlur"),f=r(p=>{if(!oe.isAllowedTo("makeDraggable"))return;b({cancelled:true});let y=e.getBoundingClientRect(),M={x:y.x,y:y.y,width:y.width,height:y.height},N,se=e.querySelectorAll("svg");if(se.length===1){let at=se.item(0).getBoundingClientRect();N={x:at.x,y:at.y,width:at.width,height:at.height};}let S={x:p.clientX,y:p.clientY};a={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:M,svgRect:N,mouse:S}},i.invoke("setDragData",o,t()),d.addEventListener("pointermove",P,true),d.addEventListener("pointerup",P,true),window.addEventListener("keydown",z,true),window.addEventListener("blur",$);},"handlePointerDown"),u=r(()=>{if(!oe.isAllowedTo("makeDraggable"))return;let p=t();p.type==="detachedComponentLayers"&&i.invoke("preloadDetachedComponentLayers",p.url),p.type==="image"&&i.invoke("preloadImageUrlForInsertion",p.image),p.previewImage&&i.invoke("preloadDragPreviewImage",p.previewImage);},"preload");e.addEventListener("pointerdown",f),e.addEventListener("mouseenter",u);function T(){a={type:"idle"},document.body.style.cursor=s,d.removeEventListener("pointermove",P,true),d.removeEventListener("pointerup",P,true),window.removeEventListener("keydown",z,true),window.removeEventListener("blur",$);}return r(T,"dragCleanup"),()=>{e.removeEventListener("pointerdown",f),e.removeEventListener("mouseenter",u),b({cancelled:true}),x();}}r(Jn,"makeDraggable");var fe=class i{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[n]=await this.#t.invoke("addRedirects",[t]);return m(st(n)),C(n)?null:new i(n,this.#t)}};var Si=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,n]=Ki(e),o=this.isAllowedTo(...t),s=r(()=>{let a=this.isAllowedTo(...t);a!==o&&(o=a,n(o));},"update");return this.#e.permissionSubscriptions.add(s),()=>{this.#e.permissionSubscriptions.delete(s);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new Y}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let n=I(t,this.#e);return m(je(n)),n})}async setSelection(e){let t=g(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let n=t.map(o=>{let s=I(o,this.#e);return m(je(s)),s});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=I(e,this.#e);return m(pi(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=I(t,this.#e);m(pi(n)),e(n);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let n=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!n)return null;let o=I(n,this.#e);return m(o instanceof O),o}async removeNodes(e){return this.#e.invoke("removeNodes2",e)}async removeNode(e){return this.removeNodes([e])}async cloneNode(e){return this.#e.cloneNode(e)}async getNode(e){let t=await this.#e.invoke("getNode",e);return t?I(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let n=g(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",n,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,n){return this.#e.invoke("setParent",e,t,n)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(n=>I(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>I(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>I(n,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?h(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(h(this.#e,t));})}async addImage(e){let t=await we(e),n=q(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await we(e),n=q(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await we(e),n=q(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return h(this.#e,o)}async addImages(e){let t=await li(e),n=t.flatMap(q);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await li(e),n=t.flatMap(q),o=await this.#e.invokeTransferable("uploadImages",n,t);return h(this.#e,o)}async uploadFile(e){let t=await si(e),n=await this.#e.invokeTransferable("uploadFile",q(t),t);return h(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(si)),n=t.flatMap(q),o=await this.#e.invokeTransferable("uploadFiles",n,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:n}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:n}),s=I(o,this.#e);return m(me(s)),s}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),s=I(o,this.#e);return m(vt(s)),s}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,n){return Jn(this.#e,e,t,n)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return m(e,"Collection data must be defined"),new pe(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return m(e,"Collections data must be defined"),e.map(t=>new pe(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new Q(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new Q(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new Q(t,this.#e))}notify=(e,t)=>this.#e.notify(e,t);async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return h(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?h(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return h(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let n=h(this.#e,t);return e(n)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return h(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?h(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return h(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let n=h(this.#e,t);return e(n)})}async getFont(e,t){let n=await this.#e.invoke("getFont",e,t);return n?h(this.#e,n):null}async getFonts(){let e=await this.#e.invoke("getFonts");return h(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(){return this.#e.invoke("getLocalizationGroups")}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new fe(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new fe(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new fe(n,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,n){let o=await this.#e.invoke("createCodeFile",e,t,n);return new X(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new X(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new X(t,this.#e):null}lintCode(e,t,n){return Promise.resolve([])}typecheckCode(e,t,n,o){return this.#e.invoke("typecheckCode",e,t,n,o)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let n=t?.map(o=>new X(o,this.#e));return e(n)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let n=t?new X(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=I(t,this.#e);return m(n instanceof re,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=I(t,this.#e);return m(n instanceof ie,"Expected node to be a WebPageNode"),n}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new Q(t,this.#e)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new pe(t,this.#e)}get[l.initialState](){return this.#e.initialState}},Fi=class extends Si{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}async setCloseWarning(e){return this.#e.invoke("setCloseWarning",e)}},Xe=class extends Fi{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new At(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(ct)}async[l.sendTrackingEvent](e,t,n){return this.#e.invoke(pt,e,t,n)}async[l.getHTMLForNode](e){return this.#e.invoke(le,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(de,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let n=await this.#e.invoke("createNode","TextNode",t??null,e);if(!n)return null;let o=I(n,this.#e);return m(o instanceof te),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=I(t,this.#e);return m(n instanceof ne),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new _e(t,this.#e))}async[V.publish](){return this.#e.invoke("publish")}async[V.getDeployments](){return this.#e.invoke("getDeployments")}async[V.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[V.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[V.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[V.createManagedCollection](e){return this.createManagedCollection(e)}[V.rejectAllPending](e){this.#e.rejectAllPending(e);}};var Di=class{constructor(e){this.origin=e;}static{r(this,"IframeTransport");}send(e,t){window.parent.postMessage(e,this.origin,t);}onMessage(e){window.addEventListener("message",e);}};async function Ho(){return new Promise(i=>{function e({data:t,origin:n}){if(!qn(t))return;window.removeEventListener("message",e);let s={transport:new Di(n),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:n,theme:t.theme??null,initialState:t.initialState};i(s);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(jn,"*");})}r(Ho,"createBrowserContext");async function jo(){return typeof window<"u"?Ho():null}r(jo,"bootstrap");var Qn=await jo(),oe=Qn?new Xe(new Ye(Qn)):new Proxy({},{get(i,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function er(i){return new Xe(new Ye(i))}r(er,"createFramerInstance");var tr=process$1.env;function Yo(i){Object.assign(tr,i);}r(Yo,"configure");function ye(i,e){let t=tr[i];return t&&t.length>0?t:e}r(ye,"getEnv");var ir=isWorkerd,nr=globalThis.WebSocket;async function rr(i,e){let t=new URL(i.href);t.protocol=t.protocol==="wss:"?"https:":t.protocol==="ws:"?"http:":t.protocol;let o=(await fetch(t.href,{headers:{Upgrade:"websocket",...e}})).webSocket;if(!o)throw new Error("WebSocket upgrade failed - server did not accept");return o.accept(),o}r(rr,"connectWebSocketCF");var or,ar;try{or=await import('node:fs'),ar=await import('node:path');}catch{}var vi=or,Ni=ar;var Ze=(d=>(d.PROJECT_CLOSED="PROJECT_CLOSED",d.POOL_EXHAUSTED="POOL_EXHAUSTED",d.TIMEOUT="TIMEOUT",d.INTERNAL="INTERNAL",d.NODE_NOT_FOUND="NODE_NOT_FOUND",d.SCREENSHOT_TOO_LARGE="SCREENSHOT_TOO_LARGE",d.INVALID_REQUEST="INVALID_REQUEST",d))(Ze||{}),E=class extends Error{static{r(this,"FramerAPIError");}code;constructor(e,t){super(e),this.name="FramerAPIError",this.code=t,this.stack=undefined;}};function Xo(i){return i instanceof E?i.code==="POOL_EXHAUSTED":false}r(Xo,"isRetryableError");function R(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
10
9
  `);n[1]?.includes("assert")?(n.splice(1,1),t.stack=n.join(`
11
10
  `)):n[0]?.includes("assert")&&(n.splice(0,1),t.stack=n.join(`
12
- `));}catch{}throw t}r(L,"assert");var sr={showUI:false,hideUI:false,closePlugin:false,notify:false,setMenu:false,showContextMenu:false,preloadDetachedComponentLayers:false,preloadDragPreviewImage:false,preloadImageUrlForInsertion:false,setBackgroundMessage:false,getSelection:false,getActiveCollection:false,getActiveManagedCollection:false,getActiveLocale:false,zoomIntoView:false,navigateTo:false,getPluginData:false,setPluginData:false,getPluginDataKeys:false,makeDraggable:false,subscribeToSelection:false,subscribeToImage:false,subscribeToText:false,subscribeToCustomCode:false,subscribeToColorStyles:false,subscribeToTextStyles:false,subscribeToRedirects:false,subscribeToCodeFiles:false,subscribeToOpenCodeFile:false,subscribeToIsAllowedTo:false,subscribeToCanvasRoot:false,subscribeToPublishInfo:false,unstable_ensureMinimumDependencyVersion:false,removeNode:true,removeNodes:true,addSVG:true,getRect:true,setText:true,getText:true,addText:true,setCustomCode:true,getCustomCode:true,getLocales:true,getDefaultLocale:true,getLocalizationGroups:true,setLocalizationData:true,getCurrentUser:true,getProjectInfo:true,setSelection:true,getCanvasRoot:true,getPublishInfo:true,cloneNode:true,getNode:true,getParent:true,getChildren:true,setAttributes:true,getNodesWithType:true,getNodesWithAttribute:true,getNodesWithAttributeSet:true,addImages:true,getImage:true,addImage:true,setImage:true,uploadImage:true,uploadImages:true,uploadFile:true,uploadFiles:true,setParent:true,addComponentInstance:true,addDetachedComponentLayers:true,getManagedCollection:true,getManagedCollections:true,getCollection:true,getCollections:true,getColorStyle:true,getColorStyles:true,createColorStyle:true,getTextStyle:true,getTextStyles:true,createTextStyle:true,getFont:true,getFonts:true,createCodeFile:true,getCodeFiles:true,getCodeFile:true,lintCode:true,typecheckCode:true,addRedirects:true,getRedirects:true,setRedirectOrder:true,removeRedirects:true,addComponentInstancePlaceholder:true,createCollection:true,getVectorSets:true,createDesignPage:true,createWebPage:true,createTextNode:true,createComponentNode:true,mode:true,isAllowedTo:false,createFrameNode:true};function ki(i){return i in sr?sr[i]===true:false}r(ki,"isAllowedMethod");var Vt=class i{static{r(this,"FramerAPI");}requestId;#e;#t;constructor(e,t,n){this.#t=e,this.#e=t,this.requestId=n;}static create(e,t,n){let o=new i(e,t,n);return new Proxy(o,{get(a,s){if(s in a)return Reflect.get(a,s);if(Ci(s)){let I=E[s],b=Reflect.get(a.#t,I);return typeof b=="function"?b.bind(a.#t):b}if(!ki(s))return;let d=Reflect.get(a.#t,s);return typeof d=="function"?d.bind(a.#t):d},has(a,s){return s in a||Ci(s)?true:ki(s)?s in a.#t:false}})}disconnect=async()=>{await this.#e();};[Symbol.dispose]=()=>{this.#e();};[Symbol.asyncDispose]=()=>this.#e()};var Jo=/^.+--([A-Za-z0-9]+)/u,lr=/^[A-Za-z0-9]{20}$/u;function dr(i){if(lr.test(i))return i;try{let t=new URL(i,"https://framer.com").pathname.split("/").filter(Boolean),n=t.findIndex(o=>o.toLowerCase()==="projects");if(n>=0){let o=t[n+1];if(o!==void 0){let a=decodeURIComponent(o),d=a.match(Jo)?.[1]??a;if(lr.test(d))return d}}return null}catch{return null}}r(dr,"parseProjectId");var Mi={silent:0,error:1,warn:2,info:3,debug:4};function Qo(){let i=fe("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in Mi?i:"warn"}r(Qo,"getLogLevel");var Ei=Qo();function Ze(i){return Mi[i]<=Mi[Ei]}r(Ze,"shouldLog");var Je=globalThis.console,ea="\x1B[90m",ta="\x1B[0m";function ia(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}r(ia,"formatPrefix");function na(i,...e){return [ea+i,...e,ta]}r(na,"formatDebug");function ur(i){let e=ia(i);return {warn:(...t)=>{Ze("warn")&&Je.warn(e,...t);},error:(...t)=>{Ze("error")&&Je.error(e,...t);},log:(...t)=>{Ze("info")&&Je.log(e,...t);},info:(...t)=>{Ze("info")&&Je.info(e,...t);},debug:(...t)=>{Ze("debug")&&Je.debug(...na(e,...t));},setLevel:t=>{Ei=t;},getLevel:()=>Ei,withRequestId:t=>ur(t)}}r(ur,"createLogger");var N=ur();N.warn;N.error;N.log;N.info;N.debug;N.setLevel;N.getLevel;var cr;function pr({error:i,tags:e,extras:t,critical:n,caller:o}){L(cr,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Vi(i,o);return cr({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!n}),a}r(pr,"reportError");function Vi(i,e=Vi){return i instanceof Error?i:new Ai(i,e)}r(Vi,"reportableError");var Ai=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let n=e?JSON.stringify(e):"No error message provided";if(super(n),this.message=n,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var Qe=typeof window<"u"?window.location.hostname:undefined,mr=!!(Qe&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(Qe)),wi=(()=>{if(!Qe)return;if(mr)return {main:Qe,previewLink:undefined};let i=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=Qe.match(i);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:wi,isDevelopment:wi?.main==="development.framer.com",isProduction:wi?.main==="framer.com",isLocal:mr});var wt;function Wt(){return typeof window>"u"?{}:wt||(wt=aa(),wt)}r(Wt,"getServiceMap");function aa(){let i=window.location,e=window?.bootstrap?.services;if(e)return e;let t;try{if(t=window.top.location.origin,e=window.top?.bootstrap?.services,e)return e}catch{}if(t&&t!==i.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${i.origin})`);if(i.origin.endsWith("framer.com")||i.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let n=new URLSearchParams(i.search).get("services")||new URLSearchParams(i.hash.substring(1)).get("services");n&&(e=JSON.parse(n));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(aa,"extractServiceMap");function et(i,e=0,t=new Set){if(i===null)return i;if(typeof i=="function")return `[Function: ${i.name??"unknown"}]`;if(typeof i!="object")return i;if(i instanceof Error)return `[${i.toString()}]`;if(t.has(i))return "[Circular]";if(e>2)return "...";t.add(i);try{if("toJSON"in i&&typeof i.toJSON=="function")return et(i.toJSON(),e+1,t);if(Array.isArray(i))return i.map(n=>et(n,e+1,t));if(Object.getPrototypeOf(i)!==Object.prototype)return `[Object: ${"__class"in i&&i.__class||i.constructor?.name}]`;{let n={};for(let[o,a]of Object.entries(i))n[o]=et(a,e+1,t);return n}}catch(n){return `[Throws: ${n instanceof Error?n.message:n}]`}finally{t.delete(i);}}r(et,"jsonSafeCopy");var sa=["trace","debug","info","warn","error"],la=[":trace",":debug",":info",":warn",":error"];function yr(i,e){let t=[];for(let n of i.split(/[ ,]/u)){let o=n.trim();if(o.length===0)continue;let a=1,s=false;o.startsWith("-")&&(o=o.slice(1),a=3,s=true);for(let b=0;b<=4;b++){let F=la[b];if(F&&o.endsWith(F)){a=b,s&&(a+=1),o=o.slice(0,o.length-F.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+ga(o).replace(/\\\*/gu,".*")+"$"),I=0;for(let b of e)b.id.match(d)&&(b.level=a,++I);I===0&&t.push(n);}return t}r(yr,"applyLogLevelSpec");var tt=class i{constructor(e,t,n){this.logger=e;this.level=t;this.parts=n;this.id=i.nextId++,this.time=Date.now();}static{r(this,"LogEntry");}static nextId=0;id;time;stringPrefix;toMessage(){if(this.stringPrefix)return this.parts;let e=[new Date(this.time).toISOString().substr(-14,14),sa[this.level]+": ["+this.logger.id+"]"],t=0;for(;t<this.parts.length;t++){let n=this.parts[t];if(typeof n=="string"){e.push(n);continue}break}return this.stringPrefix=e.join(" "),this.parts.splice(0,t,this.stringPrefix),this.parts}toString(){return this.toMessage().map(e=>{let t=typeof e;if(t==="string")return e;if(t==="function")return `[Function: ${e.name??"unknown"}]`;if(e instanceof Error)return e.stack??e.toString();let n=JSON.stringify(et(e));return n?.length>253?n.slice(0,250)+"...":n}).join(" ")}},z="*:app:info,app:info",hr=typeof process<"u"&&!!process.kill,da=hr&&!!process.env.CI;da?z="-:warn":hr&&(z="");try{typeof window<"u"&&window.localStorage&&(z=window.localStorage.logLevel||z);}catch{}try{typeof process<"u"&&(z=process.env.DEBUG||z);}catch{}try{typeof window<"u"&&Object.assign(window,{setLogLevel:Cr});}catch{}try{typeof window<"u"&&window.postMessage&&window.top===window&&window.addEventListener("message",i=>{if(!i.data||typeof i.data!="object")return;let{loggerId:e,level:t,parts:n,printed:o}=i.data;if(typeof e!="string"||!Array.isArray(n)||n.length<1||typeof t!="number")return;let a=it(e);if(t<0||t>5)return;n[0]=n[0].replace("[","*[");let s=new tt(a,t,n);s.stringPrefix=n[0],X.push(s),!o&&(a.level>t||console?.log(...s.toMessage()));});}catch{}var Li;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(Li=r(i=>{try{let e=i.toMessage().map(s=>et(s)),t=i.logger,n=i.level,o=t.level<=i.level,a={loggerId:t.id,level:n,parts:e,printed:o};window.parent?.postMessage(a,Wt().app);}catch{}},"postLogEntry"));}catch{}var Wi={},X=[],br=1e3;function ae(i,e,t){let n=new tt(i,e,t);for(X.push(n),Li?.(n);X.length>br;)X.shift();return n}r(ae,"createLogEntry");function xr(i){return typeof i=="number"&&(br=i),X}r(xr,"getLogReplayBuffer");var ua=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,fr;function ca(){if(!(typeof window>"u"||!window.location))return fr??=ua.exec(window.location.pathname)?.groups?.filename,fr}r(ca,"getFilenameFromWindowPathname");function it(i){let e=ca();i=(e?e+":":"")+i;let t=Wi[i];if(t)return t;let n=new Lt(i);return Wi[i]=n,yr(z,[n]),Li?.(new tt(n,-1,[])),n}r(it,"getLogger");function Cr(i,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=i);}catch{}let t=z;z=i;let n=Object.values(Wi);for(let a of n)a.level=3;let o=yr(i,n);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&X.length>0){console?.log("--- LOG REPLAY ---");for(let a of X)a.logger.level>a.level||(a.level>=3?console?.warn(...a.toMessage()):console?.log(...a.toMessage()));console?.log("--- END OF LOG REPLAY ---");}return t}r(Cr,"setLogLevel");var pa=r(i=>{let e={...i,logs:xr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
13
- `)};return i.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),Lt=class{constructor(e,t){this.id=e;this.errorIsCritical=t??(e==="fatal"||e.endsWith(":fatal"));}static{r(this,"Logger");}level=3;didLog={};errorIsCritical;extend(e){let t=this.id+":"+e;return it(t)}getBufferedMessages(){return X.filter(e=>e.logger===this)}setLevel(e){let t=this.level;return this.level=e,t}isLoggingTraceMessages(){return this.level>=0}trace=(...e)=>{if(this.level>0)return;let t=ae(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=ae(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=ae(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=ae(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=ae(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,n,o)=>{let a=pa(t??{}),s=pr({caller:this.reportWithoutLogging,error:e,tags:{...n,handler:"logger",where:this.id},extras:t,critical:o??this.errorIsCritical});return [a,s]};reportError=(e,t,n,o)=>{let[a,s]=this.reportWithoutLogging(e,t,n,o);a?this.error(s,a):this.error(s);};reportErrorOncePerMinute=(e,t)=>{if(!ma(e))return;let n=this.didLog[e.message];n&&n>Date.now()||(this.didLog[e.message]=Date.now()+1e3*60,this.reportError(e,t));};reportCriticalError=(e,t,n)=>this.reportError(e,t,n,true)};function ma(i){return Object.prototype.hasOwnProperty.call(i,"message")}r(ma,"isErrorWithMessage");function ga(i){return i.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(ga,"escapeRegExp");var Pr;(K=>{function i(f,...u){return f.concat(u)}K.push=i,r(i,"push");function e(f){return f.slice(0,-1)}K.pop=e,r(e,"pop");function t(f,...u){return u.concat(f)}K.unshift=t,r(t,"unshift");function n(f,u,...T){let p=f.length;if(u<0||u>p)throw Error("index out of range: "+u);let y=f.slice();return y.splice(u,0,...T),y}K.insert=n,r(n,"insert");function o(f,u,T){let p=f.length;if(u<0||u>=p)throw Error("index out of range: "+u);let y=Array.isArray(T)?T:[T],D=f.slice();return D.splice(u,1,...y),D}K.replace=o,r(o,"replace");function a(f,u){let T=f.length;if(u<0||u>=T)throw Error("index out of range: "+u);let p=f.slice();return p.splice(u,1),p}K.remove=a,r(a,"remove");function s(f,u,T){let p=f.length;if(u<0||u>=p)throw Error("from index out of range: "+u);if(T<0||T>=p)throw Error("to index out of range: "+T);let y=f.slice();if(T===u)return y;let D=y[u];return u<T?(y.splice(T+1,0,D),y.splice(u,1)):(y.splice(u,1),y.splice(T,0,D)),y}K.move=s,r(s,"move");function d(f,u){let T=[],p=Math.min(f.length,u.length);for(let y=0;y<p;y++)T.push([f[y],u[y]]);return T}K.zip=d,r(d,"zip");function I(f,u,T){let p=f.slice(),y=p[u];return y===undefined||(p[u]=T(y)),p}K.update=I,r(I,"update");function b(f){return Array.from(new Set(f))}K.unique=b,r(b,"unique");function F(f,...u){return Array.from(new Set([...f,...u.flat()]))}K.union=F,r(F,"union");function G(f,u){return f.filter(u)}K.filter=G,r(G,"filter");})(Pr||={});var Ia=Object.prototype.hasOwnProperty;function Ta(i,e){return Ia.call(i,e)}r(Ta,"hasOwnProperty");var Sr;(n=>{function i(o,a){for(let s of Object.keys(o))Ta(a,s)||delete o[s];for(let s of Object.keys(a))o[s]===undefined&&(o[s]=a[s]);return Object.setPrototypeOf(o,Object.getPrototypeOf(a)),o}n.morphUsingTemplate=i,r(i,"morphUsingTemplate");function e(o,a){a&&Object.assign(o,a);}n.writeOnce=e,r(e,"writeOnce");function t(o,a){return Object.assign(Object.create(Object.getPrototypeOf(o)),o,a)}n.update=t,r(t,"update");})(Sr||={});var Fr;(o=>{function i(a,...s){return new Set([...a,...s])}o.add=i,r(i,"add");function e(a,...s){let d=new Set(a);for(let I of s)d.delete(I);return d}o.remove=e,r(e,"remove");function t(...a){let s=new Set;for(let d of a)for(let I of d)s.add(I);return s}o.union=t,r(t,"union");function n(a,s){return a.has(s)?o.remove(a,s):o.add(a,s)}o.toggle=n,r(n,"toggle");})(Fr||={});var Dr;(n=>{function i(o,...a){let s=new Map;o.forEach((I,b)=>s.set(b,I));let d=false;for(let I of a)I&&(I.forEach((b,F)=>s.set(F,b)),d=true);return d?s:o}n.merge=i,r(i,"merge");function e(o,a,s){let d=new Map(o);return d.set(a,s),d}n.set=e,r(e,"set");function t(o,a){let s=new Map(o);return s.delete(a),s}n.remove=t,r(t,"remove");})(Dr||={});(class extends Promise{static{r(this,"ResolvablePromise");}_state="initial";resolve;reject;get state(){return this._state}pending(){return this._state="pending",this}isResolved(){return this._state==="fulfilled"||this._state==="rejected"}constructor(){let e,t;super((n,o)=>{e=n,t=o;}),this.resolve=n=>{this._state="fulfilled",e(n);},this.reject=n=>{this._state="rejected",t(n);};}});it("task-queue");function Bi(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Bi,"isObject");var ye=class{constructor(e){this.ws=e;}static{r(this,"WebSocketTransport");}onError;setOnError(e){this.onError=e;}send(e){this.ws.send(nt.stringify(e));}waitForDisconnectAck(e){return new Promise(t=>{let n=setTimeout(()=>{this.ws.removeEventListener("message",o),t();},e),o=r(a=>{if(!(typeof a.data!="string"&&!(a.data instanceof String)))try{let s=nt.parse(a.data);Bi(s)&&s.type==="disconnect-ack"&&(clearTimeout(n),this.ws.removeEventListener("message",o),t());}catch{}},"handler");this.ws.addEventListener("message",o);})}onMessage(e){this.ws.addEventListener("message",t=>{let n=typeof t.data=="string"?t.data:t.data.toString(),o=nt.parse(n);if(Bi(o)&&o.type==="error"){let a=o.message||JSON.stringify(o),s=o.code??"INTERNAL";N.error(`Server error: ${a}`),this.onError?.(new W(`Server error: ${a}`,s));return}if(Bi(o)&&o.type==="debug-archive"){Ui(o.data);return}e(o);});}};function Ui(i){L(vi,"File system module is not available."),L(Ni,"Path module is not available.");let t=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,n=process.cwd(),o=Ni.resolve(n,t);vi.writeFileSync(o,Buffer.from(i)),N.info(`Debug archive saved to ${o}`);}r(Ui,"handleDebugArchive");function Bt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Bt,"isObject");var Da={type:"pluginReadySignal"};function va(i){return Bt(i)&&i.type==="pluginReadyResponse"}r(va,"isPluginReadyResponse");var vr=45e3,Na=2e4;async function ka(i,e){let t={Authorization:`Token ${e}`};return ir?(N.debug("Using Cloudflare Workers WebSocket connection"),rr(i,t)):(N.debug("Using standard WebSocket connection"),new nr(i.href,{headers:t}))}r(ka,"createWebSocket");async function Nr(i,e){let t=new URL(fe("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));t.protocol=t.protocol==="https:"?"wss:":t.protocol==="http:"?"ws:":t.protocol,t.searchParams.set("projectId",i),N.debug(`Connecting to ${t.href}`);let n=await ka(t,e);N.debug(`WebSocket created, readyState: ${n.readyState}`);let o,a=N,s=false,d=setInterval(()=>{n.readyState===n.OPEN&&(n.send(nt.stringify({type:"ping"})),a.debug("Sent ping"));},Na),I=r(()=>{clearInterval(d),n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");},"forceClose"),b=r(async()=>{if(clearInterval(d),!(n.readyState===n.CLOSED||n.readyState===n.CLOSING)){if(s){a.debug("Initiating graceful disconnect");let G=new ye(n);G.send({type:"client-disconnect"}),await G.waitForDisconnectAck(5e3);}n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");}},"cleanup"),F=await new Promise((G,K)=>{let f=setTimeout(()=>{I(),K(new W(`Connection timeout after ${vr}ms`,"TIMEOUT"));},vr),u=r(()=>{a.debug("WebSocket opened, waiting for ready");},"onOpen"),T=r(D=>{a.debug("WebSocket error:",D),clearTimeout(f),I(),K(new W("No connection to the server","INTERNAL"));},"onError"),p=r(D=>{a.debug(`WebSocket closed: code=${D.code}, reason=${D.reason||"(no reason)"}, wasClean=${D.wasClean}`),clearTimeout(f),clearInterval(d),K(new W(`Connection to the server was closed (code: ${D.code})`,"PROJECT_CLOSED"));},"onClose");function y(D){a.debug("Received message");let Z=typeof D.data=="string"?D.data:D.data.toString(),P=nt.parse(Z);a.debug(`Message type: ${P.type}`),P.type==="error"?(clearTimeout(f),I(),K(new W(`Server error: ${P.message||JSON.stringify(P)}`,"INTERNAL"))):P.type==="ready"?(Bt(P)&&"requestId"in P&&(o=String(P.requestId),a=N.withRequestId(o),a.debug(`Server request ID: ${o}`)),Bt(P)&&"version"in P&&a.debug(`Server version: ${P.version}`),Bt(P)&&P.gracefulDisconnect===true&&(s=true),a.debug("Sending pluginReadySignal"),n.send(nt.stringify(Da))):P.type==="debug-archive"?Ui(P.data):va(P)&&(clearTimeout(f),n.removeEventListener("message",y),n.removeEventListener("error",T),n.removeEventListener("close",p),G(P));}r(y,"handshakeMessageHandler"),n.addEventListener("open",u),n.addEventListener("message",y),n.addEventListener("error",T),n.addEventListener("close",p);});return n.addEventListener("close",()=>{b();}),{ws:n,pluginReadyData:F,requestId:o,logger:a,gracefulDisconnect:s,cleanup:b}}r(Nr,"connectAndHandshake");async function kr(i,e){let t=performance.now(),n=dr(i);L(n,`Invalid project URL or ID: ${i}`);let o=e??fe("FRAMER_API_KEY");L(o,"FRAMER_API_KEY environment variable is required");let a=await Nr(n,o),s=new ye(a.ws),d={transport:s,mode:a.pluginReadyData.mode,permissionMap:a.pluginReadyData.permissionMap,environmentInfo:a.pluginReadyData.environmentInfo,origin:null,theme:null,initialState:a.pluginReadyData.initialState},I=er(d);s.setOnError(F=>{I[E.rejectAllPending](F);});let b=r(async()=>{let F=((performance.now()-t)/1e3).toFixed(2);a.logger.debug(`Connection ended after ${F}s`),await a.cleanup();},"cleanup");return Vt.create(I,b,a.requestId)}r(kr,"connect");async function Ma(i,e,t){let n=await kr(i,t);try{return await e(n)}finally{await n.disconnect();}}r(Ma,"withConnection");
11
+ `));}catch{}throw t}r(R,"assert");var sr={showUI:false,hideUI:false,closePlugin:false,setCloseWarning:true,notify:false,setMenu:false,showContextMenu:false,preloadDetachedComponentLayers:false,preloadDragPreviewImage:false,preloadImageUrlForInsertion:false,setBackgroundMessage:false,getSelection:false,getActiveCollection:false,getActiveManagedCollection:false,getActiveLocale:false,zoomIntoView:false,navigateTo:false,getPluginData:false,setPluginData:false,getPluginDataKeys:false,makeDraggable:false,subscribeToSelection:false,subscribeToImage:false,subscribeToText:false,subscribeToCustomCode:false,subscribeToColorStyles:false,subscribeToTextStyles:false,subscribeToRedirects:false,subscribeToCodeFiles:false,subscribeToOpenCodeFile:false,subscribeToIsAllowedTo:false,subscribeToCanvasRoot:false,subscribeToPublishInfo:false,unstable_ensureMinimumDependencyVersion:false,removeNode:true,removeNodes:true,addSVG:true,getRect:true,setText:true,getText:true,addText:true,setCustomCode:true,getCustomCode:true,getLocales:true,getDefaultLocale:true,getLocalizationGroups:true,setLocalizationData:true,getCurrentUser:true,getProjectInfo:true,setSelection:true,getCanvasRoot:true,getPublishInfo:true,cloneNode:true,getNode:true,getParent:true,getChildren:true,setAttributes:true,getNodesWithType:true,getNodesWithAttribute:true,getNodesWithAttributeSet:true,addImages:true,getImage:true,addImage:true,setImage:true,uploadImage:true,uploadImages:true,uploadFile:true,uploadFiles:true,setParent:true,addComponentInstance:true,addDetachedComponentLayers:true,getManagedCollection:true,getManagedCollections:true,getCollection:true,getCollections:true,getColorStyle:true,getColorStyles:true,createColorStyle:true,getTextStyle:true,getTextStyles:true,createTextStyle:true,getFont:true,getFonts:true,createCodeFile:true,getCodeFiles:true,getCodeFile:true,lintCode:true,typecheckCode:true,addRedirects:true,getRedirects:true,setRedirectOrder:true,removeRedirects:true,addComponentInstancePlaceholder:true,createCollection:true,getVectorSets:true,createDesignPage:true,createWebPage:true,createTextNode:true,createComponentNode:true,mode:true,isAllowedTo:false,createFrameNode:true,createManagedCollection:true};function ki(i){return i in sr?sr[i]===true:false}r(ki,"isAllowedMethod");var Vt=class i{static{r(this,"FramerAPI");}requestId;#e;#t;#i;#n=new AbortController;#r=new Map;#o=new Map;#s=0;constructor(e,t,n,o){this.#t=e,this.#i=t,this.#e=n,this.requestId=o,this.#d();}#a(){return `req-${++this.#s}-${Date.now()}`}#l=e=>{switch(e.type){case "screenshotResult":{let t=this.#r.get(e.id);if(t){this.#r.delete(e.id);let n=Buffer.from(e.data,"base64");t.resolve({data:n,mimeType:e.mimeType});}return true}case "screenshotError":{let t=this.#r.get(e.id);if(t){this.#r.delete(e.id);let n=e.code??"INTERNAL";t.reject(new E(e.error,n));}return true}case "exportSVGResult":{let t=this.#o.get(e.id);return t&&(this.#o.delete(e.id),t.resolve(e.data)),true}case "exportSVGError":{let t=this.#o.get(e.id);if(t){this.#o.delete(e.id);let n=e.code??"INTERNAL";t.reject(new E(e.error,n));}return true}default:return false}};static create(e,t,n,o){let s=new i(e,t,n,o);return new Proxy(s,{get(a,d){if(d in a)return Reflect.get(a,d);if(Ci(d)){let b=V[d],P=Reflect.get(a.#t,b);return typeof P=="function"?P.bind(a.#t):P}if(!ki(d))return;let x=Reflect.get(a.#t,d);return typeof x=="function"?x.bind(a.#t):x},has(a,d){return d in a||Ci(d)?true:ki(d)?d in a.#t:false}})}#d(){this.#i.onMessage(e=>{this.#l(e);},this.#n.signal);}disconnect=async()=>{this.#n.abort(),await this.#e();};screenshot=async(e,t)=>{let n=this.#a(),{format:o,quality:s,scale:a,clip:d}=t??{};return new Promise((x,b)=>{this.#r.set(n,{resolve:x,reject:b}),this.#i.send({type:"screenshot",id:n,nodeId:e,format:o,quality:s,scale:a,clip:d});})};exportSVG=async e=>{let t=this.#a();return new Promise((n,o)=>{this.#o.set(t,{resolve:n,reject:o}),this.#i.send({type:"exportSVG",id:t,nodeId:e});})};[Symbol.dispose]=()=>{this.#n.abort(),this.#e();};[Symbol.asyncDispose]=()=>(this.#n.abort(),this.#e())};var Zo=/^.+--([A-Za-z0-9]+)/u,lr=/^[A-Za-z0-9]{20}$/u;function dr(i){if(lr.test(i))return i;try{let t=new URL(i,"https://framer.com").pathname.split("/").filter(Boolean),n=t.findIndex(o=>o.toLowerCase()==="projects");if(n>=0){let o=t[n+1];if(o!==void 0){let s=decodeURIComponent(o),d=s.match(Zo)?.[1]??s;if(lr.test(d))return d}}return null}catch{return null}}r(dr,"parseProjectId");var Ei={silent:0,error:1,warn:2,info:3,debug:4};function Jo(){let i=ye("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in Ei?i:"warn"}r(Jo,"getLogLevel");var Mi=Jo();function Je(i){return Ei[i]<=Ei[Mi]}r(Je,"shouldLog");var Qe=globalThis.console,Qo="\x1B[90m",ea="\x1B[0m";function ta(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}r(ta,"formatPrefix");function ia(i,...e){return [Qo+i,...e,ea]}r(ia,"formatDebug");function ur(i){let e=ta(i);return {warn:(...t)=>{Je("warn")&&Qe.warn(e,...t);},error:(...t)=>{Je("error")&&Qe.error(e,...t);},log:(...t)=>{Je("info")&&Qe.log(e,...t);},info:(...t)=>{Je("info")&&Qe.info(e,...t);},debug:(...t)=>{Je("debug")&&Qe.debug(...ia(e,...t));},setLevel:t=>{Mi=t;},getLevel:()=>Mi,withRequestId:t=>ur(t)}}r(ur,"createLogger");var v=ur();v.warn;v.error;v.log;v.info;v.debug;v.setLevel;v.getLevel;var cr;function pr({error:i,tags:e,extras:t,critical:n,caller:o}){R(cr,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let s=Vi(i,o);return cr({error:s,tags:{...s.tags,...e},extras:{...s.extras,...t},critical:!!n}),s}r(pr,"reportError");function Vi(i,e=Vi){return i instanceof Error?i:new Ai(i,e)}r(Vi,"reportableError");var Ai=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let n=e?JSON.stringify(e):"No error message provided";if(super(n),this.message=n,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var et=typeof window<"u"?window.location.hostname:undefined,mr=!!(et&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(et)),wi=(()=>{if(!et)return;if(mr)return {main:et,previewLink:undefined};let i=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=et.match(i);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:wi,isDevelopment:wi?.main==="development.framer.com",isProduction:wi?.main==="framer.com",isLocal:mr});var wt;function Wt(){return typeof window>"u"?{}:wt||(wt=oa(),wt)}r(Wt,"getServiceMap");function oa(){let i=window.location,e=window?.bootstrap?.services;if(e)return e;let t;try{if(t=window.top.location.origin,e=window.top?.bootstrap?.services,e)return e}catch{}if(t&&t!==i.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${i.origin})`);if(i.origin.endsWith("framer.com")||i.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let n=new URLSearchParams(i.search).get("services")||new URLSearchParams(i.hash.substring(1)).get("services");n&&(e=JSON.parse(n));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(oa,"extractServiceMap");function tt(i,e=0,t=new Set){if(i===null)return i;if(typeof i=="function")return `[Function: ${i.name??"unknown"}]`;if(typeof i!="object")return i;if(i instanceof Error)return `[${i.toString()}]`;if(t.has(i))return "[Circular]";if(e>2)return "...";t.add(i);try{if("toJSON"in i&&typeof i.toJSON=="function")return tt(i.toJSON(),e+1,t);if(Array.isArray(i))return i.map(n=>tt(n,e+1,t));if(Object.getPrototypeOf(i)!==Object.prototype)return `[Object: ${"__class"in i&&i.__class||i.constructor?.name}]`;{let n={};for(let[o,s]of Object.entries(i))n[o]=tt(s,e+1,t);return n}}catch(n){return `[Throws: ${n instanceof Error?n.message:n}]`}finally{t.delete(i);}}r(tt,"jsonSafeCopy");var aa=["trace","debug","info","warn","error"],sa=[":trace",":debug",":info",":warn",":error"];function yr(i,e){let t=[];for(let n of i.split(/[ ,]/u)){let o=n.trim();if(o.length===0)continue;let s=1,a=false;o.startsWith("-")&&(o=o.slice(1),s=3,a=true);for(let b=0;b<=4;b++){let P=sa[b];if(P&&o.endsWith(P)){s=b,a&&(s+=1),o=o.slice(0,o.length-P.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+ma(o).replace(/\\\*/gu,".*")+"$"),x=0;for(let b of e)b.id.match(d)&&(b.level=s,++x);x===0&&t.push(n);}return t}r(yr,"applyLogLevelSpec");var it=class i{constructor(e,t,n){this.logger=e;this.level=t;this.parts=n;this.id=i.nextId++,this.time=Date.now();}static{r(this,"LogEntry");}static nextId=0;id;time;stringPrefix;toMessage(){if(this.stringPrefix)return this.parts;let e=[new Date(this.time).toISOString().substr(-14,14),aa[this.level]+": ["+this.logger.id+"]"],t=0;for(;t<this.parts.length;t++){let n=this.parts[t];if(typeof n=="string"){e.push(n);continue}break}return this.stringPrefix=e.join(" "),this.parts.splice(0,t,this.stringPrefix),this.parts}toString(){return this.toMessage().map(e=>{let t=typeof e;if(t==="string")return e;if(t==="function")return `[Function: ${e.name??"unknown"}]`;if(e instanceof Error)return e.stack??e.toString();let n=JSON.stringify(tt(e));return n?.length>253?n.slice(0,250)+"...":n}).join(" ")}},K="*:app:info,app:info",hr=typeof process<"u"&&!!process.kill,la=hr&&!!process.env.CI;la?K="-:warn":hr&&(K="");try{typeof window<"u"&&window.localStorage&&(K=window.localStorage.logLevel||K);}catch{}try{typeof process<"u"&&(K=process.env.DEBUG||K);}catch{}try{typeof window<"u"&&Object.assign(window,{setLogLevel:Cr});}catch{}try{typeof window<"u"&&window.postMessage&&window.top===window&&window.addEventListener("message",i=>{if(!i.data||typeof i.data!="object")return;let{loggerId:e,level:t,parts:n,printed:o}=i.data;if(typeof e!="string"||!Array.isArray(n)||n.length<1||typeof t!="number")return;let s=nt(e);if(t<0||t>5)return;n[0]=n[0].replace("[","*[");let a=new it(s,t,n);a.stringPrefix=n[0],Z.push(a),!o&&(s.level>t||console?.log(...a.toMessage()));});}catch{}var Li;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(Li=r(i=>{try{let e=i.toMessage().map(a=>tt(a)),t=i.logger,n=i.level,o=t.level<=i.level,s={loggerId:t.id,level:n,parts:e,printed:o};window.parent?.postMessage(s,Wt().app);}catch{}},"postLogEntry"));}catch{}var Wi={},Z=[],br=1e3;function ae(i,e,t){let n=new it(i,e,t);for(Z.push(n),Li?.(n);Z.length>br;)Z.shift();return n}r(ae,"createLogEntry");function xr(i){return typeof i=="number"&&(br=i),Z}r(xr,"getLogReplayBuffer");var da=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,fr;function ua(){if(!(typeof window>"u"||!window.location))return fr??=da.exec(window.location.pathname)?.groups?.filename,fr}r(ua,"getFilenameFromWindowPathname");function nt(i){let e=ua();i=(e?e+":":"")+i;let t=Wi[i];if(t)return t;let n=new Lt(i);return Wi[i]=n,yr(K,[n]),Li?.(new it(n,-1,[])),n}r(nt,"getLogger");function Cr(i,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=i);}catch{}let t=K;K=i;let n=Object.values(Wi);for(let s of n)s.level=3;let o=yr(i,n);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&Z.length>0){console?.log("--- LOG REPLAY ---");for(let s of Z)s.logger.level>s.level||(s.level>=3?console?.warn(...s.toMessage()):console?.log(...s.toMessage()));console?.log("--- END OF LOG REPLAY ---");}return t}r(Cr,"setLogLevel");var ca=r(i=>{let e={...i,logs:xr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
12
+ `)};return i.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),Lt=class{constructor(e,t){this.id=e;this.errorIsCritical=t??(e==="fatal"||e.endsWith(":fatal"));}static{r(this,"Logger");}level=3;didLog={};errorIsCritical;extend(e){let t=this.id+":"+e;return nt(t)}getBufferedMessages(){return Z.filter(e=>e.logger===this)}setLevel(e){let t=this.level;return this.level=e,t}isLoggingTraceMessages(){return this.level>=0}trace=(...e)=>{if(this.level>0)return;let t=ae(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=ae(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=ae(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=ae(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=ae(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,n,o)=>{let s=ca(t??{}),a=pr({caller:this.reportWithoutLogging,error:e,tags:{...n,handler:"logger",where:this.id},extras:t,critical:o??this.errorIsCritical});return [s,a]};reportError=(e,t,n,o)=>{let[s,a]=this.reportWithoutLogging(e,t,n,o);s?this.error(a,s):this.error(a);};reportErrorOncePerMinute=(e,t)=>{if(!pa(e))return;let n=this.didLog[e.message];n&&n>Date.now()||(this.didLog[e.message]=Date.now()+1e3*60,this.reportError(e,t));};reportCriticalError=(e,t,n)=>this.reportError(e,t,n,true)};function pa(i){return Object.prototype.hasOwnProperty.call(i,"message")}r(pa,"isErrorWithMessage");function ma(i){return i.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(ma,"escapeRegExp");var Pr;($=>{function i(f,...u){return f.concat(u)}$.push=i,r(i,"push");function e(f){return f.slice(0,-1)}$.pop=e,r(e,"pop");function t(f,...u){return u.concat(f)}$.unshift=t,r(t,"unshift");function n(f,u,...T){let p=f.length;if(u<0||u>p)throw Error("index out of range: "+u);let y=f.slice();return y.splice(u,0,...T),y}$.insert=n,r(n,"insert");function o(f,u,T){let p=f.length;if(u<0||u>=p)throw Error("index out of range: "+u);let y=Array.isArray(T)?T:[T],M=f.slice();return M.splice(u,1,...y),M}$.replace=o,r(o,"replace");function s(f,u){let T=f.length;if(u<0||u>=T)throw Error("index out of range: "+u);let p=f.slice();return p.splice(u,1),p}$.remove=s,r(s,"remove");function a(f,u,T){let p=f.length;if(u<0||u>=p)throw Error("from index out of range: "+u);if(T<0||T>=p)throw Error("to index out of range: "+T);let y=f.slice();if(T===u)return y;let M=y[u];return u<T?(y.splice(T+1,0,M),y.splice(u,1)):(y.splice(u,1),y.splice(T,0,M)),y}$.move=a,r(a,"move");function d(f,u){let T=[],p=Math.min(f.length,u.length);for(let y=0;y<p;y++)T.push([f[y],u[y]]);return T}$.zip=d,r(d,"zip");function x(f,u,T){let p=f.slice(),y=p[u];return y===undefined||(p[u]=T(y)),p}$.update=x,r(x,"update");function b(f){return Array.from(new Set(f))}$.unique=b,r(b,"unique");function P(f,...u){return Array.from(new Set([...f,...u.flat()]))}$.union=P,r(P,"union");function z(f,u){return f.filter(u)}$.filter=z,r(z,"filter");})(Pr||={});var Ca=Object.prototype.hasOwnProperty;function Ia(i,e){return Ca.call(i,e)}r(Ia,"hasOwnProperty");var Sr;(n=>{function i(o,s){for(let a of Object.keys(o))Ia(s,a)||delete o[a];for(let a of Object.keys(s))o[a]===undefined&&(o[a]=s[a]);return Object.setPrototypeOf(o,Object.getPrototypeOf(s)),o}n.morphUsingTemplate=i,r(i,"morphUsingTemplate");function e(o,s){s&&Object.assign(o,s);}n.writeOnce=e,r(e,"writeOnce");function t(o,s){return Object.assign(Object.create(Object.getPrototypeOf(o)),o,s)}n.update=t,r(t,"update");})(Sr||={});var Fr;(o=>{function i(s,...a){return new Set([...s,...a])}o.add=i,r(i,"add");function e(s,...a){let d=new Set(s);for(let x of a)d.delete(x);return d}o.remove=e,r(e,"remove");function t(...s){let a=new Set;for(let d of s)for(let x of d)a.add(x);return a}o.union=t,r(t,"union");function n(s,a){return s.has(a)?o.remove(s,a):o.add(s,a)}o.toggle=n,r(n,"toggle");})(Fr||={});var Dr;(n=>{function i(o,...s){let a=new Map;o.forEach((x,b)=>a.set(b,x));let d=false;for(let x of s)x&&(x.forEach((b,P)=>a.set(P,b)),d=true);return d?a:o}n.merge=i,r(i,"merge");function e(o,s,a){let d=new Map(o);return d.set(s,a),d}n.set=e,r(e,"set");function t(o,s){let a=new Map(o);return a.delete(s),a}n.remove=t,r(t,"remove");})(Dr||={});(class extends Promise{static{r(this,"ResolvablePromise");}_state="initial";resolve;reject;get state(){return this._state}pending(){return this._state="pending",this}isResolved(){return this._state==="fulfilled"||this._state==="rejected"}constructor(){let e,t;super((n,o)=>{e=n,t=o;}),this.resolve=n=>{this._state="fulfilled",e(n);},this.reject=n=>{this._state="rejected",t(n);};}});nt("task-queue");function Bi(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Bi,"isObject");var he=class{constructor(e){this.ws=e;}static{r(this,"WebSocketTransport");}onError;setOnError(e){this.onError=e;}send(e){this.ws.send(rt.stringify(e));}waitForDisconnectAck(e){return new Promise(t=>{let n=setTimeout(()=>{this.ws.removeEventListener("message",o),t();},e),o=r(s=>{if(!(typeof s.data!="string"&&!(s.data instanceof String)))try{let a=rt.parse(s.data);Bi(a)&&a.type==="disconnect-ack"&&(clearTimeout(n),this.ws.removeEventListener("message",o),t());}catch{}},"handler");this.ws.addEventListener("message",o);})}onMessage(e,t){let n=r(o=>{let s=typeof o.data=="string"?o.data:o.data.toString(),a=rt.parse(s);if(Bi(a)&&a.type==="error"){let d=a.message||JSON.stringify(a),x=a.code??"INTERNAL";v.error(`Server error: ${d}`),this.onError?.(new E(`Server error: ${d}`,x));return}if(Bi(a)&&a.type==="debug-archive"){Ui(a.data);return}e(a);},"listener");this.ws.addEventListener("message",n),t?.addEventListener("abort",()=>this.ws.removeEventListener("message",n));}};function Ui(i){R(vi,"File system module is not available."),R(Ni,"Path module is not available.");let t=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,n=process.cwd(),o=Ni.resolve(n,t);vi.writeFileSync(o,Buffer.from(i)),v.info(`Debug archive saved to ${o}`);}r(Ui,"handleDebugArchive");function Bt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Bt,"isObject");var Fa={type:"pluginReadySignal"};function Da(i){return Bt(i)&&i.type==="pluginReadyResponse"}r(Da,"isPluginReadyResponse");var vr=45e3,va=2e4;async function Na(i,e){let t={Authorization:`Token ${e}`};if(ir)return v.debug("Using Cloudflare Workers WebSocket connection"),rr(i,t);let n=i.hostname==="api.framerlocal.com",o=process.env.NODE_TLS_REJECT_UNAUTHORIZED;n&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"),v.debug("Using standard WebSocket connection");let s=new nr(i.href,{headers:t});return n&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED=o),s}r(Na,"createWebSocket");async function Nr(i,e,t){let n=new URL(t??ye("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));n.protocol=n.protocol==="https:"?"wss:":n.protocol==="http:"?"ws:":n.protocol,n.searchParams.set("projectId",i),v.debug(`Connecting to ${n.href}`);let o=await Na(n,e);v.debug(`WebSocket created, readyState: ${o.readyState}`);let s,a=v,d=false,x=setInterval(()=>{o.readyState===o.OPEN&&(o.send(rt.stringify({type:"ping"})),a.debug("Sent ping"));},va),b=r(()=>{clearInterval(x),o.readyState!==o.CLOSED&&o.readyState!==o.CLOSING&&o.close(1e3,"Client disconnect");},"forceClose"),P=r(async()=>{if(clearInterval(x),!(o.readyState===o.CLOSED||o.readyState===o.CLOSING)){if(d){a.debug("Initiating graceful disconnect");let $=new he(o);$.send({type:"client-disconnect"}),await $.waitForDisconnectAck(5e3);}o.readyState!==o.CLOSED&&o.readyState!==o.CLOSING&&o.close(1e3,"Client disconnect");}},"cleanup"),z=await new Promise(($,f)=>{let u=setTimeout(()=>{b(),f(new E(`Connection timeout after ${vr}ms`,"TIMEOUT"));},vr),T=r(()=>{a.debug("WebSocket opened, waiting for ready");},"onOpen"),p=r(N=>{a.debug("WebSocket error:",N),clearTimeout(u),b(),f(new E("No connection to the server","INTERNAL"));},"onError"),y=r(N=>{a.debug(`WebSocket closed: code=${N.code}, reason=${N.reason||"(no reason)"}, wasClean=${N.wasClean}`),clearTimeout(u),clearInterval(x),f(new E(`Connection to the server was closed (code: ${N.code})`,"PROJECT_CLOSED"));},"onClose");function M(N){a.debug("Received message");let se=typeof N.data=="string"?N.data:N.data.toString(),S=rt.parse(se);a.debug(`Message type: ${S.type}`),S.type==="error"?(clearTimeout(u),b(),f(new E(`Server error: ${S.message||JSON.stringify(S)}`,"INTERNAL"))):S.type==="ready"?(Bt(S)&&"requestId"in S&&(s=String(S.requestId),a=v.withRequestId(s),a.debug(`Server request ID: ${s}`)),Bt(S)&&"version"in S&&a.debug(`Server version: ${S.version}`),Bt(S)&&S.gracefulDisconnect===true&&(d=true),a.debug("Sending pluginReadySignal"),o.send(rt.stringify(Fa))):S.type==="debug-archive"?Ui(S.data):Da(S)&&(clearTimeout(u),o.removeEventListener("message",M),o.removeEventListener("error",p),o.removeEventListener("close",y),$(S));}r(M,"handshakeMessageHandler"),o.addEventListener("open",T),o.addEventListener("message",M),o.addEventListener("error",p),o.addEventListener("close",y);});return o.addEventListener("close",()=>{P();}),{ws:o,pluginReadyData:z,requestId:s,logger:a,gracefulDisconnect:d,cleanup:P}}r(Nr,"connectAndHandshake");async function kr(i,e,t){let n=performance.now(),o=dr(i);R(o,`Invalid project URL or ID: ${i}`);let s=e??ye("FRAMER_API_KEY");R(s,"FRAMER_API_KEY environment variable is required");let a=await Nr(o,s,t?.serverUrl),d=new he(a.ws),x={transport:d,mode:a.pluginReadyData.mode,permissionMap:a.pluginReadyData.permissionMap,environmentInfo:a.pluginReadyData.environmentInfo,origin:null,theme:null,initialState:a.pluginReadyData.initialState},b=er(x);d.setOnError(z=>{b[V.rejectAllPending](z);});let P=r(async()=>{let z=((performance.now()-n)/1e3).toFixed(2);a.logger.debug(`Connection ended after ${z}s`),await a.cleanup();},"cleanup");return Vt.create(b,d,P,a.requestId)}r(kr,"connect");async function ka(i,e,t,n){let o=await kr(i,t,n);try{return await e(o)}finally{await o.disconnect();}}r(ka,"withConnection");
14
13
 
15
- export { pt as BooleanField, xe as BooleanVariable, ke as BorderVariable, Tt as CollectionReferenceField, mt as ColorField, Se as ColorVariable, Ke as ComponentInstanceNode, ne as ComponentNode, Be as ConicGradient, bt as DateField, Ne as DateVariable, re as DesignPageNode, H as EnumCase, It as EnumField, Pe as EnumVariable, At as ErrorCode, xt as FieldDivider, Ct as FileField, De as FileVariable, yt as FormattedTextField, Te as FormattedTextVariable, U as FrameNode, W as FramerAPIError, q as FramerPluginClosedError, qe as FramerPluginError, Ee as ImageField, Fe as ImageVariable, Le as LinearGradient, ht as LinkField, ve as LinkVariable, Pt as MultiCollectionReferenceField, gt as NumberField, Ce as NumberVariable, Re as RadialGradient, ze as SVGNode, ft as StringField, Ie as StringVariable, te as TextNode, We as UnsupportedComputedValue, Ae as UnsupportedField, Me as UnsupportedVariable, _e as VectorSet, vt as VectorSetItem, Ge as VectorSetItemNode, $e as VectorSetNode, ie as WebPageNode, Xo as configure, kr as connect, oe as framer, pl as hasGridLayout, cl as hasStackLayout, Bn as isBreakpoint, Oo as isCodeFileComponentExport, zo as isCodeFileOverrideExport, ue as isColorStyle, Rn as isComponentGestureVariant, pe as isComponentInstanceNode, Gn as isComponentNode, so as isComponentVariable, ci as isComponentVariant, ho as isComputedValue, Kn as isDesignPageNode, lo as isField, co as isFileAsset, Dt as isFrameNode, mo as isImageAsset, Zo as isRetryableError, On as isSVGNode, Un as isTextNode, ui as isTextStyle, $i as isVariable, Hn as isVectorSetItemNode, $n as isVectorSetNode, zn as isWebPageNode, Os as supportsAspectRatio, $s as supportsBackgroundColor, Hs as supportsBackgroundColorData, qs as supportsBackgroundGradient, Ys as supportsBackgroundGradientData, js as supportsBackgroundImage, _s as supportsBackgroundImageData, Qs as supportsBorder, Js as supportsBorderRadius, Vo as supportsBreakpoint, rl as supportsComponentInfo, Ln as supportsComponentVariant, ol as supportsFont, al as supportsFontData, ul as supportsImageRendering, sl as supportsInlineTextStyle, ll as supportsInlineTextStyleData, Wn as supportsLayout, dl as supportsLink, Ks as supportsLocked, zs as supportsName, Zs as supportsOpacity, nl as supportsOverflow, Rs as supportsPins, Ls as supportsPosition, Xs as supportsRotation, el as supportsSVG, Bs as supportsSize, Us as supportsSizeConstraints, tl as supportsTextTruncation, Gs as supportsVisible, il as supportsZIndex, Ma as withConnection };
14
+ export { mt as BooleanField, xe as BooleanVariable, ke as BorderVariable, Pt as CollectionReferenceField, gt as ColorField, Se as ColorVariable, Ke as ComponentInstanceNode, ne as ComponentNode, Be as ConicGradient, xt as DateField, Ne as DateVariable, re as DesignPageNode, j as EnumCase, Tt as EnumField, Pe as EnumVariable, Ze as ErrorCode, Ct as FieldDivider, It as FileField, De as FileVariable, ht as FormattedTextField, Te as FormattedTextVariable, O as FrameNode, E as FramerAPIError, Y as FramerPluginClosedError, qe as FramerPluginError, Me as ImageField, Fe as ImageVariable, Le as LinearGradient, bt as LinkField, ve as LinkVariable, St as MultiCollectionReferenceField, ft as NumberField, Ce as NumberVariable, Re as RadialGradient, ze as SVGNode, yt as StringField, Ie as StringVariable, te as TextNode, We as UnsupportedComputedValue, Ae as UnsupportedField, Ee as UnsupportedVariable, _e as VectorSet, Nt as VectorSetItem, Ge as VectorSetItemNode, $e as VectorSetNode, ie as WebPageNode, Yo as configure, kr as connect, oe as framer, cl as hasGridLayout, ul as hasStackLayout, Bn as isBreakpoint, Oo as isCodeFileComponentExport, zo as isCodeFileOverrideExport, ce as isColorStyle, Rn as isComponentGestureVariant, me as isComponentInstanceNode, Gn as isComponentNode, so as isComponentVariable, ci as isComponentVariant, ho as isComputedValue, Kn as isDesignPageNode, lo as isField, co as isFileAsset, vt as isFrameNode, mo as isImageAsset, Xo as isRetryableError, On as isSVGNode, Un as isTextNode, ui as isTextStyle, $i as isVariable, Hn as isVectorSetItemNode, $n as isVectorSetNode, zn as isWebPageNode, Us as supportsAspectRatio, Ks as supportsBackgroundColor, $s as supportsBackgroundColorData, _s as supportsBackgroundGradient, qs as supportsBackgroundGradientData, Hs as supportsBackgroundImage, js as supportsBackgroundImageData, Js as supportsBorder, Zs as supportsBorderRadius, Vo as supportsBreakpoint, nl as supportsComponentInfo, Ln as supportsComponentVariant, rl as supportsFont, ol as supportsFontData, dl as supportsImageRendering, al as supportsInlineTextStyle, sl as supportsInlineTextStyleData, Wn as supportsLayout, ll as supportsLink, Gs as supportsLocked, Os as supportsName, Xs as supportsOpacity, il as supportsOverflow, Ls as supportsPins, Ws as supportsPosition, Ys as supportsRotation, Qs as supportsSVG, Rs as supportsSize, Bs as supportsSizeConstraints, el as supportsTextTruncation, zs as supportsVisible, tl as supportsZIndex, ka as withConnection };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-api",
3
- "version": "0.0.1-beta.4",
3
+ "version": "0.0.1-nightly.20260121115836",
4
4
  "type": "module",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -29,9 +29,8 @@
29
29
  "prepublishOnly": "echo 'Please use make for publishing' && exit 1"
30
30
  },
31
31
  "dependencies": {
32
- "devalue": "^5.4.2",
33
- "unenv": "^2.0.0-rc.24",
34
- "ws": "^8.18.0"
32
+ "devalue": "^5.6.2",
33
+ "std-env": "^3.10.0"
35
34
  },
36
35
  "devDependencies": {
37
36
  "@biomejs/biome": "1.9.4",
@@ -40,12 +39,11 @@
40
39
  "@swc/core": "1.15.3",
41
40
  "@swc/jest": "^0.2.37",
42
41
  "@types/node": "22.18",
43
- "@types/ws": "^8.18.1",
44
42
  "@typescript-eslint/eslint-plugin": "^8.40.0",
45
43
  "@typescript-eslint/parser": "^8.40.0",
46
44
  "eslint": "^8.57.1",
47
45
  "eslint-plugin-framer-studio": "1.0.0",
48
- "framer-plugin": "3.10.0-beta.0",
46
+ "framer-plugin": "3.10.2-alpha.0",
49
47
  "jest": "29.4.1",
50
48
  "tsup": "^8.0.2",
51
49
  "tsx": "^4.19.2",