import getWcAttributesFromUrl from "./getWcAttributesFromUrl";
const getWcCodeFromUrl = urlString => {
  const {
    center,
    zoom,
    elements,
    language,
    activeTopicKey,
    embedded,
    layersVisibility,
    lineName
  } = getWcAttributesFromUrl(urlString);
  const code = ["<!--Please contact sbb_map@geops.ch for your own API key-->", "\n      <trafimage-maps", "\n\tapiKey=\"".concat(window.apiKey, "\"")];
  if (activeTopicKey) {
    code.push("\n\tactiveTopicKey=\"".concat(activeTopicKey, "\""));
  }
  if (center) {
    code.push("\n\tcenter=\"".concat(center, "\""));
  }
  if (zoom) {
    code.push("\n\tzoom=\"".concat(zoom, "\""));
  }
  if (language) {
    code.push("\n\tlanguage=\"".concat(language, "\""));
  }
  if (elements) {
    code.push("\n\telements=\"".concat(elements, "\""));
  } else {
    code.push("\n\telements=\"permalink=false\"");
  }
  if (layersVisibility) {
    code.push("\n\tlayersVisibility=\"".concat(layersVisibility, "\""));
  }
  if (embedded) {
    code.push("\n\tembedded=\"".concat(embedded, "\""));
  }
  if (lineName) {
    code.push("\n\tlineName=\"".concat(lineName, "\""));
  }
  code.push("/>");
  return code.join("");
};
export default getWcCodeFromUrl;
//# sourceMappingURL=getWcCodeFromUrl.js.map