!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AdaptiveCards=e():t.AdaptiveCards=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.Default="default",t.Positive="positive",t.Destructive="destructive",t}();e.ActionStyle=n,function(t){t[t.Auto=0]="Auto",t[t.Stretch=1]="Stretch",t[t.Small=2]="Small",t[t.Medium=3]="Medium",t[t.Large=4]="Large"}(e.Size||(e.Size={})),function(t){t[t.Weight=0]="Weight",t[t.Pixel=1]="Pixel"}(e.SizeUnit||(e.SizeUnit={})),function(t){t[t.Small=0]="Small",t[t.Default=1]="Default",t[t.Medium=2]="Medium",t[t.Large=3]="Large",t[t.ExtraLarge=4]="ExtraLarge"}(e.TextSize||(e.TextSize={})),function(t){t[t.Lighter=0]="Lighter",t[t.Default=1]="Default",t[t.Bolder=2]="Bolder"}(e.TextWeight||(e.TextWeight={})),function(t){t[t.Default=0]="Default",t[t.Monospace=1]="Monospace"}(e.FontType||(e.FontType={})),function(t){t[t.None=0]="None",t[t.Small=1]="Small",t[t.Default=2]="Default",t[t.Medium=3]="Medium",t[t.Large=4]="Large",t[t.ExtraLarge=5]="ExtraLarge",t[t.Padding=6]="Padding"}(e.Spacing||(e.Spacing={})),function(t){t[t.Default=0]="Default",t[t.Dark=1]="Dark",t[t.Light=2]="Light",t[t.Accent=3]="Accent",t[t.Good=4]="Good",t[t.Warning=5]="Warning",t[t.Attention=6]="Attention"}(e.TextColor||(e.TextColor={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(e.HorizontalAlignment||(e.HorizontalAlignment={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Bottom=2]="Bottom"}(e.VerticalAlignment||(e.VerticalAlignment={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Stretch=3]="Stretch"}(e.ActionAlignment||(e.ActionAlignment={})),function(t){t[t.Default=0]="Default",t[t.Person=1]="Person"}(e.ImageStyle||(e.ImageStyle={})),function(t){t[t.Inline=0]="Inline",t[t.Popup=1]="Popup"}(e.ShowCardActionMode||(e.ShowCardActionMode={})),function(t){t[t.Horizontal=0]="Horizontal",t[t.Vertical=1]="Vertical"}(e.Orientation||(e.Orientation={})),function(t){t[t.Cover=0]="Cover",t[t.RepeatHorizontally=1]="RepeatHorizontally",t[t.RepeatVertically=2]="RepeatVertically",t[t.Repeat=3]="Repeat"}(e.FillMode||(e.FillMode={})),function(t){t[t.LeftOfTitle=0]="LeftOfTitle",t[t.AboveTitle=1]="AboveTitle"}(e.ActionIconPlacement||(e.ActionIconPlacement={})),function(t){t[t.Text=0]="Text",t[t.Tel=1]="Tel",t[t.Url=2]="Url",t[t.Email=3]="Email"}(e.InputTextStyle||(e.InputTextStyle={})),function(t){t[t.Optional=0]="Optional",t[t.Required=1]="Required",t[t.RequiredWithVisualCue=2]="RequiredWithVisualCue"}(e.InputValidationNecessity||(e.InputValidationNecessity={}));var r=function(){function t(){}return t.Default="default",t.Emphasis="emphasis",t.Accent="accent",t.Good="good",t.Attention="attention",t.Warning="warning",t}();e.ContainerStyle=r,function(t){t[t.Hint=0]="Hint",t[t.ActionTypeNotAllowed=1]="ActionTypeNotAllowed",t[t.CollectionCantBeEmpty=2]="CollectionCantBeEmpty",t[t.Deprecated=3]="Deprecated",t[t.ElementTypeNotAllowed=4]="ElementTypeNotAllowed",t[t.InteractivityNotAllowed=5]="InteractivityNotAllowed",t[t.InvalidPropertyValue=6]="InvalidPropertyValue",t[t.MissingCardType=7]="MissingCardType",t[t.PropertyCantBeNull=8]="PropertyCantBeNull",t[t.TooManyActions=9]="TooManyActions",t[t.UnknownActionType=10]="UnknownActionType",t[t.UnknownElementType=11]="UnknownElementType",t[t.UnsupportedCardVersion=12]="UnsupportedCardVersion",t[t.DuplicateId=13]="DuplicateId"}(e.ValidationError||(e.ValidationError={})),function(t){t[t.FullyInContainer=0]="FullyInContainer",t[t.Overflowing=1]="Overflowing",t[t.FullyOutOfContainer=2]="FullyOutOfContainer"}(e.ContainerFitStatus||(e.ContainerFitStatus={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);e.ContentTypes={applicationJson:"application/json",applicationXWwwFormUrlencoded:"application/x-www-form-urlencoded"};var r=function(){function t(){this._isProcessed=!1,this._original=null,this._processed=null}return t.prototype.getReferencedInputs=function(t,e){if(!e)throw new Error("The referencedInputs parameter cannot be null.");for(var i=0,n=t;i=s)return r.physicalSize=parseInt(o[1]),3==o.length&&"px"==o[2]&&(r.unit=n.SizeUnit.Pixel),r}throw new Error("Invalid size: "+e)},t}();e.SizeAndUnit=a; /** * Fast UUID generator, RFC4122 version 4 compliant. * @author Jeff Ward (jcward.com). * @license MIT license * @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136 **/ var l=function(){function t(){}return t.generate=function(){var e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return t.lut[255&e]+t.lut[e>>8&255]+t.lut[e>>16&255]+t.lut[e>>24&255]+"-"+t.lut[255&i]+t.lut[i>>8&255]+"-"+t.lut[i>>16&15|64]+t.lut[i>>24&255]+"-"+t.lut[63&n|128]+t.lut[n>>8&255]+"-"+t.lut[n>>16&255]+t.lut[n>>24&255]+t.lut[255&r]+t.lut[r>>8&255]+t.lut[r>>16&255]+t.lut[r>>24&255]},t.initialize=function(){for(var e=0;e<256;e++)t.lut[e]=(e<16?"0":"")+e.toString(16)},t.lut=[],t}();e.UUID=l,l.initialize()},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),r=i(1);function o(t){return null==t||""===t}function s(t,e,i){if(o(e))return i;for(var n in t){if(parseInt(n,10)>=0){var r=t[n];if(r&&"string"==typeof r&&r.toLowerCase()===e.toLowerCase())return parseInt(n,10)}}return i}function a(t,e,i,n){void 0===n&&(n=void 0),null==i||i===n?delete t[e]:t[e]=i}function l(t){var e=/#([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})?/gi.exec(t);if(e&&e[4]){var i=parseInt(e[1],16)/255;return"rgba("+parseInt(e[2],16)+","+parseInt(e[3],16)+","+parseInt(e[4],16)+","+i+")"}return t}function u(t,e){for(e+=1;e"!=t[e++];);return e}e.generateUniqueId=function(){return"__ac-"+r.UUID.generate()},e.isNullOrEmpty=o,e.appendChild=function(t,e){null!=e&&null!=e&&t.appendChild(e)},e.getStringValue=function(t,e){return void 0===e&&(e=void 0),"string"==typeof t?t.toString():e},e.getNumberValue=function(t,e){return void 0===e&&(e=void 0),"number"==typeof t?t:e},e.getBoolValue=function(t,e){if("boolean"==typeof t)return t;if("string"==typeof t)switch(t.toLowerCase()){case"true":return!0;case"false":return!1;default:return e}return e},e.getEnumValue=s,e.setProperty=a,e.setNumberProperty=function(t,e,i,n){void 0===n&&(n=void 0),null==i||i===n||isNaN(i)?delete t[e]:t[e]=i},e.setEnumProperty=function(t,e,i,n,r){void 0===r&&(r=void 0);var o=e[i],s=null==o||void 0!==t[o];n==r?s&&delete e[i]:null==n?s&&delete e[i]:e[i]=t[n]},e.setArrayProperty=function(t,e,i){var n=[];if(i)for(var r=0,o=i;r0||e.lineThickness>0){var r=document.createElement("div");return r.className=t.makeCssClassName("ac-"+(i==n.Orientation.Horizontal?"horizontal":"vertical")+"-separator"),i==n.Orientation.Horizontal?e.lineThickness?(r.style.paddingTop=e.spacing/2+"px",r.style.marginBottom=e.spacing/2+"px",r.style.borderBottom=e.lineThickness+"px solid "+l(e.lineColor)):r.style.height=e.spacing+"px":e.lineThickness?(r.style.paddingLeft=e.spacing/2+"px",r.style.marginRight=e.spacing/2+"px",r.style.borderRight=e.lineThickness+"px solid "+l(e.lineColor)):r.style.width=e.spacing+"px",r.style.overflow="hidden",r}return null},e.stringToCssColor=l,e.truncate=function(t,e,i){var n=function(){return e-t.scrollHeight>=-1};if(!n()){for(var r=t.innerHTML,o=function(e){t.innerHTML=r.substring(0,e)+"..."},s=function(t){for(var e=[],i=u(t,-1);i=i-1){for(var h=u(r,p);h0&&(i.customStyles=e),i},t.prototype.getStyleByName=function(t,e){return void 0===e&&(e=null),this._allStyles.hasOwnProperty(t)?this._allStyles[t]:e},Object.defineProperty(t.prototype,"default",{get:function(){return this._allStyles[o.ContainerStyle.Default]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"emphasis",{get:function(){return this._allStyles[o.ContainerStyle.Emphasis]},enumerable:!0,configurable:!0}),t}();e.ContainerStyleSet=S;var _=function(){function t(t,e,i){void 0===t&&(t=1),void 0===e&&(e=1),this._isValid=!0,this._major=t,this._minor=e,this._label=i}return t.parse=function(e,i){if(!e)return null;var n=new t;n._versionString=e;var r=/(\d+).(\d+)/gi.exec(e);return null!=r&&3==r.length?(n._major=parseInt(r[1]),n._minor=parseInt(r[2])):n._isValid=!1,!n._isValid&&i&&i.push({error:o.ValidationError.InvalidPropertyValue,message:"Invalid version string: "+n._versionString}),n},t.prototype.toString=function(){return this._isValid?this._major+"."+this._minor:this._versionString},t.prototype.compareTo=function(t){if(!this.isValid||!t.isValid)throw new Error("Cannot compare invalid version.");return this.major>t.major?1:this.majort.minor?1:this.minor=0)lt(s(c,o.ForbiddenType),a);else if((u=r(c))?(u.setParent(t),u.parse(e,a),p=u.shouldFallback()&&n):(p=n,lt(s(c,o.UnknownType),a)),p){var h=e.fallback;h||t.setShouldFallback(!0),"string"==typeof h&&"drop"===h.toLowerCase()?u=null:"object"==typeof h&&(u=d(t,h,i,!0,r,s,a))}}return u}function f(t,e,i,n,r){return d(t,e,i,n,function(t){return dt.actionTypeRegistry.createInstance(t)},function(t,e){return e==o.UnknownType?{error:s.ValidationError.UnknownActionType,message:"Unknown action type: "+t+". Fallback will be used if present."}:{error:s.ValidationError.ActionTypeNotAllowed,message:"Action type "+t+" is not allowed in this context."}},r)}function g(t,e,i,n){return d(t,e,[],i,function(t){return dt.elementTypeRegistry.createInstance(t)},function(t,e){return e==o.UnknownType?{error:s.ValidationError.UnknownElementType,message:"Unknown element type: "+t+". Fallback will be used if present."}:{error:s.ValidationError.ElementTypeNotAllowed,message:"Element type "+t+" is not allowed in this context."}},n)}!function(t){t[t.UnknownType=0]="UnknownType",t[t.ForbiddenType=1]="ForbiddenType"}(o||(o={})),e.createActionInstance=f,e.createElementInstance=g;var y=function(){function t(){this._rawProperties={}}return t.prototype.parse=function(t,e){this._rawProperties=dt.enableFullJsonRoundTrip?t:{}},t.prototype.toJSON=function(){return dt.enableFullJsonRoundTrip&&this._rawProperties&&"object"==typeof this._rawProperties?this._rawProperties:{}},t.prototype.setCustomProperty=function(t,e){"string"==typeof e&&l.isNullOrEmpty(e)||null==e?delete this._rawProperties[t]:this._rawProperties[t]=e},t.prototype.getCustomProperty=function(t){return this._rawProperties[t]},t}();e.SerializableObject=y;var m=function(t){this.cardObject=t,this.errors=[]};e.ValidationFailure=m;var v=function(){function t(){this.allIds={},this.failures=[]}return t.prototype.getFailureIndex=function(t){for(var e=0;e0},e.prototype.isFirstElement=function(t){return!0},e.prototype.isLastElement=function(t){return!0},e.prototype.isAtTheVeryLeft=function(){return!this.parent||this.parent.isLeftMostElement(this)&&this.parent.isAtTheVeryLeft()},e.prototype.isAtTheVeryRight=function(){return!this.parent||this.parent.isRightMostElement(this)&&this.parent.isAtTheVeryRight()},e.prototype.isAtTheVeryTop=function(){return!this.parent||this.parent.isFirstElement(this)&&this.parent.isAtTheVeryTop()},e.prototype.isAtTheVeryBottom=function(){return!this.parent||this.parent.isLastElement(this)&&this.parent.isAtTheVeryBottom()},e.prototype.isBleedingAtTop=function(){return!1},e.prototype.isBleedingAtBottom=function(){return!1},e.prototype.isLeftMostElement=function(t){return!0},e.prototype.isRightMostElement=function(t){return!0},e.prototype.isTopElement=function(t){return this.isFirstElement(t)},e.prototype.isBottomElement=function(t){return this.isLastElement(t)},e.prototype.isHiddenDueToOverflow=function(){return this._renderedElement&&"hidden"==this._renderedElement.style.visibility},e.prototype.getRootElement=function(){for(var t=this;t.parent;)t=t.parent;return t},e.prototype.getParentContainer=function(){for(var t=this.parent;t;){if(t instanceof et)return t;t=t.parent}return null},e.prototype.getAllInputs=function(){return[]},e.prototype.getResourceInformation=function(){return[]},e.prototype.getElementById=function(t){return this.id===t?this:null},e.prototype.getActionById=function(t){return null},e.prototype.shouldFallback=function(){return this._shouldFallback||!this.requires.areAllMet(this.hostConfig.hostCapabilities)},e.prototype.setShouldFallback=function(t){this._shouldFallback=t},e.prototype.getEffectivePadding=function(){var t=this.getPadding();return t&&this.allowCustomPadding?t:this.getDefaultPadding()},Object.defineProperty(e.prototype,"lang",{get:function(){return this._lang?this._lang:this.parent?this.parent.lang:void 0},set:function(t){if(t&&""!=t){if(!/^[a-z]{2,3}$/gi.exec(t))throw new Error("Invalid language identifier: "+t)}this._lang=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostConfig",{get:function(){return this._hostConfig?this._hostConfig:this.parent?this.parent.hostConfig:gt},set:function(t){this._hostConfig=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.parent?this.parent.indexOf(this):0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInteractive",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStandalone",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInline",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){dt.useAdvancedCardBottomTruncation&&!t&&this.undoOverflowTruncation(),this._isVisible!=t&&(this._isVisible=t,this.updateRenderedElementVisibility(),this._renderedElement&&at(this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasVisibleSeparator",{get:function(){return!(!this.parent||!this.separatorElement)&&(!this.parent.isFirstElement(this)&&(this.isVisible||this.isDesignMode()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderedElement",{get:function(){return this._renderedElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"separatorElement",{get:function(){return this._separatorElement},enumerable:!0,configurable:!0}),e}(b);e.CardElement=C;var S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectAction=null,e.size=s.TextSize.Default,e.weight=s.TextWeight.Default,e.color=s.TextColor.Default,e.isSubtle=!1,e.fontType=null,e}return r(e,t),e.prototype.getEffectiveStyleDefinition=function(){return this.hostConfig.containerStyles.getStyleByName(this.getEffectiveStyle())},e.prototype.getFontSize=function(t){switch(this.size){case s.TextSize.Small:return t.fontSizes.small;case s.TextSize.Medium:return t.fontSizes.medium;case s.TextSize.Large:return t.fontSizes.large;case s.TextSize.ExtraLarge:return t.fontSizes.extraLarge;default:return t.fontSizes.default}},e.prototype.getColorDefinition=function(t,e){switch(e){case s.TextColor.Accent:return t.accent;case s.TextColor.Dark:return t.dark;case s.TextColor.Light:return t.light;case s.TextColor.Good:return t.good;case s.TextColor.Warning:return t.warning;case s.TextColor.Attention:return t.attention;default:return t.default}},e.prototype.setText=function(t){this._text=t},e.prototype.asString=function(){return this.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setEnumProperty(s.TextSize,e,"size",this.size,s.TextSize.Default),l.setEnumProperty(s.TextWeight,e,"weight",this.weight,s.TextWeight.Default),l.setEnumProperty(s.TextColor,e,"color",this.color,s.TextColor.Default),l.setProperty(e,"text",this.text),l.setProperty(e,"isSubtle",this.isSubtle,!1),l.setEnumProperty(s.FontType,e,"fontType",this.fontType,s.FontType.Default),e},e.prototype.applyStylesTo=function(t){var e,i=this.hostConfig.getFontTypeDefinition(this.fontType);switch(i.fontFamily&&(t.style.fontFamily=i.fontFamily),this.size){case s.TextSize.Small:e=i.fontSizes.small;break;case s.TextSize.Medium:e=i.fontSizes.medium;break;case s.TextSize.Large:e=i.fontSizes.large;break;case s.TextSize.ExtraLarge:e=i.fontSizes.extraLarge;break;default:e=i.fontSizes.default}t.style.fontSize=e+"px";var n,r=this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors,this.effectiveColor);switch(t.style.color=l.stringToCssColor(this.isSubtle?r.subtle:r.default),this.weight){case s.TextWeight.Lighter:n=i.fontWeights.lighter;break;case s.TextWeight.Bolder:n=i.fontWeights.bolder;break;default:n=i.fontWeights.default}t.style.fontWeight=n.toString()},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),this.text=l.getStringValue(e.text);var n=l.getStringValue(e.size);n&&"normal"===n.toLowerCase()?(this.size=s.TextSize.Default,lt({error:s.ValidationError.Deprecated,message:'The TextBlock.size value "normal" is deprecated and will be removed. Use "default" instead.'},i)):this.size=l.getEnumValue(s.TextSize,n,this.size);var r=l.getStringValue(e.weight);r&&"normal"===r.toLowerCase()?(this.weight=s.TextWeight.Default,lt({error:s.ValidationError.Deprecated,message:'The TextBlock.weight value "normal" is deprecated and will be removed. Use "default" instead.'},i)):this.weight=l.getEnumValue(s.TextWeight,r,this.weight),this.color=l.getEnumValue(s.TextColor,e.color,this.color),this.isSubtle=l.getBoolValue(e.isSubtle,this.isSubtle),this.fontType=l.getEnumValue(s.FontType,e.fontType,this.fontType)},Object.defineProperty(e.prototype,"effectiveColor",{get:function(){return this.color?this.color:s.TextColor.Default},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this.setText(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectAction",{get:function(){return this._selectAction},set:function(t){this._selectAction=t,this._selectAction&&this._selectAction.setParent(this)},enumerable:!0,configurable:!0}),e}(C);e.BaseTextBlock=S;var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._processedText=null,e._treatAsPlainText=!0,e.wrap=!1,e.useMarkdown=!0,e}return r(e,t),e.prototype.restoreOriginalContent=function(){var t=this.maxLines?this._computedLineHeight*this.maxLines+"px":null;this.renderedElement.style.maxHeight=t,this.renderedElement.innerHTML=this._originalInnerHtml},e.prototype.truncateIfSupported=function(t){var e=this.renderedElement.children,i=!e.length;if(i||1==e.length&&"p"==e[0].tagName.toLowerCase()){var n=i?this.renderedElement:e[0];return l.truncate(n,t,this._computedLineHeight),!0}return!1},e.prototype.setText=function(e){t.prototype.setText.call(this,e),this._processedText=null},e.prototype.getRenderedDomElementType=function(){return"div"},e.prototype.internalRender=function(){var t=this;if(this._processedText=null,l.isNullOrEmpty(this.text))return null;var e=this.hostConfig,i=document.createElement(this.getRenderedDomElementType());if(i.classList.add(e.makeCssClassName("ac-textBlock")),i.style.overflow="hidden",this.applyStylesTo(i),this.selectAction&&(i.onclick=function(e){e.preventDefault(),e.cancelBubble=!0,t.selectAction.execute()},e.supportsInteractivity&&(i.tabIndex=0,i.setAttribute("role","button"),i.setAttribute("aria-label",this.selectAction.title),i.classList.add(e.makeCssClassName("ac-selectable")))),!this._processedText){this._treatAsPlainText=!0;var n=p.formatText(this.lang,this.text);if(this.useMarkdown){dt.allowMarkForTextHighlighting&&(n=n.replace(//g,"===").replace(/<\/mark>/g,"/=="));var r=dt.applyMarkdown(n);if(r.didProcess&&r.outputHtml){if(this._processedText=r.outputHtml,this._treatAsPlainText=!1,dt.allowMarkForTextHighlighting){var o="",s=this.getEffectiveStyleDefinition();s.highlightBackgroundColor&&(o+="background-color: "+s.highlightBackgroundColor+";"),s.highlightForegroundColor&&(o+="color: "+s.highlightForegroundColor+";"),l.isNullOrEmpty(o)||(o='style="'+o+'"'),this._processedText=this._processedText.replace(/===/g,"").replace(/\/==/g,"")}}else this._processedText=n,this._treatAsPlainText=!0}else this._processedText=n,this._treatAsPlainText=!0}if(this._treatAsPlainText?i.innerText=this._processedText:i.innerHTML=this._processedText,i.firstElementChild instanceof HTMLElement){var a=i.firstElementChild;a.style.marginTop="0px",a.style.width="100%",this.wrap||(a.style.overflow="hidden",a.style.textOverflow="ellipsis")}i.lastElementChild instanceof HTMLElement&&(i.lastElementChild.style.marginBottom="0px");for(var u=i.getElementsByTagName("a"),c=0;c0&&(i.style.maxHeight=this._computedLineHeight*this.maxLines+"px",i.style.overflow="hidden")):(i.style.whiteSpace="nowrap",i.style.textOverflow="ellipsis"),(dt.useAdvancedTextBlockTruncation||dt.useAdvancedCardBottomTruncation)&&(this._originalInnerHtml=i.innerHTML),i},e.prototype.truncateOverflow=function(t){return t>=this._computedLineHeight&&this.truncateIfSupported(t)},e.prototype.undoOverflowTruncation=function(){if(this.restoreOriginalContent(),dt.useAdvancedTextBlockTruncation&&this.maxLines){var t=this._computedLineHeight*this.maxLines;this.truncateIfSupported(t)}},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setProperty(e,"wrap",this.wrap,!1),l.setNumberProperty(e,"maxLines",this.maxLines),e},e.prototype.applyStylesTo=function(e){t.prototype.applyStylesTo.call(this,e);var i=this.getParentContainer(),n=!!i&&i.isRtl();switch(this.horizontalAlignment){case s.HorizontalAlignment.Center:e.style.textAlign="center";break;case s.HorizontalAlignment.Right:e.style.textAlign=n?"left":"right";break;default:e.style.textAlign=n?"right":"left"}var r=this.hostConfig.lineHeights;if(r)switch(this.size){case s.TextSize.Small:this._computedLineHeight=r.small;break;case s.TextSize.Medium:this._computedLineHeight=r.medium;break;case s.TextSize.Large:this._computedLineHeight=r.large;break;case s.TextSize.ExtraLarge:this._computedLineHeight=r.extraLarge;break;default:this._computedLineHeight=r.default}else this._computedLineHeight=1.33*this.getFontSize(this.hostConfig.getFontTypeDefinition(this.fontType));e.style.lineHeight=this._computedLineHeight+"px"},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),this.wrap=l.getBoolValue(e.wrap,this.wrap),this.maxLines=l.getNumberValue(e.maxLines)},e.prototype.getJsonTypeName=function(){return"TextBlock"},e.prototype.updateLayout=function(e){void 0===e&&(e=!1),t.prototype.updateLayout.call(this,e),dt.useAdvancedTextBlockTruncation&&this.maxLines&&this.isRendered()&&(this.restoreOriginalContent(),this.truncateIfSupported(this._computedLineHeight*this.maxLines))},e}(S);e.TextBlock=_;var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getRenderedDomElementType=function(){return"label"},e.prototype.internalRender=function(){var e=t.prototype.internalRender.call(this);return e&&!l.isNullOrEmpty(this.forElementId)&&(e.htmlFor=this.forElementId),e},e}(_),x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.italic=!1,e.strikethrough=!1,e.highlight=!1,e}return r(e,t),e.prototype.internalRender=function(){var t=this;if(l.isNullOrEmpty(this.text))return null;var e=this.hostConfig,i=p.formatText(this.lang,this.text),n=document.createElement("span");if(n.classList.add(e.makeCssClassName("ac-textRun")),this.applyStylesTo(n),this.selectAction&&e.supportsInteractivity){var r=document.createElement("a");r.classList.add(e.makeCssClassName("ac-anchor")),r.href=this.selectAction.getHref(),r.target="_blank",r.onclick=function(e){e.preventDefault(),e.cancelBubble=!0,t.selectAction.execute()},r.innerText=i,n.appendChild(r)}else n.innerText=i;return n},e.prototype.applyStylesTo=function(e){if(t.prototype.applyStylesTo.call(this,e),this.italic&&(e.style.fontStyle="italic"),this.strikethrough&&(e.style.textDecoration="line-through"),this.highlight){var i=this.getColorDefinition(this.getEffectiveStyleDefinition().foregroundColors,this.effectiveColor);e.style.backgroundColor=l.stringToCssColor(this.isSubtle?i.highlightColors.subtle:i.highlightColors.default)}},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setProperty(e,"italic",this.italic,!1),l.setProperty(e,"strikethrough",this.strikethrough,!1),l.setProperty(e,"highlight",this.highlight,!1),this.selectAction&&l.setProperty(e,"selectAction",this.selectAction.toJSON()),e},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),this.italic=l.getBoolValue(e.italic,this.italic),this.strikethrough=l.getBoolValue(e.strikethrough,this.strikethrough),this.highlight=l.getBoolValue(e.highlight,this.highlight),this.selectAction=f(this,e.selectAction,[Y.JsonTypeName],!this.isDesignMode(),i)},e.prototype.getJsonTypeName=function(){return"TextRun"},Object.defineProperty(e.prototype,"isStandalone",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInline",{get:function(){return!0},enumerable:!0,configurable:!0}),e}(S);e.TextRun=x;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._inlines=[],e}return r(e,t),e.prototype.internalAddInline=function(t,e){if(void 0===e&&(e=!1),!t.isInline)throw new Error("RichTextBlock.addInline: the specified card element cannot be used as a RichTextBlock inline.");if(!(null==t.parent||e)&&t.parent!=this)throw new Error("RichTextBlock.addInline: the specified inline already belongs to another RichTextBlock.");t.setParent(this),this._inlines.push(t)},e.prototype.internalRender=function(){if(this._inlines.length>0){var t=document.createElement("div");t.className=this.hostConfig.makeCssClassName("ac-richTextBlock");var e=this.getParentContainer(),i=!!e&&e.isRtl();switch(this.horizontalAlignment){case s.HorizontalAlignment.Center:t.style.textAlign="center";break;case s.HorizontalAlignment.Right:t.style.textAlign=i?"left":"right";break;default:t.style.textAlign=i?"right":"left"}for(var n=0,r=0,o=this._inlines;r0)return t}return null},e.prototype.asString=function(){for(var t="",e=0,i=this._inlines;e0){for(var i=[],n=0,r=this._inlines;n=0&&t=0&&(this._inlines[e].setParent(null),this._inlines.splice(e,1),!0)},e}(C);e.RichTextBlock=A;var w=function(t){function e(e,i){void 0===e&&(e=void 0),void 0===i&&(i=void 0);var n=t.call(this)||this;return n.name=e,n.value=i,n}return r(e,t),e.prototype.parse=function(e){t.prototype.parse.call(this,e),this.name=l.getStringValue(e.title),this.value=l.getStringValue(e.value)},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setProperty(e,"title",this.name),l.setProperty(e,"value",this.value),e},e}(y);e.Fact=w;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.facts=[],e}return r(e,t),Object.defineProperty(e.prototype,"useDefaultSizing",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.internalRender=function(){var t=null,e=this.hostConfig;if(this.facts.length>0){(t=document.createElement("table")).style.borderWidth="0px",t.style.borderSpacing="0px",t.style.borderStyle="none",t.style.borderCollapse="collapse",t.style.display="block",t.style.overflow="hidden",t.classList.add(e.makeCssClassName("ac-factset"));for(var i=0;i0&&(n.style.marginTop=e.factSet.spacing+"px");var r=document.createElement("td");r.style.padding="0",r.classList.add(e.makeCssClassName("ac-fact-title")),e.factSet.title.maxWidth&&(r.style.maxWidth=e.factSet.title.maxWidth+"px"),r.style.verticalAlign="top";var o=new _;o.setParent(this),o.text=l.isNullOrEmpty(this.facts[i].name)&&this.isDesignMode()?"Title":this.facts[i].name,o.size=e.factSet.title.size,o.color=e.factSet.title.color,o.isSubtle=e.factSet.title.isSubtle,o.weight=e.factSet.title.weight,o.wrap=e.factSet.title.wrap,o.spacing=s.Spacing.None,l.appendChild(r,o.render()),l.appendChild(n,r),(r=document.createElement("td")).style.width="10px",l.appendChild(n,r),(r=document.createElement("td")).style.padding="0",r.style.verticalAlign="top",r.classList.add(e.makeCssClassName("ac-fact-value")),(o=new _).setParent(this),o.text=this.facts[i].value,o.size=e.factSet.value.size,o.color=e.factSet.value.color,o.isSubtle=e.factSet.value.isSubtle,o.weight=e.factSet.value.weight,o.wrap=e.factSet.value.wrap,o.spacing=s.Spacing.None,l.appendChild(r,o.render()),l.appendChild(n,r),l.appendChild(t,n)}}return t},e.prototype.getJsonTypeName=function(){return"FactSet"},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setArrayProperty(e,"facts",this.facts),e},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),this.facts=[];var n=e.facts;if(Array.isArray(n))for(var r=0,o=n;r0&&(this.pixelWidth=r),(r=this.parseDimension("height",e.height,i))>0&&(this.pixelHeight=r),this.selectAction=f(this,e.selectAction,[Y.JsonTypeName],!this.isDesignMode(),i)},e.prototype.getResourceInformation=function(){return l.isNullOrEmpty(this.url)?[]:[{url:this.url,mimeType:"image"}]},Object.defineProperty(e.prototype,"selectAction",{get:function(){return this._selectAction},set:function(t){this._selectAction=t,this._selectAction&&this._selectAction.setParent(this)},enumerable:!0,configurable:!0}),e}(C);e.Image=T;var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectAction=null,e.allowVerticalOverflow=!1,e}return r(e,t),e.prototype.isElementAllowed=function(t,e){if(!this.hostConfig.supportsInteractivity&&t.isInteractive)return!1;if(e)for(var i=0,n=e;i0){(t=document.createElement("div")).style.display="flex",t.style.flexWrap="wrap";for(var e=0;e0?this._images[0]:null},e.prototype.getLastVisibleRenderedItem=function(){return this._images&&this._images.length>0?this._images[this._images.length-1]:null},e.prototype.removeItem=function(t){if(t instanceof T){var e=this._images.indexOf(t);if(e>=0)return this._images.splice(e,1),t.setParent(null),this.updateLayout(),!0}return!1},e.prototype.getJsonTypeName=function(){return"ImageSet"},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);if(l.setEnumProperty(s.Size,e,"imageSize",this.imageSize,s.Size.Medium),this._images.length>0){for(var i=[],n=0,r=this._images;n=0&&(this._selectedMediaType=e.supportedMediaTypes[o])}r[0]==this._selectedMediaType&&this._selectedSources.push(n)}}},e.prototype.renderPoster=function(){var t=this,i=document.createElement("div");i.className=this.hostConfig.makeCssClassName("ac-media-poster"),i.setAttribute("role","contentinfo"),i.setAttribute("aria-label",this.altText?this.altText:"Media content"),i.style.position="relative",i.style.display="flex";var n=this.getPosterUrl();if(n){var r=document.createElement("img");r.style.width="100%",r.style.height="100%",r.onerror=function(t){r.parentNode.removeChild(r),i.classList.add("empty"),i.style.minHeight="150px"},r.src=n,i.appendChild(r)}else i.classList.add("empty"),i.style.minHeight="150px";if(this.hostConfig.supportsInteractivity&&this._selectedSources.length>0){var o=document.createElement("div");o.setAttribute("role","button"),o.setAttribute("aria-label","Play media"),o.className=this.hostConfig.makeCssClassName("ac-media-playButton"),o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.onclick=function(i){if(t.hostConfig.media.allowInlinePlayback){i.preventDefault(),i.cancelBubble=!0;var n=t.renderMediaPlayer();t.renderedElement.innerHTML="",t.renderedElement.appendChild(n),n.play()}else e.onPlay&&(i.preventDefault(),i.cancelBubble=!0,e.onPlay(t))};var s=document.createElement("div");s.className=this.hostConfig.makeCssClassName("ac-media-playButton-arrow"),s.style.width="12px",s.style.height="15px",s.style.borderTopWidth="7.5px",s.style.borderBottomWidth="7.5px",s.style.borderLeftWidth="12px",s.style.borderRightWidth="0",s.style.borderStyle="solid",s.style.borderTopColor="transparent",s.style.borderRightColor="transparent",s.style.borderBottomColor="transparent",s.style.transform="translate(1.2px,0px)",o.appendChild(s);var a=document.createElement("div");a.style.position="absolute",a.style.left="0",a.style.top="0",a.style.width="100%",a.style.height="100%",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",a.appendChild(o),i.appendChild(a)}return i},e.prototype.renderMediaPlayer=function(){var t;if("video"==this._selectedMediaType){var e=document.createElement("video"),i=this.getPosterUrl();i&&(e.poster=i),t=e}else t=document.createElement("audio");t.controls=!0,t.preload="none",t.style.width="100%";for(var n=0,r=this.sources;n0&&(e.maxLength=this.maxLength),e.oninput=function(){t.valueChanged()},e.onkeypress=function(e){10==e.keyCode&&t.inlineAction&&t.inlineAction.execute()},e}var i=document.createElement("input");return i.type=s.InputTextStyle[this.style].toLowerCase(),i.className=this.hostConfig.makeCssClassName("ac-input","ac-textInput"),i.style.flex="1 1 auto",i.tabIndex=0,l.isNullOrEmpty(this.placeholder)||(i.placeholder=this.placeholder,i.setAttribute("aria-label",this.placeholder)),l.isNullOrEmpty(this.defaultValue)||(i.value=this.defaultValue),this.maxLength&&this.maxLength>0&&(i.maxLength=this.maxLength),i.oninput=function(){t.valueChanged()},i.onkeypress=function(e){13==e.keyCode&&t.inlineAction&&t.inlineAction.execute()},i},e.prototype.overrideInternalRender=function(){var e=this,i=t.prototype.overrideInternalRender.call(this);if(this.inlineAction){var n=document.createElement("button");if(n.className=this.hostConfig.makeCssClassName("ac-inlineActionButton"),n.onclick=function(t){t.preventDefault(),t.cancelBubble=!0,e.inlineAction.execute()},l.isNullOrEmpty(this.inlineAction.iconUrl))n.classList.add("textOnly"),n.textContent=l.isNullOrEmpty(this.inlineAction.title)?"Title":this.inlineAction.title;else{n.classList.add("iconOnly");var r=document.createElement("img");r.style.height="100%",r.style.display="none",r.onload=function(){r.style.removeProperty("display")},r.onerror=function(){n.removeChild(r),n.classList.remove("iconOnly"),n.classList.add("textOnly"),n.textContent=l.isNullOrEmpty(e.inlineAction.title)?"Title":e.inlineAction.title},r.src=this.inlineAction.iconUrl,n.appendChild(r),l.isNullOrEmpty(this.inlineAction.title)||(n.title=this.inlineAction.title)}n.style.marginLeft="8px",this.inputControlContainerElement.appendChild(n)}return i},e.prototype.getJsonTypeName=function(){return"Input.Text"},e.prototype.getActionById=function(e){var i=t.prototype.getActionById.call(this,e);return!i&&this.inlineAction&&(i=this.inlineAction.getActionById(e)),i},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setProperty(e,"placeholder",this.placeholder),l.setNumberProperty(e,"maxLength",this.maxLength),l.setProperty(e,"isMultiline",this.isMultiline,!1),l.setEnumProperty(s.InputTextStyle,e,"style",this.style,s.InputTextStyle.Text),this._inlineAction&&l.setProperty(e,"inlineAction",this._inlineAction.toJSON()),e},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),this.maxLength=l.getNumberValue(e.maxLength),this.isMultiline=l.getBoolValue(e.isMultiline,this.isMultiline),this.placeholder=l.getStringValue(e.placeholder),this.style=l.getEnumValue(s.InputTextStyle,e.style,this.style),this.inlineAction=f(this,e.inlineAction,[Y.JsonTypeName],!this.isDesignMode(),i)},Object.defineProperty(e.prototype,"inlineAction",{get:function(){return this._inlineAction},set:function(t){this._inlineAction=t,this._inlineAction&&this._inlineAction.setParent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.renderedInputControlElement?(this.isMultiline,this.renderedInputControlElement.value):null},enumerable:!0,configurable:!0}),e}(z);e.TextInput=D;var F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.valueOn="true",e.valueOff="false",e.wrap=!1,e}return r(e,t),e.prototype.internalRender=function(){var t=this,e=document.createElement("div");if(e.className=this.hostConfig.makeCssClassName("ac-input","ac-toggleInput"),e.style.width="100%",e.style.display="flex",e.style.alignItems="center",this._checkboxInputElement=document.createElement("input"),this._checkboxInputElement.id=l.generateUniqueId(),this._checkboxInputElement.type="checkbox",this._checkboxInputElement.style.display="inline-block",this._checkboxInputElement.style.verticalAlign="middle",this._checkboxInputElement.style.margin="0",this._checkboxInputElement.style.flex="0 0 auto",this._checkboxInputElement.setAttribute("aria-label",this.title),this._checkboxInputElement.tabIndex=0,this.defaultValue==this.valueOn&&(this._checkboxInputElement.checked=!0),this._checkboxInputElement.onchange=function(){t.valueChanged()},l.appendChild(e,this._checkboxInputElement),!l.isNullOrEmpty(this.title)||this.isDesignMode()){var i=new E;i.setParent(this),i.forElementId=this._checkboxInputElement.id,i.hostConfig=this.hostConfig,i.text=l.isNullOrEmpty(this.title)?this.getJsonTypeName():this.title,i.useMarkdown=dt.useMarkdownInRadioButtonAndCheckbox,i.wrap=this.wrap;var n=i.render();n.style.display="inline-block",n.style.flex="1 1 auto",n.style.marginLeft="6px",n.style.verticalAlign="middle";var r=document.createElement("div");r.style.width="6px",l.appendChild(e,r),l.appendChild(e,n)}return e},Object.defineProperty(e.prototype,"isNullable",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.getJsonTypeName=function(){return"Input.Toggle"},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setProperty(e,"valueOn",this.valueOn,"true"),l.setProperty(e,"valueOff",this.valueOff,"false"),l.setProperty(e,"wrap",this.wrap),e},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),this.title=l.getStringValue(e.title),this.valueOn=l.getStringValue(e.valueOn,this.valueOn),this.valueOff=l.getStringValue(e.valueOff,this.valueOff),this.wrap=l.getBoolValue(e.wrap,this.wrap)},Object.defineProperty(e.prototype,"value",{get:function(){return this._checkboxInputElement?this._checkboxInputElement.checked?this.valueOn:this.valueOff:null},enumerable:!0,configurable:!0}),e}(z);e.ToggleInput=F;var M=function(t){function e(e,i){void 0===e&&(e=void 0),void 0===i&&(i=void 0);var n=t.call(this)||this;return n.title=e,n.value=i,n}return r(e,t),e.prototype.parse=function(e){t.prototype.parse.call(this,e),this.title=l.getStringValue(e.title,""),this.value=l.getStringValue(e.value,"")},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setProperty(e,"title",this.title),l.setProperty(e,"value",this.value),e},e}(y);e.Choice=M;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.choices=[],e.isCompact=!1,e.isMultiSelect=!1,e.wrap=!1,e}return r(e,t),e.getUniqueCategoryName=function(){var t="__ac-category"+e.uniqueCategoryCounter;return e.uniqueCategoryCounter++,t},e.prototype.internalRender=function(){var t=this;if(this.isMultiSelect){var i=this.defaultValue?this.defaultValue.split(this.hostConfig.choiceSetInputValueSeparator):null;(u=document.createElement("div")).className=this.hostConfig.makeCssClassName("ac-input","ac-choiceSetInput-multiSelect"),u.style.width="100%",this._toggleInputs=[];for(var n=0;n=0&&(r.checked=!0),r.onchange=function(){t.valueChanged()},this._toggleInputs.push(r),(h=new E).setParent(this),h.forElementId=r.id,h.hostConfig=this.hostConfig,h.text=l.isNullOrEmpty(this.choices[n].title)?"Choice "+n:this.choices[n].title,h.useMarkdown=dt.useMarkdownInRadioButtonAndCheckbox,h.wrap=this.wrap,(d=h.render()).style.display="inline-block",d.style.flex="1 1 auto",d.style.marginLeft="6px",d.style.verticalAlign="middle",(f=document.createElement("div")).style.width="6px",(g=document.createElement("div")).style.display="flex",g.style.alignItems="center",l.appendChild(g,r),l.appendChild(g,f),l.appendChild(g,d),l.appendChild(u,g)}return u}if(this.isCompact){this._selectElement=document.createElement("select"),this._selectElement.className=this.hostConfig.makeCssClassName("ac-input","ac-multichoiceInput","ac-choiceSetInput-compact"),this._selectElement.style.width="100%";var o=document.createElement("option");o.selected=!0,o.disabled=!0,o.hidden=!0,o.value="",this.placeholder&&(o.text=this.placeholder),l.appendChild(this._selectElement,o);for(var s=0;s0?this._selectElement.value:null;if(!this._toggleInputs||0==this._toggleInputs.length)return null;for(var e=0;e0)&&(this.internalPrepareForExecution(t),!0)},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),function(t,e,i){var n=t.parent?t.parent.getRootElement():null,r=n&&n.onParseAction?n.onParseAction:dt.onParseAction;null!=r&&r(t,e,i)}(this,e,i),this.requires.parse(e.requires,i),e.title||""===e.title||lt({error:s.ValidationError.PropertyCantBeNull,message:"Actions should always have a title."},i),this.title=l.getStringValue(e.title),this.iconUrl=l.getStringValue(e.iconUrl),this.style=l.getStringValue(e.style,this.style)},e.prototype.remove=function(){return!!this._actionCollection&&this._actionCollection.removeAction(this)},e.prototype.getAllInputs=function(){return[]},e.prototype.getResourceInformation=function(){return l.isNullOrEmpty(this.iconUrl)?[]:[{url:this.iconUrl,mimeType:"image"}]},e.prototype.getActionById=function(t){if(this.id==t)return this},e.prototype.getReferencedInputs=function(){return this.internalGetReferencedInputs(this.parent.getRootElement().getAllInputs())},e.prototype.validateInputs=function(){return this.internalValidateInputs(this.getReferencedInputs())},e.prototype.shouldFallback=function(){return this._shouldFallback||!this.requires.areAllMet(this.parent.hostConfig.hostCapabilities)},Object.defineProperty(e.prototype,"isPrimary",{get:function(){return this.style==s.ActionStyle.Positive},set:function(t){t?this.style=s.ActionStyle.Positive:this.style==s.ActionStyle.Positive&&(this.style=s.ActionStyle.Default)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ignoreInputValidation",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderedElement",{get:function(){return this._renderedElement},enumerable:!0,configurable:!0}),e}(b);e.Action=W;var U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._isPrepared=!1,e._ignoreInputValidation=!1,e}return r(e,t),e.prototype.internalGetReferencedInputs=function(t){for(var e={},i=0,n=t;i0)for(var i=0,n=this.headers;i0?this._owner.hostConfig.actions.showCard.inlineTopMargin+"px":"0px";var t=this._owner.getEffectivePadding();this._owner.getImmediateSurroundingPadding(t);var e=this._owner.hostConfig.paddingDefinitionToSpacingDefinition(t);null!==this._actionCard&&(this._actionCard.style.paddingLeft=e.left+"px",this._actionCard.style.paddingRight=e.right+"px",this._actionCard.style.marginLeft="-"+e.left+"px",this._actionCard.style.marginRight="-"+e.right+"px",0==e.bottom||this._owner.isDesignMode()||(this._actionCard.style.paddingBottom=e.bottom+"px",this._actionCard.style.marginBottom="-"+e.bottom+"px"),l.appendChild(this._actionCardContainer,this._actionCard))}else this._actionCardContainer.style.marginTop="0px"},t.prototype.layoutChanged=function(){this._owner.getRootElement().updateLayout()},t.prototype.hideActionCard=function(){var t=this._expandedAction;this._expandedAction=null,this._actionCard=null,this.refreshContainer(),t&&(this.layoutChanged(),st(t,!1))},t.prototype.showActionCard=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!0),null!=t.card){t.card.suppressStyle=e;var n=t.card.renderedElement?t.card.renderedElement:t.card.render();this._actionCard=n,this._expandedAction=t,this.refreshContainer(),i&&(this.layoutChanged(),st(t,!0))}},t.prototype.collapseExpandedAction=function(){for(var t=0;t0){for(var t=[],e=0,i=this.items;ethis._owner.hostConfig.actions.maxActions&&t.addFailure(this._owner,{error:s.ValidationError.TooManyActions,message:"A maximum of "+this._owner.hostConfig.actions.maxActions+" actions are allowed."}),this.items.length>0&&!this._owner.hostConfig.supportsInteractivity&&t.addFailure(this._owner,{error:s.ValidationError.InteractivityNotAllowed,message:"Interactivity is not allowed."});for(var e=0,i=this.items;e=n.actions.maxActions||c==this.items.length-1)break;if(n.actions.buttonSpacing>0){var f=document.createElement("div");t===s.Orientation.Horizontal?(f.style.flex="0 0 auto",f.style.width=n.actions.buttonSpacing+"px"):f.style.height=n.actions.buttonSpacing+"px",l.appendChild(u,f)}}var g=document.createElement("div");g.style.overflow="hidden",g.appendChild(u),l.appendChild(r,g)}l.appendChild(r,this._actionCardContainer);for(c=0;c0?r:null},t.prototype.addAction=function(t){if(!t)throw new Error("The action parameter cannot be null.");if(t.parent&&t.parent!==this._owner||!(this.items.indexOf(t)<0))throw new Error("The action already belongs to another element.");this.items.push(t),t.parent||t.setParent(this._owner),c(t,this)},t.prototype.removeAction=function(t){this.expandedAction&&this._expandedAction==t&&this.collapseExpandedAction();var e=this.items.indexOf(t);if(e>=0){this.items.splice(e,1),t.setParent(null),c(t,null);for(var i=0;i=0&&e=this._items.length?this._items.push(t):this._items.splice(e,0,t),t.setParent(this)},e.prototype.supportsExcplitiHeight=function(){return!0},e.prototype.getItemsCollectionPropertyName=function(){return"items"},e.prototype.applyBackground=function(){this.backgroundImage.isValid()&&this.backgroundImage.apply(this.renderedElement),t.prototype.applyBackground.call(this)},e.prototype.internalRender=function(){this._renderedItems=[];var t=this.hostConfig,e=document.createElement("div");switch(null!=this.rtl&&this.rtl&&(e.dir="rtl"),e.classList.add(t.makeCssClassName("ac-container")),e.style.display="flex",e.style.flexDirection="column",dt.useAdvancedCardBottomTruncation&&(e.style.minHeight="-webkit-min-content"),this.verticalContentAlignment){case s.VerticalAlignment.Center:e.style.justifyContent="center";break;case s.VerticalAlignment.Bottom:e.style.justifyContent="flex-end";break;default:e.style.justifyContent="flex-start"}if(this._items.length>0)for(var i=0;i0&&this._items[i].separatorElement&&(this._items[i].separatorElement.style.flex="0 0 auto",l.appendChild(e,this._items[i].separatorElement)),l.appendChild(e,n),this._renderedItems.push(this._items[i]))}else if(this.isDesignMode()){var r=this.createPlaceholderElement();r.style.width="100%",r.style.height="100%",e.appendChild(r)}return e},e.prototype.truncateOverflow=function(t){for(var e=this.renderedElement.offsetTop+t+1,i=function(t){var n=t.renderedElement;if(n)switch(l.getFitStatus(n,e)){case s.ContainerFitStatus.FullyInContainer:t.resetOverflow()&&i(t);break;case s.ContainerFitStatus.Overflowing:var r=e-n.offsetTop;t.handleOverflow(r);break;case s.ContainerFitStatus.FullyOutOfContainer:t.handleOverflow(0)}},n=0,r=this._items;n0){for(var i=[],n=0,r=this._items;n0)for(var t=0,e=this._renderedItems;t0)for(var t=this._renderedItems.length-1;t>=0;t--)if(this._renderedItems[t].isVisible)return this._renderedItems[t];return null},e.prototype.getJsonTypeName=function(){return"Container"},e.prototype.isFirstElement=function(t){for(var e=this.isDesignMode(),i=0;i=0;i--)if(this._items[i].isVisible||e)return this._items[i]==t;return!1},e.prototype.isRtl=function(){if(null!=this.rtl)return this.rtl;var t=this.getParentContainer();return!!t&&t.isRtl()},e.prototype.isBleedingAtTop=function(){var t=this.getFirstVisibleRenderedItem();return this.isBleeding()||!!t&&t.isBleedingAtTop()},e.prototype.isBleedingAtBottom=function(){var t=this.getLastVisibleRenderedItem();return this.isBleeding()||!!t&&(t.isBleedingAtBottom()&&t.getEffectiveStyle()==this.getEffectiveStyle())},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i),this.setShouldFallback(!1),this._items=[],this._renderedItems=[],this.backgroundImage.reset();var n=e.backgroundImage;if(n&&("string"==typeof n?(this.backgroundImage.url=n,this.backgroundImage.fillMode=s.FillMode.Cover):"object"==typeof n&&this.backgroundImage.parse(n,i)),this.verticalContentAlignment=l.getEnumValue(s.VerticalAlignment,e.verticalContentAlignment,this.verticalContentAlignment),null!=e[this.getItemsCollectionPropertyName()]){var r=e[this.getItemsCollectionPropertyName()];this.clear();for(var o=0;o=0&&(this._items.splice(e,1),t.setParent(null),this.updateLayout(),!0)},e.prototype.clear=function(){this._items=[]},e.prototype.getResourceInformation=function(){var e=t.prototype.getResourceInformation.call(this);return this.backgroundImage.isValid()&&e.push({url:this.backgroundImage.url,mimeType:"image"}),e},e.prototype.getActionById=function(e){var i=t.prototype.getActionById.call(this,e);if(!i&&(this.selectAction&&(i=this.selectAction.getActionById(e)),!i))for(var n=0;n0?this._computedWeight:e.physicalSize)+"%"}},Object.defineProperty(e.prototype,"separatorOrientation",{get:function(){return s.Orientation.Vertical},enumerable:!0,configurable:!0}),e.prototype.getJsonTypeName=function(){return"Column"},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return this.width instanceof a.SizeAndUnit?this.width.unit==s.SizeUnit.Pixel?l.setProperty(e,"width",this.width.physicalSize+"px"):l.setNumberProperty(e,"width",this.width.physicalSize):l.setProperty(e,"width",this.width),e},e.prototype.parse=function(e,i){t.prototype.parse.call(this,e,i);var n=e.width;if(void 0===n&&void 0!==(n=e.size)&<({error:s.ValidationError.Deprecated,message:'The "Column.size" property is deprecated and will be removed. Use the "Column.width" property instead.'},i),n){var r=!1;try{this.width=a.SizeAndUnit.parse(n)}catch(t){"string"!=typeof n||"auto"!==n&&"stretch"!==n?r=!0:this.width=n}r&<({error:s.ValidationError.InvalidPropertyValue,message:"Invalid column width:"+n+' - defaulting to "auto"'},i)}},Object.defineProperty(e.prototype,"hasVisibleSeparator",{get:function(){return!!(this.parent&&this.parent instanceof nt)&&(this.separatorElement&&!this.parent.isLeftMostElement(this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStandalone",{get:function(){return!1},enumerable:!0,configurable:!0}),e}(et);e.Column=it;var nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._columns=[],e}return r(e,t),e.prototype.createColumnInstance=function(t,e){return d(this,t,[],!this.isDesignMode(),function(t){return t&&"Column"!==t?null:new it},function(t,e){return e==o.UnknownType?{error:s.ValidationError.UnknownElementType,message:"Unknown element type: "+t+". Fallback will be used if present."}:{error:s.ValidationError.ElementTypeNotAllowed,message:"Element type "+t+" isn't allowed in a ColumnSet."}},e)},e.prototype.internalRender=function(){if(this._renderedColumns=[],this._columns.length>0){var t=this.hostConfig,e=document.createElement("div");switch(e.className=t.makeCssClassName("ac-columnSet"),e.style.display="flex",dt.useAdvancedCardBottomTruncation&&(e.style.minHeight="-webkit-min-content"),this.horizontalAlignment){case s.HorizontalAlignment.Center:e.style.justifyContent="center";break;case s.HorizontalAlignment.Right:e.style.justifyContent="flex-end";break;default:e.style.justifyContent="flex-start"}for(var i=0,n=0,r=this._columns;n0){var c=100/i*p.width.physicalSize;p._computedWeight=c}var h=p.render();h&&(this._renderedColumns.length>0&&p.separatorElement&&(p.separatorElement.style.flex="0 0 auto",l.appendChild(e,p.separatorElement)),l.appendChild(e,h),this._renderedColumns.push(p))}return this._renderedColumns.length>0?e:null}return null},e.prototype.truncateOverflow=function(t){for(var e=0,i=this._columns;e0){for(var i=[],n=0,r=this._columns;n0)for(var t=0,e=this._columns;t0)for(var t=0,e=this._columns;t0?this._renderedColumns[0]:null},e.prototype.getLastVisibleRenderedItem=function(){return this.renderedElement&&this._renderedColumns&&this._renderedColumns.length>0?this._renderedColumns[this._renderedColumns.length-1]:null},e.prototype.getColumnAt=function(t){return this._columns[t]},e.prototype.getItemAt=function(t){return this.getColumnAt(t)},e.prototype.getJsonTypeName=function(){return"ColumnSet"},e.prototype.parse=function(e,i){if(t.prototype.parse.call(this,e,i),null!=e.columns){var n=e.columns;this._columns=[];for(var r=0;r0&&n>0&&e.addFailure(this,{error:s.ValidationError.Hint,message:"It is not recommended to use weighted and stretched columns in the same ColumnSet, because in such a situation stretched columns will always get the minimum amount of space."})},e.prototype.addColumn=function(t){if(t.parent)throw new Error("This column already belongs to another ColumnSet.");this._columns.push(t),t.setParent(this)},e.prototype.removeItem=function(t){if(t instanceof it){var e=this._columns.indexOf(t);if(e>=0)return this._columns.splice(e,1),t.setParent(null),this.updateLayout(),!0}return!1},e.prototype.indexOf=function(t){return t instanceof it?this._columns.indexOf(t):-1},e.prototype.isLeftMostElement=function(t){return 0==this._columns.indexOf(t)},e.prototype.isRightMostElement=function(t){return this._columns.indexOf(t)==this._columns.length-1},e.prototype.isTopElement=function(t){return this._columns.indexOf(t)>=0},e.prototype.isBottomElement=function(t){return this._columns.indexOf(t)>=0},e.prototype.getActionById=function(t){for(var e=null,i=0;i0?e:null},e.prototype.getHasExpandedAction=function(){return 0!=this.renderedActionCount&&(1==this.renderedActionCount?null!=this._actionCollection.expandedAction&&!this.hostConfig.actions.preExpandSingleShowCardAction:null!=this._actionCollection.expandedAction)},Object.defineProperty(e.prototype,"renderedActionCount",{get:function(){return this._actionCollection.renderedActionCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderIfEmpty",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return l.setProperty(e,"actions",this._actionCollection.toJSON()),e},e.prototype.getActionCount=function(){return this._actionCollection.items.length},e.prototype.getActionAt=function(e){if(e>=0&&e