{"version":3,"file":"changeItemNumber.js","sources":["../../../src/assets/scripts/common/changeItemNumber.js"],"sourcesContent":["const query = new URLSearchParams(location.search)\nconst testmode = new URLSearchParams(location.search).get('testmode')\nif (testmode) {\n console.log('----- working on testmode -----')\n const itemIdentifier = query.get('item')\n const count = query.get('count')\n const items = document.querySelectorAll(itemIdentifier)\n if (count && count > items.length) {\n for (let i = 0; i < count - items.length; i++){\n const parent = items[0].parentNode\n parent.appendChild(items[0].cloneNode(true))\n }\n } else {\n items.forEach((item, index) => {\n index + 1 > count ? item.remove(): item\n })\n }\n}\n"],"names":["query","URLSearchParams","location","search","get","console","log","itemIdentifier","count","items","document","querySelectorAll","length","i","parentNode","appendChild","cloneNode","forEach","item","index","remove"],"mappings":"2FAAA,MAAMA,EAAQ,IAAIC,gBAAgBC,SAASC,QAE3C,GADiB,IAAIF,gBAAgBC,SAASC,QAAQC,IAAI,YAC5C,CACZC,QAAQC,IAAI,mCACZ,MAAMC,EAAkBP,EAAMI,IAAI,QAC5BI,EAAQR,EAAMI,IAAI,SAClBK,EAAQC,SAASC,iBAAiBJ,GACxC,GAAIC,GAASA,EAAQC,EAAMG,OACzB,IAAK,IAAIC,EAAI,EAAGA,EAAIL,EAAQC,EAAMG,OAAQC,IAAI,CAC7BJ,EAAM,GAAGK,WACjBC,YAAYN,EAAM,GAAGO,WAAU,GACvC,MAEDP,EAAMQ,SAAQ,CAACC,EAAMC,KACnBA,EAAQ,EAAIX,GAAQU,EAAKE,QAAc,GAG7C"}