1"use strict";(self.webpackChunk_kosila_kosila_360_admin=self.webpackChunk_kosila_kosila_360_admin||[]).push([[9463],{9463:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});var C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(89379),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9950),react_bootstrap_table_dist_react_bootstrap_table_all_min_css__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(54764),_scss_Spinners_scss__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(502),_services_AuthenticationService__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(77397),_withAuthentication__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(38773),_components_ObjectTypeSelect__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(46437),react_async_hook__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(10375),_k360_core_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(50125),reactstrap__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(70369),reactstrap__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(38590),reactstrap__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(85077),reactstrap__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(18849),reactstrap__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(70349),reactstrap__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(23931),reactstrap__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(50651),reactstrap__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(75490),reactstrap__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(76991),reactstrap__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(19247),reactstrap__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(76152),reactstrap__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(55627),reactstrap__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(21205),reactstrap__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(97540),components_ObjectProfileMultiSelect__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(83584),react_toastify__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(47666),components_ObjectClassSelect__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(89668),react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(34366),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(44414);const SortableDrag=(0,react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__.D)((()=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{style:{cursor:"move"},className:"fa fa-arrows"}))),GroupSortableItem=(0,react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__.Zj)((e=>{let{value:_,selectedGroupId:t,changeSelectedGroup:s,getTitle:r}=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_13__.A,{style:{zIndex:1},type:"button",action:!0,tag:"a",onClick:()=>s(_.id),active:t===_.id,color:t===_.id?"info":void 0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("strong",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(SortableDrag,{}),"\xa0\xa0",r(_.languages)||"(nimet\xf6n)"]})},_.id)})),GroupSortableList=(0,react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__.q6)((e=>{let{items:_,selectedGroupId:t,changeSelectedGroup:s,getTitle:r}=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_14__.A,{flush:!0,children:_.map(((e,_)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(GroupSortableItem,{index:_,value:e,selectedGroupId:t,changeSelectedGroup:s,getTitle:r},"item-".concat(e.id))))})})),FieldSortableItem=(0,react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__.Zj)((e=>{let{field:_,onValueChange:t,removeField:s,i:r,getTitle:i}=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{maxWidth:"55px",paddingTop:"19px",paddingLeft:"22px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(SortableDrag,{})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"text",value:i(_.languages),name:"fields[".concat(r,"].languages.title"),onChange:t,placeholder:"Kent\xe4n nimi",required:!0})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"select",name:"fields[".concat(r,"].type"),onChange:t,placeholder:"Kent\xe4n tyyppi",required:!0,value:_.type,children:enumToArray(_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.Ps).map((e=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("option",{value:e.value,children:e.name},"fieldtype-"+e.name)))})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"text",value:_.defaultValue,name:"fields[".concat(r,"].defaultValue"),onChange:t,placeholder:"Oletusarvo"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"textarea",value:shouldDisableValueField(_.type)?"":_.values,name:"fields[".concat(r,"].values"),onChange:t,disabled:shouldDisableValueField(_.type),placeholder:"Valinnat, erota rivinvaihdolla"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{maxWidth:"63px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"text",value:_.prefix,name:"fields[".concat(r,"].prefix"),onChange:t,placeholder:"Etuliite"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{maxWidth:"63px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"text",value:_.suffix,name:"fields[".concat(r,"].suffix"),onChange:t,placeholder:"Takaliite"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"checkbox",checked:_.isRequired,name:"fields[".concat(r,"].isRequired"),onChange:t,style:{position:"relative",marginLeft:"0",width:"20px",height:"20px"}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"checkbox",checked:_.isSearchable,name:"fields[".concat(r,"].isSearchable"),onChange:t,style:{position:"relative",marginLeft:"0",width:"20px",height:"20px"}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"checkbox",checked:_.isShown,name:"fields[".concat(r,"].isShown"),onChange:t,style:{position:"relative",marginLeft:"0",width:"20px",height:"20px"}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"checkbox",checked:_.isQuickFilterEnabled,name:"fields[".concat(r,"].isQuickFilterEnabled"),onChange:t,style:{position:"relative",marginLeft:"0",width:"20px",height:"20px"}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"text",value:_.valueRegEx,name:"fields[".concat(r,"].valueRegEx"),onChange:t,placeholder:"RegEx validointi"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"text",value:_.valueExample,name:"fields[".concat(r,"].valueExample"),onChange:t,placeholder:"Esimerkki arvo"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{maxWidth:"55px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_16__.A,{type:"button",color:"danger",onClick:()=>s(r),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{className:"fa fa-tras
1h"})})})]})})),FieldSortableList=(0,react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__.q6)((e=>{let{items:_,onValueChange:t,removeField:s,getTitle:r}=e;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("tbody",{children:_.map(((e,_)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(FieldSortableItem,{field:e,index:_,i:_,getTitle:r,removeField:s,onValueChange:t},"field-"+_)))})})),ObjectBaseAttributes=()=>{var _selectedGroup$object,_selectedGroup$object2,_selectedGroup$object3,_selectedGroup$object4;const authService=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(new _services_AuthenticationService__WEBPACK_IMPORTED_MODULE_3__.A).current,{languageId:languageId,serviceSet:serviceSet}=(0,_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.Am)(),optionContext=(0,_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.II)(),[lang,setLang]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({chooseObjectType:"",saveOk:""}),[selectedLanguage,setSelectedLanguage]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(languageId),[objectTypeType,setObjectTypeType]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[objectTypeId,setObjectTypeId]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[selectedGroupId,setSelectedGroupId]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[selectedGroup,setSelectedGroup]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[attributeGroups,setAttributeGroups]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),[groupChanged,setGroupChanged]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[isLoading,setIsLoading]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{optionContext.setLanguageOptionValuesByCurrentServiceSet(Object.keys(lang),((e,_)=>{setLang((t=>(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)((0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},t),{},{[e]:_})))}))}),[]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{addLanguageIfNotExist()}),[selectedLanguage]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{if(selectedGroup){addLanguageIfNotExist();let e=[...attributeGroups];e.splice(e.findIndex((e=>e.id===selectedGroup.id)),1,selectedGroup),setAttributeGroups(e)}}),[selectedGroup]);const systemLanguages=(0,react_async_hook__WEBPACK_IMPORTED_MODULE_6__.Yb)(_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Core.Languages.getListByPartnerBusinessArea,[languageId,authService.getPartnerBusinessAreaId()]),attributeGroupsQuery=(0,react_async_hook__WEBPACK_IMPORTED_MODULE_6__.Yb)((async()=>{if(objectTypeType){var e=await _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Object.ObjectBaseAttributeFieldGroups.getList(serviceSet.id,{objectType:objectTypeType,page:1,pageSize:1e3});return setGroupChanged(!1),setAttributeGroups(e.data),setSelectedGroupId(null),setSelectedGroup(null),e}}),[objectTypeType]),attributeFields=(0,react_async_hook__WEBPACK_IMPORTED_MODULE_6__.Yb)((async()=>{if(objectTypeType)return await _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Object.ObjectBaseAttributeFields.getList({objectType:objectTypeType,page:1,pageSize:1e3})}),[objectTypeType,selectedGroupId]),selectedGroupQuery=(0,react_async_hook__WEBPACK_IMPORTED_MODULE_6__.Yb)((async()=>{if(selectedGroupId){if(isNewGroup(selectedGroupId)){const e=attributeGroups.find((e=>e.id===selectedGroupId));return setSelectedGroup(e),e}setGroupChanged(!1);var e=await _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Object.ObjectBaseAttributeFieldGroups.getSingle(selectedGroupId);return setSelectedGroup(e.data),e}setSelectedGroup(null)}),[selectedGroupId]),addLanguageIfNotExist=()=>{if(selectedGroup){let e=!1,_=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);_.languages.find((e=>e.languageId===selectedLanguage))||(_.languages=[..._.languages],_.languages.push({title:_.languages[0].title,languageId:selectedLanguage}),e=!0);for(let t=0;t<_.fields.length;t++)_.fields[t].languages.find((e=>e.languageId===selectedLanguage))||(_.fields[t].languages=[..._.fields[t].languages],_.fields[t].languages.push({title:_.fields[t].languages[0].title,languageId:selectedLanguage}),e=!0);e&&(setSelectedGroup(_),setGroupChanged(!0))}},getTitle=e=>{var _;return(null===(_=e.find((e=>e.languageId===selectedLanguage))||e.find((e=>e.languageId===languageId))||e[0])||void 0===_?void 0:_.title)||""},onValueChange=e=>{let field=e.target.name,updatedState=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);"checkbox"===e.target.type?field="updatedState.".concat(field," = e.target.checked"):(-1!==field.indexOf("languages.title")&&(field=field.replace("languages.","languages.find(_ => _.languageId === selectedLanguage).")),field="updatedState.".concat(field," = e.target.value")),eval(field),setSelectedGroup(updatedState),setGroupChanged(!0)},onProfileChange=e=>{let _=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);_.objectProfileSelections=e.map((e=>({objectProfileId:e,objectBaseAttributeFieldGroupId:_.id}))),setSelectedGroup(_),setGroupChanged(!0)},onClassChange=e=>{let _=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);_.objectClassSelections=e.map((e=>({objectClassId:e,objectBaseAttributeFieldGroupId:_.id}))),setSelectedGroup(_),setGroupChanged(!0)},addAttributeGroup=()=>
1{if(groupChanged&&!confirm("Muutoksia ei ole tallennettu, haluatko silti poistua?"))return;const e={id:Date.now().toString(),serviceSetId:serviceSet.id,status:_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.c5.Active,objectTypeId:objectTypeId,viewOrder:attributeGroups.length?attributeGroups[attributeGroups.length-1].viewOrder+1:0,languages:[{id:null,title:"",languageId:selectedLanguage}],fields:[],requirements:[],objectProfileSelections:[]};let _=[...attributeGroups,e];setAttributeGroups(_),setSelectedGroup(e),setSelectedGroupId(e.id),setGroupChanged(!0)},addField=()=>{var e;let _=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);_.fields.push({serviceSetId:selectedGroup.serviceSetId,languages:[{languageId:selectedLanguage,title:""}],type:_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.Ps.Text,isRequired:!0,viewOrder:100*_.viewOrder+((null===(e=_.fields)||void 0===e?void 0:e.length)||0),prefix:"",suffix:""}),setSelectedGroup(_),setGroupChanged(!0)},removeField=e=>{let _=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);_.fields.splice(e,1),setSelectedGroup(_),setGroupChanged(!0)},addRequirement=()=>{let e=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);e.requirements.push({serviceSetId:selectedGroup.serviceSetId,objectBaseAttributeFieldId:null,type:_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.z3.Equals,value:""}),setSelectedGroup(e),setGroupChanged(!0)},removeRequirement=e=>{let _=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);_.requirements.splice(e,1),setSelectedGroup(_),setGroupChanged(!0)},removeAttributeGroup=async e=>{if(confirm("Haluatko varmasti poistaa attribuuttiryhm\xe4n?"))try{isNewGroup(e)||await _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Object.ObjectBaseAttributeFieldGroups.remove(e)}catch(_){console.error(_)}finally{let _=[...attributeGroups];_.splice(_.findIndex((_=>_.id===e)),1),setAttributeGroups(_),setSelectedGroup(null),setSelectedGroupId(null)}},changeSelectedGroup=e=>{groupChanged&&!confirm("Muutoksia ei ole tallennettu, haluatko silti poistua?")||(isNewGroup(e)?setGroupChanged(!0):setGroupChanged(!1),setSelectedGroupId(e))},saveAttributeGroup=e=>(e.preventDefault(),(async()=>{setIsLoading(!0);try{const e=isNewGroup(selectedGroup.id);let _=selectedGroup.id+"";const t=e?await _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Object.ObjectBaseAttributeFieldGroups.add(selectedGroup):await _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Object.ObjectBaseAttributeFieldGroups.update(selectedGroup);if(e){let e=[...attributeGroups];e.splice(e.findIndex((e=>e.id===_)),1,t.data),setAttributeGroups(e),setSelectedGroupId(t.data.id)}setSelectedGroup(t.data),setGroupChanged(!1),react_toastify__WEBPACK_IMPORTED_MODULE_9__.oR.success(lang.saveOk)}catch(e){console.error(e)}finally{setIsLoading(!1)}})(),!1),onGroupSortEnd=e=>{let{oldIndex:_,newIndex:t}=e;if(_===t)return;const s=(0,react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__.be)(attributeGroups,_,t);for(let r=0;r<s.length;r++)if(s[r].viewOrder=r+1,!isNewGroup(s[r].id)&&r===t){let e=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},s[r]);e.fields=null,e.objectProfileSelections=null,e.objectClassSelections=null,e.requirements=null,_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.FH.Object.ObjectBaseAttributeFieldGroups.update(e)}setAttributeGroups(s)},onFieldSortEnd=e=>{let{oldIndex:_,newIndex:t}=e;if(_===t)return;const s=(0,C_sisu_monijulkaisu_code_Kosila360_Web_Admin_ClientApp_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_17__.A)({},selectedGroup);s.fields=(0,react_sortable_hoc__WEBPACK_IMPORTED_MODULE_11__.be)(s.fields,_,t);for(let r=0;r<s.fields.length;r++)s.fields[r].viewOrder=100*s.viewOrder+r;setGroupChanged(!0),setSelectedGroup(s)},isNewGroup=e=>!Number.isNaN(Number(e));return systemLanguages.loading?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.ZC,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div",{className:"animated fadeIn",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_18__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_19__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_20__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_21__.A,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_18__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_19__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{className:"icon-settings siteAdmin"})," Attribuutit"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_19__.A,{xs:"3",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"select",id:"select",value:selectedLanguage,onChange:e=>setSelectedLanguage(e.target.value),children:systemLanguages.result.data.map(((e,_)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("option",{value:e.id,children:e.title},_)))})})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_22__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_components_ObjectTypeSelect__WEBPACK_IMPORTED_MODULE_5__.A,{useObjectType:!0,value:objectTypeType,placeholder:lang.chooseObjectType,onCh
1ange:(e,_)=>{setObjectTypeType(_),setObjectTypeId(e)},languageId:languageId}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("hr",{}),objectTypeType&&!attributeGroupsQuery.loading&&attributeGroups&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_18__.A,{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_19__.A,{xs:"2",className:"border-right",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_16__.A,{type:"button",onClick:addAttributeGroup,color:"success",className:"btn-block mb-2",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{className:"fa fa-plus"})," Lis\xe4\xe4 attribuuttiryhm\xe4"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("hr",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(GroupSortableList,{items:attributeGroups,selectedGroupId:selectedGroupId,changeSelectedGroup:changeSelectedGroup,getTitle:getTitle,onSortEnd:onGroupSortEnd,pressDelay:150,pressThreshold:20,useDragHandle:!0})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_19__.A,{xs:"10",children:!selectedGroupQuery.loading&&!attributeFields.loading&&selectedGroup&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_23__.A,{onSubmit:saveAttributeGroup,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_16__.A,{type:"button",onClick:()=>removeAttributeGroup(selectedGroup.id),color:"danger",className:"pull-right",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{className:"fa fa-tras
1h"})," Poista attribuuttiryhm\xe4"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_24__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_25__.A,{className:"pb-1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("strong",{children:"Nimi:"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"text",placeholder:"Attribuuttiryhm\xe4n nimi",value:getTitle(selectedGroup.languages),name:"languages.title",onChange:onValueChange,required:!0})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_24__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_25__.A,{className:"py-1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("strong",{children:"N\xe4yt\xe4 vain luokille:"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(components_ObjectClassSelect__WEBPACK_IMPORTED_MODULE_10__.A,{serviceSetId:serviceSet.id,languageId:languageId,objectTypeIdList:[objectTypeId],onChange:onClassChange,isControlled:!0,placeholder:"N\xe4yt\xe4 vain luokille",value:null!==(_selectedGroup$object=null===(_selectedGroup$object2=selectedGroup.objectClassSelections)||void 0===_selectedGroup$object2?void 0:_selectedGroup$object2.map((e=>e.objectClassId)))&&void 0!==_selectedGroup$object?_selectedGroup$object:[],multiple:!0})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_24__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_25__.A,{className:"py-1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("strong",{children:"N\xe4yt\xe4 vain profiileille:"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(components_ObjectProfileMultiSelect__WEBPACK_IMPORTED_MODULE_8__.A,{serviceSetId:serviceSet.id,languageId:languageId,objectTypeIdList:[objectTypeId],onChange:onProfileChange,isControlled:!0,placeholder:"N\xe4yt\xe4 vain profiileille",value:null!==(_selectedGroup$object3=null===(_selectedGroup$object4=selectedGroup.objectProfileSelections)||void 0===_selectedGroup$object4?void 0:_selectedGroup$object4.map((e=>e.objectProfileId)))&&void 0!==_selectedGroup$object3?_selectedGroup$object3:[]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_24__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_25__.A,{className:"py-1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("strong",{children:"N\xe4yt\xe4 vain jos:"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_26__.A,{borderless:!0,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("thead",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("tr",{className:"table-secondary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:"Attribuutti"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:"Operaattori"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:"Arvo"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("tbody",{children:selectedGroup.requirements.map(((e,_)=>{var t,s,r,i,a;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"select",name:"requirements[".concat(_,"].objectBaseAttributeFieldId"),onChange:onValueChange,placeholder:"Valitse attribuutti",required:!0,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("option",{value:"",children:"(Valitse attribuutti)"}),null===(t=attributeFields.result)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.map((_=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("option",{value:_.id,selected:e.objectBaseAttributeFieldId===_.id,children:getTitle(_.languages)},_.id)))]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{type:"select",name:"requirements[".concat(_,"].type"),onChange:onValueChange,placeholder:"Valitse",required:!0,value:e.type,children:enumToArray(_k360_core_components__WEBPACK_IMPORTED_MODULE_7__.z3).map((e=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("option",{value:e.value,children:translateRequirementType(e.value)},"fieldtype-"+e.name)))})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("td",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_15__.A,{list:"values_"+e.id,type:"text",value:e.value||"",name:"requirements[".concat(_,"].value"),onChange:onValueChange,placeholder:"Arvo",autoComplete:"off"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("datalist",{id:"values_"+e.id,children:null===(r=attributeFields.result)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.find((_=>_.id===e.objectBaseAttributeFieldId)))||void 0===a?void 0:a.values.split("\n").map((e=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("option",{value:e})))})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{width:"55px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_16__.A,{type:"button",color:"danger",onClick:()=>
1removeRequirement(_),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{className:"fa fa-trash"})})})]})}))})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_16__.A,{onClick:addRequirement,color:"success",type:"button",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{className:"fa fa-plus"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_24__.A,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_25__.A,{className:"py-1",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("strong",{children:"Attribuutit:"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_26__.A,{borderless:!0,responsive:!0,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("thead",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("tr",{className:"table-secondary",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"200px"},children:"Nimi"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"200px"},children:"Tyyppi"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"200px"},children:"Oletusarvo"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"300px"},children:"Valinnat (rivinvaihdolla erotettuna)"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"100px"},children:"Etuliite"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"100px"},children:"Takaliite"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:"Pakollinen?"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:"Haettava?"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:"N\xe4ytett\xe4v\xe4?"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{children:"Pikafiltteri?"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"200px"},children:"Validointi RegEx"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{style:{minWidth:"200px"},children:"Esimerkki arvo"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("td",{})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(FieldSortableList,{items:selectedGroup.fields,onValueChange:onValueChange,removeField:removeField,getTitle:getTitle,onSortEnd:onFieldSortEnd,pressDelay:150,pressThreshold:20,useDragHandle:!0})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_16__.A,{onClick:addField,color:"success",type:"button",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("i",{className:"fa fa-plus"})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div",{className:"text-right",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(reactstrap__WEBPACK_IMPORTED_MODULE_16__.A,{color:"info",disabled:isLoading||!groupChanged,type:"submit",children:[isLoading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(reactstrap__WEBPACK_IMPORTED_MODULE_27__.A,{size:"sm"}),"\xa0Tallenna"]})})]})})})]})]})]})})})})},translateRequirementType=e=>{switch(e){case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.z3.Contains:return"sis\xe4lt\xe4\xe4";case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.z3.Equals:return"on yht\xe4kuin";case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.z3.NotEquals:return"ei ole";case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.z3.NotContains:return"ei sis\xe4ll\xe4"}},shouldDisableValueField=e=>{switch(Number(e)){case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.Ps.Select:case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.Ps.Checkbox:case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.Ps.Radio:case _k360_core_components__WEBPACK_IMPORTED_MODULE_7__.Ps.NumberSelectHybrid:return!1;default:return!0}},enumToArray=e=>Object.keys(e).filter((e=>isNaN(Number(e)))).map((_=>({name:_,value:e[_]}))),__WEBPACK_DEFAULT_EXPORT__=(0,_withAuthentication__WEBPACK_IMPORTED_MODULE_4__.A)(ObjectBaseAttributes)},38773:(e,_,t)=>{t.d(_,{A:()=>
1o});var s=t(89379),r=t(9950),i=t(16673),a=t(77397),n=t(50125),l=t(44414);function o(e){const _=new a.A;class t extends r.Component{constructor(e){if(super(e),this.state={user:null,referrer:null},_.loggedInAsUser())try{this.state.user=_.getProfile()}catch(r){_.logout();const{AuthenticationContext:t}=e;_.updateDataToAuthenticationContext(t)}else{var t,s;const _=(null===(t=e.history)||void 0===t||null===(s=t.location)||void 0===s?void 0:s.pathname)||null;this.state.referrer=_}}render(){const{user:_,referrer:t}=this.state;return _?(0,l.jsx)(e,(0,s.A)({user:this.state.user},this.props)):(0,l.jsx)(i.Redirect,{to:{pathname:"/login",state:{referrer:t}}})}}return(0,n.yI)(t)}},41627:()=>{},46437:(e,_,t)=>{t.d(_,{A:()=>E});var s=t(89379),r=t(9950),i=t(23613),a=t(58195),n=t(14113),l=t(99308),o=t(42062),c=t(29834),d=t(20030),p=t(44414);class u extends r.Component{constructor(e){super(e)}render(){return"modal"===this.props.style?(0,p.jsxs)(a.A,{isOpen:!0,size:"xl",children:[(0,p.jsx)(n.A,{toggle:this.props.onCancel,children:d.v.chooseObjectType}),(0,p.jsx)(l.A,{children:(0,p.jsx)(o.A,{options:this.props.options||[],value:this.props.selectedOption||"",name:"selectedOption",placeholder:this.props.placeholder,onChange:this.props.onChange,renderOption:this.renderObjectTypeOption,style:{width:"100%"},search:!0,filterOptions:c.A})})]}):(0,p.jsx)(o.A,{options:this.props.options||[],value:this.props.selectedOption||"",name:"selectedOption",placeholder:this.props.placeholder,onChange:this.props.onChange,renderOption:this.renderObjectTypeOption,search:!0,filterOptions:c.A})}renderObjectTypeOption(e,_){return(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("button",(0,s.A)((0,s.A)({className:"select-search__option",type:"button"},e),{},{children:[(0,p.jsx)("i",{className:_.iconClass}),"\xa0",(0,p.jsx)("span",{children:_.name})]}))})}}class E extends r.Component{constructor(e){super(e),this.isStillLoading=()=>{let e=[this.state.options];var _=!0;e.map((e=>{_=_&&null!==e})),this.setState({isLoading:!_})},this.onSelectedOptionChange=this.onSelectedOptionChange.bind(this),this.state={isLoading:!0,options:null,selectedOptionId:this.props.value}}componentDidMount(){this.getObjectTypes()}componentDidUpdate(e){if(e.nullOptionPlaceholder!==this.props.nullOptionPlaceholder){const{options:e}=this.state;this.state.options&&(e.find((e=>e.value===this.props.nullOptionValue)).name=this.props.nullOptionPlaceholder,this.setState({options:e}))}}getObjectTypes(){i.A.Object.ObjectTypes.getList(this.props.languageId).then((e=>{let _=this.props.objectTypeIdList?e.data.filter((e=>this.props.objectTypeIdList.includes(e.id))):e.data,t=this.convertOptionsToSelectSearch(_);this.props.forceValue&&i.A.CommonUtils.isEmpty(this.props.value)&&_>0&&(this.setState({selectedOptionId:_[0].id},this.isStillLoading),this.props.onChange(_[0].id)),this.props.isNullable&&t.unshift({name:this.props.nullOptionPlaceholder,value:this.props.nullOptionValue,iconClass:"icon-puzzle sysAdmin"}),this.setState({options:t},this.isStillLoading)})).catch((e=>{console.error(e)}))}convertOptionsToSelectSearch(e){return e.map((e=>({name:e.title,value:e.id,iconClass:e.iconClass,type:e.type})))}onSelectedOptionChange(e){this.setState({selectedOptionId:e});const _=this.state.options.find((_=>_.value===e));this.props.onChange(e,null===_||void 0===_?void 0:_.type)}render(){return this.state.isLoading?"":(0,p.jsx)(u,(0,s.A)((0,s.A)({},this.props),{},{options:this.state.options,selectedOption:this.state.selectedOptionId,onChange:this.onSelectedOptionChange,placeholder:this.props.placeholder}))}}},83584:(e,_,t)=>{t.d(_,{A:()=>c});var s=t(89379),r=t(9950),i=t(23613),a=t(40095),n=(t(41627),t(44414));const{SHOW_ALL:l}=a.A;class o extends r.Component{constructor(e){super(e)}render(){let e=null;return this.props.isControlled&&(e={value:this.props.selectedOptions}),(0,n.jsx)(a.A,(0,s.A)({style:{width:"100%"},treeData:this.props.options||[],placeholder:this.props.placeholder,onChange:this.props.onChange,multiple:!0,showCheckedStrategy:l,treeDefaultExpandedKeys:[],treeNodeFilterProp:"title"},e))}}class c extends r.Component{constructor(e){var _;super(e),_=this,this.isStillLoading=()=>{let e=[this.props.serviceSetId,this.props.languageId,this.state.options,this.state.objectProfiles];var _=!0;e.map((e=>{_=_&&null!==e})),this.setState({isLoading:!_})},this.filterExluded=e=>e.filter((e=>!this.props.excludeProfiles||!this.props.excludeProfiles.length||-1===this.props.excludeProfiles.indexOf(e.id))),this.get
1SelectedListByIds=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var s=[];null==t&&(t=_.state.objectProfiles);for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r].id)&&s.push(t[r]),t[r].children&&t[r].children.length){var i=_.getSelectedListByIds(e,t[r].children);s=s.concat(i)}return s},this.onSelectedOptionChange=this.onSelectedOptionChange.bind(this),this.mapChildren=this.mapChildren.bind(this),this.state={isLoading:!0,options:null,objectProfiles:null,objectProfileRootTitle:"",isControlled:!1,placeholder:this.props.placeholder}}componentDidMount(){this.getObjectProfiles(this.props.languageId,this.props.serviceSetId,this.props.objectTypeIdList),(this.props.hasOwnProperty("onDeselect")&&this.props.hasOwnProperty("onSelect")&&!this.props.hasOwnProperty("onChange")||this.props.isControlled)&&this.setState({isControlled:!0})}componentDidUpdate(e){JSON.stringify(this.props.objectTypeIdList)!==JSON.stringify(e.objectTypeIdList)&&this.getObjectProfiles(this.props.languageId,this.props.serviceSetId,this.props.objectTypeIdList)}getObjectProfiles(e,_,t){let s=null;s=this.props.objectProfileRootId?i.A.Object.ObjectProfiles.getSingleWithLanguage(this.props.objectProfileRootId,this.props.languageId,!0,this.props.profileNodesAlphabeticalSort):t&&1===t.length?i.A.Object.ObjectProfiles.getListByObjectType(e,_,t[0],this.props.profileNodesAlphabeticalSort):i.A.Object.ObjectProfiles.getTreeListByServiceSet(e,_),s.then((e=>{let _=t&&t.length>1?e.data.filter((e=>t.includes(e.objectTypeId))):e.data,s="";Array.isArray(_)||(s=_.title,_=_.children),this.setState({objectProfiles:_,isLoading:!1,objectProfileRootTitle:s,options:this.mapChildren(_)},this.isStillLoading)})).catch((e=>{console.error(e)}))}mapChildren(e){return this.filterExluded(e).map((e=>({value:e.id,title:e.title?e.title:"TODO: Get child language",children:this.mapChildren(e.children),disabled:!(!e.children.length||!this.props.selectLeafsOnly)})))}onSelectedOptionChange(e,_,t){const{preValue:s,triggerNode:r,triggerValue:i}=t;console.log(e),s.length>e.length?this.props.hasOwnProperty("onDeselect")&&this.props.onDeselect(i):s.length<e.length&&this.props.hasOwnProperty("onSelect")&&this.props.onSelect(i),this.props.hasOwnProperty("onChange")&&this.props.onChange(e,this.getSelectedListByIds(e))}render(){return this.state.isLoading?"":(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(o,(0,s.A)((0,s.A)({},this.props),{},{options:this.state.options,selectedOptions:this.props.value,onChange:this.onSelectedOptionChange,placeholder:this.props.objectProfileRootId?this.state.objectProfileRootTitle:this.props.placeholder,isControlled:this.state.isControlled,expandAll:this.props.expandAll}))})}}},89668:(e,_,t)=>{t.d(_,{A:()=>c});var s=t(89379),r=t(9950),i=(t(23931),t(50651),t(76991),t(23613)),a=t(40095),n=t(44414);const{SHOW_ALL:l}=a.A;class o extends r.Component{constructor(e){super(e)}render(){let e=null;return this.props.isControlled&&(e={value:this.props.selectedOptions}),(0,n.jsx)(a.A,(0,s.A)({style:{width:"100%"},treeData:this.props.options||[],placeholder:this.props.placeholder,onChange:this.props.onChange,multiple:this.props.multiple,showCheckedStrategy:l,treeDefaultExpandedKeys:[],treeNodeFilterProp:"title"},e))}}class c extends r.Component{constructor(e){super(e),this.isStillLoading=()=>{let e=[this.props.serviceSetId,this.props.languageId,this.state.options,this.state.objectClasses];var _=!0;e.map((e=>{_=_&&null!==e})),this.setState({isLoading:!_})},this.onSelectedOptionChange=this.onSelectedOptionChange.bind(this),this.mapChildren=this.mapChildren.bind(this),this.state={isLoading:!0,options:null,objectClasses:null,isControlled:!1}}componentDidMount(){this.getObjectClasses(this.props.languageId,this.props.serviceSetId,this.props.objectTypeIdList),(this.props.hasOwnProperty("onDeselect")&&this.props.hasOwnProperty("onSelect")&&!this.props.hasOwnProperty("onChange")||this.props.isControlled)&&this.setState({isControlled:!0})}componentDidUpdate(e){JSON.stringify(this.props.objectTypeIdList)!==JSON.stringify(e.objectTypeIdList)&&this.getObjectClasses(this.props.languageId,this.props.serviceSetId,this.props.objectTypeIdList)}getObjectClasses(e,_,t){let s=null;
1s=t&&1===this.props.objectTypeIdList.length?i.A.Object.ObjectClasses.getListByObjectType(e,_,t[0]):i.A.Object.ObjectClasses.getTreeListByServiceSet(e,_),s.then((e=>{let _=t&&t.length>1?e.data.filter((e=>t.includes(e.objectTypeId))):e.data;this.setState({objectClasses:_,isLoading:!1,options:this.mapChildren(_)},this.isStillLoading)})).catch((e=>{console.error(e)}))}mapChildren(e){return e.map((e=>({value:e.id,title:e.title?e.title:"TODO: Get child language",children:this.mapChildren(e.children)})))}onSelectedOptionChange(e,_,t){const{preValue:s,triggerNode:r,triggerValue:i}=t;s.length>e.length?this.props.hasOwnProperty("onDeselect")&&this.props.onDeselect(i):s.length<e.length&&this.props.hasOwnProperty("onSelect")&&this.props.onSelect(i),this.props.hasOwnProperty("onChange")&&this.props.onChange(e)}render(){return this.state.isLoading?"":(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o,(0,s.A)((0,s.A)({},this.props),{},{options:this.state.options,selectedOptions:this.props.value,onChange:this.onSelectedOptionChange,placeholder:this.props.placeholder,isControlled:this.state.isControlled,expandAll:this.props.expandAll,multiple:this.props.multiple})),false]})}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.