function CategoryInstructionsModel(e){var t=this;t.Name=e.dataName,t.Value=ko.observable(),t.isMatched=ko.observable(!0)}function convertToInstructionsArray(){const e=document.querySelectorAll(".CategoryInstruction");return Array.from(e).map((e=>{const t=e.querySelector("span[data-name]");return{dataName:t?t.getAttribute("data-name"):""}}))}async function fetchProductInstructions(e){try{const t=await fetch(`/instructions/product?SearchTerm=${e}`);if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return(await t.json()).map((e=>new ProductInstructionsModel(e["tbl_productsmanuals.ManualID"],e["tbl_productsmanuals.ProductCode"],e["tbl_productsmanuals.ManualPath"],e["tbl_productsmanuals.Caption"])))}catch(e){console.error("Fetching product instructions failed:",e)}}function instructionVideoPlay(e){var t=e.parentNode.parentNode.querySelector("[data-name]").getAttribute("data-name"),n=e.parentNode.parentNode.querySelector("select option:checked").innerText;console.log(t,n);var o=null;"Gala Shade Gazebo"==t?-1!==n.indexOf("Pro 40")?o="ewLizHL0H3M":-1!==n.indexOf("Pro 50")?o="W70VRt2UtFs":-1!==n.indexOf("Pro MX")?o="_A4Q7sd-VLM":-1!==n.indexOf("Pro DX")&&(o="w-COo1Hy5bI"):"Gala Tent Marquee"==t&&(-1!==n.indexOf("3m x 2m PE")?o="Mv-3-1McNfg":-1!==n.indexOf("3m x 2m PVC")?o="MpCdKUwBCXU":-1!==n.indexOf("3m x 3m PE")?o="Jrg0PUZtiS0":-1!==n.indexOf("3m x 3m PVC")?o="D-HpyYukyfg":-1!==n.indexOf("3m x 4m PE")?o="wtSiF0NttHA":-1!==n.indexOf("3m x 4m PVC")?o="KpySyzgVCwo":-1!==n.indexOf("3m x 6m PE")?o="0aCRoCtz-xU":-1!==n.indexOf("3m x 6m PVC")?o="vOrs2oQN7q0":-1!==n.indexOf("3m x 8m PE")?o="3fwxxvS4SsE":-1!==n.indexOf("3m x 8m PVC")?o="LHLFd-qbZY8":-1!==n.indexOf("3m x 10m PE")?o="BJsYMLrd_Us":-1!==n.indexOf("3m x 10m PVC")?o="KYNfI8BKo_I":-1!==n.indexOf("3m x 12m PE")?o="HLO8Qfga5tw":-1!==n.indexOf("3m x 12m PVC")?o="LdVgIMCh_Ns":-1!==n.indexOf("4m x 4m PE")?o="A7XATRyVX0U":-1!==n.indexOf("4m x 4m PVC")?o="9ZujSsYc7C8":-1!==n.indexOf("4m x 6m PE")?o="TPfTLzuVM0I":-1!==n.indexOf("4m x 6m PVC")?o="d1_TUKGQE-M":-1!==n.indexOf("4m x 8m PE")?o="IgvZXOPle9M":-1!==n.indexOf("4m x 8m PVC")?o="WxKaxX3O_c4":-1!==n.indexOf("4m x 10m PE")?o="JcXQ6LRZilY":-1!==n.indexOf("4m x 10m PVC")?o="EOldONA_11s":-1!==n.indexOf("4m x 12m PE")?o="KYl0V1tMA_I":-1!==n.indexOf("4m x 12m PVC")?o="63QXtrV7uno":-1!==n.indexOf("6m x 6m PE")?o="8qJWUsluqdc":-1!==n.indexOf("6m x 6m PVC")?o="0XKLDs7j8ow":-1!==n.indexOf("6m x 8m PE")?o="YD69VpQE-pM":-1!==n.indexOf("6m x 8m PVC")?o="NDjkfKWlCkI":-1!==n.indexOf("6m x 10m PE")?o="4vjBId33ijk":-1!==n.indexOf("6m x 10m PVC")?o="n0HsCqheDHs":-1!==n.indexOf("6m x 12m PE")?o="D8SYkhCr0Gs":-1!==n.indexOf("6m x 12m PVC")?o="ksTncQLt_OE":-1!==n.indexOf("6m x 14m PE")?o="C98swQJIb5Y":-1!==n.indexOf("6m x 14m PVC")?o="iuxBaGzcg4g":-1!==n.indexOf("6m x 16m PE")?o="LfZNSTay58g":-1!==n.indexOf("6m x 16m PVC")?o="yrO0CkogI-A":-1!==n.indexOf("6m x 18m PE")?o="n6JgCG8Ql08":-1!==n.indexOf("6m x 18m PVC")?o="UhEmdadR840":-1!==n.indexOf("6m x 20m PE")?o="lXDb6J6lHDI":-1!==n.indexOf("6m x 20m PVC")?o="mq0X9b2yu4M":-1!==n.indexOf("6m x 22m PE")?o="RKOL1jf4Gq4":-1!==n.indexOf("6m x 22m PVC")?o="auIgbPVgvLY":-1!==n.indexOf("6m x 24m PE")?o="F4urdvVbhi8":-1!==n.indexOf("6m x 24m PVC")&&(o="bOSNdDwwrBs")),o?showOverlay({URL:"/yt?vid="+o}):showAlert("icon-cancel-circled","Error","No video found","#FFFFFF",!1)}var Instructions;function InstructionsModel(){var e=this;e.Categories=[],e.ProductInstructions=ko.observableArray(),e.SearchText=ko.observable(),e.SearchText.subscribe((function(e){})),e.SearchFilter=function(){""==e.SearchText()&&e.Categories.forEach((e=>e.isMatched(!0))),e.Categories.forEach((t=>{const n=-1!==(t.Name||"").toLowerCase().indexOf(e.SearchText().toLowerCase());t.isMatched(n)}))},e.click_search=function(){fetchProductInstructions(e.SearchText()).then((t=>{e.ProductInstructions(t),e.SearchFilter()}))}}document.addEventListener("DOMContentLoaded",(function(){Instructions=new InstructionsModel;for(var e=convertToInstructionsArray(),t=[],n=0;n