@chili-publish/studio-sdk 1.47.0 → 1.48.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/_bundles/main.js CHANGED
@@ -1,9 +1,9 @@
1
- (function(h,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(h=typeof globalThis<"u"?globalThis:h||self,L(h.StudioSDK=h.StudioSDK||{}))})(this,(function(h){"use strict";var ir=h=>{throw TypeError(h)};var or=(h,L,T)=>L.has(h)||ir("Cannot "+T);var a=(h,L,T)=>(or(h,L,"read from private field"),T?T.call(h):L.get(h)),g=(h,L,T)=>L.has(h)?ir("Cannot add the same private member more than once"):L instanceof WeakSet?L.add(h):L.set(h,T),y=(h,L,T,ye)=>(or(h,L,"write to private field"),ye?ye.call(h,T):L.set(h,T),T);var V,k,K,O,it,_,ot,Kt,H,J,Nt,Ct,Hn,ft,St,et,Mt,ct,qt,ht,bt,x,dt,Rt,D,Vt,u,N,S,Yt,st,Zt,R,Qt,xn,$,It,kt,X,q,Xt,lt,Tt,te,ee,se,j,Bt,w,Jt,Ut,$n,ut,nt,ne,vt,Gt,ge,gt,_t,z,At,re,yt,tt;const T={current:"2.30.latest"},Oe={version:"1.47.0"};var Y;(function(s){s.Call="call",s.Reply="reply",s.Syn="syn",s.SynAck="synAck",s.Ack="ack"})(Y||(Y={}));var pt;(function(s){s.Fulfilled="fulfilled",s.Rejected="rejected"})(pt||(pt={}));var $t;(function(s){s.ConnectionDestroyed="ConnectionDestroyed",s.ConnectionTimeout="ConnectionTimeout",s.NoIframeSrc="NoIframeSrc"})($t||($t={}));var pe;(function(s){s.DataCloneError="DataCloneError"})(pe||(pe={}));var at;(function(s){s.Message="message"})(at||(at={}));const cr=(s,o)=>{const e=[];let t=!1;return{destroy(n){t||(t=!0,o(`${s}: Destroying connection`),e.forEach(r=>{r(n)}))},onDestroy(n){t?n():e.push(n)}}},hr=s=>(...o)=>{s&&console.log("[Penpal]",...o)},dr={"http:":"80","https:":"443"},lr=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,ur=["file:","data:"],gr=s=>{if(s&&ur.find(d=>s.startsWith(d)))return"null";const o=document.location,e=lr.exec(s);let t,n,r;e?(t=e[1]?e[1]:o.protocol,n=e[2],r=e[4]):(t=o.protocol,n=o.hostname,r=o.port);const c=r&&r!==dr[t]?`:${r}`:"";return`${t}//${n}${c}`},Fe=({name:s,message:o,stack:e})=>({name:s,message:o,stack:e}),yr=s=>{const o=new Error;return Object.keys(s).forEach(e=>o[e]=s[e]),o},pr=(s,o,e)=>{const{localName:t,local:n,remote:r,originForSending:c,originForReceiving:d}=s;let l=!1;const m=p=>{if(p.source!==r||p.data.penpal!==Y.Call)return;if(p.origin!==d){e(`${t} received message from origin ${p.origin} which did not match expected origin ${d}`);return}const f=p.data,{methodName:b,args:I,id:A}=f;e(`${t}: Received ${b}() call`);const v=E=>F=>{if(e(`${t}: Sending ${b}() reply`),l){e(`${t}: Unable to send ${b}() reply due to destroyed connection`);return}const M={penpal:Y.Reply,id:A,resolution:E,returnValue:F};E===pt.Rejected&&F instanceof Error&&(M.returnValue=Fe(F),M.returnValueIsError=!0);try{r.postMessage(M,c)}catch(P){if(P.name===pe.DataCloneError){const U={penpal:Y.Reply,id:A,resolution:pt.Rejected,returnValue:Fe(P),returnValueIsError:!0};r.postMessage(U,c)}throw P}};new Promise(E=>E(o[b].apply(o,I))).then(v(pt.Fulfilled),v(pt.Rejected))};return n.addEventListener(at.Message,m),()=>{l=!0,n.removeEventListener(at.Message,m)}};let mr=0;const wr=()=>++mr,De=".",Le=s=>s?s.split(De):[],Cr=s=>s.join(De),fr=(s,o)=>{const e=Le(o||"");return e.push(s),Cr(e)},Sr=(s,o,e)=>{const t=Le(o);return t.reduce((n,r,c)=>(typeof n[r]>"u"&&(n[r]={}),c===t.length-1&&(n[r]=e),n[r]),s),s},Ne=(s,o)=>{const e={};return Object.keys(s).forEach(t=>{const n=s[t],r=fr(t,o);typeof n=="object"&&Object.assign(e,Ne(n,r)),typeof n=="function"&&(e[r]=n)}),e},br=s=>{const o={};for(const e in s)Sr(o,e,s[e]);return o},Ir=(s,o,e,t,n)=>{const{localName:r,local:c,remote:d,originForSending:l,originForReceiving:m}=o;let p=!1;n(`${r}: Connecting call sender`);const f=I=>(...A)=>{n(`${r}: Sending ${I}() call`);let v;try{d.closed&&(v=!0)}catch{v=!0}if(v&&t(),p){const E=new Error(`Unable to send ${I}() call due to destroyed connection`);throw E.code=$t.ConnectionDestroyed,E}return new Promise((E,F)=>{const M=wr(),P=rt=>{if(rt.source!==d||rt.data.penpal!==Y.Reply||rt.data.id!==M)return;if(rt.origin!==m){n(`${r} received message from origin ${rt.origin} which did not match expected origin ${m}`);return}const Ht=rt.data;n(`${r}: Received ${I}() reply`),c.removeEventListener(at.Message,P);let xt=Ht.returnValue;Ht.returnValueIsError&&(xt=yr(xt)),(Ht.resolution===pt.Fulfilled?E:F)(xt)};c.addEventListener(at.Message,P);const U={penpal:Y.Call,id:M,methodName:I,args:A};d.postMessage(U,l)})},b=e.reduce((I,A)=>(I[A]=f(A),I),{});return Object.assign(s,br(b)),()=>{p=!0}},vr=(s,o,e,t,n)=>{const{destroy:r,onDestroy:c}=t;let d,l;const m={};return p=>{if(p.origin!==o){n(`Parent: Handshake - Received ACK message from origin ${p.origin} which did not match expected origin ${o}`);return}n("Parent: Handshake - Received ACK");const f={localName:"Parent",local:window,remote:p.source,originForSending:e,originForReceiving:o};d&&d(),d=pr(f,s,n),c(d),l&&l.forEach(I=>{delete m[I]}),l=p.data.methodNames;const b=Ir(m,f,l,r,n);return c(b),m}},Ar=(s,o,e,t)=>n=>{if(n.origin!==e){s(`Parent: Handshake - Received SYN message from origin ${n.origin} which did not match expected origin ${e}`);return}s("Parent: Handshake - Received SYN, responding with SYN-ACK");const r={penpal:Y.SynAck,methodNames:Object.keys(o)};n.source.postMessage(r,t)},Pr=6e4,Er=(s,o)=>{const{destroy:e,onDestroy:t}=o,n=setInterval(()=>{s.isConnected||(clearInterval(n),e())},Pr);t(()=>{clearInterval(n)})},Or=(s,o)=>{let e;return s!==void 0&&(e=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${s}ms`);t.code=$t.ConnectionTimeout,o(t)},s)),()=>{clearTimeout(e)}},Fr=s=>{if(!s.src&&!s.srcdoc){const o=new Error("Iframe must have src or srcdoc property defined.");throw o.code=$t.NoIframeSrc,o}},Dr=s=>{let{iframe:o,methods:e={},childOrigin:t,timeout:n,debug:r=!1}=s;const c=hr(r),d=cr("Parent",c),{onDestroy:l,destroy:m}=d;t||(Fr(o),t=gr(o.src));const p=t==="null"?"*":t,f=Ne(e),b=Ar(c,f,t,p),I=vr(f,t,p,d,c);return{promise:new Promise((v,E)=>{const F=Or(n,m),M=P=>{if(!(P.source!==o.contentWindow||!P.data)){if(P.data.penpal===Y.Syn){b(P);return}if(P.data.penpal===Y.Ack){const U=I(P);U&&(F(),v(U));return}}};window.addEventListener(at.Message,M),c("Parent: Awaiting handshake"),Er(o,d),l(P=>{window.removeEventListener(at.Message,M),P&&E(P)})}),destroy(){m()}}},Lr=s=>{const o=new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w]+\/$/);let e="";return o.test(s)?e=s:s.indexOf("/index.html")>-1?e=s.replace("/index.html","/"):s.charAt(-1)!=="/"&&(e=`${s}/`),e},Nr=(s,o,e)=>{const t=Lr(o),n=JSON.stringify(e||{}),r=`<html>
1
+ (function(h,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(h=typeof globalThis<"u"?globalThis:h||self,L(h.StudioSDK=h.StudioSDK||{}))})(this,(function(h){"use strict";var or=h=>{throw TypeError(h)};var cr=(h,L,T)=>L.has(h)||or("Cannot "+T);var a=(h,L,T)=>(cr(h,L,"read from private field"),T?T.call(h):L.get(h)),g=(h,L,T)=>L.has(h)?or("Cannot add the same private member more than once"):L instanceof WeakSet?L.add(h):L.set(h,T),y=(h,L,T,pe)=>(cr(h,L,"write to private field"),pe?pe.call(h,T):L.set(h,T),T);var V,k,K,F,it,_,ot,qt,H,J,Rt,Ct,xn,ft,St,et,Vt,ct,Yt,ht,bt,x,dt,kt,D,It,u,N,S,Zt,st,Qt,R,Xt,$n,$,vt,Tt,X,q,te,lt,Bt,ee,se,ne,j,Jt,w,Ut,Gt,_t,jn,ut,nt,re,At,Ht,ye,gt,xt,z,Pt,ae,yt,tt;const T={current:"2.31.latest"},Oe={version:"1.48.0"};var Y;(function(n){n.Call="call",n.Reply="reply",n.Syn="syn",n.SynAck="synAck",n.Ack="ack"})(Y||(Y={}));var pt;(function(n){n.Fulfilled="fulfilled",n.Rejected="rejected"})(pt||(pt={}));var zt;(function(n){n.ConnectionDestroyed="ConnectionDestroyed",n.ConnectionTimeout="ConnectionTimeout",n.NoIframeSrc="NoIframeSrc"})(zt||(zt={}));var me;(function(n){n.DataCloneError="DataCloneError"})(me||(me={}));var at;(function(n){n.Message="message"})(at||(at={}));const hr=(n,o)=>{const e=[];let t=!1;return{destroy(s){t||(t=!0,o(`${n}: Destroying connection`),e.forEach(r=>{r(s)}))},onDestroy(s){t?s():e.push(s)}}},dr=n=>(...o)=>{n&&console.log("[Penpal]",...o)},lr={"http:":"80","https:":"443"},ur=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,gr=["file:","data:"],yr=n=>{if(n&&gr.find(d=>n.startsWith(d)))return"null";const o=document.location,e=ur.exec(n);let t,s,r;e?(t=e[1]?e[1]:o.protocol,s=e[2],r=e[4]):(t=o.protocol,s=o.hostname,r=o.port);const c=r&&r!==lr[t]?`:${r}`:"";return`${t}//${s}${c}`},De=({name:n,message:o,stack:e})=>({name:n,message:o,stack:e}),pr=n=>{const o=new Error;return Object.keys(n).forEach(e=>o[e]=n[e]),o},mr=(n,o,e)=>{const{localName:t,local:s,remote:r,originForSending:c,originForReceiving:d}=n;let l=!1;const m=p=>{if(p.source!==r||p.data.penpal!==Y.Call)return;if(p.origin!==d){e(`${t} received message from origin ${p.origin} which did not match expected origin ${d}`);return}const f=p.data,{methodName:b,args:I,id:A}=f;e(`${t}: Received ${b}() call`);const v=E=>O=>{if(e(`${t}: Sending ${b}() reply`),l){e(`${t}: Unable to send ${b}() reply due to destroyed connection`);return}const M={penpal:Y.Reply,id:A,resolution:E,returnValue:O};E===pt.Rejected&&O instanceof Error&&(M.returnValue=De(O),M.returnValueIsError=!0);try{r.postMessage(M,c)}catch(P){if(P.name===me.DataCloneError){const U={penpal:Y.Reply,id:A,resolution:pt.Rejected,returnValue:De(P),returnValueIsError:!0};r.postMessage(U,c)}throw P}};new Promise(E=>E(o[b].apply(o,I))).then(v(pt.Fulfilled),v(pt.Rejected))};return s.addEventListener(at.Message,m),()=>{l=!0,s.removeEventListener(at.Message,m)}};let wr=0;const Cr=()=>++wr,Le=".",Ne=n=>n?n.split(Le):[],fr=n=>n.join(Le),Sr=(n,o)=>{const e=Ne(o||"");return e.push(n),fr(e)},br=(n,o,e)=>{const t=Ne(o);return t.reduce((s,r,c)=>(typeof s[r]>"u"&&(s[r]={}),c===t.length-1&&(s[r]=e),s[r]),n),n},Me=(n,o)=>{const e={};return Object.keys(n).forEach(t=>{const s=n[t],r=Sr(t,o);typeof s=="object"&&Object.assign(e,Me(s,r)),typeof s=="function"&&(e[r]=s)}),e},Ir=n=>{const o={};for(const e in n)br(o,e,n[e]);return o},vr=(n,o,e,t,s)=>{const{localName:r,local:c,remote:d,originForSending:l,originForReceiving:m}=o;let p=!1;s(`${r}: Connecting call sender`);const f=I=>(...A)=>{s(`${r}: Sending ${I}() call`);let v;try{d.closed&&(v=!0)}catch{v=!0}if(v&&t(),p){const E=new Error(`Unable to send ${I}() call due to destroyed connection`);throw E.code=zt.ConnectionDestroyed,E}return new Promise((E,O)=>{const M=Cr(),P=rt=>{if(rt.source!==d||rt.data.penpal!==Y.Reply||rt.data.id!==M)return;if(rt.origin!==m){s(`${r} received message from origin ${rt.origin} which did not match expected origin ${m}`);return}const $t=rt.data;s(`${r}: Received ${I}() reply`),c.removeEventListener(at.Message,P);let jt=$t.returnValue;$t.returnValueIsError&&(jt=pr(jt)),($t.resolution===pt.Fulfilled?E:O)(jt)};c.addEventListener(at.Message,P);const U={penpal:Y.Call,id:M,methodName:I,args:A};d.postMessage(U,l)})},b=e.reduce((I,A)=>(I[A]=f(A),I),{});return Object.assign(n,Ir(b)),()=>{p=!0}},Ar=(n,o,e,t,s)=>{const{destroy:r,onDestroy:c}=t;let d,l;const m={};return p=>{if(p.origin!==o){s(`Parent: Handshake - Received ACK message from origin ${p.origin} which did not match expected origin ${o}`);return}s("Parent: Handshake - Received ACK");const f={localName:"Parent",local:window,remote:p.source,originForSending:e,originForReceiving:o};d&&d(),d=mr(f,n,s),c(d),l&&l.forEach(I=>{delete m[I]}),l=p.data.methodNames;const b=vr(m,f,l,r,s);return c(b),m}},Pr=(n,o,e,t)=>s=>{if(s.origin!==e){n(`Parent: Handshake - Received SYN message from origin ${s.origin} which did not match expected origin ${e}`);return}n("Parent: Handshake - Received SYN, responding with SYN-ACK");const r={penpal:Y.SynAck,methodNames:Object.keys(o)};s.source.postMessage(r,t)},Er=6e4,Fr=(n,o)=>{const{destroy:e,onDestroy:t}=o,s=setInterval(()=>{n.isConnected||(clearInterval(s),e())},Er);t(()=>{clearInterval(s)})},Or=(n,o)=>{let e;return n!==void 0&&(e=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${n}ms`);t.code=zt.ConnectionTimeout,o(t)},n)),()=>{clearTimeout(e)}},Dr=n=>{if(!n.src&&!n.srcdoc){const o=new Error("Iframe must have src or srcdoc property defined.");throw o.code=zt.NoIframeSrc,o}},Lr=n=>{let{iframe:o,methods:e={},childOrigin:t,timeout:s,debug:r=!1}=n;const c=dr(r),d=hr("Parent",c),{onDestroy:l,destroy:m}=d;t||(Dr(o),t=yr(o.src));const p=t==="null"?"*":t,f=Me(e),b=Pr(c,f,t,p),I=Ar(f,t,p,d,c);return{promise:new Promise((v,E)=>{const O=Or(s,m),M=P=>{if(!(P.source!==o.contentWindow||!P.data)){if(P.data.penpal===Y.Syn){b(P);return}if(P.data.penpal===Y.Ack){const U=I(P);U&&(O(),v(U));return}}};window.addEventListener(at.Message,M),c("Parent: Awaiting handshake"),Fr(o,d),l(P=>{window.removeEventListener(at.Message,M),P&&E(P)})}),destroy(){m()}}},Nr=n=>{const o=new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w]+\/$/);let e="";return o.test(n)?e=n:n.indexOf("/index.html")>-1?e=n.replace("/index.html","/"):n.charAt(-1)!=="/"&&(e=`${n}/`),e},Mr=(n,o,e)=>{const t=Nr(o),s=JSON.stringify(e||{}),r=`<html>
2
2
  <head>
3
3
  <base href="${t}" />
4
4
  <meta charset="UTF-8"/>
5
5
  <!-- use this property to pass the StudioStyling to the engine -->
6
- <meta name="studio-styling" content='${n}'>
6
+ <meta name="studio-styling" content='${s}'>
7
7
  </head>
8
8
  <body>
9
9
  <script>
@@ -65,5 +65,5 @@
65
65
  }
66
66
  <\/script>
67
67
  </body>
68
- </html>`,c=URL.createObjectURL(new Blob([r],{type:"text/html"}));return s.setAttribute("src",c),c},Mr=(s,o,e,t="chili-editor",n,r)=>{const c=`#${t}`,d=document.createElement("iframe");d.setAttribute("src","about:blank"),d.setAttribute("title","Chili-Editor"),d.setAttribute("style","width: 100%; height: 100%;"),d.setAttribute("frameBorder","0"),d.setAttribute("referrerpolicy","origin");let l=null,m=null,p=null;const f=()=>{l&&(window.removeEventListener("message",l),l=null),m&&(document.removeEventListener("DOMContentLoaded",m),m=null),d.remove(),p&&(URL.revokeObjectURL(p),p=null)},b=()=>{const I=document.querySelector(c);if(I){I==null||I.appendChild(d),d.addEventListener("error",()=>{const A=new Error("Failed to setup frame: iframe failed to load");r==null||r(A)},{capture:!0,once:!0});try{p=Nr(d,s,n)}catch(A){A instanceof Error?r==null||r(A):r==null||r(new Error(`Failed to setup frame: ${A}`))}}};return document.readyState==="complete"||document.readyState==="interactive"?b():(m=()=>{m=null,b()},document.addEventListener("DOMContentLoaded",m,{once:!0})),l=I=>{var A;if(I.source===d.contentWindow&&((A=I.data)==null?void 0:A.type)==="iframe-error"){const v=I.data.error,E=new Error(v.message||"Failed to setup frame: error in iframe");r==null||r(E)}},window.addEventListener("message",l),e(Dr({iframe:d,methods:{actionsChanged:o.onActionsChanged,stateChanged:o.onStateChanged,documentLoaded:o.onDocumentLoaded,authExpired:o.onAuthExpired,viewportRequested:o.onViewportRequested,selectedFramesContent:o.onSelectedFramesContentChanged,selectedFramesLayout:o.onSelectedFramesLayoutChanged,allFramesLayout:o.onFramesLayoutChanged,selectedLayoutProperties:o.onSelectedLayoutPropertiesChanged,openLayoutPropertiesPanel:o.onPageSelectionChanged,selectedLayoutUnit:o.onSelectedLayoutUnitChanged,scrubberPositionChanged:o.onScrubberPositionChanged,frameAnimationsChanged:o.onFrameAnimationsChanged,selectedToolChanged:o.onSelectedToolChanged,variableListChanged:o.onVariableListChanged,undoStackStateChanged:o.onUndoStateChanged,selectedLayoutFramesChanged:o.onSelectedLayoutFramesChanged,selectedTextStyleChanged:o.onSelectedTextStyleChanged,colorsChanged:o.onColorsChanged,paragraphStylesChanged:o.onParagraphStylesChanged,characterStylesChanged:o.onCharacterStylesChanged,fontFamiliesChanged:o.onFontFamiliesChanged,selectedLayoutId:o.onSelectedLayoutIdChanged,layoutListChanged:o.onLayoutsChanged,connectorEvent:o.onConnectorEvent,connectorsChanged:o.onConnectorsChanged,zoomChanged:o.onZoomChanged,pageSnapshotInvalidated:o.onPageSnapshotInvalidated,pagesChanged:o.onPagesChanged,pageSizeChanged:o.onPageSizeChanged,shapeCornerRadiusChanged:o.onShapeCornerRadiusChanged,cropActiveFrameIdChanged:o.onCropActiveFrameIdChanged,asyncError:o.onAsyncError,viewModeChanged:o.onViewModeChanged,barcodeValidationChanged:o.onBarcodeValidationChanged,selectedPageIdChanged:o.onSelectedPageIdChanged,dataSourceIdChanged:o.onDataSourceIdChanged,injectedDataChanged:o.onInjectedDataChanged,documentIssueListChanged:o.onDocumentIssueListChanged,customUndoDataChanged:o.onCustomUndoDataChanged,engineEditingModeChanged:o.onEngineEditModeChanged,brandKitMediaChanged:o.onBrandKitMediaChanged,frameManipulated:o.onCanvasFramesManipulated}})),f};var Z=(s=>(s.GraFxStudioEnvironmentApiUrl="ENVIRONMENT_API",s.GraFxStudioSdkVersion="SDK_VERSION",s.GraFxStudioDocumentType="DOCUMENT_TYPE",s.GraFxStudioTemplateId="TEMPLATE_ID",s.GraFxStudioAuthToken="GRAFX_AUTH_TOKEN",s.QueryCallCacheEnabled="ENABLE_QUERY_CALL_CACHE",s))(Z||{}),Me=(s=>(s.full="full",s.followConstraints="followConstraints",s))(Me||{});const Rr={shortcutOptions:{debugPanel:{enabled:!1},ellipse:{enabled:!1},hand:{enabled:!1},temporaryHand:{enabled:!1},image:{enabled:!1},polygon:{enabled:!1},rectangle:{enabled:!1},select:{enabled:!1},text:{enabled:!1},zoom:{enabled:!1},copyPaste:{enabled:!1},viewMode:{enabled:!1},componentGrid:{enabled:!1}},frameEditingMode:"full"};var Re=(s=>(s.overflow="overflow",s.fontLoading="fontLoading",s.actionRegister="actionRegister",s.actionExecution="actionExecution",s.actionCircular="actionCircular",s))(Re||{}),me=(s=>(s.project="project",s.template="template",s.component="component",s))(me||{});class Ve{constructor(o,e,t,n){this.type="action",this.message=o,this.id=e,this.event=t,this.eventChain=n}}class ke{constructor(o,e,t){this.type="dataRow",this.count=o,this.message=e,this.exceptions=t}}class Te extends Error{constructor(o,e,t){super(e,t),this.statusCode=o}}class Be extends Error{constructor(o,e,t){super(e,t),this.context=o}}const Vr=404075,kr=403032;function mt(s){const o=s.error??"Yikes, something went wrong",e={cause:{name:String(s.status),message:s.error??"Yikes, something went wrong"}};if(s.status===Vr){const n=JSON.parse(s.data).statusCode;throw new Te(n,o,e)}else throw new Error(o,e)}function Tr(s){const o=[/DateVariable '([^']+)' should not be part of excludedDays, ".*" was given/,/DateVariable '([^']+)' expects \$date to be > startDate:.*$/,/DateVariable '([^']+)' expects \$date to be < endDate:.*$/,/NumberVariable '([^']+)' expects \$extractedValue to be >= .+$/,/NumberVariable '([^']+)' expects \$extractedValue to be <= .+$/];for(const e of o)if(s.match(e))return{valid:!0};return{valid:!1}}function Br(s,o){if(s.status===kr&&s.error){const e=s.error;if(Tr(e).valid)throw new Be(o,e,{cause:{name:String(s.status),message:e}})}}function Jr(s){mt(s)}function i(s,o){let e=!0,t=!1,n=Jr;typeof o=="function"?(t=!0,n=o):typeof o=="boolean"&&(e=o);try{s.success||(n(s),t&&mt(s));const r=s.data&&e;return{...s,parsedData:r?JSON.parse(s.data):s.data}}catch(r){throw console.error(r),r}}class Je{constructor(o){g(this,V);this.getAll=async()=>(await a(this,V)).getActions().then(t=>i(t)),this.getById=async e=>(await a(this,V)).getActionById(e).then(n=>i(n)),this.create=async()=>(await a(this,V)).createAction().then(t=>i(t)),this.duplicate=async e=>(await a(this,V)).duplicateAction(e).then(n=>i(n)),this.remove=async e=>(await a(this,V)).removeAction(e).then(n=>i(n)),this.update=async(e,t)=>(await a(this,V)).updateAction(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>this.update(e,{name:t}),this.updateScript=async(e,t)=>this.update(e,{script:t}),this.updateTriggers=async(e,t)=>this.update(e,{triggers:t}),this.move=async(e,t)=>(await a(this,V)).moveActions(e,t).then(r=>i(r)),this.setTypeError=async(e,t)=>this.update(e,{hasTypeError:t}),this.disable=async()=>(await a(this,V)).disableActions().then(t=>i(t)),this.enable=async()=>(await a(this,V)).enableActions().then(t=>i(t)),this.enableForComponents=async e=>(await a(this,V)).enableComponentActions(e).then(n=>i(n)),y(this,V,o)}}V=new WeakMap;class Ue{constructor(o){g(this,k);this.getAllOnSelectedLayout=async()=>(await a(this,k)).getAnimationsOnSelectedLayout().then(t=>i(t)),this.getByFrameId=async(e,t)=>(await a(this,k)).getAnimationByFrameId(e,t).then(r=>i(r)),this.getByLayoutId=async e=>(await a(this,k)).getAnimationsByLayoutId(e).then(n=>i(n)),this.setFrameAnimation=async e=>(await a(this,k)).setFrameAnimation(JSON.stringify(e)).then(n=>i({...n,data:JSON.stringify(e)})),this.play=async()=>(await a(this,k)).playAnimation().then(t=>i(t)),this.pause=async()=>(await a(this,k)).pauseAnimation().then(t=>i(t)),this.setScrubberPosition=async e=>(await a(this,k)).setScrubberPosition(e).then(n=>i(n)),this.setDuration=async e=>(await a(this,k)).setAnimationDuration(e).then(n=>i(n)),this.resetFrameAnimation=async e=>(await a(this,k)).resetFrameAnimation(e).then(n=>i(n)),this.reset=async()=>(await a(this,k)).resetAnimation().then(t=>i(t)),y(this,k,o)}}k=new WeakMap;var W=(s=>(s.code39="code39",s.code93="code93",s.code128="code128",s.dataMatrix="dataMatrix",s.ean13="ean13",s.ean8="ean8",s.qr="qr",s.upca="upca",s.upce="upce",s.gs1128="gs1128",s))(W||{}),Pt=(s=>(s.low="low",s.medium="medium",s.quartile="quartile",s.high="high",s))(Pt||{}),wt=(s=>(s.utf8="utf8",s.iso8859_1="iso8859_1",s.code128a="code128a",s.code128b="code128b",s.code128c="code128c",s))(wt||{}),Ge=(s=>(s.success="success",s.empty="empty",s.invalidLength="invalidLength",s.invalidCharacters="invalidCharacters",s.invalidChecksum="invalidChecksum",s.invalidUPCE="invalidUPCE",s.otherError="otherError",s))(Ge||{}),_e=(s=>(s.px="px",s.mm="mm",s.cm="cm",s.inch="inch",s.pt="pt",s))(_e||{}),Q=(s=>(s.top="top",s.right="right",s.bottom="bottom",s.left="left",s))(Q||{}),He=(s=>(s.top="top",s.child="child",s))(He||{}),xe=(s=>(s.print="print",s.digitalStatic="digitalStatic",s.digitalAnimated="digitalAnimated",s))(xe||{}),$e=(s=>(s.locked="locked",s.range="range",s.none="none",s))($e||{});class je{constructor(o){g(this,K);this.setBarcodeProperties=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableBackground=async(e,t)=>{const n={enableBackground:t};return this.setBarcodeProperties(e,n)},this.setBackgroundColor=async(e,t)=>{const n={backgroundColor:t};return this.setBarcodeProperties(e,n)},this.setEnableBars=async(e,t)=>{const n={enableBars:t};return this.setBarcodeProperties(e,n)},this.setBarColor=async(e,t)=>{const n={barColor:t};return this.setBarcodeProperties(e,n)},this.setBarcodeSource=async(e,t)=>(await a(this,K)).setBarcodeSource(e,JSON.stringify(t)).then(r=>i(r)),this.removeBarcodeSource=async e=>(await a(this,K)).setBarcodeSource(e,null).then(n=>i(n)),this.setEnableText=async(e,t)=>{const n={enableText:t};return this.setBarcodeProperties(e,n)},this.setBarHeight=async(e,t)=>{const n={barHeight:t};return this.setBarcodeProperties(e,n)},this.setMagnification=async(e,t)=>{const n={magnification:t};return this.setBarcodeProperties(e,n)},this.setQuietZoneValue=async(e,t,n)=>{const r=n?{left:n===Q.left?t:void 0,top:n===Q.top?t:void 0,right:n===Q.right?t:void 0,bottom:n===Q.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,K)).setBarcodeProperties(e,JSON.stringify({quietZone:r})).then(d=>i(d))},this.setAreQuietZoneValuesCombined=async(e,t)=>{const n={areQuietZoneValuesCombined:t};return(await a(this,K)).setBarcodeProperties(e,JSON.stringify({quietZone:n})).then(c=>i(c))},this.setErrorCorrectionLevel=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify({errorCorrectionLevel:t})).then(r=>i(r)),this.setCharacterSet=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify({characterSet:t})).then(r=>i(r)),this.setDrawLightMarginIndicator=async(e,t)=>{const n={drawStartStopChars:t};return this.setBarcodeProperties(e,n)},this.setDrawStartStopChars=async(e,t)=>{const n={drawStartStopChars:t};return this.setBarcodeProperties(e,n)},this.getBarcodeConfigationOptions=e=>{let t=!0,n=!0,r=!0,c,d,l=!1,m=!1,p=!1;switch(e){case W.qr:c=[wt.iso8859_1,wt.utf8],d=[Pt.low,Pt.medium,Pt.quartile,Pt.high];case W.dataMatrix:t=!1,n=!1,r=!1,l=!0;break;case W.ean13:t=!1,m=!0;break;case W.ean8:m=!0;case W.upca:case W.upce:t=!1;break;case W.code128:case W.gs1128:c=[wt.code128a,wt.code128b,wt.code128c];break;case W.code39:p=!0;break}return{allowEnableMagnification:r,allowBarHeight:n,allowQuietZone:!0,allowedCharacterSets:c,allowedErrorCorrectionLevels:d,allowToggleText:t,quietZoneAlwaysCombined:l,allowToggleLightMarginIndicator:m,allowToggleDrawStartAndEndChar:p}},y(this,K,o)}}K=new WeakMap;class ze{constructor(o,e){g(this,O);this.getId=async()=>(await a(this,O)).getBrandKitId().then(n=>i(n)),this.getVersion=async()=>(await a(this,O)).getBrandKitVersion().then(n=>i(n)),this.getName=async()=>(await a(this,O)).getBrandKitName().then(n=>i(n)),this.rename=async t=>(await a(this,O)).renameBrandKit(t).then(r=>i(r)),this.updateIdAndVersion=async(t,n)=>(await a(this,O)).updateBrandKitIdAndVersion(t,n).then(c=>i(c)),this.get=async()=>(await a(this,O)).getBrandKit().then(n=>i(n)),this.getAllMedia=async()=>(await a(this,O)).getAllBrandKitMedia().then(n=>i(n)),this.addMedia=async(t,n,r)=>(await a(this,O)).addBrandKitMedia(t,n,r).then(d=>i(d)),this.updateMedia=async(t,n,r)=>(await a(this,O)).updateBrandKitMedia(t,n,r).then(d=>i(d)),this.renameMedia=async(t,n)=>(await a(this,O)).renameBrandKitMedia(t,n).then(c=>i(c)),this.removeMedia=async t=>(await a(this,O)).removeBrandKitMedia(t).then(r=>i(r)),this.set=async t=>(await a(this,O)).setBrandKit(JSON.stringify(t)).then(r=>i(r)),this.sync=async t=>(await a(this,O)).syncBrandKit(JSON.stringify(t)).then(r=>i(r)),this.isAutoSync=async()=>(await a(this,O)).isBrandKitAutoSync().then(n=>i(n)),this.enableAutoSync=async t=>(await a(this,O)).enableBrandKitAutoSync(t).then(r=>i(r)),this.switchTheme=async t=>(await a(this,O)).switchBrandKitTheme(t).then(r=>i(r)),y(this,O,o),this.sdk=e}}O=new WeakMap;class we{constructor(o){g(this,it);this.zoomToPage=async(e,t,n,r,c)=>(e!==void 0&&console.warn("id has no effect and will be deprecated in the future"),(await a(this,it)).zoomToPage(t,n,r,c).then(l=>i(l))),this.getZoomPercentage=async()=>(await a(this,it)).getZoomPercentage().then(t=>i(t)),this.setZoomPercentage=async e=>(await a(this,it)).setZoomPercentage(e).then(n=>i(n)),this.setViewMode=async e=>(await a(this,it)).setViewMode(e).then(n=>i(n)),y(this,it,o)}}it=new WeakMap;class We{constructor(o){g(this,_);this.getAll=async()=>(await a(this,_)).getCharacterStyles().then(t=>i(t)),this.getById=async e=>(await a(this,_)).getCharacterStyleById(e).then(n=>i(n)),this.create=async()=>(await a(this,_)).createCharacterStyle().then(t=>i(t)),this.update=async(e,t)=>(await a(this,_)).updateCharacterStyle(e,JSON.stringify(t)).then(r=>i(r)),this.remove=async e=>(await a(this,_)).removeCharacterStyle(e).then(n=>i(n)),this.duplicate=async e=>(await a(this,_)).duplicateCharacterStyle(e).then(n=>i(n)),this.rename=async(e,t)=>(await a(this,_)).renameCharacterStyle(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,_)).moveCharacterStyles(e,t).then(r=>i(r)),y(this,_,o)}}_=new WeakMap;class Ke{constructor(o){g(this,ot);this.copyFrames=async e=>{const n=await(await a(this,ot)).copyFrames(e);return n.data&&await navigator.clipboard.writeText(n.data),i(n)},this.cutFrames=async e=>{const n=await(await a(this,ot)).cutFrames(e);return n.data&&await navigator.clipboard.writeText(n.data),i(n)},this.pasteFrames=async()=>{const e=await a(this,ot),t=await navigator.clipboard.readText(),n=await e.pasteFrames(t);return i(n)},this.getContentType=async()=>{const e=await a(this,ot),t=await navigator.clipboard.readText(),n=await e.getClipboardContentType(t);return i(n)},y(this,ot,o)}}ot=new WeakMap;class qe{constructor(o){g(this,Kt);this.convertToRgb=async e=>(await a(this,Kt)).colorToRgb(JSON.stringify(e)).then(n=>i(n)),y(this,Kt,o)}}Kt=new WeakMap;var Ye=(s=>(s.rgb="rgb",s.hex="hex",s.cmyk="cmyk",s.spotCmyk="spotCmyk",s.spotRgb="spotRgb",s.spotHex="spotHex",s))(Ye||{}),ie=(s=>(s.rgb="rgb",s.hex="hex",s.cmyk="cmyk",s.gray="gray",s.hsl="hsl",s.spot="spot",s.spotCMYK="spotCMYK",s.spotRGB="spotRGB",s.spotHEX="spotHEX",s))(ie||{}),Ze=(s=>(s.local="local",s.brandKit="brandKit",s.stylekit="brandKit",s))(Ze||{});class Qe{constructor(o){g(this,H);this.getAll=async()=>(await a(this,H)).getColors().then(t=>i(t)),this.getById=async e=>(await a(this,H)).getColorById(e).then(n=>i(n)),this.create=async()=>(await a(this,H)).createColor().then(t=>i(t)),this.duplicate=async e=>(await a(this,H)).duplicateColor(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,H)).moveColors(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,H)).renameColor(e,t).then(r=>i(r)),this.update=async(e,t)=>{const n=await a(this,H),r=t;return r.type===ie.spot&&(r.type=ie.spotCMYK),n.updateColor(e,JSON.stringify(r)).then(c=>i(c))},this.remove=async e=>(await a(this,H)).removeColor(e).then(n=>i(n)),y(this,H,o)}}H=new WeakMap;var Et=(s=>(s[s.file=0]="file",s[s.collection=1]="collection",s))(Et||{}),oe=(s=>(s.LowResolutionWeb="lowresWeb",s.HighResolutionWeb="highresWeb",s))(oe||{}),Ot=(s=>(s.file="file",s.collection="collection",s))(Ot||{}),Xe=(s=>(s.media="media",s.fonts="fonts",s.data="data",s.components="components",s))(Xe||{}),ts=(s=>(s.name="name",s.path="relativePath",s.id="id",s))(ts||{}),es=(s=>(s.ascending="asc",s.descending="desc",s))(es||{}),ss=(s=>(s.text="text",s.boolean="boolean",s.number="number",s))(ss||{}),ns=(s=>(s.query="query",s.upload="upload",s))(ns||{}),Ft=(s=>(s.url="url",s.grafx="grafx",s.local="local",s))(Ft||{});class Ur{constructor(o,e,t,n="engineToConnector",r){this.direction="engineToConnector",this.name=o,this.direction=n,e==="var"?(this.value=`var.${t}`,this.id=t,this.type="var",this.sourceField=r):(this.value=t,this.type="value")}}var rs=(s=>(s.variable="var",s.value="value",s))(rs||{}),as=(s=>(s.engineToConnector="engineToConnector",s.connectorToEngine="connectorToEngine",s))(as||{}),ce=(s=>(s.loading="loading",s.loaded="loaded",s.running="running",s.ready="ready",s.error="error",s))(ce||{}),is=(s=>(s.stateChanged="stateChanged",s.authChanged="authChanged",s.reloadRequired="reloadRequired",s.unloaded="unloaded",s))(is||{});const Gr={url:"grafx-media.json",source:"local"};class _r{constructor(o,e){this.type="grafxToken",this.token=o,this.headers=e}}class Hr{constructor(o){this.type="refreshed",this.headers=o}}var os=(s=>(s.grafxToken="grafxToken",s.refreshed="refreshed",s))(os||{}),cs=(s=>(s.grafxToken="grafxToken",s.any="any",s))(cs||{}),Ce=(s=>(s.minDimension="minDimension",s))(Ce||{});class hs extends Error{constructor(o,e){super(o),this.type=e}}var ds=(s=>(s.StaticKey="staticKey",s.OAuth2ClientCredentials="oAuth2ClientCredentials",s.OAuth2AuthorizationCode="oAuth2AuthorizationCode",s.OAuth2ResourceOwnerPassword="oAuth2ResourceOwnerPassword",s.OAuth2JwtBearer="oAuth2JwtBearer",s.None="none",s))(ds||{});class he{constructor(){this.makeConnectorSourceForwardsCompatible=o=>{if(o.source!=Ft.grafx||this.isSourceMigrated(o))return o;let e=o.url;for(;e.endsWith("/");)e=e.substring(0,e.length-1);const t=e.split("/");return{id:t[t.length-1],source:Ft.grafx}},this.makeMultipleConnectorsBackwardsCompatible=(o,e)=>o.map(t=>this.makeSingleConnectorBackwardsCompatible(t,e)),this.makeSingleConnectorBackwardsCompatible=(o,e)=>o.source.source!=Ft.grafx?o:{id:o.id,name:o.name,iconUrl:o.iconUrl,source:this.makeConnectorSourceBackwardsCompatible(o.source,e)},this.makeConnectorSourceBackwardsCompatible=(o,e)=>{let t=e;for(;t!=null&&t.endsWith("/");)t=t.substring(0,t.length-1);return{url:`${t}/connectors/${o.id}`,source:Ft.grafx}},this.isSourceMigrated=o=>"id"in o}}let ls=(Hn=class{constructor(o,e){g(this,J);g(this,Nt);g(this,Ct);this.getById=async t=>(await a(this,J)).getConnectorById(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData=a(this,Ct).makeSingleConnectorBackwardsCompatible(r.parsedData,a(this,Nt).get(Z.GraFxStudioEnvironmentApiUrl))),c}),this.getAllByType=async t=>(await a(this,J)).getConnectors(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData=a(this,Ct).makeMultipleConnectorsBackwardsCompatible(r.parsedData,a(this,Nt).get(Z.GraFxStudioEnvironmentApiUrl))),c}),this.register=async t=>{const n=await a(this,J),r=a(this,Ct).makeConnectorSourceForwardsCompatible(t);return n.registerConnector(JSON.stringify(r)).then(c=>i(c))},this.unregister=async t=>(await a(this,J)).unregisterConnector(t).then(r=>i(r)),this.configure=async(t,n)=>{const r=await a(this,J);return await this.waitToBeReady(t),await n(new xr(t,r)),r.updateConnectorConfiguration(t).then(c=>i(c))},this.getState=async t=>(await a(this,J)).getConnectorState(t).then(r=>i(r)),this.getOptions=async t=>(await a(this,J)).getConnectorOptions(t).then(r=>i(r)),this.waitToBeReady=async(t,n=2e3)=>{let r=Math.max(n,500);r=Math.min(r,5e3);const c=100;let d=0;try{for(;d*c<r;){const l=await this.getState(t);if(l.success&&l.parsedData&&(l.parsedData.type===ce.running||l.parsedData.type===ce.ready))return i({data:null,success:!0,error:void 0,status:0,parsedData:void 0},!1);await new Promise(m=>setTimeout(m,c)),d++}}catch(l){return i({data:null,success:!1,error:`Error while getting connector state ${l}`,status:5e4,parsedData:void 0},!1)}return i({data:null,success:!1,error:"Timed out waiting for connector",status:5e4,parsedData:void 0},!1)},this.updateMappings=async(t,n)=>await this.configure(t,async r=>{const{parsedData:c}=await this.getMappings(t),d=(c==null?void 0:c.filter(p=>!n.some(f=>f.name===p.name&&f.direction===p.direction)))??[],l=n.filter(p=>p.name!==""&&p.value!==""),m=[...d,...l];await r.setMappings(m)}),this.applyMappings=async(t,n)=>await this.configure(t,async r=>{const c=n.filter(d=>d.name!==""&&d.value!=="");await r.setMappings(c)}),this.setHttpHeaders=async(t,n)=>(await a(this,J)).remoteConnectorAuthenticationSetHttpHeaders(t,JSON.stringify(n)).then(c=>i(c)),y(this,J,o),y(this,Nt,e),y(this,Ct,new he)}async getMappings(o,e){return(await a(this,J)).getConnectorMappings(o).then(n=>i(n)).then(n=>{var r;return e?{...n,parsedData:(r=n.parsedData)==null?void 0:r.filter(c=>c.direction===e)}:n})}},J=new WeakMap,Nt=new WeakMap,Ct=new WeakMap,Hn);class xr{constructor(o,e){g(this,ft);g(this,St);this.setOptions=async t=>a(this,St).setConnectorOptions(a(this,ft),JSON.stringify(t)).then(n=>i(n)),this.setMappings=async t=>{const n=await a(this,St).setConnectorMappings(a(this,ft),t.map(function(r){return JSON.stringify(r)}));return i(n)},this.setHttpHeader=async(t,n)=>a(this,St).connectorAuthenticationSetHttpHeader(a(this,ft),t,n).then(r=>i(r)),y(this,ft,o),y(this,St,e)}}ft=new WeakMap,St=new WeakMap;class us{constructor(o,e){g(this,et);g(this,Mt);this.getPageItemById=async(t,n,r,c={})=>{const l=await(await a(this,et)).dataConnectorGetPageItemById(t,n,JSON.stringify(r),JSON.stringify(c)),m=i(l),p={...m,parsedData:null};return m.parsedData&&(p.parsedData={...m.parsedData,data:a(this,Mt).mapEngineToDataItem(m.parsedData.data)}),p},this.getConfigurationOptions=async t=>(await a(this,et)).dataConnectorGetConfigurationOptions(t).then(r=>i(r)),this.getCapabilities=async t=>(await a(this,et)).dataConnectorGetCapabilities(t).then(r=>i(r)),y(this,et,o),y(this,Mt,e)}async getPage(o,e,t={}){const{previousPageToken:n,continuationToken:r}=e;if(n!=null&&r!=null)throw new Error('Invalid page config: "previousPageToken" and "continuationToken" are mutually exclusive. Provide only one to indicate navigation direction.');const d=await(await a(this,et)).dataConnectorGetPage(o,JSON.stringify(e),JSON.stringify(t)),l=i(d),m={...l,parsedData:null};return l.parsedData&&(m.parsedData={...l.parsedData,data:l.parsedData.data.map(p=>a(this,Mt).mapEngineToDataItem(p))}),m}async getModel(o,e={}){return(await a(this,et)).dataConnectorGetModel(o,JSON.stringify(e)).then(n=>i(n))}}et=new WeakMap,Mt=new WeakMap;class gs{constructor(o,e){g(this,ct);g(this,qt);this.setDataSource=async t=>(await a(this,ct)).setDataSource(t).then(r=>i(r)),this.getDataSource=async()=>(await a(this,ct)).getDataSource().then(n=>i(n)),this.removeDataSource=async()=>(await a(this,ct)).removeDataSource().then(n=>i(n)),this.setDataRow=async t=>{const n=await a(this,ct),r=a(this,qt).mapDataItemToEngine(t);return n.setDataRow(JSON.stringify(r)).then(c=>i(c))},y(this,ct,o),y(this,qt,e)}}ct=new WeakMap,qt=new WeakMap;class ys{constructor(o){g(this,ht);this.getAllLogs=async()=>(await a(this,ht)).getLogs().then(t=>i(t)),this.toggleDebugPanel=async()=>(await a(this,ht)).toggleDebugPanel().then(t=>i(t)),this.enableDebug=async()=>(await a(this,ht)).enableDebug().then(t=>i(t)),this.disableDebug=async()=>(await a(this,ht)).disableDebug().then(t=>i(t)),y(this,ht,o)}}ht=new WeakMap;class ps{constructor(o){g(this,bt);this.getCurrentState=async()=>(await a(this,bt)).getCurrentDocumentState().then(t=>i(t)),this.load=async(e,t={keepConnectors:!1})=>{const n=await a(this,bt),r=typeof e!="string"?JSON.stringify(e):e;return n.loadDocument(r,JSON.stringify(t)).then(c=>i(c))},this.createAndLoad=async e=>{const t=await a(this,bt),n=JSON.stringify(e);return t.createAndLoadDocument(n).then(r=>i(r))},y(this,bt,o)}}bt=new WeakMap;var ms=(s=>(s.resize="resize",s.scale="scale",s.scaleAndResize="scaleAndResize",s))(ms||{}),ws=(s=>(s.top="top",s.bottom="bottom",s.left="left",s.right="right",s))(ws||{}),jt=(s=>(s.url="url",s.variable="variable",s.connector="connector",s.brandKitMedia="brandKitMedia",s))(jt||{}),Cs=(s=>(s.connector="connector",s))(Cs||{}),fs=(s=>(s.text="text",s.image="image",s.shape="shape",s.barcode="barcode",s.component="component",s.componentGrid="componentGrid",s))(fs||{}),Ss=(s=>(s.variable="variable",s.text="text",s))(Ss||{}),bs=(s=>(s.leftToRight="leftToRight",s.rightToLeft="rightToLeft",s.weak="weak",s))(bs||{}),Is=(s=>(s.horizontal="horizontal",s.vertical="vertical",s.onPath="onPath",s))(Is||{}),vs=(s=>(s.top="top",s.bottom="bottom",s.middle="middle",s.justify="justify",s))(vs||{}),As=(s=>(s.normal="normal",s.screen="screen",s.overlay="overlay",s.darken="darken",s.lighten="lighten",s.colorDodge="colorDodge",s.colorBurn="colorBurn",s.hardLight="hardLight",s.softLight="softLight",s.difference="difference",s.exclusion="exclusion",s.multiply="multiply",s.hue="hue",s.saturation="saturation",s.color="color",s.luminosity="luminosity",s))(As||{}),Ps=(s=>(s.fill="fill",s.fit="fit",s.smartCrop="smartCrop",s.manualCrop="manualCrop",s))(Ps||{}),Es=(s=>(s.topLeft="topLeft",s.topCenter="topCenter",s.topRight="topRight",s.centerLeft="centerLeft",s.center="center",s.centerRight="centerRight",s.bottomLeft="bottomLeft",s.bottomCenter="bottomCenter",s.bottomRight="bottomRight",s))(Es||{}),Os=(s=>(s.bringToFront="bringToFront",s.sendToBack="sendToBack",s.bringForward="bringForward",s.sendBackward="sendBackward",s))(Os||{}),Fs=(s=>(s.relative="relative",s.start="start",s.end="end",s.startAndEnd="startAndEnd",s.center="center",s))(Fs||{}),Ds=(s=>(s.page="page",s.frame="frame",s))(Ds||{}),Ls=(s=>(s.start="start",s.end="end",s.center="center",s))(Ls||{});class $r{constructor(){this.type="page"}}class jr{constructor(o,e){this.type="frame",this.frameId=o,this.edge=e}}var fe=(s=>(s.frameCrop="frameCrop",s.assetCrop="assetCrop",s))(fe||{}),Ns=(s=>(s.v1="v1",s.v2="v2",s))(Ns||{});const zr="v2";var Ms=(s=>(s.start="start",s.center="center",s.end="end",s))(Ms||{});class Rs{constructor(o){g(this,x);this.insertImageVariableToFrame=async(e,t)=>{const n=await a(this,x),r={id:t,type:jt.variable};return n.setImageSource(e,JSON.stringify(r)).then(c=>i(c))},this.insertTextVariable=async e=>(await a(this,x)).insertTextVariable(e).then(n=>i(n)),this.enterTextEditMode=async e=>(await a(this,x)).enterTextEditMode(e).then(n=>i(n)),this.exitTextEditMode=async()=>(await a(this,x)).exitTextEditMode().then(t=>i(t)),this.getText=async(e,t)=>(await a(this,x)).getTextByFrameId(e,t).then(r=>i(r)),this.setText=async(e,t)=>(await a(this,x)).setTextByFrameId(e,t).then(r=>i(r)),this.selectText=async(e,t,n)=>(await a(this,x)).selectTextById(e,t,n).then(c=>i(c)),this.addCustomUndoData=async(e,t,n)=>(await a(this,x)).setCustomUndoData(e,t,n??!1).then(c=>i(c)),y(this,x,o)}}x=new WeakMap;class Vs{constructor(o){g(this,dt);g(this,Rt);this.query=async(e,t,n={})=>(await a(this,dt)).fontConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),this.detail=async(e,t,n={})=>(await a(this,dt)).fontConnectorDetail(e,t,JSON.stringify(n)).then(c=>i(c)),this.download=async(e,t,n={})=>(await a(this,Rt)).fontConnectorDownload(e,t,JSON.stringify(n)).then(c=>c??c),this.preview=async(e,t,n,r={})=>(await a(this,Rt)).fontConnectorPreview(e,t,n,JSON.stringify(r)).then(d=>d??d),this.getConfigurationOptions=async e=>(await a(this,dt)).fontConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,dt)).fontConnectorGetCapabilities(e).then(n=>i(n)),this.parseDeprecatedFontType=e=>{if(e===Et.file)return Ot.file;if(e===Et.collection)return Ot.collection},y(this,dt,o),y(this,Rt,o)}}dt=new WeakMap,Rt=new WeakMap;class ks{constructor(o){g(this,D);this.addFontFamily=async(e,t)=>(await a(this,D)).addFontFamily(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontFamily=async e=>(await a(this,D)).removeFontFamily(e).then(n=>i(n)),this.addFontStyle=async(e,t)=>(await a(this,D)).addFontStyle(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontStyle=async e=>(await a(this,D)).removeFontStyle(e).then(n=>i(n)),this.getFontFamilies=async()=>(await a(this,D)).getFontFamilies().then(t=>i(t)),this.getFontStyles=async e=>(await a(this,D)).getFontStyles(e).then(n=>i(n)),this.getFontFamilyById=async e=>(await a(this,D)).getFontFamilyById(e).then(n=>i(n)),this.getFontStyleById=async e=>(await a(this,D)).getFontStyleById(e).then(n=>i(n)),this.getDefaultFontStyle=async()=>(await a(this,D)).getDefaultFontStyle().then(t=>i(t)),this.getDefaultFontFamily=async()=>(await a(this,D)).getDefaultFontFamily().then(t=>i(t)),this.isFontFamilyUsed=async e=>(await a(this,D)).isFontFamilyUsed(e).then(n=>i(n)),this.isFontStyleUsed=async e=>(await a(this,D)).isFontStyleUsed(e).then(n=>i(n)),this.moveFontFamilies=async(e,t)=>(await a(this,D)).moveFontFamilies(e,t).then(r=>i(r)),this.getPreviewsOfCharacterStrings=async(e,t)=>(await a(this,D)).getPreviewsOfCharacterStrings(e,JSON.stringify(t)).then(r=>i(r)),y(this,D,o)}}D=new WeakMap;class Se{constructor(o){g(this,Vt);this.setShapeProperties=async(e,t)=>(await a(this,Vt)).setShapeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableFill=async(e,t)=>{const n={enableFill:t};return this.setShapeProperties(e,n)},this.setFillColor=async(e,t)=>{const n={fillColor:t};return this.setShapeProperties(e,n)},this.setEnableStroke=async(e,t)=>{const n={enableStroke:t};return this.setShapeProperties(e,n)},this.setStrokeColor=async(e,t)=>{const n={strokeColor:t};return this.setShapeProperties(e,n)},this.setStrokeWeight=async(e,t)=>{const n={strokeWeight:t};return this.setShapeProperties(e,n)},this.setFlagAllCornersSame=async(e,t)=>{const n={allCornersSame:t};return this.setShapeProperties(e,n)},this.setShapeCorners=async(e,t)=>(await a(this,Vt)).setShapeCorners(e,JSON.stringify(t)).then(r=>i(r)),this.setRadiusAll=async(e,t)=>{const n={radiusAll:t};return this.setShapeCorners(e,n)},this.setRadiusTopLeft=async(e,t)=>{const n={topLeft:t};return this.setShapeCorners(e,n)},this.setRadiusBottomLeft=async(e,t)=>{const n={bottomLeft:t};return this.setShapeCorners(e,n)},this.setRadiusTopRight=async(e,t)=>{const n={topRight:t};return this.setShapeCorners(e,n)},this.setRadiusBottomRight=async(e,t)=>{const n={bottomRight:t};return this.setShapeCorners(e,n)},y(this,Vt,o)}}Vt=new WeakMap;class Ts{constructor(o){g(this,u);this.getAll=async()=>(await a(this,u)).getFrames().then(t=>i(t)),this.getSelected=async()=>(await a(this,u)).getSelectedFrames().then(t=>i(t)),this.getAllByPageId=async e=>(await a(this,u)).getFramesByPageId(e).then(n=>i(n)),this.getByName=async e=>(await a(this,u)).getFrameByName(e).then(n=>i(n)),this.getById=async e=>(await a(this,u)).getFrameById(e).then(n=>i(n)),this.getPropertiesOnSelectedLayout=async()=>(await a(this,u)).getFramePropertiesOnSelectedLayout().then(t=>i(t)),this.getLayoutProperties=async(e,t)=>(await a(this,u)).getFramePropertiesByFrameId(e,t).then(r=>i(r)),this.getAllLayoutProperties=async e=>(await a(this,u)).getFramesProperties(e).then(n=>i(n)),this.resetTransformation=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.resetSize=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.select=async e=>(await a(this,u)).selectFrames([e]).then(n=>i(n)),this.selectMultiple=async e=>(await a(this,u)).selectFrames(e).then(n=>i(n)),this.deselectAll=async()=>(await a(this,u)).deselectFrames().then(t=>i(t)),this.reorderFrames=async(e,t)=>(await a(this,u)).reorderFrames(e,t).then(r=>i(r)),this.setZIndex=async(e,t)=>(await a(this,u)).setFrameZIndex(e,t).then(r=>i(r)),this.setHeight=async(e,t)=>(await a(this,u)).setFrameHeight(e,t).then(r=>i(r)),this.setRotation=async(e,t)=>(await a(this,u)).setFrameRotation(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,u)).setFrameWidth(e,t).then(r=>i(r)),this.setX=async(e,t)=>(await a(this,u)).setFrameX(e,t).then(r=>i(r)),this.setY=async(e,t)=>(await a(this,u)).setFrameY(e,t).then(r=>i(r)),this.setOpacity=async(e,t)=>(await a(this,u)).setFrameOpacity(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,u)).renameFrame(e,t).then(r=>i(r)),this.reset=async e=>(await a(this,u)).resetFrame(e).then(n=>i(n)),this.resetX=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.resetY=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.resetRotation=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.resetWidth=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.resetHeight=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.resetImageFrameFitMode=async e=>(await a(this,u)).resetImageFrameFitMode(e).then(n=>i(n)),this.setVisibility=async(e,t)=>(await a(this,u)).setFrameIsVisible(e,t).then(r=>i(r)),this.setIsVisible=async(e,t)=>(await a(this,u)).setFrameIsVisible(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,u)).removeFrames([e]).then(n=>i(n)),this.removeFrames=async e=>(await a(this,u)).removeFrames(e).then(n=>i(n)),this.create=async(e,t,n,r,c)=>(await a(this,u)).addFrame(e,t,n,r,c).then(l=>i(l)),this.createShapeFrame=async(e,t,n,r,c)=>(await a(this,u)).addFrame(e,t,n,r,c).then(l=>i(l)),this.createBarcodeFrame=async(e,t)=>(await a(this,u)).addBarcodeFrame(e,t==null?void 0:t.x,t==null?void 0:t.y).then(r=>i(r)),this.createComponentFrame=async(e,t,n,r,c)=>(await a(this,u)).addComponentFrame(t,n,r,c,JSON.stringify(e)).then(l=>i(l)),this.duplicateFrames=async e=>(await a(this,u)).duplicateFrames(e).then(n=>i(n)),this.updateImageSource=async(e,t)=>{const n=await a(this,u),r=t!==null?JSON.stringify(t):null;return n.setImageSource(e,r).then(c=>i(c))},this.removeImageSource=async e=>this.updateImageSource(e,null),this.setImageFromConnector=async(e,t,n)=>{const r={id:t,assetId:n,type:jt.connector};return this.updateImageSource(e,r)},this.setImageFromUrl=async(e,t)=>{const n={url:t,type:jt.url};return this.updateImageSource(e,n)},this.setImageFrameFitMode=async(e,t)=>(await a(this,u)).setImageFrameFitMode(e,t).then(r=>i(r)),this.setImageFrameFitModePosition=async(e,t)=>(await a(this,u)).setImageFrameFitModePosition(e,t).then(r=>i(r)),this.setImageFrameSmartCropSettings=async(e,t)=>(await a(this,u)).setImageFrameSmartCropSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setFrameConstrainProportions=async(e,t)=>(console.error("setFrameConstrainProportions is not supported anymore"),i({success:!1,status:0,error:"setFrameConstrainProportions is not supported anymore",parsedData:null})),this.setVerticalAlign=async(e,t)=>(await a(this,u)).setVerticalAlignment(e,t).then(r=>i(r)),this.setNumberOfColumns=async(e,t)=>(await a(this,u)).setNumberOfColumns(e,t).then(r=>i(r)),this.setColumnGap=async(e,t)=>(await a(this,u)).setColumnGap(e,t).then(r=>i(r)),this.setMinCopyfitting=async(e,t)=>(await a(this,u)).setMinCopyfitting(e,t).then(r=>i(r)),this.setMaxCopyfitting=async(e,t)=>(await a(this,u)).setMaxCopyfitting(e,t).then(r=>i(r)),this.setEnableCopyfitting=async(e,t)=>(await a(this,u)).setEnableCopyfitting(e,t).then(r=>i(r)),this.resetMinCopyfitting=async e=>(await a(this,u)).resetMinCopyfitting(e).then(n=>i(n)),this.resetMaxCopyfitting=async e=>(await a(this,u)).resetMaxCopyfitting(e).then(n=>i(n)),this.resetEnableCopyfitting=async e=>(await a(this,u)).resetEnableCopyfitting(e).then(n=>i(n)),this.setShapeFrameEnableFill=async(e,t)=>this.shapeController.setEnableFill(e,t),this.setShapeFrameFillColor=async(e,t)=>this.shapeController.setFillColor(e,t),this.setShapeFrameEnableStroke=async(e,t)=>this.shapeController.setEnableStroke(e,t),this.setShapeFrameStrokeColor=async(e,t)=>this.shapeController.setStrokeColor(e,t),this.setShapeFrameStrokeWeight=async(e,t)=>this.shapeController.setStrokeWeight(e,t),this.setFillOverprint=async(e,t)=>(await a(this,u)).setFrameFillOverprint(e,t).then(r=>i(r)),this.setStrokeOverprint=async(e,t)=>(await a(this,u)).setFrameStrokeOverprint(e,t).then(r=>i(r)),this.setBlendMode=async(e,t)=>(await a(this,u)).setFrameBlendMode(e,t).then(r=>i(r)),this.setFrameContainerShape=async(e,t)=>(await a(this,u)).setFrameContainerShape(e,JSON.stringify(t)).then(r=>i(r)),this.enterCropMode=async(e,t=fe.frameCrop)=>(await a(this,u)).enterCropMode(e,t).then(r=>i(r)),this.applyCropMode=async()=>(await a(this,u)).applyCropMode().then(t=>i(t)),this.exitCropMode=async()=>(await a(this,u)).cancelCropMode().then(t=>i(t)),this.enterSubjectMode=async e=>(await a(this,u)).enterSubjectMode(e).then(n=>i(n)),this.applySubjectMode=async()=>(await a(this,u)).applySubjectMode().then(t=>i(t)),this.exitSubjectMode=async()=>(await a(this,u)).cancelSubjectMode().then(t=>i(t)),this.enterGradientMode=async e=>(await a(this,u)).enterGradientMode(e).then(n=>i(n)),this.applyGradientMode=async()=>(await a(this,u)).applyGradientMode().then(t=>i(t)),this.cancelGradientMode=async()=>(await a(this,u)).cancelGradientMode().then(t=>i(t)),this.resetCropMode=async e=>(console.error("resetCropMode is not supported anymore"),i({success:!1,status:0,error:"resetCropMode is not supported anymore",parsedData:null})),this.setEnableAutoGrow=async(e,t)=>{const n={enabled:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMinWidth=async(e,t)=>{const n={minWidth:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMaxWidth=async(e,t)=>{const n={maxWidth:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMinHeight=async(e,t)=>{const n={minHeight:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowMaxHeight=async(e,t)=>{const n={maxHeight:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAutoGrowDirections=async(e,t)=>{const n={directions:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.resetAutoGrowSettingsEnabled=async e=>(console.error("resetAutoGrowSettingsEnabled is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowSettingsEnabled is not supported anymore",parsedData:null})),this.resetAutoGrowMinWidth=async e=>(console.error("resetAutoGrowMinWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMaxWidth=async e=>(console.error("resetAutoGrowMaxWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMinHeight=async e=>(console.error("resetAutoGrowMinHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinHeight is not supported anymore",parsedData:null})),this.resetAutoGrowMaxHeight=async e=>(console.error("resetAutoGrowMaxHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxHeight is not supported anymore",parsedData:null})),this.resetAutoGrowDirections=async e=>(console.error("resetAutoGrowDirections is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowDirections is not supported anymore",parsedData:null})),this.resetAutoGrow=async e=>(console.error("resetAutoGrow is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrow is not supported anymore",parsedData:null})),this.setShadowEnabled=async(e,t)=>{const n={enabled:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowDistance=async(e,t)=>{const n={distance:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowAngleDegrees=async(e,t)=>{const n={angleDegrees:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowBlurRadius=async(e,t)=>{const n={blurRadius:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setShadowColor=async(e,t)=>{const n={color:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setAnchor=async(e,t,n,r,c)=>{const d={horizontal:t,type:n,target:r,endTarget:c};return(await a(this,u)).setAnchorProperties(e,JSON.stringify(d)).then(m=>i(m))},this.setVerticalAnchor=async(e,t,n,r)=>this.setAnchor(e,!1,t,n,r),this.setHorizontalAnchor=async(e,t,n,r)=>this.setAnchor(e,!0,t,n,r),this.resetAnchoring=async e=>(await a(this,u)).resetFrameTransformation(e).then(n=>i(n)),this.resetVisibility=async e=>(await a(this,u)).setFrameIsVisible(e,null).then(n=>i(n)),this.getConfiguration=async e=>(await a(this,u)).getFrameConfiguration(e).then(n=>i(n)),this.resetAssetCropOverride=async e=>(await a(this,u)).resetAssetCropOverride(e).then(n=>i(n)),this.resetAllAssetCropOverrides=async e=>(await a(this,u)).resetAllAssetCropOverrides(e).then(n=>i(n)),this.setGradientApplied=async(e,t)=>{const n={isApplied:t};return(await a(this,u)).updateFrameGradientSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setLocalGradient=async(e,t)=>{const n={gradient:t};return(await a(this,u)).updateFrameGradientSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setBrandKitGradient=async(e,t)=>{const n={id:t};return(await a(this,u)).updateFrameGradientSettings(e,JSON.stringify(n)).then(c=>i(c))},this.setSmartCropSubjectId=async(e,t)=>(await a(this,u)).setSmartCropSubjectId(e,t).then(r=>i(r)),y(this,u,o),this.shapeController=new Se(a(this,u)),this.constraints=new Wr(a(this,u))}}u=new WeakMap;class Wr{constructor(o){g(this,N);this.get=async e=>(await a(this,N)).getFrameConstraints(e).then(n=>i(n)),this.setSelectable=async(e,t)=>{const n={selectionAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setHorizontalMovement=async(e,t)=>{const n={horizontalMovementAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setVerticalMovement=async(e,t)=>{const n={verticalMovementAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setRotation=async(e,t)=>{const n={rotationAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setResize=async(e,t,n)=>{const r={resizeAllowed:{value:t},...n!==void 0&&{proportionLocked:{value:n}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(r)).then(d=>i(d))},this.setCrop=async(e,t)=>{const n={image:{cropAllowed:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setTextEditingAllowed=async(e,t)=>{const n={text:{editingAllowed:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedParagraphStyles=async(e,t)=>{const n={text:{paragraphStyles:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedCharacterStyles=async(e,t)=>{const n={text:{characterStyles:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedColors=async(e,t)=>{const n={text:{colors:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},this.setAllowedFontSizes=async(e,t)=>{const n={text:{fontSizes:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(n)).then(c=>i(c))},y(this,N,o)}}N=new WeakMap;class Bs{constructor(){this.currentEngineVersion=T.current,this.currentSDKVersion=Oe.version}}class Js{constructor(o){g(this,S);g(this,Yt);this.getAll=async()=>(await a(this,S)).getLayouts().then(t=>i(t)),this.getById=async e=>(await a(this,S)).getLayoutById(e).then(n=>i(n)),this.getByName=async e=>(await a(this,S)).getLayoutByName(e).then(n=>i(n)),this.getSelected=async()=>(await a(this,S)).getSelectedLayout().then(t=>i(t)),this.remove=async e=>(await a(this,S)).removeLayout(e).then(n=>i(n)),this.create=async(e,t)=>{const n=await a(this,S);return t!=null&&t.length?n.addLayouts(e,JSON.stringify(t)).then(r=>i(r)):n.addLayout(e).then(r=>i(r))},this.rename=async(e,t)=>(await a(this,S)).renameLayout(e,t).then(r=>i(r)),this.select=async e=>(await a(this,S)).selectLayoutWithOptions(e,null).then(n=>i(n)),this.selectWithPageSize=async(e,t)=>{const n=await a(this,S),r={pageSize:t};return n.selectLayoutWithOptions(e,JSON.stringify(r)).then(c=>i(c))},this.duplicate=async e=>(await a(this,S)).duplicateLayout(e).then(n=>i(n)),this.reset=async e=>(await a(this,S)).resetLayout(e).then(n=>i(n)),this.setHeight=async(e,t)=>(await a(this,S)).setLayoutHeight(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,S)).setLayoutWidth(e,t).then(r=>i(r)),this.setUnit=async(e,t)=>(await a(this,S)).setLayoutUnit(e,t).then(r=>i(r)),this.resetHeight=async e=>(await a(this,S)).resetLayoutHeight(e).then(n=>i(n)),this.resetWidth=async e=>(await a(this,S)).resetLayoutWidth(e).then(n=>i(n)),this.resetUnit=async e=>(await a(this,S)).resetLayoutUnit(e).then(n=>i(n)),this.getSelectedSnapshot=async()=>(await a(this,Yt)).getPageSnapshot().then(t=>t??t),this.setIntent=async(e,t)=>(await a(this,S)).setLayoutIntent(e,t).then(r=>i(r)),this.resetIntent=async e=>(await a(this,S)).resetLayoutIntent(e).then(n=>i(n)),this.setFillColor=async(e,t)=>(await a(this,S)).setLayoutFillColor(e,JSON.stringify(t)).then(r=>i(r)),this.setFillColorEnabled=async(e,t)=>(await a(this,S)).setLayoutFillColorEnabled(e,t).then(r=>i(r)),this.resetFillColor=async e=>(await a(this,S)).resetLayoutFillColor(e).then(n=>i(n)),this.setBleedValue=async(e,t,n)=>{const r=n?{left:n===Q.left?t:void 0,top:n===Q.top?t:void 0,right:n===Q.right?t:void 0,bottom:n===Q.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,S)).updateLayoutBleed(e,JSON.stringify(r)).then(d=>i(d))},this.setAreBleedValuesCombined=async(e,t)=>{const n={areBleedValuesCombined:t};return(await a(this,S)).updateLayoutBleed(e,JSON.stringify(n)).then(c=>i(c))},this.resetBleedValues=async e=>(await a(this,S)).updateLayoutBleed(e,null).then(n=>i(n)),this.setPrivateData=async(e,t)=>(await a(this,S)).setLayoutPrivateData(e,JSON.stringify(t)).then(r=>i(r)),this.getPrivateData=async e=>(await a(this,S)).getLayoutPrivateData(e).then(n=>i(n)),this.setDisplayName=async(e,t)=>(await a(this,S)).setLayoutDisplayName(e,t).then(r=>i(r)),this.getDisplayName=async e=>(await a(this,S)).getLayoutDisplayName(e).then(n=>i(n)),this.resetDisplayName=async e=>(await a(this,S)).setLayoutDisplayName(e,null).then(n=>i(n)),this.setAvailableForUser=async(e,t)=>(await a(this,S)).setLayoutAvailableForUser(e,t).then(r=>i(r)),this.setSelectedByUser=async(e,t)=>(await a(this,S)).setLayoutSelectedByUser(e,t).then(r=>i(r)),this.setResizableByUser=async(e,t)=>(await a(this,S)).setLayoutResizableByUser(e,JSON.stringify(t)).then(r=>i(r)),y(this,S,o),y(this,Yt,o)}}S=new WeakMap,Yt=new WeakMap;var de=(s=>(s.thumbnail="thumbnail",s.mediumres="mediumres",s.highres="highres",s.original="original",s))(de||{}),be=(s=>(s.web="web",s.print="print",s.animation="animation",s))(be||{});class Us{constructor(o){g(this,st);g(this,Zt);this.query=async(e,t,n={})=>(await a(this,st)).mediaConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),this.detail=async(e,t,n={})=>(await a(this,st)).mediaConnectorDetail(e,t,JSON.stringify(n)).then(c=>i(c)),this.download=async(e,t,n,r={})=>{const c=this.parseDeprecatedMediaDownloadType(n);return(await a(this,Zt)).mediaConnectorDownload(e,t,c,be.web,JSON.stringify(r)).then(l=>{if(l instanceof Uint8Array)return l;throw typeof l=="object"&&l!==null&&"success"in l&&!l.success&&mt(l),new Error(`Unexpected response type: ${typeof l}.`)})},this.getConfigurationOptions=async e=>(await a(this,st)).mediaConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,st)).mediaConnectorGetCapabilities(e).then(n=>i(n)),this.parseDeprecatedMediaType=e=>{if(e===Et.file)return Ot.file;if(e===Et.collection)return Ot.collection},this.upload=async(e,t,n={})=>(await a(this,st)).mediaConnectorUpload(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),y(this,st,o),y(this,Zt,o)}parseDeprecatedMediaDownloadType(o){switch(o){case oe.HighResolutionWeb:return de.highres;case oe.LowResolutionWeb:return de.thumbnail;default:return o}}}st=new WeakMap,Zt=new WeakMap;let Gs=(xn=class{constructor(o){g(this,R);g(this,Qt);this.add=async()=>(await a(this,R)).addPage().then(t=>i(t)),this.remove=async e=>(await a(this,R)).removePage(e).then(n=>i(n)),this.select=async e=>(await a(this,R)).selectPage(e).then(n=>i(n)),this.setVisibility=async(e,t)=>(await a(this,R)).setPageIsVisible(e,t).then(r=>i(r)),this.duplicate=async e=>(await a(this,R)).duplicatePage(e).then(n=>i(n)),this.getAll=async()=>(await a(this,R)).getPages().then(t=>i(t)),this.getById=async e=>(await a(this,R)).getPageById(e).then(n=>i(n)),this.getSnapshot=async(e,t)=>(await a(this,Qt)).getPageSnapshotWithSettings(e,t==null?null:JSON.stringify(t)).then(r=>{if(r instanceof Uint8Array)return r;throw typeof r=="object"&&r!==null&&"success"in r&&!r.success&&mt(r),new Error(`Unexpected response type: ${typeof r}.`)}),this.setWidth=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,R)).setPageWidth(t).then(r=>i(r))),this.setHeight=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,R)).setPageHeight(t).then(r=>i(r))),this.setSize=async(e,t)=>(await a(this,R)).setPageSize(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,R)).reorderPages(e,t).then(r=>i(r)),y(this,R,o),y(this,Qt,o)}},R=new WeakMap,Qt=new WeakMap,xn);class _s{constructor(o){g(this,$);this.getAll=async()=>(await a(this,$)).getParagraphStyles().then(t=>i(t)),this.getById=async e=>(await a(this,$)).getParagraphStyleById(e).then(n=>i(n)),this.create=async()=>(await a(this,$)).createParagraphStyle().then(t=>i(t)),this.duplicate=async e=>(await a(this,$)).duplicateParagraphStyle(e).then(n=>i(n)),this.update=async(e,t)=>(await a(this,$)).updateParagraphStyle(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,$)).renameParagraphStyle(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,$)).removeParagraphStyle(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,$)).moveParagraphStyles(e,t).then(r=>i(r)),y(this,$,o)}}$=new WeakMap;var zt=(s=>(s.shortText="shortText",s.longText="longText",s.richText="richText",s.image="image",s.list="list",s.boolean="boolean",s.group="group",s.number="number",s.date="date",s.dataSource="dataSource",s))(zt||{}),Hs=(s=>(s.Monday="monday",s.Tuesday="tuesday",s.Wednesday="wednesday",s.Thursday="thursday",s.Friday="friday",s.Saturday="saturday",s.Sunday="sunday",s))(Hs||{}),xs=(s=>(s.en_US="en_US",s.cs="cs",s.da="da",s.nl="nl",s.fi="fi",s.fr="fr",s.de="de",s.it="it",s.no="no",s.pl="pl",s.pt_PT="pt_PT",s.es_ES="es_ES",s.sv="sv",s))(xs||{}),Dt=(s=>(s.visible="visible",s.invisible="invisible",s.conditional="conditional",s))(Dt||{}),$s=(s=>(s.boolean="boolean",s.text="text",s.number="number",s))($s||{}),js=(s=>(s.equals="=",s.notEquals="!=",s.greaterThan=">",s.greaterThanOrEquals=">=",s.lessThan="<",s.lessThanOrEquals="<=",s))(js||{}),Ie=(s=>(s.injected="injected",s.connector="connector",s))(Ie||{}),zs=(s=>(s.table="table",s.list="list",s))(zs||{});let Kr=class{constructor(o,e){this.onActionsChanged=t=>{this.config.events.onActionsChanged.trigger(JSON.parse(t))},this.onAnimationChanged=t=>{this.config.events.onFrameAnimationsChanged.trigger(JSON.parse(t))},this.onAnimationPlaybackChanged=t=>{this.config.events.onScrubberPositionChanged.trigger(JSON.parse(t))},this.onSelectedLayoutPropertiesChanged=t=>{this.config.events.onSelectedLayoutPropertiesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutUnitChanged=t=>{this.config.events.onSelectedLayoutUnitChanged.trigger(t)},this.onFramesLayoutChanged=t=>{const n=JSON.parse(t);this.config.events.onFramesLayoutChanged.trigger(n)},this.onSelectedFramesLayoutChanged=t=>{const n=JSON.parse(t);this.config.events.onSelectedFramesLayoutChanged.trigger(n);const r=this.config.onSelectedFrameLayoutChanged;r&&r(n.length>1?void 0:n[0])},this.onSelectedFramesContentChanged=t=>{const n=JSON.parse(t);this.config.events.onSelectedFramesContentChanged.trigger(n);const r=this.config.onSelectedFrameContentChanged;r&&r(n.length>1?null:n[0])},this.onStateChanged=()=>{this.config.events.onStateChanged.trigger()},this.onAuthExpired=async t=>{const n=await this.config.handlers.onAuthExpired.trigger(JSON.parse(t));return n!=null?JSON.stringify(n):null},this.onViewportRequested=()=>{const t=this.config.handlers.onViewportRequested.trigger();return t!=null?JSON.stringify(t):null},this.onDocumentLoaded=()=>{this.config.events.onDocumentLoaded.trigger()},this.onPageSelectionChanged=t=>{this.config.events.onPageSelectionChanged.trigger(t)},this.onVariableListChanged=t=>{const r=JSON.parse(t).map(c=>{var d;return c.type===zt.list?{...c,items:c.items.map(l=>l.value),selected:(d=c.selected)==null?void 0:d.value}:c});this.config.events.onVariableListChanged.trigger(r)},this.onSelectedToolChanged=t=>{this.config.events.onSelectedToolChanged.trigger(t)},this.onUndoStateChanged=t=>{this.config.events.onUndoStackStateChanged.trigger(JSON.parse(t))},this.onCustomUndoDataChanged=t=>{this.config.events.onCustomUndoDataChanged.trigger(JSON.parse(t))},this.onSelectedLayoutFramesChanged=t=>{this.config.events.onSelectedLayoutFramesChanged.trigger(JSON.parse(t))},this.onSelectedTextStyleChanged=t=>{this.config.events.onSelectedTextStyleChanged.trigger(JSON.parse(t))},this.onColorsChanged=t=>{this.config.events.onColorsChanged.trigger(JSON.parse(t))},this.onParagraphStylesChanged=t=>{this.config.events.onParagraphStylesChanged.trigger(JSON.parse(t))},this.onCharacterStylesChanged=t=>{this.config.events.onCharacterStylesChanged.trigger(JSON.parse(t))},this.onFontFamiliesChanged=t=>{this.config.events.onFontFamiliesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutIdChanged=t=>{this.config.events.onSelectedLayoutIdChanged.trigger(t)},this.onLayoutsChanged=t=>{this.config.events.onLayoutsChanged.trigger(JSON.parse(t))},this.onZoomChanged=t=>{this.config.events.onZoomChanged.trigger(JSON.parse(t))},this.onConnectorEvent=t=>{this.config.events.onConnectorEvent.trigger(JSON.parse(t))},this.onConnectorsChanged=t=>{const r=new he().makeMultipleConnectorsBackwardsCompatible(JSON.parse(t),this.localConfig.get(Z.GraFxStudioEnvironmentApiUrl));this.config.events.onConnectorsChanged.trigger(r)},this.onSelectedPageIdChanged=t=>{this.config.events.onSelectedPageIdChanged.trigger(t)},this.onPagesChanged=t=>{this.config.events.onPagesChanged.trigger(JSON.parse(t))},this.onPageSnapshotInvalidated=t=>{this.config.events.onPageSnapshotInvalidated.trigger(t)},this.onPageSizeChanged=t=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(t))},this.onShapeCornerRadiusChanged=t=>{this.config.events.onShapeCornerRadiusChanged.trigger(JSON.parse(t))},this.onCropActiveFrameIdChanged=t=>{this.config.events.onCropActiveFrameIdChanged.trigger(t)},this.onAsyncError=t=>{const n=JSON.parse(t);if((n==null?void 0:n.type)==="dataRow"){const r=new ke(n.count,n.message,n.exceptions);this.config.events.onAsyncError.trigger(r)}else if((n==null?void 0:n.type)==="action"){const r=new Ve(n.message,n.id,n.event,n.eventChain);this.config.events.onAsyncError.trigger(r)}else this.config.events.onAsyncError.trigger(n)},this.onViewModeChanged=t=>{this.config.events.onViewModeChanged.trigger(t)},this.onBarcodeValidationChanged=t=>{this.config.events.onBarcodeValidationChanged.trigger(JSON.parse(t))},this.onDataSourceIdChanged=t=>{this.config.events.onDataSourceIdChanged.trigger(t)},this.onInjectedDataChanged=t=>{this.config.events.onInjectedDataChanged.trigger(t)},this.onDocumentIssueListChanged=t=>{this.config.events.onDocumentIssueListChanged.trigger(JSON.parse(t))},this.onEngineEditModeChanged=t=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(t))},this.onBrandKitMediaChanged=t=>{this.config.events.onBrandKitMediaChanged.trigger(JSON.parse(t))},this.onCanvasFramesManipulated=t=>{this.config.events.onCanvasFramesManipulated.trigger(JSON.parse(t))},this.config=o,this.localConfig=e}};class Ws{constructor(o){g(this,It);this.set=async e=>(await a(this,It)).selectedTextStyleDeltaUpdate(JSON.stringify(e)).then(n=>i(n)),this.removeSelected=async()=>(await a(this,It)).selectedTextStyleClean().then(t=>i(t)),this.getSelected=async()=>(await a(this,It)).getSelectedTextStyle().then(t=>i(t)),y(this,It,o)}}It=new WeakMap;var Ks=(s=>(s.FRAME_X="frameX",s.FRAME_Y="frameY",s.WIDTH="width",s.HEIGHT="height",s.FRAME_ROTATION="frameRotation",s))(Ks||{}),qs=(s=>(s.LAYOUT_HEIGHT="layoutHeight",s.LAYOUT_WIDTH="layoutWidth",s.BLEED_TOP="bleedTop",s.BLEED_BOTTOM="bleedBottom",s.BLEED_LEFT="bleedLeft",s.BLEED_RIGHT="bleedRight",s.BLEED_VALUES_COMBINED="areBleedValuesCombined",s))(qs||{}),G=(s=>(s.SELECT="select",s.ZOOM="zoom",s.HAND="hand",s.IMAGE_FRAME="imageFrame",s.TEXT_FRAME="textFrame",s.SHAPE_RECT="rect",s.SHAPE_ELLIPSE="ellipse",s.SHAPE_POLYGON="polygon",s.COMPONENT_GRID_FRAME="componentGridFrame",s))(G||{}),Ys=(s=>(s.MP4="mp4",s.GIF="gif",s.PNG="png",s.JPG="jpg",s.PDF="pdf",s.HTML="html",s))(Ys||{}),le=(s=>(s.SANDBOX="sandbox",s.PRODUCTION="online",s))(le||{});class Zs{constructor(o){g(this,kt);this.setTool=async e=>(await a(this,kt)).setTool(e).then(n=>i(n)),this.getSelected=async()=>(await a(this,kt)).getSelectedTool().then(t=>i(t)),this.setPointer=async()=>this.setTool(G.SELECT),this.setSelect=async()=>this.setTool(G.SELECT),this.setHand=async()=>this.setTool(G.HAND),this.setZoom=async()=>this.setTool(G.ZOOM),this.setTextFrame=async()=>this.setTool(G.TEXT_FRAME),this.setImageFrame=async()=>this.setTool(G.IMAGE_FRAME),this.setShapeRect=async()=>this.setTool(G.SHAPE_RECT),this.setShapeEllipse=async()=>this.setTool(G.SHAPE_ELLIPSE),this.setShapePolygon=async()=>this.setTool(G.SHAPE_POLYGON),this.setComponentGrid=async()=>this.setTool(G.COMPONENT_GRID_FRAME),y(this,kt,o)}}kt=new WeakMap;class Qs{constructor(o,e){g(this,X);g(this,q);g(this,Xt);this.undo=async()=>(await a(this,X)).undo().then(n=>i(n)),this.redo=async()=>(await a(this,X)).redo().then(n=>i(n)),this.addCustomData=async(t,n)=>(await a(this,X)).setCustomUndoData(t,n,!1).then(c=>i(c)),this.record=async(t,n)=>{try{await a(this,q).beginIfNoneActive(t),await n(a(this,Xt)),await a(this,q).end()}catch(r){throw await a(this,q).abort(),r}},this.pause=async()=>(await a(this,X)).pause().then(n=>i(n)),this.resume=async()=>(await a(this,X)).resume().then(n=>i(n)),this.clear=async()=>(await a(this,X)).clear().then(n=>i(n)),this.advanced={begin:async t=>a(this,q).begin(t),beginIfNoneActive:async t=>a(this,q).beginIfNoneActive(t),end:async()=>a(this,q).end(),abort:async()=>a(this,q).abort()},y(this,X,o),y(this,Xt,e),y(this,q,new qr(o))}}X=new WeakMap,q=new WeakMap,Xt=new WeakMap;class qr{constructor(o){g(this,lt);this.begin=async e=>(await a(this,lt)).begin(e).then(n=>i(n)),this.beginIfNoneActive=async e=>(await a(this,lt)).beginIfNoneActive(e).then(n=>i(n)),this.end=async()=>(await a(this,lt)).end().then(t=>i(t)),this.abort=async()=>(await a(this,lt)).abort().then(t=>i(t)),y(this,lt,o)}}lt=new WeakMap;var B=(s=>(s.info="info",s.warn="warn",s.error="error",s))(B||{}),ue=(s=>(s.general="general",s.connector="connector",s.event="event",s.engine="engine",s.sdk="sdk",s))(ue||{}),Lt=(s=>(s.throw="throw",s.log="log",s))(Lt||{});class Xs extends Error{constructor(o){super(o)}}const Yr=(s,o=2)=>{const e=Math.pow(10,o);return Math.round(s*e)/e};class tn{constructor(o,e){g(this,Tt);g(this,te);this.round=(t,n)=>i({data:String(Yr(t,n)),success:!0,status:200,parsedData:null}),this.createEnvironmentBaseURL=t=>{const{type:n=le.SANDBOX,environment:r="ft-nostress",version:c="1"}=t,d=n==le.SANDBOX?"chili-publish-sandbox":"chili-publish";return`https://${r}.${d}.online/grafx/api/v${c}/environment/${r}`},this.stageFiles=async(t,n,r)=>{var A;const c=a(this,te).get(Z.GraFxStudioEnvironmentApiUrl);if(!c)throw new Error("GraFx Studio Environment API URL is not set");const d=`${c}connectors/${n}/stage`,m=await(await a(this,Tt)).getConfigValue(Z.GraFxStudioAuthToken),p=(A=i(m))==null?void 0:A.parsedData;if(!p)throw new Error("GraFx Studio Auth Token is not set");const f=new FormData;t.forEach((v,E)=>{const F=v instanceof File?v.name:`blob-${E}`;f.append("files",v,F)}),r&&f.append("validationJson",JSON.stringify({allowedMimeTypes:r.mimeTypes,minDimensions:{width:r.minWidthPixels,height:r.minHeightPixels}}));const b=await fetch(d,{method:"POST",body:f,headers:{Authorization:`Bearer ${p}`}});if(b.status===422){const v=await b.json();throw new hs(v.message,Ce.minDimension)}if(b.status===401){const v=await b.json();throw new Xs(v.message)}if(!b.ok)throw new Error("Failed to stage files");return await b.json()},this.unitEvaluate=async(t,n)=>(await a(this,Tt)).unitEvaluate(t,n).then(c=>i(c)),y(this,Tt,o),y(this,te,e)}}Tt=new WeakMap,te=new WeakMap;const Zr=s=>s.type===zt.dataSource,Qr=s=>{var o;return s?Zr(s)&&((o=s==null?void 0:s.value)==null?void 0:o.type)===Ie.injected:!1};class Xr{constructor(o){g(this,ee);this.setMinimum=async(e,t)=>{const n={minValue:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setMaximum=async(e,t)=>{const n={maxValue:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setShowStepper=async(e,t)=>{const n={showStepper:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setStepSize=async(e,t)=>{const n={stepSize:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setThousandsSeparator=async(e,t)=>{const n={thousandsSeparator:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setDecimalSeparator=async(e,t)=>{const n={decimalSeparator:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setDecimalCharacterStyle=async(e,t)=>{const n={decimalCharacterStyleId:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setNumberOfDecimals=async(e,t)=>{const n={numberOfDecimals:{value:t}};return this.applyPropertiesUpdate(e,n)},y(this,ee,o)}async applyPropertiesUpdate(o,e){const n=await(await a(this,ee)).updateNumberVariableProperties(o,JSON.stringify(e));return i(n)}}ee=new WeakMap;class ta{constructor(o){g(this,se);this.setDisplayFormat=async(e,t)=>{const n={displayFormat:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setLocale=async(e,t)=>{const n={locale:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setStartDate=async(e,t)=>{const n={startDate:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setEndDate=async(e,t)=>{const n={endDate:{value:t}};return this.applyPropertiesUpdate(e,n)},this.setExcludedDays=async(e,t)=>{const n={excludedDays:{value:t}};return this.applyPropertiesUpdate(e,n)},y(this,se,o)}async applyPropertiesUpdate(o,e){const n=await(await a(this,se)).updateDateVariableProperties(o,JSON.stringify(e));return i(n)}}se=new WeakMap;class ea{constructor(o,e){g(this,j);g(this,Bt);this.setValue=async(t,n)=>{const r=await a(this,j);let c;return Array.isArray(n)?c=n.map(d=>a(this,Bt).mapDataItemToEngine(d)):c=n,r.setVariableValue(t,c).then(d=>i(d))},this.getInjectedData=async t=>(await a(this,j)).getInjectedDataSourceVariableData(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData={...r.parsedData,data:r.parsedData.data.map(d=>a(this,Bt).mapEngineToDataItem(d))}),c}),this.getInjectedItemById=async(t,n)=>{var p;const c=await(await a(this,j)).getVariableById(t).then(f=>i(f));Qr(c.parsedData)||mt({status:400,error:"Variable is not an injected data source variable"});const d=c.parsedData.value.itemIdPropertyName,m=(p=(await this.getInjectedData(t)).parsedData)==null?void 0:p.data.find(f=>{var b;return((b=f[d])==null?void 0:b.toString())===n.toString()});return m||mt({status:404,error:`Item not found in injected data for variable ${t}`}),{success:!0,status:200,parsedData:{data:m,continuationToken:null,previousPageToken:null}}},this.setInjectedModel=async(t,n)=>{const r=n.properties,c=n.itemIdPropertyName;return(await a(this,j)).setInjectedDataSourceVariableModel(t,JSON.stringify(r),c).then(l=>i(l))},this.setSourceType=async(t,n)=>(await a(this,j)).setDataSourceVariableSourceType(t,n).then(c=>i(c)),this.setConnector=async(t,n)=>{const r=await a(this,j),d=new he().makeConnectorSourceForwardsCompatible(n);return r.setDataSourceVariableConnector(t,JSON.stringify(d)).then(l=>i(l))},this.removeConnector=async t=>(await a(this,j)).setDataSourceVariableConnector(t,null).then(r=>i(r)),y(this,j,o),y(this,Bt,e)}async setDisplayOptions(o,e,t){return(await a(this,j)).setDataSourceVariableDisplayOptions(o,e,t??void 0).then(r=>i(r))}}j=new WeakMap,Bt=new WeakMap;let en=($n=class{constructor(o,e){g(this,w);g(this,Jt);g(this,Ut);this.getAll=async()=>(await a(this,w)).getVariables().then(n=>i(n)).then(n=>{const r=n;return r.parsedData&&(r.parsedData=this.makeVariablesBackwardsCompatible(r.parsedData)),r}),this.getById=async t=>(await a(this,w)).getVariableById(t).then(r=>i(r)).then(r=>{const c=r;return c.parsedData&&(c.parsedData=this.makeVariableBackwardsCompatible(c.parsedData)),c}),this.getByName=async t=>(await a(this,w)).getVariableByName(t).then(r=>i(r)).then(r=>{const c=r;return c.parsedData&&(c.parsedData=this.makeVariableBackwardsCompatible(c.parsedData)),c}),this.create=async(t,n)=>(await a(this,w)).addVariable(t,n).then(c=>i(c)),this.remove=async t=>(await a(this,w)).removeVariables(t).then(r=>i(r)),this.rename=async(t,n)=>(await a(this,w)).setVariableName(t,n).then(c=>i(c)),this.setLabel=async(t,n)=>(await a(this,w)).setVariableLabel(t,n).then(c=>i(c)),y(this,Jt,async(t,n)=>(await a(this,w)).setVariablePlaceholder(t,n).then(c=>i(c))),this.setPlaceholder=async(t,n)=>a(this,Jt).call(this,t,n),this.resetPlaceholder=async t=>a(this,Jt).call(this,t,null),y(this,Ut,async(t,n)=>(await a(this,w)).setVariableHelpText(t,n).then(c=>i(c))),this.setHelpText=async(t,n)=>a(this,Ut).call(this,t,n),this.resetHelpText=async t=>a(this,Ut).call(this,t,null),this.setType=async(t,n)=>(await a(this,w)).setVariableType(t,n).then(c=>i(c)),this.setRuleSetId=async(t,n)=>(await a(this,w)).setVariableRuleSetId(t,n).then(c=>i(c)),this.setListVariable=async(t,n)=>(await a(this,w)).setListVariableItems(t,n.map(c=>JSON.stringify({value:c}))).then(c=>i(c)),this.setValue=async(t,n)=>(await a(this,w)).setVariableValue(t,n).then(c=>i(c,d=>Br(d,{id:t}))),this.duplicate=async t=>(await a(this,w)).duplicateVariable(t).then(r=>i(r)),this.groupVariables=async(t,n)=>(await a(this,w)).groupVariables(t,n).then(c=>i(c)),this.ungroupVariables=async t=>(await a(this,w)).ungroupVariable(t).then(r=>i(r)),this.move=async(t,n,r)=>(await a(this,w)).moveVariable(n,r,t).then(d=>i(d)),this.moveVariables=async(t,n,r)=>(await a(this,w)).moveVariables(n,r,t).then(d=>i(d)),this.setIsVisible=async(t,n)=>{const r=n?{type:Dt.visible}:{type:Dt.invisible};return this.setVariableVisibility(t,r)},this.setIsHidden=async(t,n)=>{const r=n?{type:Dt.invisible}:{type:Dt.visible};return this.setVariableVisibility(t,r)},this.setVariableVisibility=async(t,n)=>(await a(this,w)).setVariableVisibility(t,JSON.stringify(n)).then(c=>i(c)),this.setLayoutsForVariableVisibility=async t=>(await a(this,w)).setLayoutsForVariableVisibility(t?JSON.stringify(t):null).then(r=>i(r)),this.setIsRequired=async(t,n)=>(await a(this,w)).setVariableIsRequired(t,n).then(c=>i(c)),this.setRemoveParagraphIfEmpty=async(t,n)=>(await a(this,w)).setVariableRemoveParagraphIfEmpty(t,n).then(c=>i(c)),this.setVariableCharacterLimit=async(t,n)=>(await a(this,w)).setVariableCharacterLimit(t,n).then(c=>i(c)),this.setIsReadonly=async(t,n)=>(await a(this,w)).setVariableIsReadonly(t,n).then(c=>i(c)),this.getImageVariableConnectorId=async t=>(await a(this,w)).getImageVariableConnectorId(t).then(r=>i(r)),this.setImageVariableConnector=async(t,n)=>{const r=await a(this,w),d=new he().makeConnectorSourceForwardsCompatible(n);return r.setImageVariableConnector(t,JSON.stringify(d)).then(l=>i(l))},this.setImageVariableValueWithContext=async(t,n,r)=>(await a(this,w)).setImageVariableValueWithContext(t,n,JSON.stringify(r)).then(d=>i(d)),this.removeSource=async t=>this.setValue(t,null),this.setPrefix=async(t,n)=>{const r={prefix:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffix=async(t,n)=>{const r={suffix:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrefixCharacterStyle=async(t,n)=>{const r={prefixCharacterStyleId:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffixCharacterStyle=async(t,n)=>{const r={suffixCharacterStyleId:{value:n}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrivateData=async(t,n)=>(await a(this,w)).setVariablePrivateData(t,JSON.stringify(n)).then(c=>i(c)),this.getPrivateData=async t=>(await a(this,w)).getVariablePrivateData(t).then(r=>i(r)),this.setAllowImageQuery=async(t,n)=>(await a(this,w)).setImageVariableAllowQuery(t,n).then(c=>i(c)),this.setAllowImageUpload=async(t,n)=>(await a(this,w)).setImageVariableAllowUpload(t,n).then(c=>i(c)),this.setMinImageUploadSize=async(t,n,r)=>(await a(this,w)).setImageVariableUploadMinSize(t,n,r).then(d=>i(d)),this.setIsDontBreak=async(t,n)=>(await a(this,w)).setVariableIsDontBreak(t,n).then(c=>i(c)),this.highlightUsages=async t=>(await a(this,w)).highlightVariableUsages(t).then(r=>i(r)),this.setRichTextRules=async t=>(await a(this,w)).setRichTextRulesets(JSON.stringify(t)).then(r=>i(r)),y(this,w,o),this.number=new Xr(a(this,w)),this.date=new ta(a(this,w)),this.dataSource=new ea(a(this,w),e)}makeVariablesBackwardsCompatible(o){return o.map(e=>this.makeVariableBackwardsCompatible(e))}makeVariableBackwardsCompatible(o){return o.type!==zt.list?o:this.makeListVariableBackwardsCompatible(o)}makeListVariableBackwardsCompatible(o){const e=o,t=o.items,n=o.selected,r=t.map(c=>c.value);return e.items=r,e.selected=n==null?void 0:n.value,e}async applyPrefixSuffixDeltaUpdate(o,e){const n=await(await a(this,w)).updateVariablePrefixSuffixProperties(o,JSON.stringify(e));return i(n)}},w=new WeakMap,Jt=new WeakMap,Ut=new WeakMap,$n);class sa{constructor(o){this.onVariableListChanged=e=>{this.config.events.onVariableListChanged.trigger(JSON.parse(e))},this.onConnectorsChanged=e=>{this.config.events.onConnectorsChanged.trigger(JSON.parse(e))},this.onPageSizeChanged=e=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(e))},this.onEngineEditModeChanged=e=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(e))},this.config=o}}class na{constructor(o){g(this,ut);this.getAll=async()=>(await a(this,ut)).getVariables().then(t=>i(t)),this.getById=async e=>(await a(this,ut)).getVariableById(e).then(n=>i(n)),this.getByName=async e=>(await a(this,ut)).getVariableByName(e).then(n=>i(n)),this.setListVariable=async(e,t)=>(await a(this,ut)).setListVariableItems(e,t.map(r=>JSON.stringify(r))).then(r=>i(r)),y(this,ut,o),this.image=new ra(o),this.dataSource=new aa(o)}}ut=new WeakMap;class ra{constructor(o){g(this,nt);this.setAllowQuery=async(e,t)=>(await a(this,nt)).setImageVariableAllowQuery(e,t).then(r=>i(r)),this.setAllowUpload=async(e,t)=>(await a(this,nt)).setImageVariableAllowUpload(e,t).then(r=>i(r)),this.setMinUploadSize=async(e,t,n)=>(await a(this,nt)).setImageVariableUploadMinSize(e,t,n).then(c=>i(c)),this.setConnector=async(e,t)=>(await a(this,nt)).setImageVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),this.setConnectorContext=async(e,t)=>(await a(this,nt)).setImageVariableConnectorContext(e,JSON.stringify(t)).then(r=>i(r)),y(this,nt,o)}}nt=new WeakMap;class aa{constructor(o){g(this,ne);this.setConnector=async(e,t)=>(await a(this,ne)).setDataSourceVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),y(this,ne,o)}}ne=new WeakMap;class ia{constructor(o){g(this,vt);this.register=async e=>(await a(this,vt)).registerConnector(JSON.stringify(e)).then(n=>i(n)),this.getById=async e=>(await a(this,vt)).getConnectorById(e).then(n=>i(n)),this.getAllByType=async e=>(await a(this,vt)).getConnectors(e).then(n=>i(n)),y(this,vt,o)}}vt=new WeakMap;class oa{constructor(o){g(this,Gt);g(this,ge);this.setWidth=async e=>(await a(this,Gt)).setPageWidth(e).then(n=>i(n)),this.setHeight=async e=>(await a(this,Gt)).setPageHeight(e).then(n=>i(n)),y(this,Gt,o),y(this,ge,o)}}Gt=new WeakMap,ge=new WeakMap;class sn{constructor(o,e,t){this.config=o,this.connection=e,this.editorAPI=t,this.subscriber=new sa(o),this.variable=new na(this.editorAPI),this.connector=new ia(this.editorAPI),this.page=new oa(this.editorAPI),this.canvas=new we(this.editorAPI)}}class ve{constructor(o){this.logger=o}getLogCategory(){return ue.event}createEventHandlerFn(o,e){return(...n)=>{try{const r=o(...n);return r instanceof Promise?r.catch(c=>this.handleError(c,e,o.name)):r}catch(r){this.handleError(r,e,o.name)}}}handleError(o,e,t){var n;if(e===Lt.log)(n=this.logger)==null||n.call(this,B.error,this.getLogCategory(),`Error in callback ${t}: ${o}`);else throw o}}class nn extends ve{constructor(o,e){super(e),this.handler=o}trigger(...o){const e=this.handler();if(e)return this.createEventHandlerFn(e,Lt.throw)(...o)}}class C extends ve{constructor(o,e){super(e),this.legacyHandler=o,this.subscriptions=new Set}trigger(...o){const e=this.legacyHandler();e&&this.createEventHandlerFn(e,Lt.log)(...o);for(const t of this.subscriptions)t(...o)}registerCallback(o,e=Lt.log){const t=this.createEventHandlerFn(o,e);return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}}class Ae{static createRuntimeConfig(o){var t,n,r,c,d,l,m,p,f,b,I,A,v,E,F,M,P,U,rt,Ht,xt,jn,zn,Wn,Kn,qn,Yn,Zn,Qn,Xn,tr,er,sr,nr,rr;const e={...o};return e.logging={logLevel:((t=o.logging)==null?void 0:t.logLevel)||B.error,logger:((n=o.logging)==null?void 0:n.logger)||((ae,Pe,Ee)=>{var ar;if(Ae.isLoggingEnabled(ae,((ar=e.logging)==null?void 0:ar.logLevel)??B.error))switch(ae){case B.error:console.error(`[${Pe}] [${ae}] ${Ee}`);break;case B.warn:console.warn(`[${Pe}] [${ae}] ${Ee}`);break;default:console.log(`[${Pe}] [${ae}] ${Ee}`)}})},e.handlers={onAuthExpired:new nn(()=>e.onAuthExpired,(r=e.logging)==null?void 0:r.logger),onViewportRequested:new nn(()=>e.onViewportRequested,(c=e.logging)==null?void 0:c.logger)},e.events={onActionsChanged:new C(()=>e.onActionsChanged,(d=e.logging)==null?void 0:d.logger),onStateChanged:new C(()=>e.onStateChanged,(l=e.logging)==null?void 0:l.logger),onDocumentLoaded:new C(()=>e.onDocumentLoaded,(m=e.logging)==null?void 0:m.logger),onSelectedFramesLayoutChanged:new C(()=>e.onSelectedFramesLayoutChanged,(p=e.logging)==null?void 0:p.logger),onFramesLayoutChanged:new C(()=>e.onFramesLayoutChanged,(f=e.logging)==null?void 0:f.logger),onSelectedFramesContentChanged:new C(()=>e.onSelectedFramesContentChanged,(b=e.logging)==null?void 0:b.logger),onPageSelectionChanged:new C(()=>e.onPageSelectionChanged,(I=e.logging)==null?void 0:I.logger),onSelectedLayoutPropertiesChanged:new C(()=>e.onSelectedLayoutPropertiesChanged,(A=e.logging)==null?void 0:A.logger),onSelectedLayoutUnitChanged:new C(()=>e.onSelectedLayoutUnitChanged,(v=e.logging)==null?void 0:v.logger),onScrubberPositionChanged:new C(()=>e.onScrubberPositionChanged,(E=e.logging)==null?void 0:E.logger),onFrameAnimationsChanged:new C(()=>e.onFrameAnimationsChanged,(F=e.logging)==null?void 0:F.logger),onVariableListChanged:new C(()=>e.onVariableListChanged,(M=e.logging)==null?void 0:M.logger),onSelectedToolChanged:new C(()=>e.onSelectedToolChanged,(P=e.logging)==null?void 0:P.logger),onUndoStackStateChanged:new C(()=>e.onUndoStackStateChanged,(U=e.logging)==null?void 0:U.logger),onSelectedLayoutFramesChanged:new C(()=>e.onSelectedLayoutFramesChanged,(rt=e.logging)==null?void 0:rt.logger),onSelectedTextStyleChanged:new C(()=>e.onSelectedTextStyleChanged,(Ht=e.logging)==null?void 0:Ht.logger),onColorsChanged:new C(()=>e.onColorsChanged,(xt=e.logging)==null?void 0:xt.logger),onParagraphStylesChanged:new C(()=>e.onParagraphStylesChanged,(jn=e.logging)==null?void 0:jn.logger),onCharacterStylesChanged:new C(()=>e.onCharacterStylesChanged,(zn=e.logging)==null?void 0:zn.logger),onFontFamiliesChanged:new C(()=>e.onFontFamiliesChanged,(Wn=e.logging)==null?void 0:Wn.logger),onSelectedLayoutIdChanged:new C(()=>e.onSelectedLayoutIdChanged,(Kn=e.logging)==null?void 0:Kn.logger),onLayoutsChanged:new C(()=>e.onLayoutsChanged,(qn=e.logging)==null?void 0:qn.logger),onConnectorEvent:new C(()=>e.onConnectorEvent,(Yn=e.logging)==null?void 0:Yn.logger),onConnectorsChanged:new C(()=>e.onConnectorsChanged,(Zn=e.logging)==null?void 0:Zn.logger),onZoomChanged:new C(()=>e.onZoomChanged,(Qn=e.logging)==null?void 0:Qn.logger),onSelectedPageIdChanged:new C(()=>e.onSelectedPageIdChanged,e.logging.logger),onPagesChanged:new C(()=>e.onPagesChanged,e.logging.logger),onPageSnapshotInvalidated:new C(()=>e.onPageSnapshotInvalidated,e.logging.logger),onPageSizeChanged:new C(()=>e.onPageSizeChanged,(Xn=e.logging)==null?void 0:Xn.logger),onShapeCornerRadiusChanged:new C(()=>e.onShapeCornerRadiusChanged,(tr=e.logging)==null?void 0:tr.logger),onCropActiveFrameIdChanged:new C(()=>e.onCropActiveFrameIdChanged,(er=e.logging)==null?void 0:er.logger),onAsyncError:new C(()=>e.onAsyncError,(sr=e.logging)==null?void 0:sr.logger),onViewModeChanged:new C(()=>e.onViewModeChanged,(nr=e.logging)==null?void 0:nr.logger),onBarcodeValidationChanged:new C(()=>e.onBarcodeValidationChanged,(rr=e.logging)==null?void 0:rr.logger),onDataSourceIdChanged:new C(()=>e.onDataSourceIdChanged,e.logging.logger),onInjectedDataChanged:new C(()=>e.onInjectedDataChanged,e.logging.logger),onDocumentIssueListChanged:new C(()=>e.onDocumentIssueListChanged,e.logging.logger),onCustomUndoDataChanged:new C(()=>e.onCustomUndoDataChanged,e.logging.logger),onEngineEditModeChanged:new C(()=>e.onEngineEditModeChanged,e.logging.logger),onBrandKitMediaChanged:new C(()=>e.onBrandKitMediaChanged,e.logging.logger),onCanvasFramesManipulated:new C(()=>e.onCanvasFramesManipulated,e.logging.logger)},e}static isLoggingEnabled(o,e){return e==B.info||e==B.warn&&(o==B.warn||o==B.error)?!0:e==B.error&&o==B.error}}class ca{isDatePropertyWrapper(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&"type"in o&&o.type==="date"&&"chiliReservedTag"in o&&o.chiliReservedTag==="date"}isDateObject(o){return o instanceof Date}mapEngineToDataItem(o){const e={};return Object.entries(o).forEach(([t,n])=>{e[t]=this.isDatePropertyWrapper(n)?new Date(n.value):n}),e}mapDataItemToEngine(o){const e={};return Object.entries(o).forEach(([t,n])=>{e[t]=this.isDateObject(n)?{value:n.getTime(),type:"date",chiliReservedTag:"date"}:n}),e}}class ha{constructor(o){g(this,gt);y(this,gt,o)}async getValue(o){return(await a(this,gt)).getConfigValue(o).then(t=>i(t))}async setValue(o,e){return(await a(this,gt)).setConfigValue(o,e).then(n=>i(n))}async updateStudioOptions(o){return(await a(this,gt)).updateStudioOptions(JSON.stringify(o)).then(t=>i(t))}async getEngineSessionId(){return(await a(this,gt)).getEngineSessionId().then(e=>i(e))}getLatestSmartCropVersion(){return zr}}gt=new WeakMap;class rn extends ha{constructor(e,t){super(e);g(this,_t);y(this,_t,t)}async getValue(e){const t=a(this,_t).get(e);return t!=null?i({status:200,success:!0,parsedData:t,data:t},!1):super.getValue(e)}async setValue(e,t){const n=super.setValue(e,t);return a(this,_t).set(e,t),n}}_t=new WeakMap;class an{constructor(o){g(this,z);this.getAll=async()=>(await a(this,z)).getGradients().then(t=>i(t)),this.getById=async e=>(await a(this,z)).getGradientById(e).then(n=>i(n)),this.create=async()=>(await a(this,z)).createGradient().then(t=>i(t)),this.duplicate=async e=>(await a(this,z)).duplicateGradient(e).then(n=>i(n)),this.move=async(e,t)=>(await a(this,z)).moveGradients(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,z)).renameGradient(e,t).then(r=>i(r)),this.update=async(e,t)=>{const n=await a(this,z),r=t;return n.updateGradient(e,JSON.stringify(r)).then(c=>i(c))},this.remove=async e=>(await a(this,z)).removeGradient(e).then(n=>i(n)),y(this,z,o)}}z=new WeakMap;class on{constructor(o){g(this,At);g(this,re);this.query=async(e,t,n={})=>(await a(this,At)).componentConnectorQuery(e,JSON.stringify(t),JSON.stringify(n)).then(c=>i(c)),this.preview=async(e,t,n,r={})=>(await a(this,re)).componentConnectorPreview(e,t,n,JSON.stringify(r)).then(d=>{if(d instanceof Uint8Array)return d;throw typeof d=="object"&&d!==null&&"success"in d&&!d.success&&mt(d),new Error(`Unexpected response type: ${typeof d}.`)}),this.getConfigurationOptions=async e=>(await a(this,At)).componentConnectorGetConfigurationOptions(e).then(n=>i(n)),this.getCapabilities=async e=>(await a(this,At)).componentConnectorGetCapabilities(e).then(n=>i(n)),y(this,At,o),y(this,re,o)}}At=new WeakMap,re=new WeakMap;class cn{constructor(o){g(this,yt);this.linkVariable=async(e,t,n,r)=>(await a(this,yt)).linkComponentVariable(e,t,n,r??null).then(d=>i(d)),this.getComponentVariables=async e=>(await a(this,yt)).getComponentVariables(e).then(n=>i(n)),this.setFitMode=async(e,t)=>(await a(this,yt)).setComponentLayoutFit(e,t).then(r=>i(r)),this.resetFitMode=async e=>(await a(this,yt)).resetComponentLayoutFit(e).then(n=>i(n)),y(this,yt,o)}}yt=new WeakMap;class hn{constructor(o){g(this,tt);this.updateSettings=async(e,t)=>(await a(this,tt)).updateComponentGridSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setMapping=async(e,t,n,r,c)=>(await a(this,tt)).setComponentGridMapping(e,t,n,r,c).then(l=>i(l)),this.resetSettings=async e=>(await a(this,tt)).resetComponentGridSettings(e).then(n=>i(n)),this.setComponentSource=async(e,t)=>(await a(this,tt)).setComponentGridComponentSource(e,t?JSON.stringify(t):null).then(r=>i(r)),this.setDataSourceVariable=async(e,t)=>(await a(this,tt)).setComponentGridDataSourceVariable(e,t).then(r=>i(r)),this.setResizeMode=async(e,t)=>(await a(this,tt)).setComponentGridResizeMode(e,t).then(r=>i(r)),y(this,tt,o)}}tt=new WeakMap;const da=()=>{};class la{constructor(){this.listeners=new Map}add(o,e){if(typeof e!="function")return da;const t=this.listeners.get(o)??new Set;return t.add(e),this.listeners.set(o,t),()=>{this.remove(o,e)}}remove(o,e){const t=this.listeners.get(o);t&&(t.delete(e),t.size===0&&this.listeners.delete(o))}getListeners(o){return[...this.listeners.get(o)??[]]}}const ua=s=>!s||typeof s!="object"?!1:typeof s.then=="function",ga=s=>!(!s||typeof s!="object"||Array.isArray(s)),dn=(s,o,e)=>{e==null||e(B.error,ue.sdk,`Error in method listener for ${s}: ${String(o)}`)},Wt=(s,o,e,t,n)=>{for(const r of e.getListeners(s))try{r(o)}catch(c){dn(s,c,n)}try{o.phase==="invoke"?t.onMethodInvoked.trigger(o):t.onMethodCompleted.trigger(o)}catch(r){dn(s,r,n)}};function ln(s,o,e,t,n){const r=new Map,c=new Map;return new Proxy(s,{get(d,l,m){const p=Reflect.get(d,l,m);if(typeof l=="symbol")return p;if(typeof p=="function"){if(r.has(l))return r.get(l);const f=`${o}.${String(l)}`,b=o.split(".")[0]||o,I=String(l),A=((...v)=>{const E={phase:"invoke",path:f,controller:b,method:I,args:[...v]};Wt(f,E,e,t,n);try{const F=p.apply(d,v);if(ua(F))return F.then(P=>{const U={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!0,result:P};return Wt(f,U,e,t,n),P}).catch(P=>{const U={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!1,error:P};throw Wt(f,U,e,t,n),P});const M={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!0,result:F};return Wt(f,M,e,t,n),F}catch(F){const M={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!1,error:F};throw Wt(f,M,e,t,n),F}});return A.addEventListener=v=>e.add(f,v),A.removeEventListener=v=>{e.remove(f,v)},r.set(l,A),A}if(ga(p)){if(c.has(l))return c.get(l);const f=`${o}.${String(l)}`,b=ln(p,f,e,t,n);return c.set(l,b),b}return p}})}class un extends ve{constructor(o){super(o),this.subscriptions=new Set}getLogCategory(){return ue.sdk}trigger(...o){const e=Array.from(this.subscriptions);for(const t of e)t(...o)}registerCallback(o,e=Lt.log){const t=this.createEventHandlerFn(o,e);return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}}class ya{constructor(o){this.onMethodInvoked=new un(o),this.onMethodCompleted=new un(o)}}const pa=`https://studio-cdn.chiligrafx.com/editor/${T.current}/web`,gn=Symbol("pendingInstrumentation"),ma=s=>{Object.defineProperty(s,gn,{value:!0,enumerable:!1,configurable:!0})},wa=s=>typeof s=="object"&&s!==null&&s[gn]===!0;class Ca{constructor(o){var e,t;this.localConfig=new Map,this.dataItemMappingTools=new ca,this.methodListeners=new la,this.teardownFrame=null,this.loadEditor=()=>{var n,r,c;(n=this.teardownFrame)==null||n.call(this),this.teardownFrame=Mr(this.config.editorLink||pa,{onActionsChanged:this.subscriber.onActionsChanged,onStateChanged:this.subscriber.onStateChanged,onAuthExpired:this.subscriber.onAuthExpired,onViewportRequested:this.subscriber.onViewportRequested,onDocumentLoaded:this.subscriber.onDocumentLoaded,onSelectedFramesContentChanged:this.subscriber.onSelectedFramesContentChanged,onSelectedFramesLayoutChanged:this.subscriber.onSelectedFramesLayoutChanged,onFramesLayoutChanged:this.subscriber.onFramesLayoutChanged,onSelectedLayoutPropertiesChanged:this.subscriber.onSelectedLayoutPropertiesChanged,onSelectedLayoutUnitChanged:this.subscriber.onSelectedLayoutUnitChanged,onPageSelectionChanged:this.subscriber.onPageSelectionChanged,onScrubberPositionChanged:this.subscriber.onAnimationPlaybackChanged,onFrameAnimationsChanged:this.subscriber.onAnimationChanged,onVariableListChanged:d=>{var l;(l=this.enabledNextSubscribers)!=null&&l.onVariableListChanged?this.next.subscriber.onVariableListChanged(d):this.subscriber.onVariableListChanged(d)},onSelectedToolChanged:this.subscriber.onSelectedToolChanged,onUndoStateChanged:this.subscriber.onUndoStateChanged,onSelectedLayoutFramesChanged:this.subscriber.onSelectedLayoutFramesChanged,onSelectedTextStyleChanged:this.subscriber.onSelectedTextStyleChanged,onColorsChanged:this.subscriber.onColorsChanged,onParagraphStylesChanged:this.subscriber.onParagraphStylesChanged,onCharacterStylesChanged:this.subscriber.onCharacterStylesChanged,onFontFamiliesChanged:this.subscriber.onFontFamiliesChanged,onSelectedLayoutIdChanged:this.subscriber.onSelectedLayoutIdChanged,onLayoutsChanged:this.subscriber.onLayoutsChanged,onConnectorEvent:this.subscriber.onConnectorEvent,onConnectorsChanged:d=>{var l;(l=this.enabledNextSubscribers)!=null&&l.onConnectorsChanged?this.next.subscriber.onConnectorsChanged(d):this.subscriber.onConnectorsChanged(d)},onZoomChanged:this.subscriber.onZoomChanged,onSelectedPageIdChanged:this.subscriber.onSelectedPageIdChanged,onPagesChanged:this.subscriber.onPagesChanged,onPageSnapshotInvalidated:this.subscriber.onPageSnapshotInvalidated,onPageSizeChanged:d=>{var l;(l=this.enabledNextSubscribers)!=null&&l.onPageSizeChanged?this.next.subscriber.onPageSizeChanged(d):this.subscriber.onPageSizeChanged(d)},onShapeCornerRadiusChanged:this.subscriber.onShapeCornerRadiusChanged,onCropActiveFrameIdChanged:this.subscriber.onCropActiveFrameIdChanged,onAsyncError:this.subscriber.onAsyncError,onViewModeChanged:this.subscriber.onViewModeChanged,onBarcodeValidationChanged:this.subscriber.onBarcodeValidationChanged,onDataSourceIdChanged:this.subscriber.onDataSourceIdChanged,onInjectedDataChanged:this.subscriber.onInjectedDataChanged,onDocumentIssueListChanged:this.subscriber.onDocumentIssueListChanged,onCustomUndoDataChanged:this.subscriber.onCustomUndoDataChanged,onEngineEditModeChanged:this.subscriber.onEngineEditModeChanged,onBrandKitMediaChanged:this.subscriber.onBrandKitMediaChanged,onCanvasFramesManipulated:this.subscriber.onCanvasFramesManipulated},this.setConnection,this.config.editorId,this.config.studioStyling,d=>{var l,m;(m=(l=this.config).onConnectionError)==null||m.call(l,d)}),this.editorAPI=(r=this.connection)==null?void 0:r.promise.then(d=>d),this.action=this.toInstrumented(new Je(this.editorAPI)),this.layout=this.toInstrumented(new Js(this.editorAPI)),this.frame=this.toInstrumented(new Ts(this.editorAPI)),this.barcode=this.toInstrumented(new je(this.editorAPI)),this.component=this.toInstrumented(new cn(this.editorAPI)),this.animation=this.toInstrumented(new Ue(this.editorAPI)),this.document=this.toInstrumented(new ps(this.editorAPI)),this.configuration=this.toInstrumented(new rn(this.editorAPI,this.localConfig)),this.utils=this.toInstrumented(new tn(this.editorAPI,this.localConfig)),this.tool=this.toInstrumented(new Zs(this.editorAPI)),this.page=this.toInstrumented(new Gs(this.editorAPI)),this.debug=this.toInstrumented(new ys(this.editorAPI)),this.undoManager=this.toInstrumented(new Qs(this.editorAPI,this)),this.textSelection=this.toInstrumented(new Ws(this.editorAPI)),this.colorStyle=this.toInstrumented(new Qe(this.editorAPI)),this.gradientStyle=this.toInstrumented(new an(this.editorAPI)),this.paragraphStyle=this.toInstrumented(new _s(this.editorAPI)),this.characterStyle=this.toInstrumented(new We(this.editorAPI)),this.mediaConnector=this.toInstrumented(new Us(this.editorAPI)),this.fontConnector=this.toInstrumented(new Vs(this.editorAPI)),this.componentConnector=this.toInstrumented(new on(this.editorAPI)),this.dataConnector=this.toInstrumented(new us(this.editorAPI,this.dataItemMappingTools)),this.dataSource=this.toInstrumented(new gs(this.editorAPI,this.dataItemMappingTools)),this.connector=this.toInstrumented(new ls(this.editorAPI,this.localConfig)),this.variable=this.toInstrumented(new en(this.editorAPI,this.dataItemMappingTools)),this.font=this.toInstrumented(new ks(this.editorAPI)),this.experiment=this.toInstrumented(new Rs(this.editorAPI)),this.canvas=this.toInstrumented(new we(this.editorAPI)),this.shape=this.toInstrumented(new Se(this.editorAPI)),this.colorConversion=this.toInstrumented(new qe(this.editorAPI)),this.info=this.toInstrumented(new Bs),this.clipboard=this.toInstrumented(new Ke(this.editorAPI)),this.brandKit=this.toInstrumented(new ze(this.editorAPI,this)),this.componentGrid=this.toInstrumented(new hn(this.editorAPI)),this.next=new sn(this.config,this.connection,this.editorAPI),this.applyMethodInstrumentation(),this.configuration.setValue(Z.GraFxStudioSdkVersion,Oe.version),this.configuration.setValue(Z.GraFxStudioDocumentType,this.config.documentType||me.template),this.configuration.updateStudioOptions(this.config.studioOptions||Rr),this.configuration.setValue(Z.QueryCallCacheEnabled,((c=this.config.enableQueryCallCache)==null?void 0:c.toString())||"false")},this.setConnection=n=>{this.connection=n},this.destroy=()=>{var n,r;try{(n=this.connection)==null||n.destroy()}catch{}(r=this.teardownFrame)==null||r.call(this),this.teardownFrame=null},this.toInstrumented=n=>(ma(n),n),this.applyMethodInstrumentation=()=>{var r;const n=this;for(const c of Object.keys(n)){const d=n[c];wa(d)&&(n[c]=ln(d,c,this.methodListeners,this.sdkEvents,(r=this.config.logging)==null?void 0:r.logger))}},this.config=Ae.createRuntimeConfig(o),this.sdkEvents=new ya((e=this.config.logging)==null?void 0:e.logger),this.editorAPI=(t=this.connection)==null?void 0:t.promise.then(n=>n),this.action=this.toInstrumented(new Je(this.editorAPI)),this.layout=this.toInstrumented(new Js(this.editorAPI)),this.frame=this.toInstrumented(new Ts(this.editorAPI)),this.shape=this.toInstrumented(new Se(this.editorAPI)),this.barcode=this.toInstrumented(new je(this.editorAPI)),this.component=this.toInstrumented(new cn(this.editorAPI)),this.undoManager=this.toInstrumented(new Qs(this.editorAPI,this)),this.connector=this.toInstrumented(new ls(this.editorAPI,this.localConfig)),this.mediaConnector=this.toInstrumented(new Us(this.editorAPI)),this.fontConnector=this.toInstrumented(new Vs(this.editorAPI)),this.componentConnector=this.toInstrumented(new on(this.editorAPI)),this.dataConnector=this.toInstrumented(new us(this.editorAPI,this.dataItemMappingTools)),this.dataSource=this.toInstrumented(new gs(this.editorAPI,this.dataItemMappingTools)),this.animation=this.toInstrumented(new Ue(this.editorAPI)),this.document=this.toInstrumented(new ps(this.editorAPI)),this.configuration=this.toInstrumented(new rn(this.editorAPI,this.localConfig)),this.variable=this.toInstrumented(new en(this.editorAPI,this.dataItemMappingTools)),this.utils=this.toInstrumented(new tn(this.editorAPI,this.localConfig)),this.subscriber=new Kr(this.config,this.localConfig),this.tool=this.toInstrumented(new Zs(this.editorAPI)),this.page=this.toInstrumented(new Gs(this.editorAPI)),this.debug=this.toInstrumented(new ys(this.editorAPI)),this.textSelection=this.toInstrumented(new Ws(this.editorAPI)),this.colorStyle=this.toInstrumented(new Qe(this.editorAPI)),this.gradientStyle=this.toInstrumented(new an(this.editorAPI)),this.paragraphStyle=this.toInstrumented(new _s(this.editorAPI)),this.characterStyle=this.toInstrumented(new We(this.editorAPI)),this.font=this.toInstrumented(new ks(this.editorAPI)),this.experiment=this.toInstrumented(new Rs(this.editorAPI)),this.canvas=this.toInstrumented(new we(this.editorAPI)),this.colorConversion=this.toInstrumented(new qe(this.editorAPI)),this.info=this.toInstrumented(new Bs),this.clipboard=this.toInstrumented(new Ke(this.editorAPI)),this.next=new sn(this.config,this.connection,this.editorAPI),this.enabledNextSubscribers=this.config.enableNextSubscribers,this.brandKit=this.toInstrumented(new ze(this.editorAPI,this)),this.componentGrid=this.toInstrumented(new hn(this.editorAPI)),this.applyMethodInstrumentation()}}var yn=(s=>(s.top="top",s.left="left",s.right="right",s.bottom="bottom",s.topLeft="topLeft",s.topRight="topRight",s.bottomLeft="bottomLeft",s.bottomRight="bottomRight",s))(yn||{}),pn=(s=>(s.horizontal="horizontal",s.vertical="vertical",s))(pn||{}),mn=(s=>(s.easeIn="easeIn",s.easeOut="easeOut",s.easeInOut="easeInOut",s))(mn||{}),wn=(s=>(s.quadratic="Quadratic",s.cubic="Cubic",s.quartic="Quartic",s.quintic="Quintic",s.sine="Sine",s.exponential="Exponential",s.circular="Circular",s.elastic="Elastic",s.bounce="Bounce",s.back="Back",s))(wn||{}),Cn=(s=>(s.bounce="bounce",s.flash="flash",s.headshake="headShake",s.heartbeat="heartbeat",s.pulse="pulse",s.rubberBand="rubberBand",s.vertical="vertical",s.horizontal="horizontal",s.swing="swing",s.tada="tada",s))(Cn||{}),fn=(s=>(s.preview="preview",s.normal="normal",s))(fn||{}),Sn=(s=>(s.linear="linear",s))(Sn||{}),bn=(s=>(s.local="linearLocal",s.linearBrandKit="linearBrandKit",s))(bn||{}),In=(s=>(s.Square="square",s.Line="line",s))(In||{}),vn=(s=>(s.thumbnail="thumbnail",s.highest="highest",s.medium="medium",s))(vn||{}),An=(s=>(s.BOLD="Bold",s.ITALIC="Italic",s.REGULAR="Regular",s))(An||{}),Pn=(s=>(s.LEFT="left",s.CENTER="center",s.RIGHT="right",s.JUSTIFY="justify",s))(Pn||{}),En=(s=>(s.TOP="top",s.CENTER="center",s.BOTTOM="bottom",s))(En||{}),On=(s=>(s.TO_LOWER_CASE="lowercase",s.TO_UPPER_CASE="uppercase",s.NORMAL="normal",s))(On||{}),Fn=(s=>(s.SUPERSCRIPT="superscript",s.SUBSCRIPT="subscript",s.NORMAL="normal",s))(Fn||{}),Dn=(s=>(s.none="none",s.bullet="bullet",s.number="number",s))(Dn||{}),Ln=(s=>(s.STYLE="textStyle",s.PROPERTIES="textProperties",s.APPEARANCE="appearance",s))(Ln||{}),Nn=(s=>(s.PARAGRAPH="paragraphStyleId",s.CHARACTER="characterStyleId",s.FONT_FAMILY="fontKey",s.FONT_STYLE="fontStyle",s.FONT_SIZE="fontSize",s.LETTER_SPACING="letterSpacing",s.LINE_HEIGHT="lineHeight",s.TEXT_ALIGN="textAlign",s.VERTICAL_ALIGN="verticalAlign",s.TYPOGRAPHIC_CASE="typographicCase",s.SUB_SUPER_SCRIPT="subSuperScript",s.UNDERLINE="underline",s.LINE_THROUGH="lineThrough",s.FILL_COLOR="fillColor",s.COLOR="color",s.FILL_COLOR_APPLIED="fillColorApplied",s.STROKE_COLOR="strokeColor",s.STROKE_COLOR_APPLIED="strokeColorApplied",s.BACKGROUND_COLOR="backgroundColor",s.BACKGROUND_COLOR_APPLIED="backgroundColorApplied",s.DROP_SHADOW_COLOR="dropShadowColor",s.BLEND_MODE="blendMode",s.OPACITY="opacity",s.TRACKING_RIGHT="trackingRight",s.BASELINE_SHIFT="baselineShiftValue",s.STROKE_WIDTH="strokeWidth",s.MARKED_LIST_TYPE="markedListType",s.MARKED_LIST_GROUP="markedListGroup",s.MARKED_LIST_LEVEL="markedListLevel",s))(Nn||{}),Mn=(s=>(s.arabic="arabic",s.romanUpperCase="romanUpperCase",s.romanLowerCase="romanLowerCase",s.latinUpperCase="latinUpperCase",s.latinLowerCase="latinLowerCase",s))(Mn||{}),Rn=(s=>(s.none="none",s.dash="dash",s.dot="dot",s.colon="colon",s.roundBracket="roundBracket",s))(Rn||{}),Vn=(s=>(s.fixed="fixed",s))(Vn||{}),kn=(s=>(s.selectedLayoutChanged="selectedLayoutChanged",s.frameMoved="frameMoved",s.pageSizeChanged="pageSizeChanged",s.documentLoaded="documentLoaded",s.variableValueChanged="variableValueChanged",s))(kn||{}),Tn=(s=>(s.ellipse="ellipse",s.rectangle="rectangle",s.polygon="polygon",s.custom="custom",s))(Tn||{}),Bn=(s=>(s.all="all",s.only="only",s.none="none",s))(Bn||{}),Jn=(s=>(s.paragraph="paragraph",s.character="character",s.lineBreak="lineBreak",s.inlineStyle="inlineStyle",s))(Jn||{}),Un=(s=>(s.exists="exists",s.missing="missing",s.equals="equals",s.notEquals="notEquals",s.contains="contains",s.startsWith="startsWith",s.endsWith="endsWith",s))(Un||{}),Gn=(s=>(s.normal="normal",s.textEdit="textEdit",s.customCrop="customCrop",s.frameSubjectArea="frameSubjectArea",s.perAssetCrop="perAssetCrop",s.gradient="gradient",s))(Gn||{}),_n=(s=>(s.url="url",s.grafx="grafx",s.local="local",s))(_n||{});const fa=Object.freeze(Object.defineProperty({__proto__:null,ConnectorRegistrationSource:_n},Symbol.toStringTag,{value:"Module"}));h.APIColorType=Ye,h.ActionAsyncError=Ve,h.ActionEditorEvent=kn,h.Alignment=Pn,h.AnchorTargetEdgeType=Ls,h.AnchorTargetType=Ds,h.AuthCredentialsTypeEnum=os,h.AuthRefreshTypeEnum=cs,h.AutoGrowDirection=ws,h.BarcodeCharacterSet=wt,h.BarcodeErrorCorrectionLevel=Pt,h.BarcodeSourceTypeEnum=Ss,h.BarcodeType=W,h.BarcodeValidationResult=Ge,h.BasicAnimationsEmphasisStyles=Cn,h.BlendMode=As,h.Case=On,h.ColorType=ie,h.ColorUsageType=Ze,h.ComponentFitEnum=ms,h.ComponentGridLayoutAlgorithm=Vn,h.ComponentPreviewType=vn,h.ComponentSourceTypeEnum=Cs,h.ConnectorConfigContextType=ns,h.ConnectorConfigValueType=ss,h.ConnectorEventType=is,h.ConnectorHttpError=Te,h.ConnectorMapping=Ur,h.ConnectorMappingDirection=as,h.ConnectorMappingSource=rs,h.ConnectorRegistrationSource=Ft,h.ConnectorStateType=ce,h.ConnectorSupportedAuth=ds,h.ConnectorType=Xe,h.ConstraintMode=$e,h.CornerRadiusType=Bn,h.CropType=fe,h.DataRowAsyncError=ke,h.DataSourceVariableDisplayOptionsType=zs,h.DataSourceVariableSourceType=Ie,h.Day=Hs,h.DeprecatedMediaConnectorDownloadType=oe,h.DeprecatedMediaType=Et,h.DocumentIssueTypeEnum=Re,h.DocumentType=me,h.DownloadFormats=Ys,h.EaseTypes=mn,h.EngineEditModeType=Gn,h.EnvironmentType=le,h.FitMode=Ps,h.FitModePosition=Es,h.FlowDirection=Is,h.FontPreviewFormat=In,h.FontWeights=An,h.FrameAnchorTarget=jr,h.FrameAnchorType=Fs,h.FrameEditingMode=Me,h.FramePropertyNames=Ks,h.FrameTypeEnum=fs,h.GradientType=Sn,h.GradientUsageType=bn,h.GrafxTokenAuthCredentials=_r,h.ImageSourceTypeEnum=jt,h.LayoutIntent=xe,h.LayoutPropertyNames=qs,h.LayoutType=He,h.Locale=xs,h.MarkedListType=Dn,h.MeasurementUnit=_e,h.MediaDownloadIntent=be,h.MediaDownloadType=de,h.MediaType=Ot,h.Next=fa,h.NumberListFormat=Mn,h.NumberListSeparatorSymbol=Rn,h.PageAnchorTarget=$r,h.PositionEnum=Q,h.RefreshedAuthCredendentials=Hr,h.SDKUnauthorizedError=Xs,h.Scripting=Fn,h.SelectedTextStyleSections=Ln,h.SelectedTextStyles=Nn,h.ShakeDirections=pn,h.ShapeType=Tn,h.SlideDirections=yn,h.SmartCropAxisBias=Ms,h.SmartCropVersion=Ns,h.SortBy=ts,h.SortOrder=es,h.StructuredTextAttributeMatchOperator=Un,h.StructuredTextStyleKind=Jn,h.TextDirection=bs,h.TextPosition=En,h.ToolType=G,h.TweenTypes=wn,h.UpdateZIndexMethod=Os,h.UploadAssetValidationError=hs,h.UploadAssetValidationErrorType=Ce,h.VariableType=zt,h.VariableValueConstrainsViolationError=Be,h.VariableVisibilityOperator=js,h.VariableVisibilityTargetType=$s,h.VariableVisibilityType=Dt,h.VerticalAlign=vs,h.ViewMode=fn,h.WellKnownConfigurationKeys=Z,h.default=Ca,h.grafxMediaConnectorRegistration=Gr,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
68
+ </html>`,c=URL.createObjectURL(new Blob([r],{type:"text/html"}));return n.setAttribute("src",c),c},Rr=(n,o,e,t="chili-editor",s,r)=>{const c=`#${t}`,d=document.createElement("iframe");d.setAttribute("src","about:blank"),d.setAttribute("title","Chili-Editor"),d.setAttribute("style","width: 100%; height: 100%;"),d.setAttribute("frameBorder","0"),d.setAttribute("referrerpolicy","origin");let l=null,m=null,p=null;const f=()=>{l&&(window.removeEventListener("message",l),l=null),m&&(document.removeEventListener("DOMContentLoaded",m),m=null),d.remove(),p&&(URL.revokeObjectURL(p),p=null)},b=()=>{const I=document.querySelector(c);if(I){I==null||I.appendChild(d),d.addEventListener("error",()=>{const A=new Error("Failed to setup frame: iframe failed to load");r==null||r(A)},{capture:!0,once:!0});try{p=Mr(d,n,s)}catch(A){A instanceof Error?r==null||r(A):r==null||r(new Error(`Failed to setup frame: ${A}`))}}};return document.readyState==="complete"||document.readyState==="interactive"?b():(m=()=>{m=null,b()},document.addEventListener("DOMContentLoaded",m,{once:!0})),l=I=>{var A;if(I.source===d.contentWindow&&((A=I.data)==null?void 0:A.type)==="iframe-error"){const v=I.data.error,E=new Error(v.message||"Failed to setup frame: error in iframe");r==null||r(E)}},window.addEventListener("message",l),e(Lr({iframe:d,methods:{actionsChanged:o.onActionsChanged,stateChanged:o.onStateChanged,documentLoaded:o.onDocumentLoaded,authExpired:o.onAuthExpired,viewportRequested:o.onViewportRequested,selectedFramesContent:o.onSelectedFramesContentChanged,selectedFramesLayout:o.onSelectedFramesLayoutChanged,allFramesLayout:o.onFramesLayoutChanged,selectedLayoutProperties:o.onSelectedLayoutPropertiesChanged,openLayoutPropertiesPanel:o.onPageSelectionChanged,selectedLayoutUnit:o.onSelectedLayoutUnitChanged,scrubberPositionChanged:o.onScrubberPositionChanged,frameAnimationsChanged:o.onFrameAnimationsChanged,selectedToolChanged:o.onSelectedToolChanged,variableListChanged:o.onVariableListChanged,undoStackStateChanged:o.onUndoStateChanged,selectedLayoutFramesChanged:o.onSelectedLayoutFramesChanged,selectedTextStyleChanged:o.onSelectedTextStyleChanged,colorsChanged:o.onColorsChanged,paragraphStylesChanged:o.onParagraphStylesChanged,characterStylesChanged:o.onCharacterStylesChanged,fontFamiliesChanged:o.onFontFamiliesChanged,selectedLayoutId:o.onSelectedLayoutIdChanged,layoutListChanged:o.onLayoutsChanged,connectorEvent:o.onConnectorEvent,connectorsChanged:o.onConnectorsChanged,zoomChanged:o.onZoomChanged,pageSnapshotInvalidated:o.onPageSnapshotInvalidated,pagesChanged:o.onPagesChanged,pageSizeChanged:o.onPageSizeChanged,shapeCornerRadiusChanged:o.onShapeCornerRadiusChanged,cropActiveFrameIdChanged:o.onCropActiveFrameIdChanged,asyncError:o.onAsyncError,viewModeChanged:o.onViewModeChanged,barcodeValidationChanged:o.onBarcodeValidationChanged,selectedPageIdChanged:o.onSelectedPageIdChanged,dataSourceIdChanged:o.onDataSourceIdChanged,injectedDataChanged:o.onInjectedDataChanged,documentIssueListChanged:o.onDocumentIssueListChanged,customUndoDataChanged:o.onCustomUndoDataChanged,engineEditingModeChanged:o.onEngineEditModeChanged,brandKitMediaChanged:o.onBrandKitMediaChanged,frameManipulated:o.onCanvasFramesManipulated}})),f};var Z=(n=>(n.GraFxStudioEnvironmentApiUrl="ENVIRONMENT_API",n.GraFxStudioSdkVersion="SDK_VERSION",n.GraFxStudioDocumentType="DOCUMENT_TYPE",n.GraFxStudioTemplateId="TEMPLATE_ID",n.GraFxStudioAuthToken="GRAFX_AUTH_TOKEN",n.QueryCallCacheEnabled="ENABLE_QUERY_CALL_CACHE",n))(Z||{}),Re=(n=>(n.full="full",n.followConstraints="followConstraints",n))(Re||{});const Vr={shortcutOptions:{debugPanel:{enabled:!1},ellipse:{enabled:!1},hand:{enabled:!1},temporaryHand:{enabled:!1},image:{enabled:!1},polygon:{enabled:!1},rectangle:{enabled:!1},select:{enabled:!1},text:{enabled:!1},zoom:{enabled:!1},copyPaste:{enabled:!1},viewMode:{enabled:!1},componentGrid:{enabled:!1}},frameEditingMode:"full"};var Ve=(n=>(n.overflow="overflow",n.fontLoading="fontLoading",n.actionRegister="actionRegister",n.actionExecution="actionExecution",n.actionCircular="actionCircular",n))(Ve||{}),we=(n=>(n.project="project",n.template="template",n.component="component",n))(we||{});class ke{constructor(o,e,t,s){this.type="action",this.message=o,this.id=e,this.event=t,this.eventChain=s}}class Te{constructor(o,e,t){this.type="dataRow",this.count=o,this.message=e,this.exceptions=t}}class Be extends Error{constructor(o,e,t){super(e,t),this.statusCode=o}}class Je extends Error{constructor(o,e,t){super(e,t),this.context=o}}const kr=404075,Tr=403032;function mt(n){const o=n.error??"Yikes, something went wrong",e={cause:{name:String(n.status),message:n.error??"Yikes, something went wrong"}};if(n.status===kr){const s=JSON.parse(n.data).statusCode;throw new Be(s,o,e)}else throw new Error(o,e)}function Br(n){const o=[/DateVariable '([^']+)' should not be part of excludedDays, ".*" was given/,/DateVariable '([^']+)' expects \$date to be > startDate:.*$/,/DateVariable '([^']+)' expects \$date to be < endDate:.*$/,/NumberVariable '([^']+)' expects \$extractedValue to be >= .+$/,/NumberVariable '([^']+)' expects \$extractedValue to be <= .+$/];for(const e of o)if(n.match(e))return{valid:!0};return{valid:!1}}function Jr(n,o){if(n.status===Tr&&n.error){const e=n.error;if(Br(e).valid)throw new Je(o,e,{cause:{name:String(n.status),message:e}})}}function Ur(n){mt(n)}function i(n,o){let e=!0,t=!1,s=Ur;typeof o=="function"?(t=!0,s=o):typeof o=="boolean"&&(e=o);try{n.success||(s(n),t&&mt(n));const r=n.data&&e;return{...n,parsedData:r?JSON.parse(n.data):n.data}}catch(r){throw console.error(r),r}}class Ue{constructor(o){g(this,V);this.getAll=async()=>(await a(this,V)).getActions().then(t=>i(t)),this.getById=async e=>(await a(this,V)).getActionById(e).then(s=>i(s)),this.create=async()=>(await a(this,V)).createAction().then(t=>i(t)),this.duplicate=async e=>(await a(this,V)).duplicateAction(e).then(s=>i(s)),this.remove=async e=>(await a(this,V)).removeAction(e).then(s=>i(s)),this.update=async(e,t)=>(await a(this,V)).updateAction(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>this.update(e,{name:t}),this.updateScript=async(e,t)=>this.update(e,{script:t}),this.updateTriggers=async(e,t)=>this.update(e,{triggers:t}),this.move=async(e,t)=>(await a(this,V)).moveActions(e,t).then(r=>i(r)),this.setTypeError=async(e,t)=>this.update(e,{hasTypeError:t}),this.disable=async()=>(await a(this,V)).disableActions().then(t=>i(t)),this.enable=async()=>(await a(this,V)).enableActions().then(t=>i(t)),this.enableForComponents=async e=>(await a(this,V)).enableComponentActions(e).then(s=>i(s)),y(this,V,o)}}V=new WeakMap;class Ge{constructor(o){g(this,k);this.getAllOnSelectedLayout=async()=>(await a(this,k)).getAnimationsOnSelectedLayout().then(t=>i(t)),this.getByFrameId=async(e,t)=>(await a(this,k)).getAnimationByFrameId(e,t).then(r=>i(r)),this.getByLayoutId=async e=>(await a(this,k)).getAnimationsByLayoutId(e).then(s=>i(s)),this.setFrameAnimation=async e=>(await a(this,k)).setFrameAnimation(JSON.stringify(e)).then(s=>i({...s,data:JSON.stringify(e)})),this.play=async()=>(await a(this,k)).playAnimation().then(t=>i(t)),this.pause=async()=>(await a(this,k)).pauseAnimation().then(t=>i(t)),this.setScrubberPosition=async e=>(await a(this,k)).setScrubberPosition(e).then(s=>i(s)),this.setDuration=async e=>(await a(this,k)).setAnimationDuration(e).then(s=>i(s)),this.resetFrameAnimation=async e=>(await a(this,k)).resetFrameAnimation(e).then(s=>i(s)),this.reset=async()=>(await a(this,k)).resetAnimation().then(t=>i(t)),y(this,k,o)}}k=new WeakMap;var W=(n=>(n.code39="code39",n.code93="code93",n.code128="code128",n.dataMatrix="dataMatrix",n.ean13="ean13",n.ean8="ean8",n.qr="qr",n.upca="upca",n.upce="upce",n.gs1128="gs1128",n))(W||{}),Et=(n=>(n.low="low",n.medium="medium",n.quartile="quartile",n.high="high",n))(Et||{}),wt=(n=>(n.utf8="utf8",n.iso8859_1="iso8859_1",n.code128a="code128a",n.code128b="code128b",n.code128c="code128c",n))(wt||{}),_e=(n=>(n.success="success",n.empty="empty",n.invalidLength="invalidLength",n.invalidCharacters="invalidCharacters",n.invalidChecksum="invalidChecksum",n.invalidUPCE="invalidUPCE",n.otherError="otherError",n))(_e||{}),He=(n=>(n.px="px",n.mm="mm",n.cm="cm",n.inch="inch",n.pt="pt",n))(He||{}),Q=(n=>(n.top="top",n.right="right",n.bottom="bottom",n.left="left",n))(Q||{}),xe=(n=>(n.top="top",n.child="child",n))(xe||{}),$e=(n=>(n.print="print",n.digitalStatic="digitalStatic",n.digitalAnimated="digitalAnimated",n))($e||{}),je=(n=>(n.locked="locked",n.range="range",n.none="none",n))(je||{});class ze{constructor(o){g(this,K);this.setBarcodeProperties=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableBackground=async(e,t)=>{const s={enableBackground:t};return this.setBarcodeProperties(e,s)},this.setBackgroundColor=async(e,t)=>{const s={backgroundColor:t};return this.setBarcodeProperties(e,s)},this.setEnableBars=async(e,t)=>{const s={enableBars:t};return this.setBarcodeProperties(e,s)},this.setBarColor=async(e,t)=>{const s={barColor:t};return this.setBarcodeProperties(e,s)},this.setBarcodeSource=async(e,t)=>(await a(this,K)).setBarcodeSource(e,JSON.stringify(t)).then(r=>i(r)),this.removeBarcodeSource=async e=>(await a(this,K)).setBarcodeSource(e,null).then(s=>i(s)),this.setEnableText=async(e,t)=>{const s={enableText:t};return this.setBarcodeProperties(e,s)},this.setBarHeight=async(e,t)=>{const s={barHeight:t};return this.setBarcodeProperties(e,s)},this.setMagnification=async(e,t)=>{const s={magnification:t};return this.setBarcodeProperties(e,s)},this.setQuietZoneValue=async(e,t,s)=>{const r=s?{left:s===Q.left?t:void 0,top:s===Q.top?t:void 0,right:s===Q.right?t:void 0,bottom:s===Q.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,K)).setBarcodeProperties(e,JSON.stringify({quietZone:r})).then(d=>i(d))},this.setAreQuietZoneValuesCombined=async(e,t)=>{const s={areQuietZoneValuesCombined:t};return(await a(this,K)).setBarcodeProperties(e,JSON.stringify({quietZone:s})).then(c=>i(c))},this.setErrorCorrectionLevel=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify({errorCorrectionLevel:t})).then(r=>i(r)),this.setCharacterSet=async(e,t)=>(await a(this,K)).setBarcodeProperties(e,JSON.stringify({characterSet:t})).then(r=>i(r)),this.setDrawLightMarginIndicator=async(e,t)=>{const s={drawStartStopChars:t};return this.setBarcodeProperties(e,s)},this.setDrawStartStopChars=async(e,t)=>{const s={drawStartStopChars:t};return this.setBarcodeProperties(e,s)},this.getBarcodeConfigationOptions=e=>{let t=!0,s=!0,r=!0,c,d,l=!1,m=!1,p=!1;switch(e){case W.qr:c=[wt.iso8859_1,wt.utf8],d=[Et.low,Et.medium,Et.quartile,Et.high];case W.dataMatrix:t=!1,s=!1,r=!1,l=!0;break;case W.ean13:t=!1,m=!0;break;case W.ean8:m=!0;case W.upca:case W.upce:t=!1;break;case W.code128:case W.gs1128:c=[wt.code128a,wt.code128b,wt.code128c];break;case W.code39:p=!0;break}return{allowEnableMagnification:r,allowBarHeight:s,allowQuietZone:!0,allowedCharacterSets:c,allowedErrorCorrectionLevels:d,allowToggleText:t,quietZoneAlwaysCombined:l,allowToggleLightMarginIndicator:m,allowToggleDrawStartAndEndChar:p}},y(this,K,o)}}K=new WeakMap;class We{constructor(o,e){g(this,F);this.getId=async()=>(await a(this,F)).getBrandKitId().then(s=>i(s)),this.getVersion=async()=>(await a(this,F)).getBrandKitVersion().then(s=>i(s)),this.getName=async()=>(await a(this,F)).getBrandKitName().then(s=>i(s)),this.rename=async t=>(await a(this,F)).renameBrandKit(t).then(r=>i(r)),this.updateIdAndVersion=async(t,s)=>(await a(this,F)).updateBrandKitIdAndVersion(t,s).then(c=>i(c)),this.get=async()=>(await a(this,F)).getBrandKit().then(s=>i(s)),this.getAllMedia=async()=>(await a(this,F)).getAllBrandKitMedia().then(s=>i(s)),this.addMedia=async(t,s,r)=>(await a(this,F)).addBrandKitMedia(t,s,r).then(d=>i(d)),this.updateMedia=async(t,s,r)=>(await a(this,F)).updateBrandKitMedia(t,s,r).then(d=>i(d)),this.renameMedia=async(t,s)=>(await a(this,F)).renameBrandKitMedia(t,s).then(c=>i(c)),this.removeMedia=async t=>(await a(this,F)).removeBrandKitMedia(t).then(r=>i(r)),this.set=async t=>(await a(this,F)).setBrandKit(JSON.stringify(t)).then(r=>i(r)),this.sync=async t=>(await a(this,F)).syncBrandKit(JSON.stringify(t)).then(r=>i(r)),this.isAutoSync=async()=>(await a(this,F)).isBrandKitAutoSync().then(s=>i(s)),this.enableAutoSync=async t=>(await a(this,F)).enableBrandKitAutoSync(t).then(r=>i(r)),this.switchTheme=async t=>(await a(this,F)).switchBrandKitTheme(t).then(r=>i(r)),y(this,F,o),this.sdk=e}}F=new WeakMap;class Ce{constructor(o){g(this,it);this.zoomToPage=async(e,t,s,r,c)=>(e!==void 0&&console.warn("id has no effect and will be deprecated in the future"),(await a(this,it)).zoomToPage(t,s,r,c).then(l=>i(l))),this.getZoomPercentage=async()=>(await a(this,it)).getZoomPercentage().then(t=>i(t)),this.setZoomPercentage=async e=>(await a(this,it)).setZoomPercentage(e).then(s=>i(s)),this.setViewMode=async e=>(await a(this,it)).setViewMode(e).then(s=>i(s)),y(this,it,o)}}it=new WeakMap;class Ke{constructor(o){g(this,_);this.getAll=async()=>(await a(this,_)).getCharacterStyles().then(t=>i(t)),this.getById=async e=>(await a(this,_)).getCharacterStyleById(e).then(s=>i(s)),this.create=async()=>(await a(this,_)).createCharacterStyle().then(t=>i(t)),this.update=async(e,t)=>(await a(this,_)).updateCharacterStyle(e,JSON.stringify(t)).then(r=>i(r)),this.remove=async e=>(await a(this,_)).removeCharacterStyle(e).then(s=>i(s)),this.duplicate=async e=>(await a(this,_)).duplicateCharacterStyle(e).then(s=>i(s)),this.rename=async(e,t)=>(await a(this,_)).renameCharacterStyle(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,_)).moveCharacterStyles(e,t).then(r=>i(r)),y(this,_,o)}}_=new WeakMap;class qe{constructor(o){g(this,ot);this.copyFrames=async e=>{const s=await(await a(this,ot)).copyFrames(e);return s.data&&await navigator.clipboard.writeText(s.data),i(s)},this.cutFrames=async e=>{const s=await(await a(this,ot)).cutFrames(e);return s.data&&await navigator.clipboard.writeText(s.data),i(s)},this.pasteFrames=async()=>{const e=await a(this,ot),t=await navigator.clipboard.readText(),s=await e.pasteFrames(t);return i(s)},this.getContentType=async()=>{const e=await a(this,ot),t=await navigator.clipboard.readText(),s=await e.getClipboardContentType(t);return i(s)},y(this,ot,o)}}ot=new WeakMap;class Ye{constructor(o){g(this,qt);this.convertToRgb=async e=>(await a(this,qt)).colorToRgb(JSON.stringify(e)).then(s=>i(s)),y(this,qt,o)}}qt=new WeakMap;var Ze=(n=>(n.rgb="rgb",n.hex="hex",n.cmyk="cmyk",n.spotCmyk="spotCmyk",n.spotRgb="spotRgb",n.spotHex="spotHex",n))(Ze||{}),oe=(n=>(n.rgb="rgb",n.hex="hex",n.cmyk="cmyk",n.gray="gray",n.hsl="hsl",n.spot="spot",n.spotCMYK="spotCMYK",n.spotRGB="spotRGB",n.spotHEX="spotHEX",n))(oe||{}),Qe=(n=>(n.local="local",n.brandKit="brandKit",n.stylekit="brandKit",n))(Qe||{});class Xe{constructor(o){g(this,H);this.getAll=async()=>(await a(this,H)).getColors().then(t=>i(t)),this.getById=async e=>(await a(this,H)).getColorById(e).then(s=>i(s)),this.create=async()=>(await a(this,H)).createColor().then(t=>i(t)),this.duplicate=async e=>(await a(this,H)).duplicateColor(e).then(s=>i(s)),this.move=async(e,t)=>(await a(this,H)).moveColors(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,H)).renameColor(e,t).then(r=>i(r)),this.update=async(e,t)=>{const s=await a(this,H),r=t;return r.type===oe.spot&&(r.type=oe.spotCMYK),s.updateColor(e,JSON.stringify(r)).then(c=>i(c))},this.remove=async e=>(await a(this,H)).removeColor(e).then(s=>i(s)),y(this,H,o)}}H=new WeakMap;var Ft=(n=>(n[n.file=0]="file",n[n.collection=1]="collection",n))(Ft||{}),ce=(n=>(n.LowResolutionWeb="lowresWeb",n.HighResolutionWeb="highresWeb",n))(ce||{}),Ot=(n=>(n.file="file",n.collection="collection",n))(Ot||{}),ts=(n=>(n.media="media",n.fonts="fonts",n.data="data",n.components="components",n))(ts||{}),es=(n=>(n.name="name",n.path="relativePath",n.id="id",n))(es||{}),ss=(n=>(n.ascending="asc",n.descending="desc",n))(ss||{}),ns=(n=>(n.text="text",n.boolean="boolean",n.number="number",n))(ns||{}),rs=(n=>(n.query="query",n.upload="upload",n))(rs||{}),Dt=(n=>(n.url="url",n.grafx="grafx",n.local="local",n))(Dt||{});class Gr{constructor(o,e,t,s="engineToConnector",r){this.direction="engineToConnector",this.name=o,this.direction=s,e==="var"?(this.value=`var.${t}`,this.id=t,this.type="var",this.sourceField=r):(this.value=t,this.type="value")}}var as=(n=>(n.variable="var",n.value="value",n))(as||{}),is=(n=>(n.engineToConnector="engineToConnector",n.connectorToEngine="connectorToEngine",n))(is||{}),he=(n=>(n.loading="loading",n.loaded="loaded",n.running="running",n.ready="ready",n.error="error",n))(he||{}),os=(n=>(n.stateChanged="stateChanged",n.authChanged="authChanged",n.reloadRequired="reloadRequired",n.unloaded="unloaded",n))(os||{});const _r={url:"grafx-media.json",source:"local"};class Hr{constructor(o,e){this.type="grafxToken",this.token=o,this.headers=e}}class xr{constructor(o){this.type="refreshed",this.headers=o}}var cs=(n=>(n.grafxToken="grafxToken",n.refreshed="refreshed",n))(cs||{}),hs=(n=>(n.grafxToken="grafxToken",n.any="any",n))(hs||{}),fe=(n=>(n.minDimension="minDimension",n))(fe||{});class ds extends Error{constructor(o,e){super(o),this.type=e}}var ls=(n=>(n.StaticKey="staticKey",n.OAuth2ClientCredentials="oAuth2ClientCredentials",n.OAuth2AuthorizationCode="oAuth2AuthorizationCode",n.OAuth2ResourceOwnerPassword="oAuth2ResourceOwnerPassword",n.OAuth2JwtBearer="oAuth2JwtBearer",n.None="none",n))(ls||{});class de{constructor(){this.makeConnectorSourceForwardsCompatible=o=>{if(o.source!=Dt.grafx||this.isSourceMigrated(o))return o;let e=o.url;for(;e.endsWith("/");)e=e.substring(0,e.length-1);const t=e.split("/");return{id:t[t.length-1],source:Dt.grafx}},this.makeMultipleConnectorsBackwardsCompatible=(o,e)=>o.map(t=>this.makeSingleConnectorBackwardsCompatible(t,e)),this.makeSingleConnectorBackwardsCompatible=(o,e)=>o.source.source!=Dt.grafx?o:{id:o.id,name:o.name,iconUrl:o.iconUrl,source:this.makeConnectorSourceBackwardsCompatible(o.source,e)},this.makeConnectorSourceBackwardsCompatible=(o,e)=>{let t=e;for(;t!=null&&t.endsWith("/");)t=t.substring(0,t.length-1);return{url:`${t}/connectors/${o.id}`,source:Dt.grafx}},this.isSourceMigrated=o=>"id"in o}}let us=(xn=class{constructor(o,e){g(this,J);g(this,Rt);g(this,Ct);this.getById=async t=>(await a(this,J)).getConnectorById(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData=a(this,Ct).makeSingleConnectorBackwardsCompatible(r.parsedData,a(this,Rt).get(Z.GraFxStudioEnvironmentApiUrl))),c}),this.getAllByType=async t=>(await a(this,J)).getConnectors(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData=a(this,Ct).makeMultipleConnectorsBackwardsCompatible(r.parsedData,a(this,Rt).get(Z.GraFxStudioEnvironmentApiUrl))),c}),this.register=async t=>{const s=await a(this,J),r=a(this,Ct).makeConnectorSourceForwardsCompatible(t);return s.registerConnector(JSON.stringify(r)).then(c=>i(c))},this.unregister=async t=>(await a(this,J)).unregisterConnector(t).then(r=>i(r)),this.configure=async(t,s)=>{const r=await a(this,J);return await this.waitToBeReady(t),await s(new $r(t,r)),r.updateConnectorConfiguration(t).then(c=>i(c))},this.getState=async t=>(await a(this,J)).getConnectorState(t).then(r=>i(r)),this.getOptions=async t=>(await a(this,J)).getConnectorOptions(t).then(r=>i(r)),this.waitToBeReady=async(t,s=2e3)=>{let r=Math.max(s,500);r=Math.min(r,5e3);const c=100;let d=0;try{for(;d*c<r;){const l=await this.getState(t);if(l.success&&l.parsedData&&(l.parsedData.type===he.running||l.parsedData.type===he.ready))return i({data:null,success:!0,error:void 0,status:0,parsedData:void 0},!1);await new Promise(m=>setTimeout(m,c)),d++}}catch(l){return i({data:null,success:!1,error:`Error while getting connector state ${l}`,status:5e4,parsedData:void 0},!1)}return i({data:null,success:!1,error:"Timed out waiting for connector",status:5e4,parsedData:void 0},!1)},this.updateMappings=async(t,s)=>await this.configure(t,async r=>{const{parsedData:c}=await this.getMappings(t),d=(c==null?void 0:c.filter(p=>!s.some(f=>f.name===p.name&&f.direction===p.direction)))??[],l=s.filter(p=>p.name!==""&&p.value!==""),m=[...d,...l];await r.setMappings(m)}),this.applyMappings=async(t,s)=>await this.configure(t,async r=>{const c=s.filter(d=>d.name!==""&&d.value!=="");await r.setMappings(c)}),this.setHttpHeaders=async(t,s)=>(await a(this,J)).remoteConnectorAuthenticationSetHttpHeaders(t,JSON.stringify(s)).then(c=>i(c)),y(this,J,o),y(this,Rt,e),y(this,Ct,new de)}async getMappings(o,e){return(await a(this,J)).getConnectorMappings(o).then(s=>i(s)).then(s=>{var r;return e?{...s,parsedData:(r=s.parsedData)==null?void 0:r.filter(c=>c.direction===e)}:s})}},J=new WeakMap,Rt=new WeakMap,Ct=new WeakMap,xn);class $r{constructor(o,e){g(this,ft);g(this,St);this.setOptions=async t=>a(this,St).setConnectorOptions(a(this,ft),JSON.stringify(t)).then(s=>i(s)),this.setMappings=async t=>{const s=await a(this,St).setConnectorMappings(a(this,ft),t.map(function(r){return JSON.stringify(r)}));return i(s)},this.setHttpHeader=async(t,s)=>a(this,St).connectorAuthenticationSetHttpHeader(a(this,ft),t,s).then(r=>i(r)),y(this,ft,o),y(this,St,e)}}ft=new WeakMap,St=new WeakMap;class gs{constructor(o,e){g(this,et);g(this,Vt);this.getPageItemById=async(t,s,r,c={})=>{const l=await(await a(this,et)).dataConnectorGetPageItemById(t,s,JSON.stringify(r),JSON.stringify(c)),m=i(l),p={...m,parsedData:null};return m.parsedData&&(p.parsedData={...m.parsedData,data:a(this,Vt).mapEngineToDataItem(m.parsedData.data)}),p},this.getConfigurationOptions=async t=>(await a(this,et)).dataConnectorGetConfigurationOptions(t).then(r=>i(r)),this.getCapabilities=async t=>(await a(this,et)).dataConnectorGetCapabilities(t).then(r=>i(r)),y(this,et,o),y(this,Vt,e)}async getPage(o,e,t={}){const{previousPageToken:s,continuationToken:r}=e;if(s!=null&&r!=null)throw new Error('Invalid page config: "previousPageToken" and "continuationToken" are mutually exclusive. Provide only one to indicate navigation direction.');const d=await(await a(this,et)).dataConnectorGetPage(o,JSON.stringify(e),JSON.stringify(t)),l=i(d),m={...l,parsedData:null};return l.parsedData&&(m.parsedData={...l.parsedData,data:l.parsedData.data.map(p=>a(this,Vt).mapEngineToDataItem(p))}),m}async getModel(o,e={}){return(await a(this,et)).dataConnectorGetModel(o,JSON.stringify(e)).then(s=>i(s))}}et=new WeakMap,Vt=new WeakMap;class ys{constructor(o,e){g(this,ct);g(this,Yt);this.setDataSource=async t=>(await a(this,ct)).setDataSource(t).then(r=>i(r)),this.getDataSource=async()=>(await a(this,ct)).getDataSource().then(s=>i(s)),this.removeDataSource=async()=>(await a(this,ct)).removeDataSource().then(s=>i(s)),this.setDataRow=async t=>{const s=await a(this,ct),r=a(this,Yt).mapDataItemToEngine(t);return s.setDataRow(JSON.stringify(r)).then(c=>i(c))},y(this,ct,o),y(this,Yt,e)}}ct=new WeakMap,Yt=new WeakMap;class ps{constructor(o){g(this,ht);this.getAllLogs=async()=>(await a(this,ht)).getLogs().then(t=>i(t)),this.toggleDebugPanel=async()=>(await a(this,ht)).toggleDebugPanel().then(t=>i(t)),this.enableDebug=async()=>(await a(this,ht)).enableDebug().then(t=>i(t)),this.disableDebug=async()=>(await a(this,ht)).disableDebug().then(t=>i(t)),y(this,ht,o)}}ht=new WeakMap;class ms{constructor(o){g(this,bt);this.getCurrentState=async()=>(await a(this,bt)).getCurrentDocumentState().then(t=>i(t)),this.load=async(e,t={keepConnectors:!1})=>{const s=await a(this,bt),r=typeof e!="string"?JSON.stringify(e):e;return s.loadDocument(r,JSON.stringify(t)).then(c=>i(c))},this.createAndLoad=async e=>{const t=await a(this,bt),s=JSON.stringify(e);return t.createAndLoadDocument(s).then(r=>i(r))},y(this,bt,o)}}bt=new WeakMap;var ws=(n=>(n.resize="resize",n.scale="scale",n.scaleAndResize="scaleAndResize",n))(ws||{}),Cs=(n=>(n.top="top",n.bottom="bottom",n.left="left",n.right="right",n))(Cs||{}),Lt=(n=>(n.url="url",n.variable="variable",n.connector="connector",n.brandKitMedia="brandKitMedia",n))(Lt||{}),fs=(n=>(n.connector="connector",n))(fs||{}),Ss=(n=>(n.text="text",n.image="image",n.shape="shape",n.barcode="barcode",n.component="component",n.componentGrid="componentGrid",n))(Ss||{}),bs=(n=>(n.variable="variable",n.text="text",n))(bs||{}),Is=(n=>(n.leftToRight="leftToRight",n.rightToLeft="rightToLeft",n.weak="weak",n))(Is||{}),vs=(n=>(n.horizontal="horizontal",n.vertical="vertical",n.onPath="onPath",n))(vs||{}),As=(n=>(n.top="top",n.bottom="bottom",n.middle="middle",n.justify="justify",n))(As||{}),Ps=(n=>(n.normal="normal",n.screen="screen",n.overlay="overlay",n.darken="darken",n.lighten="lighten",n.colorDodge="colorDodge",n.colorBurn="colorBurn",n.hardLight="hardLight",n.softLight="softLight",n.difference="difference",n.exclusion="exclusion",n.multiply="multiply",n.hue="hue",n.saturation="saturation",n.color="color",n.luminosity="luminosity",n))(Ps||{}),Es=(n=>(n.fill="fill",n.fit="fit",n.smartCrop="smartCrop",n.manualCrop="manualCrop",n))(Es||{}),Fs=(n=>(n.topLeft="topLeft",n.topCenter="topCenter",n.topRight="topRight",n.centerLeft="centerLeft",n.center="center",n.centerRight="centerRight",n.bottomLeft="bottomLeft",n.bottomCenter="bottomCenter",n.bottomRight="bottomRight",n))(Fs||{}),Os=(n=>(n.bringToFront="bringToFront",n.sendToBack="sendToBack",n.bringForward="bringForward",n.sendBackward="sendBackward",n))(Os||{}),Ds=(n=>(n.relative="relative",n.start="start",n.end="end",n.startAndEnd="startAndEnd",n.center="center",n))(Ds||{}),Ls=(n=>(n.page="page",n.frame="frame",n))(Ls||{}),Ns=(n=>(n.start="start",n.end="end",n.center="center",n))(Ns||{});class jr{constructor(){this.type="page"}}class zr{constructor(o,e){this.type="frame",this.frameId=o,this.edge=e}}var Se=(n=>(n.frameCrop="frameCrop",n.assetCrop="assetCrop",n))(Se||{}),Ms=(n=>(n.v1="v1",n.v2="v2",n))(Ms||{});const Wr="v2";var Rs=(n=>(n.start="start",n.center="center",n.end="end",n))(Rs||{});class Vs{constructor(o){g(this,x);this.insertImageVariableToFrame=async(e,t)=>{const s=await a(this,x),r={id:t,type:Lt.variable};return s.setImageSource(e,JSON.stringify(r)).then(c=>i(c))},this.insertTextVariable=async e=>(await a(this,x)).insertTextVariable(e).then(s=>i(s)),this.enterTextEditMode=async e=>(await a(this,x)).enterTextEditMode(e).then(s=>i(s)),this.exitTextEditMode=async()=>(await a(this,x)).exitTextEditMode().then(t=>i(t)),this.getText=async(e,t)=>(await a(this,x)).getTextByFrameId(e,t).then(r=>i(r)),this.setText=async(e,t)=>(await a(this,x)).setTextByFrameId(e,t).then(r=>i(r)),this.selectText=async(e,t,s)=>(await a(this,x)).selectTextById(e,t,s).then(c=>i(c)),this.addCustomUndoData=async(e,t,s)=>(await a(this,x)).setCustomUndoData(e,t,s??!1).then(c=>i(c)),y(this,x,o)}}x=new WeakMap;class ks{constructor(o){g(this,dt);g(this,kt);this.query=async(e,t,s={})=>(await a(this,dt)).fontConnectorQuery(e,JSON.stringify(t),JSON.stringify(s)).then(c=>i(c)),this.detail=async(e,t,s={})=>(await a(this,dt)).fontConnectorDetail(e,t,JSON.stringify(s)).then(c=>i(c)),this.download=async(e,t,s={})=>(await a(this,kt)).fontConnectorDownload(e,t,JSON.stringify(s)).then(c=>c??c),this.preview=async(e,t,s,r={})=>(await a(this,kt)).fontConnectorPreview(e,t,s,JSON.stringify(r)).then(d=>d??d),this.getConfigurationOptions=async e=>(await a(this,dt)).fontConnectorGetConfigurationOptions(e).then(s=>i(s)),this.getCapabilities=async e=>(await a(this,dt)).fontConnectorGetCapabilities(e).then(s=>i(s)),this.parseDeprecatedFontType=e=>{if(e===Ft.file)return Ot.file;if(e===Ft.collection)return Ot.collection},y(this,dt,o),y(this,kt,o)}}dt=new WeakMap,kt=new WeakMap;class Ts{constructor(o){g(this,D);this.addFontFamily=async(e,t)=>(await a(this,D)).addFontFamily(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontFamily=async e=>(await a(this,D)).removeFontFamily(e).then(s=>i(s)),this.addFontStyle=async(e,t)=>(await a(this,D)).addFontStyle(e,JSON.stringify(t)).then(r=>i(r)),this.removeFontStyle=async e=>(await a(this,D)).removeFontStyle(e).then(s=>i(s)),this.getFontFamilies=async()=>(await a(this,D)).getFontFamilies().then(t=>i(t)),this.getFontStyles=async e=>(await a(this,D)).getFontStyles(e).then(s=>i(s)),this.getFontFamilyById=async e=>(await a(this,D)).getFontFamilyById(e).then(s=>i(s)),this.getFontStyleById=async e=>(await a(this,D)).getFontStyleById(e).then(s=>i(s)),this.getDefaultFontStyle=async()=>(await a(this,D)).getDefaultFontStyle().then(t=>i(t)),this.getDefaultFontFamily=async()=>(await a(this,D)).getDefaultFontFamily().then(t=>i(t)),this.isFontFamilyUsed=async e=>(await a(this,D)).isFontFamilyUsed(e).then(s=>i(s)),this.isFontStyleUsed=async e=>(await a(this,D)).isFontStyleUsed(e).then(s=>i(s)),this.moveFontFamilies=async(e,t)=>(await a(this,D)).moveFontFamilies(e,t).then(r=>i(r)),this.getPreviewsOfCharacterStrings=async(e,t)=>(await a(this,D)).getPreviewsOfCharacterStrings(e,JSON.stringify(t)).then(r=>i(r)),y(this,D,o)}}D=new WeakMap;class be{constructor(o){g(this,It);this.setShapeProperties=async(e,t)=>(await a(this,It)).setShapeProperties(e,JSON.stringify(t)).then(r=>i(r)),this.setEnableFill=async(e,t)=>{const s={enableFill:t};return this.setShapeProperties(e,s)},this.setFillColor=async(e,t)=>{const s={fillColor:t};return this.setShapeProperties(e,s)},this.setEnableStroke=async(e,t)=>{const s={enableStroke:t};return this.setShapeProperties(e,s)},this.setStrokeColor=async(e,t)=>{const s={strokeColor:t};return this.setShapeProperties(e,s)},this.setStrokeWeight=async(e,t)=>{const s={strokeWeight:t};return this.setShapeProperties(e,s)},this.setFlagAllCornersSame=async(e,t)=>{const s={allCornersSame:t};return this.setShapeProperties(e,s)},this.setShapeCorners=async(e,t)=>(await a(this,It)).setShapeCorners(e,JSON.stringify(t)).then(r=>i(r)),this.setRadiusAll=async(e,t)=>{const s={radiusAll:t};return this.setShapeCorners(e,s)},this.setRadiusTopLeft=async(e,t)=>{const s={topLeft:t};return this.setShapeCorners(e,s)},this.setRadiusBottomLeft=async(e,t)=>{const s={bottomLeft:t};return this.setShapeCorners(e,s)},this.setRadiusTopRight=async(e,t)=>{const s={topRight:t};return this.setShapeCorners(e,s)},this.setRadiusBottomRight=async(e,t)=>{const s={bottomRight:t};return this.setShapeCorners(e,s)},this.setShapeFrameSource=async(e,t)=>(await a(this,It)).setShapeFrameSource(e,JSON.stringify(t)).then(r=>i(r)),y(this,It,o)}}It=new WeakMap;class Bs{constructor(o){g(this,u);this.getAll=async()=>(await a(this,u)).getFrames().then(t=>i(t)),this.getSelected=async()=>(await a(this,u)).getSelectedFrames().then(t=>i(t)),this.getAllByPageId=async e=>(await a(this,u)).getFramesByPageId(e).then(s=>i(s)),this.getByName=async e=>(await a(this,u)).getFrameByName(e).then(s=>i(s)),this.getById=async e=>(await a(this,u)).getFrameById(e).then(s=>i(s)),this.getPropertiesOnSelectedLayout=async()=>(await a(this,u)).getFramePropertiesOnSelectedLayout().then(t=>i(t)),this.getLayoutProperties=async(e,t)=>(await a(this,u)).getFramePropertiesByFrameId(e,t).then(r=>i(r)),this.getAllLayoutProperties=async e=>(await a(this,u)).getFramesProperties(e).then(s=>i(s)),this.resetTransformation=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.resetSize=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.select=async e=>(await a(this,u)).selectFrames([e]).then(s=>i(s)),this.selectMultiple=async e=>(await a(this,u)).selectFrames(e).then(s=>i(s)),this.deselectAll=async()=>(await a(this,u)).deselectFrames().then(t=>i(t)),this.reorderFrames=async(e,t)=>(await a(this,u)).reorderFrames(e,t).then(r=>i(r)),this.setZIndex=async(e,t)=>(await a(this,u)).setFrameZIndex(e,t).then(r=>i(r)),this.setHeight=async(e,t)=>(await a(this,u)).setFrameHeight(e,t).then(r=>i(r)),this.setRotation=async(e,t)=>(await a(this,u)).setFrameRotation(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,u)).setFrameWidth(e,t).then(r=>i(r)),this.setX=async(e,t)=>(await a(this,u)).setFrameX(e,t).then(r=>i(r)),this.setY=async(e,t)=>(await a(this,u)).setFrameY(e,t).then(r=>i(r)),this.setOpacity=async(e,t)=>(await a(this,u)).setFrameOpacity(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,u)).renameFrame(e,t).then(r=>i(r)),this.reset=async e=>(await a(this,u)).resetFrame(e).then(s=>i(s)),this.resetX=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.resetY=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.resetRotation=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.resetWidth=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.resetHeight=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.resetImageFrameFitMode=async e=>(await a(this,u)).resetImageFrameFitMode(e).then(s=>i(s)),this.setVisibility=async(e,t)=>(await a(this,u)).setFrameIsVisible(e,t).then(r=>i(r)),this.setIsVisible=async(e,t)=>(await a(this,u)).setFrameIsVisible(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,u)).removeFrames([e]).then(s=>i(s)),this.removeFrames=async e=>(await a(this,u)).removeFrames(e).then(s=>i(s)),this.create=async(e,t,s,r,c)=>(await a(this,u)).addFrame(e,t,s,r,c).then(l=>i(l)),this.createShapeFrame=async(e,t,s,r,c)=>(await a(this,u)).addFrame(e,t,s,r,c).then(l=>i(l)),this.createBarcodeFrame=async(e,t)=>(await a(this,u)).addBarcodeFrame(e,t==null?void 0:t.x,t==null?void 0:t.y).then(r=>i(r)),this.createComponentFrame=async(e,t,s,r,c)=>(await a(this,u)).addComponentFrame(t,s,r,c,JSON.stringify(e)).then(l=>i(l)),this.duplicateFrames=async e=>(await a(this,u)).duplicateFrames(e).then(s=>i(s)),this.updateImageSource=async(e,t)=>{const s=await a(this,u),r=t!==null?JSON.stringify(t):null;return s.setImageSource(e,r).then(c=>i(c))},this.removeImageSource=async e=>this.updateImageSource(e,null),this.setImageFromConnector=async(e,t,s)=>{const r={id:t,assetId:s,type:Lt.connector};return this.updateImageSource(e,r)},this.setImageFromUrl=async(e,t)=>{const s={url:t,type:Lt.url};return this.updateImageSource(e,s)},this.setImageFromBrandkitMedia=async(e,t)=>{const s={name:t,type:Lt.brandKitMedia};return this.updateImageSource(e,s)},this.setImageFrameFitMode=async(e,t)=>(await a(this,u)).setImageFrameFitMode(e,t).then(r=>i(r)),this.setImageFrameFitModePosition=async(e,t)=>(await a(this,u)).setImageFrameFitModePosition(e,t).then(r=>i(r)),this.setImageFrameSmartCropSettings=async(e,t)=>(await a(this,u)).setImageFrameSmartCropSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setFrameConstrainProportions=async(e,t)=>(console.error("setFrameConstrainProportions is not supported anymore"),i({success:!1,status:0,error:"setFrameConstrainProportions is not supported anymore",parsedData:null})),this.setVerticalAlign=async(e,t)=>(await a(this,u)).setVerticalAlignment(e,t).then(r=>i(r)),this.setNumberOfColumns=async(e,t)=>(await a(this,u)).setNumberOfColumns(e,t).then(r=>i(r)),this.setColumnGap=async(e,t)=>(await a(this,u)).setColumnGap(e,t).then(r=>i(r)),this.setMinCopyfitting=async(e,t)=>(await a(this,u)).setMinCopyfitting(e,t).then(r=>i(r)),this.setMaxCopyfitting=async(e,t)=>(await a(this,u)).setMaxCopyfitting(e,t).then(r=>i(r)),this.setEnableCopyfitting=async(e,t)=>(await a(this,u)).setEnableCopyfitting(e,t).then(r=>i(r)),this.resetMinCopyfitting=async e=>(await a(this,u)).resetMinCopyfitting(e).then(s=>i(s)),this.resetMaxCopyfitting=async e=>(await a(this,u)).resetMaxCopyfitting(e).then(s=>i(s)),this.resetEnableCopyfitting=async e=>(await a(this,u)).resetEnableCopyfitting(e).then(s=>i(s)),this.setShapeFrameEnableFill=async(e,t)=>this.shapeController.setEnableFill(e,t),this.setShapeFrameFillColor=async(e,t)=>this.shapeController.setFillColor(e,t),this.setShapeFrameEnableStroke=async(e,t)=>this.shapeController.setEnableStroke(e,t),this.setShapeFrameStrokeColor=async(e,t)=>this.shapeController.setStrokeColor(e,t),this.setShapeFrameStrokeWeight=async(e,t)=>this.shapeController.setStrokeWeight(e,t),this.setFillOverprint=async(e,t)=>(await a(this,u)).setFrameFillOverprint(e,t).then(r=>i(r)),this.setStrokeOverprint=async(e,t)=>(await a(this,u)).setFrameStrokeOverprint(e,t).then(r=>i(r)),this.setBlendMode=async(e,t)=>(await a(this,u)).setFrameBlendMode(e,t).then(r=>i(r)),this.setFrameContainerShape=async(e,t)=>(await a(this,u)).setFrameContainerShape(e,JSON.stringify(t)).then(r=>i(r)),this.enterCropMode=async(e,t=Se.frameCrop)=>(await a(this,u)).enterCropMode(e,t).then(r=>i(r)),this.applyCropMode=async()=>(await a(this,u)).applyCropMode().then(t=>i(t)),this.exitCropMode=async()=>(await a(this,u)).cancelCropMode().then(t=>i(t)),this.enterSubjectMode=async e=>(await a(this,u)).enterSubjectMode(e).then(s=>i(s)),this.applySubjectMode=async()=>(await a(this,u)).applySubjectMode().then(t=>i(t)),this.exitSubjectMode=async()=>(await a(this,u)).cancelSubjectMode().then(t=>i(t)),this.enterGradientMode=async e=>(await a(this,u)).enterGradientMode(e).then(s=>i(s)),this.applyGradientMode=async()=>(await a(this,u)).applyGradientMode().then(t=>i(t)),this.cancelGradientMode=async()=>(await a(this,u)).cancelGradientMode().then(t=>i(t)),this.resetCropMode=async e=>(console.error("resetCropMode is not supported anymore"),i({success:!1,status:0,error:"resetCropMode is not supported anymore",parsedData:null})),this.setEnableAutoGrow=async(e,t)=>{const s={enabled:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setAutoGrowMinWidth=async(e,t)=>{const s={minWidth:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setAutoGrowMaxWidth=async(e,t)=>{const s={maxWidth:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setAutoGrowMinHeight=async(e,t)=>{const s={minHeight:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setAutoGrowMaxHeight=async(e,t)=>{const s={maxHeight:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setAutoGrowDirections=async(e,t)=>{const s={directions:{value:t}};return(await a(this,u)).updateAutoGrowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.resetAutoGrowSettingsEnabled=async e=>(console.error("resetAutoGrowSettingsEnabled is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowSettingsEnabled is not supported anymore",parsedData:null})),this.resetAutoGrowMinWidth=async e=>(console.error("resetAutoGrowMinWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMaxWidth=async e=>(console.error("resetAutoGrowMaxWidth is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxWidth is not supported anymore",parsedData:null})),this.resetAutoGrowMinHeight=async e=>(console.error("resetAutoGrowMinHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMinHeight is not supported anymore",parsedData:null})),this.resetAutoGrowMaxHeight=async e=>(console.error("resetAutoGrowMaxHeight is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowMaxHeight is not supported anymore",parsedData:null})),this.resetAutoGrowDirections=async e=>(console.error("resetAutoGrowDirections is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrowDirections is not supported anymore",parsedData:null})),this.resetAutoGrow=async e=>(console.error("resetAutoGrow is not supported anymore"),i({success:!1,status:0,error:"resetAutoGrow is not supported anymore",parsedData:null})),this.setShadowEnabled=async(e,t)=>{const s={enabled:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setShadowDistance=async(e,t)=>{const s={distance:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setShadowAngleDegrees=async(e,t)=>{const s={angleDegrees:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setShadowBlurRadius=async(e,t)=>{const s={blurRadius:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setShadowColor=async(e,t)=>{const s={color:{value:t}};return(await a(this,u)).updateFrameShadowSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setAnchor=async(e,t,s,r,c)=>{const d={horizontal:t,type:s,target:r,endTarget:c};return(await a(this,u)).setAnchorProperties(e,JSON.stringify(d)).then(m=>i(m))},this.setVerticalAnchor=async(e,t,s,r)=>this.setAnchor(e,!1,t,s,r),this.setHorizontalAnchor=async(e,t,s,r)=>this.setAnchor(e,!0,t,s,r),this.resetAnchoring=async e=>(await a(this,u)).resetFrameTransformation(e).then(s=>i(s)),this.resetVisibility=async e=>(await a(this,u)).setFrameIsVisible(e,null).then(s=>i(s)),this.getConfiguration=async e=>(await a(this,u)).getFrameConfiguration(e).then(s=>i(s)),this.resetAssetCropOverride=async e=>(await a(this,u)).resetAssetCropOverride(e).then(s=>i(s)),this.resetAllAssetCropOverrides=async e=>(await a(this,u)).resetAllAssetCropOverrides(e).then(s=>i(s)),this.setGradientApplied=async(e,t)=>{const s={isApplied:t};return(await a(this,u)).updateFrameGradientSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setLocalGradient=async(e,t)=>{const s={gradient:t};return(await a(this,u)).updateFrameGradientSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setBrandKitGradient=async(e,t)=>{const s={id:t};return(await a(this,u)).updateFrameGradientSettings(e,JSON.stringify(s)).then(c=>i(c))},this.setSmartCropSubjectId=async(e,t)=>(await a(this,u)).setSmartCropSubjectId(e,t).then(r=>i(r)),y(this,u,o),this.shapeController=new be(a(this,u)),this.constraints=new Kr(a(this,u))}}u=new WeakMap;class Kr{constructor(o){g(this,N);this.get=async e=>(await a(this,N)).getFrameConstraints(e).then(s=>i(s)),this.setSelectable=async(e,t)=>{const s={selectionAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setHorizontalMovement=async(e,t)=>{const s={horizontalMovementAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setVerticalMovement=async(e,t)=>{const s={verticalMovementAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setRotation=async(e,t)=>{const s={rotationAllowed:{value:t}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setResize=async(e,t,s)=>{const r={resizeAllowed:{value:t},...s!==void 0&&{proportionLocked:{value:s}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(r)).then(d=>i(d))},this.setCrop=async(e,t)=>{const s={image:{cropAllowed:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setTextEditingAllowed=async(e,t)=>{const s={text:{editingAllowed:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setAllowedParagraphStyles=async(e,t)=>{const s={text:{paragraphStyles:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setAllowedCharacterStyles=async(e,t)=>{const s={text:{characterStyles:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setAllowedColors=async(e,t)=>{const s={text:{colors:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},this.setAllowedFontSizes=async(e,t)=>{const s={text:{fontSizes:{value:t}}};return(await a(this,N)).updateFrameConstraints(e,JSON.stringify(s)).then(c=>i(c))},y(this,N,o)}}N=new WeakMap;class Js{constructor(){this.currentEngineVersion=T.current,this.currentSDKVersion=Oe.version}}class Us{constructor(o){g(this,S);g(this,Zt);this.getAll=async()=>(await a(this,S)).getLayouts().then(t=>i(t)),this.getById=async e=>(await a(this,S)).getLayoutById(e).then(s=>i(s)),this.getByName=async e=>(await a(this,S)).getLayoutByName(e).then(s=>i(s)),this.getSelected=async()=>(await a(this,S)).getSelectedLayout().then(t=>i(t)),this.remove=async e=>(await a(this,S)).removeLayout(e).then(s=>i(s)),this.create=async(e,t)=>{const s=await a(this,S);return t!=null&&t.length?s.addLayouts(e,JSON.stringify(t)).then(r=>i(r)):s.addLayout(e).then(r=>i(r))},this.rename=async(e,t)=>(await a(this,S)).renameLayout(e,t).then(r=>i(r)),this.select=async e=>(await a(this,S)).selectLayoutWithOptions(e,null).then(s=>i(s)),this.selectWithPageSize=async(e,t)=>{const s=await a(this,S),r={pageSize:t};return s.selectLayoutWithOptions(e,JSON.stringify(r)).then(c=>i(c))},this.duplicate=async e=>(await a(this,S)).duplicateLayout(e).then(s=>i(s)),this.reset=async e=>(await a(this,S)).resetLayout(e).then(s=>i(s)),this.setHeight=async(e,t)=>(await a(this,S)).setLayoutHeight(e,t).then(r=>i(r)),this.setWidth=async(e,t)=>(await a(this,S)).setLayoutWidth(e,t).then(r=>i(r)),this.setUnit=async(e,t)=>(await a(this,S)).setLayoutUnit(e,t).then(r=>i(r)),this.resetHeight=async e=>(await a(this,S)).resetLayoutHeight(e).then(s=>i(s)),this.resetWidth=async e=>(await a(this,S)).resetLayoutWidth(e).then(s=>i(s)),this.resetUnit=async e=>(await a(this,S)).resetLayoutUnit(e).then(s=>i(s)),this.getSelectedSnapshot=async()=>(await a(this,Zt)).getPageSnapshot().then(t=>t??t),this.setIntent=async(e,t)=>(await a(this,S)).setLayoutIntent(e,t).then(r=>i(r)),this.resetIntent=async e=>(await a(this,S)).resetLayoutIntent(e).then(s=>i(s)),this.setFillColor=async(e,t)=>(await a(this,S)).setLayoutFillColor(e,JSON.stringify(t)).then(r=>i(r)),this.setFillColorEnabled=async(e,t)=>(await a(this,S)).setLayoutFillColorEnabled(e,t).then(r=>i(r)),this.resetFillColor=async e=>(await a(this,S)).resetLayoutFillColor(e).then(s=>i(s)),this.setBleedValue=async(e,t,s)=>{const r=s?{left:s===Q.left?t:void 0,top:s===Q.top?t:void 0,right:s===Q.right?t:void 0,bottom:s===Q.bottom?t:void 0}:{left:t,top:t,right:t,bottom:t};return(await a(this,S)).updateLayoutBleed(e,JSON.stringify(r)).then(d=>i(d))},this.setAreBleedValuesCombined=async(e,t)=>{const s={areBleedValuesCombined:t};return(await a(this,S)).updateLayoutBleed(e,JSON.stringify(s)).then(c=>i(c))},this.resetBleedValues=async e=>(await a(this,S)).updateLayoutBleed(e,null).then(s=>i(s)),this.setPrivateData=async(e,t)=>(await a(this,S)).setLayoutPrivateData(e,JSON.stringify(t)).then(r=>i(r)),this.getPrivateData=async e=>(await a(this,S)).getLayoutPrivateData(e).then(s=>i(s)),this.setDisplayName=async(e,t)=>(await a(this,S)).setLayoutDisplayName(e,t).then(r=>i(r)),this.getDisplayName=async e=>(await a(this,S)).getLayoutDisplayName(e).then(s=>i(s)),this.resetDisplayName=async e=>(await a(this,S)).setLayoutDisplayName(e,null).then(s=>i(s)),this.setAvailableForUser=async(e,t)=>(await a(this,S)).setLayoutAvailableForUser(e,t).then(r=>i(r)),this.setSelectedByUser=async(e,t)=>(await a(this,S)).setLayoutSelectedByUser(e,t).then(r=>i(r)),this.setResizableByUser=async(e,t)=>(await a(this,S)).setLayoutResizableByUser(e,JSON.stringify(t)).then(r=>i(r)),y(this,S,o),y(this,Zt,o)}}S=new WeakMap,Zt=new WeakMap;var le=(n=>(n.thumbnail="thumbnail",n.mediumres="mediumres",n.highres="highres",n.original="original",n))(le||{}),Ie=(n=>(n.web="web",n.print="print",n.animation="animation",n))(Ie||{});class Gs{constructor(o){g(this,st);g(this,Qt);this.query=async(e,t,s={})=>(await a(this,st)).mediaConnectorQuery(e,JSON.stringify(t),JSON.stringify(s)).then(c=>i(c)),this.detail=async(e,t,s={})=>(await a(this,st)).mediaConnectorDetail(e,t,JSON.stringify(s)).then(c=>i(c)),this.download=async(e,t,s,r={})=>{const c=this.parseDeprecatedMediaDownloadType(s);return(await a(this,Qt)).mediaConnectorDownload(e,t,c,Ie.web,JSON.stringify(r)).then(l=>{if(l instanceof Uint8Array)return l;throw typeof l=="object"&&l!==null&&"success"in l&&!l.success&&mt(l),new Error(`Unexpected response type: ${typeof l}.`)})},this.getConfigurationOptions=async e=>(await a(this,st)).mediaConnectorGetConfigurationOptions(e).then(s=>i(s)),this.getCapabilities=async e=>(await a(this,st)).mediaConnectorGetCapabilities(e).then(s=>i(s)),this.parseDeprecatedMediaType=e=>{if(e===Ft.file)return Ot.file;if(e===Ft.collection)return Ot.collection},this.upload=async(e,t,s={})=>(await a(this,st)).mediaConnectorUpload(e,JSON.stringify(t),JSON.stringify(s)).then(c=>i(c)),y(this,st,o),y(this,Qt,o)}parseDeprecatedMediaDownloadType(o){switch(o){case ce.HighResolutionWeb:return le.highres;case ce.LowResolutionWeb:return le.thumbnail;default:return o}}}st=new WeakMap,Qt=new WeakMap;let _s=($n=class{constructor(o){g(this,R);g(this,Xt);this.add=async()=>(await a(this,R)).addPage().then(t=>i(t)),this.remove=async e=>(await a(this,R)).removePage(e).then(s=>i(s)),this.select=async e=>(await a(this,R)).selectPage(e).then(s=>i(s)),this.setVisibility=async(e,t)=>(await a(this,R)).setPageIsVisible(e,t).then(r=>i(r)),this.duplicate=async e=>(await a(this,R)).duplicatePage(e).then(s=>i(s)),this.getAll=async()=>(await a(this,R)).getPages().then(t=>i(t)),this.getById=async e=>(await a(this,R)).getPageById(e).then(s=>i(s)),this.getSnapshot=async(e,t)=>(await a(this,Xt)).getPageSnapshotWithSettings(e,t==null?null:JSON.stringify(t)).then(r=>{if(r instanceof Uint8Array)return r;throw typeof r=="object"&&r!==null&&"success"in r&&!r.success&&mt(r),new Error(`Unexpected response type: ${typeof r}.`)}),this.setWidth=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,R)).setPageWidth(t).then(r=>i(r))),this.setHeight=async(e,t)=>(e!==void 0&&console.warn("pageId has no effect since all pages are being updated simultaneously."),(await a(this,R)).setPageHeight(t).then(r=>i(r))),this.setSize=async(e,t)=>(await a(this,R)).setPageSize(e,t).then(r=>i(r)),this.move=async(e,t)=>(await a(this,R)).reorderPages(e,t).then(r=>i(r)),y(this,R,o),y(this,Xt,o)}},R=new WeakMap,Xt=new WeakMap,$n);class Hs{constructor(o){g(this,$);this.getAll=async()=>(await a(this,$)).getParagraphStyles().then(t=>i(t)),this.getById=async e=>(await a(this,$)).getParagraphStyleById(e).then(s=>i(s)),this.create=async()=>(await a(this,$)).createParagraphStyle().then(t=>i(t)),this.duplicate=async e=>(await a(this,$)).duplicateParagraphStyle(e).then(s=>i(s)),this.update=async(e,t)=>(await a(this,$)).updateParagraphStyle(e,JSON.stringify(t)).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,$)).renameParagraphStyle(e,t).then(r=>i(r)),this.remove=async e=>(await a(this,$)).removeParagraphStyle(e).then(s=>i(s)),this.move=async(e,t)=>(await a(this,$)).moveParagraphStyles(e,t).then(r=>i(r)),y(this,$,o)}}$=new WeakMap;var Wt=(n=>(n.shortText="shortText",n.longText="longText",n.richText="richText",n.image="image",n.list="list",n.boolean="boolean",n.group="group",n.number="number",n.date="date",n.dataSource="dataSource",n))(Wt||{}),xs=(n=>(n.Monday="monday",n.Tuesday="tuesday",n.Wednesday="wednesday",n.Thursday="thursday",n.Friday="friday",n.Saturday="saturday",n.Sunday="sunday",n))(xs||{}),$s=(n=>(n.en_US="en_US",n.cs="cs",n.da="da",n.nl="nl",n.fi="fi",n.fr="fr",n.de="de",n.it="it",n.no="no",n.pl="pl",n.pt_PT="pt_PT",n.es_ES="es_ES",n.sv="sv",n))($s||{}),Nt=(n=>(n.visible="visible",n.invisible="invisible",n.conditional="conditional",n))(Nt||{}),js=(n=>(n.boolean="boolean",n.text="text",n.number="number",n))(js||{}),zs=(n=>(n.equals="=",n.notEquals="!=",n.greaterThan=">",n.greaterThanOrEquals=">=",n.lessThan="<",n.lessThanOrEquals="<=",n))(zs||{}),ve=(n=>(n.injected="injected",n.connector="connector",n))(ve||{}),Ws=(n=>(n.table="table",n.list="list",n))(Ws||{});let qr=class{constructor(o,e){this.onActionsChanged=t=>{this.config.events.onActionsChanged.trigger(JSON.parse(t))},this.onAnimationChanged=t=>{this.config.events.onFrameAnimationsChanged.trigger(JSON.parse(t))},this.onAnimationPlaybackChanged=t=>{this.config.events.onScrubberPositionChanged.trigger(JSON.parse(t))},this.onSelectedLayoutPropertiesChanged=t=>{this.config.events.onSelectedLayoutPropertiesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutUnitChanged=t=>{this.config.events.onSelectedLayoutUnitChanged.trigger(t)},this.onFramesLayoutChanged=t=>{const s=JSON.parse(t);this.config.events.onFramesLayoutChanged.trigger(s)},this.onSelectedFramesLayoutChanged=t=>{const s=JSON.parse(t);this.config.events.onSelectedFramesLayoutChanged.trigger(s);const r=this.config.onSelectedFrameLayoutChanged;r&&r(s.length>1?void 0:s[0])},this.onSelectedFramesContentChanged=t=>{const s=JSON.parse(t);this.config.events.onSelectedFramesContentChanged.trigger(s);const r=this.config.onSelectedFrameContentChanged;r&&r(s.length>1?null:s[0])},this.onStateChanged=()=>{this.config.events.onStateChanged.trigger()},this.onAuthExpired=async t=>{const s=await this.config.handlers.onAuthExpired.trigger(JSON.parse(t));return s!=null?JSON.stringify(s):null},this.onViewportRequested=()=>{const t=this.config.handlers.onViewportRequested.trigger();return t!=null?JSON.stringify(t):null},this.onDocumentLoaded=()=>{this.config.events.onDocumentLoaded.trigger()},this.onPageSelectionChanged=t=>{this.config.events.onPageSelectionChanged.trigger(t)},this.onVariableListChanged=t=>{const r=JSON.parse(t).map(c=>{var d;return c.type===Wt.list?{...c,items:c.items.map(l=>l.value),selected:(d=c.selected)==null?void 0:d.value}:c});this.config.events.onVariableListChanged.trigger(r)},this.onSelectedToolChanged=t=>{this.config.events.onSelectedToolChanged.trigger(t)},this.onUndoStateChanged=t=>{this.config.events.onUndoStackStateChanged.trigger(JSON.parse(t))},this.onCustomUndoDataChanged=t=>{this.config.events.onCustomUndoDataChanged.trigger(JSON.parse(t))},this.onSelectedLayoutFramesChanged=t=>{this.config.events.onSelectedLayoutFramesChanged.trigger(JSON.parse(t))},this.onSelectedTextStyleChanged=t=>{this.config.events.onSelectedTextStyleChanged.trigger(JSON.parse(t))},this.onColorsChanged=t=>{this.config.events.onColorsChanged.trigger(JSON.parse(t))},this.onParagraphStylesChanged=t=>{this.config.events.onParagraphStylesChanged.trigger(JSON.parse(t))},this.onCharacterStylesChanged=t=>{this.config.events.onCharacterStylesChanged.trigger(JSON.parse(t))},this.onFontFamiliesChanged=t=>{this.config.events.onFontFamiliesChanged.trigger(JSON.parse(t))},this.onSelectedLayoutIdChanged=t=>{this.config.events.onSelectedLayoutIdChanged.trigger(t)},this.onLayoutsChanged=t=>{this.config.events.onLayoutsChanged.trigger(JSON.parse(t))},this.onZoomChanged=t=>{this.config.events.onZoomChanged.trigger(JSON.parse(t))},this.onConnectorEvent=t=>{this.config.events.onConnectorEvent.trigger(JSON.parse(t))},this.onConnectorsChanged=t=>{const r=new de().makeMultipleConnectorsBackwardsCompatible(JSON.parse(t),this.localConfig.get(Z.GraFxStudioEnvironmentApiUrl));this.config.events.onConnectorsChanged.trigger(r)},this.onSelectedPageIdChanged=t=>{this.config.events.onSelectedPageIdChanged.trigger(t)},this.onPagesChanged=t=>{this.config.events.onPagesChanged.trigger(JSON.parse(t))},this.onPageSnapshotInvalidated=t=>{this.config.events.onPageSnapshotInvalidated.trigger(t)},this.onPageSizeChanged=t=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(t))},this.onShapeCornerRadiusChanged=t=>{this.config.events.onShapeCornerRadiusChanged.trigger(JSON.parse(t))},this.onCropActiveFrameIdChanged=t=>{this.config.events.onCropActiveFrameIdChanged.trigger(t)},this.onAsyncError=t=>{const s=JSON.parse(t);if((s==null?void 0:s.type)==="dataRow"){const r=new Te(s.count,s.message,s.exceptions);this.config.events.onAsyncError.trigger(r)}else if((s==null?void 0:s.type)==="action"){const r=new ke(s.message,s.id,s.event,s.eventChain);this.config.events.onAsyncError.trigger(r)}else this.config.events.onAsyncError.trigger(s)},this.onViewModeChanged=t=>{this.config.events.onViewModeChanged.trigger(t)},this.onBarcodeValidationChanged=t=>{this.config.events.onBarcodeValidationChanged.trigger(JSON.parse(t))},this.onDataSourceIdChanged=t=>{this.config.events.onDataSourceIdChanged.trigger(t)},this.onInjectedDataChanged=t=>{this.config.events.onInjectedDataChanged.trigger(t)},this.onDocumentIssueListChanged=t=>{this.config.events.onDocumentIssueListChanged.trigger(JSON.parse(t))},this.onEngineEditModeChanged=t=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(t))},this.onBrandKitMediaChanged=t=>{this.config.events.onBrandKitMediaChanged.trigger(JSON.parse(t))},this.onCanvasFramesManipulated=t=>{this.config.events.onCanvasFramesManipulated.trigger(JSON.parse(t))},this.config=o,this.localConfig=e}};class Ks{constructor(o){g(this,vt);this.set=async e=>(await a(this,vt)).selectedTextStyleDeltaUpdate(JSON.stringify(e)).then(s=>i(s)),this.removeSelected=async()=>(await a(this,vt)).selectedTextStyleClean().then(t=>i(t)),this.getSelected=async()=>(await a(this,vt)).getSelectedTextStyle().then(t=>i(t)),y(this,vt,o)}}vt=new WeakMap;var qs=(n=>(n.FRAME_X="frameX",n.FRAME_Y="frameY",n.WIDTH="width",n.HEIGHT="height",n.FRAME_ROTATION="frameRotation",n))(qs||{}),Ys=(n=>(n.LAYOUT_HEIGHT="layoutHeight",n.LAYOUT_WIDTH="layoutWidth",n.BLEED_TOP="bleedTop",n.BLEED_BOTTOM="bleedBottom",n.BLEED_LEFT="bleedLeft",n.BLEED_RIGHT="bleedRight",n.BLEED_VALUES_COMBINED="areBleedValuesCombined",n))(Ys||{}),G=(n=>(n.SELECT="select",n.ZOOM="zoom",n.HAND="hand",n.IMAGE_FRAME="imageFrame",n.TEXT_FRAME="textFrame",n.SHAPE_RECT="rect",n.SHAPE_ELLIPSE="ellipse",n.SHAPE_POLYGON="polygon",n.COMPONENT_GRID_FRAME="componentGridFrame",n))(G||{}),Zs=(n=>(n.MP4="mp4",n.GIF="gif",n.PNG="png",n.JPG="jpg",n.PDF="pdf",n.HTML="html",n))(Zs||{}),ue=(n=>(n.SANDBOX="sandbox",n.PRODUCTION="online",n))(ue||{});class Qs{constructor(o){g(this,Tt);this.setTool=async e=>(await a(this,Tt)).setTool(e).then(s=>i(s)),this.getSelected=async()=>(await a(this,Tt)).getSelectedTool().then(t=>i(t)),this.setPointer=async()=>this.setTool(G.SELECT),this.setSelect=async()=>this.setTool(G.SELECT),this.setHand=async()=>this.setTool(G.HAND),this.setZoom=async()=>this.setTool(G.ZOOM),this.setTextFrame=async()=>this.setTool(G.TEXT_FRAME),this.setImageFrame=async()=>this.setTool(G.IMAGE_FRAME),this.setShapeRect=async()=>this.setTool(G.SHAPE_RECT),this.setShapeEllipse=async()=>this.setTool(G.SHAPE_ELLIPSE),this.setShapePolygon=async()=>this.setTool(G.SHAPE_POLYGON),this.setComponentGrid=async()=>this.setTool(G.COMPONENT_GRID_FRAME),y(this,Tt,o)}}Tt=new WeakMap;class Xs{constructor(o,e){g(this,X);g(this,q);g(this,te);this.undo=async()=>(await a(this,X)).undo().then(s=>i(s)),this.redo=async()=>(await a(this,X)).redo().then(s=>i(s)),this.addCustomData=async(t,s)=>(await a(this,X)).setCustomUndoData(t,s,!1).then(c=>i(c)),this.record=async(t,s)=>{try{await a(this,q).beginIfNoneActive(t),await s(a(this,te)),await a(this,q).end()}catch(r){throw await a(this,q).abort(),r}},this.pause=async()=>(await a(this,X)).pause().then(s=>i(s)),this.resume=async()=>(await a(this,X)).resume().then(s=>i(s)),this.clear=async()=>(await a(this,X)).clear().then(s=>i(s)),this.advanced={begin:async t=>a(this,q).begin(t),beginIfNoneActive:async t=>a(this,q).beginIfNoneActive(t),end:async()=>a(this,q).end(),abort:async()=>a(this,q).abort()},y(this,X,o),y(this,te,e),y(this,q,new Yr(o))}}X=new WeakMap,q=new WeakMap,te=new WeakMap;class Yr{constructor(o){g(this,lt);this.begin=async e=>(await a(this,lt)).begin(e).then(s=>i(s)),this.beginIfNoneActive=async e=>(await a(this,lt)).beginIfNoneActive(e).then(s=>i(s)),this.end=async()=>(await a(this,lt)).end().then(t=>i(t)),this.abort=async()=>(await a(this,lt)).abort().then(t=>i(t)),y(this,lt,o)}}lt=new WeakMap;var B=(n=>(n.info="info",n.warn="warn",n.error="error",n))(B||{}),ge=(n=>(n.general="general",n.connector="connector",n.event="event",n.engine="engine",n.sdk="sdk",n))(ge||{}),Mt=(n=>(n.throw="throw",n.log="log",n))(Mt||{});class tn extends Error{constructor(o){super(o)}}const Zr=(n,o=2)=>{const e=Math.pow(10,o);return Math.round(n*e)/e};class en{constructor(o,e){g(this,Bt);g(this,ee);this.round=(t,s)=>i({data:String(Zr(t,s)),success:!0,status:200,parsedData:null}),this.createEnvironmentBaseURL=t=>{const{type:s=ue.SANDBOX,environment:r="ft-nostress",version:c="1"}=t,d=s==ue.SANDBOX?"chili-publish-sandbox":"chili-publish";return`https://${r}.${d}.online/grafx/api/v${c}/environment/${r}`},this.stageFiles=async(t,s,r)=>{var A;const c=a(this,ee).get(Z.GraFxStudioEnvironmentApiUrl);if(!c)throw new Error("GraFx Studio Environment API URL is not set");const d=`${c}connectors/${s}/stage`,m=await(await a(this,Bt)).getConfigValue(Z.GraFxStudioAuthToken),p=(A=i(m))==null?void 0:A.parsedData;if(!p)throw new Error("GraFx Studio Auth Token is not set");const f=new FormData;t.forEach((v,E)=>{const O=v instanceof File?v.name:`blob-${E}`;f.append("files",v,O)}),r&&f.append("validationJson",JSON.stringify({allowedMimeTypes:r.mimeTypes,minDimensions:{width:r.minWidthPixels,height:r.minHeightPixels}}));const b=await fetch(d,{method:"POST",body:f,headers:{Authorization:`Bearer ${p}`}});if(b.status===422){const v=await b.json();throw new ds(v.message,fe.minDimension)}if(b.status===401){const v=await b.json();throw new tn(v.message)}if(!b.ok)throw new Error("Failed to stage files");return await b.json()},this.unitEvaluate=async(t,s)=>(await a(this,Bt)).unitEvaluate(t,s).then(c=>i(c)),y(this,Bt,o),y(this,ee,e)}}Bt=new WeakMap,ee=new WeakMap;const Qr=n=>n.type===Wt.dataSource,Xr=n=>{var o;return n?Qr(n)&&((o=n==null?void 0:n.value)==null?void 0:o.type)===ve.injected:!1};class ta{constructor(o){g(this,se);this.setMinimum=async(e,t)=>{const s={minValue:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setMaximum=async(e,t)=>{const s={maxValue:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setShowStepper=async(e,t)=>{const s={showStepper:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setStepSize=async(e,t)=>{const s={stepSize:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setThousandsSeparator=async(e,t)=>{const s={thousandsSeparator:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setDecimalSeparator=async(e,t)=>{const s={decimalSeparator:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setDecimalCharacterStyle=async(e,t)=>{const s={decimalCharacterStyleId:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setNumberOfDecimals=async(e,t)=>{const s={numberOfDecimals:{value:t}};return this.applyPropertiesUpdate(e,s)},y(this,se,o)}async applyPropertiesUpdate(o,e){const s=await(await a(this,se)).updateNumberVariableProperties(o,JSON.stringify(e));return i(s)}}se=new WeakMap;class ea{constructor(o){g(this,ne);this.setDisplayFormat=async(e,t)=>{const s={displayFormat:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setLocale=async(e,t)=>{const s={locale:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setStartDate=async(e,t)=>{const s={startDate:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setEndDate=async(e,t)=>{const s={endDate:{value:t}};return this.applyPropertiesUpdate(e,s)},this.setExcludedDays=async(e,t)=>{const s={excludedDays:{value:t}};return this.applyPropertiesUpdate(e,s)},y(this,ne,o)}async applyPropertiesUpdate(o,e){const s=await(await a(this,ne)).updateDateVariableProperties(o,JSON.stringify(e));return i(s)}}ne=new WeakMap;class sa{constructor(o,e){g(this,j);g(this,Jt);this.setValue=async(t,s)=>{const r=await a(this,j);let c;return Array.isArray(s)?c=s.map(d=>a(this,Jt).mapDataItemToEngine(d)):c=s,r.setVariableValue(t,c).then(d=>i(d))},this.getInjectedData=async t=>(await a(this,j)).getInjectedDataSourceVariableData(t).then(r=>i(r)).then(r=>{const c={...r,parsedData:null};return r.parsedData&&(c.parsedData={...r.parsedData,data:r.parsedData.data.map(d=>a(this,Jt).mapEngineToDataItem(d))}),c}),this.getInjectedItemById=async(t,s)=>{var p;const c=await(await a(this,j)).getVariableById(t).then(f=>i(f));Xr(c.parsedData)||mt({status:400,error:"Variable is not an injected data source variable"});const d=c.parsedData.value.itemIdPropertyName,m=(p=(await this.getInjectedData(t)).parsedData)==null?void 0:p.data.find(f=>{var b;return((b=f[d])==null?void 0:b.toString())===s.toString()});return m||mt({status:404,error:`Item not found in injected data for variable ${t}`}),{success:!0,status:200,parsedData:{data:m,continuationToken:null,previousPageToken:null}}},this.setInjectedModel=async(t,s)=>{const r=s.properties,c=s.itemIdPropertyName;return(await a(this,j)).setInjectedDataSourceVariableModel(t,JSON.stringify(r),c).then(l=>i(l))},this.setSourceType=async(t,s)=>(await a(this,j)).setDataSourceVariableSourceType(t,s).then(c=>i(c)),this.setConnector=async(t,s)=>{const r=await a(this,j),d=new de().makeConnectorSourceForwardsCompatible(s);return r.setDataSourceVariableConnector(t,JSON.stringify(d)).then(l=>i(l))},this.removeConnector=async t=>(await a(this,j)).setDataSourceVariableConnector(t,null).then(r=>i(r)),y(this,j,o),y(this,Jt,e)}async setDisplayOptions(o,e,t){return(await a(this,j)).setDataSourceVariableDisplayOptions(o,e,t??void 0).then(r=>i(r))}}j=new WeakMap,Jt=new WeakMap;let sn=(jn=class{constructor(o,e){g(this,w);g(this,Ut);g(this,Gt);g(this,_t);this.getAll=async()=>(await a(this,w)).getVariables().then(s=>i(s)).then(s=>{const r=s;return r.parsedData&&(r.parsedData=this.makeVariablesBackwardsCompatible(r.parsedData)),r}),this.getById=async t=>(await a(this,w)).getVariableById(t).then(r=>i(r)).then(r=>{const c=r;return c.parsedData&&(c.parsedData=this.makeVariableBackwardsCompatible(c.parsedData)),c}),this.getByName=async t=>(await a(this,w)).getVariableByName(t).then(r=>i(r)).then(r=>{const c=r;return c.parsedData&&(c.parsedData=this.makeVariableBackwardsCompatible(c.parsedData)),c}),this.create=async(t,s)=>(await a(this,w)).addVariable(t,s).then(c=>i(c)),this.remove=async t=>(await a(this,w)).removeVariables(t).then(r=>i(r)),this.rename=async(t,s)=>(await a(this,w)).setVariableName(t,s).then(c=>i(c)),this.setLabel=async(t,s)=>(await a(this,w)).setVariableLabel(t,s).then(c=>i(c)),y(this,Ut,async(t,s)=>(await a(this,w)).setVariablePlaceholder(t,s).then(c=>i(c))),this.setPlaceholder=async(t,s)=>a(this,Ut).call(this,t,s),this.resetPlaceholder=async t=>a(this,Ut).call(this,t,null),y(this,Gt,async(t,s)=>(await a(this,w)).setVariableHelpText(t,s).then(c=>i(c))),this.setHelpText=async(t,s)=>a(this,Gt).call(this,t,s),this.resetHelpText=async t=>a(this,Gt).call(this,t,null),y(this,_t,async(t,s)=>(await a(this,w)).setVariableDescription(t,s).then(c=>i(c))),this.setDescription=async(t,s)=>a(this,_t).call(this,t,s),this.resetDescription=async t=>a(this,_t).call(this,t,null),this.setType=async(t,s)=>(await a(this,w)).setVariableType(t,s).then(c=>i(c)),this.setRuleSetId=async(t,s)=>(await a(this,w)).setVariableRuleSetId(t,s).then(c=>i(c)),this.setListVariable=async(t,s)=>(await a(this,w)).setListVariableItems(t,s.map(c=>JSON.stringify({value:c}))).then(c=>i(c)),this.setValue=async(t,s)=>(await a(this,w)).setVariableValue(t,s).then(c=>i(c,d=>Jr(d,{id:t}))),this.duplicate=async t=>(await a(this,w)).duplicateVariable(t).then(r=>i(r)),this.groupVariables=async(t,s)=>(await a(this,w)).groupVariables(t,s).then(c=>i(c)),this.ungroupVariables=async t=>(await a(this,w)).ungroupVariable(t).then(r=>i(r)),this.move=async(t,s,r)=>(await a(this,w)).moveVariable(s,r,t).then(d=>i(d)),this.moveVariables=async(t,s,r)=>(await a(this,w)).moveVariables(s,r,t).then(d=>i(d)),this.setIsVisible=async(t,s)=>{const r=s?{type:Nt.visible}:{type:Nt.invisible};return this.setVariableVisibility(t,r)},this.setIsHidden=async(t,s)=>{const r=s?{type:Nt.invisible}:{type:Nt.visible};return this.setVariableVisibility(t,r)},this.setVariableVisibility=async(t,s)=>(await a(this,w)).setVariableVisibility(t,JSON.stringify(s)).then(c=>i(c)),this.setLayoutsForVariableVisibility=async t=>(await a(this,w)).setLayoutsForVariableVisibility(t?JSON.stringify(t):null).then(r=>i(r)),this.setIsRequired=async(t,s)=>(await a(this,w)).setVariableIsRequired(t,s).then(c=>i(c)),this.setRemoveParagraphIfEmpty=async(t,s)=>(await a(this,w)).setVariableRemoveParagraphIfEmpty(t,s).then(c=>i(c)),this.setVariableCharacterLimit=async(t,s)=>(await a(this,w)).setVariableCharacterLimit(t,s).then(c=>i(c)),this.setIsReadonly=async(t,s)=>(await a(this,w)).setVariableIsReadonly(t,s).then(c=>i(c)),this.getImageVariableConnectorId=async t=>(await a(this,w)).getImageVariableConnectorId(t).then(r=>i(r)),this.setImageVariableConnector=async(t,s)=>{const r=await a(this,w),d=new de().makeConnectorSourceForwardsCompatible(s);return r.setImageVariableConnector(t,JSON.stringify(d)).then(l=>i(l))},this.setImageVariableValueWithContext=async(t,s,r)=>(await a(this,w)).setImageVariableValueWithContext(t,s,JSON.stringify(r)).then(d=>i(d)),this.removeSource=async t=>this.setValue(t,null),this.setPrefix=async(t,s)=>{const r={prefix:{value:s}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffix=async(t,s)=>{const r={suffix:{value:s}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrefixCharacterStyle=async(t,s)=>{const r={prefixCharacterStyleId:{value:s}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setSuffixCharacterStyle=async(t,s)=>{const r={suffixCharacterStyleId:{value:s}};return this.applyPrefixSuffixDeltaUpdate(t,r)},this.setPrivateData=async(t,s)=>(await a(this,w)).setVariablePrivateData(t,JSON.stringify(s)).then(c=>i(c)),this.getPrivateData=async t=>(await a(this,w)).getVariablePrivateData(t).then(r=>i(r)),this.setAllowImageQuery=async(t,s)=>(await a(this,w)).setImageVariableAllowQuery(t,s).then(c=>i(c)),this.setAllowImageUpload=async(t,s)=>(await a(this,w)).setImageVariableAllowUpload(t,s).then(c=>i(c)),this.setMinImageUploadSize=async(t,s,r)=>(await a(this,w)).setImageVariableUploadMinSize(t,s,r).then(d=>i(d)),this.setIsDontBreak=async(t,s)=>(await a(this,w)).setVariableIsDontBreak(t,s).then(c=>i(c)),this.highlightUsages=async t=>(await a(this,w)).highlightVariableUsages(t).then(r=>i(r)),this.setRichTextRules=async t=>(await a(this,w)).setRichTextRulesets(JSON.stringify(t)).then(r=>i(r)),y(this,w,o),this.number=new ta(a(this,w)),this.date=new ea(a(this,w)),this.dataSource=new sa(a(this,w),e)}makeVariablesBackwardsCompatible(o){return o.map(e=>this.makeVariableBackwardsCompatible(e))}makeVariableBackwardsCompatible(o){return o.type!==Wt.list?o:this.makeListVariableBackwardsCompatible(o)}makeListVariableBackwardsCompatible(o){const e=o,t=o.items,s=o.selected,r=t.map(c=>c.value);return e.items=r,e.selected=s==null?void 0:s.value,e}async applyPrefixSuffixDeltaUpdate(o,e){const s=await(await a(this,w)).updateVariablePrefixSuffixProperties(o,JSON.stringify(e));return i(s)}},w=new WeakMap,Ut=new WeakMap,Gt=new WeakMap,_t=new WeakMap,jn);class na{constructor(o){this.onVariableListChanged=e=>{this.config.events.onVariableListChanged.trigger(JSON.parse(e))},this.onConnectorsChanged=e=>{this.config.events.onConnectorsChanged.trigger(JSON.parse(e))},this.onPageSizeChanged=e=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(e))},this.onEngineEditModeChanged=e=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(e))},this.config=o}}class ra{constructor(o){g(this,ut);this.getAll=async()=>(await a(this,ut)).getVariables().then(t=>i(t)),this.getById=async e=>(await a(this,ut)).getVariableById(e).then(s=>i(s)),this.getByName=async e=>(await a(this,ut)).getVariableByName(e).then(s=>i(s)),this.setListVariable=async(e,t)=>(await a(this,ut)).setListVariableItems(e,t.map(r=>JSON.stringify(r))).then(r=>i(r)),y(this,ut,o),this.image=new aa(o),this.dataSource=new ia(o)}}ut=new WeakMap;class aa{constructor(o){g(this,nt);this.setAllowQuery=async(e,t)=>(await a(this,nt)).setImageVariableAllowQuery(e,t).then(r=>i(r)),this.setAllowUpload=async(e,t)=>(await a(this,nt)).setImageVariableAllowUpload(e,t).then(r=>i(r)),this.setMinUploadSize=async(e,t,s)=>(await a(this,nt)).setImageVariableUploadMinSize(e,t,s).then(c=>i(c)),this.setConnector=async(e,t)=>(await a(this,nt)).setImageVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),this.setConnectorContext=async(e,t)=>(await a(this,nt)).setImageVariableConnectorContext(e,JSON.stringify(t)).then(r=>i(r)),y(this,nt,o)}}nt=new WeakMap;class ia{constructor(o){g(this,re);this.setConnector=async(e,t)=>(await a(this,re)).setDataSourceVariableConnector(e,JSON.stringify(t)).then(r=>i(r)),y(this,re,o)}}re=new WeakMap;class oa{constructor(o){g(this,At);this.register=async e=>(await a(this,At)).registerConnector(JSON.stringify(e)).then(s=>i(s)),this.getById=async e=>(await a(this,At)).getConnectorById(e).then(s=>i(s)),this.getAllByType=async e=>(await a(this,At)).getConnectors(e).then(s=>i(s)),y(this,At,o)}}At=new WeakMap;class ca{constructor(o){g(this,Ht);g(this,ye);this.setWidth=async e=>(await a(this,Ht)).setPageWidth(e).then(s=>i(s)),this.setHeight=async e=>(await a(this,Ht)).setPageHeight(e).then(s=>i(s)),y(this,Ht,o),y(this,ye,o)}}Ht=new WeakMap,ye=new WeakMap;class nn{constructor(o,e,t){this.config=o,this.connection=e,this.editorAPI=t,this.subscriber=new na(o),this.variable=new ra(this.editorAPI),this.connector=new oa(this.editorAPI),this.page=new ca(this.editorAPI),this.canvas=new Ce(this.editorAPI)}}class Ae{constructor(o){this.logger=o}getLogCategory(){return ge.event}createEventHandlerFn(o,e){return(...s)=>{try{const r=o(...s);return r instanceof Promise?r.catch(c=>this.handleError(c,e,o.name)):r}catch(r){this.handleError(r,e,o.name)}}}handleError(o,e,t){var s;if(e===Mt.log)(s=this.logger)==null||s.call(this,B.error,this.getLogCategory(),`Error in callback ${t}: ${o}`);else throw o}}class rn extends Ae{constructor(o,e){super(e),this.handler=o}trigger(...o){const e=this.handler();if(e)return this.createEventHandlerFn(e,Mt.throw)(...o)}}class C extends Ae{constructor(o,e){super(e),this.legacyHandler=o,this.subscriptions=new Set}trigger(...o){const e=this.legacyHandler();e&&this.createEventHandlerFn(e,Mt.log)(...o);for(const t of this.subscriptions)t(...o)}registerCallback(o,e=Mt.log){const t=this.createEventHandlerFn(o,e);return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}}class Pe{static createRuntimeConfig(o){var t,s,r,c,d,l,m,p,f,b,I,A,v,E,O,M,P,U,rt,$t,jt,zn,Wn,Kn,qn,Yn,Zn,Qn,Xn,tr,er,sr,nr,rr,ar;const e={...o};return e.logging={logLevel:((t=o.logging)==null?void 0:t.logLevel)||B.error,logger:((s=o.logging)==null?void 0:s.logger)||((ie,Ee,Fe)=>{var ir;if(Pe.isLoggingEnabled(ie,((ir=e.logging)==null?void 0:ir.logLevel)??B.error))switch(ie){case B.error:console.error(`[${Ee}] [${ie}] ${Fe}`);break;case B.warn:console.warn(`[${Ee}] [${ie}] ${Fe}`);break;default:console.log(`[${Ee}] [${ie}] ${Fe}`)}})},e.handlers={onAuthExpired:new rn(()=>e.onAuthExpired,(r=e.logging)==null?void 0:r.logger),onViewportRequested:new rn(()=>e.onViewportRequested,(c=e.logging)==null?void 0:c.logger)},e.events={onActionsChanged:new C(()=>e.onActionsChanged,(d=e.logging)==null?void 0:d.logger),onStateChanged:new C(()=>e.onStateChanged,(l=e.logging)==null?void 0:l.logger),onDocumentLoaded:new C(()=>e.onDocumentLoaded,(m=e.logging)==null?void 0:m.logger),onSelectedFramesLayoutChanged:new C(()=>e.onSelectedFramesLayoutChanged,(p=e.logging)==null?void 0:p.logger),onFramesLayoutChanged:new C(()=>e.onFramesLayoutChanged,(f=e.logging)==null?void 0:f.logger),onSelectedFramesContentChanged:new C(()=>e.onSelectedFramesContentChanged,(b=e.logging)==null?void 0:b.logger),onPageSelectionChanged:new C(()=>e.onPageSelectionChanged,(I=e.logging)==null?void 0:I.logger),onSelectedLayoutPropertiesChanged:new C(()=>e.onSelectedLayoutPropertiesChanged,(A=e.logging)==null?void 0:A.logger),onSelectedLayoutUnitChanged:new C(()=>e.onSelectedLayoutUnitChanged,(v=e.logging)==null?void 0:v.logger),onScrubberPositionChanged:new C(()=>e.onScrubberPositionChanged,(E=e.logging)==null?void 0:E.logger),onFrameAnimationsChanged:new C(()=>e.onFrameAnimationsChanged,(O=e.logging)==null?void 0:O.logger),onVariableListChanged:new C(()=>e.onVariableListChanged,(M=e.logging)==null?void 0:M.logger),onSelectedToolChanged:new C(()=>e.onSelectedToolChanged,(P=e.logging)==null?void 0:P.logger),onUndoStackStateChanged:new C(()=>e.onUndoStackStateChanged,(U=e.logging)==null?void 0:U.logger),onSelectedLayoutFramesChanged:new C(()=>e.onSelectedLayoutFramesChanged,(rt=e.logging)==null?void 0:rt.logger),onSelectedTextStyleChanged:new C(()=>e.onSelectedTextStyleChanged,($t=e.logging)==null?void 0:$t.logger),onColorsChanged:new C(()=>e.onColorsChanged,(jt=e.logging)==null?void 0:jt.logger),onParagraphStylesChanged:new C(()=>e.onParagraphStylesChanged,(zn=e.logging)==null?void 0:zn.logger),onCharacterStylesChanged:new C(()=>e.onCharacterStylesChanged,(Wn=e.logging)==null?void 0:Wn.logger),onFontFamiliesChanged:new C(()=>e.onFontFamiliesChanged,(Kn=e.logging)==null?void 0:Kn.logger),onSelectedLayoutIdChanged:new C(()=>e.onSelectedLayoutIdChanged,(qn=e.logging)==null?void 0:qn.logger),onLayoutsChanged:new C(()=>e.onLayoutsChanged,(Yn=e.logging)==null?void 0:Yn.logger),onConnectorEvent:new C(()=>e.onConnectorEvent,(Zn=e.logging)==null?void 0:Zn.logger),onConnectorsChanged:new C(()=>e.onConnectorsChanged,(Qn=e.logging)==null?void 0:Qn.logger),onZoomChanged:new C(()=>e.onZoomChanged,(Xn=e.logging)==null?void 0:Xn.logger),onSelectedPageIdChanged:new C(()=>e.onSelectedPageIdChanged,e.logging.logger),onPagesChanged:new C(()=>e.onPagesChanged,e.logging.logger),onPageSnapshotInvalidated:new C(()=>e.onPageSnapshotInvalidated,e.logging.logger),onPageSizeChanged:new C(()=>e.onPageSizeChanged,(tr=e.logging)==null?void 0:tr.logger),onShapeCornerRadiusChanged:new C(()=>e.onShapeCornerRadiusChanged,(er=e.logging)==null?void 0:er.logger),onCropActiveFrameIdChanged:new C(()=>e.onCropActiveFrameIdChanged,(sr=e.logging)==null?void 0:sr.logger),onAsyncError:new C(()=>e.onAsyncError,(nr=e.logging)==null?void 0:nr.logger),onViewModeChanged:new C(()=>e.onViewModeChanged,(rr=e.logging)==null?void 0:rr.logger),onBarcodeValidationChanged:new C(()=>e.onBarcodeValidationChanged,(ar=e.logging)==null?void 0:ar.logger),onDataSourceIdChanged:new C(()=>e.onDataSourceIdChanged,e.logging.logger),onInjectedDataChanged:new C(()=>e.onInjectedDataChanged,e.logging.logger),onDocumentIssueListChanged:new C(()=>e.onDocumentIssueListChanged,e.logging.logger),onCustomUndoDataChanged:new C(()=>e.onCustomUndoDataChanged,e.logging.logger),onEngineEditModeChanged:new C(()=>e.onEngineEditModeChanged,e.logging.logger),onBrandKitMediaChanged:new C(()=>e.onBrandKitMediaChanged,e.logging.logger),onCanvasFramesManipulated:new C(()=>e.onCanvasFramesManipulated,e.logging.logger)},e}static isLoggingEnabled(o,e){return e==B.info||e==B.warn&&(o==B.warn||o==B.error)?!0:e==B.error&&o==B.error}}class ha{isDatePropertyWrapper(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&"type"in o&&o.type==="date"&&"chiliReservedTag"in o&&o.chiliReservedTag==="date"}isDateObject(o){return o instanceof Date}mapEngineToDataItem(o){const e={};return Object.entries(o).forEach(([t,s])=>{e[t]=this.isDatePropertyWrapper(s)?new Date(s.value):s}),e}mapDataItemToEngine(o){const e={};return Object.entries(o).forEach(([t,s])=>{e[t]=this.isDateObject(s)?{value:s.getTime(),type:"date",chiliReservedTag:"date"}:s}),e}}class da{constructor(o){g(this,gt);y(this,gt,o)}async getValue(o){return(await a(this,gt)).getConfigValue(o).then(t=>i(t))}async setValue(o,e){return(await a(this,gt)).setConfigValue(o,e).then(s=>i(s))}async updateStudioOptions(o){return(await a(this,gt)).updateStudioOptions(JSON.stringify(o)).then(t=>i(t))}async getEngineSessionId(){return(await a(this,gt)).getEngineSessionId().then(e=>i(e))}getLatestSmartCropVersion(){return Wr}}gt=new WeakMap;class an extends da{constructor(e,t){super(e);g(this,xt);y(this,xt,t)}async getValue(e){const t=a(this,xt).get(e);return t!=null?i({status:200,success:!0,parsedData:t,data:t},!1):super.getValue(e)}async setValue(e,t){const s=super.setValue(e,t);return a(this,xt).set(e,t),s}}xt=new WeakMap;class on{constructor(o){g(this,z);this.getAll=async()=>(await a(this,z)).getGradients().then(t=>i(t)),this.getById=async e=>(await a(this,z)).getGradientById(e).then(s=>i(s)),this.create=async()=>(await a(this,z)).createGradient().then(t=>i(t)),this.duplicate=async e=>(await a(this,z)).duplicateGradient(e).then(s=>i(s)),this.move=async(e,t)=>(await a(this,z)).moveGradients(e,t).then(r=>i(r)),this.rename=async(e,t)=>(await a(this,z)).renameGradient(e,t).then(r=>i(r)),this.update=async(e,t)=>{const s=await a(this,z),r=t;return s.updateGradient(e,JSON.stringify(r)).then(c=>i(c))},this.remove=async e=>(await a(this,z)).removeGradient(e).then(s=>i(s)),y(this,z,o)}}z=new WeakMap;class cn{constructor(o){g(this,Pt);g(this,ae);this.query=async(e,t,s={})=>(await a(this,Pt)).componentConnectorQuery(e,JSON.stringify(t),JSON.stringify(s)).then(c=>i(c)),this.preview=async(e,t,s,r={})=>(await a(this,ae)).componentConnectorPreview(e,t,s,JSON.stringify(r)).then(d=>{if(d instanceof Uint8Array)return d;throw typeof d=="object"&&d!==null&&"success"in d&&!d.success&&mt(d),new Error(`Unexpected response type: ${typeof d}.`)}),this.getConfigurationOptions=async e=>(await a(this,Pt)).componentConnectorGetConfigurationOptions(e).then(s=>i(s)),this.getCapabilities=async e=>(await a(this,Pt)).componentConnectorGetCapabilities(e).then(s=>i(s)),y(this,Pt,o),y(this,ae,o)}}Pt=new WeakMap,ae=new WeakMap;class hn{constructor(o){g(this,yt);this.linkVariable=async(e,t,s,r)=>(await a(this,yt)).linkComponentVariable(e,t,s,r??null).then(d=>i(d)),this.getComponentVariables=async e=>(await a(this,yt)).getComponentVariables(e).then(s=>i(s)),this.setFitMode=async(e,t)=>(await a(this,yt)).setComponentLayoutFit(e,t).then(r=>i(r)),this.resetFitMode=async e=>(await a(this,yt)).resetComponentLayoutFit(e).then(s=>i(s)),y(this,yt,o)}}yt=new WeakMap;class dn{constructor(o){g(this,tt);this.updateSettings=async(e,t)=>(await a(this,tt)).updateComponentGridSettings(e,JSON.stringify(t)).then(r=>i(r)),this.setMapping=async(e,t,s,r,c)=>(await a(this,tt)).setComponentGridMapping(e,t,s,r,c).then(l=>i(l)),this.resetSettings=async e=>(await a(this,tt)).resetComponentGridSettings(e).then(s=>i(s)),this.setComponentSource=async(e,t)=>(await a(this,tt)).setComponentGridComponentSource(e,t?JSON.stringify(t):null).then(r=>i(r)),this.setDataSourceVariable=async(e,t)=>(await a(this,tt)).setComponentGridDataSourceVariable(e,t).then(r=>i(r)),this.setResizeMode=async(e,t)=>(await a(this,tt)).setComponentGridResizeMode(e,t).then(r=>i(r)),y(this,tt,o)}}tt=new WeakMap;const la=()=>{};class ua{constructor(){this.listeners=new Map}add(o,e){if(typeof e!="function")return la;const t=this.listeners.get(o)??new Set;return t.add(e),this.listeners.set(o,t),()=>{this.remove(o,e)}}remove(o,e){const t=this.listeners.get(o);t&&(t.delete(e),t.size===0&&this.listeners.delete(o))}getListeners(o){return[...this.listeners.get(o)??[]]}}const ga=n=>!n||typeof n!="object"?!1:typeof n.then=="function",ya=n=>!(!n||typeof n!="object"||Array.isArray(n)),ln=(n,o,e)=>{e==null||e(B.error,ge.sdk,`Error in method listener for ${n}: ${String(o)}`)},Kt=(n,o,e,t,s)=>{for(const r of e.getListeners(n))try{r(o)}catch(c){ln(n,c,s)}try{o.phase==="invoke"?t.onMethodInvoked.trigger(o):t.onMethodCompleted.trigger(o)}catch(r){ln(n,r,s)}};function un(n,o,e,t,s){const r=new Map,c=new Map;return new Proxy(n,{get(d,l,m){const p=Reflect.get(d,l,m);if(typeof l=="symbol")return p;if(typeof p=="function"){if(r.has(l))return r.get(l);const f=`${o}.${String(l)}`,b=o.split(".")[0]||o,I=String(l),A=((...v)=>{const E={phase:"invoke",path:f,controller:b,method:I,args:[...v]};Kt(f,E,e,t,s);try{const O=p.apply(d,v);if(ga(O))return O.then(P=>{const U={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!0,result:P};return Kt(f,U,e,t,s),P}).catch(P=>{const U={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!1,error:P};throw Kt(f,U,e,t,s),P});const M={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!0,result:O};return Kt(f,M,e,t,s),O}catch(O){const M={phase:"complete",path:f,controller:b,method:I,args:[...v],success:!1,error:O};throw Kt(f,M,e,t,s),O}});return A.addEventListener=v=>e.add(f,v),A.removeEventListener=v=>{e.remove(f,v)},r.set(l,A),A}if(ya(p)){if(c.has(l))return c.get(l);const f=`${o}.${String(l)}`,b=un(p,f,e,t,s);return c.set(l,b),b}return p}})}class gn extends Ae{constructor(o){super(o),this.subscriptions=new Set}getLogCategory(){return ge.sdk}trigger(...o){const e=Array.from(this.subscriptions);for(const t of e)t(...o)}registerCallback(o,e=Mt.log){const t=this.createEventHandlerFn(o,e);return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}}class pa{constructor(o){this.onMethodInvoked=new gn(o),this.onMethodCompleted=new gn(o)}}const ma=`https://studio-cdn.chiligrafx.com/editor/${T.current}/web`,yn=Symbol("pendingInstrumentation"),wa=n=>{Object.defineProperty(n,yn,{value:!0,enumerable:!1,configurable:!0})},Ca=n=>typeof n=="object"&&n!==null&&n[yn]===!0;class fa{constructor(o){var e,t;this.localConfig=new Map,this.dataItemMappingTools=new ha,this.methodListeners=new ua,this.teardownFrame=null,this.loadEditor=()=>{var s,r,c;(s=this.teardownFrame)==null||s.call(this),this.teardownFrame=Rr(this.config.editorLink||ma,{onActionsChanged:this.subscriber.onActionsChanged,onStateChanged:this.subscriber.onStateChanged,onAuthExpired:this.subscriber.onAuthExpired,onViewportRequested:this.subscriber.onViewportRequested,onDocumentLoaded:this.subscriber.onDocumentLoaded,onSelectedFramesContentChanged:this.subscriber.onSelectedFramesContentChanged,onSelectedFramesLayoutChanged:this.subscriber.onSelectedFramesLayoutChanged,onFramesLayoutChanged:this.subscriber.onFramesLayoutChanged,onSelectedLayoutPropertiesChanged:this.subscriber.onSelectedLayoutPropertiesChanged,onSelectedLayoutUnitChanged:this.subscriber.onSelectedLayoutUnitChanged,onPageSelectionChanged:this.subscriber.onPageSelectionChanged,onScrubberPositionChanged:this.subscriber.onAnimationPlaybackChanged,onFrameAnimationsChanged:this.subscriber.onAnimationChanged,onVariableListChanged:d=>{var l;(l=this.enabledNextSubscribers)!=null&&l.onVariableListChanged?this.next.subscriber.onVariableListChanged(d):this.subscriber.onVariableListChanged(d)},onSelectedToolChanged:this.subscriber.onSelectedToolChanged,onUndoStateChanged:this.subscriber.onUndoStateChanged,onSelectedLayoutFramesChanged:this.subscriber.onSelectedLayoutFramesChanged,onSelectedTextStyleChanged:this.subscriber.onSelectedTextStyleChanged,onColorsChanged:this.subscriber.onColorsChanged,onParagraphStylesChanged:this.subscriber.onParagraphStylesChanged,onCharacterStylesChanged:this.subscriber.onCharacterStylesChanged,onFontFamiliesChanged:this.subscriber.onFontFamiliesChanged,onSelectedLayoutIdChanged:this.subscriber.onSelectedLayoutIdChanged,onLayoutsChanged:this.subscriber.onLayoutsChanged,onConnectorEvent:this.subscriber.onConnectorEvent,onConnectorsChanged:d=>{var l;(l=this.enabledNextSubscribers)!=null&&l.onConnectorsChanged?this.next.subscriber.onConnectorsChanged(d):this.subscriber.onConnectorsChanged(d)},onZoomChanged:this.subscriber.onZoomChanged,onSelectedPageIdChanged:this.subscriber.onSelectedPageIdChanged,onPagesChanged:this.subscriber.onPagesChanged,onPageSnapshotInvalidated:this.subscriber.onPageSnapshotInvalidated,onPageSizeChanged:d=>{var l;(l=this.enabledNextSubscribers)!=null&&l.onPageSizeChanged?this.next.subscriber.onPageSizeChanged(d):this.subscriber.onPageSizeChanged(d)},onShapeCornerRadiusChanged:this.subscriber.onShapeCornerRadiusChanged,onCropActiveFrameIdChanged:this.subscriber.onCropActiveFrameIdChanged,onAsyncError:this.subscriber.onAsyncError,onViewModeChanged:this.subscriber.onViewModeChanged,onBarcodeValidationChanged:this.subscriber.onBarcodeValidationChanged,onDataSourceIdChanged:this.subscriber.onDataSourceIdChanged,onInjectedDataChanged:this.subscriber.onInjectedDataChanged,onDocumentIssueListChanged:this.subscriber.onDocumentIssueListChanged,onCustomUndoDataChanged:this.subscriber.onCustomUndoDataChanged,onEngineEditModeChanged:this.subscriber.onEngineEditModeChanged,onBrandKitMediaChanged:this.subscriber.onBrandKitMediaChanged,onCanvasFramesManipulated:this.subscriber.onCanvasFramesManipulated},this.setConnection,this.config.editorId,this.config.studioStyling,d=>{var l,m;(m=(l=this.config).onConnectionError)==null||m.call(l,d)}),this.editorAPI=(r=this.connection)==null?void 0:r.promise.then(d=>d),this.action=this.toInstrumented(new Ue(this.editorAPI)),this.layout=this.toInstrumented(new Us(this.editorAPI)),this.frame=this.toInstrumented(new Bs(this.editorAPI)),this.barcode=this.toInstrumented(new ze(this.editorAPI)),this.component=this.toInstrumented(new hn(this.editorAPI)),this.animation=this.toInstrumented(new Ge(this.editorAPI)),this.document=this.toInstrumented(new ms(this.editorAPI)),this.configuration=this.toInstrumented(new an(this.editorAPI,this.localConfig)),this.utils=this.toInstrumented(new en(this.editorAPI,this.localConfig)),this.tool=this.toInstrumented(new Qs(this.editorAPI)),this.page=this.toInstrumented(new _s(this.editorAPI)),this.debug=this.toInstrumented(new ps(this.editorAPI)),this.undoManager=this.toInstrumented(new Xs(this.editorAPI,this)),this.textSelection=this.toInstrumented(new Ks(this.editorAPI)),this.colorStyle=this.toInstrumented(new Xe(this.editorAPI)),this.gradientStyle=this.toInstrumented(new on(this.editorAPI)),this.paragraphStyle=this.toInstrumented(new Hs(this.editorAPI)),this.characterStyle=this.toInstrumented(new Ke(this.editorAPI)),this.mediaConnector=this.toInstrumented(new Gs(this.editorAPI)),this.fontConnector=this.toInstrumented(new ks(this.editorAPI)),this.componentConnector=this.toInstrumented(new cn(this.editorAPI)),this.dataConnector=this.toInstrumented(new gs(this.editorAPI,this.dataItemMappingTools)),this.dataSource=this.toInstrumented(new ys(this.editorAPI,this.dataItemMappingTools)),this.connector=this.toInstrumented(new us(this.editorAPI,this.localConfig)),this.variable=this.toInstrumented(new sn(this.editorAPI,this.dataItemMappingTools)),this.font=this.toInstrumented(new Ts(this.editorAPI)),this.experiment=this.toInstrumented(new Vs(this.editorAPI)),this.canvas=this.toInstrumented(new Ce(this.editorAPI)),this.shape=this.toInstrumented(new be(this.editorAPI)),this.colorConversion=this.toInstrumented(new Ye(this.editorAPI)),this.info=this.toInstrumented(new Js),this.clipboard=this.toInstrumented(new qe(this.editorAPI)),this.brandKit=this.toInstrumented(new We(this.editorAPI,this)),this.componentGrid=this.toInstrumented(new dn(this.editorAPI)),this.next=new nn(this.config,this.connection,this.editorAPI),this.applyMethodInstrumentation(),this.configuration.setValue(Z.GraFxStudioSdkVersion,Oe.version),this.configuration.setValue(Z.GraFxStudioDocumentType,this.config.documentType||we.template),this.configuration.updateStudioOptions(this.config.studioOptions||Vr),this.configuration.setValue(Z.QueryCallCacheEnabled,((c=this.config.enableQueryCallCache)==null?void 0:c.toString())||"false")},this.setConnection=s=>{this.connection=s},this.destroy=()=>{var s,r;try{(s=this.connection)==null||s.destroy()}catch{}(r=this.teardownFrame)==null||r.call(this),this.teardownFrame=null},this.toInstrumented=s=>(wa(s),s),this.applyMethodInstrumentation=()=>{var r;const s=this;for(const c of Object.keys(s)){const d=s[c];Ca(d)&&(s[c]=un(d,c,this.methodListeners,this.sdkEvents,(r=this.config.logging)==null?void 0:r.logger))}},this.config=Pe.createRuntimeConfig(o),this.sdkEvents=new pa((e=this.config.logging)==null?void 0:e.logger),this.editorAPI=(t=this.connection)==null?void 0:t.promise.then(s=>s),this.action=this.toInstrumented(new Ue(this.editorAPI)),this.layout=this.toInstrumented(new Us(this.editorAPI)),this.frame=this.toInstrumented(new Bs(this.editorAPI)),this.shape=this.toInstrumented(new be(this.editorAPI)),this.barcode=this.toInstrumented(new ze(this.editorAPI)),this.component=this.toInstrumented(new hn(this.editorAPI)),this.undoManager=this.toInstrumented(new Xs(this.editorAPI,this)),this.connector=this.toInstrumented(new us(this.editorAPI,this.localConfig)),this.mediaConnector=this.toInstrumented(new Gs(this.editorAPI)),this.fontConnector=this.toInstrumented(new ks(this.editorAPI)),this.componentConnector=this.toInstrumented(new cn(this.editorAPI)),this.dataConnector=this.toInstrumented(new gs(this.editorAPI,this.dataItemMappingTools)),this.dataSource=this.toInstrumented(new ys(this.editorAPI,this.dataItemMappingTools)),this.animation=this.toInstrumented(new Ge(this.editorAPI)),this.document=this.toInstrumented(new ms(this.editorAPI)),this.configuration=this.toInstrumented(new an(this.editorAPI,this.localConfig)),this.variable=this.toInstrumented(new sn(this.editorAPI,this.dataItemMappingTools)),this.utils=this.toInstrumented(new en(this.editorAPI,this.localConfig)),this.subscriber=new qr(this.config,this.localConfig),this.tool=this.toInstrumented(new Qs(this.editorAPI)),this.page=this.toInstrumented(new _s(this.editorAPI)),this.debug=this.toInstrumented(new ps(this.editorAPI)),this.textSelection=this.toInstrumented(new Ks(this.editorAPI)),this.colorStyle=this.toInstrumented(new Xe(this.editorAPI)),this.gradientStyle=this.toInstrumented(new on(this.editorAPI)),this.paragraphStyle=this.toInstrumented(new Hs(this.editorAPI)),this.characterStyle=this.toInstrumented(new Ke(this.editorAPI)),this.font=this.toInstrumented(new Ts(this.editorAPI)),this.experiment=this.toInstrumented(new Vs(this.editorAPI)),this.canvas=this.toInstrumented(new Ce(this.editorAPI)),this.colorConversion=this.toInstrumented(new Ye(this.editorAPI)),this.info=this.toInstrumented(new Js),this.clipboard=this.toInstrumented(new qe(this.editorAPI)),this.next=new nn(this.config,this.connection,this.editorAPI),this.enabledNextSubscribers=this.config.enableNextSubscribers,this.brandKit=this.toInstrumented(new We(this.editorAPI,this)),this.componentGrid=this.toInstrumented(new dn(this.editorAPI)),this.applyMethodInstrumentation()}}var pn=(n=>(n.top="top",n.left="left",n.right="right",n.bottom="bottom",n.topLeft="topLeft",n.topRight="topRight",n.bottomLeft="bottomLeft",n.bottomRight="bottomRight",n))(pn||{}),mn=(n=>(n.horizontal="horizontal",n.vertical="vertical",n))(mn||{}),wn=(n=>(n.easeIn="easeIn",n.easeOut="easeOut",n.easeInOut="easeInOut",n))(wn||{}),Cn=(n=>(n.quadratic="Quadratic",n.cubic="Cubic",n.quartic="Quartic",n.quintic="Quintic",n.sine="Sine",n.exponential="Exponential",n.circular="Circular",n.elastic="Elastic",n.bounce="Bounce",n.back="Back",n))(Cn||{}),fn=(n=>(n.bounce="bounce",n.flash="flash",n.headshake="headShake",n.heartbeat="heartbeat",n.pulse="pulse",n.rubberBand="rubberBand",n.vertical="vertical",n.horizontal="horizontal",n.swing="swing",n.tada="tada",n))(fn||{}),Sn=(n=>(n.preview="preview",n.normal="normal",n))(Sn||{}),bn=(n=>(n.linear="linear",n))(bn||{}),In=(n=>(n.local="linearLocal",n.linearBrandKit="linearBrandKit",n))(In||{}),vn=(n=>(n.Square="square",n.Line="line",n))(vn||{}),An=(n=>(n.thumbnail="thumbnail",n.highest="highest",n.medium="medium",n))(An||{}),Pn=(n=>(n.BOLD="Bold",n.ITALIC="Italic",n.REGULAR="Regular",n))(Pn||{}),En=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(En||{}),Fn=(n=>(n.TOP="top",n.CENTER="center",n.BOTTOM="bottom",n))(Fn||{}),On=(n=>(n.TO_LOWER_CASE="lowercase",n.TO_UPPER_CASE="uppercase",n.NORMAL="normal",n))(On||{}),Dn=(n=>(n.SUPERSCRIPT="superscript",n.SUBSCRIPT="subscript",n.NORMAL="normal",n))(Dn||{}),Ln=(n=>(n.none="none",n.bullet="bullet",n.number="number",n))(Ln||{}),Nn=(n=>(n.STYLE="textStyle",n.PROPERTIES="textProperties",n.APPEARANCE="appearance",n))(Nn||{}),Mn=(n=>(n.PARAGRAPH="paragraphStyleId",n.CHARACTER="characterStyleId",n.FONT_FAMILY="fontKey",n.FONT_STYLE="fontStyle",n.FONT_SIZE="fontSize",n.LETTER_SPACING="letterSpacing",n.LINE_HEIGHT="lineHeight",n.TEXT_ALIGN="textAlign",n.VERTICAL_ALIGN="verticalAlign",n.TYPOGRAPHIC_CASE="typographicCase",n.SUB_SUPER_SCRIPT="subSuperScript",n.UNDERLINE="underline",n.LINE_THROUGH="lineThrough",n.FILL_COLOR="fillColor",n.COLOR="color",n.FILL_COLOR_APPLIED="fillColorApplied",n.STROKE_COLOR="strokeColor",n.STROKE_COLOR_APPLIED="strokeColorApplied",n.BACKGROUND_COLOR="backgroundColor",n.BACKGROUND_COLOR_APPLIED="backgroundColorApplied",n.DROP_SHADOW_COLOR="dropShadowColor",n.BLEND_MODE="blendMode",n.OPACITY="opacity",n.TRACKING_RIGHT="trackingRight",n.BASELINE_SHIFT="baselineShiftValue",n.STROKE_WIDTH="strokeWidth",n.MARKED_LIST_TYPE="markedListType",n.MARKED_LIST_GROUP="markedListGroup",n.MARKED_LIST_LEVEL="markedListLevel",n))(Mn||{}),Rn=(n=>(n.arabic="arabic",n.romanUpperCase="romanUpperCase",n.romanLowerCase="romanLowerCase",n.latinUpperCase="latinUpperCase",n.latinLowerCase="latinLowerCase",n))(Rn||{}),Vn=(n=>(n.none="none",n.dash="dash",n.dot="dot",n.colon="colon",n.roundBracket="roundBracket",n))(Vn||{}),kn=(n=>(n.fixed="fixed",n))(kn||{}),Tn=(n=>(n.selectedLayoutChanged="selectedLayoutChanged",n.frameMoved="frameMoved",n.pageSizeChanged="pageSizeChanged",n.documentLoaded="documentLoaded",n.variableValueChanged="variableValueChanged",n))(Tn||{}),Bn=(n=>(n.ellipse="ellipse",n.rectangle="rectangle",n.polygon="polygon",n.custom="custom",n))(Bn||{}),Jn=(n=>(n.all="all",n.only="only",n.none="none",n))(Jn||{}),Un=(n=>(n.paragraph="paragraph",n.character="character",n.lineBreak="lineBreak",n.inlineStyle="inlineStyle",n))(Un||{}),Gn=(n=>(n.exists="exists",n.missing="missing",n.equals="equals",n.notEquals="notEquals",n.contains="contains",n.startsWith="startsWith",n.endsWith="endsWith",n))(Gn||{}),_n=(n=>(n.normal="normal",n.textEdit="textEdit",n.customCrop="customCrop",n.frameSubjectArea="frameSubjectArea",n.perAssetCrop="perAssetCrop",n.gradient="gradient",n))(_n||{}),Hn=(n=>(n.url="url",n.grafx="grafx",n.local="local",n))(Hn||{});const Sa=Object.freeze(Object.defineProperty({__proto__:null,ConnectorRegistrationSource:Hn},Symbol.toStringTag,{value:"Module"}));h.APIColorType=Ze,h.ActionAsyncError=ke,h.ActionEditorEvent=Tn,h.Alignment=En,h.AnchorTargetEdgeType=Ns,h.AnchorTargetType=Ls,h.AuthCredentialsTypeEnum=cs,h.AuthRefreshTypeEnum=hs,h.AutoGrowDirection=Cs,h.BarcodeCharacterSet=wt,h.BarcodeErrorCorrectionLevel=Et,h.BarcodeSourceTypeEnum=bs,h.BarcodeType=W,h.BarcodeValidationResult=_e,h.BasicAnimationsEmphasisStyles=fn,h.BlendMode=Ps,h.Case=On,h.ColorType=oe,h.ColorUsageType=Qe,h.ComponentFitEnum=ws,h.ComponentGridLayoutAlgorithm=kn,h.ComponentPreviewType=An,h.ComponentSourceTypeEnum=fs,h.ConnectorConfigContextType=rs,h.ConnectorConfigValueType=ns,h.ConnectorEventType=os,h.ConnectorHttpError=Be,h.ConnectorMapping=Gr,h.ConnectorMappingDirection=is,h.ConnectorMappingSource=as,h.ConnectorRegistrationSource=Dt,h.ConnectorStateType=he,h.ConnectorSupportedAuth=ls,h.ConnectorType=ts,h.ConstraintMode=je,h.CornerRadiusType=Jn,h.CropType=Se,h.DataRowAsyncError=Te,h.DataSourceVariableDisplayOptionsType=Ws,h.DataSourceVariableSourceType=ve,h.Day=xs,h.DeprecatedMediaConnectorDownloadType=ce,h.DeprecatedMediaType=Ft,h.DocumentIssueTypeEnum=Ve,h.DocumentType=we,h.DownloadFormats=Zs,h.EaseTypes=wn,h.EngineEditModeType=_n,h.EnvironmentType=ue,h.FitMode=Es,h.FitModePosition=Fs,h.FlowDirection=vs,h.FontPreviewFormat=vn,h.FontWeights=Pn,h.FrameAnchorTarget=zr,h.FrameAnchorType=Ds,h.FrameEditingMode=Re,h.FramePropertyNames=qs,h.FrameTypeEnum=Ss,h.GradientType=bn,h.GradientUsageType=In,h.GrafxTokenAuthCredentials=Hr,h.ImageSourceTypeEnum=Lt,h.LayoutIntent=$e,h.LayoutPropertyNames=Ys,h.LayoutType=xe,h.Locale=$s,h.MarkedListType=Ln,h.MeasurementUnit=He,h.MediaDownloadIntent=Ie,h.MediaDownloadType=le,h.MediaType=Ot,h.Next=Sa,h.NumberListFormat=Rn,h.NumberListSeparatorSymbol=Vn,h.PageAnchorTarget=jr,h.PositionEnum=Q,h.RefreshedAuthCredendentials=xr,h.SDKUnauthorizedError=tn,h.Scripting=Dn,h.SelectedTextStyleSections=Nn,h.SelectedTextStyles=Mn,h.ShakeDirections=mn,h.ShapeType=Bn,h.SlideDirections=pn,h.SmartCropAxisBias=Rs,h.SmartCropVersion=Ms,h.SortBy=es,h.SortOrder=ss,h.StructuredTextAttributeMatchOperator=Gn,h.StructuredTextStyleKind=Un,h.TextDirection=Is,h.TextPosition=Fn,h.ToolType=G,h.TweenTypes=Cn,h.UpdateZIndexMethod=Os,h.UploadAssetValidationError=ds,h.UploadAssetValidationErrorType=fe,h.VariableType=Wt,h.VariableValueConstrainsViolationError=Je,h.VariableVisibilityOperator=zs,h.VariableVisibilityTargetType=js,h.VariableVisibilityType=Nt,h.VerticalAlign=As,h.ViewMode=Sn,h.WellKnownConfigurationKeys=Z,h.default=fa,h.grafxMediaConnectorRegistration=_r,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
69
69
  //# sourceMappingURL=main.js.map