{"version":3,"sources":["jsdelivr-header.js","/gh/willmyethewebsiteguy/splitNav@1.0.4/SplitNav.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,CCFC,YAiCC,WACE,IAAI,EAAa,SAAS,cAAc,qBACxC,IAAK,EAAY,OACjB,SAAS,KAAK,QAAQ,EACxB,CApCA,GAEA,IAAI,EAAS,SAAS,cAAc,WAChC,EAAU,EAAO,cAAc,4CAC/B,EAAe,OAAO,iBAAiB,GACvC,EAAoB,EAAa,iBAAiB,qBAClD,EAAgB,EAAQ,iBAAiB,4BAA4B,EAAQ,SAAS,OAAS,SAAS,GAAqB,MAC7H,EAAqB,EAAO,cAAc,0BAG9C,EAAO,UAAU,IAAI,gBAGrB,IAAI,EAAS,2JACb,EAAmB,mBAAmB,aAAc,GACpD,EAAS,EAAmB,cAAc,2BAC1C,EAAc,SAAQ,GAAQ,EAAO,OAAO,KAG5C,IAAI,EAAa,SAAS,EAAa,iBAAiB,uBACpD,GAAa,IAAM,GAAc,EACjC,EAAgB,IAAM,EACtB,EAAkB,WAAW,EAAa,GAAe,QAAQ,GACjE,EAAgB,WAAW,EAAY,GAAe,QAAQ,GAElE,EAAO,MAAM,YAAY,cAAe,GAAG,MAC3C,EAAO,MAAM,YAAY,kBAAmB,GAAG,MAC/C,EAAO,MAAM,YAAY,oBAA0C,IAAlB,EAAH,KAC9C,EAAO,MAAM,YAAY,kBAAsC,IAAhB,EAAH,IAuC9C,CApEA","file":"/gh/willmyethewebsiteguy/splitNav@1.0.4/SplitNav.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /gh/willmyethewebsiteguy/splitNav@1.0.4/SplitNav.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/* ==========\n * Split Navigation for Squarespace\n * This Code is licensed by Will-Myers.com \n========== */\n(function(){ \n  moveStylesheet()\n\n  let header = document.querySelector('#header'),\n      navList = header.querySelector('.header-display-desktop .header-nav-list'),\n      headerStyles = window.getComputedStyle(header),\n      rightNavLinkCount = headerStyles.getPropertyValue('--right-nav-links'),\n      rightNavLinks = navList.querySelectorAll(`:scope > *:nth-of-type(n+${navList.children.length - parseInt(rightNavLinkCount) + 1})`),\n      headerActionsRight = header.querySelector('.header-actions--right');\n\n  //Add Unique Targeting Class\n  header.classList.add('wm-split-nav')\n  \n  //Add New Nav\n  let newNav = `<div class=\"header-nav\"><div class=\"header-nav-wrapper header-nav-wrapper--right\"><nav class=\"header-nav-list header-nav-list--right\"></nav></div></div>`;\n  headerActionsRight.insertAdjacentHTML('afterbegin', newNav);\n  newNav = headerActionsRight.querySelector('.header-nav-list--right');\n  rightNavLinks.forEach(link => newNav.append(link));\n  \n  //Calculating widths\n  let titleWidth = parseInt(headerStyles.getPropertyValue('--site-title-width')),\n      sideWidth = (100 - titleWidth) / 2,\n      titleNavWidth = 100 - sideWidth,\n      innerTitleWidth = parseFloat(titleWidth / titleNavWidth).toFixed(2),\n      innerNavWidth = parseFloat(sideWidth / titleNavWidth).toFixed(2);\n  \n  header.style.setProperty('--sideWidth', `${sideWidth}%`)\n  header.style.setProperty('--titleNavWidth', `${titleNavWidth}%`)\n  header.style.setProperty('--innerTitleWidth', `${innerTitleWidth * 100}%`)\n  header.style.setProperty('--innerNavWidth', `${innerNavWidth * 100}%`)\n  \n  \n  //Move Stylesheet\n  function moveStylesheet() {\n    let stylesheet = document.querySelector('#wm-split-nav-css');\n    if (!stylesheet) return;\n    document.head.prepend(stylesheet);\n  }\n\n\n  /*\n  * Check If Flex Gap Is Supported\n  * Delete by Jan 2023 if no issues have popped up with this\n  **/\n  function checkFlexGap() {\n    // create flex container with row-gap set\n    var flex = document.createElement(\"div\");\n    flex.style.display = \"flex\";\n    flex.style.flexDirection = \"column\";\n    flex.style.rowGap = \"1px\";\n\n    // create two, elements inside it\n    flex.appendChild(document.createElement(\"div\"));\n    flex.appendChild(document.createElement(\"div\"));\n\n    // append to the DOM (needed to obtain scrollHeight)\n    document.body.appendChild(flex);\n    var isSupported = flex.scrollHeight === 1; // flex container should be 1px high from the row-gap\n    flex.parentNode.removeChild(flex);\n\n    return isSupported;\n  }\n  if(checkFlexGap){\n    //console.log('flex gap supported!')\n  } else {\n    //console.log('flex gap not supported :(')\n  }\n  \n}());\n"]}