@chili-publish/studio-sdk 1.18.0 → 1.20.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.
Files changed (121) hide show
  1. package/_bundles/main.js +1 -1
  2. package/_bundles/main.js.map +1 -1
  3. package/_bundles/report.html +2 -2
  4. package/lib/editor-engine.json +1 -1
  5. package/lib/package.json +1 -1
  6. package/lib/src/controllers/FrameController.d.ts +30 -9
  7. package/lib/src/controllers/FrameController.js +52 -10
  8. package/lib/src/controllers/FrameController.js.map +1 -1
  9. package/lib/src/controllers/LayoutController.d.ts +58 -2
  10. package/lib/src/controllers/LayoutController.js +84 -0
  11. package/lib/src/controllers/LayoutController.js.map +1 -1
  12. package/lib/src/controllers/PageController.d.ts +7 -3
  13. package/lib/src/controllers/PageController.js +9 -3
  14. package/lib/src/controllers/PageController.js.map +1 -1
  15. package/lib/src/controllers/SubscriberController.d.ts +13 -2
  16. package/lib/src/controllers/SubscriberController.js +53 -85
  17. package/lib/src/controllers/SubscriberController.js.map +1 -1
  18. package/lib/src/controllers/ToolController.d.ts +1 -1
  19. package/lib/src/controllers/ToolController.js +1 -1
  20. package/lib/src/controllers/UndoManagerController.d.ts +19 -0
  21. package/lib/src/controllers/UndoManagerController.js +28 -0
  22. package/lib/src/controllers/UndoManagerController.js.map +1 -1
  23. package/lib/src/controllers/UtilsController.d.ts +1 -1
  24. package/lib/src/controllers/UtilsController.js +1 -1
  25. package/lib/src/controllers/VariableController.d.ts +24 -6
  26. package/lib/src/controllers/VariableController.js +38 -8
  27. package/lib/src/controllers/VariableController.js.map +1 -1
  28. package/lib/src/index.d.ts +23 -21
  29. package/lib/src/index.js +11 -10
  30. package/lib/src/index.js.map +1 -1
  31. package/lib/src/interactions/{connector.d.ts → Connector.d.ts} +2 -0
  32. package/lib/src/interactions/{connector.js → Connector.js} +3 -1
  33. package/lib/src/interactions/{connector.js.map → Connector.js.map} +1 -1
  34. package/lib/src/next/NextInitiator.d.ts +2 -2
  35. package/lib/src/next/NextInitiator.js.map +1 -1
  36. package/lib/src/next/controllers/SubscriberController.d.ts +2 -2
  37. package/lib/src/next/controllers/SubscriberController.js +2 -4
  38. package/lib/src/next/controllers/SubscriberController.js.map +1 -1
  39. package/lib/src/next/tests/controllers/ConnectorController.test.js +1 -1
  40. package/lib/src/next/tests/controllers/ConnectorController.test.js.map +1 -1
  41. package/lib/src/next/tests/controllers/SubscriberContoller.test.js +5 -4
  42. package/lib/src/next/tests/controllers/SubscriberContoller.test.js.map +1 -1
  43. package/lib/src/next/tests/controllers/VariableController.test.js +3 -2
  44. package/lib/src/next/tests/controllers/VariableController.test.js.map +1 -1
  45. package/lib/src/next/types/NextSubscribers.d.ts +2 -1
  46. package/lib/src/sdk.d.ts +10 -10
  47. package/lib/src/sdk.js +24 -13
  48. package/lib/src/sdk.js.map +1 -1
  49. package/lib/src/tests/__mocks__/{animations.js → Animations.js} +1 -1
  50. package/lib/src/tests/__mocks__/Animations.js.map +1 -0
  51. package/lib/src/tests/__mocks__/{config.d.ts → Config.d.ts} +2 -2
  52. package/lib/src/tests/__mocks__/{config.js → Config.js} +5 -3
  53. package/lib/src/tests/__mocks__/Config.js.map +1 -0
  54. package/lib/src/tests/controllers/AnimationController.test.js +1 -1
  55. package/lib/src/tests/controllers/CharacterStyleController.test.js +1 -0
  56. package/lib/src/tests/controllers/CharacterStyleController.test.js.map +1 -1
  57. package/lib/src/tests/controllers/FrameController.test.js +29 -8
  58. package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
  59. package/lib/src/tests/controllers/LayoutController.test.js +64 -1
  60. package/lib/src/tests/controllers/LayoutController.test.js.map +1 -1
  61. package/lib/src/tests/controllers/PageController.test.js +11 -6
  62. package/lib/src/tests/controllers/PageController.test.js.map +1 -1
  63. package/lib/src/tests/controllers/SubscriberContoller.test.js +46 -33
  64. package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
  65. package/lib/src/tests/controllers/UndoManagerController.test.js +22 -1
  66. package/lib/src/tests/controllers/UndoManagerController.test.js.map +1 -1
  67. package/lib/src/tests/controllers/UtilsController.test.js +1 -1
  68. package/lib/src/tests/controllers/VariableController.test.js +47 -14
  69. package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
  70. package/lib/src/tests/index.test.js +1 -1
  71. package/lib/src/tests/interactions/{connector.test.js → Connector.test.js} +2 -2
  72. package/lib/src/tests/interactions/{connector.test.js.map → Connector.test.js.map} +1 -1
  73. package/lib/src/tests/utils/{editorResponseData.test.js → EditorResponseData.test.js} +1 -1
  74. package/lib/src/tests/utils/{editorResponseData.test.js.map → EditorResponseData.test.js.map} +1 -1
  75. package/lib/src/tests/utils/EventSubscription.test.js +238 -0
  76. package/lib/src/tests/utils/EventSubscription.test.js.map +1 -0
  77. package/lib/src/tests/utils/Logging.test.d.ts +1 -0
  78. package/lib/src/tests/utils/Logging.test.js +99 -0
  79. package/lib/src/tests/utils/Logging.test.js.map +1 -0
  80. package/lib/src/tests/utils/Round.test.d.ts +1 -0
  81. package/lib/src/tests/utils/{round.test.js → Round.test.js} +1 -1
  82. package/lib/src/tests/utils/{round.test.js.map → Round.test.js.map} +1 -1
  83. package/lib/src/types/CommonTypes.d.ts +226 -21
  84. package/lib/src/types/CommonTypes.js +27 -0
  85. package/lib/src/types/CommonTypes.js.map +1 -1
  86. package/lib/src/types/DocumentTypes.d.ts +0 -1
  87. package/lib/src/types/DocumentTypes.js.map +1 -1
  88. package/lib/src/types/EngineEditModeTypes.d.ts +11 -0
  89. package/lib/src/types/EngineEditModeTypes.js +8 -0
  90. package/lib/src/types/EngineEditModeTypes.js.map +1 -0
  91. package/lib/src/types/FrameTypes.d.ts +16 -2
  92. package/lib/src/types/FrameTypes.js +15 -1
  93. package/lib/src/types/FrameTypes.js.map +1 -1
  94. package/lib/src/types/LayoutTypes.d.ts +33 -1
  95. package/lib/src/types/LayoutTypes.js.map +1 -1
  96. package/lib/src/types/PageTypes.d.ts +18 -0
  97. package/lib/src/types/VariableTypes.d.ts +61 -1
  98. package/lib/src/types/VariableTypes.js +21 -0
  99. package/lib/src/types/VariableTypes.js.map +1 -1
  100. package/lib/src/utils/ConfigHelper.d.ts +11 -0
  101. package/lib/src/utils/ConfigHelper.js +90 -0
  102. package/lib/src/utils/ConfigHelper.js.map +1 -0
  103. package/lib/src/utils/EngineCallbackHandler.d.ts +13 -0
  104. package/lib/src/utils/EngineCallbackHandler.js +23 -0
  105. package/lib/src/utils/EngineCallbackHandler.js.map +1 -0
  106. package/lib/src/utils/EngineEvent.d.ts +29 -0
  107. package/lib/src/utils/EngineEvent.js +44 -0
  108. package/lib/src/utils/EngineEvent.js.map +1 -0
  109. package/lib/src/utils/EngineEventTrigger.d.ts +8 -0
  110. package/lib/src/utils/EngineEventTrigger.js +33 -0
  111. package/lib/src/utils/EngineEventTrigger.js.map +1 -0
  112. package/lib/src/utils/{enums.js → Enums.js} +1 -1
  113. package/lib/src/utils/{enums.js.map → Enums.js.map} +1 -1
  114. package/package.json +1 -1
  115. package/lib/src/tests/__mocks__/animations.js.map +0 -1
  116. package/lib/src/tests/__mocks__/config.js.map +0 -1
  117. /package/lib/src/tests/__mocks__/{animations.d.ts → Animations.d.ts} +0 -0
  118. /package/lib/src/tests/interactions/{connector.test.d.ts → Connector.test.d.ts} +0 -0
  119. /package/lib/src/tests/utils/{editorResponseData.test.d.ts → EditorResponseData.test.d.ts} +0 -0
  120. /package/lib/src/tests/utils/{round.test.d.ts → EventSubscription.test.d.ts} +0 -0
  121. /package/lib/src/utils/{enums.d.ts → Enums.d.ts} +0 -0
package/_bundles/main.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("StudioSDK",[],factory):"object"==typeof exports?exports.StudioSDK=factory():root.StudioSDK=factory()}(this,(()=>(()=>{"use strict";var enums_MessageType,Resolution,ErrorCode,NativeErrorName,enums_NativeEventType,__webpack_require__={d:(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},o:(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),r:exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})}},__webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ActionEditorEvent:()=>ActionEditorEvent,Alignment:()=>Alignment,AnchorTargetEdgeType:()=>AnchorTargetEdgeType,AnchorTargetType:()=>AnchorTargetType,AuthCredentialsTypeEnum:()=>AuthCredentialsTypeEnum,AuthRefreshTypeEnum:()=>AuthRefreshTypeEnum,AutoGrowDirection:()=>AutoGrowDirection,BarcodeCharacterSet:()=>BarcodeCharacterSet,BarcodeErrorCorrectionLevel:()=>BarcodeErrorCorrectionLevel,BarcodeSourceTypeEnum:()=>BarcodeSourceTypeEnum,BarcodeType:()=>BarcodeType,BarcodeValidationResult:()=>BarcodeValidationResult,BasicAnimationsEmphasisStyles:()=>BasicAnimationsEmphasisStyles,BlendMode:()=>BlendMode,Case:()=>Case,ColorType:()=>ColorType,ColorUsageType:()=>ColorUsageType,ConnectorConfigValueType:()=>ConnectorConfigValueType,ConnectorEventType:()=>ConnectorEventType,ConnectorHttpError:()=>ConnectorHttpError,ConnectorMapping:()=>ConnectorMapping,ConnectorMappingDirection:()=>ConnectorMappingDirection,ConnectorMappingSource:()=>ConnectorMappingSource,ConnectorRegistrationSource:()=>ConnectorRegistrationSource,ConnectorStateType:()=>ConnectorStateType,ConnectorType:()=>ConnectorType,CornerRadiusType:()=>CornerRadiusType,Day:()=>Day,DeprecatedMediaConnectorDownloadType:()=>DeprecatedMediaConnectorDownloadType,DeprecatedMediaType:()=>DeprecatedMediaType,DocumentIssueTypeEnum:()=>DocumentIssueTypeEnum,DocumentType:()=>DocumentType,DownloadFormats:()=>DownloadFormats,EaseTypes:()=>EaseTypes,EnvironmentType:()=>EnvironmentType,FitMode:()=>FitMode,FlowDirection:()=>FlowDirection,FontPreviewFormat:()=>FontPreviewFormat,FontWeights:()=>FontWeights,FrameAnchorTarget:()=>FrameAnchorTarget,FrameAnchorType:()=>FrameAnchorType,FramePropertyNames:()=>FramePropertyNames,FrameTypeEnum:()=>FrameTypeEnum,GrafxTokenAuthCredentials:()=>GrafxTokenAuthCredentials,ImageSourceTypeEnum:()=>ImageSourceTypeEnum,LayoutIntent:()=>LayoutIntent,LayoutPropertyNames:()=>LayoutPropertyNames,LayoutType:()=>LayoutType,Locale:()=>Locale,MeasurementUnit:()=>MeasurementUnit,MediaDownloadIntent:()=>MediaDownloadIntent,MediaDownloadType:()=>MediaDownloadType,MediaType:()=>MediaType,PageAnchorTarget:()=>PageAnchorTarget,PositionEnum:()=>PositionEnum,RefreshedAuthCredendentials:()=>RefreshedAuthCredendentials,Scripting:()=>Scripting,SelectedTextStyleSections:()=>SelectedTextStyleSections,SelectedTextStyles:()=>SelectedTextStyles,ShakeDirections:()=>ShakeDirections,ShapeType:()=>ShapeType,SlideDirections:()=>SlideDirections,SortBy:()=>SortBy,SortOrder:()=>SortOrder,TextDirection:()=>TextDirection,TextPosition:()=>TextPosition,ToolType:()=>ToolType,TweenTypes:()=>TweenTypes,UpdateZIndexMethod:()=>UpdateZIndexMethod,VariableType:()=>VariableType,VerticalAlign:()=>VerticalAlign,ViewMode:()=>ViewMode,WellKnownConfigurationKeys:()=>WellKnownConfigurationKeys,default:()=>src,grafxMediaConnectorRegistration:()=>grafxMediaConnectorRegistration}),function(MessageType){MessageType.Call="call",MessageType.Reply="reply",MessageType.Syn="syn",MessageType.SynAck="synAck",MessageType.Ack="ack"}(enums_MessageType||(enums_MessageType={})),function(Resolution){Resolution.Fulfilled="fulfilled",Resolution.Rejected="rejected"}(Resolution||(Resolution={})),function(ErrorCode){ErrorCode.ConnectionDestroyed="ConnectionDestroyed",ErrorCode.ConnectionTimeout="ConnectionTimeout",ErrorCode.NoIframeSrc="NoIframeSrc"}(ErrorCode||(ErrorCode={})),function(NativeErrorName){NativeErrorName.DataCloneError="DataCloneError"}(NativeErrorName||(NativeErrorName={})),function(NativeEventType){NativeEventType.Message="message"}(enums_NativeEventType||(enums_NativeEventType={}));const DEFAULT_PORT_BY_PROTOCOL={"http:":"80","https:":"443"},URL_REGEX=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,opaqueOriginSchemes=["file:","data:"],serializeError=({name,message,stack})=>({name,message,stack});let id=0;const generateId=()=>++id,keyPathToSegments=keyPath=>keyPath?keyPath.split("."):[],setAtKeyPath=(subject,keyPath,value)=>{const segments=keyPathToSegments(keyPath);return segments.reduce(((prevSubject,key,idx)=>(void 0===prevSubject[key]&&(prevSubject[key]={}),idx===segments.length-1&&(prevSubject[key]=value),prevSubject[key])),subject),subject},methodSerialization_serializeMethods=(methods,prefix)=>{const flattenedMethods={};return Object.keys(methods).forEach((key=>{const value=methods[key],keyPath=((key,prefix)=>{const segments=keyPathToSegments(prefix||"");return segments.push(key),(segments=>segments.join("."))(segments)})(key,prefix);"object"==typeof value&&Object.assign(flattenedMethods,methodSerialization_serializeMethods(value,keyPath)),"function"==typeof value&&(flattenedMethods[keyPath]=value)})),flattenedMethods},lib_connectCallSender=(callSender,info,methodKeyPaths,destroyConnection,log)=>{const{localName,local,remote,originForSending,originForReceiving}=info;let destroyed=!1;log(`${localName}: Connecting call sender`);const createMethodProxy=methodName=>(...args)=>{let iframeRemoved;log(`${localName}: Sending ${methodName}() call`);try{remote.closed&&(iframeRemoved=!0)}catch(e){iframeRemoved=!0}if(iframeRemoved&&destroyConnection(),destroyed){const error=new Error(`Unable to send ${methodName}() call due to destroyed connection`);throw error.code=ErrorCode.ConnectionDestroyed,error}return new Promise(((resolve,reject)=>{const id=generateId(),handleMessageEvent=event=>{if(event.source!==remote||event.data.penpal!==enums_MessageType.Reply||event.data.id!==id)return;if(event.origin!==originForReceiving)return void log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);const replyMessage=event.data;log(`${localName}: Received ${methodName}() reply`),local.removeEventListener(enums_NativeEventType.Message,handleMessageEvent);let returnValue=replyMessage.returnValue;replyMessage.returnValueIsError&&(returnValue=(obj=>{const deserializedError=new Error;return Object.keys(obj).forEach((key=>deserializedError[key]=obj[key])),deserializedError})(returnValue)),(replyMessage.resolution===Resolution.Fulfilled?resolve:reject)(returnValue)};local.addEventListener(enums_NativeEventType.Message,handleMessageEvent);const callMessage={penpal:enums_MessageType.Call,id,methodName,args};remote.postMessage(callMessage,originForSending)}))},flattenedMethods=methodKeyPaths.reduce(((api,name)=>(api[name]=createMethodProxy(name),api)),{});return Object.assign(callSender,(flattenedMethods=>{const methods={};for(const keyPath in flattenedMethods)setAtKeyPath(methods,keyPath,flattenedMethods[keyPath]);return methods})(flattenedMethods)),()=>{destroyed=!0}},handleAckMessageFactory=(serializedMethods,childOrigin,originForSending,destructor,log)=>{const{destroy,onDestroy}=destructor;let destroyCallReceiver,receiverMethodNames;const callSender={};return event=>{if(event.origin!==childOrigin)return void log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);log("Parent: Handshake - Received ACK");const info={localName:"Parent",local:window,remote:event.source,originForSending,originForReceiving:childOrigin};destroyCallReceiver&&destroyCallReceiver(),destroyCallReceiver=((info,serializedMethods,log)=>{const{localName,local,remote,originForSending,originForReceiving}=info;let destroyed=!1;const handleMessageEvent=event=>{if(event.source!==remote||event.data.penpal!==enums_MessageType.Call)return;if(event.origin!==originForReceiving)return void log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);const callMessage=event.data,{methodName,args,id}=callMessage;log(`${localName}: Received ${methodName}() call`);const createPromiseHandler=resolution=>returnValue=>{if(log(`${localName}: Sending ${methodName}() reply`),destroyed)return void log(`${localName}: Unable to send ${methodName}() reply due to destroyed connection`);const message={penpal:enums_MessageType.Reply,id,resolution,returnValue};resolution===Resolution.Rejected&&returnValue instanceof Error&&(message.returnValue=serializeError(returnValue),message.returnValueIsError=!0);try{remote.postMessage(message,originForSending)}catch(err){if(err.name===NativeErrorName.DataCloneError){const errorReplyMessage={penpal:enums_MessageType.Reply,id,resolution:Resolution.Rejected,returnValue:serializeError(err),returnValueIsError:!0};remote.postMessage(errorReplyMessage,originForSending)}throw err}};new Promise((resolve=>resolve(serializedMethods[methodName].apply(serializedMethods,args)))).then(createPromiseHandler(Resolution.Fulfilled),createPromiseHandler(Resolution.Rejected))};return local.addEventListener(enums_NativeEventType.Message,handleMessageEvent),()=>{destroyed=!0,local.removeEventListener(enums_NativeEventType.Message,handleMessageEvent)}})(info,serializedMethods,log),onDestroy(destroyCallReceiver),receiverMethodNames&&receiverMethodNames.forEach((receiverMethodName=>{delete callSender[receiverMethodName]})),receiverMethodNames=event.data.methodNames;const destroyCallSender=lib_connectCallSender(callSender,info,receiverMethodNames,destroy,log);return onDestroy(destroyCallSender),callSender}},connectToChild=options=>{let{iframe,methods={},childOrigin,timeout,debug=!1}=options;const log=(debug=>(...args)=>{debug&&console.log("[Penpal]",...args)})(debug),destructor=((localName,log)=>{const callbacks=[];let destroyed=!1;return{destroy(error){destroyed||(destroyed=!0,log(`${localName}: Destroying connection`),callbacks.forEach((callback=>{callback(error)})))},onDestroy(callback){destroyed?callback():callbacks.push(callback)}}})("Parent",log),{onDestroy,destroy}=destructor;childOrigin||((iframe=>{if(!iframe.src&&!iframe.srcdoc){const error=new Error("Iframe must have src or srcdoc property defined.");throw error.code=ErrorCode.NoIframeSrc,error}})(iframe),childOrigin=(src=>{if(src&&opaqueOriginSchemes.find((scheme=>src.startsWith(scheme))))return"null";const location=document.location,regexResult=URL_REGEX.exec(src);let protocol,hostname,port;return regexResult?(protocol=regexResult[1]?regexResult[1]:location.protocol,hostname=regexResult[2],port=regexResult[4]):(protocol=location.protocol,hostname=location.hostname,port=location.port),`${protocol}//${hostname}${port&&port!==DEFAULT_PORT_BY_PROTOCOL[protocol]?`:${port}`:""}`})(iframe.src));const originForSending="null"===childOrigin?"*":childOrigin,serializedMethods=methodSerialization_serializeMethods(methods),handleSynMessage=((log,serializedMethods,childOrigin,originForSending)=>event=>{if(event.origin!==childOrigin)return void log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);log("Parent: Handshake - Received SYN, responding with SYN-ACK");const synAckMessage={penpal:enums_MessageType.SynAck,methodNames:Object.keys(serializedMethods)};event.source.postMessage(synAckMessage,originForSending)})(log,serializedMethods,childOrigin,originForSending),handleAckMessage=handleAckMessageFactory(serializedMethods,childOrigin,originForSending,destructor,log),promise=new Promise(((resolve,reject)=>{const stopConnectionTimeout=((timeout,callback)=>{let timeoutId;return void 0!==timeout&&(timeoutId=window.setTimeout((()=>{const error=new Error(`Connection timed out after ${timeout}ms`);error.code=ErrorCode.ConnectionTimeout,callback(error)}),timeout)),()=>{clearTimeout(timeoutId)}})(timeout,destroy),handleMessage=event=>{if(event.source===iframe.contentWindow&&event.data)if(event.data.penpal!==enums_MessageType.Syn)if(event.data.penpal!==enums_MessageType.Ack);else{const callSender=handleAckMessage(event);callSender&&(stopConnectionTimeout(),resolve(callSender))}else handleSynMessage(event)};window.addEventListener(enums_NativeEventType.Message,handleMessage),log("Parent: Awaiting handshake"),((iframe,destructor)=>{const{destroy,onDestroy}=destructor,checkIframeInDocIntervalId=setInterval((()=>{iframe.isConnected||(clearInterval(checkIframeInDocIntervalId),destroy())}),6e4);onDestroy((()=>{clearInterval(checkIframeInDocIntervalId)}))})(iframe,destructor),onDestroy((error=>{window.removeEventListener(enums_NativeEventType.Message,handleMessage),error&&reject(error)}))}));return{promise,destroy(){destroy()}}},setupFrame=(iframe,editorLink,styling)=>{const link=(editorLink=>{let link="";return new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w]+\/$/).test(editorLink)?link=editorLink:editorLink.indexOf("/index.html")>-1?link=editorLink.replace("/index.html","/"):"/"!==editorLink.charAt(-1)&&(link=`${editorLink}/`),link})(editorLink),html=`<html>\n <head>\n <base href="/" />\n <meta charset="UTF-8"/>\n \x3c!-- use this property to pass the StudioStyling to the engine --\x3e\n <meta name="studio-styling" content='${JSON.stringify(styling||{})}'>\n </head>\n <body>\n <script> \n <\/script>\n <script src="${link}init.js" async><\/script>\n <script src="${link}init_engine.js"><\/script>\n <script>\n initializeStudioEngine({\n assetBase: '${link}',\n entryPointUrl: '${link}main.dart.js',\n });\n <\/script>\n </body>\n </html>\n `;iframe.srcdoc=html},connector=(editorLink,params,setConnection,editorId="chili-editor",styling)=>{const editorSelectorId=`#${editorId}`,iframe=document.createElement("iframe");iframe.setAttribute("srcdoc"," "),iframe.setAttribute("title","Chili-Editor"),iframe.setAttribute("style","width: 100%; height: 100%;"),iframe.setAttribute("frameBorder","0"),iframe.setAttribute("referrerpolicy","origin");const setupNewFrame=()=>{const iframeContainer=document.querySelector(editorSelectorId);iframeContainer&&(null==iframeContainer||iframeContainer.appendChild(iframe),setupFrame(iframe,editorLink,styling))};"complete"===document.readyState||"interactive"===document.readyState?setupNewFrame():document.addEventListener("DOMContentLoaded",(()=>{setupNewFrame()})),setConnection(connectToChild({iframe,methods:{actionsChanged:params.onActionsChanged,stateChanged:params.onStateChanged,documentLoaded:params.onDocumentLoaded,authExpired:params.onAuthExpired,viewportRequested:params.onViewportRequested,selectedFramesContent:params.onSelectedFramesContentChanged,selectedFramesLayout:params.onSelectedFramesLayoutChanged,selectedLayoutProperties:params.onSelectedLayoutPropertiesChanged,openLayoutPropertiesPanel:params.onPageSelectionChanged,selectedLayoutUnit:params.onSelectedLayoutUnitChanged,scrubberPositionChanged:params.onScrubberPositionChanged,frameAnimationsChanged:params.onFrameAnimationsChanged,selectedToolChanged:params.onSelectedToolChanged,variableListChanged:params.onVariableListChanged,undoStackStateChanged:params.onUndoStateChanged,selectedLayoutFramesChanged:params.onSelectedLayoutFramesChanged,selectedTextStyleChanged:params.onSelectedTextStyleChanged,colorsChanged:params.onColorsChanged,paragraphStylesChanged:params.onParagraphStylesChanged,characterStylesChanged:params.onCharacterStylesChanged,fontFamiliesChanged:params.onFontFamiliesChanged,selectedLayoutId:params.onSelectedLayoutIdChanged,layoutListChanged:params.onLayoutsChanged,connectorEvent:params.onConnectorEvent,connectorsChanged:params.onConnectorsChanged,zoomChanged:params.onZoomChanged,pageSnapshotInvalidated:params.onPageSnapshotInvalidated,pagesChanged:params.onPagesChanged,pageSizeChanged:params.onPageSizeChanged,shapeCornerRadiusChanged:params.onShapeCornerRadiusChanged,cropActiveFrameIdChanged:params.onCropActiveFrameIdChanged,asyncError:params.onAsyncError,viewModeChanged:params.onViewModeChanged,barcodeValidationChanged:params.onBarcodeValidationChanged,selectedPageIdChanged:params.onSelectedPageIdChanged,dataSourceIdChanged:params.onDataSourceIdChanged,documentIssueListChanged:params.onDocumentIssueListChanged}}))};var WellKnownConfigurationKeys;!function(WellKnownConfigurationKeys){WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl="ENVIRONMENT_API",WellKnownConfigurationKeys.GraFxStudioSdkVersion="SDK_VERSION",WellKnownConfigurationKeys.GraFxStudioDocumentType="DOCUMENT_TYPE",WellKnownConfigurationKeys.GraFxStudioTemplateId="TEMPLATE_ID",WellKnownConfigurationKeys.GraFxStudioAuthToken="GRAFX_AUTH_TOKEN"}(WellKnownConfigurationKeys||(WellKnownConfigurationKeys={}));const defaultStudioOptions={shortcutOptions:{debugPanel:{enabled:!1},ellipse:{enabled:!1},hand:{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}}},package_namespaceObject_i8="1.18.0",editor_engine_namespaceObject_V="2.1.latest";var DocumentIssueTypeEnum,ImageFrameSourceType,FramePropertiesType,DocumentType;!function(DocumentIssueTypeEnum){DocumentIssueTypeEnum.overflow="overflow",DocumentIssueTypeEnum.fontLoading="fontLoading",DocumentIssueTypeEnum.actionRegister="actionRegister",DocumentIssueTypeEnum.actionExecution="actionExecution",DocumentIssueTypeEnum.actionCircular="actionCircular"}(DocumentIssueTypeEnum||(DocumentIssueTypeEnum={})),function(ImageFrameSourceType){ImageFrameSourceType.url="url",ImageFrameSourceType.assetProvider="assetProvider",ImageFrameSourceType.variable="variable"}(ImageFrameSourceType||(ImageFrameSourceType={})),function(FramePropertiesType){FramePropertiesType.top="top",FramePropertiesType.child="child"}(FramePropertiesType||(FramePropertiesType={})),function(DocumentType){DocumentType.project="project",DocumentType.template="template"}(DocumentType||(DocumentType={}));function getEditorResponseData(response,parse=!0){var _a,_b;try{if(!response.success){const parsedError=null!==(_a=response.error)&&void 0!==_a?_a:"Yikes, something went wrong",parsedCause={cause:{name:String(response.status),message:null!==(_b=response.error)&&void 0!==_b?_b:"Yikes, something went wrong"}};if(404075===response.status){const httpStatusCode=JSON.parse(response.data).statusCode;throw new ConnectorHttpError(httpStatusCode,parsedError,parsedCause)}throw new Error(parsedError,parsedCause)}const dataShouldBeParsed=response.data&&parse;return Object.assign(Object.assign({},response),{parsedData:dataShouldBeParsed?JSON.parse(response.data):response.data})}catch(error){throw console.error(error),error}}class ConnectorHttpError extends Error{constructor(statusCode,message,options){super(message,options),this.statusCode=statusCode}}var _ActionController_editorAPI,__awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},__classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},__classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ActionController{constructor(editorAPI){_ActionController_editorAPI.set(this,void 0),this.getAll=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).getActions().then((result=>getEditorResponseData(result)))})),this.getById=id=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).getActionById(id).then((result=>getEditorResponseData(result)))})),this.create=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).createAction().then((result=>getEditorResponseData(result)))})),this.duplicate=id=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).duplicateAction(id).then((result=>getEditorResponseData(result)))})),this.remove=id=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).removeAction(id).then((result=>getEditorResponseData(result)))})),this.update=(id,update)=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).updateAction(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{name})})),this.updateScript=(id,actionScript)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{script:actionScript})})),this.updateTriggers=(id,triggers)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{triggers})})),this.move=(order,ids)=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).moveActions(order,ids).then((result=>getEditorResponseData(result)))})),this.setTypeError=(id,hasTypeErrors)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{hasTypeError:hasTypeErrors})})),this.disable=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).disableActions().then((result=>getEditorResponseData(result)))})),this.enable=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).enableActions().then((result=>getEditorResponseData(result)))})),__classPrivateFieldSet(this,_ActionController_editorAPI,editorAPI,"f")}}_ActionController_editorAPI=new WeakMap;var _AnimationController_editorAPI,AnimationController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},AnimationController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},AnimationController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class AnimationController{constructor(children){_AnimationController_editorAPI.set(this,void 0),this.getAllOnSelectedLayout=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).getAnimationsOnSelectedLayout().then((result=>getEditorResponseData(result)))})),this.getByFrameId=(id,layoutId)=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).getAnimationByFrameId(id,layoutId).then((result=>getEditorResponseData(result)))})),this.getByLayoutId=id=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).getAnimationsByLayoutId(id).then((result=>getEditorResponseData(result)))})),this.setFrameAnimation=animation=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).setFrameAnimation(JSON.stringify(animation)).then((result=>getEditorResponseData(Object.assign(Object.assign({},result),{data:JSON.stringify(animation)}))))})),this.play=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).playAnimation().then((result=>getEditorResponseData(result)))})),this.pause=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).pauseAnimation().then((result=>getEditorResponseData(result)))})),this.setScrubberPosition=timeInMS=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).setScrubberPosition(timeInMS).then((result=>getEditorResponseData(result)))})),this.setDuration=timeInMS=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).setAnimationDuration(timeInMS).then((result=>getEditorResponseData(result)))})),this.resetFrameAnimation=id=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).resetFrameAnimation(id).then((result=>getEditorResponseData(result)))})),this.reset=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).resetAnimation().then((result=>getEditorResponseData(result)))})),AnimationController_classPrivateFieldSet(this,_AnimationController_editorAPI,children,"f")}}_AnimationController_editorAPI=new WeakMap;var _CanvasController_editorAPI,CanvasController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},CanvasController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},CanvasController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class CanvasController{constructor(editorAPI){_CanvasController_editorAPI.set(this,void 0),this.zoomToPage=(id,left,top,width,height)=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).zoomToPage(id,left,top,width,height).then((result=>getEditorResponseData(result)))})),this.getZoomPercentage=()=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).getZoomPercentage().then((result=>getEditorResponseData(result)))})),this.setZoomPercentage=scaleFactor=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).setZoomPercentage(scaleFactor).then((result=>getEditorResponseData(result)))})),this.setViewMode=viewMode=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).setViewMode(viewMode).then((result=>getEditorResponseData(result)))})),CanvasController_classPrivateFieldSet(this,_CanvasController_editorAPI,editorAPI,"f")}}_CanvasController_editorAPI=new WeakMap;var _CharacterStyleController_editorAPI,ColorType,ColorUsageType,CharacterStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},CharacterStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},CharacterStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class CharacterStyleController{constructor(editorAPI){_CharacterStyleController_editorAPI.set(this,void 0),this.getAll=()=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).getCharacterStyles().then((result=>getEditorResponseData(result)))})),this.getById=characterStyleId=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).getCharacterStyleById(characterStyleId).then((result=>getEditorResponseData(result)))})),this.create=()=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).createCharacterStyle().then((result=>getEditorResponseData(result)))})),this.update=(characterStyleId,characterStyle)=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).updateCharacterStyle(characterStyleId,JSON.stringify(characterStyle)).then((result=>getEditorResponseData(result)))})),this.remove=characterStyleId=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).removeCharacterStyle(characterStyleId).then((result=>getEditorResponseData(result)))})),this.duplicate=characterStyleId=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).duplicateCharacterStyle(characterStyleId).then((result=>getEditorResponseData(result)))})),this.rename=(characterStyleId,characterStyleName)=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).renameCharacterStyle(characterStyleId,characterStyleName).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).moveCharacterStyles(order,ids).then((result=>getEditorResponseData(result)))})),CharacterStyleController_classPrivateFieldSet(this,_CharacterStyleController_editorAPI,editorAPI,"f")}}_CharacterStyleController_editorAPI=new WeakMap,function(ColorType){ColorType.rgb="rgb",ColorType.hex="hex",ColorType.cmyk="cmyk",ColorType.gray="gray",ColorType.hsl="hsl",ColorType.spot="spot",ColorType.spotCMYK="spotCMYK",ColorType.spotRGB="spotRGB"}(ColorType||(ColorType={})),function(ColorUsageType){ColorUsageType.local="local",ColorUsageType.stylekit="stylekit"}(ColorUsageType||(ColorUsageType={}));var _ColorStyleController_editorAPI,ColorStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ColorStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ColorStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ColorStyleController{constructor(editorAPI){_ColorStyleController_editorAPI.set(this,void 0),this.getAll=()=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).getColors().then((result=>getEditorResponseData(result)))})),this.getById=id=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).getColorById(id).then((result=>getEditorResponseData(result)))})),this.create=()=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).createColor().then((result=>getEditorResponseData(result)))})),this.duplicate=id=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).duplicateColor(id).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).moveColors(order,ids).then((result=>getEditorResponseData(result)))})),this.rename=(id,newColorName)=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).renameColor(id,newColorName).then((result=>getEditorResponseData(result)))})),this.update=(id,newColorProperties)=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){const res=yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f"),properties=newColorProperties;return properties.type===ColorType.spot&&(properties.type=ColorType.spotCMYK),res.updateColor(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.remove=id=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).removeColor(id).then((result=>getEditorResponseData(result)))})),ColorStyleController_classPrivateFieldSet(this,_ColorStyleController_editorAPI,editorAPI,"f")}}_ColorStyleController_editorAPI=new WeakMap;var _ColorConversionController_editorAPI,DeprecatedMediaType,DeprecatedMediaConnectorDownloadType,MediaType,ConnectorType,SortBy,SortOrder,ConnectorRegistrationSource,ConnectorMappingSource,ConnectorMappingDirection,ConnectorStateType,ConnectorEventType,ColorConversionController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ColorConversionController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ColorConversionController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ColorConversionController{constructor(editorAPI){_ColorConversionController_editorAPI.set(this,void 0),this.convertToRgb=color=>ColorConversionController_awaiter(this,void 0,void 0,(function*(){return(yield ColorConversionController_classPrivateFieldGet(this,_ColorConversionController_editorAPI,"f")).colorToRgb(color).then((result=>getEditorResponseData(result)))})),ColorConversionController_classPrivateFieldSet(this,_ColorConversionController_editorAPI,editorAPI,"f")}}_ColorConversionController_editorAPI=new WeakMap,function(DeprecatedMediaType){DeprecatedMediaType[DeprecatedMediaType.file=0]="file",DeprecatedMediaType[DeprecatedMediaType.collection=1]="collection"}(DeprecatedMediaType||(DeprecatedMediaType={})),function(DeprecatedMediaConnectorDownloadType){DeprecatedMediaConnectorDownloadType.LowResolutionWeb="lowresWeb",DeprecatedMediaConnectorDownloadType.HighResolutionWeb="highresWeb"}(DeprecatedMediaConnectorDownloadType||(DeprecatedMediaConnectorDownloadType={})),function(MediaType){MediaType.file="file",MediaType.collection="collection"}(MediaType||(MediaType={})),function(ConnectorType){ConnectorType.media="media",ConnectorType.fonts="fonts",ConnectorType.data="data"}(ConnectorType||(ConnectorType={})),function(SortBy){SortBy.name="name",SortBy.path="relativePath",SortBy.id="id"}(SortBy||(SortBy={})),function(SortOrder){SortOrder.ascending="asc",SortOrder.descending="desc"}(SortOrder||(SortOrder={})),function(ConnectorRegistrationSource){ConnectorRegistrationSource.url="url",ConnectorRegistrationSource.grafx="grafx",ConnectorRegistrationSource.local="local"}(ConnectorRegistrationSource||(ConnectorRegistrationSource={}));class ConnectorMapping{constructor(contextProperty,mapFrom,sourceValue,direction=ConnectorMappingDirection.engineToConnector){this.direction=ConnectorMappingDirection.engineToConnector,this.name=contextProperty,this.direction=direction,mapFrom===ConnectorMappingSource.variable?this.value=`${mapFrom}.${sourceValue}`:this.value=sourceValue}}!function(ConnectorMappingSource){ConnectorMappingSource.variable="var",ConnectorMappingSource.value="value"}(ConnectorMappingSource||(ConnectorMappingSource={})),function(ConnectorMappingDirection){ConnectorMappingDirection.engineToConnector="engineToConnector",ConnectorMappingDirection.connectorToEngine="connectorToEngine"}(ConnectorMappingDirection||(ConnectorMappingDirection={})),function(ConnectorStateType){ConnectorStateType.loading="loading",ConnectorStateType.loaded="loaded",ConnectorStateType.running="running",ConnectorStateType.ready="ready",ConnectorStateType.error="error"}(ConnectorStateType||(ConnectorStateType={})),function(ConnectorEventType){ConnectorEventType.stateChanged="stateChanged",ConnectorEventType.authChanged="authChanged",ConnectorEventType.reloadRequired="reloadRequired",ConnectorEventType.unloaded="unloaded"}(ConnectorEventType||(ConnectorEventType={}));const grafxMediaConnectorRegistration={url:"grafx-media.json",source:ConnectorRegistrationSource.local};class GrafxTokenAuthCredentials{constructor(token){this.type=AuthCredentialsTypeEnum.grafxToken,this.token=token}}class RefreshedAuthCredendentials{constructor(){this.type=AuthCredentialsTypeEnum.refreshed}}var AuthCredentialsTypeEnum,AuthRefreshTypeEnum;!function(AuthCredentialsTypeEnum){AuthCredentialsTypeEnum.grafxToken="grafxToken",AuthCredentialsTypeEnum.refreshed="refreshed"}(AuthCredentialsTypeEnum||(AuthCredentialsTypeEnum={})),function(AuthRefreshTypeEnum){AuthRefreshTypeEnum.grafxToken="grafxToken",AuthRefreshTypeEnum.any="any"}(AuthRefreshTypeEnum||(AuthRefreshTypeEnum={}));class ConnectorCompatibilityTools{constructor(){this.makeConnectorSourceForwardsCompatible=registration=>{if(registration.source!=ConnectorRegistrationSource.grafx)return registration;if(this.isSourceMigrated(registration))return registration;let url=registration.url;for(;url.endsWith("/");)url=url.substring(0,url.length-1);const pathChunks=url.split("/");return{id:pathChunks[pathChunks.length-1],source:ConnectorRegistrationSource.grafx}},this.makeMultipleConnectorsBackwardsCompatible=(connectors,baseUrl)=>connectors.map((connector=>this.makeSingleConnectorBackwardsCompatible(connector,baseUrl))),this.makeSingleConnectorBackwardsCompatible=(connector,baseUrl)=>connector.source.source!=ConnectorRegistrationSource.grafx?connector:{id:connector.id,name:connector.name,iconUrl:connector.iconUrl,source:this.makeConnectorSourceBackwardsCompatible(connector.source,baseUrl)},this.makeConnectorSourceBackwardsCompatible=(connector,baseUrl)=>{let url=baseUrl;for(;null==url?void 0:url.endsWith("/");)url=url.substring(0,url.length-1);return{url:`${url}/connectors/${connector.id}`,source:ConnectorRegistrationSource.grafx}},this.isSourceMigrated=registration=>"id"in registration}}var _ConnectorController_editorAPI,_ConnectorController_localConfig,_ConnectorController_connectorCompatibilityTools,_ConnectorConfigurator_connectorId,_ConnectorConfigurator_res,ConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ConnectorController{constructor(editorAPI,localConfig){_ConnectorController_editorAPI.set(this,void 0),_ConnectorController_localConfig.set(this,void 0),_ConnectorController_connectorCompatibilityTools.set(this,void 0),this.getById=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorById(id).then((result=>getEditorResponseData(result))).then((resp=>{const update=Object.assign(Object.assign({},resp),{parsedData:null});return resp.parsedData&&(update.parsedData=ConnectorController_classPrivateFieldGet(this,_ConnectorController_connectorCompatibilityTools,"f").makeSingleConnectorBackwardsCompatible(resp.parsedData,ConnectorController_classPrivateFieldGet(this,_ConnectorController_localConfig,"f").get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl))),update}))})),this.getAllByType=type=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectors(type).then((result=>getEditorResponseData(result))).then((resp=>{const update=Object.assign(Object.assign({},resp),{parsedData:null});return resp.parsedData&&(update.parsedData=ConnectorController_classPrivateFieldGet(this,_ConnectorController_connectorCompatibilityTools,"f").makeMultipleConnectorsBackwardsCompatible(resp.parsedData,ConnectorController_classPrivateFieldGet(this,_ConnectorController_localConfig,"f").get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl))),update}))})),this.register=registration=>ConnectorController_awaiter(this,void 0,void 0,(function*(){const res=yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f"),connectorRegistration=ConnectorController_classPrivateFieldGet(this,_ConnectorController_connectorCompatibilityTools,"f").makeConnectorSourceForwardsCompatible(registration);return res.registerConnector(JSON.stringify(connectorRegistration)).then((result=>getEditorResponseData(result)))})),this.unregister=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).unregisterConnector(id).then((result=>getEditorResponseData(result)))})),this.configure=(id,configurationCallback)=>ConnectorController_awaiter(this,void 0,void 0,(function*(){const res=yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f");return yield this.waitToBeReady(id),yield configurationCallback(new ConnectorConfigurator(id,res)),res.updateConnectorConfiguration(id).then((result=>getEditorResponseData(result)))})),this.getState=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorState(id).then((result=>getEditorResponseData(result)))})),this.getOptions=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorOptions(id).then((result=>getEditorResponseData(result)))})),this.waitToBeReady=(id,timeoutMilliseconds=2e3)=>ConnectorController_awaiter(this,void 0,void 0,(function*(){let timeout=Math.max(timeoutMilliseconds,500);timeout=Math.min(timeout,5e3);let retries=0;try{for(;100*retries<timeout;){const result=yield this.getState(id);if(result.success&&result.parsedData&&(result.parsedData.type===ConnectorStateType.running||result.parsedData.type===ConnectorStateType.ready))return getEditorResponseData({data:null,success:!0,error:void 0,status:0,parsedData:void 0},!1);yield new Promise((resolve=>setTimeout(resolve,100))),retries++}}catch(err){return getEditorResponseData({data:null,success:!1,error:`Error while getting connector state ${err}`,status:5e4,parsedData:void 0},!1)}return getEditorResponseData({data:null,success:!1,error:"Timed out waiting for connector",status:5e4,parsedData:void 0},!1)})),ConnectorController_classPrivateFieldSet(this,_ConnectorController_editorAPI,editorAPI,"f"),ConnectorController_classPrivateFieldSet(this,_ConnectorController_localConfig,localConfig,"f"),ConnectorController_classPrivateFieldSet(this,_ConnectorController_connectorCompatibilityTools,new ConnectorCompatibilityTools,"f")}getMappings(id,direction){return ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorMappings(id).then((result=>getEditorResponseData(result))).then((result=>{var _a;return direction?Object.assign(Object.assign({},result),{parsedData:null===(_a=result.parsedData)||void 0===_a?void 0:_a.filter((cm=>cm.direction===direction))}):result}))}))}}_ConnectorController_editorAPI=new WeakMap,_ConnectorController_localConfig=new WeakMap,_ConnectorController_connectorCompatibilityTools=new WeakMap;class ConnectorConfigurator{constructor(id,res){_ConnectorConfigurator_connectorId.set(this,void 0),_ConnectorConfigurator_res.set(this,void 0),this.setOptions=options=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_res,"f").setConnectorOptions(ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_connectorId,"f"),JSON.stringify(options)).then((result=>getEditorResponseData(result)))})),this.setMappings=mappings=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return getEditorResponseData(yield ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_res,"f").setConnectorMappings(ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_connectorId,"f"),mappings.map((function(m){return JSON.stringify(m)}))))})),this.setHttpHeader=(headerName,headerValue)=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_res,"f").connectorAuthenticationSetHttpHeader(ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_connectorId,"f"),headerName,headerValue).then((result=>getEditorResponseData(result)))})),ConnectorController_classPrivateFieldSet(this,_ConnectorConfigurator_connectorId,id,"f"),ConnectorController_classPrivateFieldSet(this,_ConnectorConfigurator_res,res,"f")}}_ConnectorConfigurator_connectorId=new WeakMap,_ConnectorConfigurator_res=new WeakMap;var _DebugController_editorAPI,DebugController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DebugController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DebugController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DebugController{constructor(editorAPI){_DebugController_editorAPI.set(this,void 0),this.getAllLogs=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).getLogs().then((result=>getEditorResponseData(result)))})),this.toggleDebugPanel=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).toggleDebugPanel().then((result=>getEditorResponseData(result)))})),this.enableDebug=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).enableDebug().then((result=>getEditorResponseData(result)))})),this.disableDebug=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).disableDebug().then((result=>getEditorResponseData(result)))})),DebugController_classPrivateFieldSet(this,_DebugController_editorAPI,editorAPI,"f")}}_DebugController_editorAPI=new WeakMap;var _DocumentController_editorAPI,AutoGrowDirection,ImageSourceTypeEnum,FrameTypeEnum,BarcodeSourceTypeEnum,TextDirection,FlowDirection,VerticalAlign,BlendMode,FitMode,UpdateZIndexMethod,FrameAnchorType,AnchorTargetType,AnchorTargetEdgeType,DocumentController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DocumentController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DocumentController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DocumentController{constructor(editorAPI){_DocumentController_editorAPI.set(this,void 0),this.getCurrentState=()=>DocumentController_awaiter(this,void 0,void 0,(function*(){return(yield DocumentController_classPrivateFieldGet(this,_DocumentController_editorAPI,"f")).getCurrentDocumentState().then((result=>getEditorResponseData(result)))})),this.load=(doc,options={keepConnectors:!1})=>DocumentController_awaiter(this,void 0,void 0,(function*(){const res=yield DocumentController_classPrivateFieldGet(this,_DocumentController_editorAPI,"f"),parsedDoc="string"!=typeof doc?JSON.stringify(doc):doc;return res.loadDocument(parsedDoc,JSON.stringify(options)).then((result=>getEditorResponseData(result)))})),this.createAndLoad=preset=>DocumentController_awaiter(this,void 0,void 0,(function*(){const res=yield DocumentController_classPrivateFieldGet(this,_DocumentController_editorAPI,"f"),parsedDoc=JSON.stringify(preset);return res.createAndLoadDocument(parsedDoc).then((result=>getEditorResponseData(result)))})),DocumentController_classPrivateFieldSet(this,_DocumentController_editorAPI,editorAPI,"f")}}_DocumentController_editorAPI=new WeakMap,function(AutoGrowDirection){AutoGrowDirection.top="top",AutoGrowDirection.bottom="bottom",AutoGrowDirection.left="left",AutoGrowDirection.right="right"}(AutoGrowDirection||(AutoGrowDirection={})),function(ImageSourceTypeEnum){ImageSourceTypeEnum.url="url",ImageSourceTypeEnum.variable="variable",ImageSourceTypeEnum.connector="connector"}(ImageSourceTypeEnum||(ImageSourceTypeEnum={})),function(FrameTypeEnum){FrameTypeEnum.text="text",FrameTypeEnum.image="image",FrameTypeEnum.shape="shape",FrameTypeEnum.barcode="barcode"}(FrameTypeEnum||(FrameTypeEnum={})),function(BarcodeSourceTypeEnum){BarcodeSourceTypeEnum.variable="variable",BarcodeSourceTypeEnum.text="text"}(BarcodeSourceTypeEnum||(BarcodeSourceTypeEnum={})),function(TextDirection){TextDirection.leftToRight="leftToRight",TextDirection.rightToLeft="rightToLeft",TextDirection.weak="weak"}(TextDirection||(TextDirection={})),function(FlowDirection){FlowDirection.horizontal="horizontal",FlowDirection.vertical="vertical",FlowDirection.onPath="onPath"}(FlowDirection||(FlowDirection={})),function(VerticalAlign){VerticalAlign.top="top",VerticalAlign.bottom="bottom",VerticalAlign.middle="middle",VerticalAlign.justify="justify"}(VerticalAlign||(VerticalAlign={})),function(BlendMode){BlendMode.normal="normal",BlendMode.screen="screen",BlendMode.overlay="overlay",BlendMode.darken="darken",BlendMode.lighten="lighten",BlendMode.colorDodge="colorDodge",BlendMode.colorBurn="colorBurn",BlendMode.hardLight="hardLight",BlendMode.softLight="softLight",BlendMode.difference="difference",BlendMode.exclusion="exclusion",BlendMode.multiply="multiply",BlendMode.hue="hue",BlendMode.saturation="saturation",BlendMode.color="color",BlendMode.luminosity="luminosity"}(BlendMode||(BlendMode={})),function(FitMode){FitMode.fit="fit",FitMode.fill="fill"}(FitMode||(FitMode={})),function(UpdateZIndexMethod){UpdateZIndexMethod.bringToFront="bringToFront",UpdateZIndexMethod.sendToBack="sendToBack",UpdateZIndexMethod.bringForward="bringForward",UpdateZIndexMethod.sendBackward="sendBackward"}(UpdateZIndexMethod||(UpdateZIndexMethod={})),function(FrameAnchorType){FrameAnchorType.relative="relative",FrameAnchorType.start="start",FrameAnchorType.end="end",FrameAnchorType.startAndEnd="startAndEnd",FrameAnchorType.center="center"}(FrameAnchorType||(FrameAnchorType={})),function(AnchorTargetType){AnchorTargetType.page="page",AnchorTargetType.frame="frame"}(AnchorTargetType||(AnchorTargetType={})),function(AnchorTargetEdgeType){AnchorTargetEdgeType.start="start",AnchorTargetEdgeType.end="end",AnchorTargetEdgeType.center="center"}(AnchorTargetEdgeType||(AnchorTargetEdgeType={}));class PageAnchorTarget{constructor(){this.type=AnchorTargetType.page}}class FrameAnchorTarget{constructor(id,edge){this.type=AnchorTargetType.frame,this.frameId=id,this.edge=edge}}var _ExperimentController_editorAPI,ExperimentController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ExperimentController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ExperimentController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ExperimentController{constructor(editorAPI){_ExperimentController_editorAPI.set(this,void 0),this.insertImageVariableToFrame=(imageFrameId,variableId)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){const res=yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f"),src={id:variableId,type:ImageSourceTypeEnum.variable};return res.setImageSource(imageFrameId,JSON.stringify(src)).then((result=>getEditorResponseData(result)))})),this.insertTextVariable=id=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).insertTextVariable(id).then((result=>getEditorResponseData(result)))})),this.enterTextEditMode=id=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).enterTextEditMode(id).then((result=>getEditorResponseData(result)))})),this.exitTextEditMode=()=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).exitTextEditMode().then((result=>getEditorResponseData(result)))})),this.getText=(frameId,textType)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).getTextByFrameId(frameId,textType).then((result=>getEditorResponseData(result)))})),this.setText=(frameId,text)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).setTextByFrameId(frameId,text).then((result=>getEditorResponseData(result)))})),this.selectText=(frameId,startIndex,length)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).selectTextById(frameId,startIndex,length).then((result=>getEditorResponseData(result)))})),ExperimentController_classPrivateFieldSet(this,_ExperimentController_editorAPI,editorAPI,"f")}}_ExperimentController_editorAPI=new WeakMap;var _FontConnectorController_editorAPI,_FontConnectorController_blobAPI,FontConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},FontConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},FontConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class FontConnectorController{constructor(editorAPI){_FontConnectorController_editorAPI.set(this,void 0),_FontConnectorController_blobAPI.set(this,void 0),this.query=(connectorId,queryOptions,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorQuery(connectorId,JSON.stringify(queryOptions),JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.detail=(connectorId,fontFamilyId,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorDetail(connectorId,fontFamilyId,JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.download=(connectorId,fontStyleId,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_blobAPI,"f")).fontConnectorDownload(connectorId,fontStyleId,JSON.stringify(context)).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.preview=(connectorId,fontFamilyId,previewFormat,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_blobAPI,"f")).fontConnectorPreview(connectorId,fontFamilyId,previewFormat,JSON.stringify(context)).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.getConfigurationOptions=connectorId=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorGetConfigurationOptions(connectorId).then((result=>getEditorResponseData(result)))})),this.getCapabilities=connectorId=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorGetCapabilities(connectorId).then((result=>getEditorResponseData(result)))})),this.parseDeprecatedFontType=deprecatedType=>deprecatedType===DeprecatedMediaType.file?MediaType.file:deprecatedType===DeprecatedMediaType.collection?MediaType.collection:void 0,FontConnectorController_classPrivateFieldSet(this,_FontConnectorController_editorAPI,editorAPI,"f"),FontConnectorController_classPrivateFieldSet(this,_FontConnectorController_blobAPI,editorAPI,"f")}}_FontConnectorController_editorAPI=new WeakMap,_FontConnectorController_blobAPI=new WeakMap;var _FontController_editorAPI,FontController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},FontController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},FontController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class FontController{constructor(editorAPI){_FontController_editorAPI.set(this,void 0),this.addFontFamily=(connectorId,fontFamily)=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).addFontFamily(connectorId,JSON.stringify(fontFamily)).then((result=>getEditorResponseData(result)))})),this.removeFontFamily=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).removeFontFamily(id).then((result=>getEditorResponseData(result)))})),this.addFontStyle=(connectorId,fontStyle)=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).addFontStyle(connectorId,JSON.stringify(fontStyle)).then((result=>getEditorResponseData(result)))})),this.removeFontStyle=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).removeFontStyle(id).then((result=>getEditorResponseData(result)))})),this.getFontFamilies=()=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontFamilies().then((result=>getEditorResponseData(result)))})),this.getFontStyles=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontStyles(id).then((result=>getEditorResponseData(result)))})),this.getFontFamilyById=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontFamilyById(id).then((result=>getEditorResponseData(result)))})),this.getFontStyleById=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontStyleById(id).then((result=>getEditorResponseData(result)))})),this.getDefaultFontStyle=()=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getDefaultFontStyle().then((result=>getEditorResponseData(result)))})),this.getDefaultFontFamily=()=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getDefaultFontFamily().then((result=>getEditorResponseData(result)))})),this.isFontFamilyUsed=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).isFontFamilyUsed(id).then((result=>getEditorResponseData(result)))})),this.isFontStyleUsed=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).isFontStyleUsed(id).then((result=>getEditorResponseData(result)))})),this.moveFontFamilies=(order,ids)=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).moveFontFamilies(order,ids).then((result=>getEditorResponseData(result)))})),FontController_classPrivateFieldSet(this,_FontController_editorAPI,editorAPI,"f")}}_FontController_editorAPI=new WeakMap;var _ShapeController_editorAPI,ShapeController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ShapeController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ShapeController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ShapeController{constructor(editorAPI){_ShapeController_editorAPI.set(this,void 0),this.setShapeProperties=(id,properties)=>ShapeController_awaiter(this,void 0,void 0,(function*(){return(yield ShapeController_classPrivateFieldGet(this,_ShapeController_editorAPI,"f")).setShapeProperties(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.setEnableFill=(id,enableFill)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={enableFill};return this.setShapeProperties(id,properties)})),this.setFillColor=(id,fillColor)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={fillColor};return this.setShapeProperties(id,properties)})),this.setEnableStroke=(id,enableStroke)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={enableStroke};return this.setShapeProperties(id,properties)})),this.setStrokeColor=(id,strokeColor)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={strokeColor};return this.setShapeProperties(id,properties)})),this.setStrokeWeight=(id,strokeWeight)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={strokeWeight};return this.setShapeProperties(id,properties)})),this.setFlagAllCornersSame=(id,allCornersSame)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={allCornersSame};return this.setShapeProperties(id,properties)})),this.setShapeCorners=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){return(yield ShapeController_classPrivateFieldGet(this,_ShapeController_editorAPI,"f")).setShapeCorners(id,JSON.stringify(radius)).then((result=>getEditorResponseData(result)))})),this.setRadiusAll=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={radiusAll:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusTopLeft=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={topLeft:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusBottomLeft=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={bottomLeft:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusTopRight=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={topRight:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusBottomRight=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={bottomRight:radius};return this.setShapeCorners(id,cornerRadius)})),ShapeController_classPrivateFieldSet(this,_ShapeController_editorAPI,editorAPI,"f")}}_ShapeController_editorAPI=new WeakMap;var _FrameController_editorAPI,PositionEnum,LayoutType,MeasurementUnit,LayoutIntent,FrameController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},FrameController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},FrameController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class FrameController{constructor(editorAPI){_FrameController_editorAPI.set(this,void 0),this.getAll=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFrames().then((result=>getEditorResponseData(result)))})),this.getSelected=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getSelectedFrames().then((result=>getEditorResponseData(result)))})),this.getAllByPageId=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramesByPageId(id).then((result=>getEditorResponseData(result)))})),this.getByName=name=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFrameByName(name).then((result=>getEditorResponseData(result)))})),this.getById=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFrameById(id).then((result=>getEditorResponseData(result)))})),this.getPropertiesOnSelectedLayout=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramePropertiesOnSelectedLayout().then((result=>getEditorResponseData(result)))})),this.getLayoutProperties=(id,layoutId)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramePropertiesByFrameId(id,layoutId).then((result=>getEditorResponseData(result)))})),this.getAllLayoutProperties=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramesProperties(id).then((result=>getEditorResponseData(result)))})),this.resetTransformation=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetSize=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.select=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).selectFrames([id]).then((result=>getEditorResponseData(result)))})),this.selectMultiple=ids=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).selectFrames(ids).then((result=>getEditorResponseData(result)))})),this.reorderFrames=(order,ids)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).reorderFrames(order,ids).then((result=>getEditorResponseData(result)))})),this.setZIndex=(id,method)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameZIndex(id,method).then((result=>getEditorResponseData(result)))})),this.setHeight=(id,height)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameHeight(id,height).then((result=>getEditorResponseData(result)))})),this.setRotation=(id,rotation)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameRotation(id,rotation).then((result=>getEditorResponseData(result)))})),this.setWidth=(id,width)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameWidth(id,width).then((result=>getEditorResponseData(result)))})),this.setX=(id,XValue)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameX(id,XValue).then((result=>getEditorResponseData(result)))})),this.setY=(id,YValue)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameY(id,YValue).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).renameFrame(id,name).then((result=>getEditorResponseData(result)))})),this.reset=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrame(id).then((result=>getEditorResponseData(result)))})),this.resetX=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetY=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetRotation=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetWidth=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetHeight=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetImageFrameFitMode=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetImageFrameFitMode(id).then((result=>getEditorResponseData(result)))})),this.setVisibility=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameIsVisible(id,value).then((result=>getEditorResponseData(result)))})),this.setIsVisible=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameIsVisible(id,value).then((result=>getEditorResponseData(result)))})),this.remove=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).removeFrames([id]).then((result=>getEditorResponseData(result)))})),this.removeFrames=ids=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).removeFrames(ids).then((result=>getEditorResponseData(result)))})),this.create=(type,x,y,width,height)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).addFrame(type,x,y,width,height).then((result=>getEditorResponseData(result)))})),this.createShapeFrame=(type,x,y,width,height)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).addFrame(type,x,y,width,height).then((result=>getEditorResponseData(result)))})),this.createBarcodeFrame=(type,position)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).addBarcodeFrame(type,null==position?void 0:position.x,null==position?void 0:position.y).then((result=>getEditorResponseData(result)))})),this.duplicateFrames=ids=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).duplicateFrames(ids).then((result=>getEditorResponseData(result)))})),this.updateImageSource=(imageFrameId,src)=>FrameController_awaiter(this,void 0,void 0,(function*(){const res=yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f"),srcJson=null!==src?JSON.stringify(src):null;return res.setImageSource(imageFrameId,srcJson).then((result=>getEditorResponseData(result)))})),this.removeImageSource=imageFrameId=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.updateImageSource(imageFrameId,null)})),this.setImageFromConnector=(imageFrameId,connectorId,assetId)=>FrameController_awaiter(this,void 0,void 0,(function*(){const src={id:connectorId,assetId,type:ImageSourceTypeEnum.connector};return this.updateImageSource(imageFrameId,src)})),this.setImageFromUrl=(imageFrameId,url)=>FrameController_awaiter(this,void 0,void 0,(function*(){const source={url,type:ImageSourceTypeEnum.url};return this.updateImageSource(imageFrameId,source)})),this.setImageFrameFitMode=(imageFrameId,fitMode)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setImageFrameFitMode(imageFrameId,fitMode).then((result=>getEditorResponseData(result)))})),this.setFrameConstrainProportions=(id,constrainProportions)=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("setFrameConstrainProportions is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"setFrameConstrainProportions is not supported anymore",parsedData:null})})),this.setVerticalAlign=(id,verticalAlign)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setVerticalAlignment(id,verticalAlign).then((result=>getEditorResponseData(result)))})),this.setMinCopyfitting=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setMinCopyfitting(id,value).then((result=>getEditorResponseData(result)))})),this.setMaxCopyfitting=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setMaxCopyfitting(id,value).then((result=>getEditorResponseData(result)))})),this.setEnableCopyfitting=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setEnableCopyfitting(id,value).then((result=>getEditorResponseData(result)))})),this.resetMinCopyfitting=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetMinCopyfitting(id).then((result=>getEditorResponseData(result)))})),this.resetMaxCopyfitting=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetMaxCopyfitting(id).then((result=>getEditorResponseData(result)))})),this.resetEnableCopyfitting=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetEnableCopyfitting(id).then((result=>getEditorResponseData(result)))})),this.setShapeFrameEnableFill=(shapeFrameId,enableFill)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setEnableFill(shapeFrameId,enableFill)})),this.setShapeFrameFillColor=(shapeFrameId,fillColor)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setFillColor(shapeFrameId,fillColor)})),this.setShapeFrameEnableStroke=(shapeFrameId,enableStroke)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setEnableStroke(shapeFrameId,enableStroke)})),this.setShapeFrameStrokeColor=(shapeFrameId,strokeColor)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setStrokeColor(shapeFrameId,strokeColor)})),this.setShapeFrameStrokeWeight=(shapeFrameId,strokeWeight)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setStrokeWeight(shapeFrameId,strokeWeight)})),this.setBlendMode=(id,blendMode)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameBlendMode(id,blendMode).then((result=>getEditorResponseData(result)))})),this.enterCropMode=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).enterCropMode(id).then((result=>getEditorResponseData(result)))})),this.applyCropMode=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).applyCropMode().then((result=>getEditorResponseData(result)))})),this.resetCropMode=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetCropMode(id).then((result=>getEditorResponseData(result)))})),this.exitCropMode=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).cancelCropMode().then((result=>getEditorResponseData(result)))})),this.setEnableAutoGrow=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={enabled:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMinWidth=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={minWidth:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMaxWidth=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={maxWidth:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMinHeight=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={minHeight:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMaxHeight=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={maxHeight:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowDirections=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={directions:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.resetAutoGrowSettingsEnabled=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowSettingsEnabled is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowSettingsEnabled is not supported anymore",parsedData:null})})),this.resetAutoGrowMinWidth=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMinWidth is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMinWidth is not supported anymore",parsedData:null})})),this.resetAutoGrowMaxWidth=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMaxWidth is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMaxWidth is not supported anymore",parsedData:null})})),this.resetAutoGrowMinHeight=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMinHeight is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMinHeight is not supported anymore",parsedData:null})})),this.resetAutoGrowMaxHeight=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMaxHeight is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMaxHeight is not supported anymore",parsedData:null})})),this.resetAutoGrowDirections=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowDirections is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowDirections is not supported anymore",parsedData:null})})),this.resetAutoGrow=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrow is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrow is not supported anymore",parsedData:null})})),this.setAnchor=(id,horizontal,anchorType,anchorTarget,endAnchorTarget)=>FrameController_awaiter(this,void 0,void 0,(function*(){const properties={horizontal,type:anchorType,target:anchorTarget,endTarget:endAnchorTarget};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setAnchorProperties(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.setVerticalAnchor=(id,anchorType,anchorTarget,endAnchorTarget)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.setAnchor(id,!1,anchorType,anchorTarget,endAnchorTarget)})),this.setHorizontalAnchor=(id,anchorType,anchorTarget,endAnchorTarget)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.setAnchor(id,!0,anchorType,anchorTarget,endAnchorTarget)})),this.resetAnchoring=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),FrameController_classPrivateFieldSet(this,_FrameController_editorAPI,editorAPI,"f"),this.shapeController=new ShapeController(FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f"))}}_FrameController_editorAPI=new WeakMap,function(PositionEnum){PositionEnum.top="top",PositionEnum.right="right",PositionEnum.bottom="bottom",PositionEnum.left="left"}(PositionEnum||(PositionEnum={})),function(LayoutType){LayoutType.top="top",LayoutType.child="child"}(LayoutType||(LayoutType={})),function(MeasurementUnit){MeasurementUnit.px="px",MeasurementUnit.mm="mm",MeasurementUnit.cm="cm",MeasurementUnit.inch="inch",MeasurementUnit.pt="pt"}(MeasurementUnit||(MeasurementUnit={})),function(LayoutIntent){LayoutIntent.print="print",LayoutIntent.digitalStatic="digitalStatic",LayoutIntent.digitalAnimated="digitalAnimated"}(LayoutIntent||(LayoutIntent={}));var _LayoutController_editorAPI,_LayoutController_blobAPI,MediaDownloadType,MediaDownloadIntent,LayoutController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},LayoutController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},LayoutController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class LayoutController{constructor(editorAPI){_LayoutController_editorAPI.set(this,void 0),_LayoutController_blobAPI.set(this,void 0),this.getAll=()=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayouts().then((result=>getEditorResponseData(result)))})),this.getById=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayoutById(id).then((result=>getEditorResponseData(result)))})),this.getByName=name=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayoutByName(name).then((result=>getEditorResponseData(result)))})),this.getSelected=()=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getSelectedLayout().then((result=>getEditorResponseData(result)))})),this.remove=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).removeLayout(id).then((result=>getEditorResponseData(result)))})),this.create=(parentId,presets)=>LayoutController_awaiter(this,void 0,void 0,(function*(){const res=yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f");return(null==presets?void 0:presets.length)?res.addLayouts(parentId,JSON.stringify(presets)).then((result=>getEditorResponseData(result))):res.addLayout(parentId).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).renameLayout(id,name).then((result=>getEditorResponseData(result)))})),this.select=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).selectLayout(id).then((result=>getEditorResponseData(result)))})),this.duplicate=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).duplicateLayout(id).then((result=>getEditorResponseData(result)))})),this.reset=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayout(id).then((result=>getEditorResponseData(result)))})),this.setHeight=(id,height)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutHeight(id,height).then((result=>getEditorResponseData(result)))})),this.setWidth=(id,width)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutWidth(id,width).then((result=>getEditorResponseData(result)))})),this.setUnit=(id,unit)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutUnit(id,unit).then((result=>getEditorResponseData(result)))})),this.resetHeight=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutHeight(id).then((result=>getEditorResponseData(result)))})),this.resetWidth=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutWidth(id).then((result=>getEditorResponseData(result)))})),this.resetUnit=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutUnit(id).then((result=>getEditorResponseData(result)))})),this.getSelectedSnapshot=()=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_blobAPI,"f")).getPageSnapshot().then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.setIntent=(id,intent)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutIntent(id,intent).then((result=>getEditorResponseData(result)))})),this.resetIntent=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutIntent(id).then((result=>getEditorResponseData(result)))})),this.setFillColor=(id,color)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutFillColor(id,JSON.stringify(color)).then((result=>getEditorResponseData(result)))})),this.setFillColorEnabled=(id,enabled)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutFillColorEnabled(id,enabled).then((result=>getEditorResponseData(result)))})),this.resetFillColor=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutFillColor(id).then((result=>getEditorResponseData(result)))})),this.setBleedValue=(id,value,position)=>LayoutController_awaiter(this,void 0,void 0,(function*(){const update=position?{left:position===PositionEnum.left?value:void 0,top:position===PositionEnum.top?value:void 0,right:position===PositionEnum.right?value:void 0,bottom:position===PositionEnum.bottom?value:void 0}:{left:value,top:value,right:value,bottom:value};return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).updateLayoutBleed(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAreBleedValuesCombined=(id,value)=>LayoutController_awaiter(this,void 0,void 0,(function*(){const update={areBleedValuesCombined:value};return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).updateLayoutBleed(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.resetBleedValues=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).updateLayoutBleed(id,null).then((result=>getEditorResponseData(result)))})),LayoutController_classPrivateFieldSet(this,_LayoutController_editorAPI,editorAPI,"f"),LayoutController_classPrivateFieldSet(this,_LayoutController_blobAPI,editorAPI,"f")}}_LayoutController_editorAPI=new WeakMap,_LayoutController_blobAPI=new WeakMap,function(MediaDownloadType){MediaDownloadType.thumbnail="thumbnail",MediaDownloadType.mediumres="mediumres",MediaDownloadType.highres="highres",MediaDownloadType.original="original"}(MediaDownloadType||(MediaDownloadType={})),function(MediaDownloadIntent){MediaDownloadIntent.web="web"}(MediaDownloadIntent||(MediaDownloadIntent={}));var _MediaConnectorController_editorAPI,_MediaConnectorController_blobAPI,MediaConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},MediaConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},MediaConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class MediaConnectorController{constructor(editorAPI){_MediaConnectorController_editorAPI.set(this,void 0),_MediaConnectorController_blobAPI.set(this,void 0),this.query=(id,queryOptions,context={})=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorQuery(id,JSON.stringify(queryOptions),JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.detail=(id,mediaId,context={})=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorDetail(id,mediaId,JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.download=(id,mediaId,downloadType,context={})=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){const compatibleDownloadType=this.parseDeprecatedMediaDownloadType(downloadType);return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_blobAPI,"f")).mediaConnectorDownload(id,mediaId,compatibleDownloadType,MediaDownloadIntent.web,JSON.stringify(context)).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.getConfigurationOptions=id=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorGetConfigurationOptions(id).then((result=>getEditorResponseData(result)))})),this.getCapabilities=id=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorGetCapabilities(id).then((result=>getEditorResponseData(result)))})),this.parseDeprecatedMediaType=deprecatedType=>deprecatedType===DeprecatedMediaType.file?MediaType.file:deprecatedType===DeprecatedMediaType.collection?MediaType.collection:void 0,MediaConnectorController_classPrivateFieldSet(this,_MediaConnectorController_editorAPI,editorAPI,"f"),MediaConnectorController_classPrivateFieldSet(this,_MediaConnectorController_blobAPI,editorAPI,"f")}parseDeprecatedMediaDownloadType(deprecatedMediaDownloadType){switch(deprecatedMediaDownloadType){case DeprecatedMediaConnectorDownloadType.HighResolutionWeb:return MediaDownloadType.highres;case DeprecatedMediaConnectorDownloadType.LowResolutionWeb:return MediaDownloadType.thumbnail;default:return deprecatedMediaDownloadType}}}_MediaConnectorController_editorAPI=new WeakMap,_MediaConnectorController_blobAPI=new WeakMap;var _PageController_editorAPI,_PageController_blobAPI,PageController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},PageController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},PageController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class PageController{constructor(editorAPI){_PageController_editorAPI.set(this,void 0),_PageController_blobAPI.set(this,void 0),this.add=()=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).addPage().then((result=>getEditorResponseData(result)))})),this.remove=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).removePage(pageId).then((result=>getEditorResponseData(result)))})),this.select=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).selectPage(pageId).then((result=>getEditorResponseData(result)))})),this.setVisibility=(pageId,isVisible)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).setPageIsVisible(pageId,isVisible).then((result=>getEditorResponseData(result)))})),this.duplicate=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).duplicatePage(pageId).then((result=>getEditorResponseData(result)))})),this.getAll=()=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).getPages().then((result=>getEditorResponseData(result)))})),this.getById=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).getPageById(pageId).then((result=>getEditorResponseData(result)))})),this.getSnapshot=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_blobAPI,"f")).getPageSnapshot(pageId).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.setWidth=(pageId,width)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).setPageWidth(pageId,width).then((result=>getEditorResponseData(result)))})),this.setHeight=(id,height)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).setPageHeight(id,height).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).reorderPages(order,ids).then((result=>getEditorResponseData(result)))})),PageController_classPrivateFieldSet(this,_PageController_editorAPI,editorAPI,"f"),PageController_classPrivateFieldSet(this,_PageController_blobAPI,editorAPI,"f")}}_PageController_editorAPI=new WeakMap,_PageController_blobAPI=new WeakMap;var _ParagraphStyleController_editorAPI,VariableType,Day,Locale,ParagraphStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ParagraphStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ParagraphStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ParagraphStyleController{constructor(editorAPI){_ParagraphStyleController_editorAPI.set(this,void 0),this.getAll=()=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).getParagraphStyles().then((result=>getEditorResponseData(result)))})),this.getById=id=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).getParagraphStyleById(id).then((result=>getEditorResponseData(result)))})),this.create=()=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).createParagraphStyle().then((result=>getEditorResponseData(result)))})),this.duplicate=id=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).duplicateParagraphStyle(id).then((result=>getEditorResponseData(result)))})),this.update=(id,properties)=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).updateParagraphStyle(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).renameParagraphStyle(id,name).then((result=>getEditorResponseData(result)))})),this.remove=id=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).removeParagraphStyle(id).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).moveParagraphStyles(order,ids).then((result=>getEditorResponseData(result)))})),ParagraphStyleController_classPrivateFieldSet(this,_ParagraphStyleController_editorAPI,editorAPI,"f")}}_ParagraphStyleController_editorAPI=new WeakMap,function(VariableType){VariableType.shortText="shortText",VariableType.longText="longText",VariableType.image="image",VariableType.list="list",VariableType.boolean="boolean",VariableType.group="group",VariableType.number="number",VariableType.date="date"}(VariableType||(VariableType={})),function(Day){Day.Monday="monday",Day.Tuesday="tuesday",Day.Wednesday="wednesday",Day.Thursday="thursday",Day.Friday="friday",Day.Saturday="saturday",Day.Sunday="sunday"}(Day||(Day={})),function(Locale){Locale.en_US="en_US",Locale.cs="cs",Locale.da="da",Locale.nl="nl",Locale.fi="fi",Locale.fr="fr",Locale.de="de",Locale.it="it",Locale.no="no",Locale.pl="pl",Locale.pt_PT="pt_PT",Locale.es_ES="es_ES",Locale.sv="sv"}(Locale||(Locale={}));var SubscriberController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};class SubscriberController{constructor(config,localConfig){this.onActionsChanged=actions=>{const callBack=this.config.onActionsChanged;callBack&&callBack(JSON.parse(actions))},this.onAnimationChanged=animation=>{const callBack=this.config.onFrameAnimationsChanged;callBack&&callBack(JSON.parse(animation))},this.onAnimationPlaybackChanged=animationPlaybackState=>{const callBack=this.config.onScrubberPositionChanged;callBack&&callBack(JSON.parse(animationPlaybackState))},this.onSelectedLayoutPropertiesChanged=layoutProperties=>{const callBack=this.config.onSelectedLayoutPropertiesChanged;callBack&&callBack(JSON.parse(layoutProperties))},this.onSelectedLayoutUnitChanged=unit=>{const callBack=this.config.onSelectedLayoutUnitChanged;callBack&&callBack(unit)},this.onSelectedFramesLayoutChanged=framesLayout=>{const frames=JSON.parse(framesLayout),multiFrameCallBack=this.config.onSelectedFramesLayoutChanged;multiFrameCallBack&&multiFrameCallBack(frames);const singleFrameCallBack=this.config.onSelectedFrameLayoutChanged;singleFrameCallBack&&singleFrameCallBack(frames.length>1?void 0:frames[0])},this.onSelectedFramesContentChanged=framesContent=>{const frames=JSON.parse(framesContent),multiFrameCallBack=this.config.onSelectedFramesContentChanged;multiFrameCallBack&&multiFrameCallBack(frames);const singleFrameCallBack=this.config.onSelectedFrameContentChanged;singleFrameCallBack&&singleFrameCallBack(frames.length>1?null:frames[0])},this.onStateChanged=()=>{const callBack=this.config.onStateChanged;callBack&&callBack()},this.onAuthExpired=authRefreshRequest=>SubscriberController_awaiter(this,void 0,void 0,(function*(){const callBack=this.config.onAuthExpired;if(!callBack)return null;const authCredentials=yield callBack(JSON.parse(authRefreshRequest));return null!=authCredentials?JSON.stringify(authCredentials):null})),this.onViewportRequested=()=>{const callBack=this.config.onViewportRequested;if(!callBack)return null;const viewport=callBack();return null!=viewport?JSON.stringify(viewport):null},this.onDocumentLoaded=()=>{const callBack=this.config.onDocumentLoaded;callBack&&callBack()},this.onPageSelectionChanged=id=>{const callBack=this.config.onPageSelectionChanged;callBack&&callBack(id)},this.onVariableListChanged=variablesJson=>{const callBack=this.config.onVariableListChanged;if(!callBack)return;callBack(JSON.parse(variablesJson).map((variable=>{var _a;return variable.type===VariableType.list?Object.assign(Object.assign({},variable),{items:variable.items.map((item=>item.value)),selected:null===(_a=variable.selected)||void 0===_a?void 0:_a.value}):variable})))},this.onSelectedToolChanged=tool=>{const callBack=this.config.onSelectedToolChanged;callBack&&callBack(tool)},this.onUndoStateChanged=undoState=>{const callBack=this.config.onUndoStackStateChanged;callBack&&callBack(JSON.parse(undoState))},this.onSelectedLayoutFramesChanged=layoutFrames=>{const callBack=this.config.onSelectedLayoutFramesChanged;callBack&&callBack(JSON.parse(layoutFrames))},this.onSelectedTextStyleChanged=styles=>{const callBack=this.config.onSelectedTextStyleChanged;callBack&&callBack(JSON.parse(styles))},this.onColorsChanged=colors=>{const callBack=this.config.onColorsChanged;callBack&&callBack(JSON.parse(colors))},this.onParagraphStylesChanged=paragraphStyles=>{const callBack=this.config.onParagraphStylesChanged;callBack&&callBack(JSON.parse(paragraphStyles))},this.onCharacterStylesChanged=characterStyles=>{const callBack=this.config.onCharacterStylesChanged;callBack&&callBack(JSON.parse(characterStyles))},this.onFontFamiliesChanged=fonts=>{const callBack=this.config.onFontFamiliesChanged;callBack&&callBack(JSON.parse(fonts))},this.onSelectedLayoutIdChanged=id=>{const callBack=this.config.onSelectedLayoutIdChanged;callBack&&callBack(id)},this.onLayoutsChanged=layouts=>{const callBack=this.config.onLayoutsChanged;callBack&&callBack(JSON.parse(layouts))},this.onZoomChanged=zoom=>{const callBack=this.config.onZoomChanged;callBack&&callBack(JSON.parse(zoom))},this.onConnectorEvent=connectorEvent=>{const callBack=this.config.onConnectorEvent;callBack&&callBack(JSON.parse(connectorEvent))},this.onConnectorsChanged=connectors=>{const callBack=this.config.onConnectorsChanged,compatibleConnectors=(new ConnectorCompatibilityTools).makeMultipleConnectorsBackwardsCompatible(JSON.parse(connectors),this.localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl));callBack&&callBack(compatibleConnectors)},this.onSelectedPageIdChanged=pageId=>{const callBack=this.config.onSelectedPageIdChanged;callBack&&callBack(pageId)},this.onPagesChanged=pages=>{const callBack=this.config.onPagesChanged;callBack&&callBack(JSON.parse(pages))},this.onPageSnapshotInvalidated=page=>{const callBack=this.config.onPageSnapshotInvalidated;callBack&&callBack(JSON.parse(page))},this.onPageSizeChanged=pageSize=>{const callBack=this.config.onPageSizeChanged;callBack&&callBack(JSON.parse(pageSize))},this.onShapeCornerRadiusChanged=cornerRadius=>{const callBack=this.config.onShapeCornerRadiusChanged;callBack&&callBack(JSON.parse(cornerRadius))},this.onCropActiveFrameIdChanged=id=>{const callBack=this.config.onCropActiveFrameIdChanged;callBack&&callBack(id)},this.onAsyncError=asyncError=>{const callBack=this.config.onAsyncError;callBack&&callBack(JSON.parse(asyncError))},this.onViewModeChanged=viewMode=>{const callBack=this.config.onViewModeChanged;callBack&&callBack(viewMode)},this.onBarcodeValidationChanged=validationResults=>{const callBack=this.config.onBarcodeValidationChanged;callBack&&callBack(JSON.parse(validationResults))},this.onDataSourceIdChanged=connectorId=>{const callBack=this.config.onDataSourceIdChanged;callBack&&callBack(connectorId)},this.onDocumentIssueListChanged=documentIssues=>{const callBack=this.config.onDocumentIssueListChanged;callBack&&callBack(JSON.parse(documentIssues))},this.config=config,this.localConfig=localConfig}}var _TextStyleController_editorAPI,FramePropertyNames,LayoutPropertyNames,ToolType,DownloadFormats,EnvironmentType,TextStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},TextStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},TextStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class TextStyleController{constructor(editorAPI){_TextStyleController_editorAPI.set(this,void 0),this.set=style=>TextStyleController_awaiter(this,void 0,void 0,(function*(){return(yield TextStyleController_classPrivateFieldGet(this,_TextStyleController_editorAPI,"f")).selectedTextStyleDeltaUpdate(JSON.stringify(style)).then((result=>getEditorResponseData(result)))})),this.removeSelected=()=>TextStyleController_awaiter(this,void 0,void 0,(function*(){return(yield TextStyleController_classPrivateFieldGet(this,_TextStyleController_editorAPI,"f")).selectedTextStyleClean().then((result=>getEditorResponseData(result)))})),this.getSelected=()=>TextStyleController_awaiter(this,void 0,void 0,(function*(){return(yield TextStyleController_classPrivateFieldGet(this,_TextStyleController_editorAPI,"f")).getSelectedTextStyle().then((result=>getEditorResponseData(result)))})),TextStyleController_classPrivateFieldSet(this,_TextStyleController_editorAPI,editorAPI,"f")}}_TextStyleController_editorAPI=new WeakMap,function(FramePropertyNames){FramePropertyNames.FRAME_X="frameX",FramePropertyNames.FRAME_Y="frameY",FramePropertyNames.WIDTH="width",FramePropertyNames.HEIGHT="height",FramePropertyNames.FRAME_ROTATION="frameRotation"}(FramePropertyNames||(FramePropertyNames={})),function(LayoutPropertyNames){LayoutPropertyNames.LAYOUT_HEIGHT="layoutHeight",LayoutPropertyNames.LAYOUT_WIDTH="layoutWidth",LayoutPropertyNames.BLEED_TOP="bleedTop",LayoutPropertyNames.BLEED_BOTTOM="bleedBottom",LayoutPropertyNames.BLEED_LEFT="bleedLeft",LayoutPropertyNames.BLEED_RIGHT="bleedRight",LayoutPropertyNames.BLEED_VALUES_COMBINED="areBleedValuesCombined"}(LayoutPropertyNames||(LayoutPropertyNames={})),function(ToolType){ToolType.SELECT="select",ToolType.ZOOM="zoom",ToolType.HAND="hand",ToolType.IMAGE_FRAME="imageFrame",ToolType.TEXT_FRAME="textFrame",ToolType.SHAPE_RECT="rect",ToolType.SHAPE_ELLIPSE="ellipse",ToolType.SHAPE_POLYGON="polygon"}(ToolType||(ToolType={})),function(DownloadFormats){DownloadFormats.MP4="mp4",DownloadFormats.GIF="gif",DownloadFormats.PNG="png",DownloadFormats.JPG="jpg",DownloadFormats.PDF="pdf"}(DownloadFormats||(DownloadFormats={})),function(EnvironmentType){EnvironmentType.SANDBOX="sandbox",EnvironmentType.PRODUCTION="online"}(EnvironmentType||(EnvironmentType={}));var _ToolController_editorAPI,ToolController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ToolController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ToolController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ToolController{constructor(editorAPI){_ToolController_editorAPI.set(this,void 0),this.setTool=tool=>ToolController_awaiter(this,void 0,void 0,(function*(){return(yield ToolController_classPrivateFieldGet(this,_ToolController_editorAPI,"f")).setTool(tool).then((result=>getEditorResponseData(result)))})),this.getSelected=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return(yield ToolController_classPrivateFieldGet(this,_ToolController_editorAPI,"f")).getSelectedTool().then((result=>getEditorResponseData(result)))})),this.setPointer=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SELECT)})),this.setSelect=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SELECT)})),this.setHand=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.HAND)})),this.setZoom=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.ZOOM)})),this.setTextFrame=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.TEXT_FRAME)})),this.setImageFrame=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.IMAGE_FRAME)})),this.setShapeRect=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SHAPE_RECT)})),this.setShapeEllipse=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SHAPE_ELLIPSE)})),this.setShapePolygon=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SHAPE_POLYGON)})),ToolController_classPrivateFieldSet(this,_ToolController_editorAPI,editorAPI,"f")}}_ToolController_editorAPI=new WeakMap;var _UndoManagerController_editorAPI,_UndoManagerController_advanced,_UndoManagerController_sdk,_AdvancedUndoManagerController_editorAPI,UndoManagerController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},UndoManagerController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},UndoManagerController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class UndoManagerController{constructor(children,sdk){_UndoManagerController_editorAPI.set(this,void 0),_UndoManagerController_advanced.set(this,void 0),_UndoManagerController_sdk.set(this,void 0),this.undo=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_editorAPI,"f")).undo().then((result=>getEditorResponseData(result)))})),this.redo=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_editorAPI,"f")).redo().then((result=>getEditorResponseData(result)))})),this.record=(operationName,undoOperationCallback)=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){try{yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_advanced,"f").beginIfNoneActive(operationName),yield undoOperationCallback(UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_sdk,"f"))}catch(error){throw error}finally{yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_advanced,"f").end()}})),UndoManagerController_classPrivateFieldSet(this,_UndoManagerController_editorAPI,children,"f"),UndoManagerController_classPrivateFieldSet(this,_UndoManagerController_sdk,sdk,"f"),UndoManagerController_classPrivateFieldSet(this,_UndoManagerController_advanced,new AdvancedUndoManagerController(children),"f")}}_UndoManagerController_editorAPI=new WeakMap,_UndoManagerController_advanced=new WeakMap,_UndoManagerController_sdk=new WeakMap;class AdvancedUndoManagerController{constructor(children){_AdvancedUndoManagerController_editorAPI.set(this,void 0),this.begin=operationName=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_AdvancedUndoManagerController_editorAPI,"f")).begin(operationName).then((result=>getEditorResponseData(result)))})),this.beginIfNoneActive=operationName=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_AdvancedUndoManagerController_editorAPI,"f")).beginIfNoneActive(operationName).then((result=>getEditorResponseData(result)))})),this.end=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_AdvancedUndoManagerController_editorAPI,"f")).end().then((result=>getEditorResponseData(result)))})),UndoManagerController_classPrivateFieldSet(this,_AdvancedUndoManagerController_editorAPI,children,"f")}}_AdvancedUndoManagerController_editorAPI=new WeakMap;const round=(val,precision=2)=>{const hundred=Math.pow(10,precision);return Math.round(val*hundred)/hundred};class UtilsController{constructor(){this.round=(val,precision)=>getEditorResponseData({data:String(round(val,precision)),success:!0,status:200,parsedData:null}),this.createEnvironmentBaseURL=parameters=>{const{type=EnvironmentType.SANDBOX,environment="ft-nostress",version="1"}=parameters;return`https://${environment}.${type==EnvironmentType.SANDBOX?"chili-publish-sandbox":"chili-publish"}.online/grafx/api/v${version}/environment/${environment}`}}}var _NumberVariable_editorAPI,_DateVariable_editorAPI,_VariableController_editorAPI,_VariableController_setPlaceholder,_VariableController_setHelpText,VariableController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},VariableController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},VariableController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class NumberVariable{constructor(editorAPI){_NumberVariable_editorAPI.set(this,void 0),this.setMinimum=(id,minimum)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={minValue:{value:minimum}};return this.applyPropertiesUpdate(id,update)})),this.setMaximum=(id,maximum)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={maxValue:{value:maximum}};return this.applyPropertiesUpdate(id,update)})),this.setShowStepper=(id,showStepper)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={showStepper:{value:showStepper}};return this.applyPropertiesUpdate(id,update)})),this.setStepSize=(id,stepSize)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={stepSize:{value:stepSize}};return this.applyPropertiesUpdate(id,update)})),this.setThousandsSeparator=(id,thousandsSeparator)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={thousandsSeparator:{value:thousandsSeparator}};return this.applyPropertiesUpdate(id,update)})),this.setDecimalSeparator=(id,decimalSeparator)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={decimalSeparator:{value:decimalSeparator}};return this.applyPropertiesUpdate(id,update)})),this.setDecimalCharacterStyle=(id,characterStyleId)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={decimalCharacterStyleId:{value:characterStyleId}};return this.applyPropertiesUpdate(id,update)})),this.setNumberOfDecimals=(id,numberOfDecimals)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={numberOfDecimals:{value:numberOfDecimals}};return this.applyPropertiesUpdate(id,update)})),VariableController_classPrivateFieldSet(this,_NumberVariable_editorAPI,editorAPI,"f")}applyPropertiesUpdate(id,update){return VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_NumberVariable_editorAPI,"f");return getEditorResponseData(yield res.updateNumberVariableProperties(id,JSON.stringify(update)))}))}}_NumberVariable_editorAPI=new WeakMap;class DateVariable{constructor(editorAPI){_DateVariable_editorAPI.set(this,void 0),this.setDisplayFormat=(id,displayFormat)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={displayFormat:{value:displayFormat}};return this.applyPropertiesUpdate(id,update)})),this.setLocale=(id,locale)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={locale:{value:locale}};return this.applyPropertiesUpdate(id,update)})),this.setStartDate=(id,date)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={startDate:{value:date}};return this.applyPropertiesUpdate(id,update)})),this.setEndDate=(id,date)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={endDate:{value:date}};return this.applyPropertiesUpdate(id,update)})),this.setExcludedDays=(id,excludedDays)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={excludedDays:{value:excludedDays}};return this.applyPropertiesUpdate(id,update)})),VariableController_classPrivateFieldSet(this,_DateVariable_editorAPI,editorAPI,"f")}applyPropertiesUpdate(id,update){return VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_DateVariable_editorAPI,"f");return getEditorResponseData(yield res.updateDateVariableProperties(id,JSON.stringify(update)))}))}}_DateVariable_editorAPI=new WeakMap;class VariableController{constructor(editorAPI){_VariableController_editorAPI.set(this,void 0),this.getAll=()=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariables().then((result=>getEditorResponseData(result))).then((resp=>{const update=resp;return update.parsedData&&(update.parsedData=this.makeVariablesBackwardsCompatible(update.parsedData)),update}))})),this.getById=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariableById(id).then((result=>getEditorResponseData(result))).then((resp=>{const update=resp;return update.parsedData&&(update.parsedData=this.makeVariableBackwardsCompatible(update.parsedData)),update}))})),this.getByName=name=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariableByName(name).then((result=>getEditorResponseData(result))).then((resp=>{const update=resp;return update.parsedData&&(update.parsedData=this.makeVariableBackwardsCompatible(update.parsedData)),update}))})),this.create=(parentId,type)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).addVariable(parentId,type).then((result=>getEditorResponseData(result)))})),this.remove=ids=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).removeVariables(ids).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableName(id,name).then((result=>getEditorResponseData(result)))})),this.setLabel=(id,label)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableLabel(id,label).then((result=>getEditorResponseData(result)))})),_VariableController_setPlaceholder.set(this,((id,placeholder)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariablePlaceholder(id,placeholder).then((result=>getEditorResponseData(result)))})))),this.setPlaceholder=(id,placeholder)=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setPlaceholder,"f").call(this,id,placeholder)})),this.resetPlaceholder=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setPlaceholder,"f").call(this,id,null)})),_VariableController_setHelpText.set(this,((id,helpText)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableHelpText(id,helpText).then((result=>getEditorResponseData(result)))})))),this.setHelpText=(id,helpText)=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setHelpText,"f").call(this,id,helpText)})),this.resetHelpText=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setHelpText,"f").call(this,id,null)})),this.setType=(id,type)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableType(id,type).then((result=>getEditorResponseData(result)))})),this.setListVariable=(id,items)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setListVariableItems(id,items.map((item=>JSON.stringify({value:item})))).then((result=>getEditorResponseData(result)))})),this.setValue=(id,value)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableValue(id,value).then((result=>getEditorResponseData(result)))})),this.duplicate=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).duplicateVariable(id).then((result=>getEditorResponseData(result)))})),this.groupVariables=(name,ids)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).groupVariables(name,ids).then((result=>getEditorResponseData(result)))})),this.ungroupVariables=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).ungroupVariable(id).then((result=>getEditorResponseData(result)))})),this.move=(order,id,parentId)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).moveVariable(id,parentId,order).then((result=>getEditorResponseData(result)))})),this.moveVariables=(order,ids,parentId)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).moveVariables(ids,parentId,order).then((result=>getEditorResponseData(result)))})),this.setIsVisible=(id,isVisible)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableIsVisible(id,isVisible).then((result=>getEditorResponseData(result)))})),this.setIsHidden=(id,isHidden)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableIsVisible(id,!isHidden).then((result=>getEditorResponseData(result)))})),this.setIsRequired=(id,isRequired)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableIsRequired(id,isRequired).then((result=>getEditorResponseData(result)))})),this.setIsReadonly=(id,isReadonly)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableIsReadonly(id,isReadonly).then((result=>getEditorResponseData(result)))})),this.getImageVariableConnectorId=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getImageVariableConnectorId(id).then((result=>getEditorResponseData(result)))})),this.setImageVariableConnector=(id,registration)=>VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f"),connectorRegistration=(new ConnectorCompatibilityTools).makeConnectorSourceForwardsCompatible(registration);return res.setImageVariableConnector(id,JSON.stringify(connectorRegistration)).then((result=>getEditorResponseData(result)))})),this.removeSource=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return this.setValue(id,null)})),this.setPrefix=(id,prefix)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={prefix:{value:prefix}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setSuffix=(id,suffix)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={suffix:{value:suffix}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setPrefixCharacterStyle=(id,characterStyleId)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={prefixCharacterStyleId:{value:characterStyleId}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setSuffixCharacterStyle=(id,characterStyleId)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={suffixCharacterStyleId:{value:characterStyleId}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setPrivateData=(id,privateData)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariablePrivateData(id,JSON.stringify(privateData)).then((result=>getEditorResponseData(result)))})),this.getPrivateData=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariablePrivateData(id).then((result=>getEditorResponseData(result)))})),VariableController_classPrivateFieldSet(this,_VariableController_editorAPI,editorAPI,"f"),this.number=new NumberVariable(VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")),this.date=new DateVariable(VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f"))}makeVariablesBackwardsCompatible(variables){return variables.map((variable=>this.makeVariableBackwardsCompatible(variable)))}makeVariableBackwardsCompatible(variable){return variable.type!==VariableType.list?variable:this.makeListVariableBackwardsCompatible(variable)}makeListVariableBackwardsCompatible(listVariable){const updated=listVariable,items=listVariable.items,selected=listVariable.selected,newItems=items.map((item=>item.value));return updated.items=newItems,updated.selected=null==selected?void 0:selected.value,updated}applyPrefixSuffixDeltaUpdate(id,update){return VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f");return getEditorResponseData(yield res.updateVariablePrefixSuffixProperties(id,JSON.stringify(update)))}))}}_VariableController_editorAPI=new WeakMap,_VariableController_setPlaceholder=new WeakMap,_VariableController_setHelpText=new WeakMap;class InfoController{constructor(){this.currentEngineVersion=editor_engine_namespaceObject_V,this.currentSDKVersion=package_namespaceObject_i8}}var _ClipboardController_editorAPI,BarcodeType,BarcodeErrorCorrectionLevel,BarcodeCharacterSet,BarcodeValidationResult,ClipboardController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ClipboardController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ClipboardController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ClipboardController{constructor(editorAPI){_ClipboardController_editorAPI.set(this,void 0),this.copyFrames=ids=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),frameData=yield res.copyFrames(ids);return frameData.data&&(yield navigator.clipboard.writeText(frameData.data)),getEditorResponseData(frameData)})),this.cutFrames=ids=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),frameData=yield res.cutFrames(ids);return frameData.data&&(yield navigator.clipboard.writeText(frameData.data)),getEditorResponseData(frameData)})),this.pasteFrames=()=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),clipboardData=yield navigator.clipboard.readText();return getEditorResponseData(yield res.pasteFrames(clipboardData))})),this.getContentType=()=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),clipboardData=yield navigator.clipboard.readText();return getEditorResponseData(yield res.getClipboardContentType(clipboardData))})),ClipboardController_classPrivateFieldSet(this,_ClipboardController_editorAPI,editorAPI,"f")}}_ClipboardController_editorAPI=new WeakMap,function(BarcodeType){BarcodeType.code39="code39",BarcodeType.code93="code93",BarcodeType.code128="code128",BarcodeType.dataMatrix="dataMatrix",BarcodeType.ean13="ean13",BarcodeType.ean8="ean8",BarcodeType.qr="qr",BarcodeType.upca="upca",BarcodeType.upce="upce",BarcodeType.gs1128="gs1128"}(BarcodeType||(BarcodeType={})),function(BarcodeErrorCorrectionLevel){BarcodeErrorCorrectionLevel.low="low",BarcodeErrorCorrectionLevel.medium="medium",BarcodeErrorCorrectionLevel.quartile="quartile",BarcodeErrorCorrectionLevel.high="high"}(BarcodeErrorCorrectionLevel||(BarcodeErrorCorrectionLevel={})),function(BarcodeCharacterSet){BarcodeCharacterSet.utf8="utf8",BarcodeCharacterSet.iso8859_1="iso8859_1",BarcodeCharacterSet.code128a="code128a",BarcodeCharacterSet.code128b="code128b",BarcodeCharacterSet.code128c="code128c"}(BarcodeCharacterSet||(BarcodeCharacterSet={})),function(BarcodeValidationResult){BarcodeValidationResult.success="success",BarcodeValidationResult.empty="empty",BarcodeValidationResult.invalidLength="invalidLength",BarcodeValidationResult.invalidCharacters="invalidCharacters",BarcodeValidationResult.invalidChecksum="invalidChecksum",BarcodeValidationResult.invalidUPCE="invalidUPCE",BarcodeValidationResult.otherError="otherError"}(BarcodeValidationResult||(BarcodeValidationResult={}));var _BarcodeController_editorAPI,BarcodeController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},BarcodeController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},BarcodeController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class BarcodeController{constructor(editorAPI){_BarcodeController_editorAPI.set(this,void 0),this.setBarcodeProperties=(id,properties)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.setEnableBackground=(id,enableBackground)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={enableBackground};return this.setBarcodeProperties(id,properties)})),this.setBackgroundColor=(id,backgroundColor)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={backgroundColor};return this.setBarcodeProperties(id,properties)})),this.setEnableBars=(id,enableBars)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={enableBars};return this.setBarcodeProperties(id,properties)})),this.setBarColor=(id,barColor)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={barColor};return this.setBarcodeProperties(id,properties)})),this.setBarcodeSource=(id,source)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeSource(id,JSON.stringify(source)).then((result=>getEditorResponseData(result)))})),this.removeBarcodeSource=id=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeSource(id,null).then((result=>getEditorResponseData(result)))})),this.setEnableText=(id,enableText)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={enableText};return this.setBarcodeProperties(id,properties)})),this.setBarHeight=(id,barHeight)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={barHeight};return this.setBarcodeProperties(id,properties)})),this.setMagnification=(id,magnification)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={magnification};return this.setBarcodeProperties(id,properties)})),this.setQuietZoneValue=(id,value,position)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const update=position?{left:position===PositionEnum.left?value:void 0,top:position===PositionEnum.top?value:void 0,right:position===PositionEnum.right?value:void 0,bottom:position===PositionEnum.bottom?value:void 0}:{left:value,top:value,right:value,bottom:value};return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({quietZone:update})).then((result=>getEditorResponseData(result)))})),this.setAreQuietZoneValuesCombined=(id,value)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const update={areQuietZoneValuesCombined:value};return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({quietZone:update})).then((result=>getEditorResponseData(result)))})),this.setErrorCorrectionLevel=(id,errorCorrectionLevel)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({errorCorrectionLevel})).then((result=>getEditorResponseData(result)))})),this.setCharacterSet=(id,characterSet)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({characterSet})).then((result=>getEditorResponseData(result)))})),this.setDrawLightMarginIndicator=(id,drawLightMarginIndicator)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={drawStartStopChars:drawLightMarginIndicator};return this.setBarcodeProperties(id,properties)})),this.setDrawStartStopChars=(id,drawStartStopChars)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={drawStartStopChars};return this.setBarcodeProperties(id,properties)})),this.getBarcodeConfigationOptions=type=>{let allowedCharacterSets,allowedErrorCorrectionLevels,allowToggleText=!0,allowBarHeight=!0,allowEnableMagnification=!0,quietZoneAlwaysCombined=!1,allowToggleLightMarginIndicator=!1,allowToggleDrawStartAndEndChar=!1;switch(type){case BarcodeType.qr:allowedCharacterSets=[BarcodeCharacterSet.iso8859_1,BarcodeCharacterSet.utf8],allowedErrorCorrectionLevels=[BarcodeErrorCorrectionLevel.low,BarcodeErrorCorrectionLevel.medium,BarcodeErrorCorrectionLevel.quartile,BarcodeErrorCorrectionLevel.high];case BarcodeType.dataMatrix:allowToggleText=!1,allowBarHeight=!1,allowEnableMagnification=!1,quietZoneAlwaysCombined=!0;break;case BarcodeType.ean13:allowToggleText=!1,allowToggleLightMarginIndicator=!0;break;case BarcodeType.ean8:allowToggleLightMarginIndicator=!0;case BarcodeType.upca:case BarcodeType.upce:allowToggleText=!1;break;case BarcodeType.code128:case BarcodeType.gs1128:allowedCharacterSets=[BarcodeCharacterSet.code128a,BarcodeCharacterSet.code128b,BarcodeCharacterSet.code128c];break;case BarcodeType.code39:allowToggleDrawStartAndEndChar=!0}return{allowEnableMagnification,allowBarHeight,allowQuietZone:!0,allowedCharacterSets,allowedErrorCorrectionLevels,allowToggleText,quietZoneAlwaysCombined,allowToggleLightMarginIndicator,allowToggleDrawStartAndEndChar}},BarcodeController_classPrivateFieldSet(this,_BarcodeController_editorAPI,editorAPI,"f")}}_BarcodeController_editorAPI=new WeakMap;class SubscriberController_SubscriberController{constructor(config){this.onVariableListChanged=variablesJson=>{const callBack=this.config.onVariableListChanged;callBack&&callBack(JSON.parse(variablesJson))},this.onConnectorsChanged=connectors=>{const callBack=this.config.onConnectorsChanged;callBack&&callBack(JSON.parse(connectors))},this.config=config}}var VariableController_VariableController_editorAPI,controllers_VariableController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},controllers_VariableController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},controllers_VariableController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class VariableController_VariableController{constructor(editorAPI){VariableController_VariableController_editorAPI.set(this,void 0),this.getAll=()=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).getVariables().then((result=>getEditorResponseData(result)))})),this.getById=id=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).getVariableById(id).then((result=>getEditorResponseData(result)))})),this.getByName=name=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).getVariableByName(name).then((result=>getEditorResponseData(result)))})),this.setListVariable=(id,items)=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).setListVariableItems(id,items.map((item=>JSON.stringify(item)))).then((result=>getEditorResponseData(result)))})),this.setImageVariableConnector=(id,registration)=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).setImageVariableConnector(id,JSON.stringify(registration)).then((result=>getEditorResponseData(result)))})),controllers_VariableController_classPrivateFieldSet(this,VariableController_VariableController_editorAPI,editorAPI,"f")}}VariableController_VariableController_editorAPI=new WeakMap;var ConnectorController_ConnectorController_editorAPI,controllers_ConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},controllers_ConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},controllers_ConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ConnectorController_ConnectorController{constructor(editorAPI){ConnectorController_ConnectorController_editorAPI.set(this,void 0),this.register=registration=>controllers_ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_ConnectorController_classPrivateFieldGet(this,ConnectorController_ConnectorController_editorAPI,"f")).registerConnector(JSON.stringify(registration)).then((result=>getEditorResponseData(result)))})),this.getById=id=>controllers_ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_ConnectorController_classPrivateFieldGet(this,ConnectorController_ConnectorController_editorAPI,"f")).getConnectorById(id).then((result=>getEditorResponseData(result)))})),this.getAllByType=type=>controllers_ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_ConnectorController_classPrivateFieldGet(this,ConnectorController_ConnectorController_editorAPI,"f")).getConnectors(type).then((result=>getEditorResponseData(result)))})),controllers_ConnectorController_classPrivateFieldSet(this,ConnectorController_ConnectorController_editorAPI,editorAPI,"f")}}ConnectorController_ConnectorController_editorAPI=new WeakMap;class NextInitiator{constructor(config,connection,editorAPI){this.config=config,this.connection=connection,this.editorAPI=editorAPI,this.subscriber=new SubscriberController_SubscriberController(config),this.variable=new VariableController_VariableController(this.editorAPI),this.connector=new ConnectorController_ConnectorController(this.editorAPI)}}var _ConfigurationController_editorAPI,ConfigurationController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ConfigurationController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ConfigurationController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};_ConfigurationController_editorAPI=new WeakMap;var _LocalConfigurationDecorator_localConfig,LocalConfigurationDecorator_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},LocalConfigurationDecorator_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},LocalConfigurationDecorator_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class LocalConfigurationDecorator extends class{constructor(editorAPI){_ConfigurationController_editorAPI.set(this,void 0),ConfigurationController_classPrivateFieldSet(this,_ConfigurationController_editorAPI,editorAPI,"f")}getValue(key){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).getConfigValue(key).then((result=>getEditorResponseData(result)))}))}setValue(key,value){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).setConfigValue(key,value).then((result=>getEditorResponseData(result)))}))}updateStudioOptions(options){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).updateStudioOptions(JSON.stringify(options)).then((result=>getEditorResponseData(result)))}))}getEngineSessionId(){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).getEngineSessionId().then((result=>getEditorResponseData(result)))}))}}{constructor(editorAPI,localConfig){super(editorAPI),_LocalConfigurationDecorator_localConfig.set(this,void 0),LocalConfigurationDecorator_classPrivateFieldSet(this,_LocalConfigurationDecorator_localConfig,localConfig,"f")}getValue(key){const _super=Object.create(null,{getValue:{get:()=>super.getValue}});return LocalConfigurationDecorator_awaiter(this,void 0,void 0,(function*(){const value=LocalConfigurationDecorator_classPrivateFieldGet(this,_LocalConfigurationDecorator_localConfig,"f").get(key);return null!=value?getEditorResponseData({status:200,success:!0,parsedData:value,data:value},!1):_super.getValue.call(this,key)}))}setValue(key,value){const _super=Object.create(null,{setValue:{get:()=>super.setValue}});return LocalConfigurationDecorator_awaiter(this,void 0,void 0,(function*(){const res=_super.setValue.call(this,key,value);return LocalConfigurationDecorator_classPrivateFieldGet(this,_LocalConfigurationDecorator_localConfig,"f").set(key,value),res}))}}_LocalConfigurationDecorator_localConfig=new WeakMap;var _DataConnectorController_editorAPI,_DataConnectorController_dataItemMappingTools,DataConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DataConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DataConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DataConnectorController{constructor(editorAPI,dataItemMappingTools){_DataConnectorController_editorAPI.set(this,void 0),_DataConnectorController_dataItemMappingTools.set(this,void 0),this.getPage=(connectorId,config,context={})=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetPage(connectorId,JSON.stringify(config),JSON.stringify(context)).then((result=>getEditorResponseData(result))).then((resp=>{const update=Object.assign(Object.assign({},resp),{parsedData:null});return resp.parsedData&&(update.parsedData={data:resp.parsedData.data.map((e=>DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_dataItemMappingTools,"f").mapEngineToDataItem(e))),continuationToken:resp.parsedData.continuationToken}),update}))})),this.getModel=(connectorId,context={})=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetModel(connectorId,JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.getConfigurationOptions=connectorId=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetConfigurationOptions(connectorId).then((result=>getEditorResponseData(result)))})),this.getCapabilities=connectorId=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetCapabilities(connectorId).then((result=>getEditorResponseData(result)))})),DataConnectorController_classPrivateFieldSet(this,_DataConnectorController_editorAPI,editorAPI,"f"),DataConnectorController_classPrivateFieldSet(this,_DataConnectorController_dataItemMappingTools,dataItemMappingTools,"f")}}_DataConnectorController_editorAPI=new WeakMap,_DataConnectorController_dataItemMappingTools=new WeakMap;class DataItemMappingTools{isDatePropertyWrapper(value){return"object"==typeof value&&"date"===(null==value?void 0:value.type)}isDateObject(value){return value instanceof Date}mapEngineToDataItem(dataItem){const parsedItem={};return Object.entries(dataItem).forEach((([key,value])=>{parsedItem[key]=this.isDatePropertyWrapper(value)?new Date(value.value):value})),parsedItem}mapDataItemToEngine(dataItem){const parsedItem={};return Object.entries(dataItem).forEach((([key,value])=>{parsedItem[key]=this.isDateObject(value)?{value:value.getTime(),type:"date"}:value})),parsedItem}}var _DataSourceController_editorAPI,_DataSourceController_dataItemMappingTools,DataSourceController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DataSourceController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DataSourceController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DataSourceController{constructor(editorAPI,dataItemMappingTools){_DataSourceController_editorAPI.set(this,void 0),_DataSourceController_dataItemMappingTools.set(this,void 0),this.setDataSource=connectorId=>DataSourceController_awaiter(this,void 0,void 0,(function*(){return(yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f")).setDataSource(connectorId).then((result=>getEditorResponseData(result)))})),this.getDataSource=()=>DataSourceController_awaiter(this,void 0,void 0,(function*(){return(yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f")).getDataSource().then((result=>getEditorResponseData(result)))})),this.removeDataSource=()=>DataSourceController_awaiter(this,void 0,void 0,(function*(){return(yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f")).removeDataSource().then((result=>getEditorResponseData(result)))})),this.setDataRow=dataRow=>DataSourceController_awaiter(this,void 0,void 0,(function*(){const res=yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f"),engineDataItem=DataSourceController_classPrivateFieldGet(this,_DataSourceController_dataItemMappingTools,"f").mapDataItemToEngine(dataRow);return res.setDataRow(JSON.stringify(engineDataItem)).then((result=>getEditorResponseData(result)))})),DataSourceController_classPrivateFieldSet(this,_DataSourceController_editorAPI,editorAPI,"f"),DataSourceController_classPrivateFieldSet(this,_DataSourceController_dataItemMappingTools,dataItemMappingTools,"f")}}let connection;_DataSourceController_editorAPI=new WeakMap,_DataSourceController_dataItemMappingTools=new WeakMap;const FIXED_EDITOR_LINK="https://studio-cdn.chiligrafx.com/editor/"+editor_engine_namespaceObject_V+"/web";class SDK{constructor(config){this.localConfig=new Map,this.dataItemMappingTools=new DataItemMappingTools,this.loadEditor=()=>{connector(this.config.editorLink||FIXED_EDITOR_LINK,{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,onSelectedLayoutPropertiesChanged:this.subscriber.onSelectedLayoutPropertiesChanged,onSelectedLayoutUnitChanged:this.subscriber.onSelectedLayoutUnitChanged,onPageSelectionChanged:this.subscriber.onPageSelectionChanged,onScrubberPositionChanged:this.subscriber.onAnimationPlaybackChanged,onFrameAnimationsChanged:this.subscriber.onAnimationChanged,onVariableListChanged:state=>{var _a;(null===(_a=this.enabledNextSubscribers)||void 0===_a?void 0:_a.onVariableListChanged)?this.next.subscriber.onVariableListChanged(state):this.subscriber.onVariableListChanged(state)},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:this.subscriber.onConnectorsChanged,onZoomChanged:this.subscriber.onZoomChanged,onSelectedPageIdChanged:this.subscriber.onSelectedPageIdChanged,onPagesChanged:this.subscriber.onPagesChanged,onPageSnapshotInvalidated:this.subscriber.onPageSnapshotInvalidated,onPageSizeChanged:this.subscriber.onPageSizeChanged,onShapeCornerRadiusChanged:this.subscriber.onShapeCornerRadiusChanged,onCropActiveFrameIdChanged:this.subscriber.onCropActiveFrameIdChanged,onAsyncError:this.subscriber.onAsyncError,onViewModeChanged:this.subscriber.onViewModeChanged,onBarcodeValidationChanged:this.subscriber.onBarcodeValidationChanged,onDataSourceIdChanged:this.subscriber.onDataSourceIdChanged,onDocumentIssueListChanged:this.subscriber.onDocumentIssueListChanged},this.setConnection,this.config.editorId,this.config.studioStyling),this.editorAPI=null==connection?void 0:connection.promise.then((editorAPI=>editorAPI)),this.action=new ActionController(this.editorAPI),this.layout=new LayoutController(this.editorAPI),this.frame=new FrameController(this.editorAPI),this.barcode=new BarcodeController(this.editorAPI),this.animation=new AnimationController(this.editorAPI),this.document=new DocumentController(this.editorAPI),this.configuration=new LocalConfigurationDecorator(this.editorAPI,this.localConfig),this.utils=new UtilsController,this.tool=new ToolController(this.editorAPI),this.page=new PageController(this.editorAPI),this.debug=new DebugController(this.editorAPI),this.undoManager=new UndoManagerController(this.editorAPI,this),this.textSelection=new TextStyleController(this.editorAPI),this.colorStyle=new ColorStyleController(this.editorAPI),this.paragraphStyle=new ParagraphStyleController(this.editorAPI),this.characterStyle=new CharacterStyleController(this.editorAPI),this.mediaConnector=new MediaConnectorController(this.editorAPI),this.fontConnector=new FontConnectorController(this.editorAPI),this.dataConnector=new DataConnectorController(this.editorAPI,this.dataItemMappingTools),this.dataSource=new DataSourceController(this.editorAPI,this.dataItemMappingTools),this.connector=new ConnectorController(this.editorAPI,this.localConfig),this.variable=new VariableController(this.editorAPI),this.font=new FontController(this.editorAPI),this.experiment=new ExperimentController(this.editorAPI),this.canvas=new CanvasController(this.editorAPI),this.shape=new ShapeController(this.editorAPI),this.info=new InfoController,this.clipboard=new ClipboardController(this.editorAPI),this.next=new NextInitiator(this.config,this.connection,this.editorAPI),this.configuration.setValue(WellKnownConfigurationKeys.GraFxStudioSdkVersion,package_namespaceObject_i8),this.configuration.setValue(WellKnownConfigurationKeys.GraFxStudioDocumentType,this.config.documentType||DocumentType.template),this.configuration.updateStudioOptions(this.config.studioOptions||defaultStudioOptions)},this.setConnection=newConnection=>{connection=newConnection},this.config=config,this.connection=connection,this.editorAPI=null==connection?void 0:connection.promise.then((child=>child)),this.action=new ActionController(this.editorAPI),this.layout=new LayoutController(this.editorAPI),this.frame=new FrameController(this.editorAPI),this.shape=new ShapeController(this.editorAPI),this.barcode=new BarcodeController(this.editorAPI),this.undoManager=new UndoManagerController(this.editorAPI,this),this.connector=new ConnectorController(this.editorAPI,this.localConfig),this.mediaConnector=new MediaConnectorController(this.editorAPI),this.fontConnector=new FontConnectorController(this.editorAPI),this.dataConnector=new DataConnectorController(this.editorAPI,this.dataItemMappingTools),this.dataSource=new DataSourceController(this.editorAPI,this.dataItemMappingTools),this.animation=new AnimationController(this.editorAPI),this.document=new DocumentController(this.editorAPI),this.configuration=new LocalConfigurationDecorator(this.editorAPI,this.localConfig),this.variable=new VariableController(this.editorAPI),this.utils=new UtilsController,this.subscriber=new SubscriberController(this.config,this.localConfig),this.tool=new ToolController(this.editorAPI),this.page=new PageController(this.editorAPI),this.debug=new DebugController(this.editorAPI),this.textSelection=new TextStyleController(this.editorAPI),this.colorStyle=new ColorStyleController(this.editorAPI),this.paragraphStyle=new ParagraphStyleController(this.editorAPI),this.characterStyle=new CharacterStyleController(this.editorAPI),this.font=new FontController(this.editorAPI),this.experiment=new ExperimentController(this.editorAPI),this.canvas=new CanvasController(this.editorAPI),this.colorConversion=new ColorConversionController(this.editorAPI),this.info=new InfoController,this.clipboard=new ClipboardController(this.editorAPI),this.next=new NextInitiator(this.config,this.connection,this.editorAPI),this.enabledNextSubscribers=this.config.enableNextSubscribers}}var SlideDirections,ShakeDirections,EaseTypes,TweenTypes,BasicAnimationsEmphasisStyles,ViewMode,ConnectorConfigValueType,FontWeights,Alignment,TextPosition,Case,Scripting,HorizontalAlign,SelectedTextStyleSections,SelectedTextStyles,FontPreviewFormat,ActionEditorEvent,ShapeType,CornerRadiusType;!function(SlideDirections){SlideDirections.top="top",SlideDirections.left="left",SlideDirections.right="right",SlideDirections.bottom="bottom",SlideDirections.topLeft="topLeft",SlideDirections.topRight="topRight",SlideDirections.bottomLeft="bottomLeft",SlideDirections.bottomRight="bottomRight"}(SlideDirections||(SlideDirections={})),function(ShakeDirections){ShakeDirections.horizontal="horizontal",ShakeDirections.vertical="vertical"}(ShakeDirections||(ShakeDirections={})),function(EaseTypes){EaseTypes.easeIn="easeIn",EaseTypes.easeOut="easeOut",EaseTypes.easeInOut="easeInOut"}(EaseTypes||(EaseTypes={})),function(TweenTypes){TweenTypes.quadratic="Quadratic",TweenTypes.cubic="Cubic",TweenTypes.quartic="Quartic",TweenTypes.quintic="Quintic",TweenTypes.sine="Sine",TweenTypes.exponential="Exponential",TweenTypes.circular="Circular",TweenTypes.elastic="Elastic",TweenTypes.bounce="Bounce",TweenTypes.back="Back"}(TweenTypes||(TweenTypes={})),function(BasicAnimationsEmphasisStyles){BasicAnimationsEmphasisStyles.bounce="bounce",BasicAnimationsEmphasisStyles.flash="flash",BasicAnimationsEmphasisStyles.headshake="headShake",BasicAnimationsEmphasisStyles.heartbeat="heartbeat",BasicAnimationsEmphasisStyles.pulse="pulse",BasicAnimationsEmphasisStyles.rubberBand="rubberBand",BasicAnimationsEmphasisStyles.vertical="vertical",BasicAnimationsEmphasisStyles.horizontal="horizontal",BasicAnimationsEmphasisStyles.swing="swing",BasicAnimationsEmphasisStyles.tada="tada"}(BasicAnimationsEmphasisStyles||(BasicAnimationsEmphasisStyles={})),function(ViewMode){ViewMode.preview="preview",ViewMode.normal="normal"}(ViewMode||(ViewMode={})),function(ConnectorConfigValueType){ConnectorConfigValueType.text="text",ConnectorConfigValueType.boolean="boolean"}(ConnectorConfigValueType||(ConnectorConfigValueType={})),function(FontWeights){FontWeights.BOLD="Bold",FontWeights.ITALIC="Italic",FontWeights.REGULAR="Regular"}(FontWeights||(FontWeights={})),function(Alignment){Alignment.LEFT="left",Alignment.CENTER="center",Alignment.RIGHT="right",Alignment.JUSTIFY="justify"}(Alignment||(Alignment={})),function(TextPosition){TextPosition.TOP="top",TextPosition.CENTER="center",TextPosition.BOTTOM="bottom"}(TextPosition||(TextPosition={})),function(Case){Case.TO_LOWER_CASE="lowercase",Case.TO_UPPER_CASE="uppercase",Case.NORMAL="normal"}(Case||(Case={})),function(Scripting){Scripting.SUPERSCRIPT="superscript",Scripting.SUBSCRIPT="subscript",Scripting.NORMAL="normal"}(Scripting||(Scripting={})),function(HorizontalAlign){HorizontalAlign.left="left",HorizontalAlign.center="center",HorizontalAlign.right="right",HorizontalAlign.justify="justify"}(HorizontalAlign||(HorizontalAlign={})),function(SelectedTextStyleSections){SelectedTextStyleSections.STYLE="textStyle",SelectedTextStyleSections.PROPERTIES="textProperties",SelectedTextStyleSections.APPEARANCE="appearance"}(SelectedTextStyleSections||(SelectedTextStyleSections={})),function(SelectedTextStyles){SelectedTextStyles.PARAGRAPH="paragraphStyleId",SelectedTextStyles.CHARACTER="characterStyleId",SelectedTextStyles.FONT_FAMILY="fontKey",SelectedTextStyles.FONT_STYLE="fontStyle",SelectedTextStyles.FONT_SIZE="fontSize",SelectedTextStyles.LETTER_SPACING="letterSpacing",SelectedTextStyles.LINE_HEIGHT="lineHeight",SelectedTextStyles.TEXT_ALIGN="textAlign",SelectedTextStyles.VERTICAL_ALIGN="verticalAlign",SelectedTextStyles.TYPOGRAPHIC_CASE="typographicCase",SelectedTextStyles.SUB_SUPER_SCRIPT="subSuperScript",SelectedTextStyles.UNDERLINE="underline",SelectedTextStyles.LINE_THROUGH="lineThrough",SelectedTextStyles.FILL_COLOR="fillColor",SelectedTextStyles.COLOR="color",SelectedTextStyles.FILL_COLOR_APPLIED="fillColorApplied",SelectedTextStyles.STROKE_COLOR="strokeColor",SelectedTextStyles.DROP_SHADOW_COLOR="dropShadowColor",SelectedTextStyles.BLEND_MODE="blendMode",SelectedTextStyles.OPACITY="opacity",SelectedTextStyles.TRACKING_RIGHT="trackingRight",SelectedTextStyles.BASELINE_SHIFT="baselineShiftValue"}(SelectedTextStyles||(SelectedTextStyles={})),function(FontPreviewFormat){FontPreviewFormat.Square="square",FontPreviewFormat.Line="line"}(FontPreviewFormat||(FontPreviewFormat={})),function(ActionEditorEvent){ActionEditorEvent.selectedLayoutChanged="selectedLayoutChanged",ActionEditorEvent.frameMoved="frameMoved",ActionEditorEvent.pageSizeChanged="pageSizeChanged",ActionEditorEvent.documentLoaded="documentLoaded",ActionEditorEvent.variableValueChanged="variableValueChanged"}(ActionEditorEvent||(ActionEditorEvent={})),function(ShapeType){ShapeType.ellipse="ellipse",ShapeType.rectangle="rectangle",ShapeType.polygon="polygon"}(ShapeType||(ShapeType={})),function(CornerRadiusType){CornerRadiusType.all="all",CornerRadiusType.only="only",CornerRadiusType.none="none"}(CornerRadiusType||(CornerRadiusType={}));const src=SDK;return __webpack_exports__})()));
1
+ !function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("StudioSDK",[],factory):"object"==typeof exports?exports.StudioSDK=factory():root.StudioSDK=factory()}(this,(()=>(()=>{"use strict";var __webpack_require__={d:(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},o:(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),r:exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})}},__webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ActionEditorEvent:()=>ActionEditorEvent,Alignment:()=>Alignment,AnchorTargetEdgeType:()=>AnchorTargetEdgeType,AnchorTargetType:()=>AnchorTargetType,AuthCredentialsTypeEnum:()=>AuthCredentialsTypeEnum,AuthRefreshTypeEnum:()=>AuthRefreshTypeEnum,AutoGrowDirection:()=>AutoGrowDirection,BarcodeCharacterSet:()=>BarcodeCharacterSet,BarcodeErrorCorrectionLevel:()=>BarcodeErrorCorrectionLevel,BarcodeSourceTypeEnum:()=>BarcodeSourceTypeEnum,BarcodeType:()=>BarcodeType,BarcodeValidationResult:()=>BarcodeValidationResult,BasicAnimationsEmphasisStyles:()=>BasicAnimationsEmphasisStyles,BlendMode:()=>BlendMode,Case:()=>Case,ColorType:()=>ColorType,ColorUsageType:()=>ColorUsageType,ConnectorConfigValueType:()=>ConnectorConfigValueType,ConnectorEventType:()=>ConnectorEventType,ConnectorHttpError:()=>ConnectorHttpError,ConnectorMapping:()=>ConnectorMapping,ConnectorMappingDirection:()=>ConnectorMappingDirection,ConnectorMappingSource:()=>ConnectorMappingSource,ConnectorRegistrationSource:()=>ConnectorRegistrationSource,ConnectorStateType:()=>ConnectorStateType,ConnectorType:()=>ConnectorType,CornerRadiusType:()=>CornerRadiusType,Day:()=>Day,DeprecatedMediaConnectorDownloadType:()=>DeprecatedMediaConnectorDownloadType,DeprecatedMediaType:()=>DeprecatedMediaType,DocumentIssueTypeEnum:()=>DocumentIssueTypeEnum,DocumentType:()=>DocumentType,DownloadFormats:()=>DownloadFormats,EaseTypes:()=>EaseTypes,EngineEditModeType:()=>EngineEditModeType,EnvironmentType:()=>EnvironmentType,FitMode:()=>FitMode,FitModePosition:()=>FitModePosition,FlowDirection:()=>FlowDirection,FontPreviewFormat:()=>FontPreviewFormat,FontWeights:()=>FontWeights,FrameAnchorTarget:()=>FrameAnchorTarget,FrameAnchorType:()=>FrameAnchorType,FramePropertyNames:()=>FramePropertyNames,FrameTypeEnum:()=>FrameTypeEnum,GrafxTokenAuthCredentials:()=>GrafxTokenAuthCredentials,ImageSourceTypeEnum:()=>ImageSourceTypeEnum,LayoutIntent:()=>LayoutIntent,LayoutPropertyNames:()=>LayoutPropertyNames,LayoutType:()=>LayoutType,Locale:()=>Locale,MeasurementUnit:()=>MeasurementUnit,MediaDownloadIntent:()=>MediaDownloadIntent,MediaDownloadType:()=>MediaDownloadType,MediaType:()=>MediaType,PageAnchorTarget:()=>PageAnchorTarget,PositionEnum:()=>PositionEnum,RefreshedAuthCredendentials:()=>RefreshedAuthCredendentials,Scripting:()=>Scripting,SelectedTextStyleSections:()=>SelectedTextStyleSections,SelectedTextStyles:()=>SelectedTextStyles,ShakeDirections:()=>ShakeDirections,ShapeType:()=>ShapeType,SlideDirections:()=>SlideDirections,SortBy:()=>SortBy,SortOrder:()=>SortOrder,TextDirection:()=>TextDirection,TextPosition:()=>TextPosition,ToolType:()=>ToolType,TweenTypes:()=>TweenTypes,UpdateZIndexMethod:()=>UpdateZIndexMethod,VariableType:()=>VariableType,VariableVisibilityOperator:()=>VariableVisibilityOperator,VariableVisibilityTargetType:()=>VariableVisibilityTargetType,VariableVisibilityType:()=>VariableVisibilityType,VerticalAlign:()=>VerticalAlign,ViewMode:()=>ViewMode,WellKnownConfigurationKeys:()=>WellKnownConfigurationKeys,default:()=>src,grafxMediaConnectorRegistration:()=>grafxMediaConnectorRegistration});const editor_engine_namespaceObject_V="2.3.latest",package_namespaceObject_i8="1.20.0";var enums_MessageType,Resolution,ErrorCode,NativeErrorName,enums_NativeEventType;!function(MessageType){MessageType.Call="call",MessageType.Reply="reply",MessageType.Syn="syn",MessageType.SynAck="synAck",MessageType.Ack="ack"}(enums_MessageType||(enums_MessageType={})),function(Resolution){Resolution.Fulfilled="fulfilled",Resolution.Rejected="rejected"}(Resolution||(Resolution={})),function(ErrorCode){ErrorCode.ConnectionDestroyed="ConnectionDestroyed",ErrorCode.ConnectionTimeout="ConnectionTimeout",ErrorCode.NoIframeSrc="NoIframeSrc"}(ErrorCode||(ErrorCode={})),function(NativeErrorName){NativeErrorName.DataCloneError="DataCloneError"}(NativeErrorName||(NativeErrorName={})),function(NativeEventType){NativeEventType.Message="message"}(enums_NativeEventType||(enums_NativeEventType={}));const DEFAULT_PORT_BY_PROTOCOL={"http:":"80","https:":"443"},URL_REGEX=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,opaqueOriginSchemes=["file:","data:"],serializeError=({name,message,stack})=>({name,message,stack});let id=0;const generateId=()=>++id,keyPathToSegments=keyPath=>keyPath?keyPath.split("."):[],setAtKeyPath=(subject,keyPath,value)=>{const segments=keyPathToSegments(keyPath);return segments.reduce(((prevSubject,key,idx)=>(void 0===prevSubject[key]&&(prevSubject[key]={}),idx===segments.length-1&&(prevSubject[key]=value),prevSubject[key])),subject),subject},methodSerialization_serializeMethods=(methods,prefix)=>{const flattenedMethods={};return Object.keys(methods).forEach((key=>{const value=methods[key],keyPath=((key,prefix)=>{const segments=keyPathToSegments(prefix||"");return segments.push(key),(segments=>segments.join("."))(segments)})(key,prefix);"object"==typeof value&&Object.assign(flattenedMethods,methodSerialization_serializeMethods(value,keyPath)),"function"==typeof value&&(flattenedMethods[keyPath]=value)})),flattenedMethods},lib_connectCallSender=(callSender,info,methodKeyPaths,destroyConnection,log)=>{const{localName,local,remote,originForSending,originForReceiving}=info;let destroyed=!1;log(`${localName}: Connecting call sender`);const createMethodProxy=methodName=>(...args)=>{let iframeRemoved;log(`${localName}: Sending ${methodName}() call`);try{remote.closed&&(iframeRemoved=!0)}catch(e){iframeRemoved=!0}if(iframeRemoved&&destroyConnection(),destroyed){const error=new Error(`Unable to send ${methodName}() call due to destroyed connection`);throw error.code=ErrorCode.ConnectionDestroyed,error}return new Promise(((resolve,reject)=>{const id=generateId(),handleMessageEvent=event=>{if(event.source!==remote||event.data.penpal!==enums_MessageType.Reply||event.data.id!==id)return;if(event.origin!==originForReceiving)return void log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);const replyMessage=event.data;log(`${localName}: Received ${methodName}() reply`),local.removeEventListener(enums_NativeEventType.Message,handleMessageEvent);let returnValue=replyMessage.returnValue;replyMessage.returnValueIsError&&(returnValue=(obj=>{const deserializedError=new Error;return Object.keys(obj).forEach((key=>deserializedError[key]=obj[key])),deserializedError})(returnValue)),(replyMessage.resolution===Resolution.Fulfilled?resolve:reject)(returnValue)};local.addEventListener(enums_NativeEventType.Message,handleMessageEvent);const callMessage={penpal:enums_MessageType.Call,id,methodName,args};remote.postMessage(callMessage,originForSending)}))},flattenedMethods=methodKeyPaths.reduce(((api,name)=>(api[name]=createMethodProxy(name),api)),{});return Object.assign(callSender,(flattenedMethods=>{const methods={};for(const keyPath in flattenedMethods)setAtKeyPath(methods,keyPath,flattenedMethods[keyPath]);return methods})(flattenedMethods)),()=>{destroyed=!0}},handleAckMessageFactory=(serializedMethods,childOrigin,originForSending,destructor,log)=>{const{destroy,onDestroy}=destructor;let destroyCallReceiver,receiverMethodNames;const callSender={};return event=>{if(event.origin!==childOrigin)return void log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);log("Parent: Handshake - Received ACK");const info={localName:"Parent",local:window,remote:event.source,originForSending,originForReceiving:childOrigin};destroyCallReceiver&&destroyCallReceiver(),destroyCallReceiver=((info,serializedMethods,log)=>{const{localName,local,remote,originForSending,originForReceiving}=info;let destroyed=!1;const handleMessageEvent=event=>{if(event.source!==remote||event.data.penpal!==enums_MessageType.Call)return;if(event.origin!==originForReceiving)return void log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);const callMessage=event.data,{methodName,args,id}=callMessage;log(`${localName}: Received ${methodName}() call`);const createPromiseHandler=resolution=>returnValue=>{if(log(`${localName}: Sending ${methodName}() reply`),destroyed)return void log(`${localName}: Unable to send ${methodName}() reply due to destroyed connection`);const message={penpal:enums_MessageType.Reply,id,resolution,returnValue};resolution===Resolution.Rejected&&returnValue instanceof Error&&(message.returnValue=serializeError(returnValue),message.returnValueIsError=!0);try{remote.postMessage(message,originForSending)}catch(err){if(err.name===NativeErrorName.DataCloneError){const errorReplyMessage={penpal:enums_MessageType.Reply,id,resolution:Resolution.Rejected,returnValue:serializeError(err),returnValueIsError:!0};remote.postMessage(errorReplyMessage,originForSending)}throw err}};new Promise((resolve=>resolve(serializedMethods[methodName].apply(serializedMethods,args)))).then(createPromiseHandler(Resolution.Fulfilled),createPromiseHandler(Resolution.Rejected))};return local.addEventListener(enums_NativeEventType.Message,handleMessageEvent),()=>{destroyed=!0,local.removeEventListener(enums_NativeEventType.Message,handleMessageEvent)}})(info,serializedMethods,log),onDestroy(destroyCallReceiver),receiverMethodNames&&receiverMethodNames.forEach((receiverMethodName=>{delete callSender[receiverMethodName]})),receiverMethodNames=event.data.methodNames;const destroyCallSender=lib_connectCallSender(callSender,info,receiverMethodNames,destroy,log);return onDestroy(destroyCallSender),callSender}},connectToChild=options=>{let{iframe,methods={},childOrigin,timeout,debug=!1}=options;const log=(debug=>(...args)=>{debug&&console.log("[Penpal]",...args)})(debug),destructor=((localName,log)=>{const callbacks=[];let destroyed=!1;return{destroy(error){destroyed||(destroyed=!0,log(`${localName}: Destroying connection`),callbacks.forEach((callback=>{callback(error)})))},onDestroy(callback){destroyed?callback():callbacks.push(callback)}}})("Parent",log),{onDestroy,destroy}=destructor;childOrigin||((iframe=>{if(!iframe.src&&!iframe.srcdoc){const error=new Error("Iframe must have src or srcdoc property defined.");throw error.code=ErrorCode.NoIframeSrc,error}})(iframe),childOrigin=(src=>{if(src&&opaqueOriginSchemes.find((scheme=>src.startsWith(scheme))))return"null";const location=document.location,regexResult=URL_REGEX.exec(src);let protocol,hostname,port;return regexResult?(protocol=regexResult[1]?regexResult[1]:location.protocol,hostname=regexResult[2],port=regexResult[4]):(protocol=location.protocol,hostname=location.hostname,port=location.port),`${protocol}//${hostname}${port&&port!==DEFAULT_PORT_BY_PROTOCOL[protocol]?`:${port}`:""}`})(iframe.src));const originForSending="null"===childOrigin?"*":childOrigin,serializedMethods=methodSerialization_serializeMethods(methods),handleSynMessage=((log,serializedMethods,childOrigin,originForSending)=>event=>{if(event.origin!==childOrigin)return void log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);log("Parent: Handshake - Received SYN, responding with SYN-ACK");const synAckMessage={penpal:enums_MessageType.SynAck,methodNames:Object.keys(serializedMethods)};event.source.postMessage(synAckMessage,originForSending)})(log,serializedMethods,childOrigin,originForSending),handleAckMessage=handleAckMessageFactory(serializedMethods,childOrigin,originForSending,destructor,log),promise=new Promise(((resolve,reject)=>{const stopConnectionTimeout=((timeout,callback)=>{let timeoutId;return void 0!==timeout&&(timeoutId=window.setTimeout((()=>{const error=new Error(`Connection timed out after ${timeout}ms`);error.code=ErrorCode.ConnectionTimeout,callback(error)}),timeout)),()=>{clearTimeout(timeoutId)}})(timeout,destroy),handleMessage=event=>{if(event.source===iframe.contentWindow&&event.data)if(event.data.penpal!==enums_MessageType.Syn)if(event.data.penpal!==enums_MessageType.Ack);else{const callSender=handleAckMessage(event);callSender&&(stopConnectionTimeout(),resolve(callSender))}else handleSynMessage(event)};window.addEventListener(enums_NativeEventType.Message,handleMessage),log("Parent: Awaiting handshake"),((iframe,destructor)=>{const{destroy,onDestroy}=destructor,checkIframeInDocIntervalId=setInterval((()=>{iframe.isConnected||(clearInterval(checkIframeInDocIntervalId),destroy())}),6e4);onDestroy((()=>{clearInterval(checkIframeInDocIntervalId)}))})(iframe,destructor),onDestroy((error=>{window.removeEventListener(enums_NativeEventType.Message,handleMessage),error&&reject(error)}))}));return{promise,destroy(){destroy()}}},setupFrame=(iframe,editorLink,styling)=>{const link=(editorLink=>{let link="";return new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w]+\/$/).test(editorLink)?link=editorLink:editorLink.indexOf("/index.html")>-1?link=editorLink.replace("/index.html","/"):"/"!==editorLink.charAt(-1)&&(link=`${editorLink}/`),link})(editorLink),html=`<html>\n <head>\n <base href="/" />\n <meta charset="UTF-8"/>\n \x3c!-- use this property to pass the StudioStyling to the engine --\x3e\n <meta name="studio-styling" content='${JSON.stringify(styling||{})}'>\n </head>\n <body>\n <script> \n <\/script>\n <script src="${link}init.js" async><\/script>\n <script src="${link}init_engine.js"><\/script>\n <script>\n initializeStudioEngine({\n assetBase: '${link}',\n entryPointUrl: '${link}main.dart.js',\n });\n <\/script>\n </body>\n </html>\n `;iframe.srcdoc=html},Connector=(editorLink,params,setConnection,editorId="chili-editor",styling)=>{const editorSelectorId=`#${editorId}`,iframe=document.createElement("iframe");iframe.setAttribute("srcdoc"," "),iframe.setAttribute("title","Chili-Editor"),iframe.setAttribute("style","width: 100%; height: 100%;"),iframe.setAttribute("frameBorder","0"),iframe.setAttribute("referrerpolicy","origin");const setupNewFrame=()=>{const iframeContainer=document.querySelector(editorSelectorId);iframeContainer&&(null==iframeContainer||iframeContainer.appendChild(iframe),setupFrame(iframe,editorLink,styling))};"complete"===document.readyState||"interactive"===document.readyState?setupNewFrame():document.addEventListener("DOMContentLoaded",(()=>{setupNewFrame()})),setConnection(connectToChild({iframe,methods:{actionsChanged:params.onActionsChanged,stateChanged:params.onStateChanged,documentLoaded:params.onDocumentLoaded,authExpired:params.onAuthExpired,viewportRequested:params.onViewportRequested,selectedFramesContent:params.onSelectedFramesContentChanged,selectedFramesLayout:params.onSelectedFramesLayoutChanged,selectedLayoutProperties:params.onSelectedLayoutPropertiesChanged,openLayoutPropertiesPanel:params.onPageSelectionChanged,selectedLayoutUnit:params.onSelectedLayoutUnitChanged,scrubberPositionChanged:params.onScrubberPositionChanged,frameAnimationsChanged:params.onFrameAnimationsChanged,selectedToolChanged:params.onSelectedToolChanged,variableListChanged:params.onVariableListChanged,undoStackStateChanged:params.onUndoStateChanged,selectedLayoutFramesChanged:params.onSelectedLayoutFramesChanged,selectedTextStyleChanged:params.onSelectedTextStyleChanged,colorsChanged:params.onColorsChanged,paragraphStylesChanged:params.onParagraphStylesChanged,characterStylesChanged:params.onCharacterStylesChanged,fontFamiliesChanged:params.onFontFamiliesChanged,selectedLayoutId:params.onSelectedLayoutIdChanged,layoutListChanged:params.onLayoutsChanged,connectorEvent:params.onConnectorEvent,connectorsChanged:params.onConnectorsChanged,zoomChanged:params.onZoomChanged,pageSnapshotInvalidated:params.onPageSnapshotInvalidated,pagesChanged:params.onPagesChanged,pageSizeChanged:params.onPageSizeChanged,shapeCornerRadiusChanged:params.onShapeCornerRadiusChanged,cropActiveFrameIdChanged:params.onCropActiveFrameIdChanged,asyncError:params.onAsyncError,viewModeChanged:params.onViewModeChanged,barcodeValidationChanged:params.onBarcodeValidationChanged,selectedPageIdChanged:params.onSelectedPageIdChanged,dataSourceIdChanged:params.onDataSourceIdChanged,documentIssueListChanged:params.onDocumentIssueListChanged,customUndoDataChanged:params.onCustomUndoDataChanged,engineEditingModeChanged:params.onEngineEditModeChanged}}))};var WellKnownConfigurationKeys;!function(WellKnownConfigurationKeys){WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl="ENVIRONMENT_API",WellKnownConfigurationKeys.GraFxStudioSdkVersion="SDK_VERSION",WellKnownConfigurationKeys.GraFxStudioDocumentType="DOCUMENT_TYPE",WellKnownConfigurationKeys.GraFxStudioTemplateId="TEMPLATE_ID",WellKnownConfigurationKeys.GraFxStudioAuthToken="GRAFX_AUTH_TOKEN"}(WellKnownConfigurationKeys||(WellKnownConfigurationKeys={}));const defaultStudioOptions={shortcutOptions:{debugPanel:{enabled:!1},ellipse:{enabled:!1},hand:{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}}};var DocumentIssueTypeEnum,ImageFrameSourceType,FramePropertiesType,DocumentType;!function(DocumentIssueTypeEnum){DocumentIssueTypeEnum.overflow="overflow",DocumentIssueTypeEnum.fontLoading="fontLoading",DocumentIssueTypeEnum.actionRegister="actionRegister",DocumentIssueTypeEnum.actionExecution="actionExecution",DocumentIssueTypeEnum.actionCircular="actionCircular"}(DocumentIssueTypeEnum||(DocumentIssueTypeEnum={})),function(ImageFrameSourceType){ImageFrameSourceType.url="url",ImageFrameSourceType.assetProvider="assetProvider",ImageFrameSourceType.variable="variable"}(ImageFrameSourceType||(ImageFrameSourceType={})),function(FramePropertiesType){FramePropertiesType.top="top",FramePropertiesType.child="child"}(FramePropertiesType||(FramePropertiesType={})),function(DocumentType){DocumentType.project="project",DocumentType.template="template"}(DocumentType||(DocumentType={}));function getEditorResponseData(response,parse=!0){var _a,_b;try{if(!response.success){const parsedError=null!==(_a=response.error)&&void 0!==_a?_a:"Yikes, something went wrong",parsedCause={cause:{name:String(response.status),message:null!==(_b=response.error)&&void 0!==_b?_b:"Yikes, something went wrong"}};if(404075===response.status){const httpStatusCode=JSON.parse(response.data).statusCode;throw new ConnectorHttpError(httpStatusCode,parsedError,parsedCause)}throw new Error(parsedError,parsedCause)}const dataShouldBeParsed=response.data&&parse;return Object.assign(Object.assign({},response),{parsedData:dataShouldBeParsed?JSON.parse(response.data):response.data})}catch(error){throw console.error(error),error}}class ConnectorHttpError extends Error{constructor(statusCode,message,options){super(message,options),this.statusCode=statusCode}}var _ActionController_editorAPI,__awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},__classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},__classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ActionController{constructor(editorAPI){_ActionController_editorAPI.set(this,void 0),this.getAll=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).getActions().then((result=>getEditorResponseData(result)))})),this.getById=id=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).getActionById(id).then((result=>getEditorResponseData(result)))})),this.create=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).createAction().then((result=>getEditorResponseData(result)))})),this.duplicate=id=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).duplicateAction(id).then((result=>getEditorResponseData(result)))})),this.remove=id=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).removeAction(id).then((result=>getEditorResponseData(result)))})),this.update=(id,update)=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).updateAction(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{name})})),this.updateScript=(id,actionScript)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{script:actionScript})})),this.updateTriggers=(id,triggers)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{triggers})})),this.move=(order,ids)=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).moveActions(order,ids).then((result=>getEditorResponseData(result)))})),this.setTypeError=(id,hasTypeErrors)=>__awaiter(this,void 0,void 0,(function*(){return this.update(id,{hasTypeError:hasTypeErrors})})),this.disable=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).disableActions().then((result=>getEditorResponseData(result)))})),this.enable=()=>__awaiter(this,void 0,void 0,(function*(){return(yield __classPrivateFieldGet(this,_ActionController_editorAPI,"f")).enableActions().then((result=>getEditorResponseData(result)))})),__classPrivateFieldSet(this,_ActionController_editorAPI,editorAPI,"f")}}_ActionController_editorAPI=new WeakMap;var _AnimationController_editorAPI,BarcodeType,BarcodeErrorCorrectionLevel,BarcodeCharacterSet,BarcodeValidationResult,PositionEnum,LayoutType,MeasurementUnit,LayoutIntent,AnimationController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},AnimationController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},AnimationController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class AnimationController{constructor(children){_AnimationController_editorAPI.set(this,void 0),this.getAllOnSelectedLayout=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).getAnimationsOnSelectedLayout().then((result=>getEditorResponseData(result)))})),this.getByFrameId=(id,layoutId)=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).getAnimationByFrameId(id,layoutId).then((result=>getEditorResponseData(result)))})),this.getByLayoutId=id=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).getAnimationsByLayoutId(id).then((result=>getEditorResponseData(result)))})),this.setFrameAnimation=animation=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).setFrameAnimation(JSON.stringify(animation)).then((result=>getEditorResponseData(Object.assign(Object.assign({},result),{data:JSON.stringify(animation)}))))})),this.play=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).playAnimation().then((result=>getEditorResponseData(result)))})),this.pause=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).pauseAnimation().then((result=>getEditorResponseData(result)))})),this.setScrubberPosition=timeInMS=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).setScrubberPosition(timeInMS).then((result=>getEditorResponseData(result)))})),this.setDuration=timeInMS=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).setAnimationDuration(timeInMS).then((result=>getEditorResponseData(result)))})),this.resetFrameAnimation=id=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).resetFrameAnimation(id).then((result=>getEditorResponseData(result)))})),this.reset=()=>AnimationController_awaiter(this,void 0,void 0,(function*(){return(yield AnimationController_classPrivateFieldGet(this,_AnimationController_editorAPI,"f")).resetAnimation().then((result=>getEditorResponseData(result)))})),AnimationController_classPrivateFieldSet(this,_AnimationController_editorAPI,children,"f")}}_AnimationController_editorAPI=new WeakMap,function(BarcodeType){BarcodeType.code39="code39",BarcodeType.code93="code93",BarcodeType.code128="code128",BarcodeType.dataMatrix="dataMatrix",BarcodeType.ean13="ean13",BarcodeType.ean8="ean8",BarcodeType.qr="qr",BarcodeType.upca="upca",BarcodeType.upce="upce",BarcodeType.gs1128="gs1128"}(BarcodeType||(BarcodeType={})),function(BarcodeErrorCorrectionLevel){BarcodeErrorCorrectionLevel.low="low",BarcodeErrorCorrectionLevel.medium="medium",BarcodeErrorCorrectionLevel.quartile="quartile",BarcodeErrorCorrectionLevel.high="high"}(BarcodeErrorCorrectionLevel||(BarcodeErrorCorrectionLevel={})),function(BarcodeCharacterSet){BarcodeCharacterSet.utf8="utf8",BarcodeCharacterSet.iso8859_1="iso8859_1",BarcodeCharacterSet.code128a="code128a",BarcodeCharacterSet.code128b="code128b",BarcodeCharacterSet.code128c="code128c"}(BarcodeCharacterSet||(BarcodeCharacterSet={})),function(BarcodeValidationResult){BarcodeValidationResult.success="success",BarcodeValidationResult.empty="empty",BarcodeValidationResult.invalidLength="invalidLength",BarcodeValidationResult.invalidCharacters="invalidCharacters",BarcodeValidationResult.invalidChecksum="invalidChecksum",BarcodeValidationResult.invalidUPCE="invalidUPCE",BarcodeValidationResult.otherError="otherError"}(BarcodeValidationResult||(BarcodeValidationResult={})),function(PositionEnum){PositionEnum.top="top",PositionEnum.right="right",PositionEnum.bottom="bottom",PositionEnum.left="left"}(PositionEnum||(PositionEnum={})),function(LayoutType){LayoutType.top="top",LayoutType.child="child"}(LayoutType||(LayoutType={})),function(MeasurementUnit){MeasurementUnit.px="px",MeasurementUnit.mm="mm",MeasurementUnit.cm="cm",MeasurementUnit.inch="inch",MeasurementUnit.pt="pt"}(MeasurementUnit||(MeasurementUnit={})),function(LayoutIntent){LayoutIntent.print="print",LayoutIntent.digitalStatic="digitalStatic",LayoutIntent.digitalAnimated="digitalAnimated"}(LayoutIntent||(LayoutIntent={}));var _BarcodeController_editorAPI,BarcodeController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},BarcodeController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},BarcodeController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class BarcodeController{constructor(editorAPI){_BarcodeController_editorAPI.set(this,void 0),this.setBarcodeProperties=(id,properties)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.setEnableBackground=(id,enableBackground)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={enableBackground};return this.setBarcodeProperties(id,properties)})),this.setBackgroundColor=(id,backgroundColor)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={backgroundColor};return this.setBarcodeProperties(id,properties)})),this.setEnableBars=(id,enableBars)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={enableBars};return this.setBarcodeProperties(id,properties)})),this.setBarColor=(id,barColor)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={barColor};return this.setBarcodeProperties(id,properties)})),this.setBarcodeSource=(id,source)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeSource(id,JSON.stringify(source)).then((result=>getEditorResponseData(result)))})),this.removeBarcodeSource=id=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeSource(id,null).then((result=>getEditorResponseData(result)))})),this.setEnableText=(id,enableText)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={enableText};return this.setBarcodeProperties(id,properties)})),this.setBarHeight=(id,barHeight)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={barHeight};return this.setBarcodeProperties(id,properties)})),this.setMagnification=(id,magnification)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={magnification};return this.setBarcodeProperties(id,properties)})),this.setQuietZoneValue=(id,value,position)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const update=position?{left:position===PositionEnum.left?value:void 0,top:position===PositionEnum.top?value:void 0,right:position===PositionEnum.right?value:void 0,bottom:position===PositionEnum.bottom?value:void 0}:{left:value,top:value,right:value,bottom:value};return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({quietZone:update})).then((result=>getEditorResponseData(result)))})),this.setAreQuietZoneValuesCombined=(id,value)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const update={areQuietZoneValuesCombined:value};return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({quietZone:update})).then((result=>getEditorResponseData(result)))})),this.setErrorCorrectionLevel=(id,errorCorrectionLevel)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({errorCorrectionLevel})).then((result=>getEditorResponseData(result)))})),this.setCharacterSet=(id,characterSet)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){return(yield BarcodeController_classPrivateFieldGet(this,_BarcodeController_editorAPI,"f")).setBarcodeProperties(id,JSON.stringify({characterSet})).then((result=>getEditorResponseData(result)))})),this.setDrawLightMarginIndicator=(id,drawLightMarginIndicator)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={drawStartStopChars:drawLightMarginIndicator};return this.setBarcodeProperties(id,properties)})),this.setDrawStartStopChars=(id,drawStartStopChars)=>BarcodeController_awaiter(this,void 0,void 0,(function*(){const properties={drawStartStopChars};return this.setBarcodeProperties(id,properties)})),this.getBarcodeConfigationOptions=type=>{let allowedCharacterSets,allowedErrorCorrectionLevels,allowToggleText=!0,allowBarHeight=!0,allowEnableMagnification=!0,quietZoneAlwaysCombined=!1,allowToggleLightMarginIndicator=!1,allowToggleDrawStartAndEndChar=!1;switch(type){case BarcodeType.qr:allowedCharacterSets=[BarcodeCharacterSet.iso8859_1,BarcodeCharacterSet.utf8],allowedErrorCorrectionLevels=[BarcodeErrorCorrectionLevel.low,BarcodeErrorCorrectionLevel.medium,BarcodeErrorCorrectionLevel.quartile,BarcodeErrorCorrectionLevel.high];case BarcodeType.dataMatrix:allowToggleText=!1,allowBarHeight=!1,allowEnableMagnification=!1,quietZoneAlwaysCombined=!0;break;case BarcodeType.ean13:allowToggleText=!1,allowToggleLightMarginIndicator=!0;break;case BarcodeType.ean8:allowToggleLightMarginIndicator=!0;case BarcodeType.upca:case BarcodeType.upce:allowToggleText=!1;break;case BarcodeType.code128:case BarcodeType.gs1128:allowedCharacterSets=[BarcodeCharacterSet.code128a,BarcodeCharacterSet.code128b,BarcodeCharacterSet.code128c];break;case BarcodeType.code39:allowToggleDrawStartAndEndChar=!0}return{allowEnableMagnification,allowBarHeight,allowQuietZone:!0,allowedCharacterSets,allowedErrorCorrectionLevels,allowToggleText,quietZoneAlwaysCombined,allowToggleLightMarginIndicator,allowToggleDrawStartAndEndChar}},BarcodeController_classPrivateFieldSet(this,_BarcodeController_editorAPI,editorAPI,"f")}}_BarcodeController_editorAPI=new WeakMap;var _CanvasController_editorAPI,CanvasController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},CanvasController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},CanvasController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class CanvasController{constructor(editorAPI){_CanvasController_editorAPI.set(this,void 0),this.zoomToPage=(id,left,top,width,height)=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).zoomToPage(id,left,top,width,height).then((result=>getEditorResponseData(result)))})),this.getZoomPercentage=()=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).getZoomPercentage().then((result=>getEditorResponseData(result)))})),this.setZoomPercentage=scaleFactor=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).setZoomPercentage(scaleFactor).then((result=>getEditorResponseData(result)))})),this.setViewMode=viewMode=>CanvasController_awaiter(this,void 0,void 0,(function*(){return(yield CanvasController_classPrivateFieldGet(this,_CanvasController_editorAPI,"f")).setViewMode(viewMode).then((result=>getEditorResponseData(result)))})),CanvasController_classPrivateFieldSet(this,_CanvasController_editorAPI,editorAPI,"f")}}_CanvasController_editorAPI=new WeakMap;var _CharacterStyleController_editorAPI,CharacterStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},CharacterStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},CharacterStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class CharacterStyleController{constructor(editorAPI){_CharacterStyleController_editorAPI.set(this,void 0),this.getAll=()=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).getCharacterStyles().then((result=>getEditorResponseData(result)))})),this.getById=characterStyleId=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).getCharacterStyleById(characterStyleId).then((result=>getEditorResponseData(result)))})),this.create=()=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).createCharacterStyle().then((result=>getEditorResponseData(result)))})),this.update=(characterStyleId,characterStyle)=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).updateCharacterStyle(characterStyleId,JSON.stringify(characterStyle)).then((result=>getEditorResponseData(result)))})),this.remove=characterStyleId=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).removeCharacterStyle(characterStyleId).then((result=>getEditorResponseData(result)))})),this.duplicate=characterStyleId=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).duplicateCharacterStyle(characterStyleId).then((result=>getEditorResponseData(result)))})),this.rename=(characterStyleId,characterStyleName)=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).renameCharacterStyle(characterStyleId,characterStyleName).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>CharacterStyleController_awaiter(this,void 0,void 0,(function*(){return(yield CharacterStyleController_classPrivateFieldGet(this,_CharacterStyleController_editorAPI,"f")).moveCharacterStyles(order,ids).then((result=>getEditorResponseData(result)))})),CharacterStyleController_classPrivateFieldSet(this,_CharacterStyleController_editorAPI,editorAPI,"f")}}_CharacterStyleController_editorAPI=new WeakMap;var _ClipboardController_editorAPI,ClipboardController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ClipboardController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ClipboardController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ClipboardController{constructor(editorAPI){_ClipboardController_editorAPI.set(this,void 0),this.copyFrames=ids=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),frameData=yield res.copyFrames(ids);return frameData.data&&(yield navigator.clipboard.writeText(frameData.data)),getEditorResponseData(frameData)})),this.cutFrames=ids=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),frameData=yield res.cutFrames(ids);return frameData.data&&(yield navigator.clipboard.writeText(frameData.data)),getEditorResponseData(frameData)})),this.pasteFrames=()=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),clipboardData=yield navigator.clipboard.readText();return getEditorResponseData(yield res.pasteFrames(clipboardData))})),this.getContentType=()=>ClipboardController_awaiter(this,void 0,void 0,(function*(){const res=yield ClipboardController_classPrivateFieldGet(this,_ClipboardController_editorAPI,"f"),clipboardData=yield navigator.clipboard.readText();return getEditorResponseData(yield res.getClipboardContentType(clipboardData))})),ClipboardController_classPrivateFieldSet(this,_ClipboardController_editorAPI,editorAPI,"f")}}_ClipboardController_editorAPI=new WeakMap;var _ColorConversionController_editorAPI,ColorType,ColorUsageType,ColorConversionController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ColorConversionController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ColorConversionController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ColorConversionController{constructor(editorAPI){_ColorConversionController_editorAPI.set(this,void 0),this.convertToRgb=color=>ColorConversionController_awaiter(this,void 0,void 0,(function*(){return(yield ColorConversionController_classPrivateFieldGet(this,_ColorConversionController_editorAPI,"f")).colorToRgb(color).then((result=>getEditorResponseData(result)))})),ColorConversionController_classPrivateFieldSet(this,_ColorConversionController_editorAPI,editorAPI,"f")}}_ColorConversionController_editorAPI=new WeakMap,function(ColorType){ColorType.rgb="rgb",ColorType.hex="hex",ColorType.cmyk="cmyk",ColorType.gray="gray",ColorType.hsl="hsl",ColorType.spot="spot",ColorType.spotCMYK="spotCMYK",ColorType.spotRGB="spotRGB"}(ColorType||(ColorType={})),function(ColorUsageType){ColorUsageType.local="local",ColorUsageType.stylekit="stylekit"}(ColorUsageType||(ColorUsageType={}));var _ColorStyleController_editorAPI,DeprecatedMediaType,DeprecatedMediaConnectorDownloadType,MediaType,ConnectorType,SortBy,SortOrder,ConnectorRegistrationSource,ConnectorMappingSource,ConnectorMappingDirection,ConnectorStateType,ConnectorEventType,ColorStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ColorStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ColorStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ColorStyleController{constructor(editorAPI){_ColorStyleController_editorAPI.set(this,void 0),this.getAll=()=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).getColors().then((result=>getEditorResponseData(result)))})),this.getById=id=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).getColorById(id).then((result=>getEditorResponseData(result)))})),this.create=()=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).createColor().then((result=>getEditorResponseData(result)))})),this.duplicate=id=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).duplicateColor(id).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).moveColors(order,ids).then((result=>getEditorResponseData(result)))})),this.rename=(id,newColorName)=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).renameColor(id,newColorName).then((result=>getEditorResponseData(result)))})),this.update=(id,newColorProperties)=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){const res=yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f"),properties=newColorProperties;return properties.type===ColorType.spot&&(properties.type=ColorType.spotCMYK),res.updateColor(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.remove=id=>ColorStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ColorStyleController_classPrivateFieldGet(this,_ColorStyleController_editorAPI,"f")).removeColor(id).then((result=>getEditorResponseData(result)))})),ColorStyleController_classPrivateFieldSet(this,_ColorStyleController_editorAPI,editorAPI,"f")}}_ColorStyleController_editorAPI=new WeakMap,function(DeprecatedMediaType){DeprecatedMediaType[DeprecatedMediaType.file=0]="file",DeprecatedMediaType[DeprecatedMediaType.collection=1]="collection"}(DeprecatedMediaType||(DeprecatedMediaType={})),function(DeprecatedMediaConnectorDownloadType){DeprecatedMediaConnectorDownloadType.LowResolutionWeb="lowresWeb",DeprecatedMediaConnectorDownloadType.HighResolutionWeb="highresWeb"}(DeprecatedMediaConnectorDownloadType||(DeprecatedMediaConnectorDownloadType={})),function(MediaType){MediaType.file="file",MediaType.collection="collection"}(MediaType||(MediaType={})),function(ConnectorType){ConnectorType.media="media",ConnectorType.fonts="fonts",ConnectorType.data="data"}(ConnectorType||(ConnectorType={})),function(SortBy){SortBy.name="name",SortBy.path="relativePath",SortBy.id="id"}(SortBy||(SortBy={})),function(SortOrder){SortOrder.ascending="asc",SortOrder.descending="desc"}(SortOrder||(SortOrder={})),function(ConnectorRegistrationSource){ConnectorRegistrationSource.url="url",ConnectorRegistrationSource.grafx="grafx",ConnectorRegistrationSource.local="local"}(ConnectorRegistrationSource||(ConnectorRegistrationSource={}));class ConnectorMapping{constructor(contextProperty,mapFrom,sourceValue,direction=ConnectorMappingDirection.engineToConnector){this.direction=ConnectorMappingDirection.engineToConnector,this.name=contextProperty,this.direction=direction,mapFrom===ConnectorMappingSource.variable?this.value=`${mapFrom}.${sourceValue}`:this.value=sourceValue}}!function(ConnectorMappingSource){ConnectorMappingSource.variable="var",ConnectorMappingSource.value="value"}(ConnectorMappingSource||(ConnectorMappingSource={})),function(ConnectorMappingDirection){ConnectorMappingDirection.engineToConnector="engineToConnector",ConnectorMappingDirection.connectorToEngine="connectorToEngine"}(ConnectorMappingDirection||(ConnectorMappingDirection={})),function(ConnectorStateType){ConnectorStateType.loading="loading",ConnectorStateType.loaded="loaded",ConnectorStateType.running="running",ConnectorStateType.ready="ready",ConnectorStateType.error="error"}(ConnectorStateType||(ConnectorStateType={})),function(ConnectorEventType){ConnectorEventType.stateChanged="stateChanged",ConnectorEventType.authChanged="authChanged",ConnectorEventType.reloadRequired="reloadRequired",ConnectorEventType.unloaded="unloaded"}(ConnectorEventType||(ConnectorEventType={}));const grafxMediaConnectorRegistration={url:"grafx-media.json",source:ConnectorRegistrationSource.local};class GrafxTokenAuthCredentials{constructor(token){this.type=AuthCredentialsTypeEnum.grafxToken,this.token=token}}class RefreshedAuthCredendentials{constructor(){this.type=AuthCredentialsTypeEnum.refreshed}}var AuthCredentialsTypeEnum,AuthRefreshTypeEnum;!function(AuthCredentialsTypeEnum){AuthCredentialsTypeEnum.grafxToken="grafxToken",AuthCredentialsTypeEnum.refreshed="refreshed"}(AuthCredentialsTypeEnum||(AuthCredentialsTypeEnum={})),function(AuthRefreshTypeEnum){AuthRefreshTypeEnum.grafxToken="grafxToken",AuthRefreshTypeEnum.any="any"}(AuthRefreshTypeEnum||(AuthRefreshTypeEnum={}));class ConnectorCompatibilityTools{constructor(){this.makeConnectorSourceForwardsCompatible=registration=>{if(registration.source!=ConnectorRegistrationSource.grafx)return registration;if(this.isSourceMigrated(registration))return registration;let url=registration.url;for(;url.endsWith("/");)url=url.substring(0,url.length-1);const pathChunks=url.split("/");return{id:pathChunks[pathChunks.length-1],source:ConnectorRegistrationSource.grafx}},this.makeMultipleConnectorsBackwardsCompatible=(connectors,baseUrl)=>connectors.map((connector=>this.makeSingleConnectorBackwardsCompatible(connector,baseUrl))),this.makeSingleConnectorBackwardsCompatible=(connector,baseUrl)=>connector.source.source!=ConnectorRegistrationSource.grafx?connector:{id:connector.id,name:connector.name,iconUrl:connector.iconUrl,source:this.makeConnectorSourceBackwardsCompatible(connector.source,baseUrl)},this.makeConnectorSourceBackwardsCompatible=(connector,baseUrl)=>{let url=baseUrl;for(;null==url?void 0:url.endsWith("/");)url=url.substring(0,url.length-1);return{url:`${url}/connectors/${connector.id}`,source:ConnectorRegistrationSource.grafx}},this.isSourceMigrated=registration=>"id"in registration}}var _ConnectorController_editorAPI,_ConnectorController_localConfig,_ConnectorController_connectorCompatibilityTools,_ConnectorConfigurator_connectorId,_ConnectorConfigurator_res,ConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ConnectorController{constructor(editorAPI,localConfig){_ConnectorController_editorAPI.set(this,void 0),_ConnectorController_localConfig.set(this,void 0),_ConnectorController_connectorCompatibilityTools.set(this,void 0),this.getById=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorById(id).then((result=>getEditorResponseData(result))).then((resp=>{const update=Object.assign(Object.assign({},resp),{parsedData:null});return resp.parsedData&&(update.parsedData=ConnectorController_classPrivateFieldGet(this,_ConnectorController_connectorCompatibilityTools,"f").makeSingleConnectorBackwardsCompatible(resp.parsedData,ConnectorController_classPrivateFieldGet(this,_ConnectorController_localConfig,"f").get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl))),update}))})),this.getAllByType=type=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectors(type).then((result=>getEditorResponseData(result))).then((resp=>{const update=Object.assign(Object.assign({},resp),{parsedData:null});return resp.parsedData&&(update.parsedData=ConnectorController_classPrivateFieldGet(this,_ConnectorController_connectorCompatibilityTools,"f").makeMultipleConnectorsBackwardsCompatible(resp.parsedData,ConnectorController_classPrivateFieldGet(this,_ConnectorController_localConfig,"f").get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl))),update}))})),this.register=registration=>ConnectorController_awaiter(this,void 0,void 0,(function*(){const res=yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f"),connectorRegistration=ConnectorController_classPrivateFieldGet(this,_ConnectorController_connectorCompatibilityTools,"f").makeConnectorSourceForwardsCompatible(registration);return res.registerConnector(JSON.stringify(connectorRegistration)).then((result=>getEditorResponseData(result)))})),this.unregister=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).unregisterConnector(id).then((result=>getEditorResponseData(result)))})),this.configure=(id,configurationCallback)=>ConnectorController_awaiter(this,void 0,void 0,(function*(){const res=yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f");return yield this.waitToBeReady(id),yield configurationCallback(new ConnectorConfigurator(id,res)),res.updateConnectorConfiguration(id).then((result=>getEditorResponseData(result)))})),this.getState=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorState(id).then((result=>getEditorResponseData(result)))})),this.getOptions=id=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorOptions(id).then((result=>getEditorResponseData(result)))})),this.waitToBeReady=(id,timeoutMilliseconds=2e3)=>ConnectorController_awaiter(this,void 0,void 0,(function*(){let timeout=Math.max(timeoutMilliseconds,500);timeout=Math.min(timeout,5e3);let retries=0;try{for(;100*retries<timeout;){const result=yield this.getState(id);if(result.success&&result.parsedData&&(result.parsedData.type===ConnectorStateType.running||result.parsedData.type===ConnectorStateType.ready))return getEditorResponseData({data:null,success:!0,error:void 0,status:0,parsedData:void 0},!1);yield new Promise((resolve=>setTimeout(resolve,100))),retries++}}catch(err){return getEditorResponseData({data:null,success:!1,error:`Error while getting connector state ${err}`,status:5e4,parsedData:void 0},!1)}return getEditorResponseData({data:null,success:!1,error:"Timed out waiting for connector",status:5e4,parsedData:void 0},!1)})),ConnectorController_classPrivateFieldSet(this,_ConnectorController_editorAPI,editorAPI,"f"),ConnectorController_classPrivateFieldSet(this,_ConnectorController_localConfig,localConfig,"f"),ConnectorController_classPrivateFieldSet(this,_ConnectorController_connectorCompatibilityTools,new ConnectorCompatibilityTools,"f")}getMappings(id,direction){return ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield ConnectorController_classPrivateFieldGet(this,_ConnectorController_editorAPI,"f")).getConnectorMappings(id).then((result=>getEditorResponseData(result))).then((result=>{var _a;return direction?Object.assign(Object.assign({},result),{parsedData:null===(_a=result.parsedData)||void 0===_a?void 0:_a.filter((cm=>cm.direction===direction))}):result}))}))}}_ConnectorController_editorAPI=new WeakMap,_ConnectorController_localConfig=new WeakMap,_ConnectorController_connectorCompatibilityTools=new WeakMap;class ConnectorConfigurator{constructor(id,res){_ConnectorConfigurator_connectorId.set(this,void 0),_ConnectorConfigurator_res.set(this,void 0),this.setOptions=options=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_res,"f").setConnectorOptions(ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_connectorId,"f"),JSON.stringify(options)).then((result=>getEditorResponseData(result)))})),this.setMappings=mappings=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return getEditorResponseData(yield ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_res,"f").setConnectorMappings(ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_connectorId,"f"),mappings.map((function(m){return JSON.stringify(m)}))))})),this.setHttpHeader=(headerName,headerValue)=>ConnectorController_awaiter(this,void 0,void 0,(function*(){return ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_res,"f").connectorAuthenticationSetHttpHeader(ConnectorController_classPrivateFieldGet(this,_ConnectorConfigurator_connectorId,"f"),headerName,headerValue).then((result=>getEditorResponseData(result)))})),ConnectorController_classPrivateFieldSet(this,_ConnectorConfigurator_connectorId,id,"f"),ConnectorController_classPrivateFieldSet(this,_ConnectorConfigurator_res,res,"f")}}_ConnectorConfigurator_connectorId=new WeakMap,_ConnectorConfigurator_res=new WeakMap;var _DataConnectorController_editorAPI,_DataConnectorController_dataItemMappingTools,DataConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DataConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DataConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DataConnectorController{constructor(editorAPI,dataItemMappingTools){_DataConnectorController_editorAPI.set(this,void 0),_DataConnectorController_dataItemMappingTools.set(this,void 0),this.getPage=(connectorId,config,context={})=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetPage(connectorId,JSON.stringify(config),JSON.stringify(context)).then((result=>getEditorResponseData(result))).then((resp=>{const update=Object.assign(Object.assign({},resp),{parsedData:null});return resp.parsedData&&(update.parsedData={data:resp.parsedData.data.map((e=>DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_dataItemMappingTools,"f").mapEngineToDataItem(e))),continuationToken:resp.parsedData.continuationToken}),update}))})),this.getModel=(connectorId,context={})=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetModel(connectorId,JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.getConfigurationOptions=connectorId=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetConfigurationOptions(connectorId).then((result=>getEditorResponseData(result)))})),this.getCapabilities=connectorId=>DataConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield DataConnectorController_classPrivateFieldGet(this,_DataConnectorController_editorAPI,"f")).dataConnectorGetCapabilities(connectorId).then((result=>getEditorResponseData(result)))})),DataConnectorController_classPrivateFieldSet(this,_DataConnectorController_editorAPI,editorAPI,"f"),DataConnectorController_classPrivateFieldSet(this,_DataConnectorController_dataItemMappingTools,dataItemMappingTools,"f")}}_DataConnectorController_editorAPI=new WeakMap,_DataConnectorController_dataItemMappingTools=new WeakMap;var _DataSourceController_editorAPI,_DataSourceController_dataItemMappingTools,DataSourceController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DataSourceController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DataSourceController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DataSourceController{constructor(editorAPI,dataItemMappingTools){_DataSourceController_editorAPI.set(this,void 0),_DataSourceController_dataItemMappingTools.set(this,void 0),this.setDataSource=connectorId=>DataSourceController_awaiter(this,void 0,void 0,(function*(){return(yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f")).setDataSource(connectorId).then((result=>getEditorResponseData(result)))})),this.getDataSource=()=>DataSourceController_awaiter(this,void 0,void 0,(function*(){return(yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f")).getDataSource().then((result=>getEditorResponseData(result)))})),this.removeDataSource=()=>DataSourceController_awaiter(this,void 0,void 0,(function*(){return(yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f")).removeDataSource().then((result=>getEditorResponseData(result)))})),this.setDataRow=dataRow=>DataSourceController_awaiter(this,void 0,void 0,(function*(){const res=yield DataSourceController_classPrivateFieldGet(this,_DataSourceController_editorAPI,"f"),engineDataItem=DataSourceController_classPrivateFieldGet(this,_DataSourceController_dataItemMappingTools,"f").mapDataItemToEngine(dataRow);return res.setDataRow(JSON.stringify(engineDataItem)).then((result=>getEditorResponseData(result)))})),DataSourceController_classPrivateFieldSet(this,_DataSourceController_editorAPI,editorAPI,"f"),DataSourceController_classPrivateFieldSet(this,_DataSourceController_dataItemMappingTools,dataItemMappingTools,"f")}}_DataSourceController_editorAPI=new WeakMap,_DataSourceController_dataItemMappingTools=new WeakMap;var _DebugController_editorAPI,DebugController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DebugController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DebugController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DebugController{constructor(editorAPI){_DebugController_editorAPI.set(this,void 0),this.getAllLogs=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).getLogs().then((result=>getEditorResponseData(result)))})),this.toggleDebugPanel=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).toggleDebugPanel().then((result=>getEditorResponseData(result)))})),this.enableDebug=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).enableDebug().then((result=>getEditorResponseData(result)))})),this.disableDebug=()=>DebugController_awaiter(this,void 0,void 0,(function*(){return(yield DebugController_classPrivateFieldGet(this,_DebugController_editorAPI,"f")).disableDebug().then((result=>getEditorResponseData(result)))})),DebugController_classPrivateFieldSet(this,_DebugController_editorAPI,editorAPI,"f")}}_DebugController_editorAPI=new WeakMap;var _DocumentController_editorAPI,AutoGrowDirection,ImageSourceTypeEnum,FrameTypeEnum,BarcodeSourceTypeEnum,TextDirection,FlowDirection,VerticalAlign,BlendMode,FitMode,FitModePosition,UpdateZIndexMethod,FrameAnchorType,AnchorTargetType,AnchorTargetEdgeType,DocumentController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},DocumentController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},DocumentController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class DocumentController{constructor(editorAPI){_DocumentController_editorAPI.set(this,void 0),this.getCurrentState=()=>DocumentController_awaiter(this,void 0,void 0,(function*(){return(yield DocumentController_classPrivateFieldGet(this,_DocumentController_editorAPI,"f")).getCurrentDocumentState().then((result=>getEditorResponseData(result)))})),this.load=(doc,options={keepConnectors:!1})=>DocumentController_awaiter(this,void 0,void 0,(function*(){const res=yield DocumentController_classPrivateFieldGet(this,_DocumentController_editorAPI,"f"),parsedDoc="string"!=typeof doc?JSON.stringify(doc):doc;return res.loadDocument(parsedDoc,JSON.stringify(options)).then((result=>getEditorResponseData(result)))})),this.createAndLoad=preset=>DocumentController_awaiter(this,void 0,void 0,(function*(){const res=yield DocumentController_classPrivateFieldGet(this,_DocumentController_editorAPI,"f"),parsedDoc=JSON.stringify(preset);return res.createAndLoadDocument(parsedDoc).then((result=>getEditorResponseData(result)))})),DocumentController_classPrivateFieldSet(this,_DocumentController_editorAPI,editorAPI,"f")}}_DocumentController_editorAPI=new WeakMap,function(AutoGrowDirection){AutoGrowDirection.top="top",AutoGrowDirection.bottom="bottom",AutoGrowDirection.left="left",AutoGrowDirection.right="right"}(AutoGrowDirection||(AutoGrowDirection={})),function(ImageSourceTypeEnum){ImageSourceTypeEnum.url="url",ImageSourceTypeEnum.variable="variable",ImageSourceTypeEnum.connector="connector"}(ImageSourceTypeEnum||(ImageSourceTypeEnum={})),function(FrameTypeEnum){FrameTypeEnum.text="text",FrameTypeEnum.image="image",FrameTypeEnum.shape="shape",FrameTypeEnum.barcode="barcode"}(FrameTypeEnum||(FrameTypeEnum={})),function(BarcodeSourceTypeEnum){BarcodeSourceTypeEnum.variable="variable",BarcodeSourceTypeEnum.text="text"}(BarcodeSourceTypeEnum||(BarcodeSourceTypeEnum={})),function(TextDirection){TextDirection.leftToRight="leftToRight",TextDirection.rightToLeft="rightToLeft",TextDirection.weak="weak"}(TextDirection||(TextDirection={})),function(FlowDirection){FlowDirection.horizontal="horizontal",FlowDirection.vertical="vertical",FlowDirection.onPath="onPath"}(FlowDirection||(FlowDirection={})),function(VerticalAlign){VerticalAlign.top="top",VerticalAlign.bottom="bottom",VerticalAlign.middle="middle",VerticalAlign.justify="justify"}(VerticalAlign||(VerticalAlign={})),function(BlendMode){BlendMode.normal="normal",BlendMode.screen="screen",BlendMode.overlay="overlay",BlendMode.darken="darken",BlendMode.lighten="lighten",BlendMode.colorDodge="colorDodge",BlendMode.colorBurn="colorBurn",BlendMode.hardLight="hardLight",BlendMode.softLight="softLight",BlendMode.difference="difference",BlendMode.exclusion="exclusion",BlendMode.multiply="multiply",BlendMode.hue="hue",BlendMode.saturation="saturation",BlendMode.color="color",BlendMode.luminosity="luminosity"}(BlendMode||(BlendMode={})),function(FitMode){FitMode.fill="fill",FitMode.fit="fit",FitMode.smartCrop="smartCrop",FitMode.manualCrop="manualCrop"}(FitMode||(FitMode={})),function(FitModePosition){FitModePosition.topLeft="topLeft",FitModePosition.topCenter="topCenter",FitModePosition.topRight="topRight",FitModePosition.centerLeft="centerLeft",FitModePosition.center="center",FitModePosition.centerRight="centerRight",FitModePosition.bottomLeft="bottomLeft",FitModePosition.bottomCenter="bottomCenter",FitModePosition.bottomRight="bottomRight"}(FitModePosition||(FitModePosition={})),function(UpdateZIndexMethod){UpdateZIndexMethod.bringToFront="bringToFront",UpdateZIndexMethod.sendToBack="sendToBack",UpdateZIndexMethod.bringForward="bringForward",UpdateZIndexMethod.sendBackward="sendBackward"}(UpdateZIndexMethod||(UpdateZIndexMethod={})),function(FrameAnchorType){FrameAnchorType.relative="relative",FrameAnchorType.start="start",FrameAnchorType.end="end",FrameAnchorType.startAndEnd="startAndEnd",FrameAnchorType.center="center"}(FrameAnchorType||(FrameAnchorType={})),function(AnchorTargetType){AnchorTargetType.page="page",AnchorTargetType.frame="frame"}(AnchorTargetType||(AnchorTargetType={})),function(AnchorTargetEdgeType){AnchorTargetEdgeType.start="start",AnchorTargetEdgeType.end="end",AnchorTargetEdgeType.center="center"}(AnchorTargetEdgeType||(AnchorTargetEdgeType={}));class PageAnchorTarget{constructor(){this.type=AnchorTargetType.page}}class FrameAnchorTarget{constructor(id,edge){this.type=AnchorTargetType.frame,this.frameId=id,this.edge=edge}}var _ExperimentController_editorAPI,ExperimentController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ExperimentController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ExperimentController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ExperimentController{constructor(editorAPI){_ExperimentController_editorAPI.set(this,void 0),this.insertImageVariableToFrame=(imageFrameId,variableId)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){const res=yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f"),src={id:variableId,type:ImageSourceTypeEnum.variable};return res.setImageSource(imageFrameId,JSON.stringify(src)).then((result=>getEditorResponseData(result)))})),this.insertTextVariable=id=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).insertTextVariable(id).then((result=>getEditorResponseData(result)))})),this.enterTextEditMode=id=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).enterTextEditMode(id).then((result=>getEditorResponseData(result)))})),this.exitTextEditMode=()=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).exitTextEditMode().then((result=>getEditorResponseData(result)))})),this.getText=(frameId,textType)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).getTextByFrameId(frameId,textType).then((result=>getEditorResponseData(result)))})),this.setText=(frameId,text)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).setTextByFrameId(frameId,text).then((result=>getEditorResponseData(result)))})),this.selectText=(frameId,startIndex,length)=>ExperimentController_awaiter(this,void 0,void 0,(function*(){return(yield ExperimentController_classPrivateFieldGet(this,_ExperimentController_editorAPI,"f")).selectTextById(frameId,startIndex,length).then((result=>getEditorResponseData(result)))})),ExperimentController_classPrivateFieldSet(this,_ExperimentController_editorAPI,editorAPI,"f")}}_ExperimentController_editorAPI=new WeakMap;var _FontConnectorController_editorAPI,_FontConnectorController_blobAPI,FontConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},FontConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},FontConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class FontConnectorController{constructor(editorAPI){_FontConnectorController_editorAPI.set(this,void 0),_FontConnectorController_blobAPI.set(this,void 0),this.query=(connectorId,queryOptions,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorQuery(connectorId,JSON.stringify(queryOptions),JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.detail=(connectorId,fontFamilyId,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorDetail(connectorId,fontFamilyId,JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.download=(connectorId,fontStyleId,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_blobAPI,"f")).fontConnectorDownload(connectorId,fontStyleId,JSON.stringify(context)).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.preview=(connectorId,fontFamilyId,previewFormat,context={})=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_blobAPI,"f")).fontConnectorPreview(connectorId,fontFamilyId,previewFormat,JSON.stringify(context)).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.getConfigurationOptions=connectorId=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorGetConfigurationOptions(connectorId).then((result=>getEditorResponseData(result)))})),this.getCapabilities=connectorId=>FontConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield FontConnectorController_classPrivateFieldGet(this,_FontConnectorController_editorAPI,"f")).fontConnectorGetCapabilities(connectorId).then((result=>getEditorResponseData(result)))})),this.parseDeprecatedFontType=deprecatedType=>deprecatedType===DeprecatedMediaType.file?MediaType.file:deprecatedType===DeprecatedMediaType.collection?MediaType.collection:void 0,FontConnectorController_classPrivateFieldSet(this,_FontConnectorController_editorAPI,editorAPI,"f"),FontConnectorController_classPrivateFieldSet(this,_FontConnectorController_blobAPI,editorAPI,"f")}}_FontConnectorController_editorAPI=new WeakMap,_FontConnectorController_blobAPI=new WeakMap;var _FontController_editorAPI,FontController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},FontController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},FontController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class FontController{constructor(editorAPI){_FontController_editorAPI.set(this,void 0),this.addFontFamily=(connectorId,fontFamily)=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).addFontFamily(connectorId,JSON.stringify(fontFamily)).then((result=>getEditorResponseData(result)))})),this.removeFontFamily=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).removeFontFamily(id).then((result=>getEditorResponseData(result)))})),this.addFontStyle=(connectorId,fontStyle)=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).addFontStyle(connectorId,JSON.stringify(fontStyle)).then((result=>getEditorResponseData(result)))})),this.removeFontStyle=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).removeFontStyle(id).then((result=>getEditorResponseData(result)))})),this.getFontFamilies=()=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontFamilies().then((result=>getEditorResponseData(result)))})),this.getFontStyles=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontStyles(id).then((result=>getEditorResponseData(result)))})),this.getFontFamilyById=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontFamilyById(id).then((result=>getEditorResponseData(result)))})),this.getFontStyleById=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getFontStyleById(id).then((result=>getEditorResponseData(result)))})),this.getDefaultFontStyle=()=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getDefaultFontStyle().then((result=>getEditorResponseData(result)))})),this.getDefaultFontFamily=()=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).getDefaultFontFamily().then((result=>getEditorResponseData(result)))})),this.isFontFamilyUsed=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).isFontFamilyUsed(id).then((result=>getEditorResponseData(result)))})),this.isFontStyleUsed=id=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).isFontStyleUsed(id).then((result=>getEditorResponseData(result)))})),this.moveFontFamilies=(order,ids)=>FontController_awaiter(this,void 0,void 0,(function*(){return(yield FontController_classPrivateFieldGet(this,_FontController_editorAPI,"f")).moveFontFamilies(order,ids).then((result=>getEditorResponseData(result)))})),FontController_classPrivateFieldSet(this,_FontController_editorAPI,editorAPI,"f")}}_FontController_editorAPI=new WeakMap;var _ShapeController_editorAPI,ShapeController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ShapeController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ShapeController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ShapeController{constructor(editorAPI){_ShapeController_editorAPI.set(this,void 0),this.setShapeProperties=(id,properties)=>ShapeController_awaiter(this,void 0,void 0,(function*(){return(yield ShapeController_classPrivateFieldGet(this,_ShapeController_editorAPI,"f")).setShapeProperties(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.setEnableFill=(id,enableFill)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={enableFill};return this.setShapeProperties(id,properties)})),this.setFillColor=(id,fillColor)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={fillColor};return this.setShapeProperties(id,properties)})),this.setEnableStroke=(id,enableStroke)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={enableStroke};return this.setShapeProperties(id,properties)})),this.setStrokeColor=(id,strokeColor)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={strokeColor};return this.setShapeProperties(id,properties)})),this.setStrokeWeight=(id,strokeWeight)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={strokeWeight};return this.setShapeProperties(id,properties)})),this.setFlagAllCornersSame=(id,allCornersSame)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const properties={allCornersSame};return this.setShapeProperties(id,properties)})),this.setShapeCorners=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){return(yield ShapeController_classPrivateFieldGet(this,_ShapeController_editorAPI,"f")).setShapeCorners(id,JSON.stringify(radius)).then((result=>getEditorResponseData(result)))})),this.setRadiusAll=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={radiusAll:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusTopLeft=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={topLeft:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusBottomLeft=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={bottomLeft:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusTopRight=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={topRight:radius};return this.setShapeCorners(id,cornerRadius)})),this.setRadiusBottomRight=(id,radius)=>ShapeController_awaiter(this,void 0,void 0,(function*(){const cornerRadius={bottomRight:radius};return this.setShapeCorners(id,cornerRadius)})),ShapeController_classPrivateFieldSet(this,_ShapeController_editorAPI,editorAPI,"f")}}_ShapeController_editorAPI=new WeakMap;var _FrameController_editorAPI,FrameController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},FrameController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},FrameController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class FrameController{constructor(editorAPI){_FrameController_editorAPI.set(this,void 0),this.getAll=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFrames().then((result=>getEditorResponseData(result)))})),this.getSelected=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getSelectedFrames().then((result=>getEditorResponseData(result)))})),this.getAllByPageId=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramesByPageId(id).then((result=>getEditorResponseData(result)))})),this.getByName=name=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFrameByName(name).then((result=>getEditorResponseData(result)))})),this.getById=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFrameById(id).then((result=>getEditorResponseData(result)))})),this.getPropertiesOnSelectedLayout=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramePropertiesOnSelectedLayout().then((result=>getEditorResponseData(result)))})),this.getLayoutProperties=(id,layoutId)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramePropertiesByFrameId(id,layoutId).then((result=>getEditorResponseData(result)))})),this.getAllLayoutProperties=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).getFramesProperties(id).then((result=>getEditorResponseData(result)))})),this.resetTransformation=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetSize=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.select=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).selectFrames([id]).then((result=>getEditorResponseData(result)))})),this.selectMultiple=ids=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).selectFrames(ids).then((result=>getEditorResponseData(result)))})),this.reorderFrames=(order,ids)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).reorderFrames(order,ids).then((result=>getEditorResponseData(result)))})),this.setZIndex=(id,method)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameZIndex(id,method).then((result=>getEditorResponseData(result)))})),this.setHeight=(id,height)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameHeight(id,height).then((result=>getEditorResponseData(result)))})),this.setRotation=(id,rotation)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameRotation(id,rotation).then((result=>getEditorResponseData(result)))})),this.setWidth=(id,width)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameWidth(id,width).then((result=>getEditorResponseData(result)))})),this.setX=(id,XValue)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameX(id,XValue).then((result=>getEditorResponseData(result)))})),this.setY=(id,YValue)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameY(id,YValue).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).renameFrame(id,name).then((result=>getEditorResponseData(result)))})),this.reset=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrame(id).then((result=>getEditorResponseData(result)))})),this.resetX=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetY=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetRotation=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetWidth=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetHeight=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),this.resetImageFrameFitMode=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetImageFrameFitMode(id).then((result=>getEditorResponseData(result)))})),this.setVisibility=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameIsVisible(id,value).then((result=>getEditorResponseData(result)))})),this.setIsVisible=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameIsVisible(id,value).then((result=>getEditorResponseData(result)))})),this.remove=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).removeFrames([id]).then((result=>getEditorResponseData(result)))})),this.removeFrames=ids=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).removeFrames(ids).then((result=>getEditorResponseData(result)))})),this.create=(type,x,y,width,height)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).addFrame(type,x,y,width,height).then((result=>getEditorResponseData(result)))})),this.createShapeFrame=(type,x,y,width,height)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).addFrame(type,x,y,width,height).then((result=>getEditorResponseData(result)))})),this.createBarcodeFrame=(type,position)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).addBarcodeFrame(type,null==position?void 0:position.x,null==position?void 0:position.y).then((result=>getEditorResponseData(result)))})),this.duplicateFrames=ids=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).duplicateFrames(ids).then((result=>getEditorResponseData(result)))})),this.updateImageSource=(imageFrameId,src)=>FrameController_awaiter(this,void 0,void 0,(function*(){const res=yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f"),srcJson=null!==src?JSON.stringify(src):null;return res.setImageSource(imageFrameId,srcJson).then((result=>getEditorResponseData(result)))})),this.removeImageSource=imageFrameId=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.updateImageSource(imageFrameId,null)})),this.setImageFromConnector=(imageFrameId,connectorId,assetId)=>FrameController_awaiter(this,void 0,void 0,(function*(){const src={id:connectorId,assetId,type:ImageSourceTypeEnum.connector};return this.updateImageSource(imageFrameId,src)})),this.setImageFromUrl=(imageFrameId,url)=>FrameController_awaiter(this,void 0,void 0,(function*(){const source={url,type:ImageSourceTypeEnum.url};return this.updateImageSource(imageFrameId,source)})),this.setImageFrameFitMode=(imageFrameId,fitMode)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setImageFrameFitMode(imageFrameId,fitMode).then((result=>getEditorResponseData(result)))})),this.setImageFrameFitModePosition=(imageFrameId,position)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setImageFrameFitModePosition(imageFrameId,position).then((result=>getEditorResponseData(result)))})),this.setFrameConstrainProportions=(_id,_constrainProportions)=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("setFrameConstrainProportions is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"setFrameConstrainProportions is not supported anymore",parsedData:null})})),this.setVerticalAlign=(id,verticalAlign)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setVerticalAlignment(id,verticalAlign).then((result=>getEditorResponseData(result)))})),this.setMinCopyfitting=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setMinCopyfitting(id,value).then((result=>getEditorResponseData(result)))})),this.setMaxCopyfitting=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setMaxCopyfitting(id,value).then((result=>getEditorResponseData(result)))})),this.setEnableCopyfitting=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setEnableCopyfitting(id,value).then((result=>getEditorResponseData(result)))})),this.resetMinCopyfitting=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetMinCopyfitting(id).then((result=>getEditorResponseData(result)))})),this.resetMaxCopyfitting=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetMaxCopyfitting(id).then((result=>getEditorResponseData(result)))})),this.resetEnableCopyfitting=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetEnableCopyfitting(id).then((result=>getEditorResponseData(result)))})),this.setShapeFrameEnableFill=(shapeFrameId,enableFill)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setEnableFill(shapeFrameId,enableFill)})),this.setShapeFrameFillColor=(shapeFrameId,fillColor)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setFillColor(shapeFrameId,fillColor)})),this.setShapeFrameEnableStroke=(shapeFrameId,enableStroke)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setEnableStroke(shapeFrameId,enableStroke)})),this.setShapeFrameStrokeColor=(shapeFrameId,strokeColor)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setStrokeColor(shapeFrameId,strokeColor)})),this.setShapeFrameStrokeWeight=(shapeFrameId,strokeWeight)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.shapeController.setStrokeWeight(shapeFrameId,strokeWeight)})),this.setBlendMode=(id,blendMode)=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setFrameBlendMode(id,blendMode).then((result=>getEditorResponseData(result)))})),this.enterCropMode=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).enterCropMode(id).then((result=>getEditorResponseData(result)))})),this.applyCropMode=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).applyCropMode().then((result=>getEditorResponseData(result)))})),this.exitCropMode=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).cancelCropMode().then((result=>getEditorResponseData(result)))})),this.enterSubjectMode=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).enterSubjectMode(id).then((result=>getEditorResponseData(result)))})),this.applySubjectMode=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).applySubjectMode().then((result=>getEditorResponseData(result)))})),this.exitSubjectMode=()=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).cancelSubjectMode().then((result=>getEditorResponseData(result)))})),this.resetCropMode=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetCropMode is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetCropMode is not supported anymore",parsedData:null})})),this.setEnableAutoGrow=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={enabled:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMinWidth=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={minWidth:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMaxWidth=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={maxWidth:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMinHeight=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={minHeight:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowMaxHeight=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={maxHeight:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAutoGrowDirections=(id,value)=>FrameController_awaiter(this,void 0,void 0,(function*(){const update={directions:{value}};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).updateAutoGrowSettings(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.resetAutoGrowSettingsEnabled=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowSettingsEnabled is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowSettingsEnabled is not supported anymore",parsedData:null})})),this.resetAutoGrowMinWidth=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMinWidth is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMinWidth is not supported anymore",parsedData:null})})),this.resetAutoGrowMaxWidth=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMaxWidth is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMaxWidth is not supported anymore",parsedData:null})})),this.resetAutoGrowMinHeight=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMinHeight is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMinHeight is not supported anymore",parsedData:null})})),this.resetAutoGrowMaxHeight=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowMaxHeight is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowMaxHeight is not supported anymore",parsedData:null})})),this.resetAutoGrowDirections=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrowDirections is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrowDirections is not supported anymore",parsedData:null})})),this.resetAutoGrow=_id=>FrameController_awaiter(this,void 0,void 0,(function*(){console.error("resetAutoGrow is not supported anymore");return getEditorResponseData({success:!1,status:0,error:"resetAutoGrow is not supported anymore",parsedData:null})})),this.setAnchor=(id,horizontal,anchorType,anchorTarget,endAnchorTarget)=>FrameController_awaiter(this,void 0,void 0,(function*(){const properties={horizontal,type:anchorType,target:anchorTarget,endTarget:endAnchorTarget};return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).setAnchorProperties(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.setVerticalAnchor=(id,anchorType,anchorTarget,endAnchorTarget)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.setAnchor(id,!1,anchorType,anchorTarget,endAnchorTarget)})),this.setHorizontalAnchor=(id,anchorType,anchorTarget,endAnchorTarget)=>FrameController_awaiter(this,void 0,void 0,(function*(){return this.setAnchor(id,!0,anchorType,anchorTarget,endAnchorTarget)})),this.resetAnchoring=id=>FrameController_awaiter(this,void 0,void 0,(function*(){return(yield FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f")).resetFrameTransformation(id).then((result=>getEditorResponseData(result)))})),FrameController_classPrivateFieldSet(this,_FrameController_editorAPI,editorAPI,"f"),this.shapeController=new ShapeController(FrameController_classPrivateFieldGet(this,_FrameController_editorAPI,"f"))}}_FrameController_editorAPI=new WeakMap;class InfoController{constructor(){this.currentEngineVersion=editor_engine_namespaceObject_V,this.currentSDKVersion=package_namespaceObject_i8}}var _LayoutController_editorAPI,_LayoutController_blobAPI,MediaDownloadType,MediaDownloadIntent,LayoutController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},LayoutController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},LayoutController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class LayoutController{constructor(editorAPI){_LayoutController_editorAPI.set(this,void 0),_LayoutController_blobAPI.set(this,void 0),this.getAll=()=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayouts().then((result=>getEditorResponseData(result)))})),this.getById=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayoutById(id).then((result=>getEditorResponseData(result)))})),this.getByName=name=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayoutByName(name).then((result=>getEditorResponseData(result)))})),this.getSelected=()=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getSelectedLayout().then((result=>getEditorResponseData(result)))})),this.remove=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).removeLayout(id).then((result=>getEditorResponseData(result)))})),this.create=(parentId,presets)=>LayoutController_awaiter(this,void 0,void 0,(function*(){const res=yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f");return(null==presets?void 0:presets.length)?res.addLayouts(parentId,JSON.stringify(presets)).then((result=>getEditorResponseData(result))):res.addLayout(parentId).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).renameLayout(id,name).then((result=>getEditorResponseData(result)))})),this.select=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).selectLayout(id).then((result=>getEditorResponseData(result)))})),this.duplicate=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).duplicateLayout(id).then((result=>getEditorResponseData(result)))})),this.reset=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayout(id).then((result=>getEditorResponseData(result)))})),this.setHeight=(id,height)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutHeight(id,height).then((result=>getEditorResponseData(result)))})),this.setWidth=(id,width)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutWidth(id,width).then((result=>getEditorResponseData(result)))})),this.setUnit=(id,unit)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutUnit(id,unit).then((result=>getEditorResponseData(result)))})),this.resetHeight=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutHeight(id).then((result=>getEditorResponseData(result)))})),this.resetWidth=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutWidth(id).then((result=>getEditorResponseData(result)))})),this.resetUnit=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutUnit(id).then((result=>getEditorResponseData(result)))})),this.getSelectedSnapshot=()=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_blobAPI,"f")).getPageSnapshot().then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.setIntent=(id,intent)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutIntent(id,intent).then((result=>getEditorResponseData(result)))})),this.resetIntent=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutIntent(id).then((result=>getEditorResponseData(result)))})),this.setFillColor=(id,color)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutFillColor(id,JSON.stringify(color)).then((result=>getEditorResponseData(result)))})),this.setFillColorEnabled=(id,enabled)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutFillColorEnabled(id,enabled).then((result=>getEditorResponseData(result)))})),this.resetFillColor=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).resetLayoutFillColor(id).then((result=>getEditorResponseData(result)))})),this.setBleedValue=(id,value,position)=>LayoutController_awaiter(this,void 0,void 0,(function*(){const update=position?{left:position===PositionEnum.left?value:void 0,top:position===PositionEnum.top?value:void 0,right:position===PositionEnum.right?value:void 0,bottom:position===PositionEnum.bottom?value:void 0}:{left:value,top:value,right:value,bottom:value};return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).updateLayoutBleed(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.setAreBleedValuesCombined=(id,value)=>LayoutController_awaiter(this,void 0,void 0,(function*(){const update={areBleedValuesCombined:value};return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).updateLayoutBleed(id,JSON.stringify(update)).then((result=>getEditorResponseData(result)))})),this.resetBleedValues=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).updateLayoutBleed(id,null).then((result=>getEditorResponseData(result)))})),this.setPrivateData=(id,privateData)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutPrivateData(id,JSON.stringify(privateData)).then((result=>getEditorResponseData(result)))})),this.getPrivateData=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayoutPrivateData(id).then((result=>getEditorResponseData(result)))})),this.setDisplayName=(id,displayName)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutDisplayName(id,displayName).then((result=>getEditorResponseData(result)))})),this.getDisplayName=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).getLayoutDisplayName(id).then((result=>getEditorResponseData(result)))})),this.resetDisplayName=id=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutDisplayName(id,null).then((result=>getEditorResponseData(result)))})),this.setAvailableForUser=(id,isAvailable)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutAvailableForUser(id,isAvailable).then((result=>getEditorResponseData(result)))})),this.setSelectedByUser=(id,isSelected)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutSelectedByUser(id,isSelected).then((result=>getEditorResponseData(result)))})),this.setResizableByUser=(id,resizableLayoutProperties)=>LayoutController_awaiter(this,void 0,void 0,(function*(){return(yield LayoutController_classPrivateFieldGet(this,_LayoutController_editorAPI,"f")).setLayoutResizableByUser(id,JSON.stringify(resizableLayoutProperties)).then((result=>getEditorResponseData(result)))})),LayoutController_classPrivateFieldSet(this,_LayoutController_editorAPI,editorAPI,"f"),LayoutController_classPrivateFieldSet(this,_LayoutController_blobAPI,editorAPI,"f")}}_LayoutController_editorAPI=new WeakMap,_LayoutController_blobAPI=new WeakMap,function(MediaDownloadType){MediaDownloadType.thumbnail="thumbnail",MediaDownloadType.mediumres="mediumres",MediaDownloadType.highres="highres",MediaDownloadType.original="original"}(MediaDownloadType||(MediaDownloadType={})),function(MediaDownloadIntent){MediaDownloadIntent.web="web"}(MediaDownloadIntent||(MediaDownloadIntent={}));var _MediaConnectorController_editorAPI,_MediaConnectorController_blobAPI,MediaConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},MediaConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},MediaConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class MediaConnectorController{constructor(editorAPI){_MediaConnectorController_editorAPI.set(this,void 0),_MediaConnectorController_blobAPI.set(this,void 0),this.query=(id,queryOptions,context={})=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorQuery(id,JSON.stringify(queryOptions),JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.detail=(id,mediaId,context={})=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorDetail(id,mediaId,JSON.stringify(context)).then((result=>getEditorResponseData(result)))})),this.download=(id,mediaId,downloadType,context={})=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){const compatibleDownloadType=this.parseDeprecatedMediaDownloadType(downloadType);return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_blobAPI,"f")).mediaConnectorDownload(id,mediaId,compatibleDownloadType,MediaDownloadIntent.web,JSON.stringify(context)).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.getConfigurationOptions=id=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorGetConfigurationOptions(id).then((result=>getEditorResponseData(result)))})),this.getCapabilities=id=>MediaConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield MediaConnectorController_classPrivateFieldGet(this,_MediaConnectorController_editorAPI,"f")).mediaConnectorGetCapabilities(id).then((result=>getEditorResponseData(result)))})),this.parseDeprecatedMediaType=deprecatedType=>deprecatedType===DeprecatedMediaType.file?MediaType.file:deprecatedType===DeprecatedMediaType.collection?MediaType.collection:void 0,MediaConnectorController_classPrivateFieldSet(this,_MediaConnectorController_editorAPI,editorAPI,"f"),MediaConnectorController_classPrivateFieldSet(this,_MediaConnectorController_blobAPI,editorAPI,"f")}parseDeprecatedMediaDownloadType(deprecatedMediaDownloadType){switch(deprecatedMediaDownloadType){case DeprecatedMediaConnectorDownloadType.HighResolutionWeb:return MediaDownloadType.highres;case DeprecatedMediaConnectorDownloadType.LowResolutionWeb:return MediaDownloadType.thumbnail;default:return deprecatedMediaDownloadType}}}_MediaConnectorController_editorAPI=new WeakMap,_MediaConnectorController_blobAPI=new WeakMap;var _PageController_editorAPI,_PageController_blobAPI,PageController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},PageController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},PageController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class PageController{constructor(editorAPI){_PageController_editorAPI.set(this,void 0),_PageController_blobAPI.set(this,void 0),this.add=()=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).addPage().then((result=>getEditorResponseData(result)))})),this.remove=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).removePage(pageId).then((result=>getEditorResponseData(result)))})),this.select=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).selectPage(pageId).then((result=>getEditorResponseData(result)))})),this.setVisibility=(pageId,isVisible)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).setPageIsVisible(pageId,isVisible).then((result=>getEditorResponseData(result)))})),this.duplicate=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).duplicatePage(pageId).then((result=>getEditorResponseData(result)))})),this.getAll=()=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).getPages().then((result=>getEditorResponseData(result)))})),this.getById=pageId=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).getPageById(pageId).then((result=>getEditorResponseData(result)))})),this.getSnapshot=(pageId,settings)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_blobAPI,"f")).getPageSnapshotWithSettings(pageId,null==settings?null:JSON.stringify(settings)).then((result=>{var _a;return null!==(_a=result)&&void 0!==_a?_a:result}))})),this.setWidth=(pageId,width)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).setPageWidth(pageId,width).then((result=>getEditorResponseData(result)))})),this.setHeight=(id,height)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).setPageHeight(id,height).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>PageController_awaiter(this,void 0,void 0,(function*(){return(yield PageController_classPrivateFieldGet(this,_PageController_editorAPI,"f")).reorderPages(order,ids).then((result=>getEditorResponseData(result)))})),PageController_classPrivateFieldSet(this,_PageController_editorAPI,editorAPI,"f"),PageController_classPrivateFieldSet(this,_PageController_blobAPI,editorAPI,"f")}}_PageController_editorAPI=new WeakMap,_PageController_blobAPI=new WeakMap;var _ParagraphStyleController_editorAPI,VariableType,Day,Locale,VariableVisibilityType,VariableVisibilityTargetType,VariableVisibilityOperator,ParagraphStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ParagraphStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ParagraphStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ParagraphStyleController{constructor(editorAPI){_ParagraphStyleController_editorAPI.set(this,void 0),this.getAll=()=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).getParagraphStyles().then((result=>getEditorResponseData(result)))})),this.getById=id=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).getParagraphStyleById(id).then((result=>getEditorResponseData(result)))})),this.create=()=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).createParagraphStyle().then((result=>getEditorResponseData(result)))})),this.duplicate=id=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).duplicateParagraphStyle(id).then((result=>getEditorResponseData(result)))})),this.update=(id,properties)=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).updateParagraphStyle(id,JSON.stringify(properties)).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).renameParagraphStyle(id,name).then((result=>getEditorResponseData(result)))})),this.remove=id=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).removeParagraphStyle(id).then((result=>getEditorResponseData(result)))})),this.move=(order,ids)=>ParagraphStyleController_awaiter(this,void 0,void 0,(function*(){return(yield ParagraphStyleController_classPrivateFieldGet(this,_ParagraphStyleController_editorAPI,"f")).moveParagraphStyles(order,ids).then((result=>getEditorResponseData(result)))})),ParagraphStyleController_classPrivateFieldSet(this,_ParagraphStyleController_editorAPI,editorAPI,"f")}}_ParagraphStyleController_editorAPI=new WeakMap,function(VariableType){VariableType.shortText="shortText",VariableType.longText="longText",VariableType.image="image",VariableType.list="list",VariableType.boolean="boolean",VariableType.group="group",VariableType.number="number",VariableType.date="date"}(VariableType||(VariableType={})),function(Day){Day.Monday="monday",Day.Tuesday="tuesday",Day.Wednesday="wednesday",Day.Thursday="thursday",Day.Friday="friday",Day.Saturday="saturday",Day.Sunday="sunday"}(Day||(Day={})),function(Locale){Locale.en_US="en_US",Locale.cs="cs",Locale.da="da",Locale.nl="nl",Locale.fi="fi",Locale.fr="fr",Locale.de="de",Locale.it="it",Locale.no="no",Locale.pl="pl",Locale.pt_PT="pt_PT",Locale.es_ES="es_ES",Locale.sv="sv"}(Locale||(Locale={})),function(VariableVisibilityType){VariableVisibilityType.visible="visible",VariableVisibilityType.invisible="invisible",VariableVisibilityType.conditional="conditional"}(VariableVisibilityType||(VariableVisibilityType={})),function(VariableVisibilityTargetType){VariableVisibilityTargetType.boolean="boolean",VariableVisibilityTargetType.text="text",VariableVisibilityTargetType.number="number"}(VariableVisibilityTargetType||(VariableVisibilityTargetType={})),function(VariableVisibilityOperator){VariableVisibilityOperator.equals="=",VariableVisibilityOperator.notEquals="!=",VariableVisibilityOperator.greaterThan=">",VariableVisibilityOperator.greaterThanOrEquals=">=",VariableVisibilityOperator.lessThan="<",VariableVisibilityOperator.lessThanOrEquals="<="}(VariableVisibilityOperator||(VariableVisibilityOperator={}));var SubscriberController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};class SubscriberController{constructor(config,localConfig){this.onActionsChanged=actions=>{this.config.events.onActionsChanged.trigger(JSON.parse(actions))},this.onAnimationChanged=animation=>{this.config.events.onFrameAnimationsChanged.trigger(JSON.parse(animation))},this.onAnimationPlaybackChanged=animationPlaybackState=>{this.config.events.onScrubberPositionChanged.trigger(JSON.parse(animationPlaybackState))},this.onSelectedLayoutPropertiesChanged=layoutProperties=>{this.config.events.onSelectedLayoutPropertiesChanged.trigger(JSON.parse(layoutProperties))},this.onSelectedLayoutUnitChanged=unit=>{this.config.events.onSelectedLayoutUnitChanged.trigger(unit)},this.onSelectedFramesLayoutChanged=framesLayout=>{const frames=JSON.parse(framesLayout);this.config.events.onSelectedFramesLayoutChanged.trigger(frames);const singleFrameCallBack=this.config.onSelectedFrameLayoutChanged;singleFrameCallBack&&singleFrameCallBack(frames.length>1?void 0:frames[0])},this.onSelectedFramesContentChanged=framesContent=>{const frames=JSON.parse(framesContent);this.config.events.onSelectedFramesContentChanged.trigger(frames);const singleFrameCallBack=this.config.onSelectedFrameContentChanged;singleFrameCallBack&&singleFrameCallBack(frames.length>1?null:frames[0])},this.onStateChanged=()=>{this.config.events.onStateChanged.trigger()},this.onAuthExpired=authRefreshRequest=>SubscriberController_awaiter(this,void 0,void 0,(function*(){const authCredentials=yield this.config.handlers.onAuthExpired.trigger(JSON.parse(authRefreshRequest));return null!=authCredentials?JSON.stringify(authCredentials):null})),this.onViewportRequested=()=>{const viewport=this.config.handlers.onViewportRequested.trigger();return null!=viewport?JSON.stringify(viewport):null},this.onDocumentLoaded=()=>{this.config.events.onDocumentLoaded.trigger()},this.onPageSelectionChanged=id=>{this.config.events.onPageSelectionChanged.trigger(id)},this.onVariableListChanged=variablesJson=>{const updated=JSON.parse(variablesJson).map((variable=>{var _a;return variable.type===VariableType.list?Object.assign(Object.assign({},variable),{items:variable.items.map((item=>item.value)),selected:null===(_a=variable.selected)||void 0===_a?void 0:_a.value}):variable}));this.config.events.onVariableListChanged.trigger(updated)},this.onSelectedToolChanged=tool=>{this.config.events.onSelectedToolChanged.trigger(tool)},this.onUndoStateChanged=undoState=>{this.config.events.onUndoStackStateChanged.trigger(JSON.parse(undoState))},this.onCustomUndoDataChanged=customData=>{this.config.events.onCustomUndoDataChanged.trigger(JSON.parse(customData))},this.onSelectedLayoutFramesChanged=layoutFrames=>{this.config.events.onSelectedLayoutFramesChanged.trigger(JSON.parse(layoutFrames))},this.onSelectedTextStyleChanged=styles=>{this.config.events.onSelectedTextStyleChanged.trigger(JSON.parse(styles))},this.onColorsChanged=colors=>{this.config.events.onColorsChanged.trigger(JSON.parse(colors))},this.onParagraphStylesChanged=paragraphStyles=>{this.config.events.onParagraphStylesChanged.trigger(JSON.parse(paragraphStyles))},this.onCharacterStylesChanged=characterStyles=>{this.config.events.onCharacterStylesChanged.trigger(JSON.parse(characterStyles))},this.onFontFamiliesChanged=fonts=>{this.config.events.onFontFamiliesChanged.trigger(JSON.parse(fonts))},this.onSelectedLayoutIdChanged=id=>{this.config.events.onSelectedLayoutIdChanged.trigger(id)},this.onLayoutsChanged=layouts=>{this.config.events.onLayoutsChanged.trigger(JSON.parse(layouts))},this.onZoomChanged=zoom=>{this.config.events.onZoomChanged.trigger(JSON.parse(zoom))},this.onConnectorEvent=connectorEvent=>{this.config.events.onConnectorEvent.trigger(JSON.parse(connectorEvent))},this.onConnectorsChanged=connectors=>{const compatibleConnectors=(new ConnectorCompatibilityTools).makeMultipleConnectorsBackwardsCompatible(JSON.parse(connectors),this.localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl));this.config.events.onConnectorsChanged.trigger(compatibleConnectors)},this.onSelectedPageIdChanged=pageId=>{this.config.events.onSelectedPageIdChanged.trigger(pageId)},this.onPagesChanged=pages=>{this.config.events.onPagesChanged.trigger(JSON.parse(pages))},this.onPageSnapshotInvalidated=page=>{this.config.events.onPageSnapshotInvalidated.trigger(JSON.parse(page))},this.onPageSizeChanged=pageSize=>{this.config.events.onPageSizeChanged.trigger(JSON.parse(pageSize))},this.onShapeCornerRadiusChanged=cornerRadius=>{this.config.events.onShapeCornerRadiusChanged.trigger(JSON.parse(cornerRadius))},this.onCropActiveFrameIdChanged=id=>{this.config.events.onCropActiveFrameIdChanged.trigger(id)},this.onAsyncError=asyncError=>{this.config.events.onAsyncError.trigger(JSON.parse(asyncError))},this.onViewModeChanged=viewMode=>{this.config.events.onViewModeChanged.trigger(viewMode)},this.onBarcodeValidationChanged=validationResults=>{this.config.events.onBarcodeValidationChanged.trigger(JSON.parse(validationResults))},this.onDataSourceIdChanged=connectorId=>{this.config.events.onDataSourceIdChanged.trigger(connectorId)},this.onDocumentIssueListChanged=documentIssues=>{this.config.events.onDocumentIssueListChanged.trigger(JSON.parse(documentIssues))},this.onEngineEditModeChanged=engineEditMode=>{this.config.events.onEngineEditModeChanged.trigger(JSON.parse(engineEditMode))},this.config=config,this.localConfig=localConfig}}var _TextStyleController_editorAPI,FramePropertyNames,LayoutPropertyNames,ToolType,DownloadFormats,EnvironmentType,TextStyleController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},TextStyleController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},TextStyleController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class TextStyleController{constructor(editorAPI){_TextStyleController_editorAPI.set(this,void 0),this.set=style=>TextStyleController_awaiter(this,void 0,void 0,(function*(){return(yield TextStyleController_classPrivateFieldGet(this,_TextStyleController_editorAPI,"f")).selectedTextStyleDeltaUpdate(JSON.stringify(style)).then((result=>getEditorResponseData(result)))})),this.removeSelected=()=>TextStyleController_awaiter(this,void 0,void 0,(function*(){return(yield TextStyleController_classPrivateFieldGet(this,_TextStyleController_editorAPI,"f")).selectedTextStyleClean().then((result=>getEditorResponseData(result)))})),this.getSelected=()=>TextStyleController_awaiter(this,void 0,void 0,(function*(){return(yield TextStyleController_classPrivateFieldGet(this,_TextStyleController_editorAPI,"f")).getSelectedTextStyle().then((result=>getEditorResponseData(result)))})),TextStyleController_classPrivateFieldSet(this,_TextStyleController_editorAPI,editorAPI,"f")}}_TextStyleController_editorAPI=new WeakMap,function(FramePropertyNames){FramePropertyNames.FRAME_X="frameX",FramePropertyNames.FRAME_Y="frameY",FramePropertyNames.WIDTH="width",FramePropertyNames.HEIGHT="height",FramePropertyNames.FRAME_ROTATION="frameRotation"}(FramePropertyNames||(FramePropertyNames={})),function(LayoutPropertyNames){LayoutPropertyNames.LAYOUT_HEIGHT="layoutHeight",LayoutPropertyNames.LAYOUT_WIDTH="layoutWidth",LayoutPropertyNames.BLEED_TOP="bleedTop",LayoutPropertyNames.BLEED_BOTTOM="bleedBottom",LayoutPropertyNames.BLEED_LEFT="bleedLeft",LayoutPropertyNames.BLEED_RIGHT="bleedRight",LayoutPropertyNames.BLEED_VALUES_COMBINED="areBleedValuesCombined"}(LayoutPropertyNames||(LayoutPropertyNames={})),function(ToolType){ToolType.SELECT="select",ToolType.ZOOM="zoom",ToolType.HAND="hand",ToolType.IMAGE_FRAME="imageFrame",ToolType.TEXT_FRAME="textFrame",ToolType.SHAPE_RECT="rect",ToolType.SHAPE_ELLIPSE="ellipse",ToolType.SHAPE_POLYGON="polygon"}(ToolType||(ToolType={})),function(DownloadFormats){DownloadFormats.MP4="mp4",DownloadFormats.GIF="gif",DownloadFormats.PNG="png",DownloadFormats.JPG="jpg",DownloadFormats.PDF="pdf"}(DownloadFormats||(DownloadFormats={})),function(EnvironmentType){EnvironmentType.SANDBOX="sandbox",EnvironmentType.PRODUCTION="online"}(EnvironmentType||(EnvironmentType={}));var _ToolController_editorAPI,ToolController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ToolController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ToolController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ToolController{constructor(editorAPI){_ToolController_editorAPI.set(this,void 0),this.setTool=tool=>ToolController_awaiter(this,void 0,void 0,(function*(){return(yield ToolController_classPrivateFieldGet(this,_ToolController_editorAPI,"f")).setTool(tool).then((result=>getEditorResponseData(result)))})),this.getSelected=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return(yield ToolController_classPrivateFieldGet(this,_ToolController_editorAPI,"f")).getSelectedTool().then((result=>getEditorResponseData(result)))})),this.setPointer=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SELECT)})),this.setSelect=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SELECT)})),this.setHand=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.HAND)})),this.setZoom=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.ZOOM)})),this.setTextFrame=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.TEXT_FRAME)})),this.setImageFrame=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.IMAGE_FRAME)})),this.setShapeRect=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SHAPE_RECT)})),this.setShapeEllipse=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SHAPE_ELLIPSE)})),this.setShapePolygon=()=>ToolController_awaiter(this,void 0,void 0,(function*(){return this.setTool(ToolType.SHAPE_POLYGON)})),ToolController_classPrivateFieldSet(this,_ToolController_editorAPI,editorAPI,"f")}}_ToolController_editorAPI=new WeakMap;var _UndoManagerController_editorAPI,_UndoManagerController_advanced,_UndoManagerController_sdk,_AdvancedUndoManagerController_editorAPI,UndoManagerController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},UndoManagerController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},UndoManagerController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class UndoManagerController{constructor(children,sdk){_UndoManagerController_editorAPI.set(this,void 0),_UndoManagerController_advanced.set(this,void 0),_UndoManagerController_sdk.set(this,void 0),this.undo=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_editorAPI,"f")).undo().then((result=>getEditorResponseData(result)))})),this.redo=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_editorAPI,"f")).redo().then((result=>getEditorResponseData(result)))})),this.addCustomData=(key,value)=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_editorAPI,"f")).setCustomUndoData(key,value).then((result=>getEditorResponseData(result)))})),this.record=(operationName,undoOperationCallback)=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){try{yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_advanced,"f").beginIfNoneActive(operationName),yield undoOperationCallback(UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_sdk,"f"))}catch(error){throw error}finally{yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_advanced,"f").end()}})),this.pause=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_editorAPI,"f")).pause().then((result=>getEditorResponseData(result)))})),this.resume=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_UndoManagerController_editorAPI,"f")).resume().then((result=>getEditorResponseData(result)))})),UndoManagerController_classPrivateFieldSet(this,_UndoManagerController_editorAPI,children,"f"),UndoManagerController_classPrivateFieldSet(this,_UndoManagerController_sdk,sdk,"f"),UndoManagerController_classPrivateFieldSet(this,_UndoManagerController_advanced,new AdvancedUndoManagerController(children),"f")}}_UndoManagerController_editorAPI=new WeakMap,_UndoManagerController_advanced=new WeakMap,_UndoManagerController_sdk=new WeakMap;class AdvancedUndoManagerController{constructor(children){_AdvancedUndoManagerController_editorAPI.set(this,void 0),this.begin=operationName=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_AdvancedUndoManagerController_editorAPI,"f")).begin(operationName).then((result=>getEditorResponseData(result)))})),this.beginIfNoneActive=operationName=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_AdvancedUndoManagerController_editorAPI,"f")).beginIfNoneActive(operationName).then((result=>getEditorResponseData(result)))})),this.end=()=>UndoManagerController_awaiter(this,void 0,void 0,(function*(){return(yield UndoManagerController_classPrivateFieldGet(this,_AdvancedUndoManagerController_editorAPI,"f")).end().then((result=>getEditorResponseData(result)))})),UndoManagerController_classPrivateFieldSet(this,_AdvancedUndoManagerController_editorAPI,children,"f")}}_AdvancedUndoManagerController_editorAPI=new WeakMap;const round=(val,precision=2)=>{const hundred=Math.pow(10,precision);return Math.round(val*hundred)/hundred};class UtilsController{constructor(){this.round=(val,precision)=>getEditorResponseData({data:String(round(val,precision)),success:!0,status:200,parsedData:null}),this.createEnvironmentBaseURL=parameters=>{const{type=EnvironmentType.SANDBOX,environment="ft-nostress",version="1"}=parameters;return`https://${environment}.${type==EnvironmentType.SANDBOX?"chili-publish-sandbox":"chili-publish"}.online/grafx/api/v${version}/environment/${environment}`}}}var _NumberVariable_editorAPI,_DateVariable_editorAPI,_VariableController_editorAPI,_VariableController_setPlaceholder,_VariableController_setHelpText,VariableController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},VariableController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},VariableController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class NumberVariable{constructor(editorAPI){_NumberVariable_editorAPI.set(this,void 0),this.setMinimum=(id,minimum)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={minValue:{value:minimum}};return this.applyPropertiesUpdate(id,update)})),this.setMaximum=(id,maximum)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={maxValue:{value:maximum}};return this.applyPropertiesUpdate(id,update)})),this.setShowStepper=(id,showStepper)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={showStepper:{value:showStepper}};return this.applyPropertiesUpdate(id,update)})),this.setStepSize=(id,stepSize)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={stepSize:{value:stepSize}};return this.applyPropertiesUpdate(id,update)})),this.setThousandsSeparator=(id,thousandsSeparator)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={thousandsSeparator:{value:thousandsSeparator}};return this.applyPropertiesUpdate(id,update)})),this.setDecimalSeparator=(id,decimalSeparator)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={decimalSeparator:{value:decimalSeparator}};return this.applyPropertiesUpdate(id,update)})),this.setDecimalCharacterStyle=(id,characterStyleId)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={decimalCharacterStyleId:{value:characterStyleId}};return this.applyPropertiesUpdate(id,update)})),this.setNumberOfDecimals=(id,numberOfDecimals)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={numberOfDecimals:{value:numberOfDecimals}};return this.applyPropertiesUpdate(id,update)})),VariableController_classPrivateFieldSet(this,_NumberVariable_editorAPI,editorAPI,"f")}applyPropertiesUpdate(id,update){return VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_NumberVariable_editorAPI,"f");return getEditorResponseData(yield res.updateNumberVariableProperties(id,JSON.stringify(update)))}))}}_NumberVariable_editorAPI=new WeakMap;class DateVariable{constructor(editorAPI){_DateVariable_editorAPI.set(this,void 0),this.setDisplayFormat=(id,displayFormat)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={displayFormat:{value:displayFormat}};return this.applyPropertiesUpdate(id,update)})),this.setLocale=(id,locale)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={locale:{value:locale}};return this.applyPropertiesUpdate(id,update)})),this.setStartDate=(id,date)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={startDate:{value:date}};return this.applyPropertiesUpdate(id,update)})),this.setEndDate=(id,date)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={endDate:{value:date}};return this.applyPropertiesUpdate(id,update)})),this.setExcludedDays=(id,excludedDays)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={excludedDays:{value:excludedDays}};return this.applyPropertiesUpdate(id,update)})),VariableController_classPrivateFieldSet(this,_DateVariable_editorAPI,editorAPI,"f")}applyPropertiesUpdate(id,update){return VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_DateVariable_editorAPI,"f");return getEditorResponseData(yield res.updateDateVariableProperties(id,JSON.stringify(update)))}))}}_DateVariable_editorAPI=new WeakMap;class VariableController{constructor(editorAPI){_VariableController_editorAPI.set(this,void 0),this.getAll=()=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariables().then((result=>getEditorResponseData(result))).then((resp=>{const update=resp;return update.parsedData&&(update.parsedData=this.makeVariablesBackwardsCompatible(update.parsedData)),update}))})),this.getById=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariableById(id).then((result=>getEditorResponseData(result))).then((resp=>{const update=resp;return update.parsedData&&(update.parsedData=this.makeVariableBackwardsCompatible(update.parsedData)),update}))})),this.getByName=name=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariableByName(name).then((result=>getEditorResponseData(result))).then((resp=>{const update=resp;return update.parsedData&&(update.parsedData=this.makeVariableBackwardsCompatible(update.parsedData)),update}))})),this.create=(parentId,type)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).addVariable(parentId,type).then((result=>getEditorResponseData(result)))})),this.remove=ids=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).removeVariables(ids).then((result=>getEditorResponseData(result)))})),this.rename=(id,name)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableName(id,name).then((result=>getEditorResponseData(result)))})),this.setLabel=(id,label)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableLabel(id,label).then((result=>getEditorResponseData(result)))})),_VariableController_setPlaceholder.set(this,((id,placeholder)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariablePlaceholder(id,placeholder).then((result=>getEditorResponseData(result)))})))),this.setPlaceholder=(id,placeholder)=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setPlaceholder,"f").call(this,id,placeholder)})),this.resetPlaceholder=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setPlaceholder,"f").call(this,id,null)})),_VariableController_setHelpText.set(this,((id,helpText)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableHelpText(id,helpText).then((result=>getEditorResponseData(result)))})))),this.setHelpText=(id,helpText)=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setHelpText,"f").call(this,id,helpText)})),this.resetHelpText=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return VariableController_classPrivateFieldGet(this,_VariableController_setHelpText,"f").call(this,id,null)})),this.setType=(id,type)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableType(id,type).then((result=>getEditorResponseData(result)))})),this.setListVariable=(id,items)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setListVariableItems(id,items.map((item=>JSON.stringify({value:item})))).then((result=>getEditorResponseData(result)))})),this.setValue=(id,value)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableValue(id,value).then((result=>getEditorResponseData(result)))})),this.duplicate=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).duplicateVariable(id).then((result=>getEditorResponseData(result)))})),this.groupVariables=(name,ids)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).groupVariables(name,ids).then((result=>getEditorResponseData(result)))})),this.ungroupVariables=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).ungroupVariable(id).then((result=>getEditorResponseData(result)))})),this.move=(order,id,parentId)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).moveVariable(id,parentId,order).then((result=>getEditorResponseData(result)))})),this.moveVariables=(order,ids,parentId)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).moveVariables(ids,parentId,order).then((result=>getEditorResponseData(result)))})),this.setIsVisible=(id,isVisible)=>VariableController_awaiter(this,void 0,void 0,(function*(){const config=isVisible?{type:VariableVisibilityType.visible}:{type:VariableVisibilityType.invisible};return this.setVariableVisibility(id,config)})),this.setIsHidden=(id,isHidden)=>VariableController_awaiter(this,void 0,void 0,(function*(){const config=isHidden?{type:VariableVisibilityType.invisible}:{type:VariableVisibilityType.visible};return this.setVariableVisibility(id,config)})),this.setVariableVisibility=(id,config)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableVisibility(id,JSON.stringify(config)).then((result=>getEditorResponseData(result)))})),this.setLayoutsForVariableVisibility=layoutIdList=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setLayoutsForVariableVisibility(layoutIdList?JSON.stringify(layoutIdList):null).then((result=>getEditorResponseData(result)))})),this.setIsRequired=(id,isRequired)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableIsRequired(id,isRequired).then((result=>getEditorResponseData(result)))})),this.setIsReadonly=(id,isReadonly)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariableIsReadonly(id,isReadonly).then((result=>getEditorResponseData(result)))})),this.getImageVariableConnectorId=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getImageVariableConnectorId(id).then((result=>getEditorResponseData(result)))})),this.setImageVariableConnector=(id,registration)=>VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f"),connectorRegistration=(new ConnectorCompatibilityTools).makeConnectorSourceForwardsCompatible(registration);return res.setImageVariableConnector(id,JSON.stringify(connectorRegistration)).then((result=>getEditorResponseData(result)))})),this.removeSource=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return this.setValue(id,null)})),this.setPrefix=(id,prefix)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={prefix:{value:prefix}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setSuffix=(id,suffix)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={suffix:{value:suffix}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setPrefixCharacterStyle=(id,characterStyleId)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={prefixCharacterStyleId:{value:characterStyleId}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setSuffixCharacterStyle=(id,characterStyleId)=>VariableController_awaiter(this,void 0,void 0,(function*(){const update={suffixCharacterStyleId:{value:characterStyleId}};return this.applyPrefixSuffixDeltaUpdate(id,update)})),this.setPrivateData=(id,privateData)=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).setVariablePrivateData(id,JSON.stringify(privateData)).then((result=>getEditorResponseData(result)))})),this.getPrivateData=id=>VariableController_awaiter(this,void 0,void 0,(function*(){return(yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")).getVariablePrivateData(id).then((result=>getEditorResponseData(result)))})),VariableController_classPrivateFieldSet(this,_VariableController_editorAPI,editorAPI,"f"),this.number=new NumberVariable(VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f")),this.date=new DateVariable(VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f"))}makeVariablesBackwardsCompatible(variables){return variables.map((variable=>this.makeVariableBackwardsCompatible(variable)))}makeVariableBackwardsCompatible(variable){return variable.type!==VariableType.list?variable:this.makeListVariableBackwardsCompatible(variable)}makeListVariableBackwardsCompatible(listVariable){const updated=listVariable,items=listVariable.items,selected=listVariable.selected,newItems=items.map((item=>item.value));return updated.items=newItems,updated.selected=null==selected?void 0:selected.value,updated}applyPrefixSuffixDeltaUpdate(id,update){return VariableController_awaiter(this,void 0,void 0,(function*(){const res=yield VariableController_classPrivateFieldGet(this,_VariableController_editorAPI,"f");return getEditorResponseData(yield res.updateVariablePrefixSuffixProperties(id,JSON.stringify(update)))}))}}_VariableController_editorAPI=new WeakMap,_VariableController_setPlaceholder=new WeakMap,_VariableController_setHelpText=new WeakMap;class SubscriberController_SubscriberController{constructor(config){this.onVariableListChanged=variablesJson=>{this.config.events.onVariableListChanged.trigger(JSON.parse(variablesJson))},this.onConnectorsChanged=connectors=>{this.config.events.onConnectorsChanged.trigger(JSON.parse(connectors))},this.config=config}}var VariableController_VariableController_editorAPI,controllers_VariableController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},controllers_VariableController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},controllers_VariableController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class VariableController_VariableController{constructor(editorAPI){VariableController_VariableController_editorAPI.set(this,void 0),this.getAll=()=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).getVariables().then((result=>getEditorResponseData(result)))})),this.getById=id=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).getVariableById(id).then((result=>getEditorResponseData(result)))})),this.getByName=name=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).getVariableByName(name).then((result=>getEditorResponseData(result)))})),this.setListVariable=(id,items)=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).setListVariableItems(id,items.map((item=>JSON.stringify(item)))).then((result=>getEditorResponseData(result)))})),this.setImageVariableConnector=(id,registration)=>controllers_VariableController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_VariableController_classPrivateFieldGet(this,VariableController_VariableController_editorAPI,"f")).setImageVariableConnector(id,JSON.stringify(registration)).then((result=>getEditorResponseData(result)))})),controllers_VariableController_classPrivateFieldSet(this,VariableController_VariableController_editorAPI,editorAPI,"f")}}VariableController_VariableController_editorAPI=new WeakMap;var ConnectorController_ConnectorController_editorAPI,LogLevel,LogCategory,CallbackErrorBehavior,ConnectorConfigValueType,controllers_ConnectorController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},controllers_ConnectorController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},controllers_ConnectorController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class ConnectorController_ConnectorController{constructor(editorAPI){ConnectorController_ConnectorController_editorAPI.set(this,void 0),this.register=registration=>controllers_ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_ConnectorController_classPrivateFieldGet(this,ConnectorController_ConnectorController_editorAPI,"f")).registerConnector(JSON.stringify(registration)).then((result=>getEditorResponseData(result)))})),this.getById=id=>controllers_ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_ConnectorController_classPrivateFieldGet(this,ConnectorController_ConnectorController_editorAPI,"f")).getConnectorById(id).then((result=>getEditorResponseData(result)))})),this.getAllByType=type=>controllers_ConnectorController_awaiter(this,void 0,void 0,(function*(){return(yield controllers_ConnectorController_classPrivateFieldGet(this,ConnectorController_ConnectorController_editorAPI,"f")).getConnectors(type).then((result=>getEditorResponseData(result)))})),controllers_ConnectorController_classPrivateFieldSet(this,ConnectorController_ConnectorController_editorAPI,editorAPI,"f")}}ConnectorController_ConnectorController_editorAPI=new WeakMap;class NextInitiator{constructor(config,connection,editorAPI){this.config=config,this.connection=connection,this.editorAPI=editorAPI,this.subscriber=new SubscriberController_SubscriberController(config),this.variable=new VariableController_VariableController(this.editorAPI),this.connector=new ConnectorController_ConnectorController(this.editorAPI)}}!function(LogLevel){LogLevel.info="info",LogLevel.warn="warn",LogLevel.error="error"}(LogLevel||(LogLevel={})),function(LogCategory){LogCategory.general="general",LogCategory.connector="connector",LogCategory.event="event",LogCategory.engine="engine"}(LogCategory||(LogCategory={})),function(CallbackErrorBehavior){CallbackErrorBehavior.throw="throw",CallbackErrorBehavior.log="log"}(CallbackErrorBehavior||(CallbackErrorBehavior={})),function(ConnectorConfigValueType){ConnectorConfigValueType.text="text",ConnectorConfigValueType.boolean="boolean"}(ConnectorConfigValueType||(ConnectorConfigValueType={}));class EngineEventTrigger{constructor(logger){this.logger=logger}createEventHandlerFn(callbackFn,errorBehavior){return(...args)=>{try{const result=callbackFn(...args);return result instanceof Promise?result.catch((error=>this.handleError(error,errorBehavior,callbackFn.name))):result}catch(error){this.handleError(error,errorBehavior,callbackFn.name)}}}handleError(error,errorBehavior,fnName){var _a;if(errorBehavior!==CallbackErrorBehavior.log)throw error;null===(_a=this.logger)||void 0===_a||_a.call(this,LogLevel.error,LogCategory.event,`Error in callback ${fnName}: ${error}`)}}class EngineCallbackHandler extends EngineEventTrigger{constructor(handler,logger){super(logger),this.handler=handler}trigger(...args){const handler=this.handler();if(handler)return this.createEventHandlerFn(handler,CallbackErrorBehavior.throw)(...args)}}class EngineEvent extends EngineEventTrigger{constructor(legacyHandler,logger){super(logger),this.legacyHandler=legacyHandler,this.subscriptions=new Set}trigger(...args){const handler=this.legacyHandler();handler&&this.createEventHandlerFn(handler,CallbackErrorBehavior.log)(...args);for(const callback of this.subscriptions)callback(...args)}registerCallback(callback,errorBehavior=CallbackErrorBehavior.log){const callbackFn=this.createEventHandlerFn(callback,errorBehavior);return this.subscriptions.add(callbackFn),()=>{this.subscriptions.delete(callbackFn)}}}class ConfigHelper{static createRuntimeConfig(config){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r,_s,_t,_u,_v,_w,_x,_y,_z,_0,_1,_2,_3,_4,_5,_6,_7,_8,_9;const clone=Object.assign({},config);return clone.logging={logLevel:(null===(_a=config.logging)||void 0===_a?void 0:_a.logLevel)||LogLevel.error,logger:(null===(_b=config.logging)||void 0===_b?void 0:_b.logger)||((level,cat,msg)=>{var _a,_b;if(ConfigHelper.isLoggingEnabled(level,null!==(_b=null===(_a=clone.logging)||void 0===_a?void 0:_a.logLevel)&&void 0!==_b?_b:LogLevel.error))switch(level){case LogLevel.error:console.error(`[${cat}] [${level}] ${msg}`);break;case LogLevel.warn:console.warn(`[${cat}] [${level}] ${msg}`);break;default:console.log(`[${cat}] [${level}] ${msg}`)}})},clone.handlers={onAuthExpired:new EngineCallbackHandler((()=>clone.onAuthExpired),null===(_c=clone.logging)||void 0===_c?void 0:_c.logger),onViewportRequested:new EngineCallbackHandler((()=>clone.onViewportRequested),null===(_d=clone.logging)||void 0===_d?void 0:_d.logger)},clone.events={onActionsChanged:new EngineEvent((()=>clone.onActionsChanged),null===(_e=clone.logging)||void 0===_e?void 0:_e.logger),onStateChanged:new EngineEvent((()=>clone.onStateChanged),null===(_f=clone.logging)||void 0===_f?void 0:_f.logger),onDocumentLoaded:new EngineEvent((()=>clone.onDocumentLoaded),null===(_g=clone.logging)||void 0===_g?void 0:_g.logger),onSelectedFramesLayoutChanged:new EngineEvent((()=>clone.onSelectedFramesLayoutChanged),null===(_h=clone.logging)||void 0===_h?void 0:_h.logger),onSelectedFramesContentChanged:new EngineEvent((()=>clone.onSelectedFramesContentChanged),null===(_j=clone.logging)||void 0===_j?void 0:_j.logger),onPageSelectionChanged:new EngineEvent((()=>clone.onPageSelectionChanged),null===(_k=clone.logging)||void 0===_k?void 0:_k.logger),onSelectedLayoutPropertiesChanged:new EngineEvent((()=>clone.onSelectedLayoutPropertiesChanged),null===(_l=clone.logging)||void 0===_l?void 0:_l.logger),onSelectedLayoutUnitChanged:new EngineEvent((()=>clone.onSelectedLayoutUnitChanged),null===(_m=clone.logging)||void 0===_m?void 0:_m.logger),onScrubberPositionChanged:new EngineEvent((()=>clone.onScrubberPositionChanged),null===(_o=clone.logging)||void 0===_o?void 0:_o.logger),onFrameAnimationsChanged:new EngineEvent((()=>clone.onFrameAnimationsChanged),null===(_p=clone.logging)||void 0===_p?void 0:_p.logger),onVariableListChanged:new EngineEvent((()=>clone.onVariableListChanged),null===(_q=clone.logging)||void 0===_q?void 0:_q.logger),onSelectedToolChanged:new EngineEvent((()=>clone.onSelectedToolChanged),null===(_r=clone.logging)||void 0===_r?void 0:_r.logger),onUndoStackStateChanged:new EngineEvent((()=>clone.onUndoStackStateChanged),null===(_s=clone.logging)||void 0===_s?void 0:_s.logger),onSelectedLayoutFramesChanged:new EngineEvent((()=>clone.onSelectedLayoutFramesChanged),null===(_t=clone.logging)||void 0===_t?void 0:_t.logger),onSelectedTextStyleChanged:new EngineEvent((()=>clone.onSelectedTextStyleChanged),null===(_u=clone.logging)||void 0===_u?void 0:_u.logger),onColorsChanged:new EngineEvent((()=>clone.onColorsChanged),null===(_v=clone.logging)||void 0===_v?void 0:_v.logger),onParagraphStylesChanged:new EngineEvent((()=>clone.onParagraphStylesChanged),null===(_w=clone.logging)||void 0===_w?void 0:_w.logger),onCharacterStylesChanged:new EngineEvent((()=>clone.onCharacterStylesChanged),null===(_x=clone.logging)||void 0===_x?void 0:_x.logger),onFontFamiliesChanged:new EngineEvent((()=>clone.onFontFamiliesChanged),null===(_y=clone.logging)||void 0===_y?void 0:_y.logger),onSelectedLayoutIdChanged:new EngineEvent((()=>clone.onSelectedLayoutIdChanged),null===(_z=clone.logging)||void 0===_z?void 0:_z.logger),onLayoutsChanged:new EngineEvent((()=>clone.onLayoutsChanged),null===(_0=clone.logging)||void 0===_0?void 0:_0.logger),onConnectorEvent:new EngineEvent((()=>clone.onConnectorEvent),null===(_1=clone.logging)||void 0===_1?void 0:_1.logger),onConnectorsChanged:new EngineEvent((()=>clone.onConnectorsChanged),null===(_2=clone.logging)||void 0===_2?void 0:_2.logger),onZoomChanged:new EngineEvent((()=>clone.onZoomChanged),null===(_3=clone.logging)||void 0===_3?void 0:_3.logger),onSelectedPageIdChanged:new EngineEvent((()=>clone.onSelectedPageIdChanged),clone.logging.logger),onPagesChanged:new EngineEvent((()=>clone.onPagesChanged),clone.logging.logger),onPageSnapshotInvalidated:new EngineEvent((()=>clone.onPageSnapshotInvalidated),clone.logging.logger),onPageSizeChanged:new EngineEvent((()=>clone.onPageSizeChanged),null===(_4=clone.logging)||void 0===_4?void 0:_4.logger),onShapeCornerRadiusChanged:new EngineEvent((()=>clone.onShapeCornerRadiusChanged),null===(_5=clone.logging)||void 0===_5?void 0:_5.logger),onCropActiveFrameIdChanged:new EngineEvent((()=>clone.onCropActiveFrameIdChanged),null===(_6=clone.logging)||void 0===_6?void 0:_6.logger),onAsyncError:new EngineEvent((()=>clone.onAsyncError),null===(_7=clone.logging)||void 0===_7?void 0:_7.logger),onViewModeChanged:new EngineEvent((()=>clone.onViewModeChanged),null===(_8=clone.logging)||void 0===_8?void 0:_8.logger),onBarcodeValidationChanged:new EngineEvent((()=>clone.onBarcodeValidationChanged),null===(_9=clone.logging)||void 0===_9?void 0:_9.logger),onDataSourceIdChanged:new EngineEvent((()=>clone.onDataSourceIdChanged),clone.logging.logger),onDocumentIssueListChanged:new EngineEvent((()=>clone.onDocumentIssueListChanged),clone.logging.logger),onCustomUndoDataChanged:new EngineEvent((()=>clone.onCustomUndoDataChanged),clone.logging.logger),onEngineEditModeChanged:new EngineEvent((()=>clone.onEngineEditModeChanged),clone.logging.logger)},clone}static isLoggingEnabled(level,logLevel){return logLevel==LogLevel.info||(logLevel==LogLevel.warn&&(level==LogLevel.warn||level==LogLevel.error)||logLevel==LogLevel.error&&level==LogLevel.error)}}class DataItemMappingTools{isDatePropertyWrapper(value){return"object"==typeof value&&"date"===(null==value?void 0:value.type)}isDateObject(value){return value instanceof Date}mapEngineToDataItem(dataItem){const parsedItem={};return Object.entries(dataItem).forEach((([key,value])=>{parsedItem[key]=this.isDatePropertyWrapper(value)?new Date(value.value):value})),parsedItem}mapDataItemToEngine(dataItem){const parsedItem={};return Object.entries(dataItem).forEach((([key,value])=>{parsedItem[key]=this.isDateObject(value)?{value:value.getTime(),type:"date"}:value})),parsedItem}}var _ConfigurationController_editorAPI,ConfigurationController_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},ConfigurationController_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},ConfigurationController_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};_ConfigurationController_editorAPI=new WeakMap;var _LocalConfigurationDecorator_localConfig,LocalConfigurationDecorator_awaiter=function(thisArg,_arguments,P,generator){return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P((function(resolve){resolve(value)}))).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))},LocalConfigurationDecorator_classPrivateFieldSet=function(receiver,state,value,kind,f){if("m"===kind)throw new TypeError("Private method is not writable");if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===kind?f.call(receiver,value):f?f.value=value:state.set(receiver,value),value},LocalConfigurationDecorator_classPrivateFieldGet=function(receiver,state,kind,f){if("a"===kind&&!f)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof state?receiver!==state||!f:!state.has(receiver))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===kind?f:"a"===kind?f.call(receiver):f?f.value:state.get(receiver)};class LocalConfigurationDecorator extends class{constructor(editorAPI){_ConfigurationController_editorAPI.set(this,void 0),ConfigurationController_classPrivateFieldSet(this,_ConfigurationController_editorAPI,editorAPI,"f")}getValue(key){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).getConfigValue(key).then((result=>getEditorResponseData(result)))}))}setValue(key,value){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).setConfigValue(key,value).then((result=>getEditorResponseData(result)))}))}updateStudioOptions(options){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).updateStudioOptions(JSON.stringify(options)).then((result=>getEditorResponseData(result)))}))}getEngineSessionId(){return ConfigurationController_awaiter(this,void 0,void 0,(function*(){return(yield ConfigurationController_classPrivateFieldGet(this,_ConfigurationController_editorAPI,"f")).getEngineSessionId().then((result=>getEditorResponseData(result)))}))}}{constructor(editorAPI,localConfig){super(editorAPI),_LocalConfigurationDecorator_localConfig.set(this,void 0),LocalConfigurationDecorator_classPrivateFieldSet(this,_LocalConfigurationDecorator_localConfig,localConfig,"f")}getValue(key){const _super=Object.create(null,{getValue:{get:()=>super.getValue}});return LocalConfigurationDecorator_awaiter(this,void 0,void 0,(function*(){const value=LocalConfigurationDecorator_classPrivateFieldGet(this,_LocalConfigurationDecorator_localConfig,"f").get(key);return null!=value?getEditorResponseData({status:200,success:!0,parsedData:value,data:value},!1):_super.getValue.call(this,key)}))}setValue(key,value){const _super=Object.create(null,{setValue:{get:()=>super.setValue}});return LocalConfigurationDecorator_awaiter(this,void 0,void 0,(function*(){const res=_super.setValue.call(this,key,value);return LocalConfigurationDecorator_classPrivateFieldGet(this,_LocalConfigurationDecorator_localConfig,"f").set(key,value),res}))}}let connection;_LocalConfigurationDecorator_localConfig=new WeakMap;const FIXED_EDITOR_LINK="https://studio-cdn.chiligrafx.com/editor/"+editor_engine_namespaceObject_V+"/web";class SDK{constructor(config){this.localConfig=new Map,this.dataItemMappingTools=new DataItemMappingTools,this.loadEditor=()=>{Connector(this.config.editorLink||FIXED_EDITOR_LINK,{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,onSelectedLayoutPropertiesChanged:this.subscriber.onSelectedLayoutPropertiesChanged,onSelectedLayoutUnitChanged:this.subscriber.onSelectedLayoutUnitChanged,onPageSelectionChanged:this.subscriber.onPageSelectionChanged,onScrubberPositionChanged:this.subscriber.onAnimationPlaybackChanged,onFrameAnimationsChanged:this.subscriber.onAnimationChanged,onVariableListChanged:state=>{var _a;(null===(_a=this.enabledNextSubscribers)||void 0===_a?void 0:_a.onVariableListChanged)?this.next.subscriber.onVariableListChanged(state):this.subscriber.onVariableListChanged(state)},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:state=>{var _a;(null===(_a=this.enabledNextSubscribers)||void 0===_a?void 0:_a.onConnectorsChanged)?this.next.subscriber.onConnectorsChanged(state):this.subscriber.onConnectorsChanged(state)},onZoomChanged:this.subscriber.onZoomChanged,onSelectedPageIdChanged:this.subscriber.onSelectedPageIdChanged,onPagesChanged:this.subscriber.onPagesChanged,onPageSnapshotInvalidated:this.subscriber.onPageSnapshotInvalidated,onPageSizeChanged:this.subscriber.onPageSizeChanged,onShapeCornerRadiusChanged:this.subscriber.onShapeCornerRadiusChanged,onCropActiveFrameIdChanged:this.subscriber.onCropActiveFrameIdChanged,onAsyncError:this.subscriber.onAsyncError,onViewModeChanged:this.subscriber.onViewModeChanged,onBarcodeValidationChanged:this.subscriber.onBarcodeValidationChanged,onDataSourceIdChanged:this.subscriber.onDataSourceIdChanged,onDocumentIssueListChanged:this.subscriber.onDocumentIssueListChanged,onCustomUndoDataChanged:this.subscriber.onCustomUndoDataChanged,onEngineEditModeChanged:this.subscriber.onEngineEditModeChanged},this.setConnection,this.config.editorId,this.config.studioStyling),this.editorAPI=null==connection?void 0:connection.promise.then((editorAPI=>editorAPI)),this.action=new ActionController(this.editorAPI),this.layout=new LayoutController(this.editorAPI),this.frame=new FrameController(this.editorAPI),this.barcode=new BarcodeController(this.editorAPI),this.animation=new AnimationController(this.editorAPI),this.document=new DocumentController(this.editorAPI),this.configuration=new LocalConfigurationDecorator(this.editorAPI,this.localConfig),this.utils=new UtilsController,this.tool=new ToolController(this.editorAPI),this.page=new PageController(this.editorAPI),this.debug=new DebugController(this.editorAPI),this.undoManager=new UndoManagerController(this.editorAPI,this),this.textSelection=new TextStyleController(this.editorAPI),this.colorStyle=new ColorStyleController(this.editorAPI),this.paragraphStyle=new ParagraphStyleController(this.editorAPI),this.characterStyle=new CharacterStyleController(this.editorAPI),this.mediaConnector=new MediaConnectorController(this.editorAPI),this.fontConnector=new FontConnectorController(this.editorAPI),this.dataConnector=new DataConnectorController(this.editorAPI,this.dataItemMappingTools),this.dataSource=new DataSourceController(this.editorAPI,this.dataItemMappingTools),this.connector=new ConnectorController(this.editorAPI,this.localConfig),this.variable=new VariableController(this.editorAPI),this.font=new FontController(this.editorAPI),this.experiment=new ExperimentController(this.editorAPI),this.canvas=new CanvasController(this.editorAPI),this.shape=new ShapeController(this.editorAPI),this.info=new InfoController,this.clipboard=new ClipboardController(this.editorAPI),this.next=new NextInitiator(this.config,this.connection,this.editorAPI),this.configuration.setValue(WellKnownConfigurationKeys.GraFxStudioSdkVersion,package_namespaceObject_i8),this.configuration.setValue(WellKnownConfigurationKeys.GraFxStudioDocumentType,this.config.documentType||DocumentType.template),this.configuration.updateStudioOptions(this.config.studioOptions||defaultStudioOptions)},this.setConnection=newConnection=>{connection=newConnection},this.config=ConfigHelper.createRuntimeConfig(config),this.connection=connection,this.editorAPI=null==connection?void 0:connection.promise.then((child=>child)),this.action=new ActionController(this.editorAPI),this.layout=new LayoutController(this.editorAPI),this.frame=new FrameController(this.editorAPI),this.shape=new ShapeController(this.editorAPI),this.barcode=new BarcodeController(this.editorAPI),this.undoManager=new UndoManagerController(this.editorAPI,this),this.connector=new ConnectorController(this.editorAPI,this.localConfig),this.mediaConnector=new MediaConnectorController(this.editorAPI),this.fontConnector=new FontConnectorController(this.editorAPI),this.dataConnector=new DataConnectorController(this.editorAPI,this.dataItemMappingTools),this.dataSource=new DataSourceController(this.editorAPI,this.dataItemMappingTools),this.animation=new AnimationController(this.editorAPI),this.document=new DocumentController(this.editorAPI),this.configuration=new LocalConfigurationDecorator(this.editorAPI,this.localConfig),this.variable=new VariableController(this.editorAPI),this.utils=new UtilsController,this.subscriber=new SubscriberController(this.config,this.localConfig),this.tool=new ToolController(this.editorAPI),this.page=new PageController(this.editorAPI),this.debug=new DebugController(this.editorAPI),this.textSelection=new TextStyleController(this.editorAPI),this.colorStyle=new ColorStyleController(this.editorAPI),this.paragraphStyle=new ParagraphStyleController(this.editorAPI),this.characterStyle=new CharacterStyleController(this.editorAPI),this.font=new FontController(this.editorAPI),this.experiment=new ExperimentController(this.editorAPI),this.canvas=new CanvasController(this.editorAPI),this.colorConversion=new ColorConversionController(this.editorAPI),this.info=new InfoController,this.clipboard=new ClipboardController(this.editorAPI),this.next=new NextInitiator(this.config,this.connection,this.editorAPI),this.enabledNextSubscribers=this.config.enableNextSubscribers}}var SlideDirections,ShakeDirections,EaseTypes,TweenTypes,BasicAnimationsEmphasisStyles,ViewMode,FontPreviewFormat,FontWeights,Alignment,TextPosition,Case,Scripting,HorizontalAlign,SelectedTextStyleSections,SelectedTextStyles,ActionEditorEvent,ShapeType,CornerRadiusType,EngineEditModeType;!function(SlideDirections){SlideDirections.top="top",SlideDirections.left="left",SlideDirections.right="right",SlideDirections.bottom="bottom",SlideDirections.topLeft="topLeft",SlideDirections.topRight="topRight",SlideDirections.bottomLeft="bottomLeft",SlideDirections.bottomRight="bottomRight"}(SlideDirections||(SlideDirections={})),function(ShakeDirections){ShakeDirections.horizontal="horizontal",ShakeDirections.vertical="vertical"}(ShakeDirections||(ShakeDirections={})),function(EaseTypes){EaseTypes.easeIn="easeIn",EaseTypes.easeOut="easeOut",EaseTypes.easeInOut="easeInOut"}(EaseTypes||(EaseTypes={})),function(TweenTypes){TweenTypes.quadratic="Quadratic",TweenTypes.cubic="Cubic",TweenTypes.quartic="Quartic",TweenTypes.quintic="Quintic",TweenTypes.sine="Sine",TweenTypes.exponential="Exponential",TweenTypes.circular="Circular",TweenTypes.elastic="Elastic",TweenTypes.bounce="Bounce",TweenTypes.back="Back"}(TweenTypes||(TweenTypes={})),function(BasicAnimationsEmphasisStyles){BasicAnimationsEmphasisStyles.bounce="bounce",BasicAnimationsEmphasisStyles.flash="flash",BasicAnimationsEmphasisStyles.headshake="headShake",BasicAnimationsEmphasisStyles.heartbeat="heartbeat",BasicAnimationsEmphasisStyles.pulse="pulse",BasicAnimationsEmphasisStyles.rubberBand="rubberBand",BasicAnimationsEmphasisStyles.vertical="vertical",BasicAnimationsEmphasisStyles.horizontal="horizontal",BasicAnimationsEmphasisStyles.swing="swing",BasicAnimationsEmphasisStyles.tada="tada"}(BasicAnimationsEmphasisStyles||(BasicAnimationsEmphasisStyles={})),function(ViewMode){ViewMode.preview="preview",ViewMode.normal="normal"}(ViewMode||(ViewMode={})),function(FontPreviewFormat){FontPreviewFormat.Square="square",FontPreviewFormat.Line="line"}(FontPreviewFormat||(FontPreviewFormat={})),function(FontWeights){FontWeights.BOLD="Bold",FontWeights.ITALIC="Italic",FontWeights.REGULAR="Regular"}(FontWeights||(FontWeights={})),function(Alignment){Alignment.LEFT="left",Alignment.CENTER="center",Alignment.RIGHT="right",Alignment.JUSTIFY="justify"}(Alignment||(Alignment={})),function(TextPosition){TextPosition.TOP="top",TextPosition.CENTER="center",TextPosition.BOTTOM="bottom"}(TextPosition||(TextPosition={})),function(Case){Case.TO_LOWER_CASE="lowercase",Case.TO_UPPER_CASE="uppercase",Case.NORMAL="normal"}(Case||(Case={})),function(Scripting){Scripting.SUPERSCRIPT="superscript",Scripting.SUBSCRIPT="subscript",Scripting.NORMAL="normal"}(Scripting||(Scripting={})),function(HorizontalAlign){HorizontalAlign.left="left",HorizontalAlign.center="center",HorizontalAlign.right="right",HorizontalAlign.justify="justify"}(HorizontalAlign||(HorizontalAlign={})),function(SelectedTextStyleSections){SelectedTextStyleSections.STYLE="textStyle",SelectedTextStyleSections.PROPERTIES="textProperties",SelectedTextStyleSections.APPEARANCE="appearance"}(SelectedTextStyleSections||(SelectedTextStyleSections={})),function(SelectedTextStyles){SelectedTextStyles.PARAGRAPH="paragraphStyleId",SelectedTextStyles.CHARACTER="characterStyleId",SelectedTextStyles.FONT_FAMILY="fontKey",SelectedTextStyles.FONT_STYLE="fontStyle",SelectedTextStyles.FONT_SIZE="fontSize",SelectedTextStyles.LETTER_SPACING="letterSpacing",SelectedTextStyles.LINE_HEIGHT="lineHeight",SelectedTextStyles.TEXT_ALIGN="textAlign",SelectedTextStyles.VERTICAL_ALIGN="verticalAlign",SelectedTextStyles.TYPOGRAPHIC_CASE="typographicCase",SelectedTextStyles.SUB_SUPER_SCRIPT="subSuperScript",SelectedTextStyles.UNDERLINE="underline",SelectedTextStyles.LINE_THROUGH="lineThrough",SelectedTextStyles.FILL_COLOR="fillColor",SelectedTextStyles.COLOR="color",SelectedTextStyles.FILL_COLOR_APPLIED="fillColorApplied",SelectedTextStyles.STROKE_COLOR="strokeColor",SelectedTextStyles.DROP_SHADOW_COLOR="dropShadowColor",SelectedTextStyles.BLEND_MODE="blendMode",SelectedTextStyles.OPACITY="opacity",SelectedTextStyles.TRACKING_RIGHT="trackingRight",SelectedTextStyles.BASELINE_SHIFT="baselineShiftValue"}(SelectedTextStyles||(SelectedTextStyles={})),function(ActionEditorEvent){ActionEditorEvent.selectedLayoutChanged="selectedLayoutChanged",ActionEditorEvent.frameMoved="frameMoved",ActionEditorEvent.pageSizeChanged="pageSizeChanged",ActionEditorEvent.documentLoaded="documentLoaded",ActionEditorEvent.variableValueChanged="variableValueChanged"}(ActionEditorEvent||(ActionEditorEvent={})),function(ShapeType){ShapeType.ellipse="ellipse",ShapeType.rectangle="rectangle",ShapeType.polygon="polygon"}(ShapeType||(ShapeType={})),function(CornerRadiusType){CornerRadiusType.all="all",CornerRadiusType.only="only",CornerRadiusType.none="none"}(CornerRadiusType||(CornerRadiusType={})),function(EngineEditModeType){EngineEditModeType.normal="normal",EngineEditModeType.textEdit="textEdit",EngineEditModeType.customCrop="customCrop",EngineEditModeType.frameSubjectArea="frameSubjectArea"}(EngineEditModeType||(EngineEditModeType={}));const src=SDK;return __webpack_exports__})()));
2
2
  //# sourceMappingURL=main.js.map