Files
2026-04-28 15:13:50 +02:00

2 lines
11 KiB
JavaScript

import{e as O,d as h,G as b,b as V,a as U,a6 as G,j as H}from"./app-core.ae890a3f.js";import{C as R,i as j,u as F}from"./Map.d67f5d6f.js";import{u as N}from"./Widgets.e7888561.js";import{C as q}from"./Index.52399193.js";import{C as P}from"./Card.c7ceb11b.js";import{C as W}from"./SettingsRow.0c329e43.js";import{_ as Y,a as z}from"./DefaultStyle.1fe3c0af.js";import{C as Q,a as J}from"./Index.ccb02f37.js";import{_ as D}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as e,a as d}from"./vendor-other.7b559694.js";import{aq as p,f as i,Q as u,R as r,a0 as a,i as K,j as _,P as X,M as c,ae as B,U as M,v as l}from"./vendor-vue-ui.de3ab35f.js";import{S as Z}from"./Pencil.405b16d2.js";import{B as $,_ as ee}from"./Cta.8109c090.js";import{R as oe}from"./RequiredPlans.c6bcf6ea.js";import{C as se}from"./ProBadge.fd60f711.js";import{C as te}from"./Index.43bf246d.js";import{u as ie}from"./AddonConditions.d0b4b606.js";import"./vendor-lodash.8e35bd59.js";import"./Close.098d4b76.js";import"./Tooltip.ae7a1028.js";import"./Caret.a017b70a.js";import"./Trash.d35f8063.js";import"./Slide.e6618126.js";import"./Row.6337df55.js";import"./ImageUploader.fbfb8dc4.js";import"./Button.a549093d.js";import"./Img.218d4bc6.js";import"./Input.8918dec2.js";import"./Plus.d276bd63.js";import"./BoxToggle.cc3b8153.js";import"./CheckSolid.7f805a48.js";import"./Blur.5e231db6.js";const m="aioseo-pro",ae={components:{CoreAttributesList:J,CoreUiElementSlider:Q},props:{label:null,displayOptions:{type:Object,required:!0}},data(){return{strings:{shortcodeAttributesDescription:e("The following shortcode attributes can be used to override the default settings:",m),phpArgumentsDescription:e("The function accepts an associative array with the following arguments that can be used to override the default settings:",m),advancedSettings:e("Advanced Settings",m)},attributes:[{name:"location_id",description:e("A Location ID if Multiple Locations is on.",m)},{name:"show_label",description:e("Show or hide the label.",m)},{name:"show_icon",description:e("Show or hide the icon.",m)},{name:"width",description:e("The width of the map. You may use a percentage or a fixed width in pixels.",m)},{name:"height",description:e("The height of the map. You may use a percentage or a fixed height in pixels.",m)},{name:"label",description:e("The label.",m)}]}}};function ne(g,t,f,o,s,y){const S=p("core-attributes-list"),k=p("core-ui-element-slider");return i(),u(k,{label:f.label,options:f.displayOptions},{shortcodeAdvanced:r(()=>[a(S,{description:s.strings.shortcodeAttributesDescription,attributes:s.attributes},null,8,["description","attributes"])]),phpAdvanced:r(()=>[a(S,{description:s.strings.phpArgumentsDescription,attributes:s.attributes},null,8,["description","attributes"])]),_:1},8,["label","options"])}const re=D(ae,[["render",ne]]),n="aioseo-pro",le={setup(){const{strings:g}=N({name:"localMap"}),{getDataObject:t}=F();return{composableStrings:g,getDataObject:t,optionsStore:U(),rootStore:V()}},components:{CoreAlert:q,CoreCard:P,CoreMap:R,CoreSettingsRow:W,LocalBusinessMapCustomMarker:z,LocalBusinessMapDefaultStyle:Y,LocalBusinessMapDisplayInfo:re,SvgCircleClose:Z},data(){return{strings:{googleMapsApiKey:e("Google Maps API Key",n),description:d(e("Integrating with Google Maps will allow your users to find exactly where your business is located. Our interactive maps let them see your Google Reviews and get directions directly from your site. Create multiple maps for use with multiple locations. %1$s",n),h.getDocLink(b.learnMore,"localSeoMapSetup",!0)),apiKey:e("API Key",n),apiKeyDescription:d(e("A Google API Key is necessary to render your maps. %1$s",n),h.getDocLink(b.learnMore,"localSeoMapSetup",!0)),mapSettings:e("Map Settings",n),apiKeyInvalid:d(e("Your API Key is invalid. Please make sure you have set your key correctly. %1$s",n),h.getDocLink(b.learnMore,"localSeoMapSetup",!0)),placeSelected:d(e("For a more seamless experience with rich information cards, we recommend that you enable the Maps Embed API for your Google Maps API Key. %1$s",n),h.getDocLink(b.learnMore,"localSeoMapEmbedApi",!0)),displayMap:e("Display Map",n),mapPreview:e("Map Preview",n),mapPreviewEditMap:e("This is a preview. To edit your map go to",n),mapPreviewEditMapSecond:e("Business Info",n),mapPreviewEditMapMultipleLocations:d(e("This is a preview. With Multiple Locations you may %1$sedit a map inside each location.%2$s",n),`<a href="${this.rootStore.aioseo.localBusiness.postTypeEditLink}">`,"</a>")},displayInfo:{block:{copy:"",desc:d(e('To add this block, edit a page or post and search for the "%1$s Local - Map" block.',n),"AIOSEO")},shortcode:{copy:"[aioseo_local_map]",desc:d(e("Use the following shortcode to display the location map. %1$s",n),h.getDocLink(b.learnMore,"localSeoShortcodeMap",!0))},widget:{copy:"",desc:this.composableStrings.visitWidgetsPage},php:{copy:"<?php if( function_exists( 'aioseo_local_map' ) ) aioseo_local_map(); ?>",desc:d(e("Use the following PHP code anywhere in your theme to display the location map. %1$s",n),h.getDocLink(b.learnMore,"localSeoFunctionMap",!0))}},debouncedApiKey:null}},computed:{defaultMapOptions(){return{...this.optionsStore.options.localBusiness.maps.mapOptions,...this.rootStore.aioseo.localBusiness.mapDefaults}},currentMarker(){return{position:this.optionsStore.options.localBusiness.maps.mapOptions.center,icon:this.optionsStore.options.localBusiness.maps.customMarker}}},methods:{apiKeyFailed(){this.optionsStore.options.localBusiness.maps.apiKeyValid=!1},checkApiKey(){O(()=>{this.debouncedApiKey=this.optionsStore.options.localBusiness.maps.apiKey,this.optionsStore.options.localBusiness.maps.apiKeyValid=!0,this.optionsStore.options.localBusiness.maps.mapsEmbedApiEnabled=null,window.gm_authFailure=this.apiKeyFailed,this.checkMapEmbedApi()},1500)},checkMapEmbedApi(){j(this.optionsStore.options.localBusiness.maps.apiKey,"places/embed",G).then(g=>{this.optionsStore.options.localBusiness.maps.mapsEmbedApiEnabled=g})}},mounted(){this.optionsStore.options.localBusiness.maps.apiKey&&(this.debouncedApiKey=this.optionsStore.options.localBusiness.maps.apiKey,this.checkMapEmbedApi())}},pe={class:"aioseo-local-maps"},ce={class:"aioseo-settings-row"},ue=["innerHTML"],me={class:"append-icon"},de=["innerHTML"],_e={key:1},ye=["innerHTML"],he={key:1};function ge(g,t,f,o,s,y){const S=p("svg-circle-close"),k=p("base-input"),A=p("core-alert"),w=p("core-settings-row"),v=p("core-map"),C=p("router-link"),L=p("core-card"),x=p("local-business-map-display-info"),I=p("local-business-map-default-style"),E=p("local-business-map-custom-marker");return i(),K("div",pe,[a(L,{slug:"localBusinessMapsApiKey"},{header:r(()=>[_("span",null,M(s.strings.googleMapsApiKey),1)]),default:r(()=>[_("div",ce,[_("span",{innerHTML:s.strings.description},null,8,ue)]),a(w,{name:s.strings.apiKey,align:""},{content:r(()=>[a(k,{size:"medium",modelValue:o.optionsStore.options.localBusiness.maps.apiKey,"onUpdate:modelValue":[t[0]||(t[0]=T=>o.optionsStore.options.localBusiness.maps.apiKey=T),y.checkApiKey],class:X({"aioseo-error":o.optionsStore.options.localBusiness.maps.apiKey&&o.optionsStore.options.localBusiness.maps.apiKeyValid===!1}),spellcheck:!1},{"append-icon":r(()=>[_("div",me,[_("template",null,[o.optionsStore.options.localBusiness.maps.apiKey&&o.optionsStore.options.localBusiness.maps.apiKeyValid===!1?(i(),u(S,{key:0})):c("",!0)])])]),_:1},8,["modelValue","onUpdate:modelValue","class"]),_("div",{class:"aioseo-description",innerHTML:s.strings.apiKeyDescription},null,8,de),o.optionsStore.options.localBusiness.maps.apiKey&&o.optionsStore.options.localBusiness.maps.apiKeyValid===!1?(i(),u(A,{key:0,type:"red",innerHTML:s.strings.apiKeyInvalid},null,8,["innerHTML"])):c("",!0),o.optionsStore.options.localBusiness.maps.apiKey&&o.optionsStore.options.localBusiness.maps.apiKeyValid&&o.optionsStore.options.localBusiness.maps.mapsEmbedApiEnabled===!1?(i(),u(A,{key:1,type:"blue",innerHTML:s.strings.placeSelected},null,8,["innerHTML"])):c("",!0)]),_:1},8,["name"]),s.debouncedApiKey?(i(),u(w,{key:0,name:s.strings.mapPreview,align:"",class:"map-preview"},{content:r(()=>[_("div",null,[!o.optionsStore.options.localBusiness.maps.apiKeyValid||!o.optionsStore.options.localBusiness.maps.apiKey?(i(),u(v,{key:0,apiKey:s.debouncedApiKey,options:y.defaultMapOptions,placeId:o.optionsStore.options.localBusiness.maps.placeId,marker:y.currentMarker},null,8,["apiKey","options","placeId","marker"])):c("",!0),o.optionsStore.options.localBusiness.maps.apiKeyValid&&o.optionsStore.options.localBusiness.maps.apiKey?(i(),K("div",_e,[a(A,{type:"blue"},{default:r(()=>[o.optionsStore.options.localBusiness.locations.general.multiple?(i(),K("div",{key:0,innerHTML:s.strings.mapPreviewEditMapMultipleLocations},null,8,ye)):c("",!0),o.optionsStore.options.localBusiness.locations.general.multiple?c("",!0):(i(),K("div",he,[B(M(s.strings.mapPreviewEditMap)+" ",1),a(C,{to:{path:"/locations",state:{scroll:"aioseo-business-info-map"}}},{default:r(()=>[B(M(s.strings.mapPreviewEditMapSecond)+" → ",1)]),_:1})]))]),_:1}),a(v,{apiKey:o.optionsStore.options.localBusiness.maps.apiKey,options:o.getDataObject.mapOptions,placeId:o.getDataObject.placeId,marker:y.currentMarker,address:o.getDataObject.geocodeAddress,preventInteraction:!0},null,8,["apiKey","options","placeId","marker","address"])])):c("",!0)])]),_:1},8,["name"])):c("",!0)]),_:1}),o.optionsStore.options.localBusiness.maps.apiKey?(i(),u(L,{key:0,slug:"localBusinessMapsSettings"},{header:r(()=>[_("span",null,M(s.strings.mapSettings),1)]),default:r(()=>[a(x,{label:s.strings.displayMap,displayOptions:s.displayInfo},null,8,["label","displayOptions"]),a(I),a(E)]),_:1})):c("",!0)])}const fe=D(le,[["render",ge]]),Se={class:"aioseo-local-maps"},Me={__name:"Maps",setup(g){const t="all-in-one-seo-pack",f=H(),o=[e("Google Places Support",t),e("Google Reviews",t),e("Driving Directions",t),e("Multiple Locations",t)],s={googleMapsApiKey:e("Google Maps API Key",t),ctaButtonText:e("Unlock Local SEO",t),ctaHeader:d(e("Local SEO is a %1$s Feature",t),"PRO"),ctaDescription:e("Show your location to your visitors using an interactive Google Map. Create multiple maps for use with multiple locations.",t)};return(y,S)=>(i(),K("div",Se,[a(l(P),{slug:"localBusinessMapsApiKey",noSlide:!0},{header:r(()=>[_("span",null,M(s.googleMapsApiKey),1),a(l(se))]),default:r(()=>[a(l($)),a(l(te),{"cta-link":l(h).getPricingUrl("local-seo","local-seo-upsell","maps","liteUpgrade"),"button-text":s.ctaButtonText,"learn-more-link":l(h).getUpsellUrl("local-seo",null,"liteUpgrade"),"feature-list":o,"hide-bonus":!l(f).isUnlicensed},{"header-text":r(()=>[B(M(s.ctaHeader),1)]),description:r(()=>[a(l(oe),{addon:"aioseo-local-business"}),B(" "+M(s.ctaDescription),1)]),_:1},8,["cta-link","button-text","learn-more-link","hide-bonus"])]),_:1})]))}},be={class:"aioseo-maps"},eo={__name:"Maps",setup(g){const t="all-in-one-seo-pack",{shouldShowActivate:f,shouldShowLite:o,shouldShowMain:s,shouldShowUpdate:y}=ie({addonSlug:"aioseo-local-business"}),S={googleMapsApiKey:e("Google Maps API Key",t)};return(k,A)=>(i(),K("div",be,[l(s)?(i(),u(l(fe),{key:0})):c("",!0),l(y)||l(f)?(i(),u(l(ee),{key:1,"card-slug":"localBusinessMapsApiKey","header-text":S.googleMapsApiKey},null,8,["header-text"])):c("",!0),l(o)?(i(),u(l(Me),{key:2})):c("",!0)]))}};export{eo as default};