1import{a as j,c as Fe,d as Ge,e as Pe,f as Ie,g as We,l as E,n as Re,q as Ne,r as k}from"./chunk-G55KY5EL.js";import{a as ze,b as Be}from"./chunk-IN3GWWF6.js";import{a as Me}from"./chunk-VPKMWEGY.js";import{a as Ee}from"./chunk-BZ4UN43Z.js";import{b as l,c,e as d}from"./chunk-BA64KDZ5.js";import{a as we}from"./chunk-KOZZKWPI.js";import{b as De,c as L,d as _e,e as Ve}from"./chunk-LKQQSM5Z.js";import"./chunk-B5PFSOIK.js";import"./chunk-3C3QH4ZZ.js";import{E as Se,F as he,J as xe,L as fe,Q as Te,R as ye,aa as ve,ba as I,ca as Ce,fa as ge,ga as W,ha as be,ia as R,ka as N,la as Q}from"./chunk-IR6PBZTK.js";import"./chunk-KJDJQTST.js";import{Sb as pe,Tb as ce}from"./chunk-QLISZWJ4.js";import{Bb as f,Cb as T,Db as y,Ga as Y,Ia as o,Ka as Z,L as z,Lb as g,Mb as b,Qa as D,Qc as oe,Sa as B,Ta as ee,Ve as me,Xc as ne,Xd as le,Zc as se,Ze as $,bb as te,cb as ie,ge as ue,ha as J,hb as u,he as H,ia as X,ib as n,ie as O,jb as m,kb as C,md as F,nd as G,oa as S,od as _,pa as h,pd as de,sb as V,uc as re,vb as x,vd as P,xb as ae}from"./chunk-2N3TROBO.js";var w=de(Re),Qe=_(w,s=>s.originRoute);var Le=_(w,s=>s.dataSetEditor.isValid),ke=_(w,s=>s.dataSetEditor.dataSet),lt=_(w,s=>s.dataSetEditor.currentView);var M=class{constructor(r,q){this.view=r,this.isValid=q;}};var $e=["validationGroup"],je=["nameInputField"],Ke=["descriptionInputField"],Ae=["dataSourceTextBox"],Ue=["dataSourceGroupCodeTextBox"],Je=["structureTypeSelectBox"],Xe=["datasetStructureTypeSelectBox"],Ye=["dimensionSelectBox"];function Ze(s,r){if(s&1){let q=V();n(0,"div")(1,"label"),g(2,"Spatial layer ID"),m(),n(3,"dx-number-box",18),x("onValueChanged",function(i){S(q);let e=ae();return h(e.onSpatialLayerIdSelected(i));}),m()();}s&2&&(o(3),u("stylingMode","outlined"));}var qe=(()=>{let r=class r{constructor(t,i,e){this.store=t,this.wizardService=i,this.hnServerClient=e,this.dataSetFormText=k,this.dataSetFormDescription="Use the HN4S management tool retrieve the values for the form fields below.",this.dataSourceCodeRequiredMessage="Provide a data source code",this.dataSourceGroupRequiredMessage="Please provide a data source group code",this.structureTypeRequiredMessage="Select a HN4S structure type",this.dataSetNamePlaceholder="Provide the name of the data set name",this.selectStructureTypeText="Select a structure type",this.selectDimensionTypeText="Select a dimension",this.dataSourceCodeText="Data source code",this.dataSourceGroupCodeText="Data source group code",this.hn4sStructureTypeText="HN4S Structure type",this.dataSetNameText="Data set name",this.structureTypeText="Structure type",this.dataSourceCodeSelectboxText="Use the dropdown box to prefill some usefull information. Note that the contents of the fields is used to generate the dataset.",this.exampleText=ue,this.provideNameText=me,this.dimensionText=le,this.datasourcesKeys=[],this.cancel=new Z(),this.subscriptions=new P(),this.DataStructureType=l,this.dimensions=[{name:c.Time,id:c.Time},{name:c.Model,id:c.Model},{name:c.Ensemble,id:c.Ensemble},{name:c.None,id:c.None}],this.dataStructures=[{name:l.Feature,id:l.Feature},{name:l.Grid,id:l.Grid},{name:l.Renderer,id:l.Renderer},{name:l.SpatialAggregation,id:l.SpatialAggregation},{name:l.SpatialLayer,id:l.SpatialLayer},{name:l.TimeSeries,id:l.TimeSeries},{name:l.Variable,id:l.Variable}],this.hn4StructureTypes=[{name:d.EnsembleGrid,id:d.EnsembleGrid},{name:d.EnsembleTimeSeries,id:d.EnsembleTimeSeries},{name:d.Grid,id:d.Grid},{name:d.Location,id:d.Location},{name:d.ModelGrid,id:d.ModelGrid},{name:d.ModelTimeSeries,id:d.ModelTimeSeries},{name:d.SpatialLayer,id:d.SpatialLayer},{name:d.TimeSeries,id:d.TimeSeries}],this.readers=[{dataSourceCode:null,dataSourceGroupCode:null,structureType:null,order:0,readerSettings:null}];}ngOnInit(){this.subscriptions.add(this.wizardService.getWizard("dataSetTemplateEditorWizard").onFinish.subscribe(()=>{this.store.dispatch(Fe({readers:this.readers})),this.setWizardValidState();})),this.subscriptions.add(this.hnServerClient.getAllDataSources().subscribe(t=>{this.datasourcesKeys=Object.keys(t),this.datasources=t;}));}ngAfterViewInit(){}prefillDatasourceForm(t){switch(this.dataSourceTextBox.value=this.datasources[t].C
1ode,this.dataSourceGroupCodeTextBox.value=this.datasources[t].DataSourceGroupCode,this.structureTypeSelectBox.value=this.datasources[t].PrimaryStructureType,this.datasources[t].PrimaryStructureType){case d.TimeSeries:this.datasetStructureTypeSelectBox.value=l.TimeSeries,this.dimensionSelectBox.value=c.Time;break;case d.ModelTimeSeries:this.datasetStructureTypeSelectBox.value=l.TimeSeries,this.dimensionSelectBox.value=c.Model;break;case d.EnsembleTimeSeries:this.datasetStructureTypeSelectBox.value=l.TimeSeries,this.dimensionSelectBox.value=c.Ensemble;break;case d.Grid:this.datasetStructureTypeSelectBox.value=l.Grid,this.dimensionSelectBox.value=c.Time;break;case d.ModelGrid:this.datasetStructureTypeSelectBox.value=l.Grid,this.dimensionSelectBox.value=c.Model;break;case d.EnsembleGrid:this.datasetStructureTypeSelectBox.value=l.Grid,this.dimensionSelectBox.value=c.Ensemble;break;case d.SpatialLayer:this.datasetStructureTypeSelectBox.value=l.SpatialLayer,this.dimensionSelectBox.value=c.None;break;default:break;}}onDimensionTypeSelected(t){this.store.dispatch(Ge({dimensionType:t.value}));}onDataStructureSelected(t){this.store.dispatch(Pe({dataStructure:t.value}));}onHn4StructureSelected(t){t.value!==l.SpatialLayer&&(this.readers[0].readerSettings=null),this.readers[0].structureType=t.value;}onDataSourceGroupCodeChange(t){this.readers[0].dataSourceGroupCode=t.value;}onDataSourceCodeChange(t){this.readers[0].dataSourceCode=t.value;}onNameChange(t){this.store.dispatch(Ie({name:t.value}));}onSpatialLayerIdSelected(t){this.readers[0].readerSettings=[{attributeId:7,value:t.value,attribute:{attributeId:7}}];}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe();}setWizardValidState(){if(this.validationGroup.instance.validate().isValid&&this.readers[0].dataSourceCode!==null&&this.readers[0].dataSourceCode!==void 0&&this.readers[0].dataSourceGroupCode!==null&&this.readers[0].dataSourceGroupCode!==void 0&&this.readers[0].structureType!==null&&this.readers[0].structureType!==void 0){let i=new M(E.Form,!0);this.store.dispatch(j({dataSetEditorValidState:i}));}else{let i=new M(E.Form,!1);this.store.dispatch(j({dataSetEditorValidState:i}));}}};r.ɵfac=function(i){return new(i||r)(D(F),D(L),D(ze));},r.ɵcmp=B({type:r,selectors:[["data-set-form"]],viewQuery:function(i,e){if(i&1&&(f($e,5),f(je,5),f(Ke,5),f(Ae,5),f(Ue,5),f(Je,5),f(Xe,5),f(Ye,5)),i&2){let a;T(a=y())&&(e.validationGroup=a.first),T(a=y())&&(e.nameInputField=a.first),T(a=y())&&(e.descriptionInputField=a.first),T(a=y())&&(e.dataSourceTextBox=a.first),T(a=y())&&(e.dataSourceGroupCodeTextBox=a.first),T(a=y())&&(e.structureTypeSelectBox=a.first),T(a=y())&&(e.datasetStructureTypeSelectBox=a.first),T(a=y())&&(e.dimensionSelectBox=a.first);}},decls:48,vars:29,consts:[["validationGroup",""],["dataSourceTextBox",""],["dataSourceGroupCodeTextBox",""],["structureTypeSelectBox",""],["nameTextBox",""],["datasetStructureTypeSelectBox",""],["dimensionSelectBox",""],[1,"card"],[1,"card-header"],[1,"card-body"],[3,"description"],[1,"inputContainer"],[3,"valueChange","placeholder","items","stylingMode","searchEnabled"],["id","dataSourceTextBox","valueChangeEvent","keyup","maxLength","255","stylingMode","outlined","validationMessageMode","always",3,"onValueChanged","placeholder"],["type","required",3,"message"],["id","dataSourceGroupCodeTextBox","valueChangeEvent","keyup","maxLength","255","stylingMode","outlined","validationMessageMode","always",3,"onValueChanged","placeholder"],["displayExpr","name","valueExpr","id",3,"onValueChanged","items","stylingMode"],["id","nameTextBox","valueChangeEvent","keyup","maxLength","255","stylingMode","outlined","validationMessageMode","always",3,"onValueChanged","placeholder"],[3,"onValueChanged","stylingMode"]],template:function(i,e){if(i&1){let a=V();n(0,"div",7)(1,"div",8),g(2),m(),n(3,"div",9),C(4,"tool-description",10),n(5,"dx-validation-group",null,0)(7,"div",11)(8,"label"),g(9),m(),n(10,"dx-select-box",12),x("valueChange",function(p){return S(a),h(e.prefillDatasourceForm(p));}),m(),n(11,"label"),g(12),m(),n(13,"dx-text-box",13,1),x("onValueChanged",function(p){return S(a),h(e.onDataSourceCodeChange(p));}
1),n(15,"dx-validator"),C(16,"dxi-validation-rule",14),m()(),n(17,"label"),g(18),m(),n(19,"dx-text-box",15,2),x("onValueChanged",function(p){return S(a),h(e.onDataSourceGroupCodeChange(p));}),n(21,"dx-validator"),C(22,"dxi-validation-rule",14),m()(),n(23,"label"),g(24),m(),n(25,"dx-select-box",16,3),x("onValueChanged",function(p){return S(a),h(e.onHn4StructureSelected(p));}),n(27,"dx-validator"),C(28,"dxi-validation-rule",14),m()(),te(29,Ze,4,1,"div"),n(30,"label"),g(31),m(),n(32,"dx-text-box",17,4),x("onValueChanged",function(p){return S(a),h(e.onNameChange(p));}),n(34,"dx-validator"),C(35,"dxi-validation-rule",14),m()(),n(36,"label"),g(37),m(),n(38,"dx-select-box",16,5),x("onValueChanged",function(p){return S(a),h(e.onDataStructureSelected(p));}),n(40,"dx-validator"),C(41,"dxi-validation-rule",14),m()(),n(42,"label"),g(43),m(),n(44,"dx-select-box",16,6),x("onValueChanged",function(p){return S(a),h(e.onDimensionTypeSelected(p));}),n(46,"dx-validator"),C(47,"dxi-validation-rule",14),m()()()()()();}i&2&&(o(2),b(e.dataSetFormText),o(2),u("description",e.dataSetFormDescription),o(5),b(e.dataSourceCodeSelectboxText),o(),u("placeholder",e.exampleText+": Knmi.Radar.Uncorrected")("items",e.datasourcesKeys)("stylingMode","outlined")("searchEnabled",!0),o(2),b(e.dataSourceCodeText),o(),u("placeholder",e.exampleText+": Knmi.Radar.Uncorrected"),o(3),u("message",e.dataSourceCodeRequiredMessage),o(2),b(e.dataSourceGroupCodeText),o(),u("placeholder",e.exampleText+": Knmi"),o(3),u("message",e.dataSourceGroupRequiredMessage),o(2),b(e.hn4sStructureTypeText),o(),u("items",e.hn4StructureTypes)("stylingMode","outlined"),o(3),u("message",e.structureTypeRequiredMessage),o(),ie(e.readers[0].structureType===e.DataStructureType.SpatialLayer?29:-1),o(2),b(e.dataSetNameText),o(),u("placeholder",e.dataSetNamePlaceholder),o(3),u("message",e.provideNameText),o(2),b(e.structureTypeText),o(),u("items",e.dataStructures)("stylingMode","outlined"),o(3),u("message",e.selectStructureTypeText),o(2),b(e.dimensionText),o(),u("items",e.dimensions)("stylingMode","outlined"),o(3),u("message",e.selectDimensionTypeText));},dependencies:[we,W,ge,ye,Te,I,ve,R,be,pe,ce,he,Se],styles:[".card[_ngcontent-%COMP%]{margin-bottom:0;min-height:450px;height:auto}dx-text-area[_ngcontent-%COMP%], dx-select-box[_ngcontent-%COMP%], dx-text-box[_ngcontent-%COMP%]{margin-bottom:1.25rem}.inputContainer[_ngcontent-%COMP%]{max-width:400px}"]});let s=r;return s;})();var et=["dataSetTemplateEditorWizard"],tt=["validationGroup"],it=["exit-popup"],A=(()=>{let r=class r{unloadNotification(t){t.returnValue=!0;}constructor(t,i,e){this.router=t,this.store=i,this.wizardService=e,this.dataSetEditorText="Data Set Editor",this.resumeEditingText=$,this.exitText=H,this.finishText=O,this.dataToolText=Ne,this.dataSetFormText=k,this.cancelWizardButton=new Q(N.light,!1,null,null,$),this.exitWizardButton=new Q(N.danger,!1,null,null,H),this.finishWizardButton=new Q(N.primary,!1,null,null,O),this.pageTitle=this.dataSetEditorText,this.dataToolRouterLink=["tool/data-tool"],this.navigationItems=[{text:this.dataToolText,routerLink:["/tool/data-tool"]},{text:this.pageTitle}],this.exitPopupVisiblity=!1,this.DataSetTemplateEditorView=E,this.subscriptions=new P();}ngAfterViewInit(){this.subscriptions.add(this.wizardService.getWizard("dataSetTemplateEditorWizard").onFinish.pipe(z(1)).subscribe(()=>{this.onFinishWizard();}));}ngOnInit(){}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe();}onFinishWizard(){this.subscriptions.add(this.store.pipe(G(Le),z(1)).subscribe(t=>{this.isWizardValid(t)===!0&&this.saveDataSetEditorState();}));}isWizardValid(t){let i=[];return t.filter(e=>{if(e.isValid===!1)return i.push(e);}),i.length===0;}saveDataSetEditorState(){this.subscriptions.add(this.store.pipe(G(ke),z(1)).subscribe(t=>{let i=t;i.$type="Hn4SDataSetDto",i.readers[0].structureType!==d.SpatialLayer&&(i.readers[0].readerSettings=null),this.store.dispatch(We({dataSet:i})),this.disableExitPopup=!0,this.router.navigate(this.dataToolRouterLink);}));}onExitPopupVisibleChange(t){this.exitPopupVisiblity=t;}toggleExitPopup(t){this.exitPopupVisiblity=t;}routeToOrigin(){this.subscriptions.add(this.store.pipe(G(Qe)).subscribe(t=>{t==null?this.router.navigate(["/tool/data-tool"]):t.length>0&&this.router.navigate(t);}));}onCancelWizard(t){this.routeToOrigin();}onConfirmExitPopup(){this.disableExitPopup=!0,this.router.navigate([this.exitWizardRoute]);}confirmLeavePage(t){return this.disableExitPopup===!0?!0:(this.exitPopupVisiblity||(this.exitWizardRoute=t.url,this.toggleExitPopup(!0)),!1);}onDisableExitPopup(t){this.disableExitPopup=t;}};r.ɵfac=function(i){return new(i||r)(D(oe),D(F),D(L));},r.ɵcmp=B({type:r,selectors:[["data-set-editor"]],viewQuery:function(i,e){if(i&1&&(f(et,7),f(tt,5),f(it,5)),i&2){let a;T(a=y())&&(e.dataSetTemplateEditorWizard=a.first),T(a=y())&&(e.validationGroup=a.first),T(a=y())&&(e.exitWizardPopup=a.first);}},hostBindings:function(i,e){i&1&&x("beforeunload",function(v){return e.unloadNotification(v);},Y);},decls:6,vars:12,consts:[["dataSetTemplateEditorWizard",""],[3,"title","breadcrumbItems"],["showNext","true","name","dataSetTemplateEditorWizard",3,"onCancel","stepsClickable"],["name","form",3,"title","showHeader","showPreview","showNext","enableNext","enableFinish","showFinish","viewIdentifier"],[3,"onVisibleChange","onExitWizardEvent","visible"]],template:function(i,e){if(i&1){let a=V();C(0,"tool-header",1),n(1,"wizard",2,0),x("onCancel",function(p){return S(a),h(e.onCancelWizard(p));}),n(3,"wizard-step",3),C(4,"data-set-form"),m()(),n(5,"exit-popup",4),x("onVisibleChange",function(p){return S(a),h(e.onExitPopupVisibleChange(p));})("onExitWizardEvent",function(){return S(a),h(e.onConfirmExitPopup());}),m();}i&2&&(u("title",e.pageTitle)("breadcrumbItems",e.navigationItems),o(),u("stepsClickable",!0),o(2),u("title",e.dataSetFormText)("showHeader",!1)("showPreview",!1)("showNext",!0)("enableNext",!1)("enableFinish",!0)("showFinish",!0)("viewIdentifier",e.DataSetTemplateEditorView.Form),o(2),u("visible",e.exitPopupVisiblity));},dependencies:[Ee,_e,De,qe,Me],styles:["[_nghost-%COMP%]{height:100%}"]});let s=r;return s;})();var U=(()=>
1{let r=class r{constructor(){}canDeactivate(t,i,e,a){return t.confirmLeavePage?t.confirmLeavePage(a):!0;}};r.ɵfac=function(i){return new(i||r)();},r.ɵprov=J({token:r,factory:r.ɵfac});let s=r;return s;})();var at=[{path:"",component:A,canDeactivate:se([U])}],gi=(()=>{let r=class r{};r.ɵfac=function(i){return new(i||r)();},r.ɵmod=ee({type:r}),r.ɵinj=X({providers:[U],imports:[re,ne.forChild(at),Ve,fe,xe,Ce,W,R,I,Be,A]});let s=r;return s;})();export{gi as DataSetEditorModule};/**i18n:e5557da090456a32cd4be9967dfbd85bee536ca78c16bedb69d01938c8bdbe75*/
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.