"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var a=0;a1&&(o=n[0],i=n[1]),(o=(o=(o=(o=(o=o.toUpperCase()).replace(/\s+/g," ")).replace(/(^\s)|(\s$)/,"")).replace(/(\d)([A-Z])/g,"$1 $2")).replace(/([A-Z])(\d)/g,"$1 $2")).match(/^Q ([1-4]) (\d\d\d\d)$/)&&(o="BET "+a[3*RegExp.$1-3]+" "+RegExp.$2+" AND "+a[3*RegExp.$1-1]+" "+RegExp.$2),o.match(/^(@#DHIJRI@|HIJRI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(o="@#DHIJRI@"+RegExp.$2+["MUHAR","SAFAR","RABIA","RABIT","JUMAA","JUMAT","RAJAB","SHAAB","RAMAD","SHAWW","DHUAQ","DHUAH"][parseInt(RegExp.$3,10)-1]+RegExp.$4),o.match(/^(@#DJALALI@|JALALI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(o="@#DJALALI@"+RegExp.$2+["FARVA","ORDIB","KHORD","TIR","MORDA","SHAHR","MEHR","ABAN","AZAR","DEY","BAHMA","ESFAN"][parseInt(RegExp.$3,10)-1]+RegExp.$4),o.match(/^(@#DHEBREW@|HEBREW)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(o="@#DHEBREW@"+RegExp.$2+["TSH","CSH","KSL","TVT","SHV","ADR","ADS","NSN","IYR","SVN","TMZ","AAV","ELL"][parseInt(RegExp.$3,10)-1]+RegExp.$4),o.match(/^(@#DFRENCH R@|FRENCH)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(o="@#DFRENCH R@"+RegExp.$2+["VEND","BRUM","FRIM","NIVO","PLUV","VENT","GERM","FLOR","PRAI","MESS","THER","FRUC","COMP"][parseInt(RegExp.$3,10)-1]+RegExp.$4),o=(o=(o=o.replaceAll(/(\d\d)(\d\d)(\d\d)(\d\d)/g,function(){return RegExp.$1>"12"&&RegExp.$3<="12"&&RegExp.$4<="31"?RegExp.$4+" "+a[RegExp.$3-1]+" "+RegExp.$1+RegExp.$2:RegExp.$1<="31"&&RegExp.$2<="12"&&RegExp.$3>"12"?RegExp.$1+" "+a[RegExp.$2-1]+" "+RegExp.$3+RegExp.$4:RegExp.$1+RegExp.$2+RegExp.$3+RegExp.$4})).replaceAll(/(\d+)([./-])(\d+)([./-])(\d+)/g,function(){var e=parseInt(RegExp.$1,10),o=parseInt(RegExp.$3,10),n=parseInt(RegExp.$5,10),i=(new Date).getFullYear(),r=i%100,l=i-r;return"DMY"===t&&e<=31&&o<=12||e>13&&e<=31&&o<=12&&n>31?e+" "+a[o-1]+" "+(n>=100?n:n<=r?n+l:n+l-100):"MDY"===t&&e<=12&&o<=31||o>13&&o<=31&&e<=12&&n>31?o+" "+a[e-1]+" "+(n>=100?n:n<=r?n+l:n+l-100):"YMD"===t&&o<=12&&n<=31||n>13&&n<=31&&o<=12&&e>31?n+" "+a[o-1]+" "+(e>=100?e:e<=r?e+l:e+l-100):RegExp.$1+RegExp.$2+RegExp.$3+RegExp.$4+RegExp.$5})).replace(/^[>]([\w ]+)$/,"AFT $1").replace(/^[<]([\w ]+)$/,"BEF $1").replace(/^([\w ]+)[-]$/,"FROM $1").replace(/^[-]([\w ]+)$/,"TO $1").replace(/^[~]([\w ]+)$/,"ABT $1").replace(/^[*]([\w ]+)$/,"EST $1").replace(/^[#]([\w ]+)$/,"CAL $1").replace(/^([\w ]+) ?- ?([\w ]+)$/,"BET $1 AND $2").replace(/^([\w ]+) ?~ ?([\w ]+)$/,"FROM $1 TO $2").replaceAll("JANUARY","JAN").replaceAll("FEBRUARY","FEB").replaceAll("MARCH","MAR").replaceAll("APRIL","APR").replaceAll("JUNE","JUN").replaceAll("JULY","JUL").replaceAll("AUGUST","AUG").replaceAll("SEPTEMBER","SEP").replaceAll("OCTOBER","OCT").replaceAll("NOVEMBER","NOV").replaceAll("DECEMBER","DEC").replaceAll(/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\.? (\d\d?)[, ]+(\d\d\d\d)/g,"$2 $1 $3").replaceAll(/(^| )(\d [A-Z]{3,5} \d{4})/g,"$10$2"),i&&(o=o+" ("+i),e.value!==o&&(e.value=o)};var n=[];n[1]="January",n[2]="February",n[3]="March",n[4]="April",n[5]="May",n[6]="June",n[7]="July",n[8]="August",n[9]="September",n[10]="October",n[11]="November",n[12]="December";var i=[];i[1]="JAN",i[2]="FEB",i[3]="MAR",i[4]="APR",i[5]="MAY",i[6]="JUN",i[7]="JUL",i[8]="AUG",i[9]="SEP",i[10]="OCT",i[11]="NOV",i[12]="DEC";var r=[];r[0]="S",r[1]="M",r[2]="T",r[3]="W",r[4]="T",r[5]="F",r[6]="S";var l=0;function s(e,t,a){var o,i,s='';for(s+='",s+='",s+='",s+='",s+="
',s+='',s+="",i=l,o=0;o<7;o++)s+="";var c=new Date(a.getFullYear(),a.getMonth(),1),d=c.getDay();d-=l;for(c=c.getTime()-864e5*d+432e5,c=new Date(c),i=0;i<6;i++){for(s+="",o=0;o<7;o++){s+="";var u=c.getTime()+864e5;c=new Date(u)}s+=""}return s+="
",++i>6&&(i=0);s+="
',s+=c.getDate(),s+="
",s+="
"}function c(e,t,a,o){return document.getElementById(e).value=(o<10?"0":"")+o+" "+i[a+1]+" "+t,!1}function d(e,t,a){var o=e.value.toUpperCase();(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.replace(/(^\s*)|(\s*$)/g,"")).replace(/ /g,":")).replace(/\+/g,"")).replace(/-/g,a)).replace(/,/g,".")).replace(/\u00b0/g,":")).replace(/\u0027/g,":")).replace(/^([0-9]+):([0-9]+):([0-9.]+)(.*)/g,function(e,t,a,o,n){var i=parseFloat(t);return i+=a/60,i+=o/3600,n+(i=Math.round(1e4*i)/1e4)})).replace(/^([0-9]+):([0-9]+)(.*)/g,function(e,t,a,o){var n=parseFloat(t);return n+=a/60,o+(n=Math.round(1e4*n)/1e4)})).replace(/(.*)(NSEW])$/g,"$2$1"))&&o.charAt(0)!==a&&o.charAt(0)!==t&&(o=t+o),e.value=o}e.calLocalize=function(e,t,a,o,i,s,c,d,u,p,h,g,f,v,m,b,x,E,$,w){n[1]=e,n[2]=t,n[3]=a,n[4]=o,n[5]=i,n[6]=s,n[7]=c,n[8]=d,n[9]=u,n[10]=p,n[11]=h,n[12]=g,r[0]=f,r[1]=v,r[2]=m,r[3]=b,r[4]=x,r[5]=E,r[6]=$,w>=0&&w<7&&(l=w)},e.calendarWidget=function(e,t){var a=document.getElementById(e),o=document.getElementById(t);if("visible"===a.style.visibility)return a.style.visibility="hidden",!1;if("show"===a.style.visibility)return a.style.visibility="hide",!1;var n;return n=/((\d+ (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) )?\d+)/i.exec(o.value)?new Date(RegExp.$1):new Date,a.innerHTML=s(t,e,n),"hidden"===a.style.visibility?(a.style.visibility="visible",!1):"hide"===a.style.visibility&&(a.style.visibility="show",!1)},e.calUpdateCalendar=function(e,t){var a=document.getElementById(e+"_daySelect");if(!a)return!1;var o=document.getElementById(e+"_monSelect");if(!o)return!1;var n=document.getElementById(e+"_yearInput");if(!n)return!1;var i=parseInt(o.options[o.selectedIndex].value,10);i-=1;var r=new Date(n.value,i,a.options[a.selectedIndex].value);c(e,r.getFullYear(),r.getMonth(),r.getDate());var l=document.getElementById(t);return l?(l.innerHTML=s(e,t,r),!1):(alert("no dateDiv "+t),!1)},e.calDateClicked=function(t,a,o,n,i){return c(t,o,n,i),e.calendarWidget(a,t),!1},e.persistentToggle=function(e){var t=document.getElementById(e),a="state-of-"+e;"true"===localStorage.getItem(a)&&t.click(),t.addEventListener("change",function(){localStorage.setItem(a,t.checked)})},e.reformatLatitude=function(e){return d(e,"N","S")},e.reformatLongitude=function(e){return d(e,"E","W")},e.autocomplete=function(e){$(e).each(function(){var e=this;$(this).typeahead(null,{display:"value",limit:0,source:new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:this.dataset.autocompleteUrl,replace:function(t,a){if(e.dataset.autocompleteExtra){var o=$(document.querySelector(e.dataset.autocompleteExtra)).val();return t.replace("QUERY",a)+"&extra="+encodeURIComponent(o)}return t.replace("QUERY",a)},wildcard:"QUERY"}})})})}}(window.webtrees=window.webtrees||{}),$.ajaxSetup({headers:{"X-CSRF-TOKEN":$("meta[name=csrf]").attr("content")}}),$(function(){$("[data-ajax-url]").each(function(){$(this).load($(this).data("ajaxUrl"))}),webtrees.autocomplete("input[data-autocomplete-url]");var e,t=document.documentElement.lang;$("select.select2").select2({language:{"zh-Hans":"zh-CN","zh-Hant":"zh-TW"}[t]||t,width:"100%",escapeMarkup:function(e){return e}}),$("select.select2:not([multiple])").on("select2:unselect",function(e){$(e.delegateTarget).html('')}),$.fn.dataTableExt.oSort["text-asc"]=function(e,t){return e.localeCompare(t,document.documentElement.lang,{sensitivity:"base"})},$.fn.dataTableExt.oSort["text-desc"]=function(e,t){return t.localeCompare(e,document.documentElement.lang,{sensitivity:"base"})},$("table.datatables").each(function(){$(this).DataTable(),$(this).removeClass("d-none")}),document.querySelectorAll("[data-toggle=button][data-persist]").forEach(function(e){"T"===localStorage.getItem("state-of-"+e.dataset.persist)&&e.click(),e.addEventListener("click",function(e){localStorage.setItem("state-of-"+e.target.dataset.persist,e.target.classList.contains("active")?"F":"T")})}),$(".wt-osk-trigger").click(function(){(e=document.getElementById($(this).data("id"))).focus(),$(".wt-osk").show()}),$(".wt-osk-script-button").change(function(){$(".wt-osk-script").prop("hidden",!0),$(".wt-osk-script-"+$(this).data("script")).prop("hidden",!1)}),$(".wt-osk-shift-button").click(function(){document.querySelector(".wt-osk-keys").classList.toggle("shifted")}),$(".wt-osk-keys").on("click",".wt-osk-key",function(){var t=$(this).contents().get(0).nodeValue,a=$(".wt-osk-shift-button").hasClass("active"),o=$("sup",this)[0];a&&void 0!==o&&(t=o.innerText),webtrees.pasteAtCursor(e,t),!1===$(".wt-osk-pin-button").hasClass("active")&&$(".wt-osk").hide()}),$(".wt-osk-close").on("click",function(){$(".wt-osk").hide()})}),document.addEventListener("click",function(e){var t=e.target.closest("a,button");if(null!==t)if("confirm"in t.dataset&&!confirm(t.dataset.confirm))e.preventDefault();else if("postUrl"in t.dataset){var a=document.querySelector("meta[name=csrf]").content;fetch(t.dataset.postUrl,{method:"POST",headers:{"X-CSRF-TOKEN":a,"X-Requested-with":"XMLHttpRequest"}}).then(function(){"reloadUrl"in t.dataset?document.location=t.dataset.reloadUrl:document.location.reload()}).catch(function(e){alert(e)})}});var GOOGLE_CHARTS_LIB="https://www.gstatic.com/charts/loader.js",Statistics=function(){function e(){return _classCallCheck(this,e),e.instance||(e.instance=this,this.callbacks=[],this.initialized=!1,this.loading=!1),e.instance}return _createClass(e,[{key:"init",value:function(e){if(!this.loading&&!this.initialized){var t=this;Promise.all([this.load(GOOGLE_CHARTS_LIB)]).then(function(){google.charts.load("current",{packages:["corechart","geochart","bar"],language:e,mapsApiKey:""}),google.charts.setOnLoadCallback(function(){t.callbacks.forEach(function(e){e()})}),t.initialized=!0}).catch(function(e){console.log(e)})}}},{key:"load",value:function(e){if(!this.loading)return this.loading=!0,new Promise(function(t,a){var o=document.createElement("script");o.async=!0,o.onload=function(){t(e)},o.onerror=function(){a(e)},o.src=e,document.body.appendChild(o)})}},{key:"addCallback",value:function(e){this.initialized?google.charts.setOnLoadCallback(e):this.callbacks.push(e),$(window).resize(function(){e()})}},{key:"drawChart",value:function(e,t,a,o){var n=google.visualization.arrayToDataTable(a);new google.visualization.ChartWrapper({chartType:t,dataTable:n,options:o,containerId:e}).draw()}},{key:"drawPieChart",value:function(e,t,a){a=Object.assign({title:"",height:"100%",width:"100%",pieStartAngle:0,pieSliceText:"none",pieSliceTextStyle:{color:"#777"},pieHole:.4,legend:{alignment:"center",labeledValueText:"value",position:"labeled"},chartArea:{left:0,top:"5%",height:"90%",width:"100%"},tooltip:{trigger:"none",text:"both"},backgroundColor:"transparent",colors:[]},a),this.drawChart(e,"PieChart",t,a)}},{key:"drawColumnChart",value:function(e,t,a){a=Object.assign({title:"",subtitle:"",titleTextStyle:{color:"#757575",fontName:"Roboto",fontSize:"16px",bold:!1,italic:!1},height:"100%",width:"100%",vAxis:{title:""},hAxis:{title:""},legend:{position:"none"},backgroundColor:"transparent"},a),this.drawChart(e,"ColumnChart",t,a)}},{key:"drawComboChart",value:function(e,t,a){a=Object.assign({title:"",subtitle:"",titleTextStyle:{color:"#757575",fontName:"Roboto",fontSize:"16px",bold:!1,italic:!1},height:"100%",width:"100%",vAxis:{title:""},hAxis:{title:""},legend:{position:"none"},seriesType:"bars",series:{2:{type:"line"}},colors:[],backgroundColor:"transparent"},a),this.drawChart(e,"ComboChart",t,a)}},{key:"drawGeoChart",value:function(e,t,a){a=Object.assign({title:"",subtitle:"",height:"100%",width:"100%"},a),this.drawChart(e,"GeoChart",t,a)}}]),e}(),statistics=new Statistics;function TreeViewHandler(e,t){var a,o,n,i=this;this.treeview=$("#"+e+"_in"),this.loadingImage=$("#"+e+"_loading"),this.toolbox=$("#tv_tools"),this.buttons=$(".tv_button:first",this.toolbox),this.zoom=100,this.boxWidth=180,this.boxExpandedWidth=250,this.cookieDays=3,this.ajaxDetails=document.getElementById(e+"_out").dataset.urlDetails+"&instance="+encodeURIComponent(e),this.ajaxPersons=document.getElementById(e+"_out").dataset.urlIndividuals+"&instance="+encodeURIComponent(e),this.container=this.treeview.parent(),this.auto_box_width=!1,this.updating=!1,"true"===readCookie("compact")&&i.compact(),n=!1,i.treeview.on("mousedown touchstart",function(e){e.preventDefault();var t="touchstart"===e.type?e.touches[0].pageX:e.pageX,r="touchstart"===e.type?e.touches[0].pageY:e.pageY;a=i.treeview.offset().left-t,o=i.treeview.offset().top-r,n=!0}),$(document).on("mousemove touchmove",function(e){if(n){e.preventDefault();var t="touchmove"===e.type?e.touches[0].pageX:e.pageX,r="touchmove"===e.type?e.touches[0].pageY:e.pageY;i.treeview.offset({left:t+a,top:r+o})}}),$(document).on("mouseup touchend",function(e){n&&(e.preventDefault(),n=!1,i.updateTree())}),i.toolbox.find("#tvbCompact").each(function(e,t){t.onclick=function(){i.compact()}}),i.toolbox.find("#tvbAllPartners").each(function(e,t){t.onclick=function(){createCookie("allPartners","true"===readCookie("allPartners")?"false":"true",i.cookieDays),document.location=document.location}}),i.toolbox.find("#tvbOpen").each(function(e,t){var a=$(t,i.toolbox);t.onclick=function(){a.addClass("tvPressed"),i.setLoading();var e=jQuery.Event("click");i.treeview.find(".tv_box:not(.boxExpanded)").each(function(t,a){var o=$(a,i.treeview).offset();o.left>=i.leftMin&&o.left<=i.leftMax&&o.top>=i.topMin&&o.top<=i.topMax&&i.expandBox(a,e)}),a.removeClass("tvPressed"),i.setComplete()}}),i.toolbox.find("#tvbClose").each(function(e,t){var a=$(t,i.toolbox);t.onclick=function(){a.addClass("tvPressed"),i.setLoading(),i.treeview.find(".tv_box.boxExpanded").each(function(e,t){$(t).css("display","none").removeClass("boxExpanded").parent().find(".tv_box.collapsedContent").css("display","block")}),a.removeClass("tvPressed"),i.setComplete()}}),i.centerOnRoot()}function createCookie(e,t,a){if(a){var o=new Date;o.setTime(o.getTime()+24*a*60*60*1e3),document.cookie=e+"="+t+"; expires="+o.toGMTString()+"; path=/"}else document.cookie=e+"="+t+"; path=/"}function readCookie(e){for(var t=e+"=",a=document.cookie.split(";"),o=0;o=a.leftMin&&i.left<=a.leftMax&&i.top>=a.topMin&&i.top<=a.topMax&&(o.push(t.attr("abbr")),n.push(t))}),o.length>0?(a.updating=!0,a.setLoading(),jQuery.ajax({url:a.ajaxPersons,dataType:"json",data:"q="+o.join(";"),success:function(e){for(var t=n.length,o=($(".rootPerson",this.treeview).offset().left,0);o