expressions.js 102 KB

12345678
  1. /*!
  2. * Licensed Materials - Property of IBM
  3. * IBM Cognos Products: Modeling UI
  4. * (C) Copyright IBM Corp. 2020
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. (window.caModellingPerspective=window.caModellingPerspective||[]).push([[19],{1026:function(e,t,r){"use strict";r.d(t,"b",function(){return o});var n=r(18),i=r(1026);function o(e,t){var r=e.moserObject,n=e.module,i=e.name,o=e.datasourceRef,a=e.expression,c=e.type,l=r&&r.getIdentifier&&r.getIdentifier(),s={moserFunctionType:"describeDataSourceQuery",module:n,name:i,datasourceRef:o,sqlType:c,sqlText:a};return l&&l.length>0&&(s.identifier=l),t&&(s.connections=t),s}t.a=function(e,t){return void 0===t&&(t={}),e.resolveConnection(function(r){return e.ajaxService({url:n.i+"/modules/mosercommand",method:"POST",data:JSON.stringify({functionSpec:i.b(t,r)})})})}},1224:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1142],{"2aeb63560720c6f79bb0":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("ce978f22510fbc93156b"));t.default=i.a},"3865314c5959606874d4":function(t,r){t.exports=e},ce978f22510fbc93156b:function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"function_32_v7",use:"function_32_v7-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="function_32_v7"><path d="M8.5 30a2.5 2.5 0 010-5c.63-.07 2.35-1.53 2.49-7.22l-1.78-.45a2.92 2.92 0 010-5.66l1.79-.46C11.55 4 19.32 2 23.5 2a2.5 2.5 0 010 5c-.08 0-2.23.15-2.48 4.22l1.77.45a2.92 2.92 0 010 5.66l-1.79.46C20.49 29.86 8.62 30 8.5 30zm15-26c-.43 0-10.5.11-10.5 8v.78l-3.3.83a.92.92 0 000 1.78l3.3.83V17c0 9.72-4 10-4.5 10a.5.5 0 000 1c.43 0 10.5-.17 10.5-11v-.78l3.3-.83a.92.92 0 000-1.78l-3.3-.83V12c0-6.92 4.46-7 4.5-7a.5.5 0 000-1z" /><path d="M4.15 23.46a14 14 0 016.46-20.38l.77 1.84A12 12 0 005.85 22.4zm17.24 5.46l-.77-1.84a12 12 0 005.49-17.54l1.69-1.08a14 14 0 01-6.41 20.46z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});a.a.add(c),t.a=c}},["2aeb63560720c6f79bb0"])}(r(15))},1225:function(e,t,r){var n=r(500);e.exports=function(e,t){for(var r=e.length;r--&&n(t,e[r],0)>-1;);return r}},1227:function(e,t,r){"use strict";r.d(t,"b",function(){return a}),r.d(t,"c",function(){return c}),r.d(t,"a",function(){return l});var n=r(0),i=r.n(n),o=r(27);function a(e,t,r){var n=e.moser.jsonObjectFactory.createQuerySubject(t);return r.label&&n.setLabel(r.label),n}function c(e,t){var r={item:[],sqlQuery:{sqlText:t.expression,sqlType:t.sqlType.enumValue,datasourceRef:[t.datasourceRef]},classifier:i.a.QsClassifierType.SQL_QUERY_SUBJECT.enumValue,label:t.label},n=e.moser.jsonObjectFactory.createQuerySubject(r);return(new i.a.IdGenerator).generateId(n),n}function l(e,t,r){var n=e.moser.objectFactory,i=Object(o.isExpressionParentGlobal)(t)&&n.createSqlQueryType();return i&&(i.setSqlType(r.sqlType.enumValue),i.setSqlText(r.expression)),i}},1673:function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return m});var n,i,o,a=r(1),c=r.n(a),l=r(16),s=r(3),u=r(25),p=r(5),d=r(2),g=r(10),f=r(44),b=r(1674),h=r(68),v=r(1693);var m=Object(f.a)(g.i,{initializer:function(e,t){return new v.a({context:e},{localScope:t.edit?null:t.element,existingCalc:t.edit?t.element:null,label:t.label,expression:t.expression,mode:t.mode,forceGlobal:t.forceGlobal,calculateAfterAggregation:t.calculateAfterAggregation,querySubjectUsage:t.querySubjectUsage})}})(n=Object(p.e)(function(e){return{dirty:e.dirty,mode:e.mode,contentHeight:e.contentHeight,isCalculateAfterAggregation:e.isCalculateAfterAggregation,setCalculateAfterAggregation:e.setCalculateAfterAggregation,showCalculateAfterAggregation:e.showCalculateAfterAggregation,validateAfterUpdate:e.validateAfterUpdate,calcIsUpdatable:e.calcIsUpdatable,isCreateMode:e.isCreateMode,readOnly:e.readOnly,createOrUpdateExpression:e.createOrUpdateExpression}})(n=Object(l.observer)((o=i=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this)._onSave=function(){var e=t.props,r=e.mode,n=e.validateAfterUpdate,i=e.calcIsUpdatable,o=e.createOrUpdateExpression,a=e.onClose,c=e.validationAction,l=a(o);r===h.h&&n&&i&&l.then(function(){return c()})},t._getEditorTitle=function(){var e=t.props,r=e.mode,n=e.readOnly,i=e.isCreateMode;return(r===h.h?i?Object(d.getString)("expSQLCreate"):Object(d.getString)("expSQLEdit"):r===h.f||r===h.e?i?Object(d.getString)("expFilterCreate"):Object(d.getString)("expFilterEdit"):i?Object(d.getString)("expEditorCreate"):Object(d.getString)("expEditorEdit"))+(n?" ("+Object(d.getString)("readOnly")+")":" ")},t}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e=this.props,t=e.onClose,r=e.prepareForClose,n=e.isCalculateAfterAggregation,i=e.setCalculateAfterAggregation,o=e.showCalculateAfterAggregation,a=e.contentHeight,l=e.mode,p=e.readOnly,g=e.dirty;return c.a.createElement(s.Dialog,{"data-tid":Object(u.a)("expressionEditorDialog"),width:"100%",minWidth:"900px",onClose:function(){return!r&&t()}},c.a.createElement(s.Dialog.Header,{"data-tid":Object(u.a)("expressionEditorDialog","header")},c.a.createElement(s.TruncatedText,{value:this._getEditorTitle()})),c.a.createElement(s.Dialog.Body,null,c.a.createElement(s.FlexLayout,{direction:"row",height:a},c.a.createElement(s.FlexItem,{grow:!0},c.a.createElement(b.a,{mode:l})))),c.a.createElement(s.Dialog.Footer,null,o&&c.a.createElement(s.FlexItem,{grow:!0,alignSelf:"center"},c.a.createElement(s.Checkbox,{disabled:p,label:Object(d.getString)("simpleCalcAggregation"),checked:n,onChange:i,"data-tid":Object(u.a)("expressionEditorDialog","aggregation")})),!p&&c.a.createElement(s.Dialog.Button,{primary:!0,"data-tid":Object(u.a)("expressionEditorDialog","ok"),label:Object(d.getString)("ok"),onClick:this._onSave,disabled:r||!g}),!p&&c.a.createElement(s.Dialog.Button,{"data-tid":Object(u.a)("expressionEditorDialog","cancel"),label:Object(d.getString)("cancel"),onClick:t,disabled:r}),p&&c.a.createElement(s.Dialog.Button,{"data-tid":Object(u.a)("expressionEditorDialog","close"),label:Object(d.getString)("close"),onClick:t})))},t}(a.Component),i.defaultProps={validationAction:function(){}},n=o))||n)||n)||n},1674:function(e,t,r){"use strict";r.d(t,"a",function(){return Q});var n,i=r(54),o=r.n(i),a=r(0),c=r.n(a),l=r(1),s=r.n(l),u=r(20),p=r.n(u),d=r(16),g=r(25),f=r(3),b=r(502),h=r.n(b),v=r(1675),m=r.n(v),y=r(776),O=r.n(y),E=r(1224),x=r.n(E),S=r(8),w=r(14),j=r(4),T=r(5),C=r(2),L=r(7),_=r(190),I=r(68),A=r(1676),P=r(1678),F=r(1679),M=r(1683),k=r(1688);r(1691);var z=500,D=325,Q=Object(f.withContext)("featureConfig")(n=Object(T.e)(function(e){return{readOnly:e.readOnly,label:e.label,mode:e.mode,expression:e.expression,treeFilter:e.treeFilter,displayedPanel:e.displayedPanel,selectedFontSize:e.aceEditorStore.selectedFontSize,highContrastMode:e.highContrastMode,selectedPanelTab:e.selectedPanelTab,contentHeight:e.contentHeight,shouldEnableSQLTypeSelection:e.shouldEnableSQLTypeSelection,selectedSQLSource:e.selectedSQLSource,selectedSQLType:e.selectedSQLType,defaultSQLType:e.defaultSQLType,sqlTypes:e.sqlTypes,sqlSources:e.sqlSources,changeSelectedSQLType:e.changeSelectedSQLType,changeSelectedSQLSource:e.changeSelectedSQLSource,insertIntoEditor:e.insertIntoEditor,moveEditorCursor:e.aceEditorStore.moveEditorCursor,onCursorChange:e.aceEditorStore.onCursorChange,onTextSelectionChange:e.onTextSelectionChange,resizeEditor:e.aceEditorStore.resizeEditor,setComponentTab:e.setComponentTab,setEditor:e.aceEditorStore.setEditor,memberSearchableTreeStore:e.memberSearchableTreeStore,setMoserObjectTreeIsDragging:e.setMoserObjectTreeIsDragging,updateExpression:e.updateExpression,updateLabel:e.updateLabel,localScope:e.localScope,module:e.module,searchInputValue:e.searchInputValue,setSearchInputValue:e.setSearchInputValue}})(n=Object(d.observer)(n=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).state={sqlTypesFlyoutOpen:!1,maxWidthPane:400,isFromWindowResize:!1,width:D},t._inputId=o()("__editorView_label_"),t._moveEditorCursor=function(e,r){return t.props.moveEditorCursor(e,r)},t._setEditor=function(e){return t.props.setEditor(e)},t._getValidExpressionItems=function(e){return Object(S.getValidExpressionItems)(t.props.module,e)},t._onMoserObjectTreeSelectionChange=function(e){t.props.setMoserObjectTreeSelectedMap(e)},t._onMoserObjectTreeExpandChange=function(){var e;(e=t.props).setMoserObjectTreeExpandedMap.apply(e,arguments)},t._onMoserObjectTreeBeginDrag=function(){t.props.setMoserObjectTreeIsDragging(!0)},t._onMoserObjectTreeEndDrag=function(){t.props.setMoserObjectTreeIsDragging(!1)},t._hasContextMenu=function(e){return Object(j.supportsMemberSearch)(e)},t._onModelTreeArrowKey=function(e){var r=t.props,n=r.localScope,i=r.insertIntoEditor,o=Object(S.getValidExpressionItems)(n,e);o.length&&i(o)},t._renderMemberSearchableTree=function(e){var r=t.props,n=r.treeFilter,i=r.featureConfig,o=r.memberSearchableTreeStore;return s.a.createElement(f.FlexItem,{grow:!0},s.a.createElement(T.b,{store:o},s.a.createElement(_.a,{width:300,onDropAction:t._onModelTreeArrowKey,rootObject:e,resizeable:!1,moserObjectFilter:n,selectionMode:"multi",onBeginDrag:t._onMoserObjectTreeBeginDrag,onEndDrag:t._onMoserObjectTreeEndDrag,showFullPackage:i[L.SHOW_MEMBERS]||i[L.SHOW_FULL_PACKAGE],label:Object(C.getString)("dataModule"),hasContextMenu:t._hasContextMenu})))},t._onFunctionTreeArrowKey=function(e){e&&t.props.insertIntoEditor(e.getDropText(),!0)},t._renderFunctionTree=function(){var e=t.props,r=e.searchInputValue,n=e.setSearchInputValue;return s.a.createElement(F.a,{width:300,filter:r,onFilterChange:n,onDropAction:t._onFunctionTreeArrowKey})},t._node=void 0,t._adjustLeftPanelWidth=function(){t.setState({isFromWindowResize:!0}),t._node.offsetWidth>D&&t._adjustLeftPanelMaxWidth()},t._adjustLeftPanelMaxWidth=function(){var e=t._node.getBoundingClientRect(),r=window.innerWidth-2*e.left-z;t.setState({maxWidthPane:r})},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.componentDidMount=function(){window.addEventListener("resize",this._adjustLeftPanelWidth)},r.componentWillUnmount=function(){window.removeEventListener("resize",this._adjustLeftPanelWidth)},r.render=function(){var e=this,t=this.props,r=t.onCursorChange,n=t.onTextSelectionChange,i=t.updateExpression,o=t.updateLabel,a=t.localScope,l=t.module,u=t.readOnly,d=t.label,b=t.expression,v=t.mode,y=t.selectedFontSize,E=t.highContrastMode,S=t.shouldEnableSQLTypeSelection,T=t.selectedSQLType,L=t.defaultSQLType,_=t.sqlTypes,F=t.selectedSQLSource,Q=t.sqlSources,U=t.selectedPanelTab,V=t.displayedPanel,R=t.contentHeight,N=t.insertIntoEditor,H=c.a.MoserObjectTypes,q=H.MODULE,B=H.CALCULATION,G=H.QUERY_ITEM,W=H.QUERY_SUBJECT,Y=a,J=a.getObjectType()!==q;if(J&&!Object(w.s)(a).some(function(e){var t=e.getObjectType();return t===G||t===B})){var K=Object(j.getAncestor)(a,[W]);K?Y=K:J=!1}var X={insertIntoEditor:N,moveEditorCursor:this._moveEditorCursor,expression:b,onChange:function(e){return i(e)},onCursorChange:function(e){return r(e)},onTextSelectionChange:function(e){return n(e)},readOnly:u,getAceEditorRef:this._setEditor,getValidExpressionItems:this._getValidExpressionItems,aceMode:v===I.f||v===I.e?I.g:v,fontSize:y,label:Object(C.getString)("expEditor"),highContrast:E},Z="EditorView",$=[Object(C.getString)("cognosSQL"),Object(C.getString)("cognosSQLHelp"),Object(C.getString)("nativeSQL"),Object(C.getString)("nativeSQLHelp"),Object(C.getString)("passThroughSQL"),Object(C.getString)("passThroughSQLHelp")].join(" "),ee=s.a.createElement("div",{style:{textAlign:"left"}},s.a.createElement("br",null),s.a.createElement("div",null,s.a.createElement("b",null,Object(C.getString)("cognosSQL"))),s.a.createElement("div",null,Object(C.getString)("cognosSQLHelp")),s.a.createElement("br",null),s.a.createElement("div",null,s.a.createElement("b",null,Object(C.getString)("nativeSQL"))),s.a.createElement("div",null,Object(C.getString)("nativeSQLHelp")),s.a.createElement("br",null),s.a.createElement("div",null,s.a.createElement("b",null,Object(C.getString)("passThroughSQL"))),s.a.createElement("div",null,Object(C.getString)("passThroughSQLHelp")),s.a.createElement("br",null)),te=s.a.createElement(f.FlexLayout,{direction:"row",alignItems:"flex-start",wrap:"wrap",justifyContent:"space-between"},s.a.createElement(f.FlexItem,{gutter:[0,0,1,0]},s.a.createElement(f.FlexLayout,{direction:"row",alignItems:"center"},s.a.createElement(f.FlexItem,{gutter:[0,2,0,0]},s.a.createElement(f.Label,{htmlFor:this._inputId,label:Object(C.getString)("expressionName")})),s.a.createElement(f.FlexItem,{gutter:[0,2,0,0],width:"680px"},s.a.createElement(f.TextInput,{fullWidth:!0,"data-tid":Object(g.a)(Z,"expressionName"),id:this._inputId,disabled:u,value:d,onChange:function(e){return o(e)}})))),v===I.h&&s.a.createElement(f.FlexItem,{gutter:[0,0,1,0]},s.a.createElement(f.FlexLayout,{direction:"row",alignItems:"center"},s.a.createElement(f.FlexItem,{gutter:[0,2,0,0]},s.a.createElement(f.Label,{label:Object(C.getString)("sqlType")})),s.a.createElement(f.FlexItem,{gutter:[0,1,0,0],width:"300px"},s.a.createElement(f.Select,{"aria-label":Object(C.getString)("sqlType"),"data-tid":Object(g.a)(Z,"sqlType"),customWidth:"100%",size:"normal",selected:S?T:L,options:_,onChange:function(t){return e.props.changeSelectedSQLType(t)},disabled:!S})),s.a.createElement(f.Container,{gutter:[1,0]},s.a.createElement(f.Button,{title:Object(C.getString)("sqlTypesHelp"),variant:"inline",onClick:function(){return e.setState(function(e){return{sqlTypesFlyoutOpen:!e.sqlTypesFlyoutOpen}})}},s.a.createElement(f.SVGIcon,{size:"normal",iconId:O.a.id})),this.state.sqlTypesFlyoutOpen&&s.a.createElement(f.Flyout,{"aria-label":$,title:Object(C.getString)("sqlTypes"),placement:"bottomCentred",showX:!0,href:I.j,linkName:Object(C.getString)("moreInfo"),textContent:ee,padding:"default",onClose:function(){return e.setState(function(e){return{sqlTypesFlyoutOpen:!e.sqlTypesFlyoutOpen}})}})))),v===I.h&&s.a.createElement(f.FlexItem,{gutter:[0,0,1,0]},s.a.createElement(f.FlexLayout,{direction:"row",alignItems:"center"},s.a.createElement(f.FlexItem,{gutter:[0,2,0,0]},s.a.createElement(f.Label,{label:Object(C.getString)("source")})),s.a.createElement(f.FlexItem,{width:"300px"},s.a.createElement(f.Select,{"aria-label":Object(C.getString)("source"),"data-tid":Object(g.a)(Z,"sqlSource"),customWidth:"100%",size:"normal",selected:F,options:Q,onChange:function(t){return e.props.changeSelectedSQLSource(t)}}))))),re=s.a.createElement(f.FlexLayout,{direction:"column"},s.a.createElement(f.Container,{className:"mui-editorBoldText",gutter:[1,0,2,0]},Object(C.getString)("components")),s.a.createElement(f.Container,{width:this.state.width,minHeight:200,minWidth:D,resizable:!0,maxWidth:this.state.maxWidthPane,resizeMinConstraintsX:D,resizeMaxConstraintsX:this.state.maxWidthPane,onResizeStart:this._adjustLeftPanelMaxWidth,onResize:function(t,r){var n=r.size;e.setState({isFromWindowResize:!1,width:n.width}),e.props.resizeEditor(n)},resizeDirection:"x",ref:function(t){return e._node=p.a.findDOMNode(t)},isPassive:this.state.isFromWindowResize},s.a.createElement(f.FlexLayout,{className:"mui-editorViewBorder",fullHeight:!0,direction:"column"},s.a.createElement(f.Tabs,{fullHeight:!0,className:"mui-editorViewTabs",selected:U||(J?I.i:I.a),onChange:function(t){return e.props.setComponentTab(t)},vertical:!0},J&&s.a.createElement(f.TabPanel,{"data-tid":Object(g.a)(Z,I.i),"aria-label":Object(C.getString)("selectedComponents"),id:I.i,key:"16",icon:m.a.id,width:"100%"},s.a.createElement(f.FlexLayout,{className:"mui-editorViewPanel",fullHeight:!0,direction:"column"},this._renderMemberSearchableTree(Y))),s.a.createElement(f.TabPanel,{"data-tid":Object(g.a)(Z,I.a),"aria-label":Object(C.getString)("components"),id:I.a,key:"17",icon:h.a.id,width:"100%"},s.a.createElement(f.FlexLayout,{className:"mui-editorViewPanel",fullHeight:!0,direction:"column"},this._renderMemberSearchableTree(l))),s.a.createElement(f.TabPanel,{"data-tid":Object(g.a)(Z,I.c),"aria-label":Object(C.getString)("calcFunctions"),id:I.c,key:"18",icon:x.a.id,width:"100%"},s.a.createElement(f.FlexLayout,{className:"mui-editorViewPanel",fullHeight:!0,direction:"column"},this._renderFunctionTree()))))));return s.a.createElement(f.FlexLayout,{fullHeight:!0,direction:"column"},s.a.createElement(f.FlexItem,null,te),s.a.createElement(f.FlexItem,{grow:!0},s.a.createElement(f.FlexLayout,{fullHeight:!0,direction:"row"},(v===I.g||v===I.f||v===I.e)&&!u&&re,s.a.createElement(f.FlexItem,{grow:!0},s.a.createElement(f.FlexLayout,{fullHeight:!0,minWidth:z,direction:"column"},s.a.createElement(f.FlexItem,null,s.a.createElement(f.FlexLayout,{direction:"row"},s.a.createElement(f.FlexItem,{grow:!0,gutter:[1,0,2,0]},s.a.createElement(f.Container,{className:"mui-editorBoldText"},Object(C.getString)("expression"))),s.a.createElement(f.FlexItem,null,s.a.createElement(M.a,null)))),s.a.createElement(f.Container,{"data-tid":Object(g.a)(Z,"editorContainer"),className:"mui-editorViewBorder",width:"100%",height:V?R-300:"100%",minHeight:200,maxHeight:V?window.innerHeight/2:1/0,onResize:function(t,r){var n=r.size;return e.props.resizeEditor(n)},resizable:!!V,resizeDirection:"y"},v===I.h&&s.a.createElement(P.a,X),(v===I.g||v===I.f||v===I.e)&&s.a.createElement(A.a,X)),V&&s.a.createElement(f.FlexItem,{grow:1,className:"mui-editorViewBorder",overflow:"auto",gutter:2},s.a.createElement(k.a,null)))))))},t}(l.Component))||n)||n)||n},1675:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1234],{"0954d4278df8b67491fc":function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"filter-applied_24_v7",use:"filter-applied_24_v7-usage",viewBox:"0 0 24 24",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="filter-applied_24_v7"><path d="M21 4.5v2.7c0 .4-.2.8-.4 1.1l-3.3 3.3c-.3-.4-.8-.7-1.3-.9l3.5-3.5V4.5h-15v2.7l6 6v6.3h3v-3.4c.5.3 1 .4 1.5.4v3c0 .8-.7 1.5-1.5 1.5h-3c-.8 0-1.5-.7-1.5-1.5v-5.7L3.4 8.2c-.2-.2-.4-.6-.4-1V4.5C3 3.7 3.7 3 4.5 3h15c.8 0 1.5.7 1.5 1.5zM15 12c-.8 0-1.5.7-1.5 1.5S14.2 15 15 15s1.5-.7 1.5-1.5S15.8 12 15 12z" /></symbol>'});a.a.add(c),t.a=c},"27576b2afa5f5246a1df":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("0954d4278df8b67491fc"));t.default=i.a},"3865314c5959606874d4":function(t,r){t.exports=e}},["27576b2afa5f5246a1df"])}(r(15))},1676:function(e,t,r){"use strict";r.d(t,"a",function(){return u});var n,i=r(1),o=r.n(i),a=r(19),c=r(2),l=r(1023);var s=a.utils.requireAMD;var u=s({ace:"ace/noconflict/ace"})(n=s({lang:"ace/noconflict/ext-language_tools",mode:"ca-modeller/bridge/aceEditor/mode-modeler",theme:"ca-modeller/bridge/aceEditor/theme-modeler",themeHighContrast:"ca-modeller/bridge/aceEditor/theme-modelerHighContrast"},function(e){e.mode.setResources(c)},!0)(n=function(e){function t(){return e.apply(this,arguments)||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){return o.a.createElement(l.a,this.props)},t}(i.Component))||n)||n},1678:function(e,t,r){"use strict";r.d(t,"a",function(){return u});var n,i=r(1),o=r.n(i),a=r(19),c=r(2),l=r(1023);var s=a.utils.requireAMD;var u=s({ace:"ace/noconflict/ace"})(n=s({lang:"ace/noconflict/ext-language_tools",mode:"ca-modeller/bridge/aceEditor/mode-modeler-sql",theme:"ca-modeller/bridge/aceEditor/theme-modeler",themeHighContrast:"ca-modeller/bridge/aceEditor/theme-modelerHighContrast"},function(e){e.mode.setResources(c)},!0)(n=function(e){function t(){return e.apply(this,arguments)||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){return o.a.createElement(l.a,this.props)},t}(i.Component))||n)||n},1679:function(e,t,r){"use strict";r.d(t,"a",function(){return j});var n,i=r(1),o=r.n(i),a=r(16),c=r(19),l=r(25),s=r(3),u=r(1224),p=r.n(u),d=r(1680),g=r.n(d),f=r(1681),b=r.n(f),h=r(1682),v=r.n(h),m=r(5),y=r(2),O=r(63),E=r(828);function x(){return(x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var S=Object(s.treeItemDnD)(s.TreeItem,{dragItemType:O.a}),w=Object(s.treeDnD)(s.Tree),j=Object(s.withContext)("featureConfig")(n=Object(m.e)(function(e){return{functionListStore:e.functionListStore,selectFunction:e.functionListStore.selectFunction}})(n=Object(c.withErrorHandling)({errorProps:function(e){return{headerText:e.functionListStore.errorTitle,bodyText:e.functionListStore.errorDetails,tryAgain:e.initFunctionList}}})(n=Object(a.observer)(n=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this)._onFilterChange=function(e){(0,t.props.onFilterChange)(e)},t._isVisible=function(e,t){return!(!t.name||-1===t.name.toLowerCase().indexOf(e.trim().toLowerCase()))},t._canDragNode=function(e){return e.objectType===E.c.FUNCTION},t._onKeyDown=function(e){t._selectedFunction&&t.props.onDropAction&&39===e.keyCode&&e.shiftKey&&t.props.onDropAction(t._selectedFunction)},t._onSelectionChange=function(e,r){r[0].objectType===E.c.FUNCTION&&(t._selectedFunction=r[0],t.props.selectFunction(r[0]))},t._getIconId=function(e){switch(e){case E.d.OPERATOR:return b.a.id;case E.d.SUMMARY:return v.a.id;case E.d.LITERAL:return g.a.id;default:return p.a.id}},t._itemRenderer=function(e,r){return o.a.createElement(S,r,o.a.createElement(s.FlexLayout,{direction:"row","data-tid":Object(l.a)("FunctionTreeView","functionNode-"+e.id)},e.objectType===E.c.FUNCTION&&o.a.createElement(s.FlexItem,{gutter:[0,1,0,0]},o.a.createElement(s.SVGIcon,{size:"small",iconId:t._getIconId(e.type)})),o.a.createElement(s.FlexItem,null,o.a.createElement(s.TruncatedText,{value:e.name}))))},t._dragLayerRenderer=function(e){var r=e.items;return o.a.createElement(s.FlexLayout,{direction:"column"},r.map(function(e,r){return o.a.createElement(s.FlexLayout,{key:r},o.a.createElement(s.FlexItem,{gutter:[1,1,1,0]},o.a.createElement(s.SVGIcon,{iconId:t._getIconId(e.type),size:"small"})),o.a.createElement(s.FlexItem,{gutter:[1,1,1,0]},o.a.createElement(s.TruncatedText,{value:e.name||""})))}))},t._selectedFunction=void 0,t}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e;if(this.props.functionListStore&&this.props.functionListStore.isInitialized){var t=this.props,r=t.width,n=t.maxWidth,i=t.filter,a=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(t,["width","maxWidth","filter"]);e=o.a.createElement(s.FlexLayout,{fullHeight:!0,direction:"column","data-tid":"functionTreePane"},o.a.createElement(s.FlexItem,{gutter:[0]},o.a.createElement(s.SearchInput,{"data-tid":Object(l.a)("FunctionTreeView","functionSearch"),fullWidth:!0,placeholder:Object(y.getString)("search_box_default_text"),onChange:this._onFilterChange,delay:500,value:i})),o.a.createElement(s.FlexItem,{grow:!0},o.a.createElement(w,x({"data-tid":Object(l.a)("FunctionTreeView","functionTree"),selectionMode:"single",onSelectionChange:this._onSelectionChange,onKeyDown:this._onKeyDown,data:this.props.functionListStore.functionList,itemRenderer:this._itemRenderer,filter:i,isVisible:this._isVisible,dragLayerRenderer:this._dragLayerRenderer,canDragNode:this._canDragNode,width:r,maxWidth:n},a))))}else{if(this.props.functionListStore.errorTitle)throw new Error(this.props.functionListStore.errorTitle);e=o.a.createElement(c.ProgressPanelMessage,{variant:"bar"},Object(y.getString)("fetchingFunctions"))}return e},t}(i.Component))||n)||n)||n)||n},1680:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1157],{"08a1d3dca86d77eb77aa":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("54b9ae0b20fff66ca07d"));t.default=i.a},"3865314c5959606874d4":function(t,r){t.exports=e},"54b9ae0b20fff66ca07d":function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"function-constant-numeric_16_v7",use:"function-constant-numeric_16_v7-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="function-constant-numeric_16_v7"><path d="M14 1H2c-.5 0-1 .5-1 1v12c0 .6.4 1 1 1h12c.5 0 1-.4 1-.9V2c0-.6-.4-1-1-1zm0 13H2V2h12v12zm-8.6-2.1h1.1l.3-1.9h1.8l-.3 1.9h1l.3-1.9h1.3V9H9.8l.3-2h1.3V6h-1.1l.3-1.9h-1L9.2 6H7.4l.3-1.9h-1L6.4 6H5.1v1h1.1l-.3 2H4.6v1h1.1l-.3 1.9zM7.3 7h1.8l-.4 2H6.9l.4-2z" /></symbol>'});a.a.add(c),t.a=c}},["08a1d3dca86d77eb77aa"])}(r(15))},1681:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1151],{"3865314c5959606874d4":function(t,r){t.exports=e},b2d26cb909b28aa9ce79:function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"function-operators_16_v7",use:"function-operators_16_v7-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="function-operators_16_v7"><path d="M9 3.5h6v1H9v-1zM9 12h6v1H9v-1zm-3.2-2L4 11.8 2.2 10l-.7.7 1.8 1.8-1.8 1.8.7.7L4 13.2 5.8 15l.7-.7-1.8-1.8 1.8-1.8-.7-.7zM4.5 1h-1v2.5H1v1h2.5V7h1V4.5H7v-1H4.5V1zm8.2 9.7c0-.4-.3-.7-.7-.7s-.7.3-.7.7c0 .4.3.7.7.7.4 0 .7-.3.7-.7zm-.7 2.9c-.4 0-.7.3-.7.7s.3.7.7.7.7-.3.7-.7c0-.4-.3-.7-.7-.7z" /></symbol>'});a.a.add(c),t.a=c},e8b5732b7514659bf272:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("b2d26cb909b28aa9ce79"));t.default=i.a}},["e8b5732b7514659bf272"])}(r(15))},1682:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1148],{"1437ff68852026159a33":function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"function-summary_16_v7",use:"function-summary_16_v7-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="function-summary_16_v7"><path d="M11 12H5c-.3 0-.5-.2-.5-.5 0-.1 0-.2.1-.3L7.3 8 4.6 4.8c-.2-.2-.1-.5.1-.7.1-.1.2-.1.3-.1h6c.3 0 .5.2.5.5s-.2.5-.5.5H6.1l2.3 2.7c.2.2.2.5 0 .7L6.1 11H11c.3 0 .5.2.5.5s-.2.5-.5.5zm3-10H2v12h12V2m0-1c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H2c-.6 0-1-.4-1-1V2c0-.6.4-1 1-1h12z" /></symbol>'});a.a.add(c),t.a=c},"2d581fb57cc7392ebc47":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("1437ff68852026159a33"));t.default=i.a},"3865314c5959606874d4":function(t,r){t.exports=e}},["2d581fb57cc7392ebc47"])}(r(15))},1683:function(e,t,r){"use strict";r.d(t,"a",function(){return w});var n,i=r(1),o=r.n(i),a=r(16),c=r(5),l=r(3),s=r(25),u=r(1684),p=r.n(u),d=r(1685),g=r.n(d),f=r(776),b=r.n(f),h=r(1686),v=r.n(h),m=r(522),y=r.n(m),O=r(1687),E=r.n(O),x=r(2),S=r(68);var w=Object(c.e)(function(e){return{readOnly:e.readOnly,validating:e.validating,setFontSize:e.aceEditorStore.setFontSize,isEmptyExpression:e.isEmptyExpression,expressionToolbar:e.expressionToolbar,displayedPanel:e.displayedPanel,previewing:e.previewStore.previewing,selectedFontSize:e.aceEditorStore.selectedFontSize,fontSizes:e.aceEditorStore.fontSizes,handleToolBarAction:e.handleToolBarAction}})(n=Object(a.observer)(n=function(e){function t(){return e.apply(this,arguments)||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e=this.props,t=e.handleToolBarAction,r=e.setFontSize,n=e.readOnly,i=e.validating,a=e.isEmptyExpression,c=e.expressionToolbar,u=e.previewing,d=e.displayedPanel,f=e.selectedFontSize,h=e.fontSizes,m="EditorToolbarView";return o.a.createElement(l.Toolbar,{align:"right"},o.a.createElement(l.Button,{"data-tid":Object(s.a)(m,S.k.INFO),variant:"inline",title:Object(x.getString)("information"),"aria-label":Object(x.getString)("information"),onClick:function(){return t(S.k.INFO)},disabled:!c[S.k.INFO]},o.a.createElement(l.SVGIcon,{size:"normal",iconId:b.a.id,intent:d===S.b.INFO?"primary":""})),o.a.createElement(l.Toolbar.Spacer,{size:"medium"}),o.a.createElement(l.Button,{"data-tid":Object(s.a)(m,S.k.PREVIEW),variant:"inline",title:Object(x.getString)("preview"),"aria-label":Object(x.getString)("preview"),onClick:function(){return t(S.k.PREVIEW)},disabled:u||a},o.a.createElement(l.SVGIcon,{size:"normal",iconId:E.a.id,intent:d===S.b.PREVIEW?"primary":""})),o.a.createElement(l.Toolbar.Spacer,{size:"medium"}),o.a.createElement(l.Button,{"data-tid":Object(s.a)(m,S.k.VALIDATE),variant:"inline",title:Object(x.getString)("validate"),"aria-label":Object(x.getString)("validate"),disabled:i||n||a,onClick:function(){return t(S.k.VALIDATE)}},o.a.createElement(l.SVGIcon,{size:"normal",iconId:y.a.id,intent:d===S.b.VALIDATION?"primary":""})),o.a.createElement(l.Toolbar.Separator,{size:"medium"}),o.a.createElement(l.Button,{"data-tid":Object(s.a)(m,S.k.COMMENT),variant:"inline",title:Object(x.getString)("comment"),"aria-label":Object(x.getString)("comment"),onClick:function(){return t(S.k.COMMENT)},disabled:!c[S.k.COMMENT]||n},o.a.createElement(l.SVGIcon,{size:"normal",iconId:g.a.id})),o.a.createElement(l.Toolbar.Spacer,{size:"medium"}),o.a.createElement(l.Button,{"data-tid":Object(s.a)(m,S.k.PRETTIFY),variant:"inline",title:Object(x.getString)("prettify"),"aria-label":Object(x.getString)("prettify"),onClick:function(){return t(S.k.PRETTIFY)},disabled:!c[S.k.PRETTIFY]||n},o.a.createElement(l.SVGIcon,{size:"normal",iconId:p.a.id})),o.a.createElement(l.Toolbar.Spacer,{size:"medium"}),o.a.createElement(l.Button,{"data-tid":Object(s.a)(m,S.k.HIGH_CONTRAST),variant:"inline",title:Object(x.getString)("highContrast"),"aria-label":Object(x.getString)("highContrast"),onClick:function(){return t(S.k.HIGH_CONTRAST)},disabled:!c[S.k.HIGH_CONTRAST]},o.a.createElement(l.SVGIcon,{size:"normal",iconId:v.a.id})),o.a.createElement(l.Toolbar.Spacer,{size:"medium"}),o.a.createElement(l.Select,{"data-tid":Object(s.a)(m,"fontSize"),title:Object(x.getString)("setFontSize"),"aria-label":Object(x.getString)("setFontSize")+" "+f,customWidth:80,size:"small",selected:f,options:h,onChange:function(e){return r(e)}}))},t}(i.Component))||n)||n},1684:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1595],{"3865314c5959606874d4":function(t,r){t.exports=e},"771b8239a798c2a07ecc":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("a3dfb042d34c5521a62c"));t.default=i.a},a3dfb042d34c5521a62c:function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"code_32_v7",use:"code_32_v7-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="code_32_v7"><path d="M31 16l-7 7-1.41-1.41L28.17 16l-5.58-5.59L24 9l7 7zM1 16l7-7 1.41 1.41L3.83 16l5.58 5.59L8 23l-7-7zm11.419 9.484L17.639 6l1.932.518L14.35 26z" /><path style="fill:none" d="M0 32V0h32v32z" /></symbol>'});a.a.add(c),t.a=c}},["771b8239a798c2a07ecc"])}(r(15))},1685:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1671],{"30285bdf643c4bb726e9":function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"chat_32_v7",use:"chat_32_v7-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="chat_32_v7"><path d="M17.74 30L16 29l4-7h6a2 2 0 002-2V8a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2h9v2H6a4 4 0 01-4-4V8a4 4 0 014-4h20a4 4 0 014 4v12a4 4 0 01-4 4h-4.84z" /><path d="M8 10h16v2H8zm0 6h10v2H8z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});a.a.add(c),t.a=c},"3865314c5959606874d4":function(t,r){t.exports=e},"54a0f76188cdace66343":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("30285bdf643c4bb726e9"));t.default=i.a}},["54a0f76188cdace66343"])}(r(15))},1686:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1479],{"3865314c5959606874d4":function(t,r){t.exports=e},"55d82046b4a9ba5a5cfe":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("7a0d08689a4c0eff5b7f"));t.default=i.a},"7a0d08689a4c0eff5b7f":function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"contrast_32_v7",use:"contrast_32_v7-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="contrast_32_v7"><path d="M29.37 11.84a13.6 13.6 0 00-1.06-2.51A14.17 14.17 0 0025.9 6.1a14 14 0 100 19.8 14.17 14.17 0 002.41-3.23 13.6 13.6 0 001.06-2.51 14 14 0 000-8.32zM4 16A12 12 0 0116 4v24A12 12 0 014 16z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});a.a.add(c),t.a=c}},["55d82046b4a9ba5a5cfe"])}(r(15))},1687:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([73],{"1359c40e0655cef61c21":function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),i=r.n(n),o=r("9ce58a7deea14f49ef01"),a=r.n(o),c=new i.a({id:"view_32_v7",use:"view_32_v7-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="view_32_v7"><path d="M30.94 15.66A16.69 16.69 0 0016 5 16.69 16.69 0 001.06 15.66a1 1 0 000 .68A16.69 16.69 0 0016 27a16.69 16.69 0 0014.94-10.66 1 1 0 000-.68zM16 25c-5.3 0-10.9-3.93-12.93-9C5.1 10.93 10.7 7 16 7s10.9 3.93 12.93 9C26.9 21.07 21.3 25 16 25z" /><path d="M16 10a6 6 0 106 6 6 6 0 00-6-6zm0 10a4 4 0 114-4 4 4 0 01-4 4z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});a.a.add(c),t.a=c},"3865314c5959606874d4":function(t,r){t.exports=e},aef4f800a87168ca9744:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),i=(r.n(n),r("1359c40e0655cef61c21"));t.default=i.a}},["aef4f800a87168ca9744"])}(r(15))},1688:function(e,t,r){"use strict";r.d(t,"a",function(){return w});var n,i=r(1),o=r.n(i),a=r(738),c=r(16),l=r(5),s=r(25),u=r(3),p=r(17),d=r(156),g=r.n(d),f=r(242),b=r.n(f),h=r(96),v=r.n(h),m=r(8),y=r(1012),O=r(2),E=r(68);r(1689);var x=p.getContentLocale,S=p.getProductLocale,w=Object(l.e)(function(e){return{feedback:e.feedback,validating:e.validating,previewExecutionTime:e.previewStore.previewExecutionTime,previewData:e.previewStore.previewData,previewHeaders:e.previewStore.previewHeaders,previewQueryItems:e.previewStore.previewQueryItems,displayedPanel:e.displayedPanel,functionInfo:e.functionListStore.functionInfo,previewing:e.previewStore.previewing,closeFeedbackPanel:e.closeFeedbackPanel,handleToolBarAction:e.handleToolBarAction}})(n=Object(c.observer)(n=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this)._formatNonKeywords=function(e){var t=e.split(""),r=[],n="",i=function(){r.push(n),n=""},a=e.match(/\b(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])\b/),c=-1;return a&&(c=a.index,t.splice(a.index,a[0].length,a[0])),t.forEach(function(e,t){e.match(/\(|\)|,|\{|\}|\[|\]|=|\+|:|\*|\|/)&&t!==c?(i(),r.push(o.a.createElement("span",{className:"mui-editorOperator"},e))):e.match(/\r?\n/)?(i(),r.push(o.a.createElement("br",null))):n+=e}),n.length>0&&r.push(n),r},t._formatOperatorsAndKeywords=function(e,r){if(!r)return null;var n=[];return r.toLowerCase().split(e.toLowerCase()).forEach(function(r){n.push(t._formatNonKeywords(r)),n.push(o.a.createElement("span",{className:"mui-editorKeyword"},e))}),n.length>0&&n.pop(),o.a.createElement("span",{className:"mui-editorBoldText"},n)},t._renderSupportingInfo=function(e,r){return r&&r.length>0?r.map(function(r,n){var i=[];return r.example&&i.push(o.a.createElement(u.Container,{gutter:[2,0,0,0]},o.a.createElement("span",{className:"mui-editorBoldText"},r.example.title+": "),t._formatOperatorsAndKeywords(e,r.example.details))),r.result&&i.push(o.a.createElement(u.Container,null,o.a.createElement("span",{className:"mui-editorBoldText"},r.result.title+": "),r.result.details)),r.resultdata&&r.resultdata.length>0&&i.push(o.a.createElement(u.Container,{textAlign:"center",gutter:[2,2],"data-tid":Object(s.a)("EditorInformationPanelView","functionInfoExampleGrid"+n),height:"100%"},o.a.createElement(u.Grid,{numRows:r.resultdata.length,numColumns:Object(m.isArray)(r.resultdata[0])?r.resultdata[0].length:1,dataCellRenderer:function(e,t,n){return o.a.createElement(u.GridCell,n,o.a.createElement(u.Container,{textAlign:"center",width:"100%",gutter:[0,2]},Object(m.isArray)(r.resultdata[0])?r.resultdata[e][t]:r.resultdata[e]))},style:{border:"0px"},autoMeasureRowHeight:!0}))),i}):null},t._renderPreview=function(){var e=t.props,r=e.previewData,n=e.previewHeaders,i=e.previewQueryItems,c=x()||S();return o.a.createElement(u.FlexLayout,{direction:"column",fullHeight:!0},o.a.createElement(u.FlexItem,{height:"100%",textAlign:"center","data-tid":Object(s.a)("EditorInformationPanelView","previewGrid")},o.a.createElement(u.Container,{height:"100%",width:"100%",className:"bi-mui-editorInformationPanelView__tableContainer"},o.a.createElement(a.c,{locale:c,defaultLocale:c},o.a.createElement(u.Grid,{autoMeasureRowHeight:!0,numRows:r.length>0?r.length:0,numColumns:r.length>0?r[0].length:0,fixedRows:1,fixedRowCellRenderer:function(e,t,r){return o.a.createElement(u.GridHeaderCell,r,o.a.createElement(u.Container,{"data-tid":Object(s.a)("EditorInformationPanelView","gridHeaderCol"+t),textAlign:"center",gutter:[0,2],maxWidth:250,width:"100%"},o.a.createElement(u.TruncatedText,{textAlign:"center",value:n[t]})))},dataCellRenderer:function(e,t,n){return o.a.createElement(u.GridCell,n,o.a.createElement(u.Container,{"data-tid":Object(s.a)("EditorInformationPanelView","gridCell"+e+"_"+t),textAlign:"center",gutter:[0,2],maxWidth:250,width:"100%"},o.a.createElement(y.a,{value:null==r[e][t]?Object(O.getString)("null"):r[e][t],format:i[t].getFormat()})))},style:{border:"0px"}})))))},t}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e=this.props,t=e.closeFeedbackPanel,r=e.handleToolBarAction,n=e.feedback,i=e.validating,a=e.functionInfo,c=e.displayedPanel,l=e.previewing,p=e.previewExecutionTime,d="EditorInformationPanelView",f=o.a.createElement(u.FlexItem,{grow:!0,gutter:[1,2,2,2],"data-tid":Object(s.a)(d,"feedbackPanelValidation"),style:{whiteSpace:"pre-wrap"}},i&&o.a.createElement(u.ProgressIndicator,{variant:"circle",size:"small"}),n.length>0&&(n===Object(O.getString)("msgExpressionValid")||n===Object(O.getString)("msgHighlightedExpressionValid"))&&o.a.createElement(u.SVGIcon,{intent:"positive",size:"small",iconId:b.a.id}),n.length>0&&n!==Object(O.getString)("msgExpressionValid")&&n!==Object(O.getString)("msgHighlightedExpressionValid")&&o.a.createElement(u.SVGIcon,{intent:"danger",size:"small",iconId:g.a.id})," "+n),h=a?o.a.createElement(u.FlexItem,{grow:!0,gutter:[1,2,2,2],"data-tid":Object(s.a)(d,"feedbackPanelInfo")},a.syntax&&o.a.createElement(u.Container,{gutter:[1,0],"data-tid":Object(s.a)(d,"functionInfoSyntax")},this._formatOperatorsAndKeywords(a.name,a.syntax)),a.tip&&o.a.createElement(u.Container,{gutter:[1,0,0,0]},a.tip),this._renderSupportingInfo(a.name,a.supportingInfo)):null,m=o.a.createElement(u.FlexItem,{grow:!0,gutter:[1,2,2,2],"data-tid":Object(s.a)(d,"feedbackPanelPreview")},l&&o.a.createElement(u.Container,{width:"100%",textAlign:"center"},o.a.createElement(u.ProgressIndicator,{variant:"circle",size:"large"})),!l&&this._renderPreview());return o.a.createElement(u.FlexLayout,{tabIndex:0,fullHeight:!0,direction:"column"},o.a.createElement(u.FlexLayout,{direction:"row"},o.a.createElement(u.FlexItem,{grow:!0,className:"mui-editorBoldText",gutter:[2,2,1,2],"data-tid":Object(s.a)(d,"feedbackPanelTitle")},c===E.b.VALIDATION&&Object(O.getString)("validationResults"),c===E.b.INFO&&Object(O.getString)("information"),c===E.b.PREVIEW&&o.a.createElement(u.FlexLayout,null,o.a.createElement(u.FlexItem,null,Object(O.getString)("preview")),!l&&p&&0!==p.executionTime&&o.a.createElement(u.FlexItem,{gutter:[0,0,0,1],className:"mui-editorNormalText"},Object(O.getString)("previewExecutionTime",{value:p.executionTime})))),c===E.b.PREVIEW&&o.a.createElement(u.FlexItem,{gutter:[2,2,1,2]},o.a.createElement(u.Button,{"data-tid":Object(s.a)(d,"refreshPreview"),variant:"inline",label:Object(O.getString)("refresh"),title:Object(O.getString)("refresh"),"aria-label":Object(O.getString)("refresh"),icon:v.a.id,onClick:function(){return r(E.k.PREVIEW)},disabled:l})),o.a.createElement(u.FlexItem,{gutter:[2,2,1,2]},o.a.createElement(u.Button,{"data-tid":Object(s.a)(d,"closeFeedbackPanel"),variant:"inline",title:Object(O.getString)("close"),"aria-label":Object(O.getString)("closeInformationPanel"),onClick:t},o.a.createElement(u.SVGIcon,{size:"small",iconId:g.a.id})))),c===E.b.VALIDATION&&f,c===E.b.INFO&&h,c===E.b.PREVIEW&&m)},t}(i.Component))||n)||n},1689:function(e,t,r){var n=r(1690);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0};r(36)(n,i);n.locals&&(e.exports=n.locals)},1690:function(e,t,r){(e.exports=r(32)(void 0)).push([e.i,".bi-mui-editorInformationPanelView__tableContainer{border:1px solid #c0bfc0}",""])},1691:function(e,t,r){var n=r(1692);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0};r(36)(n,i);n.locals&&(e.exports=n.locals)},1692:function(e,t,r){(e.exports=r(32)(void 0)).push([e.i,".mui-editorViewBorder{border:2px solid #eaeaea}.mui-editorViewPanel{padding:8px 8px 0;height:100%;width:100%}.mui-editorBoldText{font-weight:700}.mui-editorNormalText{font-weight:400}.mui-editorKeyword{color:#2d74da}.mui-editorOperator{color:#f00080}.ba-theme-default .mui-editorViewTabs .ba-common-tabList.is-vertical .ba-common-tabList__item.is-selected{background-color:#fff}",""])},1693:function(e,t,r){"use strict";r.d(t,"a",function(){return N});var n,i,o,a,c,l,s,u,p,d,g,f,b,h=r(1694),v=r.n(h),m=r(0),y=r.n(m),O=r(6),E=r(2),x=r(5),S=r(8),w=r(29),j=r(4),T=r(188),C=r(27),L=r(9),_=r(68),I=r(1698),A=r(1702),P=r(1226),F=r(1709),M=r(1710),k=r(1711),z=r(1713);function D(){return(D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Q(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function U(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e,t,r,n,i){var o={};return Object.keys(n).forEach(function(e){o[e]=n[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}var N=(n=x.c.undoable(Object(E.getString)("modifySQLType")),i=x.c.undoable(Object(E.getString)("modifySQLSource")),o=function(e){function t(t,r){var n,i=void 0===r?{}:r,o=i.forceGlobal,h=void 0!==o&&o,v=i.mode,m=void 0===v?_.g:v,y=i.calculateAfterAggregation,O=void 0===y?void 0:y,E=i.expression,x=void 0===E?null:E,S=i.label,j=void 0===S?"":S,T=i.existingCalc,L=void 0===T?null:T,I=i.localScope,A=void 0===I?null:I,P=i.querySubjectUsage,F=void 0===P?void 0:P;return Q(n=e.apply(this,arguments)||this,"searchInputValue",a,V(n)),Q(n,"_feedback",c,V(n)),Q(n,"label",l,V(n)),Q(n,"expression",s,V(n)),n.readOnly=!1,n.existingCalc=null,n.localScope=void 0,n.forceGlobal=!1,n.mode=void 0,n._originalExpression="",n._originalLabel="",Q(n,"selectedPanelTab",u,V(n)),Q(n,"selection",p,V(n)),Q(n,"expressionToolbar",d,V(n)),Q(n,"displayedPanel",g,V(n)),Q(n,"contentHeight",f,V(n)),Q(n,"highContrastMode",b,V(n)),n.isDragging=!1,n._calculateAfterAggregation=void 0,n.querySubjectUsage=void 0,n.existingCalc=L,n.forceGlobal=h,n.localScope=A||(n.existingCalc?Object(C.getParentForExpression)([n.existingCalc],h):n.provider.getModule()),n.contentHeight=window.innerHeight>750?window.innerHeight-250:500,n.mode=m||_.g,n.label=j||n.defaultCalculationName(),n.readOnly=n.existingCalc&&Object(w.e)([n.existingCalc]),n.existingCalc&&(n._originalExpression=n.expression="getExpression"in n.existingCalc?n.existingCalc.getExpression():x,n.existingCalc.getLabel&&(n.label=n._originalLabel=n.existingCalc.getLabel())),null!=x&&(n.expression=x),n._calculateAfterAggregation=O,n.querySubjectUsage=F,n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.defaultCalculationName=function(){return this.mode===_.g?Object(E.getString)("newExpressionName"):this.mode===_.h?Object(E.getString)("newSQLExpressionName"):this.mode===_.f||this.mode===_.e?Object(E.getString)("newFilterName"):""},r.updateExpression=function(e){this.expression=e},r.updateLabel=function(e,t){t?this.label===this.defaultCalculationName()&&(this.label=(""+this.labelPrefix+e).substring(0,20)):this.label=e},r.insertIntoEditor=function(e,t){Object(S.isArray)(e)&&e.every(function(e){return y.a.isMoserObject(e)})&&this.updateLabel(e.map(function(e){return e.getLabel()}).slice(0,2).join("_"),!0),this.aceEditorStore.insertIntoEditor(e,t)},r.onTextSelectionChange=function(){},r.setMoserObjectTreeIsDragging=function(e){this.isDragging=e},r.setComponentTab=function(e){this.selectedPanelTab=e,e!==_.c||this.functionListStore.isInitialized||this.functionListStore.initFunctionList()},r.closeFeedbackPanel=function(){this.displayedPanel=null},r.resizeEditor=function(){this.aceEditorStore.resizeEditor()},r.handleToolBarAction=function(e){switch(e){case _.k.INFO:this.displayedPanel=_.b.INFO;break;case _.k.PREVIEW:this.displayedPanel=_.b.PREVIEW,this.mode===_.h?this.previewStore.previewSQLData():this.mode===_.f||this.mode===_.e?this.previewStore.previewFilterData():this.previewStore.previewExpressionData();break;case _.k.VALIDATE:this.displayedPanel=_.b.VALIDATION,this.validateExpression();break;case _.k.COMMENT:this.aceEditorStore.toggleCommentLines();break;case _.k.PRETTIFY:this.aceEditorStore.setText(Object(I.a)(this.aceEditorStore.getTokens({removeWhiteSpace:!1,trimTokens:!1})));break;case _.k.HIGH_CONTRAST:this.highContrastMode=!this.highContrastMode,this.aceEditorStore.toggleHighContrast(this.highContrastMode)}},r.createOrUpdateExpression=function(){return this.modeStore.createOrUpdateExpression()},r.validateExpression=function(){return this.modeStore.validateExpression()},r.changeSelectedSQLType=function(e){this.mode===_.h&&this.modeStore.changeSelectedSQLType(e)},r.changeSelectedSQLSource=function(e){this.mode===_.h&&this.modeStore.changeSelectedSQLSource(e)},r.setCalculateAfterAggregation=function(e){this.mode===_.g&&this.modeStore.setCalculateAfterAggregation(e)},r.setSearchInputValue=function(e){this.searchInputValue=e},r.showExpressionTreeContextMenu=function(e,t,r){var n=this;this.provider.showContextMenu(this,"expressionTree",{selection:Object.keys(this.treeStore.selected).map(function(e){return n.treeStore.selected[e]}),module:this.module,activeElement:r},e,t)},function(e,t,r){t&&U(e.prototype,t),r&&U(e,r)}(t,[{key:"functionListStore",get:function(){var e=this;return new A.a({addFunctionsToEditorAutoCompletion:function(t){return e.aceEditorStore.addFunctionsToEditorAutoCompletion(t)}})}},{key:"aceEditorStore",get:function(){var e=this;return new P.a({getIsDragging:function(){return e.isDragging},getColumns:function(){return e.columns},getTreeFilter:function(){return e.treeFilter},setMoserObjectTreeExpandedMap:function(t,r,n){return e.treeStore.setExpandedNodes(t,r,n)},setMoserObjectTreeSelectedMap:function(t){return e.treeStore.setSelected(t)}},{mode:this.mode,readOnly:this.readOnly,functionListStore:this.functionListStore,scope:this.scope})}},{key:"previewStore",get:function(){var e=this;return new F.a({getExpression:function(){return e.aceEditorStore.getSelectedText()||e.expression},getSelectedText:function(){return e.aceEditorStore.getSelectedText()},getCalculateAfterAggregation:function(){return e.modeStore.calculateAfterAggregation},getExpressionIdentifiers:function(){return e.aceEditorStore.getExpressionIdentifiers()},getColumns:function(){return e.columns},getLabel:function(){return e.label},setDisplayedPanel:function(t){return e.displayedPanel=t},setFeedback:function(t){return e.feedback=t},getSelectedSQLSource:function(){return e.selectedSQLSource},getSelectedSQLType:function(){return e.selectedSQLType},getModule:function(){return e.provider.getModule()}},{mode:this.mode,existingCalc:this.existingCalc,previewTarget:this.isCreateMode?this.scope:this.existingCalc,querySubjectUsage:this.querySubjectUsage})}},{key:"modeStore",get:function(){var e=this,t={setFeedback:function(t){return e.feedback=t},getLabel:function(){return e.label},getExpression:function(){return e.expression},getSelectedText:function(){return e.aceEditorStore.getSelectedText()},getModuleId:function(){return e.provider.getModuleId()},saveGlobalSessionModule:function(){return e.provider.saveGlobalSessionModule()}},r={scope:this.scope,calcIsUpdatable:this.calcIsUpdatable,container:this.container,localScope:this.localScope,existingCalc:this.existingCalc};return this.mode===_.g?new M.a(t,D({calculateAfterAggregation:this._calculateAfterAggregation},r)):this.mode===_.h?new z.a(t,r):this.mode===_.e||this.mode===_.f?new k.a(t,D({embedded:this.mode===_.e},r)):null}},{key:"treeStore",get:function(){return this.memberSearchableTreeStore.treeStore}},{key:"memberSearchableTreeStore",get:function(){var e=this;return new T.a({getSelection:function(){return e.selection},setSelection:function(t){return e.selection=t},openNavigationGroupDialog:function(){return Promise.resolve()},showContextMenu:function(t,r,n){return e.showExpressionTreeContextMenu(t,r,n)}})}},{key:"columns",get:function(){return Object(C.getExpressionColumns)(this.scope,this.treeFilter,this.context)}},{key:"shouldEnableSQLTypeSelection",get:function(){return this.modeStore.shouldEnableSQLTypeSelection||!1}},{key:"treeFilter",get:function(){var e,t=y.a.MoserObjectTypes,r=t.QUERY_ITEM,n=t.CALCULATION,i=t.FILTER,o=t.QUERY_SUBJECT,a=t.FOLDER,c=this.existingCalc;if((this.mode===_.g||this.mode===_.f||this.mode===_.e)&&c&&this.readOnly){var l=c.getIdentifier();c.getObjectType()===r||c.getObjectType()===i&&Object(j.getAncestorOrSelf)(this.localScope,o)?e=function(e){return!e||("function"==typeof e.getQueryItem&&e.getQueryItem()?e.getQueryItem().getIdentifier()!==l:(e.getObjectType()===r||e.getObjectType()===a)&&e.getIdentifier()!==l)}:c.getObjectType()!==n&&c.getObjectType()!==i||(e=function(e){return!e||e.getObjectType()!==n&&e.getObjectType()!==i||e.getIdentifier()!==l})}return e}},{key:"scope",get:function(){var e=this.existingCalc||this.localScope,t=Object(j.getAncestorOrSelf)(e,y.a.MoserObjectTypes.QUERY_SUBJECT);return!t||t.getInstanceType()===y.a.InstanceType.REFERENCE&&!t.isImported()||Object(j.isPartOfPackage)(t)?Object(j.getModule)(e):t}},{key:"isCreateMode",get:function(){return!this.existingCalc}},{key:"isEmptyExpression",get:function(){return 0===v()(this.expression).length}},{key:"dirty",get:function(){return this.label.length>0&&!this.isEmptyExpression&&(this.isCreateMode||this._originalLabel!==this.label||this.modeStore.dirty||this._originalExpression!==this.expression)}},{key:"feedback",get:function(){return this.aceEditorStore.getSelectedText()===this.lastValidatedExpression||this.expression===this.lastValidatedExpression?this._feedback:""},set:function(e){this._feedback=e}},{key:"identifier",get:function(){return this.scope.getIdentifier()}},{key:"container",get:function(){return Object(C.getParentForExpressionOrSelf)(this.localScope,this.forceGlobal)}},{key:"calcIsUpdatable",get:function(){return!this.isCreateMode&&(Object(S.isQuerySubjectOfExtendedType)(this.existingCalc,L.p)||this.existingCalc.getObjectType()===y.a.MoserObjectTypes.QUERY_ITEM||this.existingCalc.getObjectType()===y.a.MoserObjectTypes.CALCULATION)}},{key:"labelPrefix",get:function(){return this.mode===_.g?"C_":this.mode===_.f||this.mode===_.e?"F_":""}},{key:"sqlTypes",get:function(){return this.modeStore.sqlTypes}},{key:"sqlSources",get:function(){return this.modeStore.sqlSources}},{key:"defaultSQLType",get:function(){return this.modeStore.defaultSQLType||null}},{key:"selectedSQLSource",get:function(){return this.modeStore.selectedSQLSource}},{key:"selectedSQLType",get:function(){return this.modeStore.selectedSQLType}},{key:"isCalculateAfterAggregation",get:function(){return this.modeStore.calculateAfterAggregation}},{key:"showCalculateAfterAggregation",get:function(){return this.modeStore.showCalculateAfterAggregation}},{key:"validateAfterUpdate",get:function(){return this.modeStore.validateAfterUpdate||!1}},{key:"module",get:function(){return this.provider.getModule()}},{key:"withError",get:function(){return this.modeStore.withError}},{key:"lastValidatedExpression",get:function(){return this.modeStore.lastValidatedExpression}},{key:"saving",get:function(){return this.modeStore.saving}},{key:"validating",get:function(){return this.modeStore.validating}}]),t}(x.a),a=R(o.prototype,"searchInputValue",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),c=R(o.prototype,"_feedback",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),l=R(o.prototype,"label",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),s=R(o.prototype,"expression",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),u=R(o.prototype,"selectedPanelTab",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),p=R(o.prototype,"selection",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),d=R(o.prototype,"expressionToolbar",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e;return(e={})[_.k.INFO]=!0,e[_.k.PREVIEW]=!0,e[_.k.VALIDATE]=!0,e[_.k.COMMENT]=!0,e[_.k.PRETTIFY]=!0,e[_.k.HIGH_CONTRAST]=!0,e}}),g=R(o.prototype,"displayedPanel",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return _.b.INFO}}),f=R(o.prototype,"contentHeight",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 500}}),b=R(o.prototype,"highContrastMode",[O.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),R(o.prototype,"functionListStore",[x.k],Object.getOwnPropertyDescriptor(o.prototype,"functionListStore"),o.prototype),R(o.prototype,"aceEditorStore",[x.k],Object.getOwnPropertyDescriptor(o.prototype,"aceEditorStore"),o.prototype),R(o.prototype,"previewStore",[x.k],Object.getOwnPropertyDescriptor(o.prototype,"previewStore"),o.prototype),R(o.prototype,"modeStore",[x.k],Object.getOwnPropertyDescriptor(o.prototype,"modeStore"),o.prototype),R(o.prototype,"memberSearchableTreeStore",[x.k],Object.getOwnPropertyDescriptor(o.prototype,"memberSearchableTreeStore"),o.prototype),R(o.prototype,"columns",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"columns"),o.prototype),R(o.prototype,"shouldEnableSQLTypeSelection",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"shouldEnableSQLTypeSelection"),o.prototype),R(o.prototype,"treeFilter",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"treeFilter"),o.prototype),R(o.prototype,"isCreateMode",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"isCreateMode"),o.prototype),R(o.prototype,"isEmptyExpression",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"isEmptyExpression"),o.prototype),R(o.prototype,"dirty",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"dirty"),o.prototype),R(o.prototype,"container",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"container"),o.prototype),R(o.prototype,"calcIsUpdatable",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"calcIsUpdatable"),o.prototype),R(o.prototype,"updateExpression",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"updateExpression"),o.prototype),R(o.prototype,"labelPrefix",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"labelPrefix"),o.prototype),R(o.prototype,"updateLabel",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"updateLabel"),o.prototype),R(o.prototype,"insertIntoEditor",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"insertIntoEditor"),o.prototype),R(o.prototype,"onTextSelectionChange",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"onTextSelectionChange"),o.prototype),R(o.prototype,"setMoserObjectTreeIsDragging",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"setMoserObjectTreeIsDragging"),o.prototype),R(o.prototype,"setComponentTab",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"setComponentTab"),o.prototype),R(o.prototype,"closeFeedbackPanel",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"closeFeedbackPanel"),o.prototype),R(o.prototype,"resizeEditor",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"resizeEditor"),o.prototype),R(o.prototype,"handleToolBarAction",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"handleToolBarAction"),o.prototype),R(o.prototype,"createOrUpdateExpression",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"createOrUpdateExpression"),o.prototype),R(o.prototype,"validateExpression",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"validateExpression"),o.prototype),R(o.prototype,"changeSelectedSQLType",[n],Object.getOwnPropertyDescriptor(o.prototype,"changeSelectedSQLType"),o.prototype),R(o.prototype,"changeSelectedSQLSource",[i],Object.getOwnPropertyDescriptor(o.prototype,"changeSelectedSQLSource"),o.prototype),R(o.prototype,"sqlTypes",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"sqlTypes"),o.prototype),R(o.prototype,"sqlSources",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"sqlSources"),o.prototype),R(o.prototype,"defaultSQLType",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"defaultSQLType"),o.prototype),R(o.prototype,"selectedSQLSource",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"selectedSQLSource"),o.prototype),R(o.prototype,"selectedSQLType",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"selectedSQLType"),o.prototype),R(o.prototype,"isCalculateAfterAggregation",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"isCalculateAfterAggregation"),o.prototype),R(o.prototype,"showCalculateAfterAggregation",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"showCalculateAfterAggregation"),o.prototype),R(o.prototype,"validateAfterUpdate",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"validateAfterUpdate"),o.prototype),R(o.prototype,"setCalculateAfterAggregation",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"setCalculateAfterAggregation"),o.prototype),R(o.prototype,"module",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"module"),o.prototype),R(o.prototype,"withError",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"withError"),o.prototype),R(o.prototype,"lastValidatedExpression",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"lastValidatedExpression"),o.prototype),R(o.prototype,"saving",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"saving"),o.prototype),R(o.prototype,"validating",[O.computed],Object.getOwnPropertyDescriptor(o.prototype,"validating"),o.prototype),R(o.prototype,"setSearchInputValue",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"setSearchInputValue"),o.prototype),R(o.prototype,"showExpressionTreeContextMenu",[x.c],Object.getOwnPropertyDescriptor(o.prototype,"showExpressionTreeContextMenu"),o.prototype),o)},1694:function(e,t,r){var n=r(503),i=r(514),o=r(1024),a=r(1225),c=r(1695),l=r(1025),s=r(261);e.exports=function(e,t,r){if((e=s(e))&&(r||void 0===t))return i(e);if(!e||!(t=n(t)))return e;var u=l(e),p=l(t),d=c(u,p),g=a(u,p)+1;return o(u,d,g).join("")}},1695:function(e,t,r){var n=r(500);e.exports=function(e,t){for(var r=-1,i=e.length;++r<i&&n(t,e[r],0)>-1;);return r}},1698:function(e,t,r){"use strict";r.d(t,"a",function(){return m});var n=r(1699),i=r.n(n),o=r(1700),a=r.n(o),c=r(828),l=r(68);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var u="paren.lparen",p="paren.rparen",d=[{keyword:"select",suffix:["distinct","all"]},{keyword:"from"},{keyword:"where"},{keyword:"order",suffix:["by"]},{keyword:"group",suffix:["by"]},{keyword:"having"}],g=["and","case","end","or","inner","left","right","full","union"],f=["then","else","on","when","over","using"],b=["join"],h=function(e){return d.find(function(t){return t.keyword===e.toLowerCase()})},v=function(e){return d.find(function(t){return t.suffix&&t.suffix.indexOf(e.toLowerCase())>-1})},m=function(e){for(var t=[""],r=[],n=0,o=0,d=function(e){void 0===e&&(e=!0),n+=1,t.push(""),e&&(t[n]+=a()(" ",o))},m=function(){return o+=4},y=function(){return o-=4},O=function(t){return t<e.length?e[t+1]:null},E=function(t){return t>0?e[t-1]:null},x=function(){return t[n].length===o},S=function(){return t[n].length>o},w=function(r){for(var i=r+1,o=t[n].length;i<=e.length&&e[i].type!==p;){if((o+=e[i].value.length+1)>80)return!0;i+=1}return o>80},j=function(t){var r=[],n="",i=0,o=t+1,a=!1;for(n+=e[t].value,r.push(e[t]);!a&&o<e.length;){var c=e[o];if(n+=c.value,i+=1,c.type===p&&"]"===c.value){r.pop();var l=O(o);l&&l.type===p&&"]"===l.value&&(n+="]",i+=1,o+=1),0===r.length&&(n+=" ",a=!0)}else c.type===u&&"["===c.value&&r.push(c);o+=1}return{incrementIndex:i,uniqueIdentifier:n}},T=0;T<e.length;T++){var C=s({},e[T],{value:e[T].value.trim()}),L=h(C.value);if(L&&"from"===C.value.toLowerCase()){for(var _=[],I=T,A=!1;I>=0&&E(I);){if(E(I).type===u){if(!(_.length>0))break;_.pop()}else"select"===E(I).value.toLowerCase()?A=!0:E(I).type===p&&_.push(E(I));I-=1}A||(L=null)}if(l.d.indexOf(C.type)>-1)"comment-block"!==C.type&&"macro-block"!==C.type||!O(T)||"comment-block"!==O(T).type&&"macro-block"!==O(T).type?"macro-block.end"===C.type?(t[n]=(!x()&&i()(t[n]))+" "+C.value+" ",S()&&d(O(T)&&"macro-block.start"!==O(T).type)):"comment"===C.type?(t[n]+=""+C.value,O(T)&&h(O(T).value)&&y(),d()):"macro-block.start"===C.type||"comment-block.start"===C.type||"comment-block"===C.type?t[n]+=""+C.value:t[n]+=C.value+" ":(t[n]+=""+C.value,S()&&d(!1));else if(L){if(!x()&&E(T)&&E(T).type!==u&&(y(),d()),t[n]+=C.value.toUpperCase()+" ",L.suffix&&O(T))for(var P=L.suffix.indexOf(O(T).value.toLowerCase());P>-1;)t[n]+=O(T).value.toUpperCase()+" ",T+=1,P=L.suffix.indexOf(O(T).value.toLowerCase());m(),d()}else if(","===C.value)t[n]=""+i()(t[n])+C.value,r.length>0&&!r[r.length-1].shouldStartNewLine?t[n]+=" ":d();else if(g.indexOf(C.value.toLowerCase())>-1)S()&&d(),t[n]+=C.value.toUpperCase()+" ";else if(f.indexOf(C.value.toLowerCase())>-1)m(),S()&&d(),t[n]+=C.value.toUpperCase()+" ",y();else if(b.indexOf(C.value.toLowerCase())>-1)t[n]+=C.value.toUpperCase(),r.length>0&&!r[r.length-1].shouldStartNewLine?t[n]+=" ":d();else if(C.type===u){if("["===C.value){var F=j(T),M=F.incrementIndex,k=F.uniqueIdentifier;t[n]+=k,T+=M}else if(t[n]+=C.value+" ",E(T))if(h(E(T).value)||h(O(T).value)||v(E(T).value)&&h(E(T-1).value)||w(T)){var z="select"!==O(T).value.toLowerCase();z&&m(),r.push({shouldStartNewLine:!0,indent:o,increasedIndent:z})}else r.push({shouldStartNewLine:!1,indent:o})}else if(C.type===p){var D=r.pop();if(D&&(o=D.indent,D.shouldStartNewLine)){var Q=O(T)&&O(T).value.toLowerCase(),U=Q&&(g.indexOf(Q)>-1||f.indexOf(Q)>-1);D.increasedIndent&&y(),!U&&d()}t[n]+=C.value+" "}else C.type===c.b||"keyword"===C.type?t[n]+=C.value.toUpperCase()+" ":"."===C.value?t[n]=""+i()(t[n])+C.value:C.value&&(t[n]+=C.value+" ")}return x()&&t.pop(),t.map(function(e){return i()(e)}).join("\n")}},1699:function(e,t,r){var n=r(503),i=r(1024),o=r(1225),a=r(1025),c=r(261),l=r(515);e.exports=function(e,t,r){if((e=c(e))&&(r||void 0===t))return e.slice(0,l(e)+1);if(!e||!(t=n(t)))return e;var s=a(e),u=o(s,a(t))+1;return i(s,0,u).join("")}},1700:function(e,t,r){var n=r(1701),i=r(501),o=r(267),a=r(261);e.exports=function(e,t,r){return t=(r?i(e,t,r):void 0===t)?1:o(t),n(a(e),t)}},1701:function(e,t){var r=9007199254740991,n=Math.floor;e.exports=function(e,t){var i="";if(!e||t<1||t>r)return i;do{t%2&&(i+=e),(t=n(t/2))&&(e+=e)}while(t);return i}},1702:function(e,t,r){"use strict";r.d(t,"a",function(){return x});var n,i,o,a,c,l,s,u,p=r(6),d=r(5),g=r(1703),f=r(33),b=r(2),h=r(1704),v=r(828);function m(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e,t,r,n,i){var o={};return Object.keys(n).forEach(function(e){o[e]=n[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}var x=(n=p.observable.ref,u=s=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return m(t=e.call.apply(e,[this].concat(n))||this,"functionInfo",o,O(t)),m(t,"isInitialized",a,O(t)),m(t,"errorTitle",c,O(t)),m(t,"errorDetails",l,O(t)),t._functionList=void 0,t._flatFunctionList=void 0,t._functionNamesList=void 0,t.findChildren=function(e,r){e&&e.children&&e.children.forEach(function(e){e&&e.objectType===v.c.FUNCTION&&e.name&&(!r.find(function(t){return t.name===e.name})&&r.push(e));t.findChildren(e,r)})},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.storeDidMount=function(){this.initFunctionList()},r.getFunctionByName=function(e){return this.flatFunctionList&&this.flatFunctionList.find(function(t){return t.name.toLowerCase()===e.toLowerCase()})},r.selectFunction=function(e){this.functionInfo=e},r.initFunctionList=function(){var e=this;this.isInitialized=!1,this.errorTitle=null,this.errorDetails=null,Object(g.a)(this.context,{moduleId:this.provider.getModuleId()}).then(function(t){var r=Object(h.a)(t.listOfFunctions);e.action(function(){e.functionListTreeData=r,e.provider.addFunctionsToEditorAutoCompletion(function(t){var r=e.getFunctionByName(t.trim());r&&e.selectFunction(r)})})},function(t){return e.action(function(){e.errorTitle=Object(b.getString)("fetchingFunctionsFailed"),e.errorDetails=t&&Object(f.a)(t)||Object(b.getString)("fetchingFunctionsFailedDetails")})})},function(e,t,r){t&&y(e.prototype,t),r&&y(e,r)}(t,[{key:"functionListTreeData",set:function(e){var t=(e[v.a.QUERY_FUNCTIONS]||[]).filter(function(e){return-1===["mem_summaries","block_functions","dimensional"].indexOf(e.id)});this._functionList=t.concat(e[v.a.MACRO_FUNCTIONS]),this.isInitialized=!0}},{key:"functionList",get:function(){return this._functionList}},{key:"flatFunctionList",get:function(){var e=this;return this._flatFunctionList||(this._flatFunctionList=[],this._functionList.forEach(function(t){return e.findChildren(t,e._flatFunctionList)})),this._flatFunctionList}},{key:"functionNamesList",get:function(){var e=this;return this._functionNamesList||(this._functionNamesList=[],this.flatFunctionList.forEach(function(t){return e._functionNamesList.push(t.name)})),this._functionNamesList}}]),t}(d.a),s.defaultProvider={addFunctionsToEditorAutoCompletion:function(){}},o=E((i=u).prototype,"functionInfo",[n],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),a=E(i.prototype,"isInitialized",[p.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),c=E(i.prototype,"errorTitle",[p.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),l=E(i.prototype,"errorDetails",[p.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),E(i.prototype,"selectFunction",[d.c],Object.getOwnPropertyDescriptor(i.prototype,"selectFunction"),i.prototype),E(i.prototype,"initFunctionList",[d.c],Object.getOwnPropertyDescriptor(i.prototype,"initFunctionList"),i.prototype),i)},1703:function(e,t,r){"use strict";var n=r(18);t.a=function(e,t){var r=t.moduleId;return e.ajaxService({url:n.i+"/base_modules/"+r+"/metadata/functionList",method:"GET"})}},1704:function(e,t,r){"use strict";r.d(t,"a",function(){return d});var n=r(91),i=r.n(n),o=r(1705),a=r(8),c=r(30),l=r(828);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var u=0,p=function e(t,r){var n,o=function(t){var n=t[l.c.FUNCTION],o=t[l.c.GROUP],a=n||o?l.c.FOLDER:l.c.FUNCTION,p=s({},t.attributes,{id:t.attributes?t.attributes.id:function(e){return e+"_"+(u+=1)}(a),parent:r,children:[],objectType:a,getDropText:function(){if(!this.dropText||0===this.dropText.length)return this.name+" (\t)";switch(this.dropText){case"@date":return i()().format(Object(c.n)(c.c));case"@time":return i()().format(Object(c.n)(c.l));case"@date-time":case"@dateTime":return i()().format(Object(c.n)(c.d));case"@interval":return Object(c.n)(c.g);default:return this.dropText}}}),d=!1;return Object.keys(t).forEach(function(e){e.indexOf(".")>-1?d=!0:!p[e]&&t[e]["#text"]&&(p[e]=t[e]["#text"])}),d&&function(e,t){var r=Object.keys(e).filter(function(e){return e.indexOf(".")>-1});if(r.length>0){var n=[];r.forEach(function(t){var r=t.split("."),i=r[0],o=r[1],a=[];if(n.length<o&&n.push({}),"example"===i||"result"===i){var c=e[t]["#text"].split(/:(.+)/),l=c[0],s=c[1];n[o-1][i]={title:l,details:s}}else if("resultdata"===i){var u=e[t]["#text"].split("\n");u.length>2&&(""===u[0]&&u[2].split("-").length>5?(u.splice(2,1),u.splice(0,1),u.forEach(function(e){return a.push(e.split("\t"))})):a=u),n[o-1][i]=a}}),t.supportingInfo=n}}(t,p),a===l.c.FUNCTION&&t.attributes&&t.attributes.qosLevel===l.e.UNAVAILABLE?null:(o&&(p.children=p.children.concat(e(o,p))),n&&(p.children=p.children.concat(e(n,p))),0===p.children.length&&delete p.children,p)};if(Object(a.isArray)(t))n=[],t.forEach(function(e){var t=o(e);null!==t&&n.push(t)});else{var p=o(t);null!==p&&(n=p)}return n},d=function(e){var t=[];return((Object(o.b)(Object(o.a)(e))||{}).ResponseRoot||[]).forEach(function(e){if(e.functionsRoot&&e.functionsRoot.group&&e.functionsRoot.group.group){var r=p(e.functionsRoot.group.group,null);t.push(Object(a.isArray)(r)?r:[r])}}),t}},1705:function(e,t,r){"use strict";r.d(t,"a",function(){return l}),r.d(t,"b",function(){return s});var n=r(509),i=r.n(n),o=1,a=3,c=9,l=function(e){return e&&"string"==typeof e?(new window.DOMParser).parseFromString(e,"text/xml"):null},s=function e(t){if(!t)return null;var r={};if(t.nodeType===o){if(t.attributes&&t.attributes.length>0){r.attributes={};for(var n=0;n<t.attributes.length;n++){var l=t.attributes.item(n);r.attributes[l.nodeName]=l.nodeValue}}}else t.nodeType===a?r=t.nodeValue:t.nodeType===c&&(r=e(t.documentElement));return t.hasChildNodes()&&i()(t.childNodes,function(t){var n=t.nodeName;if(void 0===r[n])r[n]=e(t);else{if(void 0===r[n].length){var i=r[n];r[n]=[],r[n].push(i)}r[n].push(e(t))}}),r}},1709:function(e,t,r){"use strict";r.d(t,"a",function(){return F});var n,i,o,a,c=r(516),l=r.n(c),s=r(222),u=r.n(s),p=r(0),d=r.n(p),g=r(6),f=r(2),b=r(5),h=r(4),v=r(27),m=r(65),y=r(220),O=r(120),E=r(262),x=r(260),S=r(73),w=r(33),j=r(1026),T=r(68),C=r(1227);function L(){return(L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function _(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function I(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t,r,n,i){var o={};return Object.keys(n).forEach(function(e){o[e]=n[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}var F=(n=function(e){function t(t,r){var n,c=r.mode,s=r.existingCalc,u=void 0===s?null:s,p=r.previewTarget,d=void 0===p?null:p,g=r.querySubjectUsage,f=void 0===g?void 0:g;return _(n=e.apply(this,arguments)||this,"previewIdentifiers",i,A(n)),n.mode=void 0,n.previewModule=void 0,_(n,"previewExpressionObject",o,A(n)),n.previewData=[],n.previewHeaders=[],n.previewExecutionTime={_startTime:0,_endTime:0,set startTime(e){this._startTime=e===parseInt(e,10)?e:l()()},set endTime(e){this._endTime=e===parseInt(e,10)?e:l()()},get executionTime(){return(this._endTime-this._startTime)/1e3}},_(n,"previewing",a,A(n)),n.existingCalc=void 0,n.previewTarget=void 0,n.lastValidatedExpression=void 0,n.expression=void 0,n.querySubjectUsage=void 0,n.mode=c,n.existingCalc=u,n.previewTarget=d,n.querySubjectUsage=f,n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.getExpressionParentObjectForPreview=function(){var e=Object(h.getAncestorOrSelf)(this.previewTarget,[d.a.MoserObjectTypes.MODULE,d.a.MoserObjectTypes.QUERY_SUBJECT]);return e&&e.getObjectType()!==d.a.MoserObjectTypes.MODULE&&u()(this.previewModule.getQuerySubject(),function(t){return t.getIdentifier()===e.getIdentifier()})||this.previewModule},r.handlePreviewInit=function(){var e=this.provider.getModule();return this.previewing=!0,this.previewData=[],this.previewHeaders=[],this.previewIdentifiers=this.provider.getExpressionIdentifiers(),this.previewModule=Object(v.generateTempModuleFromModule)(e),Object(m.a)(this.context,{temp:!0,module:this.previewModule,baseURLModule:this.provider.getBaseURLModule()})},r.handlePreviewNewExpresion=function(e){var t=this;return function(){var r={label:t.provider.getSelectedSQLSource()||t.provider.getLabel(),expression:e,module:t.previewModule.moduleId};return t.previewExpressionObject=Object(v.createExpressionObject)(t.context,t.getExpressionParentObjectForPreview(),r),Object(x.a)(t.context,L({},t._moduleId,{moserObject:t.getExpressionParentObjectForPreview(),expression:t.previewExpressionObject.getExpression(),calculateAfterAggregation:t.provider.getCalculateAfterAggregation()}))}().then(function(e){return function(e){var r=t.existingCalc;return Object(v.updateExpressionProperties)(t.context,t.previewExpressionObject,e.columnList[0]),r&&Object(h.isMoserObjectTypeOf)(r,[d.a.MoserObjectTypes.QUERY_ITEM,d.a.MoserObjectTypes.CALCULATION])&&Object(h.isMoserObjectTypeOf)(t.previewExpressionObject,[d.a.MoserObjectTypes.QUERY_ITEM,d.a.MoserObjectTypes.CALCULATION])&&r.getSplitDefinition().length&&!t.previewExpressionObject.getSplitDefinition().length&&(t.previewExpressionObject.splitDefinition=r.getSplitDefinition()),Object(v.addExpressionObjectToModule)(t.context,t.getExpressionParentObjectForPreview(),t.previewExpressionObject),Object(y.a)(t.context,L({},t._moduleId,{module:t.previewModule}))}(e)})},r.handlePreviewExistingExpression=function(e){var t=this;return this.previewExpressionObject=d.a.ModuleUtils.getMoserObjectByIdForExpression(this.existingCalc.getIdForExpression(),this.previewModule),this.previewExpressionObject.setExpression(e),this.previewExpressionObject.setLabel(this.provider.getLabel()),Object(y.a)(this.context,L({},this._moduleId,{module:this.previewModule})).then(function(){return Object(x.a)(t.context,L({},t._moduleId,{moserObjectParent:t.getExpressionParentObjectForPreview(),moserObject:t.previewExpressionObject,expression:t.previewExpressionObject.getExpression(),calculateAfterAggregation:t.provider.getCalculateAfterAggregation()}))})},r._handlePreviewRequest=function(){var e,t,r=this,n=this.provider.getExpressionIdentifiers(),i=[this.previewExpressionObject].concat(n.map(function(n){if(n){var i=n.split(".");if(1===i.length){if(function(){if(void 0===e){var n=r.getExpressionParentObjectForPreview();e=Object(v.isExpressionParentGlobal)(n),t=!e&&n.getIdentifier()}return e}())return d.a.ModuleUtils.getCalculationById(i[0],r.previewModule);i[1]=i[0],i[0]=t}return d.a.QuerySubjectUtils.getQueryItemById(i[1],d.a.ModuleUtils.getQuerySubjectById(i[0],r.previewModule))}}).filter(function(e){return e&&e!==r.previewExpressionObject}));return this.previewExecutionTime.startTime=l()(),Object(E.a)(this.context,L({},this._moduleId,{querySpec:function(e,t,r){var n=[];return{limit:"100",type:e===T.g?r?"summary":"detail":"summary",dataItems:t.map(function(t,i){var o=String(i);n.push(o);var a={id:o,itemId:t.getIdForExpression()};return e===T.g&&r&&(a.aggregate=t.getRegularAggregate()===d.a.RegularAggregateType.CALCULATED?d.a.RegularAggregateType.CALCULATED.name():d.a.RegularAggregateType.AUTOMATIC.name()),a}),projections:n}}(this.mode,i,this.provider.getCalculateAfterAggregation())}))},r._handlePreviewSuccess=function(e){return this.previewExecutionTime.endTime=l()(),this.previewing=!1,this.previewData=Object(S.a)(e.data,e.dataItems),this.previewHeaders=Object(S.b)(e.dataItems),Object(O.a)(this.context,this._moduleId)},r._handlePreviewErrors=function(e){this.previewExecutionTime.endTime=l()();var t=Object(w.a)(e);return this.previewing=!1,this.provider.setDisplayedPanel(T.b.VALIDATION),this.lastValidatedExpression=this.expression,this.provider.setFeedback((this.provider.getSelectedText()?Object(f.getString)("msgHighlightedExpressionInvalid"):Object(f.getString)("msgExpressionInvalid"))+" \n\n "+t),Object(O.a)(this.context,this._moduleId)},r.previewExpression=function(e){var t=this;return this.handlePreviewInit().then(function(r){return t.previewModule.moduleId=r.id||r.moduleURL,t.existingCalc&&t.mode!==T.f&&t.mode!==T.e?t.handlePreviewExistingExpression(e):t.handlePreviewNewExpresion(e)}).then(function(){return t._handlePreviewRequest()}).then(function(e){return t._handlePreviewSuccess(e)}).catch(function(e){t._handlePreviewErrors(e)})},r.previewExpressionData=function(){return this.previewExpression(this.provider.getExpression())},r.previewFilterData=function(){return this.previewExpression(function(e){return"CASE WHEN ("+e+") THEN 1 ELSE 0 END"}(this.provider.getExpression()))},r._handleSQLPreviewRequest=function(){var e=[];return this.previewExpressionObject.getItem().forEach(function(t){return e.push(t.getQueryItem())}),this.previewExecutionTime.startTime=l()(),Object(E.a)(this.context,L({},this._moduleId,{querySpec:function(e,t){var r=[];return{limit:"100",type:t===d.a.QuerySubjectUsage.SUMMARY_QUERY?"summary":"detail",dataItems:e.map(function(e,n){var i=String(n);r.push(i);var o={id:i,itemId:e.getIdForExpression()};return t===d.a.QuerySubjectUsage.SUMMARY_QUERY&&(o.aggregate=d.a.RegularAggregateType.AUTOMATIC.name()),o}),projections:r}}(e,this.querySubjectUsage)}))},r.previewSQLData=function(){var e=this,t={label:this.provider.getSelectedText()||this.provider.getLabel(),expression:this.provider.getExpression(),datasourceRef:this.mode===T.h?this.provider.getSelectedSQLSource():"",sqlType:this.mode===T.h?this.provider.getSelectedSQLType():""};return this.handlePreviewInit().then(function(r){return e.action(function(){return t.module=r.id,e.previewModule.moduleId=r.id,e.previewExpressionObject=Object(C.a)(e.context,e.previewModule,t),Object(j.a)(e.context,{name:t.label,module:t.module,datasourceRef:t.datasourceRef,type:t.sqlType.enumValue,expression:t.expression})})}).then(function(r){return e.action(function(){return e.previewExpressionObject=Object(C.b)(e.context,r,t),Object(v.addExpressionObjectToModule)(e.context,e.previewModule,e.previewExpressionObject),Object(y.a)(e.context,L({module:e.previewModule},e._moduleId))})}).then(function(){return e._handleSQLPreviewRequest()}).then(function(t){return e._handlePreviewSuccess(t)}).catch(function(t){e._handlePreviewErrors(t)})},function(e,t,r){t&&I(e.prototype,t),r&&I(e,r)}(t,[{key:"previewQueryItems",get:function(){var e=this;if(!this.previewExpressionObject||this.previewing)return[];if(this.mode===T.h)return Object(h.isMoserObjectTypeOf)(this.previewExpressionObject,d.a.MoserObjectTypes.QUERY_SUBJECT)?Object(h.getChildQueryItem)(this.previewExpressionObject):[];var t=this.provider.getColumns().filter(function(t){var r=t.id;return e.previewIdentifiers.some(function(e){return e===r})}).map(function(e){return e.node});return t.unshift(this.previewExpressionObject),t}},{key:"_moduleId",get:function(){return{moduleId:this.provider.getModuleURL()?null:this.previewModule.moduleId,moduleURL:this.provider.getModuleURL()?this.previewModule.moduleId:null}}}]),t}(b.a),i=P(n.prototype,"previewIdentifiers",[g.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),o=P(n.prototype,"previewExpressionObject",[g.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),a=P(n.prototype,"previewing",[g.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),P(n.prototype,"previewQueryItems",[g.computed],Object.getOwnPropertyDescriptor(n.prototype,"previewQueryItems"),n.prototype),P(n.prototype,"handlePreviewInit",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"handlePreviewInit"),n.prototype),P(n.prototype,"handlePreviewNewExpresion",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"handlePreviewNewExpresion"),n.prototype),P(n.prototype,"handlePreviewExistingExpression",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"handlePreviewExistingExpression"),n.prototype),P(n.prototype,"_handlePreviewRequest",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"_handlePreviewRequest"),n.prototype),P(n.prototype,"_handlePreviewSuccess",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"_handlePreviewSuccess"),n.prototype),P(n.prototype,"_handlePreviewErrors",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"_handlePreviewErrors"),n.prototype),P(n.prototype,"previewExpression",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"previewExpression"),n.prototype),P(n.prototype,"previewExpressionData",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"previewExpressionData"),n.prototype),P(n.prototype,"previewFilterData",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"previewFilterData"),n.prototype),P(n.prototype,"_handleSQLPreviewRequest",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"_handleSQLPreviewRequest"),n.prototype),P(n.prototype,"previewSQLData",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"previewSQLData"),n.prototype),n)},1710:function(e,t,r){"use strict";r.d(t,"a",function(){return L});var n,i,o,a,c,l,s,u=r(0),p=r.n(u),d=r(6),g=r(2),f=r(5),b=r(9),h=r(27),v=r(29),m=r(4),y=r(26),O=r(33),E=r(260),x=r(217);function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function w(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e,t,r,n,i){var o={};return Object.keys(n).forEach(function(e){o[e]=n[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}var L=(n=function(e){function t(t,r){var n,u=r.calculateAfterAggregation,d=r.existingCalc,g=r.scope,f=r.calcIsUpdatable,b=r.container;return w(n=e.apply(this,arguments)||this,"saving",i,T(n)),w(n,"validating",o,T(n)),w(n,"lastValidatedExpression",a,T(n)),n.withError=!1,w(n,"calculateAfterAggregation",c,T(n)),w(n,"showCalculateAfterAggregation",l,T(n)),w(n,"calculateAfterAggregationToggled",s,T(n)),n._originalCalculateAfterAggregation=!1,n.scope=void 0,n.calcIsUpdatable=void 0,n.container=void 0,n.existingCalc=void 0,n.scope=g,n.existingCalc=d,n.calcIsUpdatable=f,n.container=b,!0===u?(n.showCalculateAfterAggregation=!0,n.calculateAfterAggregation=!0):!1===u?(n.showCalculateAfterAggregation=!0,n.calculateAfterAggregation=!1):n.existingCalc?Object(m.isCalculateAfterAggregationAllowed)(n.existingCalc)?(n.showCalculateAfterAggregation=!0,n.calculateAfterAggregation=n._originalCalculateAfterAggregation=n.existingCalc.getRegularAggregate()===p.a.RegularAggregateType.CALCULATED):n.calculateAfterAggregation=!1:(n.showCalculateAfterAggregation=!0,n.calculateAfterAggregation=n.scope.getObjectType()===p.a.MoserObjectTypes.MODULE),n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r._validateExpression=function(e,t,r){var n=this;return this.provider.saveGlobalSessionModule().then(function(){return Object(E.a)(n.context,{moduleId:n.provider.getModuleId(),moduleURL:n.provider.getModuleURL(),moserObject:t,moserObjectParent:e,expression:r,calculateAfterAggregation:n.calculateAfterAggregation})})},r._makeAllProperties=function(){return[{name:b.t,value:{func:b.E,version:this.provider.getModule().getVersion()}}]},r._makeProperties=function(){return{label:this.provider.getLabel(),expression:this.provider.getExpression(),module:this.provider.getModuleId(),property:this._makeAllProperties()}},r.createOrUpdateExpression=function(){var e=this,t=this.existingCalc,r=this.scope,n=this.calcIsUpdatable,i=n?Object(g.getString)("updateExpression"):Object(g.getString)("saveExpression"),o=this._makeProperties(),a=p.a.Features.REGULAR_AGGREGATE,c=p.a.RegularAggregateType,l=c.CALCULATED,s=c.TOTAL;this.saving=!0,this.validating=!0;var u=n?t:Object(h.createExpressionObject)(this.context,r,o);return!this.calculateAfterAggregationToggled&&n||u.setRegularAggregate(this.calculateAfterAggregation?l:s),this.calculateAfterAggregationToggled&&Object(v.h)(u,a),this._validateExpression(r,u,o.expression).then(function(t){return e.action(Object(y.b)(i)(function(){e.withError=!1,e.saving=!1,e.validating=!1,n?Object(h.updateExpressionProperties)(e.context,u,S({},o,{},t.columnList[0])):(Object(h.updateExpressionProperties)(e.context,u,t.columnList[0]),Object(h.addExpressionObjectToModule)(e.context,e.container,u))}))},function(t){Object(x.b)(t)&&e.provider.showToast(Object(g.getString)("calcParamErrorFromValidation")),e.action(Object(y.b)(i)(function(){e.lastValidatedExpression=o.expression,e.provider.setFeedback(Object(g.getString)("msgExpressionInvalid")),e.withError=!0,e.saving=!1,e.validating=!1,n?Object(h.updateExpressionProperties)(e.context,u,o):Object(h.addExpressionObjectToModule)(e.context,e.container,u)}))}).then(function(){return e.action(function(){e.saving=!1,e.validating=!1}),u})},r.validateExpression=function(){var e=this,t=this.existingCalc,r=this.scope,n=!t,i=this.provider.getSelectedText()||this.provider.getExpression();return this.validating=!0,this._validateExpression(r,n?null:t,i).then(function(){e.action(function(){e.lastValidatedExpression=i,e.provider.setFeedback(e.provider.getSelectedText()?Object(g.getString)("msgHighlightedExpressionValid"):Object(g.getString)("msgExpressionValid")),e.validating=!1})},function(t){e.action(function(){e.lastValidatedExpression=i;var r=Object(O.a)(t);e.provider.setFeedback((e.provider.getSelectedText()?Object(g.getString)("msgHighlightedExpressionInvalid"):Object(g.getString)("msgExpressionInvalid"))+"\n\n"+r),e.validating=!1,e.withError=!0})})},r.setCalculateAfterAggregation=function(e){this.calculateAfterAggregation=e,this.calculateAfterAggregationToggled=!0},function(e,t,r){t&&j(e.prototype,t),r&&j(e,r)}(t,[{key:"dirty",get:function(){return this.calculateAfterAggregation!==this._originalCalculateAfterAggregation}},{key:"isCalculateAfterAggregation",get:function(){return this.calculateAfterAggregation}}]),t}(f.a),i=C(n.prototype,"saving",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),o=C(n.prototype,"validating",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),a=C(n.prototype,"lastValidatedExpression",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),c=C(n.prototype,"calculateAfterAggregation",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),l=C(n.prototype,"showCalculateAfterAggregation",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),s=C(n.prototype,"calculateAfterAggregationToggled",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),C(n.prototype,"dirty",[d.computed],Object.getOwnPropertyDescriptor(n.prototype,"dirty"),n.prototype),C(n.prototype,"createOrUpdateExpression",[f.c],Object.getOwnPropertyDescriptor(n.prototype,"createOrUpdateExpression"),n.prototype),C(n.prototype,"validateExpression",[f.c],Object.getOwnPropertyDescriptor(n.prototype,"validateExpression"),n.prototype),C(n.prototype,"isCalculateAfterAggregation",[d.computed],Object.getOwnPropertyDescriptor(n.prototype,"isCalculateAfterAggregation"),n.prototype),C(n.prototype,"setCalculateAfterAggregation",[f.c],Object.getOwnPropertyDescriptor(n.prototype,"setCalculateAfterAggregation"),n.prototype),n)},1711:function(e,t,r){"use strict";r.d(t,"a",function(){return x});var n,i,o,a,c=r(0),l=r.n(c),s=r(6),u=r(2),p=r(5),d=r(27),g=r(26),f=r(33),b=r(260),h=r(217),v=r(1712);function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e,t,r,n,i){var o={};return Object.keys(n).forEach(function(e){o[e]=n[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}var x=(n=function(e){function t(t,r){var n,c=r.embedded,l=void 0!==c&&c,s=r.scope,u=r.existingCalc,p=r.localScope,d=r.container;return y(n=e.apply(this,arguments)||this,"saving",i,O(n)),y(n,"validating",o,O(n)),y(n,"lastValidatedExpression",a,O(n)),n.withError=!1,n.embedded=!1,n.scope=void 0,n.existingCalc=void 0,n.localScope=void 0,n.container=void 0,n.embedded=l,n.scope=s,n.existingCalc=u,n.localScope=p,n.container=d,n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r._makeFilterProperties=function(){return{label:this.provider.getLabel(),expression:this.provider.getExpression(),module:this.provider.getModuleId()}},r._filterIsUpdatable=function(){var e=this.existingCalc;return e&&e.getObjectType()===l.a.MoserObjectTypes.FILTER},r.createOrUpdateExpression=function(){var e=this,t=this.existingCalc,r=this.scope,n=this._filterIsUpdatable(),i=n?Object(u.getString)("updateExpression"):Object(u.getString)("saveExpression"),o=this._makeFilterProperties(),a=n?null:this.container;this.saving=!0,this.validating=!0;var c=n?t:Object(v.a)(this.context,o);return this._validateExpression(r,c,o.expression).then(function(t){return e.action(Object(g.b)(i)(function(){e.withError=!1,n?Object(d.updateExpressionProperties)(e.context,c,m({},o,{},t.columnList[0])):(Object(d.updateExpressionProperties)(e.context,c,t.columnList[0]),Object(d.addExpressionObjectToModule)(e.context,a,c,e.embedded))}))},function(t){return Object(h.b)(t)&&e.provider.showToast(Object(u.getString)("calcParamErrorFromValidation")),e.action(Object(g.b)(i)(function(){e.lastValidatedExpression=o.expression,e.provider.setFeedback(Object(u.getString)("msgExpressionInvalid")),e.withError=!0,n?Object(d.updateExpressionProperties)(e.context,c,o):Object(d.addExpressionObjectToModule)(e.context,a,c,e.embedded)}))}).then(function(){return e.action(function(){e.saving=!1,e.validating=!1}),c})},r._validateExpression=function(e,t,r){var n=this;return this.provider.saveGlobalSessionModule().then(function(){return Object(b.a)(n.context,{moduleId:n.provider.getModuleId(),moduleURL:n.provider.getModuleURL(),moserObject:t,moserObjectParent:e,expression:r,isFilter:!0})})},r.validateExpression=function(){var e=this,t=this.existingCalc,r=this.scope,n=!t,i=this.provider.getSelectedText()||this.provider.getExpression();return this.validating=!0,this._validateExpression(r,n?null:t,i).then(function(){return e.action(function(){e.lastValidatedExpression=i,e.provider.setFeedback(e.provider.getSelectedText()?Object(u.getString)("msgHighlightedExpressionValid"):Object(u.getString)("msgExpressionValid")),e.validating=!1})},function(t){e.action(function(){e.lastValidatedExpression=i;var r=Object(f.a)(t);e.provider.setFeedback((e.provider.getSelectedText()?Object(u.getString)("msgHighlightedExpressionInvalid"):Object(u.getString)("msgExpressionInvalid"))+"\n\n"+r),e.validating=!1,e.withError=!0})})},t}(p.a),i=E(n.prototype,"saving",[s.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),o=E(n.prototype,"validating",[s.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),a=E(n.prototype,"lastValidatedExpression",[s.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),E(n.prototype,"createOrUpdateExpression",[p.c],Object.getOwnPropertyDescriptor(n.prototype,"createOrUpdateExpression"),n.prototype),E(n.prototype,"validateExpression",[p.c],Object.getOwnPropertyDescriptor(n.prototype,"validateExpression"),n.prototype),n)},1712:function(e,t,r){"use strict";r.d(t,"a",function(){return i});r(0);var n=r(27);function i(e,t){var r=e.moser.objectFactory.createFilter();return Object(n.updateExpressionProperties)(e,r,t),r}},1713:function(e,t,r){"use strict";r.d(t,"a",function(){return _});var n,i,o,a,c,l,s,u,p=r(222),d=r.n(p),g=r(0),f=r.n(g),b=r(6),h=r(2),v=r(5),m=r(4),y=r(27),O=r(26),E=r(33),x=r(1026),S=r(95),w=r(1227);function j(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e,t,r,n,i){var o={};return Object.keys(n).forEach(function(e){o[e]=n[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}var _=(n=v.c.undoable(Object(h.getString)("modifySQLType")),i=v.c.undoable(Object(h.getString)("modifySQLSource")),o=function(e){function t(t,r){var n,i=r.scope,o=r.calcIsUpdatable,p=r.container,d=r.existingCalc,g=r.localScope;return j(n=e.apply(this,arguments)||this,"saving",a,C(n)),j(n,"validating",c,C(n)),j(n,"lastValidatedExpression",l,C(n)),n.withError=!1,n.validateAfterUpdate=!1,n.sqlTypes=[],n.sqlSources=[],n._originalSQLType=void 0,n._originalSQLSource=void 0,n.defaultSQLType=void 0,j(n,"selectedSQLType",s,C(n)),j(n,"selectedSQLSource",u,C(n)),n.scope=void 0,n.calcIsUpdatable=void 0,n.container=void 0,n.existingCalc=void 0,n.localScope=void 0,n.feedback=void 0,n.scope=i,n.calcIsUpdatable=o,n.container=p,n.existingCalc=d,n.localScope=g,n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.storeDidMount=function(){this.initSQLSources(),this.initSQLTypes()},r.initSQLTypes=function(){this.sqlTypes=[{label:Object(h.getString)("cognosSQL"),value:f.a.SqlLanguageType.COGNOS},{label:Object(h.getString)("nativeSQL"),value:f.a.SqlLanguageType.NATIVE},{label:Object(h.getString)("passThroughSQL"),value:f.a.SqlLanguageType.PASS_THROUGH}];var e=this.existingCalc;this.defaultSQLType=this.sqlTypes[0].value,this._originalSQLType=e&&Object(m.isMoserObjectTypeOf)(e,f.a.MoserObjectTypes.QUERY_SUBJECT)?e.getSqlQuery().getSqlType():this.defaultSQLType,this.selectedSQLType=this._originalSQLType},r.initSQLSources=function(){var e,t=this,r=this.localScope,n=this.existingCalc;Object(m.isMoserObjectTypeOf)(r,f.a.MoserObjectTypes.MODULE)?e=r.getUseSpec():e=Object(m.getAncestorOrModule)(r,f.a.MoserObjectTypes.MODULE).getUseSpec();e.length&&(e.forEach(function(e){var r=null;if(e.getAncestors&&e.getAncestors().length){var n=e.getAncestors()[0];r=Object(S.d)(n.storeID)?Object(h.getString)("myContent"):n.defaultName}r&&!d()(t.sqlSources,function(e){return e.label===r})&&t.sqlSources.push({label:r,value:r,type:e.getType()})}),this.selectedSQLSource=this._originalSQLSource=n&&Object(m.isMoserObjectTypeOf)(n,f.a.MoserObjectTypes.QUERY_SUBJECT)?n.getSqlQuery().getDatasourceRef()[0]:this.sqlSources[0].value)},r._validateSQLExpression=function(e,t){var r=this;return this.provider.saveGlobalSessionModule().then(function(){return Object(x.a)(r.context,{moserObject:e,module:t.module,name:t.label,datasourceRef:t.datasourceRef,type:t.sqlType.enumValue,expression:t.expression})})},r._makeSQLProperties=function(){return{label:this.provider.getLabel(),expression:this.provider.getExpression(),module:this.provider.getModuleId(),datasourceRef:this.selectedSQLSource,sqlType:this.selectedSQLType}},r.createOrUpdateExpression=function(){var e=this,t=this.existingCalc,r=this.scope,n=this.calcIsUpdatable,i=n?Object(h.getString)("updateExpression"):Object(h.getString)("saveExpression"),o=this._makeSQLProperties();this.saving=!0,this.validating=!0;var a=n?t:Object(w.a)(this.context,r,o);return this._validateSQLExpression(a,o).then(function(t){return e.action(Object(O.b)(i)(function(){e.withError=!1,e.saving=!1,e.validating=!1;var r=Object(w.b)(e.context,t,o);n?e.validateAfterUpdate=f.a.QuerySubjectUtils.updateSQLQueryQuerySubject(a,r):Object(y.addExpressionObjectToModule)(e.context,e.container,r)}))},function(t){return e.action(Object(O.b)(i)(function(){e.lastValidatedExpression=o.expression,e.feedback=Object(h.getString)("msgExpressionInvalid"),e.withError=!0,e.saving=!1,e.validating=!1;var r=Object(w.c)(e.context,o);n?f.a.QuerySubjectUtils.updateSQLQueryQuerySubject(a,r):Object(y.addExpressionObjectToModule)(e.context,e.container,r),e.provider.showToast(Object(h.getString)("sqlExpressionError",{tableName:o.label}),{details:Object(E.a)(t)})}))}).then(function(){return e.action(function(){e.saving=!1,e.validating=!1}),a})},r.validateExpression=function(){var e=this,t=this.existingCalc,r=!t,n=this._makeSQLProperties(),i=n.expression=this.provider.getSelectedText()||this.provider.getExpression();return this.validating=!0,this._validateSQLExpression(r?null:t,n).then(function(){e.action(function(){e.lastValidatedExpression=i,e.provider.setFeedback(e.provider.getSelectedText()?Object(h.getString)("msgHighlightedExpressionValid"):Object(h.getString)("msgExpressionValid")),e.validating=!1})},function(t){e.action(function(){e.lastValidatedExpression=i;var r=Object(E.a)(t);e.provider.setFeedback((e.provider.getSelectedText()?Object(h.getString)("msgHighlightedExpressionInvalid"):Object(h.getString)("msgExpressionInvalid"))+"\n\n"+r),e.validating=!1,e.withError=!0})})},r.changeSelectedSQLType=function(e){this.selectedSQLType=e},r.changeSelectedSQLSource=function(e){this.selectedSQLSource=e},function(e,t,r){t&&T(e.prototype,t),r&&T(e,r)}(t,[{key:"dirty",get:function(){return this._originalSQLType!==this.selectedSQLType||this._originalSQLSource!==this.selectedSQLSource}},{key:"shouldEnableSQLTypeSelection",get:function(){var e=this,t=d()(this.sqlSources,function(t){return t.value===e.selectedSQLSource});return!!t&&f.a.UseSpecType.DATABASE===t.type}}]),t}(v.a),a=L(o.prototype,"saving",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),c=L(o.prototype,"validating",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),l=L(o.prototype,"lastValidatedExpression",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),s=L(o.prototype,"selectedSQLType",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),u=L(o.prototype,"selectedSQLSource",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),L(o.prototype,"dirty",[b.computed],Object.getOwnPropertyDescriptor(o.prototype,"dirty"),o.prototype),L(o.prototype,"shouldEnableSQLTypeSelection",[b.computed],Object.getOwnPropertyDescriptor(o.prototype,"shouldEnableSQLTypeSelection"),o.prototype),L(o.prototype,"createOrUpdateExpression",[v.c],Object.getOwnPropertyDescriptor(o.prototype,"createOrUpdateExpression"),o.prototype),L(o.prototype,"validateExpression",[v.c],Object.getOwnPropertyDescriptor(o.prototype,"validateExpression"),o.prototype),L(o.prototype,"changeSelectedSQLType",[n],Object.getOwnPropertyDescriptor(o.prototype,"changeSelectedSQLType"),o.prototype),L(o.prototype,"changeSelectedSQLSource",[i],Object.getOwnPropertyDescriptor(o.prototype,"changeSelectedSQLSource"),o.prototype),o)},707:function(e,t,r){"use strict";r.r(t);var n=r(1673);t.default={"components/ExpressionEditorDialog":n}}}]);
  8. //# sourceMappingURL=expressions.js.map