-
Notifications
You must be signed in to change notification settings - Fork 3
/
0-fd5ef347026a0fd2f506.js
2 lines (2 loc) · 54.3 KB
/
0-fd5ef347026a0fd2f506.js
1
2
webpackJsonp([0],{3346:function(e,t,n){"use strict";function a(e){return e&&h.a[e]}function i(e){var t=e.major,n=e.minor;return e.snapshot?"master":""+t+n}function r(e,t){var n=/\$\{(.+?)\}/g;return e.replace(n,function(e,n){return t.has(n)?t.get(n):".+?"})}function o(e,t){return Object.keys(h.a).find(function(n){var a=r(n,t);return new RegExp(a).test(e)})}function s(e,t){return a(e)?r(h.a[e],t):""}function l(e,t){var a=new Map([["objectType",t]]),i=new Map([["objectType",n.i(g.camelCaseToUnderscores)(t)]]);return s(o(e,a),i)}function u(e,t){var n=e.schema,a=t.d2,r=window.location.hash.replace(/^#/,"").replace(/\?.+?$/,""),o=i(a.system.version),s="https://docs.dhis2.org/en/use/user-guides/dhis-core-version-"+o+"/configuring-the-system",u=l(r,n);return u?c.a.createElement(y.a,{href:""+s+u,target:"_blank",rel:"noopener noreferrer",tooltip:a.i18n.getTranslation("open_user_guide"),tooltipPosition:"bottom-center",iconClassName:"material-icons",iconStyle:{top:-2}},"help_outline"):null}t.a=u;var p=n(0),c=n.n(p),d=n(1),f=n.n(d),m=n(133),y=n.n(m),g=n(724),E=(n.n(g),n(3357)),h=n.n(E);u.propTypes={schema:f.a.string.isRequired},u.contextTypes={d2:f.a.object}},3355:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(e,t,a){return n.i(D.isString)(e)?e===t.key:e===a}function o(e){var t=e.onBackClick;return p.a.createElement(S.a,{onClick:t},p.a.createElement(A.a,null))}function s(e){var t=e.onForwardClick;return p.a.createElement(S.a,{onClick:t},p.a.createElement(T.a,null))}function l(e,t){var n={buttons:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"4rem 1rem 1rem"}};return function(a){var i=a.children;return p.a.createElement("div",{style:n.buttons},p.a.createElement(e,null),i,p.a.createElement(t,null))}}n.d(t,"a",function(){return P}),n.d(t,"b",function(){return w}),n.d(t,"g",function(){return R}),n.d(t,"f",function(){return V}),t.e=l,n.d(t,"c",function(){return F}),n.d(t,"d",function(){return G});var u=n(0),p=n.n(u),c=n(1334),d=n.n(c),f=n(1332),m=n.n(f),y=n(1333),g=n.n(y),E=n(1331),h=n.n(E),v=n(203),S=n.n(v),_=n(3529),T=n.n(_),b=n(3528),A=n.n(b),O=n(170),N=n(19),C=n.n(N),D=n(15),I=(n.n(D),n(315)),L=n(201),U=n(3372),P=function(e,t,n){var a=U.a.groupsByField(n);return a&&t.map(function(t){return a[t.name]===e||t.isAttribute&&0===e?t.props.style={display:"block"}:t.props.style={display:"none"},t}),[].concat(i(t))},w=function(e){var t=e.steps,n=e.activeStep,a=e.stepperClicked,i=e.orientation,r=void 0===i?"horizontal":i;return p.a.createElement(d.a,{activeStep:n,linear:!1,orientation:r,style:{margin:"0 -16px"}},t.map(function(e,t){return p.a.createElement(h.a,{key:e.label},p.a.createElement(m.a,{onClick:function(){return a(t)}},p.a.createElement(O.a,null,e.label)))}))},R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"horizontal";return function(i){var o=i.activeStep,s=i.stepperClicked,l=i.disabled,u=a(i,["activeStep","stepperClicked","disabled"]),c=function(e){var t=[];return t.push(p.a.createElement(m.a,{key:"button",onClick:function(){return s(e.key)}},p.a.createElement(O.a,null,e.name))),e.content&&t.push(p.a.createElement(g.a,{key:"content"},p.a.createElement(e.content,u))),t};return p.a.createElement(d.a,{linear:!1,orientation:t,activeStep:n.i(D.isNumber)(o)?o:void 0},e.map(function(e,t){return p.a.createElement(h.a,{key:e.key,active:r(o,e,t),disabled:!!l},c(e))}))}},V=function(e){return function(t){var n=t.activeStep,i=a(t,["activeStep"]),r=e.find(function(e){return e.key===n});return r&&r.component?p.a.createElement(r.component,i):(n?C.a.warn("Could not find a content component for a step with key ("+n+") in",e):C.a.warn("The `activeStep` prop is undefined, therefore the component created by `createStepperContentFromConfig` will render null"),null)}},H=function(e){return function(t){return n.i(L.a)(e,t)}},F=function(e){return n.i(I.a)(void 0,H({onForwardClick:e}))(s)},G=function(e){return n.i(I.a)(void 0,H({onBackClick:e}))(o)}},3356:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var a=n(0),i=n.n(a),r=n(1),o=n.n(r),s=n(441),l=n.n(s),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},p=function(e){var t=function(t,n){var a=n.d2,r={getCurrentUser:function(){return a.currentUser},getModelDefinitionByName:function(e){return a.models[e]}};return i.a.createElement(e,u({},t,r))};return t.displayName="WithAuth("+l()(e)+")",t.contextTypes={d2:o.a.object},t};t.b=p},3357:function(e,t){e.exports={"/list/categorySection":"/metadata.html#manage_category","/list/dataElementSection":"/metadata.html#manage_data_element","/list/dataSetSection":"/metadata.html#manage_data_set","/edit/dataSetSection/dataSet/${objectId}/sections":"/metadata.html#manage_section_form","/edit/dataSetSection/dataSetNotificationTemplate":"/metadata.html#create_data_set_notification","/edit/dataSetSection/dataSet":"/metadata.html#create_data_set","/list/indicatorSection/programIndicatorGroup":"/programs.html#manage_${objectType}","/list/indicatorSection/programIndicator":"/programs.html#configure_program_indicator","/list/indicatorSection":"/metadata.html#manage_indicator","/edit/indicatorSection/programIndicator":"/programs.html#create_${objectType}","/edit/indicatorSection/programIndicatorGroup":"/programs.html#create_${objectType}","/list/organisationUnitSection/organisationUnitLevel":"/metadata.html#name_organisation_unit_level","/list/organisationUnitSection":"/metadata.html#manage_organisation_unit","organisationUnitSection/hierarchy":"/metadata.html#move_organisation_unit","/list/programSection/trackedEntity":"/programs.html#configure_tracked_entity","/list/programSection/programRuleVariable":"/programs.html#configure_program_rule","/list/programSection/program/":"/programs.html#configure_programs_in_maintenance_app","/list/programSection/${objectType}":"/programs.html#configure_${objectType}","/list/programSection":"/programs.html#configure_programs_in_maintenance_app","/edit/programSection/program/":"/programs.html#configure_programs_in_maintenance_app","/edit/programSection/trackedEntityType":"/programs.html#create_tracked_entity","/edit/programSection/${objectType}":"/programs.html#create_${objectType}","/list/validationSection":"/metadata.html#manage_validation_rule","/edit/validationSection/validationNotificationTemplate":"/metadata.html#create_validation_notification","/edit/otherSection/attribute":"/metadata.html#create-or-edit-an-attribute","/list/otherSection/optionGroup":"/metadata.html#create_option_group","/list/otherSection/optionGroupSet":"/metadata.html#create_option_group_set","/list/otherSection/legendSet":"/metadata.html#manage_legend","/edit/otherSection/legendSet":"/metadata.html#create_legend","/list/otherSection/predictorGroup":"/metadata.html#create_predictor_group","/list/otherSection/pushAnalysis":"/metadata.html#manage_push_report","/edit/otherSection/pushAnalysis":"/metadata.html#manage_push_report","/list/otherSection/externalMapLayer":"/metadata.html#manage_external_maplayer","/list/otherSection/locale":"/metadata.html#maintenance_locale_management","/edit/otherSection/locale":"/metadata.html#maintenance_locale_management","/list/otherSection/sqlView":"/metadata.html#maintenance_sql_view","/edit/otherSection/sqlView":"/metadata.html#maintenance_sql_view","/edit/":"/metadata.html#create_${objectType}","/list/":"/metadata.html#manage_${objectType}"}},3372:function(e,t,n){"use strict";var a=n(15),i=(n.n(a),n(1306)),r=new Map([["programRule",[{label:"enter_program_rule_details",fields:["program","programStage","name","description","priority"]},{label:"enter_program_rule_expression",fields:["condition"]},{label:"define_program_rule_actions",fields:["programRuleActions"]}]],["dataSetNotificationTemplate",[{label:"what_to_send",fields:["name","code","dataSets","messageTemplate"]},{label:"when_to_send_it",fields:["dataSetNotificationTrigger","relativeScheduledDays","sendStrategy"]},{label:"who_to_send_it_to",fields:["notificationRecipient","recipientUserGroup","deliveryChannels"]}]],["programNotificationTemplate",[{label:"what_to_send",fields:["name","messageTemplate"]},{label:"when_to_send_it",fields:["notificationTrigger","relativeScheduledDays"]},{label:"who_to_send_it_to",fields:["notificationRecipient","recipientUserGroup","deliveryChannels","recipientProgramAttribute","notifyUsersInHierarchyOnly","notifyParentOrganisationUnitOnly"]}]],["programStageNotificationTemplate",[{label:"what_to_send",fields:["name","messageTemplate"]},{label:"when_to_send_it",fields:["notificationTrigger","relativeScheduledDays","sendRepeatable"]},{label:"who_to_send_it_to",fields:["notificationRecipient","recipientUserGroup","deliveryChannels","recipientDataElement","recipientProgramAttribute","notifyUsersInHierarchyOnly","notifyParentOrganisationUnitOnly"]}]],["programIndicator",[{label:"program_indicator__details",fields:["program","name","shortName","code","style","description","decimals","aggregationType","analyticsType","orgUnitField","analyticsPeriodBoundaries","displayInForm","legendSets","aggregateExportCategoryOptionCombo","aggregateExportAttributeOptionCombo"]},{label:"program_indicator__edit_expression",fields:["expression"]},{label:"program_indicator__edit_filter",fields:["filter"]}]]]);t.a={for:function(e){return this.isGroupedFields(e)?r.get(e):[{label:"details",fields:i.a.for(e)}]},isGroupedFields:function(e){return e&&r.has(e)},getStepLength:function(e){if(this.isGroupedFields(e)){return r.get(e).length}return 0},groupNoByName:function(e,t){if(this.isGroupedFields(t)){var i=r.get(t);return n.i(a.findIndex)(function(t){return t.fields.includes(e)},i)}return 0},groupNameByStep:function(e,t){if(this.isGroupedFields(t)){return r.get(t)[e].label}return""},groupsByField:function(e){if(this.isGroupedFields(e))return r.get(e).map(function(e){return e.fields}).reduce(function(e,t,n){return t.map(function(t){return e[t]=n}),e},{})}}},3392:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function i(e,t){var i=e.level,r=e.schema,s=e.children,l=e.groupName,u=e.isDirtyHandler,y=e.skipTranslation,g=a(e,["level","schema","children","groupName","isDirtyHandler","skipTranslation"]);return o.a.createElement(p.a,m({},g,{level:i}),o.a.createElement(d.a,{onClick:function(){return n.i(f.b)("/list/"+l+"/"+r)},iconStyle:{top:3},isDirtyHandler:u}),y?s:t.d2.i18n.getTranslation(s),r&&o.a.createElement(c.a,{schema:r}))}var r=n(0),o=n.n(r),s=n(1),l=n.n(s),u=n(83),p=n(316),c=n(3346),d=n(3396),f=n(202),m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};i.propTypes={children:l.a.oneOfType([l.a.string,l.a.array]),level:l.a.number,isDirtyHandler:l.a.func,schema:l.a.string.isRequired,groupName:l.a.string.isRequired,skipTranslation:l.a.bool},i.defaultProps={isDirtyHandler:function(){},level:2,children:"",skipTranslation:!1},t.a=n.i(u.a)(i)},3393:function(e,t,n){"use strict";function a(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function a(i,r){try{var o=t[i](r),s=o.value}catch(e){return void n(e)}if(!o.done)return Promise.resolve(s).then(function(e){a("next",e)},function(e){a("throw",e)});e(s)}return a("next")})}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.props&&t.props.isRequired?e+" (*)":e}function r(e,t){var a=e.models[t];return Object.keys(a.attributeProperties).map(function(t){var i=a.attributeProperties[t];return n.i(D.a)({name:i.name,valueType:i.valueType,type:D.b.get(i.optionSet?"CONSTANT":i.valueType),required:Boolean(i.mandatory),fieldOptions:{labelText:i.name,options:i.optionSet?i.optionSet.options.map(function(e){return{name:e.displayName||e.name,value:e.code}}):[]}},a,e.models)})}function o(e,t){e.validators&&(e.validators=e.validators.map(function(e){return U({},e,{message:t.i18n.getTranslation(e.message)})}))}function s(e,t){e.translatedName=t.i18n.getTranslation(e.props.labelText),e.props.labelText=i(e.translatedName,e)}function l(e,t,n){if(N.a.isGroupedFields(t)&&"programNotificationTemplate"!==t){var a=N.a.groupNoByName(e.name,t),i=N.a.groupNameByStep(a,t);e.step=a+1+": "+n.i18n.getTranslation(i)}}function u(e,t,a){return function(i){if(!i||!i.trim())return Promise.resolve(!0);var r=t.filter().on(e.fieldOptions.referenceProperty).equals(i);return a&&(r=r.filter().on("id").notEqual(a)),r.list().then(function(e){return 0!==e.size?n.i(h.getInstance)().then(function(e){return e.i18n.getTranslation("value_not_unique")}).then(function(e){return Promise.reject(e)}):Promise.resolve(!0)})}}function p(e,t){return e.unique&&(e.asyncValidators=[u(e,t.modelDefinition,t.id)]),e}function c(e,t){return e.attributes&&new Set(Object.keys(e.attributes)).has(t.name)}function d(e,t){return e.map(function(e){return c(t,e)?U({},e,{value:t.attributes[e.name]}):U({},e,{value:t[e.name]})}).map(w).map(R(t))}function f(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_.identity,i=arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments[5];return a=a||_.identity,S()(function(s){return s.filter(function(e){return e.model}).combineLatest(E.Observable.fromPromise(P(e,t,i,o)),function(t,i){var s=d(i,t.model),l=r?n.i(I.a)(n.i(I.b)(o||e),a(s),t.model):s;return U({},t,{fieldConfigs:l})})})}function m(e,t,a,i,r){function o(e){var a=e.fieldConfigs,i=e.model,o=e.editFieldChanged,s=e.detailsFormStatusChange,l=void 0===s?_.noop:s,u=V(a,o),p=n.i(I.a)(n.i(I.b)(r||t),a,i);return g.a.createElement(T.a,{fields:p,onUpdateField:u,onUpdateFormStatus:l})}return n.i(_.compose)(S()(function(t){return t.combineLatest(e,function(e,t){return U({},e,{model:t})})}),f(t,a,void 0,i,!1,r))(o)}n.d(t,"a",function(){return P}),t.b=p,t.c=f,t.e=m,n.d(t,"d",function(){return H});var y=n(0),g=n.n(y),E=n(25),h=(n.n(E),n(18)),v=(n.n(h),n(722)),S=n.n(v),_=n(15),T=(n.n(_),n(1309)),b=n(1327),A=n(1328),O=n(1306),N=n(3372),C=n(1325),D=n(726),I=n(3489),L=function(){function e(e,t){var n=[],a=!0,i=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},P=function(){var e=a(regeneratorRuntime.mark(function e(t,a){var i,u,p,c,d,f,m,y,g,E,v,S=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],_=arguments[3];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.i(h.getInstance)();case 2:for(i=e.sent,u=new A.a(new b.a(i.models)),u.setFieldOrder(a||O.a.for(t)),p=!0,c=!1,d=void 0,e.prev=8,f=C.a.for(_||t)[Symbol.iterator]();!(p=(m=f.next()).done);p=!0)y=m.value,g=L(y,2),E=g[0],v=g[1],u.addFieldOverrideFor(E,v);e.next=16;break;case 12:e.prev=12,e.t0=e.catch(8),c=!0,d=e.t0;case 16:e.prev=16,e.prev=17,!p&&f.return&&f.return();case 19:if(e.prev=19,!c){e.next=22;break}throw d;case 22:return e.finish(19);case 23:return e.finish(16);case 24:return e.abrupt("return",u.getFormFieldsForModel({modelDefinition:i.models[t]},_).map(function(e){return o(e,i),l(e,t,i),s(e,i),e}).concat(S?r(i,t):[]));case 25:case"end":return e.stop()}},e,this,[[8,12,16,24],[17,,19,23]])}));return function(t,n){return e.apply(this,arguments)}}(),w=function(e){return e.beforePassToFieldConverter?U({},e,{value:e.beforePassToFieldConverter(e.value)}):e},R=function(e){return function(t){return U({},t,{props:U({},t.props,{model:e})})}},V=function(e,t){return function(n,a){var i=e.find(function(e){return e.name===n}),r=i.beforeUpdateConverter||_.identity;return t(n,r(a))}},H=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(n){return t.length<1||t.includes(n.name)?U({},n,{props:U({},n.props,e)}):n}}},3396:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function i(e,t){var n=e.tooltip,i=e.onClick,r=e.isDirtyHandler,s=void 0===r?p.a.getState.bind(p.a):r,u=a(e,["tooltip","onClick","isDirtyHandler"]),d=function(){s&&s()&&s().dirty?confirm(t.d2.i18n.getTranslation("abandon_unsaved_changes"))&&i.apply(void 0,arguments):i.apply(void 0,arguments)};return o.a.createElement(l.a,c({tooltip:n||t.d2.i18n.getTranslation("back"),tooltipPosition:"bottom-right",onClick:d},u,{iconClassName:"material-icons"}),"")}var r=n(0),o=n.n(r),s=n(203),l=n.n(s),u=n(83),p=n(245),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};i.propTypes={tooltip:o.a.PropTypes.string},t.a=n.i(u.a)(i)},3397:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function i(e,t){var n=t.d2,i=e.label,r=e.isSaving,s=(e.isValid,e.onClick),l=a(e,["label","isSaving","isValid","onClick"]),u=i||(r?n.i18n.getTranslation("saving"):n.i18n.getTranslation("save"));return o.a.createElement(p.a,d({},l,{primary:!0,onClick:s,label:u,disabled:r}))}var r=n(0),o=n.n(r),s=n(1),l=n.n(s),u=n(200),p=n.n(u),c=n(83),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};i.propTypes={label:l.a.string,isSaving:l.a.bool,isValid:l.a.bool,onClick:l.a.func.isRequired},i.defaultProps={label:"",isSaving:!1,isValid:!0},t.a=n.i(c.a)(i)},3488:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function i(e,t){var n=e.onClick,i=(e.isPristine,e.isDirtyHandler),r=void 0===i?p.a.getState.bind(p.a):i,s=a(e,["onClick","isPristine","isDirtyHandler"]),u=r&&r()&&r().dirty,d=function(){u?confirm(t.d2.i18n.getTranslation("abandon_unsaved_changes"))&&n.apply(void 0,arguments):n.apply(void 0,arguments)};return o.a.createElement(l.a,c({},s,{onClick:d,secondary:u,label:t.d2.i18n.getTranslation("cancel")}))}var r=n(0),o=n.n(r),s=n(74),l=n.n(s),u=n(83),p=n(245),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};i.propTypes={onClick:o.a.PropTypes.func.isRequired,isDirtyHandler:o.a.PropTypes.func},t.a=n.i(u.a)(i)},3489:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function i(e){return L.a.has(e)?L.a.get(e):[]}function r(e,t,n,a){n&&t.setValue(a,e)}function o(e,t,n){if(e)return e.props[t.propName]=n?t.thenValue:t.elseValue}function s(e,t,n){n&&e?(e.hiddenComponent=e.hiddenComponent||e.component,e.component=function(){return null}):e&&e.hiddenComponent&&(e.component=e.hiddenComponent,delete e.hiddenComponent)}function l(e,t,n){n&&e.hiddenComponent?(e.component=e.hiddenComponent,delete e.hiddenComponent):(e.hiddenComponent=e.hiddenComponent||e.component,e.component=function(){return null})}function u(e){return w.has(e)?w.get(e):N.a}function p(e){return P.has(e)?P.get(e):N.a}function c(e){return void 0!==e&&null!==e}function d(e){return c(e)&&e.toString().trim().length>0}function f(e,t){return e===t}function m(e,t){return e!==t}function y(e,t){return t.indexOf(e)>=0}function g(e,t){return t.indexOf(e)<0}function E(e,t,n){return t(e,n)}function h(e){try{var t=JSON.parse(e);return Array.isArray(t)&&(0===t.length||2===t.length&&!isNaN(t[0])&&!isNaN(t[1]))}catch(e){return!1}}function v(e,t,n){return n.hasOwnProperty("hiddenComponent")}function S(e,t){return!0===(U.a.getState()?U.a.getState()[t]:void 0)}function _(e,t){return!1===(U.a.getState()?U.a.getState()[t]:void 0)}function T(e,t,n){var a=e.whenFieldName,i=e.operatorFn,r=e.whenValue;return i(n[a],r,t,n,a)}function b(e,t,n,a){return e.map(function(e,i){var r=a.find(function(n){return n.name===(e.field||t.field)});return T({whenFieldName:e.field?e.field:t.field,operatorFn:p(e.operator),whenValue:e.value},r,n)})}function A(e,t,n){return e.forEach(function(e){var i=I()(e.when)?e.when:[e.when],r=b(i,e,n,t).some(function(e){return!0===e});(e.operations||[e.operation]).forEach(function(i){var o=t.find(function(t){return t.name===(i.field||e.field)}),s=(i.field,i.type),l=a(i,["field","type"]);u(s)(o,l,r,n)})}),t}t.b=i,t.a=A;var O=n(448),N=n.n(O),C=n(15),D=(n.n(C),n(169)),I=n.n(D),L=n(3520),U=n(451),P=new Map([["EQUALS",f],["NOT_EQUALS",m],["HAS_VALUE",c],["HAS_NO_VALUE",n.i(C.negate)(c)],["HAS_STRING_VALUE",d],["ONEOF",y],["NONEOF",g],["SYSTEM_SETTING_IS_TRUE",S],["SYSTEM_SETTING_IS_FALSE",_],["IS_VALID_POINT",h],["IS_HIDDEN_FIELD",v],["PREDICATE",E]]),w=new Map([["SET_PROP",o],["CHANGE_VALUE",r],["HIDE_FIELD",s],["SHOW_FIELD",l]])},3493:function(e,t,n){"use strict";function a(e){var t={marginTop:"1rem"},n={marginRight:"1rem",width:"10rem"},a=s()(e.children)?e.children:[e.children];return r.a.createElement("div",{style:Object.assign(t,e.style)},a.map(function(e,t){return r.a.cloneElement(e,{style:n,key:t})}))}t.a=a;var i=n(0),r=n.n(i),o=n(169),s=n.n(o);a.propTypes={style:r.a.PropTypes.object,children:r.a.PropTypes.oneOfType([r.a.PropTypes.array,r.a.PropTypes.object]).isRequired,isFormValid:r.a.PropTypes.func}},3519:function(e,t,n){"use strict";function a(e){return{ENROLLMENT:[{analyticsPeriodBoundaryType:r.g,boundaryTarget:r.c},{analyticsPeriodBoundaryType:r.f,boundaryTarget:r.c}],EVENT:[{analyticsPeriodBoundaryType:r.g,boundaryTarget:r.b},{analyticsPeriodBoundaryType:r.f,boundaryTarget:r.b}]}[e]}function i(e,t){return{field:e,when:[{operator:"EQUALS",value:void 0}],operations:[{type:"CHANGE_VALUE",setValue:function(e,n){n&&(n.value=t,e[n.name]=t)}}]}}t.b=a,t.a=i;var r=n(1326)},3520:function(e,t,n){"use strict";function a(e,t){e.optionSet&&e.optionSet.valueType&&(t.value=e.optionSet.valueType,e[t.name]!==e.optionSet.valueType&&(e[t.name]=e.optionSet.valueType))}var i=n(3519);t.a=new Map([["dataElement",[{field:"domainType",when:{operator:"EQUALS",value:"TRACKER"},operations:[{field:"categoryCombo",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"optionSet",when:{operator:"PREDICATE",value:function(){return!0}},operations:[{type:"CHANGE_VALUE",field:"valueType",setValue:function(e,t){if(e&&("MULTI_TEXT"===e.valueType||e.optionSet&&"MULTI_TEXT"===e.optionSet.valueType))t.originalOptions&&(t.props.options=t.originalOptions);else{var n=t.props.options;t.originalOptions||(t.originalOptions=t.props.options),t.props.options=n.filter(function(e){return"MULTI_TEXT"!==e.value})}}}]},{field:"valueType",when:{field:"optionSet",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{type:"CHANGE_VALUE",setValue:a}]},{field:"aggregationType",when:{field:"valueType",operator:"ONEOF",value:["TEXT","LONG_TEXT","MULTI_TEXT","LETTER","PHONE_NUMBER","EMAIL","TRACKER_ASSOCIATE","USERNAME","FILE_RESOURCE","COORDINATE"]},operations:[{field:"aggregationType",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{field:"aggregationType",type:"CHANGE_VALUE",setValue:function(e,t){t.value="NONE",e[t.name]="NONE"}}]}]],["dataSetNotificationTemplate",[{when:[{field:"dataSetNotificationTrigger",operator:"NOT_EQUALS",value:"SCHEDULED_DAYS"}],operations:[{field:"relativeScheduledDays",type:"HIDE_FIELD"},{field:"sendStrategy",type:"HIDE_FIELD"}]},{field:"deliveryChannels",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"ORGANISATION_UNIT_CONTACT"}],operations:[{field:"deliveryChannels",type:"HIDE_FIELD"}]}]],["attribute",[{field:"valueType",when:{field:"optionSet",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{type:"CHANGE_VALUE",setValue:a}]}]],["trackedEntityAttribute",[{field:"unique",when:[{field:"valueType",operator:"ONEOF",value:["BOOLEAN","TRUE_ONLY","DATE","TRACKER_ASSOCIATE","USERNAME","OPTION_SET"]}],operations:[{field:"unique",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{field:"unique",type:"CHANGE_VALUE",setValue:function(e,t){t.value=!1,e.unique=!1}}]},{field:"valueType",when:{field:"optionSet",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{type:"CHANGE_VALUE",setValue:a}]},{field:"orgunitScope",when:[{field:"unique",operator:"NOT_EQUALS",value:!0},{field:"valueType",operator:"ONEOF",value:["BOOLEAN","TRUE_ONLY","DATE","TRACKER_ASSOCIATE","USERNAME","OPTION_SET"]}],operations:[{type:"HIDE_FIELD"}]},{field:"generated",when:[{field:"orgunitScope",operator:"IS_HIDDEN_FIELD"},{field:"orgunitScope",operator:"ONEOF",value:["organisation_unit"]},{field:"orgunitScope",operator:"EQUALS",value:!0}],operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=!1,e.generated=!1}}]},{field:"pattern",when:[{field:"generated",operator:"IS_HIDDEN_FIELD"},{field:"generated",operator:"NOT_EQUALS",value:!0}],operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=null,e.pattern=null}}]}]],["externalMapLayer",[{field:"legendSetUrl",when:[{field:"legendSet",operator:"HAS_VALUE"}],operations:[{field:"legendSetUrl",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"legendSet",when:[{field:"legendSetUrl",operator:"HAS_STRING_VALUE"}],operations:[{field:"legendSet",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"mapLayerPosition",when:[{field:"mapService",operator:"ONEOF",value:["GEOJSON_URL","ARCGIS_FEATURE"]}],operations:[{field:"mapLayerPosition",type:"CHANGE_VALUE",setValue:function(e,t){t.value="OVERLAY",e[t.name]="OVERLAY"}}]},{field:"mapLayerPosition",when:[{field:"mapService",operator:"EQUALS",value:"VECTOR_STYLE"}],operations:[{field:"mapLayerPosition",type:"CHANGE_VALUE",setValue:function(e,t){t.value="BASEMAP",e[t.name]="BASEMAP"}}]}]],["organisationUnit",[{field:"dataSets",when:[{operator:"SYSTEM_SETTING_IS_FALSE",value:"keyAllowObjectAssignment"}],operations:[{field:"dataSets",type:"HIDE_FIELD"}]},{field:"programs",when:[{operator:"SYSTEM_SETTING_IS_FALSE",value:"keyAllowObjectAssignment"}],operations:[{field:"programs",type:"HIDE_FIELD"}]}]],["programRule",[{field:"name",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"description",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"priority",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"condition",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"programRuleActions",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]}]],["programRuleVariable",[{field:"program",when:[{field:"dataElement",operator:"HAS_STRING_VALUE"},{field:"trackedEntityAttribute",operator:"HAS_STRING_VALUE"},{field:"programStage",operator:"HAS_STRING_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"dataElement",when:[{field:"programRuleVariableSourceType",operator:"ONEOF",value:["CALCULATED_VALUE","TEI_ATTRIBUTE"]}],operations:[{field:"dataElement",type:"HIDE_FIELD"}]},{field:"trackedEntityAttribute",when:[{field:"programRuleVariableSourceType",operator:"NOT_EQUALS",value:"TEI_ATTRIBUTE"}],operations:[{field:"trackedEntityAttribute",type:"HIDE_FIELD"}]},{field:"programStage",when:[{field:"programRuleVariableSourceType",operator:"NOT_EQUALS",value:"DATAELEMENT_NEWEST_EVENT_PROGRAM_STAGE"}],operations:[{field:"programStage",type:"HIDE_FIELD"}]},{field:"programStage",when:[{field:"dataElement",operator:"HAS_STRING_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"valueType",when:[{field:"programRuleVariableSourceType",operator:"NOT_EQUALS",value:"CALCULATED_VALUE"}],operations:[{field:"valueType",type:"HIDE_FIELD"}]},n.i(i.a)("valueType","TEXT")]],["programStage",[{field:"autoGenerateEvent",when:[{field:"autoGenerateEvent",operator:"NOT_EQUALS",value:!0}],operations:[{field:"openAfterEnrollment",type:"HIDE_FIELD"},{field:"reportDateToUse",type:"HIDE_FIELD"}]},{field:"reportDateToUse",when:[{field:"openAfterEnrollment",operator:"NOT_EQUALS",value:!0}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]}]],["eventProgramStage",[n.i(i.a)("validationStrategy","ON_UPDATE_AND_INSERT")]],["programIndicator",[{field:"orgUnitField",when:[{field:"program",operator:"EQUALS",value:void 0}],operations:[{field:"orgUnitField",type:"HIDE_FIELD"}]},{field:"analyticsPeriodBoundaries",when:[{field:"analyticsType",operator:"HAS_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){if(t){var a=t.previousAnalyticsType,r=e.analyticsType,o=t.value,s=a&&a!==r;if(!o||s){var l=n.i(i.b)(r,t.value);t.value=l,e[t.name]=l}t.previousAnalyticsType=r}}}]}]],["programStageNotificationTemplate",[{field:"notificationTrigger",when:[{field:"notificationTrigger",operator:"NOT_EQUALS",value:"SCHEDULED_DAYS_DUE_DATE"}],operations:[{field:"relativeScheduledDays",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NONEOF",value:["TRACKED_ENTITY_INSTANCE","ORGANISATION_UNIT_CONTACT"]}],operations:[{field:"deliveryChannels",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"DATA_ELEMENT"}],operations:[{field:"recipientDataElement",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"PROGRAM_ATTRIBUTE"}],operations:[{field:"recipientProgramAttribute",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyUsersInHierarchyOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyParentOrganisationUnitOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"EQUALS",value:"WEB_HOOK"}],operations:[{field:"deliveryChannels",type:"CHANGE_VALUE",setValue:function(e,t){t&&(t.value=e[t.name]=["HTTP"])}}]},{field:"notifyUsersInHierarchyOnly",when:[{field:"notifyParentOrganisationUnitOnly",operator:"EQUALS",value:!0}],operations:[{field:"notifyUsersInHierarchyOnly",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"notifyParentOrganisationUnitOnly",when:[{field:"notifyUsersInHierarchyOnly",operator:"EQUALS",value:!0}],operations:[{field:"notifyParentOrganisationUnitOnly",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]}]],["programNotificationTemplate",[{field:"notificationTrigger",when:[{field:"notificationTrigger",operator:"NONEOF",value:["SCHEDULED_DAYS_INCIDENT_DATE","SCHEDULED_DAYS_ENROLLMENT_DATE"]}],operations:[{field:"relativeScheduledDays",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NONEOF",value:["TRACKED_ENTITY_INSTANCE","ORGANISATION_UNIT_CONTACT"]}],operations:[{field:"deliveryChannels",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"PROGRAM_ATTRIBUTE"}],operations:[{field:"recipientProgramAttribute",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyUsersInHierarchyOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyParentOrganisationUnitOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"EQUALS",value:"WEB_HOOK"}],operations:[{field:"deliveryChannels",type:"CHANGE_VALUE",setValue:function(e,t){t&&(t.value=e[t.name]=["HTTP"])}}]}]],["categoryCombo",[{field:"dataDimensionType",when:[{field:"dataDimensionType",operator:"HAS_NO_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){t.value=e[t.name]="DISAGGREGATION"}}]}]],["sqlView",[{field:"name",when:{field:"id",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"type",when:{field:"id",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"cacheStrategy",when:[{field:"sqlQuery",operator:"HAS_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){try{e.dataValues.sqlQuery.includes("${_current_user_id}")||e.dataValues.sqlQuery.includes("${_current_username}")?(t.value=e[t.name]="NO_CACHE",t.props.disabled=!0):t.props.disabled=!1}catch(e){return}}}]}]],["analyticsTableHook",[{field:"resourceTableType",when:{field:"phase",operator:"PREDICATE",value:function(e){return"RESOURCE_TABLE_POPULATED"!=e}},operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=e[t.name]=void 0}}]},{field:"analyticsTableType",when:{field:"phase",operator:"PREDICATE",value:function(e){return"ANALYTICS_TABLE_POPULATED"!=e}},operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=e[t.name]=void 0}}]}]],["relationshipType",[{field:"toFromName",when:{field:"bidirectional",operator:"NOT_EQUALS",value:!0},operations:[{type:"HIDE_FIELD"}]}]],["dataSet",[{field:"openPeriodsAfterCoEndDate",when:{field:"categoryCombo",operator:"PREDICATE",value:function(e){return e&&"default"===e.name}},operations:[{type:"HIDE_FIELD"}]},{field:"workflow",when:[{field:"categoryCombo",operator:"HAS_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){try{var n=["categoryCombo.id:eq:"+e.dataValues.categoryCombo.id,"categoryCombo.id:null"];Array.isArray(t.props.queryParamFilter)?t.props.queryParamFilter.includes(n[0])||(t.props.queryParamFilter=n,t.value=e[t.name]=void 0):t.props.queryParamFilter=n}catch(e){return}}}]}]],["predictor",[n.i(i.a)("organisationUnitDescendants","SELECTED")]],["eventProgram",[{field:"openDaysAfterCoEndDate",when:{field:"categoryCombo",operator:"PREDICATE",value:function(e){return e&&"default"===e.name}},operations:[{type:"HIDE_FIELD"}]}]],["trackerProgram",[{field:"openDaysAfterCoEndDate",when:{field:"categoryCombo",operator:"PREDICATE",value:function(e){return e&&"default"===e.name}},operations:[{type:"HIDE_FIELD"}]}]]])},3528:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=a(i),o=n(41),s=a(o),l=n(42),u=a(l),p=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}))};p=(0,s.default)(p),p.displayName="NavigationArrowBack",p.muiName="SvgIcon",t.default=p},3529:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=a(i),o=n(41),s=a(o),l=n(42),u=a(l),p=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}))};p=(0,s.default)(p),p.displayName="NavigationArrowForward",p.muiName="SvgIcon",t.default=p},3688:function(e,t,n){"use strict";function a(e,t){var n=t.getStateClone(),a=c(e,t,n);return a?(t.setState(n),p(a)):""}t.a=a;var i=n(15),r=(n.n(i),function(e){return!0!==e}),o=function(e){return!0===n.i(i.get)("isRequired",e.fieldOptions)},s=function(e){return e.value},l=function(e){return!e.hiddenComponent&&(o(e)||s(e))},u=function(e,t,n){var a=t.validateField(n,e.name,e.value);return{invalid:r(a),step:e.step,name:e.translatedName,message:a}},p=function(e){var t=e.step?": "+e.name+". On step "+e.step:"";return""+e.message+t},c=function(e,t,n){return e.filter(function(e){return l(e)}).map(function(e){return u(e,t,n)}).find(function(e){return e.invalid})}},3712:function(e,t,n){"use strict";function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return s.a.createElement("div",{style:{textAlign:"center"}},s.a.createElement(u.a,null))}function r(e,t){return e.map(function(e){return e.value}).find(function(e){return-1!==Array.from(t.indicatorGroups.values()).map(function(e){return e.id}).indexOf(e)})}var o=n(0),s=n.n(o),l=n(18),u=(n.n(l),n(150)),p=n(67),c=n(1342);t.a=s.a.createClass({displayName:"DataIndicatorGroupsAssignment.component",propTypes:{source:s.a.PropTypes.object.isRequired},getInitialState:function(){return c.a.setState({indicatorGroupValues:{},remove:[],save:[]}),{indicatorGroupSets:null}},componentDidMount:function(){var e=this;n.i(l.getInstance)().then(function(e){return e.Api.getApi().get("indicatorGroupSets",{fields:"id,displayName,indicatorGroups[id,displayName]",filter:["compulsory:eq:true"],paging:!1})}).then(function(e){return e.indicatorGroupSets}).then(function(t){return e.setState({indicatorGroupSets:t})}),this.subscription=c.a.subscribe(function(){return e.forceUpdate()})},componentWillUnmount:function(){this.subscription&&this.subscription&&this.subscription.unsubscribe()},render:function(){var e=this;return this.state.indicatorGroupSets?s.a.createElement("div",null,this.state.indicatorGroupSets.map(function(t,n){var a=t.indicatorGroups.map(function(e){return{value:e.id,text:e.displayName}}),i=Object.prototype.hasOwnProperty.call(c.a.state.indicatorGroupValues,t.id)?c.a.state.indicatorGroupValues[t.id]:r(a,e.props.source);return s.a.createElement("div",{key:"dataIndicatorGroupAssignment"+n},s.a.createElement(p.a,{key:t.id,labelText:t.displayName,translateLabel:!1,options:a,value:i,onChange:e._updateGroupStatus.bind(e,t.id,r(a,e.props.source)),fullWidth:!0}))})):i()},_updateGroupStatus:function(e,t,n){this.props.source.dirty=!0,c.a.setState({indicatorGroupValues:Object.assign({},c.a.state.indicatorGroupValues,a({},e,n.target.value?n.target.value:null)),remove:Array.from(new Set(c.a.state.remove.concat([t])).values())})}})},3713:function(e,t,n){"use strict";var a=n(0),i=n.n(a),r=n(19),o=n.n(r),s=n(25),l=(n.n(s),n(18)),u=(n.n(l),n(150)),p=n(1308),c=n(1309),d=n(3397),f=n(3488),m=n(3715),y=n(3493),g=n(3372),E=n(3720),h=n(3731),v=n(245),S=n(116),_=n(84),T=n(134),b=n(3393),A=n(3489),O=n(3721),N=n(3355),C=n(3688),D=function(){function e(e,t){var n=[],a=!0,i=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=T.b.filter(function(e){return e.sideBar&&e.sideBar.currentSection}).map(function(e){return e.sideBar.currentSubSection}).filter(function(e){return e}).distinctUntilChanged(),L=I.flatMap(function(e){return s.Observable.fromPromise(n.i(b.a)(e))}),U=function(e){return void 0===e.id},P=s.Observable.fromPromise(n.i(l.getInstance)()),w=s.Observable.combineLatest(v.a,L,I,P).filter(function(e){var t=D(e,3),n=t[0],a=(t[1],t[2]);return!!(n&&n.modelDefinition&&n.modelDefinition.name)&&n.modelDefinition.name===a}).map(function(e){var t=D(e,4),a=t[0],i=t[1],r=t[2],o=(t[3],i.map(function(e){return e.fieldOptions.model=a,U(a)||-1===h.a.for(r).indexOf(e.name)||(e.props.disabled=!0),Object.keys(a.attributes||[]).indexOf(e.name)>=0?(e.isAttribute=!0,e.value=a.attributes[e.name],e):(e.beforePassToFieldConverter?e.value=e.beforePassToFieldConverter(a[e.name]):e.value=a[e.name],e)}));return{fieldConfigs:[].concat(n.i(A.a)(n.i(A.b)(a.modelDefinition.name),o,a),(E.a[r]||[]).map(function(e){return e.props=e.props||{},e.props.modelToEdit=a,e})).map(function(e){return n.i(b.b)(e,a)}),modelToEdit:a,isLoading:!1}});t.a=i.a.createClass({displayName:"EditModelForm.component",propTypes:{modelId:i.a.PropTypes.string.isRequired,modelType:i.a.PropTypes.string.isRequired,onSaveSuccess:i.a.PropTypes.func.isRequired,onSaveError:i.a.PropTypes.func,onCancel:i.a.PropTypes.func.isRequired},mixins:[p.a],getInitialState:function(){return{modelToEdit:void 0,isLoading:!0,formState:{validating:!1,valid:!0,pristine:!0},activeStep:0}},isAddOperation:function(){return"add"===this.props.modelId},componentWillMount:function(){var e=this;this.subscription=w.subscribe(function(t){e.setState(t),e.setActiveStep(e.state.activeStep)},function(e){_.a.show({message:e,action:"ok"})})},componentWillUnmount:function(){this.subscription&&this.subscription.unsubscribe(),this.saveSubscription&&this.saveSubscription.unsubscribe()},setActiveStep:function(e){this.setState({activeStep:e,fieldConfigs:n.i(N.a)(e,this.state.fieldConfigs,this.props.modelType)})},setFormRef:function(e){this.formRef=e},_onUpdateField:function(e,t){var n=this.state.fieldConfigs.find(function(t){return t.name===e});return n&&n.beforeUpdateConverter?S.a.update({fieldName:e,value:n.beforeUpdateConverter(t)}):S.a.update({fieldName:e,value:t})},_onUpdateFormStatus:function(e){this.setState({formState:e})},saveSuccess:function(e){_.a.show({message:e,translate:!0}),this.props.onSaveSuccess(this.state.modelToEdit)},saveFail:function(e){if(this.setState({isSaving:!1}),200===e.httpStatusCode)o.a.warn("Save errored due to empty 200 OK body"),_.a.show({message:"success",action:"ok",translate:!0}),this.props.onSaveSuccess(this.state.modelToEdit);else{var t=void 0;t="string"==typeof e?e:n.i(O.a)(e),_.a.show({message:t,action:"ok"}),this.props.onSaveError&&this.props.onSaveError(e),o.a.error(e)}},_saveAction:function(e){var t=this;e.preventDefault();var a=n.i(C.a)(this.state.fieldConfigs,this.formRef);if(a)return void _.a.show({message:a,action:"ok"});this.setState({isSaving:!0}),this.saveSubscription=S.a.saveObject({id:this.props.modelId,modelType:this.props.modelType}).subscribe(this.saveSuccess,this.saveFail,function(){return t.setState({isSaving:!1})})},_closeAction:function(e){e.preventDefault(),this.props.onCancel()},renderSharingNotification:function(){var e={width:"100%",margin:"0 auto 3rem",position:"relative"};return this.isAddOperation()?i.a.createElement(m.a,{style:e,modelType:this.props.modelType}):null},renderStepper:function(){var e=g.a.for(this.props.modelType);return e.length>1&&n.i(N.b)({steps:e,activeStep:this.state.activeStep,stepperClicked:this.setActiveStep})},renderForm:function(){var e={width:"100%",margin:"0 auto 2rem",padding:"2rem 5rem 4rem",position:"relative"};return this.state.isLoading?i.a.createElement(u.a,null):i.a.createElement("div",{style:e},this.renderStepper(),this.renderSharingNotification(),i.a.createElement(c.a,{fields:this.state.fieldConfigs,onUpdateField:this._onUpdateField,onUpdateFormStatus:this._onUpdateFormStatus,ref:this.setFormRef}),i.a.createElement(y.a,null,i.a.createElement(d.a,{onClick:this._saveAction,isValid:this.state.formState.valid&&!this.state.formState.validating,isSaving:this.state.isSaving}),i.a.createElement(f.a,{onClick:this._closeAction})))},render:function(){return this.state.loading?i.a.createElement("div",null,"Loading data...."):this.renderForm()}})},3714:function(e,t,n){"use strict";var a=n(25),i=(n.n(a),n(18)),r=(n.n(i),n(112)),o=n(737),s=n(0),l=n.n(s),u=n(1308),p=n(3736),c=n(738),d=n.i(c.a)("indicators/expression/description");r.a.createActionsFromNames(["requestExpressionStatus"]).requestExpressionStatus.debounceTime(500).map(function(e){var t=encodeURIComponent(e.data),r="expressions/description?expression="+t,o=n.i(i.getInstance)().then(function(e){return e.Api.getApi().get(r)});return a.Observable.fromPromise(o)}).concatAll().subscribe(function(e){p.a.setState(e)});var f=l.a.createClass({displayName:"IndicatorExpressionManagerContainer",propTypes:{indicatorExpressionChanged:l.a.PropTypes.func.isRequired,description:l.a.PropTypes.string,formula:l.a.PropTypes.string,titleText:l.a.PropTypes.string},mixins:[u.a],getInitialState:function(){return{organisationUnitGroups:[],constants:[],programTrackedEntityAttributes:[],programIndicators:[],programDataElements:[]}},componentDidMount:function(){var e=this;n.i(i.getInstance)().then(function(e){return e.models.organisationUnitGroup.list({paging:!1,fields:"id,displayName"})}).then(function(e){return e.toArray().map(function(e){return{value:e.id,label:e.displayName}})}).then(function(t){return e.setState({organisationUnitGroups:t})}),n.i(i.getInstance)().then(function(e){return e.models.constant.list({paging:!1,fields:"id,displayName"})}).then(function(e){return e.toArray().map(function(e){return{value:e.id,label:e.displayName}})}).then(function(t){return e.setState({constants:t})}),this.refs.expressionManager.requestExpressionStatus()},getExpressionManager:function(){return this.refs.expressionManager},render:function(){return l.a.createElement(o.a,{descriptionLabel:this.getTranslation("description"),descriptionValue:this.props.description,formulaValue:this.props.formula,expressionStatusStore:p.a,expressionChanged:this.props.indicatorExpressionChanged,titleText:this.props.titleText,validateExpression:d,ref:"expressionManager",expressionType:"indicator"})}});t.a=f},3715:function(e,t,n){"use strict";var a=n(0),i=n.n(a),r=n(1308),o=n(723),s=n.n(o),l=n(317),u=n.n(l),p=n(3356),c=i.a.createClass({displayName:"SharingNotification",propTypes:{modelType:i.a.PropTypes.string,style:i.a.PropTypes.object},mixins:[r.a],render:function(){var e=this.props.getModelDefinitionByName(this.props.modelType),t=this.props.getCurrentUser().canCreatePublic(e),n=this.props.getCurrentUser().canCreatePrivate(e),a=Object.assign({},this.props.style,{background:"none",margin:"14px 0 0 -4px"}),r={verticalAlign:"super",lineHeight:"24px",paddingLeft:".5rem"},o=null;return t?o=i.a.createElement(u.a,{style:a,zDepth:0},i.a.createElement(s.a,{className:"material-icons"},"lock_open"),i.a.createElement("span",{style:r},this.getTranslation("object_will_created_public"))):n&&(o=i.a.createElement(u.a,{style:a,zDepth:0},i.a.createElement(s.a,{className:"material-icons"},"lock"),i.a.createElement("span",{style:r},this.getTranslation("object_will_created_private")))),o}});t.a=n.i(p.a)(c)},3716:function(e,t,n){"use strict";function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return s.a.createElement("div",{style:{textAlign:"center"}},s.a.createElement(u.a,null))}function r(e,t){return e.map(function(e){return e.value}).find(function(e){return-1!==Array.from(t.dataElementGroups.values()).map(function(e){return e.id}).indexOf(e)})}var o=n(0),s=n.n(o),l=n(18),u=(n.n(l),n(150)),p=n(67),c=n(1338);t.a=s.a.createClass({displayName:"DataElementGroupsAssignment.component",propTypes:{source:s.a.PropTypes.object.isRequired},getInitialState:function(){return c.a.setState({dataElementGroupValues:{},remove:[],save:[]}),{dataElementGroupSets:null}},componentDidMount:function(){var e=this;n.i(l.getInstance)().then(function(e){return e.Api.getApi().get("dataElementGroupSets",{fields:"id,displayName,dataElementGroups[id,displayName]",filter:["compulsory:eq:true"],paging:!1})}).then(function(e){return e.dataElementGroupSets}).then(function(t){return e.setState({dataElementGroupSets:t})}),this.subscription=c.a.subscribe(function(){return e.forceUpdate()})},componentWillUnmount:function(){this.subscription&&this.subscription.unsubscribe&&this.subscription.unsubscribe()},_updateGroupStatus:function(e,t,n){this.props.source.dirty=!0,c.a.setState({dataElementGroupValues:Object.assign({},c.a.state.dataElementGroupValues,a({},e,n.target.value?n.target.value:null)),remove:Array.from(new Set(c.a.state.remove.concat([t])).values())})},render:function(){var e=this;return this.state.dataElementGroupSets?s.a.createElement("div",null,this.state.dataElementGroupSets.map(function(t){var n=t.dataElementGroups.map(function(e){return{value:e.id,text:e.displayName}}),a=Object.prototype.hasOwnProperty.call(c.a.state.dataElementGroupValues,t.id)?c.a.state.dataElementGroupValues[t.id]:r(n,e.props.source);return s.a.createElement("div",{key:t.id},s.a.createElement(p.a,{labelText:t.displayName,translateLabel:!1,options:n,value:a,onChange:e._updateGroupStatus.bind(e,t.id,r(n,e.props.source)),fullWidth:!0}))})):i()}})},3720:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(0),s=n.n(o),l=n(437),u=n.n(l),p=n(200),c=n.n(p),d=n(151),f=n.n(d),m=n(83),y=n(3714),g=n(245),E=n(3712),h=n(3716),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},S=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),_={saveButton:{marginRight:"1rem"},customContentStyle:{width:"95%",maxWidth:"none"}},T=function(e){function t(e,n){a(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.state={dialogValid:!0,dialogOpen:!1},r.setNumerator=r.setNumerator.bind(r),r.setDenominator=r.setDenominator.bind(r),r.closeDialog=r.closeDialog.bind(r),r.saveToModelAndCloseDialog=r.saveToModelAndCloseDialog.bind(r),r.indicatorExpressionChanged=r.indicatorExpressionChanged.bind(r),r}return r(t,e),S(t,[{key:"setNumerator",value:function(){this.setState({type:"numerator",dialogOpen:!0})}},{key:"setDenominator",value:function(){this.setState({type:"denominator",dialogOpen:!0})}},{key:"closeDialog",value:function(){this.setState({dialogOpen:!1})}},{key:"saveToModelAndCloseDialog",value:function(){this.state.expressionStatus.isValid&&(this.props.modelToEdit[this.state.type]=this.state.expressionFormula,this.props.modelToEdit[this.state.type+"Description"]=this.state.expressionDescription,g.a.setState(this.props.modelToEdit)),this.setState({dialogOpen:!1})}},{key:"indicatorExpressionChanged",value:function(e){var t={};e.expressionStatus.isValid&&(t.expressionStatus=e.expressionStatus,t.expressionDescription=e.description,t.expressionFormula=e.formula),this.setState(v({dialogValid:e.expressionStatus.isValid&&Boolean(e.description.trim())},t))}},{key:"renderExpressionManager",value:function(){return s.a.createElement(y.a,{indicatorExpressionChanged:this.indicatorExpressionChanged,formula:this.props.modelToEdit[this.state.type]||"",description:this.props.modelToEdit[this.state.type+"Description"]||"",ref:"expressionManagerContainer"})}},{key:"render",value:function(){var e=this.context.d2,t=[s.a.createElement(f.a,{label:e.i18n.getTranslation("cancel"),onTouchTap:this.closeDialog}),s.a.createElement(f.a,{label:e.i18n.getTranslation("done"),onTouchTap:this.saveToModelAndCloseDialog,disabled:!this.state.dialogValid})];return s.a.createElement("div",null,s.a.createElement("div",{style:{marginTop:"2rem"}},s.a.createElement(c.a,{label:e.i18n.getTranslation("edit_numerator"),onClick:this.setNumerator,style:{marginRight:"2rem"}}),s.a.createElement(c.a,{label:e.i18n.getTranslation("edit_denominator"),onClick:this.setDenominator}),s.a.createElement(u.a,{title:e.i18n.getTranslation("edit_"+this.state.type),open:this.state.dialogOpen,modal:!0,actions:t,contentStyle:_.customContentStyle,autoScrollBodyContent:!0,repositionOnUpdate:!1},this.state?this.renderExpressionManager():null)),s.a.createElement("div",{style:{marginTop:"2rem"}},s.a.createElement(E.a,{source:this.props.modelToEdit})))}}]),t}(s.a.Component);T.propTypes={modelToEdit:s.a.PropTypes.object.isRequired},t.a={dataElement:[{name:"dataElementGroupAssignment",component:function(e){return s.a.createElement("div",{style:{marginTop:"2rem"}},s.a.createElement(h.a,{source:e.modelToEdit}))}}],indicator:[{name:"indicatorGroupAssignmentAndGroupAssignments",component:n.i(m.a)(T)}]}},3721:function(e,t,n){"use strict";function a(e){var t=[r(e),o(e),e.message];return s(t)}t.a=a;var i=n(15),r=(n.n(i),n.i(i.compose)(n.i(i.get)("message"),i.first,n.i(i.getOr)([],"errorReports"),n.i(i.get)("response"))),o=n.i(i.compose)(n.i(i.get)("message"),i.first,n.i(i.get)("messages")),s=n.i(i.compose)(i.first,n.i(i.filter)(i.identity))},3725:function(e,t,n){"use strict";t.a=["dataDimensionType"]},3726:function(e,t,n){"use strict";t.a=["dataDimensionType"]},3727:function(e,t,n){"use strict";t.a=["name"]},3728:function(e,t,n){"use strict";t.a=["dataDimensionType"]},3729:function(e,t,n){"use strict";t.a=["dataDimensionType"]},3730:function(e,t,n){"use strict";t.a=["key"]},3731:function(e,t,n){"use strict";var a=n(3725),i=n(3726),r=n(3727),o=n(3728),s=n(3729),l=n(3734),u=n(3735),p=n(3732),c=n(3733),d=n(3730),f={category:a.a,categoryCombo:i.a,categoryOptionCombo:r.a,categoryOptionGroup:o.a,categoryOptionGroupSet:s.a,icon:d.a,optionSet:l.a,programRule:u.a,optionGroup:p.a,optionGroupSet:c.a};t.a={for:function(e){return e&&f[e]?f[e]:[]}}},3732:function(e,t,n){"use strict";t.a=["optionSet"]},3733:function(e,t,n){"use strict";t.a=["optionSet"]},3734:function(e,t,n){"use strict";t.a=["valueType"]},3735:function(e,t,n){"use strict";t.a=["program"]},3736:function(e,t,n){"use strict";var a=n(44);t.a=a.a.create()},3865:function(e,t,n){"use strict";function a(e){return r.a.createElement(s.a,null,r.a.createElement(l.a,p({},e,{onCancel:function(){return n.i(u.b)("/list/"+e.groupName+"/"+e.modelType)},onSaveSuccess:function(){return n.i(u.b)("/list/"+e.groupName+"/"+e.modelType)}})))}t.a=a;var i=n(0),r=n.n(i),o=n(317),s=n.n(o),l=n(3713),u=n(202),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}},742:function(e,t,n){"use strict";function a(e){var t=e.params.modelType||"organisationUnit";return r.a.createElement("div",null,r.a.createElement("div",{style:{display:"flex",flexDirection:"row",marginBottom:"1rem"}},r.a.createElement(p.a,{schema:t,groupName:e.params.groupName},n.i(l.camelCaseToUnderscores)(t))),r.a.createElement(u.a,{groupName:e.params.groupName,modelType:t,modelId:e.params.modelId}))}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(1),s=n.n(o),l=n(724),u=(n.n(l),n(3865)),p=n(3392);a.propTypes={params:s.a.any.isRequired},t.default=a}});
//# sourceMappingURL=0-fd5ef347026a0fd2f506.js.map