",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t\n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.81",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n"+e+"";var p=this.textEl.getElementsByTagName("p");p[p.length-1].offsetWidth,p[p.length-1].classList.add("show"),this.scrollTo()}this.parsedResponse=e,this.addSelf(),this.textEl.removeAttribute("value-added"),setTimeout(function(){t.textEl.setAttribute("value-added",""),t.el.classList.add("peak-thumb")},0),this.checkForEditMode(),this.response=e.split("&&").join(" ")}},n.prototype.scrollTo=function(){var t=this.el.offsetTop,e=this.el.offsetHeight;!this.container&&this.el&&(this.container=this.el),this.container.scrollTop=t+e+this.container.scrollTop},n.prototype.checkForEditMode=function(){this.isRobotResponse||this.el.hasAttribute("thinking")||(this.el.classList.add("can-edit"),this.disabled=!1)},n.prototype.tryClearThinking=function(){this.el.hasAttribute("thinking")&&(this.textEl.innerHTML="",this.el.removeAttribute("thinking"))},n.prototype.setToThinking=function(){(this.isRobotResponse&&0!==this.uiOptions.robot.robotResponseTime||!this.isRobotResponse&&this.cfReference.uiOptions.user.showThinking&&!this._tag.skipUserInput)&&(this.textEl.innerHTML=n.THINKING_MARKUP,this.el.classList.remove("can-edit"),this.el.setAttribute("thinking","")),(this.cfReference.uiOptions.user.showThinking||this.cfReference.uiOptions.user.showThumb)&&this.addSelf()},n.prototype.addSelf=function(){this.el.parentNode!=this.container&&this.container.appendChild(this.el)},n.prototype.onClick=function(e){this.setToThinking(),t.ConversationalForm.illustrateFlow(this,"dispatch",t.ChatResponseEvents.USER_ANSWER_CLICKED,e),this.eventTarget.dispatchEvent(new CustomEvent(t.ChatResponseEvents.USER_ANSWER_CLICKED,{detail:this._tag}))},n.prototype.setData=function(t){this.image=t.image,this.response=this.originalResponse=t.response,this.isRobotResponse=t.isRobotResponse,e.prototype.setData.call(this,t)},n.prototype.onElementCreated=function(){var t=this;this.textEl=this.el.getElementsByTagName("text")[0],this.updateThumbnail(this.image),this.isRobotResponse||null!=this.response?setTimeout(function(){t.setValue({text:t.response})},0):this.cfReference.uiOptions.user.showThumb&&this.el.classList.add("peak-thumb")},n.prototype.dealloc=function(){clearTimeout(this.readyTimer),this.container=null,this.uiOptions=null,this.onReadyCallback=null,this.onClickCallback&&(this.el.removeEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1),this.onClickCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return'\n\t\t\t\t\n\t\t\t\t\n\t\t\t'},n.THINKING_MARKUP="
...
",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t\n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.83",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n
-
+
diff --git a/docs/0.9.80/getting-started/index.html b/docs/0.9.80/getting-started/index.html
index 6644cd8a5..7969f9a26 100644
--- a/docs/0.9.80/getting-started/index.html
+++ b/docs/0.9.80/getting-started/index.html
@@ -134,7 +134,7 @@
Getting Started
Turning web forms into conversations. Conversational Form is an open-source concept by SPACE10 to easily turn any form element on a web page into a conversational form interface. It features conversational replacement of all input elements, reusable variables from previous questions and complete customization and control over the styling.
Turning web forms into conversations. Conversational Form is an open-source concept by SPACE10 to easily turn any form element on a web page into a conversational form interface. It features conversational replacement of all input elements, reusable variables from previous questions and complete customization and control over the styling.