framer-api 0.1.2-alpha.0 → 0.1.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,6 +17,15 @@ Programmatically interact with Framer projects.
17
17
  npm install framer-api
18
18
  ```
19
19
 
20
+ ## Compatibility
21
+
22
+ Works with any modern JavaScript runtime.
23
+
24
+ - Node.js 22+
25
+ - Bun 1.1+
26
+ - Deno 1.4+
27
+ - Cloudflare Workers
28
+
20
29
  ## Getting Started
21
30
 
22
31
  1. Open your project in Framer
package/dist/index.d.ts CHANGED
@@ -135,6 +135,24 @@ interface Locale {
135
135
  */
136
136
  fallbackLocaleId?: string;
137
137
  }
138
+ /**
139
+ * Input for creating a new locale.
140
+ * @alpha
141
+ */
142
+ interface CreateLocaleInput {
143
+ /** The language code (e.g., "en", "fr", "zh-Hans"). Use `getLocaleLanguages()` to get the list of valid codes. */
144
+ language: string;
145
+ /** The optional region code (e.g., "US", "CA"). Use `getLocaleRegions(language)` to get the list of valid codes. */
146
+ region?: string;
147
+ /** ID of the fallback locale. Must reference an existing locale. */
148
+ fallbackLocaleId?: LocaleId;
149
+ /** URL slug for the locale (e.g., "en"). If not provided, one is derived from the code. */
150
+ slug?: string;
151
+ /** Display Name for the locale (e.g., "English (US)"). If not provided, one is derived from the code. */
152
+ name?: string;
153
+ /** Flag to mark the locale as a draft. Defaults to `false`. */
154
+ draft?: boolean;
155
+ }
138
156
  interface LocalizationValueBase {
139
157
  /**
140
158
  * The actual text of the localized value. A `value` of `null` means that
@@ -4327,7 +4345,7 @@ type NamespaceMembers<Class, Namespace extends string, Parent = undefined> = {
4327
4345
  [Member in Exclude<keyof Class, keyof Parent> as Member extends string ? `${Namespace}.${Member}` : never]: Class[Member];
4328
4346
  };
4329
4347
  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">;
4330
- 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"];
4348
+ 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", "getLocaleLanguages", "getLocaleRegions", "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"];
4331
4349
  type UnprotectedMessageType = (typeof unprotectedMessageTypesSource)[number];
4332
4350
  type ProtectedMessageType = Exclude<keyof PluginMessageAPI, UnprotectedMessageType>;
4333
4351
  type Method = keyof {
@@ -4390,7 +4408,6 @@ declare const methodToMessageTypes: {
4390
4408
  readonly getTextStyle: [];
4391
4409
  readonly getTextStyles: [];
4392
4410
  readonly hideUI: [];
4393
- /** @beta */
4394
4411
  readonly setBackgroundMessage: [];
4395
4412
  readonly setCloseWarning: [];
4396
4413
  /** @deprecated The lintCode API was removed. */
@@ -4406,6 +4423,9 @@ declare const methodToMessageTypes: {
4406
4423
  readonly setCustomCode: ["setCustomCode"];
4407
4424
  readonly setImage: ["setImage"];
4408
4425
  readonly setLocalizationData: ["setLocalizationData"];
4426
+ readonly createLocale: ["createLocale"];
4427
+ readonly getLocaleLanguages: [];
4428
+ readonly getLocaleRegions: [];
4409
4429
  readonly setMenu: [];
4410
4430
  readonly showContextMenu: [];
4411
4431
  readonly setParent: ["setParent"];
@@ -5837,6 +5857,36 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
5837
5857
  * @alpha
5838
5858
  */
5839
5859
  getVectorSets(): Promise<VectorSet[]>;
5860
+ /**
5861
+ * Create a new locale in the project.
5862
+ *
5863
+ * @alpha
5864
+ * @param input - The locale configuration, use `getLocaleLanguages` and `getLocaleRegions` to get valid language and region codes.
5865
+ * @returns The created locale.
5866
+ */
5867
+ createLocale(input: CreateLocaleInput): Promise<Locale>;
5868
+ /**
5869
+ * Get all available locale languages.
5870
+ *
5871
+ * @alpha
5872
+ * @returns A list of language codes and their display names, sorted by name.
5873
+ */
5874
+ getLocaleLanguages(): Promise<{
5875
+ code: string;
5876
+ name: string;
5877
+ }[]>;
5878
+ /**
5879
+ * Get all available locale regions for a given language.
5880
+ *
5881
+ * @alpha
5882
+ * @param languageCode - The language code to get regions for. Use `getLocaleLanguages` to get valid language codes.
5883
+ * @returns A list of region codes, their display names, and whether they are commonly paired with the given language.
5884
+ */
5885
+ getLocaleRegions(languageCode: string): Promise<{
5886
+ code: string;
5887
+ name: string;
5888
+ isCommon: boolean;
5889
+ }[]>;
5840
5890
  /** @internal - Available only through framer-api */
5841
5891
  [$framerApiOnly.publish](): Promise<PublishResult>;
5842
5892
  /** @internal - Available only through framer-api */
@@ -5955,6 +6005,19 @@ interface PluginMessageAPI {
5955
6005
  getActiveLocale: FramerPluginAPI["getActiveLocale"];
5956
6006
  getLocalizationGroups: FramerPluginAPI["getLocalizationGroups"];
5957
6007
  setLocalizationData: FramerPluginAPI["setLocalizationData"];
6008
+ /** @alpha */
6009
+ createLocale: (input: CreateLocaleInput) => Promise<Locale>;
6010
+ /** @alpha */
6011
+ getLocaleLanguages: () => Promise<{
6012
+ code: string;
6013
+ name: string;
6014
+ }[]>;
6015
+ /** @alpha */
6016
+ getLocaleRegions: (language: string) => Promise<{
6017
+ code: string;
6018
+ name: string;
6019
+ isCommon: boolean;
6020
+ }[]>;
5958
6021
  unstable_ensureMinimumDependencyVersion: FramerPluginAPI["unstable_ensureMinimumDependencyVersion"];
5959
6022
  showUI: (options?: UIOptions) => Promise<void>;
5960
6023
  notify: (message: string, options: NotifyOptionsData) => Promise<NotificationCloseReason>;
@@ -6454,6 +6517,9 @@ declare const enabledMethods: {
6454
6517
  getDefaultLocale: true;
6455
6518
  getLocalizationGroups: true;
6456
6519
  setLocalizationData: true;
6520
+ createLocale: true;
6521
+ getLocaleLanguages: true;
6522
+ getLocaleRegions: true;
6457
6523
  getCurrentUser: true;
6458
6524
  getProjectInfo: true;
6459
6525
  setSelection: true;
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { process as process$1, isWorkerd } from 'std-env';
2
2
  import * as ot from 'devalue';
3
3
 
4
- /* Framer API SDK v0.1.2-alpha.0 */
4
+ /* Framer API SDK v0.1.2-alpha.1 */
5
5
  var Ar=Object.defineProperty;var r=(n,e)=>Ar(n,"name",{value:e,configurable:true});function dt(n){return n!==undefined}r(dt,"isDefined");function $n(n){return n===undefined}r($n,"isUndefined");function x(n){return n===null}r(x,"isNull");function Hn(n){return n!==null}r(Hn,"isNotNull");function Ce(n){return n===true||n===false}r(Ce,"isBoolean");function f(n){return typeof n=="string"}r(f,"isString");function $(n){return typeof n=="number"&&Number.isFinite(n)}r($,"isNumber");function wr(n){return typeof n=="function"}r(wr,"isFunction");function v(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}r(v,"isObject");function ut(n){if(typeof n!="object"||n===null)return false;let e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}r(ut,"isPlainObject");function zt(n){return Array.isArray(n)}r(zt,"isArray");function ct(n,e){throw e||new Error(n?`Unexpected value: ${n}`:"Application entered invalid state")}r(ct,"assertNever");function p(n,...e){if(n)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let i=t.stack.split(`
6
6
  `);i[1]?.includes("assert")?(i.splice(1,1),t.stack=i.join(`
7
7
  `)):i[0]?.includes("assert")&&(i.splice(0,1),t.stack=i.join(`
8
- `));}catch{}throw t}r(p,"assert");function S(n){for(let e of Reflect.ownKeys(n)){let t=n[e];!t||typeof t!="object"&&!wr(t)||S(t);}return Object.freeze(n)}r(S,"deepFreeze");function jn(n){return [n.slice(0,-1),n.at(-1)]}r(jn,"splitRestAndLast");var c="__class";var Gt=Symbol(),Kt=Symbol(),Vr=Symbol(),Wr=Symbol(),Lr=Symbol(),Rr=Symbol(),Br=Symbol(),$t=Symbol(),Ht=Symbol(),l={getAiServiceInfo:Gt,sendTrackingEvent:Kt,environmentInfo:Vr,initialState:Wr,showUncheckedPermissionToasts:Lr,marshal:Rr,unmarshal:Br,getHTMLForNode:$t,setHTMLForNode:Ht},pt="INTERNAL_",mt=`${pt}getAiServiceInfo`,gt=`${pt}sendTrackingEvent`,de=`${pt}getHTMLForNode`,ue=`${pt}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 i=this.constructor;return new i(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},A="Variable";function w(n){let e=n.at(0);return p(!$n(e)),`${e.toLowerCase()}${n.slice(1,-A.length)}`}r(w,"classToType");var Ur=`Boolean${A}`,Or=w(Ur),Ie=class n extends k{static{r(this,"BooleanVariable");}type=Or;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},zr=`Number${A}`,Gr=w(zr),Te=class n extends k{static{r(this,"NumberVariable");}type=Gr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Kr=`String${A}`,$r=w(Kr),Pe=class n extends k{static{r(this,"StringVariable");}type=$r;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Hr=`FormattedText${A}`,jr=w(Hr),Se=class n extends k{static{r(this,"FormattedTextVariable");}type=jr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},_r=`Enum${A}`,qr=w(_r),H=class n{static{r(this,"EnumCase");}#e;#t;#n;#i;get id(){return this.#i.id}get name(){return this.#i.name}get nameByLocale(){return this.#i.nameByLocale}constructor(e,t,i,o){this.#e=e,this.#t=t,this.#n=i,this.#i=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#n,this.id,e);return t?new n(this.#e,this.#t,this.#n,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#n,this.id);}},Fe=class n extends k{static{r(this,"EnumVariable");}type=qr;#e;#t;#n;get cases(){return this.#n||(this.#n=S(this.#t.cases.map(e=>new H(this.#e,this.nodeId,this.id,e)))),this.#n}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new n(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);}},Yr=`Color${A}`,Xr=w(Yr),De=class n extends k{static{r(this,"ColorVariable");}type=Xr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Zr=`Image${A}`,Jr=w(Zr),ve=class n extends k{static{r(this,"ImageVariable");}type=Jr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Qr=`File${A}`,eo=w(Qr),Ne=class n extends k{static{r(this,"FileVariable");}type=eo;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},to=`Link${A}`,no=w(to),Ee=class n extends k{static{r(this,"LinkVariable");}type=no;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},io=`Date${A}`,ro=w(io),ke=class n extends k{static{r(this,"DateVariable");}type=ro;#e;get displayTime(){return this.#e.displayTime}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},oo=`Border${A}`,ao=w(oo),Me=class n extends k{static{r(this,"BorderVariable");}type=ao;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},so=`Unsupported${A}`,lo=w(so),Ae=class n extends k{static{r(this,"UnsupportedVariable");}type=lo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}};function _n(n){return n instanceof k}r(_n,"isVariable");function uo(n){return _n(n)&&n.nodeType==="component"}r(uo,"isComponentVariable");var R=class{static{r(this,"FieldBase");}#e;#t;#n;get id(){return this.#n.id}get name(){return this.#n.name}constructor(e,t,i){this.#e=e,this.#t=t,this.#n=i;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[i]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(p(dt(i)),x(i))return null;p(i.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,i)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},L=class extends R{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,i){super(e,t,i),this.#e=i;}},ft=class extends R{static{r(this,"BooleanField");}type=qt},yt=class extends R{static{r(this,"ColorField");}type=Yt},ht=class extends R{static{r(this,"NumberField");}type=Xt},bt=class extends L{static{r(this,"StringField");}type=Zt;#e;constructor(e,t,i){super(e,t,i),this.#e=i;}get basedOn(){return this.#e.basedOn}},xt=class extends L{static{r(this,"FormattedTextField");}type=Jt},we=class extends L{static{r(this,"ImageField");}type=Qt},Ct=class extends L{static{r(this,"LinkField");}type=tn},It=class extends L{static{r(this,"DateField");}type=nn;#e;get displayTime(){return this.#e.displayTime}constructor(e,t,i){super(e,t,i),this.#e=i;}},Tt=class extends R{static{r(this,"FieldDivider");}type=ln},Ve=class extends R{static{r(this,"UnsupportedField");}type=dn},Pt=class extends L{static{r(this,"FileField");}type=rn;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,i){super(e,t,i),this.#e=i;}},St=class extends R{static{r(this,"EnumField");}type=on;#e;#t;#n;#i;get cases(){return this.#i||(this.#i=this.#n.cases.map(e=>new H(this.#e,this.#t,this.id,e)),S(this.#i)),this.#i}constructor(e,t,i){super(e,t,i),this.#e=e,this.#t=t,this.#n=i;}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);}},Ft=class extends L{static{r(this,"CollectionReferenceField");}type=an;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},Dt=class extends L{static{r(this,"MultiCollectionReferenceField");}type=sn;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},jt=class extends L{static{r(this,"ArrayField");}type=en;fields;constructor(e,t,i){super(e,t,i);let o=i.fields[0];this.fields=[new we(e,t,o)];}};function _t(n,e,t){return n.map(i=>{switch(i.type){case qt:return new ft(e,t,i);case Yt:return new yt(e,t,i);case Xt:return new ht(e,t,i);case Zt:return new bt(e,t,i);case Jt:return new xt(e,t,i);case Qt:return new we(e,t,i);case tn:return new Ct(e,t,i);case nn:return new It(e,t,i);case ln:return new Tt(e,t,i);case dn:return new Ve(e,t,i);case rn:return new Pt(e,t,i);case on:return new St(e,t,i);case an:return new Ft(e,t,i);case sn:return new Dt(e,t,i);case en:return new jt(e,t,i);default:return new Ve(e,t,i)}})}r(_t,"fieldDefinitionDataArrayToFieldClassInstances");function co(n){return n instanceof R}r(co,"isField");var qn="action";function po(n){return !!n&&qn in n&&f(n[qn])}r(po,"isLocalizedValueUpdate");function Yn(n){return Object.keys(n).reduce((e,t)=>{let i=n[t];return po(i)&&(e[t]=i),e},{})}r(Yn,"filterInlineLocalizationValues");var We=class n{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 n(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function mo(n){return n instanceof We}r(mo,"isFileAsset");var go="ImageAsset";function Xn(n){return v(n)?n[c]===go:false}r(Xn,"isImageAssetData");var j=class n{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 n(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 n(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return ho(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(),i=new Blob([t],{type:e});return createImageBitmap(i)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((i,o)=>{let a=new Image;a.onload=()=>i(a),a.onerror=()=>o(),a.src=t;})}};function fo(n){return n instanceof j}r(fo,"isImageAsset");function _(n){return n.type==="bytes"?[n.bytes.buffer]:[]}r(_,"getTransferable");function yo(n){if(!v(n))return false;let e="bytes",t="mimeType";return !(!(e in n)||!(t in n)||!(n[e]instanceof Uint8Array)||!f(n[t]))}r(yo,"isBytesData");async function Le(n){if(n instanceof File)return pn(n);let e=await Zn(n.image);return {name:n.name,altText:n.altText,resolution:n.resolution,preferredImageRendering:n.preferredImageRendering,...e}}r(Le,"createImageTransferFromInput");async function un(n){if(n instanceof File)return pn(n);let e=await Zn(n.file);return {name:n.name,...e}}r(un,"createFileTransferFromInput");async function Zn(n){return n instanceof File?pn(n):yo(n)?{type:"bytes",mimeType:n.mimeType,bytes:n.bytes}:{type:"url",url:n}}r(Zn,"createAssetTransferFromAssetInput");function cn(n){return Promise.all(n.map(Le))}r(cn,"createNamedAssetDataTransferFromInput");async function pn(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=o=>{let a=n.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:n.name});},i.onerror=o=>{t(o);},i.readAsArrayBuffer(n);})}r(pn,"getAssetDataFromFile");async function ho(n){let e=n instanceof File,t=e?URL.createObjectURL(n):n,i=new Image;return i.crossOrigin="anonymous",new Promise((o,a)=>{i.onload=()=>{o({width:i.naturalWidth,height:i.naturalHeight});},i.onerror=s=>{a(s);},i.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(ho,"measureImage");var vt=class{static{r(this,"ComputedValueBase");}};var bo="unsupported",Re=class n extends vt{static{r(this,"UnsupportedComputedValue");}type=bo;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new n(t)}[l.marshal](){return this.#e}};function xo(n){return n instanceof vt}r(xo,"isComputedValue");var Co="Font";function Qn(n){return v(n)&&n[c]===Co}r(Qn,"isFontData");function Io(n){if(!$(n))return false;switch(n){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(Io,"isFontWeight");function To(n){if(!f(n))return false;switch(n){case "normal":case "italic":return true;default:return false}}r(To,"isFontStyle");function ei(n){return v(n)?f(n.family)&&f(n.selector)&&Io(n.weight)&&To(n.style):false}r(ei,"isFont");var O=class n{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 i=Jn.get(t.selector);if(i)return i;let o=new n(t);return Jn.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Jn=new Map;var Po="LinearGradient",So="RadialGradient",Fo="ConicGradient",ce=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})}},Be=class n extends ce{static{r(this,"LinearGradient");}[c]=Po;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(p(f(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Ue=class n extends ce{static{r(this,"RadialGradient");}[c]=So;#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 n({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,i)=>{p(f(t.color),"ColorStyle not supported yet");let o=this.stops[i+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})`}},Oe=class n extends ce{static{r(this,"ConicGradient");}[c]=Fo;#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 n({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(p(f(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 ti(n){return n instanceof ce}r(ti,"isGradient");var Do="ColorStyle";function Nt(n){return v(n)?n[c]===Do:false}r(Nt,"isColorStyleData");var Q=class n{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 n(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 n(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 pe(n){return n instanceof Q}r(pe,"isColorStyle");var vo="TextStyle";function ni(n){return v(n)?n[c]===vo:false}r(ni,"isTextStyleData");var ze=class n{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=Nt(t.color)?Q[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Nt(t.decorationColor)?Q[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 n(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:pe(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:pe(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 n(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 mn(n){return n instanceof ze}r(mn,"isTextStyle");function No(n){return v(n)&&l.marshal in n}r(No,"isSelfMarshalable");function B(n){if(No(n))return n[l.marshal]();if(zt(n))return n.map(B);if(ut(n)){let e={};for(let t of Object.keys(n))e[t]=B(n[t]);return e}return n}r(B,"marshal");var ii={ColorStyle:Q,ConicGradient:Oe,FileAsset:We,Font:O,ImageAsset:j,LinearGradient:Be,RadialGradient:Ue,TextStyle:ze,BooleanVariable:Ie,BorderVariable:Me,ColorVariable:De,DateVariable:ke,EnumVariable:Fe,FileVariable:Ne,FormattedTextVariable:Se,ImageVariable:ve,LinkVariable:Ee,NumberVariable:Te,StringVariable:Pe,UnsupportedVariable:Ae,UnsupportedComputedValue:Re};function Eo(n){return ut(n)&&f(n[c])&&n[c]in ii}r(Eo,"isSelfUnmarshalable");function h(n,e){if(Eo(e))return ii[e[c]][l.unmarshal](n,e);if(zt(e))return e.map(t=>h(n,t));if(ut(e)){let t={};for(let i of Object.keys(e))t[i]=h(n,e[i]);return t}return e}r(h,"unmarshal");var ko={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 Mo(n){return ko[n]}r(Mo,"isSupportedArrayItemFieldType");function Ao(n){return Mo(n.type)}r(Ao,"isSupportedArrayItemFieldDataEntry");var qt="boolean",Yt="color",Xt="number",Zt="string",Jt="formattedText",Qt="image",en="array",tn="link",nn="date",rn="file",on="enum",an="collectionReference",sn="multiCollectionReference",ln="divider",dn="unsupported";function wo(n){return n.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(i=>{let o=i.nameByLocale?Yn(i.nameByLocale):undefined;return {...i,nameByLocale:o}});return {...e,cases:t}})}r(wo,"sanitizeEnumFieldForMessage");function ri(n,e){let t={};for(let i in n){let o=n[i];if(!o)continue;if(o.type!=="array"){t[i]=h(e,o);continue}let a=o.value.map(s=>{let d=ri(s.fieldData,e),b={};for(let C in d){let F=d[C];p(F&&Ao(F),"Unsupported array item field data entry"),b[C]=F;}return {...s,fieldData:b}});t[i]={...o,value:a};}return t}r(ri,"deserializeFieldData");var me=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,p(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=wo(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)}},ee=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 _t(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return p(t.every(Hn)),_t(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 Ge(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)}},Ge=class n{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let i=ri(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=i,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 n(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 Vo={fixed:true,sticky:true,absolute:true,relative:true},oi="position";function Rs(n){if(!(oi in n))return false;let e=n[oi];return f(e)&&Vo[e]===true}r(Rs,"supportsPosition");var ai="top";function Bs(n){if(!(ai in n))return false;let e=n[ai];return f(e)||x(e)}r(Bs,"supportsPins");var si="width";function Us(n){if(!(si in n))return false;let e=n[si];return f(e)||x(e)}r(Us,"supportsSize");var li="maxWidth";function Os(n){if(!(li in n))return false;let e=n[li];return f(e)||x(e)}r(Os,"supportsSizeConstraints");var di="aspectRatio";function zs(n){if(!(di in n))return false;let e=n[di];return $(e)||x(e)}r(zs,"supportsAspectRatio");var ui="name";function Gs(n){if(!(ui in n))return false;let e=n[ui];return f(e)||x(e)}r(Gs,"supportsName");var ci="visible";function Ks(n){if(!(ci in n))return false;let e=n[ci];return Ce(e)}r(Ks,"supportsVisible");var pi="locked";function $s(n){if(!(pi in n))return false;let e=n[pi];return Ce(e)}r($s,"supportsLocked");var mi="backgroundColor";function Hs(n){if(!(mi in n))return false;let e=n[mi];return f(e)||pe(e)||x(e)}r(Hs,"supportsBackgroundColor");var gi="backgroundColor";function js(n){if(!(gi in n))return false;let e=n[gi];return f(e)||Nt(e)||x(e)}r(js,"supportsBackgroundColorData");var fi="backgroundImage";function _s(n){if(!(fi in n))return false;let e=n[fi];return e instanceof j||x(e)}r(_s,"supportsBackgroundImage");var yi="backgroundImage";function qs(n){if(!(yi in n))return false;let e=n[yi];return e instanceof j?false:Xn(e)||x(e)}r(qs,"supportsBackgroundImageData");var hi="backgroundGradient";function Ys(n){if(!(hi in n))return false;let e=n[hi];return ti(e)||x(e)}r(Ys,"supportsBackgroundGradient");var bi="backgroundGradient";function Xs(n){if(!(bi in n))return false;let e=n[bi];return v(e)||x(e)}r(Xs,"supportsBackgroundGradientData");var xi="rotation";function Zs(n){if(!(xi in n))return false;let e=n[xi];return $(e)}r(Zs,"supportsRotation");var Ci="opacity";function Js(n){if(!(Ci in n))return false;let e=n[Ci];return $(e)}r(Js,"supportsOpacity");var Ii="borderRadius";function Qs(n){if(!(Ii in n))return false;let e=n[Ii];return f(e)||x(e)}r(Qs,"supportsBorderRadius");var Ti="border";function el(n){if(!(Ti in n))return false;let e=n[Ti];return x(e)||pe(e.color)}r(el,"supportsBorder");var Pi="svg";function tl(n){if(!(Pi in n))return false;let e=n[Pi];return f(e)}r(tl,"supportsSVG");var Si="textTruncation";function nl(n){if(!(Si in n))return false;let e=n[Si];return $(e)||x(e)}r(nl,"supportsTextTruncation");var Fi="zIndex";function il(n){if(!(Fi in n))return false;let e=n[Fi];return $(e)||x(e)}r(il,"supportsZIndex");var Di="overflow";function rl(n){if(!(Di in n))return false;let e=n[Di];return f(e)||x(e)}r(rl,"supportsOverflow");var vi="componentIdentifier";function ol(n){if(!(vi in n))return false;let e=n[vi];return f(e)}r(ol,"supportsComponentInfo");var Ni="font";function al(n){if(!(Ni in n))return false;let e=n[Ni];return ei(e)}r(al,"supportsFont");var Ei="font";function sl(n){if(!(Ei in n))return false;let e=n[Ei];return Qn(e)||x(e)}r(sl,"supportsFontData");var ki="inlineTextStyle";function ll(n){if(!(ki in n))return false;let e=n[ki];return mn(e)||x(e)}r(ll,"supportsInlineTextStyle");var Mi="inlineTextStyle";function dl(n){if(!(Mi in n))return false;let e=n[Mi];return ni(e)||x(e)}r(dl,"supportsInlineTextStyleData");var Ai="link";function ul(n){if(!(Ai in n))return false;let e=n[Ai];return f(e)||x(e)}r(ul,"supportsLink");var wi="imageRendering";function cl(n){if(!(wi in n))return false;let e=n[wi];return f(e)||x(e)}r(cl,"supportsImageRendering");var Vi="layout";function Ri(n){if(!(Vi in n))return false;let e=n[Vi];return f(e)||x(e)}r(Ri,"supportsLayout");function pl(n){return Ri(n)?n.layout==="stack":false}r(pl,"hasStackLayout");function ml(n){return Ri(n)?n.layout==="grid":false}r(ml,"hasGridLayout");var Wi="isVariant";function Bi(n){if(!(Wi in n))return false;let e=n[Wi];return Ce(e)}r(Bi,"supportsComponentVariant");function gn(n){return Bi(n)?n.isVariant:false}r(gn,"isComponentVariant");function Ui(n){return !Bi(n)||!gn(n)?false:!x(n.gesture)}r(Ui,"isComponentGestureVariant");var Li="isBreakpoint";function Wo(n){if(!(Li in n))return false;let e=n[Li];return Ce(e)}r(Wo,"supportsBreakpoint");function Oi(n){return Wo(n)?n.isBreakpoint:false}r(Oi,"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 te(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return te(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(i=>I(i,this.#e))}async getNodesWithAttribute(e){return te(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(i=>I(i,this.#e))}async getNodesWithAttributeSet(e){return te(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(i=>I(i,this.#e))}async*walk(){if(yield this,!te(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);}},ne=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(ue,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(de,this.id)}},Ke=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);}},$e=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)}},He=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;#n;get typedControls(){return this.#n||(this.#n=h(this.#e,this.#t.typedControls)??{}),this.#n}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 i=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=I(i,this.#e);return p(o instanceof U),p(Oi(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Ge(e,this.#e):null}},re=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 i=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!i)throw new Error("Failed to add variant to component");let o=I(i,this.#e);return p(o instanceof U),p(gn(o),"Node is not a component variant"),o}async addGestureVariant(e,t,i){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,i);if(!o)throw new Error("Failed to add state to component");let a=I(o,this.#e);return p(a instanceof U),p(Ui(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);}},je=class extends V{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},oe=class extends V{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},_e=class extends V{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),S(this);}};function I(n,e){switch(n[c]){case "DesignPageNode":return new oe(n,e);case "WebPageNode":return new ie(n,e);case "ComponentNode":return new re(n,e);case "VectorSetNode":return new je(n,e);case "VectorSetItemNode":return new $e(n,e);case "ComponentInstanceNode":return new He(n,e);case "FrameNode":return new U(n,e);case "SVGNode":return new Ke(n,e);case "TextNode":return new ne(n,e);case "UnknownNode":return new _e(n,e);default:return new _e(n,e)}}r(I,"convertRawNodeDataToNode");function Et(n){return n instanceof U}r(Et,"isFrameNode");function zi(n){return n instanceof ne}r(zi,"isTextNode");function Gi(n){return n instanceof Ke}r(Gi,"isSVGNode");function ge(n){return n instanceof He}r(ge,"isComponentInstanceNode");function Ki(n){return n instanceof ie}r(Ki,"isWebPageNode");function $i(n){return n instanceof re}r($i,"isComponentNode");function Hi(n){return n instanceof oe}r(Hi,"isDesignPageNode");function ji(n){return n instanceof je}r(ji,"isVectorSetNode");function _i(n){return n instanceof $e}r(_i,"isVectorSetItemNode");function te(n){return n instanceof _e}r(te,"isUnknownNode");function qe(n){return !!(Et(n)||zi(n)||ge(n)||Gi(n)||_i(n)||te(n))}r(qe,"isCanvasNode");function fn(n){return !!(Ki(n)||Hi(n)||$i(n)||ji(n)||te(n))}r(fn,"isCanvasRootNode");var Ye=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 kt(t,this.#e))}},kt=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 Xe=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},q=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function Lo(n){return n.type==="separator"}r(Lo,"isSeparatorMenuItem");function Mt(n,e){let t=[];for(let i of n){if(Lo(i)){t.push(i);continue}let{onAction:o,...a}=i,s=a;if(i.onAction){let d=Math.random();e.set(d,i.onAction),s.actionId=d;}i.submenu&&(s.submenu=Mt(i.submenu,e)),t.push(s);}return t}r(Mt,"addMenuItemsToOnActionCallbackMap");var At="type",qi={[At]:"pluginReadySignal"},Bo="pluginReadyResponse";var Uo={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function Yi(n){return v(n)&&f(n[At])&&n[At]in Uo}r(Yi,"isVekterToPluginNonHandshakeMessage");function Xi(n){return v(n)&&n[At]===Bo}r(Xi,"isPluginReadyResponse");var yn=Symbol(),hn=Symbol(),bn=Symbol(),xn=Symbol(),Cn=Symbol(),In=Symbol(),Tn=Symbol(),W={publish:yn,getDeployments:hn,deploy:bn,getChangedPaths:xn,getChangeContributors:Cn,createManagedCollection:In,rejectAllPending:Tn};function Pn(n){return typeof n=="string"&&n in W}r(Pn,"isFramerApiOnlyMethod");var Oo=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions","lintCode"],zo=["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",mt,gt,de,"getAiServiceInfo","sendTrackingEvent",...Oo];new Set(zo);var Sn={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":[ue],"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"],[Gt]:[],[Kt]:[],[$t]:[],[Ht]:[],[yn]:["publish"],[hn]:[],[bn]:["deploy"],[xn]:[],[Cn]:[],[In]:["createManagedCollection"],[Tn]:[]},wt=[];for(let n of Object.keys(Sn))Sn[n].length!==0&&wt.push(n);S(wt);function Fn(n){let e={};for(let t of wt){let i=Sn[t];e[t]=i.every(o=>n[o]);}return e}r(Fn,"createPerMethodPermissionMap");function Zi(){let n={};for(let e of wt)n[e]=true;return n}r(Zi,"createPerMethodPermissionMapForTesting");var fe=null;function Ji(n){if(typeof window>"u")return;if(!fe){let t=document.createElement("style");document.head.appendChild(t),fe=t.sheet;}if(!fe){n();return}let e=fe.insertRule("* { transition: none !important; animation: none !important; }");n(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{fe&&fe.deleteRule(e);});});}r(Ji,"withDisabledCssTransitions");var Ze=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,i]of this.methodResponseHandlers)i.reject(e),this.methodResponseHandlers.delete(t);}constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=Zi(),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=Fn(e.permissionMap),this.postMessage=(t,i)=>e.transport.send(t,i),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:ct(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...i){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:i.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 i=this.subscriptions.get(e)??new Set;return i.add(t),this.subscriptions.set(e,i),()=>{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(Yi(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Fn(t.permissionMap);for(let i of this.permissionSubscriptions)i();break}case "methodResponse":{let i=this.methodResponseHandlers.get(t.id);if(!i)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),f(t.error)?i.reject(new Xe(t.error)):i.resolve(t.result);break}case "subscriptionMessage":{let{topic:i,payload:o}=t,a=this.subscriptions.get(i);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let i=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!i)throw new Error("Menu action received for an unknown menu item");i();break}default:ct(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:ct(t);}}applyPluginTheme=e=>{Ji(()=>{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 i=await this.invoke("setAttributes",e,t);return i?I(i,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(i=>{let o=I(i,this);return p(qe(o)),o})}notify=(e,t)=>{let i=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:i,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",i)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=Mt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let i=Mt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",i,t);}};function Go(n){return n.type==="component"}r(Go,"isCodeFileComponentExport");function Ko(n){return n.type==="override"}r(Ko,"isCodeFileOverrideExport");var Dn=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 n{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 n(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new n(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 Dn(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 Vt=class n{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 n(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let i=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!i)return null;let o=I(i,this.#t);return p(ge(o)),o}};var $o=(()=>{let n=null;return {disableUntilMouseUp:()=>{if(n)return;n=document.createElement("style"),n.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(n);let e=r(()=>{n&&(document.head.removeChild(n),n=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),i=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",i);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",i);}r(o,"cleanup");}}})(),Qi=5,Ho=(()=>{let n=1;return {next:()=>`drag-${n++}`}})();function jo(){}r(jo,"noop");function er(n,e,t,i){if(n.mode!=="canvas")return jo;let o=Ho.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,b=ae.subscribeToIsAllowedTo("makeDraggable",m=>{m||T();}),C=r(m=>{ae.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&n.invoke("onDragEnd",{...m,dragSessionId:o}).then(g=>{try{i?.(g);}catch{}}).catch(g=>{if(g instanceof Error){i?.({status:"error",reason:g.message});return}if(typeof g=="string"){i?.({status:"error",reason:g});return}i?.({status:"error"});}),T());},"endDrag"),F=r(m=>{if(!ae.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(m.buttons>0&&!!(m.buttons&1))){C({cancelled:false});return}let{clientX:M,clientY:K}=m;if(s.type==="pointerDown"){let J=M-s.dragStart.mouse.x,P=K-s.dragStart.mouse.y;if(Math.abs(J)<Qi&&Math.abs(P)<Qi)return;s={type:"dragging",dragStart:s.dragStart},n.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),$o.disableUntilMouseUp();}d.setPointerCapture(m.pointerId);let E={x:M,y:K};n.invoke("onDrag",{dragSessionId:o,mouse:E}).then(J=>{s.type==="dragging"&&(document.body.style.cursor=J??"");});},"handlePointerChange"),G=r(m=>{m.key==="Escape"&&C({cancelled:true});},"handleKeyDown"),xe=r(()=>{C({cancelled:true});},"handleBlur"),y=r(m=>{if(!ae.isAllowedTo("makeDraggable"))return;C({cancelled:true});let g=e.getBoundingClientRect(),M={x:g.x,y:g.y,width:g.width,height:g.height},K,E=e.querySelectorAll("svg");if(E.length===1){let lt=E.item(0).getBoundingClientRect();K={x:lt.x,y:lt.y,width:lt.width,height:lt.height};}let J={x:m.clientX,y:m.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:M,svgRect:K,mouse:J}},n.invoke("setDragData",o,t()),d.addEventListener("pointermove",F,true),d.addEventListener("pointerup",F,true),window.addEventListener("keydown",G,true),window.addEventListener("blur",xe);},"handlePointerDown"),u=r(()=>{if(!ae.isAllowedTo("makeDraggable"))return;let m=t();m.type==="detachedComponentLayers"&&n.invoke("preloadDetachedComponentLayers",m.url),m.type==="image"&&n.invoke("preloadImageUrlForInsertion",m.image),m.previewImage&&n.invoke("preloadDragPreviewImage",m.previewImage);},"preload");e.addEventListener("pointerdown",y),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",xe);}return r(T,"dragCleanup"),()=>{e.removeEventListener("pointerdown",y),e.removeEventListener("mouseenter",u),C({cancelled:true}),b();}}r(er,"makeDraggable");var ye=class n{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},[i]=await this.#t.invoke("addRedirects",[t]);return p(dt(i)),x(i)?null:new n(i,this.#t)}};var vn=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,i]=jn(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,i(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 i=I(t,this.#e);return p(qe(i)),i})}async setSelection(e){let t=f(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let i=t.map(o=>{let a=I(o,this.#e);return p(qe(a)),a});e(i);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=I(e,this.#e);return p(fn(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let i=I(t,this.#e);p(fn(i)),e(i);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let i=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!i)return null;let o=I(i,this.#e);return p(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?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 i=f(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",i,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,i){return this.#e.invoke("setParent",e,t,i)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(i=>I(i,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(i=>I(i,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(i=>I(i,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 Le(e),i=_(t);return this.#e.invokeTransferable("addImage",i,t)}async setImage(e){let t=await Le(e),i=_(t);return this.#e.invokeTransferable("setImage",i,t)}async uploadImage(e){let t=await Le(e),i=_(t),o=await this.#e.invokeTransferable("uploadImage",i,t);return h(this.#e,o)}async addImages(e){let t=await cn(e),i=t.flatMap(_);await this.#e.invokeTransferable("addImages",i,t);}async uploadImages(e){let t=await cn(e),i=t.flatMap(_),o=await this.#e.invokeTransferable("uploadImages",i,t);return h(this.#e,o)}async uploadFile(e){let t=await un(e),i=await this.#e.invokeTransferable("uploadFile",_(t),t);return h(this.#e,i)}async uploadFiles(e){let t=await Promise.all(e.map(un)),i=t.flatMap(_),o=await this.#e.invokeTransferable("uploadFiles",i,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:i}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:i}),a=I(o,this.#e);return p(ge(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:i}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:i}),a=I(o,this.#e);return p(Et(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,i){return er(this.#e,e,t,i)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return p(e,"Collection data must be defined"),new me(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return p(e,"Collections data must be defined"),e.map(t=>new me(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new ee(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new ee(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new ee(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 i=h(this.#e,t);return e(i)})}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 i=h(this.#e,t);return e(i)})}async getFont(e,t){let i=await this.#e.invoke("getFont",e,t);return i?h(this.#e,i):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 ye(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let i=t.map(o=>new ye(o,this.#e));return e(i)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(i=>new ye(i,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,i){let o=await this.#e.invoke("createCodeFile",e,t,i);return new Y(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let i of e)t.push(new Y(i,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,i){return Promise.resolve([])}typecheckCode(e,t,i,o){return this.#e.invoke("typecheckCode",e,t,i,o)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let i=t?.map(o=>new Y(o,this.#e));return e(i)})}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 i=t?new Y(t,this.#e):null;return e(i)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),i=I(t,this.#e);return p(i instanceof oe,"Expected node to be a DesignPageNode"),i}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),i=I(t,this.#e);return p(i instanceof ie,"Expected node to be a WebPageNode"),i}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new ee(t,this.#e)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new me(t,this.#e)}async setCloseWarning(e){return this.#e.invoke("setCloseWarning",e)}get[l.initialState](){return this.#e.initialState}},Nn=class extends vn{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},Je=class extends Nn{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 Vt(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(mt)}async[l.sendTrackingEvent](e,t,i){return this.#e.invoke(gt,e,t,i)}async[l.getHTMLForNode](e){return this.#e.invoke(de,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(ue,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 i=await this.#e.invoke("createNode","TextNode",t??null,e);if(!i)return null;let o=I(i,this.#e);return p(o instanceof ne),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let i=I(t,this.#e);return p(i instanceof re),i}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new Ye(t,this.#e))}async[W.publish](){return this.#e.invoke("publish")}async[W.getDeployments](){return this.#e.invoke("getDeployments")}async[W.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[W.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[W.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[W.createManagedCollection](e){return this.createManagedCollection(e)}[W.rejectAllPending](e){this.#e.rejectAllPending(e);}};var En=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 _o(){return new Promise(n=>{function e({data:t,origin:i}){if(!Xi(t))return;window.removeEventListener("message",e);let a={transport:new En(i),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:i,theme:t.theme??null,initialState:t.initialState};n(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(qi,"*");})}r(_o,"createBrowserContext");async function qo(){return typeof window<"u"?_o():null}r(qo,"bootstrap");var tr=await qo(),ae=tr?new Je(new Ze(tr)):new Proxy({},{get(n,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function nr(n){return new Je(new Ze(n))}r(nr,"createFramerInstance");var ir=process$1.env;function Zo(n){Object.assign(ir,n);}r(Zo,"configure");function he(n,e){let t=ir[n];return t&&t.length>0?t:e}r(he,"getEnv");var rr=isWorkerd,or=globalThis.WebSocket;async function ar(n,e){let t=new URL(n.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(ar,"connectWebSocketCF");var sr,lr;try{sr=await import('node:fs'),lr=await import('node:path');}catch{}var kn=sr,Mn=lr;var se=(b=>(b.PROJECT_CLOSED="PROJECT_CLOSED",b.POOL_EXHAUSTED="POOL_EXHAUSTED",b.TIMEOUT="TIMEOUT",b.INTERNAL="INTERNAL",b.NODE_NOT_FOUND="NODE_NOT_FOUND",b.SCREENSHOT_TOO_LARGE="SCREENSHOT_TOO_LARGE",b.INVALID_REQUEST="INVALID_REQUEST",b.UNAUTHORIZED="UNAUTHORIZED",b))(se||{}),D=class extends Error{static{r(this,"FramerAPIError");}code;constructor(e,t){super(e),this.name="FramerAPIError",this.code=t,this.stack=undefined;}};function Jo(n){return n instanceof D?n.code==="POOL_EXHAUSTED":false}r(Jo,"isRetryableError");var Qo=new Map(Object.values(se).map(n=>[n,n]));function dr(n){return typeof n=="string"?Qo.get(n)??"INTERNAL":"INTERNAL"}r(dr,"parseErrorCode");var An={silent:0,error:1,warn:2,info:3,debug:4};function ea(){let n=he("FRAMER_API_LOG_LEVEL")?.toLowerCase();return n&&n in An?n:"warn"}r(ea,"getLogLevel");var wn=ea();function Qe(n){return An[n]<=An[wn]}r(Qe,"shouldLog");var et=globalThis.console,ta="\x1B[90m",na="\x1B[0m";function ia(n){return n?`[FramerAPI:${n}]`:"[FramerAPI]"}r(ia,"formatPrefix");function ra(n,...e){return [ta+n,...e,na]}r(ra,"formatDebug");function ur(n){let e=ia(n);return {warn:(...t)=>{Qe("warn")&&et.warn(e,...t);},error:(...t)=>{Qe("error")&&et.error(e,...t);},log:(...t)=>{Qe("info")&&et.log(e,...t);},info:(...t)=>{Qe("info")&&et.info(e,...t);},debug:(...t)=>{Qe("debug")&&et.debug(...ra(e,...t));},setLevel:t=>{wn=t;},getLevel:()=>wn,withRequestId:t=>ur(t)}}r(ur,"createLogger");var N=ur();N.warn;N.error;N.log;N.info;N.debug;N.setLevel;N.getLevel;function X(n,...e){if(n)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let i=t.stack.split(`
8
+ `));}catch{}throw t}r(p,"assert");function S(n){for(let e of Reflect.ownKeys(n)){let t=n[e];!t||typeof t!="object"&&!wr(t)||S(t);}return Object.freeze(n)}r(S,"deepFreeze");function jn(n){return [n.slice(0,-1),n.at(-1)]}r(jn,"splitRestAndLast");var c="__class";var Gt=Symbol(),Kt=Symbol(),Vr=Symbol(),Wr=Symbol(),Lr=Symbol(),Rr=Symbol(),Br=Symbol(),$t=Symbol(),Ht=Symbol(),l={getAiServiceInfo:Gt,sendTrackingEvent:Kt,environmentInfo:Vr,initialState:Wr,showUncheckedPermissionToasts:Lr,marshal:Rr,unmarshal:Br,getHTMLForNode:$t,setHTMLForNode:Ht},pt="INTERNAL_",mt=`${pt}getAiServiceInfo`,gt=`${pt}sendTrackingEvent`,de=`${pt}getHTMLForNode`,ue=`${pt}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 i=this.constructor;return new i(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},A="Variable";function w(n){let e=n.at(0);return p(!$n(e)),`${e.toLowerCase()}${n.slice(1,-A.length)}`}r(w,"classToType");var Ur=`Boolean${A}`,Or=w(Ur),Ie=class n extends k{static{r(this,"BooleanVariable");}type=Or;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},zr=`Number${A}`,Gr=w(zr),Te=class n extends k{static{r(this,"NumberVariable");}type=Gr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Kr=`String${A}`,$r=w(Kr),Pe=class n extends k{static{r(this,"StringVariable");}type=$r;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Hr=`FormattedText${A}`,jr=w(Hr),Se=class n extends k{static{r(this,"FormattedTextVariable");}type=jr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},_r=`Enum${A}`,qr=w(_r),H=class n{static{r(this,"EnumCase");}#e;#t;#n;#i;get id(){return this.#i.id}get name(){return this.#i.name}get nameByLocale(){return this.#i.nameByLocale}constructor(e,t,i,o){this.#e=e,this.#t=t,this.#n=i,this.#i=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#n,this.id,e);return t?new n(this.#e,this.#t,this.#n,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#n,this.id);}},Fe=class n extends k{static{r(this,"EnumVariable");}type=qr;#e;#t;#n;get cases(){return this.#n||(this.#n=S(this.#t.cases.map(e=>new H(this.#e,this.nodeId,this.id,e)))),this.#n}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new n(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);}},Yr=`Color${A}`,Xr=w(Yr),De=class n extends k{static{r(this,"ColorVariable");}type=Xr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Zr=`Image${A}`,Jr=w(Zr),ve=class n extends k{static{r(this,"ImageVariable");}type=Jr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},Qr=`File${A}`,eo=w(Qr),Ne=class n extends k{static{r(this,"FileVariable");}type=eo;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},to=`Link${A}`,no=w(to),Ee=class n extends k{static{r(this,"LinkVariable");}type=no;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},io=`Date${A}`,ro=w(io),ke=class n extends k{static{r(this,"DateVariable");}type=ro;#e;get displayTime(){return this.#e.displayTime}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},oo=`Border${A}`,ao=w(oo),Me=class n extends k{static{r(this,"BorderVariable");}type=ao;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}},so=`Unsupported${A}`,lo=w(so),Ae=class n extends k{static{r(this,"UnsupportedVariable");}type=lo;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new n(e,t)}[l.marshal](){return this.#e}};function _n(n){return n instanceof k}r(_n,"isVariable");function uo(n){return _n(n)&&n.nodeType==="component"}r(uo,"isComponentVariable");var R=class{static{r(this,"FieldBase");}#e;#t;#n;get id(){return this.#n.id}get name(){return this.#n.name}constructor(e,t,i){this.#e=e,this.#t=t,this.#n=i;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[i]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(p(dt(i)),x(i))return null;p(i.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,i)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},L=class extends R{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,i){super(e,t,i),this.#e=i;}},ft=class extends R{static{r(this,"BooleanField");}type=qt},yt=class extends R{static{r(this,"ColorField");}type=Yt},ht=class extends R{static{r(this,"NumberField");}type=Xt},bt=class extends L{static{r(this,"StringField");}type=Zt;#e;constructor(e,t,i){super(e,t,i),this.#e=i;}get basedOn(){return this.#e.basedOn}},xt=class extends L{static{r(this,"FormattedTextField");}type=Jt},we=class extends L{static{r(this,"ImageField");}type=Qt},Ct=class extends L{static{r(this,"LinkField");}type=tn},It=class extends L{static{r(this,"DateField");}type=nn;#e;get displayTime(){return this.#e.displayTime}constructor(e,t,i){super(e,t,i),this.#e=i;}},Tt=class extends R{static{r(this,"FieldDivider");}type=ln},Ve=class extends R{static{r(this,"UnsupportedField");}type=dn},Pt=class extends L{static{r(this,"FileField");}type=rn;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,i){super(e,t,i),this.#e=i;}},St=class extends R{static{r(this,"EnumField");}type=on;#e;#t;#n;#i;get cases(){return this.#i||(this.#i=this.#n.cases.map(e=>new H(this.#e,this.#t,this.id,e)),S(this.#i)),this.#i}constructor(e,t,i){super(e,t,i),this.#e=e,this.#t=t,this.#n=i;}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);}},Ft=class extends L{static{r(this,"CollectionReferenceField");}type=an;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},Dt=class extends L{static{r(this,"MultiCollectionReferenceField");}type=sn;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,i){super(e,t,i),this.#e=i;}},jt=class extends L{static{r(this,"ArrayField");}type=en;fields;constructor(e,t,i){super(e,t,i);let o=i.fields[0];this.fields=[new we(e,t,o)];}};function _t(n,e,t){return n.map(i=>{switch(i.type){case qt:return new ft(e,t,i);case Yt:return new yt(e,t,i);case Xt:return new ht(e,t,i);case Zt:return new bt(e,t,i);case Jt:return new xt(e,t,i);case Qt:return new we(e,t,i);case tn:return new Ct(e,t,i);case nn:return new It(e,t,i);case ln:return new Tt(e,t,i);case dn:return new Ve(e,t,i);case rn:return new Pt(e,t,i);case on:return new St(e,t,i);case an:return new Ft(e,t,i);case sn:return new Dt(e,t,i);case en:return new jt(e,t,i);default:return new Ve(e,t,i)}})}r(_t,"fieldDefinitionDataArrayToFieldClassInstances");function co(n){return n instanceof R}r(co,"isField");var qn="action";function po(n){return !!n&&qn in n&&f(n[qn])}r(po,"isLocalizedValueUpdate");function Yn(n){return Object.keys(n).reduce((e,t)=>{let i=n[t];return po(i)&&(e[t]=i),e},{})}r(Yn,"filterInlineLocalizationValues");var We=class n{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 n(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function mo(n){return n instanceof We}r(mo,"isFileAsset");var go="ImageAsset";function Xn(n){return v(n)?n[c]===go:false}r(Xn,"isImageAssetData");var j=class n{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 n(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 n(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return ho(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(),i=new Blob([t],{type:e});return createImageBitmap(i)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((i,o)=>{let a=new Image;a.onload=()=>i(a),a.onerror=()=>o(),a.src=t;})}};function fo(n){return n instanceof j}r(fo,"isImageAsset");function _(n){return n.type==="bytes"?[n.bytes.buffer]:[]}r(_,"getTransferable");function yo(n){if(!v(n))return false;let e="bytes",t="mimeType";return !(!(e in n)||!(t in n)||!(n[e]instanceof Uint8Array)||!f(n[t]))}r(yo,"isBytesData");async function Le(n){if(n instanceof File)return pn(n);let e=await Zn(n.image);return {name:n.name,altText:n.altText,resolution:n.resolution,preferredImageRendering:n.preferredImageRendering,...e}}r(Le,"createImageTransferFromInput");async function un(n){if(n instanceof File)return pn(n);let e=await Zn(n.file);return {name:n.name,...e}}r(un,"createFileTransferFromInput");async function Zn(n){return n instanceof File?pn(n):yo(n)?{type:"bytes",mimeType:n.mimeType,bytes:n.bytes}:{type:"url",url:n}}r(Zn,"createAssetTransferFromAssetInput");function cn(n){return Promise.all(n.map(Le))}r(cn,"createNamedAssetDataTransferFromInput");async function pn(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=o=>{let a=n.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:n.name});},i.onerror=o=>{t(o);},i.readAsArrayBuffer(n);})}r(pn,"getAssetDataFromFile");async function ho(n){let e=n instanceof File,t=e?URL.createObjectURL(n):n,i=new Image;return i.crossOrigin="anonymous",new Promise((o,a)=>{i.onload=()=>{o({width:i.naturalWidth,height:i.naturalHeight});},i.onerror=s=>{a(s);},i.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(ho,"measureImage");var vt=class{static{r(this,"ComputedValueBase");}};var bo="unsupported",Re=class n extends vt{static{r(this,"UnsupportedComputedValue");}type=bo;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new n(t)}[l.marshal](){return this.#e}};function xo(n){return n instanceof vt}r(xo,"isComputedValue");var Co="Font";function Qn(n){return v(n)&&n[c]===Co}r(Qn,"isFontData");function Io(n){if(!$(n))return false;switch(n){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(Io,"isFontWeight");function To(n){if(!f(n))return false;switch(n){case "normal":case "italic":return true;default:return false}}r(To,"isFontStyle");function ei(n){return v(n)?f(n.family)&&f(n.selector)&&Io(n.weight)&&To(n.style):false}r(ei,"isFont");var O=class n{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 i=Jn.get(t.selector);if(i)return i;let o=new n(t);return Jn.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Jn=new Map;var Po="LinearGradient",So="RadialGradient",Fo="ConicGradient",ce=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})}},Be=class n extends ce{static{r(this,"LinearGradient");}[c]=Po;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new n({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(p(f(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Ue=class n extends ce{static{r(this,"RadialGradient");}[c]=So;#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 n({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,i)=>{p(f(t.color),"ColorStyle not supported yet");let o=this.stops[i+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})`}},Oe=class n extends ce{static{r(this,"ConicGradient");}[c]=Fo;#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 n({...t,stops:h(e,t.stops)})}[l.marshal](){return B({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(p(f(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 ti(n){return n instanceof ce}r(ti,"isGradient");var Do="ColorStyle";function Nt(n){return v(n)?n[c]===Do:false}r(Nt,"isColorStyleData");var Q=class n{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 n(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 n(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 pe(n){return n instanceof Q}r(pe,"isColorStyle");var vo="TextStyle";function ni(n){return v(n)?n[c]===vo:false}r(ni,"isTextStyleData");var ze=class n{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=Nt(t.color)?Q[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Nt(t.decorationColor)?Q[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 n(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:pe(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:pe(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 n(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 mn(n){return n instanceof ze}r(mn,"isTextStyle");function No(n){return v(n)&&l.marshal in n}r(No,"isSelfMarshalable");function B(n){if(No(n))return n[l.marshal]();if(zt(n))return n.map(B);if(ut(n)){let e={};for(let t of Object.keys(n))e[t]=B(n[t]);return e}return n}r(B,"marshal");var ii={ColorStyle:Q,ConicGradient:Oe,FileAsset:We,Font:O,ImageAsset:j,LinearGradient:Be,RadialGradient:Ue,TextStyle:ze,BooleanVariable:Ie,BorderVariable:Me,ColorVariable:De,DateVariable:ke,EnumVariable:Fe,FileVariable:Ne,FormattedTextVariable:Se,ImageVariable:ve,LinkVariable:Ee,NumberVariable:Te,StringVariable:Pe,UnsupportedVariable:Ae,UnsupportedComputedValue:Re};function Eo(n){return ut(n)&&f(n[c])&&n[c]in ii}r(Eo,"isSelfUnmarshalable");function h(n,e){if(Eo(e))return ii[e[c]][l.unmarshal](n,e);if(zt(e))return e.map(t=>h(n,t));if(ut(e)){let t={};for(let i of Object.keys(e))t[i]=h(n,e[i]);return t}return e}r(h,"unmarshal");var ko={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 Mo(n){return ko[n]}r(Mo,"isSupportedArrayItemFieldType");function Ao(n){return Mo(n.type)}r(Ao,"isSupportedArrayItemFieldDataEntry");var qt="boolean",Yt="color",Xt="number",Zt="string",Jt="formattedText",Qt="image",en="array",tn="link",nn="date",rn="file",on="enum",an="collectionReference",sn="multiCollectionReference",ln="divider",dn="unsupported";function wo(n){return n.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(i=>{let o=i.nameByLocale?Yn(i.nameByLocale):undefined;return {...i,nameByLocale:o}});return {...e,cases:t}})}r(wo,"sanitizeEnumFieldForMessage");function ri(n,e){let t={};for(let i in n){let o=n[i];if(!o)continue;if(o.type!=="array"){t[i]=h(e,o);continue}let a=o.value.map(s=>{let d=ri(s.fieldData,e),b={};for(let C in d){let F=d[C];p(F&&Ao(F),"Unsupported array item field data entry"),b[C]=F;}return {...s,fieldData:b}});t[i]={...o,value:a};}return t}r(ri,"deserializeFieldData");var me=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,p(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=wo(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)}},ee=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 _t(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return p(t.every(Hn)),_t(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 Ge(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)}},Ge=class n{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let i=ri(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=i,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 n(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 Vo={fixed:true,sticky:true,absolute:true,relative:true},oi="position";function Bs(n){if(!(oi in n))return false;let e=n[oi];return f(e)&&Vo[e]===true}r(Bs,"supportsPosition");var ai="top";function Us(n){if(!(ai in n))return false;let e=n[ai];return f(e)||x(e)}r(Us,"supportsPins");var si="width";function Os(n){if(!(si in n))return false;let e=n[si];return f(e)||x(e)}r(Os,"supportsSize");var li="maxWidth";function zs(n){if(!(li in n))return false;let e=n[li];return f(e)||x(e)}r(zs,"supportsSizeConstraints");var di="aspectRatio";function Gs(n){if(!(di in n))return false;let e=n[di];return $(e)||x(e)}r(Gs,"supportsAspectRatio");var ui="name";function Ks(n){if(!(ui in n))return false;let e=n[ui];return f(e)||x(e)}r(Ks,"supportsName");var ci="visible";function $s(n){if(!(ci in n))return false;let e=n[ci];return Ce(e)}r($s,"supportsVisible");var pi="locked";function Hs(n){if(!(pi in n))return false;let e=n[pi];return Ce(e)}r(Hs,"supportsLocked");var mi="backgroundColor";function js(n){if(!(mi in n))return false;let e=n[mi];return f(e)||pe(e)||x(e)}r(js,"supportsBackgroundColor");var gi="backgroundColor";function _s(n){if(!(gi in n))return false;let e=n[gi];return f(e)||Nt(e)||x(e)}r(_s,"supportsBackgroundColorData");var fi="backgroundImage";function qs(n){if(!(fi in n))return false;let e=n[fi];return e instanceof j||x(e)}r(qs,"supportsBackgroundImage");var yi="backgroundImage";function Ys(n){if(!(yi in n))return false;let e=n[yi];return e instanceof j?false:Xn(e)||x(e)}r(Ys,"supportsBackgroundImageData");var hi="backgroundGradient";function Xs(n){if(!(hi in n))return false;let e=n[hi];return ti(e)||x(e)}r(Xs,"supportsBackgroundGradient");var bi="backgroundGradient";function Zs(n){if(!(bi in n))return false;let e=n[bi];return v(e)||x(e)}r(Zs,"supportsBackgroundGradientData");var xi="rotation";function Js(n){if(!(xi in n))return false;let e=n[xi];return $(e)}r(Js,"supportsRotation");var Ci="opacity";function Qs(n){if(!(Ci in n))return false;let e=n[Ci];return $(e)}r(Qs,"supportsOpacity");var Ii="borderRadius";function el(n){if(!(Ii in n))return false;let e=n[Ii];return f(e)||x(e)}r(el,"supportsBorderRadius");var Ti="border";function tl(n){if(!(Ti in n))return false;let e=n[Ti];return x(e)||pe(e.color)}r(tl,"supportsBorder");var Pi="svg";function nl(n){if(!(Pi in n))return false;let e=n[Pi];return f(e)}r(nl,"supportsSVG");var Si="textTruncation";function il(n){if(!(Si in n))return false;let e=n[Si];return $(e)||x(e)}r(il,"supportsTextTruncation");var Fi="zIndex";function rl(n){if(!(Fi in n))return false;let e=n[Fi];return $(e)||x(e)}r(rl,"supportsZIndex");var Di="overflow";function ol(n){if(!(Di in n))return false;let e=n[Di];return f(e)||x(e)}r(ol,"supportsOverflow");var vi="componentIdentifier";function al(n){if(!(vi in n))return false;let e=n[vi];return f(e)}r(al,"supportsComponentInfo");var Ni="font";function sl(n){if(!(Ni in n))return false;let e=n[Ni];return ei(e)}r(sl,"supportsFont");var Ei="font";function ll(n){if(!(Ei in n))return false;let e=n[Ei];return Qn(e)||x(e)}r(ll,"supportsFontData");var ki="inlineTextStyle";function dl(n){if(!(ki in n))return false;let e=n[ki];return mn(e)||x(e)}r(dl,"supportsInlineTextStyle");var Mi="inlineTextStyle";function ul(n){if(!(Mi in n))return false;let e=n[Mi];return ni(e)||x(e)}r(ul,"supportsInlineTextStyleData");var Ai="link";function cl(n){if(!(Ai in n))return false;let e=n[Ai];return f(e)||x(e)}r(cl,"supportsLink");var wi="imageRendering";function pl(n){if(!(wi in n))return false;let e=n[wi];return f(e)||x(e)}r(pl,"supportsImageRendering");var Vi="layout";function Ri(n){if(!(Vi in n))return false;let e=n[Vi];return f(e)||x(e)}r(Ri,"supportsLayout");function ml(n){return Ri(n)?n.layout==="stack":false}r(ml,"hasStackLayout");function gl(n){return Ri(n)?n.layout==="grid":false}r(gl,"hasGridLayout");var Wi="isVariant";function Bi(n){if(!(Wi in n))return false;let e=n[Wi];return Ce(e)}r(Bi,"supportsComponentVariant");function gn(n){return Bi(n)?n.isVariant:false}r(gn,"isComponentVariant");function Ui(n){return !Bi(n)||!gn(n)?false:!x(n.gesture)}r(Ui,"isComponentGestureVariant");var Li="isBreakpoint";function Wo(n){if(!(Li in n))return false;let e=n[Li];return Ce(e)}r(Wo,"supportsBreakpoint");function Oi(n){return Wo(n)?n.isBreakpoint:false}r(Oi,"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 te(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return te(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(i=>I(i,this.#e))}async getNodesWithAttribute(e){return te(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(i=>I(i,this.#e))}async getNodesWithAttributeSet(e){return te(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(i=>I(i,this.#e))}async*walk(){if(yield this,!te(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);}},ne=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(ue,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(de,this.id)}},Ke=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);}},$e=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)}},He=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;#n;get typedControls(){return this.#n||(this.#n=h(this.#e,this.#t.typedControls)??{}),this.#n}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 i=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=I(i,this.#e);return p(o instanceof U),p(Oi(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Ge(e,this.#e):null}},re=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 i=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!i)throw new Error("Failed to add variant to component");let o=I(i,this.#e);return p(o instanceof U),p(gn(o),"Node is not a component variant"),o}async addGestureVariant(e,t,i){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,i);if(!o)throw new Error("Failed to add state to component");let a=I(o,this.#e);return p(a instanceof U),p(Ui(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);}},je=class extends V{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},oe=class extends V{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},_e=class extends V{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),S(this);}};function I(n,e){switch(n[c]){case "DesignPageNode":return new oe(n,e);case "WebPageNode":return new ie(n,e);case "ComponentNode":return new re(n,e);case "VectorSetNode":return new je(n,e);case "VectorSetItemNode":return new $e(n,e);case "ComponentInstanceNode":return new He(n,e);case "FrameNode":return new U(n,e);case "SVGNode":return new Ke(n,e);case "TextNode":return new ne(n,e);case "UnknownNode":return new _e(n,e);default:return new _e(n,e)}}r(I,"convertRawNodeDataToNode");function Et(n){return n instanceof U}r(Et,"isFrameNode");function zi(n){return n instanceof ne}r(zi,"isTextNode");function Gi(n){return n instanceof Ke}r(Gi,"isSVGNode");function ge(n){return n instanceof He}r(ge,"isComponentInstanceNode");function Ki(n){return n instanceof ie}r(Ki,"isWebPageNode");function $i(n){return n instanceof re}r($i,"isComponentNode");function Hi(n){return n instanceof oe}r(Hi,"isDesignPageNode");function ji(n){return n instanceof je}r(ji,"isVectorSetNode");function _i(n){return n instanceof $e}r(_i,"isVectorSetItemNode");function te(n){return n instanceof _e}r(te,"isUnknownNode");function qe(n){return !!(Et(n)||zi(n)||ge(n)||Gi(n)||_i(n)||te(n))}r(qe,"isCanvasNode");function fn(n){return !!(Ki(n)||Hi(n)||$i(n)||ji(n)||te(n))}r(fn,"isCanvasRootNode");var Ye=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 kt(t,this.#e))}},kt=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 Xe=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},q=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function Lo(n){return n.type==="separator"}r(Lo,"isSeparatorMenuItem");function Mt(n,e){let t=[];for(let i of n){if(Lo(i)){t.push(i);continue}let{onAction:o,...a}=i,s=a;if(i.onAction){let d=Math.random();e.set(d,i.onAction),s.actionId=d;}i.submenu&&(s.submenu=Mt(i.submenu,e)),t.push(s);}return t}r(Mt,"addMenuItemsToOnActionCallbackMap");var At="type",qi={[At]:"pluginReadySignal"},Bo="pluginReadyResponse";var Uo={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function Yi(n){return v(n)&&f(n[At])&&n[At]in Uo}r(Yi,"isVekterToPluginNonHandshakeMessage");function Xi(n){return v(n)&&n[At]===Bo}r(Xi,"isPluginReadyResponse");var yn=Symbol(),hn=Symbol(),bn=Symbol(),xn=Symbol(),Cn=Symbol(),In=Symbol(),Tn=Symbol(),W={publish:yn,getDeployments:hn,deploy:bn,getChangedPaths:xn,getChangeContributors:Cn,createManagedCollection:In,rejectAllPending:Tn};function Pn(n){return typeof n=="string"&&n in W}r(Pn,"isFramerApiOnlyMethod");var Oo=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions","lintCode"],zo=["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","getLocaleLanguages","getLocaleRegions","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",mt,gt,de,"getAiServiceInfo","sendTrackingEvent",...Oo];new Set(zo);var Sn={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"],createLocale:["createLocale"],getLocaleLanguages:[],getLocaleRegions:[],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":[ue],"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"],[Gt]:[],[Kt]:[],[$t]:[],[Ht]:[],[yn]:["publish"],[hn]:[],[bn]:["deploy"],[xn]:[],[Cn]:[],[In]:["createManagedCollection"],[Tn]:[]},wt=[];for(let n of Object.keys(Sn))Sn[n].length!==0&&wt.push(n);S(wt);function Fn(n){let e={};for(let t of wt){let i=Sn[t];e[t]=i.every(o=>n[o]);}return e}r(Fn,"createPerMethodPermissionMap");function Zi(){let n={};for(let e of wt)n[e]=true;return n}r(Zi,"createPerMethodPermissionMapForTesting");var fe=null;function Ji(n){if(typeof window>"u")return;if(!fe){let t=document.createElement("style");document.head.appendChild(t),fe=t.sheet;}if(!fe){n();return}let e=fe.insertRule("* { transition: none !important; animation: none !important; }");n(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{fe&&fe.deleteRule(e);});});}r(Ji,"withDisabledCssTransitions");var Ze=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,i]of this.methodResponseHandlers)i.reject(e),this.methodResponseHandlers.delete(t);}constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=Zi(),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=Fn(e.permissionMap),this.postMessage=(t,i)=>e.transport.send(t,i),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:ct(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...i){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:i.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 i=this.subscriptions.get(e)??new Set;return i.add(t),this.subscriptions.set(e,i),()=>{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(Yi(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Fn(t.permissionMap);for(let i of this.permissionSubscriptions)i();break}case "methodResponse":{let i=this.methodResponseHandlers.get(t.id);if(!i)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),f(t.error)?i.reject(new Xe(t.error)):i.resolve(t.result);break}case "subscriptionMessage":{let{topic:i,payload:o}=t,a=this.subscriptions.get(i);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let i=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!i)throw new Error("Menu action received for an unknown menu item");i();break}default:ct(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:ct(t);}}applyPluginTheme=e=>{Ji(()=>{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 i=await this.invoke("setAttributes",e,t);return i?I(i,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(i=>{let o=I(i,this);return p(qe(o)),o})}notify=(e,t)=>{let i=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:i,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",i)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=Mt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let i=Mt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",i,t);}};function Go(n){return n.type==="component"}r(Go,"isCodeFileComponentExport");function Ko(n){return n.type==="override"}r(Ko,"isCodeFileOverrideExport");var Dn=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 n{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 n(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new n(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 Dn(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 Vt=class n{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 n(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let i=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!i)return null;let o=I(i,this.#t);return p(ge(o)),o}};var $o=(()=>{let n=null;return {disableUntilMouseUp:()=>{if(n)return;n=document.createElement("style"),n.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(n);let e=r(()=>{n&&(document.head.removeChild(n),n=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),i=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",i);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",i);}r(o,"cleanup");}}})(),Qi=5,Ho=(()=>{let n=1;return {next:()=>`drag-${n++}`}})();function jo(){}r(jo,"noop");function er(n,e,t,i){if(n.mode!=="canvas")return jo;let o=Ho.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,b=ae.subscribeToIsAllowedTo("makeDraggable",m=>{m||T();}),C=r(m=>{ae.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&n.invoke("onDragEnd",{...m,dragSessionId:o}).then(g=>{try{i?.(g);}catch{}}).catch(g=>{if(g instanceof Error){i?.({status:"error",reason:g.message});return}if(typeof g=="string"){i?.({status:"error",reason:g});return}i?.({status:"error"});}),T());},"endDrag"),F=r(m=>{if(!ae.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(m.buttons>0&&!!(m.buttons&1))){C({cancelled:false});return}let{clientX:M,clientY:K}=m;if(s.type==="pointerDown"){let J=M-s.dragStart.mouse.x,P=K-s.dragStart.mouse.y;if(Math.abs(J)<Qi&&Math.abs(P)<Qi)return;s={type:"dragging",dragStart:s.dragStart},n.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),$o.disableUntilMouseUp();}d.setPointerCapture(m.pointerId);let E={x:M,y:K};n.invoke("onDrag",{dragSessionId:o,mouse:E}).then(J=>{s.type==="dragging"&&(document.body.style.cursor=J??"");});},"handlePointerChange"),G=r(m=>{m.key==="Escape"&&C({cancelled:true});},"handleKeyDown"),xe=r(()=>{C({cancelled:true});},"handleBlur"),y=r(m=>{if(!ae.isAllowedTo("makeDraggable"))return;C({cancelled:true});let g=e.getBoundingClientRect(),M={x:g.x,y:g.y,width:g.width,height:g.height},K,E=e.querySelectorAll("svg");if(E.length===1){let lt=E.item(0).getBoundingClientRect();K={x:lt.x,y:lt.y,width:lt.width,height:lt.height};}let J={x:m.clientX,y:m.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:M,svgRect:K,mouse:J}},n.invoke("setDragData",o,t()),d.addEventListener("pointermove",F,true),d.addEventListener("pointerup",F,true),window.addEventListener("keydown",G,true),window.addEventListener("blur",xe);},"handlePointerDown"),u=r(()=>{if(!ae.isAllowedTo("makeDraggable"))return;let m=t();m.type==="detachedComponentLayers"&&n.invoke("preloadDetachedComponentLayers",m.url),m.type==="image"&&n.invoke("preloadImageUrlForInsertion",m.image),m.previewImage&&n.invoke("preloadDragPreviewImage",m.previewImage);},"preload");e.addEventListener("pointerdown",y),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",xe);}return r(T,"dragCleanup"),()=>{e.removeEventListener("pointerdown",y),e.removeEventListener("mouseenter",u),C({cancelled:true}),b();}}r(er,"makeDraggable");var ye=class n{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},[i]=await this.#t.invoke("addRedirects",[t]);return p(dt(i)),x(i)?null:new n(i,this.#t)}};var vn=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,i]=jn(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,i(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 i=I(t,this.#e);return p(qe(i)),i})}async setSelection(e){let t=f(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let i=t.map(o=>{let a=I(o,this.#e);return p(qe(a)),a});e(i);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=I(e,this.#e);return p(fn(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let i=I(t,this.#e);p(fn(i)),e(i);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let i=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!i)return null;let o=I(i,this.#e);return p(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?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 i=f(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",i,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,i){return this.#e.invoke("setParent",e,t,i)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(i=>I(i,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(i=>I(i,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(i=>I(i,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 Le(e),i=_(t);return this.#e.invokeTransferable("addImage",i,t)}async setImage(e){let t=await Le(e),i=_(t);return this.#e.invokeTransferable("setImage",i,t)}async uploadImage(e){let t=await Le(e),i=_(t),o=await this.#e.invokeTransferable("uploadImage",i,t);return h(this.#e,o)}async addImages(e){let t=await cn(e),i=t.flatMap(_);await this.#e.invokeTransferable("addImages",i,t);}async uploadImages(e){let t=await cn(e),i=t.flatMap(_),o=await this.#e.invokeTransferable("uploadImages",i,t);return h(this.#e,o)}async uploadFile(e){let t=await un(e),i=await this.#e.invokeTransferable("uploadFile",_(t),t);return h(this.#e,i)}async uploadFiles(e){let t=await Promise.all(e.map(un)),i=t.flatMap(_),o=await this.#e.invokeTransferable("uploadFiles",i,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:i}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:i}),a=I(o,this.#e);return p(ge(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:i}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:i}),a=I(o,this.#e);return p(Et(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,i){return er(this.#e,e,t,i)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return p(e,"Collection data must be defined"),new me(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return p(e,"Collections data must be defined"),e.map(t=>new me(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new ee(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new ee(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new ee(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 i=h(this.#e,t);return e(i)})}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 i=h(this.#e,t);return e(i)})}async getFont(e,t){let i=await this.#e.invoke("getFont",e,t);return i?h(this.#e,i):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 ye(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let i=t.map(o=>new ye(o,this.#e));return e(i)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(i=>new ye(i,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,i){let o=await this.#e.invoke("createCodeFile",e,t,i);return new Y(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let i of e)t.push(new Y(i,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,i){return Promise.resolve([])}typecheckCode(e,t,i,o){return this.#e.invoke("typecheckCode",e,t,i,o)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let i=t?.map(o=>new Y(o,this.#e));return e(i)})}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 i=t?new Y(t,this.#e):null;return e(i)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),i=I(t,this.#e);return p(i instanceof oe,"Expected node to be a DesignPageNode"),i}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),i=I(t,this.#e);return p(i instanceof ie,"Expected node to be a WebPageNode"),i}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new ee(t,this.#e)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new me(t,this.#e)}async setCloseWarning(e){return this.#e.invoke("setCloseWarning",e)}get[l.initialState](){return this.#e.initialState}},Nn=class extends vn{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},Je=class extends Nn{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 Vt(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(mt)}async[l.sendTrackingEvent](e,t,i){return this.#e.invoke(gt,e,t,i)}async[l.getHTMLForNode](e){return this.#e.invoke(de,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(ue,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 i=await this.#e.invoke("createNode","TextNode",t??null,e);if(!i)return null;let o=I(i,this.#e);return p(o instanceof ne),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let i=I(t,this.#e);return p(i instanceof re),i}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new Ye(t,this.#e))}async createLocale(e){return this.#e.invoke("createLocale",e)}async getLocaleLanguages(){return this.#e.invoke("getLocaleLanguages")}async getLocaleRegions(e){return this.#e.invoke("getLocaleRegions",e)}async[W.publish](){return this.#e.invoke("publish")}async[W.getDeployments](){return this.#e.invoke("getDeployments")}async[W.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[W.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[W.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[W.createManagedCollection](e){return this.createManagedCollection(e)}[W.rejectAllPending](e){this.#e.rejectAllPending(e);}};var En=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 _o(){return new Promise(n=>{function e({data:t,origin:i}){if(!Xi(t))return;window.removeEventListener("message",e);let a={transport:new En(i),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:i,theme:t.theme??null,initialState:t.initialState};n(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(qi,"*");})}r(_o,"createBrowserContext");async function qo(){return typeof window<"u"?_o():null}r(qo,"bootstrap");var tr=await qo(),ae=tr?new Je(new Ze(tr)):new Proxy({},{get(n,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function nr(n){return new Je(new Ze(n))}r(nr,"createFramerInstance");var ir=process$1.env;function Zo(n){Object.assign(ir,n);}r(Zo,"configure");function he(n,e){let t=ir[n];return t&&t.length>0?t:e}r(he,"getEnv");var rr=isWorkerd,or=globalThis.WebSocket;async function ar(n,e){let t=new URL(n.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(ar,"connectWebSocketCF");var sr,lr;try{sr=await import('node:fs'),lr=await import('node:path');}catch{}var kn=sr,Mn=lr;var se=(b=>(b.PROJECT_CLOSED="PROJECT_CLOSED",b.POOL_EXHAUSTED="POOL_EXHAUSTED",b.TIMEOUT="TIMEOUT",b.INTERNAL="INTERNAL",b.NODE_NOT_FOUND="NODE_NOT_FOUND",b.SCREENSHOT_TOO_LARGE="SCREENSHOT_TOO_LARGE",b.INVALID_REQUEST="INVALID_REQUEST",b.UNAUTHORIZED="UNAUTHORIZED",b))(se||{}),D=class extends Error{static{r(this,"FramerAPIError");}code;constructor(e,t){super(e),this.name="FramerAPIError",this.code=t,this.stack=undefined;}};function Jo(n){return n instanceof D?n.code==="POOL_EXHAUSTED":false}r(Jo,"isRetryableError");var Qo=new Map(Object.values(se).map(n=>[n,n]));function dr(n){return typeof n=="string"?Qo.get(n)??"INTERNAL":"INTERNAL"}r(dr,"parseErrorCode");var An={silent:0,error:1,warn:2,info:3,debug:4};function ea(){let n=he("FRAMER_API_LOG_LEVEL")?.toLowerCase();return n&&n in An?n:"warn"}r(ea,"getLogLevel");var wn=ea();function Qe(n){return An[n]<=An[wn]}r(Qe,"shouldLog");var et=globalThis.console,ta="\x1B[90m",na="\x1B[0m";function ia(n){return n?`[FramerAPI:${n}]`:"[FramerAPI]"}r(ia,"formatPrefix");function ra(n,...e){return [ta+n,...e,na]}r(ra,"formatDebug");function ur(n){let e=ia(n);return {warn:(...t)=>{Qe("warn")&&et.warn(e,...t);},error:(...t)=>{Qe("error")&&et.error(e,...t);},log:(...t)=>{Qe("info")&&et.log(e,...t);},info:(...t)=>{Qe("info")&&et.info(e,...t);},debug:(...t)=>{Qe("debug")&&et.debug(...ra(e,...t));},setLevel:t=>{wn=t;},getLevel:()=>wn,withRequestId:t=>ur(t)}}r(ur,"createLogger");var N=ur();N.warn;N.error;N.log;N.info;N.debug;N.setLevel;N.getLevel;function X(n,...e){if(n)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let i=t.stack.split(`
9
9
  `);i[1]?.includes("assert")?(i.splice(1,1),t.stack=i.join(`
10
10
  `)):i[0]?.includes("assert")&&(i.splice(0,1),t.stack=i.join(`
11
11
  `));}catch{}throw t}r(X,"assert");var cr;function pr({error:n,tags:e,extras:t,critical:i,caller:o}){X(cr,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Wn(n,o);return cr({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!i}),a}r(pr,"reportError");function Wn(n,e=Wn){return n instanceof Error?n:new Vn(n,e)}r(Wn,"reportableError");var Vn=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let i=e?JSON.stringify(e):"No error message provided";if(super(i),this.message=i,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var tt=typeof window<"u"?window.location.hostname:undefined,mr=!!(tt&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(tt)),Ln=(()=>{if(!tt)return;if(mr)return {main:tt,previewLink:undefined};let n=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=tt.match(n);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:Ln,isDevelopment:Ln?.main==="development.framer.com",isProduction:Ln?.main==="framer.com",isLocal:mr});var Wt;function Lt(){return typeof window>"u"?{}:Wt||(Wt=sa(),Wt)}r(Lt,"getServiceMap");function sa(){let n=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!==n.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${n.origin})`);if(n.origin.endsWith("framer.com")||n.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let i=new URLSearchParams(n.search).get("services")||new URLSearchParams(n.hash.substring(1)).get("services");i&&(e=JSON.parse(i));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(sa,"extractServiceMap");function nt(n,e=0,t=new Set){if(n===null)return n;if(typeof n=="function")return `[Function: ${n.name??"unknown"}]`;if(typeof n!="object")return n;if(n instanceof Error)return `[${n.toString()}]`;if(t.has(n))return "[Circular]";if(e>2)return "...";t.add(n);try{if("toJSON"in n&&typeof n.toJSON=="function")return nt(n.toJSON(),e+1,t);if(Array.isArray(n))return n.map(i=>nt(i,e+1,t));if(Object.getPrototypeOf(n)!==Object.prototype)return `[Object: ${"__class"in n&&n.__class||n.constructor?.name}]`;{let i={};for(let[o,a]of Object.entries(n))i[o]=nt(a,e+1,t);return i}}catch(i){return `[Throws: ${i instanceof Error?i.message:i}]`}finally{t.delete(n);}}r(nt,"jsonSafeCopy");var la=["trace","debug","info","warn","error"],da=[":trace",":debug",":info",":warn",":error"];function yr(n,e){let t=[];for(let i of n.split(/[ ,]/u)){let o=i.trim();if(o.length===0)continue;let a=1,s=false;o.startsWith("-")&&(o=o.slice(1),a=3,s=true);for(let C=0;C<=4;C++){let F=da[C];if(F&&o.endsWith(F)){a=C,s&&(a+=1),o=o.slice(0,o.length-F.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+fa(o).replace(/\\\*/gu,".*")+"$"),b=0;for(let C of e)C.id.match(d)&&(C.level=a,++b);b===0&&t.push(i);}return t}r(yr,"applyLogLevelSpec");var it=class n{constructor(e,t,i){this.logger=e;this.level=t;this.parts=i;this.id=n.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),la[this.level]+": ["+this.logger.id+"]"],t=0;for(;t<this.parts.length;t++){let i=this.parts[t];if(typeof i=="string"){e.push(i);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 i=JSON.stringify(nt(e));return i?.length>253?i.slice(0,250)+"...":i}).join(" ")}},z="*:app:info,app:info",hr=typeof process<"u"&&!!process.kill,ua=hr&&!!process.env.CI;ua?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",n=>{if(!n.data||typeof n.data!="object")return;let{loggerId:e,level:t,parts:i,printed:o}=n.data;if(typeof e!="string"||!Array.isArray(i)||i.length<1||typeof t!="number")return;let a=rt(e);if(t<0||t>5)return;i[0]=i[0].replace("[","*[");let s=new it(a,t,i);s.stringPrefix=i[0],Z.push(s),!o&&(a.level>t||console?.log(...s.toMessage()));});}catch{}var Bn;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(Bn=r(n=>{try{let e=n.toMessage().map(s=>nt(s)),t=n.logger,i=n.level,o=t.level<=n.level,a={loggerId:t.id,level:i,parts:e,printed:o};window.parent?.postMessage(a,Lt().app);}catch{}},"postLogEntry"));}catch{}var Rn={},Z=[],br=1e3;function le(n,e,t){let i=new it(n,e,t);for(Z.push(i),Bn?.(i);Z.length>br;)Z.shift();return i}r(le,"createLogEntry");function xr(n){return typeof n=="number"&&(br=n),Z}r(xr,"getLogReplayBuffer");var ca=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,fr;function pa(){if(!(typeof window>"u"||!window.location))return fr??=ca.exec(window.location.pathname)?.groups?.filename,fr}r(pa,"getFilenameFromWindowPathname");function rt(n){let e=pa();n=(e?e+":":"")+n;let t=Rn[n];if(t)return t;let i=new Rt(n);return Rn[n]=i,yr(z,[i]),Bn?.(new it(i,-1,[])),i}r(rt,"getLogger");function Cr(n,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=n);}catch{}let t=z;z=n;let i=Object.values(Rn);for(let a of i)a.level=3;let o=yr(n,i);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&Z.length>0){console?.log("--- LOG REPLAY ---");for(let a of Z)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 ma=r(n=>{let e={...n,logs:xr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
12
- `)};return n.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),Rt=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 rt(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=le(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=le(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=le(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=le(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let i=this.didLog[e];if(i&&i>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=le(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=le(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let i=this.didLog[e];if(i&&i>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=le(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,i,o)=>{let a=ma(t??{}),s=pr({caller:this.reportWithoutLogging,error:e,tags:{...i,handler:"logger",where:this.id},extras:t,critical:o??this.errorIsCritical});return [a,s]};reportError=(e,t,i,o)=>{let[a,s]=this.reportWithoutLogging(e,t,i,o);a?this.error(s,a):this.error(s);};reportErrorOncePerMinute=(e,t)=>{if(!ga(e))return;let i=this.didLog[e.message];i&&i>Date.now()||(this.didLog[e.message]=Date.now()+1e3*60,this.reportError(e,t));};reportCriticalError=(e,t,i)=>this.reportError(e,t,i,true)};function ga(n){return Object.prototype.hasOwnProperty.call(n,"message")}r(ga,"isErrorWithMessage");function fa(n){return n.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(fa,"escapeRegExp");var Pr;(xe=>{function n(y,...u){return y.concat(u)}xe.push=n,r(n,"push");function e(y){return y.slice(0,-1)}xe.pop=e,r(e,"pop");function t(y,...u){return u.concat(y)}xe.unshift=t,r(t,"unshift");function i(y,u,...T){let m=y.length;if(u<0||u>m)throw Error("index out of range: "+u);let g=y.slice();return g.splice(u,0,...T),g}xe.insert=i,r(i,"insert");function o(y,u,T){let m=y.length;if(u<0||u>=m)throw Error("index out of range: "+u);let g=Array.isArray(T)?T:[T],M=y.slice();return M.splice(u,1,...g),M}xe.replace=o,r(o,"replace");function a(y,u){let T=y.length;if(u<0||u>=T)throw Error("index out of range: "+u);let m=y.slice();return m.splice(u,1),m}xe.remove=a,r(a,"remove");function s(y,u,T){let m=y.length;if(u<0||u>=m)throw Error("from index out of range: "+u);if(T<0||T>=m)throw Error("to index out of range: "+T);let g=y.slice();if(T===u)return g;let M=g[u];return u<T?(g.splice(T+1,0,M),g.splice(u,1)):(g.splice(u,1),g.splice(T,0,M)),g}xe.move=s,r(s,"move");function d(y,u){let T=[],m=Math.min(y.length,u.length);for(let g=0;g<m;g++)T.push([y[g],u[g]]);return T}xe.zip=d,r(d,"zip");function b(y,u,T){let m=y.slice(),g=m[u];return g===undefined||(m[u]=T(g)),m}xe.update=b,r(b,"update");function C(y){return Array.from(new Set(y))}xe.unique=C,r(C,"unique");function F(y,...u){return Array.from(new Set([...y,...u.flat()]))}xe.union=F,r(F,"union");function G(y,u){return y.filter(u)}xe.filter=G,r(G,"filter");})(Pr||={});var Ta=Object.prototype.hasOwnProperty;function Pa(n,e){return Ta.call(n,e)}r(Pa,"hasOwnProperty");var Sr;(i=>{function n(o,a){for(let s of Object.keys(o))Pa(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}i.morphUsingTemplate=n,r(n,"morphUsingTemplate");function e(o,a){a&&Object.assign(o,a);}i.writeOnce=e,r(e,"writeOnce");function t(o,a){return Object.assign(Object.create(Object.getPrototypeOf(o)),o,a)}i.update=t,r(t,"update");})(Sr||={});var Fr;(o=>{function n(a,...s){return new Set([...a,...s])}o.add=n,r(n,"add");function e(a,...s){let d=new Set(a);for(let b of s)d.delete(b);return d}o.remove=e,r(e,"remove");function t(...a){let s=new Set;for(let d of a)for(let b of d)s.add(b);return s}o.union=t,r(t,"union");function i(a,s){return a.has(s)?o.remove(a,s):o.add(a,s)}o.toggle=i,r(i,"toggle");})(Fr||={});var Dr;(i=>{function n(o,...a){let s=new Map;o.forEach((b,C)=>s.set(C,b));let d=false;for(let b of a)b&&(b.forEach((C,F)=>s.set(F,C)),d=true);return d?s:o}i.merge=n,r(n,"merge");function e(o,a,s){let d=new Map(o);return d.set(a,s),d}i.set=e,r(e,"set");function t(o,a){let s=new Map(o);return s.delete(a),s}i.remove=t,r(t,"remove");})(Dr||={});var Bt=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((i,o)=>{e=i,t=o;}),this.resolve=i=>{this._state="fulfilled",e(i);},this.reject=i=>{this._state="rejected",t(i);};}};Bt.prototype.constructor=Promise;rt("task-queue");function On(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}r(On,"isObject");var be=class{static{r(this,"WebSocketTransport");}onError;closed=false;ws;messageHandlers=new Set;constructor(e){this.ws=e,this.setupListeners();}setupListeners(){this.ws.addEventListener("close",this.handleClose),this.ws.addEventListener("message",this.handleMessage);}removeListeners(){this.ws.removeEventListener("close",this.handleClose),this.ws.removeEventListener("message",this.handleMessage);}handleClose=()=>{this.removeListeners(),this.closed=true,this.onError?.(new D("Connection closed","PROJECT_CLOSED"));};handleMessage=e=>{for(let t of this.messageHandlers)t(e);};replaceSocket(e){this.removeListeners(),this.ws=e,this.closed=false,this.setupListeners();}setOnError(e){this.onError=e;}send(e){if(this.closed)throw new D("Connection closed","PROJECT_CLOSED");this.ws.send(ot.stringify(e));}waitForDisconnectAck(e){return new Promise(t=>{let i=setTimeout(()=>{this.ws.removeEventListener("message",o),t();},e),o=r(a=>{if(!(typeof a.data!="string"&&!(a.data instanceof String)))try{let s=ot.parse(a.data);On(s)&&s.type==="disconnect-ack"&&(clearTimeout(i),this.ws.removeEventListener("message",o),t());}catch{}},"handler");this.ws.addEventListener("message",o);})}onMessage(e){let t=r(i=>{let o=typeof i.data=="string"?i.data:i.data.toString(),a=ot.parse(o);if(On(a)&&a.type==="error"){let s=a.message||JSON.stringify(a),d=a.code??"INTERNAL";N.error(`Server error: ${s}`),this.onError?.(new D(`Server error: ${s}`,d));return}if(On(a)&&a.type==="debug-archive"){zn(a.data);return}e(a);},"listener");this.messageHandlers.add(t);}};function zn(n){X(kn,"File system module is not available."),X(Mn,"Path module is not available.");let t=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,i=process.cwd(),o=Mn.resolve(i,t);kn.writeFileSync(o,Buffer.from(n)),N.info(`Debug archive saved to ${o}`);}r(zn,"handleDebugArchive");function at(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}r(at,"isObject");var va={type:"pluginReadySignal"};function Na(n){return at(n)&&n.type==="pluginReadyResponse"}r(Na,"isPluginReadyResponse");var vr=9e4,Ea=2e4;async function ka(n,e){let t={Authorization:`Token ${e}`};if(rr)return N.debug("Using Cloudflare Workers WebSocket connection"),ar(n,t);let i=n.hostname==="api.framerlocal.com",o=process.env.NODE_TLS_REJECT_UNAUTHORIZED;i&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"),N.debug("Using standard WebSocket connection");let a=new or(n.href,{headers:t});return i&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED=o),a}r(ka,"createWebSocket");async function Ut(n,e,t){let i=new URL(t??he("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));i.protocol=i.protocol==="https:"?"wss:":i.protocol==="http:"?"ws:":i.protocol,i.searchParams.set("projectId",n),N.debug(`Connecting to ${i.href}`);let o=await ka(i,e);N.debug(`WebSocket created, readyState: ${o.readyState}`);let a,s,d=N,b=false,C=setInterval(()=>{o.readyState===o.OPEN&&(o.send(ot.stringify({type:"ping"})),d.debug("Sent ping"));},Ea),F=r(()=>{clearInterval(C),o.readyState!==o.CLOSED&&o.readyState!==o.CLOSING&&o.close(1e3,"Client disconnect");},"forceClose"),G=r(async()=>{if(clearInterval(C),!(o.readyState===o.CLOSED||o.readyState===o.CLOSING)){if(b){d.debug("Initiating graceful disconnect");let y=new be(o);y.send({type:"client-disconnect"}),await y.waitForDisconnectAck(15e3);}o.readyState!==o.CLOSED&&o.readyState!==o.CLOSING&&o.close(1e3,"Client disconnect");}},"cleanup"),xe=await new Promise((y,u)=>{let T=setTimeout(()=>{F(),u(new D(`Connection timeout after ${vr}ms`,"TIMEOUT"));},vr),m=r(()=>{d.debug("WebSocket opened, waiting for ready");},"onOpen"),g=r(E=>{d.debug("WebSocket error:",E),clearTimeout(T),F(),u(new D("No connection to the server","INTERNAL"));},"onError"),M=r(E=>{d.debug(`WebSocket closed: code=${E.code}, reason=${E.reason||"(no reason)"}, wasClean=${E.wasClean}`),clearTimeout(T),clearInterval(C),u(new D(`Connection to the server was closed (code: ${E.code})`,"PROJECT_CLOSED"));},"onClose");function K(E){d.debug("Received message");let J=typeof E.data=="string"?E.data:E.data.toString(),P=ot.parse(J);if(d.debug(`Message type: ${P.type}`),P.type==="error"){clearTimeout(T),o.removeEventListener("close",M),o.removeEventListener("error",g);let Kn=dr(P.code);u(new D(P.message||"Server error",Kn)),F();}else P.type==="ready"?(at(P)&&"requestId"in P&&(a=String(P.requestId),d=N.withRequestId(a),d.debug(`Server request ID: ${a}`)),at(P)&&"sessionId"in P&&(s=String(P.sessionId),d.debug(`Server session ID: ${s}`)),at(P)&&"version"in P&&d.debug(`Server version: ${P.version}`),at(P)&&P.gracefulDisconnect===true&&(b=true),d.debug("Sending pluginReadySignal"),o.send(ot.stringify(va))):P.type==="debug-archive"?zn(P.data):Na(P)&&(clearTimeout(T),o.removeEventListener("message",K),o.removeEventListener("error",g),o.removeEventListener("close",M),y(P));}r(K,"handshakeMessageHandler"),o.addEventListener("open",m),o.addEventListener("message",K),o.addEventListener("error",g),o.addEventListener("close",M);});return o.addEventListener("close",()=>{G();}),{ws:o,pluginReadyData:xe,requestId:a,sessionId:s,logger:d,gracefulDisconnect:b,cleanup:G}}r(Ut,"connectAndHandshake");var Nr={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 Gn(n){return n in Nr?Nr[n]===true:false}r(Gn,"isAllowedMethod");var Ot=class n{static{r(this,"FramerAPI");}requestId;#e;#t;#n;#i=new Map;#r=new Map;#c=0;#a;#s;#l;constructor(e){this.#t=e.pluginAPI,this.#n=e.transport,this.#e=e.cleanup,this.#a=e.projectId,this.#s=e.apiKey,this.#l=e.serverUrl,this.requestId=e.requestId,this.#n.onMessage(t=>{this.#p(t);}),this.#n.setOnError(t=>{this.#d(t);});}#d(e){for(let t of this.#i.values())t.reject(e);this.#i.clear();for(let t of this.#r.values())t.reject(e);this.#r.clear(),this.#t[W.rejectAllPending](e);}#u(){return `req-${++this.#c}-${Date.now()}`}#p=e=>{switch(e.type){case "screenshotResult":{let t=this.#i.get(e.id);if(t){this.#i.delete(e.id);let i=Buffer.from(e.data,"base64");t.resolve({data:i,mimeType:e.mimeType});}return true}case "screenshotError":{let t=this.#i.get(e.id);if(t){this.#i.delete(e.id);let i=e.code??"INTERNAL";t.reject(new D(e.error,i));}return true}case "exportSVGResult":{let t=this.#r.get(e.id);return t&&(this.#r.delete(e.id),t.resolve(e.data)),true}case "exportSVGError":{let t=this.#r.get(e.id);if(t){this.#r.delete(e.id);let i=e.code??"INTERNAL";t.reject(new D(e.error,i));}return true}default:return false}};static create(e){let t=new n(e);return new Proxy(t,{get(i,o){if(o in i)return Reflect.get(i,o);if(Pn(o)){let s=W[o],d=Reflect.get(i.#t,s);return typeof d=="function"?d.bind(i.#t):d}if(!Gn(o))return;let a=Reflect.get(i.#t,o);return typeof a=="function"?a.bind(i.#t):a},has(i,o){return o in i||Pn(o)?true:Gn(o)?o in i.#t:false}})}async#o(){this.#d(new D("Connection closed","PROJECT_CLOSED")),await this.#e();}disconnect=()=>this.#o();reconnect=async()=>{await this.#o();let e=await Ut(this.#a,this.#s,this.#l);this.#n.replaceSocket(e.ws),this.#e=e.cleanup,this.requestId=e.requestId;};screenshot=(e,t)=>{let i=this.#u(),{format:o,quality:a,scale:s,clip:d}=t??{};return new Promise((b,C)=>{this.#i.set(i,{resolve:b,reject:C}),this.#n.send({type:"screenshot",id:i,nodeId:e,format:o,quality:a,scale:s,clip:d});})};exportSVG=e=>{let t=this.#u();return new Promise((i,o)=>{this.#r.set(t,{resolve:i,reject:o}),this.#n.send({type:"exportSVG",id:t,nodeId:e});})};[Symbol.dispose]=()=>void this.#o();[Symbol.asyncDispose]=()=>this.#o()};var Ma=/^.+--([A-Za-z0-9]+)/u,Er=/^[A-Za-z0-9]{20}$/u;function kr(n){if(Er.test(n))return n;try{let t=new URL(n,"https://framer.com").pathname.split("/").filter(Boolean),i=t.findIndex(o=>o.toLowerCase()==="projects");if(i>=0){let o=t[i+1];if(o!==void 0){let a=decodeURIComponent(o),d=a.match(Ma)?.[1]??a;if(Er.test(d))return d}}return null}catch{return null}}r(kr,"parseProjectId");async function Mr(n,e,t){let i=performance.now();if(!n)throw new D("FRAMER_PROJECT_URL environment variable is required","INVALID_REQUEST");let o=kr(n);if(!o)throw new D(`Invalid project URL or ID: ${n}`,"INVALID_REQUEST");let a=e??he("FRAMER_API_KEY");if(!a)throw new D("FRAMER_API_KEY environment variable is required","INVALID_REQUEST");let s=await Ut(o,a,t?.serverUrl);try{let d=new be(s.ws),b={transport:d,mode:s.pluginReadyData.mode,permissionMap:s.pluginReadyData.permissionMap,environmentInfo:s.pluginReadyData.environmentInfo,origin:null,theme:null,initialState:s.pluginReadyData.initialState},C=nr(b),F=r(async()=>{let G=((performance.now()-i)/1e3).toFixed(2);s.logger.debug(`Connection ended after ${G}s`),await s.cleanup();},"cleanup");return Ot.create({pluginAPI:C,transport:d,cleanup:F,projectId:o,apiKey:a,serverUrl:t?.serverUrl,requestId:s.requestId})}catch(d){throw await s.cleanup(),d}}r(Mr,"connect");async function Aa(n,e,t,i){let o=await Mr(n,t,i);try{return await e(o)}finally{await o.disconnect();}}r(Aa,"withConnection");
12
+ `)};return n.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),Rt=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 rt(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=le(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=le(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=le(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=le(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let i=this.didLog[e];if(i&&i>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=le(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=le(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let i=this.didLog[e];if(i&&i>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=le(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,i,o)=>{let a=ma(t??{}),s=pr({caller:this.reportWithoutLogging,error:e,tags:{...i,handler:"logger",where:this.id},extras:t,critical:o??this.errorIsCritical});return [a,s]};reportError=(e,t,i,o)=>{let[a,s]=this.reportWithoutLogging(e,t,i,o);a?this.error(s,a):this.error(s);};reportErrorOncePerMinute=(e,t)=>{if(!ga(e))return;let i=this.didLog[e.message];i&&i>Date.now()||(this.didLog[e.message]=Date.now()+1e3*60,this.reportError(e,t));};reportCriticalError=(e,t,i)=>this.reportError(e,t,i,true)};function ga(n){return Object.prototype.hasOwnProperty.call(n,"message")}r(ga,"isErrorWithMessage");function fa(n){return n.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(fa,"escapeRegExp");var Pr;(xe=>{function n(y,...u){return y.concat(u)}xe.push=n,r(n,"push");function e(y){return y.slice(0,-1)}xe.pop=e,r(e,"pop");function t(y,...u){return u.concat(y)}xe.unshift=t,r(t,"unshift");function i(y,u,...T){let m=y.length;if(u<0||u>m)throw Error("index out of range: "+u);let g=y.slice();return g.splice(u,0,...T),g}xe.insert=i,r(i,"insert");function o(y,u,T){let m=y.length;if(u<0||u>=m)throw Error("index out of range: "+u);let g=Array.isArray(T)?T:[T],M=y.slice();return M.splice(u,1,...g),M}xe.replace=o,r(o,"replace");function a(y,u){let T=y.length;if(u<0||u>=T)throw Error("index out of range: "+u);let m=y.slice();return m.splice(u,1),m}xe.remove=a,r(a,"remove");function s(y,u,T){let m=y.length;if(u<0||u>=m)throw Error("from index out of range: "+u);if(T<0||T>=m)throw Error("to index out of range: "+T);let g=y.slice();if(T===u)return g;let M=g[u];return u<T?(g.splice(T+1,0,M),g.splice(u,1)):(g.splice(u,1),g.splice(T,0,M)),g}xe.move=s,r(s,"move");function d(y,u){let T=[],m=Math.min(y.length,u.length);for(let g=0;g<m;g++)T.push([y[g],u[g]]);return T}xe.zip=d,r(d,"zip");function b(y,u,T){let m=y.slice(),g=m[u];return g===undefined||(m[u]=T(g)),m}xe.update=b,r(b,"update");function C(y){return Array.from(new Set(y))}xe.unique=C,r(C,"unique");function F(y,...u){return Array.from(new Set([...y,...u.flat()]))}xe.union=F,r(F,"union");function G(y,u){return y.filter(u)}xe.filter=G,r(G,"filter");})(Pr||={});var Ta=Object.prototype.hasOwnProperty;function Pa(n,e){return Ta.call(n,e)}r(Pa,"hasOwnProperty");var Sr;(i=>{function n(o,a){for(let s of Object.keys(o))Pa(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}i.morphUsingTemplate=n,r(n,"morphUsingTemplate");function e(o,a){a&&Object.assign(o,a);}i.writeOnce=e,r(e,"writeOnce");function t(o,a){return Object.assign(Object.create(Object.getPrototypeOf(o)),o,a)}i.update=t,r(t,"update");})(Sr||={});var Fr;(o=>{function n(a,...s){return new Set([...a,...s])}o.add=n,r(n,"add");function e(a,...s){let d=new Set(a);for(let b of s)d.delete(b);return d}o.remove=e,r(e,"remove");function t(...a){let s=new Set;for(let d of a)for(let b of d)s.add(b);return s}o.union=t,r(t,"union");function i(a,s){return a.has(s)?o.remove(a,s):o.add(a,s)}o.toggle=i,r(i,"toggle");})(Fr||={});var Dr;(i=>{function n(o,...a){let s=new Map;o.forEach((b,C)=>s.set(C,b));let d=false;for(let b of a)b&&(b.forEach((C,F)=>s.set(F,C)),d=true);return d?s:o}i.merge=n,r(n,"merge");function e(o,a,s){let d=new Map(o);return d.set(a,s),d}i.set=e,r(e,"set");function t(o,a){let s=new Map(o);return s.delete(a),s}i.remove=t,r(t,"remove");})(Dr||={});var Bt=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((i,o)=>{e=i,t=o;}),this.resolve=i=>{this._state="fulfilled",e(i);},this.reject=i=>{this._state="rejected",t(i);};}};Bt.prototype.constructor=Promise;rt("task-queue");function On(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}r(On,"isObject");var va=-1,be=class{static{r(this,"WebSocketTransport");}onError;closed=false;ws;messageHandlers=new Set;chunkBuffers=new Map;constructor(e){this.ws=e,this.setupListeners();}setupListeners(){this.ws.addEventListener("close",this.handleClose),this.ws.addEventListener("message",this.handleMessage);}removeListeners(){this.ws.removeEventListener("close",this.handleClose),this.ws.removeEventListener("message",this.handleMessage);}handleClose=()=>{this.removeListeners(),this.closed=true,this.chunkBuffers.clear(),this.onError?.(new D("Connection closed","PROJECT_CLOSED"));};handleMessage=e=>{let t=typeof e.data=="string"?e.data:String(e.data),i=this.tryParseChunkEnvelope(t);if(i){let o=this.handleChunk(i);if(!o)return;let a=new MessageEvent("message",{data:o});for(let s of this.messageHandlers)s(a);return}for(let o of this.messageHandlers)o(e);};replaceSocket(e){this.removeListeners(),this.chunkBuffers.clear(),this.ws=e,this.closed=false,this.setupListeners();}setOnError(e){this.onError=e;}send(e){if(this.closed)throw new D("Connection closed","PROJECT_CLOSED");this.ws.send(ot.stringify(e));}waitForDisconnectAck(e){return new Promise(t=>{let i=setTimeout(()=>{this.ws.removeEventListener("message",o),t();},e),o=r(a=>{if(!(typeof a.data!="string"&&!(a.data instanceof String)))try{let s=ot.parse(a.data);On(s)&&s.type==="disconnect-ack"&&(clearTimeout(i),this.ws.removeEventListener("message",o),t());}catch{}},"handler");this.ws.addEventListener("message",o);})}handleChunk(e){let t=this.chunkBuffers.get(e.id);return t||(t=[],this.chunkBuffers.set(e.id,t)),t.push(e.data),e.seq===va?(this.chunkBuffers.delete(e.id),t.join("")):null}tryParseChunkEnvelope(e){if(!e.startsWith('{"$chunk":'))return null;try{let t=JSON.parse(e);if(t.$chunk===1&&typeof t.id=="string"&&typeof t.seq=="number")return t}catch{}return null}onMessage(e){let t=r(i=>{let o=typeof i.data=="string"?i.data:String(i.data);this.dispatchMessage(o,e);},"listener");this.messageHandlers.add(t);}dispatchMessage(e,t){let i=ot.parse(e);if(On(i)&&i.type==="error"){let o=i.message||JSON.stringify(i),a=i.code??"INTERNAL";N.error(`Server error: ${o}`),this.onError?.(new D(`Server error: ${o}`,a));return}if(On(i)&&i.type==="debug-archive"){zn(i.data);return}t(i);}};function zn(n){X(kn,"File system module is not available."),X(Mn,"Path module is not available.");let t=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,i=process.cwd(),o=Mn.resolve(i,t);kn.writeFileSync(o,Buffer.from(n)),N.info(`Debug archive saved to ${o}`);}r(zn,"handleDebugArchive");function at(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}r(at,"isObject");var Na={type:"pluginReadySignal"};function Ea(n){return at(n)&&n.type==="pluginReadyResponse"}r(Ea,"isPluginReadyResponse");var vr=9e4,ka=2e4;async function Ma(n,e){let t={Authorization:`Token ${e}`};if(rr)return N.debug("Using Cloudflare Workers WebSocket connection"),ar(n,t);let i=n.hostname==="api.framerlocal.com",o=process.env.NODE_TLS_REJECT_UNAUTHORIZED;i&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"),N.debug("Using standard WebSocket connection");let a=new or(n.href,{headers:t});return i&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED=o),a}r(Ma,"createWebSocket");async function Ut(n,e,t){let i=new URL(t??he("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));i.protocol=i.protocol==="https:"?"wss:":i.protocol==="http:"?"ws:":i.protocol,i.searchParams.set("projectId",n),i.searchParams.set("sdkVersion","0.1.2-alpha.1"),N.debug(`Connecting to ${i.href}`);let o=await Ma(i,e);N.debug(`WebSocket created, readyState: ${o.readyState}`);let a,s,d=N,b=false,C=setInterval(()=>{o.readyState===o.OPEN&&(o.send(ot.stringify({type:"ping"})),d.debug("Sent ping"));},ka),F=r(()=>{clearInterval(C),o.readyState!==o.CLOSED&&o.readyState!==o.CLOSING&&o.close(1e3,"Client disconnect");},"forceClose"),G=r(async()=>{if(clearInterval(C),!(o.readyState===o.CLOSED||o.readyState===o.CLOSING)){if(b){d.debug("Initiating graceful disconnect");let y=new be(o);y.send({type:"client-disconnect"}),await y.waitForDisconnectAck(15e3);}o.readyState!==o.CLOSED&&o.readyState!==o.CLOSING&&o.close(1e3,"Client disconnect");}},"cleanup"),xe=await new Promise((y,u)=>{let T=setTimeout(()=>{F(),u(new D(`Connection timeout after ${vr}ms`,"TIMEOUT"));},vr),m=r(()=>{d.debug("WebSocket opened, waiting for ready");},"onOpen"),g=r(E=>{d.debug("WebSocket error:",E),clearTimeout(T),F(),u(new D("No connection to the server","INTERNAL"));},"onError"),M=r(E=>{d.debug(`WebSocket closed: code=${E.code}, reason=${E.reason||"(no reason)"}, wasClean=${E.wasClean}`),clearTimeout(T),clearInterval(C),u(new D(`Connection to the server was closed (code: ${E.code})`,"PROJECT_CLOSED"));},"onClose");function K(E){d.debug("Received message");let J=typeof E.data=="string"?E.data:E.data.toString(),P=ot.parse(J);if(d.debug(`Message type: ${P.type}`),P.type==="error"){clearTimeout(T),o.removeEventListener("close",M),o.removeEventListener("error",g);let Kn=dr(P.code);u(new D(P.message||"Server error",Kn)),F();}else P.type==="ready"?(at(P)&&"requestId"in P&&(a=String(P.requestId),d=N.withRequestId(a),d.debug(`Server request ID: ${a}`)),at(P)&&"sessionId"in P&&(s=String(P.sessionId),d.debug(`Server session ID: ${s}`)),at(P)&&"version"in P&&d.debug(`Server version: ${P.version}`),at(P)&&P.gracefulDisconnect===true&&(b=true),d.debug("Sending pluginReadySignal"),o.send(ot.stringify(Na))):P.type==="debug-archive"?zn(P.data):Ea(P)&&(clearTimeout(T),o.removeEventListener("message",K),o.removeEventListener("error",g),o.removeEventListener("close",M),y(P));}r(K,"handshakeMessageHandler"),o.addEventListener("open",m),o.addEventListener("message",K),o.addEventListener("error",g),o.addEventListener("close",M);});return o.addEventListener("close",()=>{G();}),{ws:o,pluginReadyData:xe,requestId:a,sessionId:s,logger:d,gracefulDisconnect:b,cleanup:G}}r(Ut,"connectAndHandshake");var Nr={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,createLocale:true,getLocaleLanguages:true,getLocaleRegions: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 Gn(n){return n in Nr?Nr[n]===true:false}r(Gn,"isAllowedMethod");var Ot=class n{static{r(this,"FramerAPI");}requestId;#e;#t;#n;#i=new Map;#r=new Map;#c=0;#a;#s;#l;constructor(e){this.#t=e.pluginAPI,this.#n=e.transport,this.#e=e.cleanup,this.#a=e.projectId,this.#s=e.apiKey,this.#l=e.serverUrl,this.requestId=e.requestId,this.#n.onMessage(t=>{this.#p(t);}),this.#n.setOnError(t=>{this.#d(t);});}#d(e){for(let t of this.#i.values())t.reject(e);this.#i.clear();for(let t of this.#r.values())t.reject(e);this.#r.clear(),this.#t[W.rejectAllPending](e);}#u(){return `req-${++this.#c}-${Date.now()}`}#p=e=>{switch(e.type){case "screenshotResult":{let t=this.#i.get(e.id);if(t){this.#i.delete(e.id);let i=Buffer.from(e.data,"base64");t.resolve({data:i,mimeType:e.mimeType});}return true}case "screenshotError":{let t=this.#i.get(e.id);if(t){this.#i.delete(e.id);let i=e.code??"INTERNAL";t.reject(new D(e.error,i));}return true}case "exportSVGResult":{let t=this.#r.get(e.id);return t&&(this.#r.delete(e.id),t.resolve(e.data)),true}case "exportSVGError":{let t=this.#r.get(e.id);if(t){this.#r.delete(e.id);let i=e.code??"INTERNAL";t.reject(new D(e.error,i));}return true}default:return false}};static create(e){let t=new n(e);return new Proxy(t,{get(i,o){if(o in i)return Reflect.get(i,o);if(Pn(o)){let s=W[o],d=Reflect.get(i.#t,s);return typeof d=="function"?d.bind(i.#t):d}if(!Gn(o))return;let a=Reflect.get(i.#t,o);return typeof a=="function"?a.bind(i.#t):a},has(i,o){return o in i||Pn(o)?true:Gn(o)?o in i.#t:false}})}async#o(){this.#d(new D("Connection closed","PROJECT_CLOSED")),await this.#e();}disconnect=()=>this.#o();reconnect=async()=>{await this.#o();let e=await Ut(this.#a,this.#s,this.#l);this.#n.replaceSocket(e.ws),this.#e=e.cleanup,this.requestId=e.requestId;};screenshot=(e,t)=>{let i=this.#u(),{format:o,quality:a,scale:s,clip:d}=t??{};return new Promise((b,C)=>{this.#i.set(i,{resolve:b,reject:C}),this.#n.send({type:"screenshot",id:i,nodeId:e,format:o,quality:a,scale:s,clip:d});})};exportSVG=e=>{let t=this.#u();return new Promise((i,o)=>{this.#r.set(t,{resolve:i,reject:o}),this.#n.send({type:"exportSVG",id:t,nodeId:e});})};[Symbol.dispose]=()=>void this.#o();[Symbol.asyncDispose]=()=>this.#o()};var Aa=/^.+--([A-Za-z0-9]+)/u,Er=/^[A-Za-z0-9]{20}$/u;function kr(n){if(Er.test(n))return n;try{let t=new URL(n,"https://framer.com").pathname.split("/").filter(Boolean),i=t.findIndex(o=>o.toLowerCase()==="projects");if(i>=0){let o=t[i+1];if(o!==void 0){let a=decodeURIComponent(o),d=a.match(Aa)?.[1]??a;if(Er.test(d))return d}}return null}catch{return null}}r(kr,"parseProjectId");async function Mr(n,e,t){let i=performance.now();if(!n)throw new D("FRAMER_PROJECT_URL environment variable is required","INVALID_REQUEST");let o=kr(n);if(!o)throw new D(`Invalid project URL or ID: ${n}`,"INVALID_REQUEST");let a=e??he("FRAMER_API_KEY");if(!a)throw new D("FRAMER_API_KEY environment variable is required","INVALID_REQUEST");let s=await Ut(o,a,t?.serverUrl);try{let d=new be(s.ws),b={transport:d,mode:s.pluginReadyData.mode,permissionMap:s.pluginReadyData.permissionMap,environmentInfo:s.pluginReadyData.environmentInfo,origin:null,theme:null,initialState:s.pluginReadyData.initialState},C=nr(b),F=r(async()=>{let G=((performance.now()-i)/1e3).toFixed(2);s.logger.debug(`Connection ended after ${G}s`),await s.cleanup();},"cleanup");return Ot.create({pluginAPI:C,transport:d,cleanup:F,projectId:o,apiKey:a,serverUrl:t?.serverUrl,requestId:s.requestId})}catch(d){throw await s.cleanup(),d}}r(Mr,"connect");async function wa(n,e,t,i){let o=await Mr(n,t,i);try{return await e(o)}finally{await o.disconnect();}}r(wa,"withConnection");
13
13
 
14
- export { ft as BooleanField, Ie as BooleanVariable, Me as BorderVariable, Ft as CollectionReferenceField, yt as ColorField, De as ColorVariable, He as ComponentInstanceNode, re as ComponentNode, Oe as ConicGradient, It as DateField, ke as DateVariable, oe as DesignPageNode, H as EnumCase, St as EnumField, Fe as EnumVariable, se as ErrorCode, Tt as FieldDivider, Pt as FileField, Ne as FileVariable, xt as FormattedTextField, Se as FormattedTextVariable, U as FrameNode, D as FramerAPIError, q as FramerPluginClosedError, Xe as FramerPluginError, we as ImageField, ve as ImageVariable, Be as LinearGradient, Ct as LinkField, Ee as LinkVariable, Dt as MultiCollectionReferenceField, ht as NumberField, Te as NumberVariable, Ue as RadialGradient, Ke as SVGNode, bt as StringField, Pe as StringVariable, ne as TextNode, Re as UnsupportedComputedValue, Ve as UnsupportedField, Ae as UnsupportedVariable, Ye as VectorSet, kt as VectorSetItem, $e as VectorSetItemNode, je as VectorSetNode, ie as WebPageNode, Zo as configure, Mr as connect, ae as framer, ml as hasGridLayout, pl as hasStackLayout, Oi as isBreakpoint, Go as isCodeFileComponentExport, Ko as isCodeFileOverrideExport, pe as isColorStyle, Ui as isComponentGestureVariant, ge as isComponentInstanceNode, $i as isComponentNode, uo as isComponentVariable, gn as isComponentVariant, xo as isComputedValue, Hi as isDesignPageNode, co as isField, mo as isFileAsset, Et as isFrameNode, fo as isImageAsset, Jo as isRetryableError, Gi as isSVGNode, zi as isTextNode, mn as isTextStyle, _n as isVariable, _i as isVectorSetItemNode, ji as isVectorSetNode, Ki as isWebPageNode, zs as supportsAspectRatio, Hs as supportsBackgroundColor, js as supportsBackgroundColorData, Ys as supportsBackgroundGradient, Xs as supportsBackgroundGradientData, _s as supportsBackgroundImage, qs as supportsBackgroundImageData, el as supportsBorder, Qs as supportsBorderRadius, Wo as supportsBreakpoint, ol as supportsComponentInfo, Bi as supportsComponentVariant, al as supportsFont, sl as supportsFontData, cl as supportsImageRendering, ll as supportsInlineTextStyle, dl as supportsInlineTextStyleData, Ri as supportsLayout, ul as supportsLink, $s as supportsLocked, Gs as supportsName, Js as supportsOpacity, rl as supportsOverflow, Bs as supportsPins, Rs as supportsPosition, Zs as supportsRotation, tl as supportsSVG, Us as supportsSize, Os as supportsSizeConstraints, nl as supportsTextTruncation, Ks as supportsVisible, il as supportsZIndex, Aa as withConnection };
14
+ export { ft as BooleanField, Ie as BooleanVariable, Me as BorderVariable, Ft as CollectionReferenceField, yt as ColorField, De as ColorVariable, He as ComponentInstanceNode, re as ComponentNode, Oe as ConicGradient, It as DateField, ke as DateVariable, oe as DesignPageNode, H as EnumCase, St as EnumField, Fe as EnumVariable, se as ErrorCode, Tt as FieldDivider, Pt as FileField, Ne as FileVariable, xt as FormattedTextField, Se as FormattedTextVariable, U as FrameNode, D as FramerAPIError, q as FramerPluginClosedError, Xe as FramerPluginError, we as ImageField, ve as ImageVariable, Be as LinearGradient, Ct as LinkField, Ee as LinkVariable, Dt as MultiCollectionReferenceField, ht as NumberField, Te as NumberVariable, Ue as RadialGradient, Ke as SVGNode, bt as StringField, Pe as StringVariable, ne as TextNode, Re as UnsupportedComputedValue, Ve as UnsupportedField, Ae as UnsupportedVariable, Ye as VectorSet, kt as VectorSetItem, $e as VectorSetItemNode, je as VectorSetNode, ie as WebPageNode, Zo as configure, Mr as connect, ae as framer, gl as hasGridLayout, ml as hasStackLayout, Oi as isBreakpoint, Go as isCodeFileComponentExport, Ko as isCodeFileOverrideExport, pe as isColorStyle, Ui as isComponentGestureVariant, ge as isComponentInstanceNode, $i as isComponentNode, uo as isComponentVariable, gn as isComponentVariant, xo as isComputedValue, Hi as isDesignPageNode, co as isField, mo as isFileAsset, Et as isFrameNode, fo as isImageAsset, Jo as isRetryableError, Gi as isSVGNode, zi as isTextNode, mn as isTextStyle, _n as isVariable, _i as isVectorSetItemNode, ji as isVectorSetNode, Ki as isWebPageNode, Gs as supportsAspectRatio, js as supportsBackgroundColor, _s as supportsBackgroundColorData, Xs as supportsBackgroundGradient, Zs as supportsBackgroundGradientData, qs as supportsBackgroundImage, Ys as supportsBackgroundImageData, tl as supportsBorder, el as supportsBorderRadius, Wo as supportsBreakpoint, al as supportsComponentInfo, Bi as supportsComponentVariant, sl as supportsFont, ll as supportsFontData, pl as supportsImageRendering, dl as supportsInlineTextStyle, ul as supportsInlineTextStyleData, Ri as supportsLayout, cl as supportsLink, Hs as supportsLocked, Ks as supportsName, Qs as supportsOpacity, ol as supportsOverflow, Us as supportsPins, Bs as supportsPosition, Js as supportsRotation, nl as supportsSVG, Os as supportsSize, zs as supportsSizeConstraints, il as supportsTextTruncation, $s as supportsVisible, rl as supportsZIndex, wa as withConnection };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-api",
3
- "version": "0.1.2-alpha.0",
3
+ "version": "0.1.2-alpha.1",
4
4
  "type": "module",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -39,11 +39,11 @@
39
39
  "@swc/core": "1.15.3",
40
40
  "@swc/jest": "^0.2.37",
41
41
  "@types/node": "24.10.9",
42
- "@typescript-eslint/eslint-plugin": "^8.40.0",
43
- "@typescript-eslint/parser": "^8.40.0",
42
+ "@typescript-eslint/eslint-plugin": "^8.55.0",
43
+ "@typescript-eslint/parser": "^8.55.0",
44
44
  "eslint": "^8.57.1",
45
45
  "eslint-plugin-framer-studio": "1.0.0",
46
- "framer-plugin": "3.10.4-alpha.0",
46
+ "framer-plugin": "3.11.0-alpha.4",
47
47
  "jest": "29.4.1",
48
48
  "tsup": "^8.0.2",
49
49
  "tsx": "^4.19.2",
@@ -53,6 +53,9 @@
53
53
  "imports": {
54
54
  "#framer-plugin/*": "../plugin-api/src/*"
55
55
  },
56
+ "engines": {
57
+ "node": ">=22"
58
+ },
56
59
  "publishConfig": {
57
60
  "registry": "https://registry.npmjs.org"
58
61
  }