"use strict";(self.webpackChunkfindagrave_frontend=self.webpackChunkfindagrave_frontend||[]).push([[4400,4784],{97997(t,e,a){var n=a(54802);a(71757)(()=>new n.A)},69917(t,e,a){a.d(e,{Ri:()=>i,TV:()=>n,kQ:()=>o});a(71757);function n(t,e,a,n){let i="",o=`path= ${n&&n.length>0?n:"/"};`,r=`domain=.${location.hostname.split(".").slice(-2).join(".")};`;if(a){let t=new Date;t.setTime(t.getTime()+24*a*60*60*1e3),i=`expires=${t.toUTCString()};`}document.cookie=`${t}=${e};${i}${o}${r}SameSite=Lax;Secure;`}function i(t){let e=document.cookie.split("; ").find(e=>e.split("=")[0]===t);return e?e.split("=")[1]:""}function o(){var t=i("consentSettings"),e={pref:!1,ga:!1,aa:!1};try{e=JSON.parse(t)}catch(t){}return e}},11045(t,e,a){a.d(e,{Aq:()=>o,Ue:()=>i});const n=["cemetery","city","county","state","country"];function i(t,e=!1){return(e?n.slice(1):n).map(e=>t[e]).filter(t=>t).join(", ")}function o(t){return t.slice(1).map(t=>t.name).join(", ")}},99376(t,e,a){a.d(e,{v:()=>n});a(71757);function n(t){return t&&["city","county","state","country"].map(e=>t[e]).filter(t=>t).join(", ")}},51009(t,e,a){function n(t,e){return t&&e&&(t=t.includes("?")?`${t}&size=${e}`:`${t}?size=${e}`),t}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(e,{N5:()=>i,nB:()=>n})},56533(t,e,a){a.d(e,{Ay:()=>c});var n=a(71757),i=a.n(n),o=(a(62427),a(29462)),r=a.n(o),s=a(39708),d=function(t,e,a,n){return new(a||(a=Promise))(function(i,o){function r(t){try{d(n.next(t))}catch(t){o(t)}}function s(t){try{d(n.throw(t))}catch(t){o(t)}}function d(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a(function(t){t(e)})).then(r,s)}d((n=n.apply(t,e||[])).next())})};const l=a(18510),h=a(53547);function c(){return{singleTypeahead:function(t){this.settings=i().extend({},this.defaults,t),this.changed=!1;const e=this,a=new TextEncoder;let n=new(r())({datumTokenizer:function(t){return r().tokenizers.whitespace(t.text)},queryTokenizer:r().tokenizers.whitespace,remote:{url:"/graphql/q=%prefix",wildcard:"%prefix",prepare:(t,e)=>(e.skipLoad=!/^\d+$/.test(t.trim())&&a.encode(t).length<3,e.name=t,e.url=e.url.replace("%prefix",t),e),transform:function(t){var a;return(null===(a=t.locationsByTypeahead)||void 0===a?void 0:a.locations.map(function(a){(a=Object.assign({},a)).text=["cemetery","city","county","state","country"].map(t=>a.locations[0][t]).filter(t=>t).join(", ").replace(/&/g,"&"),e.settings.displayId&&(a.text+=` (${a.id})`);const n=t.query.trim().split(/[\p{P}\s]+/u).filter(t=>t).map(t=>t.toLocaleLowerCase()),i=a.text.toLocaleLowerCase();return!n.every(t=>i.includes(t))&&a.highlight&&(a.text+=` (${a.highlight})`),a}))||[]},transport:(t,e,a)=>d(this,void 0,void 0,function*(){if(t.skipLoad)e([]);else{const{errors:n,data:i}=yield this.settings.apolloClient.query({query:s.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:t.name,autocomplete:this.settings.autocomplete,categories:this.settings.type,havingCoordinates:this.settings.havingCoordinates,returnHighlight:!0}},errorPolicy:"all"});n?a(n):e(Object.assign(Object.assign({},i),{query:t.name.toLocaleLowerCase()}))}})}});this.typeaheadEl=i()(this.settings.inputId),this.typeahead=this.typeaheadEl.typeahead(this.settings.displayOptions,{name:this.settings.inputId.replace(/[#.]/,""),source:n.ttAdapter(),displayKey:"text",limit:5,templates:{notFound:function({query:t}){return!/^\d+$/.test(t.trim())&&a.encode(t).length<3?h.render():l.render()}}});const o=``;return this.typeaheadEl.addClass("form-control").after(o).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(t,a){e.targetId.val(null==a?void 0:a.id).data("d",a),e.typeahead.trigger("typeahead:set",[a]),e.targetId.trigger("change"),e.topSuggestion=a,e.clearLocation.removeClass("hidden")}).on("typeahead:change",function(t){var n;e.settings.onChange.call(e,t),!e.targetId.val().trim()&&a.encode(e.typeahead.typeahead("val").trim()).length>=3&&(e.changed=!0,null===(n=e.settings.onEmpty)||void 0===n||n.call(e))}).on("typeahead:render",function(t,a){a&&a.length>0&&a[0]&&(e.topSuggestion=a[0])}),e.typeahead.typeahead("val")&&e.typeahead.typeahead("val").trim().length>0&&e.clearLocation.removeClass("hidden"),e.clearLocation.on("click",function(){e.typeahead.typeahead("val",""),e.typeahead.trigger("typeahead:clear"),e.typeahead.trigger("focus"),e.targetId.val("").removeData("d"),e.targetId.trigger("change"),e.topSuggestion=null,i()(this).addClass("hidden")}),e.typeaheadEl.on("keydown",function(t){var n;if(13==t.which||9==t.which){a.encode(e.typeahead.typeahead("val").trim()).length>=3?e.topSuggestion?(e.targetId.val(e.topSuggestion.id).data("d",e.topSuggestion),e.typeahead.typeahead("val",e.topSuggestion.text),e.typeahead.trigger("typeahead:set",[e.topSuggestion]),e.targetId.trigger("change"),e.clearLocation.removeClass("hidden")):t.preventDefault():e.typeahead.typeahead("val","")}else["arrowup","arrowdown","arrowleft","arrowright","end","home","pagedown","pageup","meta","control","alt"].includes(null===(n=t.key)||void 0===n?void 0:n.toLowerCase())||t.metaKey||t.ctrlKey||(e.topSuggestion=null);return i()(this).val().trim().length>0?e.clearLocation.removeClass("hidden"):e.clearLocation.addClass("hidden"),e.settings.enterSubmitsForm||13!=t.which}).on("click",function(t){e.topSuggestion&&e.typeahead.typeahead("val").trim().length>=3&&(e.targetId.val(e.topSuggestion.id).data("d",e.topSuggestion),e.typeahead.typeahead("val",e.topSuggestion.text),e.typeahead.trigger("typeahead:set",[e.topSuggestion]),e.targetId.trigger("change"),e.typeahead.typeahead("close"),e.clearLocation.removeClass("hidden"))}),e},defaults:{inputId:"#location",targetId:"#locationId",type:g,autocomplete:"location",enterSubmitsForm:!0,noContinents:!1,displayId:!1,displayOptions:{hint:!0,highlight:!0,minLength:1},onEmpty:!1,clearEmpty:!1,onChange:function(t){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 g=["loc"]}}]); //# sourceMappingURL=4784.ebfc657e10a89d7c1d0c.js.map