var $7fmur$babelruntimehelpersclassCallCheck = $parcel$interopDefault(require("@babel/runtime/helpers/classCallCheck"));
var $7fmur$babelruntimehelperscreateClass = $parcel$interopDefault(require("@babel/runtime/helpers/createClass"));
var $7fmur$babelruntimehelpersdefineProperty = $parcel$interopDefault(require("@babel/runtime/helpers/defineProperty"));
var $7fmur$jsonldutils = $parcel$interopDefault(require("jsonld-utils"));
var temp = require("s-forms");
var $7fmur$Constants = temp.Constants;
var $7fmur$FormUtils = temp.FormUtils;
var $7fmur$Question = temp.Question;
var $7fmur$FormQuestionsContext = temp.FormQuestionsContext;
var $7fmur$WizardStep = temp.WizardStep;
var $7fmur$QuestionStatic = temp.QuestionStatic;
var $7fmur$ConfigurationContext = temp.ConfigurationContext;
var $7fmur$JsonLdObjectMap = temp.JsonLdObjectMap;
var $7fmur$Answer = temp.Answer;
require("core-js/modules/es.reflect.construct.js");
var $7fmur$babelruntimehelpersassertThisInitialized = $parcel$interopDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var $7fmur$babelruntimehelpersinherits = $parcel$interopDefault(require("@babel/runtime/helpers/inherits"));
var $7fmur$babelruntimehelperspossibleConstructorReturn = $parcel$interopDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var $7fmur$babelruntimehelpersgetPrototypeOf = $parcel$interopDefault(require("@babel/runtime/helpers/getPrototypeOf"));
require("core-js/modules/es.regexp.constructor.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.regexp.to-string.js");
require("core-js/modules/es.string.match.js");
require("core-js/modules/es.string.trim.js");
require("core-js/modules/web.dom-collections.for-each.js");
require("core-js/modules/es.array.find.js");
require("core-js/modules/es.string.replace.js");
var $7fmur$react = $parcel$interopDefault(require("react"));
var temp1 = require("react-bootstrap");
var $7fmur$Card = temp1.Card;
var $7fmur$Form = temp1.Form;
var $7fmur$FormGroup = temp1.FormGroup;
require("core-js/modules/es.object.keys.js");
require("core-js/modules/es.symbol.js");
require("core-js/modules/es.object.get-own-property-descriptor.js");
require("core-js/modules/es.object.get-own-property-descriptors.js");
require("core-js/modules/es.array.filter.js");
require("core-js/modules/es.array.slice.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.function.name.js");
require("core-js/modules/es.array.from.js");
require("core-js/modules/es.string.iterator.js");
require("core-js/modules/es.symbol.description.js");
require("core-js/modules/es.symbol.iterator.js");
require("core-js/modules/es.array.iterator.js");
require("core-js/modules/web.dom-collections.iterator.js");
var $7fmur$babelruntimehelperstypeof = $parcel$interopDefault(require("@babel/runtime/helpers/typeof"));
require("core-js/modules/es.array.includes.js");
require("core-js/modules/es.string.includes.js");
require("core-js/modules/es.array.map.js");
require("core-js/modules/es.object.values.js");
var $7fmur$proptypes = $parcel$interopDefault(require("prop-types"));
var $7fmur$babelruntimehelpersextends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
var $7fmur$classnames = $parcel$interopDefault(require("classnames"));
var $7fmur$babelruntimehelpersget = $parcel$interopDefault(require("@babel/runtime/helpers/get"));
var $7fmur$IntelligentTreeSelect = require("intelligent-tree-select").IntelligentTreeSelect;

function $parcel$defineInteropFlag(a) {
  Object.defineProperty(a, '__esModule', {value: true, configurable: true});
}
function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

$parcel$defineInteropFlag(module.exports);

$parcel$export(module.exports, "default", () => $cb0df5b2e7073908f1f1fcf8aa987212$export$9099ad97b570f7c);
$parcel$export(module.exports, "Constants", () => $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c);
$parcel$export(module.exports, "CompositeQuestion", () => $1dd64436880331518ad547a919bf54eb$export$9099ad97b570f7c);
$parcel$export(module.exports, "WizardStepComponent", () => $4395a932616607551cb14b7917bd8d10$export$9099ad97b570f7c);
$parcel$export(module.exports, "QuestionWithUnit", () => $84f9dee87c6271acbe7cafa74c90d11d$export$9099ad97b570f7c);
$parcel$export(module.exports, "SectionComponent", () => $a30e4f796f7727c4fefba7ccc8bf0a38$export$9099ad97b570f7c);
$parcel$export(module.exports, "SectionIdentifier", () => $861d973965bf2969b798a16b76f9ed91$export$9099ad97b570f7c);
$parcel$export(module.exports, "ShowAdvancedSwitch", () => $dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c);
$parcel$export(module.exports, "TypeQuestionAnswer", () => $50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c);

























var $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c = function Constants() {
    $7fmur$babelruntimehelpersclassCallCheck(this, Constants);
};
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "COMPOSITE_PATTERN", 'http://onto.fel.cvut.cz/ontologies/form/has-composite-pattern');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "PATTERN", 'http://onto.fel.cvut.cz/ontologies/form/has-pattern');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "COMPOSITE_VARIABLES", 'http://onto.fel.cvut.cz/ontologies/form/has-composite-variables');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "SHOW_ADVANCED_QUESTION", 'http://onto.fel.cvut.cz/ontologies/form/show-advanced-question');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "HAS_UNIT_OF_MEASURE", 'http://onto.fel.cvut.cz/ontologies/form/has-unit-of-measure-question');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "HAS_TYPE_QUESTION", 'http://onto.fel.cvut.cz/ontologies/form/has-type-question');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "HAS_IDENTIFYING_QUESTION", 'http://onto.fel.cvut.cz/ontologies/form/has-identifying-question');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "HAS_NON_SELECTABLE_VALUE", 'http://onto.fel.cvut.cz/ontologies/form/has-non-selectable-value');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "LAYOUT_TYPE_QUESTION", 'type-question');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "LAYOUT_STICKY", 'sticky');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "BROADER", 'http://www.w3.org/2004/02/skos/core#broader');
$7fmur$babelruntimehelpersdefineProperty($0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c, "DISJOINT_WITH", 'http://www.w3.org/2002/07/owl#disjointWith');


function $1dd64436880331518ad547a919bf54eb$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $1dd64436880331518ad547a919bf54eb$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $1dd64436880331518ad547a919bf54eb$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $1dd64436880331518ad547a919bf54eb$export$9099ad97b570f7c = /*#__PURE__*/ function(_Question) {
    $7fmur$babelruntimehelpersinherits(CompositeQuestion, _Question);
    var _super = $1dd64436880331518ad547a919bf54eb$var$_createSuper(CompositeQuestion);
    function CompositeQuestion(props) {
        var _this;
        $7fmur$babelruntimehelpersclassCallCheck(this, CompositeQuestion);
        _this = _super.call(this, props);
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "onAnswerChange", function(answerIndex, change) {
            _this._onChange($7fmur$Constants.HAS_ANSWER, answerIndex, change);
            var question = _this.props.question;
            if ($7fmur$jsonldutils.getJsonAttValue(question, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.COMPOSITE_PATTERN)) _this._updateExpandedParts(change);
        });
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "onSubQuestionChange", function(subQuestionIndex, change) {
            _this._onChange($7fmur$Constants.HAS_SUBQUESTION, subQuestionIndex, change);
            var question = _this.props.question;
            if ($7fmur$jsonldutils.getJsonAttValue(question, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.COMPOSITE_PATTERN)) _this._updateCollapsedComposite();
        });
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "onCommentChange", function(commentIndex, change) {
            _this._onChange($7fmur$Constants.HAS_COMMENT, commentIndex, change);
        });
        return _this;
    }
    $7fmur$babelruntimehelperscreateClass(CompositeQuestion, [
        {
            key: "_updateExpandedParts",
            value: function _updateExpandedParts() {
                var question = this.props.question;
                var subQuestions = this._getSubQuestions();
                var patternVariables = question[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.COMPOSITE_VARIABLES];
                var regex = new RegExp(question[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.PATTERN]);
                /**
       * @var {string} value
       */ var value = question[$7fmur$Constants.HAS_ANSWER][0][$7fmur$Constants.HAS_DATA_VALUE]['@value'];
                var match = value.match(regex);
                if (match) for(var i = 1; i < match.length; i++){
                    var subValue = match[i];
                    if (!subValue) subValue = '';
                    var id = patternVariables[i - 1];
                    var subQuestion = this._findById(subQuestions, id);
                    subQuestion[$7fmur$Constants.HAS_ANSWER][0][$7fmur$Constants.HAS_DATA_VALUE] = {
                        '@value': subValue.trim()
                    };
                }
                else subQuestions.forEach(function(subQuestion) {
                    subQuestion[$7fmur$Constants.HAS_ANSWER][0][$7fmur$Constants.HAS_DATA_VALUE] = {
                        '@value': ''
                    };
                });
            }
        },
        {
            key: "_findById",
            value: function _findById(arr, id) {
                return arr.find(function(el) {
                    return el['@id'] === id;
                });
            }
        },
        {
            key: "_updateCollapsedComposite",
            value: function _updateCollapsedComposite() {
                var question = this.props.question;
                var subQuestions = this._getSubQuestions();
                /**
       * @var {string} compositePattern
       */ var compositePattern = question[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.COMPOSITE_PATTERN];
                var patternVariables = question[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.COMPOSITE_VARIABLES];
                for(var i = patternVariables.length; i >= 1; i--){
                    var id = patternVariables[i - 1];
                    var subQuestion = this._findById(subQuestions, id);
                    var val = subQuestion[$7fmur$Constants.HAS_ANSWER][0][$7fmur$Constants.HAS_DATA_VALUE]['@value'];
                    if (!val) val = '';
                    compositePattern = compositePattern.replace('?' + i, val.trim());
                }
                var change = {
                };
                change[$7fmur$Constants.HAS_DATA_VALUE] = {
                    '@value': compositePattern.trim()
                };
                this._onChange($7fmur$Constants.HAS_ANSWER, 0, change);
            }
        },
        {
            key: "render",
            value: function render() {
                var question = this.props.question;
                if ($7fmur$FormUtils.isHidden(question)) return null;
                if (!$7fmur$FormUtils.isRelevant(question)) return null;
                return(/*#__PURE__*/ $7fmur$react.createElement($7fmur$Card, {
                    className: "mb-3"
                }, /*#__PURE__*/ $7fmur$react.createElement("div", {
                    className: "p-3"
                }, this.renderAnswers(), /*#__PURE__*/ $7fmur$react.createElement("div", {
                    className: "p-3"
                }, this.renderSubQuestions()))));
            }
        }
    ]);
    return CompositeQuestion;
}($7fmur$Question);
$7fmur$babelruntimehelpersdefineProperty($1dd64436880331518ad547a919bf54eb$export$9099ad97b570f7c, "mappingRule", function(q) {
    return $7fmur$jsonldutils.getJsonAttValue(q, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.COMPOSITE_PATTERN);
});
























































function $619100bc0476c2b0cc1aeca4effc798c$var$_createForOfIteratorHelper(o, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
    if (!it) {
        if (Array.isArray(o) || (it = $619100bc0476c2b0cc1aeca4effc798c$var$_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
            if (it) o = it;
            var i = 0;
            var F = function F1() {
            };
            return {
                s: F,
                n: function n() {
                    if (i >= o.length) return {
                        done: true
                    };
                    return {
                        done: false,
                        value: o[i++]
                    };
                },
                e: function e(_e) {
                    throw _e;
                },
                f: F
            };
        }
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return {
        s: function s() {
            it = it.call(o);
        },
        n: function n() {
            var step = it.next();
            normalCompletion = step.done;
            return step;
        },
        e: function e(_e2) {
            didErr = true;
            err = _e2;
        },
        f: function f() {
            try {
                if (!normalCompletion && it.return != null) it.return();
            } finally{
                if (didErr) throw err;
            }
        }
    };
}
function $619100bc0476c2b0cc1aeca4effc798c$var$_unsupportedIterableToArray(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return $619100bc0476c2b0cc1aeca4effc798c$var$_arrayLikeToArray(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $619100bc0476c2b0cc1aeca4effc798c$var$_arrayLikeToArray(o, minLen);
}
function $619100bc0476c2b0cc1aeca4effc798c$var$_arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
var $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c = /*#__PURE__*/ function() {
    function Utils() {
        $7fmur$babelruntimehelpersclassCallCheck(this, Utils);
    }
    $7fmur$babelruntimehelperscreateClass(Utils, null, [
        {
            key: "findParent",
            value: function findParent(root, id) {
                if (!root) return null;
                var subQuestions = root[$7fmur$Constants.HAS_SUBQUESTION];
                if (subQuestions && subQuestions.length) {
                    var _iterator = $619100bc0476c2b0cc1aeca4effc798c$var$_createForOfIteratorHelper(subQuestions), _step;
                    try {
                        for(_iterator.s(); !(_step = _iterator.n()).done;){
                            var subQuestion = _step.value;
                            if (subQuestion['@id'] === id) return root;
                            var found = Utils.findParent(subQuestion, id);
                            if (found) return found;
                        }
                    } catch (err) {
                        _iterator.e(err);
                    } finally{
                        _iterator.f();
                    }
                }
                return null;
            }
        },
        {
            key: "findChild",
            value: function findChild(parent, id) {
                if (!parent) return null;
                if (parent['@id'] === id) return parent;
                var subQuestions = parent[$7fmur$Constants.HAS_SUBQUESTION];
                if (subQuestions && subQuestions.length) {
                    var _iterator2 = $619100bc0476c2b0cc1aeca4effc798c$var$_createForOfIteratorHelper(subQuestions), _step2;
                    try {
                        for(_iterator2.s(); !(_step2 = _iterator2.n()).done;){
                            var subQuestion = _step2.value;
                            var found = Utils.findChild(subQuestion, id);
                            if (found) return found;
                        }
                    } catch (err) {
                        _iterator2.e(err);
                    } finally{
                        _iterator2.f();
                    }
                }
                return null;
            }
        },
        {
            key: "findDirectChild",
            value: function findDirectChild(parent, id) {
                if (!parent) return null;
                var subQuestions = parent[$7fmur$Constants.HAS_SUBQUESTION];
                if (subQuestions && subQuestions.length) for(var i = 0; i < subQuestions.length; i++){
                    if (subQuestions[i]['@id'] === id) return {
                        q: subQuestions[i],
                        index: i
                    };
                }
                return null;
            }
        },
        {
            key: "isReferencedByProperty",
            value: function isReferencedByProperty(questions, questionId, property) {
                if (questions && questions.length) {
                    var _iterator3 = $619100bc0476c2b0cc1aeca4effc798c$var$_createForOfIteratorHelper(questions), _step3;
                    try {
                        for(_iterator3.s(); !(_step3 = _iterator3.n()).done;){
                            var question = _step3.value;
                            if (Utils.hasPropertyWithValue(question, property, questionId)) return true;
                        }
                    } catch (err) {
                        _iterator3.e(err);
                    } finally{
                        _iterator3.f();
                    }
                }
                return false;
            }
        },
        {
            key: "hasSubQuestionWithValue",
            value: function hasSubQuestionWithValue(parent, property, value) {
                var subQuestions = parent[$7fmur$Constants.HAS_SUBQUESTION];
                if (subQuestions && subQuestions.length) {
                    var _iterator4 = $619100bc0476c2b0cc1aeca4effc798c$var$_createForOfIteratorHelper(subQuestions), _step4;
                    try {
                        for(_iterator4.s(); !(_step4 = _iterator4.n()).done;){
                            var subQuestion = _step4.value;
                            if ($7fmur$jsonldutils.hasValue(subQuestion, property, value)) return true;
                        }
                    } catch (err) {
                        _iterator4.e(err);
                    } finally{
                        _iterator4.f();
                    }
                }
                return false;
            }
        },
        {
            key: "hasPropertyWithValue",
            value: function hasPropertyWithValue(question, property, value) {
                if (!question) return false;
                var propValue = this.getJsonAttValues(question, property, "@id");
                if (!propValue) return false;
                if (propValue.includes(value)) return true;
                if (propValue === value) return true;
                if (propValue['@id'] === value) return true;
                return false;
            }
        },
        {
            key: "asArray",
            value: function asArray(object_or_array) {
                if (!object_or_array) return [];
                if (object_or_array.constructor === Array) return object_or_array;
                return [
                    object_or_array
                ];
            }
        },
        {
            key: "getJsonAttValues",
            value: function getJsonAttValues(obj, att) {
                var by = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
                if (obj[att] === null || obj[att] === undefined) return null;
                return Utils.asArray(obj[att]).map(function(v) {
                    return $7fmur$babelruntimehelperstypeof(v) === 'object' ? v[by ? by : '@value'] : v;
                });
            }
        },
        {
            key: "hasArraySameValues",
            value: function hasArraySameValues(arr1, arr2) {
                if (!arr1 || !arr2) return false;
                if (arr1.length === undefined) return false;
                if (arr1.length !== arr2.length) return false;
                var set = {
                };
                var _iterator5 = $619100bc0476c2b0cc1aeca4effc798c$var$_createForOfIteratorHelper(arr1), _step5;
                try {
                    for(_iterator5.s(); !(_step5 = _iterator5.n()).done;){
                        var el = _step5.value;
                        set[el] = 1;
                    }
                } catch (err) {
                    _iterator5.e(err);
                } finally{
                    _iterator5.f();
                }
                var _iterator6 = $619100bc0476c2b0cc1aeca4effc798c$var$_createForOfIteratorHelper(arr2), _step6;
                try {
                    for(_iterator6.s(); !(_step6 = _iterator6.n()).done;){
                        var _el = _step6.value;
                        if (!set[_el]) return false;
                        set[_el] = 2;
                    }
                } catch (err) {
                    _iterator6.e(err);
                } finally{
                    _iterator6.f();
                }
                return Object.values(set).every(function(el) {
                    return el === 2;
                });
            }
        }
    ]);
    return Utils;
}();


function $dc67e28234ccab0b1d2c2b45a9e8e84e$var$ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) symbols = symbols.filter(function(sym) {
            return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        });
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function $dc67e28234ccab0b1d2c2b45a9e8e84e$var$_objectSpread(target) {
    var _arguments = arguments, _loop = function(i) {
        var source = _arguments[i] != null ? _arguments[i] : {
        };
        if (i % 2) $dc67e28234ccab0b1d2c2b45a9e8e84e$var$ownKeys(Object(source), true).forEach(function(key) {
            $7fmur$babelruntimehelpersdefineProperty(target, key, source[key]);
        });
        else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
        else $dc67e28234ccab0b1d2c2b45a9e8e84e$var$ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    };
    for(var i = 1; i < arguments.length; i++)_loop(i);
    return target;
}
function $dc67e28234ccab0b1d2c2b45a9e8e84e$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $dc67e28234ccab0b1d2c2b45a9e8e84e$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $dc67e28234ccab0b1d2c2b45a9e8e84e$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c = /*#__PURE__*/ function(_Question) {
    $7fmur$babelruntimehelpersinherits(ShowAdvancedSwitch, _Question);
    var _super = $dc67e28234ccab0b1d2c2b45a9e8e84e$var$_createSuper(ShowAdvancedSwitch);
    function ShowAdvancedSwitch(props) {
        var _this;
        $7fmur$babelruntimehelpersclassCallCheck(this, ShowAdvancedSwitch);
        _this = _super.call(this, props);
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "onSubQuestionChange", function(subQuestionIndex, change) {
            _this._onChange($7fmur$Constants.HAS_SUBQUESTION, subQuestionIndex, change);
        });
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "_toggleAdvanced", function(e) {
            e.stopPropagation();
            var _this$_getShowAdvance = _this._getShowAdvancedQuestion(), index = _this$_getShowAdvance.index, question = _this$_getShowAdvance.question;
            var value = _this._getShowAdvancedState();
            question[$7fmur$Constants.HAS_ANSWER] = [
                {
                }
            ];
            question[$7fmur$Constants.HAS_ANSWER][0][$7fmur$Constants.HAS_DATA_VALUE] = {
                '@value': !value
            };
            question[$7fmur$Constants.HAS_VALID_ANSWER] = true;
            _this._onChange($7fmur$Constants.HAS_SUBQUESTION, index, question);
        });
        return _this;
    }
    $7fmur$babelruntimehelperscreateClass(ShowAdvancedSwitch, [
        {
            key: "_getShowAdvancedQuestion",
            value: function _getShowAdvancedQuestion() {
                return ShowAdvancedSwitch.findShowAdvancedQuestion(this.props.question);
            }
        },
        {
            key: "_getShowAdvancedState",
            value: function _getShowAdvancedState() {
                var _this$_getShowAdvance2 = this._getShowAdvancedQuestion(), question = _this$_getShowAdvance2.question;
                return ShowAdvancedSwitch.isShowAdvanced(question);
            }
        },
        {
            key: "_renderIcons",
            value: function _renderIcons() {
                var options = this.context.options;
                var icons = options.icons.filter(function(i) {
                    return i.id !== $7fmur$Constants.ICONS.QUESTION_COMMENTS;
                }); // question comment icons are not implemented (see https://github.com/kbss-cvut/s-forms-smart-components/issues/4)
                var optionsWithoutQuestionCommentsIcon = $dc67e28234ccab0b1d2c2b45a9e8e84e$var$_objectSpread($dc67e28234ccab0b1d2c2b45a9e8e84e$var$_objectSpread({
                }, options), {
                }, {
                    icons: icons
                });
                var _this$_getShowAdvance3 = this._getShowAdvancedQuestion(), question = _this$_getShowAdvance3.question;
                return $7fmur$QuestionStatic.renderIcons(question, optionsWithoutQuestionCommentsIcon);
            }
        },
        {
            key: "_renderSwitch",
            value: function _renderSwitch() {
                var question = this.props.question;
                var showAdvancedQuestion = this._getShowAdvancedQuestion(question).question;
                var advancedQuestionLabel = $7fmur$jsonldutils.getLocalized(showAdvancedQuestion[$7fmur$Constants.RDFS_LABEL], this.context.options.intl);
                var switchState = this._getShowAdvancedState();
                return(/*#__PURE__*/ $7fmur$react.createElement("div", {
                    className: "show-advanced-switch",
                    style: {
                        float: 'right'
                    }
                }, /*#__PURE__*/ $7fmur$react.createElement($7fmur$Form.Switch, {
                    onChange: this._toggleAdvanced,
                    id: '--switch-' + showAdvancedQuestion['@id'],
                    label: advancedQuestionLabel,
                    checked: switchState,
                    inline: true
                }), this._renderIcons()));
            }
        },
        {
            key: "render",
            value: function render() {
                return this._renderSwitch();
            }
        }
    ], [
        {
            key: "findShowAdvancedQuestion",
            value: function findShowAdvancedQuestion(parent) {
                var subQuestions = parent[$7fmur$Constants.HAS_SUBQUESTION];
                if (subQuestions && subQuestions.length) for(var i = 0; i < subQuestions.length; i++){
                    if ($7fmur$jsonldutils.hasValue(subQuestions[i], $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.SHOW_ADVANCED_QUESTION, true)) return {
                        index: i,
                        question: subQuestions[i]
                    };
                }
                return null;
            }
        },
        {
            key: "isShowAdvanced",
            value: function isShowAdvanced(question) {
                var value = false;
                if (question[$7fmur$Constants.HAS_ANSWER] && question[$7fmur$Constants.HAS_ANSWER].length) {
                    var answer = question[$7fmur$Constants.HAS_ANSWER][0];
                    if (answer[$7fmur$Constants.HAS_DATA_VALUE]) value = !!answer[$7fmur$Constants.HAS_DATA_VALUE]['@value'];
                }
                return value;
            }
        }
    ]);
    return ShowAdvancedSwitch;
}($7fmur$Question);
$7fmur$babelruntimehelpersdefineProperty($dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c, "mappingRule", function(q) {
    return $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.hasSubQuestionWithValue(q, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.SHOW_ADVANCED_QUESTION, true);
});
$dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c.contextType = $7fmur$ConfigurationContext;
















function $861d973965bf2969b798a16b76f9ed91$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $861d973965bf2969b798a16b76f9ed91$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $861d973965bf2969b798a16b76f9ed91$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $861d973965bf2969b798a16b76f9ed91$export$9099ad97b570f7c = /*#__PURE__*/ function(_React$Component) {
    $7fmur$babelruntimehelpersinherits(SectionIdentifier, _React$Component);
    var _super = $861d973965bf2969b798a16b76f9ed91$var$_createSuper(SectionIdentifier);
    function SectionIdentifier() {
        $7fmur$babelruntimehelpersclassCallCheck(this, SectionIdentifier);
        return _super.apply(this, arguments);
    }
    $7fmur$babelruntimehelperscreateClass(SectionIdentifier, [
        {
            key: "_getIdentifyingQuestionId",
            value: function _getIdentifyingQuestionId() {
                var question = this.props.question;
                var id = $7fmur$jsonldutils.getJsonAttValue(question, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_IDENTIFYING_QUESTION, '@id');
                if (!id) return null;
                return id;
            }
        },
        {
            key: "_getLabelText",
            value: function _getLabelText() {
                var question = this.props.question;
                var id = this._getIdentifyingQuestionId();
                if (!id) return null;
                var identifyingQuestion = $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.findChild(question, id);
                if (!identifyingQuestion) return null;
                var answers = identifyingQuestion[$7fmur$Constants.HAS_ANSWER];
                if (!answers || !answers.length) return null;
                var answer = $7fmur$FormUtils.resolveValueObject(answers[0]);
                if (!answer) return null;
                if (answer['@value']) {
                    if ($7fmur$FormUtils.isCheckbox(identifyingQuestion)) return $7fmur$jsonldutils.getLocalized(identifyingQuestion[$7fmur$Constants.RDFS_LABEL], this.context.options.intl);
                    return answer['@value'];
                }
                if (answer['@id']) {
                    // answer is object with id
                    var def = $7fmur$JsonLdObjectMap.getObject(id);
                    if (!def) return null;
                    var label = $7fmur$jsonldutils.getLocalized(def[$7fmur$Constants.RDFS_LABEL], this.context.options.intl);
                    if (label) return label;
                }
                return null;
            }
        },
        {
            key: "render",
            value: function render() {
                var text = this._getLabelText();
                if (text) return(/*#__PURE__*/ $7fmur$react.createElement("span", {
                    className: "section-identifier"
                }, this.props.prefix, text, this.props.suffix));
                return null;
            }
        }
    ]);
    return SectionIdentifier;
}($7fmur$react.Component);
$7fmur$babelruntimehelpersdefineProperty($861d973965bf2969b798a16b76f9ed91$export$9099ad97b570f7c, "contextType", $7fmur$ConfigurationContext);
$7fmur$babelruntimehelpersdefineProperty($861d973965bf2969b798a16b76f9ed91$export$9099ad97b570f7c, "propTypes", {
    question: $7fmur$proptypes.object.isRequired,
    prefix: $7fmur$proptypes.string,
    suffix: $7fmur$proptypes.string
});
$7fmur$babelruntimehelpersdefineProperty($861d973965bf2969b798a16b76f9ed91$export$9099ad97b570f7c, "defaultProps", {
    prefix: '',
    suffix: ''
});


function $4395a932616607551cb14b7917bd8d10$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $4395a932616607551cb14b7917bd8d10$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $4395a932616607551cb14b7917bd8d10$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $4395a932616607551cb14b7917bd8d10$export$9099ad97b570f7c = /*#__PURE__*/ function(_WizardStep) {
    $7fmur$babelruntimehelpersinherits(WizardStepComponent, _WizardStep);
    var _super = $4395a932616607551cb14b7917bd8d10$var$_createSuper(WizardStepComponent);
    function WizardStepComponent(props) {
        var _this;
        $7fmur$babelruntimehelpersclassCallCheck(this, WizardStepComponent);
        _this = _super.call(this, props);
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "_onMouseEnterHandler", function() {
            _this.setState({
                showIcon: true
            });
        });
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "_onMouseLeaveHandler", function() {
            _this.setState({
                showIcon: false
            });
        });
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "_handleScroll", function() {
            /**
       * @type {HTMLDivElement}
       */ var card = _this.card.current;
            /**
       * @type {HTMLHeadingElement}
       */ var header = _this.cardHeader.current;
            if (!card || !header) return;
            var box = card.getBoundingClientRect();
            if (box.top <= 0) {
                if (!_this.state.headerFloating) {
                    var headerBox = header.getBoundingClientRect();
                    _this.setState({
                        headerFloating: true,
                        headerWidth: headerBox.width,
                        headerHeight: headerBox.height
                    });
                }
            } else if (_this.state.headerFloating) _this.setState({
                headerFloating: false,
                headerWidth: 0,
                headerHeight: 0
            });
        });
        _this.state = {
            showIcon: false
        };
        _this.card = /*#__PURE__*/ $7fmur$react.createRef();
        _this.cardHeader = /*#__PURE__*/ $7fmur$react.createRef();
        _this.state = {
            headerFloating: false,
            headerWidth: 0,
            headerHeight: 0
        };
        return _this;
    }
    $7fmur$babelruntimehelperscreateClass(WizardStepComponent, [
        {
            key: "componentDidMount",
            value: function componentDidMount() {
                if (this._isSticky()) window.addEventListener('scroll', this._handleScroll);
            }
        },
        {
            key: "componentWillUnmount",
            value: function componentWillUnmount() {
                window.removeEventListener('scroll', this._handleScroll);
            }
        },
        {
            key: "_isSticky",
            value: function _isSticky() {
                var question = this.props.step;
                return $7fmur$jsonldutils.hasValue(question, $7fmur$Constants.LAYOUT_CLASS, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.LAYOUT_STICKY);
            }
        },
        {
            key: "_renderIdentifierText",
            value: function _renderIdentifierText() {
                return(/*#__PURE__*/ $7fmur$react.createElement($861d973965bf2969b798a16b76f9ed91$export$9099ad97b570f7c, {
                    question: this.props.step,
                    prefix: "(",
                    suffix: ")"
                }));
            }
        },
        {
            key: "_renderShowAdvanced",
            value: function _renderShowAdvanced() {
                var question = this.props.step;
                if (!$dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c.mappingRule(question)) return null;
                return(/*#__PURE__*/ $7fmur$react.createElement($dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c, {
                    question: this.props.step,
                    onChange: this.onChange,
                    index: this.props.stepIndex
                }));
            }
        },
        {
            key: "render",
            value: function render() {
                var categoryClass = $7fmur$Question._getQuestionCategoryClass(this.props.step);
                var headerClass = 'bg-primary text-white wizard-step-header';
                var headerStyle = null;
                if (this.state.headerFloating) {
                    headerClass += ' floating';
                    headerStyle = {
                        width: this.state.headerWidth
                    };
                }
                return(/*#__PURE__*/ $7fmur$react.createElement("div", {
                    className: "wizard-step"
                }, /*#__PURE__*/ $7fmur$react.createElement($7fmur$Card, {
                    ref: this.card,
                    className: "wizard-step-content"
                }, /*#__PURE__*/ $7fmur$react.createElement($7fmur$Card.Header, {
                    ref: this.cardHeader,
                    className: headerClass,
                    style: headerStyle,
                    as: "h6",
                    id: this.props.step['@id'],
                    onMouseEnter: this._onMouseEnterHandler,
                    onMouseLeave: this._onMouseLeaveHandler
                }, $7fmur$jsonldutils.getLocalized(this.props.step[$7fmur$jsonldutils.RDFS_LABEL], this.props.options.intl), $7fmur$QuestionStatic.renderIcons(this.props.step, this.props.options, this.onCommentChange, this.state.showIcon), this._renderIdentifierText(), this._renderShowAdvanced()), /*#__PURE__*/ $7fmur$react.createElement($7fmur$Card.Body, {
                    className: categoryClass,
                    style: {
                        marginTop: this.state.headerHeight
                    }
                }, /*#__PURE__*/ $7fmur$react.createElement($7fmur$Question, {
                    question: this.props.step,
                    onChange: this.onChange,
                    withoutCard: true,
                    index: this.props.stepIndex
                }))), this.props.options.wizardStepButtons && this._renderWizardStepButtons()));
            }
        }
    ]);
    return WizardStepComponent;
}($7fmur$WizardStep);
$7fmur$babelruntimehelpersdefineProperty($4395a932616607551cb14b7917bd8d10$export$9099ad97b570f7c, "mappingRule", function(q) {
    return $7fmur$FormUtils.isWizardStep(q);
});
$4395a932616607551cb14b7917bd8d10$export$9099ad97b570f7c.contextType = $7fmur$FormQuestionsContext;

















function $84f9dee87c6271acbe7cafa74c90d11d$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $84f9dee87c6271acbe7cafa74c90d11d$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $84f9dee87c6271acbe7cafa74c90d11d$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $84f9dee87c6271acbe7cafa74c90d11d$var$_QuestionWithUnit = /*#__PURE__*/ function(_Question) {
    $7fmur$babelruntimehelpersinherits(_QuestionWithUnit, _Question);
    var _super = $84f9dee87c6271acbe7cafa74c90d11d$var$_createSuper(_QuestionWithUnit);
    function _QuestionWithUnit(props) {
        var _this;
        $7fmur$babelruntimehelpersclassCallCheck(this, _QuestionWithUnit);
        _this = _super.call(this, props);
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "_onUnitQuestionChange", function(index, change) {
            // pass change to the parent
            _this.props.onChange(index, change);
        });
        return _this;
    }
    $7fmur$babelruntimehelperscreateClass(_QuestionWithUnit, [
        {
            key: "renderAnswers",
            value: function renderAnswers() {
                if (!this.props.formData) return null;
                var question = this.props.question;
                var unitId = question[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_UNIT_OF_MEASURE];
                if (unitId['@id']) unitId = unitId['@id'];
                var parent = $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.findParent(this.props.formData.root, question['@id']);
                if (!parent) return null;
                var unitQuestion = $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.findDirectChild(parent, unitId);
                if (!unitQuestion) {
                    console.error('question with unit: cannot find question ' + unitId);
                    return null;
                }
                var answers = this._getAnswers();
                var cls = $7fmur$classnames($7fmur$Question._getQuestionCategoryClass(question), 'answer');
                return [
                    /*#__PURE__*/ $7fmur$react.createElement("div", {
                        key: 'row-item-0',
                        className: cls,
                        id: question['@id']
                    }, /*#__PURE__*/ $7fmur$react.createElement("div", {
                        className: "question-with-unit"
                    }, /*#__PURE__*/ $7fmur$react.createElement("div", {
                        className: "base-question",
                        onMouseEnter: this._onMouseEnterHandler,
                        onMouseLeave: this._onMouseLeaveHandler
                    }, /*#__PURE__*/ $7fmur$react.createElement($7fmur$Answer, {
                        index: 0,
                        answer: answers[0],
                        question: question,
                        onChange: this.onAnswerChange,
                        onCommentChange: this.onCommentChange,
                        showIcon: this.state.showIcon
                    }), this._renderUnits(), this._renderPrefixes()), /*#__PURE__*/ $7fmur$react.createElement("div", {
                        className: "unit-question"
                    }, /*#__PURE__*/ $7fmur$react.createElement($7fmur$Question, {
                        question: unitQuestion.q,
                        onChange: this._onUnitQuestionChange,
                        index: unitQuestion.index
                    }))))
                ];
            }
        }
    ]);
    return _QuestionWithUnit;
}($7fmur$Question);
$84f9dee87c6271acbe7cafa74c90d11d$var$_QuestionWithUnit.propTypes.formData = $7fmur$proptypes.object;
var $84f9dee87c6271acbe7cafa74c90d11d$var$QuestionWithUnit = function QuestionWithUnit(props) {
    var formQuestionsContext = $7fmur$react.useContext($7fmur$FormQuestionsContext);
    var formData = formQuestionsContext.getData();
    return(/*#__PURE__*/ $7fmur$react.createElement($84f9dee87c6271acbe7cafa74c90d11d$var$_QuestionWithUnit, $7fmur$babelruntimehelpersextends({
        formData: formData
    }, props)));
};
var $84f9dee87c6271acbe7cafa74c90d11d$export$9099ad97b570f7c = $84f9dee87c6271acbe7cafa74c90d11d$var$QuestionWithUnit;









function $b0ac389ebfb57f6b41c229ddd6441261$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $b0ac389ebfb57f6b41c229ddd6441261$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $b0ac389ebfb57f6b41c229ddd6441261$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $b0ac389ebfb57f6b41c229ddd6441261$export$9099ad97b570f7c = /*#__PURE__*/ function(_React$Component) {
    $7fmur$babelruntimehelpersinherits(NullQuestion, _React$Component);
    var _super = $b0ac389ebfb57f6b41c229ddd6441261$var$_createSuper(NullQuestion);
    function NullQuestion() {
        $7fmur$babelruntimehelpersclassCallCheck(this, NullQuestion);
        return _super.apply(this, arguments);
    }
    $7fmur$babelruntimehelperscreateClass(NullQuestion, [
        {
            key: "render",
            value: function render() {
                return null;
            }
        }
    ]);
    return NullQuestion;
}($7fmur$react.Component);


















































function $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createForOfIteratorHelper(o, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
    if (!it) {
        if (Array.isArray(o) || (it = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
            if (it) o = it;
            var i = 0;
            var F = function F1() {
            };
            return {
                s: F,
                n: function n() {
                    if (i >= o.length) return {
                        done: true
                    };
                    return {
                        done: false,
                        value: o[i++]
                    };
                },
                e: function e(_e) {
                    throw _e;
                },
                f: F
            };
        }
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    var normalCompletion = true, didErr = false, err;
    return {
        s: function s() {
            it = it.call(o);
        },
        n: function n() {
            var step = it.next();
            normalCompletion = step.done;
            return step;
        },
        e: function e(_e2) {
            didErr = true;
            err = _e2;
        },
        f: function f() {
            try {
                if (!normalCompletion && it.return != null) it.return();
            } finally{
                if (didErr) throw err;
            }
        }
    };
}
function $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_unsupportedIterableToArray(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_arrayLikeToArray(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_arrayLikeToArray(o, minLen);
}
function $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) symbols = symbols.filter(function(sym) {
            return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        });
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_objectSpread(target) {
    var _arguments = arguments, _loop = function(i) {
        var source = _arguments[i] != null ? _arguments[i] : {
        };
        if (i % 2) $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$ownKeys(Object(source), true).forEach(function(key) {
            $7fmur$babelruntimehelpersdefineProperty(target, key, source[key]);
        });
        else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
        else $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    };
    for(var i = 1; i < arguments.length; i++)_loop(i);
    return target;
}
function $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c = /*#__PURE__*/ function(_React$Component) {
    $7fmur$babelruntimehelpersinherits(TypeQuestionAnswer, _React$Component);
    var _super = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createSuper(TypeQuestionAnswer);
    function TypeQuestionAnswer(props) {
        var _this;
        $7fmur$babelruntimehelpersclassCallCheck(this, TypeQuestionAnswer);
        _this = _super.call(this, props);
        $7fmur$babelruntimehelpersdefineProperty($7fmur$babelruntimehelpersassertThisInitialized(_this), "_onChange", function(value) {
            if (!value) value = [];
            if (value.length === undefined) value = [
                value
            ];
            _this._setAnswers(value);
            var change = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_objectSpread({
            }, _this.props.answer);
            change[$7fmur$Constants.HAS_DATA_VALUE] = {
                '@value': !!(value && value.length)
            };
            if (!_this.state.singleSelect) _this.setState({
                tree: _this._checkDisjointOptions(_this.state.tree, value)
            });
            _this.setState({
                selected: value,
                update: _this.state.update + 1
            });
            _this.props.onChange(_this.props.index, change);
        });
        _this.state = {
            // tree: [
            //   {id: '1', value: '1', label: 'One', children: ['1-1', '1-2']},
            //   {id: '1-1', value: '1-1', label: 'One One', children: []},
            //   {id: '1-2', value: '1-2', label: 'One Two', children: []},
            //   {id: '2', value: '2', label: 'Two', children: []},
            // ],
            tree: {
            },
            selected: [],
            singleSelect: false,
            update: 0
        };
        return _this;
    }
    $7fmur$babelruntimehelperscreateClass(TypeQuestionAnswer, [
        {
            key: "_setAnswers",
            value: function _setAnswers(answers) {
                var typeQuestions = this._findTypeQuestions();
                for(var i = 0; i < typeQuestions.length; i++){
                    var typeQuestion = typeQuestions[i].question;
                    var answer = answers[i];
                    if (answer) typeQuestion[$7fmur$Constants.HAS_ANSWER] = [
                        $7fmur$babelruntimehelpersdefineProperty({
                        }, $7fmur$Constants.HAS_OBJECT_VALUE, {
                            '@id': answer.value
                        })
                    ];
                    else typeQuestion[$7fmur$Constants.HAS_ANSWER] = [];
                    this.props.onSubChange(typeQuestions[i].index, typeQuestion);
                }
            }
        },
        {
            key: "_loadAnswers",
            value: function _loadAnswers(options) {
                var values = [];
                var typeQuestions = this._findTypeQuestions();
                var _iterator = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createForOfIteratorHelper(typeQuestions), _step;
                try {
                    for(_iterator.s(); !(_step = _iterator.n()).done;){
                        var typeQuestion = _step.value;
                        var question = typeQuestion.question;
                        var answer = question[$7fmur$Constants.HAS_ANSWER];
                        if (answer && answer.length) {
                            answer = answer[0];
                            if (answer[$7fmur$Constants.HAS_DATA_VALUE]) values.push(answer[$7fmur$Constants.HAS_DATA_VALUE]['@value']);
                        }
                    }
                } catch (err) {
                    _iterator.e(err);
                } finally{
                    _iterator.f();
                }
                return values.map(function(id) {
                    return options[id];
                }).filter(function(v) {
                    return !!v;
                });
            }
        },
        {
            key: "_findTypeQuestions",
            value: function _findTypeQuestions() {
                var question = this.props.question;
                var ids = $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.getJsonAttValues(question, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_TYPE_QUESTION, '@id');
                var subQuestions = question[$7fmur$Constants.HAS_SUBQUESTION];
                var typeQuestions = [];
                for(var i = 0; i < subQuestions.length; i++){
                    var subQuestion = subQuestions[i];
                    if (ids.includes(subQuestion['@id'])) typeQuestions.push({
                        index: i,
                        question: subQuestion
                    });
                }
                return typeQuestions;
            }
        },
        {
            key: "_getMaxNumberOfAnswers",
            value: function _getMaxNumberOfAnswers() {
                var question = this.props.question;
                var typeQuestions = question[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_TYPE_QUESTION];
                if (!typeQuestions) return 0;
                if (Array.isArray(typeQuestions)) return typeQuestions.length;
                return 1;
            }
        },
        {
            key: "_checkMaxNumberOfAnswers",
            value: function _checkMaxNumberOfAnswers(tree, selected) {
                var maxAnswerCount = this._getMaxNumberOfAnswers();
                selected = selected.map(function(o) {
                    return o.value;
                });
                if (selected.length >= maxAnswerCount) for(var _i = 0, _Object$values = Object.values(tree); _i < _Object$values.length; _i++){
                    var o = _Object$values[_i];
                    if (!selected.includes(o.value)) o.disabled = true;
                }
            }
        },
        {
            key: "_checkNonSelectableOptions",
            value: function _checkNonSelectableOptions(tree) {
                var question = this.props.question;
                for(var _i2 = 0, _Object$values2 = Object.values(tree); _i2 < _Object$values2.length; _i2++){
                    var o = _Object$values2[_i2];
                    if ($7fmur$jsonldutils.hasValue(question, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_NON_SELECTABLE_VALUE, o.value)) o.disabled = true;
                }
            }
        },
        {
            key: "_checkDisjointOptions",
            value: function _checkDisjointOptions(tree, selected) {
                for(var _i3 = 0, _Object$values3 = Object.values(tree); _i3 < _Object$values3.length; _i3++){
                    var o = _Object$values3[_i3];
                    o.disabled = false;
                }
                if (selected === undefined) selected = this.state.selected;
                if (selected) {
                    var _iterator2 = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createForOfIteratorHelper(selected), _step2;
                    try {
                        for(_iterator2.s(); !(_step2 = _iterator2.n()).done;){
                            var selectedOption = _step2.value;
                            var _iterator3 = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createForOfIteratorHelper(selectedOption.disjoint), _step3;
                            try {
                                for(_iterator3.s(); !(_step3 = _iterator3.n()).done;){
                                    var d = _step3.value;
                                    if (tree[d]) tree[d].disabled = true;
                                }
                            } catch (err) {
                                _iterator3.e(err);
                            } finally{
                                _iterator3.f();
                            }
                        }
                    } catch (err) {
                        _iterator2.e(err);
                    } finally{
                        _iterator2.f();
                    }
                    this._checkMaxNumberOfAnswers(tree, selected);
                }
                this._checkNonSelectableOptions(tree);
                return tree;
            }
        },
        {
            key: "_isTotalDisjoint",
            value: function _isTotalDisjoint(tree) {
                var options = Object.values(tree);
                for(var _i4 = 0, _options = options; _i4 < _options.length; _i4++){
                    var option = _options[_i4];
                    if (options.length - 1 !== option.disjoint.length) return false;
                }
                return true;
            }
        },
        {
            key: "_isRegenerationNeeded",
            value: function _isRegenerationNeeded(previousQuestion) {
                if (!Object.values(this.state.tree).length) return true;
                var question = this.props.question;
                return !$619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.hasArraySameValues(previousQuestion[$7fmur$Constants.HAS_OPTION], question[$7fmur$Constants.HAS_OPTION]);
            }
        },
        {
            key: "_generateOptions",
            value: function _generateOptions() {
                var question = this.props.question;
                var possibleValues = question[$7fmur$Constants.HAS_OPTION];
                if (!possibleValues || !possibleValues.length) return [];
                var options = {
                };
                var relations = [];
                var _iterator4 = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createForOfIteratorHelper(possibleValues), _step4;
                try {
                    for(_iterator4.s(); !(_step4 = _iterator4.n()).done;){
                        var pValue = _step4.value;
                        var label = $7fmur$jsonldutils.getLocalized(pValue[$7fmur$Constants.RDFS_LABEL], this.context.options.intl);
                        options[pValue['@id']] = {
                            value: pValue['@id'],
                            label: label,
                            children: [],
                            disjoint: []
                        };
                        if (pValue[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.DISJOINT_WITH]) {
                            var disjoints = pValue[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.DISJOINT_WITH];
                            if (disjoints.length === undefined) // only single disjoint without array
                            disjoints = [
                                disjoints
                            ];
                            var _iterator5 = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createForOfIteratorHelper(disjoints), _step5;
                            try {
                                for(_iterator5.s(); !(_step5 = _iterator5.n()).done;){
                                    var disjoint = _step5.value;
                                    relations.push({
                                        type: 'disjoint',
                                        a: disjoint['@id'],
                                        b: pValue['@id']
                                    });
                                }
                            } catch (err) {
                                _iterator5.e(err);
                            } finally{
                                _iterator5.f();
                            }
                        }
                        var _iterator6 = $50e554e1d7d6fe84b50f3d2c57d8a8f9$var$_createForOfIteratorHelper($619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.asArray(pValue[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.BROADER])), _step6;
                        try {
                            for(_iterator6.s(); !(_step6 = _iterator6.n()).done;){
                                var parent = _step6.value;
                                relations.push({
                                    type: 'parent-child',
                                    parent: parent['@id'],
                                    child: pValue['@id']
                                });
                            }
                        } catch (err) {
                            _iterator6.e(err);
                        } finally{
                            _iterator6.f();
                        }
                    }
                } catch (err) {
                    _iterator4.e(err);
                } finally{
                    _iterator4.f();
                }
                var pushDisjoint = function pushDisjoint1(a, b) {
                    if (!options[a].disjoint.includes(b)) options[a].disjoint.push(b);
                };
                for(var _i5 = 0, _relations = relations; _i5 < _relations.length; _i5++){
                    var relation = _relations[_i5];
                    if (relation.type === 'parent-child') {
                        var _options$relation$par;
                        (_options$relation$par = options[relation.parent]) === null || _options$relation$par === void 0 || _options$relation$par.children.push(relation.child);
                    }
                    if (relation.type === 'disjoint') {
                        if (options[relation.a] && options[relation.b]) {
                            pushDisjoint(relation.a, relation.b);
                            pushDisjoint(relation.b, relation.a);
                        }
                    }
                }
                var answers = this._loadAnswers(options);
                var totalDisjoint = this._isTotalDisjoint(options);
                if (this._getMaxNumberOfAnswers() <= 1) // single answer allowed
                totalDisjoint = true;
                if (!totalDisjoint) this._checkDisjointOptions(options, answers);
                this._checkNonSelectableOptions(options);
                this.setState({
                    tree: options,
                    singleSelect: totalDisjoint,
                    update: this.state.update + 1,
                    selected: answers
                });
            }
        },
        {
            key: "_renderSelect",
            value: function _renderSelect() {
                if (!Object.values(this.state.tree).length) return null;
                var selectedValue = this.state.selected;
                if (this.state.singleSelect) {
                    var _selectedValue;
                    selectedValue = (_selectedValue = selectedValue) === null || _selectedValue === void 0 ? void 0 : _selectedValue[0];
                }
                return(/*#__PURE__*/ $7fmur$react.createElement($7fmur$IntelligentTreeSelect, {
                    value: selectedValue,
                    valueKey: "value",
                    labelKey: "label",
                    childrenKey: "children",
                    options: Object.values(this.state.tree),
                    expanded: true,
                    closeOnSelect: this.state.singleSelect,
                    onChange: this._onChange,
                    multi: !this.state.singleSelect,
                    showSettings: false,
                    renderAsTree: true,
                    optionLeftOffset: 5
                }));
            }
        },
        {
            key: "_renderLabel",
            value: function _renderLabel() {
                var label = $7fmur$jsonldutils.getLocalized(this.props.question[$7fmur$Constants.RDFS_LABEL], this.context.options.intl);
                return(/*#__PURE__*/ $7fmur$react.createElement($7fmur$Form.Label, null, label));
            }
        },
        {
            key: "componentDidMount",
            value: function componentDidMount() {
                this._generateOptions();
            }
        },
        {
            key: "componentDidUpdate",
            value: function componentDidUpdate(prevProps) {
                if (this._isRegenerationNeeded(prevProps.question)) {
                    console.debug('regeneration needed');
                    this._generateOptions();
                }
            }
        },
        {
            key: "render",
            value: function render() {
                var question = this.props.question;
                var options = this.context.options;
                var onCommentChange = this.props.onCommentChange;
                var showIcon = this.props.showIcon;
                if (this.props.isInSectionHeader) return(/*#__PURE__*/ $7fmur$react.createElement("div", {
                    className: "type-answer-group"
                }, this._renderLabel(), $7fmur$QuestionStatic.renderIcons(question, options, onCommentChange, showIcon), this._renderSelect()));
                return(/*#__PURE__*/ $7fmur$react.createElement($7fmur$FormGroup, null, this._renderLabel(), $7fmur$QuestionStatic.renderIcons(question, options, onCommentChange, showIcon), this._renderSelect()));
            }
        }
    ]);
    return TypeQuestionAnswer;
}($7fmur$react.Component);
$7fmur$babelruntimehelpersdefineProperty($50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c, "mappingRule", function(q) {
    return $7fmur$jsonldutils.hasValue(q, $7fmur$Constants.LAYOUT_CLASS, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.LAYOUT_TYPE_QUESTION);
});
$50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c.contextType = $7fmur$ConfigurationContext;
$50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c.propTypes = {
    index: $7fmur$proptypes.number.isRequired,
    answer: $7fmur$proptypes.object.isRequired,
    question: $7fmur$proptypes.object.isRequired,
    onChange: $7fmur$proptypes.func.isRequired,
    onCommentChange: $7fmur$proptypes.func.isRequired,
    showIcon: $7fmur$proptypes.bool.isRequired,
    onSubChange: $7fmur$proptypes.func.isRequired,
    isInSectionHeader: $7fmur$proptypes.bool
};



function $a30e4f796f7727c4fefba7ccc8bf0a38$var$_createSuper(Derived) {
    var hasNativeReflectConstruct = $a30e4f796f7727c4fefba7ccc8bf0a38$var$_isNativeReflectConstruct();
    return function _createSuperInternal() {
        var Super = $7fmur$babelruntimehelpersgetPrototypeOf(Derived), result;
        if (hasNativeReflectConstruct) {
            var NewTarget = $7fmur$babelruntimehelpersgetPrototypeOf(this).constructor;
            result = Reflect.construct(Super, arguments, NewTarget);
        } else result = Super.apply(this, arguments);
        return $7fmur$babelruntimehelperspossibleConstructorReturn(this, result);
    };
}
function $a30e4f796f7727c4fefba7ccc8bf0a38$var$_isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
    } catch (e) {
        return false;
    }
}
var $a30e4f796f7727c4fefba7ccc8bf0a38$export$9099ad97b570f7c = /*#__PURE__*/ function(_Question) {
    $7fmur$babelruntimehelpersinherits(SectionComponent, _Question);
    var _super = $a30e4f796f7727c4fefba7ccc8bf0a38$var$_createSuper(SectionComponent);
    function SectionComponent(props) {
        var _this;
        $7fmur$babelruntimehelpersclassCallCheck(this, SectionComponent);
        _this = _super.call(this, props);
        var toggleCollapseSuper = _this.toggleCollapse;
        _this.toggleCollapse = function(e) {
            var classList = e.target.classList;
            if (!classList.contains('answer-content') && !classList.contains('card-header') && !classList.contains('answer') && !classList.contains('show-advanced-switch') && !classList.contains('d-inline') && !classList.contains('caret-square-down') && !classList.contains('form-label') && !(classList.length === 0)) return;
            toggleCollapseSuper();
        };
        return _this;
    }
    $7fmur$babelruntimehelperscreateClass(SectionComponent, [
        {
            key: "_renderIdentifierText",
            value: function _renderIdentifierText() {
                return(/*#__PURE__*/ $7fmur$react.createElement($861d973965bf2969b798a16b76f9ed91$export$9099ad97b570f7c, {
                    question: this.props.question,
                    prefix: "(",
                    suffix: ")"
                }));
            }
        },
        {
            key: "_renderShowAdvanced",
            value: function _renderShowAdvanced() {
                var question = this.props.question;
                if (!$dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c.mappingRule(question)) return null;
                return(/*#__PURE__*/ $7fmur$react.createElement($dc67e28234ccab0b1d2c2b45a9e8e84e$export$9099ad97b570f7c, this.props));
            }
        },
        {
            key: "renderHeaderExtension",
            value: function renderHeaderExtension() {
                return(/*#__PURE__*/ $7fmur$react.createElement($7fmur$react.Fragment, null, this._renderIdentifierText(), this.state.expanded && this._renderShowAdvanced()));
            }
        },
        {
            key: "_renderAnswer",
            value: function _renderAnswer(index, answer) {
                var question = this.props.question;
                var component = $7fmur$Answer;
                if ($50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c.mappingRule(question)) component = $50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c;
                return(/*#__PURE__*/ $7fmur$react.createElement(component, {
                    index: index,
                    answer: answer,
                    question: question,
                    onChange: this.onAnswerChange,
                    onCommentChange: this.onCommentChange,
                    showIcon: this.state.showIcon,
                    onSubChange: this.onSubQuestionChange,
                    isInSectionHeader: true
                }));
            }
        },
        {
            key: "_getAnswerWidthStyle",
            value: function _getAnswerWidthStyle() {
                if ($50e554e1d7d6fe84b50f3d2c57d8a8f9$export$9099ad97b570f7c.mappingRule(this.props.question)) return {
                    maxWidth: 'none'
                };
                return $7fmur$babelruntimehelpersget($7fmur$babelruntimehelpersgetPrototypeOf(SectionComponent.prototype), "_getAnswerWidthStyle", this).call(this);
            }
        },
        {
            key: "renderAnswers",
            value: function renderAnswers() {
                var question = this.props.question, children = [], answers = this._getAnswers();
                var cls;
                var isTextarea;
                for(var i = 0, len = answers.length; i < len; i++){
                    isTextarea = $7fmur$FormUtils.isTextarea(question, $7fmur$FormUtils.resolveValue(answers[i])) || $7fmur$FormUtils.isSparqlInput(question) || $7fmur$FormUtils.isTurtleInput(question);
                    cls = $7fmur$classnames('answer', $7fmur$Question._getQuestionCategoryClass(question), $7fmur$Question.getEmphasizedOnRelevantClass(question));
                    children.push(/*#__PURE__*/ $7fmur$react.createElement("div", {
                        key: 'row-item-' + i,
                        className: cls,
                        id: question['@id'],
                        onMouseEnter: this._onMouseEnterHandler,
                        onMouseLeave: this._onMouseLeaveHandler
                    }, /*#__PURE__*/ $7fmur$react.createElement("div", {
                        className: "answer-content",
                        style: this._getAnswerWidthStyle()
                    }, this._renderAnswer(i, answers[i]), this._renderIdentifierText()), this._renderUnits(), this._renderPrefixes(), this._renderShowAdvanced()));
                }
                return children;
            }
        },
        {
            key: "_getSubQuestions",
            value: function _getSubQuestions() {
                var sub = $7fmur$babelruntimehelpersget($7fmur$babelruntimehelpersgetPrototypeOf(SectionComponent.prototype), "_getSubQuestions", this).call(this);
                return sub;
            }
        }
    ]);
    return SectionComponent;
}($7fmur$Question);
$7fmur$babelruntimehelpersdefineProperty($a30e4f796f7727c4fefba7ccc8bf0a38$export$9099ad97b570f7c, "mappingRule", function(q) {
    return $7fmur$FormUtils.isSection(q) && !$7fmur$FormUtils.isWizardStep(q);
});
$a30e4f796f7727c4fefba7ccc8bf0a38$export$9099ad97b570f7c.contextType = $7fmur$ConfigurationContext;


var $7114736cb063cbf188cc73926cda27d7$export$9099ad97b570f7c = /*#__PURE__*/ function() {
    function SmartComponents() {
        $7fmur$babelruntimehelpersclassCallCheck(this, SmartComponents);
    }
    $7fmur$babelruntimehelperscreateClass(SmartComponents, null, [
        {
            key: "_cached",
            value: function _cached(q, form, key, mapRule) {
                var cachedQuestion = SmartComponents.componentCache[q['@id']];
                if (cachedQuestion === undefined) {
                    cachedQuestion = {
                    };
                    SmartComponents.componentCache[q['@id']] = {
                    };
                }
                var cachedValue = cachedQuestion[key];
                if (cachedValue === undefined) {
                    cachedValue = mapRule(q, form);
                    SmartComponents.componentCache[q['@id']][key] = cachedValue;
                }
                return cachedValue;
            }
        },
        {
            key: "getComponentMapping",
            value: function getComponentMapping() {
                return [
                    {
                        component: $4395a932616607551cb14b7917bd8d10$export$9099ad97b570f7c,
                        mapRule: $4395a932616607551cb14b7917bd8d10$export$9099ad97b570f7c.mappingRule
                    },
                    {
                        component: $a30e4f796f7727c4fefba7ccc8bf0a38$export$9099ad97b570f7c,
                        mapRule: $a30e4f796f7727c4fefba7ccc8bf0a38$export$9099ad97b570f7c.mappingRule
                    },
                    {
                        component: $1dd64436880331518ad547a919bf54eb$export$9099ad97b570f7c,
                        mapRule: $1dd64436880331518ad547a919bf54eb$export$9099ad97b570f7c.mappingRule
                    },
                    {
                        component: $b0ac389ebfb57f6b41c229ddd6441261$export$9099ad97b570f7c,
                        mapRule: function mapRule(q, form) {
                            return SmartComponents._cached(q, form, 'NullQuestion-unit-of-measure', function() {
                                var parent = $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.findParent(form === null || form === void 0 ? void 0 : form.root, q['@id']);
                                return !!(parent && $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.isReferencedByProperty(parent[$7fmur$Constants.HAS_SUBQUESTION], q['@id'], $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_UNIT_OF_MEASURE));
                            });
                        }
                    },
                    {
                        component: $b0ac389ebfb57f6b41c229ddd6441261$export$9099ad97b570f7c,
                        mapRule: function mapRule(q, form) {
                            return SmartComponents._cached(q, form, 'NullQuestion-type-question', function() {
                                var parent = $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.findParent(form === null || form === void 0 ? void 0 : form.root, q['@id']);
                                return $619100bc0476c2b0cc1aeca4effc798c$export$9099ad97b570f7c.hasPropertyWithValue(parent, $0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_TYPE_QUESTION, q['@id']);
                            });
                        }
                    },
                    {
                        component: $b0ac389ebfb57f6b41c229ddd6441261$export$9099ad97b570f7c,
                        mapRule: function mapRule(q) {
                            return !!q[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.SHOW_ADVANCED_QUESTION];
                        }
                    },
                    {
                        component: $84f9dee87c6271acbe7cafa74c90d11d$export$9099ad97b570f7c,
                        mapRule: function mapRule(q) {
                            return !!q[$0e893ae116b3b75a04e993cef680c516$export$9099ad97b570f7c.HAS_UNIT_OF_MEASURE];
                        }
                    }
                ];
            }
        }
    ]);
    return SmartComponents;
}();
$7fmur$babelruntimehelpersdefineProperty($7114736cb063cbf188cc73926cda27d7$export$9099ad97b570f7c, "componentCache", {
});










var $cb0df5b2e7073908f1f1fcf8aa987212$export$9099ad97b570f7c = $7114736cb063cbf188cc73926cda27d7$export$9099ad97b570f7c;


//# sourceMappingURL=lib.js.map
