UNPKG

survey-react-ui

Version:

survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.

2 lines 313 kB
/*! For license information please see survey-react-ui.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("survey-core")):"function"==typeof define&&define.amd?define("survey-react-ui",["react","react-dom","survey-core"],t):"object"==typeof exports?exports["survey-react-ui"]=t(require("react"),require("react-dom"),require("survey-core")):e.SurveyReact=t(e.React,e.ReactDOM,e.Survey)}(this,((e,t,n)=>(()=>{"use strict";var r={3:e=>{e.exports=t},156:e=>{e.exports=n},442:t=>{t.exports=e}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{CharacterCounterComponent:()=>z,ComponentsContainer:()=>ge,Header:()=>xr,HeaderCell:()=>Or,HeaderMobile:()=>_r,List:()=>qn,ListItemContent:()=>Jn,ListItemGroup:()=>Xn,LoadingIndicatorComponent:()=>Et,LogoImage:()=>$n,MatrixRow:()=>Xt,Model:()=>a.SurveyModel,NotifierComponent:()=>Ce,Popup:()=>R,PopupModal:()=>qe,PopupSurvey:()=>Nn,QuestionErrorComponent:()=>wr,RatingDropdownItem:()=>et,RatingItem:()=>Ke,RatingItemSmiley:()=>Ye,RatingItemStar:()=>Ge,ReactElementFactory:()=>u,ReactQuestionFactory:()=>F,ReactSurveyElement:()=>m,ReactSurveyElementsWrapper:()=>c,Scroll:()=>xe,Skeleton:()=>Er,Survey:()=>Me,SurveyActionBar:()=>D,SurveyElementBase:()=>d,SurveyElementErrors:()=>se,SurveyFileChooseButton:()=>xt,SurveyFilePreview:()=>Rt,SurveyFlowPanel:()=>De,SurveyHeader:()=>de,SurveyLocStringEditor:()=>Sr,SurveyLocStringViewer:()=>vr,SurveyModel:()=>a.SurveyModel,SurveyNavigationBase:()=>Re,SurveyNavigationButton:()=>yr,SurveyPage:()=>pe,SurveyPanel:()=>ke,SurveyProgress:()=>Cn,SurveyProgressButtons:()=>gn,SurveyProgressToc:()=>On,SurveyQuestion:()=>ie,SurveyQuestionAndErrorsCell:()=>le,SurveyQuestionBoolean:()=>Wt,SurveyQuestionBooleanCheckbox:()=>Ft,SurveyQuestionBooleanRadio:()=>zt,SurveyQuestionButtonGroup:()=>Wn,SurveyQuestionCheckbox:()=>Ve,SurveyQuestionCheckboxItem:()=>Ze,SurveyQuestionComment:()=>X,SurveyQuestionCommentItem:()=>Y,SurveyQuestionComposite:()=>zn,SurveyQuestionCustom:()=>Qn,SurveyQuestionDropdown:()=>lt,SurveyQuestionDropdownBase:()=>st,SurveyQuestionDropdownSelect:()=>mt,SurveyQuestionElementBase:()=>f,SurveyQuestionEmpty:()=>Jt,SurveyQuestionExpression:()=>Pn,SurveyQuestionFile:()=>_t,SurveyQuestionHtml:()=>wt,SurveyQuestionImage:()=>Tn,SurveyQuestionImagePicker:()=>kn,SurveyQuestionMatrix:()=>yt,SurveyQuestionMatrixCell:()=>vt,SurveyQuestionMatrixDetailButton:()=>rr,SurveyQuestionMatrixDropdown:()=>un,SurveyQuestionMatrixDropdownBase:()=>nn,SurveyQuestionMatrixDropdownCell:()=>an,SurveyQuestionMatrixDynamic:()=>pn,SurveyQuestionMatrixDynamicAddButton:()=>hn,SurveyQuestionMatrixDynamicDragDropIcon:()=>$t,SurveyQuestionMatrixDynamicRemoveButton:()=>tr,SurveyQuestionMatrixRow:()=>Ct,SurveyQuestionMultipleText:()=>Ht,SurveyQuestionOptionItem:()=>ot,SurveyQuestionPanelDynamic:()=>mn,SurveyQuestionPanelDynamicAddButton:()=>sr,SurveyQuestionPanelDynamicNextButton:()=>hr,SurveyQuestionPanelDynamicPrevButton:()=>cr,SurveyQuestionPanelDynamicProgressText:()=>mr,SurveyQuestionPanelDynamicRemoveButton:()=>lr,SurveyQuestionRadioItem:()=>Tt,SurveyQuestionRadiogroup:()=>Dt,SurveyQuestionRanking:()=>We,SurveyQuestionRankingItem:()=>Ue,SurveyQuestionRankingItemContent:()=>Fe,SurveyQuestionRating:()=>Ln,SurveyQuestionRatingDropdown:()=>Mn,SurveyQuestionSignaturePad:()=>Zn,SurveyQuestionTagbox:()=>ht,SurveyQuestionTagboxItem:()=>ct,SurveyQuestionText:()=>Zt,SurveyRow:()=>w,SurveyTimerPanel:()=>He,SurveyWindow:()=>Hn,SurveyWindowModel:()=>a.SurveyWindowModel,SvgBundleComponent:()=>be,SvgIcon:()=>O,TagboxFilterString:()=>nt,TitleActions:()=>A,TitleElement:()=>U,attachKey2click:()=>Ie,settings:()=>a.settings,surveyLocalization:()=>a.surveyLocalization,surveyStrings:()=>a.surveyStrings});var a=i(156),l=i(442),u=function(){function e(){this.creatorHash={}}return e.prototype.registerElement=function(e,t){this.creatorHash[e]=t},e.prototype.getAllTypes=function(){var e=new Array;for(var t in this.creatorHash)e.push(t);return e.sort()},e.prototype.isElementRegistered=function(e){return!!this.creatorHash[e]},e.prototype.createElement=function(e,t){var n=this.creatorHash[e];return null==n?null:n(t)},e.Instance=new e,e}(),c=function(){function e(){}return e.wrapRow=function(e,t,n){var r=e.getRowWrapperComponentName(n),o=e.getRowWrapperComponentData(n);return u.Instance.createElement(r,{element:t,row:n,componentData:o})},e.wrapElement=function(e,t,n){var r=e.getElementWrapperComponentName(n),o=e.getElementWrapperComponentData(n);return u.Instance.createElement(r,{element:t,question:n,componentData:o})},e.wrapQuestionContent=function(e,t,n){var r=e.getQuestionContentWrapperComponentName(n),o=e.getElementWrapperComponentData(n);return u.Instance.createElement(r,{element:t,question:n,componentData:o})},e.wrapItemValue=function(e,t,n,r){var o=e.getItemValueWrapperComponentName(r,n),i=e.getItemValueWrapperComponentData(r,n);return u.Instance.createElement(o,{key:null==t?void 0:t.key,element:t,question:n,item:r,componentData:i})},e.wrapMatrixCell=function(e,t,n,r){void 0===r&&(r="cell");var o=e.getElementWrapperComponentName(n,r),i=e.getElementWrapperComponentData(n,r);return u.Instance.createElement(o,{element:t,cell:n,componentData:i})},e}();a.SurveyModel.platform="react";var p,h=(p=function(e,t){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},p(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),d=function(e){function t(t){var n=e.call(this,t)||this;return n._allowComponentUpdate=!0,n.prevStateElements=[],n.propertyValueChangedHandler=function(e,t,r){if(e[t]!==r){if(e[t]=r,!n.canUsePropInState(t))return;if(n.isRendering)return;n.changedStatePropNameValue=t,n.setState((function(e){var n={};return n[t]=r,n}))}},n}return h(t,e),t.renderLocString=function(e,t,n){return void 0===t&&(t=null),u.Instance.createElement(e.renderAs,{locStr:e.renderAsData,style:t,key:n})},t.renderQuestionDescription=function(e){var n=t.renderLocString(e.locDescription);return l.createElement("div",{style:e.hasDescription?void 0:{display:"none"},id:e.ariaDescriptionId,className:e.cssDescription},n)},t.prototype.componentDidMount=function(){this.makeBaseElementsReact()},t.prototype.componentWillUnmount=function(){this.unMakeBaseElementsReact(),this.disableStateElementsRerenderEvent(this.getStateElements())},t.prototype.componentDidUpdate=function(e,t){var n;this.makeBaseElementsReact();var r=this.getStateElements();this.disableStateElementsRerenderEvent((null!==(n=this.prevStateElements)&&void 0!==n?n:[]).filter((function(e){return!r.find((function(t){return t==e}))}))),this.prevStateElements=[],this.getStateElements().forEach((function(e){e.afterRerender()}))},t.prototype.allowComponentUpdate=function(){this._allowComponentUpdate=!0,this.forceUpdate()},t.prototype.denyComponentUpdate=function(){this._allowComponentUpdate=!1},t.prototype.shouldComponentUpdate=function(e,t){return this._allowComponentUpdate&&(this.unMakeBaseElementsReact(),this.prevStateElements=this.getStateElements()),this._allowComponentUpdate},t.prototype.render=function(){if(!this.canRender())return null;this.startEndRendering(1);var e=this.renderElement();return this.startEndRendering(-1),e&&(e=this.wrapElement(e)),this.changedStatePropNameValue=void 0,e},t.prototype.wrapElement=function(e){return e},Object.defineProperty(t.prototype,"isRendering",{get:function(){for(var e=0,t=this.getRenderedElements();e<t.length;e++)if(t[e].reactRendering>0)return!0;return!1},enumerable:!1,configurable:!0}),t.prototype.getRenderedElements=function(){return this.getStateElements()},t.prototype.startEndRendering=function(e){for(var t=0,n=this.getRenderedElements();t<n.length;t++){var r=n[t];r.reactRendering||(r.reactRendering=0),r.reactRendering+=e}},t.prototype.canRender=function(){return!0},t.prototype.renderElement=function(){return null},Object.defineProperty(t.prototype,"changedStatePropName",{get:function(){return this.changedStatePropNameValue},enumerable:!1,configurable:!0}),t.prototype.makeBaseElementsReact=function(){for(var e=this.getStateElements(),t=0;t<e.length;t++)e[t].enableOnElementRerenderedEvent(),this.makeBaseElementReact(e[t])},t.prototype.unMakeBaseElementsReact=function(){var e=this.getStateElements();this.unMakeBaseElementsReactive(e)},t.prototype.unMakeBaseElementsReactive=function(e){for(var t=0;t<e.length;t++)this.unMakeBaseElementReact(e[t])},t.prototype.disableStateElementsRerenderEvent=function(e){e.forEach((function(e){e.disableOnElementRerenderedEvent()}))},t.prototype.getStateElements=function(){var e=this.getStateElement();return e?[e]:[]},t.prototype.getStateElement=function(){return null},Object.defineProperty(t.prototype,"isDisplayMode",{get:function(){return this.props.isDisplayMode||!1},enumerable:!1,configurable:!0}),t.prototype.renderLocString=function(e,n,r){return void 0===n&&(n=null),t.renderLocString(e,n,r)},t.prototype.canMakeReact=function(e){return!!e&&!!e.iteratePropertiesHash},t.prototype.isCurrentStateElement=function(e){return!!e&&!!e.setPropertyValueCoreHandler&&e.setPropertyValueCoreHandler===this.propertyValueChangedHandler},t.prototype.makeBaseElementReact=function(e){var t=this;this.canMakeReact(e)&&(e.iteratePropertiesHash((function(e,n){if(t.canUsePropInState(n)){var r=e[n];Array.isArray(r)&&(r.onArrayChanged=function(e){t.isRendering||(t.changedStatePropNameValue=n,t.setState((function(e){var t={};return t[n]=r,t})))})}})),e.setPropertyValueCoreHandler=this.propertyValueChangedHandler)},t.prototype.canUsePropInState=function(e){return!0},t.prototype.unMakeBaseElementReact=function(e){this.canMakeReact(e)&&(this.isCurrentStateElement(e),e.setPropertyValueCoreHandler=void 0,e.iteratePropertiesHash((function(e,t){var n=e[t];Array.isArray(n)&&(n.onArrayChanged=function(){})})))},t}(l.Component),m=function(e){function t(t){return e.call(this,t)||this}return h(t,e),Object.defineProperty(t.prototype,"cssClasses",{get:function(){return this.props.cssClasses},enumerable:!1,configurable:!0}),t}(d),f=function(e){function t(t){return e.call(this,t)||this}return h(t,e),t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.updateDomElement()},t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.updateDomElement()},t.prototype.componentWillUnmount=function(){if(e.prototype.componentWillUnmount.call(this),this.questionBase){var t=this.content||this.control;this.questionBase.beforeDestroyQuestionElement(t),t&&t.removeAttribute("data-rendered")}},t.prototype.updateDomElement=function(){var e=this.content||this.control;e&&"r"!==e.getAttribute("data-rendered")&&(e.setAttribute("data-rendered","r"),this.questionBase.afterRenderQuestionElement(e))},Object.defineProperty(t.prototype,"questionBase",{get:function(){return this.props.question},enumerable:!1,configurable:!0}),t.prototype.getRenderedElements=function(){return[this.questionBase]},Object.defineProperty(t.prototype,"creator",{get:function(){return this.props.creator},enumerable:!1,configurable:!0}),t.prototype.canRender=function(){return!!this.questionBase&&!!this.creator},t.prototype.shouldComponentUpdate=function(t,n){return!(!e.prototype.shouldComponentUpdate.call(this,t,n)||this.questionBase.customWidget&&!this.questionBase.customWidgetData.isNeedRender&&!this.questionBase.customWidget.widgetJson.isDefaultRender&&!this.questionBase.customWidget.widgetJson.render)},Object.defineProperty(t.prototype,"isDisplayMode",{get:function(){return this.props.isDisplayMode||!!this.questionBase&&this.questionBase.isInputReadOnly||!1},enumerable:!1,configurable:!0}),t.prototype.wrapCell=function(e,t,n){if(!n)return t;var r=this.questionBase.survey,o=null;return r&&(o=c.wrapMatrixCell(r,t,e,n)),null!=o?o:t},t.prototype.setControl=function(e){e&&(this.control=e)},t.prototype.setContent=function(e){e&&(this.content=e)},t}(d),y=function(e){function t(t){var n=e.call(this,t)||this;return n.updateValueOnEvent=function(e){a.Helpers.isTwoValueEquals(n.questionBase.value,e.target.value,!1,!0,!1)||n.setValueCore(e.target.value)},n.updateValueOnEvent=n.updateValueOnEvent.bind(n),n}return h(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.questionBase},enumerable:!1,configurable:!0}),t.prototype.setValueCore=function(e){this.questionBase.value=e},t.prototype.getValueCore=function(){return this.questionBase.value},t.prototype.updateDomElement=function(){if(this.control){var t=this.control,n=this.getValueCore();a.Helpers.isTwoValueEquals(n,t.value,!1,!0,!1)||(t.value=this.getValue(n))}e.prototype.updateDomElement.call(this)},t.prototype.getValue=function(e){return a.Helpers.isValueEmpty(e)?"":e},t}(f),C=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(e){function t(t){var n=e.call(this,t)||this;return n.element.cssClasses,n.rootRef=l.createRef(),n}return C(t,e),t.prototype.getStateElement=function(){return this.element},Object.defineProperty(t.prototype,"element",{get:function(){return this.props.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.props.index},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"row",{get:function(){return this.props.row},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"survey",{get:function(){return this.props.survey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"creator",{get:function(){return this.props.creator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"css",{get:function(){return this.props.css},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.rootRef.current&&this.element.setWrapperElement(this.rootRef.current)},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.element.setWrapperElement(void 0)},t.prototype.shouldComponentUpdate=function(t,n){return!!e.prototype.shouldComponentUpdate.call(this,t,n)&&(t.element!==this.element&&(t.element&&t.element.setWrapperElement(this.rootRef.current),this.element&&this.element.setWrapperElement(void 0)),this.element.cssClasses,!0)},t.prototype.renderElement=function(){var e=this.element,t=this.createElement(e,this.index),n=e.cssClassesValue;return l.createElement("div",{className:n.questionWrapper,style:e.rootStyle,"data-key":e.name+this.index,onFocus:function(){var t=e;t&&t.isQuestion&&t.focusIn()},ref:this.rootRef},t)},t.prototype.createElement=function(e,t){if(!this.row.isNeedRender)return u.Instance.createElement(e.skeletonComponentName,{element:e,css:this.css});var n=e.getTemplate();return u.Instance.isElementRegistered(n)||(n="question"),u.Instance.createElement(n,{element:e,creator:this.creator,survey:this.survey,css:this.css})},t}(d),g=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=function(e){function t(t){var n=e.call(this,t)||this;return n.rootRef=l.createRef(),n.recalculateCss(),n}return g(t,e),t.prototype.recalculateCss=function(){this.row.visibleElements.map((function(e){return e.cssClasses}))},t.prototype.getStateElement=function(){return this.row},Object.defineProperty(t.prototype,"row",{get:function(){return this.props.row},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"survey",{get:function(){return this.props.survey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"creator",{get:function(){return this.props.creator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"css",{get:function(){return this.props.css},enumerable:!1,configurable:!0}),t.prototype.canRender=function(){return!!this.row&&!!this.survey&&!!this.creator},t.prototype.renderElementContent=function(){var e=this,t=this.row.visibleElements.map((function(t,n){return l.createElement(v,{element:t,index:n,row:e.row,survey:e.survey,creator:e.creator,css:e.css,key:t.id})}));return l.createElement("div",{ref:this.rootRef,className:this.row.getRowCss()},t)},t.prototype.renderElement=function(){var e=this.survey,t=this.renderElementContent();return c.wrapRow(e,t,this.row)||t},t.prototype.componentDidMount=function(){var t=this;e.prototype.componentDidMount.call(this);var n=this.rootRef.current;if(this.rootRef.current&&this.row.setRootElement(this.rootRef.current),n&&!this.row.isNeedRender){var r=n;setTimeout((function(){t.row.startLazyRendering(r)}),10)}},t.prototype.shouldComponentUpdate=function(t,n){return!!e.prototype.shouldComponentUpdate.call(this,t,n)&&(t.row!==this.row&&(t.row.isNeedRender=this.row.isNeedRender,t.row.setRootElement(this.rootRef.current),this.row.setRootElement(void 0),this.stopLazyRendering()),this.recalculateCss(),!0)},t.prototype.stopLazyRendering=function(){this.row.stopLazyRendering(),this.row.isNeedRender=!this.row.isLazyRendering()},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.isCurrentStateElement(this.getStateElement())&&(this.row.setRootElement(void 0),this.stopLazyRendering())},t.prototype.createElement=function(e,t){var n=t?"-"+t:0,r=e.getType();return u.Instance.isElementRegistered(r)||(r="question"),u.Instance.createElement(r,{key:e.name+n,element:e,creator:this.creator,survey:this.survey,css:this.css})},t}(d),b=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(e){function t(t){var n=e.call(this,t)||this;return n.rootRef=l.createRef(),n}return b(t,e),t.prototype.getStateElement=function(){return this.panelBase},t.prototype.canUsePropInState=function(t){return"elements"!==t&&e.prototype.canUsePropInState.call(this,t)},Object.defineProperty(t.prototype,"survey",{get:function(){return this.getSurvey()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"creator",{get:function(){return this.props.creator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"css",{get:function(){return this.getCss()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panelBase",{get:function(){return this.getPanelBase()},enumerable:!1,configurable:!0}),t.prototype.getPanelBase=function(){return this.props.element||this.props.question},t.prototype.getSurvey=function(){return this.props.survey||(this.panelBase?this.panelBase.survey:null)},t.prototype.getCss=function(){return this.props.css},t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.doAfterRender()},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this);var t=this.rootRef.current;t&&t.removeAttribute("data-rendered")},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),t.page&&this.survey&&this.survey.activePage&&t.page.id===this.survey.activePage.id||this.doAfterRender()},t.prototype.doAfterRender=function(){var e=this.rootRef.current;e&&this.survey&&(this.panelBase.isPanel?this.panelBase.afterRender(e):this.survey.afterRenderPage(e))},t.prototype.getIsVisible=function(){return this.panelBase.isVisible},t.prototype.canRender=function(){return e.prototype.canRender.call(this)&&!!this.survey&&!!this.panelBase&&!!this.panelBase.survey&&this.getIsVisible()},t.prototype.renderRows=function(e){var t=this;return this.panelBase.visibleRows.map((function(n){return t.createRow(n,e)}))},t.prototype.createRow=function(e,t){return l.createElement(w,{key:e.id,row:e,survey:this.survey,creator:this.creator,css:t})},t}(d),q=i(3),_=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(e){function t(t){var n=e.call(this,t)||this;return n.svgIconRef=l.createRef(),n}return _(t,e),t.prototype.updateSvg=function(){this.props.iconName&&(0,a.createSvg)(this.props.size,this.props.width,this.props.height,this.props.iconName,this.svgIconRef.current,this.props.title)},t.prototype.componentDidUpdate=function(){this.updateSvg()},t.prototype.render=function(){var e="sv-svg-icon";return this.props.className&&(e+=" "+this.props.className),this.props.iconName?l.createElement("svg",{className:e,style:this.props.style,onClick:this.props.onClick,ref:this.svgIconRef,role:"presentation"},l.createElement("use",null)):null},t.prototype.componentDidMount=function(){this.updateSvg()},t}(l.Component);u.Instance.registerElement("sv-svg-icon",(function(e){return l.createElement(O,e)}));var x=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),L=function(e){function t(t){return e.call(this,t)||this}return x(t,e),t.prototype.render=function(){var e="sv-action-bar-separator ".concat(this.props.cssClasses);return l.createElement("div",{className:e})},t}(l.Component);u.Instance.registerElement("sv-action-bar-separator",(function(e){return l.createElement(L,e)}));var S=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=function(e){function t(t){var n=e.call(this,t)||this;return n.ref=l.createRef(),n}return S(t,e),Object.defineProperty(t.prototype,"item",{get:function(){return this.props.item},enumerable:!1,configurable:!0}),t.prototype.getStateElement=function(){return this.item},t.prototype.renderElement=function(){var e=this.item.getActionRootCss(),t=this.item.needSeparator?l.createElement(L,null):null,n=u.Instance.createElement(this.item.component||"sv-action-bar-item",{item:this.item});return l.createElement("div",{className:e,id:this.item.id,ref:this.ref},l.createElement("div",{className:"sv-action__content"},t,n))},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.item.updateModeCallback=void 0},t.prototype.componentDidMount=function(){var t=this;e.prototype.componentDidMount.call(this),this.item.updateModeCallback=function(e,n){queueMicrotask((function(){q.flushSync?q.flushSync((function(){t.item.mode=e})):t.item.mode=e,queueMicrotask((function(){n(e,t.ref.current)}))}))},this.item.afterRender()},t}(d),I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return S(t,e),Object.defineProperty(t.prototype,"item",{get:function(){return this.props.item},enumerable:!1,configurable:!0}),t.prototype.getStateElement=function(){return this.item},t.prototype.renderElement=function(){return l.createElement(l.Fragment,null,this.renderInnerButton())},t.prototype.renderText=function(){if(!this.item.hasTitle)return null;var e=this.item.getActionBarItemTitleCss();return l.createElement("span",{className:e},this.item.title)},t.prototype.renderButtonContent=function(){var e=this.renderText(),t=this.item.iconName?l.createElement(O,{className:this.item.cssClasses.itemIcon,size:this.item.iconSize,iconName:this.item.iconName,title:this.item.tooltip||this.item.title}):null;return l.createElement(l.Fragment,null,t,e)},t.prototype.renderInnerButton=function(){var e=this,t=this.item.getActionBarItemCss(),n=this.item.tooltip||this.item.title,r=this.renderButtonContent(),o=this.item.disableTabStop?-1:void 0;return Ie(l.createElement("button",{className:t,type:"button",disabled:this.item.disabled,onMouseDown:function(t){return e.item.doMouseDown(t)},onFocus:function(t){return e.item.doFocus(t)},onClick:function(t){return e.item.doAction(t)},title:n,tabIndex:o,"aria-checked":this.item.ariaChecked,"aria-expanded":this.item.ariaExpanded,role:this.item.ariaRole},r),this.item,{processEsc:!1})},t}(d);u.Instance.registerElement("sv-action-bar-item",(function(e){return l.createElement(I,e)}));var P=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),R=function(e){function t(t){var n=e.call(this,t)||this;return n.containerRef=l.createRef(),n.createModel(),n}return P(t,e),Object.defineProperty(t.prototype,"model",{get:function(){return this.props.model},enumerable:!1,configurable:!0}),t.prototype.getStateElement=function(){return this.model},t.prototype.createModel=function(){this.popup=(0,a.createPopupViewModel)(this.props.model)},t.prototype.setTargetElement=function(){var e=this.containerRef.current;this.popup.setComponentElement(e)},t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.setTargetElement()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.setTargetElement()},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.popup.resetComponentElement()},t.prototype.shouldComponentUpdate=function(t,n){var r;if(!e.prototype.shouldComponentUpdate.call(this,t,n))return!1;var o=t.model!==this.popup.model;return o&&(null===(r=this.popup)||void 0===r||r.dispose(),this.createModel()),o},t.prototype.render=function(){var e;return this.popup.model=this.model,e=this.model.isModal?l.createElement(N,{model:this.popup}):l.createElement(H,{model:this.popup}),l.createElement("div",{ref:this.containerRef},e)},t}(d);u.Instance.registerElement("sv-popup",(function(e){return l.createElement(R,e)}));var N=function(e){function t(t){var n=e.call(this,t)||this;return n.handleKeydown=function(e){n.model.onKeyDown(e)},n.clickInside=function(e){e.stopPropagation()},n}return P(t,e),Object.defineProperty(t.prototype,"model",{get:function(){return this.props.model},enumerable:!1,configurable:!0}),t.prototype.getStateElement=function(){return this.model},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),!this.model.isPositionSet&&this.model.isVisible&&this.model.updateOnShowing()},t.prototype.renderContainer=function(e){var t=this,n=e.showHeader?this.renderHeaderPopup(e):null,r=e.title?this.renderHeaderContent():null,o=this.renderContent(),i=e.showFooter?this.renderFooter(this.model):null;return l.createElement("div",{className:"sv-popup__container",style:{left:e.left,top:e.top,height:e.height,width:e.width,minWidth:e.minWidth},onClick:function(e){t.clickInside(e)}},n,l.createElement("div",{className:"sv-popup__body-content"},r,l.createElement("div",{className:"sv-popup__scrolling-content"},o),i))},t.prototype.renderHeaderContent=function(){return l.createElement("div",{className:"sv-popup__body-header"},this.model.title)},t.prototype.renderContent=function(){var e=u.Instance.createElement(this.model.contentComponentName,this.model.contentComponentData);return l.createElement("div",{className:"sv-popup__content"},e)},t.prototype.renderHeaderPopup=function(e){return null},t.prototype.renderFooter=function(e){return l.createElement("div",{className:"sv-popup__body-footer"},l.createElement(D,{model:e.footerToolbar}))},t.prototype.render=function(){var e=this,t=this.renderContainer(this.model),n=(new a.CssClassBuilder).append("sv-popup").append(this.model.styleClass).toString(),r={display:this.model.isVisible?"":"none"};return l.createElement("div",{tabIndex:-1,className:n,style:r,onClick:function(t){e.model.clickOutside(t)},onKeyDown:this.handleKeydown},t)},t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.model.isVisible&&this.model.updateOnShowing()},t}(d),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return P(t,e),t.prototype.renderHeaderPopup=function(e){var t=e;return t?l.createElement("span",{style:{left:t.pointerTarget.left,top:t.pointerTarget.top},className:"sv-popup__pointer"}):null},t}(N),j=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(e){function t(t){return e.call(this,t)||this}return j(t,e),t.prototype.renderInnerButton=function(){var t=e.prototype.renderInnerButton.call(this);return l.createElement(l.Fragment,null,t,l.createElement(R,{model:this.item.popupModel}))},t.prototype.componentDidMount=function(){this.viewModel=new a.ActionDropdownViewModel(this.item)},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.viewModel.dispose()},t}(I);u.Instance.registerElement("sv-action-bar-item-dropdown",(function(e){return l.createElement(k,e)}));var B=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(e){function t(t){var n=e.call(this,t)||this;return n.rootRef=l.createRef(),n}return B(t,e),Object.defineProperty(t.prototype,"handleClick",{get:function(){return void 0===this.props.handleClick||this.props.handleClick},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.props.model},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){if(e.prototype.componentDidMount.call(this),this.model.hasActions){var t=this.rootRef.current;t&&this.model.initResponsivityManager(t,(function(e){setTimeout(e,100)}))}},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.model.resetResponsivityManager()},t.prototype.componentDidUpdate=function(t,n){if(e.prototype.componentDidUpdate.call(this,t,n),t.model!=this.props.model&&t.model.resetResponsivityManager(),this.model.hasActions){var r=this.rootRef.current;r&&this.model.initResponsivityManager(r,(function(e){setTimeout(e,100)}))}},t.prototype.getStateElement=function(){return this.model},t.prototype.renderElement=function(){if(!this.model.hasActions)return null;var e=this.renderItems();return l.createElement("div",{ref:this.rootRef,className:this.model.getRootCss(),onClick:this.handleClick?function(e){e.stopPropagation()}:void 0},e)},t.prototype.renderItems=function(){return this.model.renderedActions.concat([]).map((function(e,t){return l.createElement(M,{item:e,key:e.renderedId})}))},t}(d);u.Instance.registerElement("sv-action-bar",(function(e){return l.createElement(D,e)}));var T=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),V=function(e){function t(t){return e.call(this,t)||this}return T(t,e),Object.defineProperty(t.prototype,"cssClasses",{get:function(){return this.props.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.props.element},enumerable:!1,configurable:!0}),t.prototype.render=function(){if(this.element.isTitleRenderedAsString)return d.renderLocString(this.element.locTitle);var e=this.renderTitleSpans(this.element.getTitleOwner(),this.cssClasses);return l.createElement(l.Fragment,null,e)},t.prototype.renderTitleSpans=function(e,t){var n=function(e){return l.createElement("span",{"data-key":e,key:e}," ")},r=[];e.isRequireTextOnStart&&(r.push(this.renderRequireText(e)),r.push(n("req-sp")));var o=e.no;return o&&(r.push(l.createElement("span",{"data-key":"q_num",key:"q_num",className:e.cssTitleNumber,style:{position:"static"},"aria-hidden":!0},o)),r.push(n("num-sp"))),e.isRequireTextBeforeTitle&&(r.push(this.renderRequireText(e)),r.push(n("req-sp"))),r.push(d.renderLocString(e.locTitle,null,"q_title")),e.isRequireTextAfterTitle&&(r.push(n("req-sp")),r.push(this.renderRequireText(e))),r},t.prototype.renderRequireText=function(e){return l.createElement("span",{"data-key":"req-text",key:"req-text",className:e.cssRequiredMark,"aria-hidden":!0},e.requiredMark)},t}(l.Component),Z=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),Object.defineProperty(t.prototype,"cssClasses",{get:function(){return this.props.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.props.element},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=l.createElement(V,{element:this.element,cssClasses:this.cssClasses});return this.element.hasTitleActions?l.createElement("div",{className:"sv-title-actions"},l.createElement("span",{className:"sv-title-actions__title"},e),l.createElement(D,{model:this.element.getTitleToolbar()})):e},t}(l.Component);a.RendererFactory.Instance.registerRenderer("element","title-actions","sv-title-actions"),u.Instance.registerElement("sv-title-actions",(function(e){return l.createElement(A,e)}));var W=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),U=function(e){function t(t){return e.call(this,t)||this}return W(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this.props.element},enumerable:!1,configurable:!0}),t.prototype.renderTitleExpandableSvg=function(){if(!this.element.getCssTitleExpandableSvg())return null;var e=this.element.isExpanded?"icon-collapse-16x16":"icon-expand-16x16";return l.createElement(O,{className:this.element.getCssTitleExpandableSvg(),iconName:e,size:"auto"})},t.prototype.render=function(){var e=this.element;if(!e||!e.hasTitle)return null;var t=e.titleAriaLabel||void 0,n=this.renderTitleExpandableSvg(),r=l.createElement(A,{element:e,cssClasses:e.cssClasses}),o=void 0;e.hasTitleEvents&&(o=function(e){(0,a.doKey2ClickUp)(e.nativeEvent)});var i=e.titleTagName;return l.createElement(i,{className:e.cssTitle,id:e.ariaTitleId,"aria-label":t,tabIndex:e.titleTabIndex,"aria-expanded":e.titleAriaExpanded,role:e.titleAriaRole,onClick:void 0,onKeyUp:o},n,r)},t}(l.Component),F=function(){function e(){this.creatorHash={}}return e.prototype.registerQuestion=function(e,t){this.creatorHash[e]=t},e.prototype.getAllTypes=function(){var e=new Array;for(var t in this.creatorHash)e.push(t);return e.sort()},e.prototype.createQuestion=function(e,t){var n=this.creatorHash[e];return null==n?null:n(t)},e.Instance=new e,e}(),Q=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Q(t,e),t.prototype.getStateElement=function(){return this.props.counter},t.prototype.renderElement=function(){return l.createElement("div",{className:this.props.remainingCharacterCounter},this.props.counter.remainingCharacterCounter)},t}(d);u.Instance.registerElement("sv-character-counter",(function(e){return l.createElement(z,e)}));var K=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),J=function(e){function t(t){var n=e.call(this,t)||this;return n.initialValue=n.viewModel.getTextValue()||"",n.textareaRef=l.createRef(),n}return K(t,e),Object.defineProperty(t.prototype,"viewModel",{get:function(){return this.props.viewModel},enumerable:!1,configurable:!0}),t.prototype.canRender=function(){return!!this.viewModel.question},t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this);var t=this.textareaRef.current;t&&this.viewModel.setElement(t)},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.viewModel.resetElement()},t.prototype.renderElement=function(){var e=this;return l.createElement("textarea",{id:this.viewModel.id,className:this.viewModel.className,ref:this.textareaRef,disabled:this.viewModel.isDisabledAttr,readOnly:this.viewModel.isReadOnlyAttr,rows:this.viewModel.rows,cols:this.viewModel.cols,placeholder:this.viewModel.placeholder,maxLength:this.viewModel.maxLength,defaultValue:this.initialValue,onChange:function(t){e.viewModel.onTextAreaInput(t)},onFocus:function(t){e.viewModel.onTextAreaFocus(t)},onBlur:function(t){e.viewModel.onTextAreaBlur(t)},onKeyDown:function(t){e.viewModel.onTextAreaKeyDown(t)},"aria-required":this.viewModel.ariaRequired,"aria-label":this.viewModel.ariaLabel,"aria-labelledby":this.viewModel.ariaLabelledBy,"aria-describedby":this.viewModel.ariaDescribedBy,"aria-invalid":this.viewModel.ariaInvalid,"aria-errormessage":this.viewModel.ariaErrormessage,style:{resize:this.viewModel.question.resizeStyle}})},t}(d);u.Instance.registerElement("sv-text-area",(function(e){return l.createElement(J,e)}));var G=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),X=function(e){function t(t){return e.call(this,t)||this}return G(t,e),t.prototype.renderCharacterCounter=function(){var e=null;return this.question.getMaxLength()&&(e=l.createElement(z,{counter:this.question.characterCounter,remainingCharacterCounter:this.question.cssClasses.remainingCharacterCounter})),e},t.prototype.renderElement=function(){if(this.question.isReadOnlyRenderDiv())return l.createElement("div",null,this.question.value);var e=this.renderCharacterCounter(),t=this.props.question.textAreaModel;return l.createElement(l.Fragment,null,l.createElement(J,{viewModel:t}),e)},t}(y),Y=function(e){function t(t){var n=e.call(this,t)||this;return n.textAreaModel=n.getTextAreaModel(),n}return G(t,e),t.prototype.canRender=function(){return!!this.props.question},t.prototype.getTextAreaModel=function(){return this.props.question.commentTextAreaModel},t.prototype.renderElement=function(){if(this.props.question.isReadOnlyRenderDiv()){var e=this.textAreaModel.getTextValue()||"";return l.createElement("div",null,e)}return l.createElement(J,{viewModel:this.textAreaModel})},t}(m),$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.getTextAreaModel=function(){return this.props.question.otherTextAreaModel},t}(Y);F.Instance.registerQuestion("comment",(function(e){return l.createElement(X,e)}));var ee=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),te=function(e){function t(t){var n=e.call(this,t)||this;return n.widgetRef=l.createRef(),n}return ee(t,e),t.prototype._afterRender=function(){if(this.questionBase.customWidget){var e=this.widgetRef.current;e&&(this.questionBase.customWidget.afterRender(this.questionBase,e),this.questionBase.customWidgetData.isNeedRender=!1)}},t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.questionBase&&this._afterRender()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n);var r=!!this.questionBase.customWidget&&this.questionBase.customWidget.isDefaultRender;this.questionBase&&!r&&this._afterRender()},t.prototype.componentWillUnmount=function(){if(e.prototype.componentWillUnmount.call(this),this.questionBase.customWidget){var t=this.widgetRef.current;t&&this.questionBase.customWidget.willUnmount(this.questionBase,t)}},t.prototype.canRender=function(){return e.prototype.canRender.call(this)&&this.questionBase.visible},t.prototype.renderElement=function(){var e=this.questionBase.customWidget;if(e.isDefaultRender)return l.createElement("div",{ref:this.widgetRef},this.creator.createQuestionElement(this.questionBase));var t=null;if(e.widgetJson.render)t=e.widgetJson.render(this.questionBase);else if(e.htmlTemplate){var n={__html:e.htmlTemplate};return l.createElement("div",{ref:this.widgetRef,dangerouslySetInnerHTML:n})}return l.createElement("div",{ref:this.widgetRef},t)},t}(f),ne=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),re=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ne(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this.props.element},enumerable:!1,configurable:!0}),t.prototype.getRenderedElements=function(){return[this.element]},t.prototype.renderElement=function(){var e=this.element,t=e.hasTitle?l.createElement(U,{element:e}):null,n=e.hasDescriptionUnderTitle?d.renderQuestionDescription(this.element):null,r=e.hasAdditionalTitleToolbar?l.createElement(D,{model:e.additionalTitleToolbar}):null,o={width:void 0};return e instanceof a.Question&&(o.width=e.titleWidth),l.createElement("div",{className:e.cssHeader,onClick:function(t){return e.clickTitleFunction&&e.clickTitleFunction(t.nativeEvent)},style:o},t,n,r)},t}(d),oe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ie=function(e){function t(t){var n=e.call(this,t)||this;return n.isNeedFocus=!1,n.rootRef=l.createRef(),n}return oe(t,e),t.renderQuestionBody=function(e,t){return t.customWidget?l.createElement(te,{creator:e,question:t}):e.createQuestionElement(t)},t.prototype.getStateElement=function(){return this.question},Object.defineProperty(t.prototype,"question",{get:function(){return this.props.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"creator",{get:function(){return this.props.creator},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this),this.question&&(this.question.react=this),this.doAfterRender()},t.prototype.componentWillUnmount=function(){e.prototype.componentWillUnmount.call(this),this.question&&(this.question.react=null);var t=this.rootRef.current;t&&t.removeAttribute("data-rendered")},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.doAfterRender()},t.prototype.doAfterRender=function(){if(this.isNeedFocus&&(this.question.isCollapsed||this.question.clickTitleFunction(),this.isNeedFocus=!1),this.question){var e=this.rootRef.current;e&&"r"!==e.getAttribute("data-rendered")&&(e.setAttribute("data-rendered","r"),this.question.afterRender&&this.question.afterRender(e))}},t.prototype.canRender=function(){return e.prototype.canRender.call(this)&&!!this.question&&!!this.creator},t.prototype.renderQuestionContent=function(){var e=this.question,t={display:this.question.renderedIsExpanded?"":"none"},n=e.cssClasses,r=this.renderQuestion(),o=e&&e.hasComment?this.renderComment(n):null,i=e.hasDescriptionUnderInput?this.renderDescription():null;return l.createElement("div",{className:e.cssContent||void 0,style:t,role:"presentation"},r,o,i)},t.prototype.renderElement=function(){var e=this.question,t=e.cssClasses,n=this.renderHeader(e),r=e.hasTitleOnLeftTop?n:null,o=e.hasTitleOnBottom?n:null,i=this.question.showErrorsAboveQuestion?this.renderErrors(t,""):null,s=this.question.showErrorsBelowQuestion?this.renderErrors(t,""):null,a=e.getRootStyle(),u=this.wrapQuestionContent(this.renderQuestionContent());return l.createElement(l.Fragment,null,l.createElement("div",{ref:this.rootRef,id:e.id,className:e.getRootCss(),style:a,role:e.ariaRole,"aria-required":this.question.ariaRequired,"aria-invalid":this.question.ariaInvalid,"aria-label":this.question.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy,"aria-expanded":e.ariaExpanded,"data-name":e.name},i,r,u,o,s))},t.prototype.wrapElement=function(e){var t=this.question.survey,n=null;return t&&(n=c.wrapElement(t,e,this.question)),null!=n?n:e},t.prototype.wrapQuestionContent=function(e){var t=this.question.survey,n=null;return t&&(n=c.wrapQuestionContent(t,e,this.question)),null!=n?n:e},t.prototype.renderQuestion=f