(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[43],{907:function(t,e){t.exports='<style>\n    .content {\n        display: flex;\n        flex-direction: column;\n        height: 100%;\n    }\n\n    .content au-widget {\n        margin-bottom: var(--group-padding-content-bottom, 30px);\n        height: var(--au-widget-height, auto);\n        width: var(--au-width, 100%);\n    }\n</style>\n\n<div class="content">\n    <dom-repeat items="{{options}}" id="repeater">\n        <template>\n            <au-widget name="{{item.name}}" language="{{language}}" driver="{{driver}}"\n                definition="{{item}}"></au-widget>\n        </template>\n    </dom-repeat>\n</div>\n\n'},957:function(t,e,i){"use strict";i.r(e),i.d(e,"AuWidgetPimOptions",function(){return d}),i.d(e,"widget",function(){return d});var n=i(0),s=i(2),o=i(1),a=i(15),p=i(430),l=i(160),r=i(907);let d=class extends l.b{constructor(){super(...arguments),this.options=[],this._optionsWidgets=[],this._optionsNames=[],this._optionsAreLoaded=!1}get _(){if(this._optionsWidgets.length>0){const t={};return this._optionsWidgets.forEach(e=>{var i;if(e.element.isActive)if(Array.isArray(e._)){if(0===e._.length)return;t[e._[0].id]=[],e._.forEach(e=>{var i;t[e.id].push(null===(i=e.optionValue)||void 0===i?void 0:i.id)})}else t[e._.id]=null===(i=e._.optionValue)||void 0===i?void 0:i.id}),t}return[]}checkOptionsLoading(){this._optionsAreLoaded||0===this.options.length||this.options.length!==this._optionsWidgets.length||(this._optionsAreLoaded=!0,this._onReadyFunction&&this._onReadyFunction())}get summary(){if(this._optionsWidgets.length>0){const t=[];return this._optionsWidgets.forEach(e=>{var i;0!==(null===(i=null===e||void 0===e?void 0:e._)||void 0===i?void 0:i.length)&&t.push(new class{constructor(t){Array.isArray(t)?(this.name=t[0].title,this.value=t.map(t=>t.optionValue.title),this.visible=t[0].visible):(this.name=t.title,this.value=t.optionValue.title,this.visible=t.visible)}}(e._))}),t}return[]}updateParams(t){var e,i,n;if(!t)return;if(!t.options||t.options.length<1)return;let s=[];if(t.onReady&&(this._onReadyFunction=o.a.functionWrapperConstructor(t.onReady)),t.onChange&&(this._onChange=o.a.functionWrapperConstructor(t.onChange)),t.options.length>0){let o=new Map;(null===(e=this.paramsRaw)||void 0===e?void 0:e.modifiers)&&(null===(i=this.paramsRaw)||void 0===i?void 0:i.modifiers.length)>0&&(null===(n=this.paramsRaw)||void 0===n||n.modifiers.forEach(t=>o.set(t.name,{subType:t.subType,type:t.type,visible:t.visible,preselectedValue:t.preselectedValue,onChange:t.onChange,title:t.title,description:t.description,prompt:t.prompt}))),t.options.forEach(e=>{var i;let n=[...t.options];const a=o.has(e.title);let p=a?o.get(e.title).visible:void 0,l=p;const r=1===e.values.length,d=a&&(null===(i=o.get(e.title))||void 0===i?void 0:i.preselectedValue);r&&(l=!1!==p,p=!!p),d&&!r&&(n=n.map(t=>Object.assign(Object.assign({},t),{values:t.values.map(t=>Object.assign(Object.assign({},t),{preselected:!(d!==t.title&&(null===d||void 0===d||!d.includes(t.title)))}))})),l=!0);const c=new class{constructor(t,e){var i;this.title=null!==(i=t.title)&&void 0!==i?i:e.name,this.description=t.description,this.prompt=t.prompt,this.name=e.name,this.type="pim-option-selector",this.params={name:e.name,options:e.options,type:e.type,subType:e.subType,visible:e.visible,active:e.active,onChange:e.onChange}}}({title:o.has(e.title)?o.get(e.title).title:null,description:o.has(e.title)?o.get(e.title).description:"",prompt:o.has(e.title)?o.get(e.title).prompt:""},{name:e.title,options:n,visible:null===p||void 0===p||p,active:l,onChange:a?o.get(e.title).onChange:null,type:a?o.get(e.title).type:null,subType:a?o.get(e.title).subType:null});s.push(c)})}this.options=s,this._optionsNames=this.options.map(t=>t.name)}async updateParamsAsync(t){await super.updateParamsAsync(t)}async connectedCallback(){super.connectedCallback(),this._subscription=this.observe(a.a.WIDGET_CHANGE).pipe(Object(p.a)(t=>this._optionsNames.indexOf(t.name)>=0&&!!t.sender._)).subscribe(t=>{this._updateWidgets(t),this._onChange&&this._onChange(t),this.checkOptionsLoading()})}async _updateWidgets(t){this._optionsWidgets.length>0?(this._optionsWidgets=this._optionsWidgets.filter(e=>e.name!==t.sender.name),this._optionsWidgets.push(t.sender)):this._optionsWidgets.push(t.sender)}disconnectedCallback(){super.disconnectedCallback(),this._subscription.unsubscribe()}clearSelection(){}};Object(n.a)([Object(s.c)(),Object(n.b)("design:type",Object)],d.prototype,"options",void 0),Object(n.a)([Object(s.c)(),Object(n.b)("design:type",Object),Object(n.b)("design:paramtypes",[])],d.prototype,"_",null),d=Object(n.a)([Object(s.a)("au-widget-pim-options",r)],d)}}]);