"use strict";(self.webpackChunkfindagrave_frontend=self.webpackChunkfindagrave_frontend||[]).push([[4336,4400],{8233(e,t,a){var o=a(54802),i=a(71757),n=a.n(i);var s=a(69917),r=a(71757);function l(e){var t;e||(e=null===(t=/page=(\d+)/.exec(window.location.href))||void 0===t?void 0:t[1]),r("#gotoPage").val(e||"1")}function d(e){if(e.length>0){const t=r(e),a=r(window),o=a.scrollTop(),i=o+a.height(),n=t.offset().top,s=n+t.height();return t.height()>a.height()?s<=i&&s>=o||n>=o&&n<=i:s<=i&&n>=o}return!1}function c(e){const t=r(window).scrollTop(),a=r(window).height(),o=r(e).offset().top,i=r(e).height();return o+i-.25*i>t&&o500&&(v=500),m>1&&u("#back-to-top").removeClass("d-none"),"click"==g?(u("#load-next-page").closest("div").removeClass("hidden"),u("#load-previous-page").closest("div").removeClass("hidden")):"scroll"==g&&u("#content-placeholder").find("div").removeClass("invisible"),t>0&&0===u(window).scrollTop()&&u(window).scrollTop(1),l(),function({rowSelector:e,itemSelector:t,focusSelectorNext:a,focusSelectorPrevious:o,loadNextFunction:i,loadPreviousFunction:n,type:r}){u(document).on("click",t,function(t){!function(e){const t=new URL(window.location.href),a=new URLSearchParams(k);let o=e.closest(".list-item-page").attr("data-url").replace("page=","");e.attr("id")&&(o+="#"+e.attr("id"));const i=e.offset().top-u(window).scrollTop();a.set("page",o),history.replaceState({distanceFromTopFold:i},null,`${t.pathname}?${a.toString().replace(/%23/g,"#")}`)}(u(this).closest(e))});let h=0;u(window).on("scroll",function(){var t;"scroll"==g&&f{L(r,a,f)})),"scroll"==g&&h>u(window).scrollTop()&&m>1&&!C&&d(`${e}:first`)&&(C=!0,u("#loadpreviousajaxloader").show(),m--,n(m,b(m),y).then(e=>{$(r,o,m)})),Math.abs(u(window).scrollTop()-x)>.1*u(window).height()&&("normal"==r?(t=e,x=u(window).scrollTop(),u(".list-item-page").each(function(e){if(c(this)){const e=new URL(window.location.href),a=new URLSearchParams(k);let o=u(this).attr("data-url").replace("page=",""),i=u(this).attr("data-url");u(this).find(t).each(function(t){if(d(u(this)))return u(this).attr("id")&&(o+="#"+u(this).attr("id")),u(this).attr("id")&&u(this).attr("id").length>3&&(/page=1$/.test(i)?u("#back-to-top").addClass("d-none"):u("#back-to-top").removeClass("d-none"),a.set("page",o),history.replaceState(null,null,`${e.pathname}?${a.toString().replace(/%23/g,"#")}`),l()),!1})}})):"suggestedEdits"==r&&function(e){x=u(window).scrollTop(),u(e).each(function(e){if(c(this)){const e=new URL(window.location.href),t=new URLSearchParams(k);let a=u(this).attr("data-url").replace("page=",""),o=u(this).attr("data-url");u(this).find("tr").each(function(i){if(d(u(this)))return u(this).attr("id")&&(a+="#"+u(this).attr("id")),u(this).attr("id")&&u(this).attr("id").length>3&&(/page=1$/.test(o)?u("#back-to-top").addClass("d-none"):u("#back-to-top").removeClass("d-none"),t.set("page",a),history.replaceState(null,null,`${e.pathname}?${t.toString().replace(/%23/g,"#")}`),l()),!1})}})}(e)),h=u(window).scrollTop()}),u(document).on("click","#load-next-page",function(e){e.preventDefault(),"click"==g&&(w=!0,u("#loadmoreajaxloader").show(),f++,i(f,b(f),y).then(e=>{L(r,a,f)}))}),u(document).on("click","#load-previous-page",function(e){e.preventDefault(),"click"==g&&(C=!0,u("#loadpreviousajaxloader").show(),m--,n(m,b(m),y).then(e=>{$(r,o,m)}))}),"click"==g?(u("#load-next-page").closest("div").removeClass("hidden"),u("#load-previous-page").closest("div").removeClass("hidden")):"scroll"==g&&u("#content-placeholder").find("div").removeClass("invisible");u(document).on("change","#scrollLists",function(e){if(e.preventDefault(),e.stopPropagation(),u("#scrollLists").is(":checked")){g="scroll",m>1&&u("#content-placeholder").find("div").removeClass("invisible"),u("#load-next-page").closest("div").addClass("hidden"),u("#load-previous-page").closest("div").addClass("hidden"),(0,s.kQ)().pref&&(0,s.TV)("pageLoadType","scroll",365)}else{g="click",u("#content-placeholder").find("div").addClass("invisible"),f1&&u("#load-previous-page").closest("div").removeClass("hidden"),(0,s.kQ)().pref&&(0,s.TV)("pageLoadType","click",365)}})}({itemSelector:n,rowSelector:i,focusSelectorNext:r,focusSelectorPrevious:h,loadNextFunction:p,loadPreviousFunction:S,type:e})}function b(e){return e*y-y}function L(e,t,a){f>=v&&u("#load-next-page").closest("div").addClass("hidden"),u("#loadmoreajaxloader").hide(),"normal"==e?u(t).trigger("focus"):"suggestedEdits"==e&&u(`tbody[data-page=${a}]`).next().find("a.fw-bold").trigger("focus"),w=!1}function $(e,t,a){if(m<=1&&(u("#content-placeholder").addClass("hidden"),u("#load-previous-page").closest("div").addClass("hidden")),u("#loadpreviousajaxloader").hide(),u(".list-item-page").addClass("in"),"normal"==e){const e=u("div.list-item-page:first").outerHeight();window.scrollTo({top:u(window).scrollTop()+e,left:0,behavior:"instant"}),u(t).trigger("focus")}else if("suggestedEdits"==e){const e=u(`tbody[data-page=${a}]`).first().offset().top,t=u(`tbody[data-page=${a+1}]`).first().offset().top-e;window.scrollTo({top:u(window).scrollTop()+t,left:0,behavior:"instant"}),u(`tbody[data-page=${a+1}]`).prev().find("a.fw-bold").trigger("focus")}C=!1}var T=a(71757),I=function(e,t,a,o){return new(a||(a=Promise))(function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function r(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,r)}l((o=o.apply(e,t||[])).next())})};const P=a(27907);function j(){T(".sponsored").html(findagrave.sponsored)}T(function(){new o.A;var e;n()(document).on("change","#condensedLists",function(e){if(e.preventDefault(),e.stopPropagation(),n()("#condensedLists").is(":checked")){n()(".memorial-item-pic").addClass("hidden"),n()(".condensed-hide").addClass("hidden"),n()(".condensed-show").removeClass("hidden"),n()(".paging-divide").addClass("condensed"),n()(".aka-text").addClass("condensed"),n()(".condensed-display").removeClass("offset-sm-4 offset-md-3 offset-xl-2 mt-sm-n4 ps-xl-4"),findagrave.currentView="condensed";let e=window.location.pathname,t="",a="currentView";switch(e){case!!/^\/virtual-cemetery\//.test(e)&&e:t="/virtual-cemetery/";break;case!!/^\/cemetery\/search/.test(e)&&e:t="/cemetery/search";break;case!!/^\/cemetery\//.test(e)&&e:t="/cemetery/",a="currentCemeteryView";break;case!!/^\/famous-memorial-date\//.test(e)&&e:t="/famous-memorial-date/";break;case!!/^\/posthumous-reunion\//.test(e)&&e:t="/posthumous-reunion/";break;case!!/^\/user\//.test(e)&&e:t="/user/"}(0,s.kQ)().pref&&(0,s.TV)(a,findagrave.currentView,365,t)}else{n()(".memorial-item-pic").removeClass("hidden"),n()(".condensed-hide").removeClass("hidden"),n()(".condensed-show").addClass("hidden"),n()(".paging-divide").removeClass("condensed"),n()(".aka-text").removeClass("condensed"),n()(".condensed-display").addClass("offset-sm-4 offset-md-3 offset-xl-2 mt-sm-n4 ps-xl-4"),findagrave.currentView="default";let e=window.location.pathname,t="",a="currentView";switch(e){case!!/^\/virtual-cemetery\//.test(e)&&e:t="/virtual-cemetery/";break;case!!/^\/cemetery\/search/.test(e)&&e:t="/cemetery/search";break;case!!/^\/cemetery\//.test(e)&&e:a="currentCemeteryView=",t="/cemetery/";break;case!!/^\/famous-memorial-date\//.test(e)&&e:t="/famous-memorial-date/";break;case!!/^\/posthumous-reunion\//.test(e)&&e:t="/posthumous-reunion/";break;case!!/^\/user\//.test(e)&&e:t="/user/"}(0,s.kQ)().pref&&(0,s.TV)(a,findagrave.currentView,365,t),n()(".memorial-item-pic img").each(function(e,t){!n()(this).attr("src")&&n()(this).attr("data-src")&&n()(this).attr("src",n()(this).attr("data-src"))})}}),S({totalRecords:findagrave.total,currentPage:findagrave.page||1,loadNextFunction:function(e,t,a){return I(this,void 0,void 0,function*(){let o=yield T.ajax({url:"/interesting-monument",data:{ajax:!0,skip:t,limit:a,df:T("#dateFilter").val(),ob:T("#ob").val()}});findagrave.skip=o.loadmore.next,o.page=e,o.currentView=findagrave.currentView||"default",o.userLocale=findagrave.locale,o.userLocation=findagrave.userLocation;const i=P.render(o);T(".memorial-list-data").append(i),j()})},loadPreviousFunction:function(e,t,a){return I(this,void 0,void 0,function*(){let o=yield T.ajax({url:"/interesting-monument",data:{ajax:!0,skip:t,limit:a,df:T("#dateFilter").val(),ob:T("#ob").val()}});findagrave.prev=o.loadmore.prev,o.page=e,o.currentView=findagrave.currentView||"default",o.userLocale=findagrave.locale,o.userLocation=findagrave.userLocation;const i=P.render(o);T(".memorial-list-data").prepend(i),j()})}}),e=".scroll-prad",n()(e).length&&n()(e).each(function(){const e=n()("#header-main").outerHeight()+(n()(".top-msg").outerHeight()||0)+10+(n()(".memorial-search").outerHeight()||0);n()(this).css("position","sticky").css("top",`${e}px`)}),j()})},69917(e,t,a){a.d(t,{Ri:()=>i,TV:()=>o,kQ:()=>n});a(71757);function o(e,t,a,o){let i="",n=`path= ${o&&o.length>0?o:"/"};`,s=`domain=.${location.hostname.split(".").slice(-2).join(".")};`;if(a){let e=new Date;e.setTime(e.getTime()+24*a*60*60*1e3),i=`expires=${e.toUTCString()};`}document.cookie=`${e}=${t};${i}${n}${s}SameSite=Lax;Secure;`}function i(e){let t=document.cookie.split("; ").find(t=>t.split("=")[0]===e);return t?t.split("=")[1]:""}function n(){var e=i("consentSettings"),t={pref:!1,ga:!1,aa:!1};try{t=JSON.parse(e)}catch(e){}return t}},11045(e,t,a){a.d(t,{Aq:()=>n,Ue:()=>i});const o=["cemetery","city","county","state","country"];function i(e,t=!1){return(t?o.slice(1):o).map(t=>e[t]).filter(e=>e).join(", ")}function n(e){return e.slice(1).map(e=>e.name).join(", ")}},99376(e,t,a){a.d(t,{v:()=>o});a(71757);function o(e){return e&&["city","county","state","country"].map(t=>e[t]).filter(e=>e).join(", ")}},51009(e,t,a){function o(e,t){return e&&t&&(e=e.includes("?")?`${e}&size=${t}`:`${e}?size=${t}`),e}function i(){return location.hostname.includes("localhost")||location.hostname.includes("gravelocal.com")?"https://images.gravedev.com":`https://images${location.hostname.substring(location.hostname.indexOf("."))}`}a.d(t,{N5:()=>i,nB:()=>o})},56533(e,t,a){a.d(t,{Ay:()=>h});var o=a(71757),i=a.n(o),n=(a(62427),a(29462)),s=a.n(n),r=a(39708),l=function(e,t,a,o){return new(a||(a=Promise))(function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function r(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,r)}l((o=o.apply(e,t||[])).next())})};const d=a(18510),c=a(53547);function h(){return{singleTypeahead:function(e){this.settings=i().extend({},this.defaults,e),this.changed=!1;const t=this,a=new TextEncoder;let o=new(s())({datumTokenizer:function(e){return s().tokenizers.whitespace(e.text)},queryTokenizer:s().tokenizers.whitespace,remote:{url:"/graphql/q=%prefix",wildcard:"%prefix",prepare:(e,t)=>(t.skipLoad=!/^\d+$/.test(e.trim())&&a.encode(e).length<3,t.name=e,t.url=t.url.replace("%prefix",e),t),transform:function(e){var a;return(null===(a=e.locationsByTypeahead)||void 0===a?void 0:a.locations.map(function(a){(a=Object.assign({},a)).text=["cemetery","city","county","state","country"].map(e=>a.locations[0][e]).filter(e=>e).join(", ").replace(/&/g,"&"),t.settings.displayId&&(a.text+=` (${a.id})`);const o=e.query.trim().split(/[\p{P}\s]+/u).filter(e=>e).map(e=>e.toLocaleLowerCase()),i=a.text.toLocaleLowerCase();return!o.every(e=>i.includes(e))&&a.highlight&&(a.text+=` (${a.highlight})`),a}))||[]},transport:(e,t,a)=>l(this,void 0,void 0,function*(){if(e.skipLoad)t([]);else{const{errors:o,data:i}=yield this.settings.apolloClient.query({query:r.J1` query locationTypeahead($search: LocationSearchInput) { locationsByTypeahead(search: $search) { total locations { ... on Location { id locations(format: short){ city county state country continent } names { name } coordinates { lat lon } highlight } ... on Cemetery { id locations(format: short){ cemetery city county state country continent } names { name } coordinates { lat lon } highlight } } } } `,variables:{search:{name:e.name,autocomplete:this.settings.autocomplete,categories:this.settings.type,havingCoordinates:this.settings.havingCoordinates,returnHighlight:!0}},errorPolicy:"all"});o?a(o):t(Object.assign(Object.assign({},i),{query:e.name.toLocaleLowerCase()}))}})}});this.typeaheadEl=i()(this.settings.inputId),this.typeahead=this.typeaheadEl.typeahead(this.settings.displayOptions,{name:this.settings.inputId.replace(/[#.]/,""),source:o.ttAdapter(),displayKey:"text",limit:5,templates:{notFound:function({query:e}){return!/^\d+$/.test(e.trim())&&a.encode(e).length<3?c.render():d.render()}}});const n=``;return this.typeaheadEl.addClass("form-control").after(n).parent().addClass("form-floating"),this.clearLocation=this.typeaheadEl.parents(".btn-group, .input-group").find(".clear-search"),this.targetId=i()(this.settings.targetId),this.typeahead.on("typeahead:autocomplete typeahead:select",function(e,a){t.targetId.val(null==a?void 0:a.id).data("d",a),t.typeahead.trigger("typeahead:set",[a]),t.targetId.trigger("change"),t.topSuggestion=a,t.clearLocation.removeClass("hidden")}).on("typeahead:change",function(e){var o;t.settings.onChange.call(t,e),!t.targetId.val().trim()&&a.encode(t.typeahead.typeahead("val").trim()).length>=3&&(t.changed=!0,null===(o=t.settings.onEmpty)||void 0===o||o.call(t))}).on("typeahead:render",function(e,a){a&&a.length>0&&a[0]&&(t.topSuggestion=a[0])}),t.typeahead.typeahead("val")&&t.typeahead.typeahead("val").trim().length>0&&t.clearLocation.removeClass("hidden"),t.clearLocation.on("click",function(){t.typeahead.typeahead("val",""),t.typeahead.trigger("typeahead:clear"),t.typeahead.trigger("focus"),t.targetId.val("").removeData("d"),t.targetId.trigger("change"),t.topSuggestion=null,i()(this).addClass("hidden")}),t.typeaheadEl.on("keydown",function(e){var o;if(13==e.which||9==e.which){a.encode(t.typeahead.typeahead("val").trim()).length>=3?t.topSuggestion?(t.targetId.val(t.topSuggestion.id).data("d",t.topSuggestion),t.typeahead.typeahead("val",t.topSuggestion.text),t.typeahead.trigger("typeahead:set",[t.topSuggestion]),t.targetId.trigger("change"),t.clearLocation.removeClass("hidden")):e.preventDefault():t.typeahead.typeahead("val","")}else["arrowup","arrowdown","arrowleft","arrowright","end","home","pagedown","pageup","meta","control","alt"].includes(null===(o=e.key)||void 0===o?void 0:o.toLowerCase())||e.metaKey||e.ctrlKey||(t.topSuggestion=null);return i()(this).val().trim().length>0?t.clearLocation.removeClass("hidden"):t.clearLocation.addClass("hidden"),t.settings.enterSubmitsForm||13!=e.which}).on("click",function(e){t.topSuggestion&&t.typeahead.typeahead("val").trim().length>=3&&(t.targetId.val(t.topSuggestion.id).data("d",t.topSuggestion),t.typeahead.typeahead("val",t.topSuggestion.text),t.typeahead.trigger("typeahead:set",[t.topSuggestion]),t.targetId.trigger("change"),t.typeahead.typeahead("close"),t.clearLocation.removeClass("hidden"))}),t},defaults:{inputId:"#location",targetId:"#locationId",type:p,autocomplete:"location",enterSubmitsForm:!0,noContinents:!1,displayId:!1,displayOptions:{hint:!0,highlight:!0,minLength:1},onEmpty:!1,clearEmpty:!1,onChange:function(e){this.typeahead.typeahead("val").trim().length>=3?(this.topSuggestion?(this.targetId.val(this.topSuggestion.id).data("d",this.topSuggestion),this.typeahead.trigger("typeahead:set",[this.topSuggestion]),this.targetId.trigger("change"),this.typeahead.typeahead("val",this.topSuggestion.text),this.typeahead.typeahead("close")):this.targetId.val("").removeData("d"),this.clearLocation.removeClass("hidden")):(this.targetId.val("").removeData("d"),this.typeahead.trigger("typeahead:clear"),this.targetId.trigger("change"),this.clearLocation.addClass("hidden"))}}}}const p=["loc"]}}]); //# sourceMappingURL=4336.a41df22005350c58547f.js.map