function getArgs(n){var t=/\(([^)]*)/.exec(n.toString())[1];return t.split(",")}function WireUpFilterableList(n){n.Filters=ko.observable({});n.Filters.subscribe(function(){var t=n;$(t()).each(function(t,i){var a=n,c=!0,f=a.Filters(),r,o,e,s,l,h,u;for(r in f)if(f.hasOwnProperty(r)){if(o=f[r].value.toLowerCase().split(";"),e="",f[r].calculatedtext&&f[r].calculatedtext!==null){for(s=getArgs(f[r].calculatedtext),l=[],h=0;h<s.length;h++)l.push(i[s[h]]);i[s[0]]&&(e=f[r].calculatedtext.apply(null,l)||"")}else{if(o=$.grep(o,function(n){return n.trim()!==""}),o.length===0)continue;u=Object.byString(i,r)||function(){return""};switch(f[r].format){case"DateTime":e=$.FormatString(u()||"","DateTime");break;case"html":e=$(u()||"").text();break;case"YesNoBlank":e=u()===undefined||u()===null?"":u()?"Yes":"No";break;case"string":default:e=u()==="0"||u()===0?"0":u()||""}}if(!o.some(function(n){return String(e).toLowerCase().indexOf(n.trim())>=0})){c=!1;break}continue}i.Visible(c);!c&&i.Checked&&i.Checked(!1)})})}function WireUpGlobalFilterList(n,t){n.Filter=ko.observable();n.FilterFields=t;n.Filter.subscribe(function(t){var r=n,i=t.toLowerCase().split(";");i=$.grep(i,function(n){return n.trim()!==""});$(r()).each(function(n,t){var u=i.length===0,f=r.FilterFields;f.forEach(function(n){var f="",r;if(i.length===0)return 0;r=Object.byString(t,typeof n=="string"?n:n.value)||function(){return""};switch(n.format){case"DateTime":f=$.FormatString(r()||"","DateTime");break;case"html":f=$(r()||"").text();break;case"YesNoBlank":f=r()===undefined||r()===null?"":r()?"Yes":"No";break;case"string":default:f=r()==="0"||r()===0?"0":r()||""}if(i.some(function(n){return String(f).toLowerCase().indexOf(n.trim())>=0}))return u=!0,0});t.Visible(u);!u&&t.Checked&&t.Checked(!1)})})}function wrapElementInInputGroupWithAddOn(n,t,i){if($(n).addClass("form-control"),i)$(t).insertBefore(n).click(function(){$(this).next().focus()}),$($(n).prev().andSelf()).wrapAll('<div class="input-group"><\/div>');else{$(t).insertAfter(n).on("click",function(){$(this).prev().focus()});$($(n).next().andSelf()).wrapAll('<div class="input-group"><\/div>')}}function validateNumbersArray(n){for(var t=1;t<n.length;t++)if(n[t-1]!=undefined&&n[t]!=undefined&&Number(n[t-1])>Number(n[t]))return!1;return!0}function extractNumbersArray(n){var t=[];return $.each(n,function(n,i){$.ocfValidate.isNumericInput($(i).val().replace(/,/g,""))&&t.push($(i).val().replace(/,/g,""))}),t}function showSidebar(n,t,i){(i===null||i===undefined)&&(i="helpTextAccordion");$("aside").show(200,function(){$("#"+t).collapse("show");$("#"+i).off("shown.bs.collapse");$("#"+i).on("shown.bs.collapse",function(){$("#"+t).closest(".card")[0].scrollIntoView(!0)});$("a[data-target='#"+t+"']").focus()});var r=n.currentTarget;$("aside").data("focusedFrom",r);n.stopPropagation()}function closeSidebar(){$("aside").hide(200);var n=$("aside").data("focusedFrom");n.focus()}function activeOptions(n,t){return n.filter(function(n){return Array.isArray(t)?n.IsActive||t.indexOf(n.Key)>=0:n.IsActive||t===n.Key})}function setPageTitle(n){window.document.title=n+" - Fair Entitlements Guarantee"}var WireUpPerformAction,WireUpSammyDirtyCheck,Sorter,KoSmartSearch,scriptletHandlers,TableColumnDefintion;ko.bindingHandlers.chosen={init:function(n,t,i){var r=$(n),u=ko.unwrap(t());typeof u=="object"?r.chosen(u):r.chosen();["options","selectedOptions","value"].forEach(function(n){if(i.has(n)){var t=i.get(n);ko.isObservable(t)&&t.subscribe(function(){r.trigger("chosen:updated")})}})}};WireUpPerformAction=function(n){var t,i,r;n.ConfirmationDialog=ko.observable(!1);n.ConfirmationMessage=ko.observable("");n.ConfirmationReason=ko.observable("");n.Title=ko.observable("");n.ConfirmationButtonLabel=ko.observable("");n.ConfirmationReason=ko.observable("");n.CancelButtonLabel=ko.observable("");n.RequireConfirmationReason=ko.observable(!1);n.EnableConfirmationButton=ko.computed(function(){return!n.RequireConfirmationReason()||n.ConfirmationReason()},n);n.ConfirmationDialog.subscribe(function(){n.ConfirmationReason("")});t=function(){};i=function(){};n.ShowConfirmationDialog=function(r,u,f,e,o,s,h){n.RequireConfirmationReason(!!f);t=u;i=e||function(){n.ConfirmationDialog(!1)};n.ConfirmationMessage(r);n.ConfirmationDialog(!0);n.FeedbackMessages([]);n.Title(o||"Confirm Action");n.ConfirmationButtonLabel(s||"Confirm");n.CancelButtonLabel(h||"Cancel")};n.ConfirmAction=function(){n.RequireConfirmationReason()?t(n.ConfirmationReason()):t();n.ConfirmationDialog(!1)};n.CancelAction=function(){i();n.ConfirmationDialog(!1)};n.Processing=ko.observable(!1);n.FeedbackMessages=ko.observable({});n.RegisteredValidationMessages=[];n.PerformQuery=function(t,i,r,u,f){return window.system==="OcfOnline"&&window.ExtendOnlineSessionTime(),f=typeof f!="undefined"?f:!0,n.Processing(!0),f&&ShowHideLoadingSpinner(!0),$.get(t,i).done(r||function(){}).fail(u||n.GenericFailFunction).always(function(){n.Processing(!1);f&&ShowHideLoadingSpinner(!1)})};r=function(n,t){var f={},r,i,u;if(n.responseJSON&&n.responseJSON.feedback){r=[];for(i in n.responseJSON.feedback)u=i,u==="summary"?r.unshift(n.responseJSON.feedback[i].join("<br />")):t&&t.indexOf(u)>=0?f[u]=ko.observable(n.responseJSON.feedback[i].join("<br />")):r.push(n.responseJSON.feedback[i].join("<br />"));f.summary=ko.observable(r.join("<br />"))}return f};n.GenericFailFunction=function(t){if(t.status===HttpStatusCodes.Forbidden){window.location=currentDomain+"error/notauthorized";return}if(window.system==="OcfOnline"&&t.status===HttpStatusCodes.Unauthorized&&t.responseJSON&&t.responseJSON.feedback&&t.responseJSON.feedback.HttpAntiForgeryException){window.location=currentDomain+"error/sessionexpired";return}if(t.status===HttpStatusCodes.NotFound){window.location=currentDomain+"error/notfound";return}var i=r(t,n.RegisteredValidationMessages);n.FeedbackMessages(i);n.RegisteredValidationMessages.indexOf("summary")===-1?Toast("error","An error occurred"):t.responseJSON&&t.responseJSON.feedback&&t.responseJSON.feedback[""]?Toast("error","An error occurred. "+t.responseJSON.feedback[""]):t.responseJSON&&t.responseJSON.feedback&&i.summary()&&Toast("error","An error occurred. ")};n.PerformAction=function(t,i,r,u){window.system==="OcfOnline"&&window.ExtendOnlineSessionTime();n.Processing(!0);ShowHideLoadingSpinner(!0);n.FeedbackMessages({});$.extend(i,{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()});$.post(n.BaseUrl+t,i).done(r||function(){}).fail(u||n.GenericFailFunction).always(function(){n.Processing(!1);ShowHideLoadingSpinner(!1)})}};WireUpSammyDirtyCheck=function(n,t,i){var r=t[i];r||alert("Invalid child view model");r.subscribe(function(n){n&&(n.Original=ko.observable(),n.IsDirty||(n.IsDirty=ko.pureComputed(function(){return n.Original()&&n.Original()!==ko.mapping.toJSON(n)})),n.ResetDirty=function(){setTimeout(function(){n.Original(ko.mapping.toJSON(n))},1)})});n.CurrentHash=null;n.currentView=null;n.currentId=null;n.before(".*",function(i){var o,u,f,e;if(n.CurrentHash===null&&(n.CurrentHash=i.app.getLocation()),i.app.getLocation().indexOf("#")>-1&&(n.CurrentHash=i.app.getLocation(),o=/#\/(\w*)\/(\d*)/,u=n.CurrentHash.match(o),u)){if(f=u[1].toLowerCase(),e=u[2],f===n.currentView&&e===n.currentId)return!0;n.currentView=f;n.currentId=e}if(r()&&r().IsDirty())t.ShowConfirmationDialog("<p>You have unsaved changes.<\/p><p>Click discard changes to lose your changes and continue<\/p>",function(){r(null);n.CurrentHash=i.app.getLocation();i.app.setLocation(n.CurrentHash)},null,function(){i.app.setLocation(n.CurrentHash)},"Unsaved Changes","Discard Changes","Cancel");else return r(null),n.CurrentHash=i.app.getLocation(),!0;return!1});$(window).bind("beforeunload",function(){if(r&&r()&&r().IsDirty())return""})};Object.byString=function(n,t){var r,i,f,u;for(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),r=t.split("."),i=0,f=r.length;i<f;++i)if(u=r[i],u in n)n=n[u];else return;return n};Sorter={Sort:function(n,t){var i=function(i,r){var o=n.SortCol(),e=n.SortAsc()?1:-1,u=i[o](),f=r[o]();return(t&&(u=new Date(u.match(/-?\d+/)[0]*1),f=new Date(f.match(/-?\d+/)[0]*1)),u==f)?0:u==null&&f!=null?-e:u<f?-e:e};n.sort(i)},ShowOrder:function(n,t){var i=n.SortCol();return t===i?n.SortAsc()?"fas fa-lg fa-sort-up sorter-icon float-right":"fas fa-lg fa-sort-down sorter-icon float-right":"fas fa-lg fa-sort sorter-icon float-right"},DoOrder:function(n,t,i){var r=n.SortCol(),u=n.SortAsc();t===r?n.SortAsc(!u):(n.SortCol(t),n.SortAsc(!0));Sorter.Sort(n,i)},Initialize:function(n,t,i){(i===undefined||i===null)&&(i=!0);n.SortCol=ko.observable(t);n.SortAsc=ko.observable(!!i)}};ko.bindingHandlers.validationMessageFor={init:function(n,t,i,r){Array.isArray(r.RegisteredValidationMessages)&&r.RegisteredValidationMessages.push(t())}};ko.bindingHandlers.modal={init:function(n,t,i){$(n).modal({show:!1,backdrop:"static",keyboard:!1});var u=t(),f=i(),r=f.onshown||null;if(ko.isObservable(u)){$(n).on("hide.bs.modal",function(){u(!1)});$(n).on("shown.bs.modal",function(){r&&typeof r=="function"&&r.call()})}ko.utils.domNodeDisposal.addDisposeCallback(n,function(n){$(n).modal("hide")})},update:function(n,t){var i=t();ko.utils.unwrapObservable(i)?($(n).appendTo("body").modal("show"),$(".modal-body",n).scrollTop(0),setTimeout(function(){var t=$(n).find("select, input, textarea, button, a, iframe").filter(":visible").not(".cke_button, .cke_combo_button"),i,r;if(t.length!==0){i=t.first();r=t.last();try{t[1].focus();r.on("keydown",function(n){n.which!==9||n.shiftKey||(n.preventDefault(),i.focus())});i.on("keydown",function(n){n.which===9&&n.shiftKey&&(n.preventDefault(),r.focus())})}catch(u){}}},200)):$(n).modal("hide")}};$.fn.modal.Constructor.prototype._enforceFocus=function(){var n=$(this._element);$(document).on("focusin.modal",function(t){n[0]===t.target||n.has(t.target).length||$(t.target).parentsUntil('*[role="dialog"]').length!==0||n.focus()})};ko.components.register("switch-slider",{viewModel:function(n){this.IsActive=n.value;this.handleKeyUp=function(n,t){t.keyCode===32||t.keyCode===13?n.IsActive(!n.IsActive()):t.keyCode===37?n.IsActive(!1):t.keyCode===39&&n.IsActive(!0)}},template:'<label class="switch" tabindex="0" data-bind="event: { keyup: handleKeyUp }">            <input type="checkbox" data-bind="checked: IsActive" >            <span class="slider round"><\/span>        <\/label>'});ko.bindingHandlers.RichTextBox={init:function(n,t,i){var o=t(),f=i().EditorOptions||{},u=!1,r,e;$.extend(f,{customConfig:"",removePlugins:"resize,language,elementspath,sourcearea,save,newpage,print,selectall,bidi,about,div,flash,forms,iframe,image,imagepaste,imageuploader,pagebreak,preview,scayt,showblocks,smiley,specialchar,templates,wsc,uploadimage,uploadfile",toolbar:[{name:"basicstyles",items:["Bold","Italic","Underline"]},{name:"paragraph",items:["NumberedList","BulletedList","Outdent","Indent","JustifyLeft","JustifyRight","JustifyCenter","JustifyBlock"]},{name:"insert",items:["Table","base64image"]},{name:"styles",items:["Font","FontSize"]},{name:"max",items:["Maximize"]},{name:"color",items:["TextColor","BGColor"]},],allowedContent:!0});r=$(n).ckeditor(f);r.editor.on("instanceReady",function(){r.editor.on("doubleclick",function(n){var t=CKEDITOR.plugins.link.getSelectedLink(r.editor)||n.data.element;if(!t.isReadOnly())if(t.is("a")){if(t.$.href&&t.$.protocol.indexOf("http")==0){window.open(t.$.href,"_blank");n.preventDefault();return}n.data.dialog=t.getAttribute("name")&&(!t.getAttribute("href")||!t.getChildCount())?"anchor":"link";n.data.link=t}else CKEDITOR.plugins.link.tryRestoreFakeAnchor(r.editor,t)&&(n.data.dialog="anchor")},null,null,0);setTimeout(function(){r.editor.setData(t()());r.editor.on("change",function(){var n=t();u=!0;n(r.editor.getData());u=!1})},10)});if(i().ckBlurFn)r.editor.on("blur",i().ckBlurFn);e=o.subscribe(function(n){!u&&r&&r.editor.setData(n)});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){r.editor.destroy();e.dispose()})}};ko.bindingHandlers.datetimepicker={init:function(n,t,i){var r={format:"DD/MM/YYYY",showClear:!0,minDate:"01/01/1900",maxDate:"01/01/2100"},u=i().dtpOptions,f;u!=null&&(u.FormatType==="Date"&&(r.showTodayButton=!0,r.extraFormats=["DD/MM/YY"],$(n).find("span.icon-place-holder").addClass("far fa-calendar")),u.FormatType==="Time"&&(r.format="HH:mm",r.extraFormats=["hh:mm a","hh:mm A"],$(n).find("span.icon-place-holder").addClass("far fa-clock")),u.FormatType==="DateTime"&&(r.showTodayButton=!0,r.format="DD/MM/YYYY HH:mm",r.extraFormats=["DD/MM/YY  HH:mm"],$(n).find("span.icon-place-holder").addClass("far fa-calendar")));f=t;$(n).datetimepicker(r);$(n).datetimepicker().on("dp.change",function(n){if(n.date){var t="";u!=null&&u.FormatType==="Date"&&(t=$.FormatString("/Date("+(n.date.unix()*1e3+n.date.milliseconds())+")/","CanonicalDateTime"));u!=null&&u.FormatType==="Time"&&(t=n.date.format("HH:mm"));f()(t)}else f()(null)});$(n).datetimepicker().on("dp.show",function(){$(this).closest(".table-responsive").removeClass("table-responsive").addClass("temp")}).on("dp.hide",function(){$(this).closest(".temp").addClass("table-responsive").removeClass("temp")})},update:function(n,t,i){var e=t();if(e()){var r=e(),u=null,f=i().dtpOptions;f!=null&&(f.FormatType==="Date"&&(typeof r=="string"&&r.indexOf("/Date(")===0?u=new Date(r.match(/-?\d+/)[0]*1):r!==null&&(u=moment(r,"YYYY-MM-DD").toDate())),f.FormatType==="Time"&&(typeof r=="string"?u=r:r!=null&&(u=r.Hours()+":"+r.Minutes())));$(n).data("DateTimePicker").date(null);$(n).data("DateTimePicker").date(u)}else $(n).data("DateTimePicker").date(null)}};ko.bindingHandlers.numeric={init:function(n,t,i,r){var f;$(n).attr("type","hidden");var h=i().attr.name,u=$('<input type="text" autocomplete="off" class="form-control" id='+h+">"),e=ko.unwrap(i().attributes)||{},o={vMin:"-999999999999",vMax:"999999999999",mDec:"0"},s=t;$(n).change(function(){$(this).val()===""?s()(null):s()()!==$(this).val()&&s()(+$(this).val())});$(u).insertAfter($(n));f="Please enter a number";r.InPrintMode&&r.InPrintMode()&&(f="");e.Currency&&(o.mDec=2);e.DecimalField?o.mDec=2:$(u).attr("placeholder",f);$(u).addClass("form-control numeric-textbox");$(u).autoNumeric("init",o);$(n).data("txt-widget",u);$(u).on("blur",function(){$.ocfValidate.handleFieldValidation(u,"parsley-error",$.ocfValidate.parseNumericValue($(u).val(),e),f,n)})},update:function(n,t){var i=ko.utils.unwrapObservable(t());$(n).val(i);$(n).data("txt-widget")&&($($(n).data("txt-widget")).val(i),$($(n).data("txt-widget")).trigger("blur"))}};ko.bindingHandlers.numericRange={init:function(n,t,i){var f;$(n).attr("type","hidden");f=t();$(n).change(function(){f($(this).val())});var r=i().attr.name,e=i().attributes||{},o={vMin:"-999999999999",vMax:"999999999999",mDec:"0"},a=$('<span class="sr-only"><label for="'+r+'_from">Select '+r+" From Value<\/label><\/span>"),s=$('<span class="input-group-addon"><i class="fas fa-dollar-sign"><\/i><\/span>'),h=$('<input type="text" autocomplete="off" class="form-control nr" data-number-range="from" id="'+r+'_from">'),v=$('<span class="input-group-append input-group-text">to<\/span>'),y=$(' <span class="sr-only"><label for="'+r+'_to">Select '+r+" To Value<\/label><\/span>"),c=$('<input type="text" autocomplete="off" class="form-control nr" data-number-range="to" id="'+r+'_to">'),l=$("<span><\/span>"),u="";e.Currency?o.mDec=2:(s='<span class="sr-only"><\/span>',u="Please enter a number");$(l).insertAfter($(c).insertAfter($(y).insertAfter($(v).insertAfter($(h).insertAfter($(s).insertAfter($(a).insertAfter(n)))))));$(".nr").attr("placeholder",u);$(".nr").addClass("form-control numeric-textbox");$(".nr").autoNumeric("init",o);$(n).nextUntil(l).wrapAll('<div class="input-group"><\/div>');$(n).data("nr-widget-from",h);$(n).data("nr-widget-to",c);$(".nr",$(n).parent()).on("blur",function(){$.ocfValidate.handleNumericRangeFieldValidation(this,"parsley-error",e,u,n)})},update:function(n,t){var r=ko.utils.unwrapObservable(t()),i;!r||r.indexOf("~")<0||(i=r.split("~"),i.length<2)||($(n).data("nr-widget-from")&&i[0]&&($($(n).data("nr-widget-from")).val(i[0]),$($(n).data("nr-widget-from")).trigger("blur")),$(n).data("nr-widget-to")&&i[1]&&($($(n).data("nr-widget-to")).val(i[1]),$($(n).data("nr-widget-to")).trigger("blur")))}};KoSmartSearch=function(n,t){var i=ko.observable(""),u,r;return i.SearchResults=ko.observable(),u=function(n){i.inFlightRequest(null);i.SearchResults(ko.mapping.fromJS(n))},r=function(){i.inFlightRequest()!=null&&(i.inFlightRequest().abort(),i.inFlightRequest(null))},i.performSearch=function(){if(r(i),(i()||"")===""){i.SearchResults(null);return}var f=$.extend({},t,{LoadRecords:i.fetchRecords,SearchString:i(),_:$.now()}),e=$.get(n,f).done(u);i.inFlightRequest(e)},i.searchTimeout=null,i.inFlightRequest=ko.observable(null),i.fetchRecords=5,i.subscribe(function(n){r(i);i.fetchRecords=5;clearTimeout(i.searchTimeout);i.searchTimeout=setTimeout(function(){i.performSearch(i,n)},250)}),i.LoadMore=function(){i.inFlightRequest()||(i.fetchRecords*=2,i.performSearch())},i};ko.bindingHandlers.dropzone={init:function(n,t){t=t()||{};var i=t.removeOnComplete,r=function(){this.on("error",function(n,t){Toast("error","An error occurred: "+t);console.error("dropzone@err:",t)});if(t.successFunction)this.on("success",function(n,i){t.successFunction(n,i,t.data)});this.on("sending",function(n,t,i){i.append("__RequestVerificationToken",$("input[name=__RequestVerificationToken]").val())});if(i)this.on("complete",function(n){i&&this.removeFile(n)});if(t.removeFunc)this.on("removedfile",function(n){t.removeFunc(n,t.data)});this.on("sending",function(n,t,i){i.append("UploadIdentifier",n.upload&&n.upload.uuid)})},u=$.extend(t,{init:r,autoProcessQueue:!0,parallelUploads:1,clickable:t.triggerButton,maxFilesize:50,timeout:12e4,accept:function(n,t){n.size==0||n.name.toLowerCase().indexOf(".lnk")>=0?t("Empty/Unsupported file(s) will not be uploaded."):t()}}),f=new Dropzone(n,u);t.dropzoneHook&&t.dropzoneHook(f)}};ko.bindingHandlers.textfilter={init:function(n,t,i){var f=$("<br>").appendTo(n),r=$("<input>").css("width","100%").css("min-width","80px").addClass("no-report").appendTo(n),u=function(){t().Filters||(t().Filters=ko.observable({}));var n=t().Filters();n[i().fieldname]={value:$(r).val(),calculatedtext:i().calculatedtext||null,format:i().fieldformat||"string"};t().Filters(n);$(window).scroll()};$(r).on("blur",u);$(r).on("keyup",function(n){return u(),n.preventDefault(),!1})},update:function(n,t,i){var r=t();ko.unwrap(r);r&&r.Filters&&r.Filters()[i().fieldname]&&$("input",n).val(r.Filters()[i().fieldname].value||"")}};scriptletHandlers=scriptletHandlers||{};ko.bindingHandlers.scriptlet={init:function(n,t,i,r){r.ScriptletValidatorResults=r.ScriptletValidatorResults||ko.observable({});r.ScriptletsValid=ko.pureComputed(function(){var n=r.ScriptletValidatorResults();for(var t in n)if(n.hasOwnProperty(t)&&n[t]===!1)return!1;return!0})},update:function(n,t,i,r,u){var s=r.Attributes().Scriptlet,o,f,e;if(typeof s=="function")for(o=s().split(","),f=0;f<o.length;f++)e=o[f].trim(),e&&scriptletHandlers[e]&&scriptletHandlers[e](n,t,i,r,u)}};ko.components.register("select-list",{require:"components/select-list"});ko.components.register("text",{require:"components/text"});ko.components.register("link",{require:"components/link"});ko.components.register("form-row",{require:"components/form-row"});ko.components.register("ko-table",{require:"components/ko-table"});ko.components.register("table-search",{require:"components/table-search"});ko.components.register("date-picker",{require:"components/date-picker"});ko.components.register("pie-chart",{require:"components/pie-chart"});ko.components.register("range-table-header",{require:"components/range-table-header"});ko.components.register("address-widget",{require:"components/address-widget"});TableColumnDefintion=function(n){var t=this;if($.each(n,function(n,i){t[n]=i}),t.Type=n.Type===undefined||n.Type===null?"Text":n.Type,!$.isFunction(t.Type)&&TableColumnDefintion.Types[t.Type]===undefined)throw t.Type+" is an unrecognised type: type must be contained in the Column.Type object";if(t.PropertyName=n.PropertyName===undefined?null:n.PropertyName,t.ColumnName=n.ColumnName===undefined?t.PropertyName:n.ColumnName,t.DisplayFormat=n.DisplayFormat===undefined?null:n.DisplayFormat,t.Sortable=n.Sortable===undefined?!1:n.Sortable,t.Width=n.Width===undefined?"25%":n.Width,t.IsMultiSelect=n.IsMultiSelect===undefined?!1:n.IsMultiSelect,t.Visible=n.Visible===undefined?null:n.Visible,t.Currency=n.Currency===undefined?!1:n.Currency,t.HeaderTemplate=n.HeaderTemplate===undefined?null:n.HeaderTemplate,t.HeaderTemplateParams=n.HeaderTemplateParams===undefined?null:n.HeaderTemplateParams,t.Href=n.Href===undefined?null:n.Href,t.Hidden=t.Type==="Key"||t.Type==="Hidden"?!0:!1,t.HasTotal=n.HasTotal===undefined?null:n.HasTotal,t.TotalHeader=n.TotalHeader===undefined?null:n.TotalHeader,t.Filterable=n.Filterable,t.ColumnVisible=n.ColumnVisible,t.MaxLength=n.MaxLength===undefined?null:n.MaxLength,t.Style=n.Style===undefined?null:n.Style,t.Type==="Calculated")if(n.CalculatedFunction===undefined)throw"calculated function must be provided";else t.CalculatedFunction=n.CalculatedFunction;t.Type==="GenericActions"&&(t.Actions=n.Actions,$.each(t.Actions,function(n,t){t.Visible===undefined&&(t.Visible=function(){return!0})}))};TableColumnDefintion.Types={TextInput:"TextInput",Text:"Text",TextArea:"TextArea",Numeric:"Numeric",SelectList:"SelectList",Link:"Link",DocList:"DocList",Lookup:"Lookup",Slider:"Slider",Date:"Date",ActionLink:"ActionLink",GenericAction:"GenericAction",GenericActions:"GenericActions",Remove:"Remove",Manage:"Manage",Html:"Html",Calculated:"Calculated",ManageRemove:"ManageRemove",Hidden:"Hidden",Key:"Key"};$(document).ready(function(){/Edge\/\d./i.test(navigator.userAgent)&&(document.getElementById("footer").className+="edge-footer-padding-bottom")});$.ajaxSetup({cache:!1});var HttpStatusCodes={Unauthorized:401,Forbidden:403,NotFound:404},spinnerDepth=0,ShowHideLoadingSpinner=function(n){n?spinnerDepth++==0&&$('<div class="modal-backdrop loading-backdrop" style="opacity: 0.6; z-index: 9999"><div class="spinner"><\/div><\/div>').appendTo(document.body):--spinnerDepth<=0&&($(".modal-backdrop.loading-backdrop").remove(),spinnerDepth=0)},Toast=function(n,t,i){toastr.options={target:i||"body"};toastr[n](t)};$.ocfValidate=function(){};$.ocfValidate.handleFieldValidation=function(n,t,i,r,u){var f=$(n).val(),e=f!=""?i:!0;e&&f!=""?$(u).val(Number(f.replace(/,/g,""))):$(u).length>0&&$(u).val("");$(u).change();$.ocfValidate.markControlsValid($(n),t,e,r)};$.ocfValidate.markControlsValid=function(n,t,i){i?$(n).removeClass(t):$(n).addClass(t)};$.ocfValidate.parseNumericValue=function(n,t){if(n===undefined||n===null||n==="")return!0;var i=Number(n.replace(/,/g,"")),r=t!=undefined&&t.Min!=undefined?t.Min():-2147483648,u=t!=undefined&&t.Max!=undefined?t.Max():2147483647;return i>=r&&i<=u};$.ocfValidate.handleNumericRangeFieldValidation=function(n,t,i,r,u){var f,s,e,o,h,c;if(t=t||"parsley-error",f=[],$.each($("input[type=text].nr",$(n).parent()),function(){f.push(this)}),s=!0,e=!0,$.each(f,function(n,t){$(t).val()!=""&&($.ocfValidate.parseNumericValue($(t).val(),i)||(s=!1))}),s)$.ocfValidate.markControlsValid($(f),t,!0,r);else{$.ocfValidate.markControlsValid($(f),t,!1,r);$(u).val("");$(u).change();return}o=extractNumbersArray(f);o.length==2?e=validateNumbersArray(o):o.length==1&&(e=!1);e?(h=$("input[type=text].nr[data-number-range=from]",$(n).parent()).val().replace(/,/g,"")!=""?Number($("input[type=text].nr[data-number-range=from]",$(n).parent()).val().replace(/,/g,"")):"",c=$("input[type=text].nr[data-number-range=to]",$(n).parent()).val().replace(/,/g,"")!=""?Number($("input[type=text].nr[data-number-range=to]",$(n).parent()).val().replace(/,/g,"")):"",$(u).val(h+"~"+c)):($(u).length>0&&$(u).val(""),$.ocfValidate.markControlsValid(f,t,e,"Please enter a valid range"));$(u).change()};$.ocfValidate.isNumericInput=function(n){return isFinite(n)&&!isNaN(parseFloat(n))};$.FormatString=function(n,t,i){var r,u;if((n instanceof Function&&(n=n()),n===undefined||n===null)||(n=""+n,n===""||n.trim()===""))return"";r=0;switch(t){case"DateTime":return(u="DD/MM/YYYY",(i===""||i===undefined||i===null||i.trim()==="")&&(i=u),n.match(/^\d{1,2}\/\d{1,2}\/\d{2,4}$/))?moment(n,i).format(i):(n.indexOf("/Date(")===0&&(n=new Date(n.match(/-?\d+/)[0]*1)),moment(n).format(i));case"DateTimeFull":return n.match(/^\d{1,2}\/\d{1,2}\/\d{2,4}$/)?moment(n,"DD/MM/YYYY HH:mm").format("DD/MM/YYYY HH:mm"):(n.indexOf("/Date(")===0&&(n=new Date(n.match(/-?\d+/)[0]*1)),moment(n).format("DD/MM/YYYY HH:mm"));case"CanonicalDateTime":return n.match(/^\d{1,2}\/\d{1,2}\/\d{2,4}$/)?moment(n,"DD/MM/YYYY HH:mm").format("YYYY-MM-DD HH:mm"):(n.indexOf("/Date(")===0&&(n=new Date(n.match(/-?\d+/)[0]*1)),moment(n).format("YYYY-MM-DD HH:mm"));case"DecimalOrString":return(r=parseFloat(n),isNaN(r))?n:r.toFixed(2);case"Currency":return(r=parseFloat(n.replace(/[^0-9\.-]+/g,"")),isNaN(r))?"":"$"+r.toFixed(2);case"CurrencyCommas":return(r=parseFloat(n.replace(/[^0-9\.-]+/g,"")),isNaN(r))?"":r.toLocaleString("en-AU",{style:"currency",currency:"AUD"});case"Decimal2dp":return(r=parseFloat(n.replace(/[^0-9\.-]+/g,"")),isNaN(r))?"":r.toFixed(2);case"Percentage":return(r=parseFloat(n.replace(/[^0-9\.-]+/g,"")),isNaN(r))?"":""+r.toFixed(2)+"%";case"Time":return(r=parseInt(n.replace(/[^0-9-]+/g,"")),isNaN(r))?"":moment(new Date(2e3,1,1,0,0,r)).format("HH:mm");case"string":default:return n}};$.extend(!0,$.fn.datetimepicker.defaults,{icons:{time:"far fa-clock",date:"far fa-calendar",up:"fas fa-arrow-up",down:"fas fa-arrow-down",previous:"fas fa-chevron-left",next:"fas fa-chevron-right",today:"fas fa-calendar-check",clear:"far fa-trash-alt",close:"far fa-times-circle"}});Array.prototype.filter||(Array.prototype.filter=function(n,t){"use strict";if(!((typeof n=="Function"||typeof n=="function")&&this))throw new TypeError;var f=this.length>>>0,u=new Array(f),r=this,e=0,i=-1;if(t===undefined)while(++i!==f)i in this&&n(r[i],i,r)&&(u[e++]=r[i]);else while(++i!==f)i in this&&n.call(t,r[i],i,r)&&(u[e++]=r[i]);return u.length=e,u});Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(n){var i,u,f,t,r;if(this==null)throw TypeError('"this" is null or not defined');if(i=Object(this),u=i.length>>>0,typeof n!="function")throw TypeError("predicate must be a function");for(f=arguments[1],t=0;t<u;){if(r=i[t],n.call(f,r,t,i))return r;t++}return undefined},configurable:!0,writable:!0})