{"version":3,"sources":["/assets/app/actions/public/preload-after-paint.ts"],"names":["preloads","insertBatch","batch","index"],"mappings":"AACA,MAAMA,EAAW,SAAS,eAAe,yBAAyB,CAClE,GAAIA,aAAoB,oBAAqB,CAC3C,IAAMC,MAAoB,CACxB,GAAI,CAACD,EAAS,YAAa,OAC3B,IAAME,EAAQ,SAAS,wBAAwB,CAC/C,IAAK,IAAIC,EAAQ,EAAGA,EAAQ,GAAKH,EAAS,QAAQ,WAAY,IAC5DE,EAAM,YAAYF,EAAS,QAAQ,WAAW,CAEhDA,EAAS,OAAOE,EAAM,CAGlBF,EAAS,QAAQ,WAAY,WAAWC,EAAa,EAAE,CACtDD,EAAS,QAAQ,EAExB,0BAA4B,CAC1B,sBAAsBC,EAAY,EAClC","sourcesContent":["// Speculative imports should not compete with the first visible server-rendered page.\nconst preloads = document.getElementById(\"client-module-preloads\");\nif (preloads instanceof HTMLTemplateElement) {\n  const insertBatch = () => {\n    if (!preloads.isConnected) return;\n    const batch = document.createDocumentFragment();\n    for (let index = 0; index < 4 && preloads.content.firstChild; index++) {\n      batch.appendChild(preloads.content.firstChild);\n    }\n    preloads.before(batch);\n    // Inserting the whole graph starts module processing in one long task, even\n    // with low fetch priority. Let input and rendering run between small batches.\n    if (preloads.content.firstChild) setTimeout(insertBatch, 0);\n    else preloads.remove();\n  };\n  requestAnimationFrame(() => {\n    requestAnimationFrame(insertBatch);\n  });\n}\n"]}