framer-api 0.0.1-alpha.6 → 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3230,7 +3230,7 @@ type NamespaceMembers<Class, Namespace extends string, Parent = undefined> = {
3230
3230
  [Member in Exclude<keyof Class, keyof Parent> as Member extends string ? `${Namespace}.${Member}` : never]: Class[Member];
3231
3231
  };
3232
3232
  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">;
3233
- declare const unprotectedMessageTypesSource: ["closeNotification", "closePlugin", "getActiveCollection", "getActiveLocale", "getActiveManagedCollection", "getCanvasRoot", "getChildren", "getCollection", "getCollectionFields", "getCollectionFields2", "getCollectionItems", "getCollectionItems2", "getCollections", "getColorStyle", "getColorStyles", "getCurrentUser", "getCurrentUser2", "getCustomCode", "getDefaultLocale", "getFont", "getFonts", "getImage", "getImageData", "getLocales", "getLocalizationGroups", "getManagedCollection", "getManagedCollectionFields", "getManagedCollectionFields2", "getManagedCollectionItemIds", "getManagedCollections", "getNode", "getNodesWithAttribute", "getNodesWithAttributeSet", "getNodesWithType", "getParent", "getPluginData", "getPluginDataForNode", "getPluginDataKeys", "getPluginDataKeysForNode", "getProjectInfo", "getProjectInfo2", "getPublishInfo", "getRect", "getSelection", "getSVGForNode", "getText", "getTextForNode", "getTextStyle", "getTextStyles", "hideUI", "setBackgroundMessage", "notify", "onPointerDown", "setActiveCollection", "setSelection", "showUI", "getCodeFileVersionContent", "lintCode", "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", "getChangedPagePaths", "getChangeAuthors", "getDeployments", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions"];
3233
+ declare const unprotectedMessageTypesSource: ["closeNotification", "closePlugin", "getActiveCollection", "getActiveLocale", "getActiveManagedCollection", "getCanvasRoot", "getChildren", "getCollection", "getCollectionFields", "getCollectionFields2", "getCollectionItems", "getCollectionItems2", "getCollections", "getColorStyle", "getColorStyles", "getCurrentUser", "getCurrentUser2", "getCustomCode", "getDefaultLocale", "getFont", "getFonts", "getImage", "getImageData", "getLocales", "getLocalizationGroups", "getManagedCollection", "getManagedCollectionFields", "getManagedCollectionFields2", "getManagedCollectionItemIds", "getManagedCollections", "getNode", "getNodesWithAttribute", "getNodesWithAttributeSet", "getNodesWithType", "getParent", "getPluginData", "getPluginDataForNode", "getPluginDataKeys", "getPluginDataKeysForNode", "getProjectInfo", "getProjectInfo2", "getPublishInfo", "getRect", "getSelection", "getSVGForNode", "getText", "getTextForNode", "getTextStyle", "getTextStyles", "hideUI", "setBackgroundMessage", "notify", "onPointerDown", "setActiveCollection", "setSelection", "showUI", "getCodeFileVersionContent", "lintCode", "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"];
3234
3234
  type UnprotectedMessageType = (typeof unprotectedMessageTypesSource)[number];
3235
3235
  type ProtectedMessageType = Exclude<keyof PluginMessageAPI, UnprotectedMessageType>;
3236
3236
  type Method = keyof {
@@ -3461,9 +3461,9 @@ declare const methodToMessageTypes: {
3461
3461
  /** @alpha */
3462
3462
  readonly deploy: ["deploy"];
3463
3463
  /** @alpha */
3464
- readonly getChangedPagePaths: [];
3464
+ readonly getChangedPaths: [];
3465
3465
  /** @alpha */
3466
- readonly getChangeAuthors: [];
3466
+ readonly getChangeContributors: [];
3467
3467
  readonly createCollection: ["createCollection"];
3468
3468
  /** @alpha */
3469
3469
  readonly createManagedCollection: ["createManagedCollection"];
@@ -4134,11 +4134,10 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
4134
4134
  */
4135
4135
  deploy(deploymentId: string, domains?: string[]): Promise<Hostname[]>;
4136
4136
  /**
4137
- * Get paths of pages changed between versions.
4138
- * currently only intended to be used by framer-api
4137
+ * Get paths of pages changed in the latest unpublished changes.
4139
4138
  * @alpha
4140
4139
  */
4141
- getChangedPagePaths(fromVersion?: number, toVersion?: number): Promise<{
4140
+ getChangedPaths(): Promise<{
4142
4141
  added: string[];
4143
4142
  removed: string[];
4144
4143
  modified: string[];
@@ -4148,7 +4147,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
4148
4147
  * currently only intended to be used by framer-api
4149
4148
  * @alpha
4150
4149
  */
4151
- getChangeAuthors(fromVersion?: number, toVersion?: number): Promise<string[]>;
4150
+ getChangeContributors(fromVersion?: number, toVersion?: number): Promise<string[]>;
4152
4151
  /**
4153
4152
  * Create a new managed collection.
4154
4153
  * currently only intended to be used by framer-api
@@ -4308,7 +4307,6 @@ interface PluginMessageAPI {
4308
4307
  addManagedCollectionItems: (id: NodeId, items: ApiV2ManagedCollectionItemInput[]) => Promise<void>;
4309
4308
  addManagedCollectionItems2: (id: NodeId, items: ManagedCollectionItemInput[]) => Promise<void>;
4310
4309
  removeManagedCollectionItems: (id: NodeId, itemIds: string[]) => Promise<void>;
4311
- /** @beta */
4312
4310
  createCollection: (name: string) => Promise<CollectionData>;
4313
4311
  getCollection: (id: NodeId) => Promise<CollectionData | null>;
4314
4312
  getActiveCollection: () => Promise<CollectionData | null>;
@@ -4403,13 +4401,13 @@ interface PluginMessageAPI {
4403
4401
  /** @alpha */
4404
4402
  deploy: (deploymentId: string, domains?: string[]) => Promise<Hostname[]>;
4405
4403
  /** @alpha */
4406
- getChangedPagePaths: (fromVersion?: number, toVersion?: number) => Promise<{
4404
+ getChangedPaths: () => Promise<{
4407
4405
  added: string[];
4408
4406
  removed: string[];
4409
4407
  modified: string[];
4410
4408
  }>;
4411
4409
  /** @alpha */
4412
- getChangeAuthors: (fromVersion?: number, toVersion?: number) => Promise<string[]>;
4410
+ getChangeContributors: (fromVersion?: number, toVersion?: number) => Promise<string[]>;
4413
4411
  /** @alpha */
4414
4412
  createManagedCollection: (name: string) => Promise<CollectionData>;
4415
4413
  [getAiServiceInfoMessageType]: () => Promise<AiServiceInfo>;
@@ -4731,8 +4729,8 @@ declare const enabledMethods: {
4731
4729
  publish: true;
4732
4730
  getDeployments: true;
4733
4731
  deploy: true;
4734
- getChangedPagePaths: true;
4735
- getChangeAuthors: true;
4732
+ getChangedPaths: true;
4733
+ getChangeContributors: true;
4736
4734
  createManagedCollection: true;
4737
4735
  createCollection: true;
4738
4736
  getVectorSets: true;
package/dist/index.js CHANGED
@@ -2,14 +2,14 @@ import { WebSocket } from 'unenv/node/http';
2
2
  import Wo from 'unenv/node/process';
3
3
  import * as it from 'devalue';
4
4
 
5
- /* Framer API SDK v0.0.1-alpha.6 */
5
+ /* Framer API SDK v0.0.1-beta.0 */
6
6
  var br=Object.defineProperty;var r=(i,e)=>br(i,"name",{value:e,configurable:true});function ot(i){return i!==undefined}r(ot,"isDefined");function Ei(i){return i===undefined}r(Ei,"isUndefined");function b(i){return i===null}r(b,"isNull");function Vi(i){return i!==null}r(Vi,"isNotNull");function he(i){return i===true||i===false}r(he,"isBoolean");function g(i){return typeof i=="string"}r(g,"isString");function G(i){return typeof i=="number"&&Number.isFinite(i)}r(G,"isNumber");function xr(i){return typeof i=="function"}r(xr,"isFunction");function v(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(v,"isObject");function at(i){if(typeof i!="object"||i===null)return false;let e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}r(at,"isPlainObject");function Rt(i){return Array.isArray(i)}r(Rt,"isArray");function st(i,e){throw e||new Error(i?`Unexpected value: ${i}`:"Application entered invalid state")}r(st,"assertNever");function m(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
7
7
  `);n[1]?.includes("assert")?(n.splice(1,1),t.stack=n.join(`
8
8
  `)):n[0]?.includes("assert")&&(n.splice(0,1),t.stack=n.join(`
9
- `));}catch{}throw t}r(m,"assert");function S(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!xr(t)||S(t);}return Object.freeze(i)}r(S,"deepFreeze");function Ai(i){return [i.slice(0,-1),i.at(-1)]}r(Ai,"splitRestAndLast");var c="__class";var Bt=Symbol(),Ut=Symbol(),Cr=Symbol(),Ir=Symbol(),Tr=Symbol(),Pr=Symbol(),Ot=Symbol(),zt=Symbol(),l={getAiServiceInfo:Bt,sendTrackingEvent:Ut,environmentInfo:Cr,showUncheckedPermissionToasts:Ir,marshal:Tr,unmarshal:Pr,getHTMLForNode:Ot,setHTMLForNode:zt},lt="INTERNAL_",dt=`${lt}getAiServiceInfo`,ut=`${lt}sendTrackingEvent`,ae=`${lt}getHTMLForNode`,se=`${lt}setHTMLForNode`;var N=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(b(t))return null;let n=this.constructor;return new n(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},M="Variable";function E(i){let e=i.at(0);return m(!Ei(e)),`${e.toLowerCase()}${i.slice(1,-M.length)}`}r(E,"classToType");var Sr=`Boolean${M}`,Fr=E(Sr),be=class i extends N{static{r(this,"BooleanVariable");}type=Fr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Dr=`Number${M}`,vr=E(Dr),xe=class i extends N{static{r(this,"NumberVariable");}type=vr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Nr=`String${M}`,kr=E(Nr),Ce=class i extends N{static{r(this,"StringVariable");}type=kr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Mr=`FormattedText${M}`,Er=E(Mr),Ie=class i extends N{static{r(this,"FormattedTextVariable");}type=Er;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Vr=`Enum${M}`,Ar=E(Vr),K=class i{static{r(this,"EnumCase");}#e;#t;#i;#n;get id(){return this.#n.id}get name(){return this.#n.name}get nameByLocale(){return this.#n.nameByLocale}constructor(e,t,n,o){this.#e=e,this.#t=t,this.#i=n,this.#n=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#i,this.id,e);return t?new i(this.#e,this.#t,this.#i,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#i,this.id);}},Te=class i extends N{static{r(this,"EnumVariable");}type=Ar;#e;#t;#i;get cases(){return this.#i||(this.#i=S(this.#t.cases.map(e=>new K(this.#e,this.nodeId,this.id,e)))),this.#i}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new K(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},wr=`Color${M}`,Wr=E(wr),Pe=class i extends N{static{r(this,"ColorVariable");}type=Wr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Lr=`Image${M}`,Rr=E(Lr),Se=class i extends N{static{r(this,"ImageVariable");}type=Rr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Br=`File${M}`,Ur=E(Br),Fe=class i extends N{static{r(this,"FileVariable");}type=Ur;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Or=`Link${M}`,zr=E(Or),De=class i extends N{static{r(this,"LinkVariable");}type=zr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Gr=`Date${M}`,Kr=E(Gr),ve=class i extends N{static{r(this,"DateVariable");}type=Kr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},$r=`Border${M}`,Hr=E($r),Ne=class i extends N{static{r(this,"BorderVariable");}type=Hr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},jr=`Unsupported${M}`,_r=E(jr),ke=class i extends N{static{r(this,"UnsupportedVariable");}type=_r;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}};function wi(i){return i instanceof N}r(wi,"isVariable");function qr(i){return wi(i)&&i.nodeType==="component"}r(qr,"isComponentVariable");var W=class{static{r(this,"FieldBase");}#e;#t;#i;get id(){return this.#i.id}get name(){return this.#i.name}constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[n]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(m(ot(n)),b(n))return null;m(n.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,n)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},A=class extends W{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,n){super(e,t,n),this.#e=n;}},ct=class extends W{static{r(this,"BooleanField");}type=$t},pt=class extends W{static{r(this,"ColorField");}type=Ht},mt=class extends W{static{r(this,"NumberField");}type=jt},gt=class extends A{static{r(this,"StringField");}type=_t;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},ft=class extends A{static{r(this,"FormattedTextField");}type=qt},Me=class extends A{static{r(this,"ImageField");}type=Yt},yt=class extends A{static{r(this,"LinkField");}type=Zt},ht=class extends A{static{r(this,"DateField");}type=Jt},bt=class extends W{static{r(this,"FieldDivider");}type=ni},Ee=class extends W{static{r(this,"UnsupportedField");}type=ri},xt=class extends A{static{r(this,"FileField");}type=Qt;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,n){super(e,t,n),this.#e=n;}},Ct=class extends W{static{r(this,"EnumField");}type=ei;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new K(this.#e,this.#t,this.id,e)),S(this.#n)),this.#n}constructor(e,t,n){super(e,t,n),this.#e=e,this.#t=t,this.#i=n;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new K(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},It=class extends A{static{r(this,"CollectionReferenceField");}type=ti;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Tt=class extends A{static{r(this,"MultiCollectionReferenceField");}type=ii;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Gt=class extends A{static{r(this,"ArrayField");}type=Xt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Me(e,t,o)];}};function Kt(i,e,t){return i.map(n=>{switch(n.type){case $t:return new ct(e,t,n);case Ht:return new pt(e,t,n);case jt:return new mt(e,t,n);case _t:return new gt(e,t,n);case qt:return new ft(e,t,n);case Yt:return new Me(e,t,n);case Zt:return new yt(e,t,n);case Jt:return new ht(e,t,n);case ni:return new bt(e,t,n);case ri:return new Ee(e,t,n);case Qt:return new xt(e,t,n);case ei:return new Ct(e,t,n);case ti:return new It(e,t,n);case ii:return new Tt(e,t,n);case Xt:return new Gt(e,t,n);default:return new Ee(e,t,n)}})}r(Kt,"fieldDefinitionDataArrayToFieldClassInstances");function Yr(i){return i instanceof W}r(Yr,"isField");var Wi="action";function Xr(i){return !!i&&Wi in i&&g(i[Wi])}r(Xr,"isLocalizedValueUpdate");function Li(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return Xr(n)&&(e[t]=n),e},{})}r(Li,"filterInlineLocalizationValues");var Ve=class i{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function Zr(i){return i instanceof Ve}r(Zr,"isFileAsset");var Jr="ImageAsset";function Ri(i){return v(i)?i[c]===Jr:false}r(Ri,"isImageAssetData");var $=class i{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new i(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return to(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),n=new Blob([t],{type:e});return createImageBitmap(n)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((n,o)=>{let a=new Image;a.onload=()=>n(a),a.onerror=()=>o(),a.src=t;})}};function Qr(i){return i instanceof $}r(Qr,"isImageAsset");function H(i){return i.type==="bytes"?[i.bytes.buffer]:[]}r(H,"getTransferable");function eo(i){if(!v(i))return false;let e="bytes",t="mimeType";return !(!(e in i)||!(t in i)||!(i[e]instanceof Uint8Array)||!g(i[t]))}r(eo,"isBytesData");async function Ae(i){if(i instanceof File)return si(i);let e=await Bi(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}r(Ae,"createImageTransferFromInput");async function oi(i){if(i instanceof File)return si(i);let e=await Bi(i.file);return {name:i.name,...e}}r(oi,"createFileTransferFromInput");async function Bi(i){return i instanceof File?si(i):eo(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}r(Bi,"createAssetTransferFromAssetInput");function ai(i){return Promise.all(i.map(Ae))}r(ai,"createNamedAssetDataTransferFromInput");async function si(i){return new Promise((e,t)=>{let n=new FileReader;n.onload=o=>{let a=i.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(s);e({bytes:d,mimeType:a,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}r(si,"getAssetDataFromFile");async function to(i){let e=i instanceof File,t=e?URL.createObjectURL(i):i,n=new Image;return n.crossOrigin="anonymous",new Promise((o,a)=>{n.onload=()=>{o({width:n.naturalWidth,height:n.naturalHeight});},n.onerror=s=>{a(s);},n.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(to,"measureImage");var Pt=class{static{r(this,"ComputedValueBase");}};var io="unsupported",we=class i extends Pt{static{r(this,"UnsupportedComputedValue");}type=io;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return this.#e}};function no(i){return i instanceof Pt}r(no,"isComputedValue");var ro="Font";function Oi(i){return v(i)&&i[c]===ro}r(Oi,"isFontData");function oo(i){if(!G(i))return false;switch(i){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(oo,"isFontWeight");function ao(i){if(!g(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}r(ao,"isFontStyle");function zi(i){return v(i)?g(i.family)&&g(i.selector)&&oo(i.weight)&&ao(i.style):false}r(zi,"isFont");var B=class i{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let n=Ui.get(t.selector);if(n)return n;let o=new i(t);return Ui.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Ui=new Map;var so="LinearGradient",lo="RadialGradient",uo="ConicGradient",le=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})}},We=class i extends le{static{r(this,"LinearGradient");}[c]=so;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Le=class i extends le{static{r(this,"RadialGradient");}[c]=lo;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,n)=>{m(g(t.color),"ColorStyle not supported yet");let o=this.stops[n+1],a=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${a*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},Re=class i extends le{static{r(this,"ConicGradient");}[c]=uo;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function Gi(i){return i instanceof le}r(Gi,"isGradient");var co="ColorStyle";function St(i){return v(i)?i[c]===co:false}r(St,"isColorStyleData");var X=class i{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function de(i){return i instanceof X}r(de,"isColorStyle");var po="TextStyle";function Ki(i){return v(i)?i[c]===po:false}r(Ki,"isTextStyleData");var Be=class i{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=B[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&B[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&B[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&B[l.unmarshal](e,t.boldItalicFont),this.color=St(t.color)?X[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=St(t.decorationColor)?X[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:de(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:de(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function li(i){return i instanceof Be}r(li,"isTextStyle");function mo(i){return v(i)&&l.marshal in i}r(mo,"isSelfMarshalable");function L(i){if(mo(i))return i[l.marshal]();if(Rt(i))return i.map(L);if(at(i)){let e={};for(let t of Object.keys(i))e[t]=L(i[t]);return e}return i}r(L,"marshal");var $i={ColorStyle:X,ConicGradient:Re,FileAsset:Ve,Font:B,ImageAsset:$,LinearGradient:We,RadialGradient:Le,TextStyle:Be,BooleanVariable:be,BorderVariable:Ne,ColorVariable:Pe,DateVariable:ve,EnumVariable:Te,FileVariable:Fe,FormattedTextVariable:Ie,ImageVariable:Se,LinkVariable:De,NumberVariable:xe,StringVariable:Ce,UnsupportedVariable:ke,UnsupportedComputedValue:we};function go(i){return at(i)&&g(i[c])&&i[c]in $i}r(go,"isSelfUnmarshalable");function h(i,e){if(go(e))return $i[e[c]][l.unmarshal](i,e);if(Rt(e))return e.map(t=>h(i,t));if(at(e)){let t={};for(let n of Object.keys(e))t[n]=h(i,e[n]);return t}return e}r(h,"unmarshal");var fo={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 yo(i){return fo[i]}r(yo,"isSupportedArrayItemFieldType");function ho(i){return yo(i.type)}r(ho,"isSupportedArrayItemFieldDataEntry");var $t="boolean",Ht="color",jt="number",_t="string",qt="formattedText",Yt="image",Xt="array",Zt="link",Jt="date",Qt="file",ei="enum",ti="collectionReference",ii="multiCollectionReference",ni="divider",ri="unsupported";function bo(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?Li(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}r(bo,"sanitizeEnumFieldForMessage");function Hi(i,e){let t={};for(let n in i){let o=i[n];if(!o)continue;if(o.type!=="array"){t[n]=h(e,o);continue}let a=o.value.map(s=>{let d=Hi(s.fieldData,e),T={};for(let C in d){let D=d[C];m(D&&ho(D),"Unsupported array item field data entry"),T[C]=D;}return {...s,fieldData:T}});t[n]={...o,value:a};}return t}r(Hi,"deserializeFieldData");var ue=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,m(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,S(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=bo(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)}},Z=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 Kt(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return m(t.every(Vi)),Kt(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 Ue(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)}},Ue=class i{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=Hi(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=n,this.#e=t,S(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new i(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var xo={fixed:true,sticky:true,absolute:true,relative:true},ji="position";function Is(i){if(!(ji in i))return false;let e=i[ji];return g(e)&&xo[e]===true}r(Is,"supportsPosition");var _i="top";function Ts(i){if(!(_i in i))return false;let e=i[_i];return g(e)||b(e)}r(Ts,"supportsPins");var qi="width";function Ps(i){if(!(qi in i))return false;let e=i[qi];return g(e)||b(e)}r(Ps,"supportsSize");var Yi="maxWidth";function Ss(i){if(!(Yi in i))return false;let e=i[Yi];return g(e)||b(e)}r(Ss,"supportsSizeConstraints");var Xi="aspectRatio";function Fs(i){if(!(Xi in i))return false;let e=i[Xi];return G(e)||b(e)}r(Fs,"supportsAspectRatio");var Zi="name";function Ds(i){if(!(Zi in i))return false;let e=i[Zi];return g(e)||b(e)}r(Ds,"supportsName");var Ji="visible";function vs(i){if(!(Ji in i))return false;let e=i[Ji];return he(e)}r(vs,"supportsVisible");var Qi="locked";function Ns(i){if(!(Qi in i))return false;let e=i[Qi];return he(e)}r(Ns,"supportsLocked");var en="backgroundColor";function ks(i){if(!(en in i))return false;let e=i[en];return g(e)||de(e)||b(e)}r(ks,"supportsBackgroundColor");var tn="backgroundColor";function Ms(i){if(!(tn in i))return false;let e=i[tn];return g(e)||St(e)||b(e)}r(Ms,"supportsBackgroundColorData");var nn="backgroundImage";function Es(i){if(!(nn in i))return false;let e=i[nn];return e instanceof $||b(e)}r(Es,"supportsBackgroundImage");var rn="backgroundImage";function Vs(i){if(!(rn in i))return false;let e=i[rn];return e instanceof $?false:Ri(e)||b(e)}r(Vs,"supportsBackgroundImageData");var on="backgroundGradient";function As(i){if(!(on in i))return false;let e=i[on];return Gi(e)||b(e)}r(As,"supportsBackgroundGradient");var an="backgroundGradient";function ws(i){if(!(an in i))return false;let e=i[an];return v(e)||b(e)}r(ws,"supportsBackgroundGradientData");var sn="rotation";function Ws(i){if(!(sn in i))return false;let e=i[sn];return G(e)}r(Ws,"supportsRotation");var ln="opacity";function Ls(i){if(!(ln in i))return false;let e=i[ln];return G(e)}r(Ls,"supportsOpacity");var dn="borderRadius";function Rs(i){if(!(dn in i))return false;let e=i[dn];return g(e)||b(e)}r(Rs,"supportsBorderRadius");var un="border";function Bs(i){if(!(un in i))return false;let e=i[un];return b(e)||de(e.color)}r(Bs,"supportsBorder");var cn="svg";function Us(i){if(!(cn in i))return false;let e=i[cn];return g(e)}r(Us,"supportsSVG");var pn="textTruncation";function Os(i){if(!(pn in i))return false;let e=i[pn];return G(e)||b(e)}r(Os,"supportsTextTruncation");var mn="zIndex";function zs(i){if(!(mn in i))return false;let e=i[mn];return G(e)||b(e)}r(zs,"supportsZIndex");var gn="overflow";function Gs(i){if(!(gn in i))return false;let e=i[gn];return g(e)||b(e)}r(Gs,"supportsOverflow");var fn="componentIdentifier";function Ks(i){if(!(fn in i))return false;let e=i[fn];return g(e)}r(Ks,"supportsComponentInfo");var yn="font";function $s(i){if(!(yn in i))return false;let e=i[yn];return zi(e)}r($s,"supportsFont");var hn="font";function Hs(i){if(!(hn in i))return false;let e=i[hn];return Oi(e)||b(e)}r(Hs,"supportsFontData");var bn="inlineTextStyle";function js(i){if(!(bn in i))return false;let e=i[bn];return li(e)||b(e)}r(js,"supportsInlineTextStyle");var xn="inlineTextStyle";function _s(i){if(!(xn in i))return false;let e=i[xn];return Ki(e)||b(e)}r(_s,"supportsInlineTextStyleData");var Cn="link";function qs(i){if(!(Cn in i))return false;let e=i[Cn];return g(e)||b(e)}r(qs,"supportsLink");var In="imageRendering";function Ys(i){if(!(In in i))return false;let e=i[In];return g(e)||b(e)}r(Ys,"supportsImageRendering");var Tn="layout";function Fn(i){if(!(Tn in i))return false;let e=i[Tn];return g(e)||b(e)}r(Fn,"supportsLayout");function Xs(i){return Fn(i)?i.layout==="stack":false}r(Xs,"hasStackLayout");function Zs(i){return Fn(i)?i.layout==="grid":false}r(Zs,"hasGridLayout");var Pn="isVariant";function Dn(i){if(!(Pn in i))return false;let e=i[Pn];return he(e)}r(Dn,"supportsComponentVariant");function di(i){return Dn(i)?i.isVariant:false}r(di,"isComponentVariant");function vn(i){return !Dn(i)||!di(i)?false:!b(i.gesture)}r(vn,"isComponentGestureVariant");var Sn="isBreakpoint";function Co(i){if(!(Sn in i))return false;let e=i[Sn];return he(e)}r(Co,"supportsBreakpoint");function Nn(i){return Co(i)?i.isBreakpoint:false}r(Nn,"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 J(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return J(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>x(n,this.#e))}async getNodesWithAttribute(e){return J(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>x(n,this.#e))}async getNodesWithAttributeSet(e){return J(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>x(n,this.#e))}async*walk(){if(yield this,!J(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)}},R=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);}},Q=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(se,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(ae,this.id)}},Oe=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);}},ze=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)}},Ge=class extends V{static{r(this,"ComponentInstanceNode");}[c]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#i;get typedControls(){return this.#i||(this.#i=h(this.#e,this.#t.typedControls)??{}),this.#i}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=h(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,S(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},ee=class extends V{static{r(this,"WebPageNode");}[c]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,S(this);}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let n=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=x(n,this.#e);return m(o instanceof R),m(Nn(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Ue(e,this.#e):null}},te=class extends V{static{r(this,"ComponentNode");}[c]="ComponentNode";name;componentIdentifier;insertURL;componentName;#e;constructor(e,t){super(e,t),this.#e=t,this.componentIdentifier=e.componentIdentifier,this.insertURL=e.insertURL??null,this.componentName=e.componentName??null,this.name=e.name??null,S(this);}async addVariant(e,t){let n=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!n)throw new Error("Failed to add variant to component");let o=x(n,this.#e);return m(o instanceof R),m(di(o),"Node is not a component variant"),o}async addGestureVariant(e,t,n){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,n);if(!o)throw new Error("Failed to add state to component");let a=x(o,this.#e);return m(a instanceof R),m(vn(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,L(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);}},Ke=class extends V{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},ie=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 x(i,e){switch(i[c]){case "DesignPageNode":return new ie(i,e);case "WebPageNode":return new ee(i,e);case "ComponentNode":return new te(i,e);case "VectorSetNode":return new Ke(i,e);case "VectorSetItemNode":return new ze(i,e);case "ComponentInstanceNode":return new Ge(i,e);case "FrameNode":return new R(i,e);case "SVGNode":return new Oe(i,e);case "TextNode":return new Q(i,e);case "UnknownNode":return new $e(i,e);default:return new $e(i,e)}}r(x,"convertRawNodeDataToNode");function Ft(i){return i instanceof R}r(Ft,"isFrameNode");function kn(i){return i instanceof Q}r(kn,"isTextNode");function Mn(i){return i instanceof Oe}r(Mn,"isSVGNode");function ce(i){return i instanceof Ge}r(ce,"isComponentInstanceNode");function En(i){return i instanceof ee}r(En,"isWebPageNode");function Vn(i){return i instanceof te}r(Vn,"isComponentNode");function An(i){return i instanceof ie}r(An,"isDesignPageNode");function wn(i){return i instanceof Ke}r(wn,"isVectorSetNode");function Wn(i){return i instanceof ze}r(Wn,"isVectorSetItemNode");function J(i){return i instanceof $e}r(J,"isUnknownNode");function He(i){return !!(Ft(i)||kn(i)||ce(i)||Mn(i)||Wn(i)||J(i))}r(He,"isCanvasNode");function ui(i){return !!(En(i)||An(i)||Vn(i)||wn(i)||J(i))}r(ui,"isCanvasRootNode");var je=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 Dt(t,this.#e))}},Dt=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 _e=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},j=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function Io(i){return i.type==="separator"}r(Io,"isSeparatorMenuItem");function vt(i,e){let t=[];for(let n of i){if(Io(n)){t.push(n);continue}let{onAction:o,...a}=n,s=a;if(n.onAction){let d=Math.random();e.set(d,n.onAction),s.actionId=d;}n.submenu&&(s.submenu=vt(n.submenu,e)),t.push(s);}return t}r(vt,"addMenuItemsToOnActionCallbackMap");var Nt="type",Ln={[Nt]:"pluginReadySignal"},Po="pluginReadyResponse";var So={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function Rn(i){return v(i)&&g(i[Nt])&&i[Nt]in So}r(Rn,"isVekterToPluginNonHandshakeMessage");function Bn(i){return v(i)&&i[Nt]===Po}r(Bn,"isPluginReadyResponse");var Fo=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions"],Do=["closeNotification","closePlugin","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","lintCode","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","getChangedPagePaths","getChangeAuthors","getDeployments",dt,ut,ae,"getAiServiceInfo","sendTrackingEvent",...Fo];new Set(Do);var ci={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[se],"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"],publish:["publish"],getDeployments:[],deploy:["deploy"],getChangedPagePaths:[],getChangeAuthors:[],createCollection:["createCollection"],createManagedCollection:["createManagedCollection"],[Bt]:[],[Ut]:[],[Ot]:[],[zt]:[]},kt=[];for(let i of Object.keys(ci))ci[i].length!==0&&kt.push(i);S(kt);function pi(i){let e={};for(let t of kt){let n=ci[t];e[t]=n.every(o=>i[o]);}return e}r(pi,"createPerMethodPermissionMap");function Un(){let i={};for(let e of kt)i[e]=true;return i}r(Un,"createPerMethodPermissionMapForTesting");var pe=null;function On(i){if(typeof window>"u")return;if(!pe){let t=document.createElement("style");document.head.appendChild(t),pe=t.sheet;}if(!pe){i();return}let e=pe.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe&&pe.deleteRule(e);});});}r(On,"withDisabledCssTransitions");var qe=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;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=Un();return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof j&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof j&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=pi(e.permissionMap),this.postMessage=(t,n)=>e.transport.send(t,n),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:st(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(L)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:a,reject:s}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let n=this.subscriptions.get(e)??new Set;return n.add(t),this.subscriptions.set(e,n),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=e=>{let t=e?.data??e;if(Rn(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=pi(t.permissionMap);for(let n of this.permissionSubscriptions)n();break}case "methodResponse":{let n=this.methodResponseHandlers.get(t.id);if(!n)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),g(t.error)?n.reject(new _e(t.error)):n.resolve(t.result);break}case "subscriptionMessage":{let{topic:n,payload:o}=t,a=this.subscriptions.get(n);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let n=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!n)throw new Error("Menu action received for an unknown menu item");n();break}default:st(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:st(t);}}applyPluginTheme=e=>{On(()=>{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?x(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?x(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?x(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=x(n,this);return m(He(o)),o})}notify=(e,t)=>{let n=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:n,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:()=>this.invoke("closeNotification",n)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=vt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=vt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function vo(i){return i.type==="component"}r(vo,"isCodeFileComponentExport");function No(i){return i.type==="override"}r(No,"isCodeFileOverrideExport");var mi=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)}},_=class i{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new i(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new i(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new mi(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 await this.#t.invoke("lintCode",this.name,this.content,e)}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var Mt=class i{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new i(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let n=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!n)return null;let o=x(n,this.#t);return m(ce(o)),o}};var ko=(()=>{let i=null;return {disableUntilMouseUp:()=>{if(i)return;i=document.createElement("style"),i.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(i);let e=r(()=>{i&&(document.head.removeChild(i),i=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),n=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",n);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",n);}r(o,"cleanup");}}})(),zn=5,Mo=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function Eo(){}r(Eo,"noop");function Gn(i,e,t,n){if(i.mode!=="canvas")return Eo;let o=Mo.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,T=ne.subscribeToIsAllowedTo("makeDraggable",p=>{p||I();}),C=r(p=>{ne.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&i.invoke("onDragEnd",{...p,dragSessionId:o}).then(y=>{try{n?.(y);}catch{}}).catch(y=>{if(y instanceof Error){n?.({status:"error",reason:y.message});return}if(typeof y=="string"){n?.({status:"error",reason:y});return}n?.({status:"error"});}),I());},"endDrag"),D=r(p=>{if(!ne.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(p.buttons>0&&!!(p.buttons&1))){C({cancelled:false});return}let{clientX:F,clientY:Y}=p;if(s.type==="pointerDown"){let ye=F-s.dragStart.mouse.x,Mi=Y-s.dragStart.mouse.y;if(Math.abs(ye)<zn&&Math.abs(Mi)<zn)return;s={type:"dragging",dragStart:s.dragStart},i.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),ko.disableUntilMouseUp();}d.setPointerCapture(p.pointerId);let P={x:F,y:Y};i.invoke("onDrag",{dragSessionId:o,mouse:P}).then(ye=>{s.type==="dragging"&&(document.body.style.cursor=ye??"");});},"handlePointerChange"),O=r(p=>{p.key==="Escape"&&C({cancelled:true});},"handleKeyDown"),z=r(()=>{C({cancelled:true});},"handleBlur"),f=r(p=>{if(!ne.isAllowedTo("makeDraggable"))return;C({cancelled:true});let y=e.getBoundingClientRect(),F={x:y.x,y:y.y,width:y.width,height:y.height},Y,P=e.querySelectorAll("svg");if(P.length===1){let rt=P.item(0).getBoundingClientRect();Y={x:rt.x,y:rt.y,width:rt.width,height:rt.height};}let ye={x:p.clientX,y:p.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:F,svgRect:Y,mouse:ye}},i.invoke("setDragData",o,t()),d.addEventListener("pointermove",D,true),d.addEventListener("pointerup",D,true),window.addEventListener("keydown",O,true),window.addEventListener("blur",z);},"handlePointerDown"),u=r(()=>{if(!ne.isAllowedTo("makeDraggable"))return;let p=t();p.type==="detachedComponentLayers"&&i.invoke("preloadDetachedComponentLayers",p.url),p.type==="image"&&i.invoke("preloadImageUrlForInsertion",p.image),p.previewImage&&i.invoke("preloadDragPreviewImage",p.previewImage);},"preload");e.addEventListener("pointerdown",f),e.addEventListener("mouseenter",u);function I(){s={type:"idle"},document.body.style.cursor=a,d.removeEventListener("pointermove",D,true),d.removeEventListener("pointerup",D,true),window.removeEventListener("keydown",O,true),window.removeEventListener("blur",z);}return r(I,"dragCleanup"),()=>{e.removeEventListener("pointerdown",f),e.removeEventListener("mouseenter",u),C({cancelled:true}),T();}}r(Gn,"makeDraggable");var me=class i{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[n]=await this.#t.invoke("addRedirects",[t]);return m(ot(n)),b(n)?null:new i(n,this.#t)}};var gi=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,n]=Ai(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,n(o));},"update");return this.#e.permissionSubscriptions.add(a),()=>{this.#e.permissionSubscriptions.delete(a);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new j}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let n=x(t,this.#e);return m(He(n)),n})}async setSelection(e){let t=g(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let n=t.map(o=>{let a=x(o,this.#e);return m(He(a)),a});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=x(e,this.#e);return m(ui(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=x(t,this.#e);m(ui(n)),e(n);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let n=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!n)return null;let o=x(n,this.#e);return m(o instanceof R),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?x(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let n=g(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",n,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,n){return this.#e.invoke("setParent",e,t,n)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(n=>x(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>x(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>x(n,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?h(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(h(this.#e,t));})}async addImage(e){let t=await Ae(e),n=H(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await Ae(e),n=H(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await Ae(e),n=H(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return h(this.#e,o)}async addImages(e){let t=await ai(e),n=t.flatMap(H);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await ai(e),n=t.flatMap(H),o=await this.#e.invokeTransferable("uploadImages",n,t);return h(this.#e,o)}async uploadFile(e){let t=await oi(e),n=await this.#e.invokeTransferable("uploadFile",H(t),t);return h(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(oi)),n=t.flatMap(H),o=await this.#e.invokeTransferable("uploadFiles",n,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:n}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:n}),a=x(o,this.#e);return m(ce(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),a=x(o,this.#e);return m(Ft(a)),a}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,n){return Gn(this.#e,e,t,n)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return m(e,"Collection data must be defined"),new ue(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return m(e,"Collections data must be defined"),e.map(t=>new ue(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new Z(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new Z(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new Z(t,this.#e))}notify=(e,t)=>this.#e.notify(e,t);async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return h(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?h(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return h(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let n=h(this.#e,t);return e(n)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return h(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?h(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return h(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let n=h(this.#e,t);return e(n)})}async getFont(e,t){let n=await this.#e.invoke("getFont",e,t);return n?h(this.#e,n):null}async getFonts(){let e=await this.#e.invoke("getFonts");return h(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(){return this.#e.invoke("getLocalizationGroups")}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new me(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new me(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new me(n,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,n){let o=await this.#e.invoke("createCodeFile",e,t,n);return new _(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new _(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new _(t,this.#e):null}lintCode(e,t,n){return this.#e.invoke("lintCode",e,t,n)}typecheckCode(e,t,n){return this.#e.invoke("typecheckCode",e,t,n)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let n=t?.map(o=>new _(o,this.#e));return e(n)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let n=t?new _(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=x(t,this.#e);return m(n instanceof ie,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=x(t,this.#e);return m(n instanceof ee,"Expected node to be a WebPageNode"),n}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new Z(t,this.#e)}},fi=class extends gi{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},Ye=class extends fi{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new Mt(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(dt)}async[l.sendTrackingEvent](e,t,n){return this.#e.invoke(ut,e,t,n)}async[l.getHTMLForNode](e){return this.#e.invoke(ae,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(se,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let n=await this.#e.invoke("createNode","TextNode",t??null,e);if(!n)return null;let o=x(n,this.#e);return m(o instanceof Q),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=x(t,this.#e);return m(n instanceof te),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new je(t,this.#e))}async publish(){return this.#e.invoke("publish")}async getDeployments(){return this.#e.invoke("getDeployments")}async deploy(e,t){return this.#e.invoke("deploy",e,t)}async getChangedPagePaths(e,t){return this.#e.invoke("getChangedPagePaths",e,t)}async getChangeAuthors(e,t){return this.#e.invoke("getChangeAuthors",e,t)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new ue(t,this.#e)}};var yi=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 Vo(){return new Promise(i=>{function e({data:t,origin:n}){if(!Bn(t))return;window.removeEventListener("message",e);let a={transport:new yi(n),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:n,theme:t.theme??null};i(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(Ln,"*");})}r(Vo,"createBrowserContext");async function Ao(){return typeof window<"u"?Vo():null}r(Ao,"bootstrap");var Kn=await Ao(),ne=Kn?new Ye(new qe(Kn)):new Proxy({},{get(i,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function $n(i){return new Ye(new qe(i))}r($n,"createFramerInstance");var Lo=Wo,Hn=Lo.env;function Ro(i){Object.assign(Hn,i);}r(Ro,"configure");function ge(i,e){return Hn[i]??e}r(ge,"getEnv");var jn=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:WebSocket,_n,qn;try{_n=await import('node:fs'),qn=await import('node:path');}catch{}var hi=_n,bi=qn;function w(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
9
+ `));}catch{}throw t}r(m,"assert");function F(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!xr(t)||F(t);}return Object.freeze(i)}r(F,"deepFreeze");function Ai(i){return [i.slice(0,-1),i.at(-1)]}r(Ai,"splitRestAndLast");var c="__class";var Bt=Symbol(),Ut=Symbol(),Cr=Symbol(),Ir=Symbol(),Tr=Symbol(),Pr=Symbol(),Ot=Symbol(),zt=Symbol(),l={getAiServiceInfo:Bt,sendTrackingEvent:Ut,environmentInfo:Cr,showUncheckedPermissionToasts:Ir,marshal:Tr,unmarshal:Pr,getHTMLForNode:Ot,setHTMLForNode:zt},lt="INTERNAL_",dt=`${lt}getAiServiceInfo`,ut=`${lt}sendTrackingEvent`,ae=`${lt}getHTMLForNode`,se=`${lt}setHTMLForNode`;var N=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(b(t))return null;let n=this.constructor;return new n(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},M="Variable";function E(i){let e=i.at(0);return m(!Ei(e)),`${e.toLowerCase()}${i.slice(1,-M.length)}`}r(E,"classToType");var Sr=`Boolean${M}`,Fr=E(Sr),be=class i extends N{static{r(this,"BooleanVariable");}type=Fr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Dr=`Number${M}`,vr=E(Dr),xe=class i extends N{static{r(this,"NumberVariable");}type=vr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Nr=`String${M}`,kr=E(Nr),Ce=class i extends N{static{r(this,"StringVariable");}type=kr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Mr=`FormattedText${M}`,Er=E(Mr),Ie=class i extends N{static{r(this,"FormattedTextVariable");}type=Er;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Vr=`Enum${M}`,Ar=E(Vr),K=class i{static{r(this,"EnumCase");}#e;#t;#i;#n;get id(){return this.#n.id}get name(){return this.#n.name}get nameByLocale(){return this.#n.nameByLocale}constructor(e,t,n,o){this.#e=e,this.#t=t,this.#i=n,this.#n=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#i,this.id,e);return t?new i(this.#e,this.#t,this.#i,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#i,this.id);}},Te=class i extends N{static{r(this,"EnumVariable");}type=Ar;#e;#t;#i;get cases(){return this.#i||(this.#i=F(this.#t.cases.map(e=>new K(this.#e,this.nodeId,this.id,e)))),this.#i}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new K(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},wr=`Color${M}`,Wr=E(wr),Pe=class i extends N{static{r(this,"ColorVariable");}type=Wr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Lr=`Image${M}`,Rr=E(Lr),Se=class i extends N{static{r(this,"ImageVariable");}type=Rr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Br=`File${M}`,Ur=E(Br),Fe=class i extends N{static{r(this,"FileVariable");}type=Ur;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Or=`Link${M}`,zr=E(Or),De=class i extends N{static{r(this,"LinkVariable");}type=zr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Gr=`Date${M}`,Kr=E(Gr),ve=class i extends N{static{r(this,"DateVariable");}type=Kr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},$r=`Border${M}`,Hr=E($r),Ne=class i extends N{static{r(this,"BorderVariable");}type=Hr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},jr=`Unsupported${M}`,_r=E(jr),ke=class i extends N{static{r(this,"UnsupportedVariable");}type=_r;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}};function wi(i){return i instanceof N}r(wi,"isVariable");function qr(i){return wi(i)&&i.nodeType==="component"}r(qr,"isComponentVariable");var W=class{static{r(this,"FieldBase");}#e;#t;#i;get id(){return this.#i.id}get name(){return this.#i.name}constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[n]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(m(ot(n)),b(n))return null;m(n.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,n)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},A=class extends W{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,n){super(e,t,n),this.#e=n;}},ct=class extends W{static{r(this,"BooleanField");}type=$t},pt=class extends W{static{r(this,"ColorField");}type=Ht},mt=class extends W{static{r(this,"NumberField");}type=jt},gt=class extends A{static{r(this,"StringField");}type=_t;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},ft=class extends A{static{r(this,"FormattedTextField");}type=qt},Me=class extends A{static{r(this,"ImageField");}type=Yt},yt=class extends A{static{r(this,"LinkField");}type=Zt},ht=class extends A{static{r(this,"DateField");}type=Jt},bt=class extends W{static{r(this,"FieldDivider");}type=ni},Ee=class extends W{static{r(this,"UnsupportedField");}type=ri},xt=class extends A{static{r(this,"FileField");}type=Qt;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,n){super(e,t,n),this.#e=n;}},Ct=class extends W{static{r(this,"EnumField");}type=ei;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new K(this.#e,this.#t,this.id,e)),F(this.#n)),this.#n}constructor(e,t,n){super(e,t,n),this.#e=e,this.#t=t,this.#i=n;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new K(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},It=class extends A{static{r(this,"CollectionReferenceField");}type=ti;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Tt=class extends A{static{r(this,"MultiCollectionReferenceField");}type=ii;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Gt=class extends A{static{r(this,"ArrayField");}type=Xt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Me(e,t,o)];}};function Kt(i,e,t){return i.map(n=>{switch(n.type){case $t:return new ct(e,t,n);case Ht:return new pt(e,t,n);case jt:return new mt(e,t,n);case _t:return new gt(e,t,n);case qt:return new ft(e,t,n);case Yt:return new Me(e,t,n);case Zt:return new yt(e,t,n);case Jt:return new ht(e,t,n);case ni:return new bt(e,t,n);case ri:return new Ee(e,t,n);case Qt:return new xt(e,t,n);case ei:return new Ct(e,t,n);case ti:return new It(e,t,n);case ii:return new Tt(e,t,n);case Xt:return new Gt(e,t,n);default:return new Ee(e,t,n)}})}r(Kt,"fieldDefinitionDataArrayToFieldClassInstances");function Yr(i){return i instanceof W}r(Yr,"isField");var Wi="action";function Xr(i){return !!i&&Wi in i&&g(i[Wi])}r(Xr,"isLocalizedValueUpdate");function Li(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return Xr(n)&&(e[t]=n),e},{})}r(Li,"filterInlineLocalizationValues");var Ve=class i{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function Zr(i){return i instanceof Ve}r(Zr,"isFileAsset");var Jr="ImageAsset";function Ri(i){return v(i)?i[c]===Jr:false}r(Ri,"isImageAssetData");var $=class i{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new i(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return to(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),n=new Blob([t],{type:e});return createImageBitmap(n)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((n,o)=>{let a=new Image;a.onload=()=>n(a),a.onerror=()=>o(),a.src=t;})}};function Qr(i){return i instanceof $}r(Qr,"isImageAsset");function H(i){return i.type==="bytes"?[i.bytes.buffer]:[]}r(H,"getTransferable");function eo(i){if(!v(i))return false;let e="bytes",t="mimeType";return !(!(e in i)||!(t in i)||!(i[e]instanceof Uint8Array)||!g(i[t]))}r(eo,"isBytesData");async function Ae(i){if(i instanceof File)return si(i);let e=await Bi(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}r(Ae,"createImageTransferFromInput");async function oi(i){if(i instanceof File)return si(i);let e=await Bi(i.file);return {name:i.name,...e}}r(oi,"createFileTransferFromInput");async function Bi(i){return i instanceof File?si(i):eo(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}r(Bi,"createAssetTransferFromAssetInput");function ai(i){return Promise.all(i.map(Ae))}r(ai,"createNamedAssetDataTransferFromInput");async function si(i){return new Promise((e,t)=>{let n=new FileReader;n.onload=o=>{let a=i.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(s);e({bytes:d,mimeType:a,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}r(si,"getAssetDataFromFile");async function to(i){let e=i instanceof File,t=e?URL.createObjectURL(i):i,n=new Image;return n.crossOrigin="anonymous",new Promise((o,a)=>{n.onload=()=>{o({width:n.naturalWidth,height:n.naturalHeight});},n.onerror=s=>{a(s);},n.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(to,"measureImage");var Pt=class{static{r(this,"ComputedValueBase");}};var io="unsupported",we=class i extends Pt{static{r(this,"UnsupportedComputedValue");}type=io;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return this.#e}};function no(i){return i instanceof Pt}r(no,"isComputedValue");var ro="Font";function Oi(i){return v(i)&&i[c]===ro}r(Oi,"isFontData");function oo(i){if(!G(i))return false;switch(i){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(oo,"isFontWeight");function ao(i){if(!g(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}r(ao,"isFontStyle");function zi(i){return v(i)?g(i.family)&&g(i.selector)&&oo(i.weight)&&ao(i.style):false}r(zi,"isFont");var B=class i{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let n=Ui.get(t.selector);if(n)return n;let o=new i(t);return Ui.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Ui=new Map;var so="LinearGradient",lo="RadialGradient",uo="ConicGradient",le=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})}},We=class i extends le{static{r(this,"LinearGradient");}[c]=so;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Le=class i extends le{static{r(this,"RadialGradient");}[c]=lo;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,n)=>{m(g(t.color),"ColorStyle not supported yet");let o=this.stops[n+1],a=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${a*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},Re=class i extends le{static{r(this,"ConicGradient");}[c]=uo;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function Gi(i){return i instanceof le}r(Gi,"isGradient");var co="ColorStyle";function St(i){return v(i)?i[c]===co:false}r(St,"isColorStyleData");var X=class i{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function de(i){return i instanceof X}r(de,"isColorStyle");var po="TextStyle";function Ki(i){return v(i)?i[c]===po:false}r(Ki,"isTextStyleData");var Be=class i{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=B[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&B[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&B[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&B[l.unmarshal](e,t.boldItalicFont),this.color=St(t.color)?X[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=St(t.decorationColor)?X[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:de(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:de(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function li(i){return i instanceof Be}r(li,"isTextStyle");function mo(i){return v(i)&&l.marshal in i}r(mo,"isSelfMarshalable");function L(i){if(mo(i))return i[l.marshal]();if(Rt(i))return i.map(L);if(at(i)){let e={};for(let t of Object.keys(i))e[t]=L(i[t]);return e}return i}r(L,"marshal");var $i={ColorStyle:X,ConicGradient:Re,FileAsset:Ve,Font:B,ImageAsset:$,LinearGradient:We,RadialGradient:Le,TextStyle:Be,BooleanVariable:be,BorderVariable:Ne,ColorVariable:Pe,DateVariable:ve,EnumVariable:Te,FileVariable:Fe,FormattedTextVariable:Ie,ImageVariable:Se,LinkVariable:De,NumberVariable:xe,StringVariable:Ce,UnsupportedVariable:ke,UnsupportedComputedValue:we};function go(i){return at(i)&&g(i[c])&&i[c]in $i}r(go,"isSelfUnmarshalable");function h(i,e){if(go(e))return $i[e[c]][l.unmarshal](i,e);if(Rt(e))return e.map(t=>h(i,t));if(at(e)){let t={};for(let n of Object.keys(e))t[n]=h(i,e[n]);return t}return e}r(h,"unmarshal");var fo={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 yo(i){return fo[i]}r(yo,"isSupportedArrayItemFieldType");function ho(i){return yo(i.type)}r(ho,"isSupportedArrayItemFieldDataEntry");var $t="boolean",Ht="color",jt="number",_t="string",qt="formattedText",Yt="image",Xt="array",Zt="link",Jt="date",Qt="file",ei="enum",ti="collectionReference",ii="multiCollectionReference",ni="divider",ri="unsupported";function bo(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?Li(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}r(bo,"sanitizeEnumFieldForMessage");function Hi(i,e){let t={};for(let n in i){let o=i[n];if(!o)continue;if(o.type!=="array"){t[n]=h(e,o);continue}let a=o.value.map(s=>{let d=Hi(s.fieldData,e),T={};for(let I in d){let P=d[I];m(P&&ho(P),"Unsupported array item field data entry"),T[I]=P;}return {...s,fieldData:T}});t[n]={...o,value:a};}return t}r(Hi,"deserializeFieldData");var ue=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,m(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,F(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=bo(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)}},Z=class{static{r(this,"Collection");}id;name;slugFieldName;slugFieldBasedOn;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.slugFieldName=e.slugFieldName,this.slugFieldBasedOn=e.slugFieldBasedOn,this.readonly=e.readonly,this.managedBy=e.managedBy,this.#e=t,F(this);}async setItemOrder(e){return this.#e.invoke("setCollectionItemOrder",this.id,e)}async getFields(){let e=await this.#e.invoke("getCollectionFields2",this.id,true);return Kt(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return m(t.every(Vi)),Kt(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 Ue(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)}},Ue=class i{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=Hi(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=n,this.#e=t,F(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new i(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var xo={fixed:true,sticky:true,absolute:true,relative:true},ji="position";function Is(i){if(!(ji in i))return false;let e=i[ji];return g(e)&&xo[e]===true}r(Is,"supportsPosition");var _i="top";function Ts(i){if(!(_i in i))return false;let e=i[_i];return g(e)||b(e)}r(Ts,"supportsPins");var qi="width";function Ps(i){if(!(qi in i))return false;let e=i[qi];return g(e)||b(e)}r(Ps,"supportsSize");var Yi="maxWidth";function Ss(i){if(!(Yi in i))return false;let e=i[Yi];return g(e)||b(e)}r(Ss,"supportsSizeConstraints");var Xi="aspectRatio";function Fs(i){if(!(Xi in i))return false;let e=i[Xi];return G(e)||b(e)}r(Fs,"supportsAspectRatio");var Zi="name";function Ds(i){if(!(Zi in i))return false;let e=i[Zi];return g(e)||b(e)}r(Ds,"supportsName");var Ji="visible";function vs(i){if(!(Ji in i))return false;let e=i[Ji];return he(e)}r(vs,"supportsVisible");var Qi="locked";function Ns(i){if(!(Qi in i))return false;let e=i[Qi];return he(e)}r(Ns,"supportsLocked");var en="backgroundColor";function ks(i){if(!(en in i))return false;let e=i[en];return g(e)||de(e)||b(e)}r(ks,"supportsBackgroundColor");var tn="backgroundColor";function Ms(i){if(!(tn in i))return false;let e=i[tn];return g(e)||St(e)||b(e)}r(Ms,"supportsBackgroundColorData");var nn="backgroundImage";function Es(i){if(!(nn in i))return false;let e=i[nn];return e instanceof $||b(e)}r(Es,"supportsBackgroundImage");var rn="backgroundImage";function Vs(i){if(!(rn in i))return false;let e=i[rn];return e instanceof $?false:Ri(e)||b(e)}r(Vs,"supportsBackgroundImageData");var on="backgroundGradient";function As(i){if(!(on in i))return false;let e=i[on];return Gi(e)||b(e)}r(As,"supportsBackgroundGradient");var an="backgroundGradient";function ws(i){if(!(an in i))return false;let e=i[an];return v(e)||b(e)}r(ws,"supportsBackgroundGradientData");var sn="rotation";function Ws(i){if(!(sn in i))return false;let e=i[sn];return G(e)}r(Ws,"supportsRotation");var ln="opacity";function Ls(i){if(!(ln in i))return false;let e=i[ln];return G(e)}r(Ls,"supportsOpacity");var dn="borderRadius";function Rs(i){if(!(dn in i))return false;let e=i[dn];return g(e)||b(e)}r(Rs,"supportsBorderRadius");var un="border";function Bs(i){if(!(un in i))return false;let e=i[un];return b(e)||de(e.color)}r(Bs,"supportsBorder");var cn="svg";function Us(i){if(!(cn in i))return false;let e=i[cn];return g(e)}r(Us,"supportsSVG");var pn="textTruncation";function Os(i){if(!(pn in i))return false;let e=i[pn];return G(e)||b(e)}r(Os,"supportsTextTruncation");var mn="zIndex";function zs(i){if(!(mn in i))return false;let e=i[mn];return G(e)||b(e)}r(zs,"supportsZIndex");var gn="overflow";function Gs(i){if(!(gn in i))return false;let e=i[gn];return g(e)||b(e)}r(Gs,"supportsOverflow");var fn="componentIdentifier";function Ks(i){if(!(fn in i))return false;let e=i[fn];return g(e)}r(Ks,"supportsComponentInfo");var yn="font";function $s(i){if(!(yn in i))return false;let e=i[yn];return zi(e)}r($s,"supportsFont");var hn="font";function Hs(i){if(!(hn in i))return false;let e=i[hn];return Oi(e)||b(e)}r(Hs,"supportsFontData");var bn="inlineTextStyle";function js(i){if(!(bn in i))return false;let e=i[bn];return li(e)||b(e)}r(js,"supportsInlineTextStyle");var xn="inlineTextStyle";function _s(i){if(!(xn in i))return false;let e=i[xn];return Ki(e)||b(e)}r(_s,"supportsInlineTextStyleData");var Cn="link";function qs(i){if(!(Cn in i))return false;let e=i[Cn];return g(e)||b(e)}r(qs,"supportsLink");var In="imageRendering";function Ys(i){if(!(In in i))return false;let e=i[In];return g(e)||b(e)}r(Ys,"supportsImageRendering");var Tn="layout";function Fn(i){if(!(Tn in i))return false;let e=i[Tn];return g(e)||b(e)}r(Fn,"supportsLayout");function Xs(i){return Fn(i)?i.layout==="stack":false}r(Xs,"hasStackLayout");function Zs(i){return Fn(i)?i.layout==="grid":false}r(Zs,"hasGridLayout");var Pn="isVariant";function Dn(i){if(!(Pn in i))return false;let e=i[Pn];return he(e)}r(Dn,"supportsComponentVariant");function di(i){return Dn(i)?i.isVariant:false}r(di,"isComponentVariant");function vn(i){return !Dn(i)||!di(i)?false:!b(i.gesture)}r(vn,"isComponentGestureVariant");var Sn="isBreakpoint";function Co(i){if(!(Sn in i))return false;let e=i[Sn];return he(e)}r(Co,"supportsBreakpoint");function Nn(i){return Co(i)?i.isBreakpoint:false}r(Nn,"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 J(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return J(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>x(n,this.#e))}async getNodesWithAttribute(e){return J(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>x(n,this.#e))}async getNodesWithAttributeSet(e){return J(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>x(n,this.#e))}async*walk(){if(yield this,!J(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)}},R=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,F(this);}},Q=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,F(this);}async setText(e){await this.#e.invoke("setTextForNode",this.id,e);}async getText(){return this.#e.invoke("getTextForNode",this.id)}async setHTML(e){await this.#e.invoke(se,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(ae,this.id)}},Oe=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,F(this);}},ze=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,F(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ge=class extends V{static{r(this,"ComponentInstanceNode");}[c]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#i;get typedControls(){return this.#i||(this.#i=h(this.#e,this.#t.typedControls)??{}),this.#i}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=h(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,F(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},ee=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,F(this);}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let n=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=x(n,this.#e);return m(o instanceof R),m(Nn(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Ue(e,this.#e):null}},te=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,F(this);}async addVariant(e,t){let n=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!n)throw new Error("Failed to add variant to component");let o=x(n,this.#e);return m(o instanceof R),m(di(o),"Node is not a component variant"),o}async addGestureVariant(e,t,n){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,n);if(!o)throw new Error("Failed to add state to component");let a=x(o,this.#e);return m(a instanceof R),m(vn(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,L(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);}},Ke=class extends V{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,F(this);}},ie=class extends V{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,F(this);}},$e=class extends V{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),F(this);}};function x(i,e){switch(i[c]){case "DesignPageNode":return new ie(i,e);case "WebPageNode":return new ee(i,e);case "ComponentNode":return new te(i,e);case "VectorSetNode":return new Ke(i,e);case "VectorSetItemNode":return new ze(i,e);case "ComponentInstanceNode":return new Ge(i,e);case "FrameNode":return new R(i,e);case "SVGNode":return new Oe(i,e);case "TextNode":return new Q(i,e);case "UnknownNode":return new $e(i,e);default:return new $e(i,e)}}r(x,"convertRawNodeDataToNode");function Ft(i){return i instanceof R}r(Ft,"isFrameNode");function kn(i){return i instanceof Q}r(kn,"isTextNode");function Mn(i){return i instanceof Oe}r(Mn,"isSVGNode");function ce(i){return i instanceof Ge}r(ce,"isComponentInstanceNode");function En(i){return i instanceof ee}r(En,"isWebPageNode");function Vn(i){return i instanceof te}r(Vn,"isComponentNode");function An(i){return i instanceof ie}r(An,"isDesignPageNode");function wn(i){return i instanceof Ke}r(wn,"isVectorSetNode");function Wn(i){return i instanceof ze}r(Wn,"isVectorSetItemNode");function J(i){return i instanceof $e}r(J,"isUnknownNode");function He(i){return !!(Ft(i)||kn(i)||ce(i)||Mn(i)||Wn(i)||J(i))}r(He,"isCanvasNode");function ui(i){return !!(En(i)||An(i)||Vn(i)||wn(i)||J(i))}r(ui,"isCanvasRootNode");var je=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 Dt(t,this.#e))}},Dt=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 _e=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},j=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function Io(i){return i.type==="separator"}r(Io,"isSeparatorMenuItem");function vt(i,e){let t=[];for(let n of i){if(Io(n)){t.push(n);continue}let{onAction:o,...a}=n,s=a;if(n.onAction){let d=Math.random();e.set(d,n.onAction),s.actionId=d;}n.submenu&&(s.submenu=vt(n.submenu,e)),t.push(s);}return t}r(vt,"addMenuItemsToOnActionCallbackMap");var Nt="type",Ln={[Nt]:"pluginReadySignal"},Po="pluginReadyResponse";var So={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function Rn(i){return v(i)&&g(i[Nt])&&i[Nt]in So}r(Rn,"isVekterToPluginNonHandshakeMessage");function Bn(i){return v(i)&&i[Nt]===Po}r(Bn,"isPluginReadyResponse");var Fo=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions"],Do=["closeNotification","closePlugin","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","lintCode","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",dt,ut,ae,"getAiServiceInfo","sendTrackingEvent",...Fo];new Set(Do);var ci={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[se],"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"],publish:["publish"],getDeployments:[],deploy:["deploy"],getChangedPaths:[],getChangeContributors:[],createCollection:["createCollection"],createManagedCollection:["createManagedCollection"],[Bt]:[],[Ut]:[],[Ot]:[],[zt]:[]},kt=[];for(let i of Object.keys(ci))ci[i].length!==0&&kt.push(i);F(kt);function pi(i){let e={};for(let t of kt){let n=ci[t];e[t]=n.every(o=>i[o]);}return e}r(pi,"createPerMethodPermissionMap");function Un(){let i={};for(let e of kt)i[e]=true;return i}r(Un,"createPerMethodPermissionMapForTesting");var pe=null;function On(i){if(typeof window>"u")return;if(!pe){let t=document.createElement("style");document.head.appendChild(t),pe=t.sheet;}if(!pe){i();return}let e=pe.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe&&pe.deleteRule(e);});});}r(On,"withDisabledCssTransitions");var qe=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;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=Un();return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof j&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof j&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=pi(e.permissionMap),this.postMessage=(t,n)=>e.transport.send(t,n),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:st(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(L)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:a,reject:s}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let n=this.subscriptions.get(e)??new Set;return n.add(t),this.subscriptions.set(e,n),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=e=>{let t=e?.data??e;if(Rn(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=pi(t.permissionMap);for(let n of this.permissionSubscriptions)n();break}case "methodResponse":{let n=this.methodResponseHandlers.get(t.id);if(!n)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),g(t.error)?n.reject(new _e(t.error)):n.resolve(t.result);break}case "subscriptionMessage":{let{topic:n,payload:o}=t,a=this.subscriptions.get(n);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let n=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!n)throw new Error("Menu action received for an unknown menu item");n();break}default:st(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:st(t);}}applyPluginTheme=e=>{On(()=>{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?x(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?x(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?x(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=x(n,this);return m(He(o)),o})}notify=(e,t)=>{let n=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:n,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:()=>this.invoke("closeNotification",n)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=vt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=vt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function vo(i){return i.type==="component"}r(vo,"isCodeFileComponentExport");function No(i){return i.type==="override"}r(No,"isCodeFileOverrideExport");var mi=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)}},_=class i{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new i(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new i(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new mi(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 await this.#t.invoke("lintCode",this.name,this.content,e)}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var Mt=class i{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new i(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let n=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!n)return null;let o=x(n,this.#t);return m(ce(o)),o}};var ko=(()=>{let i=null;return {disableUntilMouseUp:()=>{if(i)return;i=document.createElement("style"),i.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(i);let e=r(()=>{i&&(document.head.removeChild(i),i=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),n=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",n);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",n);}r(o,"cleanup");}}})(),zn=5,Mo=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function Eo(){}r(Eo,"noop");function Gn(i,e,t,n){if(i.mode!=="canvas")return Eo;let o=Mo.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,T=ne.subscribeToIsAllowedTo("makeDraggable",p=>{p||C();}),I=r(p=>{ne.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&i.invoke("onDragEnd",{...p,dragSessionId:o}).then(y=>{try{n?.(y);}catch{}}).catch(y=>{if(y instanceof Error){n?.({status:"error",reason:y.message});return}if(typeof y=="string"){n?.({status:"error",reason:y});return}n?.({status:"error"});}),C());},"endDrag"),P=r(p=>{if(!ne.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(p.buttons>0&&!!(p.buttons&1))){I({cancelled:false});return}let{clientX:D,clientY:Y}=p;if(s.type==="pointerDown"){let ye=D-s.dragStart.mouse.x,Mi=Y-s.dragStart.mouse.y;if(Math.abs(ye)<zn&&Math.abs(Mi)<zn)return;s={type:"dragging",dragStart:s.dragStart},i.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),ko.disableUntilMouseUp();}d.setPointerCapture(p.pointerId);let S={x:D,y:Y};i.invoke("onDrag",{dragSessionId:o,mouse:S}).then(ye=>{s.type==="dragging"&&(document.body.style.cursor=ye??"");});},"handlePointerChange"),O=r(p=>{p.key==="Escape"&&I({cancelled:true});},"handleKeyDown"),z=r(()=>{I({cancelled:true});},"handleBlur"),f=r(p=>{if(!ne.isAllowedTo("makeDraggable"))return;I({cancelled:true});let y=e.getBoundingClientRect(),D={x:y.x,y:y.y,width:y.width,height:y.height},Y,S=e.querySelectorAll("svg");if(S.length===1){let rt=S.item(0).getBoundingClientRect();Y={x:rt.x,y:rt.y,width:rt.width,height:rt.height};}let ye={x:p.clientX,y:p.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:D,svgRect:Y,mouse:ye}},i.invoke("setDragData",o,t()),d.addEventListener("pointermove",P,true),d.addEventListener("pointerup",P,true),window.addEventListener("keydown",O,true),window.addEventListener("blur",z);},"handlePointerDown"),u=r(()=>{if(!ne.isAllowedTo("makeDraggable"))return;let p=t();p.type==="detachedComponentLayers"&&i.invoke("preloadDetachedComponentLayers",p.url),p.type==="image"&&i.invoke("preloadImageUrlForInsertion",p.image),p.previewImage&&i.invoke("preloadDragPreviewImage",p.previewImage);},"preload");e.addEventListener("pointerdown",f),e.addEventListener("mouseenter",u);function C(){s={type:"idle"},document.body.style.cursor=a,d.removeEventListener("pointermove",P,true),d.removeEventListener("pointerup",P,true),window.removeEventListener("keydown",O,true),window.removeEventListener("blur",z);}return r(C,"dragCleanup"),()=>{e.removeEventListener("pointerdown",f),e.removeEventListener("mouseenter",u),I({cancelled:true}),T();}}r(Gn,"makeDraggable");var me=class i{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[n]=await this.#t.invoke("addRedirects",[t]);return m(ot(n)),b(n)?null:new i(n,this.#t)}};var gi=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,n]=Ai(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,n(o));},"update");return this.#e.permissionSubscriptions.add(a),()=>{this.#e.permissionSubscriptions.delete(a);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new j}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let n=x(t,this.#e);return m(He(n)),n})}async setSelection(e){let t=g(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let n=t.map(o=>{let a=x(o,this.#e);return m(He(a)),a});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=x(e,this.#e);return m(ui(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=x(t,this.#e);m(ui(n)),e(n);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let n=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!n)return null;let o=x(n,this.#e);return m(o instanceof R),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?x(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let n=g(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",n,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,n){return this.#e.invoke("setParent",e,t,n)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(n=>x(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>x(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>x(n,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?h(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(h(this.#e,t));})}async addImage(e){let t=await Ae(e),n=H(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await Ae(e),n=H(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await Ae(e),n=H(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return h(this.#e,o)}async addImages(e){let t=await ai(e),n=t.flatMap(H);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await ai(e),n=t.flatMap(H),o=await this.#e.invokeTransferable("uploadImages",n,t);return h(this.#e,o)}async uploadFile(e){let t=await oi(e),n=await this.#e.invokeTransferable("uploadFile",H(t),t);return h(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(oi)),n=t.flatMap(H),o=await this.#e.invokeTransferable("uploadFiles",n,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:n}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:n}),a=x(o,this.#e);return m(ce(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),a=x(o,this.#e);return m(Ft(a)),a}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,n){return Gn(this.#e,e,t,n)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return m(e,"Collection data must be defined"),new ue(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return m(e,"Collections data must be defined"),e.map(t=>new ue(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new Z(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new Z(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new Z(t,this.#e))}notify=(e,t)=>this.#e.notify(e,t);async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return h(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?h(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return h(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let n=h(this.#e,t);return e(n)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return h(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?h(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return h(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let n=h(this.#e,t);return e(n)})}async getFont(e,t){let n=await this.#e.invoke("getFont",e,t);return n?h(this.#e,n):null}async getFonts(){let e=await this.#e.invoke("getFonts");return h(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(){return this.#e.invoke("getLocalizationGroups")}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new me(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new me(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new me(n,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,n){let o=await this.#e.invoke("createCodeFile",e,t,n);return new _(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new _(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new _(t,this.#e):null}lintCode(e,t,n){return this.#e.invoke("lintCode",e,t,n)}typecheckCode(e,t,n){return this.#e.invoke("typecheckCode",e,t,n)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let n=t?.map(o=>new _(o,this.#e));return e(n)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let n=t?new _(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=x(t,this.#e);return m(n instanceof ie,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=x(t,this.#e);return m(n instanceof ee,"Expected node to be a WebPageNode"),n}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new Z(t,this.#e)}},fi=class extends gi{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},Ye=class extends fi{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new Mt(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(dt)}async[l.sendTrackingEvent](e,t,n){return this.#e.invoke(ut,e,t,n)}async[l.getHTMLForNode](e){return this.#e.invoke(ae,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(se,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let n=await this.#e.invoke("createNode","TextNode",t??null,e);if(!n)return null;let o=x(n,this.#e);return m(o instanceof Q),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=x(t,this.#e);return m(n instanceof te),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new je(t,this.#e))}async publish(){return this.#e.invoke("publish")}async getDeployments(){return this.#e.invoke("getDeployments")}async deploy(e,t){return this.#e.invoke("deploy",e,t)}async getChangedPaths(){return this.#e.invoke("getChangedPaths")}async getChangeContributors(e,t){return this.#e.invoke("getChangeContributors",e,t)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new ue(t,this.#e)}};var yi=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 Vo(){return new Promise(i=>{function e({data:t,origin:n}){if(!Bn(t))return;window.removeEventListener("message",e);let a={transport:new yi(n),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:n,theme:t.theme??null};i(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(Ln,"*");})}r(Vo,"createBrowserContext");async function Ao(){return typeof window<"u"?Vo():null}r(Ao,"bootstrap");var Kn=await Ao(),ne=Kn?new Ye(new qe(Kn)):new Proxy({},{get(i,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function $n(i){return new Ye(new qe(i))}r($n,"createFramerInstance");var Lo=Wo,Hn=Lo.env;function Ro(i){Object.assign(Hn,i);}r(Ro,"configure");function ge(i,e){return Hn[i]??e}r(ge,"getEnv");var jn=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:WebSocket,_n,qn;try{_n=await import('node:fs'),qn=await import('node:path');}catch{}var hi=_n,bi=qn;function w(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
10
10
  `);n[1]?.includes("assert")?(n.splice(1,1),t.stack=n.join(`
11
11
  `)):n[0]?.includes("assert")&&(n.splice(0,1),t.stack=n.join(`
12
- `));}catch{}throw t}r(w,"assert");var Yn={showUI:false,hideUI:false,closePlugin:false,notify:false,setMenu:false,showContextMenu:false,preloadDetachedComponentLayers:false,preloadDragPreviewImage:false,preloadImageUrlForInsertion:false,setBackgroundMessage:false,getSelection:false,getActiveCollection:false,getActiveManagedCollection:false,getActiveLocale:false,zoomIntoView:false,navigateTo:false,getPluginData:false,setPluginData:false,getPluginDataKeys:false,makeDraggable:false,subscribeToSelection:false,subscribeToImage:false,subscribeToText:false,subscribeToCustomCode:false,subscribeToColorStyles:false,subscribeToTextStyles:false,subscribeToRedirects:false,subscribeToCodeFiles:false,subscribeToOpenCodeFile:false,subscribeToIsAllowedTo:false,subscribeToCanvasRoot:false,subscribeToPublishInfo:false,unstable_ensureMinimumDependencyVersion:false,removeNode:true,removeNodes:true,addSVG:true,getRect:true,setText:true,getText:true,addText:true,setCustomCode:true,getCustomCode:true,getLocales:true,getDefaultLocale:true,getLocalizationGroups:true,setLocalizationData:true,getCurrentUser:true,getProjectInfo:true,setSelection:true,getCanvasRoot:true,getPublishInfo:true,cloneNode:true,getNode:true,getParent:true,getChildren:true,setAttributes:true,getNodesWithType:true,getNodesWithAttribute:true,getNodesWithAttributeSet:true,addImages:true,getImage:true,addImage:true,setImage:true,uploadImage:true,uploadImages:true,uploadFile:true,uploadFiles:true,setParent:true,addComponentInstance:true,addDetachedComponentLayers:true,getManagedCollection:true,getManagedCollections:true,getCollection:true,getCollections:true,getColorStyle:true,getColorStyles:true,createColorStyle:true,getTextStyle:true,getTextStyles:true,createTextStyle:true,getFont:true,getFonts:true,createCodeFile:true,getCodeFiles:true,getCodeFile:true,lintCode:true,typecheckCode:true,addRedirects:true,getRedirects:true,setRedirectOrder:true,removeRedirects:true,addComponentInstancePlaceholder:true,publish:true,getDeployments:true,deploy:true,getChangedPagePaths:true,getChangeAuthors:true,createManagedCollection:true,createCollection:true,getVectorSets:true,createDesignPage:true,createWebPage:true,createTextNode:true,createComponentNode:true,mode:true,isAllowedTo:true,createFrameNode:true};function xi(i){return i in Yn?Yn[i]===true:false}r(xi,"isAllowedMethod");var Et=class i{static{r(this,"FramerAPI");}requestId;#e;#t;constructor(e,t,n){this.#t=e,this.#e=t,this.requestId=n;}static create(e,t,n){let o=new i(e,t,n);return new Proxy(o,{get(a,s){if(s in a)return Reflect.get(a,s);if(!xi(s))return;let d=Reflect.get(a.#t,s);return typeof d=="function"?d.bind(a.#t):d},has(a,s){return s in a?true:xi(s)?s in a.#t:false}})}async disconnect(){await this.#e();}[Symbol.dispose]=()=>{this.#e();};[Symbol.asyncDispose]=()=>this.#e()};var Bo=/^.+--([A-Za-z0-9]+)/u,Xn=/^[A-Za-z0-9]{20}$/u;function Zn(i){if(Xn.test(i))return i;try{let t=new URL(i,"https://framer.com").pathname.split("/").filter(Boolean),n=t.findIndex(o=>o.toLowerCase()==="projects");if(n>=0){let o=t[n+1];if(o!==void 0){let a=decodeURIComponent(o),d=a.match(Bo)?.[1]??a;if(Xn.test(d))return d}}return null}catch{return null}}r(Zn,"parseProjectId");var re=class extends Error{static{r(this,"FramerAPIError");}constructor(e){super(e),this.name="FramerAPIError",this.stack=undefined;}};var Ci={silent:0,error:1,warn:2,info:3,debug:4};function Uo(){let i=ge("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in Ci?i:"warn"}r(Uo,"getLogLevel");var Ii=Uo();function Xe(i){return Ci[i]<=Ci[Ii]}r(Xe,"shouldLog");var Ze=globalThis.console,Oo="\x1B[90m",zo="\x1B[0m";function Go(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}r(Go,"formatPrefix");function Ko(i,...e){return [Oo+i,...e,zo]}r(Ko,"formatDebug");function Jn(i){let e=Go(i);return {warn:(...t)=>{Xe("warn")&&Ze.warn(e,...t);},error:(...t)=>{Xe("error")&&Ze.error(e,...t);},log:(...t)=>{Xe("info")&&Ze.log(e,...t);},info:(...t)=>{Xe("info")&&Ze.info(e,...t);},debug:(...t)=>{Xe("debug")&&Ze.debug(...Ko(e,...t));},setLevel:t=>{Ii=t;},getLevel:()=>Ii,withRequestId:t=>Jn(t)}}r(Jn,"createLogger");var k=Jn();k.warn;k.error;k.log;k.info;k.debug;k.setLevel;k.getLevel;var Qn;function er({error:i,tags:e,extras:t,critical:n,caller:o}){w(Qn,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Pi(i,o);return Qn({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!n}),a}r(er,"reportError");function Pi(i,e=Pi){return i instanceof Error?i:new Ti(i,e)}r(Pi,"reportableError");var Ti=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let n=e?JSON.stringify(e):"No error message provided";if(super(n),this.message=n,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var Je=typeof window<"u"?window.location.hostname:undefined,tr=!!(Je&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(Je)),Si=(()=>{if(!Je)return;if(tr)return {main:Je,previewLink:undefined};let i=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=Je.match(i);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:Si,isDevelopment:Si?.main==="development.framer.com",isProduction:Si?.main==="framer.com",isLocal:tr});var Vt;function At(){return typeof window>"u"?{}:Vt||(Vt=jo(),Vt)}r(At,"getServiceMap");function jo(){let i=window.location,e=window?.bootstrap?.services;if(e)return e;let t;try{if(t=window.top.location.origin,e=window.top?.bootstrap?.services,e)return e}catch{}if(t&&t!==i.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${i.origin})`);if(i.origin.endsWith("framer.com")||i.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let n=new URLSearchParams(i.search).get("services")||new URLSearchParams(i.hash.substring(1)).get("services");n&&(e=JSON.parse(n));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(jo,"extractServiceMap");function Qe(i,e=0,t=new Set){if(i===null)return i;if(typeof i=="function")return `[Function: ${i.name??"unknown"}]`;if(typeof i!="object")return i;if(i instanceof Error)return `[${i.toString()}]`;if(t.has(i))return "[Circular]";if(e>2)return "...";t.add(i);try{if("toJSON"in i&&typeof i.toJSON=="function")return Qe(i.toJSON(),e+1,t);if(Array.isArray(i))return i.map(n=>Qe(n,e+1,t));if(Object.getPrototypeOf(i)!==Object.prototype)return `[Object: ${"__class"in i&&i.__class||i.constructor?.name}]`;{let n={};for(let[o,a]of Object.entries(i))n[o]=Qe(a,e+1,t);return n}}catch(n){return `[Throws: ${n instanceof Error?n.message:n}]`}finally{t.delete(i);}}r(Qe,"jsonSafeCopy");var _o=["trace","debug","info","warn","error"],qo=[":trace",":debug",":info",":warn",":error"];function rr(i,e){let t=[];for(let n of i.split(/[ ,]/u)){let o=n.trim();if(o.length===0)continue;let a=1,s=false;o.startsWith("-")&&(o=o.slice(1),a=3,s=true);for(let C=0;C<=4;C++){let D=qo[C];if(D&&o.endsWith(D)){a=C,s&&(a+=1),o=o.slice(0,o.length-D.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+ea(o).replace(/\\\*/gu,".*")+"$"),T=0;for(let C of e)C.id.match(d)&&(C.level=a,++T);T===0&&t.push(n);}return t}r(rr,"applyLogLevelSpec");var et=class i{constructor(e,t,n){this.logger=e;this.level=t;this.parts=n;this.id=i.nextId++,this.time=Date.now();}static{r(this,"LogEntry");}static nextId=0;id;time;stringPrefix;toMessage(){if(this.stringPrefix)return this.parts;let e=[new Date(this.time).toISOString().substr(-14,14),_o[this.level]+": ["+this.logger.id+"]"],t=0;for(;t<this.parts.length;t++){let n=this.parts[t];if(typeof n=="string"){e.push(n);continue}break}return this.stringPrefix=e.join(" "),this.parts.splice(0,t,this.stringPrefix),this.parts}toString(){return this.toMessage().map(e=>{let t=typeof e;if(t==="string")return e;if(t==="function")return `[Function: ${e.name??"unknown"}]`;if(e instanceof Error)return e.stack??e.toString();let n=JSON.stringify(Qe(e));return n?.length>253?n.slice(0,250)+"...":n}).join(" ")}},U="*:app:info,app:info",or=typeof process<"u"&&!!process.kill,Yo=or&&!!process.env.CI;Yo?U="-:warn":or&&(U="");try{typeof window<"u"&&window.localStorage&&(U=window.localStorage.logLevel||U);}catch{}try{typeof process<"u"&&(U=process.env.DEBUG||U);}catch{}try{typeof window<"u"&&Object.assign(window,{setLogLevel:lr});}catch{}try{typeof window<"u"&&window.postMessage&&window.top===window&&window.addEventListener("message",i=>{if(!i.data||typeof i.data!="object")return;let{loggerId:e,level:t,parts:n,printed:o}=i.data;if(typeof e!="string"||!Array.isArray(n)||n.length<1||typeof t!="number")return;let a=tt(e);if(t<0||t>5)return;n[0]=n[0].replace("[","*[");let s=new et(a,t,n);s.stringPrefix=n[0],q.push(s),!o&&(a.level>t||console?.log(...s.toMessage()));});}catch{}var Di;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(Di=r(i=>{try{let e=i.toMessage().map(s=>Qe(s)),t=i.logger,n=i.level,o=t.level<=i.level,a={loggerId:t.id,level:n,parts:e,printed:o};window.parent?.postMessage(a,At().app);}catch{}},"postLogEntry"));}catch{}var Fi={},q=[],ar=1e3;function oe(i,e,t){let n=new et(i,e,t);for(q.push(n),Di?.(n);q.length>ar;)q.shift();return n}r(oe,"createLogEntry");function sr(i){return typeof i=="number"&&(ar=i),q}r(sr,"getLogReplayBuffer");var Xo=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,nr;function Zo(){if(!(typeof window>"u"||!window.location))return nr??=Xo.exec(window.location.pathname)?.groups?.filename,nr}r(Zo,"getFilenameFromWindowPathname");function tt(i){let e=Zo();i=(e?e+":":"")+i;let t=Fi[i];if(t)return t;let n=new wt(i);return Fi[i]=n,rr(U,[n]),Di?.(new et(n,-1,[])),n}r(tt,"getLogger");function lr(i,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=i);}catch{}let t=U;U=i;let n=Object.values(Fi);for(let a of n)a.level=3;let o=rr(i,n);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&q.length>0){console?.log("--- LOG REPLAY ---");for(let a of q)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(lr,"setLogLevel");var Jo=r(i=>{let e={...i,logs:sr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
13
- `)};return i.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),wt=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 tt(t)}getBufferedMessages(){return q.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=oe(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=oe(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=oe(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=oe(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=oe(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=oe(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=oe(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,n,o)=>{let a=Jo(t??{}),s=er({caller:this.reportWithoutLogging,error:e,tags:{...n,handler:"logger",where:this.id},extras:t,critical:o??this.errorIsCritical});return [a,s]};reportError=(e,t,n,o)=>{let[a,s]=this.reportWithoutLogging(e,t,n,o);a?this.error(s,a):this.error(s);};reportErrorOncePerMinute=(e,t)=>{if(!Qo(e))return;let n=this.didLog[e.message];n&&n>Date.now()||(this.didLog[e.message]=Date.now()+1e3*60,this.reportError(e,t));};reportCriticalError=(e,t,n)=>this.reportError(e,t,n,true)};function Qo(i){return Object.prototype.hasOwnProperty.call(i,"message")}r(Qo,"isErrorWithMessage");function ea(i){return i.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(ea,"escapeRegExp");var cr;(z=>{function i(f,...u){return f.concat(u)}z.push=i,r(i,"push");function e(f){return f.slice(0,-1)}z.pop=e,r(e,"pop");function t(f,...u){return u.concat(f)}z.unshift=t,r(t,"unshift");function n(f,u,...I){let p=f.length;if(u<0||u>p)throw Error("index out of range: "+u);let y=f.slice();return y.splice(u,0,...I),y}z.insert=n,r(n,"insert");function o(f,u,I){let p=f.length;if(u<0||u>=p)throw Error("index out of range: "+u);let y=Array.isArray(I)?I:[I],F=f.slice();return F.splice(u,1,...y),F}z.replace=o,r(o,"replace");function a(f,u){let I=f.length;if(u<0||u>=I)throw Error("index out of range: "+u);let p=f.slice();return p.splice(u,1),p}z.remove=a,r(a,"remove");function s(f,u,I){let p=f.length;if(u<0||u>=p)throw Error("from index out of range: "+u);if(I<0||I>=p)throw Error("to index out of range: "+I);let y=f.slice();if(I===u)return y;let F=y[u];return u<I?(y.splice(I+1,0,F),y.splice(u,1)):(y.splice(u,1),y.splice(I,0,F)),y}z.move=s,r(s,"move");function d(f,u){let I=[],p=Math.min(f.length,u.length);for(let y=0;y<p;y++)I.push([f[y],u[y]]);return I}z.zip=d,r(d,"zip");function T(f,u,I){let p=f.slice(),y=p[u];return y===undefined||(p[u]=I(y)),p}z.update=T,r(T,"update");function C(f){return Array.from(new Set(f))}z.unique=C,r(C,"unique");function D(f,...u){return Array.from(new Set([...f,...u.flat()]))}z.union=D,r(D,"union");function O(f,u){return f.filter(u)}z.filter=O,r(O,"filter");})(cr||={});var sa=Object.prototype.hasOwnProperty;function la(i,e){return sa.call(i,e)}r(la,"hasOwnProperty");var pr;(n=>{function i(o,a){for(let s of Object.keys(o))la(a,s)||delete o[s];for(let s of Object.keys(a))o[s]===undefined&&(o[s]=a[s]);return Object.setPrototypeOf(o,Object.getPrototypeOf(a)),o}n.morphUsingTemplate=i,r(i,"morphUsingTemplate");function e(o,a){a&&Object.assign(o,a);}n.writeOnce=e,r(e,"writeOnce");function t(o,a){return Object.assign(Object.create(Object.getPrototypeOf(o)),o,a)}n.update=t,r(t,"update");})(pr||={});var mr;(o=>{function i(a,...s){return new Set([...a,...s])}o.add=i,r(i,"add");function e(a,...s){let d=new Set(a);for(let T of s)d.delete(T);return d}o.remove=e,r(e,"remove");function t(...a){let s=new Set;for(let d of a)for(let T of d)s.add(T);return s}o.union=t,r(t,"union");function n(a,s){return a.has(s)?o.remove(a,s):o.add(a,s)}o.toggle=n,r(n,"toggle");})(mr||={});var gr;(n=>{function i(o,...a){let s=new Map;o.forEach((T,C)=>s.set(C,T));let d=false;for(let T of a)T&&(T.forEach((C,D)=>s.set(D,C)),d=true);return d?s:o}n.merge=i,r(i,"merge");function e(o,a,s){let d=new Map(o);return d.set(a,s),d}n.set=e,r(e,"set");function t(o,a){let s=new Map(o);return s.delete(a),s}n.remove=t,r(t,"remove");})(gr||={});(class extends Promise{static{r(this,"ResolvablePromise");}_state="initial";resolve;reject;get state(){return this._state}pending(){return this._state="pending",this}isResolved(){return this._state==="fulfilled"||this._state==="rejected"}constructor(){let e,t;super((n,o)=>{e=n,t=o;}),this.resolve=n=>{this._state="fulfilled",e(n);},this.reject=n=>{this._state="rejected",t(n);};}});tt("task-queue");function Ni(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Ni,"isObject");var fe=class{constructor(e){this.ws=e;}static{r(this,"WebSocketTransport");}send(e){this.ws.send(it.stringify(e));}waitForDisconnectAck(e){return new Promise(t=>{let n=setTimeout(()=>{this.ws.removeEventListener("message",o),t();},e),o=r(a=>{if(!(typeof a.data!="string"&&!(a.data instanceof String)))try{let s=it.parse(a.data);Ni(s)&&s.type==="disconnect-ack"&&(clearTimeout(n),this.ws.removeEventListener("message",o),t());}catch{}},"handler");this.ws.addEventListener("message",o);})}onMessage(e){this.ws.addEventListener("message",t=>{let n=typeof t.data=="string"?t.data:t.data.toString(),o=it.parse(n);if(Ni(o)&&o.type==="error"){k.error(`Server error: ${o.message||JSON.stringify(o)}`);return}if(Ni(o)&&o.type==="debug-archive"){ki(o.data);return}e(o);});}};function ki(i){w(hi,"File system module is not available."),w(bi,"Path module is not available.");let t=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,n=process.cwd(),o=bi.resolve(n,t);hi.writeFileSync(o,Buffer.from(i)),k.info(`Debug archive saved to ${o}`);}r(ki,"handleDebugArchive");function Lt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Lt,"isObject");var pa={type:"pluginReadySignal"};function ma(i){return Lt(i)&&i.type==="pluginReadyResponse"}r(ma,"isPluginReadyResponse");var fr=45e3,ga=2e4;async function yr(i,e){let t=new URL(ge("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));t.protocol=t.protocol==="https:"?"wss:":t.protocol==="http"?"ws:":t.protocol,t.searchParams.set("projectId",i),k.debug(`Connecting to ${t.href}`);let n=new jn(t.href,{headers:{Authorization:`Token ${e}`}});k.debug(`WebSocket created, readyState: ${n.readyState}`);let o,a=k,s=false,d=setInterval(()=>{n.readyState===n.OPEN&&(n.send(it.stringify({type:"ping"})),a.debug("Sent ping"));},ga),T=r(()=>{clearInterval(d),n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");},"forceClose"),C=r(async()=>{if(clearInterval(d),!(n.readyState===n.CLOSED||n.readyState===n.CLOSING)){if(s){a.debug("Initiating graceful disconnect");let O=new fe(n);O.send({type:"client-disconnect"}),await O.waitForDisconnectAck(5e3);}n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");}},"cleanup"),D=await new Promise((O,z)=>{let f=setTimeout(()=>{T(),z(new re(`Connection timeout after ${fr}ms`));},fr),u=r(()=>{a.debug("WebSocket opened, waiting for ready");},"onOpen"),I=r(F=>{a.debug("WebSocket error:",F),clearTimeout(f),T(),z(new re("WebSocket connection failed"));},"onError"),p=r(F=>{a.debug(`WebSocket closed: code=${F.code}, reason=${F.reason||"(no reason)"}, wasClean=${F.wasClean}`),clearTimeout(f),clearInterval(d),z(new re(`WebSocket closed before handshake completed (code: ${F.code})`));},"onClose");function y(F){a.debug("Received message");let Y=typeof F.data=="string"?F.data:F.data.toString(),P=it.parse(Y);a.debug(`Message type: ${P.type}`),P.type==="error"?(clearTimeout(f),T(),z(new re(`Server error: ${P.message||JSON.stringify(P)}`))):P.type==="ready"?(Lt(P)&&"requestId"in P&&(o=String(P.requestId),a=k.withRequestId(o),a.debug(`Server request ID: ${o}`)),Lt(P)&&"version"in P&&a.debug(`Server version: ${P.version}`),Lt(P)&&P.gracefulDisconnect===true&&(s=true),a.debug("Sending pluginReadySignal"),n.send(it.stringify(pa))):P.type==="debug-archive"?ki(P.data):ma(P)&&(clearTimeout(f),n.removeEventListener("message",y),n.removeEventListener("error",I),n.removeEventListener("close",p),O(P));}r(y,"handshakeMessageHandler"),n.addEventListener("open",u),n.addEventListener("message",y),n.addEventListener("error",I),n.addEventListener("close",p);});return {ws:n,pluginReadyData:D,requestId:o,logger:a,gracefulDisconnect:s,cleanup:C}}r(yr,"connectAndHandshake");async function hr(i,e){let t=Zn(i);w(t,`Invalid project URL or ID: ${i}`);let n=e??ge("FRAMER_API_KEY");w(n,"FRAMER_API_KEY environment variable is required");let o=await yr(t,n),s={transport:new fe(o.ws),mode:o.pluginReadyData.mode,permissionMap:o.pluginReadyData.permissionMap,environmentInfo:o.pluginReadyData.environmentInfo,origin:null,theme:null},d=$n(s);o.ws.addEventListener("close",C=>{C.code!==1e3&&(o.logger.debug(`Connection closed unexpectedly: ${C.code}`),typeof process<"u"&&process.exit&&process.exit(1));});let T=r(async()=>{await o.cleanup();},"cleanup");return Et.create(d,T,o.requestId)}r(hr,"connect");async function fa(i,e,t){let n=await hr(i,t);try{return await e(n)}finally{await n.disconnect();}}r(fa,"withConnection");
12
+ `));}catch{}throw t}r(w,"assert");var Yn={showUI:false,hideUI:false,closePlugin:false,notify:false,setMenu:false,showContextMenu:false,preloadDetachedComponentLayers:false,preloadDragPreviewImage:false,preloadImageUrlForInsertion:false,setBackgroundMessage:false,getSelection:false,getActiveCollection:false,getActiveManagedCollection:false,getActiveLocale:false,zoomIntoView:false,navigateTo:false,getPluginData:false,setPluginData:false,getPluginDataKeys:false,makeDraggable:false,subscribeToSelection:false,subscribeToImage:false,subscribeToText:false,subscribeToCustomCode:false,subscribeToColorStyles:false,subscribeToTextStyles:false,subscribeToRedirects:false,subscribeToCodeFiles:false,subscribeToOpenCodeFile:false,subscribeToIsAllowedTo:false,subscribeToCanvasRoot:false,subscribeToPublishInfo:false,unstable_ensureMinimumDependencyVersion:false,removeNode:true,removeNodes:true,addSVG:true,getRect:true,setText:true,getText:true,addText:true,setCustomCode:true,getCustomCode:true,getLocales:true,getDefaultLocale:true,getLocalizationGroups:true,setLocalizationData:true,getCurrentUser:true,getProjectInfo:true,setSelection:true,getCanvasRoot:true,getPublishInfo:true,cloneNode:true,getNode:true,getParent:true,getChildren:true,setAttributes:true,getNodesWithType:true,getNodesWithAttribute:true,getNodesWithAttributeSet:true,addImages:true,getImage:true,addImage:true,setImage:true,uploadImage:true,uploadImages:true,uploadFile:true,uploadFiles:true,setParent:true,addComponentInstance:true,addDetachedComponentLayers:true,getManagedCollection:true,getManagedCollections:true,getCollection:true,getCollections:true,getColorStyle:true,getColorStyles:true,createColorStyle:true,getTextStyle:true,getTextStyles:true,createTextStyle:true,getFont:true,getFonts:true,createCodeFile:true,getCodeFiles:true,getCodeFile:true,lintCode:true,typecheckCode:true,addRedirects:true,getRedirects:true,setRedirectOrder:true,removeRedirects:true,addComponentInstancePlaceholder:true,publish:true,getDeployments:true,deploy:true,getChangedPaths:true,getChangeContributors:true,createManagedCollection:true,createCollection:true,getVectorSets:true,createDesignPage:true,createWebPage:true,createTextNode:true,createComponentNode:true,mode:true,isAllowedTo:true,createFrameNode:true};function xi(i){return i in Yn?Yn[i]===true:false}r(xi,"isAllowedMethod");var Et=class i{static{r(this,"FramerAPI");}requestId;#e;#t;constructor(e,t,n){this.#t=e,this.#e=t,this.requestId=n;}static create(e,t,n){let o=new i(e,t,n);return new Proxy(o,{get(a,s){if(s in a)return Reflect.get(a,s);if(!xi(s))return;let d=Reflect.get(a.#t,s);return typeof d=="function"?d.bind(a.#t):d},has(a,s){return s in a?true:xi(s)?s in a.#t:false}})}async disconnect(){await this.#e();}[Symbol.dispose]=()=>{this.#e();};[Symbol.asyncDispose]=()=>this.#e()};var Bo=/^.+--([A-Za-z0-9]+)/u,Xn=/^[A-Za-z0-9]{20}$/u;function Zn(i){if(Xn.test(i))return i;try{let t=new URL(i,"https://framer.com").pathname.split("/").filter(Boolean),n=t.findIndex(o=>o.toLowerCase()==="projects");if(n>=0){let o=t[n+1];if(o!==void 0){let a=decodeURIComponent(o),d=a.match(Bo)?.[1]??a;if(Xn.test(d))return d}}return null}catch{return null}}r(Zn,"parseProjectId");var re=class extends Error{static{r(this,"FramerAPIError");}constructor(e){super(e),this.name="FramerAPIError",this.stack=undefined;}};var Ci={silent:0,error:1,warn:2,info:3,debug:4};function Uo(){let i=ge("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in Ci?i:"warn"}r(Uo,"getLogLevel");var Ii=Uo();function Xe(i){return Ci[i]<=Ci[Ii]}r(Xe,"shouldLog");var Ze=globalThis.console,Oo="\x1B[90m",zo="\x1B[0m";function Go(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}r(Go,"formatPrefix");function Ko(i,...e){return [Oo+i,...e,zo]}r(Ko,"formatDebug");function Jn(i){let e=Go(i);return {warn:(...t)=>{Xe("warn")&&Ze.warn(e,...t);},error:(...t)=>{Xe("error")&&Ze.error(e,...t);},log:(...t)=>{Xe("info")&&Ze.log(e,...t);},info:(...t)=>{Xe("info")&&Ze.info(e,...t);},debug:(...t)=>{Xe("debug")&&Ze.debug(...Ko(e,...t));},setLevel:t=>{Ii=t;},getLevel:()=>Ii,withRequestId:t=>Jn(t)}}r(Jn,"createLogger");var k=Jn();k.warn;k.error;k.log;k.info;k.debug;k.setLevel;k.getLevel;var Qn;function er({error:i,tags:e,extras:t,critical:n,caller:o}){w(Qn,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Pi(i,o);return Qn({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!n}),a}r(er,"reportError");function Pi(i,e=Pi){return i instanceof Error?i:new Ti(i,e)}r(Pi,"reportableError");var Ti=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let n=e?JSON.stringify(e):"No error message provided";if(super(n),this.message=n,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var Je=typeof window<"u"?window.location.hostname:undefined,tr=!!(Je&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(Je)),Si=(()=>{if(!Je)return;if(tr)return {main:Je,previewLink:undefined};let i=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=Je.match(i);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:Si,isDevelopment:Si?.main==="development.framer.com",isProduction:Si?.main==="framer.com",isLocal:tr});var Vt;function At(){return typeof window>"u"?{}:Vt||(Vt=jo(),Vt)}r(At,"getServiceMap");function jo(){let i=window.location,e=window?.bootstrap?.services;if(e)return e;let t;try{if(t=window.top.location.origin,e=window.top?.bootstrap?.services,e)return e}catch{}if(t&&t!==i.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${i.origin})`);if(i.origin.endsWith("framer.com")||i.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let n=new URLSearchParams(i.search).get("services")||new URLSearchParams(i.hash.substring(1)).get("services");n&&(e=JSON.parse(n));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(jo,"extractServiceMap");function Qe(i,e=0,t=new Set){if(i===null)return i;if(typeof i=="function")return `[Function: ${i.name??"unknown"}]`;if(typeof i!="object")return i;if(i instanceof Error)return `[${i.toString()}]`;if(t.has(i))return "[Circular]";if(e>2)return "...";t.add(i);try{if("toJSON"in i&&typeof i.toJSON=="function")return Qe(i.toJSON(),e+1,t);if(Array.isArray(i))return i.map(n=>Qe(n,e+1,t));if(Object.getPrototypeOf(i)!==Object.prototype)return `[Object: ${"__class"in i&&i.__class||i.constructor?.name}]`;{let n={};for(let[o,a]of Object.entries(i))n[o]=Qe(a,e+1,t);return n}}catch(n){return `[Throws: ${n instanceof Error?n.message:n}]`}finally{t.delete(i);}}r(Qe,"jsonSafeCopy");var _o=["trace","debug","info","warn","error"],qo=[":trace",":debug",":info",":warn",":error"];function rr(i,e){let t=[];for(let n of i.split(/[ ,]/u)){let o=n.trim();if(o.length===0)continue;let a=1,s=false;o.startsWith("-")&&(o=o.slice(1),a=3,s=true);for(let I=0;I<=4;I++){let P=qo[I];if(P&&o.endsWith(P)){a=I,s&&(a+=1),o=o.slice(0,o.length-P.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+ea(o).replace(/\\\*/gu,".*")+"$"),T=0;for(let I of e)I.id.match(d)&&(I.level=a,++T);T===0&&t.push(n);}return t}r(rr,"applyLogLevelSpec");var et=class i{constructor(e,t,n){this.logger=e;this.level=t;this.parts=n;this.id=i.nextId++,this.time=Date.now();}static{r(this,"LogEntry");}static nextId=0;id;time;stringPrefix;toMessage(){if(this.stringPrefix)return this.parts;let e=[new Date(this.time).toISOString().substr(-14,14),_o[this.level]+": ["+this.logger.id+"]"],t=0;for(;t<this.parts.length;t++){let n=this.parts[t];if(typeof n=="string"){e.push(n);continue}break}return this.stringPrefix=e.join(" "),this.parts.splice(0,t,this.stringPrefix),this.parts}toString(){return this.toMessage().map(e=>{let t=typeof e;if(t==="string")return e;if(t==="function")return `[Function: ${e.name??"unknown"}]`;if(e instanceof Error)return e.stack??e.toString();let n=JSON.stringify(Qe(e));return n?.length>253?n.slice(0,250)+"...":n}).join(" ")}},U="*:app:info,app:info",or=typeof process<"u"&&!!process.kill,Yo=or&&!!process.env.CI;Yo?U="-:warn":or&&(U="");try{typeof window<"u"&&window.localStorage&&(U=window.localStorage.logLevel||U);}catch{}try{typeof process<"u"&&(U=process.env.DEBUG||U);}catch{}try{typeof window<"u"&&Object.assign(window,{setLogLevel:lr});}catch{}try{typeof window<"u"&&window.postMessage&&window.top===window&&window.addEventListener("message",i=>{if(!i.data||typeof i.data!="object")return;let{loggerId:e,level:t,parts:n,printed:o}=i.data;if(typeof e!="string"||!Array.isArray(n)||n.length<1||typeof t!="number")return;let a=tt(e);if(t<0||t>5)return;n[0]=n[0].replace("[","*[");let s=new et(a,t,n);s.stringPrefix=n[0],q.push(s),!o&&(a.level>t||console?.log(...s.toMessage()));});}catch{}var Di;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(Di=r(i=>{try{let e=i.toMessage().map(s=>Qe(s)),t=i.logger,n=i.level,o=t.level<=i.level,a={loggerId:t.id,level:n,parts:e,printed:o};window.parent?.postMessage(a,At().app);}catch{}},"postLogEntry"));}catch{}var Fi={},q=[],ar=1e3;function oe(i,e,t){let n=new et(i,e,t);for(q.push(n),Di?.(n);q.length>ar;)q.shift();return n}r(oe,"createLogEntry");function sr(i){return typeof i=="number"&&(ar=i),q}r(sr,"getLogReplayBuffer");var Xo=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,nr;function Zo(){if(!(typeof window>"u"||!window.location))return nr??=Xo.exec(window.location.pathname)?.groups?.filename,nr}r(Zo,"getFilenameFromWindowPathname");function tt(i){let e=Zo();i=(e?e+":":"")+i;let t=Fi[i];if(t)return t;let n=new wt(i);return Fi[i]=n,rr(U,[n]),Di?.(new et(n,-1,[])),n}r(tt,"getLogger");function lr(i,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=i);}catch{}let t=U;U=i;let n=Object.values(Fi);for(let a of n)a.level=3;let o=rr(i,n);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&q.length>0){console?.log("--- LOG REPLAY ---");for(let a of q)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(lr,"setLogLevel");var Jo=r(i=>{let e={...i,logs:sr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
13
+ `)};return i.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),wt=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 tt(t)}getBufferedMessages(){return q.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=oe(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=oe(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=oe(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=oe(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=oe(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=oe(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=oe(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,n,o)=>{let a=Jo(t??{}),s=er({caller:this.reportWithoutLogging,error:e,tags:{...n,handler:"logger",where:this.id},extras:t,critical:o??this.errorIsCritical});return [a,s]};reportError=(e,t,n,o)=>{let[a,s]=this.reportWithoutLogging(e,t,n,o);a?this.error(s,a):this.error(s);};reportErrorOncePerMinute=(e,t)=>{if(!Qo(e))return;let n=this.didLog[e.message];n&&n>Date.now()||(this.didLog[e.message]=Date.now()+1e3*60,this.reportError(e,t));};reportCriticalError=(e,t,n)=>this.reportError(e,t,n,true)};function Qo(i){return Object.prototype.hasOwnProperty.call(i,"message")}r(Qo,"isErrorWithMessage");function ea(i){return i.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(ea,"escapeRegExp");var cr;(z=>{function i(f,...u){return f.concat(u)}z.push=i,r(i,"push");function e(f){return f.slice(0,-1)}z.pop=e,r(e,"pop");function t(f,...u){return u.concat(f)}z.unshift=t,r(t,"unshift");function n(f,u,...C){let p=f.length;if(u<0||u>p)throw Error("index out of range: "+u);let y=f.slice();return y.splice(u,0,...C),y}z.insert=n,r(n,"insert");function o(f,u,C){let p=f.length;if(u<0||u>=p)throw Error("index out of range: "+u);let y=Array.isArray(C)?C:[C],D=f.slice();return D.splice(u,1,...y),D}z.replace=o,r(o,"replace");function a(f,u){let C=f.length;if(u<0||u>=C)throw Error("index out of range: "+u);let p=f.slice();return p.splice(u,1),p}z.remove=a,r(a,"remove");function s(f,u,C){let p=f.length;if(u<0||u>=p)throw Error("from index out of range: "+u);if(C<0||C>=p)throw Error("to index out of range: "+C);let y=f.slice();if(C===u)return y;let D=y[u];return u<C?(y.splice(C+1,0,D),y.splice(u,1)):(y.splice(u,1),y.splice(C,0,D)),y}z.move=s,r(s,"move");function d(f,u){let C=[],p=Math.min(f.length,u.length);for(let y=0;y<p;y++)C.push([f[y],u[y]]);return C}z.zip=d,r(d,"zip");function T(f,u,C){let p=f.slice(),y=p[u];return y===undefined||(p[u]=C(y)),p}z.update=T,r(T,"update");function I(f){return Array.from(new Set(f))}z.unique=I,r(I,"unique");function P(f,...u){return Array.from(new Set([...f,...u.flat()]))}z.union=P,r(P,"union");function O(f,u){return f.filter(u)}z.filter=O,r(O,"filter");})(cr||={});var sa=Object.prototype.hasOwnProperty;function la(i,e){return sa.call(i,e)}r(la,"hasOwnProperty");var pr;(n=>{function i(o,a){for(let s of Object.keys(o))la(a,s)||delete o[s];for(let s of Object.keys(a))o[s]===undefined&&(o[s]=a[s]);return Object.setPrototypeOf(o,Object.getPrototypeOf(a)),o}n.morphUsingTemplate=i,r(i,"morphUsingTemplate");function e(o,a){a&&Object.assign(o,a);}n.writeOnce=e,r(e,"writeOnce");function t(o,a){return Object.assign(Object.create(Object.getPrototypeOf(o)),o,a)}n.update=t,r(t,"update");})(pr||={});var mr;(o=>{function i(a,...s){return new Set([...a,...s])}o.add=i,r(i,"add");function e(a,...s){let d=new Set(a);for(let T of s)d.delete(T);return d}o.remove=e,r(e,"remove");function t(...a){let s=new Set;for(let d of a)for(let T of d)s.add(T);return s}o.union=t,r(t,"union");function n(a,s){return a.has(s)?o.remove(a,s):o.add(a,s)}o.toggle=n,r(n,"toggle");})(mr||={});var gr;(n=>{function i(o,...a){let s=new Map;o.forEach((T,I)=>s.set(I,T));let d=false;for(let T of a)T&&(T.forEach((I,P)=>s.set(P,I)),d=true);return d?s:o}n.merge=i,r(i,"merge");function e(o,a,s){let d=new Map(o);return d.set(a,s),d}n.set=e,r(e,"set");function t(o,a){let s=new Map(o);return s.delete(a),s}n.remove=t,r(t,"remove");})(gr||={});(class extends Promise{static{r(this,"ResolvablePromise");}_state="initial";resolve;reject;get state(){return this._state}pending(){return this._state="pending",this}isResolved(){return this._state==="fulfilled"||this._state==="rejected"}constructor(){let e,t;super((n,o)=>{e=n,t=o;}),this.resolve=n=>{this._state="fulfilled",e(n);},this.reject=n=>{this._state="rejected",t(n);};}});tt("task-queue");function Ni(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Ni,"isObject");var fe=class{constructor(e){this.ws=e;}static{r(this,"WebSocketTransport");}send(e){this.ws.send(it.stringify(e));}waitForDisconnectAck(e){return new Promise(t=>{let n=setTimeout(()=>{this.ws.removeEventListener("message",o),t();},e),o=r(a=>{if(!(typeof a.data!="string"&&!(a.data instanceof String)))try{let s=it.parse(a.data);Ni(s)&&s.type==="disconnect-ack"&&(clearTimeout(n),this.ws.removeEventListener("message",o),t());}catch{}},"handler");this.ws.addEventListener("message",o);})}onMessage(e){this.ws.addEventListener("message",t=>{let n=typeof t.data=="string"?t.data:t.data.toString(),o=it.parse(n);if(Ni(o)&&o.type==="error"){k.error(`Server error: ${o.message||JSON.stringify(o)}`);return}if(Ni(o)&&o.type==="debug-archive"){ki(o.data);return}e(o);});}};function ki(i){w(hi,"File system module is not available."),w(bi,"Path module is not available.");let t=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,n=process.cwd(),o=bi.resolve(n,t);hi.writeFileSync(o,Buffer.from(i)),k.info(`Debug archive saved to ${o}`);}r(ki,"handleDebugArchive");function Lt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Lt,"isObject");var pa={type:"pluginReadySignal"};function ma(i){return Lt(i)&&i.type==="pluginReadyResponse"}r(ma,"isPluginReadyResponse");var fr=45e3,ga=2e4;async function yr(i,e){let t=new URL(ge("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));t.protocol=t.protocol==="https:"?"wss:":t.protocol==="http"?"ws:":t.protocol,t.searchParams.set("projectId",i),k.debug(`Connecting to ${t.href}`);let n=new jn(t.href,{headers:{Authorization:`Token ${e}`}});k.debug(`WebSocket created, readyState: ${n.readyState}`);let o,a=k,s=false,d=setInterval(()=>{n.readyState===n.OPEN&&(n.send(it.stringify({type:"ping"})),a.debug("Sent ping"));},ga),T=r(()=>{clearInterval(d),n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");},"forceClose"),I=r(async()=>{if(clearInterval(d),!(n.readyState===n.CLOSED||n.readyState===n.CLOSING)){if(s){a.debug("Initiating graceful disconnect");let O=new fe(n);O.send({type:"client-disconnect"}),await O.waitForDisconnectAck(5e3);}n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");}},"cleanup"),P=await new Promise((O,z)=>{let f=setTimeout(()=>{T(),z(new re(`Connection timeout after ${fr}ms`));},fr),u=r(()=>{a.debug("WebSocket opened, waiting for ready");},"onOpen"),C=r(D=>{a.debug("WebSocket error:",D),clearTimeout(f),T(),z(new re("WebSocket connection failed"));},"onError"),p=r(D=>{a.debug(`WebSocket closed: code=${D.code}, reason=${D.reason||"(no reason)"}, wasClean=${D.wasClean}`),clearTimeout(f),clearInterval(d),z(new re(`WebSocket closed before handshake completed (code: ${D.code})`));},"onClose");function y(D){a.debug("Received message");let Y=typeof D.data=="string"?D.data:D.data.toString(),S=it.parse(Y);a.debug(`Message type: ${S.type}`),S.type==="error"?(clearTimeout(f),T(),z(new re(`Server error: ${S.message||JSON.stringify(S)}`))):S.type==="ready"?(Lt(S)&&"requestId"in S&&(o=String(S.requestId),a=k.withRequestId(o),a.debug(`Server request ID: ${o}`)),Lt(S)&&"version"in S&&a.debug(`Server version: ${S.version}`),Lt(S)&&S.gracefulDisconnect===true&&(s=true),a.debug("Sending pluginReadySignal"),n.send(it.stringify(pa))):S.type==="debug-archive"?ki(S.data):ma(S)&&(clearTimeout(f),n.removeEventListener("message",y),n.removeEventListener("error",C),n.removeEventListener("close",p),O(S));}r(y,"handshakeMessageHandler"),n.addEventListener("open",u),n.addEventListener("message",y),n.addEventListener("error",C),n.addEventListener("close",p);});return {ws:n,pluginReadyData:P,requestId:o,logger:a,gracefulDisconnect:s,cleanup:I}}r(yr,"connectAndHandshake");async function hr(i,e){let t=performance.now(),n=Zn(i);w(n,`Invalid project URL or ID: ${i}`);let o=e??ge("FRAMER_API_KEY");w(o,"FRAMER_API_KEY environment variable is required");let a=await yr(n,o),d={transport:new fe(a.ws),mode:a.pluginReadyData.mode,permissionMap:a.pluginReadyData.permissionMap,environmentInfo:a.pluginReadyData.environmentInfo,origin:null,theme:null},T=$n(d);a.ws.addEventListener("close",P=>{P.code!==1e3&&(a.logger.debug(`Connection closed unexpectedly: ${P.code}`),typeof process<"u"&&process.exit&&process.exit(1));});let I=r(async()=>{let P=((performance.now()-t)/1e3).toFixed(2);a.logger.debug(`Connection ended after ${P}s`),await a.cleanup();},"cleanup");return Et.create(T,I,a.requestId)}r(hr,"connect");async function fa(i,e,t){let n=await hr(i,t);try{return await e(n)}finally{await n.disconnect();}}r(fa,"withConnection");
14
14
 
15
15
  export { ct as BooleanField, be as BooleanVariable, Ne as BorderVariable, It as CollectionReferenceField, pt as ColorField, Pe as ColorVariable, Ge as ComponentInstanceNode, te as ComponentNode, Re as ConicGradient, ht as DateField, ve as DateVariable, ie as DesignPageNode, K as EnumCase, Ct as EnumField, Te as EnumVariable, bt as FieldDivider, xt as FileField, Fe as FileVariable, ft as FormattedTextField, Ie as FormattedTextVariable, R as FrameNode, j as FramerPluginClosedError, _e as FramerPluginError, Me as ImageField, Se as ImageVariable, We as LinearGradient, yt as LinkField, De as LinkVariable, Tt as MultiCollectionReferenceField, mt as NumberField, xe as NumberVariable, Le as RadialGradient, Oe as SVGNode, gt as StringField, Ce as StringVariable, Q as TextNode, we as UnsupportedComputedValue, Ee as UnsupportedField, ke as UnsupportedVariable, je as VectorSet, Dt as VectorSetItem, ze as VectorSetItemNode, Ke as VectorSetNode, ee as WebPageNode, Ro as configure, hr as connect, ne as framer, Zs as hasGridLayout, Xs as hasStackLayout, Nn as isBreakpoint, vo as isCodeFileComponentExport, No as isCodeFileOverrideExport, de as isColorStyle, vn as isComponentGestureVariant, ce as isComponentInstanceNode, Vn as isComponentNode, qr as isComponentVariable, di as isComponentVariant, no as isComputedValue, An as isDesignPageNode, Yr as isField, Zr as isFileAsset, Ft as isFrameNode, Qr as isImageAsset, Mn as isSVGNode, kn as isTextNode, li as isTextStyle, wi as isVariable, Wn as isVectorSetItemNode, wn as isVectorSetNode, En as isWebPageNode, Fs as supportsAspectRatio, ks as supportsBackgroundColor, Ms as supportsBackgroundColorData, As as supportsBackgroundGradient, ws as supportsBackgroundGradientData, Es as supportsBackgroundImage, Vs as supportsBackgroundImageData, Bs as supportsBorder, Rs as supportsBorderRadius, Co as supportsBreakpoint, Ks as supportsComponentInfo, Dn as supportsComponentVariant, $s as supportsFont, Hs as supportsFontData, Ys as supportsImageRendering, js as supportsInlineTextStyle, _s as supportsInlineTextStyleData, Fn as supportsLayout, qs as supportsLink, Ns as supportsLocked, Ds as supportsName, Ls as supportsOpacity, Gs as supportsOverflow, Ts as supportsPins, Is as supportsPosition, Ws as supportsRotation, Us as supportsSVG, Ps as supportsSize, Ss as supportsSizeConstraints, Os as supportsTextTruncation, vs as supportsVisible, zs as supportsZIndex, fa as withConnection };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-api",
3
- "version": "0.0.1-alpha.6",
3
+ "version": "0.0.1-beta.0",
4
4
  "type": "module",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {